Will there be built in testing support like in Zig or Rust?
Something Rust makes very easy to set up is testing, and Zig makes this even easier by just having
test "name" { ... }
declarations. The less friction there is for good practices like this the more people tend to do it.
Would something like this be considered for mojo at some point?12 Replies
GitHub
GitHub - modularml/mojo: The Mojo Programming Language
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
I opened a discussion on github https://github.com/modularml/mojo/discussions/730
GitHub
Built in testing support, like Rust or Zig · modularml mojo · Discu...
Having tests as a language feature greatly reduces friction required to write and maintain them as they can exist right alongside code they are testing. Personally I often avoid tests in languages ...
@TeamPuzel you use zig?
Yeah
do u also use rust?
which do u prefer more?
recently i see bun is written in zig
You mean Zig?
sorry typo
Zig is very simple and makes it easy to work with things like WebAssembly without any dependencies. I like Rust a lot too but it's more difficult to do that
Zig doesn't have traits which is often annoying
would u recommend people to learn zig?
oh then how does zig achieve polymorphism?
Yeah it's a cool language, like a more modern version of C
The only way to do polymorphism is to manually write the vtables or use tagged unions
omg
writing the vtables and tagged unions?
thats real bad
Yeah it's not intended to be Rust, it's meant to be C
But I mentioned it here because it has a very nice testing feature.