> Yes, the legacy.
That's hardly the only reason, and certainly not the reason why new OSes are not written in .net languages.
If we had more mature systems languages suitable for OS development sooner, people wouldn't use C and C++.
You're obviously not going to use it for low level or high performance system programming, or numeric stuff where you'd use Python, but for day to day getting stuff done it's amazing.
The Fable compiler for F# barely adds any cost on top of what TS adds in terms of dependencies, compilation and tooling and IMO gives you a much better language for developing applications. And you still get to use the JS ecosystem.
Most of the cost is related to familiarity with both F# and JS, node and the browser.
But once you match on a pipeline of Results you can never go back!
I've tried plenty of other to-JS compilers, even for languages that I love, and I still choose TypeScript every time.
It doesn’t feel that much different than the TS compilation process. It is not what you’re expecting.
Am I not contributing to the conversation? Has anyone else even mentioned F# or Fable?
I wish that instead of TypeScript, MS had just used F#.
It seems like they took some of the concepts of what can be done in F# and made TypeScript. I wish they had just stuck with F#.
It's almost like it was marketing, like they didn't like how F# was viewed so TypeScript was a re-branding.
Maybe it is because TypeScript can be considered a DSL that could be built by F#. Like Elmish.
EDIT> Yeah, not sure if enough people understand F#. You can easily build TypeScript from F#. Or maybe the downvotes are from Haskell people that just view, a functional language can build anything so it isn't worth commenting on.
We tried Haskell in the browser before and it was a huge mistake. We want back to TypeScript afterwards.
Haskell wouldn't work in this context.
I've had a very easy time debugging Fable compiled projects.
Again, I have extensive node and JS experience which is absolutely required for working on a Fable project.
I would argue that the hardest parts of TypeScript aren't that much less of a leap than F#.
I would argue that this code is easier to debug than the equivalent .tsx:
[<ReactComponent>]
let Counter() =
let (count, setCount) = React.useState(0)
Html.div [
Html.button [
prop.onClick (fun _ -> setCount(count + 1))
prop.text "Increment"
]
Html.button [
prop.onClick (fun _ -> setCount(count - 1))
prop.text "Decrement"
]
Html.h1 count
]
And this basically looks like JS to begin with: [<ReactComponent>]
let ShowGreeting(props: {| greeting : Greeting |}) =
React.fragment [
Html.h2 props.greeting.heading
Html.h4 props.greeting.subheading
Html.p props.greeting.content
]
app.get("/", fun req res next ->
promise {
let! response =
req
|> gql "query { greeting { heading subheading content } }" {||}
match response with
| Ok response ->
let greeting : Greeting = response?greeting
ShowGreeting ({| greeting = greeting |})
|> res.renderComponent
| Error message -> next()
}
)
Again, Result types! Computation expressions! Error handling with these constructs is well worth the price of admission.Compare this to the try/catch approach you'd be using in TS:
Besides,Isn't typescript developed by the same people who made C# and also takes quite few inspirations from it?
Google is the only company that is in a position to do anything about this and they gave up on Dart. So yeah, we're basically stuck with it.
Miles ahead of the tooling, frameworks, and features of most languages.
>There is a reason that we write javascript in the browser
Yes, we're stuck with it.
>and operating systems in c or c++
Yes, the legacy.
>and telco services in erlang
Erlang doesn't have some particular stronghold in telco services. It was created by Ericsson for their own such use, but it's not like other/most telcos use Erlang. Ericsson itself even neglected (and for a period even banned new Erlang projects, preferring other languages).
>and academic works in python rather than in C# or F#
Huh? Who writes "academic works in Python"? I'm sure some do. Still many write Java, C#, and others, including C++ and even Haskell. Except if by "academic works" you meant "in machine learning and scientific computing", or "use as teaching language".