Live data from Hacker News

Fun facts about Rust's growing popularity

jonathanturner.org

111–120 of 136 posts

Re: Fun facts about Rust's growing popularity

#111
post #35

Earlier quoted context omitted.

https://en.wikipedia.org/wiki/Rust_(fungus)

I assumed it was named after the more well-known phenomenon of iron oxidation.

The fungus was named after the iron oxidation (they look alike).

Re: Fun facts about Rust's growing popularity

#113

Earlier quoted context omitted.

To me, Swift feels very similar to Rust only a lot simpler. Arc is also (imho) a nicer solution than a GC (though people have different opinions on that). Even better, with future versions, some of the features of Rust (i.e. lifetimes) will also come to Swift in an opt-in way. It is still a young language but fun to code in.

What's coding in Swift like outside of being on macOS? Is the tooling decent on Ubuntu / *NIX or Windows?

AFAIK there is no official Swift support for Windows, you can use it under WSL though if you want.

On Linux there is official support for Swift.

Re: Fun facts about Rust's growing popularity

#114
post #108

And yet not a single project written in Rust is out. The only project is Servo and nowhere close to production.

That's not entirely true. Only in the blockchain world there are two Rust projects I know of:

- the parity ethereum client: https://github.com/paritytech/parity

- the exonum framework: https://exonum.com/

Re: Fun facts about Rust's growing popularity

#115

Well, a fun fact: there is nothing funny about that list :). It should have been called "Some facts about Rust's growing popularity". Now, my predicament: I love Rust's type system and tooling, but it's really hard to justify to myself the pain of writing correct Rust code (borrowing, lifetimes, etc.) when I know I can get almost the same effect by using a GC language + immutable messages. And I don't need that last…

I need that last drop of performance but only for a very small part of my code. For the rest, it's just painful to either have to implement iterators with tons of boilerplate ownership or declare things as sitting boxes on the heap. Both distract a lot from what I'm trying to do which is annoying. I wish there was a higher level Rust sublanguage where heap allocation and GC was default, and you would use the "bare" R…

You might look at LuaJIT as that language, with the inner loop in Rust.

Re: Fun facts about Rust's growing popularity

#117
post #46

Earlier quoted context omitted.

Pythonista makes me think of a leftist guerilla in a jungle with a beret and a machine gun.

This is fairly accurate bc they have a Chairman-for-life, and a schism between two groups, one of which denounces the other as revisionist.

Python 7 is one true ISO standard Python.

Re: Fun facts about Rust's growing popularity

#118

Earlier quoted context omitted.

I need that last drop of performance but only for a very small part of my code. For the rest, it's just painful to either have to implement iterators with tons of boilerplate ownership or declare things as sitting boxes on the heap. Both distract a lot from what I'm trying to do which is annoying. I wish there was a higher level Rust sublanguage where heap allocation and GC was default, and you would use the "bare" R…

You might look at LuaJIT as that language, with the inner loop in Rust.

It's very easy to do the Java/C, C#/C, C#/Rust, Python/C dance, but there is always a massive impedance mismatch at the boundary, and there are always two different build systems and package managers etc involved.

I'd like to see a language that is both systems and high level at the same time, with trivial interop and a common build system + package manager.

This could e.g be a set of low level extensions added to C# (Span, ref returns etc is getting there) or a high level wrapper language/subset for e.g. Rust.

There is always a best tool for the job, and most jobs might require two tools, so it would be great if those two tools were aware of each other and came in the same toolbox.

Re: Fun facts about Rust's growing popularity

#119
post #70

Earlier quoted context omitted.

>Rusts solution is a more general solution to the "general resource problem" It's true. Ever since I got familiar with the ownership concept, I've taken to writing C# IDisposables with disposable member variables like this: public MyObject(){ this.myResource = new DisposableResource(); this.ownsMyResource = true; } public MyObject(DisposableResource resourceToUseThatIDontOwn){ this.myResource = resourceToUseThatIDont…

I agree and I appreciate what they are trying to do. But just as a counter-argument, look how a simple lock looks like in Rust [1]: fn main() { let counter = Arc::new(Mutex::new(0)); let mut handles = vec![]; for _ in 0..10 { let counter = counter.clone(); let handle = thread::spawn(move || { let mut num = counter.lock().unwrap(); *num += 1; }); handles.push(handle); } //... } [1] https://doc.rust-lang.org/book/secon…

The issue really is lack of scoped threads forcing usage of reference counting to figure out when to drop a value. With crossbeam scoped threads implementation this looks much nicer.

    extern crate crossbeam;
    
    use std::sync::Mutex;
    
    fn main() {
        let counter = Mutex::new(0);
        crossbeam::scope(|scope| for _ in 0..10 {
            scope.spawn(|| *counter.lock().unwrap() += 1);
        });
        println!("{:?}", counter);
    }
Four lines to declare a mutex, start 10 threads that all lock that mutex, increase value behind mutex, unlock mutex, and join all spawned threads. There is a lot going on here (unwrap is arguably a noise here however, but the rest is straight to the point).

Also, it's possible to use atomic ints here instead of mutex. Verbosity of mutex actually helps a bit, because locking is fairly expensive and it's better to avoid locking if possible.

Re: Fun facts about Rust's growing popularity

#120

Well, a fun fact: there is nothing funny about that list :). It should have been called "Some facts about Rust's growing popularity". Now, my predicament: I love Rust's type system and tooling, but it's really hard to justify to myself the pain of writing correct Rust code (borrowing, lifetimes, etc.) when I know I can get almost the same effect by using a GC language + immutable messages. And I don't need that last…

I suggest taking a look at D[0] optional GC if you need to get that low level. A bit older than Rust. [0]: https://dlang.org/

From what I've seen so far (just getting started with D), I like D a lot:

* compiled, statically-typed, GC'd

* _very_ fast compilation (this is DMD; haven't tried the other two implementations (one on LLVM, the other on GCC))

* very fast executables

* easy linking with and use of C libraries

* familiar and practical

Post reply on HN