News for hackers. Stuff that matters.
Re:Why Use F#? by kyleperik on Wednesday December 12, 2018 @11:44PM (#18669890)
I understand there exists .net core and mono. I'll give them mono. My problem is I haven't seen a single example of a practical application written in .net core or a company that uses it, everything is .net framework. There just aren't many available alternatives to the frameworks and packages that are those who use .net framework take for granted. I hear what they're saying about it's the future, but I have yet to see the fruit of it.

To me .net core seems more like just a buzz word to prove that they like open source and anyone can use their software. But there isn't any way to monitize it so there isn't any reason for them to focus on it.

Re:Why Use F#? by bluehatbrit on Thursday December 13, 2018 @03:03AM (#18670623)
I'm not sure where this is coming from. I work at a ftse 100 company and all of our newner microservices are .net core. Almost every team in the org has some .net core running and we're slowly moving framework projects over to it.

It's definitely not just buzz, it just takes time for a company to begin adopting a radically new platform with so many differences to it.

I also have many friends in other .net based orgs and they've each got similar things happening in their companies.

Release of core happen on a pretty regular basis and we've not seen any issues with Microsoft not putting time and effort into it.

Re:Why Use F#? by zamalek on Thursday December 13, 2018 @12:32AM (#18670073)
> I haven't seen a single example of a practical application written in .net core or a company that uses it

We[1] have multiple teams working with it right now (we're strangling our netfx 4.6 monolith), and some of those teams have already pushed their work to production.

The big advantage that I've seen is that it puts teams in charge of their own destiny. I remember the upgrade from netfx 2.0 to netfx 3.0: it was awful. The entire codebase had to be upgraded. Customers had to be upgraded to netfx 3.0. If another vendor futzed with and broke the machine.config, we'd break. With netfx you are perpetually behind the curve and at the mercy of the admin, especially if on-prem is a concern. netcore is xcopy deployment, runtime and all. You can use netcore on alpine[2] (netfx only works with Windows containers).

> there isn't any reason for them to focus on it.

1. Even if nobody was using it, I bet Microsoft would use it themselves. It is so much better than netfx.

2. Azure. It does run outside of Azure, obviously, but the Azure integration in VS is a powerful bait and hook.

Plus, for something that there's no reason to focus on, they are certainly putting a lot of focus into it. Even if I haven't figured out the true reason to focus on it, there clearly has to be one.

> There just aren't many available alternatives to the frameworks and packages

That was an issue up until, maybe, a year ago. Most packages have netstandard (a build target that works with netfx and netcore) support nowadays. If they don't, they are probably unmaintained.

[1]: https://www.k2.com/ [2]: https://hub.docker.com/r/microsoft/dotnet/

Re:Why Use F#? by math on Thursday December 13, 2018 @12:10AM (#18669984)
quite the contrary, people are quickly moving away from the .net framework towards .net core, which is now objectively better and moving at a fast pace. I help maintain a popular open source library for .net. We develop on MacOS using VS Code (only use Windows for testing) - the experience is good. We have many large customers (brands you would know), and .NET Core support is important to pretty much all of them.

https://github.com/confluentinc/confluent-kafka-dotnet

Re:Why Use F#? by victorNicollet on Thursday December 13, 2018 @02:41AM (#18670532)
We migrated the compiler and virtual machine for our DSL, our ETL pipeline, and our machine learning code (traditional & deep) to .NET core on Linux earlier this year. We are impressed with the performance and stability, and the developer experience has significantly improved since the mess two years ago.

We are a tiny bit miffed at some missing features, though (especially in System.Reflection.Emit).

Re:Why Use F#? by atombender on Thursday December 13, 2018 @12:21AM (#18670023)
The last time I brought this up on HN, I received a comment [1] from one of the people who work on F# at Microsoft:

  F# is fundamentally a .NET language ... It's impossible to divorce 
  the two, even if the target runtime environment is not necessary a
  .NET runtime. Those other environments inherent language design
  decisions made with .NET as a target runtime. The .NET runtime
  with .NET Core is indeed minimal, is natively supported just about
  everywhere, and was built with cross-platform in mind. F# is a
  part of this, for better or worse.
I like F# a lot, and to me it comes across as something of a cleaner, more modern OCaml. I have zero interest in .NET and its toolchain, and I don't want the baggage of its runtime or VM.

[1] https://news.ycombinator.com/item?id=17936732

Re:Why Use F#? by kyleperik on Thursday December 13, 2018 @12:29AM (#18670064)
Thanks, I think we find ourselves in the same boat.

To everyone else - maybe I should have asked a better question, but it's quite clear to me now that people are in fact using this in production. That's great. My only question now is, what is Microsoft's strategy here? There's no money flow with .net core as far as I know, so why put in the effort?

Re:Why Use F#? by bonesss on Thursday December 13, 2018 @03:10AM (#18670653)
Their strategy is to make bank.

Traditionally MS was laughed out of vast swaths of academia, research, and Enterprise solutions. Now, they're making ever more bank off of Azure, and want to get their products deeper into those markets where being Linux friendly, cross-platform, and all the rest are "must have" features. That's big money, and future growth.

At the same time: their current breed of engineers also struggles with some of the historic windows nonsense, and it's becoming ever less profitable to maintain. So it makes sense even for MS to transition a bit away from legacy MS.

SQL server runs on Linux now, MS hosts Kubernetes cluters and has Linux bundled in Windows, and Azure scaling is always cheaper when not paying OS licensing fees. MS stands to win a lot by having a relevant development platform, MS stands to win a lot being the tool provider of choice for cloud development, MS stands to win on cloud hosting and growth, and MS stands to win a lot with upselling to captive cloud customers (BI, BizTalk, OMS, Analytics, etc).

.Net Core is the free razor, everything else are the high-margin blades :)

