Live data from Hacker News

John Carmack: writing Rust code feels wholesome

twitter.com

41–50 of 85 posts

Re: John Carmack: writing Rust code feels wholesome

#41
post #21

Earlier quoted context omitted.

If it does, than not to Rust. Comparing tooling support for c++ and rust... In that comparison c++ completely overwhelms rust

I like C++ but I think he meant in terms of how sane and usable the tools are, in which case Rust easily wins. Compare Cargo to CMake for example. Sure it might not have as many IDEs, static analysers, debuggers and so on, but I'd easily take Rust's build system over C++'s tool ecosystem.

When we compare eco-systems, we need to consider everything.

For cargo to win over cmake, it needs to finally support binary libraries.

For Rust to matter to .NET devs, it needs to support COM/UWP and mixed mode debugging on IDEs.

On Android, mixed mode debugging and just fitting in with the NDK/AS would also be quite productive.

Re: John Carmack: writing Rust code feels wholesome

#42

I decided to learn Go instead of Rust over the last 6 months (very limited time so couldn’t learn both well). Rust has gotten so much on HN lately that I think it may be time for me to make the switch.

Go is okay too. It's not as hyped as Rust but it has a lot going for it. So don't regret your choice.

Re: John Carmack: writing Rust code feels wholesome

#43

I decided to learn Go instead of Rust over the last 6 months (very limited time so couldn’t learn both well). Rust has gotten so much on HN lately that I think it may be time for me to make the switch.

I started with Go and am now learning Rust. I liked Go, but it felt incomplete (currently there's a discussion on generics) and I'm tired of Java never settling down and now trying to be cool. Also, method declarations are weird (method over variable or pointer).

Rust seems complete. The ownership paradigm is a bit difficult at first, but the compiler is good at pointing out exactly what the issue is.

Re: John Carmack: writing Rust code feels wholesome

#44

I looked seriously at rust about 2 years ago. I seem to have tried the language at the wrong time .. they were transitioning between versions and this made learning it hard. I grew up with C so am very comfy with pointers. Even reference counting feels natural to me. That said, the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Has this got better? Is there a K&R…

[deleted]

Re: John Carmack: writing Rust code feels wholesome

#45

When I explored rust I found the exact same feeling too, but couldn't find that word. My only issue is how surprisingly weak Rust support is in my favourite editor. Rust seems to feel more popular than it is. Or maybe more people write Rust in a "no frills notepad" kind of way.

CLion/IntelliJ with the Rust plugin works nicely, but I write 99% of rust in (neo)vim. I hate opening up IDEs and keeping them open.

Re: John Carmack: writing Rust code feels wholesome

#46

I looked seriously at rust about 2 years ago. I seem to have tried the language at the wrong time .. they were transitioning between versions and this made learning it hard. I grew up with C so am very comfy with pointers. Even reference counting feels natural to me. That said, the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Has this got better? Is there a K&R…

the borrow checker will accept more correct programs than it did 2 years ago so yes it has gotten better, but it is still a big paradigm shift.

Re: John Carmack: writing Rust code feels wholesome

#47

I looked seriously at rust about 2 years ago. I seem to have tried the language at the wrong time .. they were transitioning between versions and this made learning it hard. I grew up with C so am very comfy with pointers. Even reference counting feels natural to me. That said, the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Has this got better? Is there a K&R…

>the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Taking a wild guess here, but it sounds like you maybe referring to issues addressed by Non-Lexical Lifetimes (NLL)? Reference: https://github.com/rust-lang/rfcs/blob/master/text/2094-nll.... NLL are a part of Rust 2018 Edition. Three complementary books are the best resources: - The Official book: https://doc.ru…

NLL only modes aren't available on stable Rust atm. What edition 2018 has right now is migrate mode NLL. In order to fully enjoy NLL, you'll have to use Rust nightly and do #![feature(nll)] or -Z borrowck=mir -Z two-phase-borrows, both flags being independent of the edition you're using.

Edit: removed outdated behaviour of migration mode.

Re: John Carmack: writing Rust code feels wholesome

#48
post #40

I looked seriously at rust about 2 years ago. I seem to have tried the language at the wrong time .. they were transitioning between versions and this made learning it hard. I grew up with C so am very comfy with pointers. Even reference counting feels natural to me. That said, the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Has this got better? Is there a K&R…

I've been programming in C and C++ since sometime around 1992 (and Pascal before that). For the last 3 years, I've been writing Rust professionally. Here's my Rust advice for C and C++ programmers: - Rust is a higher-level language than C. A C/C++ programmer could think of Rust as "C++ without most of the footguns and magic." - Certain types of C/C++ code will translate very easily to Rust. For example, if your code…

What are you building with Rust if you don’t mind sharing? I’m curious to know what sorts of companies are using it out there in production.

Re: John Carmack: writing Rust code feels wholesome

#50
post #47

Earlier quoted context omitted.

>the borrowing/ownership semantics of rust (at the time I looked at it) felt needlessly over complicated. Taking a wild guess here, but it sounds like you maybe referring to issues addressed by Non-Lexical Lifetimes (NLL)? Reference: https://github.com/rust-lang/rfcs/blob/master/text/2094-nll.... NLL are a part of Rust 2018 Edition. Three complementary books are the best resources: - The Official book: https://doc.ru…

NLL only modes aren't available on stable Rust atm. What edition 2018 has right now is migrate mode NLL. In order to fully enjoy NLL, you'll have to use Rust nightly and do #![feature(nll)] or -Z borrowck=mir -Z two-phase-borrows , both flags being independent of the edition you're using. Edit: removed outdated behaviour of migration mode.

> What edition 2018 has right now is migrate mode NLL which emits an error if either NLL borrowck or AST borrowck think there is an issue with your code.

If that were true, then this example would fail to compile, since it fails with the old AST borrowck: https://play.rust-lang.org/?version=stable&mode=debug&editio...

See: https://rust-lang-nursery.github.io/edition-guide/rust-2018/...

Post reply on HN