1.97K subscribers
3.95K photos
156 videos
15 files
4.1K links
Блог со звёздочкой.

Много репостов, немножко программирования.

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
#prog #article

My Thoughts on the Bun Rust Rewrite (от Andrew Kelly, создателя Zig)

TL;DR:

The main issue here had nothing to do with the language features of Zig vs Rust, and everything to do with the diverging value systems of the two projects [Bun и Zig] and the relationship breakdown that followed.


Технические замечания, впрочем, тоже есть.
🤔1🤷1
#prog #rust #zig #article

How Our Rust-to-Zig Rewrite is Going

Переписывание в данном случае — компилятора языка Roc. В статье, разумеется, указываются причины для выбора языка реализации, и они вполне здравые.
👍5
#prog #rust #article

Query cycles: A compiler murder mystery

Или как сделать баг настолько мощный, что отваливаются отладочные инструменты.
🤔4❤‍🔥3
Блог*
Polished technical products no longer indicate effort and understanding.
#prog #zig #ml #article

Собственно, именно по этой причине в Zig запретили использование LLM вообще.

Contributor Poker and Zig's AI Ban

TL;DR: Zig foundation заинтересованы в том, чтобы контрибуторы вовлекались в сообщество и набирались экспертизы, а использование LLM очень часто на практике означает отсутствие желания разбираться и оставаться с сообществом.
👍191🖕1
#article

Some thoughts on writing (от Dan Luu)

I see a lot of essays framed as writing advice which are actually thinly veiled descriptions of how someone writes that basically say "you should write how I write" <...>

<...> if you're trying to figure out what stylistic choices are right for you, you should start from your goals and what you're good at and go from there, not listen to somebody who's going to tell you to write like them. Besides being unlikely to work for you even if someone is able to describe what makes their writing tick, most advice is written by people who don't understand how their writing works.

Как это часто у Dan Luu бывает, у эссе несколько дополнений, некоторые из которых с основной темой связаны несколько косвенно.
8
Блог*
#prog #rust #article Rust threads on the GPU
#prog #rust #article

Rust SIMD on the GPU

Код на Rust, использующий core::simd, может быть использован на GPU без изменений на уровне исходников!

К сожалению, на текущий момент применимость этого подхода несколько ограничена, поскольку core::simd всё ещё закрыта за фичей portable_simd, и авторам пришлось внести изменения в компилятор для устранения оверхеда.
🔥5👍32
#prog #rust #article

Downcasting Arcs in Rust

...И о том, как можно (небезопасно) сделать это настолько дешёвым, насколько возможно
👍1🤔1
#prog #rust #article

Protecting the Rust standard library from accidental breakage

Accidental breakage can happen in any codebase. The Rust standard library isn't magically exempt from this — so it too now uses cargo-semver-checks to prevent accidental breakage. Here's why this took months of work by multiple Rustaceans, dozens of pull requests, and 15,000+ lines of code across the Rust repo, cargo-semver-checks, and its component libraries.
😁5🤔2👍1
#prog #rust #article

Replacing a Rust Enum with a 64-bit Word Made My Interpreter 17% Faster

<...> That being said, sha256_unfixed is still running 12% faster with the new value representation than with the old version, even though it's allocating a total of 3,149,052 boxed integer values in a span of about 490 ms. That seemed a bit crazy to me, but having a copying GC with a bump allocator means that we can allocate objects really fast.
👍5🫡2
#prog #rust #article

How we saved 100 terabytes of memory by optimizing 1.1.1.1’s DNS cache

Big Pineapple, the platform behind 1.1.1.1, Gateway DNS, DNS Firewall, AS112, and several other Cloudflare DNS services, stores over 250 billion DNS cache entries at any given time. At that scale, wasting a single byte per entry costs more than 250 gigabytes of memory across our fleet.

Five successive changes to how cache entries are stored in memory cut the per-entry footprint by over 50%. Across our fleet, these changes freed up roughly 100 terabytes of memory, equivalent to the amount of RAM in 130 of our Gen 13 servers. The cache also got faster. Insert throughput rose 43% and lookup latency dropped 19%, as fewer allocations and better memory locality meant we did not trade speed for space.


Большая часть изменений довольно простая.
🎉7🔥2🤔2
#prog #rust #article

How I made Rustdoc 33% faster in one week

More than any technical detail, the learnings I most want you to take away are to trust your instincts and to question assumptions. Just because a piece of code (or anything, not just code!) has been a certain way for a long time doesn’t mean that it’s optimal or even correct.
👍71
#prog #js #abnormalprogramming #article

The Depths of JavaScript: Minesweeper in 247 Bytes

b=e=>document.body.innerHTML=m(73,e||[~9,..."1172711",~9].map(j=>m[i-=j]?++e:i).map(j=>b(b[i=j]^1|e),b[i]=!m[O--,i]*~e));b(m=t=>t--?`<a onmouseup=b(b[i=${t}]^=event.which)>${t%9?"*#F"[x=b[t]??=(O-=m[t]=Math.random()<.1,1)]??~x:"<p>"}`+m(t):O,O=64)
🔥13😱1
#prog #rust #article

iddqd, or the hardest kind of unsafe Rust

I’m the main author of iddqd, a Rust library for maps (named after the Doom cheat code) where keys are borrowed from values. <...>

iddqd consists of a fair amount of unsafe code underneath. There’s been some recent concern over the amount of unsafe code in Rust rewrites, so I thought I’d write about some of the unsafe code in iddqd and how we try to tame it.
🤔3
#prog #article

Implementing FMA and finding bugs in C and Rust standard libraries

This is a story of how I tried to compute a * b + c, and found that Rust and musl libc get it subtly wrong.
🤯8👍1