Rust intro tonight (free)

I don't know anything about General Assembly but they are hosting a "Practical Introduction to Rust" at 18:30 Thursday (today). You need to register. <https://generalassemb.ly/education/practical-introduction-to-rust/toronto/94578> It is given by a Blad Filippov of Mozilla Preparation: "Bring a laptop with a code editor installed. Bonus points for installing the Rust toolchain: https://rustup.rs/" I'm going to go. I assume that the text editor I use qualifies as a code editor.

No parking, so can't go. We should invite him to GTALUG. --William Sent from Yahoo Mail on Android On Thu, Dec 12, 2019 at 2:05 AM, D. Hugh Redelmeier via talk<talk@gtalug.org> wrote: I don't know anything about General Assembly but they are hosting a "Practical Introduction to Rust" at 18:30 Thursday (today). You need to register. <https://generalassemb.ly/education/practical-introduction-to-rust/toronto/94578> It is given by a Blad Filippov of Mozilla Preparation: "Bring a laptop with a code editor installed. Bonus points for installing the Rust toolchain: https://rustup.rs/" I'm going to go. I assume that the text editor I use qualifies as a code editor. --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

On Thu, Dec 12, 2019 at 02:05:13AM -0500, D. Hugh Redelmeier via talk wrote:
I don't know anything about General Assembly but they are hosting a "Practical Introduction to Rust" ...
It is given by a Blad Filippov of Mozilla
Preparation:
"Bring a laptop with a code editor installed. Bonus points for installing the Rust toolchain: https://rustup.rs/"
I'm going to go. I assume that the text editor I use qualifies as a code editor.
I'm interested in your thoughts on Rust if you attended the talk. I'm currently learning Rust the old fashioned hacker way (from books and other people's code :)). My biggest mistake was trying to use Rust with SDL2 to display some graphics. My head still hurts from banging it into a wall called 'lifetimes'. :) (Sorry for the topic necromancy. :)) -- Tom Low-Shang 416 857 7013

On Mon, Dec 30, 2019, 12:07 PM Tom Low-Shang via talk <talk@gtalug.org> wrote:
On Thu, Dec 12, 2019 at 02:05:13AM -0500, D. Hugh Redelmeier via talk wrote:
I don't know anything about General Assembly but they are hosting a "Practical Introduction to Rust" ...
It is given by a Blad Filippov of Mozilla
Preparation:
"Bring a laptop with a code editor installed. Bonus points for installing the Rust toolchain: https://rustup.rs/"
I'm going to go. I assume that the text editor I use qualifies as a code editor.
I'm interested in your thoughts on Rust if you attended the talk.
I'm currently learning Rust the old fashioned hacker way (from books and other people's code :)). My biggest mistake was trying to use Rust with SDL2 to display some graphics. My head still hurts from banging it into a wall called 'lifetimes'. :)
(Sorry for the topic necromancy. :))
I just saw a presentation on a somewhat C-centric approach... http://cliffle.com/p/dangerust/ Learning Rust the "Dangerous Way", starting with how to do C-like things, and then draw back towards "rustacean" ways.

On Mon, Dec 30, 2019 at 12:21:44PM -0500, Christopher Browne wrote:
I just saw a presentation on a somewhat C-centric approach...
http://cliffle.com/p/dangerust/
Learning Rust the "Dangerous Way", starting with how to do C-like things, and then draw back towards "rustacean" ways.
That's a very good intro to Rust. Thanks. -- Tom Low-Shang 416 857 7013

| From: Tom Low-Shang via talk <talk@gtalug.org> | I'm interested in your thoughts on Rust if you attended the talk. The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions. | I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :) The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful.

