

New language that let's you add syntax as if defining a function [video] - sanity31415
https://vimeo.com/130697349

======
sklogic
Term rewriting, I guess? Then it's not that different from what Maude is
doing, for example.

~~~
sanity31415
Thanks for the reference to Maude, I wasn't aware of it.

Certainly there is similarity to Maude, in that both Maude and LastCalc are
programmed through term rewriting. However in other respects they are very
different, both in purpose and implementation.

Maude looks to be an academic research language. LastCalc is designed to be
used by anyone, and can be used as a teaching language. I've used it to teach
my girlfriend, who had no prior programming experience, how to write simple
recursive methods.

The biggest algorithmic difference with Maude is that LastCalc has a
backtracking parse engine.

Here is an example of how this works:

    
    
      x=12 pounds
      x in usd (result: US$19.9522)
      x in kg (result: 5.4431 kilograms)
    

Note how the interpretation of x is different depending on what makes sense
within the wider context. To the best of my knowledge this is fairly unique
(I'm sure Google Calculator does something similar, but it's not user-
extensible).

~~~
sklogic
Yes, it's certainly a cool feature and I cannot think of a language already
doing this. Must be very useful for interactive DSLs.

