16. november 2008
Beta 3 released
Beta 3 has just been released, with a few minor bug fixes. Thanks for the feedback, everyone!
10. november 2008
Beta 2 released
First stupid bug found and fixed! The issue was with parameters sharing the same name, e.g.
function f(a, a) {}
This gave an obscure internal error. Now it is fixed so it gives a nice "Duplicate definition of name: a" error message instead :-) It is probably not a common situation, but there is one case where I have seen it happen. Consider if someone writes:
function f(int : a, int : b) {}
Do you see the error? The parameter type and parameter name are reversed, which is a typical beginners error for developers used to C-style syntax. In this case it would lead to the previously described internal error, which would be pretty confusing. Now at least it gives a meaningful error message.
Thinking aloud: This makes me wonder though, if there should be a warning if one shadows a built-in name? E.g if I create a variable or parameter named int or String? This is actually perfectly legal in ECMAScript, but I think that in almost all real-world cases it would be a bug.
function f(a, a) {}
This gave an obscure internal error. Now it is fixed so it gives a nice "Duplicate definition of name: a" error message instead :-) It is probably not a common situation, but there is one case where I have seen it happen. Consider if someone writes:
function f(int : a, int : b) {}
Do you see the error? The parameter type and parameter name are reversed, which is a typical beginners error for developers used to C-style syntax. In this case it would lead to the previously described internal error, which would be pretty confusing. Now at least it gives a meaningful error message.
Thinking aloud: This makes me wonder though, if there should be a warning if one shadows a built-in name? E.g if I create a variable or parameter named int or String? This is actually perfectly legal in ECMAScript, but I think that in almost all real-world cases it would be a bug.
9. november 2008
Beta 1 released
Finally, Mascara beta 1 has been released. Download here.
What does beta mean? It means that the program is fully functional and useful, but may still contain bugs. You are invited to download and try it out, and report any bugs you find.
It is not a complete, conformant implementation of ECMAScript 4/Harmony. The official ECMAScript standard is still under development and may still change.
However Mascara supports a number of major ECMAScript 4 features, which makes it a powerful tool for developing serious JavaScript.
New slogan: The JavaScript of tomorrow, today.
What does beta mean? It means that the program is fully functional and useful, but may still contain bugs. You are invited to download and try it out, and report any bugs you find.
It is not a complete, conformant implementation of ECMAScript 4/Harmony. The official ECMAScript standard is still under development and may still change.
However Mascara supports a number of major ECMAScript 4 features, which makes it a powerful tool for developing serious JavaScript.
New slogan: The JavaScript of tomorrow, today.
8. november 2008
Documentation
A Project like Mascara is pretty useless without through documentation. Therefore I've published the beginnings of what is going to be through documentation of Mascara ECMAScript 4.
Among other things, there are pages about some of the new features in the latest releases, which I haven't gotten around to describe here on the blog:
Among other things, there are pages about some of the new features in the latest releases, which I haven't gotten around to describe here on the blog:
31. oktober 2008
Version 0.5.5
Version 0.5.5 has been realeased. We are getting very close to an official beta release. For convenience I provide both a zip and a tar.gz file for download.
New features in this version:
Array comprehensions. One of my favorite features. It is already implemented natively in Firefox, but with the help of Mascara you can have it work in everything from IE 6 to Netscape 3 :-)
Example:
[x*2 for each (x in [1,2,3])]evaluates to [2,4,6]
Destructuring assignments.
Example:
[a, b] = [1,2];Assigns 1 to a and 2 to b. Very convenient.
22. juli 2008
18. juli 2008
Version 0.3.6
Version 0.3.6 is now released. Numerous improvements:
static initializer blocks and static methods are now supported correctly. They work basically like in Java.
Array type literals are supported. They have an interesting syntax:
var a : [...int] = [1,2,3]; // a variable size array of integers
var b : [int, int, int] = [1,2,3]; //a fixed size array of three integers.
So the three dots mean "any number of". Fixed sized arrays can be heterogenous:
var c : [int, String, boolean] = [7, "hello", false];
And believe it or not, an array can even be a combination of heterogeneous types and variable size:
var d : [boolean, String, ...int] = [true, "hello", 1, 2, 3];
The first two items are boolean and String, end every item after is int.
Destructuring variable definitions is also supported now. This allows you to write:
var [a, b] = [1,2];
This is especially useful when returning arrays from a function, e.g.:
function f() { return [1, 2]; }
var [a,b] = f();
static initializer blocks and static methods are now supported correctly. They work basically like in Java.
Array type literals are supported. They have an interesting syntax:
var a : [...int] = [1,2,3]; // a variable size array of integers
var b : [int, int, int] = [1,2,3]; //a fixed size array of three integers.
So the three dots mean "any number of". Fixed sized arrays can be heterogenous:
var c : [int, String, boolean] = [7, "hello", false];
And believe it or not, an array can even be a combination of heterogeneous types and variable size:
var d : [boolean, String, ...int] = [true, "hello", 1, 2, 3];
The first two items are boolean and String, end every item after is int.
Destructuring variable definitions is also supported now. This allows you to write:
var [a, b] = [1,2];
This is especially useful when returning arrays from a function, e.g.:
function f() { return [1, 2]; }
var [a,b] = f();
Abonner på:
Indlæg (Atom)