Working on My First Non-trivial Haskell Project, an Implementation of an FP language
As a Senior Scala Developer, I've always had huge respect for Haskell. I've learned about the language over 10 years ago and applied many of its functional programming principles in my Scala projects. However, I've never really tried the language (aside perhaps from REPL one-liners and hello-worlds).
Last month, I decided to finally build a project with it. I stumbled upon Simon Peyton Jones' book, "The Implementation of Functional Programming Languages" and learned a lot from it. I already have experience designing and building a dynamically typed language, thanks to the first part of Crafting Interpreters, but it was Simon Peyton's book that really discussed how all FP languages essentially boil down to the lambda calculus (though we FP programmers have probably already realized it at least intuitively over the years).
My respect for Haskell and its designers has just skyrocketed because of this project. The project is still in its infancy (still a tree-walker, no type checker yet, etc.) but I'm really excited to learn more about Haskell and programming languages in general (both in design and implementation).
Haskell resurrected the joy of programming that I haven't experienced in a long time. But sadly, I can't shake the feeling that the world has already moved on from type theoretic stuff (at least the part of world that once cared or listened) and is now focusing on code generation, a realization that often cancels out the said joy.
I hope this community is still full of passionate folks and that it's not too late to join the ride. Thanks.
Here's what the language I'm working on currently looks like, by the way:
mascheya> c = '\^A'
()
mascheya> c
'\SOH'
mascheya> add a b = a + b
()
mascheya> add 23.4f 56.7f
80.1
mascheya> add7to = add 7
()
mascheya> add7to 10
17
mascheya> double = \x -> x * 2
()
mascheya> double 14
28
mascheya> minus = \a b -> a - b
()
mascheya> minus 9 10
-1
mascheya> (\d -> d / 2) 14
7
mascheya> let x = 10 in x % 3
1
mascheya> :set line=multi
mascheya>
let x = 10;
y = 20;
z = 30
in x + y * z
-- end
610
mascheya> :set line=single
-- end
mascheya> id a = a
()
mascheya> id (\x -> x + 1)
<function>
Edit:
Here's the source code: https://github.com/melvic-ybanez/mascheya