News for hackers. Stuff that matters.
Re:Parsing S-expressions in C (2019) by codemac on Thursday August 20, 2020 @04:23PM (#24228433)
guile for embedding works really nicely.
Re:Parsing S-expressions in C (2019) by outworlder on Thursday August 20, 2020 @04:35PM (#24228605)
Sorry, I keep forgetting about Guile. That thing needs more love indeed.
Re:Parsing S-expressions in C (2019) by grugagag on Thursday August 20, 2020 @04:41PM (#24228682)
As a newbie im getting a bit confused. What is the difference between guile and chicken scheme? There's also chez. Im even more confused
Re:Parsing S-expressions in C (2019) by Jtsummers on Thursday August 20, 2020 @05:21PM (#24229136)
They're each different implementations of Scheme, sometimes with different design goals (like embedding or scripting or for standalone programs). Scheme is a pretty simple language (in comparison to many others) and relatively small. There are also several versions (not just implementations). Common ones out there now are R5RS, R6RS (it was considered "big" and was somewhat unpopular), and R7RS. Consequently, different implementations are also conforming to different versions of the spec.

Really, if you're wanting to learn Scheme, just pick one and run with it. For learning purposes they're mostly equivalent if you stick to the more popular ones, but be aware of your learning material and the version of Scheme that they're using.

If you're familiar with other programming languages, it's somewhat like the relationship between different compilers. Though usually they adhere a bit more strictly to the same standards. Since Scheme is such a small language, there's more room for differences between implementations. This mostly doesn't affect you as a learner (most learning materials focus on the core parts of the language which all implementations should be consistent on).

Re:Parsing S-expressions in C (2019) by grugagag on Saturday August 22, 2020 @11:42AM (#24244835)
Thank a lot, I decided to give Racket a go. It has a fancy IDE and is battery included
Re:Parsing S-expressions in C (2019) by Jtsummers on Saturday August 22, 2020 @07:51PM (#24248273)
Cool. Racket's a great option, and it's really a multi-lingual environment. Technically not Scheme anymore, but compatible with it in most ways. So any learning material for Scheme will still apply, and you can select different Scheme versions within Racket if the Racket language itself is incompatible with whatever book or similar you're using.
Re:Parsing S-expressions in C (2019) by cycloptic on Thursday August 20, 2020 @06:09PM (#24229604)
There is a basic explanation that was written by the guile maintainer in 2013: https://www.wingolog.org/archives/2013/01/07/an-opinionated-...
Re:Parsing S-expressions in C (2019) by outworlder on Thursday August 20, 2020 @05:08PM (#24229001)
These are different implementations. The language spec they follow is slightly different so they are not completely compatible (although I've been able to use some OpenGL-ES Racket code with no modifications in Chicken by using macros).

Where they will differ the most is things like the packaging system (if they have packages, not all Scheme implementations will), as well as their main use-case.

If you are interested, just pick one and start to learn Scheme, using any implementation. Their differences will become apparent quickly.

Re:Parsing S-expressions in C (2019) by grugagag on Thursday August 20, 2020 @05:21PM (#24229145)
Thank you. Quite a few options out there in terms of LISPS and a beginner like me can be quite confused. I started looking at SBCL, Chicken Scheme and Racket and since I'm a newbie I'll stick with racket for the learning phase. I seem to like more the uniformity of Scheme over the cl for example. Do people usually specialize in one or the other or use them interchangeably depending on libraries and such? Another slight barrier has been learning Emacs and that's another reason I chose racket. I like what Emacs is capable but I most likely revisit later.
Re:Parsing S-expressions in C (2019) by minerjoe on Thursday August 20, 2020 @09:39PM (#24231078)
Racket can be a good first choice. I would nudge you, if I may, and if the lisp glove fits, into taking the deep dive into

  emacs + evil (optional) + paredit + SLIME/SLY + SBCL + Quicklisp
There are fully configured starting setups out there for a quick start. That's basically the closest thing nowadays you'll get to experience the interactive power of the ol' Lisp Machines.

That said, you might not always need such large runtimes and other lisps can fit the bill. For example, I usually program in CL (with C FFI) for most projects, but for embedding lisps into existing C programs, Guile can be a joy. Once I was programming servo motor controllers that offered C as one of the programming languages, and I embedded a single C file that gave me a tiny little scheme interpreter and I was then able to prototype motor control algorithms and setting in way less time than before. It's just a game changer for learning about a system when you can get a REPL on it and start rapidly digging and experimenting.

Re:Parsing S-expressions in C (2019) by grugagag on Saturday August 22, 2020 @11:45AM (#24244860)
Thanks. I tried emacs+slime+quicklisp on SBCL and it looks interesting but the learning curve is insane, for now I just want to learn some scheme and take it from there. Racket has some interesting libraries to tot with so Im really excited.