Hacker Newsnew | past | comments | ask | show | jobs | submit | etyp's commentslogin

To quote the very first paragraph of the bytecode interpreter section[1]:

> The style of interpretation it uses—walking the AST directly—is good enough for some real-world uses, but leaves a lot to be desired for a general-purpose scripting language.

Sometimes it's useful to teach progressively, using techniques that were used more often and aren't as much anymore, rather than firehosing a low-level bytecode at people.

[1] https://craftinginterpreters.com/a-bytecode-virtual-machine....


Sure, I'm not criticizing it.

He's doesn't actually build on this though, but rather goes back to a single pass compiler (no AST, no visitor) for his bytecode compiler.


There is a chance that the title here was intentionally worded to answer a question people are likely to search for, then actually answer their concerns.


Then the "alternative AI-generated title next to the original title" would say so.


HN would never do that, it would violate the minimalism of the site.

Most people aren't even aware that their posted URLs can be changed or their titles re-edited automatically because the UI doesn't give affordances for anything. You're just expected to notice and edit it out within the edit window (which there also isn't an affordance for.)


This is one of those natural consequences of "everything is an expression" languages that I really like! I like more explicit syntax like Zig's labelled blocks, but any of these are cool.

Try this out, you can actually (technically) assign a variable to `continue` like:

let x = continue;

Funnily enough, one of the few things that are definitely always a statement are `let` statements! Except, you also have `let` expressions, which are technically different, so I guess that's not really a difference at all.


I'm not sure why you picked continue here? All the diverging control flow instructions have the same type, ! aka "Never". In stable Rust you're not allowed to use its name but it's "just" an empty type and you can easily make one of those yourself - an enum with no variants.


Yeah I only found day 2, hopefully day 1 will appear though: https://www.youtube.com/watch?v=ZLRngpdV6Qg

(edited to not assume anything)


The streams for some halls from day 1 seem to be here: https://www.youtube.com/@LinuxPlumbersConference/streams but I don't see Main Hall A from yesterday.

https://lpc.events/event/19/contributions/2159/


is ,AOE too far?


The best one.


I read it as "this was a big news story which we care about. You may know it, but it is not the primary reason. Here is the primary reason."


Random note since Godbolt was mentioned: It's also fun to hop on play.rust-lang.org and see what different IRs look like via the "..." next to "RUN." Just look at how simple the HIR is pretty simple for "Hello world" - then check out the MIR ;)


This goes to show how Zig's language design makes everything look nicer and simpler - the `errdefer` patterns in tests are super nice! I've debugged my Zig tests with simple print debugging (or try to narrow it down to a standalone case I can use a debugger), but I'll certainly use some of these tricks in the future.


Zeek is well known in "security" spaces, but not as much in "developer" spaces. It did get me a bit excited to see Zeek here until I realized it was unrelated, though :)


Practically, it's all through this `type_traits` header that (often) end up in unreadable messes. It's all possible because of the catchy acronym SFINAE. It doesn't make much sense to me either, so I avoid it :)

https://en.cppreference.com/w/cpp/language/sfinae


You don't really need to use sfinae anymore, concepts are cleaner and easier to follow, also this library appears to use concepts


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: