Re: libseed-list custom syntax for JSC?



Carlos Zuniga wrote:
On Tue, Jun 1, 2010 at 3:52 AM, Jonatan Liljedahl <lijon kymatica com> wrote:
Hi everyone,

this is not actually a question about seed, but since you're familiar with
JSC's workings you might be able to answer it...

how tightly couples is the syntax parser with the code generation? would it
be possible to pass it a custom syntax tree generated with a custom parser?
i'm looking into the possibilities to make my own language based on
javascript but with some syntactic sugar and less typing.. :)

one way would of course be to make a wrapper that outputs valid javascript
code, but that wouldn't be as clean and nice as if it would be possible to
use the backend directly.

any thoughts on this?


Sounds kinda like coffe script, have you checked that out?
http://jashkenas.github.com/coffee-script/

Cool! Having a parser generator written in JS that outputs a parser in JS for a compiler that outputs JS is a very nice idea :)

I didn't like the coffee script syntax very much though, especially the python-style handling of whitespace. But the way to define functions was nice! What I'm looking for is more like standard JS but with syntactic sugar, like:
	var foo = (x) { x*x+123 };
instead of
	var foo = function(x) { return x*x+123; }
and some array stuff like maybe (0..9).do (x) { print x };

I found another parser generator which I managed to modify and got it to work with seed: http://jscc.jmksf.com/

/Jonatan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]