back

by lerno·5y ago·view on hn ↗
No, that's probably not a good description. I'm not saying you will appreciate the language, but it is basically C.

- "Failables" (which is somewhat like Result) offers an alternative to error handling which mostly mirrors how one commonly does it in C, but with conveniences. Since it works a bit different from all other error systems, I'd have to point to the docs for a summary. :(

- Semantic macros where the big win is that they are easier to read and write. (This is heavily inspired by the ASTEC macro system for C)

- Generic modules, which works similar to macro-based generics in C, but easier to read and work with.

- Subarrays (slices), yes they make a huge difference even though they're an obvious addition.

- A bunch of GCC extensions

- Optional design by contract

There are no objects, and certainly no dynamic OO system. There are no constructors and destructors or similar explicit code.

Calling C is straightforward, you just need to declare that it exists, like you would in C.

So `extern func int printf(char*, ...)` -> now you can do `printf("Hello %s\n", "World");` the opposite also works, so if you define a function `func void foo() @extname("c3_foo")` you can then call it from C as `c3_foo()` (or skip the `@extname` but you would have to call `my_module_foo()` instead due to namespacing.