
Racket is 25 - azhenley
https://blog.racket-lang.org/2020/05/racket-is-25.html
======
sohamsankaran
Taking an SICP-like class in Racket and playing with recursive constructs for
the first time was one of the highlights of my CS education. This language
gave more unalloyed joy than anything else I've done as a programmer, though
I've yet to build anything practically useful in it.

~~~
billfruit
I thought similarly too, until I spent some time with Prolog. Lisp seems
wonderful and clever, but Prolog feels even more magical.

Even a simple thing like concatenation of two lists, that in Prolog it could
be done purely declaratively, without expressing how it needs to be performed,
seems levels more magical than how it is done in lisps.

~~~
jrumbut
Something I would like to see is Prolog/logic programming embedded in a
general purpose programming language, rather than as a standalone system.

Racket and Perl 6 are the only small userbase languages in the last 8-10 years
to amaze me with their feature sets and to make me want to learn them just for
the sake of experiencing them.

~~~
FPGAhacker
Probably doesn’t fit what you mean by mainstream, but even so:
[https://github.com/clojure/core.logic](https://github.com/clojure/core.logic)

> A logic programming library for Clojure & ClojureScript. core.logic offers
> Prolog-like relational programming, constraint logic programming, and
> nominal logic programming for Clojure.

~~~
jrumbut
This is cool but less what I'm looking for, which is to actually write Prolog
inside my Clojure source, or be able to include a Prolog file.

Minikanren seems to be closer to the mark, and I thank the commenters who
pointed it out!

~~~
harperlee
I think you oversaw that core.logic is basically a minikanren (plus c-kanren,
plus alpha-kanren) implementation in clojure instead of scheme; it even points
to the papers and to The Reasoned Schemer for documentation and reference.

That is, saying that minikanren seems to be closer to the mark than core.logic
is a little bit nonsensical (please read that in a good sense!)

~~~
jrumbut
You're right, although I think what I was actually wrong about was what
minikanren is (probably by looking at examples in languages I was less
familiar with).

I don't want to do logic programming in clojure (or whatever other language),
I want to do logic programming in Prolog and drop it into my clojure project
and have to do as little plumbing as possible.

The nearest analogy I can come up with is LINQ. In the examples in [1] the
experience of the developer is closer to writing SQL in the middle of a C# or
VB file, rather than having a good C# database query library.

[1] [https://docs.microsoft.com/en-
us/dotnet/csharp/programming-g...](https://docs.microsoft.com/en-
us/dotnet/csharp/programming-guide/concepts/linq/)

------
mark_l_watson
I used Racket a lot about 2 months ago. I was prototyping an application [1]
in three different languages: Racket, LispWorks Common Lisp, and Swift.

Racket produces standalone applications that can be codesigned using Apple's
tools, in preparation for their App Store.

Best regards to the Racket team.

[1]
[http://www.knowledgegraphnavigator.com/](http://www.knowledgegraphnavigator.com/)

~~~
threepio
> Racket produces standalone applications that can be codesigned using Apple's
> tools

Can you elaborate on how this works? I've been wanting to try something
similar.

~~~
mark_l_watson
My codesigning notes for Racket

Build an application, unpack the .dmg file, add my own data files, create a
new subdirectory with same name and move all files into it, discard the dmg,
use Disk Utility to build a new .dmg and sign it:

codesign --force --deep --options runtime -s mark@mydomain.com -v New.dmg

Note: my app had required data files, which complicated the process.

~~~
fiddlerwoaroof
I’ve figured out a somewhat automatic way to do the dmg bundling which may be
of interest:

[https://github.com/cjdev/aws-
access/blob/master/Makefile#L26](https://github.com/cjdev/aws-
access/blob/master/Makefile#L26)

The manifest file used is here:

[https://github.com/cjdev/aws-
access/blob/master/dmg.json](https://github.com/cjdev/aws-
access/blob/master/dmg.json)

It’s a bit annoying because it requires having a working node installation,
but I found the whole process of building and configuring a dmg much too
manual and undocumented to not use some kind of utility for.

------
manish_gill
I've picked up Racket recently after a long while and I'm enjoying it.

Does anyone have recommendations of how to learn to _think recursively_? Sure,
using the language more and more does it, but what about a more general
recursion as a problem solving paradigm pattern? I'm enjoying doing recursive
code exercises and got into Backtracking problems. Creating things like Sudoku
solvers, Knight's Tour grid etc was quite fun. I still can't develop
recurrences easily though.

Any books/exercises that people here found helpful?

~~~
neilv
One way to learn some of using recursion while using Racket (or any other
Scheme) is to:

* avoid the iteration constructs that Racket added to Scheme,

* avoid mutating operations, such as `set!` and those that operate on mutable data types,

* embrace named-`let` for iteration/recursion (using `let` with a name, like `(let loop-for-foo (` rather than `(let (`, which effectively makes it like an embedded function that can be called from within its own definition), and

* embrace immutable data for collections, like immutable pairs and immutable hashes.

You can do that for real-world development, or for interview-oriented
Leetcode-type exercises. Whichever motivates one more; with the above
suggestions, both will present many opportunities to practice recursion this
way, without exercises that are selected or contrived to need recursion.

~~~
ausbah
if Racket was built on top of immutable data structures, recursion, and the
likes - why were imperative-like features such as mutation added to the
language?

~~~
neilv
Scheme was defined as an algorithmic language, not a strictly pure-functional
one, though it also included some functional features and permitted other
functional abstractions to be implemented.

Racket slowly added some immutable data types to Scheme, which was a nice fit
for some other Scheme features that had been there from the start, and better
for software engineering (e.g., enforce that a user of a module couldn't go
and mutate data you were sharing with them).

------
ken
> "If functional programming is that good, why is nobody using it?"

In the past 25 years, I think we've seen quite clearly that programming
language popularity depends on many different factors, and "quality of he
underlying paradigm" is way down on that list -- if it's even a factor at all.

Just a quick glance at any list of most-used-languages will tell you that 50%
of popularity is "is it being pushed by a big company?", and 25% is "is it the
primary interface for a popular platform?"

Take away those two factors and there's maybe only about 3 languages left in
the top 25 (Python, Ruby, PHP?).

Where quality shines is in being able to stay a viable niche for a long period
of time. That's Scheme.

~~~
hintymad
Oh, lots of people are using functional programming. They just don't use the
paradigm exclusively nor do they use a purely functional programming language.
Let's see,

\- Supporting higher order functions in programming languages. Check.

\- Usual operations on higher-order functions like currying? Check.

\- Functional reactive programming. Check. Rx was a big thing a few years ago.

\- Purely functional data structures. Check. Even Java has a few reasonably
popular libraries that support such data structures.

\- Using referential transparency whenever we can. Check.

\- Using CPS (continuation-passing style) in daily programming. Check.

\- Using recursion in production. This is not functional programming per se,
but given that so many people mention recursion whenever they mention
functional programming, it's worth listing recursion here. And mutual
recursion and tail recursion, two of the hallmarks of entry-level functional
programming techniques? Check and check. For instance, RxJava implements
trampoline just to support tail-recursion, as it is necessary to implement
cleanly some of RxJava's operators.

\- Common techniques seen in functional programming, particularly the ones
that involve map, reduce, scan, left-fold and right-fold. Check.

This is just the items that are on top of my mind. I'm sure I missed plenty.
The gist is that people have been adopting functional programming. They just
don't necessarily move to a purely functional programming language for
practical reasons: platform, support, community, ecosystems, or even
marketing. Programming paradigm is just one factor among many when people
choose their programming languages.

~~~
sweeneyrod
Who uses CPS in daily programming? Or do you mean using a compiler that uses
it?

~~~
Twisol
The Visitor pattern is not much more than a CPS-style transform that lets you
represent sum types in a language without them.

A CPS transform for a computation of type `X` gives a computation of type
`forall A. (X -> A) -> A`. That is, instead of evaluating to ("returning") a
value of type `X`, you take a function that you deliver a valid of type `X`
to, and return whatever it returns.

CPS-transforming a sum type `X + Y` gives `forall A. (X + Y -> A) -> A`, and
if you distribute over the sum you get `forall A. ((X -> A) * (Y -> A)) -> A`.
The visitor is the pair of functions you pass in, `(X -> A) * (Y -> A)`, and
the value decides which method to call. In either event, it returns whatever
the chosen visitor method returns.

(Dropping into Java syntax, this is the type of the `visit` method: `<A> A
visit(Visitor<A> visitor)` -- and the Visitor is `interface Visitor<A> { A
onX(X x); A onY(Y y); }`.)

------
nickmain
I've used Racket for many prototype languages and tools and love its
facilities and philosophy. The thing that always gives me pause when
considering it for a new project is that it has no robust mobile or client-
side web story.

If the tool lives on beyond prototype then I have to rewrite it in a native
language or restrict it to the subset of Scheme that can run in Gambit on iOS.

I really hope that Racket can evolve and adapt to a world where more computing
and even development is going to happen on mobile and web.

~~~
peatmoss
I keep looking at Gerbil Scheme as another “modern feeling” scheme with some
opinions and creature comforts. And it’s built on Gambit.

------
emmanueloga_
I wish the team did away with Dr Racket... It does have some unique features
but I feel like it adds megabytes to the whole package and is not really very
usable for anything other than learning (imho). I've seen this acknowledged by
the Racket docs I think (the fact that it is supposed to be a learning
environment).

I suspect Racket would be a lot more popular as a development environment if
the team did away with Dr Racket and put those resources into maintaining a
very solid Emacs, Vim and VS Code integration.

~~~
nikofeyn
racket doesn't have any less of a solid integration into emacs (racket-mode)
and visual studio code (magic racket) than most other languages.

~~~
emmanueloga_
I don't think this is true. I don't think racket-mode has a big community
around it, and sadly doesn't come even close to slime [1] or cider [2], both
very feature full dev envs for Emacs.

Magic racket is very bare bones and can't compare to integrations like Calva
[3].

So I saw someone down voted me... just to be clear, I use Racket despite
having to work against a poor tooling experience, when comparing to say, CL or
Clojure.

I want Racket to succeed in industry, so is not like I'm complaining. I'm
pointing out what I think is a weakness, maybe a blind spot by the team, since
they seem to be very attached to Dr Racket!

1: [https://common-lisp.net/project/slime/](https://common-
lisp.net/project/slime/)

2: [https://cider.mx/](https://cider.mx/)

3:
[https://github.com/BetterThanTomorrow/calva](https://github.com/BetterThanTomorrow/calva)

~~~
soegaard
Have you checked the new features recently?

[https://www.racket-mode.com/](https://www.racket-mode.com/)

~~~
emmanueloga_
So part of the problem is that racket mode has a bus factor of 1. I saw that
the maintainer posted this [1] a while ago, which is a bit concerning.

My point is that would be ideal if the core Racket team also participated in
polishing the IDE integrations, other than Dr Racket.

1: [https://www.greghendershott.com/2019/07/future-of-
racket.htm...](https://www.greghendershott.com/2019/07/future-of-racket.html)

~~~
greghendershott
On the other hand, I've just spent several more-or-less full-time months
taking advantage of the drracket/check-syntax library, provided by the core
Racket team.

On the third hand, I spent all that time, so wrt "bus factor 1", there will be
no pleasing you. :)

~~~
emmanueloga_
Just avoid buses please :-p

Thanks for all your work on the racket ecosystem!

------
ethagnawl
Racket has some of the best documentation I've ever seen and is a joy to use.
I don't use it, but DrRacket is also a great IDE -- especially for beginners.

I wish either Racket was more widely used in industry or I had more
time/energy/excuses to use it.

~~~
catalogia
Scribble documentation rendered as HTML is alright, but I wish there was
better support for accessing that documentation in your editor. _Racket Guide_
and _Racket Reference_ are both very well written though.

~~~
sorawee
In DrRacket, when the cursor is on an identifier, you can hover over the big
arrow at the top right corner of the definition window. A popup will appear
showing basic usage of functions / macros without detailed explanation.
However, you can click "read more..." which will open up the full
documentation in a browser. Also, this documentation is installed locally and
does not require the internet.

------
pjmlp
Happy birthday!

Looking forward to Racket CS as main implementation.

The talks done by the Racket team are always interesting to watch.

~~~
pankajdoharey
Well this is a Birthday year for many languages. 1995 must be some super
anomaly year Ruby, Java, Javascript, PHP, Delphi and Racket all were invented
in the same year.

~~~
skrishnamurthi
I don't think it's a coincidence that the mid-90s was a hot time for language
design: the CGI-bin protocol of the Web suddenly made it possible to write
code in any language you wanted and distribute the results, even with a
loosely graphical interface, painlessly to clients (in the sense they didn't
need to install anything). I call it the "Cambrian explosion of languages".

Though Racket was not created for that purpose, it's unsurprising that many
others from that era were linked to the Web.

~~~
pankajdoharey
Perhaps you are right, I was just just 11 when these languages were invented
so I really lack any context.

------
ipnon
What I learned from studying Racket is that I can now only reluctantly forego
functional programming languages in all contexts personal and professional.

~~~
skrishnamurthi
Why forego at all? (-:

------
submeta
How does Racket compare to Clojure? Anyone knows both worlds and would like to
give some infos? I know Clojure is JVM based, one of those new languages built
on Java technology (the others being Scala and Groovy). So very solid tech
used by the likes of Soundcloud or young startups like RoamResearch. But
Racket? Mostly education?

~~~
madhadron
There is very little commercial use of Racket. I've used it several times to
make little GUI apps to deploy on multiple platforms, and it excels at that.

Probably the best way to think about the two of them is that Clojure is a
focused language design, and the assumption is that you stay in the language
and extend it with macros. Racket is an environment for generating languages.
The assumption is that you will build language variants to do various tasks.

~~~
neilv
Very little commercial use of Racket is maybe an understatement. A few notes
to people thinking about commercial use of Racket...

The big customer of my consulting business (public sector) did amazing "force
multiplier" things with Racket and my help, even when many general-purpose
libraries had to be built in-house. But there were virtually no other
prospective clients in that niche after over a decade.

There are a few organizations who use Racket to great production effect. But
two problems for consulting&employment for those:

* Their generally one-person teams could usually do everything that's needed, and perhaps some developers prefer that;

* When they would like additional help, they generally didn't have the money/authority to pay HCOLA developers.

I tried half-heartedly for a few years to promote the idea of doing one's
startup prototype with Racket. But the browser-side and iOS&Android app
stories aren't there yet. And my own startup, I self-funded too long before my
co-founder and I realized we should've found a CEO to court funding months
earlier.

The startup where I currently lead engineering uses (for historical reasons)
Python for server backend and for device interfacing on a light embedded
system, and framework-like JS on one frontend, and interfaces with a SaaS for
a different frontend. All the Python bits could've been done in Racket, and
Racket would've been more productive and fun to work with, but it's not worth
rewriting at this time. I recently prototyped a new embedded system frontend
in Kivy, and was able to get a running GUI mockup nice in a few hours, but
realized afterwards it would've been better with Racket's GUI toolkit.

When I recently had to pick a method to do an iOS app that wasn't consumer-
facing, I was tempted to use Gambit Scheme. But I decided on Swift and
SwiftUI, to be safe, and so we'd have more experience with it for the next iOS
app (consumer-facing, for a high-quality/prestige brand) that was more likely
to need a more-native toolkit and APIs.

That said, if someday I have a startup that uses Racket or another Scheme (or
another fringe platform), I expect the platform appeal to help me attract a
larger pool of higher-powered developers than I otherwise could.

If you're considering using Racket for making money, one start is to
participate in this low-traffic email list (which has some unusual
conventions): [https://www.neilvandyke.org/racket-
money/](https://www.neilvandyke.org/racket-money/)

------
ipnon
It seems functional programmers are alone in being able to take a joke. Long
live Racket!

------
teodorlu
What is "the infamous Felleisen-Wadler paper"?

~~~
throwaway17_17
Based on context I would assume it is:

A Call by Need Lambda Calculus.

Zena Ariola, Matthias Felleisen, John Maraist, Martin Odersky, and Philip
Wadler. 22'nd Symposium on Principles of Programming Languages, ACM Press, San
Francisco, California, January 1995.

There is a humorous story about how the paper and collaboration came about,
which Felleisen discusses in an interview [1].

[1] —> [https://www.cs.cmu.edu/~popl-
interviews/felleisen.html](https://www.cs.cmu.edu/~popl-
interviews/felleisen.html)

~~~
teodorlu
Thanks!

------
spdegabrielle
Happy Birthday Racket! I’ve learnt a lot working with Racket and I hope that
will continue: next on my list `#lang typed/racket` [https://docs.racket-
lang.org/ts-guide/quick.html](https://docs.racket-lang.org/ts-
guide/quick.html)

------
traes
I feel like this article has a rather abrupt ending. Is there another resource
that covers Racket's early history?

~~~
samth
It's really just about the initial steps of the project. One talk you might
like is
[https://www.youtube.com/watch?v=wEgaVMOYLEU](https://www.youtube.com/watch?v=wEgaVMOYLEU)
from 9 years ago.

------
mtsx
welcome

