3 ms·
> in my work (signal processing) I use complex math in C every day, and native language support for complex numbers is the single most important thing in my cho
by buserror 8y ago
> in my work (signal processing) I use complex math in C every day, and native language support for complex numbers is the single most important thing in my choice of C over other languages
Fair enough -- but I think you are in a fairly corner market -- personally I think I used complex math /twice/ over the last 30+ years... I used SIMD extensively tho, from Altivec onward!
>> I want an array base type that can't be cast as a pointer
> just out of curiosity? why would you like that?
For bound checking. In C right now if you declare a char blob[4] and pass it as parameter to anything, it's passed down as a char * mostly -- and that function can clobber whatever it likes. An array type would propagate the size down so bound checking can be done at for the whole lifetime of the array.
> * better stack support (e.g. a standard way know whether a VLA fits)
Yes, anything involving stack requires serious dirty hacking -- even for basic things as 'what are my high/low water marks'. Basically your stack is just a problem waiting to explode in your face, especially on smaller devices.
> * closures (being able to return a pointer to a local function)
That's mostly what I meant by sub-functions -- I used them quite a bit, until I had to crossport to llvm (they refused to implement them). Apple "blocks" look pretty good, but I know there are a couple alternative implementations...
- enriquto 8y ago> Fair enough -- but I think you are in a fairly corner market -- personally I think I used complex math /twice/ over the last 30+ years... I used SIMD extensively tho, from Altivec onward! One of the best ways to implement SIMD support for C would be to add native quaternion and octonion support to the language!
- a1369209993 8y agoFor addition and subtraction, that sounds like one of the most evil-assembly-hack tricks I've heard for a high (-er than assembly) level language, but how would you do ... pretty much everything but addition and subtraction?
- enriquto 8y agothere are a lot of operators in the C language that could be overloaded as SIMD operations when acting over quaternionic and octonionic values. This would be useful for the most common operations. For the rest, there would be functions with well-thougt names (not the current avx monstrosities), defined on #include <octonion.h>