Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Guile Scheme Emacs-Lisp Compatibility Matures

Unknown Lamer posted about 2 years ago | from the this-is-the-future-1999-promised-me dept.

GNU is Not Unix 46

In a posting to the Guile developers list today, it was announced that the Emacs-Lisp compiler for Guile has matured enough to run actual elisp programs. The author included a screencast demoing the new compiler running the Dunnet dungeon crawler. It is still a bit hackish: you need a load file that fakes a few Emacs side functions. In theory, most batch mode programs that don't do buffer manipulation should now work. After a few previous attempts, things could be on track for GNU Emacs 25 based on Guile.

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered


Guile scheme goes with anything (0)

Anonymous Coward | about 2 years ago | (#39552601)

Even Emacs-Lisp.

Has anyone embedded Guile? (2)

GreatBunzinni (642500) | about 2 years ago | (#39553141)

I've heard of Guile in the past, but I never managed to come across any application that actually uses it. Guile's own project list is rather meek [gnu.org] , and whenever people talk about embedding a programming language, the talk appears to always shift to Lua [lua.org] . Does anyone know why no one picks Guile for any task? It would be great if it was possible to hear from anyone who actually gave Guile a try in any project.

Re:Has anyone embedded Guile? (2)

deKernel (65640) | about 2 years ago | (#39553429)

The one application that I am aware of that does make use of Guile is GnuCash and it uses Guile for generating reports.

Re:Has anyone embedded Guile? (4, Informative)

Anonymous Coward | about 2 years ago | (#39553571)

TeXmacs and Lilypond also embed Guile.

Re:Has anyone embedded Guile? (1)

HyperQuantum (1032422) | about 2 years ago | (#39553621)

I'd think it's rather logical that the GNU project is dogfooding.

Re:Has anyone embedded Guile? (0)

Anonymous Coward | about 2 years ago | (#39555041)

dogfooding their decades old extension system?

Re:Has anyone embedded Guile? (0)

Anonymous Coward | about 2 years ago | (#39553583)

Capcom's been using Guile since the early 1990s! ;)

Re:Has anyone embedded Guile? (-1, Redundant)

polo ralph lauren (2609061) | about 2 years ago | (#39553619)

you need a load file that fakes a few Emacs side functions. In theory, most batch mode programs that don't do buffer manipulation should now work. After a few previous attempts, things could be on track for GNU Emacs 25 based on Guile.

Re:Has anyone embedded Guile? (3, Interesting)

Bomazi (1875554) | about 2 years ago | (#39553649)

There are many other apps using it, like gnucash.

Having used it before I can tell you that the C API is very well made, and C and scheme can call each other with few limitations. Scheme is an elegant language too.

Lua has three main advantages over guile. It is trivial to package, has a smaller footprint, and works anywhere. Guile only really supports posix and windows.

But the main competitor to guile is not lua, it is python. And the battle is all but lost. The two offer about the same functionality. They can easily interface with the outside (unlike Lua) and the C API works similarly, but python wins due to its more traditional syntax and larger developer base.

As much as I like guile, the whole point of an extension language is to encourage third-party additions, so you want a language that attracts as many potential developers as possible (including beginners), and that language is not scheme. So unless your religion forbids it (i.e. it is a gnu program), python, or maybe javascript, is almost always a better choice.

Re:Has anyone embedded Guile? (1)

doom (14564) | about 2 years ago | (#39555489)

As much as I like guile, the whole point of an extension language is to encourage third-party additions, so you want a language that attracts as many potential developers as possible (including beginners), [...]

Yeah, but then back in 2000, John Tobey released an emacs with perl embedded. The FSF folks promptly talked him out of doing that work. If what they wanted was a large third-party developer base, they could've had it over ten years ago.

Re:Has anyone embedded Guile? (1)

macshit (157376) | about 2 years ago | (#39555955)

They can easily interface with the outside (unlike Lua) and the C API works similarly, but python wins due to its more traditional syntax and larger developer base.

Wait, what? How do you come to the conclusion that Lua "can't easily interface with the outside"?

[Lua and Python / Guile are very similar in overall form. Lua is much faster, much smaller, easier to embed, and has a better C interface than Python, but Python has more libraries (including many that are included by default) and a larger user-base. Guile I dunno about, it seems to have the bad points of both (large/bloated + not much support or user-base)...]

Re:Has anyone embedded Guile? (1)

Bomazi (1875554) | about 2 years ago | (#39556569)

I meant that Lua has a limited standard library so a lot of stuff will require C. Guile by contrast has a POSIX system calls interface, networking, an html module, etc... Python has even more stuff. And it is my understanding that Lua is most often used sandboxed, like javascript, rather than to write standalone applications.

Re:Has anyone embedded Guile? (2)

macshit (157376) | about 2 years ago | (#39558461)

Hmmm, of course such libraries do exist for Lua, it's just that you'll have to download them separately rather than finding them in the tarball that contains the actual interpreter...

The most common use of Lua is as an "embedded" language—app is written in C, but linked with a Lua interpreter which the app calls to do whatever stuff it wants. I don't think actual sandboxing is all that common—it's common, for instance, for "embedded" Lua code to load various external modules/libraries to do stuff.

[There's no particular reason not to write an entire app in Lua (works fine), it's just that its small size, standalone nature / lack of dependencies, and good C interface make it a very good fit for those times when you want to add an interpreter to your app...]

Re:Has anyone embedded Guile? (1)

Anonymous Coward | about 2 years ago | (#39557217)

That's a popular misconception. The rule of thumb which typically works out well is, Lua is faster for math heavy, low precision operations while python is faster and better for pretty much everything else.

For a lot of games, the interface tends to add this number to that number and compare to intuit some meaning. For that, Lua is in deed pretty fast. For most everything else, python is generally on par or even faster. The more you need a general purpose language, the more appealing and faster python generally becomes.

Again, these are not hard, fast rules, but rather rules of thumbs which are all too frequently accurate for real world projects. Bluntly, saying Lua is "much faster", is all too often simply nowhere near accurate. It is, however, much smaller and easier to embed. The second part, however, doesn't really say much considering python is amazingly easy to embed. Which means, for a general purpose scripting language, where size doesn't matter, python is typically the win. Where size does matter or you need to almost exclusively work on small precision numbers, Lua is almost exclusively the win. So worry, you blanket statement, while popular, is generally not accurate.

Re:Has anyone embedded Guile? (0)

macshit (157376) | about 2 years ago | (#39558419)

You are misformed. Lua is much faster than python in pretty much any normal application. [and that's normal Lua—LuaJIT is of course, even faster.]

Python has its strong points, but speed is not one of them.

Re:Has anyone embedded Guile? (1)

mellon (7048) | about 2 years ago | (#39553771)

Nobody picks guile because in practice it's hard to do anything real with it. Possibly that's changed since the last time I evaluated it, but last time I evaluated it, batteries were most definitely not included.

Re:Has anyone embedded Guile? (1)

terpri (853344) | about 2 years ago | (#39598999)

Guile 2.0 is a huge improvement over earlier releases. Scheme programs are now compiled for a custom VM with an optimizing compiler (not simply interpreted, and AOT or JIT native compilation are now much more practical goals), and Guile now supports hygienic macros, delimited continuations, Unicode, dynamic FFI, R6RS and more SRFIs, and comes with a new debugger and REPL, SXML, and a Web server, among other new standard modules. There's also a SLIME-like Emacs interface: http://www.nongnu.org/geiser/ [nongnu.org]

It's definitely worth a second look if you previously evaluated Guile in the 1.x days.

Re:Has anyone embedded Guile? (3, Informative)

Michael Duggan (124223) | about 2 years ago | (#39553833)

Lilypond [lilypond.org] uses Guile extensively, and as time goes on, more and more of its code has been moving from C++ to Guile. For those not in the know, Lilypond is a typesetting program for music.

Re:Has anyone embedded Guile? (1)

hanwen (8589) | about 2 years ago | (#39555113)

I wouldn't recommend it as a scripting language to other projects, though.

The API is not very good, and the release pace has been glacial.


Re:Has anyone embedded Guile? (0)

Anonymous Coward | about 2 years ago | (#39555459)

The API is not very good

This is PRECISELY why people use SWIG (swig.org) to generate wrapper code.

COME ON you are going to tell me that guile's native interface is ANY WORSE than, say, Java's???

the release pace has been glacial.

This is a GOOD THING, guile is STABLE. You can put it in your project and you don't have to worry about it.

Re:Has anyone embedded Guile? (0)

Anonymous Coward | about 2 years ago | (#39558867)

The GPL'd Electronic Design Automation: gEDA-project [geda-project.org] uses Guile. Gschem, the schematic entry, uses hooks written in Guile to perform actions. The netlists are generated with Guile scripts that also interface with the C coded core. The configuration files for the project are also written in Guile.

Re:Has anyone embedded Guile? (2)

LizardKing (5245) | about 2 years ago | (#39558963)

Guile was a failed attempt at making an embeddable scripting language for the larger GNU apps. It failed because very few people actually wanted to use Lisp for such a purpose, even in if it was in a minimalist Scheme like form. There was even a flame war aeons ago when Tcl was proposed as a ready made alternative to a fledgling Guile. RMS shot the idea down in flames since he considered Tcl beneath unworthy of use by "real programmers". As you've noted, since then alternatives such as Lua have become popular in the embedded scripting language niche.

Re:Has anyone embedded Guile? (1)

macshit (157376) | about 2 years ago | (#39568353)

The attitude of many towards lisp/scheme was probably a factor, but I think not the major one. As can be seen by the huge number of Emacs extensions, people can deal with lisp, even if it's not everybody's first choice. [...and note that this is true even with Emacs' somewhat inelegant lisp dialect and lack of many modern features; people will put up with a lot of crap if the reward is immediate...]

The real problem, I think, was that Guile never had a particularly usable or attractive implementation—it was kind of bloated and slow, and the interfaces were not particularly good. Lua, by contrast, although it also has its weaknesses, really hit the sweet spot for language embedding; for somebody who just thinks "hmm, I'd like to add an extension language," it's easy to quickly add Lua to your app, it works well, and doesn't add many dependencies (Lua is so small it's perfectly practical to just include the entire Lua source tree with your app). Python is a bit clumsier and resource-intensive, but has tons of tool support, and works well in practice; moreover with its popularity, one can get a big payback from the effort required, with the huge amount of libraries available and widespread user familiarity.

In other words, Guile was a pretty good idea, but the reality never lived up to it.

I've heard that Guile has improved a lot in the last few years, but it may be too late for it to gain much ground with so many good alternatives already in widespread use. If a popular app like Emacs were to start using it (besides the "GNU dogfooding" aspect, Guile would probably be a better fit for Emacs than non-lisp languages), that would help to keep the project going, and maybe it could win over more people in the future, but ... I'm not holding my breath.

Re:Has anyone embedded Guile? (2)

Jim Hall (2985) | about 2 years ago | (#39560729)

GNU Robots [gnu.org] uses Guile, but I don't see it on the list. GNU Robots lets you construct a program for a robot, then you set it loose in a virtual environment. It can use sensors to detect objects, blast baddies, pick up rewards, and move around. You write the program in Scheme, which is loaded by GNU Robots via Guile.

cannot parse headline (0)

Anonymous Coward | about 2 years ago | (#39553283)

Is this a markov chain headline generator?

Lisp is... (1)

YurB (2583187) | about 2 years ago | (#39553765)

Eric S Raymond wrote in "How to become a hacker [catb.org] " that Lisp is worth learning for "the profound enlightenment experience you will have when you finally get it". It's true (although I'm still a newbie with it).

Re:Lisp is... (3, Funny)

doom (14564) | about 2 years ago | (#39555449)

Eric S Raymond wrote in "How to become a hacker [catb.org]" that Lisp is worth learning [...]

But don't let that discourage you too much, lisp might be worth learning in any case.

Re:Lisp is... (1)

YurB (2583187) | about 2 years ago | (#39564095)

Yep, I'm using it mostly in Emacs and a little bit in LilyPond, but Guile might give me the possibility to do other things when I'll need (I'm excited about Guile bindings to Gtk).

Re:Lisp is... (1)

LizardKing (5245) | about 2 years ago | (#39559005)

ESR says a lot of things, and few of them make sense. Lisp is a great playground for conceptual stuff, but pretty much anything of value in Common Lisp has migrated to other, more mainstream languages.

Re:Lisp is... (1)

YurB (2583187) | about 2 years ago | (#39564053)

I cited only one of these things ESR said;) But back to Lisp... I think Guile (and Scheme in general) can be a good modern incarnation of Lisp. Lisp (and Scheme) are somewhat underscored because of ther stangeness to eyes of people who have been learning algorithmic languages. But this is more the matter of what one have learned first: for someone (this (is (strange))) and for some other person { $this->migth("be", strange()); }...:) If we can write apps in Java or Python (interpreted languages, right?), why not Scheme? Only maturity of the implementation may be a criteria here, but the language itself seems to be quite useful.

Glad to see this on Slashdot! (3, Funny)

Lemming Mark (849014) | about 2 years ago | (#39554333)

This is the kind of article I'm always glad to see on Slashdot; emacs is cool, Lisp is cool, an article on something that's genuinely hardcore nerdy is always good to see! With the Linux on 8-bit micro article also posted today it feels like the nerd coefficient is running high today! Good!

Long time in the making (1)

countach (534280) | about 2 years ago | (#39554843)

Boy, this has been a long time in the making. It seems to me they were talking about this 10 years ago.

The problem with all the scheme implementations is none of them are up to the task of real world work. You want good C function call integration? Get one variant of scheme. You want to do X windows guis? Get a different one. You want nice UNIX system call interface? Different one again. You want to do cross platform gui work? Good luck with that. Scheme could have gone quite a long way if all their forces got together and pooled their (considerable) talent and made one scheme to rule them all, just like there is one Java to rule them all.

Re:Long time in the making (0)

Anonymous Coward | about 2 years ago | (#39555465)

while this has been pointed out numerous times, this is kind of anathema to the scheme/lisp community, which is mostly comprised of cs language theorists, interested in language implementation more than use. recent efforts at standardizing (r6rs / err5rs) have been controversial because it is seen that standardizing too much hurts 'expression' of scheme, which is part-and-parcel of implementing it. Strictness of this belief varies between the different implementors. Generally speaking, if you want to write large scale scheme apps, you pick an implementation, and stick with it, with plt/racket being the predominant one due to large number of libraries, and others used for other reasons (ease of embedding, other features, etc.), typically to make a portable application you'll need to use some kind of 'compatibility' layer, which hurts adoptation as you state

There has only ever been 1 java - because it was a trademarked / patented sun technology created from a computer company, and later the proprietaryness became more of a 'legal framework for defining java' than a hodgepodge of people implementing closely related but not identical languages.

IMHO, java is a 'simplified lisp runtime & object model with C-like syntax' designed to bridge the gap between lisp (gc, runtime interfacing) and traditional statically typed compiled languages like C/C++

Re:Long time in the making (0)

Anonymous Coward | about 2 years ago | (#39555903)

And there's not much of a gap anymore.

There are Common Lisp and Scheme implementations on the JVM (ABCL and SISC, respectively). Furthermore, Clojure exists complete with Software Transactional Memory. This is quite a world we live in.

Re:Long time in the making (1)

aaaaaaargh! (1150173) | about 2 years ago | (#39557835)

Check out Racket [racket-lang.org] . It is fast, comes with "batteries included", and even has a fairly feature-complete cross-platform GUI toolkit. It even has its own built-in web server.

Some people claim it's no longer Scheme, though, because Racket lists are immutable.

Re:Long time in the making (0)

Anonymous Coward | about 2 years ago | (#39562251)

Mutable lists moved to their own library in R6RS and are deprecated anyway.

I tried Guile recently... (2)

JanneM (7445) | about 2 years ago | (#39555269)

...and I like it; surprisingly so. Scheme is off-putting at first (and Andy Wingos blog posts aimed at long-time seasoned users don't help) but once I sat down and really wrote something in it it turns out to be very expressive and readable.

What Guile needs, I think, is better packaging. Make a full-featured package set for the most popular platforms with the libraries you need to do real, fun stuff. Things like the Cairo and SDL library bindings for instance, and UI bindings.

The libraries you want already exist and work well, but installing them by hand is a pain, especially when your aim is to learn the language, not deal with installation issues.

Then add a set of docs to get things rolling. Docs for the libraries (the Cairo bindings have none; you basically use the C version docs.) A few Hello World-ish tutorials to get going with UI, graphics, communication, language bindings and so on, together with a general introduction to Scheme and Guile. Again, I think most of it is out there already, just not assembled and packaed in an accessible way.

It's a really good system; shame to see it so underused.

Why not Common Lisp? (1)

ChunderDownunder (709234) | about 2 years ago | (#39555747)

They might want to talk to this guy [tromey.com] who is translating the C source code of emacs into common lisp. No embedded Guile, the whole thing is running on lisp!

Re:Why not Common Lisp? (1)

Anonymous Coward | about 2 years ago | (#39557961)

> Why not Common Lisp?

For three reasons:

1. Political: GNU doesnt have an own high quality Common Lisp implementation so they would have to base Emacs on a non-GNU implementation and ignore their own existing "extension language". Guile ist the best the GNU project has to offer and several other projects are already using it, while no other gnu project uses Common Lisp.

2. Practical: It is easier to implement the whole of elisp in guile and then to swap guile into emacs instead of the current elisp implementation in C, than it is to rewrite the whole C backend of emacs in Common Lisp, which is what Tromey is attempting.

3. Practical: Unlike guile, whcih ahs been designed from the start to be embeddable, Common Lisp implementations are not available as embeddable libs, so you cant do with them what they are attempting to do with guile. ECL is supposed to be able to do this, but it is still in a state of high flux, and I've never seen it anywhere in the wild. Guile, on the other hand, has been reliably powering applications (GnuCash, gEDA, Texmacs, Lilypond) for at least 15 years.

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account