How does Lisp deal with the modern Writable Xor Executable philosophy? Or does it? Can a lispy program that exposes its lispyness to its users be secure (emacs, I'm looking at you)?
How does Lisp deal with the modern Writable Xor Executable philosophy? Or does it? Can a lispy program that exposes its lispyness to its users be secure (emacs, I'm looking at you)?
Emacs is not meant to be secure against user scripts. You could even say that's an integral part of its whole philosophy: the user can do whatever she likes, and her scripts too.
It does have some rudimentary safety. For example, color themes by default can't run Lisp code. They are written as Lisp data structures, but they aren't run through the evaluator unless the user explicitly allows it.
You either
- Expose the entire language and then there's not much you can do to prevent something harmful.
- Expose a subset of the language perhaps through parsing for harmful patterns or by somehow making potentially harmful functions unreachable.
- Expose a more restricted language (scripting like c/lua) that you control and know its full capabilities.
The only difference I can think of is that it's easier to write flexible and dynamically modifiable software in lisp than in most mainstream languages.
All access to anything important (network, files, other commands, etc) have to happen through opaque handles called capabilities. Think of them as objects that you can't look for.
When you call code, you pass it a set of capabilities that are available. That is all it can ever access.
But the whole language and environment needs to be defined from the bottom up to enable this.
Plus, they are taking their time (years and years and years) to get it working properly before driving public adoption.
However, high-security language runtimes have a history of being subverted anyway.