News for hackers. Stuff that matters.
Re:Go 2, here we come by icedchai on Thursday November 29, 2018 @04:45PM (#18564364)
Yeah, sounds crazy. It only worked for C for 40+ years...
Re:Go 2, here we come by usrusr on Thursday November 29, 2018 @05:26PM (#18564720)
Ignoring the basic int type and using a zoo of preprocessor defines instead is what has worked for C all that time.

But I still think that native types have their place. It can often be quite reasonable to accept serious limitations on narrow machines where the performance gains won by the trade-off are desperately needed, lift those limitations on wider machines and grant an enormous safety margin on the widest architectures. When you dive deeper, the values where this makes sense still tend to be "index-like", as GP stated, but they don't have to strictly be indexes (e.g. IDs, a wider machine will be capable of working on bigger datasets and therefore be more likely to exhaust a given width of IDs, all indexes are identifiers but not all identifiers are indexes)

Re:Go 2, here we come by geezerjay on Friday November 30, 2018 @02:02PM (#18571631)
> Ignoring the basic int type and using a zoo of preprocessor defines

My C is a bit rusty but why should #defines be used in this scenario? A typedef set in a config.h.in is more than enough to meet the requirements of this usecase.

Re:Go 2, here we come by icedchai on Friday November 30, 2018 @05:30PM (#18573343)
Why do you need your own typedef? stdint.h is available, if you're using a compiler from the past couple of decades at least.
Re:Go 2, here we come by johncolanduoni on Friday November 30, 2018 @12:28AM (#18566942)
And what percentage of programs written in those 40 years are actually able to run on systems with more than one or two different memory layouts?