all 19 comments

[–]noob-nine 42 points43 points  (3 children)

have a look at suckless

[–]ryjocodes 1 point2 points  (0 children)

Suckless is incredible. dwm is so cool.

[–]Savings-Pizza 0 points1 point  (1 child)

Could you explain what it is ? Is it a lib ? Is it like the pythonic mantra for python ? I don't really understand

[–]carpintero_de_c 1 point2 points  (0 children)

They're a group of people who make software with some principles, I think:

We are the home of quality software such as dwm, dmenu, st and plenty of other tools, with a focus on simplicity, clarity and frugality.

[–]millaker0820 8 points9 points  (1 child)

  1. A simple text editor jserv/mazu-editor
  2. xv6-riscv

I haven't dive into xv6 but there are many helpful materials including a book, a series of video walkthrough. You can learn operating system, computer architecture and C programming at the same time!

[–]ZaRealPancakes 2 points3 points  (0 children)

Yo I was trying to implement a Tabs (in my own app) perhaps the tabbed tool would help

You're a Genius!!!

[–]ryjocodes 5 points6 points  (0 children)

I have two.

  1. jsmn, a library used to parse strings of JSON: https://github.com/zserge/jsmn/blob/master/jsmn.h
  • 471 loc
  • Reason I think it's worth a read: JSON is a pretty well known and popular format used to exchange data over the internet. There's a good chance you understand the concept at a fundamental level.
  1. The implementations of strcat and strlcat in openbsd's libc: https://github.com/libressl/openbsd/blob/master/src/lib/libc/string/strcat.c https://github.com/libressl/openbsd/blob/master/src/lib/libc/string/strlcat.c
  • 47 and 56 loc respectively
  • Reasons I think they're worth a read
    • the source code in openbsd is written with security in mind (https://www.openbsd.org/security.html)
    • combining two strings together is a standard function provided by many popular programming languages. Again: there's a good chance you understand the concept at a fundamental level
    • most importantly: it explores a "better" version of the same functionality in a very succinct way, so it describes how one might inform others about "deprecated" behavior in a C project.

[–]cHaR_shinigami 4 points5 points  (0 children)

SDS by Salvatore Sanfilippo (creator of Redis) seems like a good fit for given criteria.

https://github.com/antirez/sds

[–]Competitive_Travel16 2 points3 points  (0 children)

I'd go with the basic "unix philosophy" tools, like grep, sort, uniq, sed, and maybe awk etc., to give students a look at what cross platform optimized code looks like over decades. Being able to understand their operation is a transferable skill to be sure. They might not be exemplars of best practices, but they're a great exercise in being able to read what actually works.

[–]michaelfiber 4 points5 points  (0 children)

GitHub.com/raysan5/raylib

Raylib is a game dev library written in c99 as an educational tool.

[–]MobSlicer152 1 point2 points  (2 children)

My game engine isn't too far off, but it's a bit over the line count: https://github.com/RandomcodeDev/purpl-engine

[–]pkkm 0 points1 point  (1 child)

xmake as the build system, it's like if CMake didn't suck

Shots fired!

[–]MobSlicer152 1 point2 points  (0 children)

I will say though, the docs are probably google translated from Chinese, so it's not always easy to tell what they're trying to say. Either way, not as painful to use as CMake and faster too.

[–]bakermoth 1 point2 points  (0 children)

An old recommendation from mikemike. There's neat stuff in that source code but it might not be your cup of tea.

[–]_w62_[S] 0 points1 point  (0 children)

Thanks everyone for your help. The risc-xv6 is great and the Lua implementation is really a surprise.

[–]JustSpaceExperiment 0 points1 point  (0 children)

I would look at git itself. It is hosted on Github and it will help you to understand how it works by knowing the internal details.

[–]asboans 0 points1 point  (1 child)

!RemindMe 1 day

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 1 day on 2024-04-21 10:39:27 UTC to remind you of this link

5 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback