Re:Blech Programming Language
by TheNewAndy on Thursday September 17, 2020 @08:26AM
(#24503755)
In writing performance critical cross platform embedded code, I have found that exact width integer types are less useful than the "minimum width" style types you get from plain C (e.g. you can't write cross platform code with an 8-bit exact width integer type, because there is no such type on some platforms). It is disappointing to see this language provides no such types.
[ Parent
| on HN ]
Well since C99 there is an exact width C type for 8 bit ints, so i'm assuming you are targeting an obscure platform using a tool chain that is 20 years out of date
There is no guarantee that the hardware supports 8-bit numbers natively, and emulating them might be expensive. For embedded programming, it is sometimes useful to ask for a type that is at least 8 bits, but may be bigger.
That’s what int_least8_t or int_fast8_t are for
You can choose to use int_least_8_t or int_fast8_t as the implementation type blc_int8 of Blech type int8 for code generation https://github.com/boschresearch/blech/blob/master/src/blech...
So you can adopt to your needs on your platform.
Re:Blech Programming Language
by iainmerrick on Friday September 18, 2020 @09:48AM
(#24516726)
Out of interest, are there particular platform(s) you have in mind?
I remember working with TI C5x DSPs which had 16-bit "bytes", but that was a long time ago. I'm curious whether there are still important embedded platforms that you might target with C and have unusual addressable word sizes.