Forwarded from ọzkriff
The series is based on Vlad's RustCon'21 talk (ru): https://youtu.be/AgUgUDYpAoY
YouTube
Под капотом у процедурных макросов. Владислав Бескровный, JetBrains
Это хардкорный доклад про кишки rustc и низкоуровневые особенности работы процедурных макросов.
Доклад рассчитан на продвинутых пользователей, любопытствующих о внутренностях компилятора
О чем поговорим:
1. Какое API компилятор предоставляет процедурным…
Доклад рассчитан на продвинутых пользователей, любопытствующих о внутренностях компилятора
О чем поговорим:
1. Какое API компилятор предоставляет процедурным…
Forwarded from Блог*
#prog #rust #article
How to speed up the Rust compiler in July 2022
Куча интересных усовершенствований!
How to speed up the Rust compiler in July 2022
Куча интересных усовершенствований!
Nicholas Nethercote
How to speed up the Rust compiler in July 2022
Let’s look at some of the progress on Rust compiler speed made since my last post. I will start with some important changes made by other people.
Forwarded from Блог*
#prog #rust #c #video
Unsafe Rust is not C
Или об отличиях в правилах, нарушение которых приводит в C и в Rust к UB, к чему UB может привести на практике и как эти правила выливаются в ограничения и возможности для оптимизации.
Unsafe Rust is not C
Или об отличиях в правилах, нарушение которых приводит в C и в Rust к UB, к чему UB может привести на практике и как эти правила выливаются в ограничения и возможности для оптимизации.
YouTube
Unsafe Rust is not C
Unsafe Rust is like C in some ways, but there are tricky rules that unsafe Rust has to follow that don't exist in C. C also has some tricky rules of its own. This is a talk about some of these differences, particularly when it comes to pointer aliasing. I've…
Forwarded from Блог*
#prog #math #article
Написано на удивление доходчиво.
High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations
Everyone uses math libraries (i.e., libm), which provide approximations for elementary functions. Surprisingly (or not), mainstream math libraries (i.e., Intel’s and GCC’s libm) do not produce correct results for several thousands of inputs! Developers of modern software systems are seldom aware of them, which affects the reproducibility and portability of software systems. This blog post describes our new method for synthesizing elementary functions that produces correct results for all inputs but is also significantly faster than the state of the art libraries, which have been optimized for decades.
<...>
The overall goal of our RLIBM project is to make correctly rounded elementary functions mandatory rather than a recommendation by the standards (at least for 32 bits or lower). In our RLIBM project, we have been making a case for generating polynomials that approximate the correctly rounded result of f(x) rather than the real value of f(x) because our goal is to generate correct, yet efficient implementations. By approximating the correctly rounded result, we consider both approximation errors (i.e., polynomial approximation) and rounding errors (i.e., with polynomial evaluation with finite precision representations), which enables the generation of correct results. One can use existing high-precision libraries, which are slow, to generate oracle correctly rounded results. Now our goal is to generate efficient polynomials that produce these correctly rounded results for all inputs. Given a correctly rounded result, there is an interval of real values around the correct result that the polynomial can produce, which still rounds to the correct result. This interval is the amount of freedom available that our polynomial generator has for a given input. Using this interval, our idea is to structure the problem of polynomial generation that produces correct results for all inputs as a linear programming (LP) problem. To scale to representations with a large number of inputs, we propose counterexample guided polynomial generation, generate piecewise polynomials rather than a single polynomial, and develop techniques that support various complex range reductions.
Написано на удивление доходчиво.
High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations
Everyone uses math libraries (i.e., libm), which provide approximations for elementary functions. Surprisingly (or not), mainstream math libraries (i.e., Intel’s and GCC’s libm) do not produce correct results for several thousands of inputs! Developers of modern software systems are seldom aware of them, which affects the reproducibility and portability of software systems. This blog post describes our new method for synthesizing elementary functions that produces correct results for all inputs but is also significantly faster than the state of the art libraries, which have been optimized for decades.
<...>
The overall goal of our RLIBM project is to make correctly rounded elementary functions mandatory rather than a recommendation by the standards (at least for 32 bits or lower). In our RLIBM project, we have been making a case for generating polynomials that approximate the correctly rounded result of f(x) rather than the real value of f(x) because our goal is to generate correct, yet efficient implementations. By approximating the correctly rounded result, we consider both approximation errors (i.e., polynomial approximation) and rounding errors (i.e., with polynomial evaluation with finite precision representations), which enables the generation of correct results. One can use existing high-precision libraries, which are slow, to generate oracle correctly rounded results. Now our goal is to generate efficient polynomials that produce these correctly rounded results for all inputs. Given a correctly rounded result, there is an interval of real values around the correct result that the polynomial can produce, which still rounds to the correct result. This interval is the amount of freedom available that our polynomial generator has for a given input. Using this interval, our idea is to structure the problem of polynomial generation that produces correct results for all inputs as a linear programming (LP) problem. To scale to representations with a large number of inputs, we propose counterexample guided polynomial generation, generate piecewise polynomials rather than a single polynomial, and develop techniques that support various complex range reductions.
SIGPLAN Blog
High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations
Everyone uses math libraries. Surprisingly, mainstream math libraries do not produce correct results for several thousands of inputs. Developers are seldom aware of them, which affects reproducibil…
Forwarded from 10 долларов Баффетта
🥶 Как пережить криптозиму?
На фондовом рынке существуют защитные акции: ценные бумаги, которые меньше всего реагируют на колебания рынка, внешние факторы и экономические потрясения.
Например, акции золотодобытчиков, платежных систем, коммунальных компаний, производителей в сфере питания и тд.
Они актуальны в любой стадии рынка. Люди всегда будут пользоваться коммунальными услугами, ходить в Макдональдс, покупать Coca-Cola.
🛡 Работает ли эта стратегия на крипторынке?
Нет, потому что большинство криптовалют зависят от курса Биткоина, то есть коррелируют с его ценой. Крипторынок слишком молод и тут нет криптовалют, которые ведут себя как защитные акции.
Но зато есть различные DeFi-инструменты, позволяющие зарабатывать даже на падающем рынке. Например: автофарм, стейкинг, доходное фермерство, майнинг ликвидности или депозиты на лендинг-платформах.
Все они работают по одному и тому же принципу:
• У вас есть какая-то криптовалюта, например ETH или USDT
• Вы закидываете её на платформу (как депозит) и получаете за это вознаграждение
Если вы плохо разбираетесь в DeFi, то можно начать с Binance Earn, Bybit Earn или OKX Earn. На этих биржах есть все инструменты для этого и подробные инструкции. А продвинутые пользователи могут посмотреть список DeFi-платформ на Defipulse.
DeFi-инструменты — это не единственное, что может защитить ваш портфель. Не стоит забывать о традиционных инвестициях: фондовый рынок, недвижимость и подобное.
💼 В экспериментальный портфель сегодня докупаем Ethereum.
На фондовом рынке существуют защитные акции: ценные бумаги, которые меньше всего реагируют на колебания рынка, внешние факторы и экономические потрясения.
Например, акции золотодобытчиков, платежных систем, коммунальных компаний, производителей в сфере питания и тд.
Они актуальны в любой стадии рынка. Люди всегда будут пользоваться коммунальными услугами, ходить в Макдональдс, покупать Coca-Cola.
🛡 Работает ли эта стратегия на крипторынке?
Нет, потому что большинство криптовалют зависят от курса Биткоина, то есть коррелируют с его ценой. Крипторынок слишком молод и тут нет криптовалют, которые ведут себя как защитные акции.
Но зато есть различные DeFi-инструменты, позволяющие зарабатывать даже на падающем рынке. Например: автофарм, стейкинг, доходное фермерство, майнинг ликвидности или депозиты на лендинг-платформах.
Все они работают по одному и тому же принципу:
• У вас есть какая-то криптовалюта, например ETH или USDT
• Вы закидываете её на платформу (как депозит) и получаете за это вознаграждение
Если вы плохо разбираетесь в DeFi, то можно начать с Binance Earn, Bybit Earn или OKX Earn. На этих биржах есть все инструменты для этого и подробные инструкции. А продвинутые пользователи могут посмотреть список DeFi-платформ на Defipulse.
DeFi-инструменты — это не единственное, что может защитить ваш портфель. Не стоит забывать о традиционных инвестициях: фондовый рынок, недвижимость и подобное.
💼 В экспериментальный портфель сегодня докупаем Ethereum.
Forwarded from мне не нравится реальность
Доклад про монады, почему они везде и возможно лучшие виды записи тех же концептов?
https://www.youtube.com/watch?v=nGhoZzihbHY
p.s. доклад максимально beginner friendly, так что даже если ничего не знаете про монады, всё равно посмотрите <3
https://www.youtube.com/watch?v=nGhoZzihbHY
p.s. доклад максимально beginner friendly, так что даже если ничего не знаете про монады, всё равно посмотрите <3
YouTube
Monads are everywhere... Maybe that's bad? by Till Schröder
Till discusses the use of monads as a pattern for handling effects and chaining functions, with examples from various programming languages like JavaScript, Haskell, and C#. Monads, which can be thought of as a way to overload the semicolon, provide a more…
Forwarded from Блог*
#prog #rust #article
Набор из трёх статей Niko Matsakis про дизайн параллельных итераторов в rayon. Впрочем, первая статья посвящена обзору обычных, последовательных итераторов. Если у вас есть опыт работы с Rust — первую статью можно спокойно не читать.
Parallel Iterators Part 1: Foundations
Parallel Iterators Part 2: Producers
Parallel iterators, part 3: Consumers
И ещё небольшой документ в репе rayon о том, как реализовывать параллельные итераторы.
Набор из трёх статей Niko Matsakis про дизайн параллельных итераторов в rayon. Впрочем, первая статья посвящена обзору обычных, последовательных итераторов. Если у вас есть опыт работы с Rust — первую статью можно спокойно не читать.
Parallel Iterators Part 1: Foundations
Parallel Iterators Part 2: Producers
Parallel iterators, part 3: Consumers
И ещё небольшой документ в репе rayon о том, как реализовывать параллельные итераторы.
docs.rs
rayon - Rust
Rayon is a data-parallelism library that makes it easy to convert sequential computations into parallel.