Timber | Implementation | Spar | Overview | foreach | arrays | array expressions | inline | Vectors | Templates | array interface | elastic array interface | example | Sins |
The language extensions that we have chosen were designed to be unintrusive, powerful, and generally useful. We believe that they do not violate the `spirit' of Java, and that the language extensions are valuable additions to the language. Who knows, perhaps Sun agrees with us (or similar proposals from others), and one day extends the language.
Also, there is a compiler option --java
that switches off
all language extensions. You can also selectively switch off language
extensions.
Another reason not to compile to JVM, is that I am convinced that using a virtual machine still causes a performance hit. Yes, I know that there are reports that prove that Just In Time compilers can cause performance equal to (or even better than) native code, but there are more than enough reports that suggests that this only applies to specific program areas.
The compiler is quite portable and generates fairly portable C++ code (interfacing to the message passing library of the new platform is probably the most difficult part). In that sense Spar code is portable.
At the moment we can only support classes for which we have source
code, or classes that we have re-implemented from the specification.
We are considering implementing a .class
compiler, which would make it easier for us to support arbitrary
Java classes.
However, we try as much as possible to follow the published standard.
Moreover, as several people have argued (see e.g. the Borneo project), the current tight specification of Java floating point behavior is detrimental to floating point calculation. This specification requires the compiler to throw away floating point precision only to be compatible with the standard, and encourages the dubious practice of relying of the exact behavior of a floating point calculation.
The main disadvantage is that templates may cause `code bloat', since for every combination of parameter values that is passed to the generic type a new instance of the template is created. We realize that this may cause problems, but we believe that with responsible use this problem is rarely significant.
The main advantage of templates is that they easily allow a high-performance implementation. Since we are building a compiler for high-performance computing, this is obviously very attractive.
Last modified Sat May 13 15:50:56 2017 UT by Kees van Reeuwijk.