3 ms·
> Really? I was able to call the intrinsic I sloppy patched into the auto generated files fine via extern platform. Err... yes, that is exactly my point. You n
by dbaupp 10y ago
> Really? I was able to call the intrinsic I sloppy patched into the auto generated files fine via extern platform.
Err... yes, that is exactly my point. You needed an `extern` block to call the functions. It is much nicer if the `extern` block is written down once (just like the _mmintrn.h files for gcc/clang) so that there's no risk of mistakes or mismatches. The JSON files make this easy: both the compiler internals and the external `extern` block are guaranteed to match. Note that this is particularly important on a platform like AArch64, where there are hundreds of intrinsics: hand-transcribing them twice (once for the compiler, once for the libraries) is time consuming and error-prone.
> Because it's a systems programming language?
This is meaningless: being a systems language doesn't mean having intrinsics for every possible operation, it just means being able to do everything; these are not the same. The remainder of the paragraph you quoted explained how the functionality already exists. The only benefit of having an intrinsic function to call is that there is a function instead of built-in syntax, it doesn't add any new power: Rust is just as systems-y with or without the intrinsic.