4 ms·
> Programming the AVR-8 Arduino it's hard to miss the conclusion that "C sucks" but anything really better (say Supercharged Pascal or a Miracle Macro Assembler
by blippage 5y ago
> Programming the AVR-8 Arduino it's hard to miss the conclusion that "C sucks" but anything really better (say Supercharged Pascal or a Miracle Macro Assembler)
I did see an Ada compiler for the AVR recently (I'm not an Ada programmer). It seemed unpolished, and not really an advancement on C.
I think one problem with embedded work is that you either stick to the low-level, in which case you have no advantage over C, or you go for high-level, in which case you have convenience but lose flexibility.
In terms of meta programming, Val Schorre has an interesting idea with META-II. Both Alan Kay and Joe Armstrong spoke highly of it.The compiler has its own assembly language. I had this goofy idea of writing a Basic-like language that replaced the assembly. So you'd have a language that was both high-level Basic and a compiler. It would embrace the GOTO, because META-II also generates GOTOs, and GOTOs are a natural fit for CPS (Continuation Passing Style) used by many compilers.
- PaulHoule 5y agoPersonally I find bit-twiddling in C to be painful compared to bit twiddling in assembly. For my Arduino projects in particular I never make recursive function calls, and would be happy to statically allocate everything in RAM. The stack-oriented activation records in C, calling conventions, return values, are more a problem than a solution.
- calebh 5y agoFor call graphs without cycles it should be possible to run static analysis to determine the maximum amount of memory taken by your program at any point, assuming you don't use things like malloc or alloca or dynamically sized arrays.