Stephen Brennan

brennan.io · Personal blog · on HN since 2016

Stephen Brennan writes programming tutorials and essays on C, shells, system calls, Meson, Git, and operating systems.

What HN saysHN commenters cite his tutorial on writing a shell in C as a great, simple read. They also point to his Meson post and call his educational approach valuable.
37HN people shared it
5linked it in comments
56stories submitted
2.3Kstory points
6 months agolast shared
2016people per year2026

Most-shared posts

  1. 1
    Write a Shell in C (2015)
    11 people · 874 points · first shared 2016 · 80 comments on HN
  2. 2
    Tutorial – Write a System Call
    10 people · 276 points · first shared 2016 · 16 comments on HN
  3. 3
    Embracing Modularity with Meson
    4 people · 36 points · first shared 2020 · 5 comments on HN
  4. 4
    When it comes to Git history, less is more
    3 people · 257 points · first shared 2021 · 122 comments on HN
  5. 5
    Development of a Developer (2017)
    3 people · 8 points · first shared 2017 · discussion on HN
  6. 6
    Why You Should Hire Computer Science Majors
    3 people · 4 points · first shared 2016 · discussion on HN
  7. 7
    Linked Lists Are Still Hard
    2 people · 184 points · first shared 2017 · 133 comments on HN
  8. 8
  9. 9
    My experience being blocked by Google Safe Browsing
    2 people · 6 points · first shared 2022 · discussion on HN
  10. 10
    You Don't Learn (2016)
    2 people · 2 points · first shared 2024 · discussion on HN
  11. 11
    Implementing simple cooperative threads in C
    1 people · 304 points · first shared 2020 · 86 comments on HN
  12. 12
    Visualizing Gzip Compression with Python
    1 people · 79 points · first shared 2020 · 6 comments on HN
  13. 13
    Fare Hacking on BART
    1 people · 46 points · first shared 2016 · 51 comments on HN
  14. 14
    Space Cadet Pinball on Linux
    1 people · 34 points · first shared 2026 · 3 comments on HN
  15. 15
    The Windows 10 Installer Dystopia
    1 people · 6 points · first shared 2020 · 2 comments on HN

What HN people wrote when they linked it

woodrowbarlow · 2017-09-01
stephen brennan wrote a great article [1] on how to write a shell in C. it's a little more simply than DAS' implementation, but it's a fantastic read. [1] https://brennan.io/2015/01/16/write-a-shell-in-c/
aninteger · 2024-03-08
I've always preferred Stephen Brennan's approach mentioned here: https://brennan.io/2020/05/08/meson/ This is the approach I take with my C and C++ projects, although I've swapped meson out for CMake. I still have my CMake projects generate pkg-config files as well so that I don't force CMake on any consuming projects (just because I suffered with CMake doesn't mean you have to, although you can as well :))
warriorkitty · 2016-11-20
I decided to read ep1[0] too and I saw a picture "use all the memory". I don't know if it's funnier that I checked if you have an "alt" HTML tag or that you actually wrote the text from the picture. People with alt tags are MVPs. :) [0] - https://brennan.io/2016/10/13/kernel-dev-ep1/
vmateixeira · 2016-07-15
Hope this can help [1]. Otherwise, if you just want an API wrapped up with python [2]. [1] http://brennan.io/2015/01/16/write-a-shell-in-c/ [2] http://www.ibm.com/developerworks/aix/library/au-pythocli/
FRex · 2018-04-24
It's very educational to dig into stuff that everyone takes for granted or even try implement your own version that does similar things (at a smaller scale and with less features, performance and security of course, just for educational purposes, not to serve as a real replacement). E.g. writing your own shell sounds hard but you can do it in an hour (of course it'd be very bare compared to even ash), I once did it during a very casual C class while trying to impress the teacher. He even joked it was self hosting when he has seen the end result (as in - I didn't need other shells anymore and could use vim and gcc from my shell so I could use my shell to work on my shell). I wanted to put that into tutorial at some point but there already exists one[0] (that blog seems quite tinker-y actually, it has implementing own Linux sys call too, which is also surprisingly easy to do and I did it for a class at one point too[1]). Going knee deep into this stuff also completely dispels the magic that language and system runtimes, filesystems, file formats, linkers, shells, standard commands (e.g. ls, I had to reimplement it once as a homework) or whatever have, or even better - it's still magic to most people and you're the wizard now! It's also very accomplishing to do something so unique in an hour or two (although to me due to my C and C++ bias at some point making a pastebin clone in an hour in PHP or Python became an unique experience). Even JIT (which sounds scary due to V8,…

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