Functional Programming Adventures in 2019

Explore Functional Programming adventures in 2019: Fable, F# to JavaScript conversion, and innovative projects like Green Print for web development.

6 min read 1,092 words

Happy New Year

I like to start by wishing all the readers A Very Happy New Year... I wish 2019 will be full of fun and fewer issues for you.

Speaking of issues, I'm going to talk about Functional Programming. Because if you code with Functional Programming, you normally get fewer errors. I love it for those reasons.

In this post, as the title suggests, I will be talking about Functional Programming only. There will be no code though, but mostly in a meta sense.

Fable

As we are talking about Functional Programming, we have to talk about Fable. My current favorite tech. It nicely converts F# to JavaScript and has a wonderful ecosystem. I am lucky enough to be part of it and also maintain awesome-fable. I have been using it in multiple projects for more than a year. It is very much battle ready for putting in a big or very big project. I will talk about projects later. But let us talk about a few other announcements.

Green Print

If you take Blue and mix it with Yellow, what will you get? Green. Here is Green Print project. It is a thin wrapper around Blueprint Js. So Blueprint can be used with Fable Elmish. Blueprint is a UI library built for desktop-heavy web applications. All the namespaces are in Fable fashion, Fable.Blueprint.*. It is still a work in progress though. I ported core and icons but others are still pending.

I love Fulma, so I took that project and made Green Print from it. I am using the library in a project for work. I will be adding to the open source project as well. It is kind of working. The thing here is, Blueprint is quite a big library, so I can't test all elements with all features. Docs are also pending, so there's a chance of a few corner issues. But here I need the community's help to make it feature ready as fast as possible—fine tune the API or work on docs. It is the same as Fulma but a bit different. Check out Blueprint JS and see if that matters to you. I'll be happy if it can be useful to anyone.

Fabulous

Fabulous is a fabulous library for cross-platform mobile development. It is a wrapper around Xamarin.Forms with Elmish in it. I was so pumped up when it first launched, tried it, and made a couple of apps with it. Nothing fancy, but I was having fun. There were a few things I was not happy about.

  • The list is quite jumpy
  • Not happy with the performance on Android
  • I felt there was too much wiring up I needed to do
  • Live reload didn't work for multiple files in the project

But

FabScaffold

Recently I created an application with Fabulous within a week. Polishing the UI took a week more. I will write more about it in a separate write-up once I launch the application. Coming very soon. For now, I ripped apart my application and created a scaffold from it.

Here is the project called FabScaffold. It has almost everything to get you started. It also provides an architecture to grow your next business application. Go for it. I have solved all the mentioned issues other than live-reload for multiple files in a project.

Fabulous has the same limitations that Xamarin.Forms have. Backend plugins will work as they should, and for UI you might need a wrapper for a few, and a few will work as is. But it is too good without all that Xaml around.

Machine Learning Monday

I started Machine Learning Monday a few months back. But due to year-end, I couldn't continue. But I will continue from next week. This coming Monday, I will be reviewing F# for Machine Learning Essentials. I got this book from Sudipta Mukherjee himself. It should be fun. So stay tuned.

Sad State of F# & Moving Forward

This is a little bit personal. Some might find it a rant, but please don't mind. I started my consulting gig Fuzzy Cloud last year. There are a couple of people other than me. My sole motive behind starting my own gig was to do more work in F#—be it consulting or training. It is such a sweet language and has a wonderful community around it. I did get continuous contract work a year before. But last year was not so good. Not only is it hard to find work in F#, but people also keep asking for other languages like Scala or Haskell. There is not enough buzz or work in F#. Even at functional conferences, when people speak about Haskell, Scala, and Elixir in the same breath, they always skip F#. Even the Twitter account Functional Works skips F# quite a bit. Even though I learn those languages, I am all in for F#.

I should not fall in love with a language (it is just a tool). But what should one do when a language is so delightful?

I am still going to try a few more months to get good work in F#. Else, I need to keep it for my hobby projects only. I will be working more towards Scala, Rust, and Kotlin. Haskell and Swift are also there, but I am kind of undecided on those.

I am available for F# related training and work if anyone is interested or has a remote position open.

Speaking

In 2019 I will try to speak at more conferences. As of now, F# Exchange is top of my mind. Please suggest good conferences if you think they are good and don't mind fresh speakers.

Languages

Because of my history, I never liked English that much. Also, I never bothered with it. But I guess I need to improve on that. Also, I want to learn German as well. People say it is very close to Sanskrit. Maybe I can learn both. If you know how to get started with German better than a Google search, then please let me know.

If someone is confused about history and English, they can read about Bengal Famine 1943—a very recent incident.

I will also try to write more compared to the last couple of years. There are many things I like to share but never get enough time to write. With that, I am closing it. Happy New Year once again to everyone.

Frequently Asked Questions

What is Functional Programming and why does it reduce errors?

Functional Programming is a coding paradigm that emphasizes writing pure functions and avoiding side effects, which naturally leads to fewer bugs and errors in your code. By reducing mutable state and following functional principles, developers can write more predictable and testable code that's easier to debug.

What is Fable and how does it work with F#?

Fable is a technology that converts F# code to JavaScript, allowing developers to use functional programming principles for web development. It has a strong ecosystem and is production-ready for large-scale projects, making it ideal for those who want to leverage F# in JavaScript environments.

What is Green Print and how does it relate to Blueprint JS?

Green Print is a thin wrapper around Blueprint JS that enables Blueprint's powerful UI library to be used with Fable Elmish in a Fable-fashion namespace structure. It's designed for desktop-heavy web applications and allows F# developers to leverage Blueprint's comprehensive component library.

What is Fabulous used for in mobile development?

Fabulous is a library for cross-platform mobile development that wraps Xamarin.Forms with Elmish, allowing developers to build mobile apps using functional programming principles. It enables writing native iOS and Android applications using F# with a functional architecture.

What challenges did the author face with Fabulous?

The author experienced issues with list performance, Android performance concerns, excessive wiring requirements, and live reload limitations with multiple files. Despite these challenges, they were able to create a working application in about two weeks and subsequently developed FabScaffold from the experience.

Share this article