The "Dragon Book" is big on parsing but I wouldn't recommend it if you want to make many optimisation passes or a back-end.
The first edition was my first CS textbook, back in the '90s and as a young programmer I learned a lot from it.
A couple years ago, I started on a modern compiler back-end however, and found that I needed to update my knowledge with quite a lot.
The 2nd ed covers data-flow analysis, which is very important.
However, modern compilers (GCC, LLVM, Cranelift, ...) are built around an intermediate representation in Static Single Assignment-form. The 2nd ed. has only a single page about SSA and you'd need to also learn a lot of theory about its properties to actually use it properly.
Parsing is the front end to a compiler. Can't get semantics without first recognizing syntax. I have a hard time thinking about programming languages without seeing them as a parsing exercise first, every time.
Syntax and semantics are never orthogonal and you always need syntax so it must be considered from the start. Any reasonable syntax will quickly become much more pleasant to generate an ast or ir than, say, manually building these objects in the host language of the compiler which is what the semantics first crowd seem to propose.
It also is only the case that most of the work is the backend for some compilers, though of course all of this depends on how backend is defined. Is backend just codegen or is it all of the analysis between parsing and codegen? If you target a high level language, which is very appropriate for one's first few compilers, the backend can be quite simple. At the simplest, no ast is even necessary and the compiler can just mechanically translate one syntax into another in a single pass.
I think his point is that "form follows function".
If you know what kind of semantics you're going to have, you can use that to construct a syntax that lends itself to using it properly.
> The recommended advice is to start with semantics first. Syntax will change, there is not much point fixing it down too early.
It's actually the reverse, in my opinion. Semantics can change much more easily than syntax. You can see this in that small changes in syntax can cause massive changes in a recursive-descent parser while the semantics can change from pass-by-reference to pass-by-value and make it barely budge.
There is a reason practically every modern language has adopted syntax sigils like (choosing Zig):
pub fn is_list(arg: arg_t, len: ui_t) bool {
This allows the identification of the various parts and types without referencing or compiling the universe. That's super important and something that must be baked in the syntax at the start or there is nothing you can do about it.
Getting an overview of parsing theory is mainly useful to avoid making ambiguous or otherwise hard to parse grammars. Usually one can't go too wrong with a hand-written recursive descent parser, and most general-purpose language are so complicated that parser generator can't really handle them. Anyway the really interesting parts of compiling happen in the backend.
Another alternative is basing the language on S-expressions, for which a parser is extremely simple to write.
I used to do cosplay. Many costumes from movies, TV-series and anime are of characters that wield guns, often unique or at least quite distinctive guns. Carrying the correct gun is sometimes a thing that identifies the character, and therefore is an integral part of the cosplay.
For example, I used to cosplay for charity in the Star Wars costuming club 501'st Legion [0], where for most costumes a blaster gun of high likeness to the original is required. It has hundreds of members in California.
These days, it is very common to make cosplay accessories through 3D-printing.
A ban on replica guns parts would hit the hobby hard.
So that law would also diminish the glorification of weapons in pop culture then. I guess that would be seen as positive side effect for the people supporting this ban.
I really want to highlight this comment to everyone who's on the fence on gun rights or still believes that compromise is possible. This is the position of hardline anti-gun people, their billionaire funded NGOs, and the politicians they finance.
It's not about reducing excess death, it's not about gun violence, it's about abolishing all civilian firearms ownership and removing any positive association of firearms or self defense from the culture. There is no compromise possible because they will never be happy with anything less.
How about blasting caps? Those are integrated into modern brass cartridges, and I think making them that way would require more precision than you'd be able to achieve with simple hand tools and an anvil.
19th century revolvers tended to require separate blasting caps, but you still had to buy them even if you could make the bullets.
Tiny objects are harder to regulate. Many drugs are illegal but are still easily accessible due to their small size and transportability.
The correct action at this point in a society that wanted to keep guns legal but better regulated would be regulation of barrels. They are the only item left that are truly difficult to make in quantity and hide easily.
And Sweden. And probably lots of other countries too.
It's a world standard, and there are very few places that use hyphens in dates that are not ISO dates.
That can get messy and confusing if the user's locale is different from the language of the web page.
When I write in English, I of course also want to edit dates and numbers using English conventions. But instead, I am forced to use decimal comma and day/month order because those are the default locale for Swedish, which is my default locale.
I have never encountered an OS that doesn't work that way.
On the web you'll often don't know: it could be anything.
Ilya Sutskever and Dario Amodei were high up at OpenAI before becoming competitors. They are just two of many people who have known Altman personally who have accused him of being a lying sociopath. I would not call that vague.
It is not just a question of morality. A sociopath with that amount of power can be a danger.
> It is not just a question of morality. A sociopath with that amount of power can be a danger.
You probably think that "sociopathy" is an incurable disease which would make him some sort of vampire. This is pure bs. The way these "personality disorders" are diagnosed is the same as taking a buzzfeed personality quiz. This is not very rigorous stuff, I would even classify it as pseudoscience. As a tangent, I really despise how they are using greek and latin roots to prompt into our brains that what their models are describing is in any way similar to actual pathologies.
So yeah, maybe Sam Altman is generally a dishonest person if we believe what Ilya Sutskever, Dario Amodei, and others are saying. If that's the case (I have no reason to doubt it), he should stop lying and manipulating people, there are more satisfying ways to achieve one's objectives.
But the "sociopath" label is pure bs, along with the rest of those "personality disorders". That shit is more dangerous and harmful than a million lying Sam Altmans.
The first edition was my first CS textbook, back in the '90s and as a young programmer I learned a lot from it. A couple years ago, I started on a modern compiler back-end however, and found that I needed to update my knowledge with quite a lot.
The 2nd ed covers data-flow analysis, which is very important. However, modern compilers (GCC, LLVM, Cranelift, ...) are built around an intermediate representation in Static Single Assignment-form. The 2nd ed. has only a single page about SSA and you'd need to also learn a lot of theory about its properties to actually use it properly.
reply