News for hackers. Stuff that matters.
Re:Show HN: a lexer, parser, interpreter and web runtime (np... by Udo on Sunday March 17, 2013 @05:38PM (#5391173)
I made this primarily because I wanted to learn more about writing an interpreter and I also wanted to experiment a little with the decisions that go into language design - so it turned out not like a "normal" C-like, but hopefully still recognizable. To my surprise, making decisions about how scope should work was actually the hardest part.

I can only recommend that every hacker does this at least once in their lifetime, it's been a real eye-opener for me in respect to problems I don't usually think too much about.

That said, feedback or questions are very welcome :)

Re:Show HN: a lexer, parser, interpreter and web runtime (np... by gngeal on Sunday March 17, 2013 @07:45PM (#5391620)
"To my surprise, making decisions about how scope should work was actually the hardest part."

Perhaps a thorough reading of SICP would enlighten you as to how scope should be handled if you don't want to run into problems with it.

Re:Show HN: a lexer, parser, interpreter and web runtime (np... by Udo on Sunday March 17, 2013 @07:48PM (#5391631)
I know SICP, it's great. However, arguments from authority only get one so far. I think it's definitely worth experimenting with different paradigms. And I'm not done yet. However, there is something to be said for not taking "the standard way of doing things" at face value all the time, even if that means arriving at the exact same solution in the end. To my defense though, different languages behave in different ways in this respect, so at least I'm not violating the entire collective wisdom of computing (just a part of it).
Re:Show HN: a lexer, parser, interpreter and web runtime (np... by fabriceleal on Monday March 18, 2013 @09:57AM (#5394152)
> I can only recommend that every hacker does this at least once in their lifetime

I've been doing this for a while now and I love interpreter implementation.

The way I got started with this was through http://nathansuniversity.com/, which teaches you how to implement interpreted languages using Javascript (it uses http://pegjs.majda.cz/ for generating the parser). From that I already played in C (lex/yacc for the lexer/parser), C# (irony - http://irony.codeplex.com) and currently I'm enjoying F# (flex/fyacc).

I already made a simple programming language from scratch (https://github.com/fabriceleal/Multitasks.git) and I'm currently implementing a subset of scheme (https://github.com/fabriceleal/Pang.git), which I have great proud to announce that has a working call-cc.

I'm only hoping to have some time to polish them before "officially" showing them in HN or reddit.