summaryrefslogtreecommitdiff
path: root/readme.md
blob: 7c28d83542ae553a813a705cf6055a5218552042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# parscan

Parscan is an experimental project to test a single parser to multiple
languages and virtual machines.

The first language definition is a subset of Go, enough to implement
simple benchmarks, as fibonacci numbers.

The first VM is a stack machine, operated by walking  directly the AST.

The next step is to add a byte-code based VM and the corresponding byte code
generator.

Further steps is to get closer to full Go spec and / or introduce new
languages definitions and new VM implementations.

Note: this is highly experimental and unstable.


## Usage

`go run ./cmd/gint < ./samples/fib`

To debug visually the AST, you can set the `DOT` env to a command able
to a display a graphviz dot input, such as `dot -Txlib` or `dotty -`
(for old graphviz versions like mine):

`DOT="dot -Txlib" go run ./cmd/gint < ./samples/fib`