I've begun writing a book about Roc. Here is an early draft:
https://roc.lynrummy.com/tutorial/introduction.html
I won't go into too much detail here, because the introduction should speak for itself, and if it doesn't, then I need that feedback.
I'm about 20% through the book for the scope that I have set out. I would love to get feedback now about nearly everything, but especially on the Roc code. It's all agent-written code, so I think folks like @notramo may be particularly suited to give the code an adversarial review, if they have time, of course. I want the Roc code to shine.
The prose is also agent written. I've done a fairly decent job of teaching Claude how to avoid agent-speak with the help of adversarial agents and Shale scripts, but it's harder for me to spot these days! Any feedback about the overall tone would be helpful, especially broad critiques like "it's too dry" or whatever.
I like the prose and tone :)
One thing that comes to mind, for those who are unfamiliar with animation, it could increase cognitive load because they are learning both animation and Roc at the same time.
Thanks! Yeah, that's totally fair criticism. I'm slightly biased, because I think animation is fairly simple when the agents do all the trigonometry. I think I need to be a little more explicit in the introduction that the reader will be learning TWO things during the book.
Claude agrees with your feedback too, by the way. :smile: We're on it.
I like a lot using LLMs for learning. For many fields, LLMs are the best and cheapest educational tool that ever existed.
But I think books or blog posts are just the wrong format to write with LLMs.
It's a wrong way to utilize an LLM for learning. I can't ask questions from a book. It's structure is fixed, and it may not match my most effective learning style. Different people like different ways to structure learning material, e.g. the most simple difference is that some people like to start with small details and work towards the big picture, while others like to start from the big picture.
There's only one reason for writing a book or blog post: the writer can provide insights, viewpoints, or info that an LLM is not capable of providing.
But if an LLM writes the book, there will be zero amount of those.
Why should I read a book or blog post if it provides only LLM-based info? I could have prompted my preferred LLM to provide that info in my preferred style.
Books should be the input to an LLM, not an output.
Reading an LLM-written book or article is inferior to both reading human-written stuff, and using an LLM interactively.
None of your feedback is actionable here. If you disagree with the premise of using agents to build a book, then find another topic to discuss, please.
I just wrote these to provide some background for my feedback.
I've done a fairly decent job of teaching Claude how to avoid agent-speak
It's still very obviously LLM-written. Fixing the phrasing is not enough, because the way of explaining the problem is the big obstacle here. I started reading, but I quickly got bored from filler text, while at the same time got too much info from other sentences, that did not help learning, because it's not gradually built up.
Ok, I'll look for filler text. That's actionable, thank you.
When somebody thinks about learning/teaching with LLMs, I usually recommend to use the largest variant of Gemini (so 3.1 Pro or 4 Argon). It's way better at explaining things. If no Gemini available, then try GLM 5 and Qwen 3.5 Plus, or Qwen 3.8 Max, but it depends on the task with those LLMs, and I only tried them for interactive learning, not for writing a book.
I would recommend taking a try at a non-customized Gemini, with no style guide, and only the task.
GLM and Qwen are very sensitive to style-related prompting, so it's best to figure out some way to steer them by prompting an approach, instead of explicitly giving style instructions, because of weak generalization. If the style instructions are not well represented in the training data, an instruction may affect unrelated things. This also happens with GPT and Claude, and also with Gemini, but to a lesser extent.
So, describe what you want as result, and not how to do it.
Ok, I've gotten enough feedback from you. Thanks.
Just a question:
Lines that start with
#are comments.
What is the target audience for the book? Total beginners, or intermediate?
Intermediate. I assume the audience is a somewhat experienced programmer who is new to Roc.
As somebody who knows the language quite well, is there something relevant for me in this book?
Where should somebody start, who has experience with Roc, but are new to animation and 3D?
If you are already a Roc expert, then you could be most helpful by reviewing the Roc concepts. That's one of the things I clearly asked for at the top of the topic. Instead, you spammed me with a rant about LLMs. You should start at the beginning and skim past stuff that doesn't interest you. If none of it interests you, then kindly leave the thread.
Instead, you spammed me with a rant about LLMs.
Because I think Claude is just bad at writing books. And since you stated that you put effort into reducing "agent-peak" and agentic writing artifacts, I thought you would find some LLM usage and prompting tips valuable.
Sorry if it was useless.
As someone who only uses Claude, you got used to its style, so its writing probably doesn't annoy you as much. However, many users use different LLMs, and those LLMs write in more readable styles, so the users are not that much used to Claude style.
Please stop spamming my thread. You keep repeating the same themes over and over again.
Feel free to ask me publicly, no need to DM. I don't get offended.
I was just hoping learn something new from the book, but I could not learn anything, despite I'm not familiar with animation or 3D. Sorry for providing feedback.
Please stop spamming my thread.
Anton said:
I like the prose and tone :)
One thing that comes to mind, for those who are unfamiliar with animation, it could increase cognitive load because they are learning both animation and Roc at the same time.
We added this to the introduction:
You'll learn two things as you read: Roc, and how a ride like this one is animated. The animation is a handful of plain ideas. Each frame is one picture, and a step moves the world on before the next. Far things look small, and near things cover far ones. The book explains each of these in plain words where the ride first needs it, and the trigonometry behind them waits for a chapter of its own near the end. If you know animation already, skim those parts. If both are new to you, you'll get both at a walking pace.
And we updated our style guide that we should be careful about assuming too much knowledge of animation concepts (throughout the book). Thanks, Anton!
We added this to the introduction
I like it!
Here's the link again: https://roc.lynrummy.com/tutorial/
I will reiterate that my biggest concern is that the Roc code itself reads nicely. To notramo's point, most folks here are a bit advanced to be potential readers of the book, so I am essentially asking for code review in the context of the book.
The code looks good, I think you definitely have enough experience to write it well.
The only nit is lots of Point.Point (instead of Point) on this page, but I could see the argument for consistency with the other code snippets.
I agree that Point.Point gets repetitive. I don't know the best Roc idiom here.
Defining it as a nominal?
Point := { x : Pixels, y : Pixels }.{
## The point `x` pixels across and `y` pixels down.
at : F64, F64 -> Point
at = |x, y| { x: Pixels.of(x), y: Pixels.of(y) }
}
Steve Howell said:
I agree that Point.Point gets repetitive. I don't know the best Roc idiom here.
What do you think of https://roc-lang.org/docs/main/langref/statements/#renaming-imports ?
Is there a reason for naming two different things with the same name? It's usually a bad practice in most programming languages.
from Claude:
I changed the declaration in lib/Point.roc itself, and every import stayed as it was:
roc
import lib.Point # unchanged in every caller
...
corner : Point # was Point.Point
corner = Point.at(3.0, 4.0)The old module wrapped an empty type (Point :: [].{ Point : { x, y } }), so the record type was nested one level down as Point.Point. Now the module's own type is the record (Point := { x : Pixels, y : Pixels }.{ … }), so after a plain import lib.Point, the name Point is both the type and the home of Point.at. That's the same pattern as Cat, Conifer and Distance. The rename touched 41 files, and all 59 apps check clean.
An import lib.Point as P alias would only shorten the module name, and the doubled name would still be there.
@notramo I think the general convention in most programming languages is that you should only use as to avoid collisions or to rename something from an API that you're forced to use. I agree that it's a bad practice to give two different names for the same thing. I think you were on the Ruby thread from a couple days ago, correct?
obligatory: The three hardest things in programming are naming things, managing caches, and avoiding off-by-one errors.
I think you were on the Ruby thread from a couple days ago, correct?
Where's that thread?
One possibly engaging addition could be to show something like an exploded view of the animation frame that also shows labels with the types.
https://share.google/wnrgFQBbR6k8sCUIa
notramo said:
I think you were on the Ruby thread from a couple days ago, correct?
Where's that thread?
is the thread. You're technically on the thread, but before Ruby came up, so I was mis-remembering.
Anton said:
One possibly engaging addition could be to show something like an exploded view of the animation frame that also shows labels with the types.
https://share.google/wnrgFQBbR6k8sCUIa
Definitely actionable. I think a more moderate version of this idea is just to add labels to some of the widgets within the picture itself. The widgets are Roc-based, of course, so this should be easy enough.
I agree that it's a bad practice to give two different names for the same thing.
I wrote the opposite: instead of one thing with two different names, two different things, that are named the same. In this example, both the module Point and the alias Point have the same name, but are different things, and the only way to decide which one does the word point refer to is to look at whether it's inside the namespace, or the namespace itself. (Before you refactored it.)
I agree that it's a bad practice to give two different names for the same thing.
But yes, this is also true.
So, generally: one thing - one name. If there's two of either, it's bad.
Ah, I misread that, so thanks for the clarification.
The concept of ubiquitous language (in the book Domain Driven Design by Eric Evans) extends it further: both the real-world business terminology and the code variables/types should use the same name.
Yup, makes sense. Some of our naming decisions are super easy, so a conifer maps to a Conifer type. Some concepts are more abstract. For example, we have a Sighting concept that is about where an object is sighted on the page.
A tip for naming things: if two things have the same name, a good idea usually is to search for a word that is more specific, or provides more info about the concept. For example, instead of Point, name it ScreenCoordinates or WorldCoordinates, which would provide the additional info: does this data describe how we see this on the screen, or where it's located before rendering?
I don't know how much additional help would such a name provide in the code of Safari Ride, but it's just a generic naming principle, that can help in some cases.
Yup, we have two-syllable names already.
Brevity's important too, so we call distance Distance, because it's extremely versatile, and usually the frame of reference is clear enough from the enclosing types that use it. But we also have a FarHeight type that gets used in a more specific context. It should arguably be FarProjectedHeight, but, again, often the enclosing types make it clear enough, and I don't go full Java on names.
I don't go full Java on names.
:smile:
We have a RaisedPointAhead that describes a point that has been translated into a frame of reference that accounts for the curvature of the earth. This is used to draw tall objects that are far away. In the app radio towers actually dip below the horizon.
I also occasionally get finicky about prepositions. I prefer SegmentInView to SegmentView, so we use the former.
Most of the code reads like this:
expect
RiderView.point_between({
from: {
right: Distance.metres(0.0),
forward: Distance.metres(10.0),
height: Distance.metres(20.0),
},
to: {
right: Distance.metres(8.0),
forward: Distance.metres(30.0),
height: Distance.metres(0.0),
},
fraction: Fraction.of(0.25),
})
== {
right: Distance.metres(2.0),
forward: Distance.metres(15.0),
height: Distance.metres(15.0),
}
(I let Claude spell "meters" as "metres" despite my American upbringing.)
What about giving EmojiStills.EmojiStill the same treatment as Point?
notramo said:
What about giving
EmojiStills.EmojiStillthe same treatment asPoint?
Fixed now. (book is still a stale deployment while we are churning a lot of stuff)
Thanks!
I should mention that the book itself is somewhat powered by Roc. The book is authored in a dialect of markdown, and that's mostly processed by my pure-Roc markdown package (see #contributing > markdown) along with a little bit of Shale (see #off topic > shale programming language). The only third-party dependency is dot.js for the diagrams, unless I'm forgetting something. All the images and widgets are Roc based, and the entire app itself is embedded WASM as well. The widgets use actual code from the app, of course. There's also CSS/JS for the styling.
The app runs in chapter one: https://roc.lynrummy.com/tutorial/introduction.html
The app kinda stumbles out of the gate until the browser gets wasm running at full speed, but then it starts running at the expected speed. Roc is fast!
correction: The book's diagrams come from Graphviz's dot program in book.shale at build time, as inline SVG. (I was remembering dot.js from my essay surface.)
Nice work @Steve Howell . :+1:
I really like the idea of building a concrete project from start to finish. To me, the main value for a Roc beginner who has gone through the tutorial is to understand how actual code should be structured, beyond tiny toy examples, and how some of the advanced language concepts can solve concrete problems. Perhaps that's worth mentioning in the intro, to motivate the reader.
I do feel like the intro is a bit too long: I'm concerned that readers might lose motivation before reaching the 4th page where the code starts. In particular, perhaps it would be more motivating to start almost right away by creating a tiny scene, then gradually extend and organize the project as the problems arise, rather than presenting the whole journey upfront, which might seem daunting and kind of spoil the fun. I skimmed through the chapters and it looked hands on, if perhaps a bit verbose at times.
This is Claude's reflection on the problems that Aurélien Geron poses:
http://143.244.172.148:9100/notes/the-books-problem-statement.md
I think it's really well written. I think Claude's a great writer, but it's not shining through in the book yet. That's my job as an editor. It's tough! But I hope to make some good progress. This feedback is so on point, but the execution is gonna be tricky.
@Aurélien Geron Thanks for the excellent feedback! We tried to address most of it with multiple edits throughout the book and a brand new chapter early in the book: https://roc.lynrummy.com/tutorial/one-page.html
https://roc.lynrummy.com/tutorial/introduction.html is now a complete first edition of my Roc book. The book doesn't have a riveting narrative, so I will spoil the ending. This is the last sentence of the book: Get the types right, and everything else follows.
It includes over 2000 lines of actual Roc code. I would love for folks to spot-check the Roc code to make sure it's idiomatic. Here is the longest chapter of the book: https://roc.lynrummy.com/tutorial/types.html
I'm starting a new book about how to do agentic development in general.
Other feedback is welcome, too. I don't have enough time to overhaul the central premise of the book, but I can still tweak things. The book describes how to build an animated screensaver with Roc.
There's now also an index of all the Roc concepts in the book: https://roc.lynrummy.com/tutorial/appendix-index.html
obligatory: The three hardest things in programming are naming things, managing caches, and avoiding off-by-one errors.
The version I remember says "the two hardest things", for comedy reasons. :slight_smile:
oops, I was off by one on the joke! That's what I meant haha.
Last updated: Nov 26 2026 at 20:35 UTC