Brian Spilsbury | 1 Sep 12:56 2007
Picon

Re: unboxed closure

Well, I seem to have unboxed lexicals working.

The produced code is like;

{ VT2 VLEX2 CLSR2
        cl_object value0;
        {
TTL:
        lex0[0].unboxed_cl_fixnum= 0;             /*  X
                */
        lex0[1].unboxed_cl_fixnum= 0;             /*  Y
                */
        value0=LC1test6(lex0,MAKE_FIXNUM(3),MAKE_FIXNUM(4)) /*  TEST6      */;
        return value0;
        }
}

lexN[i] is now a union of unboxed (i.e., C) datatypes.

I'm looking at closures, but it seems that that might entail something
more radical, since it uses a chain of conses.

Any suggestions would be welcomed.

Regards,
Brian.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
(Continue reading)

marc daya | 3 Sep 06:50 2007
Picon

passing compiler and linker options through 'compile-file'

Greetings,

Is there a way to pass compiler and linker options to the gcc/dllwrap
invocation that ECL spawns for 'compile-file'?  My intention is to use
ECL's static FFI to construct an interface to a native library, so
that the functionality that it provides is available to an ECL image
(by loading a compiled fasl).

To get this to work I need to be able to pass the location of the
header files during the compile phase, and the library path and name
during the link phase, but I couldn't find anything in the
documentation that shows how this might be done.
I  got it working (under MinGW) by adding 3 new keyword arguments to
'compile-file' (:cc-flags, :ld-path, :ld-libs).  The value of
'cc-flags' is passed to 'compiler-cc', and 'ld-path' and 'ld-libs' to
'bundle-cc'.

Since I'm not sure, though, if this the best (or even correct)
approach.  Any comments or suggestions would be appreciated.

.marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Pascal Costanza | 3 Sep 14:27 2007
Picon

ContextL Survey September 2007

Context-dependent behavior is becoming increasingly important for a  
wide range of application domains. Unfortunately, mainstream  
programming languages do not provide mechanisms that enable software  
entities to adapt their behavior dynamically to the current execution  
context. In collaboration with various researchers, we have developed  
a new programming technique called "Context-oriented Programming" (COP).

ContextL - http://common-lisp.net/project/closer/contextl.html - is  
our first fully implemented and currently most mature programming  
language extension for COP and is built on top of the Common Lisp  
Object System (CLOS). ContextL has first been made available to the  
public in early 2005, and has already been adopted by a number of  
programmers. We would now like to assess how well ContextL has been  
received so far.

Please consider participating in our first survey about ContextL -  
this will help us a lot to develop ContextL and related projects  
further (like Closer to MOP, etc.).

You can find the survey and more information about it at http:// 
prog.vub.ac.be/~pcostanza/COP/survey.html

Thanks a lot,
Pascal

--

-- 
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium

(Continue reading)

Brian Spilsbury | 3 Sep 16:20 2007
Picon

Re: passing compiler and linker options through 'compile-file'

I'm not sure if this addresses your problem, but look in src/cmp/cmpdefs.lsp

You'll see *cc-flags*, *ld-flags*, etc.

This may be the right place to set those things up.

If you find what works with mingw, then we should be able to add the
correct defaults to the cvs version, too.

Regards,
Brian.

On 9/3/07, marc daya <marc.daya+ecl@...> wrote:
> Greetings,
>
> Is there a way to pass compiler and linker options to the gcc/dllwrap
> invocation that ECL spawns for 'compile-file'?  My intention is to use
> ECL's static FFI to construct an interface to a native library, so
> that the functionality that it provides is available to an ECL image
> (by loading a compiled fasl).
>
> To get this to work I need to be able to pass the location of the
> header files during the compile phase, and the library path and name
> during the link phase, but I couldn't find anything in the
> documentation that shows how this might be done.
> I  got it working (under MinGW) by adding 3 new keyword arguments to
> 'compile-file' (:cc-flags, :ld-path, :ld-libs).  The value of
> 'cc-flags' is passed to 'compiler-cc', and 'ld-path' and 'ld-libs' to
> 'bundle-cc'.
>
(Continue reading)

marc daya | 3 Sep 12:51 2007
Picon

Re: passing compiler and linker options through'compile-file'

> Use the existing variables c::*cc-flags* and c::*ld-flags* to
> achieve the same result.

Thanks, Michael ... It does indeed.

I remember trying something similar and running into problems because
*cc-flags* and friends are not exported, but as I'm now unable to
reproduce that particular error message I'll put it down to (too much
| too little) coffee.
I had the feeling there was a better way; thanks for passing on a
little enlightenment.

.marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Brian Spilsbury | 3 Sep 17:06 2007
Picon

latest unboxing patch

Just posting this patch before I break things.

This patch seems to do things more or less the way I wanted.

(defun test5 ()
  (let ((x 0) (y 0))
    (declare (type fixnum x y))
    (flet ((test6 (a b)
             (declare (type fixnum a b)
                      (si::c-funboxed ("test6" (:fixnum :fixnum) :fixnum)))
             (incf x)
             (+ a b x y)))
      (declare (ftype (function (fixnum fixnum) fixnum) test6)
               (si::c-funboxed ("test6" (:fixnum :fixnum) :fixnum) test6))
      (test6 3 4))))

This will produce an unboxed local function with unboxed
lexicals.

The C code for lexicals (unescaping closures) looks like so.

        {cl_fixnum V5= lex0[0].unboxed_cl_fixnum;
        lex0[0].unboxed_cl_fixnum= (V5)+(1);}
        NVALUES = 1;
return((((V3)+(V4))+(lex0[0].unboxed_cl_fixnum))+(lex0[1].unboxed_cl_fixnum));
        }

The declarations required for unboxing are fairly ugly -- for lexical
functions they should probably be inferred transparently, since the
can't escape.
(Continue reading)

Goffioul Michael | 3 Sep 13:29 2007
Picon

Re: passing compiler and linker options through'compile-file'

> > Use the existing variables c::*cc-flags* and c::*ld-flags* 
> to achieve 
> > the same result.
> 
> Thanks, Michael ... It does indeed.
> 
> I remember trying something similar and running into problems because
> *cc-flags* and friends are not exported, but as I'm now 
> unable to reproduce that particular error message I'll put it 
> down to (too much
> | too little) coffee.
> I had the feeling there was a better way; thanks for passing 
> on a little enlightenment.

For this to work, the compiler package (cmp.fas) must be loaded,
otherwise you'll get an error about undefined 'c' (or 'cmp')
package. As 'compile-file' loads the compiler package automatically,
you usually don't have to do it yourself. However in this case,
as you want to tune some internal variables, you have to load it
manually.

Michael.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Goffioul Michael | 3 Sep 09:32 2007
Picon

Re: passing compiler and linker options through'compile-file'

> Greetings,
> 
> Is there a way to pass compiler and linker options to the 
> gcc/dllwrap invocation that ECL spawns for 'compile-file'?  
> My intention is to use ECL's static FFI to construct an 
> interface to a native library, so that the functionality that 
> it provides is available to an ECL image (by loading a compiled fasl).
> 
> To get this to work I need to be able to pass the location of 
> the header files during the compile phase, and the library 
> path and name during the link phase, but I couldn't find 
> anything in the documentation that shows how this might be done.
> I  got it working (under MinGW) by adding 3 new keyword 
> arguments to 'compile-file' (:cc-flags, :ld-path, :ld-libs).  
> The value of 'cc-flags' is passed to 'compiler-cc', and 
> 'ld-path' and 'ld-libs' to 'bundle-cc'.
> 
> Since I'm not sure, though, if this the best (or even 
> correct) approach.  Any comments or suggestions would be appreciated.

Use the existing variables c::*cc-flags* and c::*ld-flags* to
achieve the same result.

For instance

(let ((c::*cc-flags* (concatenate 'string c::*cc-flags* " -I/my/dir")))
  (compile-file ...))

Michael.

(Continue reading)

_ _ | 4 Sep 16:14 2007
Picon

Embedding ECL library in C program

I'm trying to build a simple "hello world"-like example, but not doing very well so far.
Here is my C code:

//prog_msg.c

#include <stdio.h>
#include <ecl/ecl.h>

int main(int argc,char** argv)
{
  cl_object res;
  cl_boot(argc,argv);

  res=eval("(get-msg-text)");
  printf("%s",(char*)res->string.self);
  cl_shutdown();
  return 0;
}

and ECL library code:

//test.lisp

(defpackage "TEST"
(:use "COMMON-LISP")
(:nicknames "TEST")
(:export "GET-MSG-TEXT"))

(in-package test)

(Continue reading)

Goffioul Michael | 4 Sep 16:23 2007
Picon

Re: Embedding ECL library in C program

> I'm trying to build a simple "hello world"-like example, but 
> not doing very well so far.
> Here is my C code:
> 
> //prog_msg.c
> 
> #include <stdio.h>
> #include <ecl/ecl.h>
> 
> int main(int argc,char** argv)
> {
>   cl_object res;
>   cl_boot(argc,argv);
> 
>   res=eval("(get-msg-text)");
>   printf("%s",(char*)res->string.self);
>   cl_shutdown();
>   return 0;
> }
> 
> and ECL library code:
> 
> //test.lisp
> 
> (defpackage "TEST"
> (:use "COMMON-LISP")
> (:nicknames "TEST")
> (:export "GET-MSG-TEXT"))
> 
> (in-package test)
(Continue reading)


Gmane