frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Building a Shell

https://healeycodes.com/building-a-shell
63•ingve•3h ago

Comments

zokier•1h ago
Bit of pedantry but I don't think traditional unix shell (like this) follows repl model; the shell is not usually doing printing of the result of evaluation. Instead the printing happens more as a side effect of the commands.
jermaustin1•49m ago
I remember my first shell programming I ever did was batch in windows back in the 3.11/95 days.

The first line was always to turn off echo, and I've always wondered why that was a decision for batch script. Or I'm misremembering. 30 years of separation makes it hard to remember the details.

skydhash•3m ago
It’s a shell, not the whole thing. The whole thing is the shell+kernel+programs.
lvales•1h ago
Building a shell is a great exercise, but honestly having to deal with string parsing is such a bother that it robs like 2/3 of the joy along the way. I once built a very simple one in Go [0] as a learning exercise and I stopped once I started getting frustrated with all the corner cases.

[0] https://github.com/lourencovales/codecrafters/blob/master/sh...

healeycodes•1h ago
Author here, and yeah, I agree. I skipped writing a parser altogether and just split on whitespace and `|` so that I could get to the interesting bits.

For side-projects, I have to ask myself if I'm writing a parser, or if I'm building something else; e.g. for a toy programming language, it's way more fun to start with an AST and play around, and come back to the parser if you really fall in love with it.

hristian•1h ago
The corner cases are exactly where the learning is though. Every time you hit one unquoted spaces, escaped characters, subshell expansion — you understand something deeper about how the OS actually works. The frustration is the point. Most developers never have to think about what the shell is actually doing between their keystrokes and the kernel.
Retr0id•1h ago
Fascinating that you resurrected an account from 2014 just for LLM spam, were the credentials compromised or something?
IncreasePosts•1h ago
Maybe the author had it logged into something that their claw had access to
gf000•1h ago
Not sure it tells all that much about 'how the OS works'. This is a historical abstraction that happened to look how it looks today with all its numerous warts and shortcomings.

We can easily imagine it done a better way - for all the criticism of Windows, PowerShell gives a glimpse into this hypothetical future.

jmmv•1h ago
Somebody blamed this comment on LLMs, and maybe/probably it is, but I think the first sentence is spot-on so I thought it was worth replying to.

Dealing with the corner cases ends up teaching you a lot about a language and for an ancient language like the shell, dealing with the corner cases also takes you through the thinking process of the original authors and the constraints they were subject to. I found myself in this situation while writing EndBASIC and wrote an article with the surprises I encountered, because I found the journey fascinating: https://www.endbasic.dev/2023/01/endbasic-parsing-difficulti...

mzs•1h ago
Had an assignment to build a shell in a week, how hard could it be?

  controlling terminal
  session leader
  job control
The parser was easy in comparison.
emersion•57m ago
Some time ago I've written an article about a particular aspect of shells, job control: https://emersion.fr/blog/2019/job-control/
rigorclaw•56m ago
The pipe implementation section is really clean. Working through fork/exec/dup2 by hand like this is one of those exercises that makes you appreciate how much composability Unix got right. Processes that know nothing about each other just work together because they read stdin and write stdout. I built something similar years ago and the moment pipes actually worked felt like unlocking a cheat code.
austy69•25m ago
Fun read. Wonder if you are able to edit text in the shell, or if you need to implement a gap buffer to allow it?

Kagi Small Web

https://kagi.com/smallweb/
277•trueduke•3h ago•57 comments

Kagi Translate now supports LinkedIn Speak as an output language

https://translate.kagi.com/?from=en&to=LinkedIn+speak
835•smitec•8h ago•207 comments

Reddit User Uncovers Who Is Behind Meta's $2B Lobbying for Age Verification Tech

https://www.gadgetreview.com/reddit-user-uncovers-who-is-behind-metas-2b-lobbying-for-invasive-ag...
300•doener•2h ago•96 comments

Building a Shell

https://healeycodes.com/building-a-shell
63•ingve•3h ago•14 comments

Leanstral: Open-source agent for trustworthy coding and formal proof engineering

