3 ms·
What’s special about Racket? What makes it stand out compared to Lisp/SBCL/Scheme? I recall a while back John Carmack tweeted about writing some project in Rac
by rychco 4y ago
What’s special about Racket? What makes it stand out compared to Lisp/SBCL/Scheme?
I recall a while back John Carmack tweeted about writing some project in Racket & it’s been vaguely on my radar lately.
- antipurist 4y agoLisps let you define macros. Racket lets you define languages. https://docs.racket-lang.org/guide/languages.html https://docs.racket-lang.org/guide/languages.html https://docs.racket-lang.org/guide/more-hash-lang.html https://docs.racket-lang.org/guide/more-hash-lang.html Example of a language-in-racket: https://github.com/soegaard/minipascal/tree/master https://github.com/soegaard/minipascal/tree/master
- behnamoh 4y agothis is so cool! Pascal code without the parentheses.
- CyberDildonics 4y agoThe worst possible programming scenario is usually being locked in to an internal hacked together proprietary language. I don't think trying to make a new language for every program is a good idea and is almost the polar opposite of what I would consider good programming.
- nequo 4y agoIt lets you create languages like Pie which is designed to teach others about dependent types: https://thelittletyper.com/ https://thelittletyper.com/
- CyberDildonics 4y agoThat seems like an extreme niche use that isn't suited for general purpose programming.
- nequo 4y agoRacket's main use case is pedagogy and PL research.
- e12e 4y agoNot to mention arc/anarki (hn is/was written in arc - anarki comes with a "news" example app/forum): https://github.com/arclanguage/anarki/tree/HEAD#readme https://github.com/arclanguage/anarki/tree/HEAD#readme
- gus_massa 4y agoUntil a few years ago Racket was a dialect of Scheme. In addition to the main language "Racket" it also supports R5R and R6R in the standard distribution, and also R7Rs using a user maintained package. There are like 20 of additional languages as part of the distribution. Some are variants, like "Typed Racket" that is like racket with static types. Other languages that are more/completely different and/or almost unused and keep for compatibility or as a demo of some strange feature. And also there are many user defined languages that can be downloaded as packages. The batteries are included. I had to make a program that uses IMAP, SMTP and web scrapping. In another I used support for gzip and xml. In both cases, and all of that was installed by default. And also there are many user defined libraries that can be downloaded as packages. Racket is more immutable than a normal Scheme. For example, lists ("cons") are immutable, and that allows the generation of faster code. Anyway, you can load a library to create mutable lists/cons if you need them. There is more separation of the normal code from the code in macros. So normal code does not affect the code inside macros. Some people like that, and some people dislike that. It's better to reason about macro expansions, but to share a function between normal code and a macro you must define it in another file. It's quite fast in the Scheme family https://ecraven.github.io/r7rs-benchmarks/ https://ecraven.github.io/r7rs-benchmarks/ Still like 5x slower than C, but 5x faster than vanilla Python. https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/racket-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... YMMV
- rychco 4y agoThanks for such a detailed response! At a glance it seems pretty interesting, and the performance is quite good too. I’ll have to toy with it for my next project.
- Decabytes 4y ago1. Discord and discourse forum make it easy to get answers and search for solutions 2. Language is evolving in both a low level (Racket on Chez) and high level way (zuo make replacement) 3. Package manager built into the language 4 Gradually typed sister language 5. Compiled 6. Binaries for multiple Oses for easy download 7. Built in GUI library 8. Drracket for an all in one text editor and language solution. Some schemes/lisps have some of these, but they are either bolted on after the fact, or not widely adopted in that community.