www.digitalmars.com         C & C++   DMDScript  

D - bytecode & co.

reply Alexander Lahmann <info elco-pro.de> writes:
Hi *,

I
'm interested in using D as a script language in an image processing
system. It is very important for this application that the scripts are
executed as fast as possible. To achieve this, the following needs
exist:

- the D compiler should be able to produce bytecode
- the final bytecode file should not contain "native" code (from the D
inline assembler)
- when objects are released (or the last object reference is removed),
the "virtual machine" should notified - to have the flexibility to
implement a GC-style system or directly using object destruction.

As you can see, I
'd like to use D in an embedded system and don't like the idea to use
garbage collection in a memory-limited device.

Is something like this already available? How am I able to create my own
"bytecode" from D source?

Best regards,
Mark Junker
Aug 31 2002
parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Alexander Lahmann wrote:

 Hi *,

 I
 'm interested in using D as a script language in an image processing
 system. It is very important for this application that the scripts are
 executed as fast as possible. To achieve this, the following needs
 exist:

 - the D compiler should be able to produce bytecode
Current compilers don't do this, but you could write a backend for GCC to produce your bytecode. (There is currently a project in the works to write a D frontend for GCC).
 - the final bytecode file should not contain "native" code (from the D
 inline assembler)
I don't know if any of the current frontends do this, but it seems simple enough to disable this feature...
 - when objects are released (or the last object reference is removed),
 the "virtual machine" should notified - to have the flexibility to
 implement a GC-style system or directly using object destruction.
 As you can see, I
 'd like to use D in an embedded system and don't like the idea to use
 garbage collection in a memory-limited device.
Just turn off the garbage collector, and do your own (C-style) memory management. Otherwise, you'll have to implement your own reference counting algorithm. That's possible, but difficult (especially if you want to handle loops safely). -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Sep 04 2002