MurphyA/hacker-news huggingface dataset:
Show HN: Brainfuck to RISC-V JIT compiler written in Zig
by 0x000xca0xfe | 2025-05-25 12:34:09+00:00
Hi everybody,

this was my project to learn Zig and RISC-V+x86_64 assembly.

Not sure if anybody is actually interested in yet another Brainfuck compiler, so I'll just write up some random things I learned while building it!

- A primitive assembly stitching compiler is 10x faster than the interpreter. Did not expect that.

- The generated x86 code is really bad (e.g. it always uses 6 or 7 byte sized instructions with 32-bit immediates when there are much smaller ones) but it doesn't really matter. Good code generated by GCC and clang for transpiled Brainfuck->C is not much faster as it's bottlenecked by memory accesses anyways.

- Zig is pretty far along actually. You can make serious projects with it!

- But the community seems to like self-punishment. Unused parameters and variables are hard errors and there is no way to disable that even for debug builds. Makes quickly commenting out part of the code a real PITA.

- I've had a miscompilation due to std.mem.span being broken and two source code breaks going from Zig 0.13 to 0.15 (std.mem.page_size got removed and ArrayList.popOrNull as well).

- But arbitrary size integers are fantastic! And well-defined two's complement behaviour!

Here is for example the code that encodes the c.beqz instruction:

/// Branch if Equal to Zero (compressed): c.beqz rs1', offset -> beq rs1, x0, offset pub fn c_beqz(text: *std.ArrayList(u8), rs1: RV_X, offset: i9) !void { std.debug.assert(is3BitReg(rs1)); std.debug.assert(@mod(offset, 2) == 0); const imm: u9 = @bitCast(offset); const RV_CB = packed struct(u16) { op: u2, offset5: u1, offset1_2: u2, offset6_7: u2, rsd_rs1_: u3, offset3_4: u2, offset8: u1, funct3: u3, }; const ins = RV_CB { .op = 0x1, .offset5 = @truncate(imm >> 5), .offset1_2 = @truncate(imm >> 1), .offset6_7 = @truncate(imm >> 6), .rsd_rs1_ = @truncate(@intFromEnum(rs1) - 8), .offset3_4 = @truncate(imm >> 3), .offset8 = @truncate(imm >> 8), .funct3 = 0x6, }; try appendInstruction(text, u16, @bitCast(ins)); }

This is really nice as all the exotic integer sizes are actually checked, too.

- Zig support for Windows is good. Porting the project to Windows was very easy.

- When the RISC-V registers are carefully chosen, almost all instructions could be compressed in this projects.

- Compressed instructions and good branching code (using the branch instructions directly when the jump range is small enough instead of branching over a larger jump instruction) did not noticeably change performance on real hardware (OrangePi RV2).

- But somehow QEMU got a massive boost from that. Not sure why exactly.

So, that's about it!

I hope at least something was interesting...
by andrepd | 2025-05-25 12:34:22+00:00
> What I found upon arriving was an unserious mob of hippies laughing and taking selfies to post on social media. I'd made signs supporting the rule of law. The signs of the other participants were an unfocused smattering of various political goals from "tax the rich" to banning Teslas. They included what I thought was an excessive about of profanity and crude insults. I think these are unserious people and what they're doing is performative and utterly pointless.

You don't think this is completely by design? Social media is probably the most powerful cultural force that every existed, by an order of magnitude. Just flood instagram with quirky posts about protesting with your favourite Marvel superhero franchise quips, and The Algorithm will take care of injecting it into the brains of five hundred million people before lunchtime.
by whoisyc | 2025-05-25 12:35:45+00:00
You are proving GP and OP’s point. CS 1.6 was an exceptionally popular game in the GoldSrc days and that is why it survived and was chosen by you as an example. That is an exception not the norm. Plenty of FPSs from the same generation have been forgotten. How many people out there are still playing Day of Defeat? Or Counter Strike Condition Zero? Or any of the old Delta Force games? Or Daikatana (except for the lol factor?)

