Skip to content
Snippets Groups Projects
Commit b5caea79 authored by charguer's avatar charguer Committed by Thomas Wood
Browse files

cleanup

parent a9526d51
No related branches found
No related tags found
No related merge requests found
...@@ -20,40 +20,46 @@ TESTS_ML := $(wildcard $(TESTS_DIR)/*.ml) ...@@ -20,40 +20,46 @@ TESTS_ML := $(wildcard $(TESTS_DIR)/*.ml)
JSREF_ML := $(wildcard $(TESTS_DIR)/$(JSREF_DIR)/*.ml) JSREF_ML := $(wildcard $(TESTS_DIR)/$(JSREF_DIR)/*.ml)
JSREF_MLI := $(wildcard $(TESTS_DIR)/$(JSREF_DIR)/*.mli) JSREF_MLI := $(wildcard $(TESTS_DIR)/$(JSREF_DIR)/*.mli)
###############################################################
# ASSEMBLY_JS must respect dependencies order # ASSEMBLY_JS must respect dependencies order
ASSEMBLY_JS := \ ASSEMBLY_JS_FILES := \
Ascii.log.js \ BinNums.unlog.js \
BinNums.log.js \ Bool0.unlog.js \
Bool0.log.js \ List0.unlog.js \
Datatypes.log.js \ Datatypes.unlog.js \
Fappli_IEEE_bits.log.js \ Fappli_IEEE_bits.unlog.js \
Fappli_IEEE.log.js \ Fappli_IEEE.unlog.js \
LibBool.log.js \ LibBool.unlog.js \
LibReflect.log.js \ LibReflect.unlog.js \
LibOperation.log.js \ LibOperation.unlog.js \
LibList.log.js \ LibList.unlog.js \
Heap.log.js \ LibString.unlog.js \
Shared.log.js \ LibOption.unlog.js \
LibString.log.js \ LibTactics.unlog.js \
LibOption.log.js \ LibProd.unlog.js \
LibFunc.unlog.js \
Heap.unlog.js \
Shared.unlog.js \
JsNumber.js \ JsNumber.js \
JsSyntax.log.js \ JsSyntax.unlog.js \
JsSyntaxAux.log.js \ JsSyntaxAux.unlog.js \
Translate_syntax.js \ Translate_syntax.js \
List0.log.js \ JsSyntaxInfos.unlog.js \
JsSyntaxInfos.log.js \ JsCommon.unlog.js \
JsCommon.log.js \ JsCommonAux.unlog.js \
JsCommonAux.log.js \
JsPreliminary.log.js \ JsPreliminary.log.js \
JsInit.log.js \ JsInit.unlog.js \
Prheap.js \ JsInterpreterMonads.unlog.js \
LibTactics.log.js \ JsInterpreter.log.js
LibProd.log.js \ ASSEMBLY_JS := $(STDLIB_DIR)/stdlib.js $(addprefix tests/jsref/,$(ASSEMBLY_JS_FILES));
LibFunc.log.js \
JsInterpreterMonads.log.js \
JsInterpreter.log.js \ ###############################################################
Specif.log.js
ASSEMBLY_JS := $(STDLIB_DIR)/stdlib.js $(addprefix tests/jsref/,$(ASSEMBLY_JS)); # --> todo arthur include src files
# JsPreliminary.log.js \
# JsInterpreter.log.js
############################################################### ###############################################################
......
ARTHUR
- remove "open JsNumber" to more easily trace occurences
- generate "type: " in smart constructors [optional until display is needed]
- generate the escaped source code
- control which file should feature logging
NEW TODO
- parse pickage in JsCommon needed for eval
========================================================= - optimize ML code for
NEXT type_compare mutability_compare prim_compare
and test for prim_compare if we can match on pairs of arguments, with a catchall
- move prim_compare and value_compare to a higher file because it is interesting and should be logged
- move same_value_dec from jscommonaux to a higher file
[arthur did a first pass on JsNumber.ml to make explicit paths - generate the escaped source code
and on stdlib.ml]
- continue cleaning up stdlib.ml - LATER: inline the "%able" functions
- implement stdlib.js
- remove unused functions
- sort out remaining ones
- need to have one function for each one of stdlib.ml
- replace JsNumber by a corresponding JsNumber.mli
(keep JsNumber saved somewhere else for future use)
- implement JsNumber.js by hand to match signature of JsNumber.mli,
by implementing number related functions using JS counterpart directly
(ask Alan for Int32 and Int64 implementation tricks)
- include JsNumber.js in assembly.js by modifying ASSEMBLY_JS in Makefile
- remove useless files such as LibReflect LibString etc... - LATER: remove useless files such as LibReflect LibString etc...
- in JsInterpreter let append = strappend (* hack for compatibility, to do cleanup *)
[alan or thomas] - BONUS -- generate "type: " in smart constructors [optional until display is needed]
- figure out what to do for Parser_syntax Parser_main
=========================================================
[our goal is to build trace for]
- Introduce testing functions called: - Introduce testing functions called:
- test_exec("code") -> parse, convert, build trace, log trace - test_exec("code") -> parse, convert, build trace, log trace
- Test first "var x = 3". - Test first "var x = 3".
...@@ -50,13 +41,16 @@ NEXT ...@@ -50,13 +41,16 @@ NEXT
for each example, check the AST, check step-by-step the execution. for each example, check the AST, check step-by-step the execution.
=> to see if the right things get highlighted => to see if the right things get highlighted
[second biggest, only once we manage to build the trace]
- display JS values/env/heap/ctx in html - display JS values/env/heap/ctx in html
- contexts: essentially as before - contexts: essentially as before
- environments: need to follow the list of environment records - environments: need to follow the list of environment records
- heap: same as before, and do not attempt at first to show - heap: same as before, and do not attempt at first to show
additional information in the heap appart from key/value bindings. additional information in the heap appart from key/value bindings.
- BONUS in JsInterpreter let append = strappend (* hack for compatibility, to do cleanup *)
========================================================= =========================================================
LATER LATER
......
...@@ -176,16 +176,6 @@ val (!) : 'a ref -> 'a ...@@ -176,16 +176,6 @@ val (!) : 'a ref -> 'a
val ( === ) : 'a -> 'a -> bool val ( === ) : 'a -> 'a -> bool
(*--------------------*)
(* no longer needed it seems
module Pervasives : sig
val succ : int -> int
end
*)
(*--------------------*) (*--------------------*)
(* todo: remove when JsNumber.ml becomes .mli file *) (* todo: remove when JsNumber.ml becomes .mli file *)
...@@ -204,32 +194,6 @@ module Int32 : sig ...@@ -204,32 +194,6 @@ module Int32 : sig
end end
(*--------------------*)
(* figure out how to deal with parser *)
module Parser_syntax : sig (* needed by translate_syntax.mli and by parser_main (below) *)
type unary_op
type arith_op
type bin_op
type exp
end
module Parser_main : sig
val exp_from_string : ?force_strict:bool -> string -> Parser_syntax.exp
end
(* ARTHUR: not needed -- tocheck
module Parser : sig
exception ParserFailure of string
exception InvalidArgument
end
*)
(*--------------------*) (*--------------------*)
(* JSRef specific functions, useful for debugging *) (* JSRef specific functions, useful for debugging *)
...@@ -243,32 +207,3 @@ val prerr_endline : string -> unit ...@@ -243,32 +207,3 @@ val prerr_endline : string -> unit
val raise : exn -> 'a val raise : exn -> 'a
val stuck : string -> 'a val stuck : string -> 'a
(*--------------------*)
(* deprecated *)
(* should not be needed if we don't use JsNumber.ml *)
(*
module Int64 : sig
val one : int64
val float_of_bits : int64 -> float
end
module List : sig (* should rely on List0 instead *)
val map : ('a -> 'b) -> 'a list -> 'b list
val rev : 'a list -> 'a list
end
module String : sig (* should rely on String0 instead *)
val length : string -> int
val append : string -> string -> string
val sub : string -> int -> int -> string
val concat : string -> string list -> string
val iter : (char -> unit) -> string -> unit
val make : int -> char -> string
val get : string -> int -> char
end
*)
...@@ -584,7 +584,7 @@ let elision_tail_remove ol = ...@@ -584,7 +584,7 @@ let elision_tail_remove ol =
let parse_pickable = (fun s strict -> let parse_pickable = (fun s strict ->
let str = s in let str = s in
(* try ARTHUR HACK *) (* try ARTHUR HACK *)
let parserExp = Parser_main.exp_from_string ~force_strict:strict str in let parserExp = Translate_syntax.Parser_main.exp_from_string ~force_strict:strict str in
Some (JsSyntaxInfos.add_infos_prog strict Some (JsSyntaxInfos.add_infos_prog strict
(Translate_syntax.exp_to_prog parserExp)) (Translate_syntax.exp_to_prog parserExp))
(* with (* with
......
type 'a coq_sig =
'a
(* singleton inductive, whose constructor was exist *)
exception CoqSyntaxDoesNotSupport of string module Parser_syntax : sig (* needed by translate_syntax.mli and by parser_main (below) *)
exception Empty_list type unary_op
type arith_op
type bin_op
type exp
end
module Parser_main : sig
val exp_from_string : ?force_strict:bool -> string -> Parser_syntax.exp
end
exception CoqSyntaxDoesNotSupport of string
exception Empty_list
val string_to_coq : string -> char list val string_to_coq : string -> char list
val unary_op_to_coq : Parser_syntax.unary_op -> JsSyntax.unary_op val unary_op_to_coq : Parser_syntax.unary_op -> JsSyntax.unary_op
val arith_op_to_coq : Parser_syntax.arith_op -> JsSyntax.binary_op val arith_op_to_coq : Parser_syntax.arith_op -> JsSyntax.binary_op
val bin_op_to_coq : Parser_syntax.bin_op -> JsSyntax.binary_op val bin_op_to_coq : Parser_syntax.bin_op -> JsSyntax.binary_op
val exp_to_literal : Parser_syntax.exp -> JsSyntax.literal val exp_to_literal : Parser_syntax.exp -> JsSyntax.literal
val exp_to_exp : Parser_syntax.exp -> JsSyntax.expr val exp_to_exp : Parser_syntax.exp -> JsSyntax.expr
val exp_to_stat : Parser_syntax.exp -> JsSyntax.stat val exp_to_stat : Parser_syntax.exp -> JsSyntax.stat
val exp_to_prog : Parser_syntax.exp -> JsSyntax.prog val exp_to_prog : Parser_syntax.exp -> JsSyntax.prog
val exp_to_elem : Parser_syntax.exp -> JsSyntax.element val exp_to_elem : Parser_syntax.exp -> JsSyntax.element
val exp_to_funcbody : val exp_to_funcbody :
Parser_syntax.exp -> JsSyntax.strictness_flag -> JsSyntax.funcbody Parser_syntax.exp -> JsSyntax.strictness_flag -> JsSyntax.funcbody
val coq_syntax_from_file : ?init:bool -> string -> JsSyntax.prog val coq_syntax_from_file : ?init:bool -> string -> JsSyntax.prog
val coq_syntax_from_string : string -> JsSyntax.prog val coq_syntax_from_string : string -> JsSyntax.prog
val coq_syntax_from_main : string -> JsSyntax.prog val coq_syntax_from_main : string -> JsSyntax.prog
(* (*
module Translate_syntax : sig (* ARTHUR: to implement *) module Translate_syntax : sig (* ARTHUR: to implement *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment