Skip to content

Commit

Permalink
att
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmoutinho committed Oct 24, 2024
1 parent 77ceaed commit a876bd5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
A Boostrapped lua Compiler

Install:
download the: [Darwin](https://github.com/OUIsolutions/Darwin/releases/download/0.002/darwin002.c)
download the: [Darwin](https://github.com/OUIsolutions/Darwin/releases/download/0.003/darwin003.c)
by typing
```shel
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.002/darwin002.c -o darwin002.c
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.003/darwin003.c -o darwin003.c
```
create a **main.lua** file
```shel
echo "print('hello world')" > main.lua

Create the **darwinconf.lua** file, these file configure the entire project ,to you

```lua
Addcode("print('hello world')") -- embed these code to o final.o
Addfile("test.lua") --embed these file to final.o

Cfilename = "final.c"
Compiler = "gcc"
Output = "final.o"
Runafter = true
```
and run

```shel
gcc darwin002.c -o darwin002.o && ./darwin002.o && gcc final002.c -o final002.o
gcc darwin003.c -o darwin003.o && ./darwin003.o
```

note that these its a especif version its designed for boostraping, it does not suport
argv, env variables, etc, it only suport one file , called **main.lua**, that needs to
be in the same path that you are running, and its generates the **final002a.c** file,
containing all the lua virtual machine, and the code of main.lua, to be able to boostrap
to the next version
11 changes: 6 additions & 5 deletions darwinconf.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

Addfile("test.lua")
Addcode("print('hello world')") -- embed these code to o final.o
Addfile("test.lua") --embed these file to final.o

Cfilename = "final.c"
Compiler = "gcc"
Output = "final.o"
Runafter = true
Cfilename = "final.c"
Compiler = "gcc"
Output = "final.o"
Runafter = true

0 comments on commit a876bd5

Please sign in to comment.