S

sunfishcode

blog.sunfishcode.online · Personal blog · on HN since 2021

Dan Gohman, who works on WebAssembly, WASI and Rust systems libraries, writes about capability-based APIs and low-level correctness.

What HN saysHN commenters link it as a source for bugs in hello world, WASI Preview 2 context, and ideas for evolving the WASI filesystem beyond preopens.
32HN people shared it
6linked it in comments
39stories submitted
1.3Kstory points
1 year agolast shared
2021people per year2026

Most-shared posts

  1. 1
    Bugs in Hello World
    5 people · 529 points · first shared 2022 · 252 comments on HN
  2. 2
    Errors from `Close`
    4 people · 58 points · first shared 2024 · 21 comments on HN
  3. 3
  4. 4
    WASI Preview 2 Launched
    3 people · 25 points · first shared 2024 · 1 comments on HN
  5. 5
    Guarding Against Broken Encapsulation
    3 people · 12 points · first shared 2021 · 1 comments on HN
  6. 6
    WASI API: Capabilities and Filesystems
    3 people · 9 points · first shared 2024 · 1 comments on HN
  7. 7
    Rust programs written entirely in Rust
    2 people · 167 points · first shared 2021 · 56 comments on HN
  8. 8
    No Ghosts
    2 people · 9 points · first shared 2022 · discussion on HN
  9. 9
    Embrace the Kinda: WebAssembly Is a Kinda
    2 people · 3 points · first shared 2023 · discussion on HN
  10. 10
  11. 11
    Eyra Does the Impossible
    2 people · 2 points · first shared 2023 · 1 comments on HN
  12. 12
    Porting Rust's Std to Rustix
    1 people · 224 points · first shared 2022 · 51 comments on HN
  13. 13
    Writing into Uninitialized Buffers in Rust
    1 people · 129 points · first shared 2025 · 119 comments on HN
  14. 14
    First-Class I/O
    1 people · 81 points · first shared 2021 · 15 comments on HN
  15. 15
    WASI 0.2 Launched
    1 people · 3 points · first shared 2024 · discussion on HN

What HN people wrote when they linked it

kibwen · 2023-11-20
Eyra is a new implementation of libc in Rust that addresses this in its default configuration: "Eyra solves this by having setenv etc. just leak the old memory. That ensures that it stays valid for as long as any thread needs it. Granted, leaking isn't great, and Eyra makes it configurable with the threadsafe-setenv cargo feature, so it can be disabled in favor of the thread-unsafe implementation. " https://blog.sunfishcode.online/eyra-does-the-impossible/
ketzu · 2022-03-09
I am not sure either follows. But it depends how we even define "older languages", especially considering differences between python 3 and 2, are they the same age (based on the original python release) or are they treated for their respective release version? Just taking some simple release dates [1] or wikipedia I found: Ages of "Yes" group: 49, 36, 22, 26, 26, 12, 31 Ages of "No" group: 11, 14, 33, 7, 32, 45, 26, 34, 21 Averages: Yes 28.85, No 24.78 With the ambiguity around what "age" even means for the language here (e.g., counting the age of node.js or python) it is probably meaningless, but it seems well mixed independent of age. [1] https://blog.sunfishcode.online/bugs-in-hello-world/
fouronnes3 · 2025-02-24
Depending on the language, this simple code actually has a bug: https://blog.sunfishcode.online/bugs-in-hello-world/
ricochetcode · 2024-12-15
I'd like to see wasi:filesystem evolve beyond preopens (which would avoid "ghosts" like this) as described in this blog: https://blog.sunfishcode.online/capabilities-and-filesystems/
andoband · 2024-01-26
Another good write-up which gives more context to this release, and it touches on POSIX in relation to the component model. https://blog.sunfishcode.online/wasi-preview2/
ddulaney · 2023-02-23
> reading from stdin isn’t challenging, nor writing to stdout. Unless you're Kernighan and Ritchie, who semi-famously wrote a buggy hello world program and used it to educate a generation of C programmers: https://blog.sunfishcode.online/bugs-in-hello-world/ Obviously an exaggeration, but when's the last time you checked the return value of printf? I know I don't. And that's not even a memory safety bug, just basic logic. I hope nobody trusts those guys around malloc and free :)

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close