r/AIprogrammingLanguage • • Aug 02 '26

Introducing Mad-C (My Advanced Dialect of C++)

5 Upvotes

So just over seven years ago I got the idea that I wanted to try my hand as writing my own actual programming language, and by this I mean more than just a scripting language, as I had made a few of these over the years... the first one being a simple scripting language for a dial-up BBS terminal program I co-authored with a friend to script playing MajorBBS games, primarily one called Galactic Empire written by Mike Murdoc which my friend was majorly into, and hence called the terminal program GEnius. It was written in Turbo Pascal, and somewhat modeled after the DOS terminal program Telix. I specifically worked on a scrollback buffer that would display everything in full ANSI and also the (very rudimentary) script language.

Fast forward nearly 30 years and I'm experimenting with writing my own byte code interpreter and direct dispatch switch tables getting decent performance, and then I stumbled across a library called AsmJIT which made it relatively easy to generate x86 code and execute it, and I was off to the races working on my own c-like language which I originally called C3PO.

After working on it for a few weeks, I changed the name to Mad-C before creating a github repo (pretty much exactly 7 years ago today), and pushed forward getting all the basics working, if/else, expression parsing, switch, for loops, etc, before trying to figure out what was going to make it stick out beyond it being a JIT language, and I decided I wanted to bring in a bit of C++, and that it was also going to bring in features from other languages.

I tinkered around with it on and off for several months, but actually getting C++ features working properly (without crashing) turned out to be much more difficult than getting C working, and eventually I just didn't have the time to continue to chip away at it as I got busy with other aspects of work and life... it was something I would tinker with here and there as I could.

After a certain point, the AsmJIT author had changed the interface and deprecated some ways of doing things, and I ended up shelving the project completely. It was fun while it lasted, but I just didn't have the time to pursue it further.

Fast forward to this year, and my work started pushing AI really hard, such that all the lead developers (including myself) got pulled off of our primary projects for three months to completely focus on implementing an "AI Playbook" using Claude Code.

I was so impressed at how much better this was working for me than my previous experience with Cursor, that I ended up purchasing my own personal subscription to try it out on my personal projects, including Mad-C, and it was able to get it building again.

I switched back and forth between using Claude Code as well as Codex (which I had barely tried before this) and got Mad-C to the point where I was able to get it to JIT run the SMAUG MUD code base (which is over 185 Kb of C89-style C source).

This wasn't instant... it took weeks of grinding away switching between Codex and Claude Code, waiting for 5 hour usage resets, but it was actually working and I was steering it and guiding them all along the way. Part of getting this working involved grinding it against the C23 GCC torture test suite.

I also wanted it to be able to cache the code generation in object files, as well as generate executables. This involved a lot more complexity and all test cases needed to pass in both JIT mode and EXE mode, and required implementing my own IR (intermediate representation).

Next I started adding in those language features from other languages. I used C++ style namespaces to bring in about 100 different functions from languages like PHP, Perl, Python, Rust, Ruby, JS, etc, as well as things like defer, multiple return values, rust matching, etc, and then turned the focus onto C++ support.

This is where things started getting really tricky because I didn't just want to simulate C++ with hardcoded string, fstream, and stringstream classes, I wanted it to parse the real C++ headers, which meant templates, and multiple inheritance, among hundreds of other language features.

Also, around the same time, just to make things more exciting, I wanted to be able to support other architectures than only x86 Linux, and this is when I discovered the MIR project, which was also seven years old. It provided a CPU agnostic "medium intermediate representation" (MIR), and seemed like just what I was looking for... but it presented a fork in the road, because not only did it provide this CPU agnostic opcode format, the project also included a C11-to-MIR library.

So the question now was, did I switch all my code from generating x86 code of my own design and structure to generating MIR opcodes, or do I change Mad-C into a sort of C-transpiler?

The author of MIR (Vladimir Makarov) has been one of the GCC developers for over 20 years... so I figured his C-implementation was likely superior, and it was also tested on MIR itself (which is written in C), and I chose this direction instead, even though I already had a working C implementation.

I did keep my lexer/parser though. What I ended up doing, was taking the internal node structure (the node_t struct) and using it for the base of MadC's AST tree node, which I named CIR_node, and it contains all the semantics for C++ and MadC.

I modified libc2mir so that I could pass in the CIR_node AST tree directly, which c2mir thinks is its own node_t AST tree, and converts it to MIR, and JIT executes it.

So MadC parses C, C++ (and madc), but lowers C++ into a C-AST tree, similar to how CFront used to work (the original C++ implementation). This means that madc can also emit standard C code so that you can feed it to GCC or CLANG if you want to.

The other part of MadC that was important to me, was making it self-contained, so the build also packs in all the system headers, precompiled into an AST "forest", and appends this to the binary compressed. This currently weighs in at around 12 Mbs or so total. So with a 12 Mb binary you can have a C/C++ JIT language (plus compiler) that doesn't need any external system include files.

Not only that, but it also support auto-including, so you don't need to remember what function or object is in what header file. It also supports auto-namespace resolution as well as an auto-main "script mode" where you do not even have to define a main() function.

