MurphyA/hacker-news huggingface dataset:
by josephg | 2025-04-29 03:47:53+00:00
> It correctly pointed out that by then, you're basically recreating your own pointers without any of the guarantees rust, or even C++ smart pointers, provide.

I've gone back and forth on this, myself.

I wrote a custom b-tree implementation in rust for a project I've been working on. I use my own implementation because I need it to be an order-statistic tree, and I need internal run length encoding. The original version of my b-tree works just like how you'd implement it in C. Each internal node / leaf is a raw allocations on the heap.

Because leaves need to point back up the tree, there's unsafe everywhere, and a lot of raw pointers. I ended up with separate Cursor and CursorMut structs which held different kinds of references to the tree itself. Trying to avoid duplicating code for those two cursor types added a lot of complex types and trait magic. The implementation works, and its fast. But its horrible to work with, and it never passed MIRI's strict checks. Also, rust has really bad syntax for interacting with raw pointers.

Recently I rewrote the b-tree to simply use a vec of internal nodes, and a vec of leaves. References became array indexes (integers). The resulting code is completely safe rust. Its significantly simpler to read and work with - there's way less abstraction going on. I think its about 40% less code. Benchmarks show its about 25% faster than the raw pointer version. (I don't know why - but I suspect the reason is due to better cache locality.)

I think this is indeed peak rust.

It doesn't feel like it, but using an array-index style still preserves many of rust's memory safety guarantees because all array lookups are bounds checked. What it doesn't protect you from is use-after-free bugs.

Interestingly, I think this style would also be significantly more performant in GC languages like javascript and C#, because a single array-of-objects is much simpler for the garbage collector to keep track of than a graph of nodes & leaves which all reference one another. Food for thought!
by 90s_dev | 2025-04-29 03:48:37+00:00
Most of the time, yes. I maintained my vimrc for maybe 10-15 years before I gave up on it.

The hard part of maintaining a config is that there's no such thing as cost-free usage, it always takes a mental toll to change a config, to learn a new config, to remember which configs are in use and what they do, to backup configs, or at least to setup and maintain a config-auto-backup flow.

By far, the easiest mental model is just learning how everything works out of the box, and getting used to it. Then again, sometimes what people want is to do things the hard way for its own sake. That's probably part of why I kept going back to C over and over for so many years.
by hxtk | 2025-04-29 03:50:05+00:00
It sounds like the source of confusion is in terminology. I would consider AES-CBC+HMAC to be an AEAD construction, and I would consider whatever "secret key" you pass into HMAC along with the ciphertext to be the "associated data". AES-GCM is an AEAD construction that gives you the MAC organically as part of the cipher, but that is not what makes it AEAD as I understand it.

If you are using an AEAD cipher mode, then you always have AD, but sometimes that AD might be the empty string. In that case, the advantage to using contextual AD as opposed to using the empty string as AD and then doing additional verification on the decrypted object is that it prevents some kinds of timing attacks, because cryptographic libraries will often implement AEAD constructions to fail in constant time, where as your scheme will take longer if post-decryption validation of contextual data encoded in the plaintext fails compared to if decryption fails.
by SamPatt | 2025-04-29 03:51:24+00:00
I have had so many ideas related to this. Particularly around automation.

Because the way the community arrives at meta knowledge and its geographical distribution is very informal. There are quite a few false metas out there, or the commonly understood range of the meta is inaccurate.

What needs to happen is automated image recognition and mapping of the metas. I started building an open source tool that allows for people to do this manually, but it's quite a difficult project to do myself and I'm not pursuing it anymore. But I would like to see a less manual process emerge.
by xutopia | 2025-04-29 03:52:24+00:00
If you mean codebase complexity and team size... then yes... types is more helpful with that. But in a small team with a small codebase you don't need types to do really well. I find types helped a lot when multiple teams were responsible for different domain spaces inside different components of a Rails app. I never saw the same advantage in codebases that are much smaller with fewer people.
by 90s_dev | 2025-04-29 03:52:53+00:00
Yes, I have the same history customizing everything! From Windows 3.11 to XP to Linux, and then giving up because life gets busy.

On the note of programming not being fun anymore, that's exactly why I'm making my secret project that I hope to release very very soon, maybe in a week or so. I want to make programming fun again, in a similar way that pico8 did, but x100.
by willtemperley | 2025-04-29 03:54:14+00:00
Java is incredibly productive - it's fast and has the best tooling out there IMO.

Unfortunately it's not a good gaming language. GC pauses aren't really acceptable (which C# also suffers from) and GPU support is limited.

Miguel de Icaza probably has more experience than anyone building game engines on GC platforms and is very vocally moving toward reference counted languages [1]

[1] https://www.youtube.com/watch?v=tzt36EGKEZo
by chamomeal | 2025-04-29 03:55:54+00:00
It’s funny you mention clojure, cause I when I saw “one-person framework” I instantly thought of Biff.

I haven’t used Biff (clojure web framework, does not sound comparable to rails), but there’s a great episode of The Repl with the dev who created it. It’s one of those interviews that reminds you how fun and creative programming can be
by perilunar | 2025-04-29 03:55:55+00:00
You don't need the classes on the alert sub-elements:

<div class="alert"> <img src="/img/logo.svg" alt="ChitChat Logo" /> <div> <h2>ChitChat</h2> <p>You have a new message!</p> </div> </div>

Then the CSS is just:

.alert {...} .alert img {...} .alert h2 {...} .alert p {...}

You can probably also get rid of the nested div by using flex, floats, or margins.
by amirhirsch | 2025-04-29 03:57:03+00:00
I built control computers for nuclear reactors. Those machines are not connected to a network and are guarded by multiple stages of men with automatic machine guns. It was designed to flawlessly run 3x boards each with triple-modular-redundant processors in FPGA fabric all nine processors instruction-synced with ECC down to the Registers (including cycling the three areas of programmable fabric on the FPGAs). They cycle and test each board every month.

What’s your source?
by ookblah | 2025-04-29 03:57:05+00:00
every page in our app is a "component" which could have many sub components, some reused. i think it's actually very common in large scale apps so maybe we're not even starting on the same foot.

would you not consider opening the web inspector "hunting down" when i can just understand the full thing just by looking at the element itself? to your example, let's say now you want to put your search bar next to another item, but that item requires that there be 4rem right margin. Then you put your search bar next to another item in another component that requires 8rem top margin. this starts breaking down at scale. in the past we would just inline the margin value. eventually this moved to basic utility classes which evolved into tailwind.

and with your code, you've just proved my point. i find tailwind overly verbose (necessary evil), but honestly i don't even need to open the "inspector" to understand how this will look. you can give me that 12 months from now and i can understand exactly what it is in 10 seconds. with "alert" i have to referencing something else. and this is just a handful of lines, imagine if your component is larger than that. it's also a bad example because i will just eventually roll the styles for "alert" into its own class if it makes sense. get the best of both worlds.

again, i challenge you to just consider that a lot of other people as smart as you have thought through these issues and made the according trade-offs. the example you're giving is just way too simplistic and pretty much like every example someone gives in these threads.
by daemonologist | 2025-04-29 03:57:48+00:00
Smaller quantizations are possible [1], but I think you're right in that you wouldn't want to run anything substantially smaller than 128 GB. Single-GPU on 1x H200 (141 GB) might be feasible though (if you have some of those lying around...)

[1] - https://huggingface.co/unsloth/Qwen3-235B-A22B-GGUF/tree/mai...
by hedgehog | 2025-04-29 03:58:16+00:00
Fast enough depends what you are doing. Models down around 8B params will fit on the card, Ollama can spill out though so if you need more quality and can tolerate the latency bigger models like the 30B MoE might be good. I don't have much experience with Qwen3 but Qwen2.5 coder 7b and Gemma3 27b are examples of those two paths that I've used a fair amount.
by nearbuy | 2025-04-29 03:59:52+00:00
It counters the claim that "inference is too damn expensive". You can argue that cheap inference is actually bad for OpenAI because it makes it easier to run models on commodity hardware, but then you're arguing against your point that inference was too expensive for OpenAI to be sustainable. Which is it? Is inference too expensive or too cheap?

For now, OpenAI's models are closed source, so if you find their models offer the best value for your use case, you don't have the option of running it on your own hardware. If a competitor releases better products for cheaper, OpenAI will fail, just like any other company would.
by chamomeal | 2025-04-29 04:00:26+00:00
Wow that does sound pretty sick.

I’ve always heard awesome things about elixir/beam but I only have so much love in my heart for languages without good static types. Right now that love goes to clojure!

I’ve been hearing some buzz about static types landing in elixir, and it’s definitely piquing my interest. This comment of yours has fully sold me though!
by stolksdorf | 2025-04-29 04:01:24+00:00
Really great stuff, having demos for the progressions was a very nice touch

I had some ideas/modifications, so I sketched up a version in autohotkey and really liked playing around with it for a bit:

-> Pressing in the joystick also switches to alt mode, instead of having a separate button. Works really well, just need to tune the timing/tolerances a bit. It felt way more intuitive.

-> Right bumper => space, Left Bumper => backspace

-> Right Trigger fully down => jumps cursor to start of next word (left trigger start of prev).

-> Right Trigger partially down => moves cursor that much to start of next word (eg. half way down, halfway through current word)

-> Holding a trigger down while using the other one selects the text. This one is a bit awkward to use, needing to "undo" the initial press and not really having a way to unselect if you selected too much. Will need more experimentation to see if it's a good idea.

This leaves the buttons available for new line, key swap (numbers, symbols, etc.), confirm/exit; And dpad for direct arrow key control.

Thanks for sharing!

Bug Report: I could not get the Gamepad Mapping Settings to work. No changes registered, no errors in dev console. Win10 chrome.
by treetalker | 2025-04-29 04:01:40+00:00
Cool project, thanks for taking the time to create it and to share it.

Please forgive my ignorance: this seems like an obvious and straightforward solution to a problem that I have read others to complain about; so my question is why coding LLMs don't already implement this or something like it? (Perhaps they do, or something more advanced, but I'm just unaware.)
by zeroq | 2025-04-29 04:02:35+00:00
This is nice, and works really nice for her use case!

Two things to note when thinking about color schemes:

(1) dr. Cynthia Brewer spent way too much time developing the color scheme for maps with information and similar inforgraphics. I can't find the document at this time, but was a lecture long explanation about how she got them.

(2) designers often use "sacred geometry" bullshit like "golden ratio", PI, Phi, and such to explain their thought process. The most common way to create a color palette is to use opposite colors, "triads" and "tetrads". All of this is based on color wheel in HSL/HSV. Which is almost as bad at describing relation between colors as RGB. [2]

PS. my pet peeve for a long time was trying to understand why most color quantization algorithms were relying on finding the distance between RGB colors in 3D space (by mapping RGB components to XYZ coordinates) while it's obviously a terrible way to reason about color relationship.

PPS. a random dude with a similar interest but way more dedication (re)disovered a work by Kubelka and Munk from 1931 describing an algorithm how to properly mix colors and based on that created an incredible graphics program that allows you to paint just like in real life - with oils and watercolors on canvas! [3]

[1] https://colorbrewer2.org/ [2] https://www.youtube.com/watch?v=gnUYoQ1pwes [3] https://www.escapemotions.com/products/rebelle/about
by squigz | 2025-04-29 04:02:45+00:00
> It is. I used to customize everything. On Windows 95/98/2000/XP - custom cursors, themes, icon packs, custom Windows loading screen, the works.

> I have the same history customizing everything! ... then giving up because life gets busy.

I think this might be why some people have such different experiences. I don't try to customize "everything" - just what needs to be. Like, yeah, I would expect it to be difficult to maintain random Explorer customizations. I would not expect it to be difficult to maintain customization for a popular IDE.
by dang | 2025-04-29 04:04:05+00:00
I'm afraid that's sample bias. We've done exactly the same kind of moderation countless times on all wings of commenters for many years.

