The problem is that I'm not sure what problem this language is trying to solve
Like I don't know of any problems where:
* You want architecture independence
* Don't need SIMD (inherently unportable)
Is infinitesimal
Conversation
Anyway what's interesting to me is
- Packing memory into very specific memory layouts which C is not as good as it should be
- If you're "nearly asm" you can put arch specific blocks (ifdefs or whatever) that call down to "real" asm (and thus regain SIMD)
1
3
what does clang do with inline assembly? does it just translate it to llvm ir?
1
the binary form (.bc), generally yes, with rare exceptions. the textual form (.ll), generally no, it is explicitly intended to only be used in cases where you need humans in the loop. similarly, do not generate textual IR.
3
8
Also, trying to turn LLVM IR into a truly stable and portable layer has already been tried: PNaCl which along with asm.js was one of the origins for WebAssembly. LLVM IR is fairly platform specific (more so than C) with a lot of unspecified and unsafe / undefined behavior like C.
1
3
It exposes more functionality than standard C, like pointers where you're allowed to index outside of objects / between objects (by leaving out inbounds markers) and options like well-defined signed integer overflow (like -fwrapv but case-by-case) or undefined unsigned overflow.
1
1
LLVM IR is nice to read, and I'd probably prefer writing a substantial amount of code in it rather than assembly (assuming macro systems could be used with both), but it's really not meant for that. It would be very weird, a major pain to keep it maintained and missing too much.
You can give the virtual registers meaningful names and you aren't limited to in how many you use, which is nice. It's quite verbose to do things with pointers, since it's for reading rather than writing - unless you used a preprocessor. It'd be quite weird to do this though...
1
To me the most annoying thing is the lack of any kind of type inference (understandable given it’s meant to be parsed and printed mostly by machines)
1
Show replies





