If you find that helpful, I've made more content on compilers (including live coding a compiler, without narration) which should be easily reachable from my website.
I think one way to simplify language creation is to use an existing language with somewhat similar operational semantics as a compilation target. This simplifies the backend a lot and leaves more time to explore what the language (frontend) should look like. The backend can always be rewritten at a later time. My personal choice is usually JavaScript[1].
Regarding type checkers/type inference, I've also ran into difficulties with this topic, and I've written several articles trying to make it more approachable[2].
Monads are a bit like exiting vim. The complexity is exaggerated to the point of a meme, but in reality not very difficult, and they can be quite useful.
That's a bit of an understatement, seeing as it's... I mean is it even possible to write a non-trivial application without accidentally implementing a monad?
Most people write monads all the time, and then their head explodes when someone calls it by its name.
A different thing to look at is what enforcing referential transparency in your program means.
Referential transparency means that when we bind an expression to a name (e.g. `y = f x`), the two are interchangeable, and whenever we use `y` we could just as well use `f x` and vice versa, and the meaning of the code will stay the same.
Enforcing referential transparency in a programming language means that:
- We need to have more control over effects (purity)
- We can use substitution and equational reasoning
The value of referential transparency for me is that I can trust code to not surprise me with unexpected effects, I can use substitution to understand what a piece of code is doing, and I can always refactor by converting a piece of code to a new value or function because referential transparency guarantees that they are equivalent.
Because of that I feel like I can always understand how something works because I have a simple process to figure things out that doesn't require me keeping a lot of context in my head. I never feel like something is "magic" that I cannot understand. And I can easily change code to understand it better without changing its meaning.
Referential transparency is freeing, and makes me worry less when working with code!
---
The other part that is very notable about Haskell is one of its approaches to concurrency - Software Transactional Memory. Which is enabled by limiting the kind of effects we can perform in a transaction block:
I've written an online book with mdbook (https://lhbg-book.link) and it was a breeze. I believe mdbook was one of the reasons I even finished the book.
1. It's super easy to install. If you have a rust toolchain, just `cargo install mdbook`
2. One command to initialize: `mdbook init my-book`
3. One command to get immediate continuous feedback: `mdbook serve`
4. It allowed me to keep writing in my preferred environment (emacs)
5. It looked good by default. I could focus on the content.
6. Setting up auto deploy ci on github is about 30 lines for yaml
Though one point of improvement would be better support for other export formats such as pdf and epub.
tl;dr mdbook allowed me to use the path of least resistence to complete my project, and I highly recommend it.
Also it is possible other platforms can do the same or better but I haven't tried them.
https://gilmi.me/blog/tags/type%20inference
If you find that helpful, I've made more content on compilers (including live coding a compiler, without narration) which should be easily reachable from my website.