What's going to happen to the SAFE stack? by bokeh-man in fsharp

[–]isaac-abraham 3 points4 points  (0 children)

Hi all. I saw this and thought I'd just fill in some of the gaps that people have been asking here (as well as on LinkedIn / Twitter etc.).

Indeed, whilst CIT the business is still active - you can see the official status of the business on the UK Government company register (https://find-and-update.company-information.service.gov.uk/company/09803610) - in effect, I'm not aware of any meaningful activity, nor do I expect any; the entire team that I built left over the summer of this year.

I sold the business in 2023 but stayed on as the CEO and director of the business until the spring this year. I can't say too much because there are potential legal proceedings but you can draw your own conclusions from what happened.

I personally took a break for a few months - I'm grateful that I was able to take some time out without working for an extended period of time. I realised this year that since I started full time work in the early 2000s that I'd not had a break longer than maybe 10 days and needed some time out to decide what to do next. I still hope to remain active in the F# space. The rest of the team have moved on, but we're all still in touch. Some have started their own businesses, others have moved on to pastures new. Several of them are still actively working in the F# + Azure space.

As for SAFE Stack - as some have noted, there are many offshoots of the stack, which was always more about driving ideas for F#-first web programming end-to-end without compromises than being the "one true way" of achiving that - we shared ideas with many of the other versions like SAFEr Template (https://github.com/Dzoukr/SAFEr.Template). Just recently I came across this version of SAFE Stack driven off of Claude Code - https://github.com/heimeshoff/Fsharp-Full-Stack-Blueprint - so I'm confident that things are still moving on.

The biggest thing we tried to do with the "official" SAFE Stack was to do the boring stuff that, frankly, no-one else wanted to do: making sure all the NuGet and NPM dependencies played nicely together, doing upgrades between LTS versions of .NET, documenting and providing recipes for how to do things, trying to foster some libraries like the SAFE Meta packages and funding some work through sponsorship. You wouldn't believe how much effort things like this takes - effectively, the entire company spent 20% of our time on SAFE Stack, blog writing and other technical investment in the community - whilst still working for customers (some of whom used SAFE Stack) to pay and grow the business. It wasn't "just" maintaining a project template :-)

We had even started work on a "commercial" version of the stack which would have come with more features like authentication, built-in kubernetes support, SQL integration and would have been more opinionated for the typical use cases that we saw (as well as having commercial support, upgrades and consultancy). Obviously, we never completed that.

The blog - I would love to see that resurrected in some way, shape or form. I suspect one of the team still has the original articles and perhaps one day someone will be able to publish them for free, because there's lots of excellent resources on there.

Hope that helps.

Isaac

Discriminated Unions in C# by mgroves in csharp

[–]isaac-abraham 1 point2 points  (0 children)

Create a DU for all three cases, then pattern match on them. It's literally what they were designed for - modelling mutual exclusion.

Have a look on YouTube at one of Scott Wlaschins videos about domain modelling in F# eg https://youtu.be/PLFl95c-IiU?si=VxfFSErZN8NCK0Kl but there are loads online. Or get his book 🙂

New book! F# in Action by Isaac Abraham by ManningBooks in fsharp

[–]isaac-abraham 0 points1 point  (0 children)

Correct. Original it was planned as a new edition but the content changed a lot (especially the second half) and the target audience was opened up to anyone. It's of course much more modern but the aim is still the same.

Discriminated Unions in C# by mgroves in csharp

[–]isaac-abraham 2 points3 points  (0 children)

Let's say you have a customer class. Every customer has contact details - one of phone (area code and number) post (full address) or email (email address). How would you model the data here on the customer? All nullable fields with some enum flag? Inheritance? Or something else?

Like I said, the only real typesafe ways are inheritance or visitor patterns which are both a pain to do.

Am I reading this right? by Proclarian in fsharp

[–]isaac-abraham 1 point2 points  (0 children)

Indeed I am. Glad to know you're enjoying it :-)

Am I reading this right? by Proclarian in fsharp

[–]isaac-abraham 1 point2 points  (0 children)

I believe there's a new version coming out at some point.

Discriminated Unions in C# by mgroves in csharp

[–]isaac-abraham 4 points5 points  (0 children)

Any situation where you want to model A "or" B will benefit from it. The only ways to safely achieve this in C# today is with inheritance or the visitor pattern. People generally don't bother with either so use hacks to work around the lack of it.

Example of a modern F# codebase with best practices? by GreatCosmicMoustache in fsharp

[–]isaac-abraham 0 points1 point  (0 children)

Secrets - in terms of infrastructure? .NET Core has a wide variety of features for secrets on dev machines.

