24 ms·
interesting advice to get hands dirty with source code directly. I might think to experiment a bit with C/lexx/yacc then. one thing, I am curious about, what a
by poseid 12y ago
interesting advice to get hands dirty with source code directly. I might think to experiment a bit with C/lexx/yacc then.
one thing, I am curious about, what are the kind of "hello_world()" functions, that would print something on a screen... hmm..
- chton 12y agoGetting in on the ground floor tends to be my advice for a lot things. It's hard to make something click if you can't see it work in the flesh. For the typical functions that print output or take input or the likes, I'm always partial to keeping them separate from the grammar itself. You can see the distinction clearly between for example Python: print myVar and Java: System.out.println(myVar); In Python, the print verb is defined in the grammar, and as such needs to be parsed and handled properly. In Java's case, it's regarded as any other method. It's irrelevant to the parser what it does, it just needs to handle it like it would a normal method. This tends to make the whole easier to debug and adapt, since you never need to touch the parser to change behavior of one of these standard methods. This does ofcourse lead to more complex applications, which may not be desirable, depending on the intent of the language. Just my 2 cents :)