Live data from Hacker News

Rue: Higher level than Rust, lower level than Go

rue-lang.dev

161–170 of 274 posts

Re: Rue: Higher level than Rust, lower level than Go

#161
post #36

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.

Yep. This was the biggest thing that turned me off Go. I ported the same little program (some text based operational transform code) to a bunch of languages - JS (+ typescript), C, rust, Go, python, etc. Then compared the experience. How were they to use? How long did the programs end up being? How fast did they run? I did C and typescript first. At the time, my C implementation ran about 20x faster than typescript.…

> it was annoying to program (due to a lack of enums)

Typescript also lacks enums. Why wasn't it considered annoying?

I mean, technically it does have an enum keyword that offers what most would consider to be enums, but that keyword behaves exactly the same as what Go offers, which you don't consider to be enums.

Re: Rue: Higher level than Rust, lower level than Go

#162

Okay, right now it's basically Pascal as it was described in Revised Report, only even more restricted. Which is... fine, I guess, you can still write a whole OS with something like that (without using pointers/addresses) as Per-Brinch Hansen demonstrated but it's... an acquired taste. Are the actual references/pointers coming in the future?

Maybe Pascal without the syntax, sure. It’s still very early on.

I hope to not introduce references, because I’m going to give mutable value semantics a go. We’ll see though!

Re: Rue: Higher level than Rust, lower level than Go

#163
post #40
post #36

Earlier quoted context omitted.

Yep. This was the biggest thing that turned me off Go. I ported the same little program (some text based operational transform code) to a bunch of languages - JS (+ typescript), C, rust, Go, python, etc. Then compared the experience. How were they to use? How long did the programs end up being? How fast did they run? I did C and typescript first. At the time, my C implementation ran about 20x faster than typescript.…

Rust gets harder with codebase size, because of borrow checker. Not to mention most of the communication libraries decided to be async only, which adds another layer of complexity.

I work in a 400k+ LOC codebase in Rust for my day job. Besides compile times being suboptimal, Rust makes working in a large codebase a breeze with good tooling and strong typechecking.

I almost never even think about the borrow checker. If you have a long-lived shared reference you just Arc it. If it's a circular ownership structure like a graph you use a SlotMap. It by no means is any harder for this codebase than for small ones.

Re: Rue: Higher level than Rust, lower level than Go

#164
post #72

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

Auto generation? If you need to use that a lot, then the programming language is defective, I would say.

When Go was launched, it was said it was built specifically for building network services. More often than not that means using protobuf, and as such protobuf generated code ends up being a significant part of your application. You'd have that problem in any language, theoretically, due to the design of protobuf's ecosystem.

Difference is that other languages are built for things other than network services, so protobuf is much less likely to be a necessary dependency for their codebases.

Re: Rue: Higher level than Rust, lower level than Go

#165

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

I think ~everyone wants a language that's kind of like Go with a Rusty type system (and maybe syntax), so any title like this gets attention.

There's an obvious sweet spot in there.

Re: Rue: Higher level than Rust, lower level than Go

#166
post #158

Just pointing out here that "rue" is used to express "to regret", emphatically. Perhaps it is not the best name for a programming language.

Sounds fitting to me. Every line of code I wrote that ultimately didn't need code to begin with, is basically codified regrets checked into git.

Re: Rue: Higher level than Rust, lower level than Go

#167
post #164

Earlier quoted context omitted.

Auto generation? If you need to use that a lot, then the programming language is defective, I would say.

When Go was launched, it was said it was built specifically for building network services. More often than not that means using protobuf, and as such protobuf generated code ends up being a significant part of your application. You'd have that problem in any language, theoretically, due to the design of protobuf's ecosystem. Difference is that other languages are built for things other than network services, so proto…

I'd say auto generation is just another instance of Greenspun's tenth rule.

Re: Rue: Higher level than Rust, lower level than Go

#168

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.

I think it is precisely why Rust is gold - you can pick the abstraction level you work at. I used it a lot when simulating quantum physics - on one hand, needed to implement low-level numerical operations with custom data structures (to squeeze as much performance as possible), on the other - be able to write and debug it easily.

It is similar to PyTorch (which I also like), where you can add two tensors by hand, or have your whole network as a single nn.Module.

Re: Rue: Higher level than Rust, lower level than Go

#169
post #79

Earlier quoted context omitted.

You can provide default method implementations for traits. Any type with that trait gets the default behavior, unless you override it.

But that trait can’t have fields

You can use a struct that the other structs have as a field. The trait can then operate on that struct.

I'm not trying to convince you to use Rust. If you prefer C++ have at it. I was just trying to point out that most patterns in C++ have a fairly close analogy in Rust, just with different tradeoffs.

Re: Rue: Higher level than Rust, lower level than Go

#170
post #158

Just pointing out here that "rue" is used to express "to regret", emphatically. Perhaps it is not the best name for a programming language.

That’s part of the reason for the name! “Rust” also has negative interpretations as well. A “rue” is also a kind of flower, and a “rust” is a kind of fungus.

Fair enough! I do like how others are framing this is as "write less code" -- if Rue makes one think more and more about the code that finally makes it to the production, that can be a real win.
Post reply on HN