News for hackers. Stuff that matters.
Re:The Current State of Clojure's Machine Learning Ecosystem by nextos on Sunday April 07, 2024 @03:44PM (#39963236)
I would not say it is such a small niche. There are job openings here and there. It is much easier to find a Clojure job than a F# or a Haskell job in my experience. This may be of course different depending on your location.

The problem is that an entire ecosystem is more than just a new language. Clojure has some really interesting libraries, but the rest relies on Java. It is a good ecosystem nonetheless. Julia is having the same issue. It has grown a very respectable ecosystem, but it is hard to grow further to catch up with Python in some fronts without massive corporate funding.

It is interesting to note that, at some point circa 2010, it looked like Clojure could revive Lisp-Stat with Incanter. But, eventually, the project declined in popularity and died. Reaching mainstream relies on getting a critical mass of developers at the right time and for the right domain.

Re:The Current State of Clojure's Machine Learning Ecosystem by bachmeier on Sunday April 07, 2024 @04:18PM (#39963532)
> at some point circa 2010, it looked like Clojure could revive Lisp-Stat with Incanter

I think there was hope that would happen, but Incanter simply didn't have the functionality or documentation needed to become a player in that space in 2010. It was a doomed effort because of the (intentional) difficulty of native interoperability on the JVM. They'd have had to rewrite tens of millions of lines of code to realize their goals.

Re:The Current State of Clojure's Machine Learning Ecosystem by actionfromafar on Sunday April 07, 2024 @03:56PM (#39963339)
And imagine if F# had an alternative native "runtime" (i.e. not married CLR and dotnet) grafted onto Fortran. Resistance is futile, indeed.
Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Sunday April 07, 2024 @06:14PM (#39964431)
I don't even care about the runtime, imagine if F# devs made anything that wasn't on top of Asp.net. The small community coupled with breaking changes from Asp.net leads to a lot of issues, and the interop story of F#/C# and Clojure/Java is night and day

I like Asp.net, but the thing I've run into several times in F# is there are breaking changes in libraries that the developers of F# can't keep up with.

- Giraffe doesn't support swagger docs, you have to use Asp.net directly, because the swagger generation isn't compatible with the way Giraffe does routing

- Microsoft Identity uses EF core by default. The EFcore.FSharp library doesn't support past .NET 6. You could use your own backend, but at this point, it's easier to just use C# interop

You could use C# for the routing of your app and F# for the business logic. But then there's the C#/F# interop story. Lots of little finicky type differences you have to convert. Whereas using Java from Clojure feels easy and natural to me.

And even if you use Asp.net directly and do interop correctly, you're basically using C# at that point. You're missing a lot of benefits of a functional language. It's not worth it in my opinion, even though F# is a wonderful language to me.

It's tough to learn the ecosystem in Clojure. But once you do, I've found the "small libraries" approach much better than the whole ecosystem tying itself to one web framework it can't even keep up with.

Re:The Current State of Clojure's Machine Learning Ecosystem by throw868788 on Sunday April 07, 2024 @07:37PM (#39964886)
Its funny because I've found the opposite; the fact that the smaller community (and lets face it - most FP langs have a much smaller community than needed to get the scale you are after) the more it needs to piggy back on the army of engineers in the mainstream language target and stick to only its value add as a technology. There were web frameworks in F# that were written from scratch, but fundamentally ASP.NET is quite good and fast enough at least from my evaluations and these frameworks are now out of favor.

I personally don't have much issues using ASP.NET directly from F# (don't bother with Giraffe or anything like that); its not too hard. The routing layer is only a few classes/functions anyway - it isn't the majority of your program. I guess maybe I'm in a different position to you - I find for the few bits of ASP.NET config it isn't worth switching to C#. A few rules you need to follow but I would say that is a lot less than the Clojure learning curve and you get static typing still - that is just my opinion however.

My experience is that both languages have their pros/cons and tbh both have their challenges w.r.t adoption. My personal view is most of these challenges are not technical. The issues we complain about with the language as developers are IMO minor (i.e. things are still possible or decent compared to some other languages) and probably aren't the major factor in the wide scale technology choice away from FP in general.

