Live data from Hacker News

Fable 3: F# to JavaScript compiler

fable.io

111–120 of 131 posts

Re: Fable 3: F# to JavaScript compiler

#111

Earlier quoted context omitted.

There is nothing concerning Windows 10X that undermines anything I have said. UWP is the future of Windows - correct. I'm not sure any significant part of UWP has ever been in the kernel per se. It sounds like you're a consultant where taking risks on behalf of your customers, no matter how small or logical the risk, is obviously not part of your job description. Your offerings of good luck appear to be disingenuous.

We've been running F# in production since 2014 - almost 7 years. It is quite shocking to hear anyone imply that F# is not ready for production use - that it is just "cool" tech. (when has F# ever been cool in the minds of the masses?) I suspect you'll say "7 years is nothing" and maybe it is nothing. But it is still something. It is long enough that we made a couple bad framework/library dependency choices early on a…

On the context of Windows GUI frameworks and UWP, no it isn't ready.

Still no VS or Blend tooling support, no project templates and .NET Native requires workarounds with stuff that most corporate enterprise developers don't care to learn.

Re: Fable 3: F# to JavaScript compiler

#112

I've had fantastic experiences with this platform as well, front- and back-end code compiled together using F#'s robust type system. Elmish framework provided a nice MVU pattern for the U/I. And the real icing on the cake was this Thoth.Elmish package which creates statically-typed proxy for your front-end to access your back-end API, more or less transparently. I was always certain that I would some day do something…

For those interested, I believe you're referring to Fable.Remoting https://zaid-ajaj.github.io/Fable.Remoting/src/basics.html

Re: Fable 3: F# to JavaScript compiler

#113
post #103

Does anybody here use F# in a Linux shop? I'm generally keen on the more functional languages, but have tended to avoid F# under the assumption that if I use F# I'll probably also end up needing to use Windows to get the most out of it (or get a job using it).

At my previous company I developed on Ubuntu/macOS and deployed to Linux on AWS. Never experienced any issues, never had code running on Windows.

Re: Fable 3: F# to JavaScript compiler

#114
post #48

We're an F#-first company and I'd like to share our experience here. All our new code is in F#, we started off from a C# codebase, so that made the transition somewhat manageable, as new F# code can be directly called from C#, and vice versa (still took over 2 years). All new frontend apps are also being written in F# (using Fable), as of 6 months back, migrating away from TypeScript, this forces everyone into a "des…

How's your experience with Fable, especially when using third party JS libraries?

I'm really having fun experimenting with F# for my API server, but I hesitate to use it on the front end.

Re: Fable 3: F# to JavaScript compiler

#115
post #92
post #84

Earlier quoted context omitted.

Here's is a simplistic example of a state machine: let transition (state: State) (action: Action) : State option = match (state, action) with | (StateA, ActionA) -> Some StateB | (StateA, ActionB) -> Some StateC | (StateB, ActionA) -> Some StateB | _ -> None If you get the quoted representation of the transition function, it can be visualized as a tree data structure (like code-as-data in LISP). You can analyze that…

Do you blog any of this or do any sort of writing on the topic. I think I could learn a lot from the way you are doing things.

Not yet, it has been on my list for a long time. Meanwhile I recommend this blog that collates all good F# content from around the web weekly:

https://sergeytihon.com/category/f-weekly/

Re: Fable 3: F# to JavaScript compiler

#116
post #103

Does anybody here use F# in a Linux shop? I'm generally keen on the more functional languages, but have tended to avoid F# under the assumption that if I use F# I'll probably also end up needing to use Windows to get the most out of it (or get a job using it).

Using F# on Ubuntu for two years, it’s lovely!

Re: Fable 3: F# to JavaScript compiler

#117
post #76

This looks like a great update: prettier code output plus roughly double the compilation speed. Compilation speed is one of the things that put me off Fable when I kicked the tires a while ago. That and tooling was a mess. I really like F# as a language, but it's hard to give up the high quality tooling of VS Code + TypeScript + almost any NPM package w/ proper types.

Was trying to use F# at work for a backend service and got shut down. Ended up using Typescript instead and it doesn't feel as clean.

TypeScript is nowhere near as clean as any FP language I’ve used. But it’s hard to deny that TypeScript has better tooling and 1st class library support.

Re: Fable 3: F# to JavaScript compiler

#118
post #84

Earlier quoted context omitted.

Please can you sure more about this? > We also make ample use of quotations to do some cool tricks (like predict the future states some type can take, based on current state + available transitions).

Here's is a simplistic example of a state machine: let transition (state: State) (action: Action) : State option = match (state, action) with | (StateA, ActionA) -> Some StateB | (StateA, ActionB) -> Some StateC | (StateB, ActionA) -> Some StateB | _ -> None If you get the quoted representation of the transition function, it can be visualized as a tree data structure (like code-as-data in LISP). You can analyze that…

> "Any sufficiently complicated model class contains an ad hoc, informally specified, bug-ridden, slow implementation of half of a state machine." (not sure where I read this quote).

Can’t tell you where you read it, of course, but believe it originates from Braithwaite/raganwald:

http://raganwald.com/2018/02/23/forde.html

Re: Fable 3: F# to JavaScript compiler

#119
post #86

Earlier quoted context omitted.

Does interop with c# get easier? Trying to figure out how to map to an overloaded C# callback (maybe hidden in an *.extension doc!) has wasted hours of my time. F# (the ml family in general) is my favorite language right now but, man, the .net APIs are rough. Lacking the same UX I’m used to in Node, Ruby, and Elixir.

Can you explain the interop a bit more? I’ve been looking into an F# job. Having a functional background, the language looks nice, but I’m wondering about the ecosystem. Can you not use .Net libraries as easily as you can from C#?

Yes. Typically interop is very straightforward. You look in the api docs and copy paste.

Example here is the String doc[1]. Way down you see all the methods. Some of the methods have overloads (multiple variants). Pretty straightforward here. (E.g. `"mystring".Contains("ring")`)

Where it gets more verbose and finicky is when the API takes a C# callback. Even more complex is if it’s asynchronous so it takes a C# callback as a Task.

An example being the `.Use` method for defining server middleware.[2]

To see how it’s done, here’s a gist I found.[3] Notice how the function for requestHandler is verbosely annotated with Func and RequestDelegate, etc.

Luckily this isn’t the norm, most APIs are less complicated. Even so, you write a wrapper (abstraction) around that complexity and only look at your wrapper. Which is why someone in this thread said to leave them in a dark corner.

[1]: https://docs.microsoft.com/en-us/dotnet/api/system.string?vi...

[2]: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnet...

[3]: https://gist.github.com/kspeakman/7870a75283f6942dd96ff34a03...

Re: Fable 3: F# to JavaScript compiler

#120
post #103

Does anybody here use F# in a Linux shop? I'm generally keen on the more functional languages, but have tended to avoid F# under the assumption that if I use F# I'll probably also end up needing to use Windows to get the most out of it (or get a job using it).

I do a lot of F# these days. I haven’t owned a windows machine in a decade.
Post reply on HN