HN.zip

The Flash C Compiler

82 points by AlexeyBrin - 31 comments
ndiddy [3 hidden]5 mins ago
I looked at the Github page and of course it's vibe coded. This is the sort of project that someone would have spent a few months doing as a learning exercise while they were reading through something like Crenshaw's "Let's Build a Compiler" series. I don't see the point of vibe coding it. You still end up with a toy compiler that nobody will actually use, except now you haven't learned anything about how compilers work. It's pointless.
djriley [3 hidden]5 mins ago
This is really neat, I'll have to give it a try. I grew up on QuickBASIC, then Turbo Pascal and Turbo C later on. For my own personal hands on coding time solving mathematical challengers or working on hand coded personal projects to relax in our increasingly agent driven world I've taken to using the text mode Free Pascal ide that is bundled in with the fpc compiler, built on an open-source implementation of Borland's TurboVision DOS TUI libraries. I always wished it had a mode to emulate Turbo C as well.

The only bummer I'm seeing with fcc is not having a linker mean not being able to use external libraries. So you're really limited to what you can include in your own project, but if it truly is C89 compliant there are plenty of useful single header libraries you could use for various things.

I'll check it out!

xenophonf [3 hidden]5 mins ago
I'm not willing to whitelist whatever bullshit malware this thinly veiled advertisement wants to run on my computer before it will allow me to see the page. Can someone share a précis?
rgovostes [3 hidden]5 mins ago
The Adafruit post is just an LLM recap of the author's blog post, which is an LLM summary of the project, which was vibe coded with Claude. The signal:noise ratio is dropping off exponentially.
shoobiedoo [3 hidden]5 mins ago
Damn. I'm reading Nils Holm's book on a C subset compiler and was hoping this would be a neat supplement. Into the trashbin it goes
hn_submit [3 hidden]5 mins ago
Why is everyone calling LLM generated code "written from scratch" with almost no clue that they didn't write one line of code themselves? Yeah, it was written from scratch, but not by you!!

Projects like these are defiling the programmer's guild.

sn0n [3 hidden]5 mins ago
ArtCraft says it’s all written from scratch as well.
rfgplk [3 hidden]5 mins ago
ArtCraft lies. It makes extensive use of crates, which to me defeats the "from scratch" argument. The whole point of doing it from scratch is that you get full control of every line of code in the compiled binary.

https://github.com/rfgplk/micron.cpp

This is an example of a true "from scratch implementation" (as long as you target the freestanding compile option, hosted still depends on pthread for threading). Absolutely zero external code or references anywhere outside the stated repo. (Not even compiler builtins or includes are needed). You can drag and drop it wherever you'd like hit compile and you're done.

rfgplk [3 hidden]5 mins ago
"Written from scratch" just means that no external code or existing libraries were used in producing something. Nowadays it's preferable to reusing code/crates/whatever because a) you avoid supply side attacks b) the implementation is likely going to be more correct and performant than alternatives c) it's actually easier to write your own thing than to download an existing lib and wrangle it into your project.
rowanG077 [3 hidden]5 mins ago
Why does it matter? Tbh at this point if frontier models are used I would place more trust in the average codebase than the average pre-AI codebase.

There are outliers where an excellent team of devs produce great quality, better that even frontier LLM code now. SQLite comes to mind. But it's easy to forget that is the 0.x%.

throawayonthe [3 hidden]5 mins ago
the comment isn't even about the quality, it's about the "from scratch" aspect (used to 'market' it)
rowanG077 [3 hidden]5 mins ago
But isn't that correct? It doesn't seem to be based on anything, or am I missing something?

Or is it "To make an apple pie, you must first invent the universe" kind of deal. Which doesn't make sense to me either.

FeteCommuniste [3 hidden]5 mins ago
If you hired a chef to come to your house and make a pie from scratch, would you then share the pie with your friends and tell them that you made it from scratch?
rowanG077 [3 hidden]5 mins ago
No I wouldn't, but that is not really what happened here. If someone used a bread making robot and put the ingredients in there and it made bread most people would have no problem saying they made bread from scratch. In the same vein people say "I did the laundry" or "I did the dishes" but in both cases the real work is often done by a laundry machine or dishwasher.

In the same way a program manager is free to say "We build X from scratch" even though they made no code contribution to it. The we is replaced with I since no other person was involved in this case.

