Functional programming languages and Qt
-
There is also "EQL" (a Qt binding embedded in ECL: a Common Lisp which compiles to C).
It can be used as a Qt binding, and additionally it can easily be embedded in C++ (direct function calls in both directions).
-
perhaps some what obvious but you can use Scala with Qt Jamibi (http://qtjambi.sourceforge.net/)
Richard D
-
The problem with Scala+Jambi is that the Qt classes (for example for collections) are not scala's collections and they will not have folds and similar.
I'm currently working on a small Qt addon library [1] to allow you to develop in Qt/C++ with some of the funtional concepts.
It will have greedy and lazy evals for most of the things, and whatnot. It is currently not in open development, but it will become soon, and it will be published under LGPL or some BSD-like license.
Obviously, this is not really a functional language, but lambdas in C++2011 brought some new very nice possibilities.
[1] http://ivan.fomentgroup.org/blog/category/qt-functional/
-
Anyone tried using Qt Jambi with "clojure":http://clojure.org?
-
[quote author="Ivan Čukić" date="1312874479"]Not really, if Qt doesn't have the APIs for lambdas and functors, you will not have too many places to use lambdas in your code.
At the moment, there's work being done for QObject::connect to work with lambdas. Lets hope it will get into Qt 5.[/quote]
And of course, you will be able to use them with QtConcurrent (works fine already with Boost's implementation). What is missing, do you think?
-
[quote author="Andre" date="1314860619"]What is missing, do you think? [/quote]
The missing is the stuff that I'm trying to address with QtFunctional - functional way of dealing with the collections - stuff like list.filter(some lambda), ... lazy evaluation for things ...
-
[quote author="Ivan Čukić" date="1314867006"][quote author="Andre" date="1314860619"]What is missing, do you think? [/quote]
The missing is the stuff that I'm trying to address with QtFunctional - functional way of dealing with the collections - stuff like list.filter(some lambda), ... lazy evaluation for things ...
[/quote]
If you get anything usable done, maybe we could generate Jambi bindings for it... So those using Scala could use this, or maybe in Java, hack some support for it somehow... Would be very interest at least.
Java 8 is said to get lambdas, so atleast something can be done, if not doing anything for actual model Jambi works for example with signals and slots.
-
I have no clue how would you map things, but from my standpoint, it doesn't seem possible. Templates here are used for things that java generics can't do... heck, not even all C++ compilers can process the code :)
The library is at http://gitorious.org/qt-functional
Not sure how many more improvements it will receive in the next period. Hoping I'll have the times to work on it again in a few months.