3 ms·
A Forth or a Lisp are simple tasks for an experienced programmer, and even basic ones are really satisfying imho. Seeing simple constructs work in an hour of co
by tluyben2 8y ago
A Forth or a Lisp are simple tasks for an experienced programmer, and even basic ones are really satisfying imho. Seeing simple constructs work in an hour of coding really feels great. I implemented more complex languages (with types) for work which were more like DSLs but in languages less suited for the type of DSL we required, but I find most pleasure doing little Forth (like [1]) or Lisp likes when I am waiting for hours (in a plane for instance). It is like playing games for me. I write them on my phone or iPad.
I would recommend a lot of books here as well for a solid base and giving you the background needed to write more complex languages including static types, compilers, JITs and VMs. But for me, because I really do not have that much time, that would stretch over too long time and I lose interest, so I stick to things I know I can finish (or rather, get working and achieve something a previous incantation did not achieve; smallest, simplest, fastest etc).
[1] https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d5c6a https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d...
- white-flame 8y agoI'll agree and expand on their benefits to more complex things: The vast majority of languages are parsed into ASTs of some form, and Lisp is basically directly programming in AST data structures that are executable. Seeing that source code is basically just another data structure to be manipulated and converted was the major "Ah hah!" moment in demystifying compilers for me. Forth is a great lower-level representation of nested expression evaluation, and sheds a lot of light on how to organize that evaluation in your code generation, converting foo(bar(baz(val),blort(val2))) into a linear stream of operations. Even for register machines, Forth's stack represents the intermediate values that must be retained between expressions in either registers or memory. Once this basis of how programming languages work is established, then the ideas of new programming language design from the source code perspective can be explored in practical terms.
- gleenn 8y agoSomeone wrote an amazing write-your-own lisp using Python tutorial, I found it amazingly consumable and it only took a weekend: https://github.com/kvalle/diy-lang https://github.com/kvalle/diy-lang
- emidln 8y agoThere's also Make a Lisp: https://github.com/kanaka/mal/blob/master/process/guide.md https://github.com/kanaka/mal/blob/master/process/guide.md It's available in a variety of languages and has a nice guide (linked) to various steps.
- bjconlan 8y agoI totally agree here, if you want low level I think j1 forth (http://www.excamera.com/sphinx/fpga-j1.html http://www.excamera.com/sphinx/fpga-j1.html) and for lisp I really liked http://www.buildyourownlisp.com http://www.buildyourownlisp.com which uses modern C libraries so it polishes your C knowledge too.