Hello,
I want to write in favor of Boostifying the functional library
FC++, which I find very useful. Would a merger with the Phoenix
library from Spirit (already in Boost) be feasible? Phoenix seems to
have a slightly nicer syntax but lacks (as far as I know) the Haskell
prelude functions and lazy list implementation, also the closures do
not seem very intuitive to me.
My main concern with both FC++ and Phoenix is that when defining new
functiods, the user needs to write a lot of often repetitive
code. This could be simplified using a suitable preprocessor. Would
that be acceptable and are there other people interested ?
Yours,
Jan
--
-------------------------------------------------------------------------
Jan Kybic
Jan Kybic
Hello, I want to write in favor of Boostifying the functional library FC++, which I find very useful. Would a merger with the Phoenix library from Spirit (already in Boost) be feasible? Phoenix seems to have a slightly nicer syntax but lacks (as far as I know) the Haskell prelude functions and lazy list implementation, also the closures do not seem very intuitive to me.
My main concern with both FC++ and Phoenix is that when defining new functiods, the user needs to write a lot of often repetitive code. This could be simplified using a suitable preprocessor. Would that be acceptable and are there other people interested ?
Hi,
You might be glad to know that Brian, Jaakko and I are currently exchanging
emails and ideas.
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!
<
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
Jan Kybic
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++/....
You guys oughta check out the Felix project: http://felix.sourceforge.net/ -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
David Abrahams
-
Jan Kybic
-
Joel de Guzman