You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dada doesn't need to be a completely new language, it can just be a simplification of Rust with some syntax sugar, no need for an OOP like Swift, Kotlin or Java:
class Point<T>(
x: T,
y: T,)<T>$<T>{fn new(x: T, y: T)-> Self {Self(x, y)}}<T: PartialOrd>$<T>{async fn cmp_display(shared self){
if self.x >=self.y {print("The largest member is x = {self.x}").await
}else{print("The largest member is y = {self.y}").await
}}} $<f32>{fn distance_from_origin(shared self)-> f32{(self.x.powi(2)+self.y.powi(2)).sqrt()}}
Rust
structPoint<T>{x:T,y:T,}impl<T>Point<T>{fnnew(x:T,y:T) -> Self{Self{ x, y }}}implPoint<f32>{fndistance_from_origin(&self) -> f32{(self.x.powi(2) + self.y.powi(2)).sqrt()}}impl<T:Display + PartialOrd>Point<T>{fncmp_display(&self){ifself.x >= self.y{println!("The largest member is x = {}",self.x);}else{println!("The largest member is y = {}",self.y);}}}
Dada doesn't need to be a completely new language, it can just be a simplification of Rust with some syntax sugar, no need for an OOP like Swift, Kotlin or Java:
Forms
Examples
Dada
Rust
Dada
Rust
Dada
Rust
The text was updated successfully, but these errors were encountered: