SWE notes
385 subscribers
15 photos
1 video
284 links
Канал про разработку ПО и все что с этим связано.

В нем я делюсь как авторскими материалами из своего блога https://www.swe-notes.ru так и полезными ссылки на другие ресурсы

По вопросам сотрудничества обращаться @kuznetsovin
Download Telegram
Forwarded from Блог*
#prog #parsing #article

Obliteratingly Fast Parser Combinators (pdf)

Lexers and parsers are typically defined separately and connected by a token stream. This separate definition is important for modularity, but harmful for performance.
We show how to fuse together separately-defined lexers and parsers, drastically improving performance without compromising modularity. Our staged parser combinator library, flap, provides a standard parser combinator interface, but generates psecialized token-free code that runs several times faster than ocamlyacc on a range of benchmarks.

(thanks @clayrat)
Forwarded from Блог*
#prog #rust

Если ждать достаточно долго, то можно дождаться исполнения своего желания. В данном случае — желания разобраться с конкурентностью на низком уровне.

Небезызвестная Mara Bos опубликовала свою книгу: Rust Atomics and Locks: Low-Level Concurrency in Practice. Все главы можно прочитать бесплатно онлайн.
👍1
Forwarded from Блог*
#prog #rust #rustasync #suckassstory

Ask not what the compiler can do for you

TL;DR: из-за того, что async_trait боксит футуры и стирает типы, в асинхронном коде, использующем этот крейт, можно организовать безусловную рекурсию, и ни компилятор, ни clippy этого не отловят.
Forwarded from Блог*
#prog #go #article

Understanding Real-World Concurrency Bugs in Go (PDF)

In this paper, we perform the first systematic study on concurrency bugs in real Go programs. We studied six popular Go software including Docker, Kubernetes, and gRPC. We analyzed 171 concurrency bugs in total, with more than half of them caused by non-traditional, Go-specific problems. Apart from root causes of these bugs, we also studied their fixes, performed experiments to reproduce them, and evaluated them with two publicly-available Go bug detectors.

<...>

Our study found that message passing does not necessarily make multithreaded programs less error-prone than shared memory. In fact, message passing is the main cause of blocking bugs.

<...>

We believe that message passing offers a clean form of inter-thread communication and can be useful in passing data and signals. But they are only useful if used correctly, which requires programmers to not only understand message passing mechanisms well but also other synchronization mechanisms of Go.

Надо отметить, что результаты могут быть искажены тем, что:
а) выборка только из шести проектов (Docker, Kubernetes, etcd, CockroachDB, BoltDB, gRPC-go);
б) рассматриваются только баги, которые были исправлены.
👍1
Forwarded from Блог*
#prog #rust #rustlib

embed_it — макрос, который позволяет включить в бинарь целую директорию ресурсов и потом обращаться к вложенным директориям и файлам по именам, причём как по статическим (в виде геттеров с теми же именами, что и файлы), так и по рантаймовым. Посмотрите пример в README.