T. Kurt Bond | 1 Feb 2006 18:15

clisp.sty and ecl.sty?

Are clisp.sty and ecl.sty, mentioned in .../doc/Makefile.in, available
anywhere?  They don't seem to be in the distribution or in CVS.
--

-- 
T. Kurt Bond, tkb@...

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Ivan Toshkov | 2 Feb 2006 13:53

Embedding ECL in a C++ app.

Hi all,

I've decided to try and embed ECL in a C++ web-app (read CGI scripts)
running under Linux.  It is a proprietary application, so I can't post
code here, but probably I can give enough info.  We have other
embedded languages, mainly for UI stuff, but I wanted to see how far I
can go with Lisp in this particular setup.

I've tried several times before, but our system failed to compile with
so many errors, that I've got discouraged after an hour or so.  Until
the next time.  And the most interesting part was, that I had no
problems compiling a sample C++ app with ECL.

At last, a few days ago a colleague of mine actually found the
problem:  ECL and our system both had the same file named "config.h". 
They both were in the include path, but ours was first, so ECL found
it and, naturally, failed to compile.

So, my first suggestion is to move most of the include files in a
subdirectory, named e.g. "ecl" and include them like this:

#include <ecl/config.h>

The "ecl.h" file itself probably doesn't need to go there, which
should keep it backwards compatible.

BTW, I found that at cl_defvar and cl_defparameter are declared in the
external.h but are never defined.  Should be easy to remove them, but
probably better to implement?

(Continue reading)

Goffioul Michael | 2 Feb 2006 15:56
Picon

RE: Embedding ECL in a C++ app.

> 1.  How to catch errors in the C++ part?  I use si_safe_eval 
> to run the Lisp code.  When there is an error in it, the Lisp 
> debugger runs. 
> In a while, I'd probably try to have a REPL, listening on a 
> different port, but for now (and for the production system), 
> I'd like to just log the error.

In my embedded ECL, I do it by setting *debugger-hook* to an internal
handler routine.

> 2.  The C++ app doesn't use a garbage collector, but I don't 
> know what happens when I link it with ECL, and through that, 
> with Boehm's GC. 
> Any pointers (pun unintended, but noticed)?

AFAIK, the GC only cares about LISP objects.

> 3.  I don't want to complicate the build process more than 
> it's absolutely necessary, so I don't use the fancy Lisp like 
> C++ macros  <at> (defun ...) and friends, but I still want to 
> define Lisp functions with &optional, &keyword, and &rest 
> argument lists from C.  How?

I guess by writing a dummy .d file, running dpp on it and looking at the
result. However, because it's ECL's internal, I don't know if the code
structure is subject to change, hence you might have portability issues.

Michael.

-------------------------------------------------------
(Continue reading)

David Creelman | 6 Feb 2006 03:50
Picon
Picon
Favicon

Re: new ECL list member/ ECL project

On Wed, Jan 25, 2006 at 10:17:43AM +0100, Goffioul Michael wrote:
> > Hi Michael,
> > 
> > Thanks for that. My app doesn't crash now.
> > How do you setup a gray stream ?
> > 
> > I'd love to be able to echo errors and general standard 
> > output goodness to the screen.
> > 
> > In the FAQ, it points to xchat, but I couldn't find the 
> > implementation of gray streams there.
> 
> Here are parts of my implementation (not fully functional, but you
> probably get the idea). lisp.d defines the MEX interface and the
> low-level
> routines to redirect ECL outputs to MATLAB window. It also defines a
> temporary output stream as a string-stream used during the
> initialization
> process. Finally, it loads minit.lsp (compiled in the MEX file, loaded
> through the init_MINIT call), which setup the gray streams.
> 
<snip>

Thanks for that Michael. When I see .d files does it mean that these files contain interface code for ECL that
has to be compiled for ECL with the d preprocesssor/compiler? Or, could I just as well write these in C and
link it in with my app ?

Cheers
DC
> 
(Continue reading)

Goffioul Michael | 6 Feb 2006 08:55
Picon

RE: new ECL list member/ ECL project

> Thanks for that Michael. When I see .d files does it mean 
> that these files contain interface code for ECL that has to 
> be compiled for ECL with the d preprocesssor/compiler? Or, 
> could I just as well write these in C and link it in with my app ?

Indeed, I use the ECL preprocessor dpp to convert the file to plain C
code.

Michael.

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
Juan Jose Garcia Ripoll | 6 Feb 2006 11:15
Picon

Re: error while compiling: THROW: The catch #:G1 is undefined.

On Thu, 2006-01-19 at 15:40 -0800, Greg Pfeil wrote:
> > On Mon, 2006-01-16 at 09:07 +0100, Peter Van Eynde wrote:
> >> Hello,
> >> 
> >> While compiling a newer version of clc (which does compile on cmucl/sbcl
> >> and an older clisp)  I get the following error. Is there anything I can
> >> do to debug this further? If I try to remove the offending function
> >> the error just moves round. [...]
> >> ;;; Note: Replacing variable G736 by its value #<form VAR 866FE88>
> >> [...]
> >> THROW: The catch #:G1 is undefined.
> >> Broken at COMPILE-FILE.
> 
> Oh, cool. I've been seeing this, too ... Not the _most_ recent CVS, but
> newer than 0.9h.

After a lot of debugging, I found out that this was due to a problem in
SAFE-EVAL. This function was implemented using some "magic" that has
disappeared in recent versions. The fix has been to reimplement
SAFE-EVAL using *DEBUG-HOOK*, a variable that allows one to trap
invocations of the debugger and which SAFE-EVAL uses to cause an
immediate return.

The reason why it took so long is that there is no easy way to implement
SAFE-EVAL using the standard Common-Lisp. SAFE-EVAL also has to protect
ECL against nonlocal jumps outside the function that invoked it.

Furthermore, it was not so easy to figure out that *DEBUG-HOOK* was the
solution. At first I tried with variations of HANDLER-BIND but this has
a horrible problem: if SAFE-EVAL sets up a handler for all conditions,
(Continue reading)

Juan Jose Garcia Ripoll | 6 Feb 2006 11:37
Picon

Re: --help

On Tue, 2006-01-24 at 11:28 -0800, Greg Pfeil wrote:
> I noticed a little oddity in the behavior of the usage message on the ECL
> command-line.
> 
> When I run:
> 
>     $ ecl --help
> 
> The rc file is loaded before printing the message. However, when I give an
> unknown option, like
> 
>     $ ecl -h
> 
> The message is printed without loading the rc file. In a case where there's
> an error in an rc file, this could cause a problem, as --help never gets to
> the help message, while -h does.
> 
> I would recommend that the rc file is never loaded when the help option is
> passed.

Implemented in CVS.

Juanjo

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
(Continue reading)

Juan Jose Garcia Ripoll | 6 Feb 2006 11:38
Picon

Re: clisp.sty and ecl.sty?

On Wed, 2006-02-01 at 12:15 -0500, T. Kurt Bond wrote:
> Are clisp.sty and ecl.sty, mentioned in .../doc/Makefile.in, available
> anywhere?  They don't seem to be in the distribution or in CVS.

They are nowhere to be found. It seems that the original documentation
was designed to be printed as a book, but Attardi's EcoLisp lacked the
files to produce these printed manuals.

Juanjo

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Juan Jose Garcia Ripoll | 6 Feb 2006 11:49
Picon

Re: Embedding ECL in a C++ app.

On Thu, 2006-02-02 at 14:53 +0200, Ivan Toshkov wrote:
> At last, a few days ago a colleague of mine actually found the
> problem:  ECL and our system both had the same file named "config.h". 
> They both were in the include path, but ours was first, so ECL found
> it and, naturally, failed to compile.
> So, my first suggestion is to move most of the include files in a
> subdirectory, named e.g. "ecl" and include them like this:
> 
> #include <ecl/config.h>

I take note.

> BTW, I found that at cl_defvar and cl_defparameter are declared in the
> external.h but are never defined.  Should be easy to remove them, but
> probably better to implement?

They do no longer exist. cl_* refer only to lisp functions and not to
special forms so as to keep things consistent. You can, however, define
a simple macro

#define ecl_defparameter(s,v) \
    do { si_Xmake_special(s); ECL_SETQ(s,v); } while (0);

I might include it in the next release. Seems harmless.

> 1.  How to catch errors in the C++ part?  I use si_safe_eval to run
> the Lisp code.  When there is an error in it, the Lisp debugger runs. 
> In a while, I'd probably try to have a REPL, listening on a different
> port, but for now (and for the production system), I'd like to just
> log the error.
(Continue reading)

Ivan Toshkov | 6 Feb 2006 13:18
Picon

Re: Embedding ECL in a C++ app.

Thanks for the replies (Michael's too).  I hope to have some time this
week to work on this project and will post about my progress.

--
All languages are equal,
but Lisp is more equal than others.

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642

Gmane