I don’t even think you can easily find people to play on pre-1.6 versions of CS these days, even though when I played CS on LAN I had friends who believed CS 1.5 to be the better version and insisted that we play that instead.
by crote | 2025-05-25 12:37:32+00:00
> It's not uncommon to see people on this very forum defending many of his policies

From what I've seen on the wider internet, the support for Trump is mostly a personality cult. The policies are getting support because they are his policies. They are on the Good Side, and the woke leftists are on the Bad Side. If Trump changes his views, most of his voter base will change with him.

The big question is: what's going to happen when Trump isn't in power anymore? Will he be able to motivate his voter base into a JD Vance presidency? Don Jr.? He's not getting any younger either - what if he dies?

With Trump off the stage the Republican party will almost certainly fall into a state of crisis. The traditional conservatives have been decimated, and the fringe extremists won't be able to rally the moderates. The entire Republican electorate will be up for grabs, and it won't be pretty.
by jonstewart | 2025-05-25 12:37:48+00:00
That’s true, but streamable formats often don’t need an index.

A team member just created a new tool that uses the tar format (streamable), but then puts the index as the penultimate entry, with the last entry just being a fixed size entry with the offset of the beginning of the index.

In this way normal tar tools just work but it’s possible to retrieve a listing and access a file randomly. It’s also still possible to append to it in the future, modulo futzing with the index a bit.

