Live data from Hacker News

Fable: F# to JavaScript compiler

fable.io

41–50 of 74 posts

Re: Fable: F# to JavaScript compiler

#41

Earlier quoted context omitted.

That would require Microsoft, the F# team, and the vocal F# community members to actually want F# to be a proper first-class .NET citizen, which sadly isn't the case. https://np.reddit.com/r/fsharp/comments/6tdrwq/after_so_many...

As a sometimes-user of F#, I’m quite happy not caring about a dead-end technology like UWP and .NET Native, thank you very much. I’m glad everyone else seems to agree about that, too.

How things are going, I bet those dead-end technologies have a brighter future than F#, specially when I see those Microsoft bashing comments.

If it comes to be, lets see how long F# survives without Microsoft support.

Re: Fable: F# to JavaScript compiler

#42
post #2

The first thing I worry about reading something like this is how leaky the abstraction will be. I would love to ditch JavaScript for pretty much anything else but if I need to think about the JavaScript part anyway because of certain things that I can or cannot do I prefer to think in JavaScript from the get go.

People seem to love BuckleScript, so it must be possible to do this kind of thing right.

Re: Fable: F# to JavaScript compiler

#43

Earlier quoted context omitted.

I've been holding of targeting UWP, until proper F# support. I have experience with plenty of languages and technologies, including C, C++, Rust, Scala, OCaml, Haskell, Clojure, Elm, Idris, WinForms, WPF, DirectX and dabbled with Silverlight. Migrating from WPF or Silverlight towards UWP shouldn't be a problem. F# has been my favorite language since 2008, but the hostile anti-UWP, anti-Windows community, compounded w…

> there is no sign of UWP going away anytime soon Except for Windows Phone getting killed, which was the _main_ device type for UWP. The Windows app store is the same graveyard that it was in late 2015 when the announcements around new Windows Phones piqued my curiosity. It looks like that's simply not a thing anymore. I'm betting my money on Xamarin and the browser for a client application, not UWP. There's just no…

UWP is the future of Windows APIs, in case you missed Windows Developer day earlier this month.

So if F# doesn't speak UWP, the community keeps tweeting that GNU/Linux is so much better than Windows, and that we enterprise devs just don't get it, should we bet which of those technologies will last longer on MS roadmap?

Re: Fable: F# to JavaScript compiler

#44

Earlier quoted context omitted.

This is a tricky one. If the abstractions were not leaky, you would not be able to interoperate with JavaScript libraries and you'd have to reimplement everything that powers the modern JS ecosystem. On the other hand, if the abstractions were too leaky, you'd lose all benefits of a nice language like F#. I think Fable strikes the right balance. There are some leaky aspects of how it compiles to JS, but this means th…

> you can just cast JSON object to F# records and it'll work Isn't a "JSON object" just a string?

He probably wanted to say "plain JS object", which is denoted in JSON. You can put JSON in a string, but the syntax is called JSON as well.

Re: Fable: F# to JavaScript compiler

#45

Why not show a code sample on the homepage? None of Home, Docs, or Samples have a single code snippet on the entire page, you have to click through. Crystal and Rust are good examples of language homepages that give you an idea of what you're getting into up front. Or for a transpiled language, PureScript.

The front page has a link directly to the F# website: http://fsharp.org/ , which has a bunch of resources to learn the language.

F# website its also hard to find an example of the code

Re: Fable: F# to JavaScript compiler

#46

Why not show a code sample on the homepage? None of Home, Docs, or Samples have a single code snippet on the entire page, you have to click through. Crystal and Rust are good examples of language homepages that give you an idea of what you're getting into up front. Or for a transpiled language, PureScript.

Fable is a compiler and runtime for a language that already very much exists, and has its own documentation and landing page. F# isn't a new thing.

Sure, but I would still like to see how I would use this in the context of a browser. How do I interact with existing JS libraries? How would I use it with React or something else? How would I even call window.alert()?

Re: Fable: F# to JavaScript compiler

#47
post #40
post #38

Earlier quoted context omitted.

> Plus, being a superset means that if you want to 'drop into' JS to take advantage of some quirk or whatever at any time, you can just disable your linter and do the deed. This is an exact example of what GP was talking about with leaky abstractions though. You don't have to just learn TS to use TS, you need to learn TS and JS. IMO a proper, strict typed language; and plain Javascript; are both much better options t…

> You don't have to just learn TS to use TS, you need to learn TS and JS. I don't understand this. TypeScript is not a different language. It's just JavaScript with some type annotations. If you had never used JavaScript before and learned TypeScript you could immediately write plain JavaScript as well.

Typescript has grown into way more than just "JavaScript with some type annotations". It's a much bigger superset with lots of language features that JS doesn't have.

Re: Fable: F# to JavaScript compiler

#48
post #38

Earlier quoted context omitted.

I have to agree, the pragmatic and thoughtful approach that the TS team has brought to the language makes it reasonable to write in and easy enough to reason about at any given time. Plus, being a superset means that if you want to 'drop into' JS to take advantage of some quirk or whatever at any time, you can just disable your linter and do the deed. Coming from a C# and Python fan, TS hits the mark pretty solidly o…

> Plus, being a superset means that if you want to 'drop into' JS to take advantage of some quirk or whatever at any time, you can just disable your linter and do the deed. This is an exact example of what GP was talking about with leaky abstractions though. You don't have to just learn TS to use TS, you need to learn TS and JS. IMO a proper, strict typed language; and plain Javascript; are both much better options t…

TS is not a leaky abstraction; TS is no abstraction at all. It extends JavaScript, not alters or replaces it. As a result, all JS is automatically valid TS.

Re: Fable: F# to JavaScript compiler

#49
I have been watching and trying Fable for two months after I wrote a demo in ReasonML/BuckleScript, because I need a full-stack language for my side projects and Fable is much complete and stable, and the backend story is also much better than OCaml or BS bindings for Nodejs.

Re: Fable: F# to JavaScript compiler

#50
post #49

I have been watching and trying Fable for two months after I wrote a demo in ReasonML/BuckleScript, because I need a full-stack language for my side projects and Fable is much complete and stable, and the backend story is also much better than OCaml or BS bindings for Nodejs.

Here are some real-world examples:

A Server-Client full-stack scaffold: https://github.com/SAFE-Stack/SAFE-BookStore

A React-Native scaffold: https://github.com/SAFE-Stack/SAFE-Nightwatch

Post reply on HN