Subject Re: [Firebird-Architect] Re: embedding Lua as procedural language
Author Jim Starkey
Adriano dos Santos Fernandes wrote:
> Jim Starkey escreveu:
>
>> I could probably design a better language for the problem. The question
>> is whether it would be sufficiently better to justify the effort
>> involved in the design and in the endless explanations of why a new
>> language was necessary.
>>
>>
> ...
>
>> I'll probably extend the JavaScript implementation to handle 64 bit
>> iinteger with decimal scale factor and maybe BigInt.
>>
> So you are designing a new (better?) language. It will not be Javascript.
>
> The problem with reimplementing existing languages is maintaining up to
> date with new versions, from the POV of who is not focused on the
> language itself (i.e., a database implementor).
>
> Using an existing implementation with its API is transparent to upgrade.
> Java in FB embeds the JVM through JNI. It's tested with Java 6.
> Certainly can work with Java 5, and probably with any complaint JVM.
>
> Oracle 10g is tied with (Oracle) JVM 1.4 - sigh. Oracle 11i with JVM 5.
> And there is Java 6.
>
> Just to know, what's the version used in Netfrastructure? Does it
> adheres 100% to the spec.?
>
>
A valid point.

The date of the ECMAScript document (ISO standard for JavaScript) is
December, 1999. Not a big risk.

Java extensions have been to the language, not the JVM. Other than
"clarifications", the class file format has been essentially stable.
The Java guys have been very care (and very clever). Subclasses, for
example, are distinct and separate classes with funny names to the JVM
and not subsclasses at all. Similarly for iterators and enums. The
class file format and JVM structure was remarkably well thought out.
This is not true of the base classes, however, and a JVM is tighly bound
to the set of base classes.

Probably the biggest change to Java runtime world was the introduction
of JNI itself. The first version of Java had a horrible native
interface, Microsoft had one that was substantially less bad, and
Mozilla had one also good enough to use. Sun eventually took the
Mozilla interface and morphed it into something the world could live with.

But, no I'm not designing a new language, at least not yet. I will
probably extend the set of internal types to avoid loss of precision and
cyclical conversions between integer and double, but they the external
evidence will be the absence of roundoff errors over a larger range of
values. As a language, JavaScript is somewhere between C and Java on
language size and much smaller than C++. And, likely almost all modern
languages, the vast bulk of an implementation is a huge runtime
library. However, it isn't necessary to implement the full runtime to
be useful. I'll implement what I need as a need it, deferring as much
as possible to the productization phase.

The Netfrastructure JVM is much the same. Only about half of JNI is
actually there, but what's there is sufficient to server the full set of
base classes. Certifying the JVM is too expensive to consider,
however. It does run the Sun SSL implementation, which is a pretty good
test of a JVM.

--
Jim Starkey
President, NimbusDB, Inc.
978 526-1376



[Non-text portions of this message have been removed]