couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Smith <...@couch.io>
Subject Re: [jira] Commented: (COUCHDB-796) Bignum support
Date Sat, 12 Jun 2010 19:06:19 GMT
On Sun, Jun 13, 2010 at 01:24, Robert Newson (JIRA) <jira@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/COUCHDB-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878298#action_12878298]
>
> Robert Newson commented on COUCHDB-796:
> ---------------------------------------
>
> Sorry, I pasted a terse summary from #couchdb and was then too busy to
> flesh this out.
>
> I'm actually not sure I like the idea of tweaking mochijson2.erl, though it
> was suggested (by you iirc ;). Also the notion that numbers magically become
> strings at some point feels wrong, but so also does the notion that a sum()
> overflows or goes wrong when you hit that limit too.
>
> Rather, I think a guarantee that some bignum.js library is always available
> and some prominent docs about it. Ideally a BigDecimal and BigInteger class
> like Java has (yes, kill me).
>

Weird, I just created that exact project the other day.
http://github.com/jhs/bigdecimal.js

It is indeed the Java class! It is the Apache Harmony BigDecimal/BigInteger
implementation, compiled to Javascript thanks to GWT. This list isn't the
place to debate whether that's wise but a the very least, CouchDB's default
view server can support BigDecimal. I even put up a demo expression
evaluator:

http://jhs.couchone.com/bigdecimal/_design/bigdecimal_demo/_show/ui?e=5192834791234712811238476129384671293847611923192386479347.1234876123467129384761234%20*%205123412612351263.1123412365123541234

What is my point? That CouchDB perhaps does not need bigdecimal support in
mochijson2 because it is quite straightforward to get things working within
the view server.

-- 
Jason Smith
Couchio Hosting

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message