Lisette - A little language inspired by Rust that compiles to Go
It looks nice, yes—this could be a better version of Go. It has elements of Rust and Vlang. A very interesting compromise.
Lisette - A little language inspired by Rust that compiles to Go
It looks nice, yes—this could be a better version of Go. It has elements of Rust and Vlang. A very interesting compromise.
@psyhackological I’ve come to realize that a type system isn't always the silver bullet it’s made out to be. At the end of the day, you're almost always starting with strings or binary data. You can define beautiful types and structures, but they often fail to catch real-world errors, which then just pop up at runtime anyway. In my experience, most errors occur because you have incorrect/unexpected input data.
For me, types are mostly useful for large-scale refactoring or IDE code completion.
@psyhackological I actually find e.g. #Rakulang's approach quite interesting too. Gradual dynamic typing. For example, using `subset`
```raku
subset Age of Int where 0..120;
my Age $my-age = 25; # OK
my Age $old-age = 150; # Error: Type check failed
subset Username of Str where /^ \w ** 3..15 $/;
my Username $user = “r2d2_detective”; # OK
my Username $bad = “yo”; # Error
```
@psyhackological
```raku
subset
NonEmptyList of List where *.elems > 0;
sub process-data(NonEmptyList $data) {
say “process ” ~ $data.elems ~ “...”;
}
process-data([1, 2, 3]); # Okay
process-data([]);
```
or things like multi-dispatch e.g.:
```raku
proto fib (Int $n --> Int) {*}
multi fib (0) { 0 }
multi fib (1) { 1 }
multi fib ($n) { fib($n - 1) + fib($n - 2) }
```