You're right that not every comment which should be moderated actually gets moderated, but this is not because we're secretly on one side or the other. It's because we don't see most of what gets posted here. There's far too much of it to read, and we can't moderate what we don't see. If you see a post like that going unmoderated, the most likely explanation is that we just didn't see it (https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...).

To politically passionate users, it always feels like the mods are against them and secretly in cahoots with the other side, but this is an illusion (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...). If it helps at all, the other side has exactly the same complaint, just with the political bit flipped. See https://news.ycombinator.com/item?id=26368875 for a plethora of quotes; they're years old now, but the phenomenon is perennial. Here are a few more recent cases:

HN is mainly left leaning https://news.ycombinator.com/item?id=43559670 (April 2025)

HN has turned into a far-left hive-mind https://news.ycombinator.com/item?id=43214821 (March 2025)

this website is effectively a leftist filter bubble and you do nothing to address it https://news.ycombinator.com/item?id=43146049 (Feb 2025)

a hard liberal-progressive tilt https://news.ycombinator.com/item?id=43136198 (Feb 2025)

a prog-left echo chamber https://news.ycombinator.com/item?id=43133747 (Feb 2025)

an echo-chamber of left-wing lunatics https://news.ycombinator.com/item?id=42576474 (Jan 2025)
by Animats | 2025-04-29 04:04:25+00:00
That's a good comment.

The difference is that I'm writing a metaverse client, not a game. A metaverse client is a rare beast about halfway between an MMO client and a web browser. It has to do most of the the graphical things a 3D MMO client does. But it gets all its assets and gameplay instructions from a server.

