5 ms·
Hmmm... Is F# a good alternative? I already have a ton of experience with .NET and C#. I'm thinking about doing a deep dive into functional programming and d
by FrankenPC 11y ago
Hmmm... Is F# a good alternative? I already have a ton of experience with .NET and C#. I'm thinking about doing a deep dive into functional programming and don't want to waste my time with something that has a major fundamental flaw.
- spuz 11y agoThat's quite a rash conclusion to jump to. Every language has its controversies and quirks. I would recommend deep diving both into F# and Haskell - you certainly won't be wasting your time either way.
- glogla 11y agoHow is F# on unix? I can imagine F# being nice on Windows, but can people with Linux or Mac OS use it? How dependent on visual studio it is? I would guess that Ocaml might be better in unixy environment while sharing similar features to F#?
- sitharus 11y agoIt's not dependent on Visual Studio at all. It has its own build chain (FAKE), runs under Mono and ships independently from .NET. It's the most open-source of the MS projects.
- spuz 11y agoWell F# from the very beginning has always had a bit of a rebellious nature seeing as it was brining ML style programming to the traditional OO platform of Microsoft's .NET. Because of that, many F# people do not use Windows and F# is very much built to be as independent from Microsoft as possible. See here for various ways to use it on linux: http://fsharp.org/use/linux/ http://fsharp.org/use/linux/
- dagw 11y agohttp://fsharp.org/guides/mac-linux-cross-platform/ http://fsharp.org/guides/mac-linux-cross-platform/ Core language works fine and no dependence on VS. There are packages for most distros. Libraries outside the core language are a bit hit and miss, but you'll find libraries for most things you want to do. If you have a Windows project where you've been NuGetting stuff from all over the place, porting might be a bit of a pain.
- FrankenPC 11y agoIt's not a conclusion. I have no idea what's going on with FP. So, it's a genuine question.
- cammil 11y agoDont forget that journalism by its very nature is sensationalist. I doubt very much that this is a "major fundamental flaw". Besides, you would also be asserting that F# does not have that flaw. I don't believe you have that evidence either.
- kolektiv 11y agoIt doesn't have that flaw! But that's probably partly because it doesn't have typeclasses, so Foldable/Traversable aren't possible in the same way...
- sitharus 11y agoI wouldn't say it's an alternative any more than Haskell is an alternative to Java. It's a different language and ecosystem. That said, F# is pretty nice. It's opt-in laziness for .NET compatibility but laziness is pervasive. There's no forced purity though. On the plus side it's easy to interact with anything that has .NET bindings.
- drewm1980 11y agoYeah, I'm not really a haskeller, but this is not a flaw at all. Some standard functions that used to operate specifically on lists now operate on anything that is "Foldable"... including lists. It makes the learning curve a bit steeper, but tutorials already often have you re-implement toy versions of standard library functions for learning anyway. The benefit, if I understand correctly, is that you can use the standard library functions on more things that are not lists.
- masklinn 11y ago> don't want to waste my time with something that has a major fundamental flaw. It's not a fundamental flaw it's a change. Basically in the early days of Haskell they decided to make much of the prelude (the builtins) work on the concrete type "list" rather than on more abstract types for beginner simplicity, with more abstract "interfaces" like Foldable not shown upfront, with the attendant duplication as each function of the prelude now has a more abstract duplicate somewhere else. The FTP change reverses this and alters the prelude to operate on abstract types rather than concrete ones, this somewhat increases the initial learning experience[0] but it doesn't really change the language itself. For C# equivalence, imagine if all the most easily accessible functions operated on the concrete `List` to avoid having to introduce interfaces and all had duplicates taking an IEnumerable instead (that doesn't quite work as C# uses methods but there you are). And surely if that's a "fundamental flaw" of Haskell, you've wasted your time with C# and its fundamental flaw of non-generic System.Collections [0] for complete beginners with no concept of abstract types I guess? For Haskell beginners coming from other languages it doesn't seem like a big issue, just a matter of how abstract types which is already an issue between languages anyway e.g. where Haskell has Foldable C# has IEnumerable, Ruby has Enumerable, Java and Python have Iterable, ...
- FrankenPC 11y ago> For C# equivalence, imagine if all the most easily accessible functions operated on the concrete `List` to avoid having to introduce interfaces and all had duplicates taking an IEnumerable instead (that doesn't quite work as C# uses methods but there you are). Thanks! Considering 'List' is one of the few structures of FP I understand, that makes actual sense.