Live data from Hacker News

Ask HN: How to learn proper systems programming?

news.ycombinator.com

91–97 of 97 posts

Re: Ask HN: How to learn proper systems programming?

#91

Years ago I modified the Postgresql source code (8.xx). It's something I was terrified of doing. But once I got in there and started poking around, I realized it was just ordinary plain-vanilla C code. Not C++. Just C code. With my local copy, I started to hack pg_dump to do something special that we wanted at the time. Even after 30 years of coding, I'm not that especially good of a programmer. But I ended up gettin…

This.

I can relate to this as well. I will share couple of things just to add to this.

I have ~8YoE now. When I was at my first job, I did not have any formal CS degree, I had completed bachelors in commerce and was struggling with masters in computer applications (had year drops). My first job was in a company started by ~7-8 ex-veritas folks, all of them being hardcore system developers. I had dreams of being the same like them some day (yet to happen). ~1 year in this job and I shared my aspirations to become a system developer - I was given a task, implement persistent ram mechanism, something that will persist data in the RAM even after soft reboot, without dumping data on hard drive, using Linux kernel. "what to do" (trick/technique) was told by them, how to do it was left for me. It took me 4 days (2 weekends) to complete this. Over first weekend I learnt how to get Linux source code, add custom syscall, compile kernel etc. On second weekend I actually got to go through the code, find places to add patches, test etc.

I was also afraid before starting and my then boss had said few things like .. "because you think folks sitting in the west are something special, they are not ..", "whole thing is man made. If one man can do it, so can you". It was a matter of going through the code and understand. Do things repeatedly without giving up. Spend long hours, take notes. Once you have the context and that code is running in your head - you get what to do!

I also did the something similar few years after this. I was learning Go and wanted to do something better. I got into delve codebase (debugger for Go) and I patched it to work for cgo binaries. Its a small patch but for that I had to learn delve's architecture + what is dwarf standard and stuff. Context was pretty huge compared to what I needed to patch it. Same story though, I was little afraid thinking - omg! it's a freaking debugger, how am I going to understand all this to make changes. But in fact they are just the same constructs.

Go ahead and jump into some project you use, it helps understanding codebase faster. Read Read Read. Give yourself time to learn the codebase. You will definitely be able to contribute "properly" for that project. Don't be afraid :)

Re: Ask HN: How to learn proper systems programming?

#92

If you're interested in systems programming with rust then i can recommend "Rust in Action" by Tim McNamara [1]. You've found some pretty good resources already by the looks of it though. [1] https://www.manning.com/books/rust-in-action

Thanks for recommending my book Sam.

Author here - please feel free to ask any questions :)

Re: Ask HN: How to learn proper systems programming?

#93
I will recommend that you go through Universities course pages on courses related to Operating Systems, Systems Programming, Computer Networks & Distributed Systems. Many of them have links to programming assignments and projects, try implementing those.

Advantages:

1. Problem will be well defined for you.

2. Better to implement eventual consistency between 3 nodes, distributed file system or single user database than trying to figure a bug in a large open source codebase.

You may find following links helpful in finding some of such courses:

https://github.com/Developer-Y/cs-video-courses

https://github.com/prakhar1989/awesome-courses

Re: Ask HN: How to learn proper systems programming?

#94
post #70

Earlier quoted context omitted.

How is that not just good old “application programming”? My own definition of “system programming” is exactly “developing on top of the system” vs “developing in the comfort of a helper library” (and its limits). I consider myself a decent application programmer, but I'm not a system programmer (at least not yet ;). The OP was talking about Postgres, if you don't know how the pitfalls of write(2), or don't know how t…

Most people don't get into systems programming by writing a database completely on their own, and it's fair to say that the line between application and systems programming is fuzzy. Here are a bunch of things I would broadly consider systems programming: - Kernel and driver development - Low level library development (pretty much anything involving bit wrangling) - Platform abstraction libraries - Database developme…

I realize it's unlikely anyone will see this, but to amplify this point a little, I thought I'd poke through the Posgres source (which I'm not otherwise familiar with). By my count, mmap is only called in 4 places, in three files.

The implementation behind this file is one of them:

https://doxygen.postgresql.org/fd_8h.html

That is the actual file API that you'd use inside of Postgres. While the API there isn't going to win any beauty pageants, it's significantly more sane than raw POSIX.

For comparison, this is the interface to mmaped files within my company's internal database:

https://gist.github.com/scotchi/83609f5eb9b98ac3b4b4476ed621...

There's a grand total of 1 call to mmap in all of our source. Most of the time for writing code using mapped files here, all you'd see is the interface above.

Re: Ask HN: How to learn proper systems programming?

#95
post #12

There are two books that taught me how systems work. - One system in isolation - Operating Systems: Three Easy Pieces . Covers persistence, virtualisation and concurrency. This book is available for free at https://pages.cs.wisc.edu/~remzi/OSTEP/ - Multiple systems, and how data flows through them - Designing Data Intensive Applications . Covers the low level details of how databases persist data to disk and how mult…

[deleted]

Re: Ask HN: How to learn proper systems programming?

#96

I would also add Computer Systems: A Programmer's Perspective, 3rd Edition by Bryant and O'Hallaron and C Programming: A Modern Approach, 2nd Edition by K.N. King, to the list. I'm learning systems programming and theory at the moment as well. Both are venerable seminal works on their subjects for the self guided learner. If anyone here wants a quality PDF of either, I can make that happen, I digitize textbooks as a…

I’m interested in this. I live in a country where I can’t get the US editions without spending the equivalent of a big percentage of my monthly income. I have the international edition of CSAPP, but the booksite says it’s full of errors and even misordered pages, and the problem sets don’t match.

Re: Ask HN: How to learn proper systems programming?

#97
post #33

Back when started coding, system programming were books like these ones, https://www.atariarchives.org https://archive.org/details/pcinternsystempr0000tisc Granted they are probably too old, but the concepts of what is actually systems programming is there, you can then get hold of an Arduino or Rasperry PI like device and do your own little OS or bare metal game, https://www.cl.cam.ac.uk/projects/raspberrypi/tutoria…

Thank you for mentioning Rust in Action.
Post reply on HN