-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-tests.sh
45 lines (37 loc) · 1.6 KB
/
build-tests.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# idris DDecl to QB, using 2 provided transformations reused by several back ends
# javaname: identifiers transformed to valid Java Identifier
# symEmu: emulating LISP symbol types(via integer types) for the use of tagged unions
idris examples/testcases.idr \
-o examples/testcases.qb \
--codegen qb \
--cg-opt "--javaname" \
--cg-opt "--symemu" \
-p quick-backend
# code generation to Python
python backend.py examples/testcases.qb examples/testcases.py
# code generation to Ruby
ruby backend.rb -f examples/testcases.qb -o examples/testcases.rb
# code generation to Julia
julia backend.jl examples/testcases.qb examples/testcases.jl
# When a target language has native symbol types, like Julia,
# LISP dialects and Ruby, we don't need symbol emulation.
# use native symbol types
idris examples/testcases.idr \
-o examples/testcases.native-symbol.qb \
--codegen qb \
--cg-opt "--javaname" \
-p quick-backend
# code generation to Julia
julia backend.jl examples/testcases.native-symbol.qb examples/testcases.native-symbol.jl
# code generation to Ruby
ruby backend.rb -f examples/testcases.native-symbol.qb -o examples/testcases.native-symbol.rb
# compile hello world example
idris examples/hello_world.idr \
-o examples/hello_world.qb \
--codegen qb \
--cg-opt "--javaname" \
--cg-opt "--symemu" \
-p quick-backend
python backend.py examples/hello_world.qb examples/hello_world.py
julia backend.jl examples/hello_world.qb examples/hello_world.jl
ruby backend.rb -f examples/hello_world.qb -o examples/hello_world.rb