https://mistral.ai/news/leanstral
616•Poudlardo•16h ago•133 comments

Font Smuggler – copy hidden brand fonts into Google Docs

https://brianmoore.com/fontsmuggler/
29•lanewinfield•3d ago•7 comments

The unlikely story of Teardown Multiplayer

https://blog.voxagon.se/2026/03/13/teardown-multiplayer.html
140•lairv•3d ago•27 comments

Reverse-engineering Viktor and making it Open Source

https://matijacniacki.com/blog/openviktor
55•zggf•4h ago•18 comments

What CI looks like at a 100-person team (PostHog)

https://www.mendral.com/blog/ci-at-scale
45•shad42•4d ago•16 comments

Meta’s renewed commitment to jemalloc

https://engineering.fb.com/2026/03/02/data-infrastructure/investing-in-infrastructure-metas-renew...
461•hahahacorn•18h ago•201 comments

Gummy Geometry

https://newkrok.github.io/nape-js/examples.html?open=soft-body&mode=3d&outline=0
25•memalign•3d ago•3 comments

The American Healthcare Conundrum

https://github.com/rexrodeo/american-healthcare-conundrum
395•rexroad•19h ago•361 comments

The “small web” is bigger than you might think

https://kevinboone.me/small_web_is_big.html
461•speckx•19h ago•194 comments

Grace Hopper's Revenge

https://www.thefuriousopposites.com/p/grace-hoppers-revenge
45•ashirviskas•3h ago•38 comments

Sci-Fi Short Film “There Is No Antimemetics Division” [video]

https://www.youtube.com/watch?v=3v8AsTHfAG0
140•Anon84•4d ago•34 comments

Every layer of review makes you 10x slower

https://apenwarr.ca/log/20260316
331•greyface-•9h ago•189 comments

Ryugu asteroid samples contain all DNA and RNA building blocks

https://phys.org/news/2026-03-ryugu-asteroid-samples-dna-rna.html
21•bookofjoe•1h ago•15 comments

Enabling Efficient Sparse Computations Using Linear Algebra Aware Compilers

https://www.osti.gov/biblio/3013883
3•matt_d•4d ago•0 comments

US SEC preparing to scrap quarterly reporting requirement

https://www.reuters.com/business/finance/us-sec-preparing-eliminate-quarterly-reporting-requireme...
621•djoldman•12h ago•341 comments

Pyodide: a Python distribution based on WebAssembly

https://github.com/pyodide/pyodide
112•tosh•3d ago•25 comments

Gitana 18: the new flying Ultim trimaran

https://www.boatnews.com/story/50717/gitana-18-radical-technical-choices-for-the-new-flying-ultim...
52•divbzero•4d ago•27 comments

My Journey to a reliable and enjoyable locally hosted voice assistant (2025)

https://community.home-assistant.io/t/my-journey-to-a-reliable-and-enjoyable-locally-hosted-voice...
389•Vaslo•23h ago•119 comments

Why I love FreeBSD

https://it-notes.dragas.net/2026/03/16/why-i-love-freebsd/
460•enz•1d ago•224 comments

Beyond has dropped “meat” from its name and expanded its high-protein drink line

https://plantbasednews.org/news/alternative-protein/beyond-meat-not-the-moment-rebrand/
152•rmason•16h ago•366 comments

Fatal Core Dump Game

https://www.robopenguins.com/core-dump-game/
16•pabs3•4d ago•3 comments

Show HN: Oxyde – Pydantic-native async ORM with a Rust core

https://github.com/mr-fatalyst/oxyde
126•mr_Fatalyst•3d ago•64 comments

Claude Tips for 3D Work

https://www.davesnider.com/posts/claude-3d
129•snide•3d ago•26 comments

Starlink Mini as a failover

https://www.jackpearce.co.uk/posts/starlink-failover/
278•jkpe•1d ago•206 comments

AirPods Max 2

https://www.apple.com/airpods-max/
295•ssijak•23h ago•487 comments

In space, no one can hear you kernel panic (2020)

https://increment.com/software-architecture/in-space-no-one-can-hear-you-kernel-panic/
71•p0u4a•4d ago•15 comments