Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ml-proto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
NAME = wasm
NAME_OPT = $(NAME).opt
NAME_UNOPT = $(NAME)
DIRS = given host spec
DIRS = given host host/import spec
LIBS = str bigarray

OCB_FLAGS += # -use-ocamlfind
Expand Down
8 changes: 8 additions & 0 deletions ml-proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ The representation for that kernel language AST is defined in [kernel.ml](https:

## Implementation

The implementation is split into three directories:

* `spec`: the part of the implementation that corresponds to the actual language specification.

* `host`: infrastructure for loading and running scripts, parsing S-expressions, and defining host environment modules.

* `given`: auxiliary libraries.

The implementation consists of the following parts:

* *Abstract Syntax* (`ast.ml`, `kernel.ml`, `types.ml`, `source.ml[i]`). Notably, the `phrase` wrapper type around each AST node carries the source position information.
Expand Down
25 changes: 0 additions & 25 deletions ml-proto/host/builtins.ml

This file was deleted.

3 changes: 0 additions & 3 deletions ml-proto/host/builtins.mli

This file was deleted.

21 changes: 21 additions & 0 deletions ml-proto/host/import.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
open Source
open Kernel
open Values
open Types

module Unknown = Error.Make ()
exception Unknown = Unknown.Error (* indicates unknown import name *)

module Registry = Map.Make(String)
let registry = ref Registry.empty

let register name lookup = registry := Registry.add name lookup !registry

let lookup m i =
let {module_name; func_name; itype} = i.it in
let ty = List.nth m.it.types itype.it in
try Registry.find module_name !registry func_name ty with Not_found ->
Unknown.error i.at
("no function \"" ^ module_name ^ "." ^ func_name ^ "\" of requested type")

let link m = List.map (lookup m) m.it.imports
4 changes: 4 additions & 0 deletions ml-proto/host/import.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exception Unknown of Source.region * string

val link : Kernel.module_ -> Eval.import list (* raises Unknown *)
val register: string -> (string -> Types.func_type -> Values.func) -> unit
44 changes: 44 additions & 0 deletions ml-proto/host/import/env.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
(*
* Emulation of (a subset of) the `env` module currently used by Binaryen,
* so that we can run modules generated by Binaryen.
*)

open Values
open Types

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name env is confusing to me. The name waterfalltest was suggested in this PR; I'd be ok with that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please add a top-level comment to this file explaining what its purpose is. The text in the README.md is a good introduction, but we should be clear about what these various builtin modules are for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't just for the waterfall.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is it for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running compiled code as a stopgap until we have agreement on what libc should look like. When we have an agreed libc we'll likely do something like syscalls, and abort/exit will be simple renames. libc still won't be "standard", but it'll be an ad-hoc thing we end up using.

I'll be testing this on the waterfall, but something that only works on the waterfall is a silly idea so I want to avoid silly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this in a comment in the file then, so that we can all know what it is we're dealing with here.

Also, please rename the module to stopgap or something similarly descriptive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments to spectest and env modules explaining their purpose. PTAL

@sunfishcode, as explained before, the env module emulates the respective module imported by Binaryen code. Renaming it here would defeat the purpose. Binaryen would have to decide that.


let error msg = raise (Eval.Crash (Source.no_region, msg))

let type_error v t =
error
("type error, expected " ^ string_of_value_type t ^
", got " ^ string_of_value_type (type_of v))

let empty = function
| [] -> ()
| vs -> error "type error, too many arguments"

let single = function
| [] -> error "type error, missing arguments"
| [v] -> v
| vs -> error "type error, too many arguments"

let int = function
| Int32 i -> Int32.to_int i
| v -> type_error v Int32Type


let abort vs =
empty vs;
print_endline "Abort!";
exit (-1)

let exit vs =
exit (int (single vs))


let lookup name ty =
match name, ty.ins, ty.out with
| "abort", [], None -> abort
| "exit", [Int32Type], None -> exit
| _ -> raise Not_found
16 changes: 16 additions & 0 deletions ml-proto/host/import/spectest.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(*
* Simple collection of functions useful for writing test cases.
*)

open Types


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A top-level comment would be useful here as well. Something like "The spectest module provides functions that support the specialized testsuite execution environment."

let print vs =
List.iter Print.print_value (List.map (fun v -> Some v) vs);
None


let lookup name ty =
match name, ty.ins, ty.out with
| "print", _, None -> print
| _ -> raise Not_found
7 changes: 6 additions & 1 deletion ml-proto/host/main.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
let name = "wasm"
let version = "0.2"

let configure () =
Import.register "spectest" Spectest.lookup;
Import.register "env" Env.lookup

let banner () =
print_endline (name ^ " " ^ version ^ " spec interpreter")

Expand Down Expand Up @@ -32,7 +36,7 @@ let process file lexbuf start =
| Check.Invalid (at, msg) -> error at "invalid module" msg
| Eval.Trap (at, msg) -> error at "runtime trap" msg
| Eval.Crash (at, msg) -> error at "runtime crash" msg
| Builtins.Unknown (at, msg) -> error at "unknown built-in" msg
| Import.Unknown (at, msg) -> error at "unknown import" msg

let process_file file =
Script.trace ("Loading (" ^ file ^ ")...");
Expand Down Expand Up @@ -89,6 +93,7 @@ let argspec = Arg.align
let () =
Printexc.record_backtrace true;
try
configure ();
let files = ref [] in
Arg.parse argspec (fun file -> files := !files @ [file]) usage;
if !files = [] then Flags.interactive := true;
Expand Down
2 changes: 1 addition & 1 deletion ml-proto/host/script.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let run_cmd cmd =
Print.print_module_sig m
end;
trace "Initializing...";
let imports = Builtins.match_imports m in
let imports = Import.link m in
let host_params = {
Eval.has_feature = Params.has_feature
} in
Expand Down
12 changes: 6 additions & 6 deletions ml-proto/spec/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ let rec check_expr c et e =

| Call (x, es) ->
let {ins; out} = func c x in
check_exprs c ins es;
check_exprs c ins es e.at;
check_type out et e.at

| CallImport (x, es) ->
let {ins; out} = import c x in
check_exprs c ins es;
check_exprs c ins es e.at;
check_type out et e.at

| CallIndirect (x, e1, es) ->
let {ins; out} = type_ c.types x in
check_expr c (Some Int32Type) e1;
check_exprs c ins es;
check_exprs c ins es e.at;
check_type out et e.at

| GetLocal x ->
Expand Down Expand Up @@ -221,13 +221,13 @@ let rec check_expr c et e =
| Host (hostop, es) ->
let {ins; out}, has_mem = type_hostop hostop in
if has_mem then check_has_memory c e.at;
check_exprs c ins es;
check_exprs c ins es e.at;
check_type out et e.at

and check_exprs c ts es =
and check_exprs c ts es at =
let ets = List.map (fun x -> Some x) ts in
try List.iter2 (check_expr c) ets es
with Invalid_argument _ -> error (Source.ats es) "arity mismatch"
with Invalid_argument _ -> error at "arity mismatch"

and check_expr_opt c et eo at =
match et, eo with
Expand Down
2 changes: 1 addition & 1 deletion ml-proto/spec/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ let rec eval_expr (c : config) (e : expr) =

| CallImport (x, es) ->
let vs = List.map (fun ev -> some (eval_expr c ev) ev.at) es in
(import c x) vs
(try (import c x) vs with Crash (_, msg) -> Crash.error e.at msg)

| CallIndirect (ftype, e1, es) ->
let i = int32 (eval_expr c e1) e1.at in
Expand Down
1 change: 1 addition & 0 deletions ml-proto/spec/values.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type ('i32, 'i64, 'f32, 'f64) op =
Int32 of 'i32 | Int64 of 'i64 | Float32 of 'f32 | Float64 of 'f64

type value = (I32.t, I64.t, F32.t, F64.t) op
type func = value list -> value option


(* Typing *)
Expand Down
130 changes: 67 additions & 63 deletions ml-proto/winmake.bat
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
rem Auto-generated from Makefile!
set NAME=wasm
if '%1' neq '' set NAME=%1
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/float.cmo spec/float.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/numerics.cmi spec/numerics.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/int.cmo spec/int.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/types.cmo spec/types.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/f32.cmo spec/f32.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/f64.cmo spec/f64.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/i32.cmo spec/i32.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/i64.cmo spec/i64.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/values.cmo spec/values.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/memory.cmi spec/memory.mli
ocamlc.opt -c -bin-annot -I given -I spec -I host -o given/source.cmi given/source.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/kernel.cmo spec/kernel.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/eval.cmi spec/eval.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/float.cmo spec/float.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/numerics.cmi spec/numerics.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/int.cmo spec/int.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/types.cmo spec/types.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/f32.cmo spec/f32.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/f64.cmo spec/f64.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/i32.cmo spec/i32.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/i64.cmo spec/i64.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/values.cmo spec/values.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/memory.cmi spec/memory.mli
ocamlc.opt -c -bin-annot -I given -I spec -I host -I host/import -o given/source.cmi given/source.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/kernel.cmo spec/kernel.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/eval.cmi spec/eval.mli
ocamlyacc host/parser.mly
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/ast.cmo spec/ast.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/script.cmi host/script.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/parser.cmi host/parser.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/builtins.cmi host/builtins.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/check.cmi spec/check.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/flags.cmo host/flags.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/lexer.cmi host/lexer.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/main.cmo host/main.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/main.d.cmo host/main.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/error.cmi spec/error.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/print.cmi host/print.mli
ocamlc.opt -c -bin-annot -I given -I spec -I host -o given/lib.cmi given/lib.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/arithmetic.cmi spec/arithmetic.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/ast.cmo spec/ast.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/script.cmi host/script.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/parser.cmi host/parser.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/print.cmi host/print.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/check.cmi spec/check.mli
ocamlc.opt -c -bin-annot -I host/import -I spec -I given -I host -o host/import/env.cmo host/import/env.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/flags.cmo host/flags.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/import.cmi host/import.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/lexer.cmi host/lexer.mli
ocamlc.opt -c -bin-annot -I host/import -I spec -I given -I host -o host/import/spectest.cmo host/import/spectest.ml
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/main.cmo host/main.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/main.d.cmo host/main.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/error.cmi spec/error.mli
ocamlc.opt -c -bin-annot -I given -I spec -I host -I host/import -o given/lib.cmi given/lib.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/arithmetic.cmi spec/arithmetic.mli
ocamllex.opt -q host/lexer.mll
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/desugar.cmi spec/desugar.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -o host/params.cmo host/params.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/builtins.d.cmo host/builtins.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/check.d.cmo spec/check.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/eval.d.cmo spec/eval.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/flags.d.cmo host/flags.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/lexer.d.cmo host/lexer.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/parser.d.cmo host/parser.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/script.d.cmo host/script.ml
ocamlc.opt -c -g -bin-annot -I given -I spec -I host -o given/source.d.cmo given/source.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/error.d.cmo spec/error.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/kernel.d.cmo spec/kernel.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/print.d.cmo host/print.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/types.d.cmo spec/types.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/memory.d.cmo spec/memory.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/values.d.cmo spec/values.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/f32.d.cmo spec/f32.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/f64.d.cmo spec/f64.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/i64.d.cmo spec/i64.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/float.d.cmo spec/float.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/int.d.cmo spec/int.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/numerics.d.cmo spec/numerics.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/i32.d.cmo spec/i32.ml
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/f32_convert.cmi spec/f32_convert.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/f64_convert.cmi spec/f64_convert.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/i32_convert.cmi spec/i32_convert.mli
ocamlc.opt -c -bin-annot -I spec -I host -I given -o spec/i64_convert.cmi spec/i64_convert.mli
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/arithmetic.d.cmo spec/arithmetic.ml
ocamlc.opt -c -g -bin-annot -I given -I spec -I host -o given/lib.d.cmo given/lib.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/f32_convert.d.cmo spec/f32_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/f64_convert.d.cmo spec/f64_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/i32_convert.d.cmo spec/i32_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/i64_convert.d.cmo spec/i64_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/ast.d.cmo spec/ast.ml
ocamlc.opt -c -g -bin-annot -I spec -I host -I given -o spec/desugar.d.cmo spec/desugar.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -o host/params.d.cmo host/params.ml
ocamlc.opt str.cma bigarray.cma -g given/source.d.cmo spec/float.d.cmo spec/f32.d.cmo spec/f64.d.cmo spec/numerics.d.cmo spec/int.d.cmo spec/i64.d.cmo spec/types.d.cmo spec/i32.d.cmo spec/values.d.cmo spec/memory.d.cmo spec/kernel.d.cmo host/print.d.cmo spec/error.d.cmo given/lib.d.cmo spec/i32_convert.d.cmo spec/f32_convert.d.cmo spec/i64_convert.d.cmo spec/f64_convert.d.cmo spec/arithmetic.d.cmo spec/eval.d.cmo host/builtins.d.cmo host/flags.d.cmo host/params.d.cmo spec/ast.d.cmo spec/check.d.cmo spec/desugar.d.cmo host/script.d.cmo host/parser.d.cmo host/lexer.d.cmo host/main.d.cmo -o %NAME%
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/desugar.cmi spec/desugar.mli
ocamlc.opt -c -bin-annot -I host -I spec -I given -I host/import -o host/params.cmo host/params.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/check.d.cmo spec/check.ml
ocamlc.opt -c -g -bin-annot -I host/import -I spec -I given -I host -o host/import/env.d.cmo host/import/env.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/eval.d.cmo spec/eval.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/flags.d.cmo host/flags.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/import.d.cmo host/import.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/lexer.d.cmo host/lexer.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/parser.d.cmo host/parser.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/script.d.cmo host/script.ml
ocamlc.opt -c -g -bin-annot -I given -I spec -I host -I host/import -o given/source.d.cmo given/source.ml
ocamlc.opt -c -g -bin-annot -I host/import -I spec -I given -I host -o host/import/spectest.d.cmo host/import/spectest.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/error.d.cmo spec/error.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/kernel.d.cmo spec/kernel.ml
ocamlc.opt -c -g -bin-annot -I given -I spec -I host -I host/import -o given/lib.d.cmo given/lib.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/memory.d.cmo spec/memory.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/types.d.cmo spec/types.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/values.d.cmo spec/values.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/f32.d.cmo spec/f32.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/f64.d.cmo spec/f64.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/i64.d.cmo spec/i64.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/float.d.cmo spec/float.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/int.d.cmo spec/int.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/numerics.d.cmo spec/numerics.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/i32.d.cmo spec/i32.ml
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/f32_convert.cmi spec/f32_convert.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/f64_convert.cmi spec/f64_convert.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/i32_convert.cmi spec/i32_convert.mli
ocamlc.opt -c -bin-annot -I spec -I given -I host -I host/import -o spec/i64_convert.cmi spec/i64_convert.mli
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/arithmetic.d.cmo spec/arithmetic.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/f32_convert.d.cmo spec/f32_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/f64_convert.d.cmo spec/f64_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/i32_convert.d.cmo spec/i32_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/i64_convert.d.cmo spec/i64_convert.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/ast.d.cmo spec/ast.ml
ocamlc.opt -c -g -bin-annot -I spec -I given -I host -I host/import -o spec/desugar.d.cmo spec/desugar.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/params.d.cmo host/params.ml
ocamlc.opt -c -g -bin-annot -I host -I spec -I given -I host/import -o host/print.d.cmo host/print.ml
ocamlc.opt str.cma bigarray.cma -g given/source.d.cmo host/flags.d.cmo spec/error.d.cmo given/lib.d.cmo spec/float.d.cmo spec/f32.d.cmo spec/f64.d.cmo spec/numerics.d.cmo spec/int.d.cmo spec/i32.d.cmo spec/i64.d.cmo spec/i32_convert.d.cmo spec/f32_convert.d.cmo spec/i64_convert.d.cmo spec/f64_convert.d.cmo spec/types.d.cmo spec/values.d.cmo spec/memory.d.cmo spec/kernel.d.cmo spec/arithmetic.d.cmo spec/eval.d.cmo host/import.d.cmo host/import/env.d.cmo host/print.d.cmo host/import/spectest.d.cmo host/params.d.cmo spec/ast.d.cmo spec/check.d.cmo spec/desugar.d.cmo host/script.d.cmo host/parser.d.cmo host/lexer.d.cmo host/main.d.cmo -o %NAME%