The Open-Source Game Development Pipeline

Providing the means and education to create games using free/libre open-source tools.

F# Already Did It

Leave a comment

Soooooooo… I’ve been pretty busy, which is why I haven’t been posting that often. However, now that things are moving again, I wanted to write about something that I think developers would find useful.

As I mentioned in my last post, languages like Rust and Swift are designed to move beyond C++, introducing some syntatic sugar and other goodies to lure you away from what has become a very old language. Even though you can probably create anything in C++, it also allows you to get in your own way very easily.

Syntatic sugar tends to help ease new programmers into a particular language, as well as learn other programming paradigms. If you look at Swift and Rust, however, you’ll notice that they’re kind of similar.

So, why are they similar? Why create two languages that adopt the “let” and “var” keywords (“var” is adopted from JavaScript and C#, and “let” from JavaScript, C#/Linq, and F#) only to have them competing for market share? It is true that .NET remained closed-source until 2014 (even though Mono, its Free/Libre cousin, had been open for ten years), the same year that Apple also unveiled the Swift Programming Language (which was closed-source at launch); Rust (which has always been open) had been around for 4 years at that time. Why saturate the market further?

Now let’s talk about F#.

F# has been around since 2005. It introduced tuples, pattern matching, and python-like indentation sensitivity all wrapped up in a neat functional package. It also has the benefit of interoperating with C# code and building on top of advances made by the various .NET languages that preceded it. Simply put, if you look at Rust, Swift, and F#, you will see that the former two languages clearly borrow from the latter.

Tuples (F#)

Tuples (Rust)

Tuples (Swift)

Those are just to whet your appetite. Perform a web search for the other similarities and you’ll see my point. 😛

Also, if there is ANOTHER point to what I’m talking about here it would be: try F#. Seriously. Give it a whirl.

The F# organization’s website is here and contains a link to installing the free F Sharp Compiler.

It is becoming stated by programmers more and more that Functional languages are the future… try F# (and Rust, and Swift too!) and see for yourself.*

Cheers!

*(Editor’s Note: “OCaml”)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s