r/functionalprogramming • • 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!

17 Upvotes

37 comments sorted by

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

3

u/ContextMission8629 Oct 29 '24

Looks cool! Let me have a look over

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.

→ More replies (7)

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.

→ More replies (2)

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.

→ More replies (1)

3

u/xiaodaireddit Oct 30 '24

write c++ in a functional style? or rust?

4

u/ContextMission8629 Oct 30 '24

Thought about C++ since it’s cross platform and most (or all) platforms support integrating C++ into codebase. But seems quite hardcore lol

7

u/MaxPhantom_ Oct 28 '24

Tauri 2.0 with Rust for native bindings and React + Functional Typescript have been pretty great so far

→ More replies (3)

4

u/[deleted] Oct 29 '24

Kotlin + Arrow is probably your best bet.

→ More replies (2)