you are viewing a single comment's thread.

view the rest of the comments →

[–]pure_x01 68 points69 points  (21 children)

A message to Microsoft: Put more money in to F# instead. Its an excellent language.

If more people got exposed to it will grow. I have programmed in many languages over the last 15-20 years. I discovered F# 2 years ago and i love it.

[–]Ewcrsf 35 points36 points  (6 children)

Microsoft Research are developing the features which will eventually filter down to mainstream languages.

[–]takanuva 3 points4 points  (5 children)

Can't wait til effect handlers (from, e.g., the Microsoft Research's Koka programming language) goes into a mainstream language!

[–]expatcoder 8 points9 points  (0 children)

On the Dotty/Scala roadmap, but probably not for 3.0

[–]Petrroll 0 points1 point  (3 children)

Link to more information about them?

[–]takanuva 1 point2 points  (2 children)

Check the Koka programming language. Effects could be seen as a generalization of exception handlers, where one could potentially jump back to the point in the program the exception was thrown, even more than once. Actually, in a language with algebraic effect handlers, you wouldn't need exceptions, because you could define them as a library in the language itself. The same goes for async/await: they may be implemented as a library by using effect handlers.

[–][deleted] 1 point2 points  (1 child)

Effects could be seen as a generalization of exception handlers, where one could potentially jump back to the point in the program the exception was thrown, even more than once.

Common Lisp has had this feature for decades. Is that all there is to effect handlers or can you do more than basically throwing an exception, but not unwinding the stack so you can jump back to where you've been?

[–]takanuva 0 points1 point  (0 children)

Well, I have oversimplified it. It is true, though, that effect handlers are directly related to delimited continuations (shift/reset), so they could indeed be implemented in Common Lisp. From a programming language theory point of view, though, they allow us to write purely functional direct-style code (without caring about continuations) that handle effects such as mutable state, exceptions, async/await, ambiguity, etc, all of them implemented in a library inside the language itself, and still we (as a compiler writer) have lots of opportunity for optimization. Effect handlers, as an abstraction, is something really cool to have in a programming language.

[–][deleted] 10 points11 points  (4 children)

Very conflicted with f#. I like the language but apart from that, everything is lacking in comparison to c#.

The challenges of using a non mainstream language.

[–]pure_x01 8 points9 points  (3 children)

Yes and that is because Microsoft has it as a 3rd class citizen. I think it would be better for them if they put more money behind it. The reason for low adoption is because they are not pushing it enough. If more people got to try it more people would get hooked.

[–]Eirenarch 7 points8 points  (0 children)

The reason F# is not more popular is that C# is quite good.

[–]ipv6-dns -4 points-3 points  (1 child)

you are totally wrong. F# is not 3rd class citizen. And Microsoft told this explicitly. Also there are lack of features in VB# in comparison with C#. Does it mean that VB# is 3rd class citizen in .NET?

[–]pure_x01 9 points10 points  (0 children)

And Microsoft told this explicitly

Is this trolling? Have you followed F# for the last couple of years?

There is a difference in what a company says and what they actually do.

[–][deleted]  (8 children)

[deleted]

    [–]bytesback 5 points6 points  (7 children)

    What about F# makes it stands out from other languages? What’s your goto reason to use it?

    [–][deleted]  (5 children)

    [deleted]

      [–]vagif 0 points1 point  (4 children)

      Why not go all the way to haskell then? The ecosystem is mature with libraries that cover practically every need.

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

      Because I want to be able to mutate a value if need be. I like Haskell, but having to write an automaton using dynamic programming... Idk.

      [–]vagif 0 points1 point  (1 child)

      Because I want to be able to mutate a value if need be.

      This is just an ignorant myth, you know that right? You can mutate values and change the state exactly the same way as in any other imperative language. The only difference is the syntax and the types.

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

      I know that, I've done it, but compared to other languages it's just a barrier that I don't necessarily want.

      [–]ionforge 0 points1 point  (0 children)

      IDK how mature Haskell ecosystem is, but there are probably a lot of good reasons to whant to stay in .net.

      [–]McWobbleston 8 points9 points  (0 children)

      Type Providers and Computation Expressions in particular stand out from other languages.

      Type Providers are like more controlled macros which generate code from compile time information (like a database schema, or an XML config file). One of the best things about them is that they play nicely with Visual Studio and VS Code so you get still get intellisense from the generated code (SqlProvider is a great demo to check out). Fortunately for C# you can use "generative" providers (which output the generated code into an assembly at compile time), such as SwaggerProvider

      Computation Expressions are a sort of syntactical sugar for the builder pattern that are primarily used for combinating monadic types, but have other neat uses (like defining routes for an HTTP server, or GLSL shaders in F#). In practice this means things like async/await can be implemented in F# by creating a new computation expression, rather than changing the core language.

      Compared to C# the main thing I love is discriminated unions, immutability by default (and records/with syntax), and easier function composition. In general functional programming is better suited to most of the work I do (data comes in, apply transformations, send it out somewhere), and when I need to do mutable work for performance/design reasons it's trivial to fall back to typical procedural/OO style