Instructions should be relatively self evident. Enter a bunch of
expressions, one per line. Click submit. See results. Alter
expressions. Repeat.
Implementation notes:
This simply is a CGI that shells out to a version of SpiderMonkey with
decimal support added. This code is at an alpha level at best. It may
produce incorrect results. It may trap.
I've tried SpiderMonkey with the -i parameter and capturing the results,
but it seems to batch up the echoing of the input followed by all of the
output. So, for now, I'm simply wrapping each line in print(...); and
passing the whole stream to the shell. Yes, this makes testing of
things like for loops difficult. If anybody on this list has a
suggestion, let me know.
Security notes:
Yes, I'm aware that many of you who follow this list know that what I'm
providing is a dumb idea. You know it. I know it. There is no need to
show off. But offline suggestions are welcome.
Availability:
From time to time I will be updating this to the latest code. If I get
hacked (this host is not the one that serves my blog), the service will
be taken down. Eventually, I will be taking this down anyway. But for
now, feel free to play.
Testing cases:
What I'm really hoping for is test cases. Find some output that is
wrong and let me know. I'm starting to build SpiderMonkey test cases,
which ultimately are a simple matter of pairs of expressions and
expected results.
http://code.intertwingly.net/demo/es-decimal/
user: brendan, password: cowlishaw
Instructions should be relatively self evident. Enter a bunch of
expressions, one per line. Click submit. See results. Alter
expressions. Repeat.
Implementation notes:
This simply is a CGI that shells out to a version of SpiderMonkey with
decimal support added. This code is at an alpha level at best. It may
produce incorrect results. It may trap.
I've tried SpiderMonkey with the -i parameter and capturing the results,
but it seems to batch up the echoing of the input followed by all of the
output. So, for now, I'm simply wrapping each line in print(...); and
passing the whole stream to the shell. Yes, this makes testing of
things like for loops difficult. If anybody on this list has a
suggestion, let me know.
Security notes:
Yes, I'm aware that many of you who follow this list know that what I'm
providing is a dumb idea. You know it. I know it. There is no need to
show off. But offline suggestions are welcome.
Availability:
From time to time I will be updating this to the latest code. If I get
hacked (this host is not the one that serves my blog), the service will
be taken down. Eventually, I will be taking this down anyway. But for
now, feel free to play.
Testing cases:
What I'm really hoping for is test cases. Find some output that is
wrong and let me know. I'm starting to build SpiderMonkey test cases,
which ultimately are a simple matter of pairs of expressions and
expected results.
http://code.intertwingly.net/public/hg/js-decimal/file/d65d970dd2ea/js/tests/decimal/ops/
- Sam Ruby
code.intertwingly.net/demo/es-decimal
user: brendan, password: cowlishaw
Instructions should be relatively self evident. Enter a bunch of expressions, one per line. Click submit. See results. Alter expressions. Repeat.
Implementation notes:
This simply is a CGI that shells out to a version of SpiderMonkey with decimal support added. This code is at an alpha level at best. It may produce incorrect results. It may trap.
I've tried SpiderMonkey with the -i parameter and capturing the results, but it seems to batch up the echoing of the input followed by all of the output. So, for now, I'm simply wrapping each line in print(...); and passing the whole stream to the shell. Yes, this makes testing of things like for loops difficult. If anybody on this list has a suggestion, let me know.
Security notes:
Yes, I'm aware that many of you who follow this list know that what I'm providing is a dumb idea. You know it. I know it. There is no need to show off. But offline suggestions are welcome.
Availability:
From time to time I will be updating this to the latest code. If I get hacked (this host is not the one that serves my blog), the service will be taken down. Eventually, I will be taking this down anyway. But for now, feel free to play.
Testing cases:
What I'm really hoping for is test cases. Find some output that is wrong and let me know. I'm starting to build SpiderMonkey test cases, which ultimately are a simple matter of pairs of expressions and expected results.
code.intertwingly.net/public/hg/js-decimal/file/d65d970dd2ea/js/tests/decimal/ops