Live data from Hacker News

Brushing up on operating systems and C programming

shubhro.com

21–30 of 89 posts

Re: Brushing up on operating systems and C programming

#21

This book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi For OS development resources, this wiki is very good: http://wiki.osdev.org

The Linux Programming Interface is my favorite software book of all time. I had a problem that I think a lot of other people had, where I learned C the language pretty in depth, but didn't really know what to do with it until I read this.

Re: Brushing up on operating systems and C programming

#22

This book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi For OS development resources, this wiki is very good: http://wiki.osdev.org

And forgot to add these: https://beej.us/guide/

Beej's guides to networking and IPC are excellent.

Re: Brushing up on operating systems and C programming

#23
post #5

Can anyone recommend an intermediate to advanced C book? I feel like most C material I've been exposed to in the past lacks what a modern C project should have when it comes to best practices, code organization, build tools (should I use make for this, cmake, where does autotools fit? what about clang vs gcc?), linters (valgrind?), testing, etc. I recognize that much of this falls outside of C, but all of these tools…

I really enjoyed "Deep C Secrets" as an intermediate C book:

Expert C Programming: Deep C Secrets https://www.amazon.com/dp/0131774298/

A little dated, still lots of relevant knowledge though.

Re: Brushing up on operating systems and C programming

#24
Will recommending my own project get me hell-voted? Cixl is a straight forward 3-stage (parse/compile/eval) interpreter that is designed to be as fast as possible without compromising on simplicity, transparency and flexibility. The codebase has no external dependencies and is currently hovering around 7 kloc including tests and standard library. There are some articles explaining design decisions, but I've been mostly busy with code. The code should be perfectly readable though, and contains plenty of good ideas distilled from 32 years of daily practice.

https://github.com/basic-gongfu/cixl

https://github.com/basic-gongfu/cixl/tree/master/devlog

Re: Brushing up on operating systems and C programming

#25
post #23
post #5

Can anyone recommend an intermediate to advanced C book? I feel like most C material I've been exposed to in the past lacks what a modern C project should have when it comes to best practices, code organization, build tools (should I use make for this, cmake, where does autotools fit? what about clang vs gcc?), linters (valgrind?), testing, etc. I recognize that much of this falls outside of C, but all of these tools…

I really enjoyed "Deep C Secrets" as an intermediate C book: Expert C Programming: Deep C Secrets https://www.amazon.com/dp/0131774298/ A little dated, still lots of relevant knowledge though.

One of my all time C favorites.

Re: Brushing up on operating systems and C programming

#26

This book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi For OS development resources, this wiki is very good: http://wiki.osdev.org

> This book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi You can also look through the man pages for free. https://www.kernel.org/doc/man-pages/ Or if you are adventurous you can play around with syscalls in assembly. https://syscalls.kernelgrok.com/ Also, the examples for TLPI are available online http://man7.org/tlpi/code/online/index.html

I think of TLPI as a "getting started" introduction for each one of the Linux APIs.

But it is also valuable as a refresher since it's a bit hard to memorize the vastness of the Linux API in the long term.

Re: Brushing up on operating systems and C programming

#27
post #24

Will recommending my own project get me hell-voted? Cixl is a straight forward 3-stage (parse/compile/eval) interpreter that is designed to be as fast as possible without compromising on simplicity, transparency and flexibility. The codebase has no external dependencies and is currently hovering around 7 kloc including tests and standard library. There are some articles explaining design decisions, but I've been most…

Could make a good show hn post

Re: Brushing up on operating systems and C programming

#28
post #5

Can anyone recommend an intermediate to advanced C book? I feel like most C material I've been exposed to in the past lacks what a modern C project should have when it comes to best practices, code organization, build tools (should I use make for this, cmake, where does autotools fit? what about clang vs gcc?), linters (valgrind?), testing, etc. I recognize that much of this falls outside of C, but all of these tools…

As far as books go; K&R contains a lot of wisdom despite it's apparent simplicity; and the language hasn't really changed that much since last edition. But to answer some of your questions:

CMake is by far the most convenient build tool I've come across for C so far, the link below will give you an idea of how it looks. I find linters mostly a waste of time , but I run all my tests through valgrind before committing; I don't miss programming in C without valgrind at all; it's also an excellent profiler in combination with KCacheGrind. For testing, simple functions and bit of macro magic on top goes pretty far; C programmers tend to value simplicity, you won't find that many epic unit testing adventure frameworks out there. clang or gcc doesn't really matter, I prefer clang's error messages; and both support GNU extensions, which solve most of the boring problems with coding in C.

https://github.com/basic-gongfu/cixl/blob/master/CMakeLists....

Re: Brushing up on operating systems and C programming

#29
post #27
post #24

Will recommending my own project get me hell-voted? Cixl is a straight forward 3-stage (parse/compile/eval) interpreter that is designed to be as fast as possible without compromising on simplicity, transparency and flexibility. The codebase has no external dependencies and is currently hovering around 7 kloc including tests and standard library. There are some articles explaining design decisions, but I've been most…

Could make a good show hn post

Been there, done that :)

https://news.ycombinator.com/item?id=16081592

Re: Brushing up on operating systems and C programming

#30
post #29
post #27

Earlier quoted context omitted.

Could make a good show hn post

Been there, done that :) https://news.ycombinator.com/item?id=16081592

Yes I followed that thread with interest, as well as the earlier one on Reddit. I still have trouble following many of your statements, though.

Here, are you saying the Cixl implementation is a useful example of C programming? Or something else?

Post reply on HN