C Programming Language

!c_lang

@programming.dev
Create post
ACBS - Another C Build System

ACBS - Another C Build System

I created a little side project over the past few days, a new build system for C and C++: https://github.com/blueOkiris/acbs/

I've seen a lot of discourse over C build tools. None of them really seem solid except for (some) Makefiles (some Makefiles are atrocious; you just can't rely on people these days). Bazel, cmake - they're just not straight forward like a clean Makefile is, basically black magic, but setting up a Makefile from scratch is a skill. Many copy the same one over each time. Wouldn't it be nice if that Makefile didn't even need to be copied over?

Building C should be straight forward. Grab the C files and headers I want, set some flags, include some libraries, build, link. Instead project build systems are way way way overcomplicated! Like have you ever tried building any of Google's C projects? Nearly impossible to figure out and integrate with projects.

So I've designed a simplistic build system for C (also C++) that is basically set up to work like a normal Makefile with gcc but where you don't have to set it up each time. The only thing you are required to provide is the name of the binary (although you can override defaults for your project, and yes, not just binaries are possible but libs as well). It also includes things like delta building without needing to configure.

Now there is one thing I haven't added yet - parallel building. It should be as simple as adding separate threads when building files (right now it's a for loop). I know that's something a lot of people will care about, but it's not there yet. It's also really intended to only work with Linux rn, but it could probably pretty easily be adjusted to work with Windows.

Lay your project out like the minimal example, adjust the project layout, and get building! The project itself is actually bootstrapped and built using whatever the latest release is, so it's its own example haha.

It's dead simple and obvious to the point I would claim that if your project can't work with this, your project is wrong and grossly over-complicated in its design, and you should rework the build system. C is simple, and so should the build system you use with it!

So yeah. Check it out when y'all get a chance

Getting back into C programming for CP/M

Getting back into C programming for CP/M

Open link in next tab

Kevin Boone: Getting back into C programming for CP/M

https://kevinboone.me/cpm-c.html

%%DESC%%

Writing a game the hard way - from scratch using C.

Writing a game the hard way - from scratch using C.

Open link in next tab

https://www.youtube.com/watch?v=AFXt6qP5ATY

Writing a C Compiler | Build a Real Programming Language from Scratch | Nora Sandler | July 2024 | No Starch Press | 792 pages | ISBN-13: 9781718500426

Writing a C Compiler | Build a Real Programming Language from Scratch | Nora Sandler | July 2024 | No Starch Press | 792 pages | ISBN-13: 9781718500426

Open link in next tab

Writing a C Compiler

https://nostarch.com/writing-c-compiler

A fun, hands-on guide to writing your own compiler for a real-world programming language.

Writing a C Compiler
ISO/IEC DIS 9899: Project cancelled

ISO/IEC DIS 9899: Project cancelled

Open link in next tab

ISO/IEC DIS 9899

https://www.iso.org/standard/82075.html

Information technology — Programming languages — C

fatal error: dbus/dbus-arch-deps.h: No such file or directory

fatal error: dbus/dbus-arch-deps.h: No such file or directory

cross-posted from: https://lemmy.ml/post/17545833

im new to system programming, idk if thats the issuse. but according gcc, it can not find dbus/dbus-arch-deps.h and thats all i know. any idea about this issue?

 program
[I] tomri@artix ~ [1]> cat main.c
#include <dbus-1.0/dbus/dbus.h>

int main(void) { return 0; }
# error
[I] tomri@artix ~> gcc main.c
In file included from main.c:1:
/usr/include/dbus-1.0/dbus/dbus.h:29:10: fatal error: dbus/dbus-arch-deps.h: No such file or directory
   29 | #include <dbus/dbus-arch-deps.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[I] tomri@artix ~> ls -la /usr/include/dbus-1.0/dbus/
total 216
drwxr-xr-x 2 root root  4096 Jul  2 20:26 ./
drwxr-xr-x 3 root root  4096 Jun 15 21:36 ../
-rw-r--r-- 1 root root  2809 Jan 14 06:17 dbus-address.h
-rw-r--r-- 1 root root  3470 Jan 14 06:17 dbus-bus.h
-rw-r--r-- 1 root root 27018 Jan 14 06:17 dbus-connection.h
-rw-r--r-- 1 root root  2909 Jan 14 06:17 dbus-errors.h
-rw-r--r-- 1 root root 22076 Jun  8  2023 dbus-glib-bindings.h
-rw-r--r-- 1 root root  2575 Jun  8  2023 dbus-glib-lowlevel.h
-rw-r--r-- 1 root root 14766 Jun  8  2023 dbus-glib.h
-rw-r--r-- 1 root root  8969 Jun  8  2023 dbus-gtype-specialized.h
-rw-r--r-- 1 root root  1464 Jun  8  2023 dbus-gvalue-parse-variant.h
-rw-r--r-- 1 root root  7246 Jan 14 06:17 dbus-macros.h
-rw-r--r-- 1 root root  1961 Jan 14 06:17 dbus-memory.h
-rw-r--r-- 1 root root 15259 Jan 14 06:17 dbus-message.h
-rw-r--r-- 1 root root  1810 Jan 14 06:17 dbus-misc.h
-rw-r--r-- 1 root root  3809 Jan 14 06:17 dbus-pending-call.h
-rw-r--r-- 1 root root 23956 Jan 14 06:17 dbus-protocol.h
-rw-r--r-- 1 root root  5412 Jan 14 06:17 dbus-server.h
-rw-r--r-- 1 root root  5392 Jan 14 06:17 dbus-shared.h
-rw-r--r-- 1 root root  3047 Jan 14 06:17 dbus-signature.h
-rw-r--r-- 1 root root  2359 Jan 14 06:17 dbus-syntax.h
-rw-r--r-- 1 root root  8505 Jan 14 06:17 dbus-threads.h
-rw-r--r-- 1 root root  4143 Jan 14 06:17 dbus-types.h
-rw-r--r-- 1 root root  3961 Jan 14 06:17 dbus.h
[I] tomri@artix ~> 
# my system
[I] tomri@artix ~> uname --all
Linux artix 6.9.7-artix1-1 #1 SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 18:11:28 +0000 x86_64 GNU/Linux
research!rsc: On Duff's Device and Coroutines

research!rsc: On Duff's Device and Coroutines

Open link in next tab

research!rsc: On Duff's Device and Coroutines

https://research.swtch.com/duff

The C Standard charter (2024)

The C Standard charter (2024)

Open link in next tab

The C Standard charter

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3280.htm

Guiding document with overview of the C committee's mission and expectations

UB or not UB: How gcc and clang handle statically known undefined behaviour

UB or not UB: How gcc and clang handle statically known undefined behaviour

Open link in next tab

Lukas Diekmann

https://diekmann.uk/blog/2024-06-25-statically-known-undefined-behaviour.html

A History of C Compilers - Part 1: Performance, Portability and Freedom

A History of C Compilers - Part 1: Performance, Portability and Freedom

Open link in next tab

Freedom and Portability

https://thechipletter.substack.com/p/a-history-of-c-compilers-part-1-performance

Let's talk compilers with part one of a whistle stop tour of their history

Freedom and Portability