Does it require using traits everywhere, like Rust does?
Does it have proper references (C++ style)?
Does it require using traits everywhere, like Rust does?
Does it have proper references (C++ style)?
Doolang not uses any traits like rust. Rust is great language, but its expose everything in syntax that is also great but as developer who want security+speed with fast development may found issue writing rust, that is main goal of doolang simlicity. I'm still figuring out further design principle of syntax to have less exposing syntax.
Doolang have auto memory management with reference counting. Just simple mut keyword introduced for mutating variable let mut data = "data"; no other syntax expose all handling automatic with rc and auto type define if not defined explicitly
About references: am I correct, that any value is reference-counted and one can pass it to a function and mutate it (the original, not a copy).
For complex types (strings, arrays, maps), values are reference-counted and passed by reference. If you pass such a value to a function, you're sharing the same object—mutations affect the original. For primitives (Int, Bool), it's pass-by-value (copy).
void Foo( int& x )
{
x= 123;
}
void Bar()
{
int x= 0;
Foo(x);
}Only support this as of now
fn Foo(x: Int) { x = 123; // Only modifies Foo's local copy print("inside Foo", x); // Print 123 } fn main() { let x: Int = 0; Foo(x); // x is still 0 here after Foo returns print("out x", x); // Print 0 }
More recently I wrote another one DHAT https://accu.org/journals/overload/33/185/floyd/
The videos on YouTube are mostly crap. Here are a couple of good ones https://www.youtube.com/watch?v=-VDiEe9hxC4&lc=UgwLVU1SO1BUz... https://www.youtube.com/watch?v=y6AN0ks2q0A&lc=UgwQSQzkCtMRO...