I didn't stop there, of course, and MadC depends on my own fork of MIR, where I've been working to add C23 support (MIR's c2mir only implements the C11 standard), and I've also added support to my fork of MIR to generate objects, ELF binaries, link objects, handle multi-file projects, and I'm currently working on this for different platforms, like Mach-O for MacOS, as well as ARM CPUs.

This ended up being much more complicated than expected because while Linux uses libstdc++ (which is the GCC implementation of C++), MacOS uses libc++ (the CLANG implementation of C++) and they are quite different. So this is still in progress, but getting close to completion.

So now that you have all the history, please take a look at the project, and let me know what you think! -- https://github.com/derekbsnider/madc


r/AIprogrammingLanguage • • 3d ago

AiLang, artificial Intelligence Programming Language Self hosting x86_64 programming language with performance comparable to or better then gcc -03 llvm clang

Thumbnail
github.com
5 Upvotes

I’m a contributor to this project. The author doesn’t really do promotion or social media, but he said I could share it here to get some early public feedback.

What it is: a language designed around intelligibility, performance, and code quality. A big chunk of the repo is demo, test, and stress code used to validate the language and compiler.

What you get:

  • A self-hosting compiler with throughput around 15k LOC/sec

  • Fully self-contained: no make, no external linker. The compiler ingests every file following its path-based naming scheme and handles the whole stack end to end, including ELF generation on the backend

  • Self-hosts its ~160k LOC codebase in about 10–13 seconds on old hardware

  • Tight, minimal output: statically compiled, no libc dependency

  • Targets x86-64 with SSE2 and the System V ABI, so anything from roughly 2004 onward

  • Runs natively on Linux, with a Haiku OS runtime backend as well

What it does well:

  • Makes deep, complex systems code much easier to read

  • AI agents produce high-quality, performance-oriented code in it with little effort

  • Strong debugging and code analysis tools

  • A VS Code plugin, which I’ll update this week for the new enhanced compiler

Docs and examples: 20+ programming and library manuals, 150 demo programs, and dozens of dev regression tests. These also work well for cache-warming long-context models. So far DeepSeek 4+, Claude, and Grok have all produced excellent low-level code with it.

The lead dev says it’s coming out of low-key mode around New Year’s. Until then, I’d love to hear what people think.


r/AIprogrammingLanguage • • Oct 12 '26

U: Ultra-safe new programming language for LLMs and Humans to collaborate

Thumbnail
ulanguage.org
6 Upvotes

r/AIprogrammingLanguage • • Oct 08 '26

The Unfair Benchmark: What is your language unfairly good at?

2 Upvotes

I'm thinking about a small community challenge for experimental, new, and AI-driven programming languages.

The idea is simple:

Every language gets to choose its superpower.

«What is your language unfairly good at?»

A few superpowers I had in mind:

- Runtime performance

- Memory efficiency

- Code density / expressiveness

- Build / compilation speed

- Parallelism / concurrency

- Compile-time computation

- Preventing errors before runtime — e.g. formal verification, proofs, dependent types, contracts

- Metaprogramming

- Hardware / SIMD / GPU utilization

- Developer feedback loop

- Something completely different?

But I don't want to define the categories all by myself.

This is the first step of the game: choose your language's superpower.

Tell me what you think your language is exceptionally good at — even if it doesn't fit any of the categories above.

How we measure it comes later. We can figure that out together.

Right now, I'm much more interested in hearing what you believe your language can do unusually well.

P.S. to the non-AI languages: Don't worry, you're allowed to play too. We believe in inclusion. 😉

And yes, you're absolutely encouraged to use AI to code the benchmark. ;-)

So: What's your language's superpower?


r/AIprogrammingLanguage • • Oct 02 '26

Nikaia: a pre-alpha language where the compiler figures out the "how". How would you like to experiment with it?

4 Upvotes

Hi all,

I've been building Nikaia, a pre-alpha language that compiles to Rust.

The basic idea is simple: in a lot of systems code, you end up specifying how memory, waiting, sharing, etc. should work rather than just describing what you want the program to do. Nikaia tries to have the compiler figure out those details for you.

So there’s no async/await, GC, or manual memory management. Data races, missing values and unhandled errors are compile-time errors, with plain-language hints about what to do instead.

It's still very early, but it can already build real programs: a JSON parser, a log analyser, a small HTTP server, the One Billion Row Challenge, and more.

Nikaia itself is built almost entirely by AI agents, and they're currently rewriting the compiler in Nikaia (self-hosting). So the language is getting quite a bit of real-world use already.

I'd love to have people try it and tell me what makes sense, what doesn't, and where the language gets in the way. "This can't work because..." is just as useful as praise.

What would make that easy for you?

- Is the repo enough?

- A crate you can "cargo install"?

- A prebuilt executable?

- A Docker image with everything set up?

- An LSP / IDE integration?

Repo: https://github.com/Nikaia-Language/Nikaia

Docs: https://nikaia-lang.org/


r/AIprogrammingLanguage • • Oct 12 '26

madc v0.104.0 released — interactive editing, LSP/MCP support, and madcide gets its own repo

4 Upvotes

I've released madc v0.104.0, a fairly substantial update that also completes the separation of madc and madcide into independent projects.

What's new in madc

  • Expanded interactive REPL — madc -i now includes an ed/ex-style editing mode, multiple file buffers, undo/redo, search and replace, and syntax highlighting.

  • New REPL commands — inspect source definitions, check code without running it, manage projects, rebuild interactive sessions, and work with command history.

  • Built-in Language Server (LSP) — diagnostics, symbols, definitions, references, hover information and semantic highlighting, available to external editors.

  • Built-in MCP server — exposes compiler-aware code analysis, editing operations and project memory to AI coding tools.

  • Better regular expressions — unified PCRE2 support across Linux, Windows and macOS.

  • Automatic language selection — .c files default to C17, .cpp files to C++17, and .mad files to the madc dialect. Explicit --std options still override these defaults.

The madcide split

madcide now has its own repository and independent releases.

Starting with this version, madc is distributed without madcide. The IDE is available separately as madcide v0.7.0, built using madc v0.104.0.

Chthonia v0.1.0, the beginner-friendly C/C++ environment inspired by Thonny, builds on madcide and madc.

The three projects now have distinct roles:

  • madc — compiler, language, REPL and development services.

  • madcide — extensible terminal (TUI) and desktop (GUI) IDE.

  • Chthonia — beginner-friendly C/C++ learning environment built on madcide.

Low friction C and C++ without the ceremony.

Repositories:


r/AIprogrammingLanguage • • Sep 21 '26

Why Nyx Became Rove — and Why r/RoveLang Is for More Than Just Rove

5 Upvotes

Rove originally started under the name Nyx.

I liked the name, and a lot of the early compiler work, architecture notes, experiments, and plans were created under it.

The problem was that Nyx was already everywhere.

There were already other programming language projects using the name, tools using the same CLI naming, VS Code extensions, security projects, and plenty of unrelated software using “Nyx” as a brand.

At some point it stopped feeling like my project had its own identity.

So I decided to rename it.

Why “Rove”?

I wanted something short, simple, and easy to remember.

Not a huge fantasy name. Not something that sounds like a company trying too hard. Not a name that needs a paragraph to explain.

Rove felt right because the project itself has always been exploratory.

I move between compiler architecture, language design, runtimes, LLVM, different backends, tooling, systems programming, and whatever problem becomes interesting next.

The project has never really followed a straight line.

It explores.

It roves.

The source extension will still stay .nyx for now. I don't see a reason to break existing files just because the project name changed.


About this subreddit

Despite the name, r/RoveLang is not meant to be only about Rove.

Rove will obviously be one of the main things I post here:

  • compiler development

  • language design

  • experiments

  • benchmarks

  • architecture ideas

  • bugs

  • weird failures

  • releases

  • things that worked

  • things that definitely didn't work

But I also want this to be a place where other people can share their own experiments.

If you're building:

  • a programming language

  • a compiler

  • an interpreter or VM

  • a strange runtime

  • a small operating system experiment

  • embedded software

  • developer tooling

  • a weird hardware/software project

  • a parser

  • a transpiler

  • something low-level

  • or just some technical experiment you think is interesting

you can post it here.

It doesn't need to be polished.

It doesn't need to be a serious product.

It doesn't even need to succeed.

Sometimes the failed experiments are the interesting ones.


The only real rule

Please don't flood the subreddit.

Sharing your work is welcome.

Posting every tiny update as a separate thread, repeatedly promoting the same project, dumping unrelated links, or treating the subreddit like an advertising feed isn't.

Other than that:

show what you're building, explain what you're trying, ask questions, criticize ideas, share failures, and experiment.

Rove may have started this place, but it doesn't have to be the only thing built here.


r/AIprogrammingLanguage • • Sep 02 '26

I built a self-hosting systems programming language called Nyx via vibe coding

5 Upvotes

r/AIprogrammingLanguage • • Jul 31 '26

My reason for creating this Reddit community

6 Upvotes

While implied in the community description, I wanted to elaborate a bit to get some activity going on here, and I figured this post could serve as a discussion point.

Over the past few months, many of the programming related communities have began enacting AI content bans, and this overlaps a massive industry push for more AI adoption, which puts us at a sort of crossroads and an impasse for developers in general.

On one hand, we are being compelled to adopt these tools in our professional careers to advance the agendas of our employers, and on the other, attempts to use these tools for our personal projects are being shunned by communities of our peers.

While I understand the need to protect from the sudden influx of "slop" projects, I believe that the use of AI to assist with development should serve more as a disclaimer than a barred door.

AI tools are not going away, so banning their use is pointless. While I will be the first to agree that "agentic development" certainly has its own set of flaws and pitfalls, it requires us to think differently, and thus to work differently.

For me personally, AI assisted development has allowed me to take a project which I have been slowly working on for over seven years (due to lack of free time) and push it forward far more than I would have been able to on my own. I simply do not have the spare time I did when I was in my early 20s.

When I thought my project was now far along enough for community input and discussion, I came to find that it was a forbidden topic because I had used AI -- even though I had worked on my project for seven years without any AI assistance.

I am certain I am not the only developer facing this, and while there are lots of programming communities that are AI-oriented, my project is specifically a programming language, and the r/ProgrammingLanguages Reddit community has enacted exceedingly strict anti-AI rules.

Not only could I not create a new post about my programming language, I was banned just for mentioning it in a comment on a post.

Thus I decided to create this community for this forbidden topic.


r/AIprogrammingLanguage • • Oct 12 '26

Objective 9c: A CSP actor based language for 9front and other Plan 9 OS

6 Upvotes

I've been working on a new native system language for 9front where objects are CSP actors, and the application can act as a 9p file server (though calling serve() is entirely optional).

When utilizing the file server, interacting with class methods can be done entirely through standard Plan 9 tools (ls, cat, etc.). Data moves around using an NDB-derived text format called 'libtab'. The language currently has a small stdlib, a small UI library, and allows for writing Plan 9 C directly as inline functions. The most recent feature I've added is actor-controlled filetrees utilizing namespaces and an MVC pattern.

The language transpiles to Plan 9 C, so it drops cleanly into the typical build system (mk, 6c, 6l, etc.). The runtime is written in Plan 9 assembly for x86, with a C fallback for non-x86 architectures.

I haven't been able to test the non-x86 fallback yet as I lack the necessary hardware. If anyone here has non-x86 setups and is willing to help test, or just wants to poke around and provide feedback, I'd greatly appreciate it.

I've included extensive documentation in the repository covering the architecture, standard library, and how to get started. You can find the code and docs here:

https://github.com/kiljoy001/objective-9c


r/AIprogrammingLanguage • • Oct 07 '26

Protos: a programming language designed by a human, implemented with AI

7 Upvotes

I've been working on Protos, an experimental prototype-based object-oriented programming language built on GraalVM/Truffle.

Project links:

Protos is based around a deliberately small semantic core: objects and slots, delegation, object execution contexts, and closures as the fundamental executable value. Futures, structured tasks, isolated parallel execution and Actors are intended to fit into that same object/message model rather than becoming separate subsystems.

I originally wanted to discuss Protos in r/ProgrammingLanguages, but projects whose implementation depends on LLM-generated output are not welcome there. That makes this community a much better place to explain not only the language, but also how I am actually building it.

How AI is used in Protos

I want to be completely explicit about this.

The ideas, language design and decisions are mine. The implementation is currently AI-generated. I have not personally written a single line of Protos code so far.

This is intentional rather than something I am trying to hide.

I've been thinking about the ideas behind Protos for roughly twenty years. What AI gives me today is something I didn't have before: enough implementation manpower to explore those ideas at a scale and speed that would otherwise be unrealistic for me working alone.

I'd rather see how far I can take the language with AI than deliberately move much more slowly just so I can say that I personally typed every line of code.

But I don't treat AI as the designer.

My workflow currently has two distinct AI levels:

  1. Research AI It investigates a problem before implementation: existing languages, runtimes, academic or production approaches, upstream implementations, alternatives and trade-offs. Research does not implement anything and it does not make the final decision.

  2. Implementation AI Once I've made a decision, a separate implementation stage receives a constrained task describing what has been decided, the invariants it has to preserve, and the tests/evidence required to consider the work complete.

Between those two stages, I make the decisions.

I decide the semantics, accept or reject architectural alternatives, change direction, define priorities, decide what gets implemented and ultimately decide whether an implementation actually represents the language I want to build.

So the model is approximately:

human idea → AI research → human decision → AI implementation → tests/evidence → human acceptance

AI provides manpower.

It does not own the language.

Why work this way?

Because my limiting resource isn't ideas. It's implementation capacity.

I'm one person.

Without AI, I could either reduce the scope of what I want to explore or spend much longer implementing each idea myself.

I prefer a third option: use AI as engineering manpower and see how far I can push the design.

For me, the interesting question isn't whether I can personally type every line of a programming language.

It's whether I can design a coherent language, make the important decisions myself, direct considerably more implementation capacity than one person traditionally has available, and still maintain enough discipline that the implementation remains subordinate to the design.

The process is public

An important part of this experiment is that I'm not asking anyone to take that distinction on faith.

The source is public:

https://github.com/guillermomolina/protos

And the engineering process is also public:

https://github.com/guillermomolina/protos-project-docs

That second repository contains the durable record behind the project: investigations, architectural and semantic decisions, implementation evidence, measurements, audits and closure records.

The live work is also visible through the project's issues and project board:

https://github.com/users/guillermomolina/projects/1

So if I claim that a decision was mine rather than something an AI silently decided while generating code, there should increasingly be a public trail showing the research, alternatives, decision and subsequent implementation work.

About the language itself

What I'm most interested in discussing here is still the language, not merely the development method.

Protos has no classes. Objects delegate directly to other objects.

Some of the ideas I'm exploring include:

  • objects and slots as the basic state model;

  • prototype-based delegation rather than classes;

  • execution contexts that are themselves objects;

  • lexical bindings represented through that object/context model;

  • closures as the single executable value rather than having separate Function and Method value kinds;

  • Futures, structured Tasks, isolated parallelism and Actors integrated into the same object/message model;

  • keeping language mechanisms composable instead of accumulating unrelated special cases.

The website gives a much more approachable overview than the implementation repository:

https://protos.guillermomolina.com

I'm especially interested in criticism around:

  • whether the semantic model is understandable and coherent;

  • where the prototype/object model becomes surprising;

  • closures and execution contexts;

  • delegation, traits and operators;

  • concurrency and the relationship between Futures, Tasks and Actors;

  • places where I've introduced complexity that isn't justified;

  • ideas from other languages that Protos should study or challenge.

The language is still evolving considerably.

I'm not looking for people to agree with the design. Quite the opposite: useful criticism of the semantics, architecture and assumptions is exactly what I'm looking for.

And given the subject of this subreddit, I'm also very interested in the development model itself:

What happens when an individual language designer can use AI not just for autocomplete, but as separate research and implementation manpower while keeping design authority and decision-making human?

I don't know yet how far that model can go.

Protos is partly an attempt to find out.


r/AIprogrammingLanguage • • Aug 16 '26

I vibe-coded a programming language. It got slightly out of hand.

Thumbnail flooooooooooow.github.io
8 Upvotes

I present to you Flow, which started from the fairly simple question:

what would a systems language look like if a huge amount of its development was driven through LLMs?

What started off as a simple experiment has become an actual compiler + language ecosystem.

Flow is statically typed and aimed at writing relatively compact code without giving up native performance. It has multiple compilation paths, including C and MLIR/LLVM.

A lot of people wonder about whether or not an LLM can generate a compiler from a schema.

I think it's time we start asking ourselves whether we can construct enough feedback and verification around an LLM that the language remains coherent while the implementation is scaled up.

I've learned a lot of things about how best to use LLMs as tools, as well as a lot of the science behind traditional compiler engineering, in the process. By embracing the tooling and having fun, there's a lot of cool stuff to be made.


r/AIprogrammingLanguage • • Sep 21 '26

MadC C/C++ Compiler v0.100.0 — the Nexus

9 Upvotes

v0.100.0 — the Nexus: a multi-client IDE, an agent-addressable IR, and measured C++11 conformance at 75.1%

With version 0.100.0 of the madc compiler, based on the gcc torture test suites we currently score:

  • C at 99.2% of the in-scope gcc c-torture set under --std=c17

  • C++98 80.0%

  • C++11 75.1%

  • C++14 49.4%

  • C++17 41.6%

  • C++20 53.0%

Why a new C/C++ compiler when GCC and CLANG rule the roost? Well, MadC isn't just an AOT C/C++ compiler. It's primarily a JIT compiler. You can run C/C++ code as shebang scripts without requiring system headers installed, because they are precompiled into the compiler (relax... it can still include them externally if you want/need to). You can also embed madc as a JIT scripting language into your own programs.

What's this "nexus" stuff about? Well, there's also an IDE that has the compiler built in, and the same binary can operate in headless, CLI, ed/ex line mode, TUI and GUI mode under Linux, MacOS and Windows. With multi-client -> server connections with MCP and LSP servers. Oh, and a VS Code plugin to boot.

Why? Why not? It was primarily an exercise in developing madc's multi-mode UI module.

Oh, I should also mention that in addition to supporting standard C and C++, it also supports the "MadC language" dialect which brings in a load of conveniences to make C and C++ easier to use, including such things as:

  • automatic includes (no need to use #include <iostream>)

  • automatic namespace resolution (with controllable precedence order)

  • "script mode" (automatic main() function wrapping)

  • defer, :=, go, yield, await, untyped variables

  • well over 100 convenience functions from other languages

  • Uniform Function Call Syntax (UFCS)

  • URI Channels: file:// pipe:// tcp:// udp:// uds:// exec://

  • ... and much more


r/AIprogrammingLanguage • • 23d ago

madc v0.106.1 released — faster C compilation, leaner executables, SQLite support, and improved C++ exceptions

4 Upvotes

I've released madc v0.106.1, with improvements to compilation speed, native executable dependencies, C and C++ compatibility, and modularity.

For those unfamiliar with it, madc is a self-contained C/C++ compiler with JIT execution, native executable output, and an interactive REPL, without requiring GCC, Clang, or an installed development toolchain.

What's new

  • C compilation is approximately 1.8× faster than v0.105.0 across 40 measured compilation workloads. C++ compilation has also improved modestly.

  • Leaner native executables — madc now links only the libraries a program actually needs, eliminating unnecessary dependencies on libmadc, libstdc++, and other runtime libraries for plain C programs. A C hello-world executable is just 10 KB on Linux and depends only on libc.

  • SQLite now builds and runs its tests — SQLite 3.54.0's test fixture passes 394,058 of 394,060 tests, matching the results from GCC and Clang.

  • Improved C++ exception handling — exceptions now use native platform unwinding, correctly destroying objects as the stack unwinds.

  • Better C++ compatibility — improvements to templates, type traits, virtual function dispatch, object lifetimes, and constructors.

  • Modular architecture — Git, Markdown, and web UI functionality can now be loaded as independent modules using statements such as import git;.

  • Improved GCC command-line compatibility — response files, multiple source files, additional compiler flags, and more helpful diagnostics.

  • Improved generated-code performance — approximately 2% faster than v0.105.0 across the measured benchmark suite.

A notable compile speed comparison

The SQLite amalgamation compiles at -O2 in:

CompilerTime
madc3.2 s
GCC16.8 s
Clang15.7 s

These are results for this workload, not a claim that madc universally outperforms GCC or Clang.

Updated companion project releases:

  • madcide v0.9.1 — the extensible terminal and desktop IDE.

  • Chthonia v0.3.1 — the Thonny-inspired C/C++ learning environment built on madcide.

(Both include madc v0.106.1).

GitHub: https://github.com/derekbsnider/madc

Release: https://github.com/derekbsnider/madc/releases/tag/v0.106.1


r/AIprogrammingLanguage • • Aug 03 '26

AI-friendly programming language design

2 Upvotes

So when developing a new programming language using AI (or enhancing an existing one), it seems to make sense to design the language not only to be convenient for humans to use, but likewise for AI agents.

What Would an “AI-Friendly” Programming Language Actually Look Like?

There has been a great deal of discussion about making programming languages easier for AI systems to use. Usually, this means making code easier for large language models to generate: simpler syntax, fewer punctuation rules, less boilerplate and more predictable formatting.

But code generation is only a small part of software development.

An autonomous programming agent must also be able to understand an unfamiliar codebase, identify the consequences of a change, modify the program without breaking unrelated behaviour, verify that the result is correct and explain what it has done.

That suggests a much broader definition:

The goal should not merely be to make programs easier for AI to write. It should be to make programs easier for both humans and machines to understand, modify and verify.

Source Code Should Not Be the Only Representation

Most programming languages treat source text as the authoritative representation of a program. Compilers parse that text into abstract syntax trees, symbol tables, control-flow graphs and other structures, but these are usually treated as temporary implementation details.

An AI-friendly language could instead expose a stable semantic representation of the program.

Humans might continue to work primarily with readable source code, while tools and AI agents interact with the same program as a structured semantic graph containing:

  • Symbols and their identities

  • Types and relationships

  • Data ownership

  • Function contracts

  • Side effects

  • Dependencies

  • Call graphs

  • Tests

  • Access permissions

  • Source locations

  • Documentation

Source code would remain important, but it would become one view of the program rather than the only usable representation.

An AI agent should not need to rediscover the meaning of a program by repeatedly parsing text, searching filenames and inferring relationships from naming conventions.

Programs Should Be Locally Understandable

One of the greatest difficulties in maintaining a large codebase is that the meaning of a small section of code may depend on information scattered throughout the repository.

A module might rely on global state, build flags, initialization order, implicit imports, runtime configuration or code-generation steps that are not visible locally.

This is difficult for humans and even more difficult for AI agents operating with limited context windows.

An AI-friendly language should encourage modules to explicitly declare:

  • What they export

  • What they import

  • What state they own

  • What resources they require

  • What external systems they access

  • What assumptions they make

  • What invariants they guarantee

For example:

module Accounts

exports:
    User
    update_email

requires:
    Database
    EmailService

owns:
    UsersTable

guarantees:
    User.email is normalized
    User.email is unique

The purpose is not necessarily to make source files more verbose. Much of this information could be inferred by the compiler and displayed through tooling.

The important part is that the information exists in a structured and queryable form.

A programming agent should be able to ask:

describe module Accounts

and receive a bounded, reliable summary of the module without examining the entire application.

Types Should Describe Meaning, Not Just Storage

Many programming languages describe data primarily in terms of its storage representation.

A program may represent all of the following as strings:

first_name
email_address
postal_code
country_code
birth_date
telephone_number

Although these values share a storage representation, they do not share a meaning.

A language designed for machine reasoning should support semantic types such as:

PersonName
EmailAddress
PostalCode
CountryCode
BirthDate
TelephoneNumber
CurrencyAmount
TimeZone

These types could carry information about:

  • Valid values

  • Normalization

  • Comparison

  • Serialization

  • Privacy

  • Localization

  • Appropriate user-interface controls

  • Database representation

  • Safe conversions

A value of type EmailAddress would not merely be a string whose purpose is explained in a comment. Its meaning would be available directly to the compiler, development tools and AI agents.

This reduces the need to infer domain knowledge from variable names and scattered validation code.

Effects Should Be Part of Function Signatures

Traditional type systems tell us what values a function accepts and returns, but often say very little about what the function can do.

Consider a function such as:

update_email(user, address)

Does it modify memory? Write to a database? Send an email? Update an audit log? Access the network? Throw an exception? Trigger an event?

An AI agent should not need to inspect the implementation and every transitive function call to answer these questions.

An effect-aware declaration might look something like this:

function update_email(user_id, new_address)
    returns Result

    reads:
        User.id
        User.email

    writes:
        User.email
        AuditLog

    uses:
        Database
        EmailService

    may:
        send_email
        fail_with ValidationError
        fail_with DuplicateEmailError

This creates a machine-readable description of the function’s blast radius.

An agent proposing a modification could ask:

show effects of update_email

or:

will this change introduce network access?

The compiler could provide a reliable answer.

Authority Should Be Explicit

Most programs execute with ambient authority. Any code running within the process may be able to access the filesystem, environment variables, network, database or global application state.

That is convenient, but dangerous when code is being produced or executed by an autonomous agent.

A more AI-friendly language would use capabilities: explicit values representing permission to access particular resources.

For example:

function load_config(config_directory)

The function could access only the directory represented by the capability it receives. It would not automatically inherit access to the entire filesystem.

Similarly:

function update_customer(read_write_customers_database, customer_id)

could write to the customer database but not to the payroll database.

This would allow an AI agent to operate within a restricted environment where accidental or malicious actions are structurally impossible.

The agent could be given:

  • Read access to one repository

  • Write access to one module

  • A temporary filesystem

  • A test database

  • No network access

  • A limited memory and execution budget

Security boundaries would become part of the program rather than an external policy layered on top of it.

Contracts Should Be First-Class

Comments can explain what a function is intended to do, but comments are not normally checked by the compiler.

An AI-friendly language should make preconditions, postconditions and invariants first-class program elements.

For example:

function transfer(source, destination, amount)

requires:
    amount > 0
    source.balance >= amount

ensures:
    source.balance =
        previous(source.balance) - amount

    destination.balance =
        previous(destination.balance) + amount

    source.balance + destination.balance =
        previous(source.balance + destination.balance)

These contracts could serve several purposes:

  • Human documentation

  • Static analysis

  • Runtime checks during development

  • Test generation

  • Formal verification

  • Agent acceptance criteria

Instead of guessing whether an implementation is correct, an AI agent could ask the compiler whether the implementation satisfies its declared contract.

Contracts would also make tasks easier to define.

Rather than telling an agent:

a task could be expressed as:

Modify transfer so that contract
AccountTransferPreservesTotalBalance
is satisfied.

The desired outcome becomes concrete and machine-verifiable.

Inference Should Be Predictable and Inspectable

Inference can make a language substantially easier to use. Type inference, automatic imports, generic specialization and implicit conversions can remove large amounts of repetitive code.

However, inference becomes dangerous when it hides meaningful decisions.

A useful rule might be:

Automatic behaviour may be reasonable when:

  • A conversion is exact

  • Ownership remains unchanged

  • No persistent state is modified

  • No external resource is accessed

  • Execution remains deterministic

Explicit syntax should be required when an operation:

  • Loses information

  • Transfers ownership

  • Performs network access

  • Blocks or becomes asynchronous

  • Writes persistent state

  • Escalates privilege

  • Introduces nondeterminism

  • Has significant computational cost

An AI agent should also be able to inspect every inferred decision.

For example:

explain expression:
    total = price + tax

might produce:

price has type Currency<USD>
tax has type Currency<USD>

selected operation:
    Currency.add

conversion:
    none

effects:
    none

possible failures:
    CurrencyOverflow

The language could remain concise while the toolchain exposes the full semantic interpretation.

The Language Should Have a Canonical Form

Formatting tools create a consistent textual style, but an AI-friendly language would benefit from a deeper canonical representation.

The compiler could normalize:

  • Resolved names

  • Inferred types

  • Selected overloads

  • Implicit conversions

  • Generic arguments

  • Default arguments

  • Effects

  • Ownership decisions

Human-written code might say:

user.balance += payment

The canonical semantic form might record:

read field User.balance

convert Payment
    to CurrencyAmount
    using exact conversion

invoke CurrencyAmount.add

write result
    to field User.balance

This form would not necessarily be shown during normal programming. It would be available to tools, reviewers and agents when precise interpretation is required.

It would also allow code written in different stylistic forms to be compared semantically rather than textually.

Symbols Should Have Stable Identities

Programming tools often identify symbols using names and source locations. Both are fragile.

Names change during refactoring, and source locations change whenever lines are inserted or removed.

An AI-friendly language could assign stable identities to program entities:

symbol:
    User.email

stable_id:
    field:7f2a81c4

aliases:
    email
    email_address
    contact_email

Humans could use whichever names are appropriate in source code or user interfaces, while tools and agents refer to the canonical identity.

This becomes especially important when a language supports aliases, localization, schema evolution or generated interfaces.

An agent should be able to rename a symbol without losing track of its identity or confusing it with another similarly named symbol.

Changes Should Be Semantic, Not Merely Textual

AI coding tools currently make changes largely through text patches. This works, but it is fragile.

A line-based patch may fail because:

  • The file was reformatted

  • Another change shifted the lines

  • A symbol was renamed

  • Similar code appears elsewhere

  • The surrounding context has changed

  • The patch applies cleanly but to the wrong location

A semantic patch could instead express intent:

rename symbol:
    User.birthdate
to:
    User.birth_date

or:

add parameter:
    Logger

to function:
    process_order

position:
    after Database

or:

replace implementation of:
    Account.transfer

only if:
    function signature is unchanged
    semantic hash matches 4e720
    no new callers have been introduced

The compiler or development environment could translate the semantic change into ordinary source-code edits and Git-compatible diffs.

The repository would still contain readable text, but agents would operate on program structure rather than guessing where to insert characters.

Diagnostics Should Be Structured Data

Compiler errors are generally written as prose for humans:

Cannot convert argument 2 from nullable string
to email address.

An agent then has to parse that prose and infer an appropriate repair.

A structured diagnostic might contain:

diagnostic_code:
    TYPE_ARGUMENT_MISMATCH

function:
    update_email

parameter:
    new_address

expected:
    EmailAddress

received:
    Nullable<String>

cause:
    nullability mismatch

possible_repairs:
    validate non-null value
    provide default value
    change parameter type

automatic_repairs:
    none

The human-readable message could still be generated from this data.

The compiler should clearly distinguish between:

  • A repair that is known to preserve semantics

  • A probable repair requiring review

  • Multiple ambiguous alternatives

  • A condition for which no valid repair is known

This would make compiler interaction far more reliable for autonomous agents.

Relationships Should Be Declarative

Many applications define the same relationship repeatedly across:

  • Database schemas

  • Object models

  • API definitions

  • Validation code

  • User interfaces

  • Serialization formats

  • Access-control rules

An AI agent must then determine whether these duplicated definitions are consistent.

A more declarative language might express the relationship once:

entity Order

fields:
    id: OrderId
    customer: relation to Customer
    items: many OrderItem
    total: CurrencyAmount

derivation:
    total = sum(items.price)

The language now knows:

  • customer refers to another entity

  • items is a collection

  • total is derived

  • Changing an item may change the total

  • total should not normally be edited directly

  • Storage and user-interface tools can represent these fields appropriately

This greatly reduces the amount of detective work required to understand the application.

State Changes Should Be Transactional and Inspectable

AI-generated operations should be easy to preview, sandbox and reverse.

A language or runtime could make state-changing operations transactional:

transaction UpdateEmail

set:
    user.email = new_email

append:
    audit_log = email_changed

send:
    confirmation_email

Before committing, an agent or human could request:

preview transaction UpdateEmail

The runtime might report:

database changes:
    Users.email modified for user 1842
    AuditLog row inserted

external effects:
    one email would be sent

invariants checked:
    email is valid
    email is unique

result:
    transaction may commit

The runtime could also support:

  • Snapshots

  • Rollback

  • Deterministic replay

  • Resource limits

  • Mutation logs

  • Simulated external services

  • Reversible development environments

An agent should be able to demonstrate what would change before being permitted to change it.

Tests Should Be Connected to Program Semantics

Tests are usually organized as source files and function names. Their relationship to the code they verify is often informal.

An AI-friendly language could associate tests with symbols, contracts and invariants:

test transfer_preserves_total

verifies:
    Account.transfer

covers:
    AccountTransferPreservesTotalBalance

The toolchain could then answer:

which tests verify Account.transfer?


which public behaviours changed?


which contracts have no tests?


what is the smallest sufficient test set
for this patch?

This last question is particularly important for autonomous agents. Running every test after every small change may be expensive, while running too few tests is unsafe.

Semantic test relationships could allow the compiler to select a targeted verification set and then expand it when uncertainty remains.

The Compiler Should Expose an Agent Protocol

The most important feature may not be part of the language syntax at all.

A language designed for AI-assisted development should provide an official interface through which agents can query and modify programs.

That interface might support operations such as:

describe(symbol)

find_references(symbol)

explain(expression)

show_effects(function)

show_contracts(function)

show_invariants(type)

calculate_change_impact(patch)

create_semantic_patch(request)

validate_patch(patch)

find_relevant_tests(patch)

run_tests(test_set)

preview_transaction(operation)

apply_patch(patch)

rollback(change)

Today, AI coding agents often interact with a repository using little more than shell commands, text search, a language server and compiler output.

A compiler-native protocol would give them a much more precise and constrained environment.

The compiler could even generate a compact task-specific context package:

task:
    modify email validation

relevant symbols:
    User.email
    EmailAddress
    update_email
    UserRepository.save

required invariants:
    email must be normalized
    email must be unique

allowed modules:
    Identity
    Accounts

forbidden effects:
    database schema changes
    network access

required verification:
    EmailAddress contracts
    identity email tests

This would help prevent agents from becoming lost in large repositories or long-running plans.

AI-Friendly Does Not Necessarily Mean Verbose

Many of these ideas may sound as though they would produce an extremely ceremonial language.

That does not have to be the case.

Humans should be able to write concise code while the compiler derives and records the richer semantic model.

For example:

function add_item(order, item):
    order.items.append(item)

The compiler might infer:

  • order is mutated

  • item is read

  • order.total must be recalculated

  • The operation may fail if the order is finalized

  • The database transaction touches two tables

  • Three invariants must be rechecked

  • Four tests are directly relevant

The source code remains readable. The additional information exists because the language and toolchain understand the operation.

The principle should be:

Human-Friendly and AI-Friendly Design Are Closely Related

Most of the features that would make a language safer for AI agents would also make it easier for humans to maintain:

  • Explicit module boundaries

  • Meaningful types

  • Predictable conversions

  • Structured effects

  • First-class contracts

  • Better diagnostics

  • Semantic refactoring

  • Transaction previews

  • Clear test coverage

  • Stable symbol identities

AI agents amplify the importance of these features because they expose weaknesses that humans have historically worked around through experience, intuition and institutional knowledge.

A human developer may remember that a particular field is updated by a hidden database trigger. An AI agent may not discover that fact until something breaks.

The better solution is not necessarily to train the agent to guess more accurately. It is to make the dependency explicit.

A Possible Definition

A genuinely AI-friendly programming language would not merely be one whose syntax appears frequently in training data.

It would be a language in which a program is:

  • Readable as source code

  • Understandable as a semantic graph

  • Divided into bounded cognitive domains

  • Explicit about authority and side effects

  • Modifiable through structured operations

  • Testable against declared contracts

  • Executable in sandboxed transactions

  • Verifiable using compiler-supported evidence

The central design goal might be summarized as:

Such a language would not eliminate programming mistakes, hallucinations or unsafe changes. It would, however, give both humans and AI agents much stronger tools for detecting those problems before they reach production.

The result would not simply be a language that AI can generate.

It would be a language in which AI can operate with bounded authority, explicit understanding and evidence that its work is correct.


r/AIprogrammingLanguage • • Oct 03 '26

I’ve been building a programming language with AI assistance — Mah

7 Upvotes

I’ve been building a small programming language called Mah from scratch, and this seemed like the right subreddit to share it because AI has been part of the development process.

Mah currently has:

  • a hand-written lexer, parser, resolver and compiler

  • its own portable bytecode format and VM

  • a static type checker with inference

  • structs, enums, traits, pattern matching, generics and closures

  • try / catch / typed error sets

  • a standard library (std:json, std:fs, std:math, std:regex, etc.)

  • runtime reflection, decorators and hooks

  • a real LSP with diagnostics, hover, completion, definition and rename

  • a formatter

  • Neovim and VS Code integrations

  • a second VM/runtime implemented in Rust

The compiler/tooling are mostly Python standard-library code, with the Rust implementation being an optional native runtime.

The interesting part for me hasn't really been inventing another syntax. It's been figuring out how all of these pieces fit together: resolution, closures, bytecode, runtime metadata, reflection, the type checker and the LSP all sharing the same underlying representation.

GitHub: https://github.com/sina-salahshour/mahlang

I'm particularly interested in feedback on the language/runtime architecture and on places where AI assistance helped versus places where it made the implementation harder.


r/AIprogrammingLanguage • • Aug 14 '26

Announcing Raptor, a Perl5 subset of Raku

Thumbnail
reddit.com
4 Upvotes

r/AIprogrammingLanguage • • Sep 01 '26

Working on the IDE

4 Upvotes

So for the past week or so I've been working on an IDE for madc which is actually written in madc.

Part of the idea for the madc language is to build everything to be modular, reusable and exposed to the language itself, so madc is not just a language of its own, it's also an embeddable language, but also much of the machinery can be used outside of madc, and also madc can call upon its own machinery, including embedding madc into itself (since it is c/c++), etc. So it makes this all very possible.

So this also means the features and functionality to create an IDE are also reusable components of the language, as I started with a text editor as an "example program", and the UI module actually first started with a simple text (dumb terminal) implementation of Colossal Cave Adventure, and that same UI module was extended to support TUI (Terminal User Interface), which is what was used for the text editor, and that text editor was extended into the madc IDE (madcide).

In the current develop branch the editor is working with basic IDE functionality, and with a few different editor key mapping flavours (pico, joe, emacs and vim).

I'm doing a bit more cleanup and polishing before the next master release, but wanted to chat about what's in progress and where it is going.

I've talked a little bit in here before about my idea of the future of AI coding, and that the current method of LLMs using text based shell tools and scripts (sed, awk, grep, and python mostly) to edit code seems archaic and problematic, and what I've been thinking would be useful would be to provide a "nexus" API/MCP of sorts that gives the LLM direct access to the current "live" code, at a lower level than the typical LSP layer provided by things like VSCode, and the same API would funnel gated access to the revision history, as well as the project management layer, and both of those would be configurable external connectors, so that the IDE was just providing a simple, unified entry point to the code.

So my idea with the IDE is that it would fit into this model so that there would be these various layers of a user session (or sessions), accessing this state of the union so to speak, and allowing a real collaboration between developers and LLM agents to the same live project.

I think eventually this live code nexus would be its own running server that you would connect IDE clients and LLM agents to, and you could access it from the CLI, including simple shell CLI access, a TUI interface IDE, or GUI interface IDE, remote, local, it doesn't matter.

It's something I'm playing with, and while it's primarily c/c++ based, madc itself has polyglot leanings so the door is open for fully parsing and supporting other languages.

Any thoughts?


r/AIprogrammingLanguage • • Sep 10 '26

RFC: What is Nyx actually supposed to mean?

Thumbnail reddit.com
3 Upvotes

r/AIprogrammingLanguage • • Sep 09 '26

Nyx’s post-v5 compiler architecture: Typed HIR → MIR → target legalization

Thumbnail reddit.com
4 Upvotes

r/AIprogrammingLanguage • • Aug 23 '26

madc v0.95.2 released — faster startup, faster FP code, and less ceremony

4 Upvotes

I just released madc v0.95.2, with updated binaries for Linux, Windows, and macOS (Intel + Apple Silicon).

A few highlights since v0.92.1:

  • Much faster startup — an 11-file JIT project dropped from roughly 829 ms to around 150 ms.

  • Floating-point-heavy code is ~2.8× faster after a MIR x86-64 codegen fix; donut.c now slightly beats GCC -O0 in the test case.

  • Added std::print, std::println, and std::format

  • Array literals and var are more convenient: var values = { 1, 2, 3 }; values.push(4);

  • Polyglot utility functions from PHP, Python, Perl, Ruby, JavaScript, and Rust now work more naturally with var and C strings.

  • Multi-file project support has been improved, with fixes around globals, initialization, overload handling, and shared state.

  • Several MIR code-generation fixes landed, including fixes for higher optimization levels and Apple Silicon.

  • The release includes a madc adaptation of Colossal Cave Adventure, based on Eric S. Raymond's Open Adventure port and modified to demonstrate madc features. It remains fully playable while matching all 94 reference transcripts byte-for-byte.

The goal remains:

C and C++ without the ceremony — convenient enough for scripting, while still producing and interoperating with native code.

https://github.com/derekbsnider/madc


r/AIprogrammingLanguage • • Aug 12 '26

Jaithon 3 (the perfect programing language)

5 Upvotes

Hi! I've recently been working on an old project of mine called Jaithon. Also, this is one of my first ever posts on reddit (its my first post in a tech oriented subreddit for sure) so bear with me if the style of the post comes off a little weird.

https://github.com/abhiramasonny/jaithon

This post is pretty long so tldr, I created a programming language and i think its pretty cool, and you can check it out there and you should star the repo :) ^

I started Jaithon nearly 4 years ago when I was in 8th grade, and back then all programing was human generated 😔. lmao JK, but seriously speaking, when I was first creating Jaithon (or Jaithon 1), I was primarily doing it as a project to teach myself how to code in C. As it was my first time coding in C, the project was horribly structured with all the code being located in one file and filled with a bunch of bugs. The syntax of Jaithon 1 was also really really bad, however I left it at the end of the summer to go work on other projects and highschool. Last winter however, I decided to pick back up on development as I was a little bit more experienced in programming with C, and also agentic coding was a thing.

Heres a disclaimer / transparency thing now, if you are someone who HATES any project that has even a line of code that is generated by an LLM, you are not the target audience for this post. To be fully transparent, currently, over 80% of the code is LLM generated. A more detailed explanation of how I used AI in this project is located in the readme, and if your view on AI generated code is a bit more lenient (such as mine) I would recommend reading the readme as I think that I handled it in a way that is not only ethical, but actually produced the best results and taught me the most. I dont consider myself a "vibe coder" nor do I consider Jaithon as "AI slop" and for further clarification there are 2 paragraphs of the README dedicated to explaining this.

Okay anyways, now that thats cleared up, back to the story. Last winter, I decided to upgrade jaithon with all my knowledge and the tools available to me at the time. This led me to creating Jaithon 2, which was certainly much better than the original completley interpreted language that was all in one file and impossible to propperly maintain, however there were still major architectural problems within Jaithon 2 that with all my knowledge at the time, I was not able to solve and which led me to just giving up on it again. Even so, Jaithon 2 was, in my opinion, one of the best projects I have ever made.

Now, heres the real reason I am making this post. I recently over the last week came back to Jaithon after watching a bunch of youtube videos about compilers and bytecode and JIT and all that, which at the time of developing Jaithon's 1 and 2 I had no clue existed, led me to having increased motivation to develop features to Jaithon yet again. Now here is whats new with Jaithon 3, and the reason it exists.

Jaithon 3 is very much bootstraped. The entirety of the frontend is written in Jaithon itself, along with the implementation of a large standard library, a JIT for arm64 that makes jaithon 3 incredibly fast, along with a whole slew of better architectural decisions that saved me in the long run on this project many hours of time. Jaithon 3 holds, in my opinion, the perfect syntax taken from all the languages that I use (Python, Java, Lua, C++, Ruby, Bash, Rust) and has a clean architecture behind it which places it in my benchmarks between Java and C++ in terms of speed.

Benchmark of Jaithon compaired to other languages

I loved developing this project, and here is some examples of its syntax. It would mean a lot to me if you were to star the github repo, I am trying to hit 15 stars soon and it motivates me to continue development on the project :) All and any criticism is appreciated, wether that be on the use of AI, the languages architecture, syntax, etc.

