c69's Browser Pit

Subscribe to RSS feed

Posts tagged with "js"

on Asm.js

,

i had not specificly blogged on it, when it was released, so will just put these links here:

Some discussions (some people dislike how asm.js is actually not a js at all, cake-is-a-lie, etc):
http://mozakai.blogspot.com/2013/05/the-elusive-universal-web-bytecode.html
http://mrale.ph/blog/2013/03/28/why-asmjs-bothers-me.html

QT framework ported to JS - works surprisingly good even in Chrome:
http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt/wiki/Demos


Speeeeeeeeed!!!

, , , ...

Monads in JS, by Crock

, , , ...


via: YUIBlog
Douglas Crockford explains how monads work from inside, and how to write them in JavaSscript.
Level: Advanced.


+ links he referenced in the video (at 44:50):
http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask
mirror: http://www.youtube.com/watch?v=7erJ1DV_Tlo

Secure Distributed Programming with Object-capabilities in JavaScript
http://www.youtube.com/watch?v=w9hHHvhZ_HY
Bringing Object-orientation to Security Programming
http://www.youtube.com/watch?v=oBqeDYETXME

Tales from the Dark Side: ActionScript is Faster

, , ,

Requiem for a Dream

, , ,

it was a bad dream, anyway cheers

http://webreflection.blogspot.com.au/2012/10/javascript-made-everyone-crazy.html
TypeScript is a lot like Dart in its main purpose - big company (ms/google) makes new language to add classes and tooling into javascript. And just like Dart, it fails. Thanx to the less lazy and more bright guys (than myself), i don't have to write wall of text.

p.s.: tooling, seriously ? Good IDEs provide tooling for javascript NOW. And no, classes will not suddenly make your code good.

Yet another JS MVC framework

,

http://generatedcontent.org/post/27398344690/ninja-montage

As well as the modern technologies built into the browser, we use various parts of CommonJS including Promises, Modules, and package.json. We also take advantage of Node.JS.

The main aim of Montage is to help developers be able to develop native quality applications using web technologies, as quickly and easily as possible. As such we support components using HTML5 templates, Two way data binding (to both objects and components) , serialization, extended event handling, an optimised component draw cycle (for efficiently repainting when updating the DOM), keyboard shortcut handling, gestures and composers, data converters, and much more.



sounds cool. let's see how it would turn out smile

vert.x - a faster node.js clone for polyglots ?

,

http://vertx.io/

info: the project got to version 1.0 in May 2012, is sponsored by VMvare, is claimed to be faster than Node.JS, has ability to use other languages (Groovy, Ruby or Java now, Scala and Clojure on TODO list), "scales across your cores automatically", has cluster support and other goodies right out of the box. Also, there is separate project aimed to make Node modules compatible with vert.x

Sounds nice. Time will show, who is better.

their blog (mostly filled with self praise and "why we are better than Node"): http://vertxproject.wordpress.com/

JS engine improvements in IE10

, ,

http://blogs.msdn.com/b/ie/archive/2012/06/13/advances-in-javascript-performance-in-ie10-and-windows-8.aspx

Unlike in other browsers, Chakra’s just-in-time (JIT) compiler runs on a separate dedicated thread and thus does not interfere with script execution.


interesting.

To further reduce the time to first executed instruction, Chakra processes and emits bytecode only for functions that are about to be executed using a mechanism called deferred parsing.


so big 3rd party libraries will not get executed until called.

We enhanced Chakra’s interpreter to collect it at runtime, a technique we call dynamic profiling. When a function is scheduled for JIT compilation, the compiler examines the runtime profile gathered by the interpreter and emits code tailored to the expected inputs.

...
The interpreter gathers information for the runs it observes, but it’s possible that the execution of the program will lead to runtime values which violate assumptions made in the generated optimized code. For every assumption it makes, the compiler emits a runtime check. If a later execution results in an unexpected value, the check fails, execution bails out of the specialized machine code, and is continued in the interpreter. The reason for bailout (the failed check) is recorded, additional profile information is collected by the interpreter, and the function is recompiled with different assumptions. Bailout and re-compilation are two fundamentally new capabilities in IE10.


Just like other modern JIT compilers. Thus, writing type-stable code is essential for apps that need speed. (c) Cap.

Also, there are improvements to GC. Again, like in all other engines in 2011-2012.


Related older post about other jit-compilers: "http://my.opera.com/c69/blog/show.dml/37206612

less known gotchas with automatic semicolon insertion

, ,

never rely on semi-colon insertion! (unless you like to spend friday evenings hunting bugs, while your colleagues are having fun).

Everybody knows, that:
return 
{
x: 1
} 

will return undefined, because semicolon will be inserted right after return.

But there are few other illustrative examples (all will throw exceptions):
-1.----
var foo = 'asdf'
[1,2,3].forEach(function(value){console.log(value)})
'asdf'[1,2,3] is syntax error

-2.----
var foo = 1+2
('asdf' + 'blubb').toUpperCase()
'2' is not a function

-3.----
This code will work:
function(){}

(function(){
})()
But this one:
var foo = function(){}

(function(){
})()
will throw:
'}
(function(){
})' is not a function 


-------
copy/pasted from comment in "grumpy old farts vs dumb emo kids"* thread : https://github.com/twitter/bootstrap/issues/3057#issuecomment-5140311
-------
via: http://brendaneich.com/2012/04/the-infernal-semicolon/
-------
p.s.: * - 'seasoned veterans vs creative youth' would be less offensive, but.. can i at least insult people, more talented than me, if i cant write better code ? wink

XSS Defence 101

, , , ...

June 2013
M T W T F S S
May 2013July 2013
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30