2 ms·
> Don't you find that web & javascript are pretty much a straight denial of your argument ? You should probably direct that question at Patrick because his ori
by lisper 8y ago
> Don't you find that web & javascript are pretty much a straight denial of your argument ?
You should probably direct that question at Patrick because his original question was kind of based on the premise that the answer to your question is "no".
My personal opinion? No. OMG no. Javascript and HTML are both poorly designed re-inventions of tiny little corners of Lisp. In that regard they are improvements over C. But no. OMG no.
> Even without debug symbols you mostly can do this for C, C++, ... programs
No, you can't. You can grovel around on the stack and muck with the data structures, but you can't redefine a function, or redefine a class, or change a class's inheritance structure without restarting your program. In Common Lisp you can do all of these things.
- pbhjpbhj 8y agoCan you/someone explain for this noob why you can't redefine a function, etc.? I'm not a programmer, so I'm imagining you hook in to the call that addresses the function (like modify a jump instruction), overwrite any registers that need changing, nullify caches, so the program runs new code -- this I think is how some hacks work? Ultimately couldn't you just write NOP to addresses used for a function? Is it something structural about C/C++ that stops this, like the ownership of memory (I'm assuming a superuser can tell the computer to ignore that addresses written to are reserved for the program being modified). How does the computer know that you pushed a different long jump in to a particular address and stop working, rather than keep going processing instructions. Apologies if I've misunderstood, please be gentle.
- lisper 8y agoIt's a good question, and I'm a little disappointed no one has answered this yet. There is no reason you couldn't redefine a function in C. It's really more of a cultural constraint than a technical one. It's a little tricky, but it could be done. It just so happens that C programmers don't think in terms of interactive programming because C started out as a non-interactive language, and so it has remained mostly a non-interactive language. Lisp, by way of contrast, was interactive and dynamic on day 1, and it has stayed that way. In the early days that made C substantially faster than Lisp, but that performance gap has mostly closed. However, there are some things that Lisp does that are actually impossible in C. The two most notable ones are garbage collection and tail recursion. It's impossible to write a proper GC in portable C because there is no way to walk the stack, and there is no way to compile a tail-call unless you put the entire program inside the body of a single function.