4 ms·
Cool! It's interesting that you want them to make a procedural language, although if they started with C, it makes some sense. I wonder if you could broaden t
by vessenes 15y ago
Cool!
It's interesting that you want them to make a procedural language, although if they started with C, it makes some sense.
I wonder if you could broaden the experiment slightly by relaxing your constraints and saying they either need to allow reassignment of variables, or else support lambdas, and in exchange they can assume immutability.
- dovyski 15y agoThanks! I think a procedural language makes more sense for them at this time. They are just learning OOP, so it would be hard to implement an interpreter for that. About your suggestion, that's cool. I think most of them are already assuming immutability and using floats/doubles as the type of all variables.
- Jach 15y agoI agree with your blog post that it's a more interesting assignment than yet-another-Tic-Tac-Toe clone. I wish more curricula did this, and earlier! I think after the assignment is done it'd be worthwhile to show them that they can get all the Java-style OOPy features with just lexical closures, and I think showing Forth as a powerful, simple, and simple-to-implement language would be neat too. (Also yacc and lex deserve a mention, I like this PDF that accomplishes the goal of the assignment: http://www.scribd.com/doc/8669780/Lex-yacc-Tutorial http://www.scribd.com/doc/8669780/Lex-yacc-Tutorial ) If you relaxed the constraint on syntax and just stipulated Turing-completeness, it would be very amusing if someone implemented a clone of Brainfuck. ;) (Especially for the unlucky pair who has to write two programs for it!)
- dovyski 15y agoThanks for the words and suggestions! About yacc they will meet that when they attend the compiler course. I didn't see a Brainfuck clone yet, but I saw something in the same level of oddity. It was a language called "Star Wars", I guess. I can remember some commands such as "Darth Vader told to a = 1" and "Skywalker from 0 to 10" haha :)
- deleted 15y ago[deleted]