mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-20 08:25:13 +00:00
Page:
OS Bridge 2013 tutorial
Pages
Anticipated breaking changes during 1.0 alpha
Community User Groups, Meetups, and Events
Community libraries
Doc continuous integration
Doc how to install an unofficial nightly for Windows
Doc Emacs Support
Doc FAQ Cheatsheet
Doc building for android
Doc building for ios
Doc detailed release notes
Doc examples
Doc friends of the tree
Doc language faq
Doc lowlevel details
Doc packages, editors, and other tools
Doc releases
Doc under construction FAQ
Doc vim support
Docs project structure
Docs
Games written in Rust
Home
Howto submit a rust bug report
IRC notifications channel
Lib datetime
Lib fmt
Lib html
Lib io
Lib rand
Lib re
Library editing
Libs
Meeting API review 2014 06 23
Meeting RFC triage 2014 06 19
Mixed language link time optimization
Note Building Rust Before 0.8 on Windows Systems
Note 0.5 priorities
Note Intrinsics
Note Rust performance fixes
Note bors usage
Note buildbots
Note code review
Note compiler snapshots
Note core team
Note development policy
Note getting started developing Rust
Note git workflow
Note guide for new contributors
Note operator overloading
Note priority issue criteria
Note research
Note rustc hacking guide back end
Note rustc hacking guide front end
Note rustc hacking guide middle end
Note rustc hacking guide
Note seeing LLVM output from rust
Note style guide
Note tag label names and definitions
Note testsuite
Note wiki conventions
Notes
OS Bridge 2013 tutorial
Operating system development
Projects using Rust
Rustpkg schedule
Sigil reference
Teaching Rust
The Rusticon
Using Rust on Windows
lib template
No results
5
OS Bridge 2013 tutorial
catamorphism edited this page 2013-01-23 17:42:09 -08:00
These are Tim's notes for a proposed Rust tutorial at Open Source Bridge 2013.
Length: 1 hour, 45 minutes. 15 minutes for Q & A; plan for 90 minutes. ~ 45 slides, two minutes per slide.
Examples: Look at Servo (resource manager, display list...), https://github.com/pcwalton/fempeg , https://github.com/pcwalton/sprocketnes , ...
- What is Rust? (4 slides)
- Why another programming language?
- For systems programming, want a straightforward mapping between language semantics and machine, like what C gives you.
- For writing safe and reliable applications, don't want buffer overflows, null pointers, or other preventable vulnerabilities.
- For taking advantage of modern hardware, want usable concurrency constructs (not the focus of this talk)
- In general, want types and pattern matching, without the overhead of functional languages like Haskell and ML (but we pay the price of having to think more about memory allocation and data representations than in those languages)
- Fun with types (4 slides)
- Algebraic data types (simple example)
- Generics (ditto)
- Pattern matching
- Structs: named product types
- Field access, functional record update
- Using traits (4 slides)
- intro to traits (simple example)
- trait inheritance
- default methods
- objects / dynamic dispatch
- the difference between static and dynamic dispatch
- Could start with a program that duplicates code, and show how traits emerge when refactoring it
- Background on traits (2 slides)
- Traits vs. type classes
- Traits vs. OO classes
- bringing together OO & functional styles
- Pointers and memory in Rust (10 slides)
(example for each)
- In Java, Haskell, ... , everything (except for a few primitive types) is implicitly boxed, and you can't explicitly create/dereference pointers
- Not so in Rust: in fact, we have three kinds of pointers
- Shared (@)
- Unique (~)
- @ is garbage-collected, ~ gets freed automatically because the compiler knows its lifetime
- You can send ~ in between tasks (haven't introduced tasks yet)
- Borrowed (&)
- Interior pointers
- Returning a borrowed pointer into a structure
- The important thing is that this is all safe: no dangling pointers, no leaks. (except with unsafe code or compiler/RT bugs, handwave handwave) (24 slides so far)
- A more extended example combining traits and pointers? (4 slides)
- A more extended example exhibiting borrowed pointers? (4 slides)
- Miscellaneous fun stuff (4 slides):
- #[test]
- #[bench]
- fmt! (nod to macros in general); deriving-eq?
- (what else?)
- Concurrency (3 slides) (maybe... very simple in any case)
- example (maybe from one of the shootout benchmarks) 39 so far
- Demonstrate changing a simple program with @-boxes into something with no GC? Show stats for amount of memory allocated?
- Questions?
All Categories:
- Docs -- For users
- Notes -- For developers
- Libs -- For library authors
- Meeting minutes