Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good cross platform functional language for library use in a C++ application?

What are my options in terms of a fast functional language for library use in a cross-platform Qt C++ application?

It seems almost all languages (functional or not) have some way of calling C/C++ code in an easy manner. I'd like to go the other way around - write an application in Qt using C++ for stateful business logic, GUIs and stuff but drop down and use a functional language for the core calculation library.

Which ones are easy to use in this manner? Can for instance OCaml code be compiled into a static library and then consumed by a C++ app?

Thanks, Rickard

like image 200
Rickard Avatar asked Jun 24 '10 09:06

Rickard


People also ask

Which programming language is cross-platform?

To code cross-platform software, developers use intermediate programming languages — HTML, JavaScript and CSS — not native to devices and OSs.

Is C good for functional programming?

C is primarily an imperative language, not a functional language. the use of anonymous objects and Functors.


1 Answers

Haskell has this capability, though the interaction with Qt/qmake and your build process with ghc may take a little trickery to get working:

http://www.haskell.org/haskellwiki/Calling_Haskell_from_C

There is also a project called HaskellDirect which seems similar to your purpose as well:

http://www.haskell.org/hdirect/

like image 54
David Harks Avatar answered Oct 14 '22 15:10

David Harks