6 ms·
"BuckleScript is one of the very few compilers which compiles an existing typed language to readable JavaScript." Elm (type inference) is sort of. While there
by bootload 10y ago
"BuckleScript is one of the very few compilers which compiles an existing typed language to readable JavaScript."
Elm (type inference) is sort of. While there is a lot of OS type projects used, having bloomberg use it is a plus. Interesting that FB have build system ^Reason^ (build system) doing something similar (OCaml backend->JS) ~ http://facebook.github.io/reason/ http://facebook.github.io/reason/
- yawaramin 10y agoReason is an alternative, JavaScript-like, syntax for the OCaml language. Same language, different syntax! It's crazy cool. BuckleScript is an OCaml -> ES5 compiler, so it actually compiles Reason to ES5 just fine. Bloomberg and Facebook are two big users of BuckleScript. FB have a couple of folks writing significant stuff in Reason, compiling with BuckleScript, and deploying to user-facing web properties.
- deleted 10y ago[deleted]
- k__ 10y agoWhat is the difference between reason and bucklescript?
- phpnode 10y agoReason is a language, bucklescript is an alternative backend for ocaml which generates JavaScript. You write reason, you don't write bucklescript
- k__ 10y agookay, then what's the difference between ocaml and reason? :)
- phpnode 10y agoReason is a js like syntax for ocaml, semantically they're identical. Similar to coffeescript and JavaScript, except ocaml has really good support for this kind of stuff
- nerdponx 10y agoSo what you're saying is I could write a JavaScript-esque program and compile it to OCaml using Reason, and then compile it to true JavaScript using Bucklescript?
- phpnode 10y agoYes exactly, although you can avoid the middle step and go straight from reason to js because of the way bucklescript plugs into the ocaml compiler
- e12e 10y agoWhy would one prefer reason to ocaml? (Honest question)
- purity_resigns 10y agoReason's syntax is a little cleaner and it's easier to get up and running with.
- phpnode 10y agoIt is much more like JavaScript than ocaml and so you get a familiar language but one which benefits from all the cool things that ocaml can do.
- k__ 10y agoAnother n00b question: What are "all the cool things that ocaml can do"? I only saw rather simple typing examples, which didn't seem much different from what TypeScript can do. On the other hand I read often that ocaml doesn't have runtime errors, which I certainly get with TypeScript.
- akhilcacharya 10y agoI'm still waiting on full JSX and React for BuckleScript.
- quicksnap 10y agoJSX is available in Reason out of the box: https://facebook.github.io/reason/#diving-deeper-jsx https://facebook.github.io/reason/#diving-deeper-jsx
- akhilcacharya 10y agoOh snap, didn't know this was supported yet. I think the tooling isn't available for transforming Reason => JSX in a consistent development environment from what I gather, but I haven't paid attention for a few months.
- cel1ne 10y agoKotlin can do that too: https://kotlinlang.org/ https://kotlinlang.org/
- agumonkey 10y agoKotlin is slow though. To compile that is.
- SureshG 10y agoDartlang dev compiler - https://github.com/dart-lang/sdk/tree/master/pkg/dev_compiler https://github.com/dart-lang/sdk/tree/master/pkg/dev_compile... .
- wstrange 10y agoDDC is an alternative to the dart2js compiler. It supports "strong mode" which provides better compile time checking, and produces more idiomatic Javascript. Dart has a large team behind it, an awesome package management infrastructure, a "Dart native" angular 2 library.
- willtim 10y agoDart is just another junk food programming language in the same vein as Java (with some of the same people involved). If you really want to learn what a "strong mode" is, learn OCaml. Good job Bloomberg for Bucklescript.
- teen 10y agodidn't gwt do this 5 years ago
- grayrest 10y agoIf we're just talking about compiling a typed language to javascript, gwt did it 12 years ago.
- bootload 10y ago"Interesting that FB have build system ^Reason^ (build system)" One reason to define a tool and use language clearly, I interpreted, 'Build Systems Rapidly' as a ^build system^ where in reality Reason is a ^systems language^ to build things quickly. Some of the tools are fantastic. I would love to have REFMT "dynamically as the window resizes in order to make optimal use of screen real estate while still abiding perfectly by the formatting rules" built into language editors to aid development.