More on Plastic

I’ve added some more features to my toy language “Plastic”. Partial application of function arguments. This is now used for generators. Yield is no longer a core function, instead, each generator takes a closure as its last argument which is then supplied by the foreach function. This way the foreach body don’t have to be stored…More

Plastic – Added generator support

I’ve added generator support to my toy language “Plastic”. It’s quite funny how easy it is to implement some language features once you understand how they work behind the scenes. At first, I thought generators would be extremely hard to implement, requiring AST transformations to build state machines a’la C# for enumerable methods. But my java…More

Playing with Plastic

As some of you might know, I’ve been fiddling with a generic DSL grammar, here and here. I figured that I should do some proof of concept on this and started to write a language using the grammar and parser. Since I’ve already created a LISP clone earlier, I thought I should go with something…More