Live data from Hacker News

Fable 3: F# to JavaScript compiler

fable.io

61–70 of 131 posts

Re: Fable 3: F# to JavaScript compiler

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

Amazing! I’d be interested- the problem I have in the FP space is not getting the F# or Haskell experience so you have to “keep up in your spare time” and with other commitments I have to choose what to keep up with and the rarity of FP jobs means it makes more sense to say learn Redux, Sagas, that kind of stuff etc. So I think it’s good if companies like yours would take pure enthusiasm with proven knowledge of other programming languages and desire to learn F#. But I guess it depends as you may have a queue of people wanting a FP job so you can be choosy!

Re: Fable 3: F# to JavaScript compiler

#62
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

Re: Fable 3: F# to JavaScript compiler

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

Maybe it's my unsophisticated mind talking here, but programming in F# is pure joy.Among the languages I use only Ruby gets close to provide that feeling.

Re: Fable 3: F# to JavaScript compiler

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

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

Take a look at F#'s type solver code especially wrt to Extension Typing: https://github.com/dotnet/fsharp/blob/main/src/fsharp/Extens...

You can do similar things with other Ocaml or Lispy Langs, depending on how you want to do it. All you need is a function that returns possibleTypeTransitions for givenType(type, enclosedLexeme, type.validTransitions). A gradually typed lang sitting in top of a prototype-based blob also makes this easy to do (see typescript) in-codo.

See also MacKay (RIP)'s classic book: http://www.inference.org.uk/itprnn/book.pdf

Re: Fable 3: F# to JavaScript compiler

#65
Anyone have any insight into how well the Ts2Fable tool works these days? (It translates TypeScript type definition files into F# for fable consumption.) https://github.com/fable-compiler/ts2fable

I just now dumped a 350KB JQuery.d.ts file into it, and sure enough it spit out F#, but confirming how well it works overall would take a lot longer to ascertain.

Always seemed to me like having a really robust tool for this purpose (or else, just a rich direct Fable-typing selection) would be a huge boon for the whole Fable ecosystem.

Re: Fable 3: F# to JavaScript compiler

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

Amazing! I’d be interested- the problem I have in the FP space is not getting the F# or Haskell experience so you have to “keep up in your spare time” and with other commitments I have to choose what to keep up with and the rarity of FP jobs means it makes more sense to say learn Redux, Sagas, that kind of stuff etc. So I think it’s good if companies like yours would take pure enthusiasm with proven knowledge of othe…

I find the same thing. Getting the experience can only happen in time I direct. I have scope to use F# at work but still fear that choice is not the best for the company I work for. Yes I will love the tooling and right now I'm there but it won't always be that way. They won't be able to find contractors to make changes in the future. I have to give them solutions they can run with in the future or they will be forever regretting me once I'm gone.

Re: Fable 3: F# to JavaScript compiler

#68
post #53

Earlier quoted context omitted.

F# is your strongly typed contender to Python.

Sure, it's a lovely language. But I find the lack of some basic linear algebra, probability and statistics libraries frustrating. As pjmlp said in a parent thread, those are closed source and usually bought. I guess a lot of the .NET ecosystem is like that. It's a shame, because MS has some open-source jewels like Z3 or Infer.NET.

MS is making a conscious effort to push into the ML space with libraries such as ML.NET https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotn... . IMO, the combination of a strongly-typed language with features such as type inference, data providers and discriminated unions/pattern matching make F# a perfect fit for this space. It's just unfortunate that they had to go through the .NET Framework -> .NET Core journey before focusing on the ML ecosystem...

But, the F# PM has recently given talks recognizing that they want to go into the space that Python is dominating, so it's a clear goal of the F# team (https://www.youtube.com/watch?v=_QnbV6CAWXc). I hope they're successful!

Re: Fable 3: F# to JavaScript compiler

#69

I see some F# praising in here. any good learning resources one can recommend to me (Ik I can "google it" or whatever. I mean something you had experience with and would recommend)

http://fsharpforfunandprofit.com

The one true way (his book is also very good)

Post reply on HN