Skip to content

Commit

Permalink
Add generated files to git
Browse files Browse the repository at this point in the history
  • Loading branch information
djwatson committed Oct 13, 2023
1 parent c62b928 commit 6f6035f
Show file tree
Hide file tree
Showing 9 changed files with 13,687 additions and 14 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ cmake_install.cmake
*.bc
tmp1
tmp2
bootstrap.cpp
libwrite_double.so
opcodes*
vm.ll
bootstrap.c
test/tmp3
test/bench/foo
test/outputs/*
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ Hawk has no dependencies other than a recent (> 13) clang. GCC
Release mode, but not in Debug mode.

It has an optional dependency on libcapstone, and elf headers for debugging.
Currently chezscheme or chicken is used for bootstrapping, but is not
used after install.

```
sudo apt install chezscheme
```bash
git clone https://github.com/djwatson/hawk.git
cd hawk
cmake .
make -j
sudo make install
```

Currently chezscheme or chicken is used for bootstrapping, but is not
used after install. The generated build artifacts are checked in, so
there is no need to install chez or chicken unless you have modified
the sources.

## OPTIONS

`--joff`
Expand Down Expand Up @@ -66,15 +68,15 @@ sudo make install
Print help message and exit.

## EXAMPLES
```
```bash
hawk hello.scm
```
Prints 'hello world', assuming hello.scm contains
```
```scheme
(display "hello world")
```
Compile the hello.scm script to an executable:
```
```bash
hawk --exe hello.scm
./hello
```
Expand Down
5 changes: 2 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ <h2>HAWK</h2>
<p>HAWK can be found on <a href="https://github.com/djwatson/hawk">github</a>. It is licensed under the <a href="https://opensource.org/license/mit/">MIT License</a>. </p>
</div>
<h2>Building</h2>
<div class="header">Hawk has no dependencies other than a recent (> 13) clang. It has an optional dependency on libcapstone, and elf headers for debugging. Currently chezscheme or chicken is used for bootstrapping, but is not used after install.</div>
<div class="header">Hawk has no dependencies other than a recent (> 13) clang. It has an optional dependency on libcapstone, and elf headers for debugging. Currently chezscheme or chicken is used for bootstrapping, but is not used after install. The generated build artifacts are checked in, so there is no need to install chez or chicken unless you have modified the sources.</div>
<p></p>
<pre class="code"><code>$ sudo apt install chezscheme
$ git clone https://github.com/djwatson/hawk.git
<pre class="code"><code>$ git clone https://github.com/djwatson/hawk.git
$ cd hawk
$ cmake .
$ make -j
Expand Down
12,420 changes: 12,420 additions & 0 deletions src/bootstrap.c

Large diffs are not rendered by default.

Binary file added src/bootstrap.scm.bc
Binary file not shown.
907 changes: 907 additions & 0 deletions src/opcodes-table.h

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions src/opcodes.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
const char* ins_names[] = {
"ILOOP",
"LOOP",
"IFUNC",
"FUNC",
"IFUNCV",
"FUNCV",
"ICLFUNC",
"CLFUNC",
"ICLFUNCV",
"CLFUNCV",
"KSHORT",
"JMP",
"IRET1",
"RET1",
"HALT",
"SUBVN",
"ADDVN",
"ADDVV",
"SUBVV",
"MULVV",
"DIV",
"REM",
"EQ",
"JEQ",
"JNEQ",
"MEMQ",
"ASSV",
"ASSQ",
"LENGTH",
"EQUAL?",
"JISLT",
"JISEQ",
"JISNEQ",
"JISLTE",
"JISGT",
"JISGTE",
"ISLT",
"ISGT",
"ISLTE",
"ISGTE",
"ISEQ",
"JISF",
"JIST",
"GGET",
"GSET",
"KFUNC",
"KONST",
"MOV",
"BOX",
"UNBOX",
"SET-BOX!",
"GUARD",
"JGUARD",
"JNGUARD",
"VECTOR",
"CLOSURE",
"CLOSURE-GET",
"CLOSURE-SET",
"CLOSURE-PTR",
"APPLY",
"JFUNC",
"JLOOP",
"CALL",
"LCALL",
"CALLT",
"LCALLT",
"EQV?",
"JEQV",
"JNEQV",
"CONS",
"CAR",
"CDR",
"MAKE-VECTOR",
"MAKE-STRING",
"VECTOR-REF",
"STRING-REF",
"VECTOR-LENGTH",
"STRING-LENGTH",
"VECTOR-SET!",
"STRING-SET!",
"SET-CAR!",
"SET-CDR!",
"WRITE",
"WRITE-U8",
"WRITE-DOUBLE",
"SYMBOL->STRING",
"STRING->SYMBOL",
"CHAR->INTEGER",
"INTEGER->CHAR",
"OPEN",
"CLOSE",
"PEEK",
"READ",
"READ-LINE",
"INEXACT",
"EXACT",
"ROUND",
"SIN",
"SQRT",
"ATAN",
"COS",
"TRUNCATE",
"FLOOR",
"CEILING",
"EXP",
"LOG",
"TAN",
"ASIN",
"ACOS",
"CALLCC",
"CALLCC-RESUME",
"FILE-EXISTS?",
"DELETE-FILE",
};
119 changes: 119 additions & 0 deletions src/opcodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#pragma once

extern const char* ins_names[];
enum {
ILOOP,
LOOP,
IFUNC,
FUNC,
IFUNCV,
FUNCV,
ICLFUNC,
CLFUNC,
ICLFUNCV,
CLFUNCV,
KSHORT,
JMP,
IRET1,
RET1,
HALT,
SUBVN,
ADDVN,
ADDVV,
SUBVV,
MULVV,
DIV,
REM,
EQ,
JEQ,
JNEQ,
MEMQ,
ASSV,
ASSQ,
LENGTH,
EQUAL,
JISLT,
JISEQ,
JISNEQ,
JISLTE,
JISGT,
JISGTE,
ISLT,
ISGT,
ISLTE,
ISGTE,
ISEQ,
JISF,
JIST,
GGET,
GSET,
KFUNC,
KONST,
MOV,
BOX,
UNBOX,
SET_BOX,
GUARD,
JGUARD,
JNGUARD,
VECTOR,
CLOSURE,
CLOSURE_GET,
CLOSURE_SET,
CLOSURE_PTR,
APPLY,
JFUNC,
JLOOP,
CALL,
LCALL,
CALLT,
LCALLT,
EQV,
JEQV,
JNEQV,
CONS,
CAR,
CDR,
MAKE_VECTOR,
MAKE_STRING,
VECTOR_REF,
STRING_REF,
VECTOR_LENGTH,
STRING_LENGTH,
VECTOR_SET,
STRING_SET,
SET_CAR,
SET_CDR,
WRITE,
WRITE_U8,
WRITE_DOUBLE,
SYMBOL_STRING,
STRING_SYMBOL,
CHAR_INTEGER,
INTEGER_CHAR,
OPEN,
CLOSE,
PEEK,
READ,
READ_LINE,
INEXACT,
EXACT,
ROUND,
SIN,
SQRT,
ATAN,
COS,
TRUNCATE,
FLOOR,
CEILING,
EXP,
LOG,
TAN,
ASIN,
ACOS,
CALLCC,
CALLCC_RESUME,
FILE_EXISTS,
DELETE_FILE,
INS_MAX
};
Loading

0 comments on commit 6f6035f

Please sign in to comment.