[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] csc & (uses format)
From: |
Isaac Gouy |
Subject: |
Re: [Chicken-users] csc & (uses format) |
Date: |
Thu, 26 Jan 2006 19:17:50 -0800 (PST) |
Thanks for your help, I've fixed the other programs that were failing
for the same reason, see
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=chicken
We'd certainly welcome up-to-date improved Chicken programs
http://shootout.alioth.debian.org/gp4/faq.php#contributeprogram
best wishes, Isaac
--- Kon Lovett <address@hidden> wrote:
> There is no libformat so -lformat doesn't will not work.
>
> I used:
>
> $ cat > harmonic.scm <<EOF;;;; The Great Computer Language Shootout
> ;;;; http://shootout.alioth.debian.org/
> ;;
> ;;
> ;; OCaml version contributed by Will M. Farr
>
> ;; ported to Chicken by Felix
> ;; mod to support "safe" format & therefore requirement for safe
> libraries, Kon Lovett
>
> ;; to compile: csc harmonic.scm -O3 -d0 -lambda-lift -o
> harmonic_chicken
>
> (use format)
> (declare (unsafe) (block) (disable-interrupts))
>
> (define (sum-harmonic4 n)
> (do ([i 1 (fx+ i 1)]
> [sum 1.0 (+ sum (/ ifloat))]
> [ifloat 2.0 (+ ifloat 1)] )
> ((fx>= i n) sum) ) )
>
> (format #t "~,9f~%"
> (sum-harmonic4
> (string->number (:optional (command-line-arguments)
> "10000000"))))
> EOF
>
> With:
>
> $ csc harmonic.scm -O3 -d0 -lambda-lift -o harmonic_chicken
>
> (note the absence of -unsafe-libraries)
>
> Then:
>
> $ ./harmonic_chicken
> 16.695311366
>
> Hope this helps.
>
> Currently there isn't an unsafe format. The shootout code for Chicken
>
> is out-of-date. For example, the above. It probably should use
> (printf) since format is not a built-in.
>
> Best Wishes,
> Kon
>
>
> On Jan 26, 2006, at 2:45 PM, Isaac Gouy wrote:
>
> > That isn't working for me, see
> >
> > http://shootout.alioth.debian.org/gp4/benchmark.php?
> > test=harmonic&lang=chicken&id=0#log
> >
> >
> >
> > --- Kon Lovett <address@hidden> wrote:
> >
> >> Nothing. Just '(use format)' in your source, as you would w/ csi.
> >>
> >> Best Wishes,
> >> Kon
> >>
> >>
> >> On Jan 26, 2006, at 1:08 PM, Isaac Gouy wrote:
> >>
> >>> I've used chicken-setup to install the format egg, and checked
> that
> >> it
> >>> loads with the interpreter.
> >>>
> >>> What do I need to put on the commandline to use format with csc?
> >>>
> >>> best wishes, Isaac
> >>>
> >>> __________________________________________________
> >>> Do You Yahoo!?
> >>> Tired of spam? Yahoo! Mail has the best spam protection around
> >>> http://mail.yahoo.com
> >>>
> >>>
> >>> _______________________________________________
> >>> Chicken-users mailing list
> >>> address@hidden
> >>> http://lists.nongnu.org/mailman/listinfo/chicken-users
> >>
> >>
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> > _______________________________________________
> > Chicken-users mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com