For multiplication, you could add an option to use MMC5 hardware multiplication if it is available.
Dwedit wrote:Nothing is really wrong with C-style syntax itself, but C itself has some really backwards features in it.
Yes there are some.
Lack of forward declarations is the single most annoying part of C and C++. I write a function, then need to copy-paste the first line somewhere else just so I can call it in code that happens to be before the function. That is absolutely ridiculous.
It doesn't annoy me much, but this is a valid point.
Also, C doesn't have a good way for a function to return multiple values. You can return a struct, but that mainly leads to the compiler throwing it on the stack instead of returning it in several registers.
Yes, I agree; other programming languages do, even though things like Haskell also would return in a structure (or a pair), in Forth to return on the stack, etc.
What else is wrong with C and C++? Assignments in If expression.
I like this feature actually.
Infinite while loops because you accidentally put a semicolon before the open brace.
I like this feature too.
The postincrement operator having undefined meaning when there is more than one use of that variable.
I don't think it is wrong; what else would expected in such cases?
The wrong order of operations makes bitwise arithmetic lower priority than expected (OR should be like addition, AND and bit shifts should be like multiplication), but they are all low priority instead.
This I agree with you; I don't like this either.
Leading zeroes magically make your numbers octal. Tons of annoying legacy crap.
I think it is OK.
Shiru wrote:I have a note on the whole idea. HLL is a High Level Language, i.e. very abstracted from the low level, the hardware. So there is a dillema - either you target it for effective resulting code, but this brings some hardware limitations back to the abstaction level (like 1D arrays and lack of 32 bit math), thus compicating use of the language, or you target it to simplify programming a lot, hiding all these details, but this leads to not very effective code.
What if you add commands for both purpose, and add only the stuff to the compiled binary in the places needed for adding the extra details?