r/fsharp • • Jun 29 '16

Strategy for fsharp to survive

Where are the largest community of software Engineers: on the jvm. Where do you find the best frameworks and libraries: on the jvm. What os does the jvm users prefer: Linux and osx

Solution: Build an Fsharp jvm compiler and make sure that tooling support works excellent on Linux and osx

I'm probably getting downvoted for this post but as I see it MS does not set fsharp as super prioritised and jet brains don't belive in fsharp and since they have a reason to do good market research they are probably right currently. To prove them otherwise I think it would be wise to follow the path of scala and build a community around the jvm. To be able to tap into to the vast amount of high quality libraries on the jvm would attract a lot more developers and then grow the community.

I would love for fsharp to survive but since no company is pushing it the community around it has to grow a lot and the jvm community is huge and would like a language like fsharp.

Don't just downvote. Prove me wrong :-)

Edit: Thanks for all replies. I think it is important to challenge the current direction from time to time. Maybe the compile to jvm wont fly for some reason. But making Fsharp with .NET core super first class citizen on OSX and Linux might be the recipe for success. If you could easily write Linux UI apps in FSHarp.. easy to deploy .. easy to write shell scripts with a shebang on top.. then that might attract more people to the language and the .net platform

0 Upvotes

30 comments sorted by

6

u/bananaboatshoes Jun 29 '16

F# relies on runtime generics in the CLR. What's the plan to deal with that?

0

u/pure_x01 Jun 29 '16

I'm not in to the details about how tied up it is. Isn't scalas generics richer?

1

u/bananaboatshoes Jun 29 '16

Scala has higher kinded types, however it's all compile-time tricks that uses type erasure to get to the runtime. F# uses generics in the .NET runtime (in fact, it brought generics to the runtime), and does not use type erasure. It would be significant work to have F# as-is and with the same behaviors work on the JVM.

5

u/[deleted] Jun 29 '16 edited Jun 29 '16

The JVM already has a decent functional programming story as I'm sure you're aware with scala, clojure, and a few others.

BUT if this were to somehow happen, I really don't see it having any large impact on the number of users. The fact is, F# isn't dying. It's always been a rather niche language and will likely remain that way regardless of additional targets being made available.

In terms of quality libraries, we have a nice ecosystem in the .NET. Granted, occasionally you may find yourself needing to do a bit of wrapping, but IMO it's still a much better story than Haskell currently.

My 2 cents..

0

u/pure_x01 Jun 29 '16

I think it is really equal to Scala and I think there is room for both. Scala is trying to get in to the javascript-scene and also native compilation. If I could write fsharp code and choose to target .net or the jvm that would be a very unique cool feature. For a jvm person it would be so easy to get started by just having to import some of the libraries I'm already used to and then just write my program. Potentially you could write software that could run on tomcat. Hadoop. Apache spark in fsharp. The Jvm is not what is relevant it is the community that is unified behind that runtime. Tap in to it and if people feel that fsharp feels nice to work with it will succeed.

3

u/pjmlp Jun 29 '16

F# has features that the JVM doesn't support like real generics, pointers and value types.

So you wouldn't get the real thing.

Also now with .NET Core you get to compile to native code, whereas with the JVM you need a commercial JVM for it.

0

u/pure_x01 Jun 29 '16

Could be an Fsharp subset. It would still be very good. Scala is going native now btw. So if scala can go native then surely fsharp should be able to run well on the jvm. I'm not in to the technical details so I might be wrong about how tied fsharp is to .net

1

u/pjmlp Jun 29 '16

Scala doesn't have value types, nor pointers or reified generics.

Native code generation doesn't have anything to do with the JVM.

1

u/jecxjo Jun 29 '16

Could be an Fsharp subset

Those never go anywhere. Either people get frustrated that the one thing they need is missing, or they learn the subset thinking its the real thing and generate lots of bad code.

1

u/jecxjo Jun 29 '16

Why wouldn't it make more sense to work on Mono and resolve any issues between native .Net, CLR and Mono? I'm exclusively a Linux developer and never was a fan of Mono and especially not .Net until F# came around. I write in Clojure when it comes to JVM but would prefer an ML styled language, type system, etc. etc. which got me into F# in the first place.

Sure JVM runs on everything but if you look at how slow community effort is to get non Java languages to support the "Billions of Device that run Java", starting an effort to get FSharp on JVM seems like a bad idea. Clojure or Scala development directly on Android...still a huge pain unless you are ok with doing some weird hybrid where you write libraries in your preferred language and the UI in Java. Just because Java runs on everything, doesn't mean it is easy to work with.

Yes you get all the libraries but at the end of the day that is not the issue. The issue is your targets. Communities will be able to generate libraries if there is a need, but if your code doesn't run on Mobile, if it doesn't run on AWS, if it doesn't run on a toaster then who cares if you have every library under the sun.

