For Programmers: Free Programming Magazines  


Home > Archive > Prolog > October 2006 > Logtalk vs XPCE?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Logtalk vs XPCE?
MaR

2006-10-12, 7:05 pm

A somewhat newbie question:

I need OO support in a system to be created.
Logtalk gives good readability and interesting features (object,
protocol, category, syntax).
XPCE, I see as more a graphics library support thingy.. (Am I mistaken
here?)

Since I'd like to use XPCE for UI and Logtalk for modelling, I'd like
to know if there are any issues combining them?

Thanks//M

Paulo Moura

2006-10-12, 7:05 pm


MaR wrote:
> A somewhat newbie question:
>
> I need OO support in a system to be created.
> Logtalk gives good readability and interesting features (object,
> protocol, category, syntax).
> XPCE, I see as more a graphics library support thingy.. (Am I mistaken
> here?)
>
> Since I'd like to use XPCE for UI and Logtalk for modelling, I'd like
> to know if there are any issues combining them?


Me and Jan have received reports in the past of some users doing just
that. I would not expect any roadblocks. Btw, the latest Logtalk
release (2.28.1) includes improved integration with SWI-Prolog (namely,
support for the edit/1 and make/0 development predicates when doing
Logtalk programming).

Cheers,

Paulo

Jan Wielemaker

2006-10-12, 7:05 pm

On 2006-10-12, MaR <Maria.Reinhammar@accalon.com> wrote:
> A somewhat newbie question:
>
> I need OO support in a system to be created.
> Logtalk gives good readability and interesting features (object,
> protocol, category, syntax).
> XPCE, I see as more a graphics library support thingy.. (Am I mistaken
> here?)


I think this observation is correct. There are exceptions, but in
general I would not use XPCE for modelling the application. The
exceptions are applications where the interface is the vast majority
of the code. Calling XPCE methods defined in Prolog is relatively
slow and looses non-determinism (all XPCE methods are
(semi-)deterministic, i.e. they succeed or fail). This is fine for
programming the UI as non-determinism does not play an important role
in I/O programming and performance is often bound by the graphical
operations anyway.

> Since I'd like to use XPCE for UI and Logtalk for modelling, I'd like
> to know if there are any issues combining them?


I've not looked into it for a long time. Long time ago the systems
conflicted in operator usage. I think (not 100% sure) that is no
longer an issue.

I guess the best integration would be to have a logtalk wrapper for
all XPCE classes. XPCE is completely inspectable and it should be
possible to create such wrappers automatically. Ideally, this should
happen lazily as most applications only touch a small part of XPCEs
classes and methods. I don't know enough of Logtalk whether or not that
is feasible. Maybe Paulo is interested.

Cheers --- Jan
Paulo Moura

2006-10-12, 7:05 pm


Jan Wielemaker wrote:
> On 2006-10-12, MaR <Maria.Reinhammar@accalon.com> wrote:
>
> I've not looked into it for a long time. Long time ago the systems
> conflicted in operator usage. I think (not 100% sure) that is no
> longer an issue.


Yes, I believe we solved the operator issue long ago.

> I guess the best integration would be to have a logtalk wrapper for
> all XPCE classes. XPCE is completely inspectable and it should be
> possible to create such wrappers automatically. Ideally, this should
> happen lazily as most applications only touch a small part of XPCEs
> classes and methods. I don't know enough of Logtalk whether or not that
> is feasible. Maybe Paulo is interested.


It should be doable as Logtalk supports all (AFIK) all the OOP concepts
found on XPCE. Creating the wrappers automatically will be the
preferred solution as it would make it easier to keep them synchronized
with XPCE changes. Right now, with all my teaching duties, Logtalk
development, and ISO Prolog standardization work, I've little time left
to write the wrappers code myself but I will be happy to help such a
project. Any volunteers or sponsors? :o)

Cheers,

Paulo

Carlo Capelli

2006-10-13, 4:00 am


"Paulo Moura" <pjlmoura@gmail.com> ha scritto nel messaggio
news:1160656709.094073.261880@k70g2000cwa.googlegroups.com...
>
> Jan Wielemaker wrote:
>
> Yes, I believe we solved the operator issue long ago.
>
>
> It should be doable as Logtalk supports all (AFIK) all the OOP concepts
> found on XPCE. Creating the wrappers automatically will be the
> preferred solution as it would make it easier to keep them synchronized
> with XPCE changes. Right now, with all my teaching duties, Logtalk
> development, and ISO Prolog standardization work, I've little time left
> to write the wrappers code myself but I will be happy to help such a
> project. Any volunteers or sponsors? :o)
>
> Cheers,
>
> Paulo
>


I'm interested to start this work, although my spare time is very limited.
Mapping complex interfaces having introspective abilities is an interesting
theme.
I guess that a basic wrapping of XPCE requires minimal Logtalk code, but
could leave the user facing some
low-level detail of the interface that should be hidden at applicative level
(i tried to 'dig' into XPCE,
but i found the task a bit daunting...). Maybe a top level layer in Logtalk
is required to gain some usability (we can call it a 'framework'?).

Cheers,
Carlo


Paulo Moura

2006-10-13, 7:58 am

Carlo Capelli wrote:
> "Paulo Moura" <pjlmoura@gmail.com> ha scritto nel messaggio
> news:1160656709.094073.261880@k70g2000cwa.googlegroups.com...
>
> I'm interested to start this work, although my spare time is very limited.


Great :-)

> Mapping complex interfaces having introspective abilities is an interesting
> theme.


Using XPCE introspective/reflective features it should be possible to
map all its classes into Logtalk wrappers. This rises two questions:
(1) what will be the computation overhead in using the wrappers? (2)
does the advantages of using a single OOP dialect (Logtalk in this
case) outweigh the work required in implementing the wrappers?

> I guess that a basic wrapping of XPCE requires minimal Logtalk code, but
> could leave the user facing some
> low-level detail of the interface that should be hidden at applicative level
> (i tried to 'dig' into XPCE,
> but i found the task a bit daunting...). Maybe a top level layer in Logtalk
> is required to gain some usability (we can call it a 'framework'?).


I also need to go back to the XPCE docs to find if a set of Logtalk
wrappers or a Logtalk framework would be able to provide high-level
access to XPCE features, at least for common application interface
tasks. That by itself would make this project worthwhile.

I will email you and the remaining people participating on this thread
later next w with my findings.

Cheers,

Paulo

Paulo Moura

2006-10-19, 7:59 am

Paulo Moura wrote:
> ...
> I will email you and the remaining people participating on this thread
> later next w with my findings.


Anyone interested in this topic please send me an e-mail so that we
can further discuss the best way to improve the Logtalk + XPCE
integration.

Cheers,

Paulo

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com