9 ms·
Getting started with the F# and .Net ecosystem
- dev360 9y agoI know its heresy, but for a while I was actually getting hooked on F# succinct way to write/support OO. On the surface at least, it looked a lot cleaner and more concise than C#. I wish there were more F# jobs - its a very interesting language.
- oblio 9y agoI don't think it's heresy, nothing about F# strikes me as dogmatic. It's a multiparadigm language, after all.
- ydt 9y agoNot heresy at all. Everyone I know that has used it, including myself, really likes it. Yet no one I know has ever used it a real production environment. I guess it has some traction in financial circles, but that's about it. Maybe .NET going cross-platform will lead to some adoption.
- jackfoxy 9y agoWe at Tachyus use it as the main server-side language in our production environment. Also on Linux/Mono. Jet uses it, and they were bought by WalMart for > $1B. There is no problem running in production. In fact, there is a noticeable lack of problems running in production.
- lzybkr 9y agoIt's used in production for Microsoft Security Risk Detection - here is a good blog post describing how F# is used: https://blogs.msdn.microsoft.com/dotnet/2016/12/13/project-springfield-a-cloud-service-built-entirely-in-f/ https://blogs.msdn.microsoft.com/dotnet/2016/12/13/project-s...
- DanielBMarkham 9y agoIt's used in production in a ton of places, although that's only 1-2% probably. Still a lot. And the numbers are growing.
- neilsimp1 9y agoI'm pretty sure https://jet.com/ https://jet.com/ uses F# for their price calculations.
- gecko 9y agoKiln, Fog Creek's old Git/Mercurial hosting environment, had major components written in F#. Those components honestly were probably the only genuinely bug-free parts of the code base (though I think that had as much to do with developers self-selecting to work on those areas as it did to do with using F# as such).
- platz 9y agosame thoughts; some legacy things irk me a bit though, like the inefficiency of async
- Nelkins 9y agoElastic uses it for their Windows/.NET pipeline[1]! And Kaggle, and Credit Suisse, and...[2] [1] https://www.elastic.co/blog/solidifying-releases-with-fsharp-make https://www.elastic.co/blog/solidifying-releases-with-fsharp... [2] http://fsharp.org/testimonials/ http://fsharp.org/testimonials/
- zitterbewegung 9y agoI think the language that is apart of .net that people on HN would find most appealing is F# . Its heavily Ocaml inspired but also has LINQ and all the other cool features from c# .
- partisan 9y agoThe syntax was a part of what kept me away at first, but ultimately, it has become preferable to C# for me as well. It's likely similar for Java programmers moving to Scala for the syntax. I stumbled upon the following response on SO that helped me to move past using interfaces to passing functions instead. https://stackoverflow.com/questions/34011895/f-how-to-pass-equivalent-of-interface/34028711#34028711 https://stackoverflow.com/questions/34011895/f-how-to-pass-e...
- cjnicholls 9y agoIf you have issues accessing it. https://web.archive.org/web/20170607134504/http://www.prigrammer.com/?p=363 https://web.archive.org/web/20170607134504/http://www.prigra...
- qaid 9y agoI was introduced to F# 3 years ago at work, and have been developing with it for more than 2 of those years (in production, some apps mixed with C#, others pure F#) My quick thoughts: Beautiful language. There's quite a bit of a learning curve for some of the more advanced features, but a large portion of the language is very readable and succinct Additionally, I love how the language has helped me become a better developer. Far fewer bug, and none of them are null-related After my former lead left, I've had difficulty introducing new teammates to the language. It's hard to convince C# devs to try it out I've been looking around for a long time, but there seem to be very few teams that are hiring F#. It doesn't help that many aggregate job posting sites fail to show useful results when searching for "F#" Negatives aside, I really enjoy programming in F# and if you were on the fence, I'd say to give it a try!
- equalunique 9y agoThanks a lot for posting this. I have been wanting to break into F#. At work I use PowerShell on many Windows computers. I could write PowerShell modules in C#, but F# would allow me to think like I would if they had been written in Haskell. I am also working on a small web application with C#. (M101N course via MongoDB Uni.) I'm keen on re-implementing in F#, just to see how both compare. Appreciate the getting started guide!
- pjmlp 9y agoThat is my current approach, as I don't get to use anything other than C# (or C++) on .NET/UWP projects, so F# gets used for my own scripts.
- polskibus 9y agoDoes F# have Generalized Algebraic Data Types like Ocaml has?
- Nelkins 9y agoNo, but you can get very close using classes/objects. See https://eiriktsarpalis.wordpress.com/2017/03/20/why-oo-matters-in-f/ https://eiriktsarpalis.wordpress.com/2017/03/20/why-oo-matte... and https://www.microsoft.com/en-us/research/publication/generalized-algebraic-data-types-and-object-oriented-programming/ https://www.microsoft.com/en-us/research/publication/general... for more details.
- vicpara 9y agoI'd love to use F# in production on a Linux/Mac OS environment. I find the tooling to be problematic and quite hacky on these platforms. In the same time the library ecosystem around manipulating PDF/Word/XLSX documents, CPU/GPU math accelerated libraries, machine learning, stats, charts and DB connectors are not that mature and production ready. If you just stay withing the F# and .NET core library ecosystem then it's fine. I'd need more support for the ecosystem to be able to fully switch from scala to F# for production. I'm so looking forward to having Microsoft get the full .NET to Linux.
- nobleach 9y agoI have been feeling this way for quite awhile. I never want to detract from anyone's hard work, but I simply hate Mono. I hate having to fool around with it to get something else to work. When MS released C# for .net-core, I was extremely pleased. I'm not a big MS fan, but C# is really good! Being able to run it on Linux is a great step forward. I know MS has a roadmap to get F# going, so I'll be anxiously waiting.
- smortaz 9y agoin case you'd like to get a quick intro to the language w/o installing anything, check out their jupyter notebook here which you can clone & run: https://notebooks.azure.com/Microsoft/libraries/fsharp https://notebooks.azure.com/Microsoft/libraries/fsharp
- mikerg87 9y agoThis talks about mono and I certainly think it's a nice option. If you want to use .netcore and F# (even on mac and Linux ) here is a nice getting started vid : https://channel9.msdn.com/Events/Build/2016/T661 https://channel9.msdn.com/Events/Build/2016/T661
- cm2187 9y agoThere was a nice video on F# 101 on MSDN recently: https://channel9.msdn.com/Shows/On-NET/A-tour-of-F-with-Phillip-Carter https://channel9.msdn.com/Shows/On-NET/A-tour-of-F-with-Phil... There are two passages that I found amusing. First the guest mentions the merits of F#'s deep implicit typing, where the use of a function at the top may determine the typing of other nested functions. And as one would expect with this level of things happening implicitly, it is very easy to get lost in what is going on, which is exactly what happened to the guest at minute 27, where he couldn't figure out why the F# compiler wasn't implying the correct type. Later on the guest mentioned that for all their API, they actually create a signature file (i.e. a header file) where you have to declare every function signature separately from the implementation. The host diplomatically mentions that perhaps this might maybe be a little bit cumbersome to maintain. The answer is that it's not a problem, as the program simply doesn't compile if you have a mismatch.... Hum. I like certain aspects of it, not using too many special characters (kind of python/vb style), the immutability, etc. But I can't say I am sold and ready to switch though. And many of what are presented as key features are just not the kind of things I have any use for, like declaring lists of consecutive numbers (can't remember the last time I needed one) or F# type providers (I rarely have to deal with unexpected file data formats).
- firlefans 9y agoIt's true that it's easier to write and arguably harder to read code when types are not specified, or at least it's handy for public interfaces between modules. Luckily this is easy to do and often done: https://fsharpforfunandprofit.com/posts/function-signatures/ https://fsharpforfunandprofit.com/posts/function-signatures/ It's the same deal with Haskell, you don't HAVE to specify the types of your code but it can help check your assumptions as to what the compiler is inferring. I've frankly found that a more frequent issue in Haskell because of pervasive use of Monads and other higher-order constructs.
- yawaramin 9y agoYes, to be honest in languages with type inference you have to rely on your editor/IDE to show you types on demand. You do need that to be able to work smoothly on a day-to-day basis. Of course you can and should learn how to reason about the types, but you still need quick feedback about whether the compiler agrees with your reasoning. To your second point, about the 'header' (interface) files in ML-family languages like F#--that is a really great feature because it lets you do abstraction and access control. The interface file specifies what callers are allowed to see, you can use them to make your types truly abstract and prevent access to your modules' internal functions. About lists of consecutive numbers ... not sure what that is referring to exactly. About type providers ... yes, I agree with you that not everyone finds a use for them. In general, I will say that the killer feature of F# and other ML-family languages is that they dramatically increase code refactorability (low-ceremony static types) and dramatically reduce lines of code (simple, 'math-y' syntax).
- lobut 9y agoAny one that uses F# right now, can you tell me if you can create folders in Visual Studio? It seems like it's mentioned here, but I'd like a confirmation.
- akra 9y agoYou can via the F# Power Tools; at least in VS2015. In VSCode just create the folder as per normal and hit "F1->F#: Add File to Project" using the Ionide plugin. Admittedly the need for folders in my experience is a lot less than in C#.