F# for fun and profit: Terms and Conditions
fsharpforfunandprofit.com
fsharpforfunandprofit.com
https://pragprog.com/titles/swdddf/domain-modeling-made-func...
Although it may look like just Domain Driven Design (DDD) and F# from the title. I think I've learnt a lot more from it. It changed the way I approached a problem and I somehow keep coming back to the book to get a refresher of the teachings in it. I suspect it is due to the influence of F# and functional paradigms that is also being shared in the book.
Direct youtube[1] for those who don't want to click twice :)
Really well done, and such a easy read as well.
It's not that it's revolutionary, but it one of those things that once you read it both seems obvious and also makes you wonder why we do things any other way.
It completely changed the way I thought about the role of type systems -- and I don't even mean in terms of monads, functors, or any other higher level category theoretic stuff. I mean just the day-to-day business coding idea of representing more of your domain directly in the type system.
I now find that pencil and paper is the best programming tool. It's massively easier to iterate on types and arrows between them than it is to pluck away against and refactor actual implementations.
It also does some nice things from a pragmatic perspective. It's true that computation expressions are nerfed monads, but they're done in a way that makes unfamiliar code easier to read. I find the tradeoff to be a net gain for the teamwork story. And, while pattern matching is everywhere these days, I still think F# wears it best.
1. Have you tried using JetBrain's Rider IDE for that and, if so, how deficient your experience was when compared to using Rider for C# development? If, alternatively, you have used VS Code for F# development, how much support is there - generally and when compared to Rider - in terms of both language features and external frameworks/libraries (Fable, etc.)?
2. Could you quantify both quality and productivity gains from developing a complex system in F# versus developing it in C#?
1. As part of my job I flip between C# and F# often and with each new release of Rider the IDE-support gap between them is closing. Obviously C# has many more years of attention and work on its tooling, but there are very few things I yearn for when editing F# code nowadays. I also find Rider far better to use than VS Code for F#, simply because I’m so comfortable with JetBrains’s IDEs now.
2. Any time I have to model anything remotely complex in C# I always wish I was doing it in F# instead. Features like discriminated unions, exhaustive pattern matching and immutability-by-default immediately spring to mind.
I would love to see that talk.
Tthat paper talks about bringing ideas from Haskell to C# and Visual Basic (!).
Looks like his nephews/nieces are verboten from using the site.
I prefer F# for larger projects because it makes a bunch of pragmatic compromises. IMHO languages which a singular vision (Scheme, Smalltalk, Haskell) are great for learning and expanding your mind, but when it comes to larger real-world projects, dogmatism just gets in the way.
While he covers many topics, and almost all of F#, I think the way he uses the language to model a domain is what stands out as something that could really be of use in many real world applications.
Just looking at my own pet project of yatzy that I implemented in F# in a day, I used discriminated unions and enums to model all of it.
As a separate note, I find F# to be a breath of fresh air as a language, I only wish it was more widely used professionally.
The list of companies using it is few and far between similar to when people ask where lisp or scheme is used in the real world and everyone references Jane Street and Hacker News as the only two examples.
I've had fun writing a little bit of F# on my own for some personal projects using Fable to transpile it to Javascript. It can be difficult to get good with a language when you don't use it profesionally 8 hours a day 5 days a week.
Hard to convince a manager to allow for a new language in a project (it was difficult enought to get approval for TypeScript on top of Javascript to begin with).
If this sounds like something you’d be interested in, please reach out to me at: im (at) saul.re
I regularly see functional programming get voted to the top, but never any practical applications of such.
Anyway, I just sat in a Mathematical Planning seminar with a guy from Quicken Loans who uses F# in production at work (Matthew Crews). He is also an author behind the Flips F# library.
A quick list of F# libs for real world, everyday uses:
* Pulumi / Farmer - code as infrastructure
* FAKE - build tool
* Fable - javascript transpiler
* Feliz - react elements
* FSharp.Data - parsing csvs, html pages
* Http.fs - making http calls
I've been using F# to parse CSVs at work and using result types and a ton of F# active patterns.
https://www.cnbc.com/2020/05/19/walmart-winds-down-jetcom-fo...
Microsoft will never charge for usage of .NET simply because that's not their business model which relies on mainstream adoption, previously it was to spur sales of Windows Desktop, Servers & their Infrastructure software but now with Azure they're happy for it to have ubiquitous adoption on Linux or Windows servers as well.
However, this isn't something I'm really concerned about. I think there's practically nil chance something like that would ever happen.
This creeped me out just enough that I haven't played with it. Microsoft has changed a lot but downloading Linux binaries from them is still just a bit too much.
https://github.com/dotnet/fsharp#contributing
They even have a Visual Studio Online quickstart which provisions the build environment with all necessary dependencies:
https://github.com/dotnet/fsharp#visual-studio-online-quicks...
Where the build environment wouldn't be running on your machine.
Even compiling the compiler and then use that compiler to compile your code doesn't help, because the first compiler that was compiled by someone's else might tamper the resulting compiler binary.
So why are you still looking for issues when there's solutions avoiding their stated objection?
> Even compiling the compiler and then use that compiler to compile your code doesn't help
So what's the threat model now? that MS will risk their reputation, established business models and subject themselves to liability to poison the bootstrapped compiler to detect when a modified F# compiler is being built so they can inject vulnerabilities into all new modified F# compilers ensuring they're similarly poisoned whilst avoiding detection from easily disassembled byte code (that can be crossed checked against its original source), Does that sound plausible?
For a long time the F# community criticized Microsoft for their lackluster tooling support in VS where it was treated like a 2nd class citizen, but that's less of an issue now that a lot of devs are developing F# with cross-platform IDEs like VS Code and JetBrains Rider.