Hacker News new | past | comments | ask | show | jobs | submit login

I guess that makes sense. RISC-V assembly doesn't actually seem that difficult to hand write, especially given that pseudo-instructions exist.

I don't see why you wouldn't just write in C, though, aside from a few functions where hand-written assembly is necessary. C compilers are more complex than assemblers, but they're still really common and, and they're doable for the average person to learn to write on their own.




You pinpointed the issue: a C compiler is already way above the complexity of a normal assembler, but you can write "reasonable" real-life alternatives with a small team (cprop/tinycc/more?)... but C code is quite sensitive to planned obsolescence and abuse via extensions. ISO is always adding stuff, which first will increase the cost of writing a new real life alternative (slowly but surely), and some code was C but ended up being specialized to specific C compilers of cosmical cost, namely way more expensive (aka not reasonable for even a small group of devs) to write a real life alternative, linux kernel code (even though llvm is running after the never ending addition of gcc extensions required to compile kernel code), glibc and much GNU software code (the "GNU jail"), etc. You can be almost certain, some C software will get "feature creep" which will force you to update your C compiler, some sort of steady and creepy planned obsolescence.

We took the example of C, but with other languages it could be much more worse and accute, I guess you get the overall picture. For c++, it is just out of control, beyond sanity, this language is actually toxic.

I still write in C some software, but I am carefull to avoid as much as possible extensions, latest ISO tantrums, and I try to use NOT gcc. I force myself to code C programs which compile with tinycc & cproc/qbe & gcc (if I can get my hands on other "real life" C compilers, I may try to add them). But I am writing more and more assembly, because I realize the cost of a compiler is not that much worth it (and actually giving more trouble than an assembler in my use cases), and I get much better stability (and control on the actual machine code running). It is even reaching a point where I think it would be better to write the same code for different ISAs than using any compilers... it all depends on the type of code and its expected life cycle.

Writing assembly abusing a complex macro-preprocessor is not that much "better" than using a C compiler in the end, since the overall costs and drawbacks of such complex macro-preprocessor would not be that much "better" than the costs and drawbacks of a C compiler.

So I already think there should be much more assembly out there, and with RISC-V being a worldwide free standard, the golden grail of machine ISA interoperability, even more so.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: