I am happy to see Racket make it to the front page. After using mostly Common Lisp for research programming since 1982, I now more often turn to Racket. There are parts of Racket I don’t like, which is most everything *NOT* the compiler, package management system, GUI IDE, Emacs bindings, fun language to use.
I don’t care for much of the programming language research parts of the ecosystem - that is the parts that the computer scientist professors who run the project probably care about the most. More power to them!
So I feel like a freeloader on the Racket project, just enjoying the little parts I like and ignoring the rest, and not contributing anything (except maybe the little Racket book I wrote).
The packet management system, the GUI IDE (which includes a step debugger), the ability to write a cross platform IDE (which is maintained by the core Racket team themselves), and the ability to easily produce runnable binaries make Racket my favorite Lisp hands down.
Those features are so incredibly useful and important, I really can't state it enough. I love Lisps, but at work, I will only use a language if it's the best tool for a job. Because of several of those features, Racket has been the only Lisp I've ever been able to justify using.
Because of the community, tooling and learning resources available, Racket is such an easy language for me personally to recommend to people. There are things I really like about CL and Clojure too, both of which I have used quite a bit, but I would never recommend them to people because of some huge drawbacks that come with each.
I also don't jive with the research parts of the language , nor do I care about the "lang" facilities, and I also kind of strongly dislike HtDP. But my perspective on all that is that they are projects I am uninterested in that happened to be made with a language I love, rather than knocks against the language itself, because I never bump up against them.
I use CL on a day to day basis (and not in research/PL research domain), have never ventured into Racked yet. Can you please elaborate further on parts of Racket you don't like vis a vis CL? Thanks!
What are the 'programming language research parts of the ecosystem'?
The only part of the Racket distribution I can see that is specifically 'programming language research' is Redex.
In the language itself there are the metaprogramming capabilities - but all modern languages have metaprogramming.
My experience of the community is it is generally people talking about real problems.
People do use Racket for PL and other research, so a number of PL research papers and conference talks do reference Racket, but it doesn't dominate any of the discussion.
Having used Racket in college for programing language ecosystem, I can say I don't enjoy that aspect either haha. Racket is easy to get started with and definitely great at what it does. If you're wading into Lisp IMO it's the way to go.
That said, IMO Clojure has a larger and more robust community, that said it's a bit of a bigger pain to set up (uses JVM) & has some more nuance.
how do you deal with the very bad Racket repl? Thats what turned me off the language
edit: I dont reslly understand the downvotes, not trying to be rude or anything. Coming from CL the racket repl is very very barebones, it loses all state everytime you recompile. So I ask him how he deals with that coming from the very nice CL repl
Racket is a very practical language. If you have the impression that it's some academic quirk you should take a look at what Bogdan Popa is doing with it: https://defn.io/
When I personally want a binary with a native GUI I turn to Racket. It's also pretty nice for parsing stuff, like JSON, XML, some text-file formats.
The companion book How to design programs, https://htdp.org/2023-8-14/Book/index.html , is nice too, while it doesn't exactly teach Racket (it uses a couple of teaching languages implemented in Racket) it has some valuable ideas that are good to be reminded of every now and then.
The macro system might seem weird if one comes from e.g. CL, but once I got used to it I found it relatively easy to stay sane while doing metaprogramming.
I like Racket the language a lot, but can't get to terms with the workflow it imposes on you. When coding in Python I use my editor to write the code and I run it from my shell. Doesn't work with Racket because it takes too long to start. Instead you "should" interact with a long-running vm through a REPL. But that means the code you are working on doesn't start with a "clean slate" and instead starts with whatever state the vm is in at the moment. It's a great workflow for things like Jupyter notebooks but doesn't work well for larger programs imo.
> I use my editor to write the code and I run it from my shell
That's a perfectly valid workflow for Racket too. Startup time is pretty comparable to Python in my experience. Slow but not cripplingly so, especially if you compile it ahead of time (useful when you're done working on a file for the moment). Using the racket/base #lang instead of racket makes a big difference too. https://docs.racket-lang.org/style/Language_and_Performance.... has more on that.
>But that means the code you are working on doesn't start with a "clean slate" and instead starts with whatever state the vm is in at the moment.
That sounds more like a Common Lisp style repl than Racket's, where you typically do have to restart Racket when reloading files/modules and thus have a fresh environment. People complain about it but I prefer the clean slate style of Racket over CL.
When I studied at the University of British Columbia, racket was taught in the intro to CS course. I thought it was a great language, and put everyone on an even playing field (eg: students with prior programming experience hadn’t worked with lisp). Also was impressed by the libraries which made it easy to produce simple games or visuals.
I also was at UBC for that class and left with a totally different impression. I thought it was awful and set up introductory students very poorly for subsequent CS classes, especially data structures and algorithms that were taught in imperative languages.
When I TAed, a lot of incoming 2nd year students didn’t know how to do for loops yet, which really set them back for basic algorithms.
I had a much deeper appreciation for functional languages after theory of computation classes in my senior / 4th year.
I'm lost on how should I integrate all these "languages" of Racket into a single application.
Like, I can see there are `typed/racket`, `racket/gui` and `scribble/base` languages. But how do I write a GUI application that create PDF while also having all the code be typed?
I tried following Racket tutorial multiple times but I'm still lost on how to tied each unrelated "languages" together.
IMO, each chapter of the tutorial just talk about unrelated "language" and then never once show how they all work together. One chapter will talk about web server but not class system, then another chapter will talk about another "language" that support class but then never write web server in it.
You can think of the #lang line as a kind of compiler instruction with that file as scope. There's much more to it but that's a good starting point. If you have an application and want to add types doing it one file at a time is a good strategy.
Besides the #lang line you can also use 'require to bring in libraries, so a single file could contain GUI as well as web server code. #lang isn't constrained to one language at a time either, if they don't conflict you can just add more to that line.
I think this is a fair question. In my opinion, if you're developing a larger application then nearly all of your code will either be in the "racket" language. If you're keen on types, substantial fractions of this may be in the "typed/racket" language. It is true that all of the languages share a common substrate, and they can more or less all interoperate, but it's definitely not the case that a programmer would be likely to break their program into five equal pieces and use a different language for each one. You'll probably write your docs with scribble. Using different languages allows you to have a fundamentally different programming model, and while having that as a backdrop made things like the development of Typed Racket feasible, it isn't something that should prevent you from starting.
TL/DR: Just use Racket. If you find that you really wish that you had some other feature or style of programming, you can investigate whether there's a language that already provides that.
I was a student at the 2018 racket school mentioned in the link.
All of the instructors, including Felleisen and Butterick, were nothing but helpful and friendly inside and outside of the classroom.
Even taking that link completely at face value that Felleisen is a Torvalds-type asshole in certain personal interactions... his work including How To Design Programs had such a positive impact on my life and the lives of others that I wouldn't discourage people from taking advantage of it.
Felleisen is an insufferable prick but also easy to avoid. More a symptom of an illness in academia than Racket specifically, I'd say. In the community there are some 'weird nerds' with strong opinions that are likely to be more annoying since their presence is more strongly felt, but that's just how it is in many social settings where money doesn't chain things down.
Racket is my favorite language. It's fast, practical, has solid foundations and an extremely nice concurrency story (based on concepts borrowed and extended from Concurrent ML). It has an excellent documentation system, with an integrated package ecosystem, which means that most packages have high quality documentation with cross-references. It has a great backwards-compatibility story -- a lot better than Python's, for example, which I use in my current dayjob. So, my impression of the commenters saying it's too academic or not practical is that they probably never dove deeply enough, or they are former students who were only exposed to the teaching languages in the past. It's definitely not perfect: the community is small, the runtime has a high memory baseline, parallelism requires spinning up a Racket VM per system thread, among others, but these are things that will improve over time.
In the past several years, I've:
* built & run an e-commerce site written in Racket[1]
* built a native macOS and iOS reminders app, available on the App Store [2, 3, 4]
* built a cross-platform desktop client for Apache Kafka [5, 6, 7]
* built a `#lang` for Lua [8]
Among[9] other[10] things[11]. I think that's all pretty practical stuff!
I also just want to add that Bogdan is the author of gui-easy and http-easy, which are indispensable libraries in the Racket ecosystem.
Bogdan also is extremely helpful and active on the community forums and gives EXTREMELY helpful answers on there.
Definitely an unsung hero of the language - just wanted to give a shout-out - I can report that your libraries are powering code that is making some unsuspecting users lives much easier :)
>It has a great backwards-compatibility story -- a lot better than Python's, for example, which I use in my current dayjob.
I think this is a really important point. I worked intensively with Python for years, but it was a deep disappointment to see how little the core devs and the community care about backwards compatibility in the 2/3 transition, and things have not improved. That might be due to what Python is dominantly used for today (The Numeric/Numpy transition which happened around 2000 was totally different). Breaking things every few years might be OK for unicorn startups or companies that move fast and, well, break things, but there is a lot of valuable programming from people and in organisations which can simply not afford, or do not see it as a priority to re-write mature algorithms every few years.
I am using Racket once in a while, and I like it. Though I have also learned that some Lisps, and especially Common Lisps (and, I suspect, Guile), are a bit under-hyped.
But a question to people who know it better: What are features of Racket which at first might not seen practical, relevant, or useful, but are surprisingly useful for programming when one gives them a try?
~20 years ago I worked on commercial software for email security that was using MzScheme (before it became PLT Scheme) as the base language. Code was cross-platform (Solaris, Linux, HP-UX) - OS-specific code was in C, with about 1k lines. Filter rules were compiled into Scheme itself. The whole code was about 30k LoC, including web based UI, and only had 5-6 developers… Later I immigrated and joined company that had similar product with less features with code in C++, with hundred thousand LoC and more developers.
Racket and similar languages never clicked with me. The syntax barrier feels very high.
I started programming at a young age, and I failed my Functional Programming class at college 3 times. Eventually, I gave up on getting a degree.
Lots of respect to people who not only get it, but build complex programs with Racket, Common Lisp, Haskell and similar languages.
I feel like when I dive into LISPs like Racket or SBCL I’m presented with a very academic purist view of programming that clashes with my desire for more tangible, material apps.
I feel like I’d be able to comprehend deep computer science theorems in CL well but god forbid if I wanted to crank out a weekend web app.
4. Gradually typed language Typed-Racket that checks types at compile time
5.fast (has moved from middle of the pack to top 3 fastest Schemes)
6. Evolution under the hood as opposed to just syntax and features (chez scheme over C)
7. Simple IDE with Emacs built in which makes getting started if you are afraid of Emacs easier.
8. Documentation languages like Pollen and Scribble make writing documentation better than any other language I have used
9. Zuo, a Make replacement which works like a mini Racket
10. Large active community
11. Modern communication channels (Discord, Discourse Forum, subreddit)
12. Documentation geared towards beginners or experienced programmers (Racket Guide vs Racket Reference)
13. You can turn a Racket program into an executable (it’s far but better than Python’s options that’s for sure)
There are Schemes that I like better for specific things (Gambit-C for C integration, Gerbil as a Racket Successor, Chez as the Fastest Scheme, Guile for its large GNU ecosystem)
But no Scheme has come close to offering even half of what you get with Racket out of the box
[+] [-] mark_l_watson|1 year ago|reply
I don’t care for much of the programming language research parts of the ecosystem - that is the parts that the computer scientist professors who run the project probably care about the most. More power to them!
So I feel like a freeloader on the Racket project, just enjoying the little parts I like and ignoring the rest, and not contributing anything (except maybe the little Racket book I wrote).
[+] [-] BaculumMeumEst|1 year ago|reply
The packet management system, the GUI IDE (which includes a step debugger), the ability to write a cross platform IDE (which is maintained by the core Racket team themselves), and the ability to easily produce runnable binaries make Racket my favorite Lisp hands down.
Those features are so incredibly useful and important, I really can't state it enough. I love Lisps, but at work, I will only use a language if it's the best tool for a job. Because of several of those features, Racket has been the only Lisp I've ever been able to justify using.
Because of the community, tooling and learning resources available, Racket is such an easy language for me personally to recommend to people. There are things I really like about CL and Clojure too, both of which I have used quite a bit, but I would never recommend them to people because of some huge drawbacks that come with each.
I also don't jive with the research parts of the language , nor do I care about the "lang" facilities, and I also kind of strongly dislike HtDP. But my perspective on all that is that they are projects I am uninterested in that happened to be made with a language I love, rather than knocks against the language itself, because I never bump up against them.
[+] [-] hiAndrewQuinn|1 year ago|reply
I'd say this counts as a phenomenal contribution. :)
[+] [-] oumua_don17|1 year ago|reply
[+] [-] spdegabrielle|1 year ago|reply
The only part of the Racket distribution I can see that is specifically 'programming language research' is Redex.
In the language itself there are the metaprogramming capabilities - but all modern languages have metaprogramming.
My experience of the community is it is generally people talking about real problems.
People do use Racket for PL and other research, so a number of PL research papers and conference talks do reference Racket, but it doesn't dominate any of the discussion.
e.g. https://racket.discourse.group/t/levin-tree-search-with-cont...
[+] [-] lettergram|1 year ago|reply
That said, IMO Clojure has a larger and more robust community, that said it's a bit of a bigger pain to set up (uses JVM) & has some more nuance.
[+] [-] darby_eight|1 year ago|reply
[+] [-] temporarely|1 year ago|reply
(Thank you for the book - will be reading)
[+] [-] MarceColl|1 year ago|reply
edit: I dont reslly understand the downvotes, not trying to be rude or anything. Coming from CL the racket repl is very very barebones, it loses all state everytime you recompile. So I ask him how he deals with that coming from the very nice CL repl
[+] [-] MrBuddyCasino|1 year ago|reply
[+] [-] cess11|1 year ago|reply
When I personally want a binary with a native GUI I turn to Racket. It's also pretty nice for parsing stuff, like JSON, XML, some text-file formats.
The companion book How to design programs, https://htdp.org/2023-8-14/Book/index.html , is nice too, while it doesn't exactly teach Racket (it uses a couple of teaching languages implemented in Racket) it has some valuable ideas that are good to be reminded of every now and then.
The macro system might seem weird if one comes from e.g. CL, but once I got used to it I found it relatively easy to stay sane while doing metaprogramming.
A couple of more resources that are useful:
https://www.greghendershott.com/fear-of-macros/
https://beautifulracket.com/
[+] [-] prlin|1 year ago|reply
[+] [-] bjourne|1 year ago|reply
[+] [-] shawn_w|1 year ago|reply
That's a perfectly valid workflow for Racket too. Startup time is pretty comparable to Python in my experience. Slow but not cripplingly so, especially if you compile it ahead of time (useful when you're done working on a file for the moment). Using the racket/base #lang instead of racket makes a big difference too. https://docs.racket-lang.org/style/Language_and_Performance.... has more on that.
>But that means the code you are working on doesn't start with a "clean slate" and instead starts with whatever state the vm is in at the moment.
That sounds more like a Common Lisp style repl than Racket's, where you typically do have to restart Racket when reloading files/modules and thus have a fresh environment. People complain about it but I prefer the clean slate style of Racket over CL.
[+] [-] captainkrtek|1 year ago|reply
[+] [-] czhu12|1 year ago|reply
When I TAed, a lot of incoming 2nd year students didn’t know how to do for loops yet, which really set them back for basic algorithms.
I had a much deeper appreciation for functional languages after theory of computation classes in my senior / 4th year.
[+] [-] lavp|1 year ago|reply
[+] [-] api_or_ipa|1 year ago|reply
[+] [-] joesb|1 year ago|reply
IMO, each chapter of the tutorial just talk about unrelated "language" and then never once show how they all work together. One chapter will talk about web server but not class system, then another chapter will talk about another "language" that support class but then never write web server in it.
[+] [-] cess11|1 year ago|reply
Besides the #lang line you can also use 'require to bring in libraries, so a single file could contain GUI as well as web server code. #lang isn't constrained to one language at a time either, if they don't conflict you can just add more to that line.
[+] [-] jbclements|1 year ago|reply
TL/DR: Just use Racket. If you find that you really wish that you had some other feature or style of programming, you can investigate whether there's a language that already provides that.
All of this is my opinion, of course.
[+] [-] zelphirkalt|1 year ago|reply
[+] [-] fanf2|1 year ago|reply
[+] [-] ReleaseCandidat|1 year ago|reply
[+] [-] kod|1 year ago|reply
All of the instructors, including Felleisen and Butterick, were nothing but helpful and friendly inside and outside of the classroom.
Even taking that link completely at face value that Felleisen is a Torvalds-type asshole in certain personal interactions... his work including How To Design Programs had such a positive impact on my life and the lives of others that I wouldn't discourage people from taking advantage of it.
[+] [-] rscho|1 year ago|reply
[+] [-] cess11|1 year ago|reply
[+] [-] Bogdanp|1 year ago|reply
In the past several years, I've:
* built & run an e-commerce site written in Racket[1]
* built a native macOS and iOS reminders app, available on the App Store [2, 3, 4]
* built a cross-platform desktop client for Apache Kafka [5, 6, 7]
* built a `#lang` for Lua [8]
Among[9] other[10] things[11]. I think that's all pretty practical stuff!
[1]: https://defn.io/2019/08/20/racket-ecommerce/
[2]: https://defn.io/2020/01/02/ann-remember/
[3]: https://defn.io/2024/04/09/ann-remember-for-ios/
[4]: https://github.com/bogdanp/remember
[5]: https://defn.io/2022/11/20/ann-franz/
[6]: https://defn.io/2023/10/15/ann-franz-for-windows/
[7]: https://defn.io/2023/08/10/ann-franz-source-available/
[8]: https://defn.io/2022/11/12/ann-racket-lua/
[9]: https://docs.racket-lang.org/http-easy/index.html
[10]: https://docs.racket-lang.org/deta/index.html
[11]: https://docs.racket-lang.org/gui-easy/index.html
[+] [-] BaculumMeumEst|1 year ago|reply
Bogdan also is extremely helpful and active on the community forums and gives EXTREMELY helpful answers on there.
Definitely an unsung hero of the language - just wanted to give a shout-out - I can report that your libraries are powering code that is making some unsuspecting users lives much easier :)
https://docs.racket-lang.org/http-easy/index.html
https://docs.racket-lang.org/gui-easy/index.html
https://racket.discourse.group
[+] [-] jnxx|1 year ago|reply
I think this is a really important point. I worked intensively with Python for years, but it was a deep disappointment to see how little the core devs and the community care about backwards compatibility in the 2/3 transition, and things have not improved. That might be due to what Python is dominantly used for today (The Numeric/Numpy transition which happened around 2000 was totally different). Breaking things every few years might be OK for unicorn startups or companies that move fast and, well, break things, but there is a lot of valuable programming from people and in organisations which can simply not afford, or do not see it as a priority to re-write mature algorithms every few years.
[+] [-] jnxx|1 year ago|reply
But a question to people who know it better: What are features of Racket which at first might not seen practical, relevant, or useful, but are surprisingly useful for programming when one gives them a try?
[+] [-] alexott|1 year ago|reply
[+] [-] Altern4tiveAcc|1 year ago|reply
Lots of respect to people who not only get it, but build complex programs with Racket, Common Lisp, Haskell and similar languages.
[+] [-] doublepg23|1 year ago|reply
[+] [-] nikolayasdf123|1 year ago|reply
[+] [-] Decabytes|1 year ago|reply
1. Package manager
2. Cross platform Gui
3. Easy to install on all platforms
4. Gradually typed language Typed-Racket that checks types at compile time
5.fast (has moved from middle of the pack to top 3 fastest Schemes)
6. Evolution under the hood as opposed to just syntax and features (chez scheme over C)
7. Simple IDE with Emacs built in which makes getting started if you are afraid of Emacs easier.
8. Documentation languages like Pollen and Scribble make writing documentation better than any other language I have used
9. Zuo, a Make replacement which works like a mini Racket
10. Large active community
11. Modern communication channels (Discord, Discourse Forum, subreddit)
12. Documentation geared towards beginners or experienced programmers (Racket Guide vs Racket Reference)
13. You can turn a Racket program into an executable (it’s far but better than Python’s options that’s for sure)
There are Schemes that I like better for specific things (Gambit-C for C integration, Gerbil as a Racket Successor, Chez as the Fastest Scheme, Guile for its large GNU ecosystem)
But no Scheme has come close to offering even half of what you get with Racket out of the box
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] brucenanner|1 year ago|reply