Better Way to Build C

preview_player
Показать описание

References:

Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9

Chapters:
- 0:00:00 - Announcement
- 0:00:42 - Build System of Musializer
- 0:04:15 - Configuration
- 0:10:54 - Best Interview Question
- 0:11:42 - Taking Full Responsibility
- 0:13:10 - Boilerplate
- 0:15:25 - config.h approach
- 0:16:09 - Shortcomings of config.h
- 0:18:29 - Environment variables
- 0:19:38 - Better approach
- 0:21:31 - Generating config.h
- 0:25:46 - Second Stage
- 0:30:29 - Crossplatformness
- 0:32:35 - Shared config
- 0:33:05 - Is This Too Much Voodoo?
- 0:33:49 - Building C code is easy
- 0:34:31 - Two Stages, One File
- 0:38:34 - Testing the UX
- 0:39:51 - Multi-staging is a Powerful Idea
- 0:41:39 - Shortcomings of CMake
- 0:43:13 - "Modifying C is meh"
- 0:43:23 - Integrating Two Stages with Musializer
- 0:52:47 - Tea spill
- 0:53:09 - -D is crossplatform
- 0:54:52 - Microsoft being out of character
- 0:55:34 - Never Trust Twitch Chat
- 0:55:53 - Subcommands
- 0:58:41 - Removing Config structure
- 0:59:39 - Checking UX of adding parameters
- 1:02:49 - Including config.h and logging the stages
- 1:03:27 - Removing Config related code
- 1:04:31 - Build function per target
- 1:11:52 - Hotreload parameter
- 1:12:28 - Shared microphone feature parameter
- 1:15:34 - It's not about C
- 1:16:40 - ./build/ in search folder
- 1:17:18 - target names
- 1:18:52 - String literals in preprocessor
- 1:20:45 - MUSIALIZER_TARGET_NAME
- 1:22:20 - File per target
- 1:24:28 - nob_linux.c
- 1:25:51 - reset of the target files
- 1:27:20 - build_raylib()
- 1:30:42 - build_dist()
- 1:32:31 - nob subcommands
- 1:34:46 - Adjust defaults
- 1:35:32 - More compilation errors
- 1:36:14 - Sharing hotreload parameter config
- 1:37:42 - Testing hotreloading
- 1:38:20 - Testing disabled hotreloading
- 1:39:06 - Sharing microphone parameter config
- 1:40:21 - Testing microphone feature
- 1:41:03 - Summary
- 1:42:00 - Q: Why not pass config via cmd args?
- 1:43:30 - Outro
Рекомендации по теме
Комментарии
Автор

I love how Andrew Kelley (the lead of Zig) went with the same approach as you did with nob. Why have another tool (and language in case of cmake) if you already have one that can do that.

siniarskimar
Автор

"a nightly mode, for using application at night" xD 7:43



casually roasting crustaceans

lievenpetersen
Автор

Terry Davis reference in the title, I'm really looking forward to this one

Omar-fnim
Автор

"Nightly mode for using the application at night" 😂

Mozartenhimer
Автор

Indeed the hardest question in programming.

talhaakram
Автор

didn't know programming could be this exciting

ItzHapso
Автор

I learn so much from you & your videos. Thank you making me a slightly better programmer.

jaitjacob
Автор

@TsodingDaily I don't know if it was answered, but you can compare pointers to static strings in the preprocessor because static strings are stored in the hash table. If you have two similar strings, they point to the same memory address. I'm not sure if it is a part of the standard tho; it could be a compiler-specific thing. If we use another, less popular compiler that stores strings in a different way, it will have different addresses. But works for me with clang :)

Example:

const char* str1 = "hello";
const char* str2 = YOUR_STRING_IN_PREP;
#if str1 == str2
printf("Yes!\n");
#else
printf("No!");
#endif

disusdev
Автор

This dude is hilarious why am I just finding these videos?

inx
Автор

It feels bad to have so much conditional compilation. Better to have multiple different build_musializer functions like build_musializer_linux() and build_musializer_macos() and so on, then choose which to call using #if. That way the compiler could always check for errors in the build script regardless of the chosen target, and we could keep the #endif on the screen as the #if.

Ansatz
Автор

23:13 - "We will be working with sisters" monkaS

labsendeyshent
Автор

1:08:40 - out of my experience, this might be a problem. It is quite easy to leave some platforms go "stale"; or assume something just works but it explodes because the platform's compiler/libc/etc has weird compilation quirks.

ecosta
Автор

Another amazing stream with loads of ideas which will help with my own build system. I'm kicking myself for not thinking about this multi-stage bootstrap concept (eventually I fell into the "CMake" trap and now I need yet another refactoring).

ecosta
Автор

Really like where you are going with nob.

alh-xjgt
Автор

52:47 finally something I could actually recreate in my own project!

Czeckie
Автор

Only just started the video.. Musializer is one of the few projects you've done that I have learned about since discovering your channel that I have not played around with. Mainly because I don't tend to have music or anything downloaded on my PC. Now I think I'm gonna check it out and maybe rip a few mp3s off YouTube to play around with it. 😂 Very interested in the build system. I've honestly learned an absolute ton from your videos so I'm always happy to check out a Tzozin project! 😀 Maybe some day I can even contribute but you mostly write in languages I don't know well just yet lol.

iWillAvert
Автор

Deep shit. Thx for the stream. Great pleasure.

DelgardAlven
Автор

you ask the right questions when developing. sadly missing in much of the development world

kaltwarraith
Автор

Thanks for the friendly and educative content. I wonder if there is something similar on YouTube/Twitch but Java dedicated. Suggestions are apreciated!

lesechko
Автор

The Seperate platform files makes it simpler and shorter but more likely the code drifts

berndeckenfels