Skip to content

Commit

Permalink
*: update README and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Dec 21, 2017
1 parent 3aa0b0e commit 16ae755
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.PHONY: all kl shen esc
.PHONY: all kl shen esc generate

all: shen kl

generate:
generate: esc
${GOPATH}/bin/esc -o vm/asset.go -pkg=vm bytecode

esc: ${GOPATH}/bin/esc
go get github.com/mjibson/esc
go get -u -v github.com/mjibson/esc

kl:
go install github.com/tiancaiamao/shen-go/cmd/kl

shen:
go install github.com/tiancaiamao/shen-go/cmd/shen
go build -o shen cmd/shen/main.go

test:
go test github.com/tiancaiamao/shen-go/vm
Expand Down
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,62 @@ Shen is a portable functional programming language by [Mark Tarver](http://markt

shen-go is a port of the Shen language that runs on top of Go implementations.

There is a klambda interpreter that is available, but it's quite slow. Right now I'm working on a bytecode compiler.

## Building

Make sure you have [Go installed](https://golang.org/doc/install).

```
go get github.com/tiancaiamao/shen-go/cmd/kl
make shen
```

## Running

```
$GOPATH/bin/kl -shen
./shen
```

This binary has no dependency, you can move it to any where you want.

## Testing

```
cd $GOPATH/src/github.com/tiancaiamao/shen-go/ShenOSKernel-20.1/tests
$GOPATH/bin/kl -shen
cd ShenOSKernel-20.1/tests
../../shen
(load "README.shen")
(load "tests.shen")
```

## Bootstrap from scratch

Run shen repl, then

```
(load "compiler/primitive.shen")
```

This would compile all necessary shen files into bytecode.

Move the `.bc` files to bytecode directory

```
mv ShenOSKernel-20.1/sources/*.bc bytecode/
mv compiler/*.bc bytecode/
```

And try it with

```
./shen -boot=true
```

If everything is ok, you can embedded those bytecode files into `asset.go`

```
make generate
```

And make shen again to get the new binary.

## Learn Shen
* [Official website of Shen](http://shenlanguage.org/)
* [The Shen OS Kernel Manual](http://shenlanguage.org/learn-shen/index.html)
Expand Down

0 comments on commit 16ae755

Please sign in to comment.