initial commit

This commit is contained in:
2026-02-26 14:57:24 -06:00
commit 12be649bb7
7 changed files with 117 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.o
testprog

24
LICENSE Normal file
View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org/>

13
Makefile Normal file
View File

@@ -0,0 +1,13 @@
all: obj link
obj:
hcc -obj gw.hc
hcc -obj vd.hc
gcc -c main.c
link:
gcc gw.o vd.o main.o -o testprog
clean:
rm -f *.o testprog

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# it works lol
the HolyC-lang compiler `hcc` just converts everything to straigh tassembly
and passes it to `gcc`, which i'm pretty sure just hands that off to the GNU
Assembler `as`.
you can get a copy of it [here](https://holyc-lang.com/install)
## run that shit
```
make
./testprog
```
If you take a peep at `Makefile` you'll notice that `hcc` can't compile multiple
objects in a single command. It also doesn't know when you've passed multiple
`.hc` file arguments, so it only processes the last one.
HolyC actually has some surprisingly rich features, like vectors, hashtables,
and even a built-in JSON class.
crazy stuff

4
gw.hc Normal file
View File

@@ -0,0 +1,4 @@
U0 godword()
{
"Let there be light!\n";
}

40
main.c Normal file
View File

@@ -0,0 +1,40 @@
#include <stdio.h>
extern int voodoo(); /* from vd.hc */
extern void godword(); /* from gw.hc */
int
main(void)
{
int t;
int f;
int g;
t = voodoo(1);
f = voodoo(0);
g = voodoo(4);
puts("voodoo() is a HolyC function.");
puts("If we pass 1 to it, it should return 0.");
puts("If we pass 0 to it, it should return 1.");
puts("For any other value, it should return 69.");
puts("Tests:");
printf("pass 1, want 0 --> t = %d\n", t);
printf("pass 0, want 1 --> f = %d\n", f);
printf("pass 4, want 69 --> g = %d\n", g);
puts("");
puts("Is this divine intellect?");
puts("");
puts("Now let's try printing to stdout.");
puts("We are going to call godword(), a void-returning function.");
puts("If this works correctly, it should say something biblical:");
godword();
return 0;
}

10
vd.hc Normal file
View File

@@ -0,0 +1,10 @@
I32 voodoo(I32 testval)
{
if (testval == 1) {
return 0;
} else if (testval == 0) {
return 1;
}
return 69;
}