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.
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.
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.
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.
*looks at about for version, it displays 13.0.800.0* 255,255,255,255,255.....(FFFFFF.....)
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.
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.
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.
s/once/for the first time
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)
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'); ;)
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:
dynamically without the dirty document.write()? what other options do i have? (sorry my complete lack of experience/understanding of js)create a new Function or a new script element with that code
See the Function constructor.
Code:
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.var myNewFunction=new Function(yourCode);
Code:
NB: yourCode is executed right away so you may want yourCode to create functions and stuff that you can call later.var s=document.createElement('script');s.text=yourCode;document.body.appendChild(s);
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!
Any chance to get a sneak peak ;)
soon enough (but it's not a demo or anything big). keep talking about salt!
IQ, really cool! :)
http://www.iquilezles.org/apps/soundtoy/index.html
From http://www.iquilezles.org/blog/?p=1587
http://www.iquilezles.org/apps/soundtoy/index.html
From http://www.iquilezles.org/blog/?p=1587