Skip to content

Commit 85f730c

Browse files
first commit
0 parents  commit 85f730c

File tree

10 files changed

+5008
-0
lines changed

10 files changed

+5008
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
prelude.h linguist-generated
2+
prelude.cog linguist-vendored

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"cogni"
4+
]
5+
}

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: test run clean update-prelude
2+
3+
test: run clean
4+
5+
CFLAGS += -g1 -O0 -Wuninitialized # cSpell: ignore Wuninitialized
6+
ifeq ($(MODE), cpp)
7+
CC := g++
8+
CFLAGS += --std=gnu++2c
9+
else
10+
CFLAGS += --std=gnu2x
11+
endif
12+
13+
PRELUDE_URL := https://raw.githubusercontent.com/cognate-lang/cognate/refs/heads/master/src/prelude.cog
14+
15+
prelude.h: prelude.cog
16+
xxd -i prelude.cog >prelude.h
17+
18+
cogni: cogni.o main.o prelude.h
19+
$(CC) $(CFLAGS) main.o cogni.o -o cogni
20+
21+
run: cogni
22+
@echo
23+
@echo -- begin program output --
24+
@./cogni || true
25+
@echo -- end program output --
26+
@echo
27+
28+
clean:
29+
rm -f cogni cogni.o main.o
30+
31+
update-prelude:
32+
curl -s $(PRELUDE_URL) >prelude.cog

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Cogni
2+
3+
This is an experimental interpreter for the [Cognate](https://github.com/cognate-lang/cognate) programming language that parses and runs the code directly and doesn't have to compile to C first.
4+
5+
In its present state it is not operable by any means. If you are looking for an embedded scripting language interpreter that actually works, look somehere else.

0 commit comments

Comments
 (0)