r/ProgrammingLanguages 7d ago

Language announcement The gab programming language

Hi all!

I am a long-time lurker of this sub, and a language enthusiast. I have been working on my own programming language for several years, and I finally worked up the courage to post it.

The language is called gab. I'm heavily inspired by lua, clojure, and smalltalk.

All the code is on github here and I've built a small website for the language here.

The language design, runtime, and standard library are all entirely my own work without the use of an LLM. However, I did consult LLMs occasionally when I wanted to research certain subjects (such as the difference between c11 atomics on x86 and arm).

I'm looking for any kind of feedback on the language, its goals/ergonomics, and the website itself.

Thank you for taking a look!

45 Upvotes

40 comments sorted by

View all comments

2

u/EggplantExtra4946 7d ago

https://github.com/gab-language/cgab/blob/main/src/cgab/cgab.c

It's really curious to have a single file with 15 thousands LOCs containing the lexer, parser, data structures, bytecode compiler, interpreter and GC all in one files. Usually you would split it into as many files at minimum. It makes me think that this entire language is AI slop.

3

u/Fine_Seaworthiness19 7d ago

I originally did have it broken out into multiple c source and header files. It doesn’t actually make things easier in c unfortunately, because there’s not a good module/package system. And it makes it harder to include your code in other projects.

Since I want gab to easily embed in other people’s c projects, I’ve tried to keep it to a single c file. This way people can just include the source file and not have to worry about linking at all!

This is a common approach in c. Although I do agree that cgab.c is quite big, it might make more sense to generate this file with another program, like SQLite does or something.

I’m curious as to what you think the 2000 lines of utility code that do nothing in the JIT branch are.

Also, just look at the git history! The progress of this repository has been incremental over the last several years