From a3d48d0ce4ca563d1c574e3393c5653f879d79c2 Mon Sep 17 00:00:00 2001 From: Konstantin Nazarov Date: Sun, 29 Oct 2023 22:20:24 +0000 Subject: [PATCH] Reformat lists in the latest post --- content/posts/writing_programming_languages_is_fun/note.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/posts/writing_programming_languages_is_fun/note.md b/content/posts/writing_programming_languages_is_fun/note.md index 86258d9..9ec9f57 100644 --- a/content/posts/writing_programming_languages_is_fun/note.md +++ b/content/posts/writing_programming_languages_is_fun/note.md @@ -14,6 +14,7 @@ I'd argue that studying the implementation of an existing mainstream language is Now, why should you care at all about these things? Isn't it the case that there are lots of great engineers who have never touched the internals of a compiler/interpreter? Sure, I'll grant you that. I would even say that I'm not a great engineer myself, so I can't be the judge. Every time I figure something out, it's usually a hard-won battle that takes _way_ longer than people around me realize. Having said that, there are a few things that are special about programming languages that make them a good learning material: + - They are multi-stage transformers: starting from lexing to code generation. The transformers would be more or less independent, and writing them a few times will teach you how to compose programs out of "pure" blocks. This is something that you rarely see in mature codebases (unless of course they are written in Ocaml/Haskell) - They would teach you to think in trees. A compiler/interpreter is mostly a tree walker, whether for evaluation or optimization. - And finally, you'd start to appreciate the cost of abstractions. You'd learn the costs of closures, different types of dispatch and memory accesss. @@ -29,6 +30,7 @@ And then at some point, I discovered Lisp. I never quite enjoyed writing large p Sure, a production version of a Lisp dialect would be as hard as other languages, because it would include a JIT compiler and a generational garbage collector. But for educational purposes you don't need this. It is exactly the simplicity of the core idea that matters for a hobby implementation. Finally, there are many programming languages that are useful without being "fully-featured": + - text processing: sed, awk, and others - templating: m4, jinja, etc. - shells: bash, ash, etc.