Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Help a newbie understand how to create a "native library" for any new language
"rdc02271" <rdc02271@yahoo.com> schrieb im Newsbeitrag
>
> Can any of you show me an example of what would be the perfect
> solution for the libraries problems?

Sorry, there's usually no such thing as a perfect solution.

I recommend the book _Linkers and Loaders_ by John R. Levine (the
moderator of this newsgroup) and the documentation of GNU Libtool:
http://www.gnu.org/software/libtool/libtool.html.  You might want to
take a look at the relevant chapters in Kernighan and Ritchie, _The C
Programming Language_ and Stroustrup, _The C++ Programming Language_.
This will give you a clearer idea of what libraries are.  You could
also take a look at the source code of the GNU implementations of the
C and C++ standard libraries.

Generally speaking, a library for C will be written in C, a library
for C++ in C++, etc.  Assembler is platform-specific, so it's not a
good choice for code that's intended to be ported to other systems.
It's best suited for platform-specific optimizations, not for large
programming tasks.

> When you create a new langauge like D how do you create the
> libraries to work with the operating system (for instance Windows) ?

I can't help you with Windows, but in Unix-like systems, the operating
system provides so-called "system calls" in order to make it possible
for programs to communicate with the operating system.
Implementations of C provide functions that map to these system calls,
so that programmers can access them from their programs.  'creat',
'fork', 'exec', 'read' and 'write' are such system calls.  The C
standard does not specify what they do, since they may differ from
system to system.

Laurence Finston

Report this thread to moderator Post Follow-up to this message
Old Post
Skandinavisches Seminar
05-15-05 08:57 AM


Re: Help a newbie understand how to create a "native library" for any new language
"Skandinavisches Seminar" <skandgoe@gwdg.de> wrote:

> Generally speaking, a library for C will be written in C, a library
> for C++ in C++, etc.

Even though this is true on the source code level, it seems that on
the object code level, one way to do it is to mangle the code into a
C-library. For example, when doing this, the C++ directive 'extern "C"
....' becomes a directive 'do not C++ mangle ..., but use C
conventions directly'.

--
Hans Aberg

Report this thread to moderator Post Follow-up to this message
Old Post
Hans Aberg
05-16-05 01:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compilers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:03 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.