5 ms·
Gerbil – An opinionated dialect of Scheme designed for systems programming
- roma1n 9y agoFor the uninitiated, how does this compare to guile?
- ratboy666 9y agoBased on Gambit-C: A scheme to C (or javascript... and I think there may be other targets) compiler. Comes with a Scheme->target compiler, then compile that code, and deploy. So, you write in Scheme, and deliver in C... Comes with an interpreter. Supports macros, etc. and Gambit supports easy C FFI, option for infix syntax, massive threading, full numeric tower Easy to hack on (in my opinion), and performs very well. Gambit-C has been my "goto" Scheme for the past decade. Could be used as an "extension language", but not its main purpose. Mostly, a way to deliver Scheme code that runs fast. Racket has a better IDE -- but I like the simplicity of Gambit-C.
- WindowsFon4life 9y agoGambit is amazing. And gerbil brings a lot of batteries to it.
- ClFromEmacs 9y agoSupports r7rs, networking, leveldb, lmdb, mysql, and is very fast.
- jblow 9y agoWhy do people keep thinking they can use a garbage-collected language for “systems programming”?
- inetsee 9y agoA search on "non-blocking garbage collection" turns up almost a million hits.
- tokenrove 9y agoWell, it's been happening since the '80s when several OSes were written in ostensibly garbage-collected languages. So it might be a little late to complain.
- tom_mellior 9y agoWhy do people keep thinking that "systems programming" is a term with a well-defined meaning? I've seen it used for anything from operating system kernels to database systems to anything that talks to the network to command-line utilities like ls. Garbage-collected languages are fine for all of these except maybe kernels. But even there, you might use a system that lets you do critical sections in a mode where the GC is disabled, or in a sublanguage that is guaranteed to be GC-free.
- CoolGuySteve 9y agoI always wonder exactly what kind of "systems" these people are programming, clearly not any with real-time constraints. It almost seems like "systems programming" got co-opted to mean "not interpreted". At least that's what I noticed with Go's marketing. There are a few HFT firms, most notably Virtu, that use Java. But my understanding from having interviewed people that worked there is that it's so convoluted to avoid GC pauses that you might as well be using C++.
- naasking 9y agoReal-time GCs with microsecond latencies do exist.
- kazinator 9y agoMany operating systems that use manual memory allocation and/or reference counting techniques are nevertheless unsuitable for real time. Modern desktop and mobile device operating systems often exhibit embarassing lulls in responsiveness that resemble pauses in a rudimentary garbage collector. Real-time operation can be "bolted on" to a non-real time operating system as a small specialized kernel which has higher priority access to the CPU and its own, separate resource management.
- geofft 9y agoI don't tend to think of hard realtime as "systems programming". It's related in that a lot of the good languages for one are good for the other, but they don't seem like the same fundamental problem space - note that almost no OS kernels and even fewer base userspace layers (libc or equivalent, coreutils or equivalent, etc.) are hard realtime.
- astrobe_ 9y agoIt seems to md that systems (with a 's') programming was a term lntroduced by Go, and I always understood it has something with a wider scope than system programming - actually "intermediate level" applications for which a GC is acceptable both time-wise and space-wise. Yet for system (without 's') programmers (kernel, driver or embedded systems devs for instance) a GC is still a no-go.
- flavio81 9y ago>Why do people keep thinking they can use a garbage-collected language for “systems programming”? Why do you think it can't be done? It was already used for systems-programming in the early 80s; whole machines were programmed in Lisp in low level: TI Explorer, Xerox workstations and others.
- rfreytag 9y agoI distinctly remember waiting quite a long while with my Symbolics locked up while it completed a GC.
- flavio81 9y agoCan't help but recall this quote: "Bad response time doesn't bother the Real Programmer -- it gives him a chance to catch a little sleep between compiles. " -- from "Real Programmers Don't use Pascal" http://web.mit.edu/humor/Computers/real.programmers http://web.mit.edu/humor/Computers/real.programmers
- TeMPOraL 9y agoGCs are better these days. And you're much more likely to wait on IO anyway, at every granularity level in the system.
- cat199 9y agoI distinctly remember waiting quite a long while with my PC locked up while it completed a Win32 load.
- e12e 9y agoBecause of lisp machines, Smalltalk/the Alto - the popularity of java and the popularity of golang? As well as a disagreement about what "systems programming" means? But when you can do real-time video processing in an (at the time) young alternative implementation of python[1] - I'm not sure what we're arguing about anymore..? [1] https://morepypy.blogspot.no/2011/07/realtime-image-processing-in-python.html https://morepypy.blogspot.no/2011/07/realtime-image-processi...
- kazinator 9y agoMy guess would be because it's been done since the dawn of electronic computing.
- tentaTherapist 9y agoBecause it's a term that means nothing but makes for good marketing.
- yawaramin 9y agoBecause they keep being able to do it: https://mirage.io/ https://mirage.io/
- deleted 9y ago[deleted]
- zitterbewegung 9y agoHow does this compare to prescheme from scheme48? http://www.s48.org http://www.s48.org https://en.wikipedia.org/wiki/PreScheme https://en.wikipedia.org/wiki/PreScheme
- kovrik 9y agoCan anyone explain why there are so many implementations of Scheme written in Scheme? What is the point of doing that (apart from learning purposes)? I know, for example that people want Racket VM to be implemented in Chez Scheme because Chez is super fast. But what about all other implementations? Also, as I'm currently writing R5RS/Clojure hybrid in Kotlin, can anyone please share any _simple_ standard algorithm of implementing r5rs macro system and macro expander? The only thing I could find is https://www.cs.indiana.edu/chezscheme/syntax-case/ https://www.cs.indiana.edu/chezscheme/syntax-case/
- huntie 9y agoI think it's usually to provide extra features. For example, Gerbil has a more advanced macro and module system than most Scheme implementations. It's also very easy to do because you're bascially given an AST for your new Scheme that you transform into the base Scheme. Gerbil's docs have an example of this: https://github.com/vyzo/gerbil/blob/master/doc/tutorial/lang.md https://github.com/vyzo/gerbil/blob/master/doc/tutorial/lang...
- xfer 9y agoThe well-known algorithm for macro expansion is mark-and-rename. Although the racket implementation was later changed to scope-sets(http://www.cs.utah.edu/plt/scope-sets/index.html http://www.cs.utah.edu/plt/scope-sets/index.html).
- noelwelsh 9y agoScheme has a strong tradition in programming pedagogy---it is the language used in SICP and other classic books---and writing Scheme in Scheme is what many of these books build up to. So writing your own Scheme implementation is a natural thing for many Scheme programmers to do. As for Racket, IIUC the plan is to migrate the current C VM to a Scheme one building on Chez Scheme. It won't be that Racket will be running on Chez. The Racket fork of Chez and Racket itself will be one and the same thing.
- nemoniac 9y agoAlready a handful of "how does this compare...?" postings but the standard for a systems-programming scheme is scsh, a find abstraction layer over POSIX dating from the nineties. https://scsh.net/ https://scsh.net/
- Naac 9y agoI think maybe there is a different interpretation of the words "systems programming"? I took it to mean a scheme used for developing close to the hardware programs, where as maybe others are taking it to mean a language which can be used to write common scripts and tools used by Systems Engineers.
- xfer 9y agoClose to the hardware can also be done with scheme and indeed has been done in the past. Look at all the smartcards, running a JVM. For scheme, it just requires some engineering effort and there is not much demand for it. Btw, there is picobit(https://github.com/stamourv/picobit https://github.com/stamourv/picobit) which can be run on micro-controllers.
- mschaef 9y agoPreScheme serves the same sort of role within the Scheme48 ecosystem. It's been a while since I've looked at Scheme48, but if I remember right, the VM is written in PreScheme, which is usually compiled down to either C or machine code. However... you can also run PreScheme code within Scheme48, so that it's possible to test/update the VM semantics without actually compiling down to C for each dev cycle.
- cat199 9y agoThat wasn't the point of parent - scsh is purely interpreted and interfaces well with user-level programs but was being put forth as a systems-programming tool - while this works for some definitions of systems programming, it doesn't for others, and it is this distinction that the parent was pointing out.
- 9y ago
- xfer 9y agoHere is some context on Racket vs Gerbil by a well-known Common-lisp Programmer, François-René Rideau : https://fare.livejournal.com/188429.html https://fare.livejournal.com/188429.html
- e12e 9y agoSome excellent comments there. Looking around a bit, I came across a couple of implementations that might be of interest for those wanting to mash up "some kind of system programming" and "scheme": Bigloo (interpret / compile to executables, java byte code or experimentally dot.net) and larceny (interpret / direct compile to machine code / optionally via c): http://www-sop.inria.fr/mimosa/fp/Bigloo/ http://www-sop.inria.fr/mimosa/fp/Bigloo/ http://www.larcenists.org/ http://www.larcenists.org/
- metaobject 9y agoI used Bigloo years ago to build Scheme bindings to a few of our C applications and libraries. It's so much more fun to script your applications - similar to how your can/could script The Gimp with SIOD (Scheme in one Defun) Scheme.
- WindowsFon4life 9y agoTry building a modern project in either. Anything non-trivial will highlight where Gerbil stands out.
- e12e 9y agoI'd be happy to see some example non-trivial, new(ish) projects in any scheme, actually. Hop looks like one such project, I don't know if gerbil would be better as an underpinning than Bigloo? https://github.com/manuel-serrano/hop https://github.com/manuel-serrano/hop
- cat199 9y agoChicken Scheme https://www.call-cc.org/ https://www.call-cc.org/ is another good one - compiles to binary, many libraries (eggs)
- jbclements 9y ago(Mostly just hoisting Noel Welsh's comment to the top level) How will the expected upcoming move of Racket to the use of Chez affect the comparison between Gerbil and Racket? I'm trying not to set my expectations too high. BTW: RacketCon! This weekend!
- baldfat 9y agoI am super excited for Chez. If we see the speed we are look at a possible doubling in speed. There is certainly a reason why he has stuck with Gambit and not my beloved Racket. This seems perfect for using Racket's macros. I just don't know Gambit's Macros well enough to compare them to Racket. Here is the Bench Marks for Chez, Racket and Gambit https://ecraven.github.io/r7rs-benchmarks/ https://ecraven.github.io/r7rs-benchmarks/
- WindowsFon4life 9y agoGerbil is there as well.
- 616c 9y agoNo way!!! Holy crap balls will this get interesting. To be clear, is this what mflatt's racket7 repo is all about!? This is what I found from quick Googling. https://github.com/racket/racket7 https://github.com/racket/racket7 Is this like research work like Pycket (Racket on PyPy) or is this a blessed project and Rackets official implementation will cut over
- capnrefsmmat 9y agoIt's the official goal of Racket to be based on Chez in the next couple years: > TL;DR: I expect the main Racket distribution to run on Chez Scheme instead of the current Racket VM sometime in the next couple of years. https://groups.google.com/d/msg/racket-dev/2BV3ElyfF8Y/4RSd3XbECAAJ https://groups.google.com/d/msg/racket-dev/2BV3ElyfF8Y/4RSd3...
- ClFromEmacs 9y agoThe link should have been to http://cons.io http://cons.io See Freenode #gerbil-scheme for active development and help. So far it is very nice and about twice as fast as sbcl.
- WindowsFon4life 9y agohttps://ecraven.github.io/r7rs-benchmarks/ https://ecraven.github.io/r7rs-benchmarks/ recent addition to the charts, and is doing quite well.
- nextos 9y agoYes, Chez & Stalin are the fastest in these benchmarks, which seems to match what the community usually answers when asked about quick implementations. Sadly Stalin is unmaintained. Its whole program optimization techniques were really advanced. I remember it even got my ivory-tower professors, who were big in the static analysis field, excited. Now, a tricky question. I'm mostly unfamiliar with Scheme for writing real-world code. Will the ongoing merger of Chez with Racket make the latter a clear winner in the Scheme camp? How are libraries and FFI? A problem with Scheme is excessive fragmentation. Having a clear winner would be cool for library support. Racket is great due to multiple paradigms and DSLs [1]. I hope it eventually becomes a very practical Lisp with all Mozart/Oz semantic goodies. I am trying to do all my projects in a Lisp. Lately this is either Clojure or SBCL. Both have good libraries and decent FFIs. Clasp (Common Lisp on LLVM) [2] has gotten me excited, as good interfacing with C++ will be great to access a lot of quick numerics code. [1] https://beautifulracket.com/appendix/domain-specific-languages.html https://beautifulracket.com/appendix/domain-specific-languag... [2] https://github.com/drmeister/clasp https://github.com/drmeister/clasp
- ClFromEmacs 9y agoR7RS ftw.
- Johnny_Brahms 9y agoI feel that not standardising a low level FFI for r7rs large is a mistake. They should at least recommend some reasonably low level stuff that can be used to build abstractions.
- cat199 9y agoAgree with the sentiment, but at the same time understand the rationale - FFI implies alot of GC/memory internal interfacing stuff, and to some extent expects a c-based implementation (not e.g. JVM,CLR,etc). If r7 & library interface are widely adopted, some flavors of FFI could evolve within the library/srfi process and gradually become defacto standards.. Probably hoping too much.. but in any event..
- dogruck 9y agoCan anyone briefly summarize the points of debate and optimization? I'm not familiar with the competing kit, and the primary goals.