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

Статья (в двух частях: первая, вторая), которая наглядно показывает слабость тайпчекера Mypy и проблемы с производительностью строк в Python. А, и ещё это статья о конструировании парсер-комбинаторов на Python, но это уже вторично.
Forwarded from Блог*
#prog #article

Продолжение темы от того же автора: Names are not type safety.
https://lexi-lambda.github.io/blog/2020/11/01/names-are-not-type-safety/
В рассуждениях автора легко провести параллели с тем, как использовать и ограничивать unsafe-код в Rust.
Forwarded from Так говорит Алиса (John Meow)
Начало цикла статей по процедурным макросам в Rust

#prog #rust #proc_macro #article
Forwarded from Блог*
#prog #rust #моё #article

Здрасьте. Сегодня поста не будет — но только потому, что я решил написать статью для Хабра. Собственно, вот она.

И напоминаю: если вам это понравилось — поддержите копеечкой автора, я вам благодарен буду: 4274 3200 5402 8520.
Forwarded from Блог*
#prog #article

Статья про паттерн для работы с IO.

"There’s a pattern that I keep recommending to teams over and over again, because it helps separate concerns around I/O; sending and receiving things over a network, interacting with AWS, saving and loading things from data stores. It’s an old idea; you’ll find it filed under “Decorator” in your Gang of Four book.

<...>

Decorators are a great compositional pattern allowing the different concerns that inevitably cluster around I/O boundaries to be neatly separated and recombined. This opportunity presents itself several times in every app we write, and does not require any fancy language, type system, or framework."
Forwarded from Блог*
#prog #rust #article

Rust's Unsafe Pointer Types Need An Overhaul

Или что не так с сырыми указателями в Rust и что с этим стоило бы сделать
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.
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 о том, как реализовывать параллельные итераторы.
Forwarded from Блог*
#prog #rust #article

The registers of Rust

Лодочник рассматривает существующие эффекты в Rust (асинхронность, итерирование, ошибочность) с точки зрения регистров (не процессорных, а в том смысле, в котором это слово используется в социолингвистике) и довольно аргументированно доказывает, что усилия по развитию асинхронности в Rust идут в не совсем нужном направлении. Даже если вы с ним не согласны, предложенный им способ рассмотрения фич языка программирования довольно полезен.

И продолжения:

Patterns & Abstractions

Const as an auto trait
Forwarded from Блог*
#prog #rust #rustasync #article

Efficient indexing with Quickwit Rust actor framework

Или немного о том, почему разработчики Quickwit решили реализовать свой акторный фреймворк. Также в тексте есть ссылка на статью Actors with Tokio, которая описывает, как создавать свои акторы, имея асинхронный рантайм, и показывает некоторые частые ошибки при подобном наивном подходе.
Forwarded from Блог*
#prog #rust #rustasync #article

Using Rustlang's Async Tokio Runtime for CPU-Bound Tasks

Да, это возможно и в этом есть смысл. Описываемый подход используется в InfluxDB, а InfluxDB используется в проде.
Forwarded from Блог*
#prog #haskell #article

GADTs

Статья, которая показывает с опорой на лемму Йонеды, что GADT чисто технически не является чем-то, увеличивающим выразительность языка, и что GADT могут быть выражены на обычных ADT (не G) при наличии в языке полиморфизма второго ранга.
Forwarded from Блог*
#prog #rust #article

Как известно, в Rust (почти) нет higher-ranked polymorphism. Тем не менее, иногда его можно эмулировать довольно простым образом.

leshow.github.io/post/cheat_rank_n
Forwarded from Блог*
#ml #article

Large Language Foobar

Суммировать всю статью до одного предложения можно цитатой из неё:

Stop treating GPT-4 as if it can understand things when it absolutely and fundamentally cannot and will not.

Разумеется, сам по себе этот призыв не особо убедителен, так что настоятельно рекомендую прочитать всю статью и ознакомиться с конкретными примерами, когда ChatGPT просто не может.

(алсо про частный случай того, что ChatGPT не могёт, я уже выкладывал статью)