www.digitalmars.com         C & C++   DMDScript  

D - Intermediate code

reply Alcides <dignor_sign yahoo.es> writes:
Is this feasible?

If we want to build portable code, we should have a set of cross-platform
libraries to run us one’s over. I think this set must be under somebody control,
and must change under some unique version system.
In the other way, there will be a lot of libraries just using the cross platform
ones, in some way “portables”. 
But object code format is unique for each platform, so, we have to lose the
wonderful feature of D about using type information encoded in a library. The
classic solution has been intermediate code. Some people instinctively
associates intermediate code to .NET or Java, but in fact it is used in many
other compilers (C++ compilers, not to forget the old P-code in earlier Pascal
impl, and I guess any present time decent compiler does) as a step in
translation to native code. We might then just delay this process until the
final software is about to be installed in its target platform. By the way, then
we can encode in that binary some class of signature proving component
authenticity. Not to forget that perhaps, attending to its productivity, D could
be of some interest to commercial world.
Of course, this requires a standard, and sometimes this is hard to achieve in
the open community.
Sep 14 2003
parent Ilya Minkov <minkov cs.tum.edu> writes:
Alcides wrote:
 Is this feasible?
Yes. It's much easier than bind D to GCC or write yet another back-end.
 Of course, this requires a standard, and sometimes this is hard to achieve in
 the open community.
There are. Look at http://www.tendra.org/ Also, C can be considered as a kind of intermediate code. You can even embed some conditional compilation to adapt to different platforms. However, these all are for executable code. Type information (for import and so on) is quite a different thing and is probably eliminated to a significant extent within D front-end. -eye
Sep 14 2003