aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation
diff options
context:
space:
mode:
authorEduardo Julian2018-07-30 23:40:48 -0400
committerEduardo Julian2018-07-30 23:40:48 -0400
commit748c868680683df1949f62aac274040ac5bf43da (patch)
tree67b3bd8fb402dfd00fc0ee472186fc79e6545ac7 /new-luxc/source/luxc/lang/translation
parent76b47564f89bac5eb6604da7bbb94aabb83d6d84 (diff)
Now implementing math functionality in stdlib instead of the compiler.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux27
-rw-r--r--new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux54
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux70
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux40
-rw-r--r--new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux23
-rw-r--r--new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux33
-rw-r--r--new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux23
-rw-r--r--new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux33
-rw-r--r--new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux28
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux47
10 files changed, 0 insertions, 378 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
index ba2e0a8b4..7218d9618 100644
--- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
@@ -315,32 +315,6 @@
(install "clip" (trinary text//clip))
)))
-## [[Math]]
-(def: (math//pow [subject param])
- Binary
- ((_.$apply2 (_.global "expt")) subject param))
-
-(def: math-func
- (-> Text (-> Expression Expression))
- (|>> _.global _.$apply1))
-
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary (math-func "cos")))
- (install "sin" (unary (math-func "sin")))
- (install "tan" (unary (math-func "tan")))
- (install "acos" (unary (math-func "acos")))
- (install "asin" (unary (math-func "asin")))
- (install "atan" (unary (math-func "atan")))
- (install "exp" (unary (math-func "exp")))
- (install "log" (unary (math-func "log")))
- (install "ceil" (unary (math-func "ceiling")))
- (install "floor" (unary (math-func "floor")))
- (install "pow" (binary math//pow))
- )))
-
## [[IO]]
(def: (void code)
(-> Expression Expression)
@@ -415,7 +389,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
index 4c3b0afe8..b40f00c73 100644
--- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
@@ -284,37 +284,6 @@
)
-## [[Math]]
-(do-template [<name> <method>]
- [(def: (<name> inputJS)
- Unary
- (format "Math." <method> "(" inputJS ")"))]
-
- [math//cos "cos"]
- [math//sin "sin"]
- [math//tan "tan"]
- [math//acos "acos"]
- [math//asin "asin"]
- [math//atan "atan"]
- [math//cosh "cosh"]
- [math//sinh "sinh"]
- [math//tanh "tanh"]
- [math//exp "exp"]
- [math//log "log"]
- [math//ceil "ceil"]
- [math//floor "floor"]
- [math//round "round"]
- )
-
-(do-template [<name> <method>]
- [(def: (<name> [inputJS paramJS])
- Binary
- (format "Math." <method> "(" inputJS "," paramJS ")"))]
-
- [math//atan2 "atan2"]
- [math//pow "pow"]
- )
-
## [[IO]]
(def: (io//log messageJS)
Unary
@@ -454,28 +423,6 @@
(install "size" (unary array//size))
)))
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary math//cos))
- (install "sin" (unary math//sin))
- (install "tan" (unary math//tan))
- (install "acos" (unary math//acos))
- (install "asin" (unary math//asin))
- (install "atan" (unary math//atan))
- (install "cosh" (unary math//cosh))
- (install "sinh" (unary math//sinh))
- (install "tanh" (unary math//tanh))
- (install "exp" (unary math//exp))
- (install "log" (unary math//log))
- (install "ceil" (unary math//ceil))
- (install "floor" (unary math//floor))
- (install "round" (unary math//round))
- (install "atan2" (binary math//atan2))
- (install "pow" (binary math//pow))
- )))
-
(def: io-procs
Bundle
(<| (prefix "io")
@@ -518,7 +465,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 2334f9cc2..327a95871 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -378,53 +378,6 @@
runtimeT.noneI
(_.label @end))))
-## [[Math]]
-(def: math-unary-method ($t.method (list $t.double) (#.Some $t.double) (list)))
-(def: math-binary-method ($t.method (list $t.double $t.double) (#.Some $t.double) (list)))
-
-(do-template [<name> <method>]
- [(def: (<name> inputI)
- Unary
- (|>> inputI
- (_.unwrap #$.Double)
- (_.INVOKESTATIC "java.lang.Math" <method> math-unary-method #0)
- (_.wrap #$.Double)))]
-
- [math//cos "cos"]
- [math//sin "sin"]
- [math//tan "tan"]
- [math//acos "acos"]
- [math//asin "asin"]
- [math//atan "atan"]
- [math//cosh "cosh"]
- [math//sinh "sinh"]
- [math//tanh "tanh"]
- [math//exp "exp"]
- [math//log "log"]
- [math//ceil "ceil"]
- [math//floor "floor"]
- )
-
-(do-template [<name> <method>]
- [(def: (<name> [inputI paramI])
- Binary
- (|>> inputI (_.unwrap #$.Double)
- paramI (_.unwrap #$.Double)
- (_.INVOKESTATIC "java.lang.Math" <method> math-binary-method #0)
- (_.wrap #$.Double)))]
-
- [math//atan2 "atan2"]
- [math//pow "pow"]
- )
-
-(def: (math//round inputI)
- Unary
- (|>> inputI
- (_.unwrap #$.Double)
- (_.INVOKESTATIC "java.lang.Math" "round" ($t.method (list $t.double) (#.Some $t.long) (list)) #0)
- _.L2D
- (_.wrap #$.Double)))
-
## [[IO]]
(def: string-method $.Method ($t.method (list $String) #.None (list)))
(def: (io//log messageI)
@@ -597,28 +550,6 @@
(install "size" (unary array//size))
)))
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary math//cos))
- (install "sin" (unary math//sin))
- (install "tan" (unary math//tan))
- (install "acos" (unary math//acos))
- (install "asin" (unary math//asin))
- (install "atan" (unary math//atan))
- (install "cosh" (unary math//cosh))
- (install "sinh" (unary math//sinh))
- (install "tanh" (unary math//tanh))
- (install "exp" (unary math//exp))
- (install "log" (unary math//log))
- (install "ceil" (unary math//ceil))
- (install "floor" (unary math//floor))
- (install "round" (unary math//round))
- (install "atan2" (binary math//atan2))
- (install "pow" (binary math//pow))
- )))
-
(def: io-procs
Bundle
(<| (prefix "io")
@@ -661,7 +592,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
index cfbe7f0ac..372d107cb 100644
--- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
@@ -287,28 +287,6 @@
[text//index runtimeT.text//index]
)
-## [[Math]]
-(do-template [<name> <method>]
- [(def: (<name> inputO)
- Unary
- (lua.apply <method> (list inputO)))]
-
- [math//cos "math.cos"]
- [math//sin "math.sin"]
- [math//tan "math.tan"]
- [math//acos "math.acos"]
- [math//asin "math.asin"]
- [math//atan "math.atan"]
- [math//exp "math.exp"]
- [math//log "math.log"]
- [math//ceil "math.ceil"]
- [math//floor "math.floor"]
- )
-
-(def: (math//pow [inputO paramO])
- Binary
- (lua.apply "math.pow" (list inputO paramO)))
-
## [[IO]]
(def: (io//log messageO)
Unary
@@ -442,23 +420,6 @@
(install "size" (unary array//size))
)))
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary math//cos))
- (install "sin" (unary math//sin))
- (install "tan" (unary math//tan))
- (install "acos" (unary math//acos))
- (install "asin" (unary math//asin))
- (install "atan" (unary math//atan))
- (install "exp" (unary math//exp))
- (install "log" (unary math//log))
- (install "ceil" (unary math//ceil))
- (install "floor" (unary math//floor))
- (install "pow" (binary math//pow))
- )))
-
(def: io-procs
Bundle
(<| (prefix "io")
@@ -501,7 +462,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
index 9638ec9bf..715d8bf0b 100644
--- a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
@@ -327,28 +327,6 @@
## (install "clip" (trinary text//clip))
## )))
-## ## [[Math]]
-## (def: (math//pow [subject param])
-## Binary
-## (|> subject (_.** param)))
-
-## (def: math-procs
-## Bundle
-## (<| (prefix "math")
-## (|> (dict.new text.Hash<Text>)
-## (install "cos" (unary runtimeT.math//cos))
-## (install "sin" (unary runtimeT.math//sin))
-## (install "tan" (unary runtimeT.math//tan))
-## (install "acos" (unary runtimeT.math//acos))
-## (install "asin" (unary runtimeT.math//asin))
-## (install "atan" (unary runtimeT.math//atan))
-## (install "exp" (unary runtimeT.math//exp))
-## (install "log" (unary runtimeT.math//log))
-## (install "ceil" (unary runtimeT.math//ceil))
-## (install "floor" (unary runtimeT.math//floor))
-## (install "pow" (binary math//pow))
-## )))
-
## ## [[IO]]
## (def: io-procs
## Bundle
@@ -409,7 +387,6 @@
## (dict.merge frac-procs)
## (dict.merge text-procs)
## (dict.merge array-procs)
- ## (dict.merge math-procs)
## (dict.merge io-procs)
## (dict.merge atom-procs)
## (dict.merge process-procs)
diff --git a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
index ac04df255..d4c14b473 100644
--- a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
@@ -338,38 +338,6 @@
## @@process//future
## @@process//schedule))
-## (do-template [<name> <method>]
-## [(runtime: (<name> input)
-## ($_ _.then!
-## (_.import! "math")
-## (_.return! (|> (_.global "math") (_.send (list input) <method>)))))]
-
-## [math//cos "cos"]
-## [math//sin "sin"]
-## [math//tan "tan"]
-## [math//acos "acos"]
-## [math//asin "asin"]
-## [math//atan "atan"]
-## [math//exp "exp"]
-## [math//log "log"]
-## [math//ceil "ceil"]
-## [math//floor "floor"]
-## )
-
-## (def: runtime//math
-## Runtime
-## ($_ _.then!
-## @@math//cos
-## @@math//sin
-## @@math//tan
-## @@math//acos
-## @@math//asin
-## @@math//atan
-## @@math//exp
-## @@math//log
-## @@math//ceil
-## @@math//floor))
-
(def: check-necessary-conditions!
Statement
(let [condition (_.= (_.int 8)
@@ -391,7 +359,6 @@
## runtime//atom
## runtime//io
## runtime//process
- ## runtime//math
))
(def: #export artifact Text (format prefix //.extension))
diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
index f7cdf044a..35ffdb1f8 100644
--- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
@@ -347,28 +347,6 @@
(install "clip" (trinary text//clip))
)))
-## [[Math]]
-(def: (math//pow [subject param])
- Binary
- (|> subject (python.** param)))
-
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary runtimeT.math//cos))
- (install "sin" (unary runtimeT.math//sin))
- (install "tan" (unary runtimeT.math//tan))
- (install "acos" (unary runtimeT.math//acos))
- (install "asin" (unary runtimeT.math//asin))
- (install "atan" (unary runtimeT.math//atan))
- (install "exp" (unary runtimeT.math//exp))
- (install "log" (unary runtimeT.math//log))
- (install "ceil" (unary runtimeT.math//ceil))
- (install "floor" (unary runtimeT.math//floor))
- (install "pow" (binary math//pow))
- )))
-
## [[IO]]
(def: io-procs
Bundle
@@ -449,7 +427,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
index 275eea636..3dd5980e8 100644
--- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
@@ -375,38 +375,6 @@
Runtime
@@process//schedule)
-(do-template [<name> <method>]
- [(runtime: (<name> input)
- ($_ python.then!
- (python.import! "math")
- (python.return! (|> (python.global "math") (python.send (list input) <method>)))))]
-
- [math//cos "cos"]
- [math//sin "sin"]
- [math//tan "tan"]
- [math//acos "acos"]
- [math//asin "asin"]
- [math//atan "atan"]
- [math//exp "exp"]
- [math//log "log"]
- [math//ceil "ceil"]
- [math//floor "floor"]
- )
-
-(def: runtime//math
- Runtime
- ($_ python.then!
- @@math//cos
- @@math//sin
- @@math//tan
- @@math//acos
- @@math//asin
- @@math//atan
- @@math//exp
- @@math//log
- @@math//ceil
- @@math//floor))
-
(def: runtime
Runtime
($_ python.then!
@@ -420,7 +388,6 @@
runtime//box
runtime//io
runtime//process
- runtime//math
))
(def: #export artifact Text (format prefix ".py"))
diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
index eab139f33..c17eb6738 100644
--- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
@@ -329,33 +329,6 @@
(install "clip" (trinary text//clip))
)))
-## [[Math]]
-(def: (math//pow [subject param])
- Binary
- (|> subject (r.** param)))
-
-(def: (math-func name)
- (-> Text (-> Expression Expression))
- (function (_ input)
- (r.apply (list input) (r.global name))))
-
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary (math-func "cos")))
- (install "sin" (unary (math-func "sin")))
- (install "tan" (unary (math-func "tan")))
- (install "acos" (unary (math-func "acos")))
- (install "asin" (unary (math-func "asin")))
- (install "atan" (unary (math-func "atan")))
- (install "exp" (unary (math-func "exp")))
- (install "log" (unary (math-func "log")))
- (install "ceil" (unary (math-func "ceiling")))
- (install "floor" (unary (math-func "floor")))
- (install "pow" (binary math//pow))
- )))
-
## [[IO]]
(def: (io//exit input)
Unary
@@ -446,7 +419,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)
diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
index bed68a0a0..ba6a1241a 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
@@ -360,52 +360,6 @@
(install "clip" (trinary text//clip))
)))
-## [[Math]]
-(do-template [<name> <method>]
- [(def: <name>
- Unary
- (|>> (list) (ruby.apply <method>)))]
-
- [math//cos "Math.cos"]
- [math//sin "Math.sin"]
- [math//tan "Math.tan"]
- [math//acos "Math.acos"]
- [math//asin "Math.asin"]
- [math//atan "Math.atan"]
- [math//exp "Math.exp"]
- [math//log "Math.log"]
- )
-
-(do-template [<name> <method>]
- [(def: <name>
- Unary
- (ruby.send <method> (list)))]
-
- [math//ceil "ceil"]
- [math//floor "floor"]
- )
-
-(def: (math//pow [inputO paramO])
- Binary
- (ruby.pow paramO inputO))
-
-(def: math-procs
- Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary math//cos))
- (install "sin" (unary math//sin))
- (install "tan" (unary math//tan))
- (install "acos" (unary math//acos))
- (install "asin" (unary math//asin))
- (install "atan" (unary math//atan))
- (install "exp" (unary math//exp))
- (install "log" (unary math//log))
- (install "ceil" (unary math//ceil))
- (install "floor" (unary math//floor))
- (install "pow" (binary math//pow))
- )))
-
## [[IO]]
(def: (io//log messageO)
Unary
@@ -506,7 +460,6 @@
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)
- (dict.merge math-procs)
(dict.merge io-procs)
(dict.merge atom-procs)
(dict.merge box-procs)