142 points · by peter_d_sherman · 1mo ago · 39 comments
If readability is the selling point, why not go the extra millimeter and add a heuristic so that this variable is named return_value for instance?
Scylla is kind of Eurydice's dual. But also Charon and the eponymous Aeneas.
Also, "There is ongoing work to integrate Eurydice-generated code for both Microsoft and Google’s respective crypto libraries." [1] which I find incredibly cool. This link is also a brilliant intro to Eurydice.
Some idealistic projects like live-bootstrap go a step further and don't even allow generated sources in the full source bootstrap chain, even if they are readable in principle, because the xz debacle showed that a configure script, which is also readable in principle, can contain a backdoor. In those projects you could probably still bootstrap Eurydice from sources, and then do the rust -> c translation of the rust compiler as an ordinary build step, before compiling it with a bootstrapped C compiler.
Wouldn't you want to audit the final outputs? Except nobody is going to bother analyzing my hand all the assembly produced by the final tool.
In other words, I am not seeing the value of pursuing the discovery of Thompson-style Trojans, no matter what the original source language was. It is one of these risks that one has to live with.
Now, trust/security is one aspect of things, that's true...
But another important aspect of all of this is building understandable, maintainable, controllable software and AI's from the ground up, for future generations...
Let's suppose that in the future, there is no longer source code for compilers, they are only black-box compilers that future AI (which is also black-box by then) uses... At that point, humanity has lost control! No more source can be compiled without a black-box compiler, without an AI, and any source code so compiled will be controlled by whatever unknown things have been implanted in the original compiler!
Phrased another way, when humanity requires AI to generate new AI's (i.e., no scientists, computer scientists, programmers or other people know how to generate an AI from the ground up, from transistors on up, and control every layer of abstraction on top of that from assemblers to compilers to neural networks)... then humanity is lost, because at that point, humanity (not knowing how to build AI again from scratch, and control it at every step) quite literally has lost control of AI!
Future humanity cannot have that.
Future humanity requires, absolutely requires, transparency at every abstraction level... no black boxes should exist anywhere!
Future humanity also requires the requisite education, to be able to understand, manage and control each level of hardware/software abstraction, but that is outside of the scope of this HN post... :-)
Anyway, Stabbles, you get it!
”Idiomatic” - is a ridiculous tautology I wish people discussing languages would stop using.
The only non-idiomatic code written seriosly is that which the compiler/interpreter does not understand.
Claiming universal superiority of style is shallow and thoughtless.
Intentional obfuscation is a different thing.
When computer people name things, it is with a tenuous grasp of meaning of the words they are using. You kinda have to roll with it.
If you are really enthusiastic you can write _obsfuscated_ C. And people can kind of agree what that is when they see it.
But _idiomatic_ ? Good luck defining what that is.
The term has sort of stuck in Python and there it's purpose is a bit more clear. There is this _object_ way of doing things, there is this _expression_ way of doing things etc and the interaction patterns work really nicely.
But you can't really use that expression in other languages which lack the same level of institutional design without sounding very much out of touch.
C++ started as a preprocessor that translated into C, nowadays all relevant C compilers are written in C++.
D has enough backeds already available.
I also think it would be helpful to how have a useful intermediate result to look at. So I agree, having C++ to C compiler would be useful.
C seems to me a really poor choice because it's barely more expressive than one of the machine code architectures and yet unlike them it's not even a real machine we can know about - some of the edge cases are just a shrug emoji.
The LLVM IR is buggy of course, and under-specified, but we could imagine improving those things more easily than fixing C for this purpose.
Those people should move on, there isn't a single relevant platform without at least C++98 compiler, and there are other ways to bootstrap compilers.
The C++ subset target is of theoretical interest and because some compilers cannot support a C++ compiler of the latest standard. OpenWatcom comes to mind.
Of course the question is which C++ standard in and what C standard out!
As for not having a compiler, do it like in the old days, cross compilation.
See Go and Zig for good examples of old practices brought into modern times.