Hacker News new | comments | show | ask | jobs | submit login

I'm not a C programmer by any means - and the languages I've dealt with don't have signed/unsigned. So I don't fully understand the merits and drawbacks of them.

However I know enough to question this:

>The default int and float types have been removed, as have type modifier like short, long, signed, unsigned.

If the goal is this:

>C2 aims to be used for problems where currently C would be used. So low-level programs, like bootloaders, kernels, drivers and system-level tooling.

It is my understanding that signed/unsigned is exactly the type of concern you have when dealing with low-level, embedded, or binary code. eg. Bit masking, bit shifting, raw memory

So I'm a bit confused. The removal of them seems a bit contrary to the domain goal of the language.




They removed the default types. Meaning no int or unsigned int. They do have int8, int16, int32, uint8, uint16, and so on. You are forced to be explicit.

http://c2lang.org/site/language/basic_types/


That's what I get for glancing (asking silly questions already answered in a relevant section)! :) Thanks. That makes a lot more sense.


They've removed the default "int" and "float" types and modifiers for size and signed/unsigned. Instead, they just have the specific types which have specified signed/unsigned and size characteristics. So, this because explicit over implicit.

They have int8, int16, int32, int64 and uint8, uint16, uint32, uint64, and float32, float64.

They don't have short, int, unsigned int, signed short int, long, unsigned long, long long, unsigned long long int, float, double, long double, etc.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: