4 ms·
> As it comes from a Scheme background, Guile provides > the immutable data types we need. Scheme does not provide any immutable data types beyond numbers
by groovy2shoes 15y ago
> As it comes from a Scheme background, Guile provides
> the immutable data types we need.
Scheme does not provide any immutable data types beyond numbers or symbols, either. Procedures like `set-car!`, `vector-set!`, and `string-set!` all modify their operands. In fact, in R5RS, there's no real way to introduce truly disjoint types (you can, however, simulate them as in SRFI-9 which is being incorporated in R7RS), so it'll be a little difficult to even introduce new types let alone interoperable new types.
> One of the Summer of Code projects for this year is
> to allow for pluggable backends in the ClojureScript
> compiler, with Lua as a proof of concept.
Compound data types in Lua are similarly mutable (perhaps even more so because mutation of tables is acceptable practice in Lua). There will be difficulties targeting ClojureScript to Lua, too.
> Of course, with a compiler that targets Emacs Lisp,
> you can work around this by implementing your own
> immutable types. But this makes any form of interop
> much more cumbersome... you have to choose between
> getting equality right and seamless interop.
It's just a fact of life that when introducing a radically different paradigm to any language platform, interop is going to have seams.
[EDIT - formatting]
- technomancy 15y agoThanks for the pointer. Guile does in fact have immutable strings and lists, but apparently they do not actually come from the Scheme standard: http://lists.gnu.org/archive/html/guile-devel/2012-01/msg00135.html http://lists.gnu.org/archive/html/guile-devel/2012-01/msg001.... I will update my post to reflect this. I'll keep a close eye on the Lua ClojureScript backend as well; this should be interesting.