Comment by skydhash

2 years ago

> and my conjecture is there might be something about keywords that makes them superior cognitively for humans compared to just piles of nested parentheses.

It's the nature of the language and the VM that it runs in. The code is data and data is code. You can construct a list and then decide to evaluate it. Or the current code you're writing is actually data for another piece of code. It's a paradigm that really opens the computation mindset.

The VM looks like the common REPL you see in Python, but it's more powerful. It's more like a OS installation than a language interpreter. You can inspect anything, patch anything. When paired with an editor, that means you can only apply part of the code and then rerun part of the code. You can also try stuff and then formalize stuff down in code, no need to rerun the whole program.

For me, the parenthesis are the same as Python's whitespaces and colons. Or C-like language and their brackets and semicolons. Just syntax. After a while, you just don't notice them other than check that the expression is correct.

> You can inspect anything, patch anything. When paired with an editor, that means you can only apply part of the code and then rerun part of the code. You can also try stuff and then formalize stuff down in code, no need to rerun the whole program.

I’ve heard this a lot about Lisp. But doesn't this lead to greater cognitive complexity because every time you patch your running code, you have to keep in mind the state of the running program and mentally check whether your patch affects any part of that state?

A lot of people do data analysis this way in R/Python who aren’t programmers either by training or for a living, and it is not a practice that generally leads to bug-free outcomes. This has also mirrored my experience with Emacs which is a Lisp machine, maybe getting closer to Common Lisp’s programming environment.

Is this process of runtime modification fundamentally different in CL? What am I misunderstanding?

  • When you redefine a function in CL, every function that use this function is notified of the change and pickup the new version. And because it's functional and you're not supposed to modify the state outside your function, everything will keep churning.

    The issue with emacs is the sheer number of variables. And the fact they're global. That leads you to do stuff you shouldn't do. But the principles are essentially the same. And in CL, you can snapshot the current state of your program to a file. Then restart later, instead of reloading the environment from the code.

    A quick demo: https://youtu.be/jBBS4FeY7XM