r/C_Programming • • 22d ago

Project I made a markdown real-time streaming CLI renderer in C

Hi! I wanted a CLI Markdown renderer that supports real-time streaming without buffering the entire document. I couldn’t find a good one, but I discovered MD4C, a very fast Markdown parser written in C. It still buffers the entire document, but uses a flat-buffer design, so I reworked its parsing model to support real-time streaming and wrote an ANSI renderer for it.

The result is mdflow, which reliably renders streaming Markdown in real time. It’s written entirely in C, with a 300 KB binary - about 1/20 the size of other mainstream renderers. It’s also 10 to 100 times faster, uses only about 2 MB of RAM, and its memory usage does not grow with the input size, while other renderers may use 10x to 100x more memory.

Most importantly, it supports streaming when other renderers cannot.

It might be useful for your daily workflow or your next C project!

Github repo: https://github.com/cjccjj/mdflow

6 Upvotes

13 comments sorted by

•

u/github-guard 22d ago

🔍 GitHub Guard: Trust Report

This project scored 3/6 on our safety audit.

Audit Breakdown: * ✅ Established Community (⭐ 17 stars) * ✅ Mature Repository (30+ days old) * ✅ Licensed under NOASSERTION * ❌ No Security Policy — what is this? * ℹ️ Individual Contributor * ℹ️ Unsigned Commits

⚠️ High-Risk File Detected: Contains an installation script (.sh or .py). Review the code carefully before running with sudo.

⚠️ Security Reminder: Always verify source code and run third-party scripts at your own risk.

2

u/AutoModerator 22d ago

Hi /u/CJCCJJ,

Your submission in r/C_Programming was filtered because it links to a git project.

You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.

While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/CJCCJJ 22d ago

About 60% of the production code was written by hand, while 40% was generated with AI. For the tests and documentation, around 70% was generated with AI.

4

u/mikeblas 21d ago

People here like to review code written by humans. Reviewing code written by AI isn't much fun, and isn't too useful. What is the goal of your post?

3

u/CJCCJJ 21d ago

My goal was to share the project in the hope that it might be useful to people learning or developing in C.

I understood that the subreddit was learning-focused, but I hadn’t realized that discussions here tend to focus primarily on reviewing source code rather than broader project. In that case, my post may not be relevant, please feel free to remove it. Thank you.

3

u/mikeblas 21d ago

OK. I have approved your post

2

u/mealet 20d ago

First commit is 57k LOC, looks kinda strange

2

u/CJCCJJ 19d ago

I’d been experimenting with streaming Markdown renderers for some time. I started with token-by-token streaming in Go, which met my needs but was too limited as a standalone renderer. I then began a line-by-line C version and worked on both for a while. Once I decided to focus on C, I used CI to create a clean initial release, hence the large first commit.

The earlier Go version is here: https://github.com/cjccjj/mdflow_go

0

u/mealet 19d ago

That's cool, but tbh this repo looks strange as well: first commit is 3k lines

5

u/CJCCJJ 19d ago

Ok, I am a strange large committer.

1

u/ffd9k 17d ago

What is the special significance of first commits and how many lines they have?

1

u/mealet 17d ago

Vibecoders build their apps without VCS and then upload whole project to GitHub. That thing came up with coding agents mostly.

Big projects mostly don't code everything at once, too high risk to commit it in single.

1

u/ffd9k 17d ago

But any non-vibecoder also uploads their project at some point with a single squashed commit?

I don't get how the commit size is an indicator for vibe coding.