Juan Jose Garcia-Ripoll | 1 Dec 2011 22:13

Keyword arguments and compiler macros

[Sorry for possible duplicates]

I just realized that compiler macros might be too restrictive in some implementations. Take for instance

(define-compiler-macro foo (a &key key-arg) ...)

This is assuming that FOO is only going to be invoked with _constant_ keyword arguments. I know, I know, most uses will have always one argument or :KEY-ARG, but suppose you want to call (FOO some-value a-non-constant-expression some-other-value)... What is the compiler to do?

I _now_ think that the compiler macro processor should simply recognize the failure to parse the form and return the original form, unprocessed, but the implementations I have at hand do not do that. ECL to begin with, but also CCL and SBCL.

Any opinions on this?

Juanjo

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Juan Jose Garcia-Ripoll | 1 Dec 2011 23:22

Some changes

ECL now inlines forms with constant arguments. This is currently limited to the set of Common Lisp functions that I marked as :pure in src/cmp/proclamations.lsp Please take a look at the list if you find time or feel that it is incomplete and beware that this list may not contain functions that create non-externalizable objects (streams) or that have some side effects!


And as usual, please report any problems.

Juanjo

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Juan Jose Garcia-Ripoll | 1 Dec 2011 23:26

Re: Some changes

On Thu, Dec 1, 2011 at 11:22 PM, Juan Jose Garcia-Ripoll <juanjose.garciaripoll-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:

ECL now inlines forms with constant arguments.

BTW, this also means that now ECL should be able to eliminate dead code branches, such as

(if (plusp (cos 1.0)) some-code some-unreachable-code))

See:

> (disassemble '(lambda (x) (if (plusp (cos 1.0)) (print 'hola) (error))))

;;; Compiling (DEFUN C::GAZONK ...).
;;; Warning:
;;;   ! The variable X is not used.
;;; Emitting code for C::GAZONK.
/* function definition for GAZONK                                */
/* optimize speed 3, debug 0, space 0, safety 2                  */
static cl_object L1c__gazonk(cl_object V1)
{ VT2 VLEX2 CLSR2 STCK2
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
ecl_cs_check(cl_env_copy,value0);
{
TTL:
value0=ecl_print(VV[2],Cnil); cl_env_copy->nvalues=1;
return value0;
}}
NIL


--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Eric Marsden | 2 Dec 2011 11:47
Picon
Favicon

PATCH: {e}cl_alloc_adjustable_base_string and --enable-unicode

Hi,

I had to replace a few calls to cl_alloc_adjustable_base_string by calls
to ecl_alloc_adjustable_base_string to make ECL build without
"--enable-unicode". 

(configure flags --enable-c99complex --enable-gengc --enable-longdouble
led to undefined references when linking libeclmin.a)

Thanks,
Attachment (ecl.diff): text/x-diff, 1663 bytes

--

-- 
Eric Marsden
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Eric Marsden | 2 Dec 2011 13:11
Picon
Favicon

BUG in CTYPECASE

Hi,

The following is ECL compiled from current git, on Linux/AMD64.

