HN Gopher Feed (2017-10-03) - page 1 of 10 ___________________________________________________________________
Gerbil - An opinionated dialect of Scheme designed for systems
programming
79 points by cmpitg
https://github.com/vyzo/gerbil___________________________________________________________________
ClFromEmacs - 8 minutes ago
The link should have been to 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.
[deleted]
xfer - 1 hours ago
Here is some context on Racket vs Gerbil by a well-known Common-
lisp Programmer, Fran?ois-Ren? Rideau :
https://fare.livejournal.com/188429.html
e12e - 1 hours ago
Some 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.larcenists.org/
DigitalJack - 25 minutes ago
Thank you for posting this.
kovrik - 2 hours ago
Can 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/
xfer - 1 hours ago
The 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).
ClFromEmacs - 1 minutes ago
Can someone explain these sort of questions?
huntie - 2 hours ago
I 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...
kovrik - 2 hours ago
Can these 'more advanced' features be implemented in, say,
Racket/Guile/Chez?
jbclements - 1 hours ago
I'm afraid I literally laughed out loud at your request for a
simple standard algorithm for r5rs macro systems. However, it's a
sympathetic laugh. Macro Hygiene is still very hard, principally
because (I claim) there's not yet a clean and widely accepted
model for it. Matthew Flatt's "sets of scopes" model is (IMNSHO)
the current leader. Time will tell whether he or anyone else
comes up with a simpler and more widely accepted model. But yes:
as an implementor, it "feels" very heavy, and you keep thinking
that there must be a simpler solution to this problem (aside from
just throwing the problem out and giving up on hygiene and
language composability).
kovrik - 1 hours ago
Yeah, you are right. I've already implemented everything from
r5rs, but macro system. And I don't know where to start, just
can't wrap my head around it.And people say that Scheme has a
very minimalist design and is easy to implement...
noelwelsh - 1 hours ago
Scheme 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.
roma1n - 3 hours ago
For the uninitiated, how does this compare to guile?
ClFromEmacs - 2 minutes ago
Supports r7rs, networking, leveldb, lmdb, mysql, and is very
fast.
ratboy666 - 2 hours ago
Based 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 towerEasy 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.
nemoniac - 2 hours ago
Already 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/
Naac - 2 hours ago
I 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 - 1 hours ago
Close 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) which can be run
on micro-controllers.
jblow - 3 hours ago
Why do people keep thinking they can use a garbage-collected
language for ?systems programming??
inetsee - 3 hours ago
A search on "non-blocking garbage collection" turns up almost a
million hits.
flavio81 - 2 hours 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.
tentaTherapist - 49 minutes ago
Because it's a term that means nothing but makes for good
marketing.
e12e - 2 hours ago
Because 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-processi...
tom_mellior - 2 hours ago
Why 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.
kazinator - 1 hours ago
My guess would be because it's been done since the dawn of
electronic computing.
CoolGuySteve - 2 hours ago
I 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++.
geofft - 44 minutes ago
I 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.
naasking - 2 hours ago
Real-time GCs with microsecond latencies do exist.
kazinator - 1 hours ago
Many 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.
tokenrove - 3 hours ago
Well, 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.
zitterbewegung - 3 hours ago
How does this compare to prescheme from
scheme48?http://www.s48.orghttps://en.wikipedia.org/wiki/PreScheme
jbclements - 1 hours 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!