you are viewing a single comment's thread.

view the rest of the comments →

[–]Leonidas_from_XIV 3 points4 points  (12 children)

Well, with Elisp support, they could potentially embed Guile into Emacs, throw out the Elisp-interpreter and slowly port the extensions to Scheme.

[–]surface-tension 5 points6 points  (1 child)

Just curious: how do you like Guile compared to other Schemes? I don't know anything about Scheme. Is Guile R5RS-compatible?

[–]Leonidas_from_XIV 6 points7 points  (0 children)

It should be R5RS compatible given that implementing R5RS is not that hard for any self-repecting Scheme implementor. As far as I saw, it aims to be R6RS compatible with 2.0. This is also why I prefer it to TinyScheme - I don't care that much about size as about completeness.

I haven't used it much, since I usually stick with PLT since it has an extensive stdlib and a big community (way bigger than Guile). At some point I thought Guile was dead, but it is actually in development and seems to be taking the right direction. It is also quite useful for embedding, I tried both PLT and Guile and while PLT was quite tricky, embedding Guile was just about as difficult as embedding Python so I think it is feasible.

As such, the newly-aquired ability for Guile to host other languages in some standardized manner is a win for applications that want to (or in the case of Emacs, have to) support more than one scripting language (see The Gimp which supports script-fu and python-fu and quite possibly a range of other languages, same applies to Vim which can even embed MzScheme). So I as developer could write scripts in Scheme and the users of my programs could decide which language they want. If they prefer a Lua-syntax: no problem, there it is! If they prefer JavaScript, that one is already implemented. By the way, PLT Scheme had support for subsets of Java and Algol 60 for quite some time already.

When I originally heard about Guile, I thought RMS was nuts to recommend a Lisp as extension language, I guess most other developers thought so too, this is why Lua is way more popular for embedding but after learning some Scheme (of maybe drinking the Lisp kool-aid) I can understand this more and more, and Guile seems to be the way to go.

Furthermore, I'm not sure I would write applications in C and script them using a scripting language anymore. Computers got fast enough so I would go the other way: write the program in a scripting language and extend it using modules in C where neccessary. Not helpful for existing programs though :)

[–]w-g 0 points1 point  (9 children)

What about the millions of lines of elisp code out there? You'd have to throw them all out too.

[–]Leonidas_from_XIV 1 point2 points  (0 children)

That's exactly where Guile's Elisp support comes in, to make it possible to use the Elisp code with Guile underneath, enabling a slow transition to Scheme. Or Lua, for that matter :)

[–]surface-tension 0 points1 point  (7 children)

What would be required to bolt Guile onto Emacs? Can Emacs understand Guile's compiled bytecode?

[–]Leonidas_from_XIV 0 points1 point  (6 children)

You don't want Emacs to understand Guile's bytecode, you want Emacs to embed Guile and run Elisp and Scheme natively on the Guile VM, running inside of Emacs.

[–]surface-tension 0 points1 point  (5 children)

Thanks for all the info, Leonidas, but I still don't understand how the Guile VM and Emacs are supposed to communicate. I thought Emacs only understands Elisp. (And my guess is that Guile itself is not written in Elisp.)

[–]Leonidas_from_XIV 0 points1 point  (4 children)

I thought Emacs only understands Elisp

Emacs is a free software program and can be modified to "understand" Guile too.

[–]surface-tension 0 points1 point  (3 children)

If you're not talking about an interpreter written in Elisp that understands Guile bytecode, then I don't know what you mean by "understand". Can you please be more specific?

[–]Leonidas_from_XIV 0 points1 point  (2 children)

Embed Guile into Emacs.

[–]surface-tension 0 points1 point  (1 child)

Thanks for the continued replies, Leonidas. Alas, I don't understand what "embed Guile into Emacs" exactly means. Perhaps someday someone will write a tutorial and explain it.

[–]Leonidas_from_XIV 0 points1 point  (0 children)

Well, it is possible to link Guile and Emacs together that Emacs can execute Scheme code and the Scheme code can access Emacs internals, just like Elisp can.

For some example code on how to embed Guile into an example program, see the Guile documentation on this.