4 ms·
I'm actually learning Common lisp for working on my side projects, and those are the reasons that really make the whole thing stick out and amazing. * Live ima
by drekipus 2y ago
I'm actually learning Common lisp for working on my side projects, and those are the reasons that really make the whole thing stick out and amazing.
* Live image and hot-patching is great. You edit it within the code, so if you're making a shooter game, and you're in a "draw HUD" function, you can just edit the code to be what you want and send that function to the running image, to update while you play. Any time you spot a bug, you can isolate, correct, and verify, while still running the game.
* Macros can be thought of as a way to make the code more readable. CL is almost thought of as a "programming language to make programming languages in, so you can solve the problem".
For instance, if you think about any amount of boilerplate. Macros allow you to write it once (because you have to) and then use it in different places at different times. CL makes boilerplate nonexistent.
I do this for wrapping up ncurses functions: to use colours, you must turn on and off certain bits and flags. You can imagine that there's complications when you want to draw a box, or colours text, or coloured underlined text, and there's all sorts of flags and state involved. To write it in C or Python would be a few multi line functions. In lisp it can be made as simple as (with-colours a-colour (draw-text) (with-underline (draw-text))).
- johnisgood 2y ago> * Live image and hot-patching is great. You edit it within the code, so if you're making a shooter game, and you're in a "draw HUD" function, you can just edit the code to be what you want and send that function to the running image, to update while you play. Any time you spot a bug, you can isolate, correct, and verify, while still running the game. I think this is an excellent selling point. Many frameworks (e.g. JavaScript frameworks) have file system watching implemented, but it is not the same.
- drekipus 2y agoIt is not even close to the same. And I think the point is that hot patching. If you could save a JavaScript file and it would reload just those functions in your running app with out changing state, then that would be closer. As far as I am aware it is near impossible in every language that isn't lisp
- kazinator 2y agoYou can reload functions without changing state in, oh, POSIX shell. I carefully wrote the Basta code (Bash Status Line) to be hot upgradable. https://kylheku.com/cgit/basta/about https://kylheku.com/cgit/basta/about
- fuzztester 2y ago>CL is almost thought of as a "programming language to make programming languages in, so you can solve the problem". https://www.google.com/search?q=lisp+is+a+programmable+programming+language https://www.google.com/search?q=lisp+is+a+programmable+progr...