
Beautiful Racket - tosh
https://www.beautifulracket.com/
======
ketralnis
I really like this book and highly recommend it.

My only complaint is that because it is so directed (you're writing a
programming language and it wants to get you there very quickly) it abstracts
a lot of stuff that you'll need to know if you're doing anything other than
following this book. For instance, a lot of the code you write will start with

    
    
        #lang br
    

Instead of the usual Racket

    
    
        #lang racket
    

That's using some support from Racket where you say "I'm writing the `br`
language" and Racket goes and runs your code in that language instead of
Racket. That "language" is really just Racket with some libraries pre-included
([https://beautifulracket.com/appendix/from-br-to-racket-
base....](https://beautifulracket.com/appendix/from-br-to-racket-base.html))
and some of those libraries are specific to the book (e.g.
[https://docs.racket-lang.org/br/index.html?q=br#%28mod-
path....](https://docs.racket-lang.org/br/index.html?q=br#%28mod-
path._br%2Fsyntax%29)).

So if you're following along the book, the upside is that that he can skip
explaining a bunch of stuff about Racket packaging and libraries. But the
downside is that he skips explaining a bunch of stuff about Racket packaging
and libraries. If you want to take what you've learnt here and go write a
programming language in Racket, you're going to have to go and learn all of
that stuff anyway. You're going to have to take apart `br` and figure out how
to map its parsing stuff to Racket's and you'll find that almost none of the
scaffolding from the book can be copy-pasted without including the book's
libraries, and many of the concepts aren't even reuseable if you want to use
Racket's parsing tools instead of the book's largely bespoke tools. (Just
including the book's libraries themselves can be difficult because of how
Racket's packaging works. In the New World of Racket packaging, you install a
library _on your machine_, not as a dependency of your project. So if you want
to run your code on another machine, you first have to manually install the
library on that machine before your code can run, and Racket's tooling around
this is currently very sub-par.)

But I'll say again that it's a great book and if you're interested in Lisp and
Scheme in particular, you should buy it and you should read it. It's great.
Just know that you'll have to read the book _and also learn Racket_.

~~~
threatofrain
On the matter of learning Racket, I've heard some good things about How to
Design Programs (2nd Edition):
[http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html](http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html).

~~~
klibertp
I'd say HtDP is a good book for learning programming, but I don't think it's
the best introduction to Racket. It also uses a specially crafted languages (a
series of them) and focuses on the process of coming up and implementing the
design, while removing most of the usual problems (cryptic error messages, too
complex docs, too advanced techniques) which the beginners encounter. It's
great as an introduction to programming, and it's even worthwhile a quick read
for more experienced programmers (esp. self-taught), but it's definitely not
about learning Racket, at all. The Little Schemer may be slightly better, but
on its own, it too is not about learning Racket. Actually, I guess there's no
book about Racket itself (EDIT: other than this one to some extent (in
"explainers")) - existing books either focus on the basics of programming
(HtDP, Realm of Racket) or on specific algorithmic problems and techniques
(The X Schemer, SICP). Which is kind of natural given the educational
background, but it makes it harder for already established programmers to
learn Racket to get the job done.

~~~
Scarbutt
After you have read HtDP2e, I found that racket-lang.org has all you need.

 _The Little Schemer may be slightly better, but on its own, it too is not
about learning Racket._

Although they overlap on some topics, comparing little schemer to htdp is
comparing apples to oranges.

Also, htdp is just racket in my opinion, it differs very little from the
students languages, I did the whole thing using just plain racket and didn't
have any problems that couldn't be solved in two minutes visiting docs.racket-
lang.org (and they were rare), but sure, you won't get to know all of racket
because that's not the point of the book.

------
bgorman
This is a very interesting case where the author claims the book is not free,
provides it on a public webpage, and does not want to provide a PDF or ePub. I
would gladly be willing to pay for content, but I like to do most of my
reading on a kindle. I am not willing to pay for a book if the author is
trying to make it as difficult as possible to view his book (but at least the
fonts are beautiful).

~~~
chipotle_coyote
Butterick has Strong Opinions™ about Kindle typography that led him to that
position. I largely share those opinions, to be fair, although I think it's a
bit of a quixotic enterprise for many books; offline is more important than
beauty. (And, really, the Kindle _could_ do most of these tricks if Amazon
gave a rat's ass; Apple's iBooks can do nearly everything that any other
WebKit browser can with regards to typography.)

Having said that, though, this is a book that I'd argue is better in the
browser than on the Kindle or as a PDF. I want to be able to read this with a
code editor open, and the book side-by-side in a separate window. PDF books
don't reflow, and in my experience Kindle just isn't particularly good for
tech books.

~~~
e12e
> I want to be able to read this with a code editor open, and the book side-
> by-side in a separate window.

Like this?

[https://xkcd.com/1988/](https://xkcd.com/1988/)

~~~
baldfat
I do it with two monitors like this:

[https://i.imgur.com/QZWIvNq.jpg](https://i.imgur.com/QZWIvNq.jpg)

~~~
PhasmaFelis
I'm a big fan of rotatable monitors. A 4x3 display rotated to portrait is
fantastic for reading most PDFs, if you set Acrobat to Fullscreen and Single
Page View.

As a bonus, lots of offices have a closet full of old 4x3 Dell flat-panels
somewhere, so there's no hassle with procurement.

------
_hardwaregeek
Practical Typography (written by the same author) has been a wonderful
resource for me. Sometime I'll get around to working through this book as
well. My high school is actually one of the last places to teach Racket/Scheme
as an introductory language. Personally I find it a wonderful way of teaching
the basics of computation and recursion. I wish more schools still taught it.

~~~
rachitnigam
Several universities still teach racket as an intro language. Ex: Brown,
Northeastern, Northwestern, etc.

The authors of Racket specially avoid arguments about teaching language X in
introductory CS. The pedagogy and curriculum are significantly more factors in
effectively teaching CS [1]. The design of Racket with its restricted
languages reflects that.

[1] [https://www.janestreet.com/tech-talks/curriculum-
design/](https://www.janestreet.com/tech-talks/curriculum-design/)

~~~
adjkant
This is an essay by the creator/author of How To Design Programs (currently at
Northeastern) that lays out the pedagogy well:

[http://www.ccs.neu.edu/home/matthias/Thoughts/Developing_Dev...](http://www.ccs.neu.edu/home/matthias/Thoughts/Developing_Developers.html)

The speaker in the talk linked is a previous Ph.D. student of the author
above.

Northeastern, Brown, Northwestern, and Waterloo all use the approach in HTDP
as far as I'm aware, even if they don't use the book itself. Racket just
happens to be the language of choice (or rather X Student Languages are, not
even Racket) because they fit the pedagogy well.

------
adjkant
This is a great introduction to Racket as a language for building languages.

For those interested further, there is a lot of work with Racket in this
respect. A recent paper previously hit the front page of HN on "Domain
Specific Languages" (DSL's), which is basically the idea that you should write
a programming language for each problem to make it easier to write programs in
that domain rather than writing complex spaghetti code in a general-purpose
language or writing a library that badly ports to the general purpose
language. I'm a bit biased here, but I think this could be the next big step
in programming in the next few decades as we see people not writing libraries
but writing DSL's to make for easy writing of programs.

HN Discussion:
[https://news.ycombinator.com/item?id=16454854](https://news.ycombinator.com/item?id=16454854)

The authors of the paper are mentioned in the acknowledgments of this book as
well!

~~~
grimgrin
Here's a cache of A Programmable Programming Language since it's down for me
atm

[https://webcache.googleusercontent.com/search?q=cache:ATgZRm...](https://webcache.googleusercontent.com/search?q=cache:ATgZRmeSNKAJ:https://cacm.acm.org/magazines/2018/3/225475-a-programmable-
programming-language/fulltext+&cd=1&hl=en&ct=clnk&gl=us)

------
watersb
Other fantastic projects by the same author:

“Typography for Lawyers”
[https://typographyforlawyers.com/](https://typographyforlawyers.com/)

“The Book is a Program” [https://docs.racket-
lang.org/pollen/](https://docs.racket-lang.org/pollen/)

------
weberc2
Looks like it's being hugged to death.

~~~
laCour
Archive link:
[https://web.archive.org/web/20180509201622/https://beautiful...](https://web.archive.org/web/20180509201622/https://beautifulracket.com/)

------
wvlia5
I have little knowledge of lisps, but I'd like to implement a new language in
one of them. What would be a better choice, racket or clojure?

~~~
thelibrarian
One of Racket’s is explicit design goals is to be a toolkit for designing and
implementing new languages, so I would say it is the better choice.

~~~
wvlia5
Yes I know, but I've heard some clojurists criticizing racket because of its
data structures. So perhaps that would outweigh its benefits. Thanks for your
opinion

------
nanomonkey
How useful is this book for a Clojure programmer? I always wonder if there is
cross-over in practices between the Lisps.

------
mathinpens
what a beautiful book.

