|Builtin Interpretation firstname.lastname@example.org (Philip Herron) (2009-04-29)|
|Re: Builtin Interpretation email@example.com (BartC) (2009-05-03)|
|Re: Builtin Interpretation firstname.lastname@example.org (Philip Herron) (2009-05-05)|
|Re: Builtin Interpretation email@example.com (cr88192) (2009-05-06)|
|Date:||Sun, 03 May 2009 15:02:04 GMT|
|Posted-Date:||03 May 2009 20:22:14 EDT|
"Philip Herron" <firstname.lastname@example.org> wrote in message
> I am getting on much better with my programming language i am making
> at the moment, when i get it to a decent state I'll send around the
> Anyways, this doesn't affect me but i was thinking about interpreters,
> say you have a programming language which needs to like read/write to
> a file or otherwise some System interface call, so for that
> programming language the library for doing that is probably written in
> its own language, but when it comes down how does it exec:
> fopen()... or otherwise...
> Or more precisely how does it know to do such a thing, is it that
> there is a special built-in keyword which the interpreter picks up to
> know hey we need to do 'X'. Thats one way i think it could be done,
> but is that the way most things do it? I need to do some more reading
> into interpreted languages.
Under Windows, the OS (and also the C runtime) can be called via DLL
interfaces, so by arranging a way of calling DLL files, it's easy to
make all these essential system calls.
In one of my interpreted languages, these declarations look like:
clang function fopen (istring,istring)int
windows function DeleteFileA <erasefile> (istring)int
(istring means something like char*, and maybe that library should be
This provides a mechanism to call /any/ dll functions, independently of
whether the interpreter is aware of them.
But if the interpreter is coded in C for example then C runtime calls can be
statically linked in, and Windows calls can also be taken care of. Then yes
there can be a list of standard, built-in function calls that the
(However an interpreted language might need a softer, more tolerant
interface than is provided by raw C or Win32 functions...)
Return to the
Search the comp.compilers archives again.