6 ms·
Ask HN: Who is developing a programming language that compiles to C?
What is your programming language and it's status? Can you share a link to its code?
- ofalkaed 3y agoNot mine but one missing from your list, MinForth is a Forth which compiles to C. https://sourceforge.net/projects/minforth/ https://sourceforge.net/projects/minforth/
- mdwalters 3y agoMy friend is making a programming language called ACPL[1] that used to be written in Python, and outputs Python code, but now, he's working on a C implementation called CACPL, which is written in C and outputs C code. [1]: https://github.com/rjmsg/ACPL https://github.com/rjmsg/ACPL
- thesuperbigfrog 3y agoNot my project, but Chicken Scheme is an awesome language that compiles to C: https://www.call-cc.org/ https://www.call-cc.org/ Source download: https://code.call-cc.org/ https://code.call-cc.org/
- jhonsrid 3y agoThe language with a rude name sometimes known as 'BF' compiles trivially to C (from C), for instance: #include <stdio.h> int main() { int c; printf("#include <stdio.h>\nint main() {\nchar a[30000] = {0}; char *p = a;\n"); while((c = getc(stdin)) != EOF) { switch(c) { case '>': printf("++p;\n"); break; case '<': printf("--p;\n"); break; case '+': printf("++*p;\n"); break; case '-': printf("--*p;\n"); break; case '.': printf("putchar(*p);\n"); break; case ',': printf("*p = getchar();\n"); break; case '[': printf("while (*p) {\n"); break; case ']': printf("}\n"); break; } } printf("return 0;}\n"); return 0; } (Though sorry to any BF fans if I've missed something in the implementation) ;-)
- Exuma 3y agoJust say it… Brain Fuck Let its syllables echo through your body Let its phonetic oomph roll off your tongue
- samuba 3y agoV compiles to C https://vlang.io/ https://vlang.io/
- mathverse 3y agoNim
- stefanos82 3y agoNim, Crystal, Nelua...just search for "transpilers to C" and you will get lots of examples.
- maattdd 3y agoCrystal compiles to LLVM IR, not C
- danielEM 3y agoThanks! Here is a list that I'm maintaining: https://github.com/dbohdan/compilers-targeting-c https://github.com/dbohdan/compilers-targeting-c I'm long time fan of programming languages that compiles to C hoping that one day will fall in love with one endlessly! :-)
- ingigauti 3y agoI'm creating a new language but it "compiles" to C# - plang.is
- rnvannatta 3y agohttps://github.com/rnvannatta/vanity-scheme https://github.com/rnvannatta/vanity-scheme I am currently making a r7rs scheme derivative that compiles to C. The lofty goal is parallel fibers. It's in extreme early stages, and I don't expect anyone will use it other than me, but I already like it. The compiler has been self hosted for a few months now. It has a cool FFI that you can see in use in the demos folder. Working on adding header generation to the module system. While Chicken Scheme is cool, I don't think it'll be parallel, and not in the way I want it to be, and I am willing to make a lot of compromises Chicken isn't to get there. As mentioned, I am willing to settle with fibers for parallelism, and heavily eschewing side effects, making changes from r7rs to get there. For example, there will be no dynamic-wind provided and parameter objects will have different, thread friendlier, semantics. ---- My main reason for choosing C as a transpile is that it's easier to lean on gcc and C11 than it is to write my own codegen, and LLVM is too unstable for me to handle. I started writing this in June 2022, and since then LLVM has had 3 backwards compatibility breaking major release and millions of lines of code changed.
- worthless-trash 3y agoNot me personally, but gnucobol compiles to C ( https://gnucobol.sourceforge.io/ https://gnucobol.sourceforge.io/ )
- deleted 3y ago[deleted]
- JaDogg 3y agoHello, I'm working on Yaksha programming language. It has python like syntax and whole lisp subsystem as a macro preprocessor. Got bunch of builtin tools - syntax highlighting plugins etc. Main website: https://yakshalang.github.io/ https://yakshalang.github.io/ Try it online (with full x86 vm running in the browser): https://yaksha.pages.dev/ https://yaksha.pages.dev/ ------------ License is GPLv3 with few additional terms
- nbenitezl 3y agoVala - https://vala.dev/ https://vala.dev/ compiles to C and is tailored to GNOME ecosystem.
- gsuuon 3y agoI have a toy language I play around with that's just in specifications stage. Not mine but an interesting compile-to-c language: https://github.com/koka-lang/koka https://github.com/koka-lang/koka. Functional, effects, no-GC.