| From: Tom Low-Shang via talk <talk@gtalug.org>
| I'm interested in your thoughts on Rust if you attended the talk.
The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions.
| I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :)
The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful. Hugh, I've a question about how borrowing is implemented internally as it can lead to a problem, if I allow lots of memory can my program stall because of this at the end of a block. In addition due to this does borrow checking
On 12/31/19 11:57 AM, D. Hugh Redelmeier via talk wrote: limit or not implement something like freelists or caching to get better usage of the CPU cache as that's also a concern. Thanks, Nick
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Borrowing is entirely a compile-time analysis. There is no runtime impact (other than the fact that you can get away without a garbage collector - in a safe way). The Learn Rust the Dangerous way article is very good, by the way! I heartily endorse it for the C-philes among GTALUG. If you haven’t read it, one of the things that might convince you is that the leaderboard for this highly-optimized n-body simulation has Rust in the first-place https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbod... - faster than C, C++, Fortran or Ada. I’ve added it to my list of resources for Rust: https://cps506.scs.ryerson.ca/Resources/rust.html ../Dave On Dec 31, 2019, 4:22 PM -0500, Nicholas Krause via talk <talk@gtalug.org>, wrote:
| From: Tom Low-Shang via talk <talk@gtalug.org>
| I'm interested in your thoughts on Rust if you attended the talk.
The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions.
| I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :)
The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful. Hugh, I've a question about how borrowing is implemented internally as it can lead to a problem, if I allow lots of memory can my program stall because of this at the end of a block. In addition due to this does borrow checking
On 12/31/19 11:57 AM, D. Hugh Redelmeier via talk wrote: limit or not implement something like freelists or caching to get better usage of the CPU cache as that's also a concern.
Thanks, Nick
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Borrowing is entirely a compile-time analysis. There is no runtime impact (other than the fact that you can get away without a garbage collector - in a safe way).
The Learn Rust the Dangerous way article is very good, by the way! I heartily endorse it for the C-philes among GTALUG. If you haven’t read it, one of the things that might convince you is that the leaderboard for this highly-optimized n-body simulation has Rust in the first-place https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbod... - faster than C, C++, Fortran or Ada. I’ve added it to my list of resources for Rust: https://cps506.scs.ryerson.ca/Resources/rust.html Ownership makes sense its a compiler version of smart pointers. My concerns are still: What about circular references in which the owner depends on data from
On 1/1/20 11:44 AM, David Mason wrote: the child but cannot free it due to the knowledge also depending on the parent. Binary trees are a problem here. Or you must assume like garbage collectors this never occurs and this is one way to get memory leaks in a lot of garbage collectors fast. Rust seems fine for a lot of things but this one case does not seem solved at least in my knowledge or is assumed to not be a big issue and I could be wrong but from my limited research it appears not, Nick
../Dave On Dec 31, 2019, 4:22 PM -0500, Nicholas Krause via talk <talk@gtalug.org>, wrote:
| From: Tom Low-Shang via talk <talk@gtalug.org>
| I'm interested in your thoughts on Rust if you attended the talk.
The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions.
| I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :)
The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful. Hugh, I've a question about how borrowing is implemented internally as it can lead to a problem, if I allow lots of memory can my program stall because of this at the end of a block. In addition due to this does borrow checking
On 12/31/19 11:57 AM, D. Hugh Redelmeier via talk wrote: limit or not implement something like freelists or caching to get better usage of the CPU cache as that's also a concern.
Thanks, Nick
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Rust uses a reference-counting collector for allocations that go beyond what the borrow-checker can handle. You have to explicitly use the RC allocation. Reference counting, as you may know is a more predictable memory allocation technique and works well for many data structures, such as trees (binary or otherwise). It however has problems with cyclic data structures (doubly-linked lists, general graphs, etc.). Since the reference-counted allocations are explicit, it is usually not onerous for the programmer to handle the de-allocation of these data structures. Having a built-in RC collector is a big win over C/C++ - your effective alternatives. If you aren’t willing to deal with the reference counter, your closest choices to Rust are D, Nim, or (less close) Go. But if you look at the benchmark game site, you’ll see that garbage-collected languages are often a factor of 3 slower than Rust/C/C++. If that degree of performance matters to you, I think you should use Rust rather than C or C++. If it doesn’t, you have a plethora of choices, including Go, Java, C#, Haskell, Python, Lisp, or (my favoured) Smalltalk. ../Dave On Jan 1, 2020, 6:09 PM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
On 1/1/20 11:44 AM, David Mason wrote:
Borrowing is entirely a compile-time analysis. There is no runtime impact (other than the fact that you can get away without a garbage collector - in a safe way).
The Learn Rust the Dangerous way article is very good, by the way! I heartily endorse it for the C-philes among GTALUG. If you haven’t read it, one of the things that might convince you is that the leaderboard for this highly-optimized n-body simulation has Rust in the first-place https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbod... - faster than C, C++, Fortran or Ada. I’ve added it to my list of resources for Rust: https://cps506.scs.ryerson.ca/Resources/rust.html Ownership makes sense its a compiler version of smart pointers. My concerns are still: What about circular references in which the owner depends on data from the child but cannot free it due to the knowledge also depending on the parent. Binary trees are a problem here. Or you must assume like garbage collectors this never occurs and this is one way to get memory leaks in a lot of garbage collectors fast.
Rust seems fine for a lot of things but this one case does not seem solved at least in my knowledge or is assumed to not be a big issue and I could be wrong but from my limited research it appears not, Nick
../Dave On Dec 31, 2019, 4:22 PM -0500, Nicholas Krause via talk <talk@gtalug.org>, wrote:
| From: Tom Low-Shang via talk <talk@gtalug.org>
| I'm interested in your thoughts on Rust if you attended the talk.
The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions.
| I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :)
The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful. Hugh, I've a question about how borrowing is implemented internally as it can lead to a problem, if I allow lots of memory can my program stall because of this at the end of a block. In addition due to this does borrow checking
On 12/31/19 11:57 AM, D. Hugh Redelmeier via talk wrote: limit or not implement something like freelists or caching to get better usage of the CPU cache as that's also a concern.
Thanks, Nick
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Rust uses a reference-counting collector for allocations that go beyond what the borrow-checker can handle. You have to explicitly use the RC allocation. Reference counting, as you may know is a more predictable memory allocation technique and works well for many data structures, such as trees (binary or otherwise). It however has problems with cyclic data structures (doubly-linked lists, general graphs, etc.). Since the reference-counted allocations are explicit, it is usually not onerous for the programmer to handle the de-allocation of these data structures. Having a built-in RC collector is a big win over C/C++ - your effective alternatives. Thanks for letting me know. Don't know if it will be solved as that's a
On 1/2/20 9:59 AM, David Mason wrote: problem in my view. Nick
If you aren’t willing to deal with the reference counter, your closest choices to Rust are D, Nim, or (less close) Go. But if you look at the benchmark game site, you’ll see that garbage-collected languages are often a factor of 3 slower than Rust/C/C++. If that degree of performance matters to you, I think you should use Rust rather than C or C++. If it doesn’t, you have a plethora of choices, including Go, Java, C#, Haskell, Python, Lisp, or (my favoured) Smalltalk.
../Dave On Jan 1, 2020, 6:09 PM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
On 1/1/20 11:44 AM, David Mason wrote:
Borrowing is entirely a compile-time analysis. There is no runtime impact (other than the fact that you can get away without a garbage collector - in a safe way).
The Learn Rust the Dangerous way article is very good, by the way! I heartily endorse it for the C-philes among GTALUG. If you haven’t read it, one of the things that might convince you is that the leaderboard for this highly-optimized n-body simulation has Rust in the first-place https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbod... - faster than C, C++, Fortran or Ada. I’ve added it to my list of resources for Rust: https://cps506.scs.ryerson.ca/Resources/rust.html Ownership makes sense its a compiler version of smart pointers. My concerns are still: What about circular references in which the owner depends on data from the child but cannot free it due to the knowledge also depending on the parent. Binary trees are a problem here. Or you must assume like garbage collectors this never occurs and this is one way to get memory leaks in a lot of garbage
collectors fast.
Rust seems fine for a lot of things but this one case does not seem solved at least in my knowledge or is assumed to not be a big issue and I could be wrong but from my limited research it appears not, Nick
../Dave On Dec 31, 2019, 4:22 PM -0500, Nicholas Krause via talk <talk@gtalug.org>, wrote:
| From: Tom Low-Shang via talk <talk@gtalug.org>
| I'm interested in your thoughts on Rust if you attended the talk.
The talk was mostly a guided creation of a program. So I don't think that it answered any of your questions.
| I'm currently learning Rust the old fashioned hacker way (from books and | other people's code :)). My biggest mistake was trying to use Rust with | SDL2 to display some graphics. My head still hurts from banging it into | a wall called 'lifetimes'. :)
The whole idea of borrowing etc. is fundamental to Rust and how it ensures safety. Without garbage collection. If you don't like or understand this approach, Rust isn't useful. Hugh, I've a question about how borrowing is implemented internally as it can lead to a problem, if I allow lots of memory can my program stall because of this at the end of a block. In addition due to this does borrow checking
On 12/31/19 11:57 AM, D. Hugh Redelmeier via talk wrote: limit or not implement something like freelists or caching to get better usage of the CPU cache as that's also a concern.
Thanks, Nick
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
--- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

