[antlr-interest] Standard library functions: how to??

Bharath S bharath at starthis.com
Wed Apr 21 17:08:57 PDT 2004


Hi John,

I will be generating bytecode and not object code. I get the general
idea; unless you have a language like lets say, MuMath which is built
for special math purposes, I guess I don't need to provide standard math
functions as a feature of the language itself. Instead, they can be
library functions.

In practice, usually libraries for a particular language are written in
the same language itself, right? There could be innumerable library
functions and it could be fair to delegate it to the users of the
language, I guess. I also saw that you mentioned about more and more
library functions being written in Java itself, instead of native code
like C/C++.

Thanks a lot!

Bharath.

-----Original Message-----
From: John D. Mitchell [mailto:johnm-antlr at non.net] 
Sent: Wednesday, April 21, 2004 6:25 PM
To: antlr-interest at yahoogroups.com
Subject: RE: [antlr-interest] Standard library functions: how to??

>>>>> "Bharath" == Bharath S <bharath at starthis.com> writes:
[...]

> By adding, Should I write code for each of the standard library
function
> I am planning to provide? There should be a whole load of library
> functions for any language and there should be an easier way of
getting
> this done, right?

Look at a complete system such as Sun's Java or GCC.

For example, the Java run-time engines come with the standard Java
libraries in a bunch of .jar files (which are bundles of Java .class
bytecode files) which contain all of the Java-based portions of the
standard libraries. In addition, they come with whatever e.g., native
code
(i.e., C/C++) libraries that are needed to interface with the underlying
operating system.  All that the source compiler does in transform the
source code into the bytecode files.

It's interesting to watch the evolution of Java run-time implementations
of
the standard libraries started out with a high-percentage of the code
written in "native code" (C/C++) but as they have matured, more and more
of
the code is being written in Java itself.

[Of course, for a completely new language, I'm completely eliding any
discussion of the joys of bootstrapping.]

Hope this helps,
		John


 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list