Dear Lazzie
|
|
|
|
2009-05-02Equality and Identity in JavascriptA reader from Plymouth writes,
Gentle reader, Well, here’s a problem:
Can you spot it? When
Well, I won’t bore you with more gory details, but the bottom line is, every time we compare The storal of the morey is, when you want to compare for “identity”, use the “strict equals operator” ( 2009-04-23I am a hackerA reader from Maine asks:
Gentle reader, I am a hacker. The popular press has co-opted the label “hacker”, which was originally a compliment of your high degree of computer skills, to mean a person who uses those skills for evil.1 If you are asking “Could I break into someone’s computer”, the answer is “yes”. There is no magic here. I started my computer career working in computer security at MITRE. And, believe it or not, things have not really changed much since those days. If anything, computer security has gone downhill quite a bit. No one has ever succeeded in commercializing the research we did (to build a secure system from the ground up), instead commercial enterprises have all focussed on selling “barn door” solutions, so called because they are attempts to close the barn door, despite the fact that a lot of (Trojan) horses have already been through… — [1] http://en.wikipedia.org/wiki/Hacker(computing)#Hackerdefinition_controversy “Hacker (computing) - Wikipedia, the free encyclopedia” 2009-04-03OL 4.3!We are pleased to announce that OpenLaszlo 4.3 is available now. You can download it from the OpenLaszlo Download page. It is the recommended platform for all application development for the SWF8, SWF9, and DHTML runtimes. OpenLaszlo 4.3 is a major release, with almost 300 bugs fixed since OpenLaszlo 4.2 introduced the SWF9 runtime. ‘nuff sed. 2009-02-16OpenLaszlo under a Bushel?A reader from Germany writes:
Gentle Reader: I look at it this way: OpenLaszlo is practically a separate entity. Laszlo is our main sponsor, so we mostly do what they ask. But, we do have other sponsors: G.ho.st directly, others through support contracts. So they also get attention. Community stuff comes last, because that has no $ attached to it. But community leaders can be given commit privileges and see their goals achieved directly. While OpenLaszlo is a valuable technology base, the company can’t make (as much) money off of it as they can with a proprietary product. Laszlo is doing kind of the same thing as Apple: adding proprietary value to an open-source base. And, we like that, because it means they can “donate” more money to the OpenLaszlo team. :) Laszlo is a venture-backed company, and venture capitalists are all about making money. They pretty much only see as far as the Webtop licenses. But the management has been made well aware of how the community has made the base they build on much more solid than what they would get with a closed source. As to DHTML applications, in reality, swf9 is so different from swf8, that is the more convincing port to me! swf8 and DHTML are only different in their UI model, the Javascript is 99% the same. To do swf9, we really had to re-engineer the guts of the whole tag compiler and script compiler, to implement a lot of Javascript 2 (Harmony) and then compile down to Javascript 1 for swf8 and DHTML. We knew it would be a lot of work, but we knew if we could do it, we would really prove we had a platform-independent language in LZX, and we ended up with a much more robust system in the end. There is a rule of thumb: 2 ports does not make you platform-independent, it is the 3rd that is the test! In the end, we were very pleased that we were able to keep nearly all the dynamicity of LZX and target a strongly-typed, much more static platform. The strong-typing and ‘true’ classes of Javascript 2 have given significant performance gains (some claim a speed-up of 5-6 times), but the OpenLaszlo compiler has been able to shield the LZX developer from most of the requirements of declaring types and overrides in their LZX code and has been able to keep dynamic features like Let me conclude by saying, overall you are right. OpenLaszlo needs more publicity, whether for Laszlo as a company, or just for it’s own growth. Let’s hope this little post can help it along the way… 2009-01-16The difference between `.` and `[` in JavascriptWe recently had a bug report that the debugger started issuing a warning in code where it had not before:
The initial fix proposed was to simply change:
to:
Continue reading "The difference between `.` and `[` in Javascript"2007-08-01Advice for the OpenLaszlo optimizerSince the OpenLaszlo compiler does not do common-subexpression elimination, when you are trying to optimize things, pretend you are writing in 1985 C. Instead of:
say:
Even better, when you find yourself having to write a null check, ask yourself if it would be cleaner, simpler, and more efficient to have the variable you are referencing not be nullable. For instance, if a variable is an array, consider using an empty array for its initial value, rather than null. This is a time/space trade-off: if there are many operations on the array and the variable is almost always not null, it will be more efficient to use an empty array; if there are few operations and the variable is usually null, then not allocating the empty array is the better choice. (In Javascript 2, you will have the option of declaring a variable to be of a particular type, and you will have the option of declaring whether or not that variable can also be null. If you declare it not to be nullable, then the compiler will give you a compile-time warning if it cannot prove that the variable is never null, and it will insert the appropriate runtime check for you.
Even though we don’t yet support the type declarations, we can follow the pattern and be ready…) 2007-04-19Undefined reduxA reader from Maynard asks: Continue reading "Undefined redux" 2007-02-04Order in the codeA reader from San Mateo writes:
Gentle reader,
An object is just a hash table, and there is no implicit order of elements of a hash table (Java has If you want to iterate over an array’s entries in order, use
If you want to iterate over an object’s keys in a particular order, you have to pull the keys out into an array, sort that array, and then iterate over that array:
The fact that any particular runtime iterates over object keys in any particular order reveals an implementation detail of their hashes, but if you write your code to depend on that you are setting yourself up for a fall. Most Javascript runtimes just happen to use particularly trivial hash implementations that give you the illusion the keys are iterated in order. See also the yellow box caution here. |
|