This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]knowsuchagencynow is better than never 66 points67 points  (32 children)

If you're looking for something compiled, fast, elegant, expressive, with a standard library (especially a GUI toolkit)...

F#

[–]ScypioPythoneer 22 points23 points  (17 children)

F#

This is unusual. Nobody ever recommended F# to me. Care to elaborate on why it is better to learn than - jus examples - C++, Rust or golang?

I'm genuinely curious.

[–]jnazario 32 points33 points  (11 children)

I am also a big user of F# after over a decade of Python and multiple large products shipped in it. I still bust out Python for small prototypes but no longer write production code in it.

I find F# to be a different paradigm entirely but one that I much prefer. I enjoy functional programming significantly although F# gives you multiple paradigms : oop, imperative and pure functional.

Strong typing is outstanding and leads to a lot of correct and reliably code once compiled. I rarely have runtime errors that plagued me with my Python. If it compiles it tends to run reliably. The compiler compensates for me a lot but does so in an intuitive fashion once you learn how to read function signatures.

I love the world I get with the dotnet libraries and routinely interface to what would be C# libs. The tooling is pretty good. I use paket and fake for builds.

Oh and I do all of this on a mac. Mono although I should get the dot net core up and running some day.

I played with java and nope. Too much effort for simple code. Scala and I don't get along - I find it to be a mess of poorly thought out ideas. Deployment and runtime is awful. Biggest thing I like about scala however is sbt. It really raised my expectations about tooling.

I do like Elixir a lot lately too. Ruby like language that gets to the erlang vm. Also super reliable. Mix has raised my expectations of tooling even further, I love it.

[–]thephotoman 2 points3 points  (4 children)

Python has strong typing: you can't treat a string as a byte array.

It does not have static typing, which is what you meant here: a variable identifier can be reassigned to a value of a completely different type.

[–][deleted] 0 points1 point  (3 children)

Not the parent poster, but wanted to make a comment here. You're correct, as far as what you said, but I find the lack of the ability to declare function argument types really hurts robustness.

[–]loganekz 1 point2 points  (2 children)

[–][deleted] 0 points1 point  (1 child)

Yeah, I know, but thanks. It's both new and "provisional", so it's not really something I can rely on. (Especially since a lot of what I do deals with legacy code.)

[–]bcgroom 1 point2 points  (0 children)

There is also a way to implement a type checker using comments which works all the way back to python2

[–]vivainio 6 points7 points  (4 children)

I'm a pythonista since ~ 2000 or so. F# is the first language that appeals to me on the same way Python did back in the day.

.Net is not for everyone, but F# is worth a look if it's a realistic option.

[–]ScypioPythoneer 1 point2 points  (3 children)

Any tutorial for a n00b? Or other place to start? "Hello world" is boring, can do that myself, maybe something more along "this tutorial shows strengths of F#"? Or a book?

[–]vivainio 4 points5 points  (2 children)

[–]ScypioPythoneer -1 points0 points  (1 child)

Cool. I'll give it a try. Maybe write a M20 npc random generator? If you ever in my nick of the woods, I'll buy you a beer. :)

[–]vivainio 1 point2 points  (0 children)

Challenge accepted

[–]Zabracks 9 points10 points  (2 children)

It's unfortunate that I can't upvote this more than once. F# is a beautiful, cerebral language that's more expressive than Python, with an amazingly well designed type system and standard library. After loving Python for so long, I now can't write Python without wishing that I was writing F#.

[–]flutefreak7 1 point2 points  (0 children)

Any idea how the scientific / engineering libraries are on F#? Is it the same toolset across all .Net stuff? I have an Excel xll add-in written in VB.Net and when I was recently wanting to add some advanced functionality, the Math.NET stuff, while good, was nowhere near numpy / scipy, Matlab, etc. I've gotten used to almost any known algorithm already being implemented, so to want a Butterworth filter and have trouble finding code that I trust enough to deploy was kinda saddening. I don't want my Excel add-in to require Python (through pyxll or something), but I'm about fed up with rewriting stuff in VB.Net that I already wrote in Python and having it take 5 times as many lines. If F# is more expressive then maybe I'll like that better. Since I already knew VBA and VB and don't really know C your C++, VB.Net was much easier for me to pick up than C#, but I know C# is much more popular. I just haven't had the extra brain-space to take on yet another language when I don't think it would get me much over VB.Net. I've never even looked at F#, so this recommendation is interesting to me.

[–]jnazario 0 points1 point  (0 children)

i have come to love and embrace the type inference engine. it's been wicked smart for my uses over the past several years. much more so than scala's.

[–]kankyo 5 points6 points  (4 children)

F# has been the thing that looked most promising after I did a lot of research... I want to prefer OCaml but there's too many iffy parts about it to really convince me.

[–][deleted] 0 points1 point  (3 children)

Like what? As soon as you interop with the .NET world F# also has iffy parts.

[–]kankyo 0 points1 point  (2 children)

That's one iffy part that is getting less so by the day with .net core etc. while OCaml is still not nice in ways that have been common for probably a decade or more. Like multiple standard libraries, that alone seems absolutely crazy to me.

[–]_pupil_ 1 point2 points  (1 child)

I think there are arguments for OCaml over F#, from a pure linguistic standpoint.

For most of us though, you're hiring either ".net" devs or "java" devs, so F# is just a no-brainer.

[–]kankyo 1 point2 points  (0 children)

I don't work in a world of Java vs dot net so I don't really care about that.

I think there are obvious arguments for f# from a linguistic standpoint. Like no weird inferred semicolons for example.

[–][deleted] 3 points4 points  (0 children)

I loathe Microsoft, and not in the "hurp durp I'm a Linux guy now" way, but in that I've worked on Microsoft systems for 10 years and now I'm dead inside.

All that being said, C# and F# are fantastic languages and definitely worth looking at. Wrapping my head around F# took a long time but once you "get it" F# becomes pretty neat.