Search the web
Sign In
New User? Sign Up
squeak
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: Talking to other languages (with callbacks!) - possible solution   Message List  
Reply | Forward Message #94863 of 143989 |
Lex Spoon wrote:
[snip]
> my working assumptions have been:
> 1. If you want to talk to the software world, speak C. It's the
lingua
> posixa and almost everything can speak it in some fashion.
>
> 2. Speaking C without an accent means you have to support callbacks
> and using the Squeak VM as a library.
>
> 3. Allowing callbacks means that the interpreter must be reentrant and
> that the VM is implemented with a call stack that alternates back and
> forth between Squeak and C.
>
[snip]
> If I understand correctly, the DBus
> strategy might be an alternative that is easier than #3.

Exactly my point.. or, on an aside: easier for me, since I don't
want to get involved in Squeak internals, which I'm guessing would take
a long time to understand well enough to modify nicely (and this assuming
they don't need a complete rearchitecting).

> Further, it
> seems plausible that DBus will become a widely used "language" of its
> own -- perhaps even *the* lingua posixa of 2010 -- thus meaning #1 on
> the list above is unnecessary.

I'm more conservatively hoping it will at least be *supported* for quite a
while :). In any case I agree that it is a good portability strategy to
converse easily with C. Besides, Squeak's easy FFI to the DBus C library
is what made the bindings realizeable in the first place..

> Some questions:
>
> - How hard is it to bind an *arbitrary* C program to DBus? If it's
> easy, then that means we can talk to arbitrary C libraries even when
> they don't already have DBus support. (It also means that DBus will be
> supported more widely, because people can say "why not" and offer DBus
> bindings.)

DBus is a C library, so in that sense its trivial..
If you mean 'how hard is it to bind an arbitrary object-oriented system',
then I would say it seems relatively simple given the work I've done for
Squeak bindings. It is *designed* to be easy to bind..

> - You mention some impressive high-level examples--TeapotMorphs
> and TFrames. How about basic stuff like arithmetic? That is, how hard
> would it be to write in C the following:
>
> obj = executeSmalltalkCode("Compile evaluate: '5 factorial'");
>
> How complicated is executeSmalltalkCode()?

Well, currently this is not very hard.. it would just be a matter of
constructing a message to whatever object 'Compile' is, and reading the
answer.. maybe 5 lines of C.

> I ask about this example because I am wondering about what the exact
> overheads are of going via DBus. Those overheads can easily disappear
> into the noise if you are doing a more complicated project.

If you mean performance overhead: I haven't done benchmarks, and things
really aren't at that stage yet ("premature optimization..").
If you mean boilerplate-type overhead, this can be reduced...

> Please update the list with any further work you do on it -- this is useful
stuff!

I'll announce something this week.. I appreciate the response - it lets me
know other people are interested in the issue..

cheers,
Daniel






Mon May 23, 2005 6:26 pm

faken@...
Send Email Send Email

Forward
Message #94863 of 143989 |
Expand Messages Author Sort by Date

Lex Spoon wrote: [snip] ... lingua ... [snip] ... Exactly my point.. or, on an aside: easier for me, since I don't want to get involved in Squeak internals,...
Daniel B. Faken
faken@...
Send Email
May 23, 2005
6:27 pm

I see you've posted your D-bus bindings, Daniel. Cool! What I meant by overhead and by talking to arbitrary libraries is, for example, is this a way to...
Lex Spoon
lex@...
Send Email
May 25, 2005
9:35 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help