Hacker News new | ask | show | jobs
by pjmlp 268 days ago
> Instead of adding the Valgrind headers to the tree, and using cgo to call the various Valgrind client request macros, we just add an assembly function which emits the necessary instructions to trigger client requests.

Love that they have taken this route, this is the way bootstraped toolchains should be, minimal building blocks and everything else on the language itself.

1 comments

I am still curious, had they not gone this route, and avoided the other two routes mentioned, what could they have done to make this process as simple as the rest of Go tends to be, and nearly as performant? I guess this is an ongoing question to be solved at a future date.
It would be another scenario to use as ammunition for "see you can't implement a language toolchain without using C", usually voiced by folks without background in compiler design, and understanding that most of the time that is a decision that spurs out of convenience and nothing else.

Assembly isn't that hard, those of us that grown around 8 bit home computers were writing Z80 and 6502 Assembly aged 10 - 12 years old, while having fun cracking games and setting the roots of Demoscene.

Oh. There was a comment to your comment saying that kids learning assembly was easy and — I guess? — implying that adults-learning-assembly is hard. I teach adults assembly on an irregular basis. Adults-learning-assembly is hard because adults are rational animals who (correctly) assume I'm an idiot for insisting on assembly. Once I explain the long-term benefits for our exceedingly specific use case, they pick up assembly in a few hours. Assembly isn't hard. Assembly is annoying because it takes absolutely gobsmacking amounts of assembly to do anything.
Assembly is simple because each instruction is very simple.

Also, assembly is complex because each instruction is very simple.

Large Scale Assembly puts a huge premium on planning and design. If you try to just bang things out, you'll live in a world of pain.
Remember, simple is not the same easy
See also: go.
Do you have anything public on how you get people writing assembly in a few hours?
I guess because there is nowadays a misconception that it is harder than it actually is in practice.

Exactly, plus one gets to understand what JIT and AOT toolchains are actually generating.

> it takes absolutely gobsmacking amounts of assembly to do anything.

"ever built something big in LEGO? Yeah? Yeah."

> Assembly isn't that hard, those of us that grown around 8 bit home computers were writing Z80 and 6502 Assembly aged 10 - 12 years old, while having fun cracking games and setting the roots of Demoscene.

Finally. I found my people.

Z80 on the TI-80 series of calculators for me. The Internet was very young, but there was ticalc.org. Damn, it's still around. I wonder if can log in?
Z80 and 6502 for me, pre internet, which was a luxury of sorts I wish we all could go back to now and then.
To the deleted sibling comment about children vs. adults: some children are also optimists.
Isn't Valgrind written in C?
Yes, but the goal of this is integration, not Rewrite in Go for Valgrind.