Thanks guys and heres some example code!

# traits are interfaces with default methods, and they are types.
trait Printable {
    fn to_str(self) -> str
    fn describe(self) -> str { return f"<{self.to_str()}>" }
}

let name = "Jaithon"
var count = 0
const MAX = 1 << 16

let lookup: dict[str, int] = {}
let maybe: int? = null           # T? is T | null

# loops and ranges
for i in 0..10 { count += i }
'outer: for row in grid {
    for cell in row {
        if cell == target { break 'outer }
    }
}

# pattern matching
let kind = match code {
    200           => "ok",
    301 | 302     => "redirect",
    400..=499     => "client error",
    n if n >= 500 => "server error",
    _             => "unknown",
}

enum Shape {
    Circle(radius: float),
    Rect(w: float, h: float),
}

fn area(s: Shape) -> float {
    return match s {
        Shape.Circle(r)  => math.PI * r ** 2,
        Shape.Rect(w, h) => w * h,
    }
}

r/AIprogrammingLanguage • • Sep 08 '26

Progress on the GUI version of the MadC IDE

Thumbnail
gallery
4 Upvotes

So the same IDE supports terminal/TUI mode and now GUI mode... for Linux, Windows and MacOS.

The attached images show, in order:

  • Linux -- GTK 4 + WebKitGTK 6

  • Linux -- TUI mode (inside Windows Terminal)

  • Windows -- Win32 + WebView2

  • macOS -- Cocoa + WKWebView

