Rust News # 2 (October 2018)
Better with a delay of a week than never, so I bring to your attention a subjective selection of rusty news for October.
In this selection: Rust 1.30, Rust 2018, RustRush conference, Amethyst 0.9, crates.io squatting, garbage collector, 2D graphics disputes, Non-lexical lifetimes, functional GUI.
Rust 1.30 and Rust2018 testing
Rust 1.30 came out ( discussion ). The main innovations are partial stabilization of procedural macros, import of macros through a regular one use
, improvement of the system of modules, raw identifiers, and no_std
application support (for more information, see the habro translation ).
Rust 1.31 will be the first release of the edition (edition) of "Rust2018" ( what is the "edition"? ), In connection with which everyone is invited to join beta testing of version 1.31 and cargo fix .
RustRush 2018 : Conference December 15-16 in Moscow
RustRush 2018 is a Rust developer conference dedicated to web, blockchain, high performance and system programming.
The site has been updated ( rustrush.ru ) - an almost complete list of speakers and a program has been published , the sale of the main lot of tickets has begun .
There will be four members of the project Rust Language: Steve Klabnik, Ashley Williams, Pascal Herliffe, Katharina Fey. From other local and not very famous stars - Maksim Lapshin with IP camera firmware, Kostya Stepanov and Pierre Krieger aka tomaka. The program .
If someone wants to submit a report, Call for Papers is open until November 19 .
WebAssembly
Programming WebAssembly with Rust - The Book ( discussion ) - a book on WASM / Rust is planned;
WebAssembly's post-MVP future: A cartoon skill tree ( habro-translation: "The future of WebAssembly as a“ skill tree ” ) - where and how WASM will continue to develop and what role in its ecosystem will play languages like Rust;
Ruukh ( code , discussion ) - experimental front-end web framework (uses unstable features), inspired by VueJS and ReactJS;
Draco ( discussion ) - a library for building client applications, inspired by Redux and Elm ;
Twiggy 0.3.0 ( code ) - among other updates, a profiler
.wasm
file size guide has appeared ;For parcel (a young and fast build system for JS projects, which is friendly with the growth and does not require customization) , a plugin is released that integrates it with the wasm_bindgen package : parcel-plugin-wasm.rs .
Here is a template that demonstrates how the plugin works: rustwasm / rust-parcel-template .
Thanks mvlabat for the news.
Smithy progress update: how I decreased WebAssembly bundle size by 90% - the name is a little misleading, because about weight reduction there, in essence, only a small piece in the spirit of "twirled the LLVM settings and used wasm-opt", but the article can find other useful stuff.
Here, at the same time, the head of the book wasm about reducing the size of artifacts .
Calls between JavaScript and WebAssembly are finally fast ( discussion ) - there is no Rust in the article itself, but for the Rust / WASM ecosystem the event is still very important;
Multithreading Rust and Wasm ( discussion ) - a detailed analysis of the multithreading situation in Rust and the ray tracing demo :
Embedded
rust-industrial-io - using libiio , provides access to industrial sensors and actuators;
The development of cortex-r-rt - a runtime package for Cortex-R processors has begun;
keypad - driver for keyboard matrix circuits;
Bluetooth Low Energy with Rust ( discussion );
With stabilization
#[panic_handler]
at 1.30, it became possible to develop Cortex-M applications that work without an OS using a stable compiler.shared-bus ( code ) - allows you to safely share peripherals between devices using mutexes;
Embedded WG (working group) is growing: already 27 developers in 11 teams;
Rusty igrostroy
The cgmath library of linear algebra is slowly dying in favor of nalgebra ;
The new version of the game engine Amethyst 0.9 ( discussion ) has been released:
- Added a
SpriteRender
component that simplifies the creation of 2D games and adds support for batching; - Now you can easily download spritesheet (spritesheet) from RON files;
- randomPoison / amethyst-editor is an experimental editor / visualizer / debugger based on Electron. To work requires the integration of the package amethyst-editor-sync in the code of your project with a description of the component.
Also, we are working on:
- improving the resource preparation process (assets pipelone) ;
- new network subsystem ;
- new rendering subsystem ;
- improved integration of the nphysics physics engine with ECS .
- Added a
New notes on the development of the RoboInstruct puzzle :
- Concept Art Revealed - is redrawing sprites;
- Early Game Discoveries - message system for the filing of the game plot;
- Introduce Yourself - basic education;
- Big Changes For The Early Game - new alpha version with new levels;
The Entry Component System ( discussion ) is a new fast ECS, faster specs due to putting data in SoA, not AoS . Gifka demo . The author warns that the project is still raw and for serious undertakings it is better to use specs for now;
Gfx-hal Tutorial part 2: Vertex buffers - the second lesson on working with gfx-hal ;
The last couple of months in rustsim # 1 - what happened in the last couple of months with nphysics , ncollide , nalgebra and alga ;
GLSL quasiquoting in Rust! ( discussion ) - quasi-coding of the shader code allows using GLSL directly from the Rust code with rustc checks at the build stage (the current version is very raw and only checks the formatting, but future versions should learn how to make more useful semantic checks);
Encrusted ( discussion ) - WASM interpreter Zork-like textual adventures;
Events in Entity Component Systems ( discussion ) - approaches to the organization of an ECS-based event system with special greetings
specs
;
Squatting on crates.io
The controversy over whether crates.io should start supporting namespaces / organizations, almost without stopping, comes from the very advent of cargo. Just throw here a list of several in recent years:
- https://users.rust-lang.org/t/should-people-be-allowed-to-reserve-crate-names/8360
- https://www.reddit.com/r/rust/comments/6u52po/name_squating_on_cratesio
- https://www.reddit.com/r/rust/comments/86yr2x/python_pep_regarding_package_names_abandoned
- https://www.reddit.com/r/rust/comments/9aaanw/cargo_crate_name_reservation_spam
- https://www.reddit.com/r/rust/comments/9dole9/proposal_crate_squatting_on_cratesio
- https://internals.rust-lang.org/t/crates-io-squatting/8031 is a hot topic at the moment;
The question is difficult, I don’t see the end. Someone freaked out a couple of weeks ago and decided to either punch or spam the repository:
Users of the service had access problems for several hours. As a result, nothing much has changed: they introduced several additional rules against outright spam, discussions resumed with a vengeance, creating several more Pre-RFCs in the process. Let's see where it all comes in the end.
Shifgrethor GC
withoutboats , in the process of researching what a new, not yet stabilized Pin API is capable of , wrote an experimental garbage collection library - Shifgrethor - and published a series of articles on how and why it works:
- Shifgrethor I: Garbage collection as a Rust library ( discussion ) - project overview;
- II of Shifgrethor: the Notes on tracing garbage collectors ( discussion ) - an educational program on how to work at all tracer garbage collectors ;
- Shifgrethor III: Rooting ( discussion ) - a review of approaches to "rooting" (rooting) and features of local implementation;
- Shifgrethor IV: Tracing ( discussion ) - how the trace itself works;
This is not the first attempt to implement a rusty GC library (there used to be @
pointers for this purpose in the language ), but it differs from previous attempts by using a new mechanism Pin
.
Since the library depends on the Pin API, it cannot work on stable Rust yet. The boatman reiterates several times that the project is still purely research and he is not even sure where it will make sense to use this library - most likely for integration with GC of other languages or implementation of complex data structures.
A series of notes on 2D graphics
- A crate I want: 2d graphics ( discussion );
- Up on the Following 2d graphics in discussion Rust ( discussion );
- 2d graphics in Rust discussion - A look at GPU memory management ( discussion );
Why take and create a universal library for 2D graphics for all occasions will not work? Very entertaining, I recommend to look through the articles themselves and comments to them.
Notes on Non-lexical lifetimes (NLL)
Niko posted a few notes about how NLL ( what is this? ) Will be immediately integrated into the next edition of Rust (so far it must be explicitly enabled through feature(nll)
), its implementation and problems to be solved in future iterations of the borrowing analyzer (borrowck) :
- MIR-based borrowck is almost here ( discussion );
- After NLL: Interprocedural conflicts ( discussion );
For those who want to dig a little deeper, there is also a URLO theme .
Azul
Even from comments to the past of the monthly it is clear that the GUI is a sore spot of Rust. Another attempt to plug this hole in the ecosystem: Azul is an IMGUI functional state-caching library that uses WebRender for rendering ( discussion ).
For details, see the project website: azul.rs .
One line
- The next update of Intellij-rust IDE brings, among other things, the analysis of moving semantics and new “quick fixes” ( gif demo );
- The jemalloc memory allocator has been removed from the standard library in favor of the "system" allocator . The attribute has recently been stabilized
#[global_allocator]
, so those who wish to return the old allocator can hook up the jemallocator package ; - TravisCI rolled out support for Windows builds; Rust is in the top three supported languages ;
- Writing an OS in Rust: Hardware Interrupts ( discussion ) - a great article about work with interruptions for lovers of low-level;
- Should you learn how to “computer works”? ( discussion in / r / programming ) - Klabnik tries to fight stereotypes;
- Oxidizing Python: Speeding up URL quoting by 10x using Rust ( discussion ) - a practical example of accelerating python code by rewriting a computationally heavy part into Rust;
- My release checklist for Rust programs ( discussion ) - an explanatory list of things that should be checked before publishing a new version of the project;
- Towards fearless SIMD ( discussion ) - Ralph is thinking about how to improve SIMD support in Rust;
- Notes on Type Layouts and ABIs in Rust ( discussion ) - how the current version of Rust ABI + is arranged is just a little bit of random low-level interest;
- Rust, Battlecode, and Halite: a beginner's experience with AI programming contests - a report on participation in competitions in AI programming ;
- Rust has a static garbage collector ( discussion ) - Klabnik talks about automatic memory management in Rust as opposed to classic garbage collectors;
- Future directions for cbindgen (rust-ffi) ( discussion ) - plans for the further development of the generator of bindings based on cbindgen 's rusty libraries ;
- Qt applications with Cargo - how to simplify the process of assembling a rusty Qt application as much as possible;
- More Space For Cargo - @llogiq talks about how
target
directories eat disk space like they do not like; - A Case Study in Heaptrack ( discussion ) - a small report on the optimization of memory consumption - using a system allocator , heaptrack, flamegraph , etc .;
- Documentation hosting docs.rs moved under rust-lang-nursery wing . This required significant improvements to the official rustdoc, because before docs.rs had to use the patched fork of the ratchulchain;
- Problems Scaling A Large Multi-Crate Rust Project ( discussion ) - discussion of the problems of scaling up a growing “multi-rate” project (mainly about binary size);
- What cool stuff have you learned about Rust recently? - An entertaining reddit theme with all sorts of useful trifles;
New and updated packages
- reFORM ( discussion ) - high-performance framework for symbolic computing (analog FORM );
- Noria ( discussion , code ) - fast backend for web applications;
- bible.rs ( discussion , code ) - an example of a site with actix + diesel for a sudden, convenient search in the Bible;
- sugar-rs ( discussion ) - a collection of macro-sugar in the spirit
hashmap!{ 1 => 2, 2 => 3 }
; - reflow ( discussion ) - a system-level proxy switcher, uses Tokio;
- hashbrown ( discussion ) - very fast HashMap, Rust-port of google SwissTable ;
- Formality ( discussion ) - a functional language without garbage collection and with formal evidence (hello, Coq / Idris ?), Which can be compiled into Ethereum smart contracts or CUDA / OpenCL;
- hex ( discussion ) - a collection of packages for managing a music library;
- soup ( discussion ) is a library for parsing and manipulating HTML, inspired by the BeautifulSoup 's python cell . In the implementation uses html5ever ;
- pest 2.0 ( discussion , code ) - the fast parser is even faster;
- Alacritty terminal emulator can now work in Windows - picture ;
- 0.3 slotmap ( discussion , ? What is the Map the Slot ) - add arbitrary key types ( custom key types ) and SecondaryMap (allows you to efficiently store more information for the elements);
- Gotham 0.3 ( website , discussion ) is a fast and flexible web framework running on a stable Rust. Updated
tokio
,hyper
andhttp
dependencies, improved performance, appeared asynchronous distribution of static files and the ability to customize the used tokio-runtime; - libdiffuzz (a security-oriented alternative to the memory sanitizer ) was ( rewritten to Rust );
New RFCs
By RFC, it is quite convenient to observe which way the language is moving, so here are some interesting ones. In the PR header, there is a "Rendered" link, under which the RFC is available in readable form.
- RFC 2436 Formatting guidelines is another step towards the establishment of the dictatorship of the Unified Official Style of the Rust Code;
- RFC 2476 Clippy 1.0 - install what clippy functionality should be stabilized;
- RFC 2457 Allow non-ASCII identifiers — a long-suffering and srachegonic RFC that has already gone far beyond a single iteration;
- RFC 2451 Re-Rebalancing Coherence - will allow to implement
impl<T> ForeignTrait<LocalType> for ForeignType<T>
; - RFC 2581 integers the Generic - proposes to add
uint<N>
andint<N>
integer types;
And here are some more Pre-RFC discussions:
- IRLO is a topic about the need to throw Windows XP out of the list of supported platforms - it's high time;
- A new symbol mangling scheme is a new, more thoughtful scheme for decorating symbol names. One of the many steps necessary for the future stabilization of ABI;
- The idea of documenting cargo features is an awesome thing, I hope that it will soon become a full-fledged RFC;
- Teach the package "log" to structural journaling ( discussion ) to solve all alternatives / backends in one front-end;
That's all, thank you for your attention!
If I have not added any important link or event, feel free to throw in the comments. :)
KDPV taken from here , the rest of the pictures from the sites of relevant projects.