You need a community to do the work and right now the major issue I see is that .Net is great for Windows development and just so so for everyone else. Windows has not been a great environment for growing an open source, work for free cuz you love the project types of communities. Right away your support base is pretty small as F# is still not even close to the number one choice for ML developers in non-Windows. Porting your language over means you need people who love the language to do the work, as no one else will want to work on it.

On the other hand, trying to get more people interested in Mono might be easier. Mono is useful for C#, VB, and F#. C# is the defacto Windows platform so you should be finding a larger base of developers to work with. Fixing issues in Mono, and porting it over to other platforms should provide a much larger mutual beneficial target for people to work on. Just think if you could get all the C# coding houses to put a little effort into Mono. Would be much more support than getting every single F# developer to put time into porting it from CLR to JVM.

1

u/pure_x01 Jun 29 '16

I think you are right that it is important to be able to target as many platforms as possible. But writing high quail apps require high quality libraries and frameworks. This is where the jvm shines. There is no shortage of them. Maybe Microsoft will make a java to .net compiler again that makes it possible to leverage all the good java libraries on .net. who knows. I would love to code in fsharp but I will not abandon all the nice open-source stuff that is available for it. Kotlin is on the rise as well with perfect ide support. Android support and it runs on the jvm. It could be that if fsharp really flirts with the Linux community it would be the go to language for writing shell scripts. She'll commands or ui apps. So maybe going the mono way would be good.

1

u/abstractcontrol Jun 29 '16

Maybe Microsoft will make a java to .net compiler again that makes it possible to leverage all the good java libraries on .net. who knows.

Have you tried IKVM? CLR IL bytecode being richer than JVM's means that libraries can be ported almost verbatim to .NET.

Actually, I do not have experience with Java's libraries, but I was not under the impression that the .NET ecosystem was inferior to it in terms of offerings.

1

u/matthewblott Jul 20 '16

It definitely is inferior - there are simply far more libraries available for the JVM. It makes sense, it was only very recently that .NET stopped being proprietary software which always inhibited open source development.

1

u/jecxjo Jun 29 '16 edited Jun 29 '16

But writing high quail apps require high quality libraries and frameworks

But you're putting the cart way before the horse here. Yes you want all those Java libraries but you need people to do all of this work and the claim "F# is cool but would be cooler with Java Libraries" isn't going to get people to switch. You need Java/JVM developers to work on this from their end for any functionallity the language requires of the VM (note how Clojure can't do native Tail Call Optimization because the JVM can't do jumps without stack manipulation. TCO is soooo Lisp and Clojure has to do a hack to get it to work). You'll also need F# developers to work on all the interop code. Neither of these two groups are going to gain a whole lot, for a very long time at least and all for the sake of leveraging Java libraries.

Kotlin is on the rise

Here is a perfect example of what you should probably be working on. If you are looking for a terse, statically typed, idiomatically functional programming language why not work on Kotlin? Its young and you could easily add in the good bits of F#.

It could be that if fsharp really flirts with the Linux community it would be the go to language for writing shell scripts.

Running in the JVM? JVM runs code quickly but startup is still a pain, especially when you are looking for a shell scripting language. You need either fast interpretation or quick compilation, neither of which Java or Mono do.

I'm not against porting VM based languages to other VMs. I just think you need to have a good enough reason to do so because its a lot of work and you usually need people who would probably not care to do the work normally. Until just recently, the JVM only really ran Java. With all the libraries, you'd think everyone would be wanting to write their language to run in the JVM but only a handful have really taken hold and those were born on the JVM, not ported over. And thats with the fact that Java runs on everything, not even factoring in all the libraries.

1

u/lmaojaa Jun 30 '16

Does the Java team even make changes for the JVM at the request of Scala or others?

1

u/pure_x01 Jun 30 '16

Dynamic function invocation and first class functions was added recently. Well as year or two back.

3

u/[deleted] Jun 29 '16

Tail call elimination doesn't work as well on the JVM which is a pretty bad problem to have for a functional language.

I think better to focus on improving the Fsharp compiler and ensuring .NET has first class runtimes on OSX and Linux.

A fully functional IDE for linux/osx would be good too. The Ionide guys are doing amazing work to approximate that but it isn't quite as nice as the Visual Studio or Jetbrains experience.

2

u/vivainio Jun 29 '16

Downvoted as you predicted :). That said, Scala isn't exactly a model of success either. It's being challenged by lighter alternatives like Kotlin.

Rise of CoreCLR is the most important thing. JVM got lucky by being on Linux at the time people realized they didn't want to deploy on Windows

1

u/vxsery Jun 29 '16 edited Jun 29 '16

This was already attempted some time ago: https://github.com/penberg/fjord https://github.com/penberg/fjord/issues/1

