Question

There is a old computer language called APL. Could this be implemented in Scala as a DSL?

http://en.wikipedia.org/wiki/APL_%28programming_language%29

Was it helpful?

Solution

Someone could probably give a better answer than this, but this is my initial thought:

  1. A Scala DSL should in theory be able to implement any programming language because it could build up an arbitrary structure representing the syntax, and then evaluate that.

  2. A Scala DSL could not exactly replicate APL syntax for many reasons, one of which is that

    'single quotes'

can denote a string in APL, but not in Scala. Also (from the wikipedia page)

×/2 3 4

wouldn't be valid Scala.

I don't know how close you could get, though...

OTHER TIPS

A Javascript implementation exists here: https://github.com/ngn/apl

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top