You also can't compile JS to asm.js, for example.
You get C-like performance by writing C.
1,026 karma · joined December 11, 2011
You also can't compile JS to asm.js, for example.
You get C-like performance by writing C.
After executing 5 million statements, IE will ask you if you want to continue. It will ask you many times. You'll probably sit there all day long clicking the whatever button.
Here is a nice list:
https://github.com/jashkenas/coffee-script/wiki/List-of-lang...
From my own experience, I'd say that this strategy worked exactly as intended. I was able to write code after skimming through some of the examples. To be honest, I only bothered with Dart because it used C-like syntax.
Also, it compiles to surprisingly fast JavaScript [1]. Support by all browser vendors isn't necessary. You can use it either way. The lack of support really doesn't change anything. You'd use a build/deploy script either way, wouldn't you?
[1] https://plus.google.com/u/0/114943499066504644906/posts/WXNL...
50kB of compressed and minified JS aren't the same as a 50kB JPEG. The JS must be parsed and compiled which is a far heavier operation than decoding an image.
The last time I looked, it took about 100msec to parse and compile 100kB of minified and gzipped JavaScript on a desktop. However, after all of this you still won't get the full speed. It needs to run for a bit and then the hot parts of the code will be replaced with more optimized code. Again, this takes some precious resources.
An image, on the other hand, is decoded within a few msecs and that's the end of that.
Size is just one metric. It won't tell you the whole story.
You can do whatever you want.
What a twist!
320x200 with 16 or 256 colors and maybe 15 fps?
Your magical nostalgia glasses are perhaps a little bit too thick.
They probably just don't know how to operate the machine.
It's very unlikely that IE will ever support WebGL, because Microsoft is against OpenGL in general. If you start with OpenGL, you probably won't bother with DirectX, which means you won't tie yourself to their ecosystem. That's obviously not in their interest.
Fortunately, IE has been constantly losing market share for the last 4 years.
It doesn't matter if that identifier is a class or something else.
Well, if it's a class people may feel inclined to reuse that identifier on the CSS side, which is a bad thing, because now you've tied 3 parts together instead of just 2. If I use classes for this, I prefix them with "js-" to indicate that they are only meant for scripting purposes.
Your template will also use names of properties, arrays, and objects directly. There also isn't a way around that.
At some point you have to connect your pieces. They can't float around in mid-air forever.
The presentational things you mentioned are different. We can separate those things more, we can use abstractions, and we can make it extremely reusable.
Larger photo-based images will always look terrible, no matter which kind of dithering is used.
If quantized PNG8s aren't good enough, you can only use gigantic PNG32 files, which are over 5 times larger than JNG or WebP files. I've seen websites which were over 5MB thanks to that limitation. It's ridiculous.
I wish they had at least kept JNG. It's a fairly simple JPG/PNG mashup format. If you already use JPG and PNG libraries, supporting JNG won't add much weight.
Most template engines support loops. Would be very weird without that capability, really.
Also, you have to add hooks to buttons and the like somehow. There isn't much of a difference between adding a class like "js-addWhatever" or using Angular's in-your-face approach.
https://github.com/jashkenas/coffee-script/wiki/List-of-lang...
I, for one, really like Dart. It's very nice to use.
The array-like `arguments` object will always reflect what was actually passed to the function though.
Also, the document itself is just one fairly small piece of the whole puzzle.
In general, your assets are only protected by copyright.
Math.pow(2, 53) === Math.pow(2, 53) + 1 // true
Math.pow(2, 53) === Math.pow(2, 53) - 1 // false
I can't disagree with that, because that statement is absolutely true. The only difference between those two kinds of programs is the intention of the programmer. In both cases you have at least one heavy function which is called just once. As far as the VM is concerned, there is no difference whatsoever.
But it's also true that there are sometimes long running functions which are aren't frequently called. In Java, JavaScript, or C# you won't have to worry about that kind of thing. You won't have to break it down in smaller pieces just for the sake of spreading the load across more function calls.
The most obvious ones are probably `eval`, `with` (each property can mean something different with every iteration), and messing around with `arguments` (changing values of that pseudo array also changes the values of the actual named parameters).
You can also change, overwrite, and delete everything. `this` can also refer to something different each time.
Those quirks make JavaScript VMs very complicated and they also result in many surprises. For example, using `delete` can degrade performance quite a bit and adding properties to built-in objects can break some optimization-related heuristics.
Dart just skipped all of that really nasty stuff.
Well, to be fair, they also skipped one of the very useful nasty parts: on-stack replacement (OSR). If there is just one long-running function it won't get optimized (it won't get replaced - right there on the stack - with an optimized version).
Generally, this doesn't matter much, but there are some cases where it's really inconvenient.
It's safe to assume that they will address this once they are done with all optimizations they deem more important. I'd guess it will happen before they hit the big 1.0 (M1 = 0.1-ish).
Sass also allows you to put media queries inside your rule blocks. (In the future, this will be also possible in regular CSS.)