The part of this that's the most interesting to me is the fact that it is worthwhile for the compiler to expend the effort looking for this optimization opportunity. I would expect (x << 2) & -4 to be a fairly rare pattern, and even then removing the & -4 only saves one or two assembly instructions.
HN user
piinbinary
Jeremy Mikkola
http://jeremymikkola.com
Email: <My first name><2^7=>@<google's mail product>.com
https://twitter.com/silenceofnight
ChatGPT tells me that it would take a very large array to detect distance with any accuracy
One day I want to build something like this, except for sound. It would be great to get a heading and distance for where a sound is coming from.
This could be both for small scale things (e.g. which part of this is squeaking?) or large scale (e.g. is that booming noise coming from the construction a few blocks away?)
I wonder if it would ever start to make sense to burn an AI model into ROM, replacing a large portion of an inference machine's RAM with ROM. (Probably not, since I'm sure those machines do dual-duty and run training when the inference workload slows down)
Is there a URL for that language? It is unfortunately a bit un-googleable!
I have this book and like it.
I also wish there was a book that guided you through the process of implementing a language with accurate garbage collection, similar to how Crafting Interpreters teaches you to implement a language. Perhaps it could start with a shadow stack + simple mark-and-sweep and then move on to stack maps + generational GC.
Prior discussion: https://news.ycombinator.com/item?id=29104047
I have a suspicion these new prices will stick around, even after the RAM shortage ends.
Speaking of which, what's the timeline of the RAM shortage ending? I have no sense for whether it is going to be (for example) 6 months or 3 years.
Only as
the act of writing out a problem to a model still forces the same sentence-level precision described earlier
(model referring to LLM here)
but not as writing for writing's sake
Writing is as good, or even better https://www.paulgraham.com/words.html
How do the linear types here relate (or not relate) to the Borrow Checker in Rust?
This 404s for me
The README references Electroboom's implementation
It would also be fun to have a full computer algebra system (like maxima) on a phone
I bet if you took one of Taalas' cards which consumes 200 watts for 14,000 tokens/second [0] and slowed it down by a factor of 10, it would actually be quite reasonable to power by bicycle.
[0] https://www.sdxcentral.com/news/chip-designer-taalas-bets-on...
I've been going through Nora Sandler's Writing a C Compiler book and writing a compiler in Python. I'm excited to start the chapters on optimization - those seem like the most fun algorithm problems.
I recommend the book. It certainly isn't easy (maybe 3x harder than Crafting Interpreters), but I've learned a ton (eg how to deal with operations on different sizes of types, or the trick of using pseudoregisters to avoid having to figure out registers up front).
I'd be very curious to know what class of vulnerability these tend to be (buffer overrun, use after free, misset execute permissions?), and if, armed with that knowledge, a deterministic tool could reliably find or prevent all such vulnerabilities. Can linters find these? Perhaps fuzzing? If code was written in a more modern language, is it sill likely that these bugs would have happened?
How does the benchmark tell how many branches were mispredicted? Is that something the processor exposes?
a luxury apartment building goes up, surveys the market, and sets its rents 30% higher for the privilege of living in a new building with a gym for dogs or ball pit or whatever. Then the older buildings say, "Well, we can raise our rents 20% and still be the best deal in town," and so on.
I think that might not be the right cause and effect relationship. The actual cause is increased demand. This creates both the increased pricing of existing stock and an incentive to build new stock.
Back when I lived in SF, there was one bus route (the 6, I believe) that I could use to get to work. The bus was so slow due to frequent, long stops and traffic lights that I could keep up with it on foot by walking briskly. I only bothered taking it when it was raining because it didn't get me to work any faster than walking.
That's an interesting point.
I'm also curious how bus stops interact with timed lights. Presumably each time the bus stops, it gets kicked back to the next cycle of green lights (which might be a low-single-digit minute delay).
Hopefully there's a traffic engineer in the audience who can give the real answers.
I think it's missing Google's Bard
That reminds me of `curl wttr.in/94110`
friends don’t just bring up type inference in casual conversation
I wonder if this is a reference to "I need you to understand that people don't have conversations where they randomly recommend operating systems to one another"
But to the actual point of the article: my understanding is that there are areas where you can use bidirectional typing (e.g. languages that have subclasses) where HM style type inference might become undecidable.
I'm impressed with how approachable the explanation is!
That stuck out to me as well.
I wonder if there could be a bug where extra code runs but the result is discarded (and the code that runs happens to have no side effects).
The post also says
That is roughly 1 billion iterations
but that doesn't sound right because GCC's version runs in only 0.047s, and no CPU can do a billion iterations that quickly.
I am currently going through that book. I recommend it with one caveat: you'll need to have written some interpreters before (Crafting Interpreters is a perfect starting point) because it expects you to already know some things like to how write a simple recursive decent parser.
It didn't know about the Woodboring beetle: https://en.wikipedia.org/wiki/Woodboring_beetle
Doing this felt odd, it was like it wore out something in my brain. After a while I could picture the animals I wanted to enter but I struggled to remember the word for them. Only now, a minute or so after stopping, could I remember 'Dragonfly'
I was also amused by the reaction to "crab":
(Carcinization makes it hard to define “crab”, so I'm going to pretend you said “brown crab”.)
Somehow, there's a relevant XKCD: https://xkcd.com/576/