back

by lerno·5y ago·view on hn ↗
`ptr = array` vs `ptr = &array` (no [0] needed) is also part of being able to capture array sizes during compile time for macros, and also being able to copy arrays by value in an easy way. I don't think there would have been a way to do it consistently while retaining the pointer decay. In general, all implicit conversion are associated with difficulty when trying to add other features – just to explain why the pointer decay is dropped.

`num_value = enum_value`... that might actually happen. I haven't decided.

"`char str` into cstring str"... no? The whole story with strings haven't been 100% decided yet, but likely this will be: `char str` raw character string `char[]` a string slice, preferred over null terminating char*, and finally `String` which is a userland, dynamic string.

Something you can do with C3 is that you can convert as much or as little you want from C to C3. C3 is ABI compatible with C, so you can just compile using the C3 compiler for some files and then with GCC or Clang the C files. In fact I did this with vkQuake, converting a little bit of code into C3 and removing that from the .c files, then compiling the C3 code with c3c and the C code with Clang, then linking it together and it runs as if all had been written in C.

https://twitter.com/nuoji/status/1417212252843880451

Edit: And regarding `func` it's for easy parsing and greping for IDEs and editors.