当前位置:网站首页>[rust daily] first release of mnemos on April 20, 2022

[rust daily] first release of mnemos on April 20, 2022

2022-06-10 15:06:00 MikeLoveRust

Ruby yjit use Rust Rewrite the PR Submitted

Before matz Say you prefer zig, But respecting the decisions of the community introduces Rust .

introduce Rust Of Value proposition :

  • Rust The type system will find more errors early , Helps prevent new errors
  • Easier to manage YJIT Growing complexity
  • Easier to maintain the code base , Less “footguns”
  • Easier for novices , Because the compiler catches more errors
  • Better performance , Because more complex optimizations can be achieved
  • Easier to add support for new platforms ( This adds complexity )
  • Rust Have mature and easy to install tools , For example, source code formatter and editor plug-ins
  • Rust As a programming language community , There is great enthusiasm behind it . This may translate into a response to YJIT and Ruby More enthusiasm .

YJIT The new Rust Version and C The version has reached the same level , Because it passed all CRuby test , Able to run all YJIT The benchmark , And the execution is similar to C edition ( Because it works in the same way and mostly generates the same machine code ). Some design improvements have even been added , For example, a finer grained constant failure mechanism , It's expected that this will help Ruby on Rails Applications have a significant impact .

https://github.com/ruby/ruby/pull/5826

Previous discussions https://bugs.ruby-lang.org/issues/18481

Use Rust and React Create rich text editor

stay Fiberplane, The author recently encountered an interesting challenge : Their libraries exceed those we use for rich text editors . They used to use Slate.js —— A good editor , But when implementing our own rich text primitives for collaborative editing , Find ourselves their primitives and Slate The disconnect between our data models is an obstacle to some extent . So I decided Use Rust and React Create rich text editor .

Original reading :https://fiberplane.dev/blog/creating-a-rich-text-editor-using-rust-and-react/

MnemOS First release

MnemOS v0.1.0 Version release , It's a small universal operating system , use Rust To write .MnemOS Designed for restricted hardware , Including microcontrollers .

at present ,Adafruit Feather nRF52840 Express Is the only supported kernel hardware platform . Support for other goals and architectures is planned .

Kernel code repository :https://github.com/jamesmunns/pellegrino

Details please see :https://jamesmunns.com/blog/mnemos-initial-release/

fast_fp project

fast_fp Provides a set of primitive types , Support for fast math compiler optimization for many operations . These optimizations allow the compiler to relax IEEE 754 Some of the requirements of floating-point arithmetic to potentially generate faster code .

Examples of use :

use fast_fp::{FF32, ff32};

// Construct instances of the fast type from std's type using the convenience
// wrapper `ff32` (or `ff64`)
let four = ff32(4.0);

// or using the `From`/`Into` trait
let five: FF32 = 5.0.into();

assert_eq!(four + five, ff32(9.0));

// Most ops are also implemented to work with std's floats too (including PartialEq).
// This makes working with literals easier.
assert_eq!(five + 6.0, 11.0);
assert_eq!(five * 2.0, 10.0);

// Functions can be made generic to accept std or fast types using `num-traits`
use num_traits::real::Real;
fn square<T: Real>(num: T) -> T {
    num * num
}
assert_eq!(square(3.0_f32), 9.0);
assert_eq!(square(five), 25.0);

// If the nalgebra feature (with version suffix) is enabled, interop with
// nalgebra is supported
# #[cfg(feature = "nalgebra_v029")]
use nalgebra_v029 as na;
# #[cfg(feature = "nalgebra_v029")]
assert_eq!(na::Matrix3::repeat(four).sum(), 36.0);

Project address :https://github.com/standard-ai/fast_fp


From Daily Group @Jancd

原网站

版权声明
本文为[MikeLoveRust]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101443242596.html