3 ms·
Well my pet language Ivy http://sourceforge.net/projects/ivy-lang/ http://sourceforge.net/projects/ivy-lang/ allows you to define new statements via delayed eva
by jhallenworld 13y ago
Well my pet language Ivy http://sourceforge.net/projects/ivy-lang/ http://sourceforge.net/projects/ivy-lang/ allows you to define new statements via delayed evaluation tricks (but without actual quoting):
fn myfor(&init, &test, &incr, &body)
*init
while *test
*body
*incr
var a
myfor a=0, a!=10, ++a
print a
& creates a zero-argument lambda function out of the argument. * is sugar to call a zero-argument function.
Also:
fn set(&x y)
*x = y
set a 7 # Set variable a to 7
It works because when variables are evaluated, the result includes both the value and the address from which it originated.
Anyway, creating a language is one thing. Creating a fast compiler for it is quite another. It's impressive how well v8 works for the dynamic language javascript, but the amount of work embedded in it is daunting. On my list of future projects is to try to make a simple SSA-based optimizer.
- mattgreenrocks 13y agoThat's really awesome!