Live data from Hacker News

Rust 1.24

blog.rust-lang.org

21–30 of 215 posts

Re: Rust 1.24

#21
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

What do you use Python for?

Re: Rust 1.24

#22
post #12

Incremental compilation! And it's only going to incremental-er from here, as the compiler learns how to cache more and more sorts of interim artifacts to avoid redundant work. Though I think the wording in the OP is a bit off: > Historically, the compiler has compiled your entire project, no matter how little you’ve changed the code. This isn't quite correct. When you change the code in a given library, it has histor…

Have there been any thoughts around making the compiler something akin to a stateful server with an embedded datastore for the caching rather than using the filesystem?

I think this is something that C# and VB.NET do.

Re: Rust 1.24

#23
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

They really very different but...

+ Static typing (extra safety, robust refactoring, code completion etc.)

+ Much much faster and less memory use

+ Compiles to a relatively standalone binary (not as good as Go though)

+ No Python 2/3 nonsense to deal with

- Much more complicated. You have to deal with lifetimes and borrowing and so on. It's really very difficult and we still don't know how to write some types of programs nicely (e.g. GUIs)

- Slow compilation times

- Can get pretty verbose and full of type boilerplate

Honestly if I was coming from Python I think I would switch to Go first. It is still way faster than Python, has a very nice "batteries included" standard library, static typing, very fast compilation and makes nice static binaries. The downside compared to Python is that it isn't very expressive at all - you'll find yourself writing out loops where you might have used a one-line list comprehension or something in Python.

Re: Rust 1.24

#27
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

Performance is quite a bit higher for rust. And it's a much safer language by design (and forces the programmer to be as such). That said, development time in Python is much faster. Honestly, it depends on what you're building.

I'm curious what parts of Rust you think are safer than Python.

Edit: The only big thing I can think of is the safety of compile-time type checking to ensure you won't end up with some kind of runtime error from mismatched types. Is there something I'm missing?

Re: Rust 1.24

#28

Is rustfmt fast enough to reasonable be put on a save hook?

I went into one of my projects and did a `cargo fmt`, took 2.2 seconds. Dunno if that's within your tolerances or not. I personally have CI check it, rather than on save.

Re: Rust 1.24

#29
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

Python:

Think about your domain problem, don't worry about CS and perf

Use the REPL to "touch data with your own hands"

Rustlang:

Fast, fast, fast

Everything bundled inside a single binary that you can just ship - no dependency hell for your users

Re: Rust 1.24

#30
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

They really very different but... + Static typing (extra safety, robust refactoring, code completion etc.) + Much much faster and less memory use + Compiles to a relatively standalone binary (not as good as Go though) + No Python 2/3 nonsense to deal with - Much more complicated. You have to deal with lifetimes and borrowing and so on. It's really very difficult and we still don't know how to write some types of prog…

> Compiles to a relatively standalone binary (not as good as Go though)

Whats the difference?

Post reply on HN