(The intended purpose is archiving files that were stored as S3 objects back into S3.?
by freen | 2025-05-25 12:38:19+00:00
CIO of $20B/year ARR company: “I was going to send my kid to the US for college. Now? Never in a million years. I’m not even going to go to the US!”

Well done everyone. Well done.

For those without a choice, no threat of punishment/deportation will deter them.

For those with a choice? Arguably the people a country would want to visit/do business with/etc?

The choice is clear: the US is hostile and to be avoided.
by ath3nd | 2025-05-25 12:38:20+00:00
> How are UK citizens voting for deteriorating services?

- Voting Tory, you get cutting of public health services (e.g NHS) and and Brexit.

- Voting Reform, you get the same plus a healthy dose of xenophobia and nationalism (it's thinly veiled-fascism, really).

- Voting Labour, you get the same cuts but with a nice label of "progress", so you can feel good about yourself. All the while flat prices are skyrocketing and your doctor's appointment might not ever happen, but there is always money for militarizing police and for sending abroad some bombs to kill Palestinians.

If people did want improved public services, they should have voted for somebody like Jeremy Corbyn, who had the decency to distance himself from the absolute disgrace that Labour has become, or at least for the Greens/Socialists. But people did not, in fact, want improved public services, not really.

They preferred to either vote for the xenophobe thugs of Reform, the xenophobe elitist Tories, or the pretend-liberal oligarch/capital-loving "Labour", none of who have any incentives to improve public services. You get what you vote for.
by deadlydose | 2025-05-25 12:40:28+00:00
> i wouldn’t visit the US even if i though i was perfectly safe

That's certainly your right and I get where you are coming from but

> our enemy.

Calling the US your "enemy" is a pretty strong stance, especially considering how deeply tied our countries are economically and culturally.

Don't want to visit? That's fine, but let's not pretend for a second that every American supports all the things you oppose. Only a plurality, not a majority, of Americans even voted for Trump and more than 75% of us still consider you an ally.

But you might want to lay off the media and tone down the rhetoric and drama a bit. Shit like that is why things are the way they are now.
by amenhotep | 2025-05-25 12:41:34+00:00
Supreme court judges are nominated by (theoretically) democratically elected presidents and (theoretically) confirmed by democratically elected senators. Their power is ultimately derived from a democratic mandate, even if it's insulated from direct accountability to the current electorate. And they can (theoretically) be removed via impeachment.

Certainly in the way they're manifested at the moment they're one of the less democratic elements of the state, but if you can't think of better examples of anti-democratic things then you lack imagination
Ask HN: Lobste.rs Invite?
by surrTurr | 2025-05-25 12:41:56+00:00
Hi HN.

I'm addicted to reading HN posts. I recently found a similar site called lobste.rs and want to participate in that community, too.

However, to join, one needs an invite. Could someone please send me an invite? Of coures, if there's other people who want to join, just comment here so you can get invited as well.

email: wild.van7387<at>fastmail.com
by echelon | 2025-05-25 12:43:15+00:00
> LLM can't reason

> we will forever get slop

I think the New York quote is a lot better than whatever I wrote. A human saw that diamond in the rough and decided to share it, and that was the transformative moment.

A human curator of AI outputs, a tastemaker if you will, can ensure we don't see the sloppy outputs. Only the sublime ones that exceed expectations.

I suspect that artists and writers and programmers will pick and choose the best outputs to use and to share. And then they do, that their AI-assisted work will stand above our current expectations of whatever limitations we think AI has.
by safety1st | 2025-05-25 12:44:49+00:00
What's different is that new games increasingly incorporate planned obsolescence as a business strategy. The game won't function unless it can phone home, stream assets etc. from their server, and they can and do plan to shut that server off at some point, forcing you to move on and buy new games.

Now what's really troubling is you can conceivably employ this approach with any form of digital entertainment. I think Netflix and the streaming industry in general aspires to convert movies into a planned obsolescence business model; in the beginning Netflix's selling point was that they had an archive of every DVD ever made, but now increasingly they're conditioning us to expect that stuff's going to leave the platform sooner or later. Why? If all we watch are the classics there's not much point to keep subscribing to a streaming service, just download/buy the classics, and then you're done. They are having trouble with this however because the movies they put out just aren't as good as the older stuff; I've read the data indicates that people are mostly watching 90s stuff on Netflix, so they can't purge it from the platform just yet. But they will try.

The games publishers on the other have us over a barrel. They switched to a planned obsolescence model one day and we just went along with it.
by intended | 2025-05-25 12:45:56+00:00
You dont have a cult. You have an ecosystem that created an alternative reality.

Its structural, not individual.

This idea that its a strange aberration of faith - Trump isn't the problem, hes just evidence that the efforts to counter watergate are working.

Its the Bannons, Stones and Murdochs of the world that create the media world for someone like Trump to exist.
by idiotsecant | 2025-05-25 12:46:26+00:00
Maybe the fermi paradox comes about not through nuclear self annihilation or grey goo, but making dumb AI chat bots that are too nice to us and remove any sense of existential tension.

Maybe the universe is full of emotionally fullfilled self-actualized narcissists too lazy to figure out how to build a FTL communications array.
by watwut | 2025-05-25 12:46:39+00:00
It is not just that. He works on support of the whole ecosystem - from heritage foundation through tech leaders to fox news. The ecosystem will keep existing and will find a new preacher. The same people who use their talking points now will keep voting for the same set of policies. Just about only exception are tariffs in their current implementation - those are genuinely the Trump thing. But everything else is Trump executing long known conservative goals that are accepted by conservative voters.

> With Trump off the stage the Republican party will almost certainly fall into a state of crisis. The traditional conservatives have been decimated, and the fringe extremists won't be able to rally the moderates. The entire Republican electorate will be up for grabs, and it won't be pretty.

Trump represents traditional conservatives. With exception of tariffs, he is doing exactly what they wanted for years. Likewise, republican moderates never disagreed or opposed Trump policies, they just wanted someone more presentable for it.
by intended | 2025-05-25 12:48:40+00:00
If your hope is 2028, then you are effectively abdicating responsibility for your future to chance, at best.

When 2028 rolls around, the 4 years of straight up corruption, illegality, and power concentration will mean you wont have the tools to enforce your rules.

You are at your strongest, least tired, least weakened now. Today.

There is no tomorrow.

Americans have never lived most of their lives in a banana republic, so its understandable that they act as if there is a continuation of things.

There isn't.
Show HN: Yurl.ai – LLM based url shortener in F#
by reverseblade2 | 2025-05-25 12:49:25+00:00
Built a URL shortener in F# to explore CQRS – feedback welcome Hey folks,

I’ve been experimenting with F# and decided to build a small project to try out CQRS in practice. The result is a basic URL shortener I named YURL.

The backend is all in F#, structured around command and query separation. I wanted something minimal yet cleanly architected—so no heavy dependencies or complicated setup. The project helped me better understand event flow and separation of concerns in functional style.

If you’re curious, here’s the code: github.com/OnurGumus/YURL

Would love thoughts from other F# folks or anyone doing CQRS in a minimalist way.
by janbrasna | 2025-05-25 12:50:39+00:00
> sucks that this means I'm not welcome as FireFox contributor anymore

Nothing has changed regarding being a contributor. Bugzilla, Phabricator, Lando. You don't really interact with GH other than read-only needs as code search. (Which, funnily, is currently the most rate-limited thing on the whole of GH ;D) — but luckily as long as there's the Hg mirror, Searchfox continues to being used for that as well.
Show HN: Continuing the work on the ADHD personal assistant – Part 4
by MKBSP | 2025-05-25 12:50:39+00:00
I’m building a local-first AI assistant to help ADHD users (like me) structure their days without losing autonomy or drowning in dopamine loops.

Why I’m building it: ADHD brains tend to thrive with structure, but hate rigidity. Most productivity tools assume your brain already works "normally." Mine doesn’t.

So I’m trying to build something different: → Works locally → Keeps your data private → Structures your day using AI summaries → Doesn’t nag — just helps you see what matters

Core features (WIP):

Daily Debriefs: What happened, what’s next

Communication Triage: Who to reply to, based on context

Meeting & Task Prep: Pulling key info before your brain crashes

Progress so far:

Working integrations with Gmail, Calendar, and Slack

Auth0 handling secure logins

Backend structure for conversations, tasks, and people

Early debrief summaries starting to work (still refining prompts)

But here’s the twist: I started procrastinating on the product… by working on my personal brand and how to build in public

So I: → Defined my brand pillars via ChatGPT + podcast transcript → Set up a Substack + mirrored blog → Started sharing regularly, writing first, videos later → Trying to make my creative chaos more useful for others too

If you’re building weird tools for brains like yours, or trying to get out of your own way, would love feedback or to jam.
by pjmlp | 2025-05-25 12:51:00+00:00
I am upset people about the attitude in general, especially when they feel entitled to get a salary and are pretty much capable of owning expensive fruity hardware.

Then every couple of months later everyone is complaining there is no money in FOSS, that there are too many subscription fatigue, walled guardens and what not.

Of course they are, there is no other way to make money from trying to sell software if it doesn't come with a ball and chain, apparently.
by lobsterthief | 2025-05-25 12:51:18+00:00
“Never roll your own crypto” is just this year’s “never roll your own date library”. There will always be something. Could I code this? Even if it’s quick, there’s ongoing maintenance cost and you lose out on the FOSS community identifying and fixing vulnerabilities as well as new features that you may need to use. Yes, the library might be large and contain things you don’t need, but that’s the tradeoff. You can mitigate this (depending on the platform and language)—for example, with ESM tree-shaking.

I’d rather install date-fns or moment and let it decide what the fourth Sunday of a given month is in 2046, and also audit for the latest browser attack vectors.
by einpoklum | 2025-05-25 12:51:50+00:00
In LibreOffice, on the menus, you can choose View > User Interface... and choose one of several UI modes, including the classic menu+toolbar and a ribbon-like "tabbed" UI. That's been available for a few years already.

For the upcoming 25.8 release of LibreOffice, we have decided to make the UI mode selection part of a welcome dialog on the first run - as a compromise between the majority opinion, which is that the MSO ribbon is undesirable, and the desire to make the transition easier for MSO users who expect a ribbon-like UI since that's what they're used it. The default choice will remain menus+toolbars.

Also, the LO tabbed UI is not "fully-baked", and still has quite a few issues :

https://bugs.documentfoundation.org/show_bug.cgi?id=107237

and more generally:

https://bugs.documentfoundation.org/show_bug.cgi?id=102062
by jqpabc123 | 2025-05-25 12:52:27+00:00
The more things change, the more they stay the same.

Linux still lacks 3 really significant "desktop?" features that Windows provides:

1) Standardization --- Which distro and which desktop? Pick one? This would be a no brainer if they were all compatible but they're not. Variety is good? Maybe for a hobbyist, not so much for business.

2) Backward compatibility. The only real constant with Linux is change. Pick any distro/desktop and try running a desktop app from 10 years ago --- if you can find one.

