pouët.net

Go to bottom

NaCl

category: code [glöplog]
The thing is that the web is built on open standards that are designed by committee. That's how you get 5 browser companies and dozens other companies using the web platform to agree on and improve a new standard.

Google isn't playing that way with SPDY, NaCL, DART, ... None of these have been submitted to the w3c, ietf or tc39.

OTOH, see ES5 and ES6. Everybody is on board and things are moving pretty good.
added on the 2011-09-27 09:46:47 by p01 p01
I wouldn't say that the ECMAScript group is moving pretty good.
It's barely moving at committee speed, at best.

In fact Javascript hasn't changed in any significant way since 10 years. That sends us back in time, when the web was a whole different beast than what it is now.
Consider the fiasco that was the long ECMAScript 4 effort. What a waste of time that has been. Then move on to ECMAScript 5, with the only noticeable change made being the strict mode.

The only real change in my view is the addition of Typed Arrays. But this is not be credited to the ECMAScript commitee. In fact, this was put down the throat of browsers by the Khronos group. Otherwise, WebGL would have been nearly unusable.

Granted, ECMAScript 6 at least look like a serious effort to move the standards. But it doesn't eclipse the fact that it's been 10 goddamn years that things stayed still.
added on the 2011-09-27 10:54:10 by RetroVM RetroVM
added on the 2011-09-29 20:07:31 by mrdoob mrdoob
*looks at about for version, it displays 13.0.800.0* 255,255,255,255,255.....(FFFFFF.....)
added on the 2011-09-30 00:07:51 by Exin Exin
Wow, Quake NaCL is really fast!
pretty off topic, but i don't want to open a new thread for such a stupid/simple question: why is eval() so much slower than regular js code? ok, a second question: is there a way i could preprocess a string in js so that some sort of evalBinary() would execute my dynamic code faster? thx for the answers.
added on the 2011-10-01 11:02:18 by iq iq
iq: eval() is much slower because unlike the regular JS code, it is parsed and "compiled" at run time not at load time, and of course it is run once hence there has been no opportunity to fine tune / optimize the compiled code.

If your "eval" stuff is to be executed several times without any change, you'd rather create a new Function or a new script element with that code.
added on the 2011-10-01 12:42:01 by p01 p01
s/once/for the first time
added on the 2011-10-01 12:42:48 by p01 p01
Iq, i had that issue with 704.
From my experience, some browsers don't optimize eval code.
Chrome didn't had this issue, but old Firefox versions had.
On Firefox 4.0 beta 7 this issue was solved.
One solution was doing this:
document.write("<script>",X,"<\/script>")
instead of
eval(X)
aka what I said above, but the document.write('dirty way'); ;)
added on the 2011-10-01 14:54:57 by p01 p01
p01, ups sorry. Didn't read the "you'd rather create a new Function or a new script element with that code." part of your post :P
thx guys. and how do i
Quote:
create a new Function or a new script element with that code
dynamically without the dirty document.write()? what other options do i have? (sorry my complete lack of experience/understanding of js)
added on the 2011-10-01 22:00:22 by iq iq
See the Function constructor.

Code:var myNewFunction=new Function(yourCode);
NB: yourCode is not executed right away but you get a whole new function called myNewFunction which you can call as much as you want. The more the merrier.

Code:var s=document.createElement('script');s.text=yourCode;document.body.appendChild(s);
NB: yourCode is executed right away so you may want yourCode to create functions and stuff that you can call later.
added on the 2011-10-01 23:07:09 by p01 p01
wow, that was super useful! "new Function(src)",avoiding "using()" plus some other trickery made my dynamic code run 34 times faster :) now we are talking. thanks guys!
added on the 2011-10-02 04:29:49 by iq iq
Any chance to get a sneak peak ;)
added on the 2011-10-02 09:56:01 by p01 p01
soon enough (but it's not a demo or anything big). keep talking about salt!
added on the 2011-10-02 20:48:39 by iq iq

login

Go to top