HN user

qouteall

372 karma
Posts21
Comments49
View on HN
qouteall.fun 3mo ago

Lock-Free Deadlock

qouteall
2pts0
qouteall.fun 3mo ago

Deadlock, Circular Reference and Halting

qouteall
2pts0
publish.obsidian.md 6mo ago

Anything Will Work (In AI)

qouteall
2pts0
surfingcomplexity.blog 7mo ago

Lying Virtual Eyes

qouteall
1pts0
qouteall.fun 7mo ago

Higher-Level Software Design Ideas

qouteall
1pts0
docs.google.com 7mo ago

Shaping the future of AI from the history of Transformer [2024]

qouteall
1pts1
ckpinnegar.xyz 8mo ago

Thought-Terminating Cliches in Software

qouteall
1pts1
qouteall.fun 8mo ago

WebAssembly Limitations

qouteall
4pts1
qouteall.fun 9mo ago

Rust Contagious Borrow Issue

qouteall
44pts10
qouteall.fun 9mo ago

Higher-Level Design Patterns

qouteall
1pts0
qouteall.fun 9mo ago

How to avoid fighting the Rust borrow checker

qouteall
26pts9
qouteall.fun 10mo ago

How to Avoid Fighting Rust Borrow Checker

qouteall
2pts0
www.lesswrong.com 11mo ago

Concept Poisoning: Probing LLMs without probes

qouteall
3pts0
qouteall.fun 11mo ago

Traps to Developers

qouteall
256pts107
samsja.github.io 1y ago

Weight sharing is the inverse of MoE

qouteall
2pts0
www.ethansmith2000.com 1y ago

To create something new, you need to make some noise

qouteall
2pts0
nrehiew.github.io 1y ago

The State of Generative Models

qouteall
103pts6
near.blog 1y ago

Personality Basins

qouteall
166pts111
docs.google.com 1y ago

Proposal of JavaScript becoming a compiled language: JS0 and JSSugar

qouteall
6pts2
near.blog 2y ago

Personality Basins

qouteall
1pts0
ludwigabap.bearblog.dev 2y ago

Zig vs. Rust at work: the choice we made

qouteall
94pts54

With modern IDE and AI there is no need to save letters in identifier (unless too long). It should be "sizeInBytes" instead of "size". It should be "byteOffset" "elementOffset" instead of "offset".

Normally the database and message queue is decoupled from the backend service. This decoupling makes managing simpler and make cross-language things easier.

But if the type system need to cover all these components, then they start coupling again.

Coupling is not necessarily a bad thing as long as it gives good developer UX. If the database is tightly coupled with programming language, then it looks like ORM but better. And it probably can also reduce CRUD biolerplate or N+1 issue etc.

Related, there is SpacetimeDB that make backend run within database, and the backend code is highly coupled with SpacetimeDB's own API

WebAssembly standard design has considered binary size optimization. The format itself is quite compact. But porting native code to Wasm often brings many large existing libraries which contain a lot of code which makes the binary large.

The native ecosystem never payed attention to binary size optimization, but the JS ecosystem payed attention to code size in the very beginning.

I've written about limitations of WebAssembly https://qouteall.fun/qouteall-blog/2025/WebAsembly%20Limitat...

WebAssembly still doesn't provide a way to release memory back to browser (unless using Wasm GC). The linear memory can only grow.

The Wasm GC limits memory layout and doesn't yet support multi-threading.

Wasm multithreading has many limitations. Such as cannot block on main thread, cannot share function table, etc. And web worker has "impedance mismatch" between native threads.

And tooling is also immature (debugging requires print debugging)

One limitation of Rust macro is that it can only access code token, not actual type information.

When macro sees a type `X` macro can never be sure whether it's `&str` as Rust allows type alias. If `X` is not `&str` it may also be a struct that contains `&str`, still macro cannot know.

Wasm-bindgen workarounds this issue by generating "fake functions" then read and remove them in CLI:

https://wasm-bindgen.github.io/wasm-bindgen/contributing/des...

Zig comptime allows getting full type information. This is one advantage of Zig.

Thanks for reply.

So in my understanding:

- The transactions that only touch one shard is simple

- The transactions that read multiple shards but only write shard can use simple optimistic concurrency control

- The transactions that writes (and reads) multiple shards stay complex. Can be avoided by designing a smart sharding key. (hard to do if business requirement is complex)

In real-world business requirements it often need to read some data then touch other data based on previous read result.

It violates the "every transaction can only be in one shard" constraint.

For a specific business requirement it's possible to design clever sharding to make transaction fit into one shard. However new business requirements can emerge and invalidate it.

"Every transaction can only be in one shard" only works for simple business logics.

There are two kinds of slowness. One is trying hard while getting no visible result. Another is procrastination. The article refers to the first

Goodhart's law: When a measure becomes a target, it ceases to be a good measure.

AI companies have high incentive to make score go up. They may employ human to write similar-to-benchmark training data to hack benchmark (while not directly train on test).

Throwing your hard problem at work to LLM is a better metric than benchmarks.

Can you provide the source of "(eg Android definitely has sanitizers running on every commit and yet it wasn’t until they switched to Rust that exploits started disappearing)"?

AI is really great at creating superficial signals. And most people just judge things by superficial signal.

Why is Zig so cool? 9 months ago

For example , if error data contains string, if it directly point to input string it won't require allocation, but will have memory safety issue if error is passed to outer scope where input string is deallocated. Many errors copy string to make it usable in outer scope.

Why is Zig so cool? 9 months ago

I agree that building a special diagnostic system is better than just using language's builtin error system. However that takes efforts.

Library developers tend to choose the path of least resistance, which is to not pass diagnostic information.

The most convenient diagonistic system is the good old logging. Logging is easy.

Maybe logging will be the de facto solution of passing error data in Zig ecosystem, due to psychological reasons.

Why is Zig so cool? 9 months ago

If the error rarely happens then passing error data shouldn't affect performance in visible way. If the error occurs in common path then it's designed wrongly.

I agree that in special states like OOM passing error data with allocation is not ok.

Why is Zig so cool? 9 months ago

In my opinion the biggest issue of Zig is that it doesn't allow attaching data to error. The error can only be passed via side channel, which is inconvenient and ENOURAGES TOOL DEVELOPERS TO NOT PASS ERROR DATA, which greatly increase debugging difficulty.

Somethings there are 100 things that possibly go wrong. With error data you can easily know which exact thing is wrong. But with error code you just know "something is wrong, don't know which exactly".

See: https://github.com/ziglang/zig/issues/2647#issuecomment-1444...

I just spent way longer than I should have to debugging an issue of my project's build not working on Windows given that all I had to work with from the zig compiler was an error: AccessDenied and the build command that failed. When I finally gave up and switched to rewriting and then debugging things through Node the error that it returned was EBUSY and the specific path in question that Windows considered to be busy, which made the problem actually tractable ... I think the fact that even the compiler can't consistently implement this pattern points to it perhaps being too manual/tedious/unergonomic/difficult to expect the Zig ecosystem at large to do the same

Simplify: tokio::select! will discard other futures when one future progress.

The discarded futures will never be run again.

Normally when a future is discarded it's dropped. When a future holding lock is dropped, lock is released, but it's passing future borrow to select so the discarded future is not dropped while holding lock.

So it leaves a future that holds a lock that will never run again.