What do you think about the draft?

@Apos yes, the motivation was just to show a bit of assembly. Hello-world is a classic, but I wanted to include some simple instruction like add and mov as well. I will think of another example/explanation.

Also, I plan to change the Taste of assembly section: instead of numbers in the code (/* 1 */) that are referenced in the text, I want to present full code listing, and then repeat relevant instructions intertwined with explanations.

p96: is double negative here necessary? :slight_smile:

So, why not pop the return address not back into lr, but directly into pc?

p111: is it worth pointing out that “improvement” means trading readability for brevity?
Because, as a reader/student, the “pre-improvement” version is easier to follow than the “improved” one.

We can do precisely that, but there are few improvements that we can make.

1 Like

@gmarik, you are pretty far into the book! What do you think about the chapters so far?

so far so good!
looking forward to getting to the coding part, and actually testing my understanding.

1 Like

7.19 last paragraph:

conditionl execution

I found some other ones, but I forgot to save them. Now I’m in chapter 8.

1 Like

Page 116:

whenever we encounter and identifier node

and should be an.

1 Like

I finished the book. Now I’m at the point where I can code something.

@Apos Congrats! Let us know how it unfolds!

1 Like

In the code for the baseline compiler, there’s this line:

You pass an error message, but it’s never used. Also that code is different from what I see in the book.

1 Like

Yeah, in the book it says:

return new Parser(source => { throw Error(message) });

As it should. In the repo what you see is a left-over from a time I was debugging the parser. For that, instead of printing a message, I printed the source starting from the current location (source.index) as a way to see where the parser encountered this error. I will change it back to throw Error(message) in the repo.

1 Like

I love it! Am a third of the way through the book and I’ve read the entire (incomplete) OCaml source code.

My only gripe is the implementation languages but I’d struggle to recommend a better one. Only one thing for it: we must invent a better language! :grinning:

1 Like

@jdh30 I’m glad you liked it! And I’m especially pleased to hear it from the author of The OCaml Journal that I used to read.

Yeah, as I say, TypeScript is probably nobody’s favorite, but I was surprised to find it half as bad as I thought. I was struggling to pick between JS, Python, and C#, and thought that TypeScript might not be a bad compromise.