HNHacker News
TopNewBestAskShowJobs

levzettelin

357 karma · joined April 11, 2020

submissionscomments
levzettelin··on A Deep Dive into German Strings
tl;dr

They made a C++ string type, let's call it "german_string", with sizeof(german_string) == 16. german_string can be in SSO mode (4 byte size field plus 12 SSO bytes) or in long string mode. In long string mode, they still use 4 bytes for the size, store no capacity (capacity is always equal to size), use another 4 bytes to always store the prefix of the string (this avoids a memory indirection in many cases when doing string comparisons), plus the pointer. Furthermore, a long string mode german_string can also act as a string_view or a string_view to ".rodata"; this is called the "string class". The string class is stored in two bits stolen from the 8 byte pointer.

levzettelin··on Battleships Logic Puzzle
Nice collection of puzzles. But the ads on this are bloody awful. Can't even pay to get rid of them. What a pity.

TIP: Don't sign up! It doesn't give you any benefits, and you still can't get rid of the ads.

levzettelin··on [dead]
Terse C interpreter that can interpret itself.

Previous posts:

https://news.ycombinator.com/item?id=22353532

https://news.ycombinator.com/item?id=8558822

levzettelin··on AI is growing faster than companies can secure it, warn industry leaders
As commented before, by say that they "could very easily solve the problem" I meant that they could just collectively stop using the problematic AIs in prod until they feel that the issue is resolved (moratorium). Not that it's easy to resolve the technical difficulties.
levzettelin··on AI is growing faster than companies can secure it, warn industry leaders
They could just collectively stop working on the problem until they feel that the issue is resolved (moratorium). That's what I meant by "they could very easily solve the problem".
levzettelin··on AI is growing faster than companies can secure it, warn industry leaders
Probably just companies trying to impede progress of other companies. Not to say that the statement is wrong necessarily. But given that this is coming from a group of people that could very easily solve the problem, I'll take it with a grain of salt.
levzettelin··on Dasel: Select, put and delete data from JSON, TOML, YAML, XML and CSV
How often do you have to add singular entries to some data file your working with? For all other cases, Miller and xsv look more powerful.
levzettelin··on A wonderful coincidence or an expected connection: why π² ≈ g
He wouldn't be speaking like this if he was born on Mars.
levzettelin··on How I Use "AI"
neovim with the gp.nvim plugin.

Allows you to open chats directly in a neovim window. Also, allows you to select some text and then run it with certain prompts (like "implement" or "explain this code"). Depending on the prompt you can make the result appear directly inside the buffer you're currently working on. The request to the ChatGPT API also is enriched with the file-type.

I hated AI before I discovered this approach. Now I'm an AI fanboy.

levzettelin··on New insights into transcription factors and chromatin remodeling
Can you post any evidence for this? I somehow have it in my mind that it's the other way around (i.e., mean doesn't grow anymore, but 99th percentile still does).
levzettelin··on U++ – Cross-Platform App Development Framework
https://www.ultimatepp.org/www$uppweb$vswx$en-us.html
levzettelin··on I switched to Vim – and it took me only 6 years to learn it
Maybe a bit more than that. I'd say a week to start and about one or two months to achieve the previous speed.
levzettelin··on When to Write a Simulator (2021)
When you look at it the right way, the solution to the Monty Hall problem is actually straight forward and doesn't require a simulation.

If you choose the "no switching" strategy, you're probability of winning is 1/3. On the other hand, if you use the "switching" strategy, you win if you pick a goat at first and you loose if you pick the car at first. Thus, with the "switching" strategy, your probability of winning is 2/3.

So once you recognize that with the "switching" strategy you win if and only if you start on a goat, the only thing you're really doing with a simulation is to contribute to the carbon footprint of the world.

Without that realization, a simulation can be helpful, of course, since finding the right way to look at a problem is often so hard.

levzettelin··on Hermann Grassmann and the nature of abstractions
If people took risks building out ideas they "felt" were the right thing, the world would be a better place for you; but not for those people.
levzettelin··on Hurl, the Exceptional Language
I see. Many thanks for this! Sounds a bit like a mixture of coroutines and dynamic scoping. Very interesting!
levzettelin··on Hurl, the Exceptional Language
I never understood "algebraic effects". But I understand the Hurl docs. Are "algebraic effects" basically the "toss" keyword from Hurl? If so, how are "algebraic effects" stronger than the "toss" keyword?
levzettelin··on The Nimble File Format by Meta
What are the differences versus Arrow/Parquet?
levzettelin··on Zig Roadmap 2024 [video]
Didn't watch; will they implement RAII?
levzettelin··on At 93, he's as fit as a 40-year-old. His body offers lessons on aging
Doesn't look like he's 40.
levzettelin··on Scholars asked Harvard President Claudine Gay for her data. She said no.
She would never be in the position that she is in if it wasn't for DEI. DEI systematically helps bad persons into power.
levzettelin··on Scholars asked Harvard President Claudine Gay for her data. She said no.
No way the frequency of the cycle is around seven years. More like 100 years. Also not sure if the pendulum has begun swinging back. I guess it depends on which pendulum you focus on. Taking an obvious one (net immigration into the European wellfare systems), it would seem that the pendulum is still accelerating.
levzettelin··on How are zlib, gzip and zip related?
What are some of those modern competitors?
levzettelin··on The Great Inflation
> It's becoming increasingly clear that pumping water into a lake is not, in fact, the main driver of flooding.

> Just look at the recent past. We've been pumping water into the lake since 08 without any appreciable flooding.

> Then the dam broke and BOOM! floodings rocket double digits.

The war-induced shortages may be the proximate cause of inflation, but maybe it wasn't a good idea to keep pumping that water in the first place, in particular, with the knowledge that dams always break sooner or later anyway.

levzettelin··on The Westminster Declaration
Discourse is never free; in no society. The question is just what kinds of discourse are allowed. Depending on what you care about, different societies will work better or worse for you (or be more free or less free, to adopt the lingo of this declaration). In other words, "freedom" is a subjective quality that depends what an individual cares about.
levzettelin··on Escape analysis hates copy elision (2021)
Interesting point! That's my understanding as well.
levzettelin··on Metric Time
16 hours in a day

64 minutes in an hour

64 seconds in a minute

This would make seconds 1.31835 times longer then what they are now.

levzettelin··on Metric Time
If this is called "decimal time", what about "binary time"? You could convert between days and seconds using bit-shift, haha.
levzettelin··on How to Use Monadic Operations for `std:optional` in C++23
I can't really think of a way in which I'd consider the monadic version better-or-equal than the "traditional approach". Except that maaaaybe

``` ageNext = age.transform([] (const int age) { return age + 1; }); ```

if equally readable to

``` if (age) { ageNext = *age + 1; } ```

Maaaaaybe!

levzettelin··on Pooling and Sharing of wealth makes everyone's wealth grow faster
The mathematics of this seem sound. The ideological overhead ("cooperation is good"), however, seems wrong. The same outcome that the author achieves with pooling in a group can be achieved by an individual just splitting their wealth into N pools, and then playing the coin-toss individually with each of those N pools.

Also, I suspect an even better outcome for an individual would be achieved by essentially using the Kelly criterion, which means that you wager a certain fraction of year wealth on every coin-toss. The optimal fraction that should be wagered on each toss can be calculated with pretty basic math.

For the lefties: this doesn't mean that cooperation is bad, of course. It just means that the argument in the article can not be used in support of your ideology.

levzettelin··on Science of Crowd Control [video]
Doesn't really shout "scientists", this article LOL.
← PreviousPage 2 of 3Next →