R
roman
Hello everybody,
I am working on application that will contain a shared portion running
on server and client and would like to be able to deploy on LAMP.
Looked at jsext, jslibs and wsjs and standalone SpiderMonkey. They are
all very nice, some even compile out of the box. But all need CGI or
FCGI, or own box (physical/virtual) + mod_js, since not many webhosts
yet support JavaScript and I doubt they just install it on request (I am
talking about cheapo shared hostings).
Another alternative is translation to supported environment. I found
J4P5 - it comes with parser and runtime (in PHP). Project seems
abandoned but it's very serious attempt very close to completion. It did
not work out of the box, but after few modifications in P4P5 runtime I
was able to run my routines with same testing results in browser and in
J4P5.
It's 100-150x slower than PHP, i.e. a lookup in some 200 member array
that took ~3ms with PHP was ~400ms in J4P5. Translation of 700 lines of
tables/code took 1.2sec, but this is done only first time after JS
source changes. Changing the table lookups to binary search made this
some 20x faster (average 20ms) - fairly workable. Of course this is not
usable for writing entire applications but until JS becomes as native on
servers as PHP, this may be the transition tool.
My code will not run with every HTTP request but only with final
request, when untrusted data from browser is received and must be
verified if it was not tampered.
I am looking for input. Can someone recommend better solution? Anyone
deployed similar system before? What are security implications (e.g.
user will be able to review non-critical portions of the business
logic), perhaps I did not think of something. I am aware of P4P5
licensing and at this point I do not mind my app to be GPL'd.
Thanks for your time.
Roman
I am working on application that will contain a shared portion running
on server and client and would like to be able to deploy on LAMP.
Looked at jsext, jslibs and wsjs and standalone SpiderMonkey. They are
all very nice, some even compile out of the box. But all need CGI or
FCGI, or own box (physical/virtual) + mod_js, since not many webhosts
yet support JavaScript and I doubt they just install it on request (I am
talking about cheapo shared hostings).
Another alternative is translation to supported environment. I found
J4P5 - it comes with parser and runtime (in PHP). Project seems
abandoned but it's very serious attempt very close to completion. It did
not work out of the box, but after few modifications in P4P5 runtime I
was able to run my routines with same testing results in browser and in
J4P5.
It's 100-150x slower than PHP, i.e. a lookup in some 200 member array
that took ~3ms with PHP was ~400ms in J4P5. Translation of 700 lines of
tables/code took 1.2sec, but this is done only first time after JS
source changes. Changing the table lookups to binary search made this
some 20x faster (average 20ms) - fairly workable. Of course this is not
usable for writing entire applications but until JS becomes as native on
servers as PHP, this may be the transition tool.
My code will not run with every HTTP request but only with final
request, when untrusted data from browser is received and must be
verified if it was not tampered.
I am looking for input. Can someone recommend better solution? Anyone
deployed similar system before? What are security implications (e.g.
user will be able to review non-critical portions of the business
logic), perhaps I did not think of something. I am aware of P4P5
licensing and at this point I do not mind my app to be GPL'd.
Thanks for your time.
Roman