9 ms·
GNU Guile 3.0
- bjoli 7y agoThis is fantastic news. Speedups across the board and lots of small goodies everywhere! Previously I had been using macros to bolt-on support for definitions in expression context, but that was buggy at best. If you have time you should look at the algorithm behind this letrectification. The paper is called "Fixing letrec (Reloaded)" and can be found here: https://legacy.cs.indiana.edu/~dyb/pubs/letrec-reloaded.pdf https://legacy.cs.indiana.edu/~dyb/pubs/letrec-reloaded.pdf This means letrec is now just as fast as let, which means (define ...) at the top of functions now is as fast as (let ...). For small functions called often, that could add quite a bit of overhead.
- pjmlp 7y agoJIT support, great news.
- MaxBarraclough 7y agoThe JIT uses a fork of the GNU Lightning JIT engine. The fork has the best/worst name imaginable: Lightening. [0] [1] [2] [0] https://wingolog.org/archives/2019/05/24/lightening-run-time-code-generation https://wingolog.org/archives/2019/05/24/lightening-run-time... [1] https://www.gnu.org/software/guile/docs/master/guile.html/Just_002dIn_002dTime-Native-Code.html#Just_002dIn_002dTime-Native-Code https://www.gnu.org/software/guile/docs/master/guile.html/Ju... [2] https://gitlab.com/wingo/lightening https://gitlab.com/wingo/lightening
- jhoechtl 7y agoIsn't Guile VM the VM behind Racket?
- rgrau 7y agoRacket team are in the process of migrating to Chez, not Guile.
- samth 7y agoThis is correct, however much of the work we've done to make Racket work using the Chez VM could be re-used to build a Guile-backed version of Racket. It's not clear whether that would be of significant value, but it's doable.
- bjoli 7y agoAndy has, tongue in cheek, said he wants to beat chez :)
- deleted 7y ago[deleted]
- hencq 7y agoIs there still any work being done on Guile Emacs? As I recall it basically worked a few years ago, but it doesn't seem to be maintained. I'm curious if these 3.0 speedups would translate there too.
- bjoli 7y agoGuile runs elisp just fine, although there are quite some low hanging optimization fruit to be picked. From the Emacs side I strongly doubt it will happen. The discussions that have been going on for faaaar less intrusive changes is staggering. Reading the discussions about the portable dumper (new in the upcoming emacs 27, proposed in 2014) is a nice 4 hours. That was in just about every measurable way a step forward for Emacs, yet it took almost 4 years for it to be mainlined,despite glibc more or less deprecating the old unexec from under emacs' feet. I might be misrepresenting just about everything here, but one thing I am pretty certain of: guile Emacs will never happen, despite the promises of running elisp on guile.
- pzone 7y ago> Guile runs elisp just fine While this may be the case, my understanding was that once the codebases were combined and guile-emacs builds were brought online, they encountered a severe performance drop from vanilla Emacs due to back-and-forth string conversion between Guile's Unicode strings and the Emacs internal enhanced string type. I thought that the project was abandoned after finding no obvious resolution to the problem short of a complete rewrite of all Emacs string handling.
- bjoli 7y agoThat was only a problem for scheme interop, since guile's elisp uses emacs extended UTF8 strings.
- yepguy 7y agoI think it could potentially happen by way of a fork, similar to the history of GCC and EGCS, but it would take a dedicated group of hackers to make it happen. Not one guy doing all the work and a bunch of Guile fans on the sidelines cheering for him.
- levosmetalo 7y agoThe only reason Guile still exists is the stubbornes of GNU project to accept better alternative solutions over the course of time and push their own as the only true.
- kerkeslager 7y ago...which is a great thing if you want to write code that will still run in 30 years. If you're writing code geared toward a company's quarterly report, the long-term doesn't matter, but that's not everyone's goal.
- chrisseaton 7y agoI don't really know where you're coming from - Guile is a leading implementation of Scheme. It's valuable by itself.
- lloda 7y agoI've been a Guile user since 2001 or 2002 and all these years it's been a workhorse for me. Even before there was a compiler or before the compiler started getting better, Guile was a solid choice for embedding. Each of the alternatives had issues. Now that Scheme runs faster I get to write more Scheme and less C and I couldn't be happier.
- nrclark 7y agoExcited by the new release. I learned a little bit of Guile for scripting in Make, and I dig it. It's a little hard to include in my own designs though, as much as I'd like to do it. If I had a wish-list, it would be: - Make some of the dependencies (especially libgc) internal. - Reduce the installed size. - Consider adding a license exception that allows using Guile without inheriting GPLv3's Installation Instructions requirement, which prevents inclusion on a lot of commercial products (even as a standalone program for running scripts). The Guile team is doing great work, and I'll enjoy trying out 3.0 once it hits my distro packages. I just wish that it slotted better into more systems. There's some humor in the idea that Guile started out with the stated goal of being a Tcl killer. Years later, a Guile install is almost 8 times the size of a Tcl install and it introduces significant external dependencies. The licensing is also worse for inclusion in larger systems.
- JNRowe 7y ago> [make guile extensions] Just a note from someone who was bitten by GNU make and guile integration last year. Huge numbers of systems have old make versions with no support for guile extensions¹, and many systems that do have new enough releases require a separate package² to use it. And yeah, I'd written all my fancy integrations before figuring out they'd be worthless :/ It did allow me to noodle over the build system for long enough to come with some real improvements though, so it wasn't all wasted. 1. Some presumably to stay on pre-GPL3 make 2. make-guile on Debian for example.
- nrclark 7y agoI had the same experience. I think the slow adoption of Make's Guile extension is precisely because of its larger dependency load. If Guile had the same set of dependencies as GNU Make, I bet we'd see more distros turn it on by default.
- JNRowe 7y agoFWIW, I switched that same project to meson¹ about six months later with no pushback whatsoever. I expected there to be some, but it went through review with uniform agreement. I'm not sure what that says. `apt install make-guile` vs `apt install meson` don't seem all that different, if it is just about dependencies. I think that means your point on licensing is probably the bigger issue, or that perhaps I just picked the wrong day to open a PR with a guile extension… 1. https://mesonbuild.com https://mesonbuild.com
- jammygit 7y agoIs guile a good choice for going through SICP one day?
- jdormit 7y agoYes. You will be able to recreate the examples and problems exactly as they are written using Guile (or any other R6RS-compliant Scheme).
- sigjuice 7y agoWhat about things that are not part of R6RS like the picture language or parallel-execute?
- cableclasper 7y agoA picture language equivalent can be found here: https://git.elephly.net/gitweb.cgi?p=software/guile-picture-language.git https://git.elephly.net/gitweb.cgi?p=software/guile-picture-...
- cableclasper 7y agoI'm currently doing this and am in the middle of chapter 3. So far, everything has worked fine with guile.
- eeh 7y agoIf you've ever felt a sense of flexibility and freedom writing JS... Scheme takes it one step further. Guile is a great, well documented Scheme implementation. I prefer typing and less flexibility on larger projects, but Guile is my go-to for for small/medium programs. Great to see good work being done on this.
- emmanueloga_ 7y agoI feel like the single most important reason Guile is not more popular is the focus on Linux. It is not even as easy to install it on Mac, afaict. I've seen unofficial binary builds for windows but they are hard to find... and probably they use cygwin? I wish Guile was readily available in other platforms (I wish their downloads page looked like this [1]...), but I'm guessing the main reason it is not is more philosophical than practical. 1: http://www.sbcl.org/platform-table.html http://www.sbcl.org/platform-table.html
- chrisseaton 7y ago> It is not even as easy to install it on Mac brew install guile That's a bottle though. I don't know if it's hard to build but it isn't hard to install.
- tjr 7y agoI've tried to build it on Mac in the past (years ago). I spent hours fiddling with it, and finally gave up and ran brew install guile. It might be better now?
- bjoli 7y agoTBH, isnt this just how compiling things on Mac os is? Every single time it is voodoo-fighting ./configure and sed-ing makefiles.
- tjr 7y agoI have built some other GNU packages without issue. In particular, I remember having easy success with CLISP. But at the same time, I have not needed to try to build a lot of packages, as many are available as pre-built binaries already.
- coldtea 7y agoCan't understand why a Lisp would be hard to build on a Mac or elsewhere. What are the dependencies besides some common C libraries (e.g. for math, unicode handling, etc)?
- mark_l_watson 7y agoCongratulations to the Guile team! I usually use Common Lisp and when I use a Scheme-like language I usually use Racket. However, projects likes Guile (great for scripting applications, the web framework is cool), Chez, and Gambit are much appreciated (I use them all, at least a few times a year). I know that Lisp languages are not the best tool for every application, but using Lisp languages makes me happy so I try to use them whenever possible.
- agumonkey 7y agoVery very very happy to have guile3.0 on my system. Thanks for the hard work and everything.
- wsgeek 7y agoI would like to ask a genuine question (not trying to provoke anyone!). Where is a good use case for Scheme these days (in any form?). I really love the idea of the language but I can't figure out where it really does a _better_ job that these things: -- JavaScript/Typescript for in-browser or even some server-side stuff (e.g., NodeJS) -- Python seems to be dominant for non-browser code that doesn't need to be fast (or which needs to call Python libraries) -- C/C++/Rust/C# in the performance space -- And then the workhorse Bash/ZSH etc for command-line script-fu I am sincerely asking, what's the nice good fit for a Lisp these days? I know Emacs uses it as its internal language -- fair enough. But other than that. Thanks and I did not mean to hurt anyone's feelings, I just really am curious.
- Koshkin 7y agoScheme is just yet another general-purpose programming language, it does not serve any specific use case. (Particular implementations might, though.)
- hajile 7y agoI'd say scheme fits into the python niche rather well. It's faster, easy to learn, and usually has good C interopt (or great interopt in the case of ones like chicken). <stands on soapbox> Scheme: fix your damn documentation I have to know that SRFI (scheme request for implementation) is a thing. Then I have to look over hundreds of them to find the one I want (do I want SRFI 69, 90, 125, or 126 for hash tables?). Then I have to find that obscure doc somewhere that says which SRFI are supported. Then I have to read the specification doc as the only source of documentation on https://srfi.schemers.org/ https://srfi.schemers.org/.
- rscho 7y agoProgramming language research. Nothing better than scheme for that. Also quite good for building small programs with no/minimal depencies from scratch. Which I suspect reduces to my first statement...
- cyberpunk5000 7y agoScheme has been the 50th most popular language for 50 years running. It has never been the best language for any particular use case, but it has been good enough to inspire a community to keep it running and relevant all this time. If you made the same kind of list of 4 languages that dominate all use cases back in 1990 (say), Scheme wouldn't have made the list then either; BUT the 4 languages would be different than they are now. If you want the most frictionless and popular language for the tech stack of the moment, use the trendy language du jour, but you have to live with neverending churn. If you want a language that is perpetually "good enough," use something like Scheme. There are use cases where longevity and inoffensiveness are important. Embedded scripting, the original motivation for Guile, is one of them. Scheme is my go-to for little personal utility programs. After a long day of dealing with headaches from trendy environment du jour, I want to come home to something that's bulletproof, just works, and I already know. The minimalism and clarity make it a good first learning language. It seems like it'd be good for code "for the ages" like reference implementations and government software, but AFAIK there hasn't been much of that.
- guenthert 7y agoUh, this is all nice and such I suppose, but how do I install it? The README file in the git repository refers to an INSTALL file, which doesn't seem to exist as well as to a ./configure script which doesn't either.
- ken 7y ago./configure is a generated file. It's not committed to the repository. If you download a release (like "guile-3.0.0.tar.gz"), it has the files you're looking for. Or you can learn autotools and do it yourself, but I don't recommend opening that can of worms.
- guenthert 7y agoHmmh, it's been a decade or two since I used the autotools last, so I'll need a hint. I find it slightly disturbing that the README file is of little help though. Further, if I try naively $ sh -x ./autogen.sh then that fails on a dependency on libtoolize, of which I never have heard of and which doesn't seem to be known to bananian.
- nrclark 7y agolibtoolize is a program provided by the libtool package. It's pretty common in the GNU ecosystem, and is used for managing some of the more subtle aspects of build-time and runtime linking. Agreed that the README needs much better documentation of the package-time dependencies (autoconf, automake, m4, perl, etc), and the build-time dependencies (libtool, libgc, plus a bunch of other libraries).
- guenthert 7y agoYeah, that was just my ignorance which a quick search on the Imterwebs remedied. With the bananian (Debian) package 'libtool' installed (and flex and libunistring-dev) $ sh -x ./autogen.sh completes successfully and I got a ./configure and a INSTALL file (don't recall having seen an INSTALL file be autogenerated, but my memory might very well be failing me there). The './configure' also completes successfully (after a while -- seems like autoconfigure still believes that there are other Unices besides Linux left ;-} but 'make' eventually fails with --8<-- [..] CC libguile_3.0_la-intrinsics.lo CC libguile_3.0_la-ioext.lo CC libguile_3.0_la-jit.lo jit.c:232:1: error: initializer element is not constant static const jit_gpr_t THREAD = JIT_V0; ^ jit.c:237:1: error: initializer element is not constant static const jit_gpr_t SP = JIT_R0; ^ [..] -->8-- I'll try again with 3.1 ...
- ncmncm 7y agoCongratulations, Andy! I have been following along since you first picked up Guile and began running with it. Displacing badly-designed, slow scripting languages is the natural home for Lisp, and Guile is the right vehicle for it.