Seems OK. Except this passage:
Certain programming conventions should be respected in the hopes of facilitating the optimization of the Tachyon source code. In particular, we emphasize an OOP style which easily translates to that of languages such as Java and C++.
Using an OOP style does not facilitate optimization. Imagine a constructor like:
function Foo() { this.field = ...; this.meth = function () { ... this.field = ... } }
It will be hard for a compiler to determine that the call x.meth() is actually calling the method "meth" in Foo (not only does the compiler have to determine that x is always an instance of the constructor Foo, but you have to ensure that there have been no mutations of the field "meth" in the instance bound to x). So it is hard to inline that method in place of the call x.meth(). Moreover, space has to be reserved in all instances of Foo for all the methods in the non-optimized case, and it is not clear how these fields can be eliminated.
On the other hand, if the program was written using a procedural OOP style, such as:
function Foo() { this.field = ...; }
function meth(self) { ... self.field = ... }
then it is much easier to inline the method "meth" in place of the call meth(x) and there is no extra space required in the instances.
Note that the inlining must still be guarded (by an absence of mutation to the global variable "meth") but other than that it requires a trivial data flow analysis (looking for all the mutations of the global variable "meth").
So please explain why you propose using a C++/Java style OOP style. Why not use the procedural variant?
Marc
On 2010-05-06, at 6:18 PM, chevalma@iro.umontreal.ca wrote:
I shared a file containing preliminary JavaScript programming guidelines in the Tachyon Google Docs folder. You should all have access to it.
The conventions are mostly what Erick, Marc and I discussed. I added some extra points, which I'd like your opinion on, if you disagree.
You are also free to add other points there or introduce more examples. We all have edit access to the file.
- Maxime
Tachyon-list mailing list Tachyon-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/tachyon-list