ranger_danger [3 hidden]5 mins ago
> most people would have no problem saying they made bread from scratch

That's fine for bread, but for people that see code more like art, they have a preconceived notion that "from scratch" means writing the code yourself.

Some people code to solve a problem and they don't care how it gets done. They have no problems using AI and see other methods as prehistoric. That's fine for them, carry on.

For me, the journey is more important than the destination.

Being able to code "by hand" is what strokes my sense of worth and accomplishment... knowing I can do something that not just anyone can. Pushing a button or prompting an AI isn't the same for me, that's more like a project manager and something I never want to be.

When people bash on the anti-AI crowd, they just don't understand that people code for different reasons, and neither is more right or wrong.

rowanG077 [3 hidden]5 mins ago
I agree that people can write code for whatever they want, and that is valid.

Code can be art, making food can also be art. So I'm don't agree with your distinction that code is materially different from baking.

The terminology "from scratch" and "by hand" are really not interchangeable in my opinion. "By hand" implies something about the process. "From scratch" implies something about the state before you started, not anything about the process.

program_whiz [3 hidden]5 mins ago
A more apt analogy is heating up a frozen packaged pie, then saying it was made from scratch. Yes _you_ bought from the store, but somewhere ingredients were assembled and it was made "from scratch".
JdeBP [3 hidden]5 mins ago
The plotline of at least one Hallmark romcom movie, as I recall. (-:
FeteCommuniste [3 hidden]5 mins ago
What does a vibe-coder say when he orders a dish at a restaurant and the waiter brings it to the table? "Look at the food I made!"
aleph_minus_one [3 hidden]5 mins ago
On the other hand: many managers love to claim to have been deeply involved in the development of some product when the actual work was done at least by their underlings, or sometimes even a completely different team.

If people were similar confrontive in calling out such managers ...

jhbadger [3 hidden]5 mins ago
Or any project of any size -- scientists running a lab rarely do the experiments or data analysis themselves -- they have graduate students and postdocs for that. Their job is to decide what those people work on.
aleph_minus_one [3 hidden]5 mins ago
With the same argument, you can argue that it is the programmer's job to decide which LLM shall work on the problem, and the programmer still gets the credit for the work. :-)
childintime [3 hidden]5 mins ago
500kB source for the compiler and half of it is for the optimizer. Could it be a nice basis for putting a new vibe coded syntax on top? Move it to Zig or Rust first?
sylware [3 hidden]5 mins ago
Neat, but I would keep an eye on the trend: with all this AI coding (if true) some are now going directly to assembly.
anonymous908213 [3 hidden]5 mins ago
> The result of the study is only a description of how the IDE looks and behaves: which menus exist and in what order, which options each dialog holds, how the Message window tracks errors, and what the diagnostics say.

LLM-generated blogpost. The stench is all over it.

mrlonglong [3 hidden]5 mins ago
That's true but LLMs are a massive time saver when generating unit tests and other useful things for your work, leaving you free to write what really matters.
bayesnet [3 hidden]5 mins ago
Building useful tests are probably one of the things that LLMs are the worst at tbh. You end up with tests checking `2 * 2 == 4` and similar.
lume [3 hidden]5 mins ago
Stop whining. LLMs are available to everyone. If you think you can do better, then go ahead and do it instead of criticizing people who are actually getting things done.
cors-fls [3 hidden]5 mins ago
This is not "getting things done", it is not a useful project. It is one of the interesting projects that one would do to show mastery of a hard technical topic (compiler), to learn, and to impress fellow programmers. Doing it with an LLM makes it just completely useless
ranger_danger [3 hidden]5 mins ago
> Doing it with an LLM makes it just completely useless

There can be other valid perspectives than your own.

Different people code for different reasons.

Some see it as a means to an end... "I want X as an end result and I don't care how I get it."

Others see it as an art form and something special to them; their sense of worth is tied to their knowledge and experience in something that not just anyone can do (without an AI).

OP uses an LLM because they just want the end result. You might write code for different reasons entirely. Neither is "wrong" or "useless."

canelonesdeverd [3 hidden]5 mins ago
The whining will continue until boosters get it. If the things you're "getting done" are even remotely valuable then you can spare the brainpower to use your words.