Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is there such a thing as a good low-level language?

Name: Anonymous 2018-02-01 9:37

At work, I occasionally have to do some low-level bit-fucking. I do it in C, and so does everyone - it's the de facto standard language for doing this sort of thing. and not to get into a mental midget-kun tier C hate but the more I do bit-fucking in C the more I notice its flaws when it comes to bit-fucking.

but this is not the thread about complaining about C's shortcomings. my question is: is there an actual programming language (other than some specific assemblers, but this isn't ideal because I'd need to write a lot of code to support different OSes and architectures) that is good for those kinds of things? I mean supporting things like:
- variables with programmer-specified number of bits; I don't mean just uint8, I mean 3-bit, 4-bit, 5-bit etc.
- direct access to specific bits in the variable's binary representation - bitmasks and shits may be how people achieve this but isn't it a bit of a hack? why not accessing bits the way you access bytes
- variable-length integers (like Exp-Golomb) as a native data type - would be useful in codecs because e.g. H264 uses them
- instructions like circular shifts (often used in crypto) being directly supported instead of compiler folding your logical shifts and ORs into them - 'some architectures don't have this instruction' is a bad argument against this; some architectures don't have mul and yet C has * for multiplication instead of folding looped additions into one
- explicit support for vector processing - see above for why 'compiler will fold your code into one' is stupid
- inlining being a command, not a suggestion
- standards-defined way to use inline assembly (I'm not sure that C doesn't have it, I don't remember if it's da standard or GNU shit)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List