For better or worse developers are often "languages takers" not "language deciders" in most big shops and this is where most of the jobs are - its only in niche elements/problem spaces (i.e small shops, dedicated niche teams, etc) where niche technologies can be worth it. This means not a lot of jobs; but when there is a job it can be higher paying. Big employers drive the market for technologies though when it comes to large scale usage and they want commodity fungible developers (i.e. resources), and are happy using a mediocre tech that gets the job done to do it. Unless there is a "killer app" where the language must be used to unlock the value most managements will stay clear of better tech - predictable, boring, commodity tech that I can get anyone in for (contractor, offshore person, etc) wins for them every time especially for the MBA/product manager/etc types. In the current economic climate developers are trying to meet the jobs that are being advertised as well (higher interest rates, less startup's, etc etc).

Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Sunday April 07, 2024 @07:52PM (#39964971)
For me it's not that using Asp.net from F# is bad, but the little things that add up.

Like I said, if you want to use Microsoft Identity, you need to either write your own backend that doesn't use EFcore or use .NET 6 instead of 8. Why? EFcore is essentially a scaffolding library. You can't use it from F# without EFcore.FSharp. EFCore.FSharp doesn't support anything higher than .NET 6.

So now we have a scenario where the main auth library in asp.net doesn't work in F#. I've never had these issues in Clojure where I just flat out can't use a Java library.

Re:The Current State of Clojure's Machine Learning Ecosystem by neonsunset on Sunday April 07, 2024 @08:27PM (#39965144)
Have you looked into whether the maintainers of EFCore.FSharp look for assistance?

It seems there is work in progress on bringing .NET 8 support here https://github.com/efcore/EFCore.FSharp/pull/162

Re:The Current State of Clojure's Machine Learning Ecosystem by banashark on Monday April 08, 2024 @01:18AM (#39966421)
I understand where you're coming from on these 100%, but I believe some of the conclusions might be more dire than they are in practice.

Both identity and efcore both work fine with F#. What _doesn't_ work is the EF Core design-time support (having models auto-create your schema) and scaffolding razor pages with F# (razor pages just doesn't work in general).

Calling these APIs (authing your users, and interacting with the database) work fine.

I've used mostly database-first design, and tweaked the stock identity pages code anyways so these things haven't affected me a ton (though I _would_ like to use razor pages, since it seems nice and simple for the 80% use-case).

Re:The Current State of Clojure's Machine Learning Ecosystem by neonsunset on Monday April 08, 2024 @07:36AM (#39968655)
The temptation to whine, cry and complain is too high in developer communities, as always.

It's either "just the way I want it exactly" or "unusable", any smallest and most accessible but slightly different option from preferred way to make things work be damned.

I'm really sad to see a part of F# community being persistently vocal against .NET which makes F# viable and possible in the first place.

Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Monday April 08, 2024 @09:46AM (#39969674)
That's an extremely uncharitable take of my comment. I wouldn't call the many days I've spent investigating and opening issues that the F# community didn't even know about (because it's on life support) to be whining about small things. I can't tell you how many times things just don't work and the community kinda shrugs it off and says "use C#".

If you look in the database section of F# websites, maybe 20% of those libraries work. If you bring it up to people online, they'll say "yeah use Dapper, it's the only thing that works".

This just isn't the case in Clojure and I don't think the expectation is that it should be.

Re:The Current State of Clojure's Machine Learning Ecosystem by banashark on Monday April 08, 2024 @01:07PM (#39971704)
I'm happy with how usable F# is as the moment, though it's not hard to sympathize with the sentiments that get thrown around.

F# has had a good run with a lot of open-source efforts in different domains, but as some core parts of the domain evolve (asp.net), if there are changes made which make it more complicated or prohibitive to use F# (t4 templates, roslyn analyzers, custom code-behind behavior), it can seem like F# is on-track to become deprecated by the moving-target that is it's native platform tooling.

I don't have much of a doomer mindset about things, since from the evidence of the F# team's priorities, it's keeping up with CLR and C# specific features (check the F# releases for how many features are compatibility-focused) while also delivering on some very cool F# specific things (SRTP, nested record copy/update, etc).

Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Monday April 08, 2024 @09:51AM (#39969719)
But EFcore and Identity are documented assuming you'll use scaffolding. They set up a bunch of models for you representing users and roles. You wouldn't know how to set this up if you tried to do it in F#. You'd have to set it up in C# first to see what it would look like, and then you might as well just use C#
Re:The Current State of Clojure's Machine Learning Ecosystem by banashark on Monday April 08, 2024 @12:57PM (#39971611)
Agreed on most of this except for the takeaway (seems to be a theme haha).

In the end, I still ended up using F#, since it was only about 30 minutes of copy/pasting the classes/etc over once, and for the rest of the time in development I got to stay in F# land.

To be explicit, I did do what you say here. I scaffolded things out in C#, then just copied/translated that over to F# calls. All the APIs still work just fine.

Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Monday April 08, 2024 @06:29PM (#39974398)
Thanks for responding, glad it's working for you. F# is a very cool language
Re:The Current State of Clojure's Machine Learning Ecosystem by Capricorn2481 on Thursday April 11, 2024 @08:59PM (#40008427)
I'm still a little confused on your answer to this. C# generated a big `BuildTargetModel` method on each generated migration, even if there are no changes. Are you changing this to an F# file every time? On every migration?
Re:The Current State of Clojure's Machine Learning Ecosystem by pjmlp on Monday April 08, 2024 @03:10AM (#39967029)
What you describe is a very good example, why I seldom rely on guest languages for production code.

Communities can't control themselves, always try to create an ecosystem on top of the ecosystem, some of them even are quite vocal against the platform that made their beloved language possible in first places.

Thus as the platform moves under their feet, everyone fails to keep up, to make anything usable one has to master now two stacks instead of one, and spend even more time tracking down issues.

Clojure's approach to embrace the host is a much better way to handle this.

Re:The Current State of Clojure's Machine Learning Ecosystem by fire_lake on Monday April 08, 2024 @03:10AM (#39967030)
Suave does not depend on Asp.net
Re:The Current State of Clojure's Machine Learning Ecosystem by icey on Sunday April 07, 2024 @10:29PM (#39965716)
Isn’t this effectively OCaml? Minus the Fortran part but it doesn’t need any other runtime.
Re:The Current State of Clojure's Machine Learning Ecosystem by actionfromafar on Monday April 08, 2024 @05:13AM (#39967754)
Sort of I guess, but there are things like how they look very different and that F# is very very fast, has static types and OCaml is not exactly slow but not fast exactly fast, either.
Re:The Current State of Clojure's Machine Learning Ecosystem by throw868788 on Sunday April 07, 2024 @07:16PM (#39964789)
I do think this depends on region, as I've seen F# and Scala jobs typically outnumber Clojure for example depending on whether it is a .NET or Java shop. Mileage does vary.

However to be honest anecdotally I do think even if they aren't going down in user terms, FP languages are losing percentage market share. From my personal experience FP is no longer new; the hype of FP in general has died down. The hype has moved onto other things over the years (e.g. AI, blockchain, bare metal technologies that enable the above, etc etc).

I'm not saying FP doesn't have a lot of value. I enjoy, particularly when the program calls for it, FP languages like F#, Scala, etc. They still offer a lot of value IMO for all the usual spouted reasons.

IMO I just think the hype has moved from technologies that do things better (i.e. more efficient, less error prone, makes my job easier, etc) to technologies that do shiny new things. There are a lot of reasons for this, many of them aren't in fact technical but economic and political (e.g. management). Things like less jobs globally in tech (meaning my skills need to have wider reach), demand for specialist roles that aren't as language focused, etc play a part. Mainstream languages taking FP features as well makes the return vs risk of using a FP language even worse of a tradeoff - there's less perceived return for changing stack than before.