From: Nikhil Ketkar
Subject: ECL or Guile
Date: 
Message-ID: <1131792319.697817.82730@g44g2000cwa.googlegroups.com>
I wanted some advice about certain implementation issues. I have to
write a system which will be a toolkit for implementing new ideas about
finding patterns in graphs. On one hand this will involve a lot of
expensive stuff like graph-isomorphism (not np-complete but very very
bad) . On the other hand the system needs to be very very flexible with
a high level language front end. The uses of this system will use the
high level language to implement their ideas.

My initial plan was to use ECL. Implement the whole thing in CL,
profile it find the troublemakers and code them in C . The users could
implement their ideas in Lisp. Then I thought I could do the same in
Guile.
That would involve writing stuff in C and a Scheme front end will be
ready for the users.

I think the ECL plan is better as I write most part in Lisp and will be
able to identify the troublemakers. But then I know most of them and
writing them first in Lisp and then in C will be a waste of time.


Thanks,
Nikhil Ketkar

From: Pascal Bourguignon
Subject: Re: ECL or Guile
Date: 
Message-ID: <87oe4qm17i.fsf@thalassa.informatimago.com>
"Nikhil Ketkar" <············@gmail.com> writes:

> I wanted some advice about certain implementation issues. I have to
> write a system which will be a toolkit for implementing new ideas about
> finding patterns in graphs. On one hand this will involve a lot of
> expensive stuff like graph-isomorphism (not np-complete but very very
> bad) . On the other hand the system needs to be very very flexible with
> a high level language front end. The uses of this system will use the
> high level language to implement their ideas.
>
> My initial plan was to use ECL. Implement the whole thing in CL,
> profile it find the troublemakers and code them in C . The users could
> implement their ideas in Lisp. Then I thought I could do the same in
> Guile.
> That would involve writing stuff in C and a Scheme front end will be
> ready for the users.
>
> I think the ECL plan is better as I write most part in Lisp and will be
> able to identify the troublemakers. But then I know most of them and
> writing them first in Lisp and then in C will be a waste of time.

Perhaps not.

If you can write the troublemakers in lisp in 1/2 hour correctly, then
you can spend 1/2 week to debug them in C, having a reference implementation.

In anycase, better use ECL than guile.

-- 
"By filing this bug report you have challenged the honor of my
family. Prepare to die!"
From: Rainer Joswig
Subject: Re: ECL or Guile
Date: 
Message-ID: <BF9C156E.1E363%joswig@lisp.de>
Am 12.11.2005 11:45 Uhr schrieb "Nikhil Ketkar" unter
<············@gmail.com> in
·······················@g44g2000cwa.googlegroups.com:

> I wanted some advice about certain implementation issues. I have to
> write a system which will be a toolkit for implementing new ideas about
> finding patterns in graphs. On one hand this will involve a lot of
> expensive stuff like graph-isomorphism (not np-complete but very very
> bad) . On the other hand the system needs to be very very flexible with
> a high level language front end. The uses of this system will use the
> high level language to implement their ideas.
> 
> My initial plan was to use ECL. Implement the whole thing in CL,
> profile it find the troublemakers and code them in C . The users could
> implement their ideas in Lisp. Then I thought I could do the same in
> Guile.
> That would involve writing stuff in C and a Scheme front end will be
> ready for the users.
> 
> I think the ECL plan is better as I write most part in Lisp and will be
> able to identify the troublemakers. But then I know most of them and
> writing them first in Lisp and then in C will be a waste of time.
> 
> 
> Thanks,
> Nikhil Ketkar
> 

Hi,

why do you want to use ECL or Guile? Do you want to embed the Lisp system in
some other software? Generally I would prefer to write any non-trivial code
in CL, since it makes large portions of the software easier to move between
different implementations and platforms - that way one can have more
deployment options.

Otherwise, almost any CL implementation has some FFI (Foreign Function
Interface) and some support for calling libraries written in C. You could
use one of the 'faster' Common Lisp implementations like CMUCL, SBCL,
OpenMCL, LispWorks (commercial), MCL (commercial) or Allegro CL
(commercial), ...  These implementations all have a native code compiler, so
you probably need to move less code to C.

The most prominent Common Lisp implementations which compile to C are ECL
and GCL. Probably GCL is more mature. There is also CLISP, which is written
in C for a large part.

Rainer Joswig
From: Nikhil Ketkar
Subject: Re: ECL or Guile
Date: 
Message-ID: <1131915464.270032.104350@g49g2000cwa.googlegroups.com>
I have made a lot of progress in very less time by deciding to write
everything in CL first. There were 3 of major mistakes in my design
which became evident to me just after geting a basic prototype done in
about a day. Had I done this with C and Guile, this would happen
sometime next week.

Another quick question. Just because I rewrite an expensive task in C,
it's not going to be faster than CL. It may happen that writing in C
may not make any difference when compared with compiled CL code. How do
I judge when a C implementation will help? Could you give me some
heuristics?

Thanks,
Nikhil Ketkar
From: drewc
Subject: Re: ECL or Guile
Date: 
Message-ID: <HUOdf.493392$oW2.302655@pd7tw1no>
Nikhil Ketkar wrote:
> I have made a lot of progress in very less time by deciding to write
> everything in CL first. There were 3 of major mistakes in my design
> which became evident to me just after geting a basic prototype done in
> about a day. Had I done this with C and Guile, this would happen
> sometime next week.
> 
> Another quick question. Just because I rewrite an expensive task in C,
> it's not going to be faster than CL. It may happen that writing in C
> may not make any difference when compared with compiled CL code. How do
> I judge when a C implementation will help? Could you give me some
> heuristics?

Well tuned CL can be as fast, and sometimes faster, than C. As premature 
optimisation is the root of all evil, i'd say you never need to 
implement in C unless you can prove to yourself that the C code will 
make a significant difference in execution speed.

Write your code, profile it to find the hotspots, tune only that code, 
and you'll likely find that there is no need to turn to C in anger. This 
ain't python, and the answer to performance issues will never be 'write 
your inner loops in C', but rather, 'profile, add the proper 
declarations, and watch your lisp code fly.'



drewc


> 
> Thanks,
> Nikhil Ketkar
> 


-- 
Drew Crampsie
drewc at tech dot coop
  "... the most advanced use of lisp in the field of bass lure sales"
	-- Xach on #lisp