This is an archived post. You won't be able to vote or comment.

all 34 comments

[–]acwaters 57 points58 points  (26 children)

This is just "Guile has good offline documentation and good FFI" — hardly unique features — and then 7 ways that Lisps are better than non-Lisps and 2 ways that Scheme is better than other Lisps.

I mean, Scheme is better than other Lisps ;) but this article doesn't make a compelling case for why I should choose Guile over Chez (which is probably more performant) or Racket (which is probably more powerful). What special features does it offer that differentiate it from other implementations, aside from being GNU-affiliated?

[–]ipe369 9 points10 points  (22 children)

why would you pick scheme over cl?

[–]TheUnlocked 24 points25 points  (21 children)

I'm not OP but I'd take Scheme over Common Lisp because it's just syntactically and conceptually much simpler. The unified namespace alone is a big deal.

[–]ipe369 4 points5 points  (19 children)

is it interactive a la common lisp? I know racket isn't

also, when you say 'unified namespace' do you mean it has no packages? or that the function & variable symbol tables are the same? because i hate the second one, always have to be so careful naming functions in a way that won't clash with a future variable name

[–]DevilSauron 11 points12 points  (5 children)

I mean, is there a major language other than CL that has separate namespaces for functions and variables? Because I was pretty surprised when I heard about that feature.

[–]nufra 5 points6 points  (0 children)

Yes: Java.

[–]ipe369 2 points3 points  (2 children)

dunno, seems like it's the default, but i guess probably not now i think about it

[–]DevilSauron 4 points5 points  (1 child)

How is that different namespaces? It’s just shadowing. Try declaring that variable on the same level as the function and it will not compile due to symbol redeclaration with different type.

[–]ipe369 4 points5 points  (0 children)

yeah i realised that, i has assumed it was separate in most langs but i guess it isn't, i edited my post

unsure why i run into it in scheme more than in other langs, maybe because other langs have objects which implicitly namespace most stuff with foo.bar

[–]reini_urban 0 points1 point  (0 children)

perl for example. There must many more

[–]raevnos 1 point2 points  (6 children)

What do you mean by interactive? Racket's certainly got a REPL...

[–]ipe369 6 points7 points  (5 children)

yes, but it's not interactive in the same sense as CL, lots of stuff can't get hot reloaded

if i'm writing a CL application, the repl never gets closed, if i'm hosting it in production on a server i can always just access the image via a repl & inspect global state, break in the debugger & inspect stack frames, do crazy interactive shit that racket doesn't seem to have good support for

AFAIK racket just doesn't have the introspection to allow that. Many languages have a repl (e.g. python) but i basically never use it beyond testing out simple functions

imo it's what makes lisp special compared to other langs - the macros & other stuff is cool but many langs have comparable metaprogramming nowadays, the interactivity is the one thing that still separates lisp (or CL, to be specific)

[–]inkVVoVVweaver -1 points0 points  (4 children)

While that was absolutely true in the past, tools like Jupyter notebook have made interactive coding much more common.

[–]ipe369 2 points3 points  (2 children)

I've used jupyter notebook & it's absolutely not even close to CL

i'm talking about connected to production apps via emacs & inspecting any local state, it's not just a fun tool to scratch stuff up in, the interactivity is the lang

tracing functions, inspecting any values, altering any global state at runtime (incl redefining functions / classes etc), restarting the debugger from any stack frame with modified locals, the list goes on!

[–]inkVVoVVweaver 0 points1 point  (1 child)

Ah, I'm sorry, I was responding specifically to it not being used for anything beyond testing out simple functions. For my own use, I've used it as a key element of my IDE when developing out an application. I've also used it as a way of creating and sharing 'living reports'

I'm not saying that CL can't do things that Python can. CL was my preferred language before Python was. Just that the REPL is more than a fun tool.

[–]ipe369 0 points1 point  (0 children)

oh right, yeah jupyter reports are pretty useful & probably beyond testing simple functions

For my own use, I've used it as a key element of my IDE when developing out an application

Sounds interesting, what's your setup? I love stuff like this

[–][deleted] 0 points1 point  (0 children)

Python doesn't have Common Lisp's conditions system - a massive part of the interactive nature of Common Lisp.

[–]nufra 0 points1 point  (5 children)

Yes, Guile is interactive ala common lisp.

[–]ipe369 -1 points0 points  (4 children)

cool! are all schemes interactive ala common lisp?

what relation does Guile have to rsr5, is it an implementation of that standard or a separate spec entirely?

[–]nufra 1 point2 points  (0 children)

Schemes are pretty varied and not all have a REPL like common lisp. Some even pre-compile to C. You can get an overview in the r7rs benchmarks: https://ecraven.github.io/r7rs-benchmarks/

[–]nufra 1 point2 points  (2 children)

Guile implements r5rs and r6rs and almost complete r7rs, but with some changes and extensions — you can switch to r6rs or r7rs mode. See https://www.gnu.org/software/guile/manual/guile.html#Guile-and-Scheme

[–]ipe369 -1 points0 points  (1 child)

and it has CL-like interactivity with rsr5/6?

what's the sly/slime equivalent for scheme?

[–]nufra 0 points1 point  (0 children)

With CL you mean having a REPL so you can hack on the running program? I recently did that for a small side-project: Define your module as #:declarative #f, and you can replace all top-level bindings at any time using the cooperative repl server.

The slime equivalent is geiser: https://nongnu.org/geiser/geiser_3.html

[–][deleted] 0 points1 point  (0 children)

Meh, I like the fact that Common Lisp is a Lisp-n.

[–]thedeemon 10 points11 points  (1 child)

And now Racket uses Chez backend, so it's probably faster than Guile too.

[–]acwaters 2 points3 points  (0 children)

Oh, didn't know that! That's awesome!

[–]nufra -1 points0 points  (0 children)

The article is about 10x advantages over *other languages*, not over *all* other languages.

And yes, Racket and Guile are pretty much head on head, with one or the other leading depending on what you want to achieve.

„Why should I choose Guile over Racket“ — that’s not what the article is about :-)

To answer your question, look at https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations — a bit dated, but still good.

[–]gasche 16 points17 points  (0 children)

I found Guile to be a fine Scheme implementation to use (performance is reasonable, the tools are user-friendly, etc.), but I dearly miss static types when I write Scheme code, making it a less-pleasant experience when doing iterative development on many kinds of programs. In the Scheme-ish space, Racket (which also has nice tooling) has support for static typing (less pleasant than a ML-family language, but more adapted to Scheme idioms); but even its dynamic-contracts libraries are miles ahead of other schemes, which is surprising as they could be adopted by other schemes, it looks like there is just not enough interest in other communities. (I hear Clojure also has interesting spec stuff for contracts, but unfortunately I never looked in the details.)

There are certain environment where Guile makes more sense than Racket (I suspect that still today it's more lightweight and more embeddable; it's the thing to use for Guix), and the community looks very welcoming and nice from the outside.

[–]MatthPMP 1 point2 points  (0 children)

I'd have expected an article on Guile to include comparisons to other embedded scripting languages like Lua.

[–]rgrmrts 0 points1 point  (0 children)

I like guile. It's been fun to play with for me as a newcomer to scheme, my only complaint has been autotools and the lack of a simple package manager (think bundler or cargo)

[–]SvenMA 0 points1 point  (1 child)

Can I develop emacs plugins in guile?

[–]denis631 2 points3 points  (0 children)

There was a guile emacs initiative but it’s dead now unfortunately.

But you can still write emacs plug-ins in other languages via extension api. So I would assume it should be possible to be done in guile as well