Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a functional language for C++ ecosystem?

Java has Scala and .NET has F#. Both of these languages are very highly integrated into the respective Java and .NET platforms. Classes can be written in Scala then extended in Java for example.

Does there exist an equivalent functional language that interoperates highly with C++?

like image 998
pauldoo Avatar asked Aug 24 '08 12:08

pauldoo


People also ask

Is functional programming possible in C?

Obviously, C is a procedural language and doesn't really support functional programming natively.

Why is C not a functional programming language?

While C has functions and a (relatively) high amount of flexibility in handling them as imperative, command-oriented languages are concerned, it is in the general category of imperative languages in terms of general programming style and approach, so it is not a functional language.

Is C functional or procedural?

The different programming styles of these languages have formed the idea programming-paradigm: C is a typical represention of the procedural, LISP of the functional, C + + of the object-oriented and PROLOG of the logic-oriented paradigm.

Is Fortran a functional language?

Is Fortran a purely functional language? No, it is not. Subroutines in Fortran can do things other than return values according to a mapping between input and output; and computations in Fortran can be done with state changes and mutable data.


2 Answers

Ah, something else. Although this certainly isn't what you meant, template metaprogramming in C++ is purely functional.

like image 190
Konrad Rudolph Avatar answered Sep 20 '22 19:09

Konrad Rudolph


As has been said, I'm not really sure about a C++ 'ecosystem'. But Haskell does have a Foreign Function Interface that allows you to call C functions from Haskell and Haskell functions from C.

Then again, that's C, I'm not really sure how far along the C++ FFI is...

like image 26
Tom Lokhorst Avatar answered Sep 18 '22 19:09

Tom Lokhorst