9 ms·
Chicken Scheme
- yakubin 5y agoDoes anyone here have any experience using Chicken Scheme in production? How did it go?
- shakna 5y agoIt was boring. We built a server backend using Chicken in six months, it held up under significant load, and as normal the database connection was where we had to put most of the engineering effort. We used a few macros to remove overhead in a few places where you'd use generic functions, and that saved us a little performance. All in all - I'd happily use it in production again. I like it when the tech stack is boring and does what is expected of it.
- garren 5y agoCan you elaborate a little on your dev environment? Emacs/Geiser?
- shakna 5y agoI was using Sublime Text, a couple others were using Atom. The only one with a CLI editor used vim. Just about everything out there will have decent Scheme support. It's a lisp, and it's a well-defined lisp. Scheme being well-specified makes everything simple. (Even the SRFIs are well specified.) Our deploys were via Jenkins, but through Chicken's egg system it wasn't exactly a complicated process.
- garren 5y agoDid you leverage the repl much in your process? I hear a lot about “repl-driven” development with Clojure and CL, but anytime I get experimental with it I find myself neck-deep in editor configuration, or simply wrestling with emacs keybindings.
- shakna 5y agoNo and yes. Mostly no. Because load was a primary concern, we mostly used a test-driven cycle where we'd spin up the server and then attempt to DOS it for every change. Not something you want happening much on your dev machine. However, for the simpler tests, if the test system hit a failure, it would then drop into a REPL (not on the production server). So it was sort of like a nicer debugger. The test system was developed in-house, but if I remember, it was something like a 100 lines of code. That's one of the things that Scheme guides you towards - if you don't have a wheel, it's generally five minutes to make one. I wouldn't generally bother fighting with emacs or configuration for anything. If you're fighting your tools, you're not being productive. Fine to do if you're not being paid, not so fine in a workplace. Keep things simple, and you'll do better than if you try and be clever. Rainbow braces and documentation lookup will get you 99% of the way to where you want to be. That being said, one of our devs wrote their code with Wisp (SRFI-119), and had a git pre-commit hook that automatically rewrote it back to normal Scheme, and another hook in their editor to turn it into Wisp code when they opened a file. Nobody noticed for over a month. Scheme makes it easy to write the way that you want to, using the tools that you like.
- lioeters 5y agoThank you, that was interesting to read about how Chicken Scheme was used in production. For others like me who are curious, here's what Wisp looks like: Wisp (SRFI-119) Simpler, indentation-sensitive Scheme - https://srfi.schemers.org/srfi-119/srfi-119.html https://srfi.schemers.org/srfi-119/srfi-119.html
- mhitza 5y agoI know what you mean. A few months back I started playing with GNU Guile and wanted some of that nice repl integration. It took me more hours than I would have liked, first because I wanted to use vim instead of Emacs, and second, because vim for parenthesis language programming is frowned upon and harder to find examples for. In the end I wrote my editor config in a gist to make it easier to discover https://gist.github.com/mhitza/a00d7900571e9f13bac2bbf4a203d21b#vim-integration https://gist.github.com/mhitza/a00d7900571e9f13bac2bbf4a203d... When I get more free time I'm definitely eager to jump back to Guile programming. But on my first test drive, I definitely had good experience with the repl driven approach. No matter how barebones of a setup it is, it's better than my past Haskell repl experience, where it almost felt like a tool you need to use no matter what.
- LAC-Tech 5y agodid you use the awful web framework? http://wiki.call-cc.org/eggref/5/awful http://wiki.call-cc.org/eggref/5/awful
- shakna 5y agoTo begin with, but as half of the devs, myself included, were sight-impaired, the symbol-heavy syntax became a real drag and we transitioned away from it. In the end, what we ended up with was our own library written around libevent, which could interface with awful's plugins. As a bonus, it was much, much faster than awful. It even beat out nginx in some situations.
- mshroyer 5y agoI used Chicken successfully in an embedded Linux system where C interop was a high priority. It's a great compiler and one of my go-to Schemes to this day, though obviously the library ecosystem is nowhere near as complete as e.g. Python's.
- memling 5y agoCan you describe this in any detail? E.g., what was the system, how did the interop work, etc?
- mshroyer 5y agoIt was a configuration manager for what was basically a Linux-based wireless router. The Chicken compiler actually compiles down to C, which has the nice side-effect that you can easily include literal C code. Here's an example: https://www.more-magic.net/posts/scheme-c-integration.html https://www.more-magic.net/posts/scheme-c-integration.html
- gmfawcett 5y agoI have a multiple-choice quizzing system written in Chicken that's been running at our uni for the past 15 years. It was meant to be a throw-away, to be used for a semester until the bugs in our learning-management system were fixed. But it still gets some use, and has clocked ~350,000 test submissions over the years. Not too shabby for a throw-away. It just runs, and I never think about it... until someone asks a Chicken Scheme question!
- zelphirkalt 5y agoNot really production, but hobby project: I found the documentation to be good. I remember looking at it and finding whatever I was looking for, thinking: "It's all here!" Even stuff, that I do not fully understand like CK-macros (http://wiki.call-cc.org/eggref/5/ck-macros http://wiki.call-cc.org/eggref/5/ck-macros). There was one issue though, which stopped my hobby project: Support for UTF-8 in display seems to be broken: http://bugs.call-cc.org/ticket/1374 http://bugs.call-cc.org/ticket/1374 As I tried to build a vocabulary trainer, I had to switch to another Scheme. The web framework called "awful" (http://wiki.call-cc.org/eggref/5/awful#description http://wiki.call-cc.org/eggref/5/awful#description) seemed nice too.
- andyjpb 5y agoHi, This reply is a bit late because someone pointed me at it and suggested it was worth answering. ...so I hope that this is useful! I have experience using Chicken Scheme in production both on knodium.com and registers.app Both times it has gone well. There's an HTTP implementation ( https://api.call-cc.org/5/doc/intarweb https://api.call-cc.org/5/doc/intarweb ), a webserver (https://api.call-cc.org/5/doc/spiffy https://api.call-cc.org/5/doc/spiffy that supports SSL) and an HTTP client ( https://api.call-cc.org/5/doc/http-client https://api.call-cc.org/5/doc/http-client ). There's also an "app server" that tries to be like other app servers you might already know ( https://api.call-cc.org/5/doc/awful https://api.call-cc.org/5/doc/awful ). We had to write a lot of our own stuff but it fits fairly neatly into the scheme-way of doing things: you can get a remarkable amount done with just a few simple lines of code. I'd probably want to write about as much in any other language as a lot of what we built were domain level abstractions. Knodium is now long gone but there's a video of what it looked like here: https://www.youtube.com/watch?v=gOPuWi-dbQg https://www.youtube.com/watch?v=gOPuWi-dbQg We had a very talented web designer and we also built a "Widgets and forms" toolkit. I gave a talk at FrOSCon quite early in the development and it was saved for posterity: https://media.ccc.de/v/c116_lisp_-_2013-08-25_11:15_-_building_knodium_com_with_scheme_-_andy_bennett_-_1281 https://media.ccc.de/v/c116_lisp_-_2013-08-25_11:15_-_buildi... The first few minutes of audio are broken but it sorts itself out. I built a bunch of things along the way and released as many of them as I could as open source: http://wiki.call-cc.org/users/andyjpb http://wiki.call-cc.org/users/andyjpb We're currently doing https://registers.app https://registers.app with a similar stack so I'd be pleased to talk more if anyone has any questions.
- dang 5y agoI guess it might be interesting to list past related threads: Show HN: How I used Chicken Scheme to build registromat.com - https://news.ycombinator.com/item?id=23860977 https://news.ycombinator.com/item?id=23860977 - July 2020 (4 comments) Chicken Scheme 5.1 - https://news.ycombinator.com/item?id=20259324 https://news.ycombinator.com/item?id=20259324 - June 2019 (21 comments) Making Games in Lisp with Hypergiant and Chicken Scheme - https://news.ycombinator.com/item?id=18647562 https://news.ycombinator.com/item?id=18647562 - Dec 2018 (22 comments) Chicken Scheme 5.0 - https://news.ycombinator.com/item?id=18402567 https://news.ycombinator.com/item?id=18402567 - Nov 2018 (86 comments) Ugarit: content-addressable storage and backup written in Chicken scheme - https://news.ycombinator.com/item?id=14637593 https://news.ycombinator.com/item?id=14637593 - June 2017 (11 comments) Chicken Scheme - https://news.ycombinator.com/item?id=12773314 https://news.ycombinator.com/item?id=12773314 - Oct 2016 (31 comments) Let's add a statistical profiler to Chicken Scheme - https://news.ycombinator.com/item?id=11097044 https://news.ycombinator.com/item?id=11097044 - Feb 2016 (3 comments) Making Games in Chicken Scheme with Hypergiant - https://news.ycombinator.com/item?id=8850722 https://news.ycombinator.com/item?id=8850722 - Jan 2015 (4 comments) Chicken Scheme Websockets - https://news.ycombinator.com/item?id=8534082 https://news.ycombinator.com/item?id=8534082 - Oct 2014 (20 comments) Chicken Scheme internals: the garbage collector - https://news.ycombinator.com/item?id=7499101 https://news.ycombinator.com/item?id=7499101 - March 2014 (25 comments) Example Project Using Chicken Scheme on Android - https://news.ycombinator.com/item?id=6399148 https://news.ycombinator.com/item?id=6399148 - Sept 2013 (7 comments) Embed the Chicken Scheme runtime into a FastCGI module hosted by Apache server - https://news.ycombinator.com/item?id=5733388 https://news.ycombinator.com/item?id=5733388 - May 2013 (3 comments) Developing database-driven web applications with Chicken Scheme - https://news.ycombinator.com/item?id=5692190 https://news.ycombinator.com/item?id=5692190 - May 2013 (5 comments) Behind the Scenes with Chicken Scheme - https://news.ycombinator.com/item?id=5644349 https://news.ycombinator.com/item?id=5644349 - May 2013 (22 comments) Chicken Scheme - https://news.ycombinator.com/item?id=5380513 https://news.ycombinator.com/item?id=5380513 - March 2013 (61 comments) How Chicken Scheme compiles to C - https://news.ycombinator.com/item?id=3440777 https://news.ycombinator.com/item?id=3440777 - Jan 2012 (9 comments) Chicken - Portable, Efficient C Compiler for the Scheme Programming Language - https://news.ycombinator.com/item?id=2278562 https://news.ycombinator.com/item?id=2278562 - March 2011 (13 comments) Chicken Scheme looks mighty fine - https://news.ycombinator.com/item?id=2241015 https://news.ycombinator.com/item?id=2241015 - Feb 2011 (15 comments)
- xedrac 5y agoI generally like RSR6, but Chicken opted to stick with RSR5 for a long time, which honestly was a deterrent for me. They are in the process of implementing RSR7 which is strangely incompatible with RSR6. Racket has been my go-to scheme for awhile. The only time I would consider Chicken over Racket is if I needed tight integration into an existing C project and had size constraints. Is there something else I'm missing out on?
- emeraldd 5y agosmall note, I think it's R#RS ...
- sigzero 5y agoR5RS ;)
- tbrgmnn 5y agoAs in "Revised Revised Revised Revised Revised... Report on the Algorithmic Language Scheme".
- johncowan 5y agoWe usually write RnRS. If you're into Unicode or markup languages like TeX and HTML, you can write R⁴RS, R⁵RS, R⁶RS, R⁷RS, or generally RⁿRS. And yes, I think that "The Revised Revised Revised Revised Revised Revised Revised Report on the Algorithmic Language Scheme" is pushing the joke rather too far, but R⁷RS is what name got consensus. It's modeled on "The {,Revised|Modified} Report on the Algorithmic Language Algol 60", where the usual abbreviations were R, RR, MR, but I like to write R⁰RA60, R¹A60, R²RA60 instead. Ditto with R⁰RA68, R¹A68 for the distinct language Algol 68. Finally, the incomplete report on the Scheme offshoot Kernel is R⁻¹RK.
- MathMonkeyMan 5y agoI didn't do much work in Chicken, but I chose it as a language for ops scripts that were to run on any old Unix box whose installed software I couldn't control, e.g. AIX, Solaris, HP-UX, RHEL 5. Couldn't even count on Python 2 being there. It was either POSIX shell or statically linked native, and Chicken (with a few modifications) allowed me to do that on all of the above platforms. Fortunately (in retrospect), none of my code ever found much use. Learned a lot about Scheme, though :)
- Koshkin 5y agoI wish instead of HTML+JS we had just… Lisp.
- FPGAhacker 5y agoTo me, clojure fits that bill.
- Pompidou 5y ago... then we could write a domain specific language for building web pages and another one for managing additional features, thanks to the power of lisp macro.
- shakna 5y agoSXML is widely used when combining Scheme and the web, so the DSL has already been made for you, and is actually pretty pleasant to use. Example SXML template, that fills in data fields from a given namespace: (form (@ (method (%data form-method)) (action (%data form-action))) (label "Username") (input (@ (type "text") (name (%data username-input-name)))) (label "Password") (input (@ (type "password") (name (%data password-input-name)))) (input (@ (type "submit"))))
- MathMonkeyMan 5y agoI even do a minimal version of SXML in python, using python's lists, because it's much better than the DOM/builder way. https://github.com/dgoffredo/dgoffredo.github.io/blob/372300b6666c683bfe7674cf7ea106d3cc979e53/bin/sxml.py https://github.com/dgoffredo/dgoffredo.github.io/blob/372300... You could do the exact same thing in javascript.
- bjoli 5y agoDoes the new pattern match work with this? In guile there is (ice-9 sxml match) which matches attributes without order. Incredibly useful. And then there is the whole SXPATH and SXSLT stuff that makes sxml a lot nicer than HTML.
- swhalen 5y agoI don't mean this comment to be critical of the OP, who is undoubtedly acting in good faith, but how after all this time is this submission not somehow flagged as a duplicate?
- mkl 5y agoAccording to dang's list (https://news.ycombinator.com/item?id=28398201 https://news.ycombinator.com/item?id=28398201), the last significant discussion was over two years ago. The FAQ (https://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html) says: "Are reposts ok? If a story has not had significant attention in the last year or so, a small number of reposts is ok."
- oneplane 5y agoI have never really been exposed to the likes of Scheme, Lisp, Smalltalk etc. and I'm curious if anyone without an academic background actually got in to any of that by themselves. Generally, it's just a bunch of JS, C#, Java, Python, and some Scala that runs everywhere I look, which often also has a large "I came across it and I got to work" type of developer or engineer using it. Maybe it's just the type of ecosystem I keep hopping around it but it seems that it's much less prominent than you'd expect. There are always novel compilers, transpilers and showcases, but the amount of widespread use eludes me. (Only ErLang comes to mind with RabbitMQ, and maybe OCaml with Xen)
- fiddlerwoaroof 5y agoI picked up Common Lisp mostly because it intrigued me and there’s a decent market for Clojure and Haskell. Google Flights is still based on a CL flight search engine. Walmart processes all their receipts with Clojure. Target does a bunch of data sciency stuff in Haskell.
- bigdict 5y agoStart reading SICP or Little Schemer if you don't feel like making the time investment.
- Mesmoria 5y agoI got into scheme, prolog, smalltalk, Haskell, and ocaml - without an academic background in those languages. I dont find them useful commercially YMMV but I do think they stretch the way you program and I actually enjoy them more. Prolog is my favourite.
- nightfly 5y agoI got into Common Lisp > 9 years ago with being exposed to it in academia, or really even from social/pop-culture influences. I was looking for a language that had relatively good performance that was easy to prototype code interactively for and Common Lisp + SLIME fit that need perfectly. From there I learned how easy it was to make your own Lisp and learned a lot about how programming languages work and had a lot fun with that for a while.
- 5y ago
- yewenjie 5y agoWhat is a good auto formatter for Scheme and Lisp languages?
- MathMonkeyMan 5y agohttps://shaunlebron.github.io/parinfer/ https://shaunlebron.github.io/parinfer/
- lanstin 5y agoEmacs? But the syntax is so regular all you need is indenting and paren closing.
- tgbugs 5y agoI would love to be able to use chicken on a regular basis, but unfortunately it is an enormous pain to get it install on a system at the same time as mono because the mono c# compiler and the chicken scheme compiler have the same name [0]. 0. https://bugs.gentoo.org/645728 https://bugs.gentoo.org/645728
- pankajdoharey 5y agoTrue this is a big problem, i have faced the same eventually i uninstalled Chicken, though i really love the size of Binaries and how fast they are. On several tests i did Chicken Scheme outperforms Go lang for a similar implementation.
- quickthrower2 5y agoCan it be run in docker?
- lambdaba 5y agothis is why I love Nix; with Nix, you could do: nix-shell -p chicken --run csi for one-off invocation or alternatively, tweak the package to rename them: chicken = pkgs.chicken.overrideAttrs (attrs: { postInstall = attrs.postInstall + "\n" + "mv $out/bin/{csi,chicken-csi} })
- Solarsail 5y agoSimilar issue applies on Windows with Visual Studio's C# compiler; Tho in that case it's a terminal with a non-default starting script that adds the C# compiler, so default and that non-default terminal point CSI or CSC at different languages.
- nostrademons 5y agoNote that Chicken has a very interesting garbage-collection algorithm called "Cheney on the MTA". Basically, the stack is the heap, and no function ever returns. The compiler converts every program to continuation-passing style, where instead of a function returning, it tail-calls a continuation. When the stack exhausts its limit, the runtime longjmps back to a trampoline. Variables captured by the current continuation form the roots of a copying generational GC - the runtime traces every pointer from them and copies the live objects to the heap. The stack then unwinds, with every uncopied object being garbage that gets re-used the next time the stack grows. It's pretty amazing that it works, particularly in relatively portable C. Also gets fairly decent performance, too: as Schemes go Chicken is one of the faster ones. https://www.more-magic.net/posts/internals-gc.html https://www.more-magic.net/posts/internals-gc.html https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.7143 https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54....
- Y_Y 5y agoTo my knowledge nobody has recorded a version of the song about Cheney, but it may be enjoyable to listen the more popular version about Charlie: https://www.youtube.com/watch?v=7Tc1GUXxr2o https://www.youtube.com/watch?v=7Tc1GUXxr2o
- gmfawcett 5y agoGreat link! The name of Henry Baker's paper is a play-on-words that references that song: > A Cheney queue is a garbage collection scheme originally described by J. C. Cheney. The MTA is a reference to a song recorded by The Kingston Trio. https://wiki.c2.com/?CheneyOnTheMta https://wiki.c2.com/?CheneyOnTheMta
- pankajdoharey 5y agoCheney on the MTA is fundamantally a Tri-Color Mark and Sweep GC. Cyclone Scheme also has this same GC.
- b3morales 5y ago
- rosetremiere 5y agoI'm wondering: are there any RXRS compliant scheme implementations that are competitively fast? say comparable to js or lua, or even C/rust? If not, is the reason coming from scheme itself, or is it more a lack of effort in this direction?
- avhon1 5y agoMy understanding is that Chez Scheme is pretty fast. Developed by Cisco, and the new backend for Racket.
- nerdponx 5y agoChez is also also the default backend for Idris 2. Edwin Brady (Idris 2 creator and main author) has mentioned a few times that Chez is surprisingly and impressively fast.
- rgrmrts 5y agoHow does the C ffi in Chez (or guile if anyone is familiar) compare with Chicken? I’ve heard good things about all three but have only used guile a bit, but never the C ffi. I’ve heard Chicken proponents speak highly of the ffi but have not seen any comparisons between the three implementations.
- johncowan 5y agoDeveloped by Kent Dybvig, sold to Chez which did who-knows-what with it (hiring Dybvig as well) but never commercialized it directly, and then open-sourced by Cisco.
- tonyg 5y ago"Cadence Research Systems" (CRS) was Kent's company. The system was "Chez", and was a commercial product of CRS since the '80s. Kent sold CRS (and thus Chez) to Cisco in 2011, and they didn't commercialize it directly, but happily it was open-sourced in 2016.
- kryptiskt 5y ago
- gwbas1c 5y agoEvery time I see "Chicken Scheme" I think it's an article describing some kind of scam related to chicken.
- johncowan 5y agoThere's a tradition of skullduggery-related names: Guile, Gambit, Gauche, Heist, Larceny (with variants Petit Larceny and Common Larceny), Racket, and Stalin (it optimizes your code -- brutally). "Chicken" is I believe related to an actual rubber chicken (which of course is also unreal).
- soegaard 5y agoAnd the obvious one: Scheme(r). John knows already, but the Scheme were meant to be called Schemer, but the file system only had 6 characters in the filenames. Apropos, the suffix "bit" is popular too: rabbit, orbit, gambit, picbit, twobit
- fithisux 5y agoNot intended to start a long thread: How do I start with Scheme and the moder R7RS standard? Books, tutorials, courses ? Thank you.