Live data from Hacker News

Announcing BuckleScript 1.0

bloomberg.github.io

21–30 of 78 posts

Re: Announcing BuckleScript 1.0

#21

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!

From a practical standpoint, what's the difference between js_of_ocaml?

it is generate more readable JS. and we have spent lots of time in polishing the FFI to make OCaml/JS interaction easier

Re: Announcing BuckleScript 1.0

#22
I've been following Bucklescript's development from the sidelines for the last couple of months along with Facebook's Reason (https://facebook.github.io/reason/javaScriptCompared.html).

I'm very optimistic about the future of these two projects. Both are working hard to build a soundly-typed platform on top of the JS ecosystem. While there are tons of existing languages that can be compiled to JS, the most successful ones are those (like Typescript) that embrace the npm ecosystem and the huge community investment it represents.

Both Bucklescript and Reason have a huge focus on seamless JS interop and DX, and stand a good chance of bringing soundly-typed functional programming to a much wider audience!

Re: Announcing BuckleScript 1.0

#23
post #17

Earlier quoted context omitted.

Reason describes itself as "a meta language toolchain to build systems rapidly", which seems a little vague to me. Am I understanding correctly that Reason is both a (kind of) alternative compiler for OCaml's build toolchain, and a dialect of OCaml in its own right? To tie this back to Bucklescript, does this loosely describe the process of using Reason syntax to author Javascript? Reason file -> (Reason) -> OCaml ex…

If you'll forgive the shameless plug, I talked a bit about ReasonML here, hopefully it helps clear things up https://youtu.be/QWfHrbSqnB0?t=29m34s Basically, just a new syntax and a blessed-stack approach that really, really emphasizes developer experience. Which is to say, ReasonML is merely a cosmetic and DX change, it remains compatible and is not a fork of OCaml at all.

Thanks, that's very helpful!

Re: Announcing BuckleScript 1.0

#24

Earlier quoted context omitted.

Reason describes itself as "a meta language toolchain to build systems rapidly", which seems a little vague to me. Am I understanding correctly that Reason is both a (kind of) alternative compiler for OCaml's build toolchain, and a dialect of OCaml in its own right? To tie this back to Bucklescript, does this loosely describe the process of using Reason syntax to author Javascript? Reason file -> (Reason) -> OCaml ex…

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

That will be great. Ocaml is great language, but not that user friendly.

Elixir is pretty mature nowadays. Reason still have a long way to go. Hope that will happen.

Re: Announcing BuckleScript 1.0

#25
Very cool!

I'm surprised by this one:

https://bloomberg.github.io/bucklescript/js-demo/#Curry_Opti...

Why doesn't it actually curry? Impressive output, don't get me wrong. But given how native and idiomatic currying is in Javascript, and how much trouble I'd expect this to have taken to implement... is there a specific reason for this? Just curious.

Anyway, again: very impressive. Thanks.

EDIT clarification: I expected:

    function f(param) {
        return curry(32, param);
    }
(or is this to highlight the difference between currying and partial function application?)

Re: Announcing BuckleScript 1.0

#26

Very cool! I'm surprised by this one: https://bloomberg.github.io/bucklescript/js-demo/#Curry_Opti... Why doesn't it actually curry? Impressive output, don't get me wrong. But given how native and idiomatic currying is in Javascript, and how much trouble I'd expect this to have taken to implement... is there a specific reason for this? Just curious. Anyway, again: very impressive. Thanks. EDIT clarification: I expect…

Looks like it's just an optimization. If you change to

  let test_curry x  y =  x + y + x
You get the expected output

  function f(param) {
    return test_curry(32, param);
  }

Re: Announcing BuckleScript 1.0

#27

Earlier quoted context omitted.

Reason describes itself as "a meta language toolchain to build systems rapidly", which seems a little vague to me. Am I understanding correctly that Reason is both a (kind of) alternative compiler for OCaml's build toolchain, and a dialect of OCaml in its own right? To tie this back to Bucklescript, does this loosely describe the process of using Reason syntax to author Javascript? Reason file -> (Reason) -> OCaml ex…

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?

Re: Announcing BuckleScript 1.0

#28

Very cool! I'm surprised by this one: https://bloomberg.github.io/bucklescript/js-demo/#Curry_Opti... Why doesn't it actually curry? Impressive output, don't get me wrong. But given how native and idiomatic currying is in Javascript, and how much trouble I'd expect this to have taken to implement... is there a specific reason for this? Just curious. Anyway, again: very impressive. Thanks. EDIT clarification: I expect…

btw, we also have native uncurried calling convention support to make callback even more efficient

Re: Announcing BuckleScript 1.0

#29

I was wondering about the practical differences between BuckleScript and js_of_ocaml. Found this brief explanation in the docs[0]: > Js_of_ocaml takes lowlevel bytecode from OCaml compiler, BuckleScript takes the highlevel rawlambda representation from OCaml compiler I presume that means different (higher-level) optimisations are available in BuckleScript? > Js_of_ocaml focuses more on existing OCaml eco-system(opam)…

yes, it is actually easier to optimize since you have more herusitics. both compiled to js, so yes, it can work together : )

Re: Announcing BuckleScript 1.0

#30
post #6

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!

I just wanted to say thanks to the authors of Bucklescript. Not sure if I'll ever get to use it in a production system, but definitely awesome tech. I played with it a little bit and I think an OCaml React app might actually compile faster than the same thing written in ES6 and compiled/built through the normal babel+webpack toolchain.

you should checkout reason, they are working on bindings using bucklescript. So it is not a dream, people probably can write react app using ocaml very soon
Post reply on HN