logoalt Hacker News

Rue: Higher level than Rust, lower level than Go

122 pointsby ingveyesterday at 8:46 PM92 commentsview on HN

Comments

killingtime74yesterday at 10:16 PM

I always thought of Go as low level and Rust as high level. Go has a lot of verbosity as a "better C" with GC. Rust has low level control but many functional inspired abstractions. Just try writing iteration or error handling in either one to see.

show 4 replies
andsoitisyesterday at 8:50 PM

> Memory Safe

> No garbage collector, no manual memory management. A work in progress, though.

I couldn't find an explanation in the docs or elsewhere how Rue approaches this.

If not GC, is it via:

a) ARC

b) Ownership (ala Rust)

c) some other way?

show 3 replies
est31today at 3:19 AM

I have mostly been writing Rust in the last 10 years, but recently (1 year) I have been writing Go as well as Rust.

The typical Go story is to use a bunch of auto generation, so a small change quickly blows up as all of the auto generate code is checked into git. Like easily a 20x blowup.

Rust on the other hand probably does much more such code generation (build.rs for stuff like bindgen, macros for stuff like serde, and monomorphized generics for basically everything). But all of this code is never checked into git (with the exception of some build.rs tools which can be configured to run as commands as well), or at least 99% of the time it's not.

This difference has impact on the developer story. In go land, you need to manually invoke the auto generator and it's easy to forget until CI reminds you. The auto generator is usually quite slow, and probably has much less caching smartness than the Rust people have figured out.

In Rust land, the auto generation can, worst case, run at every build, best case the many cache systems take care of it (cargo level, rustc level). But still, everyone who does a git pull has to re-run this, while with the auto generation one can theoretically only have the folks run it who actually made changes that changed the auto generated code, everyone else gets it via git pull.

So in Go, your IDE is ready to go immediately after git pull and doesn't have to compile a tree of hundreds of dependencies. Go IDEs and compilers are so fast, it's almost like cheating from Rust POV. Rust IDEs are not as fast at all even if everything is cached, and in the worst case you have to wait a long long time.

On the other hand, these auto generation tools in Go are only somewhat standardized, you don't have a central tool that takes care of things (or at least I'm not aware of it). In Rust land, cargo creates some level of standardization.

You can always look at the auto generated Go code and understand it, while Rust's auto generated code usually is not IDE inspectable and needs special tools for access (except for the build.rs generated stuff which is usually put inside the target directory).

I wonder how a language that is designed from scratch would approach auto generation.

show 3 replies
Panzerschrektoday at 6:24 AM

I am surprised that a language with nothing than a couple of promises gets so much attention. Why exactly?

lifisyesterday at 11:38 PM

All the Rue code in the manual seems to also be valid Rust code, except for the @-prefixed intrinsics

show 1 reply
jameskiltonyesterday at 10:11 PM

Probably best to link to the repo itself, this is not meant to be used yet. https://github.com/rue-language/rue

chrysopracetoday at 1:18 AM

It may have been more useful to link to the blog post [0] which gives more of an introduction than the front page at this point.

[0] https://rue-lang.dev/blog/hello-world/

show 1 reply
Panzerschrektoday at 6:22 AM

How does it achieve memory safety?

waldrewstoday at 2:58 AM

What the world needs is a more expressive language than Go, that interops with Go's compilation model and libraries.

show 1 reply
reactordevtoday at 1:28 AM

I write a lot of go. I tried to write a lot of rust but fell into lifetime traps. I really want to leave C++ but I just can’t without something that’s also object oriented.

Not a dig at functional, it’s just my big codebases are logically defined as objects and systems that don’t lend itself to just being a struct or an interface.

Inheritance is why I’m stuck in C++ land.

I would love to have something like rust but that supports classes, virtual methods, etc. but I guess I’ll keep waiting.

show 3 replies
misirtoday at 3:03 AM

Any plans for adding algebraic data types (aka rust enums)?

show 1 reply
coffeeaddict1yesterday at 11:18 PM

How does this differ from Hylo [0]?

[0] https://hylo-lang.org

show 1 reply
oulipo2yesterday at 10:54 PM

Interesting, for me the "between Rust and Go" would be a nice fit for Swift or Zig. I've always quite liked the language design of Swift, it's bad that it didn't really take off that much

show 2 replies
noriryesterday at 10:18 PM

I wince every time I see naive recursive fibonacci as a code example. It is a major turnoff because it hints at a lack of experience with tail call optimization, which I consider a must have for a serious language.

show 4 replies
frizlabyesterday at 11:34 PM

How does this compare to Swift?

show 1 reply