by kachapopopow · 11mo ago · 0 comments
the most odd one probably being 'const expected = [_]u32{ 123, 67, 89, 99 };'
and the 2nd most being the word 'try' instead of just ?
the 3rd one would be the imports
and `try std.fs.File.stdout().writeAll("hello world!\n");` is not really convincing either for a basic print.
For example, Pythons syntax is quite nice for the most part, but I hate indentation being syntax. I like braces for scoping, I just do. Rust exists in both camps for me; I love matching with Result and Option, but lifetime syntax confuses me sometimes. Not everyone will agree, they are opinions.
No, this is a wild claim that shows you've either never written async Rust or never written heavily templated C++. Feel free to give code examples if you want to suggest otherwise.
But for real the ratings for me stem from how much arcane symbology i must newly memorize. I found rust to be up there but digestible. The thought of c++ makes me want to puke but not over the syntax.
template<auto V>
concept non_zero = (V != 0);
template<typename T>
concept arithmetic = std::is_arithmetic_v<T>;
template<arithmetic T>
requires non_zero<T{42}>
struct complicated {
template<auto... Values>
using nested_alias = std::tuple<
std::integral_constant<decltype(Values), Values>...,
std::conditional_t<(Values > 0 && ...), T, std::nullptr_t>
>;
template<typename... Ts>
static constexpr auto process() {
return []<std::size_t... Is>(std::index_sequence<Is...>) {
return nested_alias<(sizeof(Ts) + Is)...>{};
}(std::make_index_sequence<sizeof...(Ts)>{});
}
};
I most definitely agree.All control flow in Zig is done via keyword
If you mean C-style declarations, the fact that tools such as https://linux.die.net/man/1/cdecl even exist to begin with shows what's wrong with it.
<fn> <generic> <name>(<type/argument>[:] <type/argument> [(->/:) type]
[import/use/using] (<package>[/|:|::|.]<type> | "file") (ok header files are a relic of the past I have to admit that)
I tried writing zig and as someone who has pretty much written in every commonly used language it just felt different enough where I kept having to look up the syntax.
constant array with u32, and let the compiler figure out how many of em there are (i reserve the right to change it in the future)