Boost logo

Boost Users :

From: Jan Kybic (yg-boost-users_at_[hidden])
Date: 2003-07-31 04:25:59


> Regarding the preprocesor, I've had the idea once but I guess I don't have
> enough time to pursue it. I'm not sure but are you implying that you want
> to volunteer to write a Haskell preprocessor that emits FC++ code?
> Possibly using Spirit? That would be awesome!

I do not think it would be worthwhile to use Haskell as the input
language of the preprocessor, because then you could just use the ghc
Haskell compiler. Also, even though I quite like Haskell and I have
been using it for some time, I found it a bit too lazy for the
my applications involving large-scale numeric computing where
efficiency and control over memory management is necessary. I found
C++ to be a better language in that aspect.

Therefore, I propose to use the best from both worlds, the Haskell
type system for defining function signatures and C++ for writing the
function bodies. The first step could be just a very stupid
preprocessor to save some typing. I do not really have a clear idea at
the moment, it needs to be thought out well, it could be something as
simple as:

@fun plus :: A a -> B b -> A result
@{
        @let c = a+b // type automatically deduced
        return static_cast<A>(c) ;
@}

which would provide a polymorphic functor plus.

As for me volunteering to write the preprocessor, I am obviously
tempted, but very busy at the moment and also I think it might be
better to wait a month or two whether there is any outcome from the
cross fertilization of Spirit/FC++/....

Cheers,
        Jan

-- 
-------------------------------------------------------------------------
Jan Kybic <kybic_at_[hidden]>                  tel. +420 2 2435 7264
       or <kybic_at_[hidden]>,     http://cmp.felk.cvut.cz/~kybic

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net