Live data from Hacker News

Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

gossamer-lang.org

81–90 of 98 posts

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#81
post #49

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,…

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.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#82
post #31

If you are interested in Gossamer, you may also be interested in Lis, which is Rust flavored and compiles to go: https://github.com/ivov/lisette From their readme: Safe and expressive: - Hindley-Milner type system - Algebraic data types, pattern matching - Expression-oriented, immutable by default - Rust-like syntax plus |> operator and try blocks - Go-style interfaces, channels, goroutines Quietly practical: - Inter…

I would also like to toss my project into the ring, which also allows mixing most real-world Rust & Go packages together, on runtime & syntax compatible level. https://github.com/deepai-org/omnivm Pardon the sloppy readme - it actually does work :)

You were so preoccupied with whether or not you could, you didn't stop to think if you should.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#84
post #20

Earlier quoted context omitted.

Haskell does too. And it predates Go by a large margin, such that calling it goroutine is weird. And within Google, the C++ implementation fiber also predated goroutines. It really shows that this is more of a library feature rather than a language feature.

I agree with your objection to treating goroutines as the baseline implementation of fibers. However, I would disagree with categorizing the feature as a library feature vs a language level feature. In “low-level” languages (C, Rust, Zig, C++, etc) the ability and option exists for having ‘green threads’ with most of their commonly assumed characteristics be library based constructs (although see [1] for why that’s n…

Another thing is the stdlib integration of goroutines. We see this in Python where various generations of paradigms kind-of coexist. Golang built their goroutines into the heart of the stdlib which puts it IMHO in a special position.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#85

Earlier quoted context omitted.

Java and Crystal are not equivalent - neither have preemptible threads. Lots of other languages have co-routines or other cooperative systems - async/await are really just variants of that. I didn't check if Gossamer is actually preemptible. I believe the short list of production languages with preemptible M:N schedulers are limited to: Erlang/Elixir Haskell Go

Java threads including Virtual Threads (JDK 21+) are preemptive.

They are not - and do not claim to be preemptive. They claim they are "not cooperative", but even that doesn't mean what anyone else thinks it means.

This paragraph is the only one containing the word "preempt" in JEP 444:

"The scheduler does not currently implement time sharing for virtual threads. Time sharing is the forceful preemption of a thread that has consumed an allotted quantity of CPU time. While time sharing can be effective at reducing the latency of some tasks when there are a relatively small number of platform threads and CPU utilization is at 100%, it is not clear that time sharing would be as effective with a million virtual threads."

https://openjdk.org/jeps/444

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#86
post #54

Earlier quoted context omitted.

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.

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 wante…

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.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#87
post #49

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,…

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.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#88
post #49

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,…

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 apprecia…

does rust have FFI, then? (aka stable ABI)

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#89

Earlier quoted context omitted.

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 apprecia…

does rust have FFI, then? (aka stable ABI)

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.

Re: Gossamer: a Rust-flavoured language with real goroutines and pause-free memory

#90

Earlier quoted context omitted.

The entire concept of a pauseless GC is that you have no uncontrollable latency. The GC can run on a background thread with zero stop-the-world. Of course, this assumes you're in a preemptive environment with access to other threads, etc.

@LoganDark You're right, as long as there is an object graph to scan, 'uncontrollable' latency is an inherent trade-off in GC-based systems. I’ve taken a different route with a C++20 execution engine that eliminates the object graph scan entirely by using pre-allocated, static memory pools and lock-free SPSC structures. It's essentially moving from 'managing GC pauses' to 'deterministic, zero-allocation execution'. H…

The lock-free architecture that bypasses the allocator on the hot path is called `alloca`. Many mainstream compilers, and nearly every language that is not C, seemingly haven't properly supported it for years.
Post reply on HN