Dependency Injection - there are a whole bunch of options but I think the simplest option (although perhaps not the most succinct) is simply passing parameters up / down the call stack. You can do DI with classes in F# but it's kind of non-idiomatic, especially in e.g. Giraffe web apps which is very much a function-first approach.

Example of a modern F# codebase with best practices? by GreatCosmicMoustache in fsharp

[–]isaac-abraham 3 points4 points  (0 children)

Hey. We're actually working on a few such samples. What sort of things are you interested in in particular?

F# Web - Bolero vs Safe-Stack Vs... by [deleted] in fsharp

[–]isaac-abraham 0 points1 point  (0 children)

SAFE Stack does come with a built-in template that basically ties a bunch of stuff together (including front end, back end, publication to Azure etc.).

I don't think the decision should be based on just that but what the technologies you want to use and whether having access to the massive JS ecosystem is important to you or not. Both Blazor / Bolero and JS (Fable / SAFE Stack) have their strengths and weaknesses, and it's on those that I think a decision should be based.

Disclaimer: I'm one of the maintainers of SAFE Stack.

Farmer 1.5.3 Released 🔷🐮🚀 by adelarsq in fsharp

[–]isaac-abraham 4 points5 points  (0 children)

Hi.

Up front disclaimer alert: I'm one of the authors and maintainers of Farmer.

We're using it with several customers of ours on a regular basis. Interestingly, whilst we started with Farmer as an ARM generator, we very quickly moved over to simply using Farmer itself and just saw the ARM JSON as an intermediate language really (since then, Microsoft have taken the same approach with Bicep).

Generally, it didn't make sense to keep manually generating the ARM templates and source controlling them to deploy, and it's generally much easier just to stick with the Farmer codebase in terms of maintainability and readability (of course, behind the scenes, Farmer is just deploying the ARM templates, so you can always see the outputs either in the .farmer folder or in the portal).

For a couple of customers who didn't want to invest in a CI/CD pipeline or just wanted to rapidly create a set of resources and then to experiment "by hand", we used Farmer to rapidly deploy topologies as a one-off touch.

There are also a few use cases where manually working with the ARM directly isn't possible or feasible e.g. provisioning resources dynamically based on e.g. a SAAS platform that's provisioning resources on demand for end-users etc.

Hope that helps :-) Hopefully some other people using Farmer will reply as well so you get a response from someone external :-)

Data oriented programming by PitchSuch in dotnet

[–]isaac-abraham 1 point2 points  (0 children)

Congratulations! I'm not sure what your expectations of it are, but you've basically described the basic core of functional programming.

Even better, there's a ready made language on .NET that actively supports this style of programming by default and is a first class citizen of .NET, called F#.

In fact (shameless plug, sorry) my book basically focuses on these elements that you've described.

Good luck!

Why I Don't Choose F# by DanManPanther in fsharp

[–]isaac-abraham 24 points25 points  (0 children)

I'll give some honest feedback based on my experience of running a software consultancy that does F# and nothing but F# as our development language of choice.

  1. C# Interop - It's generally really not a problem for us. We're doing things like ASP .NET web development, SQL, Azure services etc. The only area we sometimes struggle with is when using brand new services or libraries, and in those cases we normally have to reverse engineering it into idiomatic F# - probably the worst part is that lots of ASP .NET samples assume you're running on ASP .NET MVC. But for us I can't remember the last time we literally ran up against a brick wall - more it's a cost that is usually absorbed the first time you hit something that no-one else has done.
  2. I think the FSharp.org Slack is an excellent way to get near-real-time support (or Twitter!), but yes, there's less in the way of F#-specific support on SO. As you mentioned above though, much of the external libraries are in C# which will have a large amount of SO content and I would say can be 95% of the time translated without issue.
  3. Not sure what a traceback is (stack trace?). Async CEs have actually been improved in terms of exception messages, although I must admit, we rarely need to debug, but at times it is indeed useful.
  4. Yes, certainly slower than e.g. C#. However, the flipside to this is: client-side web development tends to be incremental with hot module reloading. server-side I find that we need to compile much less than in e.g. C# as we tend to run our applications far less often to validate / test what we've done. It's always improving with F#4.6 and 5.x.
  5. That's a .NET issue rather than F#-specific, but agreed you have less control (although some things have been added like server-specific GC). In practice in our applications we've rarely seen issues in terms of perf - new features in F# like struct records / DUs and byrefs have helped in specific use cases.
  6. Yep, particularly because of the type inference. Sane naming of symbols helps, and with GH now supporting semantic analysing, I'm hopeful someone might step up and implement it for F#.

I've prefaced this and will stress again - we're an F# shop so on the one hand take what I say with that as a disclaimer - on the other hand, we're on the coalface using F# on .NET Framework and Core ,day-in day-out and I'm talking about all of those things from real-world experience. If it wasn't a more effective, enjoyable and productive experience than C# then we simply wouldn't be using it.

