Skip to content
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

Webassembly backend #153

Merged
merged 141 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
d7e309f
feature(wasm) per-module extraction and add wasm_ast to compiler
jeromesimeon Jun 24, 2020
cfafc2d
feature(wasm) Add preliminary wasm backend
pkel Jun 28, 2020
a7631f8
Compile a few more operators and add testing
pkel Jun 29, 2020
be379ea
Fix ejson object & array allocation.
pkel Jun 30, 2020
0de40ef
Implement Ejson operators in AssemblyScript.
pkel Jul 3, 2020
9b4cec0
Write/read Ejson to/from Assemblyscript managed memory.
pkel Jul 5, 2020
82361af
Add debugging runtime for pre Assemblyscript modules.
pkel Jul 6, 2020
4d3941c
Compile Imp operators as imported functions.
pkel Jul 7, 2020
a93b2f8
Compile constants (not strings and foreign)
pkel Jul 7, 2020
13dde47
Link runtime with compiled module and execute.
pkel Jul 7, 2020
5cfec3e
Compile string constants and parts of EJsonRuntimeOperator.
pkel Jul 7, 2020
64de200
Improve compilation of contants.
pkel Jul 9, 2020
ed5142f
Delete redundant OCaml modules.
pkel Jul 9, 2020
f9810ce
Improve String constant allocation.
pkel Jul 9, 2020
8180387
High priority runtime operators (#133).
pkel Jul 10, 2020
f5d3f14
Add some unit tests for a subset of operators
pkel Jul 10, 2020
9f4da3a
Compile BigInt's as f64.
pkel Jul 13, 2020
fec164e
Test runtimeCompare operator on BigInt. Fix BigInt write.
pkel Jul 13, 2020
420a612
Test runtimeRecConcat and runtimeRecDot.
pkel Jul 13, 2020
c369f88
Test runtime operators Either / ToLeft / ToRight.
pkel Jul 13, 2020
1713bd7
WIP(Imp) An ImpEJson parser proof of concept
jeromesimeon Jul 13, 2020
9ac1ea8
WIP(imp) Generalizes runtime calls in imp parser
jeromesimeon Jul 13, 2020
1c3413a
WIP(imp) functions always contain a block, more tests
jeromesimeon Jul 14, 2020
d133933
WIP(Imp) Add objects / array constructors to parser + more tests
jeromesimeon Jul 14, 2020
e54329c
fix(test) Remove generated files from tests
jeromesimeon Jul 14, 2020
3071fb5
Compile if statements
pkel Jul 14, 2020
adf7e68
Compile for loop (range style)
pkel Jul 14, 2020
12e27e0
Compile for loops (for each style)
pkel Jul 14, 2020
ab5f5ff
Fix type of opMathTrunc
pkel Jul 14, 2020
8713dcd
Support runtime array creation.
pkel Jul 14, 2020
b349517
Construct objects at runtime (opOpject operator).
pkel Jul 15, 2020
a417824
Small clean-up
pkel Jul 15, 2020
ab84ddc
fix(Wasm) add to_string to Wasm_ast API
jeromesimeon Jul 18, 2020
59e459a
fix(Imp) Make imp truly polymorphic in foreign model after extraction
jeromesimeon Jul 19, 2020
95cd57e
fix(Imp) Also make imp truly polymorphic in foreign ops after extraction
jeromesimeon Jul 19, 2020
ba2e465
fix(imp) remove brand runtime operator from ImpEJson
jeromesimeon Jul 23, 2020
2e74dc4
Binary EJson (Assemblyscript/Runtime)
pkel Jul 24, 2020
f957908
Binary EJson (Ocaml) (WIP)
pkel Jul 24, 2020
2c7fdce
Binary EJson (Ocaml): Add type variables for (c)ejson
pkel Jul 24, 2020
662c64f
Binary EJson (Ocaml)
pkel Jul 26, 2020
bc23301
Run compiled Wasm modules on spec interpreter
pkel Jul 27, 2020
c21e3b7
Allocate compiled constants using binary EJson encoding.
pkel Jul 28, 2020
9a31b6c
Provide brand hierarchy to wasm eval
pkel Aug 1, 2020
35c4409
Encode BigInt as i64 in wasm runtime
pkel Aug 1, 2020
b2185b4
Functorize Wasm backend.
pkel Aug 2, 2020
7952c4a
Support multi function Imp.lib
pkel Aug 2, 2020
e6c37a5
Add runtimeCast and runtimeUnbrand operators.
pkel Aug 4, 2020
73c7bc5
Fix assemblyscript tests
pkel Aug 10, 2020
a1ef9a7
Binary encode JS EJson values and hand them to Wasm runtime.
pkel Aug 10, 2020
99d0d47
Decode binary EJson in JS and read values from Wasm runtime.
pkel Aug 11, 2020
11c030f
Invoke compiled wasm with binary encoded EJson arguments und result.
pkel Aug 11, 2020
7409347
Wasm runtime: produce nicer error messages for mising keys.
pkel Aug 12, 2020
667a32c
Wasm engine: avoid hard coding of the invoked function.
pkel Aug 12, 2020
f9b3dfc
chore(8.12) Rebase and updates for Coq 8.11/8.12
jeromesimeon Aug 13, 2020
1b42f97
fix(WASM) Add type hierarchy to EJson -> WASM compile code
jeromesimeon Aug 14, 2020
53fa2a1
Wasm: Compile brand hierarchy into module.
pkel Aug 14, 2020
baa8974
feature(wasm) Add binary wasm target to compiler
jeromesimeon Aug 17, 2020
36ca10e
Downgrade to wasm.1.0.*
pkel Aug 18, 2020
2104541
fix(WASM) compilation of if-then-else
pkel Aug 19, 2020
2590c9d
fix(WASM) flip sign of EJsonRuntimeCompare
pkel Aug 19, 2020
0c9206b
fix(wasm) Add float to nat conversion to runtime
jeromesimeon Aug 20, 2020
238449f
fix(wasm) Uses <i64> casting syntax for integer coercion in runtime
jeromesimeon Aug 20, 2020
215613e
Rename Imp variables for wasm function scoping (OCaml)
pkel Aug 20, 2020
9e9a4d2
fix(wasm) Fixes some tests
jeromesimeon Aug 20, 2020
4cf5926
test(wasm) One more block scoping test for wasm
jeromesimeon Aug 20, 2020
21aa621
fix(test) comments
jeromesimeon Aug 20, 2020
a3cd52d
chore(wasm) clean-up imp_ejson tests
pkel Aug 21, 2020
a822285
fix(wasm) return None on failed eval
pkel Aug 21, 2020
1db4c9e
fix(wasm) cast operator does not change the object
pkel Aug 21, 2020
fb8452b
chore(wasm) remove unmaintained OQL->wasm tests
pkel Aug 21, 2020
2e3dae6
feature(wasm) Add union and distinct to runtime
jeromesimeon Aug 21, 2020
68124fa
fix(wasm) Catches errors in cli-runner invoke
jeromesimeon Aug 21, 2020
047f211
fix(wasm) Slightly more consistent error
jeromesimeon Aug 21, 2020
aa9b0b4
fix(wasm) more on cli-runner error
jeromesimeon Aug 21, 2020
798fb84
fix(wasm) Another fix to error in cli-runner.js
jeromesimeon Aug 21, 2020
693c3a6
feature(wasm) Add array flatten to runtime
jeromesimeon Aug 21, 2020
59f7741
chore(wasm) ship wasm runtime in OCaml module.
pkel Aug 21, 2020
0ebaa74
fix(build) build runtimes before compiler
jeromesimeon Aug 22, 2020
162c8ca
fix(wasm) promote generated wasm_runtime.ml to source dir
pkel Aug 30, 2020
d6aa5c5
test(imp) Add expected output to imp_ejson tests
jeromesimeon Sep 2, 2020
f8793e7
fix(js) Fixes union in JS runtime, breaking when both inputs are same…
jeromesimeon Sep 2, 2020
eb22630
test(imp) Run imp_ejson tests by default
jeromesimeon Sep 2, 2020
124640f
feature(Wasm) Add array access and integer subtraction to runtime
jeromesimeon Sep 2, 2020
ff652b9
fix(test) systematically test wasm_ast target for imp_ejson
jeromesimeon Sep 2, 2020
b79dce3
Add imp_ejson rewrite: for loops + blocks hook
jeromesimeon Sep 2, 2020
33626a1
fix(wasm) runtimeArrayAccess should not return optional result.
pkel Sep 2, 2020
882048d
fix(wasm) track binary runtime.wasm in git
pkel Sep 2, 2020
9df4adb
proof(imp) A little bit more of the for loop rewrite proven
jeromesimeon Sep 3, 2020
3014d91
Avoid bootstrapping problems with better documentation
pkel Jan 29, 2021
18427ae
Ensure reproducible build of assemblyscript runtime
pkel Jan 29, 2021
3299eb2
fix(wasm) Assemblyscript runtime Makefile
pkel Jan 29, 2021
67415ff
Rewrite WASM test in Makefile
pkel Jan 29, 2021
98ab5bf
fix(wasm) we forgot update the test for commit 99495709c97c3
pkel Feb 19, 2021
297233e
Run assemblyscript runtime tests in circleci
pkel Feb 19, 2021
05b206f
Add some comments to the Assemblyscript runtime
pkel Feb 19, 2021
5ce4d7a
More assemblyscript/wasm runtime cleaning
pkel Feb 19, 2021
f3198f7
Assemblyscript/Wasm runtime does not mutate values.
pkel Feb 19, 2021
f4235be
Delete severely outdated wasm runtime
pkel Feb 19, 2021
0c03493
assemblyscript-runtime: add placeholders for all EJsonRuntimeOperators
pkel Mar 8, 2021
993fa4c
wasm-backend: compile all trivial operators
pkel Mar 12, 2021
c19cd96
wasm: disable OQL test relying on RuntimeForeign op
pkel Mar 12, 2021
c2bed8d
wasm-backend: catch errors and return as EJson
pkel Mar 12, 2021
b361255
wasm-runtime: throw nicer errors
pkel Mar 12, 2021
b46b147
wasm-backend: return Assemblyscript error messages
pkel Mar 12, 2021
aecefe0
wasm-runtime: check-in latest build
pkel Mar 12, 2021
8cd3024
test(imp) A few more tests
jeromesimeon Sep 4, 2020
18982f2
Wasm/Imp operator tests proof-of-concept
pkel May 4, 2021
e97beec
Fix circleci test: `make test` requires opam/dune
pkel May 4, 2021
14651b5
Test operators with object/array ejson arguments
pkel May 5, 2021
2ac4884
Improve test failure reports
pkel May 5, 2021
96df137
Implement wasm/runtimeRecMerge operator
pkel May 5, 2021
8ca658f
Implement wasm/runtimeRecRemove; fix runtimeRecConcat, runtimeRecMerge
pkel May 5, 2021
6196b8b
Implement wasm/EJsonRuntimeRecProject
pkel May 5, 2021
1a44571
Implement wasm/EJsonRuntimeMinus
pkel May 5, 2021
bec768a
Implement wasm/EJsonRuntimeNth
pkel May 5, 2021
34c4e01
Implement wasm/runtimeCount (redundant with opArrayLength)
pkel May 5, 2021
0621272
Test wasm/runtimeUnbrand and wasm/runtimeCast
pkel May 6, 2021
012a951
Implement wasm/runtimeToString
pkel May 6, 2021
f0f66d0
Revise assemblyscript build
pkel May 7, 2021
f91de47
Fixup for #154
pkel May 7, 2021
7bb3300
Implement wasm/EJsonOpAccess, EJsonOpHasOwnProperty; test EJsonOpArra…
pkel May 7, 2021
788e03e
Test wasm/opMath*
pkel May 7, 2021
d6be6df
Test wasm/opRuntimeArray
pkel May 7, 2021
c9fab28
Compile wasm/EJsonOpArray
pkel May 7, 2021
bacf5a8
chore(build) Bump up version for opam
jeromesimeon May 7, 2021
3fe9242
Align Js_runtime build and Assemblyscript_runtime build.
pkel May 10, 2021
25ecb40
Implement wasm/EJsonRuntimeMin and EJsonRuntimeMax
pkel May 31, 2021
07f68c0
Implement wasm/EJsonRuntime(Contains|Length|Substring|SubstringEnd|St…
pkel May 31, 2021
f6c5e87
Test existing EJsonRuntimeNat* operators
pkel May 31, 2021
8a000b7
Implement wasm/runtimeNatLog2 and runtimeNatSqrt
pkel May 31, 2021
85407ae
Implement wasm/runtimeNat(Sum|Min|Max|ArithMean)
pkel May 31, 2021
e1e9d1b
Implement wasm/runtimeFloat(Sum|Min|Max|ArithMean)
pkel May 31, 2021
0daf997
Assemblyscript runtime build: ignore local node_modules
pkel Jun 1, 2021
3a04a14
Complete wasm runtime EJson compare
pkel Jun 1, 2021
c6dd860
Implement wasm/EJsonRuntimeLike
pkel Jun 2, 2021
8cea5a2
Align wasm/EJsonRuntime(Compare|Equal) with coq/Imp.
pkel Jun 2, 2021
4d47414
feature(wasm) Add some foreign type hooks for WASM
jeromesimeon Jun 2, 2021
7dd31ae
feature(wasm) Add foreign operator hook for Wasm backend
jeromesimeon Jun 3, 2021
e12b479
Wasm: translate EJsonRuntimeForeign using new hooks
pkel Jun 8, 2021
cee41d9
Fixup for 0b855ee: Wasm: translate EJsonRuntimeForeign using new hooks
pkel Jun 8, 2021
865228d
Run Imp/Wasm tests on NodeJS
pkel Sep 10, 2021
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ common_steps: &common_steps
- run:
name: 'Testing'
command: |
eval $(opam env)
make test
# Save test results
- store_test_results:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ log/
*.vo
*.vos
*.vok
*.vio
*.v.d
*.glob
*.aux
Expand Down
36 changes: 8 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ all:
@$(MAKE) install-local

build:
@$(MAKE) qcert-compiler
@$(MAKE) MAKEFLAGS= qcert-runtimes
@$(MAKE) qcert-compiler
@$(MAKE) MAKEFLAGS= qcert-cli

clean: Makefile.coq remove_all_derived
Expand All @@ -51,6 +51,7 @@ cleanmost: Makefile.coq
- @rm -f *~

cleanall: Makefile.coq remove_all_derived
- @$(MAKE) cleanall-runtimes
- @$(MAKE) cleanall-qcert-compiler
- @$(MAKE) cleanmost

Expand All @@ -60,7 +61,7 @@ cleanall: Makefile.coq remove_all_derived
install-coqdev:
@$(MAKE) -f Makefile.coq install

install-local:
install-local:
@$(MAKE) install-ocaml
ifneq ($(JAVASCRIPT),)
@$(MAKE) install-javascript
Expand Down Expand Up @@ -112,17 +113,11 @@ cleanmost-qcert-compiler:

## Configure

runtimes/javascript/qcert_runtime.ml:
$(MAKE) -C runtimes/javascript

compiler/lib/js_runtime.ml: runtimes/javascript/qcert_runtime.ml
cp runtimes/javascript/qcert_runtime.ml compiler/lib/js_runtime.ml

compiler/lib/static_config.ml:
echo "(* This file is generated *)" > compiler/lib/static_config.ml
echo "let qcert_home = \"$(CURDIR)\"" >> compiler/lib/static_config.ml

prepare: compiler/lib/js_runtime.ml compiler/lib/static_config.ml Makefile.coq
prepare: compiler/lib/static_config.ml Makefile.coq

configure:
@echo "[Q*cert] "
Expand All @@ -133,8 +128,6 @@ configure:
clean-configure:

cleanall-configure:
$(MAKE) -C runtimes/javascript cleanall
rm -rf compiler/lib/js_runtime.ml
rm -rf compiler/lib/static_config.ml
rm -f compiler/.merlin compiler/*/.merlin

Expand Down Expand Up @@ -242,22 +235,13 @@ qcert-runtimes:
@echo "[Q*cert] "
@echo "[Q*cert] Building runtimes"
@echo "[Q*cert] "
ifneq ($(JAVASCRIPT),)
@$(MAKE) javascript-runtime
endif
ifneq ($(JAVA),)
@$(MAKE) java-runtime
endif
ifneq ($(SPARK),)
@$(MAKE) spark2-runtime
endif

javascript-runtime:
@echo "[Q*cert] "
@echo "[Q*cert] JavaScript runtime"
@echo "[Q*cert] "
@$(MAKE) -C runtimes/javascript

java-runtime:
@echo "[Q*cert] "
@echo "[Q*cert] Java runtime"
Expand All @@ -271,14 +255,12 @@ spark2-runtime:
@$(MAKE) -C runtimes/spark2

clean-runtimes:
- @$(MAKE) -C runtimes/javascript clean
- @$(MAKE) -C runtimes/java clean
- @$(MAKE) -C runtimes/spark2 clean
- @rm -rf bin/lib
- @rm -f bin/javaRunner.jar

cleanall-runtimes:
- @$(MAKE) -C runtimes/javascript cleanall
- @$(MAKE) -C runtimes/java cleanall
- @$(MAKE) -C runtimes/spark2 cleanall
- @rm -rf bin/lib
Expand Down Expand Up @@ -336,10 +318,7 @@ demo:
bin/qcertJS.js:
@$(MAKE) qcert-javascript

runtimes/javascript/qcert-runtime.js:
@$(MAKE) javascript-runtime

qcert-demo: bin/qcertJS.js runtimes/javascript/qcert-runtime.js
qcert-demo: bin/qcertJS.js
@echo "[Q*cert] "
@echo "[Q*cert] Compiling Web Demo in TypeScript"
@echo "[Q*cert] "
Expand All @@ -355,6 +334,7 @@ cleanall-demo: clean-demo
## Tests

test:
dune runtest
@$(MAKE) -C tests

clean-test:
Expand All @@ -370,10 +350,10 @@ docs:
## Misc

clean_detritus:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 scripts/remove_detritus_derived_file.sh
@find . \( -name '*.vo' -or -name '*.vos' -or -name '*.vok' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 scripts/remove_detritus_derived_file.sh

remove_all_derived:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 rm -f
@find . \( -name '*.vo' -or -name '*.vos' -or -name '*.vok' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 rm -f

Makefile.coq: Makefile Makefile.coq_modules $(FILES)
@coq_makefile -f _CoqProject $(FILES) -o Makefile.coq
Expand Down
21 changes: 19 additions & 2 deletions Makefile.coq_modules
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ MODULES = \
Utils/ListAdd \
Utils/StringAdd \
Utils/SortingAdd \
Utils/FloatAdd \
Utils/NativeString \
Utils/Float \
Utils/Lattice \
Utils/Monoid \
Utils/Assoc \
Expand Down Expand Up @@ -63,6 +63,10 @@ MODULES = \
JSON/Model/JSONNorm \
JSON/JSONRuntime \
JSON/JSONSystem \
WSON/Model/ForeignWSON \
WSON/Operators/ForeignWSONRuntime \
WSON/WSONRuntime \
WSON/WSONSystem \
EJson/Model/ForeignEJson \
EJson/Model/EJson \
EJson/Model/EJsonNorm \
Expand Down Expand Up @@ -120,6 +124,7 @@ MODULES = \
Translation/Model/DataToEJson \
Translation/Model/ForeignEJsonToJSON \
Translation/Model/EJsonToJSON \
Translation/Model/ForeignEJsonToWSON \
Translation/Model/EJsonToEJsonMut \
Translation/Model/ForeignTypeToJSON \
Translation/Model/TypeToJSON \
Expand Down Expand Up @@ -261,6 +266,7 @@ MODULES = \
Imp/ImpSystem \
Imp/Optim/ImpOptimizerEngine \
Imp/Optim/ImpEJsonRewrite \
Imp/Optim/ImpEJsonBlockRewrite \
Imp/Optim/ImpEJsonOptimizer \
Imp/ImpOptim \
NNRCMR/Lang/ForeignReduceOps \
Expand Down Expand Up @@ -342,12 +348,19 @@ MODULES = \
SparkDF/Lang/SparkDF \
SparkDF/SparkDFRuntime \
SparkDF/SparkDFSystem \
WasmAst/Lang/WasmAst \
WasmAst/WasmAstRuntime \
WasmAst/WasmAstSystem \
WasmBinary/Lang/WasmBinary \
WasmBinary/WasmBinaryRuntime \
WasmBinary/WasmBinarySystem \
Translation/Operators/ForeignToReduceOps \
Translation/Operators/ForeignToJavaScriptAst \
Translation/Operators/ForeignToJava \
Translation/Operators/ForeignToScala \
Translation/Operators/ForeignToSpark \
Translation/Operators/ForeignToEJsonRuntime \
Translation/Operators/ForeignToWasmAst \
Translation/Lang/NRAtocNNRC \
Translation/Lang/cNRAEnvtocNNRC \
Translation/Lang/cNRAEnvtoNRA \
Expand Down Expand Up @@ -382,6 +395,8 @@ MODULES = \
Translation/Lang/NNRCtoJava \
Translation/Lang/DatatoSparkDF \
Translation/Lang/tDNNRCtoSparkDF \
Translation/Lang/ImpEJsontoWasmAst \
Translation/Lang/WasmAsttoWasmBinary \
Translation/Typing/TNRAtocNNRC \
Translation/Typing/TcNRAEnvtocNNRC \
Translation/Typing/TcNNRCtoCAMP \
Expand Down Expand Up @@ -426,8 +441,10 @@ MODULES = \
Compiler/Enhanced/EnhancedEJson \
Compiler/Enhanced/EnhancedDataToEJson \
Compiler/Enhanced/EnhancedEJsonToJSON \
Compiler/Enhanced/EnhancedEJsonToWSON \
Compiler/Enhanced/EnhancedToJava \
Compiler/Enhanced/EnhancedToJavascriptAst \
Compiler/Enhanced/EnhancedToWasmAst \
Compiler/Enhanced/EnhancedReduceOps \
Compiler/Enhanced/EnhancedToReduceOps \
Compiler/Enhanced/EnhancedToSpark \
Expand All @@ -453,4 +470,4 @@ MODULES = \
Tests/SQLTest \
Tests/LambdaNRATest \
Tests/CompilerTest \
Tests/HelloWorld \
Tests/HelloWorld
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ $ opam repo add coq-released https://coq.inria.fr/opam/released
$ opam install . --deps-only
```

*Warning:* It seems that coq and/or the Q\*cert build process does not like opam local switches.
If you want to use a separate opam switch for Q\*cert, we recommend creating a new named global switch *before* executing the above steps.

```
$ opam switch create qcert 4.09.1
```

#### Java (Recommended)

Parsers for SQL, SQL++, and ODM rules, the Q\*cert runtime for the Java compilation target, as well as utilities for running compiled queries are written in Java and require a Java 8 compiler.
Expand Down
2 changes: 1 addition & 1 deletion cli/nodejs/lib/qcertRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class QcertRunner {
const gconf = QcertRunner.configure('oql',schema,compiledQuery,output);
input = BoxedCollections.boxColl(input);
if (validate) {
if (output) {
if (output !== undefined) {
let result = QcertRunner.executeCompiled(schema,queryFile,compiledQuery,input);
result = BoxedCollections.unboxColl(result);
return QcertRunner.validate(gconf,queryFile,'js',output,result)
Expand Down
55 changes: 28 additions & 27 deletions cli/ocaml/qcert.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ open Qcert_lib
open Util
open Logger
open Config
open Core.EnhancedCompiler
open CompLang
open EnhancedCompiler.EnhancedCompiler
open Logger_to_sexp

(* Command line args *)
Expand Down Expand Up @@ -114,30 +115,30 @@ let args_list gconf =
let anon_args input_files f = input_files := f :: !input_files

let languages =
[ Core.L_camp_rule;
Core.L_camp;
Core.L_tech_rule;
Core.L_designer_rule;
Core.L_oql;
Core.L_sql;
Core.L_sqlpp;
Core.L_lambda_nra;
Core.L_nra;
Core.L_nraenv;
Core.L_nraenv_core;
Core.L_nnrc;
Core.L_nnrc_core;
Core.L_nnrs;
Core.L_nnrs_core;
Core.L_imp_data;
Core.L_imp_ejson;
Core.L_nnrcmr;
Core.L_dnnrc;
Core.L_dnnrc_typed;
Core.L_js_ast;
Core.L_javascript;
Core.L_java;
Core.L_spark_df; ]
[ L_camp_rule;
L_camp;
L_tech_rule;
L_designer_rule;
L_oql;
L_sql;
L_sqlpp;
L_lambda_nra;
L_nra;
L_nraenv;
L_nraenv_core;
L_nnrc;
L_nnrc_core;
L_nnrs;
L_nnrs_core;
L_imp_data;
L_imp_ejson;
L_nnrcmr;
L_dnnrc;
L_dnnrc_typed;
L_js_ast;
L_javascript;
L_java;
L_spark_df; ]


let languages_string =
Expand All @@ -156,8 +157,8 @@ let parse_args () =
let gconf =
{ gconf_qname = None;
gconf_class_name = None;
gconf_source = Core.L_camp_rule;
gconf_target = Core.L_javascript;
gconf_source = L_camp_rule;
gconf_target = L_javascript;
gconf_path = [];
gconf_exact_path = false;
gconf_dir = None;
Expand Down
6 changes: 3 additions & 3 deletions cli/ocaml/qdata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open Qcert_lib

open Util
open Config
open Core.EnhancedCompiler
open EnhancedCompiler.EnhancedCompiler

let verbose = ref false

Expand All @@ -43,8 +43,8 @@ let parse_args () =
let gconf =
{ gconf_qname = None;
gconf_class_name = None;
gconf_source = Core.L_camp_rule;
gconf_target = Core.L_javascript;
gconf_source = L_camp_rule;
gconf_target = L_javascript;
gconf_path = [];
gconf_exact_path = false;
gconf_dir = None;
Expand Down
21 changes: 21 additions & 0 deletions compiler/core/Compiler/Component/SqlDateComponent.v
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,26 @@ Section SqlDateOperators.
| EJsonRuntimePeriodBetween => "periodBetween"
end.

Definition ejson_sql_date_runtime_op_fromstring opname : option ejson_sql_date_runtime_op :=
match opname with
| "dateFromString" => Some EJsonRuntimeDateFromString
| "dateGetYear" => Some EJsonRuntimeDateGetYear
| "dateGetMonth" => Some EJsonRuntimeDateGetMonth
| "dateGetDay" => Some EJsonRuntimeDateGetDay
| "dateNe" => Some EJsonRuntimeDateNe
| "dateLt" => Some EJsonRuntimeDateLt
| "dateLe" => Some EJsonRuntimeDateLe
| "dateGt" => Some EJsonRuntimeDateGt
| "dateGe" => Some EJsonRuntimeDateGe
| "dateSetYear" => Some EJsonRuntimeDateSetYear
| "dateSetMonth" => Some EJsonRuntimeDateSetMonth
| "dateSetDay" => Some EJsonRuntimeDateSetDay
| "periodFromString" => Some EJsonRuntimePeriodFromString
| "periodPlus" => Some EJsonRuntimePeriodPlus
| "periodMinus" => Some EJsonRuntimePeriodMinus
| "periodBetween" => Some EJsonRuntimePeriodBetween
| _ => None
end.

End toEJson.
End SqlDateOperators.
7 changes: 7 additions & 0 deletions compiler/core/Compiler/Component/UriComponent.v
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,12 @@ Section UriOperators.
| EJsonRuntimeUriDecode => "uriDecode"
end.

Definition ejson_uri_runtime_op_fromstring opname : option ejson_uri_runtime_op :=
match opname with
| "uriEncode" => Some EJsonRuntimeUriEncode
| "uriDecode" => Some EJsonRuntimeUriDecode
| _ => None
end.

End toEJson.
End UriOperators.
Loading