Alessandro Serra | 24 Nov 23:57 2015

iolib and close

Dear all,
compiling "iolib-tests" I received the following error:

    #<IPv4 datagram socket, closed 00000000050f3660> is not of type STREAM.
    [Condition of type TYPE-ERROR]

I have seen that in "clos/streams.lsp" the following method is defined:   

  (defmethod close ((stream t) &key abort)
     (declare (ignore abort))
     (bug-or-error stream 'close))

Removing the method above with:
     (remove-method #'gray:close (find-method #'gray:close '() '(t)))

I was able to compile iolib-tests and run the tests.

  Did 71 checks.
     Pass: 59 (83%)
     Skip: 0 ( 0%)
     Fail: 12 (16%)


hiro hiro | 12 Nov 14:00 2015

ffi:defcallback with cxx


  I compiled ecl16.0.0 with option "--with-cxx".

  Then I use ffi:defcallback function like

    (ffi:defcallback yyyy :void () ..... )

  then compile-file
    (compile-file "xxxxx.lisp" :c-file "xxxxx.cpp" :system-p t)

  I received error message as follows
   (freebsd10.1 clang++)
    xxxxx.cpp:162:8: error: no matching function for call to
      T0 = ecl_make_foreign_data(ECL_SYM("POINTER-VOID",1381),0,ecl_callback_0)

  I try as follows

    in src/cmp/cmpcbk.lsp & src/new-cmp/cmpc-cbk.lsp   line 44
       ,(format nil "ecl_make_foreign_data( <at> ':pointer-void,0,~a)" c-name)
       ,(format nil "ecl_make_foreign_data( <at> ':pointer-void,0,(void*)~a)" c-name)

  after that, I did not receive error message and ffi:callback work fine.

  Would you let me know what your thoughts are on this matter.



Evrim Ulu | 7 Nov 23:32 2015

ECL & IPhone Port

Dear List,

I've been one of the Android port and I am glad to see that Daniel is
working in order to merge the port into the master branch soon. I know
that he's building other nice perks for Android devs.

In the meantime, I would like to proceed into building a sound IPhone
port. In this regard, I am looking for capital to fund the
development. Please contact me if you like to see support for IPhone
platform on the master branch.


Daniel Kochmański | 7 Nov 02:09 2015

[ecl-android v0.0.1]

Dear all,

for the last few weeks I was working on the ECL Android
integration. I've managed to create a basic app which is
swank-capable. More info here:

I'll appreciate all the feedback :)



Daniel Kochmański | Poznań, Poland
;; aka jackdaniel

"Be the change that you wish to see in the world." - Mahatma Gandhi

Bix | 25 Oct 09:28 2015

GC and Threading

just two quick question:
1. Is it possible to disable the threading model and have multiple thread
to eval the code or have one ECL per thread?
2. Can the garbage collector be disabled at all and have the memory
managed in a reference counting fashion?

I like to embed the ECL in my multithread application but I've got very
restrictive constrain about thread and memory:
* I can not spawn new thread but I've got concurrent thread to execute
ecl call.
* A component that bring GC would probably not be accepted and I'm
wondering if there is an alternative to that in ECL, or at least have
more control how/when GC will be run.

Can you point me out where to look in the source code to understand those
aspect of ECL?

Thanks in advance.

Daniel Kochmański | 3 Oct 07:08 2015

Fwd: Re: [monolith builds]

Current ML is ecl-devel@..., I'm forwarding this mail there.

Daniel Kochmański writes:

> Faré writes:
>> [Adding ECL-list to this conversation, that I believe should be
>> publicly archived]
> Good idea.
>> On Fri, Oct 2, 2015 at 7:24 AM, Daniel Kochmański
<daniel@...> wrote:
>>> Hey,
>>> when fixing problem with randomized names etc I have taken a closer look
>>> at the build process. You asked earlier how ECL manages to do monolithic
>>> builds.
>>> Each module is initialized with a special function which registers the
>>> whole module and creates lisp objects. Before calling this function ECL
>>> isn't aware of the existance of it neither it has environment.
>>> Module may be composed on other modules. Builder, when constructing
>>> initialization function for "top module" gathers all submodules (object
>>> files or libraries) and parses the binary file to find special tag which
>>> contains name of functions which initialize submodules. Top module in
>>> it's initialization functions calls (beside the other things) all
>>> submodule initialization functions. Then it concatanates all of them in
>>> .a, .fasl, .so, ... files
>>> Top-module
>>> Sub-module-1
>>> Sub-module-2
>>> …
>>> So it is guaranteed, that if this top-module will be embedded in the
>>> other one it's special tag will be found first and the correct
>>> initialization function will be called (which will initialize the futher
>>> submodules).
>>> This description might be not 100% accurate but I believe it is how
>>> things work there. Reverse engineering might be misleading :-)
>>> I've fixed bundles once again and ASDF passes tests. It's your call if
>>> you want to enable it by default.
>>> Best regards,
>>> Daniel
>>> --
>>> Daniel Kochmański | Poznań, Poland
>>> ;; aka jackdaniel
>>> "Be the change that you wish to see in the world." - Mahatma Gandhi
>> Thanks for these explanations.
>> Questions:
>> 1- what is a "tag" in this context?
> Tag is a string embedded in the C code with deterministic prefix
> followed by a name of the object function. For instance assuming
> initialization function has name lib_init_xyz, then it will look
> something like:
> void lib_init_xyz (cl_object block) {
>      ...
>      Cblock->cblock.data_text = (const cl_object *)" <at> EcLtAg_lib:lib_init_xyz <at> ";
>      ...
> }
> When emiting code for top module we scan the binary object files for
> appropriate tag (in this example  <at> EcLAg_lib) to find the inititalization
> function name which we embed in a source code as a normall call:
> void lib_init_top_module (cl_object block) {
>      ...
>      Cblock->cblock.data_text = (const cl_object *)" <at> EcLtAg_lib:lib_init_top_module <at> ";
>      ...
>      lib_init_xyz(block);
>      ...
> }
> Note that now function names are randomized and this is mere a
> psudocode. For further details consult src/cmp/cmpmain.lsp.
>> 2- once again, why not use the linker support for initialization?
>>   If behavior has to depend on whether ECL was initialized yet,
>>   the initialization could consider in calling ecl_register_init_function,
>>   which depending on whether ECL was booted, would either call the function
>>   and/or add it to a hook.
>>   See once again attached files on how to use linker support for
>>   initialization.
> Fact that we might bundle many objects in one archive doesn't mean that
> they don't have dependencies on one another. *I think* that we have to
> strictly control initialization order. It's possible that I'm wrong here
> though.
> Also do we want to *always* initialize *everything* what is linked? We
> may have compiled-in support for number of lisp libraries in one module
> just for conveniance and require them on demand depending on the
> application using our code.
> I'm guessing here since it's a design decision made by someone
> else. Your proposition is surely worth investigating - it is like it is
> because it was that way when I approached the codebase.
>> 3- How does MKCL do it?
> MKCL creates these initialization functions but when it loads files it
> "slurps" some vector with objects - it doesn't call initialization
> functions. Don't know if function creation is
> rendundant/obsolete/inconsistent/correct - you have to ask MKCL
> maintainer for details. It looks to me that it works for files built
> with MKCL but breaks linking from the outer code with the libraries
> created by it (and by breakage I mean that compilation goes fine but
> such modules doesn't work). Once again I'm not 100% about that. MKCL
> code diverged a lot with this regards.
> Regards,
> Daniel
>> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
>> Suppose 2/3 Congress were incinerated, what would we lose to offset our gain
>> of their salaries and the salaries of their parasites?  — H. L. Mencken


Daniel Kochmański | Poznań, Poland
;; aka jackdaniel

"Be the change that you wish to see in the world." - Mahatma Gandhi

Morgan Howe | 28 Sep 01:23 2015

More detailed embedding example

Hey guys,

I'm playing around with embedding ECL into a C program. I've followed
the blog post which was very useful, but as far as calling lisp
functions, didn't really get beyond the cl_safe_eval type operations.
I'd like to be able to get a handle to a specific lisp function, and
call that function passing some arguments. What I've tried is
basically this series of steps (omitting boot, shutdown, etc for

* cl_safe_eval some code doing (load "foo.lisp") // From the blog
example, works fine
* ecl_make_symbol("BAR", "CL-USER") // Quite sure this is where I'm going wrong
* cl_funcall the symbol from step 2, which gives me this a few times
before dropping to debugger:
Condition of type: SIMPLE-ERROR
0 is an illegal frs index.
No restarts available.

I'm sure step 2 is where I'm going wrong and the symbol I try to
retrieve is not valid, thus the issue in step 3. Sorry if this is too
basic a question, but could someone give me a working example of doing
something like this?


Attila Lendvai | 24 Sep 17:18 2015

cross compiling howto for mips-openwrt-linux


with the invaluable help of jackdaniel on #ecl, i've managed to
cross compile ecl for mips-openwrt-linux.

unfortunately i cannot edit the wiki at, so i'll write it up here. (if
anyone reads it an can give me rights, my user is attila.lendvai)


the bird's eye view:

 - first you need to compile ecl on the host, but making sure that
   some important variables are the same as on the target (e.g. 32/64
   bit; long long support; what else?).

 - then make clean, and configure the source tree for the target

   - ./configure will fail when run for the first time. you'll then
     need to edit 'build/cross_config' to set some variables regarding
     the target that cannot be detected automatically from the host.

 - then build it once again using a cross-compiling gcc

 - if you are not planning to have a gcc on the target, then configure
   the target with --with-bytecmp=builtin --with-cmp=no

compile for the host:

 - you may need 32 bit support: sudo apt-get install gcc-multilib

 - CFLAGS=-m32 LDFLAGS=-m32 ABI=32 ./configure --prefix=/opt/ecl-host

 - make -j2

 - make install

compile for the target:

make clean

export STAGING_DIR=/home/alendvai/workspace/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_uClibc-

export TOOLCHAIN=${STAGING_DIR}/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-

export TARGETROOT=${STAGING_DIR}/target-mips_34kc_uClibc-

PATH=/opt/ecl-host/bin/:${TOOLCHAIN}/bin:${PATH} \
 CFLAGS="-I${TOOLCHAIN}/include -I${TARGETROOT}/usr/include" \
 LDFLAGS="--sysroot=${TARGETROOT}" ./configure \
 --prefix=/opt/ecl-mips --disable-longdouble \
 --with-libffi-prefix=${TARGETROOT} \
 --host=mips-openwrt-linux --with-system-gmp

optionally add: --with-bytecmp=builtin --with-cmp=no

edit 'build/cross_config' and restart the above once again. (in this
specific case i had to ECL_BIGENDIAN=yes)

PATH=/opt/ecl-host/bin/:${TOOLCHAIN}/bin:${PATH} make -j2

copy /opt/ecl-mips to your openwrt and don't forget to:
opkg install libgmp
opkg install libffi

i will try to put together an openwrt package, too.


• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
“People get used to anything. The less you think about your
oppression, the more your tolerance for it grows. After a while,
people just think oppression is the normal state of things. But to
become free, you have to be acutely aware of being a slave.”
	— Assata Shakur (1947–), 'Assata: An Autobiography'

Daniel Kochmański | 22 Sep 23:16 2015


Dear all,

I've got a question - does anyone really depend on a non-C99 compliant

MSVC supports C99 from 2013 [1], GCC has complete support from 4.5 [2] (with
various bits earlier), TCC also has everything except complex numbers [3]
(what is on their TODO) and Clang has complete support [4].

I'm asking this question because we're considering making C99-supporting
compiler as a dependency for ECL C backend.

This will relieve us from writing backward-compatible workarounds for
the older standard and will simplify the code. That also means, that
various improvements will be possible and code will be easier to

Best regards,



Daniel Kochmański | Poznań, Poland
;; aka jackdaniel

"Be the change that you wish to see in the world." - Mahatma Gandhi

bruce li | 8 Sep 18:15 2015

Safely calling lisp lambda function from C?

I'm writing a wrapper for a game engine that involves a few callbacks.
I wrap the callback in a C function so that I can pass in lambdas as
callbacks. Here is how the code looks like:

cl_object callback_wrapper(cl_object lambda, cl_object ...) {
    cl_funcall(2, lambda, some_params);

It works OK if the passed in lambda function is syntactically correct.
But it fails disastrously if the function contains errors, either
syntactically or logically and it crashes the program. I wonder if
it's possible to call the lambda function in a safer manner and when
anything is wrong, it just drops to the top-level?

A second question is... can I traverse lisp lists in C? I would like
to collect everything into a C++ vector and pass that on to the
engine's API.


Daniel Herring | 5 Sep 18:08 2015

email list subject line

Hi all,

The old mailing list had a "[Ecls-list]" prefix in the subject line.  This 
was helpful for visually scanning a mailbox and could also be used for 
filter rules.

The new list has no such prefix.  Could someone add it?  I don't care the 
exact format -- [Ecls-list], [ECL], whatever.  I would just appreciate the