4 ms·
The "hosted" part is not quite right. Clojure is hosted, but what I think you are referring to with the "parasite" metaphor is called "embedded." (Distinct use
by jonahbenton 7y ago
The "hosted" part is not quite right. Clojure is hosted, but what I think you are referring to with the "parasite" metaphor is called "embedded." (Distinct use of the term embedded from its use to describe small systems hardware).
Clojure was definitely designed to be both embedded and hosted, but those are distinct axes.
There are lots of languages designed to be embedded as scripting or automation runtimes in other systems. Tcl, Lua, Python, Guile (a lisp)...
Why embedded- pre-web, there used to be a practice of writing your infrastructure in systems language (C/C++) then writing your application tier in a scripting language. Countless games and GUI line of business tools on Windows were written this way.
Java in this case was considered a "systems" language, and there is a long history of embedded languages for Java. My favorite JVM-embedded language was called Beanshell.
This embedding was/is a use case for Clojure, important for "sneaking" Clojure in to the enterprise.
The "designed" part implies that the scripting runtime plays nicely with process-owned resources like threads and memory, and has a well defined interface for exposing your infrastructure objects to the scripting layer.
Post-web, if you squint, you can recognize this architecture in the DOM the browser (written in a systems language like C++ or Rust) exposes to its scripting tier (Javascript).