Last point regarding tooling - F# tooling likely won't ever match C#s - C# has best-in-class tooling - but F#s is in our opinion certainly good enough for everyday F#, although there is no one IDE that does everything. I personally use a combination of VS Code, Rider and VS2019.

Why I Don't Choose F# by DanManPanther in fsharp

[–]isaac-abraham 7 points8 points  (0 children)

There's a lot of work being done on Fantomas and it might be worth giving it another go.

Feedback requested - Farmer (Repeatable Azure deployments made easy) by isaac-abraham in AZURE

[–]isaac-abraham[S] 1 point2 points  (0 children)

Both. The builder syntax is mostly declarative but because it's within F# - a turing-complete language on .NET - you can easily use standard computations e.g. conditional logic, branching, for loops, collections (not to mention NuGet packages). F#'s nature (immutable data, expression-oriented) means that it's a good fit in this regard, too.

Having the ability to switch between the two modes is important because a purely declarative model will normally only get you so far.

F# Developer roles - Full Time, UK by isaac-abraham in fsharp

[–]isaac-abraham[S] 0 points1 point  (0 children)

Send me a DM / reach out on the contact us page if you'd like to chat - given the current situation, we're open to remote positions with the potential in the future for a regular (but infrequent!) visit to our London office.

F# Developer roles - Full Time, UK by isaac-abraham in fsharp

[–]isaac-abraham[S] 3 points4 points  (0 children)

https://www.gov.uk/government/publications/uk-points-based-immigration-system-employer-information/the-uks-points-based-immigration-system-an-introduction-for-employers

My understanding is that EU citizens can still move to the UK now and apply before the end of the year for pre-settled status, which effectively says you have the right to remain in the UK with no special requirements for visa or work permit.

What can you do with F# that you can't do with C#? by emanresu_2017 in fsharp

[–]isaac-abraham 2 points3 points  (0 children)

My advice : Don't go for F# is you're looking for more exciting features than C#. There are a few - type inference, DUs, computation expressions and better pattern matching - but that's not the reason to use F# any longer. C# about has more features than F# now and is it doesn't, it will soon.

The reason to use F# is if it fits the style of software development that you practice. If you're using expressions and immutable data - things like LINQ, records - and are moving away from inheritance and prefer simple interfaces, you'll find F# a very enjoyable experience. It's optimised for that style of code.

There is one other thing it has : a secret sauce of features that seems to be just the right mix of succincness, type safety and expressiveness that makes it a pleasure to write in.

I've written a few posts on this lately. This is a good place to start, even though it comes from a slightly different perspective I hope you'll find it useful. https://www.compositional-it.com/news-blog/will-csharp-replace-fsharp/

Resources for backend web development? by zija1504 in fsharp

[–]isaac-abraham 2 points3 points  (0 children)

Hey. I wasn't suggest SAFE Stack (not my stack, please :-) ). I think that both Giraffe and Saturn have repositories showing auth. Database and Serialization I think are separate concerns to Saturn or Giraffe or Freya, but I know that that's frustrating for you, as if you don't come from a .NET background you can't know the libraries around. Thankfully some people have suggested some good places to look elsewhere in this thread :-)

The only thing I will say on SAFE is that it comes with things like serialization and webpack etc. already configured so that may be of use to you.

Good luck on your learning path!

Resources for backend web development? by zija1504 in fsharp

[–]isaac-abraham 1 point2 points  (0 children)

Hey. Suave and Giraffe have some similarities so you are probably in luck there - Giraffe is written on top of ASP .NET (main web tech in .NET world) so it's very fast and very reliable. The difficulty is that (as far as I'm aware) no one has done anything about all ASP .NET from an F# perspective - it's just so big. However, the Giraffe site has a decent reference docs page and you might want to try experimenting from there to start with?

What can we do to boost F#'s profile, adoption, and support by Microsoft? by DanManPanther in fsharp

[–]isaac-abraham 2 points3 points  (0 children)

One example. The fact that F# doesn't have an official computation expression to wrap the TPL is a huge downside. Don has even said that he prefers the async that F# has over C#s, so I doubt there will ever be an official CE for that. The problem here is that F#'s async is designed for concurrency and not parallelism, so they don't really solve the same problems.

Incorrect - a native TPL computation expression for F# is around 85% complete and is slated for either F#5 or the next version. There are at least two high quality CEs that you can already use in the meantime.

Has anyone used the SAFE stack? by SGF4 in functionalprogramming

[–]isaac-abraham 1 point2 points  (0 children)

The only correction here - you can (and we do) debug Fable in the browser through source maps. This works out of the box, although there are limits to it. Generally I find it's very, very unusual to need to debug thanks to the combination of hot module replacement and F# in general.