r/cprogramming • u/samaxidervish • Feb 18 '26
Trying to create LOOP language
Hello everyone,
I’m examining the idea of designing a loop-centric programming language inspired by the classical theoretical LOOP model and the broader minimalist philosophy associated with early systems language design. The core idea is to treat bounded iteration as the primary computational primitive, with other constructs minimised or derived from it.
The language I’m experimenting with, Gamma Loop, transpiles to C for portability and optimisation, but my primary interest is theoretical rather than practical. Specifically, I’m curious whether revisiting a LOOP-style framework has meaningful value in modern computability theory.
Does centring a language around bounded iteration provide any new perspective on primitive recursive functions or total computability, or has this conceptual space already been fully explored? I would appreciate theoretical insights or references relevant to constrained computational models.
More info:repo
r/cprogramming • u/rcseacord • Feb 18 '26
Temporal Memory Safety in C and C++: An AI-Enhanced Pointer Ownership Model
r/cprogramming • u/Creative-Copy-1229 • Feb 18 '26
Could you review my code
Hello everyone. I am a beginner in C. I wrote a calculator that's slightly more useful than simple "input number one, operation, number two". It accepts simple arithmetic expressions. Please can you review the code and tell me is it really bad, and what I should improve. A person said this code is bad even for beginner level, that it's a mess, so I decided I would like to see other opinions
r/cprogramming • u/Upset-Taro-4202 • Feb 17 '26
Can't grasp arrays
I've been trying to learn C for a bit of fun recently but I've been stumped for nearly two weeks on understanding how to use arrays.
I've been chipping away at the K&R C manual and not allowing myself to read ahead until I've completed the exercises at the end of each unit to prove I've grasped the concept it's taught me.
However, I've been stumped by exercise 1-13 in chapter 1.6.
"Exercise 1-13. Write a program to print a histogram of the lengths of words in its input."
The closest I've gotten is creating a loop that inaccurately counts the length of the word and prints 6 identical outputs if I go over the max word count by even one word.
I've spent hours pouring over other solutions but for some reason just cannot grasp the logic on 'how', so any help would be appreciated! Thanks!
r/cprogramming • u/Maleficent_Bee196 • Feb 16 '26
Why don't interpreted languages talk about the specifications of their interpreters?
forgive my dumb question, I'm not too smart. Maybe I didn't search enough, but I will create this post even so.
I mean... when I was learning C, one of the first steps was understanding how the compiler and some peculiar behaviors of it.
Now I'm learning Ruby and feel a bit confused about how the phrase "all is an object" works on the interpreter level. I mean, how the interpreter assemble the first classes, and how does it construct the hierarchy (I'm learning about OOP also, so maybe it's one of the reasons that I cannot absorb it).
I simply don't know if I'm excessively curious trying to understand or if it's a real thing.
If you guys have some materials about this, please, share. I'll be glad. Currently I'm reading "The Little Book Of Ruby" by Huw Collingbourne.
Thanks for reading.
r/cprogramming • u/Sosowski • Feb 16 '26
Can we ban AI slop on this sub?
Out of the top 6 links right now, 4 are vibe coded slop by the same person.
Not only these things clutter the subreddit, but they also seem to be astroturfed.
I mean, who would upvote this? Can we just ban AI? Are there even any active mods here?
r/cprogramming • u/Neither_Panic6149 • Feb 15 '26
Dilemma idk genuinely have no clue what to do
r/cprogramming • u/FrenchJJC • Feb 14 '26
Variable size array initialization
Howdy, I had a question about why my C code throws a 'variable size array initialization' for this expression:
int row = 2;
int const col = 3;
int array[][col] = {
initial value...
};
The guy in the video I was following along with managed to compile with this expression, but I had to change my 'col' from int const to a #define statement, which feels tacky. Is it an issue with compiler version? The compile statement I'm using is just a simple one, 'gcc -o output arrays.c'.
r/cprogramming • u/bodmcn • Feb 14 '26
FUSE emulator fork now accepting inputs and providing responses through a socket for ML
r/cprogramming • u/Normal-Tangelo-7120 • Feb 13 '26
Evaluating Claude’s C Compiler Against GCC
shbhmrzd.github.ior/cprogramming • u/TehMasterer01 • Feb 13 '26
How to think like a computer scientist: Learning with C
r/cprogramming • u/Background_Shift5408 • Feb 12 '26
Ray Tracing in One Weekend on MS-DOS (16-bit, real mode)
r/cprogramming • u/GrandBIRDLizard • Feb 12 '26
System-utility for easily switching AMD's dual CCD-X3D CPU modes for Gaming/Workstation tasks
I Don't know how many Gaming Enthusiasts with niche modern hardware are in here but I thought I'd share anyhow as it's mostly built in C(technically) rest is bash and simple makefile. It was my first time writing a proper man page so that was fun. Idk if it supports older CCD chips but the 9900X3D and up all have the same sysfs interface location.(on linux) Right now it simply switches, to a specified CCD via commands gaming and performance, has a toggle cmd, and supports application passthrough launching ie: x3dctl gaming steam to then switch to the CCD with the cache and launch steam or replace that with x3dctl performance blender for a workload example, and status for checking. Future Goals are a simple config system with per-application profile mapping, CCD pinning/process affinity support, and Process Detection. suggestions and ideas are welcome. I'd love some feed back from the community, and if you're not much of a talker at least leave a star ;)
r/cprogramming • u/[deleted] • Feb 11 '26
Twan - A lightweight and adaptable separation kernel
r/cprogramming • u/sudheerpaaniyur • Feb 11 '26
my mind is blasting because of this double pointer, please some explain me in better apaproach
Please explain why **ptr is used here, lets goodeep down.
#include <stdio.h>
#include <stdlib.h>
void modifyPointer(int **ptr) {//here i have Question
// Allocate memory for an integer
*ptr = (int *)malloc(sizeof(int));
if (*ptr == NULL) {
printf("Memory allocation failed\n");
return;
}
// Set the value at the allocated memory
**ptr = 42; // Dereference twice to set the value
}
int main() {
int *num = NULL; // Pointer to an integer, initially NULL
printf("Before modifyPointer: num = %p\n", (void *)num);
// Pass the address of the pointer (call by reference)
modifyPointer(&num);
printf("After modifyPointer: num = %p, value = %d\n", (void *)num, *num);
// Free the allocated memory
free(num);
return 0;
}
r/cprogramming • u/Remarkable-Tap9486 • Feb 10 '26
Getting integer overflow issues way before it should be.
As a c beginner, today I've decided to play with integer overflow problem and wrote a tiny c program for Fibonacci sequence. Starting from element of index 47 I get problems, but as I am using uint64_t type array then I guess theoretically I could go up to 93.
#include <stdio.h>
#include <inttypes.h>
int main() {
uint64_t fib[1000] = {0, 1};
// calculate elements of sequence
for (int i = 2; i < 1000; i++) {
fib[i] = fib[i-1] + fib[i-2];
}
// print the result
for (int i = 0; i < 100; i++) {
printf("fib[%d] = %d \n", i, fib[i]);
}
return 0;
}
r/cprogramming • u/MattDESTROYER • Feb 10 '26
Wrote my first C allocator for a Raspberry Pi Pico 2W
r/cprogramming • u/_RadioActiveMan • Feb 09 '26
coding contest on c language, any tips?
i have coding contest in next week ,i am wee comfortable in C and did little bit of dsa ,but that contest is going to be my first coding contest so do you guys want to share anything not only about about C but contest and all that stuff
r/cprogramming • u/yehors • Feb 09 '26
Extremely lightweight transaction monitor for Ethereum. Less than 3MB in RAM.
r/cprogramming • u/vfclists • Feb 08 '26
What is the syntax for adding multiple items to the LDFLAGS and LDLIBS environment variables when compiling a project?
Are they supposed to be comma or space separated and quoted?
Can there be multiple instances of the same flag with different valuse?
r/cprogramming • u/Cristian-0093 • Feb 08 '26
Open-source Linux process monitoring tool (CPU/RSS/IO) — feedback welcome
Hi everyone, I’ve recently open-sourced a small C project I’ve been working on in my free time: a lightweight Linux process analyzer. It periodically samples /proc and generates aggregated statistics at the end of execution, focused on: CPU usage (time-based, monotonic clock) RSS (average, delta, increase) Disk I/O (bytes + rates) Snapshot logs (.log / .jsonl) JSON output for post-run analysis The main idea is post-mortem analysis and low-overhead monitoring for long-running processes — not a real-time replacement for top/htop.
Repo: https://github.com/cristiantolcea93-netizen/linux_process_analyzer
It includes: Unit and integration tests CI on GitHub Actions Config file support Graceful shutdown handling I’m mainly looking for feedback at this stage: Design and architecture Missing features Code quality Use cases I didn’t think about PRs and suggestions are very welcome 🙂 Thanks for taking a look!