Readit News logoReadit News
mark_l_watson · 2 years ago
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).

BaculumMeumEst · 2 years ago
I agree with every word of this.

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 · 2 years ago
https://leanpub.com/racket-ai/read

I'd say this counts as a phenomenal contribution. :)

oumua_don17 · 2 years ago
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!
shawn_w · 2 years ago
Not Mark, but I use Racket a lot and sometimes play with Common Lisp.

CLOS is way nicer than Racket's class/OO model and how generic functions are handled. Growable/resizable arrays are sometimes nice to have.

I prefer Racket and Scheme for the most part though.

spdegabrielle · 2 years ago
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.

e.g. https://racket.discourse.group/t/levin-tree-search-with-cont...

lettergram · 2 years ago
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.

pjmlp · 2 years ago
Uses the JVM is exactly why Clojure is the Lisp like language I mostly bother with.

What matters are ecosystems and not languages on their own, so when switching between languages it is a great benefit that I can reuse my Java ecosystem knowledge, instead of adding yet another ecosystem to those I jump around between projects.

However, I really like the almost Lisp Machine like experience from using Raket.

jnxx · 2 years ago
One feeling I have is that while Clojure is incredibly tasteful, well-designed and elegant, it is less focused on Correctness as Racket. And this gives me the feeling that if I make some mistake (say, erroneously swapping arguments of a complex function that e.g. computes on list as sets), I do not know what is going to happen.
eru · 2 years ago
Clojure's biggest advantage, integration with the JVM ecosystem, is also its biggest drawback. JVM compatibility forces a lot of ugly compromises on Clojure.
darby_eight · 2 years ago
Ok, so to state the obvious, if you don't turn to racket for "programming language research" why do you use the language at all?
tgbugs · 2 years ago
One reason is that it has one of the best cross platform native gui solutions out there. It exists because the research side was focused on teaching programming and needed a solution that their students could just install. There is a bit of a learning curve, but once you're over the hump it is just a pleasure to work with. See also things like https://docs.racket-lang.org/gui-easy/index.html.
djtango · 2 years ago
As a Clojure developer who did write some Racket, there is a satisfying purity to Scheme (at least to me).
rscho · 2 years ago
Ergonomics. It's extremely easy to use, especially in the GUI department. Generally, many things are super easy to use but not always top performance. Other things (macros) are truly exceptionally powerful, but rather complicated.

So, industry-grade customer-facing code? Not its focus, maybe not. But incredibly easy internal tools? Sure!

zem · 2 years ago
it's also a lovely general-purpose language, very pleasant to use.
eru · 2 years ago
The same reason people use Haskell outside of 'programming language research', too, perhaps?
t4ng0pwn3d · 2 years ago
A lisp with a lot of features built in (websites, guis, etc)
temporarely · 2 years ago
"Wall, chilern, whar dar is so much racket dar must be somethin' out o' kilter."

(Thank you for the book - will be reading)

MarceColl · 2 years ago
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

neilv · 2 years ago
The REPL in DrRacket is like that because it was made by professors, specifically targeting intro students who had never programmed before. They thought a big Run button with a clean slate each time would be less confusing.

You don't have to use DrRacket to use Racket.

People doing real work with Racket tend to have "workflow" setups that are closer to SLIME.

I personally used a simpler Emacs setup ("https://www.neilvandyke.org/quack/"), and ended up leaning more on modules and embedded unit tests ("https://www.neilvandyke.org/racket/overeasy/"), and less on very dynamic interactive evaluation like I'd done before.

Though, if you want to monkeypatch heavily, CL is famously good at that.

MrBuddyCasino · 2 years ago
You might be happy (or sad) to hear you‘ve just qualified for the HN humble-brag finals.
rpdillon · 2 years ago
There is something edgy about calling oneself a community freeloader and then casually mentioning you wrote a book on the topic.
cess11 · 2 years ago
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.

A couple of more resources that are useful:

https://www.greghendershott.com/fear-of-macros/

https://beautifulracket.com/

prlin · 2 years ago
Any specific highlight from Bogdan? Nothing jumped out from a quick skim.
cess11 · 2 years ago
He posted a list elsewhere in the thread, showing off his web-shop and stuff for mobile phones.

What I've used most over the years is his writing about GUI development.

https://defn.io/2019/06/17/racket-gui-saves/ helped me figure out some patterns I had trouble with and got me stuck in using Racket for this purpose in personal projects.

Later he added observables and threading logic, making it even nicer to build GUI, https://defn.io/2021/08/01/ann-gui-easy/ .

The core web development tools in Racket aren't exactly trivial to get started with until one is rather fluent with continuations so I've gained a lot from http-easy and Koyo, https://www.youtube.com/watch?v=DS_0-lqiSVs.

sourcepluck · 2 years ago
Ctrl-f "racket" on his "Projects" page here, there's tonnes of stuff https://defn.io/page/projects/

Deleted Comment

bjourne · 2 years ago
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.
shawn_w · 2 years ago
> 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.

sschwarzer · 2 years ago
> Startup time is pretty comparable to Python in my experience.

In my experience a "Hello world" program with `#lang racket/base` (precompiled) takes around 150 ms on my computer whereas Python takes about 50 ms.

> Using the racket/base #lang instead of racket makes a big difference too.

My experience has been: As soon as I use `#lang racket/base` with `(require racket/match)` for pattern matching, the startup times are as when using `#lang racket`.

bjourne · 2 years ago
Hmm... perhaps. Last I tried Racket using it as I'm using Python didn't work well. It wasn't just the startup time of Racket, it was also all the libraries I used. Like loading most libraries is almost instant in Python but they weren't in Racket. Sure I could perhaps solve those issues (caching?), but it would be working against the grain of the language's ethos and that just doesn't work out well in my experience. For example, there are excellent REPLs for, say, Rust, but using them is not the same as using a REPL for a language (runtime) intended for interactive use.
igouy · 2 years ago
> doesn't start with a "clean slate"

The docs seem to suggest that the user can explicitly decline to save backup files?

https://docs.racket-lang.org/drracket/drracket-files.html#(p...

Presumably offers can be declined?

"When DrRacket first starts up, itlooks to see if there are any backup files still present and if so, offers to restore the backup files"

spdegabrielle · 2 years ago
That is a DrRacket feature, and nothing to do with staring the REPL in a clean state.

https://blog.racket-lang.org/2009/03/the-drscheme-repl-isnt-...

qwerty456127 · 2 years ago
Try Smalltalk :-))
spdegabrielle · 2 years ago
I *love* Smalltalk. EVERYONE should try Smalltalk !
jnxx · 2 years ago
You might find Guile interesting, I think it is more immersed than Racket, especially when debugging, and more similar to Common Lisp (SBCL).
pjmlp · 2 years ago
Welcome to the world of Smalltalk and Lisp Machines, which modern IDEs still don't fully support everything, like hot-reload, saving work states, control over the whole development stack in a single language.
captainkrtek · 2 years ago
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.
czhu12 · 2 years ago
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.

lavp · 2 years ago
I also TA'd 110 and I firmly disagree. CPSC110 teaches you to view a particular problem as a series of different possible states, and solving for those states (while placing an emphasis on seeing base cases and working up from there). Students learn about data structures like binary trees by the fifth week, and the ninth week they're already able to solve sudoku puzzles using generative recursion. We even touched on the n-queens problem towards the end of the course.

Racket serves its purpose well as a simple and fast to learn educational language; it's easy to see and understand recursion. It's also easy to see what the execution order of statements in your program.

I will say though that some problem sets were a bit brutal in terms of time taken to complete them.

zelphirkalt · 2 years ago
Most data structures taught with imperative languages are just that, data structures for imperative languages, which run on a single CPU core and do not utilize multiple cores well, or at least not without locking mechanisms. One can usually find one of them and copy paste the code, when needed. Much more interesting are purely functional data structures, that can be easily parallelized. That is what universities should teach. I feel like we are quite backward in education with data structures. I can watch a whole data structures lecture/class at no cost besides my own time on YouTube, for famous professors, but when I want to apply it in an FP setting, I will still be dumbfounded and looking for other solutions, which I do not know how to arrive at.
cess11 · 2 years ago
"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."

They hadn't done simple recursive functions over lists? What had they been doing?

Been a while since I had to read introductory material for Racket (or any similar language), but as I recall functions with a base case exit and recursion is usually among the first things they teach.

IIsi50MHz · 2 years ago
> 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'm surprised anew on the rare occasions I come across statements like this. The first time was when I applied for my first programming elective class. The teacher actively tried to dissuade me from it, saying that by the end of term they'd be lucky if they even got to for-next or do-while loops. I was shocked, having first understood these from BASIC code listings in the back of magazines, with only one or two weeks per year having a few hours of access to an Apple II on which to actually run anything.

I tend to fall into the trap of feeling that loop constructs should be so trivial, that understanding should come from a tiny fraction of one class session plus maybe a few minutes tracing the code by hand. So, I thank you for being my irregularly scheduled reminder that people's first exposures to such things can be very different.

t4ng0pwn3d · 2 years ago
SICP doesn't teach assignment till chapter 3 if I recall correctly, and that was used for years at MIT. I don't think it set CS back there, so maybe it was more a teaching issue?
lavp · 2 years ago
Good ol' Gregory Kiczales
api_or_ipa · 2 years ago
Trust in the recursion
joesb · 2 years ago
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.

cess11 · 2 years ago
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.

jbclements · 2 years ago
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.

All of this is my opinion, of course.

zelphirkalt · 2 years ago
You are supposed to be able to choose for each module the language of the module, I think.
fanf2 · 2 years ago
This website, Hacker News, is written in Arc and runs on Racket https://en.wikipedia.org/wiki/Arc_(programming_language)
ReleaseCandidat · 2 years ago
The biggest problém of Racket isn't the language or it's ecosystem https://news.ycombinator.com/item?id=27531508
kod · 2 years ago
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.

rscho · 2 years ago
This is a very personal conflict between prominent community members. The larger racket community is very friendly, including the core team.
cess11 · 2 years ago
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.
Bogdanp · 2 years ago
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!

[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 · 2 years ago
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 :)

https://docs.racket-lang.org/http-easy/index.html

https://docs.racket-lang.org/gui-easy/index.html

https://racket.discourse.group

jnxx · 2 years ago
>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.