Live data from Hacker News

BigDecimal – JavaScript Polyfill for proposed Decimal data type

github.com

1–10 of 19 posts

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#4

JS urgently needs support for decimals and thus be able to establish in sectors such as scientific and financial. as I said before, V8 + dynamic language + better math support = perfect environment for many applications out there

Decimal shouldn't be part of the interpreter. Even Python doesn't do that.

JS needs operator overloading so that it can have decimals, rationals, ndarrays, automatic differentiation, etc. Unfortunately operator overloading is a dirty word for most of the webblubs who use JS. I've given up hope of that ever changing.

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#5

I’m curious how much diff there is with the existing BigDecimal packages (big.js & family). Their APIs look very similar, unsurprisingly. It would be great if a lot of existing code is already mostly compatible.

I woke in crypto and we use bignumber.js. even so, developers default to just using Number and built in math. Having Decimal be native would make it a lot easier to be consistent in the code.

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#6
post #4

JS urgently needs support for decimals and thus be able to establish in sectors such as scientific and financial. as I said before, V8 + dynamic language + better math support = perfect environment for many applications out there

Decimal shouldn't be part of the interpreter. Even Python doesn't do that. JS needs operator overloading so that it can have decimals, rationals, ndarrays, automatic differentiation, etc. Unfortunately operator overloading is a dirty word for most of the webblubs who use JS. I've given up hope of that ever changing.

JavaScript inherited the abysmal standard library support of Lisp language families and poor support for domain specific use cases of Java. The situation has been improving, but with the ”never break the backwards compatibility” of the web browsers on the driver seat, JavaScript will never be like Python or Julia for the data science use cases.

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#7

JS urgently needs support for decimals and thus be able to establish in sectors such as scientific and financial. as I said before, V8 + dynamic language + better math support = perfect environment for many applications out there

A corollary is that SQLite is as ubiquitous to structured storage as JavaScript is to programming and it too lacks the exact decimal representation available as DECIMAL(precision, scale) in other SQL engines.

These are not fatal flaws, IMO, just gaps in need of attention.

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#8

JS urgently needs support for decimals and thus be able to establish in sectors such as scientific and financial. as I said before, V8 + dynamic language + better math support = perfect environment for many applications out there

JS is already very popular in finance, decimal types aren’t always needed for monetary values, floats are often fine (or computations can be done on the backend).

Re: BigDecimal – JavaScript Polyfill for proposed Decimal data type

#10

JS urgently needs support for decimals and thus be able to establish in sectors such as scientific and financial. as I said before, V8 + dynamic language + better math support = perfect environment for many applications out there

I don't think decimal is that big a deal for financial programming. When $0.01 accuracy matters, you just build your data structures around cents instead of dollars and get on with your life.
Post reply on HN