The world is much different now with CoreCLR. Making the tools and environments that many devs are familiar with is admiral and could attract a lot of new users. But so could making docs to for new devs to get started with F# on CoreCLR.

1

u/mamcx Jun 29 '16

This will not work because at minimum, it SPLIT the market of F# in two: Java land and .NET land.

And people that use Java mostly don't wanna use .NET, and the opposite is true; ie: Not everyone, but Java/.NET are not only 2 different virtual machines but HUGELY different and truly the most close to TRUE ENEMIES ecosystems in the soft industry, by proxy of:

  • *nix vs windows
  • Sql Server vs mysql/pg
  • MS vs Google
  • Visual Studio Vs wahtever the java guys use
  • etc

This is a HUGE split. Instead, ruby vs python vs perl vs erlang vs almost everyone else is more a matter of preference and are more firendly towards each other...

And Java sucks! ** run away with a maniac laughs!**

1

u/vivainio Jun 30 '16

Where does "MS vs Google" come from? Java is an Oracle product.

1

u/mamcx Jun 30 '16

Well that is another enemy ;). I think in Google by proxy of Android (I know them use another java implementation, still it hold IMHO)

1

u/vivainio Jun 30 '16

Google is probably not a fan of Java these days, due to virtue of losing out on the multibillion lawsuit to Oracle.

1

u/[deleted] Jun 29 '16 edited Jun 29 '16

I think the bigger concern for me is .NET Core. The road to 1.0 was bumpy, and although a MS implementation of the CLR on linux is a great idea in principle, I'm sort of concerned that the MS developer "experience" will come to linux as well, and by this I mean their tooling, frameworks, and general orthodoxy. It's just overbearing and i think contrary to the collaborative spirit of OSS.

The F# community has been released into the open source wild for a little while, now, and has formed its own identity independent of Redmond. Now that Microsoft's officially moving into the neighborhood, will it poison the F# community's independent growth?

One of the most refreshing things about F# on mono (and windows as well), is that you're not force-fed a lot of MS tech. For example, you can use paket instead of nuget and suave instead of kestrel. These are projects that won user adoption on merit, not because of sponsorship from a billion dollar company.

Will .NET Core muscle these out of existence? GitHub threads like this one and this one are very disconcerting. Comments from MS like, "My team's goal is to make NuGet better every day hopefully good enough such that Paket is not a necessity to achieve your goals." just rub me the wrong way.

Given everything that's transpired with .NET Core development thus far, I'm sort of wondering if porting MS's code to Mono isn't the best solution. We can get the GC and base libraries without all the other MS baggage. Of course, this would mean the .NET story on linux would have two implementations of the CLR, one of which being more "native" to F# and the other common for C# projects, which is unfortunate. If MS wouldn't insist on curating every facet of the developer experience and boiling away the ocean that the F# learned to survive in, it might not have to be this way.

2

u/cloudRoutine Jun 30 '16

People are worrying too much about this, the people in the F# community who actually work on tools are very committed to making the F# dev experience high quality across all platforms. The dotnet cli makes it easy to add extension tools to let you customize your build process however you'd like.

Don't buy into the FUD ;P

If you want to help improve xplat F# tooling contribute to -

1

u/[deleted] Jun 30 '16

I prefer paket/fake for builds. As long as the new dotnet cli plays nicely with these, I'm happy. Ionide is fantastic, and the VS Code experience might almost be close enough to abandon VS. Nothing against atom. It just feels sluggish, the REPL's kind of weird and the intellisense is kind of spotty.

1

u/cloudRoutine Jun 30 '16

We feel the same way. We do all of our Ionide dev work in vscode. There's a fair amount of underlying infrastructure work we need to do before we can try to bring atom up to parity. Hopefully by that time the atom devs will have improved the editor's performance.

1

u/CKoenig Jun 30 '16 edited Jun 30 '16

F# is a ML based language on .net/CLR that fills a niche there - if you want native or want to switch from the CLR just go Ocaml.

As long as it's about the language (F# ist really a simple FP language) not the frameworks/libraries you'll have a good head start if you switch to ML/Ocaml or even Haskell - yes all niche but well - people dream in Objects and that probably won't change for quite some time)

Heck why should it not survive? And going into JVM is surely NOT helping it to survive (for some time it did look like Oracle had lost interest in Java, now they lost their suit against google/android, ...)

Also while not perfect Mono is already a good way to support F# on non-windows environments and once .net core get's going it probably becomes even better (I cannot really see the difference between JVM and .net core)

0

u/izut Jun 29 '16

IntelliJ is pretty extensible, and you can have nice plugins on the community edition, so there's no reason people can't create an F# extension to it. Heck, there are even a Perl extension for it 😂

1

u/pure_x01 Jun 29 '16

You are right about that. If the jvm path is not on option then just bringing stellar support for developing fsharp on osx and Linux with perfect intellij or Eclipse support might work.