From a dev perspective, this means you're not making changes to gameplay by recompiling the client. You make changes to objects in the live world while you're connected to the server. So client compile times (I'm currently at about 1 minute 20 seconds for a recompile in release mode) aren't a big issue.

Most of the level and content building machinery of Bevy or Unity or Unreal Engine is thus irrelevant. The important parts needed for performance are down at the graphics level. Those all exist for Rust, but they're all at the My First Renderer level. They don't utilize the concurrency of Vulkan or multiple CPUs. When you get to a non-trivial world, you need that. Tiny Glade is nice, but it works because it's tiny.

What does matter is high performance and reliability while content is coming in at a high rate and changing. Anything can change at any time, but usually doesn't. So cache type optimizations are important, as is multithreading to handle the content flood. Content is constantly coming in, being displayed, and then discarded as the user moves around the big world. All that dynamism requires more complex data structures than a game that loads everything at startup.

Rust's "fearless multiprogramming" is a huge win for performance. I have about 20 threads running, and many are doing quite different things. That would be a horror to debug in C++. In Rust, it's not hard.

(There's a school of thought that says that fast, general purpose renderers are impossible. Each game should have its own renderer. Or you go all the way to a full game engine and integrate gameplay control and the scene graph with the renderer. Once the scene graph gets big enough that (lights x objects) becomes too large to do by brute force, the renderer level needs to cull based on position and size, which means at least a minimal scene graph with a spatial data structure. So now there's an abstraction layering problem - the rendering level needs to see the scene graph. No one in Rust land has solved this problem efficiently. Thus, none of the four available low-level renderers scale well.

I don't think it's impossible, just moderately difficult. I'm currently looking at how to do this efficiently, with some combination of lambdas which access the scene graph passed into the renderer, and caches. I really wish someone else had solved this generic problem, though. I'm a user of renderers, not a rendering expert.)

Meta blew $40 billion dollars on this problem and produced a dud virtual world, but some nice headsets. Improbable blew upwards of $400 million and produced a limited, expensive to run system. Metaverses are hard, but not that hard. If you blow some of the basic architectural decisions, though, you never recover.
by tomhow | 2025-04-29 04:06:25+00:00
All these guidelines are relevant:

Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.

Comments should get more thoughtful and substantive, not less, as a topic gets more divisive.

When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."

Please don't fulminate. Please don't sneer, including at the rest of the community.

Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

It should be clear that this kind of conduct is not acceptable. We're not banning you, we just need you, like everyone, to keep to the guidelines.
by jcranmer | 2025-04-29 04:07:45+00:00
There are three main models to numerically model a color space.

There is an additive color mixing model, which is basically your standard RGB model, where you basically control how bright each of the red, green, and blue lamps shining at a point. There is a complementary subtractive color mixing model, which is controlling the amount of pigments you drop onto a substrate (CMYK is what you'll see used in computers these days). Then there's a third model, where you measure it according to brightness, colorfulness, and then the actual hue it is--there's a lot more variants in this model, basically any colorspace you don't recognize is this kind of model.

If you visualize colors existing in an RGB cube, you have 8 colors at the vertices: black and white are at opposite ends of a diagonal, and the other 6 are two sets of nonadjacent vertices: red, green, and blue in one set, and cyan, magenta, and yellow in the other set. Given such a cube, you should be able to easily see that RGB is using one of those sets as its basis set, whereas CMYK is using the other set as its basis set. The third set of models is built by tilting the cube such that the black-white diagonal is now the vertical line (one of the components), and then distance from this line becomes another component, and then the angle around the line is the final component--it's a cylindrical coordinate space in 3D space, not a Cartesian space.

Some models, like CIELAB or Oklab, use the third model but retain a Cartesian coordinate system, the last two values being called something generic like 'a' and 'b'. Oklch is the same as Oklab, but expressed as cylindrical coordinates, because chroma (colorfulness aka distance from the pure light line) and hue (aka the dominant color of the light) is more convenient for people to work with than a Cartesian system.
by ffsm8 | 2025-04-29 04:08:04+00:00
Not only do they forbid devs to use Linux on their dev machines, they then proceed with cb.exe etc. Nothing shows how they value your time quiet as much as these artificial slowdowns they love to introduce. (Along with gigantic privacy issues, as it allows the employer to essentially look at a live feed of your desktop whenever they want)

I could understand it if your device needed special access (VPN to prod etc), but you usually can't do that either from the dev machines - and need to first connect to a virtual machine (via browser or rdp) to be able to do that...
by searls | 2025-04-29 04:09:41+00:00
For anyone who's ducked out of Rails World over the last decade (or two), I devoted my final conference talk last year to the topic of One-Person Framework with a real-world case study of how Rails 7+ specifically helps developers build ambitious apps, even as a solo developer. https://justin.searls.co/tubes/2024-11-09-11h03m00s/
by Dylan16807 | 2025-04-29 04:09:44+00:00
For the golden gate bridge, that's not a particularly large impact of deaths. Even if you don't like assigning a monetary value to lives, bad infrastructure causes its own deaths in the people using it. But it's simpler to say lives are worth ten million dollars and then calculate that those deaths were about 4% of the cost.

For the other two, the death toll was much more significant.
by ninkendo | 2025-04-29 04:10:04+00:00
> I wish more languages would lean into having a really permissive compiler that emits a lot of warnings. I have CI so I'm never going to actually merge anything that makes warnings. But when testing, just let me do whatever I want!

I’d go even further and say I wish my whole development stack had a switch I can use to say “I’m not done iterating on this idea yet, cool it with the warnings.”

Unused imports, I’m looking at you… stop bitching that I’m not using this import line simply because I commented out the line that uses it in order to test something.

Stop complaining about dead code just because I haven’t finished wiring it up yet, I just want to unit test it before I go that far.

Stop complaining about unreachable code because I put a quick early return line in this function so that I could mock it to chase down this other bug. I’ll get around to fixing it later, I’m trying to think!

In rust I can go to lib.rs somewhere and #![allow(unused_imports,dead_code,etc)] and then remember to drop it by the time I get the branch ready for review, but that’s more cumbersome than it ought to be. My whole IDE/build/other tooling should have a universal understanding of “this is a work in progress please let me express my thoughts with minimal obstructions” mode.