Re: C and other programming languages
- From: Friedrich Dominicus <just-for-news-frido@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 07 Apr 2007 09:13:33 +0200
"cr88192" <cr88192@xxxxxxxxxxxxxxxxxx> writes:
Well yes I agree, therfor my question. How is it done in you language
IMO, the FFI is one of those problems where it is nearly impossible to come
to a good solution. usually wrapping a C function requires manual effort,
because even if a few trivial things map, other things don't.
of choice. How easy do you find it, what do you like about the
approach taken and why?
Well you can write wrappers by hand, or you can generatrors like e.g
most of the time it comes down to this:
write wrappers;
register wrappers;
try to wrap complex data in a way that doesn't totally suck.
SWIG. However it's often automated or at least one gets tool support
either by the implementation itself or some third party tool. I have
used a few of them I have interfaced different parts with C, but my
knowledge can just be "regional". I for my part found the way this is
and can be done in Tcl/TK and/or Ruby not very difficult, I'd argue
the interface froim Tcl/Tk to C is somehow better, but I can not tell
exaclty why. And so I'd like to get other opions. Maybe the questions
is in the end how easy can interfacing different languages mean. Well
you can argue one should code for .NET which is supposed to be
"language" neutral. But well the current state of OSes is not that
they are build on anything close to .NET, but mostly some "C" dialekt.
I know on the other hand that especially the Lisp vendors have spend a
lot of money for making it easy to interface to libraries written in
C. In LispWorks e.g you feed some tools the headers and the code is
mostly generated automatically. Well they have experiences with this
since the infanthood of C. The Smalltalks fight "similiar" problems
and currently most of the scripting languages are written in C. But
IMHO interfacing is still quite "difficult"
Oh, well I have to disagree, I'm not very fond of the Macros in C. But
IME, typically the later issue is at least a little easier. if anything,
nothing is really convinient from C, and at least macros are a good easy way
to wrap most problems in C (and in C++ there are a few even more powerful
mechanisms for wrapping...).
that's a different story ;-(
I can not see that. It's quite easy at least in Ruby. They have
the net result is that it is often not too difficult to use script features
(datatypes, ...) in C, but it is a horrible pain to use C code/data/... from
the script language.
special suport for wrapping "C Datastructures.", and well I know from
at least one Eiffel where C is mostly the underslying implementation
of the basic data structures.
the general result is that:Well yes that and so what are good example which are "bad"
the C codebase is either small or very centralized around the VM;
the scripted parts of the app are dominate;
often the app has poor access to external libraries;
...
Well this is quite general. What about a few example which are
if one can get the C and script code to share the same underlying mechanics,
then the problem should be a little easier.
especially dislike or like?
Oh, well if that would be "easier" one would have accomplish something
I don't as of yet have a working C compiler though, and there is still a
long way to go.
but then in all this I accomplish nothing new.
quite new ;-)
However thanks for you comments. I hope others will take them
further....
--
Please remove just-for-news- to reply via e-mail.
.
- Follow-Ups:
- Re: C and other programming languages
- From: Marco van de Voort
- Re: C and other programming languages
- From: cr88192
- Re: C and other programming languages
- References:
- C and other programming languages
- From: Friedrich Dominicus
- Re: C and other programming languages
- From: cr88192
- C and other programming languages
- Prev by Date: Re: C and other programming languages
- Next by Date: Re: C and other programming languages
- Previous by thread: Re: C and other programming languages
- Next by thread: Re: C and other programming languages
- Index(es):
Relevant Pages
|