- As I expected, not many people have a use for Units of Measure.
----To post, send email to fsharp-o...@googlegroups.comTo unsubscribe, send email toFor more options, visit this group at---You received this message because you are subscribed to the Google Groups "F# Discussions" group.To unsubscribe from this group and stop receiving emails from it, send an email to fsharp-opensou...@googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Just my two cents – I’m in the camp who’ve used it rarely, but when I did it was incredibly useful. We were using it some months ago to compare AWS and Azure VM offerings in terms of costing, memory sizes, CPU core counts etc. – some of the data came in GB, some in MB, some in bytes etc. – having the UoM available saved us from an incredible amount of fluff.
About the real-world code, I’d assume it has also a lot to do with when people use F#. I have now seen quite a few applications of F# for some very core components in an enterprise setting or for things like our GPU compiler or the likes of what we read earlier about solutions for energy. That said, from those projects, it won’t be easy to see code as those are usually part of the uniqueness of the company building them so it is not going to be open-sourced for instance.
Also, in a corporate environment, where you have say mostly C#, introducing F# for certain parts (because you can’t just flip an existing code base to F#), causes additional effort. People need to deal with double code bases, learn the language (for an imperative programmer this takes time), etc. Companies will (and do) go for it, but only if it yields a large enough benefit. Especially if it gives them a competitive edge, but again, you won’t see that that code…
On 15 April 2015 at 22:14, Warren Young <tan...@west.etr-usa.com> wrote:
> Also, in a corporate environment, where you have say mostly C#, introducing F# for certain parts (because you can’t just flip an existing code base to F#), causes additional effort. People need to deal with double code bases, learn the language (for an imperative programmer this takes time), etc.
I think there’s a lot of potential in F# libraries. They’re easily consumed by C# code, and the C# programmers don’t need to dig deeper than the API, if they don’t want to.
Yes and no; F# libraries are easily consumed by C# code, when they are designed to. We recently broadened our GPU compiler from being F#-only to being fully IL compatible. In that, we refactored our code to be more easily accessible from C#. F# most certainly can be written in such a way, that using an API from C# is a joy and you can take good advantage of C# type inference and you can end up with a very clean and even quite functional and fairly type-safe API. That said, it is not for free and you have explicitly design it that way.
Problematic for a C# API include F# data structures (even simple lists), modules, DUs, even records to a certain degree, usually tuples and almost always F# function values. Or with other words, writing idiomatic F# code without caring about C# will likely cause a C# unfriendly API.
I think a lot of pure C# programs would be better off stripped to a C# GUI driving an F# core.
The reverse is a problem, as I brought up above. In addition to C#-isms, you have problems like OO- and mutable-centric interfaces that are just plain clumsy to use from F#.
While, I definitely agree, this also is part of the reason, I think, why F#’s adoption is not too high (yet) for simple business applications. When you have fairly simple business apps with little business logic along some validation but mostly CRUD, really, then what is the point in using an F# core with a C# GUI? For MVC, the story is I think much better as there is no C#-heavy designer and as far as I understand F#’s adoption is better. For WPF or WinForms, we would need something to make them easy from F#. That is, some designer which allows for F# code interaction (might not even need F# generation, just interaction should be fine). And some good blog posts, MSDN tutorials and general best practices how to deal with say a WPF API from F#; I’m thinking something like: “I feed you nice immutable records and you’ll notify the view of whatever it needs to know”, some nice event sinks and event sources for the UI
Well, the module thing can get a pain, when you have types in modules as you then need to fully qualify the name. In F# we just open
the module like a namespace. That said, this one might be fixed in C# 6.0, though I am not sure if you can open classes in C# 6.0 with respect to nested classes.
I would actually like that feature in F# as well i.e. opening up static classes, not just modules.
From: fsharp-o...@googlegroups.com [mailto:fsharp-o...@googlegroups.com] On Behalf Of Daniel Fabian
Sent: 16 April 2015 10:00
To: fsharp-o...@googlegroups.com
Subject: Re: F# Survey results discussion
Well, the module thing can get a pain, when you have types in modules as you then need to fully qualify the name. In F# we just open
the module like a namespace. That said, this one might be fixed in C# 6.0, though I am not sure if you can open classes in C# 6.0 with respect to nested classes.
Not enough real-world code to learn from
--