On Jan 2, 2020, 11:22 AM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
Thanks for letting me know. Don't know if it will be solved as that's a problem in my view.
I was going to say that you could implement a garbage collector in/for Rust, but first I checked if there was a crate for one, and sure enough, there is: https://github.com/Manishearth/rust-gc/ for those occasions when you really need a garbage collector. It’s in development, but looks pretty usable. ../Dave

On Jan 2, 2020, 11:22 AM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
Thanks for letting me know. Don't know if it will be solved as that's a problem in my view.
I was going to say that you could implement a garbage collector in/for Rust, but first I checked if there was a crate for one, and sure enough, there is: https://github.com/Manishearth/rust-gc/ for those occasions when you really need a garbage collector. It’s in development, but looks pretty usable.
../Dave This isn't a issue that can be solved by a garbage collector which are notoriously for having
On 1/2/20 1:57 PM, David Mason wrote: these leaks but something like a unsafe mode with something similar to weak_ptr in C++. Not sure what the unsafe Rust implementation would would do but its a outstanding issue if you assume that memory has a non circular owner, Nick

If you don’t care about safety around the allocations of your particular data type, you can certainly have “unsafe” sections of your code that are responsible for the allocation/deallocation of your data type. In the unsafe code (which can be as little as an expression or as much as a function) you can do anything. The point is that the unsafety is limited to sections of code that can be identified as unsafe and can be identified by something as crude as grep. If you haven’t yet, I encourage you to read through the http://cliffle.com/p/dangerust/ article. It’s very good, and will demonstrate that in Rust, you can be as crude as C or as safe as Haskell, or anywhere in between - with very fine granularity. ../Dave On Jan 2, 2020, 5:16 PM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
On Jan 2, 2020, 11:22 AM -0500, Nicholas Krause <xerofoify@gmail.com>, wrote:
Thanks for letting me know. Don't know if it will be solved as that's a problem in my view.
I was going to say that you could implement a garbage collector in/for Rust, but first I checked if there was a crate for one, and sure enough, there is: https://github.com/Manishearth/rust-gc/ for those occasions when you really need a garbage collector. It’s in development, but looks pretty usable.
../Dave This isn't a issue that can be solved by a garbage collector which are notoriously for having
On 1/2/20 1:57 PM, David Mason wrote: these leaks but something like a unsafe mode with something similar to weak_ptr in C++.
Not sure what the unsafe Rust implementation would would do but its a outstanding issue if you assume that memory has a non circular owner,
Nick
participants (6)
-
Christopher Browne
-
D. Hugh Redelmeier
-
David Mason
-
Nicholas Krause
-
Tom Low-Shang
-
William Park