,----
| > (lisp-implementation-version)
| "9.8.4"
| > (ctypecase :foo (integer 1) (keyword 2))
| In form
| (SETQ :FOO #:G130)
| SETQ: Tried to assign a value to the constant :FOO.
| Available restarts:
| 1. (QUIT-DEBUGGER) Quit debugger level 1.
| 2. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
`----

(From the ansi-test suite)

--

-- 
Eric Marsden

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Eric Marsden | 2 Dec 2011 13:39
Picon
Favicon

BUG: (sleep least-positive-long-float) => fp underflow

Hi,

This is current git, on Linux/AMD64.

,----
| > (lisp-implementation-version)
| "9.8.4"
| > *features*
| (:LINUX :FORMATTER :UINT64-T :UINT32-T :UINT16-T :RELATIVE-PACKAGE-NAMES
|  :LONG-FLOAT :DFFI :CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS
|  :BOEHM-GC :ANSI-CL :COMMON-LISP :IEEE-FLOATING-POINT :PREFIXED-API :FFI
|  :X86_64 :COMMON :ECL)
| > (sleep least-positive-long-float)
| #<a FLOATING-POINT-UNDERFLOW>
`----

--

-- 
Eric Marsden

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Juan Jose Garcia-Ripoll | 2 Dec 2011 20:46

Re: PATCH: {e}cl_alloc_adjustable_base_string and --enable-unicode

On Fri, Dec 2, 2011 at 11:47 AM, Eric Marsden <eric.marsden <at> free.fr> wrote:

I had to replace a few calls to cl_alloc_adjustable_base_string by calls
to ecl_alloc_adjustable_base_string to make ECL build without
"--enable-unicode".

Eric, you must have some obsolete version of the code. This patch does not apply on the CVS/git version of ECL, where all uses of cl_alloc_adjustable_base_string are replaced already with ecl_alloc...

Juanjo

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Juan Jose Garcia-Ripoll | 2 Dec 2011 20:47

Re: BUG in CTYPECASE

On Fri, Dec 2, 2011 at 1:11 PM, Eric Marsden <eric.marsden <at> free.fr> wrote:
Hi,

The following is ECL compiled from current git, on Linux/AMD64.

,----
| > (lisp-implementation-version)
| "9.8.4"

Obsolete.

> (lisp-implementation-version)

"11.1.1"
> (ctypecase :foo (integer 1) (keyword 2))

Condition of type: SIMPLE-PROGRAM-ERROR
In form
(SETF :FOO (SI::CTYPECASE-ERROR ':FOO #:G157 '(INTEGER KEYWORD)))
SETQ: Tried to assign a value to the constant :FOO.

Available restarts:

1. (RESTART-TOPLEVEL) Go back to Top-Level REPL.

Broken at SI:BYTECODES. [Evaluation of: (SI:TOP-LEVEL T)] In: #<process TOP-LEVEL>.


--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Eric Marsden | 5 Dec 2011 11:11
Picon
Favicon

Re: PATCH: {e}cl_alloc_adjustable_base_string and --enable-unicode

>>>>> "jgr" == Juan Jose Garcia-Ripoll
<juanjose.garciaripoll@...> writes:

  jgr> Eric, you must have some obsolete version of the code. This patch does not
  jgr> apply on the CVS/git version of ECL, where all uses of
  jgr> cl_alloc_adjustable_base_string are replaced already with ecl_alloc...

  You are quite right; I apologize. I had a git tree at work which was
  fetching from

    remote.origin.url=http://ecls.sourceforge.net/git/ecl/.git

  which has no updates since August 2009. Is it possible for you to
  disable this git archive?

--

-- 
Eric Marsden

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Marko Kocić | 5 Dec 2011 15:28
Picon

Building with clang on windows/mingw

Hi Juan,
I'm trying to build ECL head using clang on mingw/msys.
Compiling of ecl goes fine, until it fails with the linking problem:

...
make[2]: Leaving directory `/c/development/cvstree/ecl/build/c'
if [ -f CROSS-COMPILER ]; then \
                touch ecl_min.exe; \
        else \
                clang -Lc:/usr/local/lib  -o ecl_min.exe cinit.o
c/all_symbols.o -L./ libeclmin.a -leclatomic  -lgmp -lgc -lffi -lm
-lws2_32;\
        fi
Cannot export _APPLY: symbol not found
Cannot export _APPLY_fixed: symbol not found
Cannot export _CEerror: symbol not found
Cannot export _CEpackage_error: symbol not found
Cannot export _FEassignment_to_constant: symbol not found
Cannot export _FEcannot_open: symbol not found
Cannot export _FEcircular_list: symbol not found
Cannot export _FEclosed_stream: symbol not found
Cannot export _FEcontrol_error: symbol not found
Cannot export _FEdivision_by_zero: symbol not found
Cannot export _FEend_of_file: symbol not found
Cannot export _FEerror: symbol not found
Cannot export _FEinvalid_function: symbol not found
Cannot export _FEinvalid_function_name: symbol not found
Cannot export _FEinvalid_macro_call: symbol not found
Cannot export _FEinvalid_variable: symbol not found
Cannot export _FElibc_error: symbol not found
Cannot export _FEprint_not_readable: symbol not found
Cannot export _FEprogram_error: symbol not found
Cannot export _FEprogram_error_noreturn: symbol not found
Cannot export _FEreader_error: symbol not found
Cannot export _FEstack_advance: symbol not found
Cannot export _FEstack_underflow: symbol not found
Cannot export _FEtype_error_array: symbol not found
Cannot export _FEtype_error_cons: symbol not found
Cannot export _FEtype_error_index: symbol not found
Cannot export _FEtype_error_list: symbol not found
Cannot export _FEtype_error_proper_list: symbol not found
Cannot export _FEtype_error_sequence: symbol not found
Cannot export _FEtype_error_vector: symbol not found
Cannot export _FEunbound_variable: symbol not found
Cannot export _FEundefined_function: symbol not found
Cannot export _FEwin32_error: symbol not found
Cannot export _FEwrong_dimensions: symbol not found
Cannot export _FEwrong_index: symbol not found
Cannot export _FEwrong_num_arguments: symbol not found
Cannot export _FEwrong_num_arguments_anonym: symbol not found
Cannot export _FEwrong_type_argument: symbol not found
Cannot export _FEwrong_type_key_arg: symbol not found
Cannot export _FEwrong_type_nth_arg: symbol not found
Cannot export _FEwrong_type_only_arg: symbol not found
Cannot export __ecl_big_boole_operator: symbol not found
Cannot export __ecl_big_ceiling: symbol not found
Cannot export __ecl_big_divided_by_big: symbol not found
Cannot export __ecl_big_divided_by_fix: symbol not found
Cannot export __ecl_big_floor: symbol not found
Cannot export __ecl_big_gcd: symbol not found
Cannot export __ecl_big_minus_big: symbol not found

It is built using the following configure options:
./configure CFLAGS="-Ic:/usr/local/include
-Ic:/usr/local/lib/libffi-3.0.9/include" LDFLAGS="-Lc:/usr/local/lib"
CC=clang CXX=clang --prefix=c:/opt/ecl --enable-threads
--with-system-gmp -enable-boehm=system && make 2>&1 | tee -a build.log

$ clang --version
clang version 3.1 (trunk 145791)
Target: i686-pc-mingw32
Thread model: posix

Regards,
Marko Kocić

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ecls-list mailing list
Ecls-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Gmane