3) Specialized business apps. The reason these are lacking on Linux --- see #1 and #2. It's harder to develop, support and market such apps on Linux. Linux is an inherently hostile ecosystem for a software "market".

With regard to the desktop, business drives Windows, hobbyists drive Linux. Still true after all these years.
by jmkni | 2025-05-25 12:52:58+00:00
This is a good point.

I was involved in one startup in particular where "trust" was important. They didn't understand why I was pushing to build a native Android/iOS app and have it on the app store, as opposed to a PWA.

It's because, like it or not, having an app on the app store makes you look legitimate, it makes you look like a real company.

It was a pain in the ass, a PWA would have been way easier, but I still maintain it was the right call.
by himalayan_yak | 2025-05-25 12:53:30+00:00
No, it is not. If A -> B is Not logically equivalent as If Not A -> Not B. Many make this mistake. It is equivalent to If Not B -> Not A. In this case, if a writing that sounds bad is less likely to be right - leads to - if the writing is right the writing is likely to sound good, (and only that).
by CompoundEyes | 2025-05-25 12:53:41+00:00
I write a lot of “defensive” C# code in my day job expecting that someone very inexperienced / offshore will be working with it in the future (and I will be reviewing it four months later when no longer on the project). I call it “corporate coding”. Lots of interfaces that must be adhered to, ioc, injection and annoyingly strong patterns. Anything that makes going off the rails a lot of work — the path of most resistance — glaring in code reviews. But…key logic concentrated in a few taller files so none of the drilling through abstraction so easy to comprehend for a newbie. I want to take some time with a defensive coding approach and LLMs. Particularly scoping it to a certain project or folder in a layered architecture. Why let it know of the front end, back end, database all at once? Of course it’ll get discombobulated.

