Live data from Hacker News

A 30-minute Introduction to Rust

doc.rust-lang.org

41–50 of 94 posts

Re: A 30-minute Introduction to Rust

#41
Wow, is Rust ever changing quickly. I think I read some docs a few months ago and most of this was different. It's gotten better though. All that punctuation for different pointer types was a bit too much. And this way of using mutexes as accessors that unlock automatically when they leave scope is brilliant.

I can't wait for Rust to be "done" (and get some kick-ass HTTP support).

Re: A 30-minute Introduction to Rust

#42
post #41

Wow, is Rust ever changing quickly. I think I read some docs a few months ago and most of this was different. It's gotten better though. All that punctuation for different pointer types was a bit too much. And this way of using mutexes as accessors that unlock automatically when they leave scope is brilliant. I can't wait for Rust to be "done" (and get some kick-ass HTTP support).

Thanks! We have slowly been removing the sigils. As a quick reference:

    let x = ~5;
    let y = @5;
is now

    let x = box 5;
    let y = box(Rc) 5;
(though obviously, boxing an integer is silly)

> and get some kick-ass HTTP support

http://arewewebyet.com/

Re: A 30-minute Introduction to Rust

#43
post #38

Earlier quoted context omitted.

Thanks for the details. In all honesty I am probably not a target for Rust anyway, I almost never use C++ for systems programming, but rather for (cross-platform) application development. It would seem that neither Rust nor Go serve this area and probably do not intend to do it either.

Could you expand on why? I ask because the largest test case for Rust, Servo, is a cross-platform application, and I'm always looking to improve our marketing.

As someone who has researched using Rust for a cross-platform GUI application and looked at Servo for ideas of how to do so, I think the libraries for the GUI layer are still very immature. Servo is mostly a rendering engine that draws its final product directly to a canvas, which is great for the content area of a browser window, but different than what most GUI applications need. (Definitely interested in being corrected by the far more knowledgeable Servo developers here.)

Having said that, immature libraries are to be expected at this point, and I do think Rust is very well positioned to have really good ones for this use case in the short to medium term.

Re: A 30-minute Introduction to Rust

#44

Earlier quoted context omitted.

Could you expand on why? I ask because the largest test case for Rust, Servo, is a cross-platform application, and I'm always looking to improve our marketing.

As someone who has researched using Rust for a cross-platform GUI application and looked at Servo for ideas of how to do so, I think the libraries for the GUI layer are still very immature. Servo is mostly a rendering engine that draws its final product directly to a canvas, which is great for the content area of a browser window, but different than what most GUI applications need. (Definitely interested in being cor…

> the libraries for the GUI layer are still very immature.

This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about.

One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

Re: A 30-minute Introduction to Rust

#45
post #8
post #5

I gotta say, reading this actually made me really excited about Rust. C++ without the annoying memory management but no GC-overhead sounds like a dream.

Just to temper your enthusiasm, the compiler errors can sometimes be irritating, especially when you want to do something the you are pretty sure will be safe. But on the whole if you work with it the pay-off is well worth the minor annoyances. Having the compiler always check your code for memory safety is a huge win for refactoring - C or C++ code bases get really brittle over time as developers forget what is actu…

> C or C++ code bases get really brittle over time as developers forget what is actually going on

This is very true. And one of the culprits is a lack of modules, an shortcoming that Rust avoids. A module system for C++ is grossly overdue, and I'm not holding my breath that one will be forthcoming.

Re: A 30-minute Introduction to Rust

#46

Earlier quoted context omitted.

As someone who has researched using Rust for a cross-platform GUI application and looked at Servo for ideas of how to do so, I think the libraries for the GUI layer are still very immature. Servo is mostly a rendering engine that draws its final product directly to a canvas, which is great for the content area of a browser window, but different than what most GUI applications need. (Definitely interested in being cor…

> the libraries for the GUI layer are still very immature. This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about. One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

I'm glad you mention Qt. Qt bindings are an absolute necessity before my company (which also makes cross-platform applications) could consider adopting Rust.

Re: A 30-minute Introduction to Rust

#47
post #46

Earlier quoted context omitted.

> the libraries for the GUI layer are still very immature. This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about. One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

I'm glad you mention Qt. Qt bindings are an absolute necessity before my company (which also makes cross-platform applications) could consider adopting Rust.

There are several people working on it. I'm not sure what the current state is, but I know that mapping was one of the big issues.

Re: A 30-minute Introduction to Rust

#48
post #46

Earlier quoted context omitted.

> the libraries for the GUI layer are still very immature. This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about. One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

I'm glad you mention Qt. Qt bindings are an absolute necessity before my company (which also makes cross-platform applications) could consider adopting Rust.

Bindings exist, but are not particularly usable at this point.

Re: A 30-minute Introduction to Rust

#49

Earlier quoted context omitted.

As someone who has researched using Rust for a cross-platform GUI application and looked at Servo for ideas of how to do so, I think the libraries for the GUI layer are still very immature. Servo is mostly a rendering engine that draws its final product directly to a canvas, which is great for the content area of a browser window, but different than what most GUI applications need. (Definitely interested in being cor…

> the libraries for the GUI layer are still very immature. This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about. One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

Yep, I think we are in complete agreement. My inference from looking at the language and community is that Rust absolutely intends to serve this use case.

Re: A 30-minute Introduction to Rust

#50

Earlier quoted context omitted.

As someone who has researched using Rust for a cross-platform GUI application and looked at Servo for ideas of how to do so, I think the libraries for the GUI layer are still very immature. Servo is mostly a rendering engine that draws its final product directly to a canvas, which is great for the content area of a browser window, but different than what most GUI applications need. (Definitely interested in being cor…

> the libraries for the GUI layer are still very immature. This is absolutely true, but that's a different concern than "It would seem that neither Rust nor Go serve this area and probably do not intend to do it either," which is what I'm curious about. One of the open questions with GUI toolkit stuff is that Rust does not have named parameters, but Qt, for example, uses them heavily.

I've only based my impression on a cursory look on the Rust API docs, so I might be wrong, but I did not find any references to database libraries, UI toolkits, multimedia and so on. I did not know about Servo, so I will have to look into it. Will the cross-platform components from Servo be included in the Rust standard library?

To give you some background about the kind of apps I was referring to - I am right now working on a UI-driven app that will be deployed to Android and on the desktop. I am using C++, Qt and platform code where necessary.

Post reply on HN