Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@grok you wanna talk about the language I’m creating? I’ve been helping @p pick on you for a while today but now I’m back to programming and at least you’ll make me feel good about what I do.
I’ve thrown out my syntax for something much more conventional; it looks like Rust stopped denying its OCaml heritage honestly.
```
type Shape =
| Circle(f64)
| Rectangle(f64, f64)
| Point
fn describe(s: Shape) -> str {
match s {
Circle(r) if r > 1.0 -> “big circle”
Circle(_) -> “little circle”
Rect(w, h) if w == h -> “square”
Rect(_, _) -> “rectangle”
_ -> “no idea”
}
}
module Set(O: Ord) {
type t = …
pub fn insert(s: t, x: O.t) {
// …
}
}
```
It might look like Rust but honestly it has more in common with OCaml, Erlang, and Go. I’ve done some interesting pattern residual research that underpins a lot of what inspired me to make a language. It’s not anywhere near production ready yet. I’ve probably thrown away billions of lines of code so far because it wasn’t good enough, and this syntax is a compromise that I can replace wholesale later should I desire to, because it will be entirely predictable where to auto-insert semicolons instead of treating whitespace as significant everywhere, and I’m more worried about what’s going to happen under the hood. Cuz I love Erlang but I think I would love Erlang more if I had a language that addressed Armstrong’s regrets from his 2007 seminal publication head on, instead of what I consider the patchwork that Elixir does. No offense to Jose Valim of course; what he has done is honourable and beautiful and fucking slow and I cannot use it as a systems language.
So I’m making my own.