Programming News and Articles
8 subscribers
5 photos
3 files
241 links
Download Telegram
Forwarded from Блог*
#prog #rust #c #video

Unsafe Rust is not C

Или об отличиях в правилах, нарушение которых приводит в C и в Rust к UB, к чему UB может привести на практике и как эти правила выливаются в ограничения и возможности для оптимизации.
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.
🥶 Как пережить криптозиму?

На фондовом рынке существуют защитные акции: ценные бумаги, которые меньше всего реагируют на колебания рынка, внешние факторы и экономические потрясения.

Например, акции золотодобытчиков, платежных систем, коммунальных компаний, производителей в сфере питания и тд.

Они актуальны в любой стадии рынка. Люди всегда будут пользоваться коммунальными услугами, ходить в Макдональдс, покупать Coca-Cola.

🛡 Работает ли эта стратегия на крипторынке?

Нет, потому что большинство криптовалют зависят от курса Биткоина, то есть коррелируют с его ценой. Крипторынок слишком молод и тут нет криптовалют, которые ведут себя как защитные акции.

Но зато есть различные DeFi-инструменты, позволяющие зарабатывать даже на падающем рынке. Например: автофарм, стейкинг, доходное фермерство, майнинг ликвидности или депозиты на лендинг-платформах.

Все они работают по одному и тому же принципу:
• У вас есть какая-то криптовалюта, например ETH или USDT
• Вы закидываете её на платформу (как депозит) и получаете за это вознаграждение

Если вы плохо разбираетесь в DeFi, то можно начать с Binance Earn, Bybit Earn или OKX Earn. На этих биржах есть все инструменты для этого и подробные инструкции. А продвинутые пользователи могут посмотреть список DeFi-платформ на Defipulse.

DeFi-инструменты — это не единственное, что может защитить ваш портфель. Не стоит забывать о традиционных инвестициях: фондовый рынок, недвижимость и подобное.

💼 В экспериментальный портфель сегодня докупаем Ethereum.
Forwarded from Блог*
Однако.

SWC на Rust написан, если что.
Доклад про монады, почему они везде и возможно лучшие виды записи тех же концептов?

https://www.youtube.com/watch?v=nGhoZzihbHY

p.s. доклад максимально beginner friendly, так что даже если ничего не знаете про монады, всё равно посмотрите <3
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 о том, как реализовывать параллельные итераторы.