Live data from Hacker News

Rust Foundation: Hello, World

foundation.rust-lang.org

101–110 of 284 posts

Re: Rust Foundation: Hello, World

#101
post #76

Earlier quoted context omitted.

I think the point is that most people will know the offset of their own timezone from GMT/UTC. If you specify time in another timezone, they now need to know two offsets - theirs AND yours. Chances are they won't know yours and they have to look it up.

This is a very "HN bubble" perspective. No, most people do not know their time zone's offset from GMT and go through a timezone converter. When they have to set a timezone, they click a spot on a map or look up, "What timezone is Pittsburgh?" For most, it's faster to search "12:00 GMT to EST" or whatever than it is to remember it and do the arithmetic.

Rust Foundation seems pretty much targeted at HN-bubble-like groups, that do indeed have some familiarity with GMT/UTC.

Re: Rust Foundation: Hello, World

#102
post #64

Earlier quoted context omitted.

I have a app that have been ported from old python -> f# -> rust (e-commerce like) and the transition was great ( https://www.reddit.com/r/rust/comments/hh9tz6/does_rust_have... ). You need to pay attention in how align the whole software stack. Pairing Rust with tailwinds and htmx or Hotwire simplify so much stuff is like cheating. For regular CRUD flows having enums/traits/iterators make domain modeling very good a…

Could you comment a bit more on how Rust let you model the domain better than F# did?

The thing with F# is that (idiomatic) models/functions rely on type inference, and eventually is hard to see what is the flow without look at the IDE. Rust making type annotations explicit with minimal inference is much clearer.

Also, the fact I can do mutation + imperative code locally yet give a functional feel make some hacks around this on F# unnecessary.

But probably the biggest thing is that Rust make idiomatic things like conversions with From/Into/AsRef/etc instead of rely in your own conventions, making code more readable in the long run.

Other source of simplification is serde. A lot of my stuff is transfer/(re)encoding of data and have a "de facto" idiom for this help a lot.

One thing that F# make far easier and I miss much is the sequences (https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...). Making iterators is boilerplate and wish Rust have generators in stable.

I found a decent library for this in https://lib.rs/crates/genawaiter but is not the same as have it in-build.

Re: Rust Foundation: Hello, World

#103

Earlier quoted context omitted.

serious question : would you recommend Rust for CRUDdy type of web applications -- stuff where mostly you are firing off prepared statememts at a SQL db and then applying business logic to result set. This is what most J2EE apps do currently.

don't get me wrong, I love rust and find it a great language for doing systems level stuff but it would be my last choice for a crudy type web application. Those are intrinsically IO bound. Sure, you might find a noticeable improvement if you're using something really slow like rails without any caching but there are plenty of garbage collected rapid development languages that will be fast enough that the visible per…

> Those are intrinsically IO bound.

Rust has a great async story compared to other languages, which benefits IO-bound workloads even more so than CPU-busy ones.

Re: Rust Foundation: Hello, World

#104
post #87

As someone who wants to use Rust for real world applications, what are some good use cases for Rust? Web development is not its strong suite, apparently. Or, better still, what have you personally built using Rust?

I've used Rust to write a couple of personal projects: a compiler for a language I've designed (it's really good for that because of its great ADT and pattern matching support) and a small CLI which I wanted to be very fast. Rust is great for that. The `structopt`[0] crate makes writing CLIs almost as easy as on a high level language.

The other project is a web app and I use Rust to compile to WASM. Because I had to use several web APIs (DOM, WebCrypto) I used the JS interop heavily, and that's still very painful to use if you use the low-level interop (js-sys and web-sys)... however, I am aware of several efforts in this area, like Yew[1], which should make things better.

The language is very hard to learn, but once you get past a certain threshold (depending on what you know already, that may take weeks to several months) it's really nice to use (though certain things are still hard to write because managing lifetimes can be very tricky).

[0] https://crates.io/crates/structopt

[1] https://yew.rs/

Re: Rust Foundation: Hello, World

#105
post #88

Earlier quoted context omitted.

serious question : would you recommend Rust for CRUDdy type of web applications -- stuff where mostly you are firing off prepared statememts at a SQL db and then applying business logic to result set. This is what most J2EE apps do currently.

I have some extensive (self-assesment :) ) experience building this kind of application, and my answer would be "no, but maybe" (I was one of the first engineers & architect on our zero to ~500k codebase). Some of the arbitrary, random things I've learned: 1. Given how nice and powerful language is, Rust works relatively well with less experienced engineers. Potentially. You can build very nice APIs which are straigh…

> Turned out, strings are not that cheap to clone if all you have is a bunch of strings.

Yeah, if you're doing a lot of cloning, you'll probably run into performance issues at some point. A common way to solve that problem is usually to use references instead of cloning.

Of course, writing your code that way takes more work/thought/planning.

Re: Rust Foundation: Hello, World

#106
post #101

Earlier quoted context omitted.

This is a very "HN bubble" perspective. No, most people do not know their time zone's offset from GMT and go through a timezone converter. When they have to set a timezone, they click a spot on a map or look up, "What timezone is Pittsburgh?" For most, it's faster to search "12:00 GMT to EST" or whatever than it is to remember it and do the arithmetic.

Rust Foundation seems pretty much targeted at HN-bubble-like groups, that do indeed have some familiarity with GMT/UTC.

Also CT is lucky to be unique. CST / BST / IST are a bit more of a guesswork for international groups.

Re: Rust Foundation: Hello, World

#108

As a C developer, after getting sick and tired of hearing about Rust everywhere, I decided to do a bit of assessment in terms of code-size complexity. I heard of ripgrep, an amazing twenty-first century revolution that beats grep in the dust. I have never seen grep source code. I told myself, if I download ripgrep-on-Rust and grep-on-C and find out that ripgrep is doing all it's doing in one-tenth the size of grep so…

Maybe the fact that ripgrep contains more lines of code is related to the fact that it has more features, and not just about the language it's written in? https://beyondgrep.com/feature-comparison/ Also, it's kind of pointless to compare lines of code given that both projects get large amounts of their functionality from dependencies. For instance, the GNU grep repository doesn't actually contain any regex-matching c…

The "proper" comparison (that would still be horribly misguided) would be against the "core" crate in ripgrep. And that's only 5kloc, a lot of it from the "app.rs" (3kloc) and "args.rs" (1.2kloc) which is almost only declarative usage strings.

The "actual" code of ripgrep is accross its multiple support crates, which the community largely benefits from having since those are general enough to be almost foundational to any software.

imo, op is trolling, the old fashioned way

Re: Rust Foundation: Hello, World

#109
post #35

Earlier quoted context omitted.

In what way?

Mozilla was sort of de-facto the steward of the language up until recently. They stupidly fired the teams behind their most promising R&D project and lost any semblance of control over it.

No, Rust has been independent since Rust 1.0. Mozilla only provided free legal advice (+trademarks, etc) and employed some team members but they didn't have control.

Re: Rust Foundation: Hello, World

#110

Announcements also from Mozilla, Amazon and Microsoft: https://blog.mozilla.org/blog/2021/02/08/mozilla-welcomes-th... https://aws.amazon.com/blogs/opensource/congratulations-rust... https://cloudblogs.microsoft.com/opensource/2021/02/08/micro...

And Google:

https://opensource.googleblog.com/2021/02/google-joins-rust-...

Post reply on HN