Re:Why Use F#? by jerryluc on Thursday December 13, 2018 @01:44AM (#18670339)
Azure. Microsoft revolves around Azure these days, if they can provide a better dev experience that leads to more people using Azure they're happy to spend money on it.
Re:Why Use F#? by oblio on Thursday December 13, 2018 @03:42AM (#18670813)
Not just Azure, cloud. Office can be extended with .NET. And Office is now Office 365.

Plus, Microsoft wants to get back in the game on mobile, so they need at least a platform, if not an OS. If they can put .NET reliably on top of Linux, Android, iOS, they can probably find ways to monetize that.

Re:Why Use F#? by kazinator on Thursday December 13, 2018 @12:24AM (#18670038)
It strikes me as nonsense. Let's take the paragraph and replace "F#" with "C", ".NET" with "PDP-11", and "Core" with "V6 Unix".

Come on, surely you can make a non-.NET dialect of F#. Sure, not every .NET F# program will be portable to it. There must be some considerable abstraction in F# that isn't tied to .NET.

Re:Why Use F#? by piaste on Thursday December 13, 2018 @07:35AM (#18671852)
https://fable.io/repl/

This is a F# -> Javascript compiler and environment, itself running in your browser (in Javascript, obviously).

https://github.com/kjnilsson/fez

This is a project running F# on BEAM (Erlang).

So yes, of course you _can_ write a compiler from F# to whatever platform you choose. It's just a really major effort, in no small part because F# is a way, _way_ higher-level language than C (you'll remember 'worse is better' - a big deal with C is that it's easy to write a compiler for).

Re:Why Use F#? by kazinator on Thursday December 13, 2018 @01:05PM (#18674501)
> a big deal with C is that it's easy to write a compiler for

We are still feverishly at it in 2018 and there is no end in sight.

> It's just a really major effort

That is neither here nor there.

Re:Why Use F#? by bonesss on Thursday December 13, 2018 @03:04AM (#18670630)
Can you make a language that looks like F# and compiles? Sure.

Can you make F# the language meaningful on other VMs? Not really, as F# is a deep, deep, .Net language.

This isn't about abstraction or syntax, it's that every concept, feature, and element of the toolchain bases itself on .Net capabilities and considerations. From referencing libraries, to scripting, to type generation at specific points in the compile cycle to support Type Providers... Async computation blocks...

Remember, F# came from MS research based on the established working .Net framework, and was tighly tied to fundamental framework improvements (like generics and dynamics). It was built by hardcore .Netters, it's the first "true" .Net language, and it bases major language features on deep-down .Net capabilites not found in other VMs.

