On Friday, 25 November 2011 13:25:43 UTC+8, rjf wrote:
>
> On Nov 24, 6:52 pm, Dima Pasechnik <dim...@gmail.com> wrote:
> > Unless I am missing something, Maxima in Sage is compiled into C using 
> ECL.
> > How fully these capabilities are exploited in Sage, is another question.
>
> I think you are missing the point.  Unless the ECL system is sadly
> broken, the
> Maxima system has the capability of compiling programs written in its
> top-level
> language (an Algol-ish style language), into binary
> code.
>
> good to know. 
Actually, your example works just fine in Sage's maxima console:
sage: maxima_console()
;;; Loading #P"/usr/local/src/sage/current/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/usr/local/src/sage/current/local/lib/ecl/sockets.fas"
;;; Loading #P"/usr/local/src/sage/current/local/lib/ecl/defsystem.fas"
;;; Loading #P"/usr/local/src/sage/current/local/lib/ecl/cmp.fas"
Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) g(x):=block([s:0],for i thru x do s:s+i^2,s);
                                                         2
(%o1)        g(x) := block([s : 0], for i thru x do s : i  + s, s)
(%i2) g(10000);
(%o2)                            333383335000
(%i3) compile(g);

;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; Note:
;;;   Refusing to propagate #<form PSETQ 102aa68d0>
;;; Note:
;;;   Constant value optimized away or not used
;;; $done
;;; Note:
;;;   Invoking external command:
;;;   gcc -I. -I/usr/local/src/sage/sage-4.7.alpha5/local/include/ 
-I/usr/local/src/sage/sage-4.7.alpha5/local/include -g -O2 -fPIC 
-fno-common -Ddarwin -O2 -w -c 
/private/var/folders/qW/qWY+4Ku1GF0WXrOsV+IDvk+++TM/-Tmp-/ecl001jfJYt0.c -o 
/private/var/folders/qW/qWY+4Ku1GF0WXrOsV+IDvk+++TM/-Tmp-/ecl001jfJYt0.o 
;;; Note:
;;;   Invoking external command:
;;;   gcc -o 
/private/var/folders/qW/qWY+4Ku1GF0WXrOsV+IDvk+++TM/-Tmp-/ecl001jfJYt0.fas 
-L/usr/local/src/sage/sage-4.7.alpha5/local/lib/ 
/private/var/folders/qW/qWY+4Ku1GF0WXrOsV+IDvk+++TM/-Tmp-/ecl001jfJYt0.o 
-bundle -L/usr/local/src/sage/sage-4.7.alpha5/local/lib 
-L/usr/local/src/sage/sage-4.7.alpha5/local/lib -lecl -lgmp -lm (%o3)       
                          [g]
(%i4) g(10000);
(%o4)                            333383335000
(%i5) 

It's a good question how to make this capability used in Sage.
 

> William seems to prefer to tout the Sage-Cython link.
>
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to