Only the Linux GUI version currently has the menu options, as this is a develop release (v0.99.1), but all three will have them in the upcoming master release.

The IDE is currently operating in local mode, but I have been designing it to be able to also operate in client -> server mode, supporting multiple client connections.

Also, the internal UI framework (madc::ui) is used for all user interfaces:

  • TTY/line-by-line UI -- examples/adventure (Colossal Cave Adventure madc port)

  • TUI/smart terminal -- tools/madcide (vt102/xterm TUI version of madcide)

  • Web/DOM -- tools/madcide --gui (web GUI version of madcide)

I decided to start with a web interface for the IDE since it makes a lot of the cross-platform GUI work much easier, and is one of the purposes that HTML was originally designed for (a simple, standardized way to format text so that any computer system could read and display the same document identically).

https://github.com/derekbsnider/madc


r/AIprogrammingLanguage • • Sep 17 '26

Klyn 0.1.7

Post image
5 Upvotes

r/AIprogrammingLanguage • • Aug 05 '26

What tools are you using?

2 Upvotes

I'm curious what tools everyone is using to improve their agentic development flow?

I'll go first... I'm using both Codex (CLI) and Claude Code (CLI) to work on madc, which is written in C++ using g++ (and clang++) with no real other tools (currently), beyond AGENTS.md, CLAUDE.md, and various rules file.

I have another project which I have implemented my own project tracking through an MCP server that is part of the project itself, where the primary development agent is Claude Code, but through the MCP it triggers Codex CLI agents to do code reviews using Forgejo for the git repository.

I'm planning to move the MadC project into this platform, but just haven't quite gotten around to it yet. The idea is that I can use one agent as a master orchestrator, and have it select other agents to do some work as they have capacity and usage remaining.

The main problem I've been running into (regardless of orchestration method) is task fragmentation and tangential plan overload. Like I have an overall roadmap, and it is broken down into stages, but what I'm noticing is that as a project grows in complexity, each subsequent stage not only takes longer to implement, it inevitably fragments into ever smaller slices.

Those slices will get sliced into subsequentially smaller slices, and the next thing I know my agents are grinding endlessly on never-ending numbered tasks.

The other main problem is post-compaction drift, where before the compaction, the agent will be quite certain in what is supposed to be tackled next, but after the compaction, the agent takes things in a completely different direction.

Other issues involve outright deception, where an agent will vastly overstate the completion of a task, where later investigation reveals something that could not have possibly passed unit testing.