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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Fable is a compiler that brings F# into the JavaScript ecosystem

129 点作者 philonoist超过 3 年前

11 条评论

phillipcarter超过 3 年前
Fable is a brilliant project.<p>It doesn&#x27;t try to hide the fact that when you write a Fable program, you&#x27;re fundamentally in the JS ecosystem. This can be a bit of a shift if you&#x27;re used to doing stuff in .NET, but it means that everything will more or less work with your code.<p>It also comes with a few tools&#x2F;utilities to ease the F#-JS bridge you&#x27;re on.
评论 #28924724 未加载
kirse超过 3 年前
Along with Fable highly recommend a look at Feliz. A joy to work with and its ViewEngine can also separately be used w&#x2F; Giraffe just for the syntax:<p><a href="https:&#x2F;&#x2F;zaid-ajaj.github.io&#x2F;Feliz&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zaid-ajaj.github.io&#x2F;Feliz&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;Zaid-Ajaj&#x2F;Feliz" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Zaid-Ajaj&#x2F;Feliz</a>
评论 #28924026 未加载
评论 #28923141 未加载
评论 #28923552 未加载
评论 #28926340 未加载
akdor1154超过 3 年前
What&#x27;s even more exciting is there is work underway to allow Fable to target Python instead: <a href="https:&#x2F;&#x2F;github.com&#x2F;fable-compiler&#x2F;Fable&#x2F;issues&#x2F;2339" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fable-compiler&#x2F;Fable&#x2F;issues&#x2F;2339</a><p>These things are bizarre when you think about the tech stack they lead to, but undeniably still really useful in our unfortunate real world. I think of F# as &#x27;the pragmatist&#x27;s functional programming language&#x27;, and projects like this follow that mindset.
评论 #28926145 未加载
Taikonerd超过 3 年前
Is it my imagination, or has there been an upswing of interest in F# on HN recently?
评论 #28923038 未加载
评论 #28923242 未加载
评论 #28924685 未加载
评论 #28924443 未加载
评论 #28923389 未加载
评论 #28923372 未加载
评论 #28923153 未加载
sbelskie超过 3 年前
I’ve only played around with it on a few smaller projects, but it blew me away with the simplicity and expressiveness. I’ve used it a few times to make simple web based UIs for personal tooling and am looking forward to using it on something bigger.<p>Just one of the many reasons I find myself more and more excited by F#.
评论 #28923438 未加载
brundolf超过 3 年前
Maybe I&#x27;m biased, but I&#x27;m often skeptical of the benefits of projects like this that translate a language which normally targets runtime A, into another language that targets a wildly different runtime B (usually JS or WASM)<p>(Disclaimer that I&#x27;m not talking about compiling runtime-less languages for different platforms)<p>It just seems like it&#x27;s going to be a very leaky abstraction, like there will be tons of corner cases where some behavior isn&#x27;t exactly the same and other behavior isn&#x27;t quite possible, which will cause libraries and in-house code alike to break in weird ways. I know that ClojureScript, for example, has several caveats relative to Clojure; and most of these translators are not nearly as mainstream (and so don&#x27;t get nearly as much maintenance attention) as ClojureScript does. And then there&#x27;s the messy question of interacting with the host system, dropping down into the host language for certain things, etc.<p>I haven&#x27;t really worked with these kinds of systems so I may be way off, but from the outside it seems like a huge increase in complexity just so you get to stay in a familiar language
评论 #28923476 未加载
评论 #28923534 未加载
评论 #28923105 未加载
评论 #28928781 未加载
评论 #28923119 未加载
Rapzid超过 3 年前
Debating F# for OSS project I&#x27;m about to start but the asp.net C# with blazor story(though I need support for loading blazor code at runtime for plugins and can&#x27;t get a straight answer on that) is very compelling.<p>As to Fable.. I would want to use it on Vuejs perhaps if I can&#x27;t do blazor, but also with something like mobx and NOT Elmish. I despise redux and it just looks gross. I want the Mobx &quot;magic&quot; for this boring view update stuff.
评论 #28927949 未加载
评论 #28927523 未加载
icey超过 3 年前
Since we&#x27;re in here talking about all kinds of F# goodies, has anyone spent time with <a href="https:&#x2F;&#x2F;wiz.run&#x2F;" rel="nofollow">https:&#x2F;&#x2F;wiz.run&#x2F;</a>?
评论 #28925838 未加载
评论 #28927505 未加载
spankalee超过 3 年前
I don&#x27;t know a ton about Fable, but they recently wrapped Google&#x27;s Lit to allow building functional templating and web components in it: <a href="https:&#x2F;&#x2F;fable.io&#x2F;Fable.Lit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fable.io&#x2F;Fable.Lit&#x2F;</a><p>Seems like a neat project.
dan-robertson超过 3 年前
How close are the semantics to F#? For example OCaml has bucklescript which produces reasonable looking JavaScript but doesn’t always follow the language semantics, and js_of_ocaml which produces horrid JavaScript (it compiles from 32-bit OCaml bytecode to js, and fakes the OCaml memory layout of objects by using arrays with their first element being the tag of the object, so e.g. a float is represented in js as [&lt;magic number&gt;, &lt;the actual float&gt;]).<p>Similarly, Common Lisp has something called parenscript which compiles a lispy syntax to js but e.g. uses JavaScript arrays for its lists (so you don’t have a cons function).
评论 #28927542 未加载
satvikpendem超过 3 年前
Is it named Fable due to its relation to the Fable series which Microsoft publishes?
评论 #28925230 未加载