Live data from Hacker News

Announcing BuckleScript 1.0

bloomberg.github.io

31–40 of 78 posts

Re: Announcing BuckleScript 1.0

#34
post #31

I am one of the authors of BuckleScript, you can try BuckleScript in the browser: http://bloomberg.github.io/bucklescript/js-demo/ Click Examples see how the JS code generated, questions are welcome!

Very neat. Can BuckleScript compile Core?

It would have to be Core_kernel, the subset of Core that doesn't interact with the runtime or OS. I'm very curious about this and would like to know, too.

Re: Announcing BuckleScript 1.0

#35
post #3

Earlier quoted context omitted.

Are there internal projects inside Bloomberg that use this? It is really great and it is very impressive that it seems that you almost single-handedly did all this. I am curious what moved Bloomberg to start a project like this.

we have an intern this summer create bindings for our internal JS stack. we have some internal stuff running on server side in OCaml which we wish to move to client side. I would say many thanks to my boss and employer's great support

BTW, congratulations on the 1.0 milestone!

How did you become so proficient with the OCaml compiler internals? When you started the project did you already know that you can compile to idiomatic js or was that discovered through experimentation?

Re: Announcing BuckleScript 1.0

#36
post #27

Earlier quoted context omitted.

Think Elixir for Erlang. Currently it's a syntax on top of OCaml. But we'd like to polish the OCaml ecosystem tooling too; we're calling the umbrella project "Reason".

> Currently it's a syntax on top of OCaml. Does this just mean it compiles to OCaml?

There's a crucial distinction! OCaml's compilation command takes in a `-pp` flag (preprocessor), which accepts a command that takes in a file and outputs an OCaml AST tree. We're basically using that. In that sense, the official OCaml syntax is really just that: another syntax like Reason, but official, and goes back two decades.

Because of the clean mapping from one syntax to another, you can toggle between the two fairly easily: https://github.com/facebook/reason/wiki/Newcomer-Tips-&-Tric...

Re: Announcing BuckleScript 1.0

#37
post #31

I am one of the authors of BuckleScript, you can try BuckleScript in the browser: http://bloomberg.github.io/bucklescript/js-demo/ Click Examples see how the JS code generated, questions are welcome!

Very neat. Can BuckleScript compile Core?

as long as it is vanilla OCaml (no c stubs), it should be fine

Re: Announcing BuckleScript 1.0

#38

This looks really cool. How does the integration with external JavaScript libraries work? Could I use this with something like Three.js?

Definitely, almost half the time is spent in polishing the FFI. Check out the FFI section in the Manual. OCaml's type system is so powerful, that it can model most js libraries without writing JS stubs code

Re: Announcing BuckleScript 1.0

#40
This is one of the few JS compiled languages that interest me: Some of these languages add a very thin syntactic layer on Javascript and maybe a type system. If I wanted Javascript, I'd use Javascript, and if I wanted types, I'd use Flow, not a new programming language that's kinda-sorta-not-really JS.

That leaves this, Clojurescript, and SPOCK as the only really interesting projects. They all have runtimes that are unpleasantly large (well, Buckle may not), but that's the price of a new language.

However, Clojurescript leaves a bad taste in my mouth, and SPOCK stresses javascript implementations in interesting ways. I'm not really a fan of OCaml, but Buckle looks interesting, and more enjoyable/practical than the other two.

Post reply on HN