Automatic arithmetic promotion#588
Conversation
82e1d75 to
19d08bc
Compare
|
I'll also aim to add missing Clojure test suite test cases for some of the arithmetic promotion operators. |
|
Interestingly enough it looks like Clojure doesn't seem to support automatic arithmetic promotion from a |
359cba1 to
452e148
Compare
Seems like Clojure intentionally chooses to not promote to |
jeaye
left a comment
There was a problem hiding this comment.
The changes look good. CI is failing, though.
f78df29 to
22fd3dd
Compare
|
CI fails due to: jank-lang/clojure-test-suite#828 (comment). |
|
I've commented the Clojure test suite test cases for these operators, the CI passes now. |
After discussing with the Clojure core team we found out that Clojure intentionally chooses not to support automatic promotion for `real` values to `big_decimal`. - Clojure Q/A: https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc. - Slack thread: https://clojurians.slack.com/archives/C053AK3F9/p1762684740564009.
Resolves jank-lang#604.
22fd3dd to
9a39ef7
Compare
|
Nice work! |
* Port `inc'` * Port `dec'` * Port `+'` * Port `-'` * Port `*'` * Move `inc'` & `dec'` to LLVM overflow checks * Add missing cases * Remove promotion support for `jank::runtime::real` values After discussing with the Clojure core team we found out that Clojure intentionally chooses not to support automatic promotion for `real` values to `big_decimal`. - Clojure Q/A: https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc. - Slack thread: https://clojurians.slack.com/archives/C053AK3F9/p1762684740564009. * Port `num` Resolves jank-lang#604. * Enable `+'` tests * Enable `*'` tests * Disable blocked tests * Enable the `ratio_qmark` tests
Initial work at arithmetic promotion. The PR still requires tests but I'm creating this so that I can get some early feedback, especially on the overflow detection logic.
Requires a repoint.
Resolves #359, resolves #604.