10 ms·
Perchance to Scheme (2016)
- threatofrain 8y agoThe author concludes with: > Oh, and one last thing. I feel it’s obligatory at this point for me to say, please don’t spend too much time researching Scheme dialects. Just pick Racket and start coding.
- merlincorey 8y agoI prefer Chicken Scheme, which recently just had a new release (version 5). It actually compiles to C and then to binaries for your specific platform. Check it out: https://www.call-cc.org/ https://www.call-cc.org/
- nerdponx 8y agoThe fact that Chicken actually has a package manager and central repository is a big plus for me.
- GeoffKnauth 8y agoRacket also has a package manager and central repository.
- WindowsFon4life 8y agoGerbil has a package manager too.
- nerdponx 8y agoI know this is a big controversial can of worms, but as a filthy casual who just happens to like Lisp, the idea of R6RS is pretty appealing to me. This post seems very much R5RS-oriented. Are there any R6RS-conformant Schemes that are recommended?
- kkylin 8y agoNot a R6RS fan myself, so no definitive answer. But AFAIK Chez (now open source as someone else posted) is R6RS-compliant and one of the fastest implementations. Also, R7RS-small is final I think. Not sure about R7RS-large. Here's an old discsussion: https://news.ycombinator.com/item?id=11700167 https://news.ycombinator.com/item?id=11700167.
- gus_massa 8y agoRacket has an official R5RS and an official R6RS modes (you must start your program with #lang r6rs or with #!r6rs) and also an unofficial R7RS mode.
- gus_massa 8y agoA minor update: Now Chez Scheme is open source (Apache license) https://github.com/cisco/chezscheme https://github.com/cisco/chezscheme
- GeoffKnauth 8y agoRacket is now integrating the best parts of Chez Scheme, for a future release.
- dTal 8y agoRacket-on-Chez will be considerably slower than vanilla Chez - Racket semantics incur some overhead. Here are some rough benchmarks from a year ago: http://blog.racket-lang.org/2018/01/racket-on-chez-status.html#%28part._benchmarks%29 http://blog.racket-lang.org/2018/01/racket-on-chez-status.ht...
- i_feel_great 8y agoOther schemes that may be of use: 1) Gambit. Compiles to C. Interesting tools built on top are Termite (Erlang-like concurrency framework) and Lambdanative 2) TinyScheme - super minimalist embeddable scheme. 3) Kawa Scheme - on JVM. Much smaller and faster than Clojure when I used it last. 4) Bigloo - can compile to C & Java bytecode. Note ChezScheme is now open source and has very good documentation.
- snaky 8y agoTo add to the list, PicoBit Scheme for microcontrollers, currently PIC18 and ARM, https://github.com/stamourv/picobit https://github.com/stamourv/picobit There was a port of one of PicoBit predecessors, Bit Scheme, to the XMOS architecture, with realtime GC and support for the native XMOS features http://soft.vub.ac.be/~cderoove/publications/master_thesis_ruben_vandamme.pdf http://soft.vub.ac.be/~cderoove/publications/master_thesis_r...
- sdevlin 8y agoEmacs Lisp is most certainly not a Scheme.
- teddyh 8y agoThe plan is to replace Emacs Lisp with Guile, which is a Scheme: https://www.emacswiki.org/emacs/GuileEmacs https://www.emacswiki.org/emacs/GuileEmacs
- lispm 8y agoNo, that's not the plan. The plan is to replace the Emacs Lisp runtime with a Guile-based runtime. See here: 'is a branch of GNU Emacs that replaces Emacs’s own EmacsLisp engine with the Elisp compiler of Guile.' The word is 'ENGINE'. That's the underlying language runtime. It's neither GNU Emacs right now, nor will Emacs Lisp be replaced.
- erjiang 8y agoI am guilty of writing my own Scheme (R5RS) interpreter as well, and a key takeaway from the experience was that many things calling themselves Scheme interpreters are missing core parts of Scheme. Implementing a language that resembles Scheme is quite easy. Implementing call-with-current-continuation and hygienic macros AND getting the tricky little details correct is not.[0] An analogy might be someone offering "ability to write SQL" for their fly-by-night database without stating up front that joins are not supported. [0] Old test suite run against old Schemes: http://sisc-scheme.org/r5rs_pitfall.php http://sisc-scheme.org/r5rs_pitfall.php
- plinkplonk 8y ago"Implementing a language that resembles Scheme is quite easy. Implementing call-with-current-continuation and hygienic macros AND getting the tricky little details correct is not." (tangential) and this is where most "build your own compiler" style books fall down. They teach you to implement ultra simple languages, but don't tackle memory management/garbage collection, concurrency, production grade typecheckers, and for lisplikes, macro systems, etc.
- nils-m-holm 8y ago> (tangential) and this is where most "build your own compiler" style books fall down. Have a look at http://t3x.org/s9book http://t3x.org/s9book - it covers a Scheme implementation including GC, call/cc, low-level macros, type checking, tail call elimination, etc.
- eatonphil 8y agoYou will love Lisp in Small Pieces [0] then. :) It covers various lisps (mostly Scheme and Common Lisp) including how continuations can be implemented. Hygienic macros are not hard to implement [1]. I can't speak to the efficiency of my implementation though. [0] https://www.goodreads.com/book/show/1168500.LISP_in_Small_Pieces https://www.goodreads.com/book/show/1168500.LISP_in_Small_Pi... [1] https://github.com/eatonphil/bsdscheme/blob/master/examples/ellipsis-syntax.scm https://github.com/eatonphil/bsdscheme/blob/master/examples/...
- 8y ago
- phoe-krk 8y ago> ClojureScript is a compiler from Clojure to JavaScript (Clojure originally targeted Java). It is not a Scheme dialect, not does it feel like one. It’s a LISP dialect. Hell no. The linked website, http://wiki.c2.com/?LispSchemeDifferences http://wiki.c2.com/?LispSchemeDifferences lists differences between Common Lisp and Scheme. Clojure is not a Common Lisp implementation.
- gcornut 8y agoClojure(Script) is neither a Scheme nor an implementation of Common Lisp but is a LISP dialect. LISP dialect languages are simply a group of lisp-like language not just implementations of Common Lisp. https://en.m.wikipedia.org/wiki/List_of_Lisp-family_programming_languages https://en.m.wikipedia.org/wiki/List_of_Lisp-family_programm...
- lispm 8y agoScheme is generally also a LISP Dialect, more so like Clojure, since it inherits many of the LISP features directly. Generally Clojure has very little in common with LISP dialects, besides some concepts. It has no linked lists, almost no functions are the same, almost no macros are the same, no special forms are the same, similar named operators often do something different, ... Think ATOM, CONS, CAR, CDR, APPEND, SETQ, NULL, DOLIST, DOTIMES, ... basically the original core of LISP is not present in Clojure. Literally no Clojure code runs in LISP dialects and no LISP code runs in Clojure dialects -> without completely rewriting it. Some Scheme ran in LISP - with more or less effort to do so. Nowadays that's not very common. Clojure may in abstract terms be a LISP dialect, but the expectation that anything from LISP can be applied directly to Clojure is not the case. You can't take any LISP book and execute the examples in Clojure , nor would it make much sense.
- deleted 8y ago[deleted]
- phoe-krk 8y agoSure that Clojure is a dialect of Lisp, but that statement shouldn't be backed by a link to a website that describes differences between Scheme and Common Lisp. CL and Clojure are two completely different dialects and confusing them for each other is an error.
- nikofeyn 8y agowhat about mit/gnu scheme?
- canuseeme 8y ago> Clojurescript.... Personally, I don’t like it on a matter of principle: I don’t like things that compile to JavaScript. It doesn’t seem like anything you really need to write better code. Maybe I don't understand what the alternative is when you want to write client side code for the browser - js?? I use Clojurescript and find clear benefits. By way of example I often found the general setTimeout functionality to be a nightmare for scheduling delays. Most of the time it works, but periodically I find it blocks or fails (via a dependancy chain) and then have to spend time arranging code abnormally to mitigate. In clojurescipt I use core async. (defn timeout [ms] (let [c (async/chan)] (js/setTimeout (fn [] (async/close! c)) ms) c)) Never looked back. Never had a delay problem - Ever. cljs core.async and many other features have made it so much more enjoyable to write client side code. Don't even get me started on callbacks. > Oh, and one last thing. I feel it’s obligatory at this point for me to say, please don’t spend too much time researching Scheme dialects. Just pick Racket and start coding I've had the opposite experience so thanks, but no thanks.
- all2 8y agoWhat was your experience with Racket?
- canuseeme 8y agoThis dates back about 5 years ago, but I found Racket's libraries were rough. Often they amounted to prototype work that never got fleshed out, they were ill maintained, low in quality, and many just wouldn't load. And these were general purpose libraries; like even just basic database stuff. I moved on to Clojure.
- rgrau 8y agoThere's this new implementation called "gerbil"[1] which runs on top of gambit, is still very young but looks very promising. It's opinionated in a good way (IMHO). [1]. https://cons.io/ https://cons.io/
- JasonFruit 8y agoLooking at it, I'd call it a new language, not a Scheme implementation. Its semantics are much different from Scheme's.
- WindowsFon4life 8y agoUmm superficially you could say it is anything. The reality is it IS Scheme. (define (foo bar) (format "hi ~a" bar)) works just fine. As will any of the Scheme code, as it's merely syntactic sugar, (import :std/sugar) that you are confusing with a whole new language.
- JasonFruit 8y agoLook at things like: (define lst '(4 5 6)) (set! (car lst) 3) (display (car lst)) ;; 3 That's a pretty serious semantic departure. It's at least as different from RnRS as Racket, which insists it is not Scheme.
- kbp 8y agoThere's an SRFI for generalised set! that lots of implementations (Racket, Guile, Chicken, etc) support: https://srfi.schemers.org/srfi-17/srfi-17.html https://srfi.schemers.org/srfi-17/srfi-17.html
- JasonFruit 8y agoNeat. Learn something new every day.
- 8y ago
- drmeister 8y agoAlternatively - you can choose to program in Common Lisp - an industrial strength language that has been demonstrated in large projects like the QPX flight search engine (Google Flights). For anyone who doesn't know - a big difference that Common Lisp brings to the table is that it has separate namespaces for variables and functions. This may not sound like much but it makes it much easier to write macros (code that writes code) and facilitates compile-time computing. Another big difference between Scheme and Common Lisp is that the Common Lisp specification is _much_ larger and it comes with a much larger collection of standard built-in functions and macros and a standard object-oriented programming facility, among many other things. I know this because I've spent the last six years implementing Clasp (github.com/clasp-developers/clasp) - a Common Lisp that interoperates with C++ and uses LLVM as the backend. There are several excellent implementations of Common Lisp - Steel Bank Common Lisp is a great place to start.
- eatonphil 8y agoHadn't heard of ITA (authors of QPX before being bought by Google) before. Now that I'm looking, it isn't clear to me QPX is still written in Common Lisp? Has anyone confirmed recently that it is still a big CL project?
- 8y ago
- baldfat 8y agoRacket is not academic to me. Racket equals programming fun and really is a joy to use. Academic seems to not convey the feeling one gets when using Racket. To me Racket is really the future of what languages will look like, a language to create your own DSL. The greatest strength of Racket is its documentation. Secondly the way Racket actually teaches you how to be a better programmer. I personally grew the most due to "How to Design Programs" https://htdp.org/2018-01-06/Book/ https://htdp.org/2018-01-06/Book/ Third the executables for cross platform is its reason why I use Racket at work. I can make it and create an executable with raco. I feel like Racket is the most general purpose language I have ever used. I grew up on C64 Assembly, Pascal and Forth. When I learned Python I felt like I could do anything. That was until I wanted my Python code to be used on a computer that wasn't my own computer. Python was my go to language for everything at work but I ended up moving to R about 6 years ago. I felt my R was rough around the edges and picked up Racket to learn about R's Scheme roots. It was a night and day difference. I have several pet programs that saves me hours every week. My Racket programs are much more readible than my Python Scripts. The libraries are certainly not all there but it is actually easy and fun to create your own implementations in Racket and a library for your own use.
- JasonFruit 8y agoI used to be very much anti-Racket, until I grasped the reality that it is not a Scheme, but a Scheme-derived language that strives to combine power and rational design. I now use it daily for many pet projects, and it is great: highly effective, predictable, well-documented, and supplied with enough libraries that you can go a while in most projects before you need to implement anything outside what is core to your purpose. The ffi isn't as bad as the article suggests, either.
- JadeNB 8y ago> Racket equals programming fun and really is a joy to use. Academic seems to not convey the feeling one gets when using Racket. As an academic, it makes me very sad to hear these qualities, that I feel describe my work, used as the opposite of 'academic'.
- 8y ago
- bjoli 8y agoAs a guile user myself, I feel I must say that guile works just fine also when you are not embedding it. It is a very capable scheme, and even though it is not as fast as chez or racket, things have gotten a lot better (the upcoming JIT in the 3.0 release means at least a 2x speedup).
- bjoli 8y agoOh,and thanks to pthreads and guile fibers the concurrency situation is probably the best of any scheme.
- jacobush 8y agoWhat about PicoLisp?!
- linuxlizard 8y agoDoes the sheer amount of cool stuff out there feel overwhelming to anyone else? I want to learn this and this and this and that and this and that thing and this other thing over there.
- gglitch 8y agoI'm probably halfway through my career and still feel like a perpetual beginner because of this syndrome. It has brought me many material and intellectual pleasures and tangible benefits, including a decent living; but I increasingly feel like if I want to progress in my career, it's time to specialize a great deal in a tiny subset of my interests. There's real power in being able to say No to things, and real wisdom in knowing what to say No to. I fear I lack both of these! It's vexing in the extreme.
- gnulinux 8y agoBecause of this I can't focus on anything because learning anything feels like it has infinite opportunity cost, spirals into anxiety. My irrational response is to watch Netflix because if I were instead learning X, I would be concerned that I'm not learning Y0, ..., YN for a very large N.
- funkaster 8y agoOne important thing the author failed to mention (probably due to the publication date) is that Guile also has compiler front ends for ECMAScript and Emacs lisp (and there's a lua front end in the works). So far, Guile is my go-to scheme. https://www.gnu.org/software/guile/ https://www.gnu.org/software/guile/
- WindowsFon4life 8y agoAnd Gambit has backends for JS, Java, Ruby, Php, C and no doubt some others.
- stcredzero 8y agoScheme, on the other hand, is very loosely specified. This is a good thing: the core language is so small that the entire standard fits on about 50 pages...It’s not nebulous, it’s simply minimalist. This is why Scheme is more of an idea than a language. Smalltalk wound up being quite loosely specified. This, combined with the small "core," enabling single developers rolling their own, resulted in a high degree of fragmentation of the overall language community.
- soegaard 8y agoI noticed that quote as well. Odd thing to call RnRS Scheme loosely specified. The RnRS spec is extremely well-written - and it even includes a semantics. Now "Scheme" used to mean "a Scheme like language" is of course loosely specified - but that's another story.
- WindowsFon4life 8y agoThese days Gambit/Gerbil are a much more pragmatic Scheme.