3 ms·
I've been spending a lot of time recently looking into and thinking about alternatives to C. I'd love to see a language as close to assembly as C is, but with
by bjackman 13y ago
I've been spending a lot of time recently looking into and thinking about alternatives to C.
I'd love to see a language as close to assembly as C is, but with a cleaner disconnect with it. As an example of what I mean:
Bitfields would be really handy when writing a device driver. A basic example of the difference they would make is "if (reg.field == VAL)" vs. either "if (reg & MASK == VAL)" or "if (GET_FIELD(reg) == MASK)". But you can't use them for that purpose because their layout is implementation defined.
There would be a noteworthy performance benefit to pay for portable bitfields, but I think it would be worth it. Right now I have to write ugly code if I want any attempt at portability (always). I'd much rather have to write ugly code where I need speed (sometimes).
I'd love to hear if anyone else has any ideas on this matter (BTW it seems like D solves many of the problems I've been thinking about, but it's memory managed).