[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some thoughts about GS

From: Nicola Pero
Subject: Re: Some thoughts about GS
Date: Tue, 16 Jan 2001 11:36:40 +0000 (GMT)

> > About the barrier of Objective C. As much as I like Objective C  
> (and I
> > like it a lot!) I have to agree with those who do not like to be  
> forced to
> > use one language or another. After all, I hate being forced to use  
> Java. It
> > would be nice if GNUstep could attain some kind of language  
> neutrality, or
> > offer bindings for Java, Smalltalk, LISP, Python... Something like  
> the
> > promises made by .NET / C# .
> Of course there were many answers about the merits of Objective C (I  
> don't have to be convinced). I also almost agree with those who say,  
> in essence: "screw them if they're too dumb to try something  
> different". But the question was: how to get a greater GNUSTEP  
> following among developers.
> Many references were made to the fact that Guile, Smalltalk can be  
> used as some kind of scripting languages for GNUSTEP. That's nice,  
> but that's not exactly what I had in mind. Could I use a Smalltalk or  
> Java object as a NSBrowser delegate? I know this is probably way too  
> ambitious, a reminder our brief 'universal runtime' OREO encounter.

I realize I probably need to expand this topic.

You can program GNUstep in:

 * Objective-C.  (of course).

 * guile and java - we have interfaces for both of these languages.

 * smalltalk ? heard someone working on it but I never tried it.

I say `interfaces' and not `bindings' because I mean something very

When I talk about a `interfaces' I mean more than `bindings'.

`Bindings' mean that someone has hard/hand coded a wrapper library in
another language which internally calls the original library.  Bindings
work for a single library.  Eg, if someone implements `gtk bindings' for
Objective-C, this simply means he has wrapped some gtk functions into
Objective-C classes.  You can't use the `gtk bindings' to access, say,
gnome libraries, unless someone else has written also `gnome bindings' for
Objective-C.  You can only use them to access gtk.  Bindings are hand/hard
code wrappers for a specific library.

`Interface' means something more powerful, complex and flexible -
basically an interface between the two language run-time systems which can
in some way map certain language constructs from one language to another
one.  For example, a gtk/objective-c interface would mean something which
can automatically create a proxy objective-c object for any gtk object,
and viceversa, and convert calls between the two - and possibly other
stuff such as selectors <--> gtk functions etc - and hide all this to the
programmer - then you wouldn't need to hard/hand code bindings - or at
least if you still need bindings because the gtk object system is not
flexible enough to support such run-time dynamism, you could have the
interface generate the bindings for you for an arbitrary library instead
of having to hard/hand code them yourselves.

Said that, GNUstep has both a guile and a java _interfaces_.  Since they
are 'interfaces' and not simply 'bindings', they are quite complex piece
of software, but they are very powerful.  When you program gnustep in
guile, you can really program it in guile - you can create objective-c
objects from guile, call objective-c methods from guile, implement new
objective-c classes using guile procedures, run guile commands from
withing objective-c code, ...  In a similar way, when you program gnustep
in java, you can really program it in java - you can create objective-c
objects in java, call their methods and use them as if they were java
objects, implement new objects in java and pass them to objective-c as if
they were objective-c objects, subclass objective-c classes in java; run a
java virtual machine in an objective-c program and then access the java
objects in the JVM as if they were objective-c objects, ... - the
interfaces keep track for you of all the messy low-level details of
interfacing the runtimes and allowing you to use objects of the other
language as if they were objects of your language.  (With java, you need
to generate `wrappers' for an objective-c library before you can access it
from java - that's because java is very strict on loading external code,
strict typing etc - but the interface generates the wrappers automatically
for you.)

Both the interfaces work fine - even if they probably have not a big user
base, since people programming in gnustep usually use Objective-C.

Again - just to repeat myself once more - the guile and java interface do
not only provide guile and java bindings for the gnustep base library -
they potentially provide bindings for *any* objective-c library written in
objective-c - and advanced integration of the languages.

They are probably best suited when the core business is done in
objective-c, and the miriad of little scripts/servlets/small apps/tests
which work around the core business and use the core business are written
in java and/or guile by programmers who do not know (or simply do not
like) objective-c and can only code (prefer coding) in java and/or guile.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]