4 ms·
Aside - Documentation says: > It is possible to cast the variant type to any pointer type, which will return null if the types match, or the pointer value othe
by tialaramex 4y ago
Aside - Documentation says:
> It is possible to cast the variant type to any pointer type, which will return null if the types match, or the pointer value otherwise.
That seems backwards to me. Maybe it's just me? Surely if the types match that's when we get the pointer value ?
My main point - Strings
I think at this point good strings are table stakes. If you're a general purpose language, people are going to use strings. Are they going to make a hash table of 3D vectors? Maybe. Are they going to do finite field arithmetic? Maybe. Are they going to need networking? Maybe. But they are going to use strings. C's strings are reprehensibly awful. C++ strings are, astoundingly, both much more complicated and worse in many ways, like there was a competition. You need to be doing a lot better than that IMHO.
I happen to really like Rust's str but I'm not expecting to see something so feature rich in a language like C3. I am expecting a lot more than from a fifty year old programming language though.
- lerno 4y agoVariants... that's a bug in the documentation. Thanks for finding it! I agree about strings. There are basically two strings we use: the string builder and the "string data" which is any sort of slice of bytes that can be interpreted as a string. But starting from there are a lot of different ways one can name and implement them. I'm doing some experiments and before those are finished I don't have a strong opinion. One thing to note though is that C3 does not have RAII or move semantics and so the C++ std::string or similar isn't even an option.
- mst 4y agoIf I have that set of semantics I'll use nim compiled to C with ORC attached. You're aiming for something different, and I appreciate the idea even if I never end up using it. In the unlikely case you haven't already read it about the only time I got C to do what I wanted without just segfaulting everywhere (my mistakes) was using djb's substdio.