Оцените прошедший день
Anonymous Poll
15%
+2 (прекрасно)
27%
+1
33%
0 (нейтрально)
14%
-1
11%
-2 (ужасно)
Forwarded from мне не нравится реальность
Это видео — отрезок из аниме Love Live! School Idol Project, где героиня по имени Nico Yazawa говорит свою коронную фразу "Nico-Nico-Niii". Но поверх её лица наклеена фотография Niko Matsakis — одного из участников compiler team и language team раста.
Forwarded from мне не нравится реальность
A brutally effective hash function in Rust
Маленькая статья о том, какая hash функция используется в rustc для hash таблиц и почему.
Маленькая статья о том, какая hash функция используется в rustc для hash таблиц и почему.
Nicholas Nethercote
A brutally effective hash function in Rust
Update (Dec 10, 2021): I have added some extra information worth reading at the bottom of this post.
#music
Немного чиптюна. И послушайте другие работы автора.
youtube.com/watch?v=bww-iwae23g
youtube.com/watch?v=YKXkFzqjbFA
Немного чиптюна. И послушайте другие работы автора.
youtube.com/watch?v=bww-iwae23g
youtube.com/watch?v=YKXkFzqjbFA
YouTube
Chiptune: Bytenommer – A New Start
This is a bit more laid back than what I have been doing previously. It is a tune for an imaginary game, where it would play when you unlock a new world and get to explore. I added some light swing feel to make it groove better. I like it. #chiptune #8bit…
#prog #rust #amazingopensource
diffstatic — инструмент для определения разницы между исходниками, который понимает синтаксис и потому отображает более адекватный дифф (см. пример).
(thanks @rustawesome)
diffstatic — инструмент для определения разницы между исходниками, который понимает синтаксис и потому отображает более адекватный дифф (см. пример).
(thanks @rustawesome)
С учётом современных реалий фразу "она краше" стоит понимать, как "у неё выше потенциал стать чьим-то крашем".
Forwarded from мне не нравится реальность
Хоть const дженерики в расте уже некоторое время можно использовать на стейбле, они достаточно сильно ограниченны в возможностях. По сути стабилизировали пока только MVP —
lcnr написал wrap-up на тему того, что произошло с const дженериками за год. TL;DR:
— ✨ стабилизация
— всё сложно,
— возможно в следующем году будет
feature(min_const_generics)
.lcnr написал wrap-up на тему того, что произошло с const дженериками за год. TL;DR:
— ✨ стабилизация
feature(const_generics_defaults)
✨— всё сложно,
feature(generic_const_exprs)
забагованная— возможно в следующем году будет
feature(min_generic_const_exprs)
GitHub
Tracking issue for const generics (RFC 2000) · Issue #44580 · rust-lang/rust
Tracking issue for rust-lang/rfcs#2000 Updates: 2 May 2019: #44580 (comment) 19 Oct 2019: #44580 (comment) 2 Jan 2020: #44580 (comment) 22 Jul 2020: #44580 (comment) 17 Nov 2020: #44580 (comment) 1...
#prog #rust #article
A Lightweight Formalism for Reference Lifetimes and Borrowing in Rust
Rust is a relatively new programming language which has gained significant traction since its v1.0 release in 2015. Rust aims to be a systems language that competes with C/C++. A claimed advantage of Rust is a strong focus on memory safety without garbage collection. This is primarily achieved through two concepts, namely reference lifetimes and borrowing. Both of these are well known ideas stemming from the literature on region-based memory management and linearity / uniqueness. Rust brings both of these ideas together to form a coherent programming model. Furthermore, Rust has a strong focus on stack-allocated data and, like C/C++ but unlike Java, permits references to local variables.
Type checking in Rust can be viewed as a two-phase process: firstly, a traditional type checker operates in a flow-insensitive fashion; secondly, a borrow checker enforces an ownership invariant using a flow-sensitive analysis. In this paper, we present a lightweight formalism which captures these two phases using a flow-sensitive type system that enforces “type and borrow safety”. In particular, programs which are type and borrow safe will not attempt to dereference dangling pointers. Our calculus core captures many aspects of Rust, including copy- and move-semantics, mutable borrowing, reborrowing, partial moves, and lifetimes. In particular, it remains sufficiently lightweight to be easily digested and understood and, we argue, still captures the salient aspects of reference lifetimes and borrowing. Furthermore, extensions to the core can easily add more complex features (e.g. control-flow, tuples, method invocation, etc). We provide a soundness proof to verify our key claims of the calculus. We also provide a reference implementation in Java with which we have model checked our calculus using over 500 billion input programs. We have also fuzz tested the Rust compiler using our calculus against 2 billion programs and, to date, found one confirmed compiler bug and several other possible issues.
Рекомендую обратить внимание на секцию "Related work", там много интересного
A Lightweight Formalism for Reference Lifetimes and Borrowing in Rust
Rust is a relatively new programming language which has gained significant traction since its v1.0 release in 2015. Rust aims to be a systems language that competes with C/C++. A claimed advantage of Rust is a strong focus on memory safety without garbage collection. This is primarily achieved through two concepts, namely reference lifetimes and borrowing. Both of these are well known ideas stemming from the literature on region-based memory management and linearity / uniqueness. Rust brings both of these ideas together to form a coherent programming model. Furthermore, Rust has a strong focus on stack-allocated data and, like C/C++ but unlike Java, permits references to local variables.
Type checking in Rust can be viewed as a two-phase process: firstly, a traditional type checker operates in a flow-insensitive fashion; secondly, a borrow checker enforces an ownership invariant using a flow-sensitive analysis. In this paper, we present a lightweight formalism which captures these two phases using a flow-sensitive type system that enforces “type and borrow safety”. In particular, programs which are type and borrow safe will not attempt to dereference dangling pointers. Our calculus core captures many aspects of Rust, including copy- and move-semantics, mutable borrowing, reborrowing, partial moves, and lifetimes. In particular, it remains sufficiently lightweight to be easily digested and understood and, we argue, still captures the salient aspects of reference lifetimes and borrowing. Furthermore, extensions to the core can easily add more complex features (e.g. control-flow, tuples, method invocation, etc). We provide a soundness proof to verify our key claims of the calculus. We also provide a reference implementation in Java with which we have model checked our calculus using over 500 billion input programs. We have also fuzz tested the Rust compiler using our calculus against 2 billion programs and, to date, found one confirmed compiler bug and several other possible issues.
Рекомендую обратить внимание на секцию "Related work", там много интересного
#prog #rust #article
Fuzzing the Rust Typechecker Using CLP
И сразу существенная ложка дёгтя: статья из 2015 года, а потому разбирается с Rust 1.0-alpha. Тем не менее, читать интересно из-за общего похода.
Language fuzzing is a bug-finding technique for testing compilers and interpreters; its effectiveness depends upon the ability to automatically generate valid programs in the language under test. Despite the proven success of language fuzzing, there is a severe lack of tool support for fuzzing statically-typed languages with advanced type systems because existing fuzzing techniques cannot effectively and automatically generate well-typed programs that use sophisticated types. In this work we describe how to automatically generate well-typed programs that use sophisticated type systems by phrasing the problem of well-typed program generation in terms of Constraint Logic Programming (CLP). In addition, we describe how to specifically target the typechecker implementation for testing, unlike all existing work which ignores the typechecker. We focus on typechecker precision bugs, soundness bugs, and consistency bugs. We apply our techniques to Rust, a complex, industrial-strength language with a sophisticated type system.
Fuzzing the Rust Typechecker Using CLP
И сразу существенная ложка дёгтя: статья из 2015 года, а потому разбирается с Rust 1.0-alpha. Тем не менее, читать интересно из-за общего похода.
Language fuzzing is a bug-finding technique for testing compilers and interpreters; its effectiveness depends upon the ability to automatically generate valid programs in the language under test. Despite the proven success of language fuzzing, there is a severe lack of tool support for fuzzing statically-typed languages with advanced type systems because existing fuzzing techniques cannot effectively and automatically generate well-typed programs that use sophisticated types. In this work we describe how to automatically generate well-typed programs that use sophisticated type systems by phrasing the problem of well-typed program generation in terms of Constraint Logic Programming (CLP). In addition, we describe how to specifically target the typechecker implementation for testing, unlike all existing work which ignores the typechecker. We focus on typechecker precision bugs, soundness bugs, and consistency bugs. We apply our techniques to Rust, a complex, industrial-strength language with a sophisticated type system.
Самая большая ложь, которую нам внушает мир — это то, что взрослые существуют.
Их нет, есть только выросшие дети.
Их нет, есть только выросшие дети.
❤2