reocha
3 days ago
Three things stick out to me on https://gossamer-lang.org/docs/migration/rust/
* No user macros at all. Six fixed format! / println!-family macros expand at parse time. - Meta programming is incredibly important in rust.
* (unsafe is) Forbidden at the language level. No unsafe keyword in Gossamer source. std is safe-Rust too. - No low level programming then.
* No move semantics. Non-trivial values are heap-allocated, reference-counted, and shared by reference; primitives are copied the same as Rust. - Again, no low level programming.
Calling this rust flavored (or even a systems programming language) seems a bit bold.
SkiFire13
3 days ago
It has a Rust-like syntax, enums, matching, traits, etc etc. Yes, it also loses a lot of special characteristics of Rust, but it has to be different somewhere. Moreover a lot of people like Rust as a high level language, i.e. ignoring the lower level capabilities and lifetimes, and this seems to be a direct response to that feeling.
jeremyjh
3 days ago
Google called Go a "systems language". I agree its not the right term, but people do use it to describe a language used in infrastructure software like Docker or Kubernetes.
To me it makes a lot of sense as a starting point. The world does not need another Rust since we have a perfectly good one. People who like Rust's type system but don't care to think about ownership when writing application code, and who appreciate the language asyncing all the things invisibly have plenty to like here.
I do agree though any serious language MUST have an FFI capability, and macros or at least some form metaprogramming of seem like tablestakes. Green threads are not impressive if they are not preemptive. But its not describing itself as finished, its 0.19. Rust looked completely different at that stage in its development - I think it still had green threads itself at that point.
librasteve
3 days ago
does rust have FFI, then? (aka stable ABI)
jeremyjh
3 days ago
It can export a stable C ABI. Most languages can - is there any language that has a different stable ABI?
What I was talking about though, was calling into C APIs through FFI, which pretty much every language except Gossamer can do.
bfung
3 days ago
Totally agree, misleading.
The syntax looks like rust, but esp w/the memory management model (reference counting), it’s going to have more overhead than rust when it’s running, more like Swift or at worse, Python.
charlieflowers
3 days ago
Originally I replied here that I thought you were both missing the point (but I was wrong).
I wrote: It has a garbage collector and goroutines, so clearly it is not trying to be a systems programming language.
Then ... I saw that it does indeed pitch itself as a systems programming language. So, I guess you both are right.
If Gossamer were to drop that claim, then I'd say it looks impressive to me. I have often wanted this particular mix of language features.
Recurecur
3 days ago
It doesn’t have a garbage collector, it uses reference counting with a cycle detector. So, no GC pauses. It should be suitable for hard real time systems.
reocha
3 days ago
Gleam comes close if you're comfortable with functional programming: https://gleam.run/
user
3 days ago
norman784
3 days ago
This language reminds me of Borgo https://borgo-lang.github.io
Recurecur
3 days ago
All three points are erased by its ability to call Rust functions…
It’s not a bad approach, in that for most general programming one doesn’t need those things. Granted, macros can be convenient.
reocha
2 days ago
Any language with FFI support can call rust functions.
Recurecur
18 hours ago
My impression was that Gossamer has good Rust FFI rather than basic C FFI, sharing struct layout etc. I may play around with Gossamer and see how it really does performance wise…
The syntax similarities help make for a more painless two language approach.