chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Re: regarding floating-point performance


From: Ivan Raikov
Subject: [Chicken-hackers] Re: regarding floating-point performance
Date: Fri, 23 Feb 2007 09:56:44 -0500
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

  Yes, I was going to say that you cannot really compare a
dynamically-typed language like Scheme with a statically-typed
language like C. If you want a functional language with the potential
for powerful static optimizations, you either need to use a severely
restricted subset of Scheme, like Felix says, or look into languages
that use Hindley-Milner polymorphic type systems (Standard ML, Ocaml,
Haskell, etc.). Scheme vs. C is a bit like apples vs. oranges. I
suppose one could also use the GNU lightning library (if it supports
floating point operations) and generate optimized code, as well.

     -Ivan


"felix winkelmann" <address@hidden> writes:

> One word about FP speed and benchmarking: Scheme's numeric
> system and the desire to generate not too excessive binaries
> requires out-of-line implementations of generic arithmetic.
> With the right operators, though (fp+, ...) floating-point ops are
> done in-line. It might be possible to do something which is
> called "speculative inlining" (i believe) where we do the type-checks
> in-line. I can look into this, but the bottomline is that you have to
> do quite a lot of checks if you want to implement Scheme.
>
> If you look at the shootout and chicken should perform ok in
> some of the benchmarks, then probably since optimizations are
> enabled for running in fixnum-only mode, which does all math-ops
> in-line. But that won't be standards compliant, of course.
>
> So we can't have both, but using the right operators, you will
> get (unsafe) inline math ops. Anything beyond that means
> static analysis which (again) makes Scheme less flexible and
> standards compliant, and additionally is hard to implement for
> a highly dynamic language (it works for subsets, though).
>
>
> cheers,
> felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]