Tech Support > Computers & Technology > Programming > Binary format for compiled code
Binary format for compiled code
Posted by Mark R.Bannister on November 6th, 2003


Hi,

I'm currently designing a new language that compiles into a bytecode
format (this bytecode will be interpreted). I have a choice:

a) Design my own binary file format for the bytecode, symbols and data

b) Use an existing standard for the file format, if existing tools
would then be of use (but the format must not prevent my file from
being portable)


What do you think?

Cheers,
Mark.

Posted by TLOlczyk on November 7th, 2003


On 6 Nov 2003 15:16:17 -0800, Chapter33@aol.com (Mark R.Bannister)
wrote:

shouldn't be designing your own language.

Oh. Yeah I also think you are much better off compiling to native.

----------------------------
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess.
----------------
Thaddeus L. Olczyk, PhD
Think twice, code once.

Posted by Corey Murtagh on November 7th, 2003


Mark R.Bannister wrote:

Unless you're compiling to Java bytecode, or some other existing format,
there's not a whole lot of point trying to achieve binary compatibility
with any existing standard.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"


Posted by Arto V. Viitanen on November 7th, 2003


Mark> Hi, I'm currently designing a new language that compiles into a
Mark> bytecode format (this bytecode will be interpreted). I have a choice:

Mark> a) Design my own binary file format for the bytecode, symbols and data

Mark> b) Use an existing standard for the file format, if existing tools
Mark> would then be of use (but the format must not prevent my file from
Mark> being portable)


Mark> What do you think?

I think about b). That is, I have desinged/am desinging (functions are still
missing) my own programming language. It has interpreter now and some day I
might make a compiler for it. I would use Java virtual machine and I thought
it might be suitable to try Jakarta Byte Code Engineering Library instead of
java assemblers. For the interpreter I have used Java compiler compiler and
Java Tree Builder (http://www.cs.purdue.edu/jtb/).

--
Arto V. Viitanen av@cs.uta.fi
University of Tampere, Department of Computer Sciences
Tampere, Finland http://www.cs.uta.fi/~av/

Posted by TLOlczyk on November 7th, 2003


On 07 Nov 2003 10:04:14 +0200, av@cs.uta.fi (Arto V. Viitanen) wrote:

----------------------------
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess.
----------------
Thaddeus L. Olczyk, PhD
Think twice, code once.

Posted by Calum on November 7th, 2003


TLOlczyk wrote:
Both are valid design decisions. In the longer term, I think b) will
save time and produce faster executables. Unless OP wants to implement
an interpreter for the fun of it :-)

Really? A lot of new languages don't compile to native. You feel this
is a mistake?

In the short term, I would strongly suggest making the language
interpreted. In the medium term, I suggest targeting an intermediate
language like .net, c, c-- or Java bytecode. All portable. Learning
the ins and outs of the .net architecture would probably benefit you the
most, and by all accounts it is the best VM. Mono is the open source
version.

Compiling to native will be a lot of work for very little gain. Do that
last, if ever.



Posted by bd on November 9th, 2003


Mark R.Bannister wrote:

Prehaps you should look into the Parrot bytecode interpreter? It'll make it
easier to implement option b (though, it's currently pre-alpha, but
usable): http://parrotcode.org


Posted by TLOlczyk on November 9th, 2003


On Fri, 07 Nov 2003 14:28:47 +0000, Calum <calum.bulk@ntlworld.com>
wrote:

some cases I don't use software develped in them either.

hardware to make up for the speed hit.

The JVM, .NET and Mono are all crap produced not for the sake
of high quality compilers but for the sake of waging a monopoly war.

especially where resources are tight.
----------------------------
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess.
----------------
Thaddeus L. Olczyk, PhD
Think twice, code once.

Posted by Programmer Dude on November 10th, 2003


TLOlczyk wrote:

If speed is a primary criterion, then native code is definitely
the way to go.

But if portability (or something thing else) is a primary concern,
then perhaps not, eh?

--
|_ CJSonnack <Chris@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|


Similar Posts