TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why F#?

447 点作者 bozhidar大约 2 个月前

47 条评论

raphinou大约 2 个月前
F# was for me the best functional language when I looked at rewriting a Ruby on Rails app. I wanted to go with a functional language, as it seems to better fit my thinking and reasoning, and I looked at Haskell, Ocaml, Scala, F#.<p>Being a stranger to Microsoft technologies, F# was the least likely to be chosen, but easily became the first choice. Haskell&#x27;s purity made it hard to adopt (for me), Ocaml&#x27;s ecosystem is subpar (there wasn&#x27;t even a clear choice for a library to interact with postgresql, I couldn&#x27;t install the latest version due to its reliance on an obscure tool whose name I forgot and didn&#x27;t get help on the forum), and Scala is seems complex....<p>F# was surprisingly easy to get started with. The community is mis-managed by a corporate-minded approach (requiring people to become member of the F# software foundation to get access to the official slack!), but its members are friendly, smart and ready to help. The ecosystem is great with access to all the dotnet libraries (some complain there&#x27;s a mismatch as most of those are developed for use with C#, but I rarely got in trouble for using them).<p>There are also great libs and frameworks available. Like <a href="https:&#x2F;&#x2F;github.com&#x2F;SchlenkR&#x2F;FsHttp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SchlenkR&#x2F;FsHttp</a> to easily interact with http servers, to the point that I find it easier to use than a dedicated library. Or <a href="https:&#x2F;&#x2F;github.com&#x2F;CaptnCodr&#x2F;Fli" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;CaptnCodr&#x2F;Fli</a> , to run commands. And last but not least, <a href="https:&#x2F;&#x2F;www.websharper.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.websharper.com&#x2F;</a> is the best web framework I have encountered across all ecosystems. Their reactive approach to web ui really allows me to develop complex interfaces in a maintainable way.<p>This became a longer message than I thought, probably due to my enthousiasm for the language. For complete transparency, the situation is not perfect, and in my experience the tooling is not the best.<p>If you want more info, I blogged about it a couple of months ago: <a href="https:&#x2F;&#x2F;www.asfaload.com&#x2F;blog&#x2F;consider-fsharp&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.asfaload.com&#x2F;blog&#x2F;consider-fsharp&#x2F;</a>
评论 #43549735 未加载
评论 #43547982 未加载
评论 #43548045 未加载
评论 #43548126 未加载
评论 #43547792 未加载
rockyj大约 2 个月前
I did try F#, but I was new to .NET ecosystem. For 1 &quot;hello world&quot; I was quite surprised by how many project files and boilerplate was generated by .NET, which put me off.<p>I am all for FP, immutable, and modern languages. But then where are the jobs and which companies care if you write good code?<p>Now everyone wants languages which are easy to use with AI, while reducing workforce and &quot;increased productivity&quot;. I have been programming for 20 years and know 4-5 languages, in India it was worse but in EU at-least I can make a sustainable living by writing Java &#x2F; TypeScript. I cannot even find jobs with Kotlin + TypeScript which pay well, forget getting jobs in Elixir &#x2F; Clojure &#x2F; F# (there maybe a handful of opportunities if I will relocate for around 70K&#x2F;year). That is why I have mostly given up on learning niche languages.
评论 #43547274 未加载
评论 #43546914 未加载
评论 #43547691 未加载
评论 #43546522 未加载
评论 #43546648 未加载
评论 #43548828 未加载
评论 #43547243 未加载
评论 #43546918 未加载
评论 #43546449 未加载
评论 #43553311 未加载
评论 #43546629 未加载
darksaints大约 2 个月前
I&#x27;m completely convinced that F# (along with Scala, Haskell, and OCaml) adoption has stalled due to having ridiculously bad build systems. More significantly, they are being passed up in favor of Rust, which is a great language but nonetheless a bad fit for a lot of problem domains, simply because Rust has a superior build system. Hell, 80% of the reason I choose Rust over C++ for embedded work is because of the build system.<p>It baffles me that there are languages with non-profit foundations and are financially backed by multiple corporations which still have bad build systems. It is the most important investment you can make into a programming language.
评论 #43552671 未加载
评论 #43559547 未加载
评论 #43555737 未加载
评论 #43551301 未加载
评论 #43554790 未加载
评论 #43556392 未加载
评论 #43554888 未加载
pimbrouwers大约 2 个月前
Our shop converted 6 years ago, from C# to exclusively F#. I also author and maintain some packages (falco, donald, validus and others). The language is tough to learn if you&#x27;re coming from a C-style language. But worth the effort and experience. It&#x27;s extremely concise a true delight to build programs in that are fast, robust and durable.<p>There are a few drawbacks, depending on your perspective:<p>- compilation is slower than c# and hot reload isn&#x27;t supported (it&#x27;s in progress)<p>- there are very few opportunities to use it professionally<p>- hiring devs can be challenging
评论 #43548900 未加载
评论 #43546760 未加载
评论 #43546728 未加载
评论 #43554801 未加载
评论 #43552429 未加载
lihaoyi大约 2 个月前
I learned F# in 2013 and had a lot of fun with it, some of that code remains on Github (e.g. a 2D platformer game for windows <a href="https:&#x2F;&#x2F;github.com&#x2F;lihaoyi&#x2F;FSharpMetro&#x2F;tree&#x2F;master&#x2F;Application" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lihaoyi&#x2F;FSharpMetro&#x2F;tree&#x2F;master&#x2F;Applicati...</a>).<p>My experience was that it was a surprisingly nice language with a surprisingly warty user experience: papercuts ranging from naming conventions and function call styles (`|&gt; List.map` vs `.Select`), basic syntax (`foo.[0]` to lookup arrays), type system features (F# doesn&#x27;t have covariance&#x2F;contravariance even though C# does), IDE support (back then was only Visual Studio, whose support for F# was inferior to C#).<p>Ended up settling on Scala after that, as a language with its own Warts, but one that somehow managed to feel a more cohesive than F# did despite having largely the same featureset and positioning.<p>F# was my first functional language and one that changed how I look at programming, but at the same time I&#x27;m happy to not actually have to use it for serious programming!
评论 #43546364 未加载
评论 #43548252 未加载
评论 #43546571 未加载
评论 #43546652 未加载
评论 #43553300 未加载
eknkc大约 2 个月前
As far as I can tell F# is one of those things where every single user is extremely happy. This happens rarely and I really am curious about the thing but never had time to get into it. I&#x27;m also pretty well versed in the .net ecosystem so it&#x27;s probably gonna be easy.<p>Any tips? What kind of workflows might benefit the most if I were to incorporate it (to learn..)?
评论 #43546333 未加载
评论 #43546241 未加载
评论 #43548384 未加载
评论 #43546205 未加载
reverseblade2大约 2 个月前
Here&#x27;s a Saas that actually makes money written fully in F#<p><a href="https:&#x2F;&#x2F;3dpack.ing" rel="nofollow">https:&#x2F;&#x2F;3dpack.ing</a><p>Here&#x27;s a rust ray tracer compiled to web assembly written in F#<p><a href="https:&#x2F;&#x2F;ncave.github.io&#x2F;fable-raytracer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ncave.github.io&#x2F;fable-raytracer&#x2F;</a><p>source: <a href="https:&#x2F;&#x2F;github.com&#x2F;ncave&#x2F;fable-raytracer?tab=readme-ov-file" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ncave&#x2F;fable-raytracer?tab=readme-ov-file</a>
评论 #43548413 未加载
7thaccount大约 2 个月前
F# is beautiful, but I could never crack the nut and get fluent in it. I think the big problem is I only know a little C#, so it is difficult to figure out the object oriented methods that F# depends on. It was the same thing with Clojure and Scala for the JVM. I have zero interest in first learning C# or Java, just to use those platforms.
评论 #43546786 未加载
评论 #43546337 未加载
kingkongjaffa大约 2 个月前
F# is great<p>Even if you never write a single line, it’s a fantastic illustrative language.<p>For example I refer to <a href="https:&#x2F;&#x2F;fsharpforfunandprofit.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fsharpforfunandprofit.com&#x2F;</a> all the time for functional programming ideas.
jonsagara大约 2 个月前
The killer feature for me is type providers. I need to read a lot of CSV files of varying formats, and the CSV Type Provider lets me make quick work of them in a type-safe manner.<p><a href="https:&#x2F;&#x2F;fsprojects.github.io&#x2F;FSharp.Data&#x2F;library&#x2F;CsvProvider.html" rel="nofollow">https:&#x2F;&#x2F;fsprojects.github.io&#x2F;FSharp.Data&#x2F;library&#x2F;CsvProvider...</a>
评论 #43558829 未加载
评论 #43552484 未加载
评论 #43548210 未加载
a-french-anon大约 2 个月前
Why would Lispers feel at home with its (whitespace delimited) syntax? Quite the strange claim.<p>I know this isn&#x27;t a common rant, but I hate so-called functional language still bowing to the &quot;infix mathematical operator special case&quot; dogma, when those are just binary (variadic in Lisp) functions.<p>Always found it pretty appealing, otherwise. And no &quot;;;&quot;!
110bpm大约 2 个月前
I put together a quick-start guide to F# Computation Expressions — showing how you can go from C# async&#x2F;await all the way to Result&lt;&gt; workflows with let!... and!... expressions, and even a custom validation {} CE. [0]<p>This is a practical side of F# that doesn’t get enough spotlight — but one I’m using daily.<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42636791">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42636791</a>
评论 #43573352 未加载
protonbob大约 2 个月前
&gt; which is quite odd for what is supposed to be the flagship editor for F#<p>The flagship editor is Visual Studio, not vs code.
评论 #43550328 未加载
评论 #43546414 未加载
protonbob大约 2 个月前
I&#x27;ve found that as C# gains much of the features that F# has and will soon gain more (pattern matching, functions as first class data types, great fp libraries, etc) the &quot;moat&quot; that F# has over C# has gotten smaller. I write most of my c# code in a primarily functional style, but I still have the advantage of using the libraries in their own native ways that follow the examples given by microsoft and other vendors.
评论 #43558100 未加载
评论 #43558726 未加载
shermantanktop大约 2 个月前
&gt; Trivia: F# is the language that made the pipeline operator (|&gt;) popular.<p>I’m not a dabbler in exotic languages, so this definition of “popular” was puzzling. I’ve literally never seen that operator before. Maybe I need to get out more.
评论 #43547773 未加载
评论 #43559469 未加载
GiorgioG大约 2 个月前
As a 20+ year C# developer I’ve tried several times to learn&#x2F;use F#. Despite being interested in FP, my brain is having trouble figuring out how to structure my code in F#. In C# I’d either build a service (or use the mediator pattern) for the domain and a repository for data access. With F# it’s functions all the way down and it feels unnatural (as silly as that may sound).
评论 #43546899 未加载
评论 #43546782 未加载
评论 #43556011 未加载
评论 #43551623 未加载
hurril大约 2 个月前
F# is a wonderful language, one that I write as my daily for the second time during my carrier. It _baffles_ me how it isn&#x27;t more popular than it is because it truly is very very good. And I say this as an experienced and avid functional programmer.<p>We even do the frontend in it using Fable and Elmish, which is to say: we basically write our frontends in Elm, but the platform is .NET.
nickpeterson大约 2 个月前
Because it’s great, and people that think otherwise are dead to me.
评论 #43546305 未加载
评论 #43546162 未加载
评论 #43548281 未加载
mesic大约 2 个月前
F# is getting some traction in Norway. I know for a fact that places such as NRK (BBC eqvivalent), Resoptima, Frende Forsikring and my current employer, REN are all using F#.<p>I just gave a talk about how we use F# at REN: <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;1070647821" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;1070647821</a>
aloisdg大约 2 个月前
F# is corporate friendly ML. Love it.
BenGosub大约 2 个月前
Two nice things about F# are that you can introduce it into an organisation using the dotnet ecosystem and that you can use all libraries in dotnet, which is a huge advantage over OCaml.<p>Otherwise, I am happy with OCaml, but F# has also a place in this world.
评论 #43554144 未加载
aaronmu大约 2 个月前
I&#x27;ve been using F# professionally for the past seven years across different contexts. First in a small software shop and now while bootstrapping a SaaS company. Some observations:<p>* It’s easier to attract smart developers to an F# project than to a [mainstream language] project. This was one of my driving beliefs when I introduced F# seven years ago. <a href="https:&#x2F;&#x2F;www.paulgraham.com&#x2F;pypar.html" rel="nofollow">https:&#x2F;&#x2F;www.paulgraham.com&#x2F;pypar.html</a>. This is probably just as true for languages like Elixir, Clojure, ... But F# is what we went with.<p>Small Software Shop Context<p>* We operated in a small market where customers eventually dictated our tech stack (.NET &amp; React). In that market, F# was a major advantage—it allowed junior developers to build apps that &quot;just worked&quot; with minimal regressions. Even with mediocre code quality, I felt confident that we could refactor safely at any time.<p>* I constantly had to justify F# to clients, which was exhausting. We always delivered decent results, so it worked out, but my partners were never as confident in defending F#.<p>Bootstrapping a SaaS Company<p>* F# has been invaluable for shipping features quickly and taking shortcuts when needed.<p>* Three years in, our codebase is large and contains its fair share of messy parts. But we can still develop new features at high speed with minimal regressions. Refactoring is relatively safe and straightforward.<p>* Compilation speed is the Achilles’ heel. If you don’t monitor it, the compiler slows down to the point where it impacts productivity. Earlier this year, waiting over a minute for feedback after a small change became unbearable. A lot of our &quot;clean-up&quot; work focuses on optimizing compilation times. We&#x27;re still learning, but we’re optimistic that we can restructure the project to significantly improve build performance.<p>EDIT: maybe one more point. I see a lot of C# vs F# popping up here. Yes, C# has all the features that F# has. But do not underestimate how well designed F# is. It is an extremely simple language to learn compared to C#. There is a very limited amount of keywords to learn. And they compose extremely well. If you learned F# 7 years ago, took a break, and came back today, you&#x27;d simply write the same boring code that you would have written 7 years ago. And along the way you&#x27;d find out that some things have gotten a bit nicer over time.
评论 #43548495 未加载
评论 #43548051 未加载
justanotheratom大约 2 个月前
F# was my favorite language, but - You have to chose the language of the Domain that you are working in, e.g, Swift for native iOS Development. Supabase Backend requires TypeScript, etc. - LLMs don&#x27;t care about F#.
systems大约 2 个月前
The problem with F#, Clojure and Elixir (hosted languages)<p>For F# , you need some basic C# knowledge For Clojure, you need some basic Java knowledge For Elixir, you need some basic Erlang knowledge<p>I like all 3 languages but usually each vm have a primary language, and each hosted language eventually become hosted on that primary language not the vm<p>I understand that for many task simple, to medium complexity, you might not need that, but it seem as you try to be more advanced you hit the wall of having to learn you host vm primary language
评论 #43546991 未加载
评论 #43547051 未加载
评论 #43554726 未加载
评论 #43557529 未加载
评论 #43548499 未加载
lysecret大约 2 个月前
I worked a lot in F# and loved it. I love that it has a lot of great functional ideas without being too pedantic about being 100% functional all the time. (You can have mutating state or just call arbitrary C#.) I took a lot of its insights into my daily python code too. I especially love match.
评论 #43550466 未加载
Aldipower大约 2 个月前
&quot;Why the F#?&quot; perhaps would be a better title. :-)
phplovesong大约 2 个月前
Last time i tried F# i got bit by the weird concurrency story. There was async&#x2F;task and somwhow they did not play well together. Also the dev tooling (for vim) was subpar, compared to ocaml (lsp). Compile times also was on the slower side.
评论 #43546681 未加载
评论 #43550617 未加载
FrustratedMonky大约 2 个月前
F# on front page? And popular?<p>ahhh, Its April Fools?<p>JK, I love F#. Please get over the hump and be a big language.
DeathArrow大约 2 个月前
Iove the ideas behind functional programming but I never properly learned a functional programming language. I will probably never have the opportunity to use it professionaly and learning it just for hobby doesn&#x27;t make sense to me.<p>If I am developing something in my spare time I also like to use something I can earn money with so I can hone and maintain my earning skills. Maybe sounds like min maxing.<p>If I would be in a situation where I can develop software just out of pleasure or pure curiosity, I would use just whatever language I deem interesting.
rawoke083600大约 2 个月前
I&#x27;m waiting for the excellent F# Article about railroad-coding to be posted here. Required F#e reading :) No not trolling. Am on mobile and traveling else I would have searched-posted
评论 #43554930 未加载
gwbas1c大约 2 个月前
If you&#x27;ve had C# and F# co-exist in the same codebase, how do they co-exist? Is it like C# and VB.Net where a project (dll) is either C# or VB.Net, and they can reference each other?<p>Or: Is it more like the Swift &#x2F; Objective C ecosystem where Swift, Objective C, and even straight C can co-exist in the same library?<p>In a mixed C# and F# codebase, generally when do you favor C# versus F#?<p>Coming from a C# background, what are the areas where F# is a better language?<p>Any success stories for F#, especially if it co-exists with C#? Any horror stories?
评论 #43546727 未加载
评论 #43546846 未加载
loxs大约 2 个月前
I tried F# some years back when I was searching for a language to port my OCaml project in... It felt too much .NET-y and too much MicroSoft-y. And back then .net for linux had just been released and was somewhat unpolished.<p>It seemed that I had to learn C# in order to use F# properly and it seemed that porting it to C# was the saner option. I went with Rust after all and it seems to have been the right choice.
评论 #43558068 未加载
评论 #43548583 未加载
RKFADU_UOFCCLEL大约 2 个月前
F# is a very well-polished functional language. Think of it to Haskell as C# is to Java. No worries about space leaks or purely-academic syntax or monads (though you can get those if you need them). All with tight integration into one of the biggest, well-established ecosystem (CLI). It&#x27;s managed by smart people who know how to keep it from derailing as it grows.
froggertoaster大约 2 个月前
Coming from a .NET developer - why NOT F#?<p>* Network effect, or lack thereof. Very few people use it. * Its nature is contrary to the ecosystem. The CLR is fundamentally resistant to the paradigms that F# creates.<p>Wonderful little language - one of my favorites - and we owe a lot to it for the great features that C# has. But it just hasn&#x27;t picked up the critical mass it needs.
DeathArrow大约 2 个月前
F# is a lovable language as in people are really enjoying using it vs not being bothered using it.<p>Once every other month a new F# link lands on top page and receives a few hundred of upvotes.<p>I think F# needs and deserves more publicity in order for it to win a larger audience. If only F# community would be half as vocal as Rust community.
ClimaxGravely大约 2 个月前
I work in an industry where F# is a non-starter but I still love to use it outside of work. Also what I learn from F# and functional programming still benefits me in my day job (mostly c++). I think I tend to write a bit safer code after understanding the benefits of a functional language.
twodave大约 2 个月前
In the case of F#, the use cases are diminishing with every new C# release, since C# is getting better and better at the things F# is supposed to be strong at (record types, pattern-matching, etc.). Better to write the thing in C# using modern features of the more popular and capable language.
评论 #43552521 未加载
评论 #43551275 未加载
评论 #43556948 未加载
评论 #43546963 未加载
amelius大约 2 个月前
I have a few questions. Can it do GUIs well? How about mobile? And how does it compare to e.g. Scala?
评论 #43546479 未加载
评论 #43546358 未加载
评论 #43550529 未加载
评论 #43546584 未加载
评论 #43546276 未加载
评论 #43546812 未加载
gwbas1c大约 2 个月前
&gt; Why F#?<p>I&#x27;m kinda wondering if anyone here with decent C#&#x2F;.net experience can give their version of the answer?<p>---<p>The article really didn&#x27;t answer its own question. It basically says &quot;How&quot; instead of &quot;Why&quot;...<p>...Which as someone who&#x27;s spent over 20 years in C#, and tends to advocate for &quot;functional&quot; style, leaves me with more questions than answers!
评论 #43547924 未加载
评论 #43548811 未加载
评论 #43548267 未加载
fud101大约 2 个月前
I want to ask a weird question. I&#x27;d love to learn ASP.net but i can&#x27;t bring myself to deal with Microsoft Windows and their tech. Is F# a way for me to learn enough NET to make some money?
评论 #43546805 未加载
评论 #43548299 未加载
评论 #43551375 未加载
jxjnskkzxxhx大约 2 个月前
Does anyone else find interesting that people who write blog posts saying &quot;my favourite language is X&quot;, it&#x27;s never a mainstream language..?
评论 #43550667 未加载
评论 #43548191 未加载
评论 #43548314 未加载
评论 #43557687 未加载
sklivvz1971大约 2 个月前
As a person who&#x27;s worked with the author (a great guy!) and with the F# community on a very large F# project: don&#x27;t bother with F#, professionally speaking.<p>F# has many theoretical qualities, which make it fun if you like these things, but it also has some fundamental flaws, which is why it&#x27;s not getting a wide professional adoption.<p>- the build system was a mess last I checked (slow, peculiar)<p>- syntax is not c-like or python-like (a big deal for a lot of people)<p>- you can&#x27;t hire developers who know it (and certainly the few are not cheap)<p>- the community is a bit weird&#x2F;obsessed&#x2F;evangelizing (a turn off in a professional environment)<p>- it&#x27;s clearly a second class citizen in the .net world (when stuff breaks, good luck getting support)<p>On the other hand<p>- it has discriminated unions<p>- units<p>- etc.<p>but do you need this stuff (not want: need)? most people don&#x27;t.
评论 #43556288 未加载
pdimitar大约 2 个月前
People will do anything except actually try Elixir. :D<p>...I mean: pipes, immutability, transparent mega-parallelism... helloooo?<p>I tried F# some years ago (after I was fired from a shop that decided they will go all-in on Java and F# and dropping everything else overnight) and I was not impressed. I mean the language is really nice but the C# baggage and runtime was just a bit much. And I was not left convinced that immutability alone is worth the switch. I suppose we can call F# an FP gateway drug?<p>Now arguably you get a runtime and some baggage from the Erlang runtime (the BEAM VM, where Elixir also runs), but the guarantees and features you get are invaluable, and have proven themselves many times over the last literal three decades.
评论 #43549182 未加载
评论 #43546458 未加载
评论 #43547281 未加载
评论 #43546620 未加载
this_user大约 2 个月前
Because you love using Microsoft&#x27;s shitty technologies, but also want to be completely unemployable?
评论 #43546353 未加载
评论 #43549831 未加载
评论 #43546513 未加载
评论 #43546293 未加载
nudpiedo大约 2 个月前
Same as many, I had wonderful experience with F# in the past, I would use it again if:<p>- fable would 100% detach from dotnet - keeps up yo the LLM rush, specially vibe coding on cursor<p>Last LLM experience it generated obsolete grammar (not much but a bit).<p>Such la gauges are key for vibe coding experience and modeling.
oguz-ismail大约 2 个月前
&gt;whitespace is significant, like in Python<p>hard pass
评论 #43550293 未加载
评论 #43549106 未加载
评论 #43546246 未加载
评论 #43551353 未加载
评论 #43548986 未加载
fnord77大约 2 个月前
&gt; Trivia: F# is the language that made the pipeline operator (|&gt;) popular.<p>laughs in clojure