Can APL be implemented in Scala as a DSL?

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

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

+4
source share
2 answers

Maybe someone can give a better answer, but this is my initial thought:

  • A Scala DSL should theoretically be able to implement any programming language, because it can create an arbitrary structure representing the syntax, and then evaluate it.

  • A Scala DSL was not able to accurately reproduce the APL syntax for many reasons, one of which is

    'single quotes'

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

ร—/2 3 4 

Invalid Scala.

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

+5
source

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

+1
source

All Articles