Live data from Hacker News

Ask HN: What's the best “higher level Rust” these days?

news.ycombinator.com

51–60 of 63 posts

Re: Ask HN: What's the best “higher level Rust” these days?

#51
post #19

Earlier quoted context omitted.

I tried to write a little Linux utility that would walk the filesystem in C# a while back. It convinced me the language doesn't really support Posix systems after all. (Obviously, Linux software that's been written in C# exists; maybe I was using the wrong standard library or something. I went with whatever Microsoft's documentation suggested.)

Yeah, this is mistaken. At my last job we deployed tons of c# on Linux. The .net ecosystem is a little complicated because of the slow convergence of its std library and runtime (.net core, .net standard, .net framework, .net), but as of a few years ago a bog-standard .net app did everything you’d expect on any computer.

I'd rather believe hedora who has given a concrete example, sorry.

Re: Ask HN: What's the best “higher level Rust” these days?

#52
post #20

Have you tried wrapping everything in an Rc (or Arc >) and keeping everything synchronous and single threaded? I've seen people report good success with that for low-performance stuff. Reference counted languages provide 99% of the benefit of full GCs for simple programs, and I think those two suggestions are enough to mindlessly appease the borrow checker in most circumstances.

I wish somebody would make a language that looked like ruby/python but all it did was transpile the source file into a rust file with any necessary Rc/Arc> stuff and then run the normal rust compiler.

If you wanted to optimize a file, then just run the "eject" command on a file and then replace the extraneous Rc/Arc> stuff with smart people borrow checker stuff yourself.

I like crystal and nim, but it would be better to have such a language deeply just actually be rust under the hood and use rust libs natively and use crate literally instead of creating a whole new ecosystem.

Re: Ask HN: What's the best “higher level Rust” these days?

#53

I'd recommend going full steam ahead with Rust. Companies like Azure and Meta now recommend Rust as either one of several viable choices, or THE recommended option, for the use cases you describe, including CLI and web servers. Personally at this point, just about anything that's not a frontend (android, ios, web), I think Rust is the best language for the job. It's the language I prefer, and feel most productive in,…

It's crazy how many good GUI libraries there are as well, I've played around migrating some heavier applications and the experience was absolutely painless.

Which ones do you mean? That is the first time I've had someone express a positive sentiment regarding the state of GUIs in Rust.

I would say that I've tried most of them and they are all varying levels of aweful right now.

Re: Ask HN: What's the best “higher level Rust” these days?

#54

Unfortunately I have to agree with your inner voice that there's no perfect language out there. I'm building my first library in OCaml for a number of great reasons: 1. the type system we all want 2. multicore is here (but in RC) 3. algebraic effects is here (but in basically RC) 4. build system is pretty good after you warm yourself up a bit. i ran into some weird dep issues recently but overcame it by vendoring dep…

F# and C# also support native executables

Re: Ask HN: What's the best “higher level Rust” these days?

#55
post #41

C# is a good option. F# if you want functional C#. Scala if you are adventurous.

C# is great, if you ignore the lack of algebraic data types and the generally weak type system. Value types in C# are awesome and really make it easy to write super high performance code that doesn't allocate! F# is awesome if you ignore the fact that it's so easy to shoot yourself in the foot from a performance standpoint with all the lazy constructs. It sure is awesome though to have such a strict type system, thou…

What do you mean by lazy constructs? F# is not lazy by default but opt-in using seq.

Re: Ask HN: What's the best “higher level Rust” these days?

#56
post #41

C# is a good option. F# if you want functional C#. Scala if you are adventurous.

C# is great, if you ignore the lack of algebraic data types and the generally weak type system. Value types in C# are awesome and really make it easy to write super high performance code that doesn't allocate! F# is awesome if you ignore the fact that it's so easy to shoot yourself in the foot from a performance standpoint with all the lazy constructs. It sure is awesome though to have such a strict type system, thou…

Agreed. I really like TypeScript type system. I wish there was a language that used .NET but used TypeScript syntax/semantics. Maybe deno?

Re: Ask HN: What's the best “higher level Rust” these days?

#57
> After playing with rust, I really like it. However, I generally don't need to write the low level code that justifies the increased complexity of the borrow checker. I would rather just pay the small price for a garbage collector. What language is most like rust, but at a higher level?

I think you've mixed yourself up somewhere here. A garbage collector doesn't protect you from stale references, it just makes sure that it results in a program crash (or exception of some sort) rather than letting your program run off into fantasy lands where pigs fly and everyone casts magic spells. Rust still protects you by turning these errors into compile time errors, saving debugging time.

Re: Ask HN: What's the best “higher level Rust” these days?

#58

Earlier quoted context omitted.

Yeah, this is mistaken. At my last job we deployed tons of c# on Linux. The .net ecosystem is a little complicated because of the slow convergence of its std library and runtime (.net core, .net standard, .net framework, .net), but as of a few years ago a bog-standard .net app did everything you’d expect on any computer.

I'd rather believe hedora who has given a concrete example, sorry.

We've been running a production web service on .NET core on Linux for over a year. We develop, compile, and test this service in macs, build the docker containers on linux, and run on Linux.

Re: Ask HN: What's the best “higher level Rust” these days?

#59
I would recommend taking a look at Julia. What it can't do is "get nullability right at compile time" however you can define Integer values which can't be zero and have that changed at run time with more and more of these checks moving to compile time but still raising errors at run time, "force you to look at values" but you can throw arbitrary stuff which is nice. Julia has the rest you wish for though. Julia has nice macros, has multiple dispatch instead of inheritance, a vibrant and growing community. It is mostly used in numerical work however use it on other domains has also shown a lot of promise, at the moment producing standalone binaries is still complicated, it pays compile time every time a function is called with new types.

Re: Ask HN: What's the best “higher level Rust” these days?

#60
Honestly it sounds like you should stick with Rust a while longer, until those low level things no longer present an obstacle. I've finally gone all-in on Rust and after a few months of full-time use at work I feel like I've "broken through" to the same level of productivity I had with Python (which I've used for a decade).
Post reply on HN