I’ve also been experimenting with giving an LLM coins and a budget. “You have 10 coins to spend doing x, you earn coins if you m,n,o and lose coins if you j,k,l” this has reduced slop and increased succinctness. It will come back, recount what it’s done explaining the economy and spending. I’ve had it ask “All done boss I have 2 left how can i earn some more coins?” It’s fun to spy on the thinking model working through the choices “if I do this it’ll cost me this so maybe I should do this instead in 1 line of code and I’ll earn 3 coins!”
by intended | 2025-05-25 12:55:12+00:00
This is a red herring. There is no winning for any party that isnt the Republican party, because there is no actual mechanism for non right wing voices to be heard on the right wing information ecosystem.

The issues is that Dems must bring their A game, to compete against a clown squad that can and will fabricate issues that havent happened, and force the dems to debate on it.

This is also a thought experiment, not a real issue, because Americans do not have that long a time horizon.

The strongest, most unified, and capable you will be is now. By the time elections come around, you will be hounded, disorganized, isolated and unable to coordinate.
by cankoseoglu | 2025-05-25 12:56:43+00:00
The challenge with getting users to embrace new software lies in the difficulty of changing their behaviour.

After conversations with several users, we concluded that large operators with staff can invest time in learning and using our UI but micro operators don’t have the time to learn yet another UI to manage their real estate. They love the product and its automatic response handling, but one thing we noticed was that autopilot response rates weren’t increasing as much as larger operators because micro operators weren't logging in to our platform to further train the AI on edge cases and missing information.

Startups often need to iterate their products to achieve product-market fit for diverse customer profiles. We asked several micro operators what we could do to get them to use our UI; we developed a mobile native app; sent notifications; built a SuperHuman email client inspired inbox and finally someone said just text or call me! We then went ahead and asked our micro operators whether they would give info over voice and everyone said a BIG YES! So now I am happy to annouce that we are rolling out this option next month to the public, creating a feedback loop that trains the AI from whatsapp to voice replies, and initial results indicate a skyrocketing adoption rate.

We believe this trend will persist as conversational AI evolves, potentially rendering traditional UI obsolete in the future.

The real estate sector is heavily driven by conversation, and at Botel AI, we’re at the forefront of this innovation while others catch up.

As a former micro operator in real estate myself, I’m incredibly excited about what we're accomplishing at Botel AI.