The point of the quote is that if you were to try this, at best you'd get "OCaml Over There", not "F#", since F# without .Net is "OCaml". It's not the syntax, it's the deeply intertwined nature of everything else.

Re:Why Use F#? by vram22 on Thursday December 13, 2018 @04:05AM (#18670925)
>Remember, F# came from MS research based on the established working .Net framework, and was tighly tied to fundamental framework improvements (like generics and dynamics). It was built by hardcore .Netters, it's the first "true" .Net language,

What are "dynamics" in this context?

>and it bases major language features on deep-down .Net capabilites not found in other VMs.

Can you give some examples of that?

Re:Why Use F#? by profquail on Thursday December 13, 2018 @01:32PM (#18674738)
“Dynamic” in GP’s answer is referencing .NET’s support for dynamic typing (which works in both C# and F#): https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...
Re:Why Use F#? by vram22 on Thursday December 13, 2018 @01:48PM (#18674881)
Thanks, will check that out.
Re:Why Use F#? by kazinator on Thursday December 13, 2018 @01:59PM (#18674993)
That just looks earth-shatteringly non-portable; it cannot possibly exist anywhere but .NET.
Re:Why Use F#? by loeg on Thursday December 13, 2018 @10:48PM (#18678313)
Re:Why Use F#? by sparkie on Thursday December 13, 2018 @04:55AM (#18671135)
F# without the .NET platform is essentially OCaml.

The differences between the two languages are primarily in the way it integrates with the .NET platform and many assumptions on it.

If you wanted something similar on say, the JVM, starting from OCaml, you would make many different design choices and the result would be a very different language.

Re:Why Use F#? by kazinator on Thursday December 13, 2018 @01:49PM (#18674902)
So F# is the name of an OCaml implementation for .NET, which adds nothing but very .NET-specific extensions that don't make sense anywhere else?
Re:Why Use F#? by sparkie on Thursday December 13, 2018 @02:31PM (#18675230)
Mostly. It does add some novel new features which could be reused on other platforms, but many of the features are tightly linked to the .NET base class library, and would not translate cleanly over to other platforms (certainly possible to simulate them, but you would probably want something which integrates better with your VM)

For example, the whole type system is based on .NETs type system. interfaces, subtyping and generics, properties and indexed properties, which are quite different on the JVM and other platforms.

F# usually relies on having attributes (annotations in Java) for compatibility with other .NET languages like C# where certain features did not fit into the OCaml syntax and semantics cleanly. These also wouldn't transfer over to other platforms very well.

Some features which F# has that could transfer over to other platforms include measure types, active patterns, and type providers. I believe some of these have already made it to other languages. Gosu, for example, on the JVM had a feature similar to type providers before F# got them, so you could argue that F# borrowed that feature.

Re:Why Use F#? by jugg1es on Thursday December 13, 2018 @12:17AM (#18670009)
we're running a ton of .net core docker containers at my company. C# is really a great language and now you can run it on anything. If you haven't seen it yet, it's because you aren't looking that hard.
Re:Why Use F#? by nikofeyn on Thursday December 13, 2018 @12:09AM (#18669977)
well, i don't know what to tell you. i am not really here to defend or market for the world's most valuable company. all i know is that my understanding is that .net core is the future of their .net stack and they are doing things that show that. for example, with .net core 3.0, there are desktop packs for uwp, wpf, and windows forms so that you can develop even your windows apps for .net core. so even on windows, .net core is quickly moving to replace .net framework for new projects. of course old projects will likely lag being so attached to the .net framework. that's the case for any technology platform transition.

also, on a technical point, .net core is fast, faster than .net framework and mono.

Re:Why Use F#? by bishala on Saturday December 15, 2018 @12:06PM (#18689176)
Tencent FiT, a division of Tencent have been using .NET Core in production for a while now https://customers.microsoft.com/en-us/story/tencent-telecomm...
Re:Why Use F#? by Xeronate on Thursday December 13, 2018 @12:13AM (#18669995)
FWIW I work for a large public tech company and we have a major portion of our microservices written in .net core deployed on linux containers in AWS.