-
Notifications
You must be signed in to change notification settings - Fork 517
Implement env.exit and env.abort #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
|
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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% |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name
envis confusing to me. The namewaterfalltestwas suggested in this PR; I'd be ok with that.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is it for?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
stopgapor something similarly descriptive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments to
spectestandenvmodules explaining their purpose. PTAL@sunfishcode, as explained before, the
envmodule emulates the respective module imported by Binaryen code. Renaming it here would defeat the purpose. Binaryen would have to decide that.