Live data from Hacker News

Fable 3: F# to JavaScript compiler

fable.io

121–130 of 131 posts

Re: Fable 3: F# to JavaScript compiler

#121
post #77

Is there any note on if F# will gain concepts/type classes?

I don’t know, but I think this GitHub issue will probably give you the current status and background on this point https://github.com/fsharp/fslang-suggestions/issues/243 Update: the issue is tagged await-csharp-alignment, which is probably the relevant status.

Ah thanks!

Re: Fable 3: F# to JavaScript compiler

#122
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).

.NET Core on Linux is actually the best experience I had in a while. Microsoft provides packages for all the major versions of the SDK and you can install them side-by-side with your distro package manager. Then you pick which version of the SDK you want to use for each solution and everything works.

Re: Fable 3: F# to JavaScript compiler

#123
post #119

Earlier quoted context omitted.

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# callb…

I think it will get better in F# 5.1, which adds native C# Task support... https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-...

Re: Fable 3: F# to JavaScript compiler

#124
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've been writing code with f# and dotnet core 5.0 on MacOS. Works great!

Re: Fable 3: F# to JavaScript compiler

#125
post #51

Fable isn't just for view logic. Fable is also really handy for writing puzzle solvers/generators for the browser. I used it in https://vowels.io while using regular preact/js for the views. I found that keeping the fable stuff isolated to lib code gave me less friction.

Nice site. I liked the game, I was embarrassingly slow though

Yeah, a really nice site. It's not slow at all from what I'm seeing!

Re: Fable 3: F# to JavaScript compiler

#126
post #119

Earlier quoted context omitted.

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# callb…

Thanks. I appreciate the explanation.

Re: Fable 3: F# to JavaScript compiler

#127
post #119

Earlier quoted context omitted.

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# callb…

I think it will get better in F# 5.1, which adds native C# Task support... https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-...

In the meantime, you can use the fantastic TaskBuilder.fs for C# Task support and interop.

https://www.nuget.org/packages/TaskBuilder.fs/ https://github.com/rspeele/TaskBuilder.fs

Re: Fable 3: F# to JavaScript compiler

#130
post #51

Fable isn't just for view logic. Fable is also really handy for writing puzzle solvers/generators for the browser. I used it in https://vowels.io while using regular preact/js for the views. I found that keeping the fable stuff isolated to lib code gave me less friction.

my experience was the same, although is it possible to do everything with Fable, it works better to glue frameworks with typescript and keep F# as library or some function calls in strategic points.
Post reply on HN