Skip to content

Chicken-Egg: F# <-> TypeScript — Missing in the Web Ecosystem #3359

@D1no

Description

@D1no

Wanted to check if Microsoft is working on having their TypeScript and F# language interopp? I am very interested in bringing F# into production of end-to-end web applications (mostly for state managing, domain and data modeling).

So far, I've only read statements like "maybe a community thing" or "stale". Not sure what that means — personally — I'd think that relying on individuals to combine the power of two of MS complicated languages is kind of weird.

The reason why I write this, is because Fabel states to be a "F# to JS Compiler" to be integrated in JS projects. Luckily for us, over the past 3-5 years we haven't seen JS Projects anymore. For serious applications, JS/ES5/ES2015/ES### is merely a compile target powered by TypeScript.

I believe, if F# would be an easy TypeScript generator, it would make the language very interesting to people that know TypeScript and create synergies between them.

Oddly, because TypeScript devs (like me) don't have easy "npm install -D fsharp" access, these don't know enough about the .net and F# sharp world to make this F# <-> TypeScript synergy happen. Potentially opening up .Net for some.

And the F#/.Net people don't know / or care about the E2E web domain either, to make this happen.

A chicken and egg problem.

Not sure if any of the F# Microsoft guys read this, but if strategic inspiration is appreciated:

  • As a tech lead, I believe that "purist" approaches are wrong. We have well established development lifecycles. No reason to try to get rid of them.
    Like Blazor trying do do everything in C#, Elexir creating huge learning barriers and flutter... rebuilding the OS GUI in Dart etc.

  • I'd love to be able to integrate a counter Language like F# in the browser as TypeScript to solve individual hard parts like state machines and data modeling.
    My frontend engineers know the DOM API, React and CSS - no need to bother them with extra WASM build chains / file sizes / integrations etc. My backend engineers on the other hand are fast and efficient in data, file and request management via node.js/deno — giving them the same F# logic as a WASM file with perfect a d.ts would empower integration and isomorphic client-server code.

TypeScript is already the C# equivalent for us. I'd really wish there would also be a F# "FunctionScript" equivalent to functional programming.

F# sharp seems to be an amazing language. For me behind various barriers... and I write this in a bar, on my phone... slightly drunk... after watching once again Domain Modeling Made Functional - Scott Wlaschin and think: God damn it! We need this as reactjs hook libs and GraphQL/Event resolvers 😪

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions