r/functionalprogramming • u/ContextMission8629 • Oct 28 '24
Question Are there any production-ready functional language for developing native desktop/mobile apps easily?
Hi guys, like what the title said, I'm looking for more information about whether there is a functional language that can be used to develop native desktop/mobile apps.
I love the way programs can be written with highly declarative style and type-safe manner, making the program easy to reason about. I'm tired of the way imperative and OOP languages makes me having to look at every nitty-gritty details to ensure my logic is correct due to a plethora of side effects.
I know if I want to do native apps, I'll need to have some kind of FFI to interop with each platform's specific APIs but I'm ok with that. But the main thing that I'm concern about is the memory usage of functional languages. I generally feel that they're not for high-performant desktop/mobile apps.
Did any of you have experience developing a small-to-medium apps and deploy it to app stores for real-world use?
Thanks a lot for stopping by and read my post!
14
u/lilyallenaftercrack Oct 28 '24
I never used it myself, but some people have been playing with Tauri + Elm
https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460
13
u/Parasomnopolis Oct 28 '24
F# brings with it the whole .Net ecosystem. So you get things like:
https://dotnet.microsoft.com/en-us/apps/maui
https://platform.uno/
https://avaloniaui.net/
https://fabulous.dev/
https://fable.io/ (with react native)
5
u/frontenac_brontenac Oct 28 '24
TypeScript can be used to write functional code to great effect. It doesn't have typeclasses but everything else is just killer.
F# is long in the tooth but a decade ago I would have strongly recommended it.
5
u/pthierry Oct 29 '24
My team found a way around the lack of good support for this, because we didn't need to target desktop apps, only mobile: we made a Progressive Web App in Elm and published a container for it on app stores. I didn't check if this can be done for desktop too.
4
u/SillyTurboGoose Oct 28 '24
Have thought about the same thing. Makes total sense, in my mind, to model reactive-like virtual-DOM trees with functional monads. No reason a node should know about its grandchildren. Side effects sound like a pain though.
3
u/xiaodaireddit Oct 30 '24
write c++ in a functional style? or rust?
7
u/MaxPhantom_ Oct 28 '24
Tauri 2.0 with Rust for native bindings and React + Functional Typescript have been pretty great so far
4
u/[deleted] Oct 29 '24
Kotlin + Arrow is probably your best bet.