13 ms·
Ask HN: Which Functional Language to Implement for Learning?
They say the best way to learn about things is to just go and implement it. That being said, I'm looking to implement an interpreter (or maybe a vm and compiler) for a functional language to enforce the ideas I've learned in the past few months.
In the past, I've written interpreters for a few basic languages and Scheme (not fully r4rs compliant, but close enough to learn what I wanted). Of course, I wrote these in languages that provided garbage collection, and without any type-checking. Basically as AST-walkers.
I want to establish more expertise with these topics and create something that I can actually use, maybe even extend, but to build a new language from scratch and make real design decisions isn't in my cards yet.
So, the question, does anyone know of language specifications for functional languages that aren't entirely crippled that would be interesting to implement as a learning project?
Please don't suggest scheme. I love scheme, but it's been done to death, and is the language I've studied the inner-workings of the most. Thanks.
- qhoxie 18y agoHaskell is probably a good option.
- apgwoz 18y agoI like the idea of playing with a lazy language, but am a bit intimidated by Haskell. Oh, sure I've written some trivial programs in it, but there's this aura surrounding it that makes me put Simon Peyton Jones, Philip Wadler and the rest of the crew on this pedestal. I kneel before them.
- felixmar 18y agoPerhaps a strict Haskell 98 implementation? I really like Haskell but i'm still not convinced that laziness should be the default. It would be interesting to see what the trade-offs are.
- apgwoz 18y agoInteresting. I've been thinking about laziness a bit lately and am wondering why not to make it the default. Of course my thoughts haven't produced much and I haven't went in search of arguments yet. But, the only argument against it that I can see is efficiency assuming your in a pure functional language. Obviously, laziness when the surrounding environment is changing can lead to unpredictability, but compiling memoized thunks to implement laziness seems like it could be optimized very well. Edit: In regards to your actual suggestion, I'll take a look at the spec and the idea. Thanks
- kasharoo 18y agoWhy don't you try Sche.... Oh. Never mind.