Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-27 Thread Bob Zhang
Hi Gordon, your facts can be changed every post. And you spent a month in tweaking your elm expert's code to match the perf of newbie's BuckleScript code, I am still not sure you reach there. I suggested we take the discussions off the list very very early, most people have very busy professional

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-26 Thread Bob Zhang
As I said, you already get convinced elm is better for you, then happy coding in elm. I am not interested in a biased judgement. On Thu, Jan 26, 2017 at 7:29 PM GordonBGood wrote: > On Thursday, 26 January 2017 21:13:33 UTC+7, Bob Zhang wrote: > > Hi Gordon, > I think it is inap

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-26 Thread Bob Zhang
hon against JS, Python users *rewrite the hot function *in C and call it from Python due to the incapability of Python. On Thu, Jan 26, 2017 at 4:31 AM, GordonBGood wrote: > On Wednesday, 25 January 2017 19:25:40 UTC+7, Bob Zhang wrote: >> >> I cannot help replying when I see some

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-26 Thread Bob Zhang
small difference between uglify and google > closure with advanced_opts. If Elm had been compiled into modules, then > uglify would have done much worse. > > > torsdag 26. januar 2017 02.37.59 UTC+1 skrev Bob Zhang følgende: > > Not really, closure has very very advanced optimi

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-25 Thread Bob Zhang
Not really, closure has very very advanced optimizations that uglify does not even come close . If you feed bad code to it , of course it won't help too much. There are limitations to closure and its limitations are documented unclearly, so you have to be very careful On Wed, Jan 25, 2017 at 8:09 P

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-25 Thread Bob Zhang
Note, we are working on es6 modules for BuckleScript, which means you don't need google closure compiler for tree shaking, it will benefit webpack/rollup/browserify users too! On Wed, Jan 25, 2017 at 10:56 AM, OvermindDL1 wrote: > I use browserify for some code via brunch, rollup for others, I r

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-25 Thread Bob Zhang
I am not interested in campaign, it's not fun. But I cannot help replying when I see some inexact arguments... elm is a reasonably fast language, I think it might run even faster than purescript, enjoy your work! On Wed, Jan 25, 2017 at 4:55 AM Robin Heggelund Hansen wrote: > > Actually tree shak

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-24 Thread Bob Zhang
s when choosing a language, as long as you enjoy it, then it's great. Have fun with your favorite language! On Tue, Jan 24, 2017 at 11:53 PM Bob Zhang wrote: I have been working on compilers professionally for more than 8 years, I did not read your ocaml code, so I am not sure it's p

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-24 Thread Bob Zhang
I have been working on compilers professionally for more than 8 years, I did not read your ocaml code, so I am not sure it's performant ocaml code. But anyway, I think you already convinced yourself elm suits your need better :-) On Tue, Jan 24, 2017 at 11:44 PM GordonBGood wrote: > On Tuesday, 2

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-24 Thread Bob Zhang
Thanks for your update. To be fair, BuckleScript is a one year project, I will keep focused on improving performance and build speed, I assure that you can expect even more amazing perf. Btw, we have some of the best front end developers to actively working on UI frameworks using BuckleScript :-)

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-24 Thread Bob Zhang
a problem as > Elm doesn't use arrays directly, but it isn't strictly type safe. > > > On Tuesday, 24 January 2017 09:16:11 UTC+7, Bob Zhang wrote: > > We do bounds check, but we also provide unsafe version which does not do > bound check for performance reasons. If you

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-23 Thread Bob Zhang
Sorry, typo... I mean data representation is not the only reason that BuckleScript runs fast On Mon, Jan 23, 2017 at 9:41 PM Bob Zhang wrote: > I agree, we did a lot of work to engineer performance, data representation > is part of the reason that BuckleScript running fast, it's def

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-23 Thread Bob Zhang
I agree, we did a lot of work to engineer performance, data representation is part of the reason that BuckleScript running fast, it's definitely the only one On Mon, Jan 23, 2017 at 9:37 PM Richard Feldman wrote: > The reason is that BuckleScript proves that Arrays are faster than > "string" tagg

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-23 Thread Bob Zhang
We do bounds check, but we also provide unsafe version which does not do bound check for performance reasons. If you find the safe function which does not, you are welcome to file an issue On Mon, Jan 23, 2017 at 8:41 PM GordonBGood wrote: > On Tuesday, 24 January 2017 01:26:49 UTC+7, OvermindDL1

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-16 Thread Bob Zhang
This will be a fundamental change to the architecture of the elm compiler, it is cool to see elm is also moving in this direction in the next several months! On Mon, Jan 16, 2017 at 1:09 AM GordonBGood wrote: > Richard and Hongbo, I'm relieved to know that others are aware of the long > compilati

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-15 Thread Bob Zhang
g will add up On Sun, Jan 15, 2017 at 9:23 PM GordonBGood wrote: > On Monday, 16 January 2017 02:54:17 UTC+7, Bob Zhang wrote: > > Hi Gordon, > > It is not uncommon to see 100 times slowness when building Elm vs OCaml in > incremental build (dev time), the reason is that Elm (cor

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-15 Thread Bob Zhang
Hi Gordon, In case you are interested, this is a link I made to show the excellent compile time performance of BuckleScript (https://twitter.com/bobzhang1988/status/810508070350680066 ) It takes around 0.58s to do a clean build: 55 mo

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-14 Thread Bob Zhang
I would be very surprised if parsing is the bottle neck. In most cases, type checking and register allocations (could be quadratic) takes much more time. OCaml's type checking algorithms is very clever, almost linear in most practical use cases. On Sat, Jan 14, 2017 at 11:14 PM Richard Feldman < ri

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-13 Thread Bob Zhang
Note by default OCaml is immutable, purely functional style does not guarantee more optimizations opportunities, if you profile real world OCaml programs vs real world Haskell programs you know what I mean. Let's forget about JS backend, in practice, OCaml native backend runs faster is mostly due t

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-12 Thread Bob Zhang
We do have around 12 passes to optimize js code, will have more advanced optimizations coming in 1.5 Note the optimization is written carefully so it will not slow down compile time. To squeeze the compiler performance, some performant critical code was changed to c in recent release On Thu, Jan 12

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-11 Thread Bob Zhang
4, so the combination of ReasonML and BuckleScript is seamless. Thanks -- Hongbo On Wed, Jan 11, 2017 at 10:37 AM, GordonBGood wrote: > > On Thursday, 5 January 2017 21:46:26 UTC+7, Bob Zhang wrote: >> >> Indeed, in OCaml native backend, `for loop` still dominates the >&

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-05 Thread Bob Zhang
can still write low level code with type safe guarantee in it when performance matters On Thu, Jan 5, 2017 at 12:32 AM, GordonBGood wrote: > On Wednesday, 4 January 2017 21:05:58 UTC+7, Bob Zhang wrote: >> >> Hi Gordon, >> As you can see, BuckleScript already did a very g

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-04 Thread Bob Zhang
Hi Gordon, As you can see, BuckleScript already did a very good good job here, of course, there are still places for improvement. To write extremely high performance code, you should avoid creating a closure in a tight loop, here you can lift the `nxtc` into the toplevel, in the future, we will d

Re: [elm-discuss] Re: Same code generated by BuckleScriptRe: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-03 Thread Bob Zhang
limitation of JavaScript. > And you remember correctly, IEEE 64-bit floats have 53 bits including sign > bit in the mantissa. > > Also, OCaml and Haskell are about the same age, although OCaml is based on > the older SML, but as for the 'feel' of it there are two things to no

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-02 Thread Bob Zhang
pers are also working on high quality ReactJS bindings Happy New York and enjoy your favorite language! On Sun, Jan 1, 2017 at 11:04 PM, GordonBGood wrote: > On Sunday, 1 January 2017 22:27:40 UTC+7, Bob Zhang wrote: >> >> Note that a high quality optimizing compiler lik

Re: [elm-discuss] Re: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2017-01-01 Thread Bob Zhang
Note that a high quality optimizing compiler like BuckleScript outperforms native JS significantly > Elm. (See the benchmark here: http://bloomberg.github.io/bucklescript/slides/preview/bb-reveal-example-presentation.html#/5/1 ) On Sun, Jan 1, 2017 at 9:48 AM, GordonBGood wrote: > On Wednesday,

[elm-discuss] Re: Same code generated by BuckleScriptRe: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2016-12-31 Thread Bob Zhang
par with Haskell) On Saturday, December 31, 2016 at 8:35:28 AM UTC-5, GordonBGood wrote: > > On Saturday, 31 December 2016 11:44:10 UTC+7, Bob Zhang wrote: >> >> >> Just for fun, I pasted the same code under BuckleScript playground: >> >> >> https://bloo

[elm-discuss] Same code generated by BuckleScriptRe: Elm "faster than JavaScript" (version 0.18) - NOT - Parts I and II...

2016-12-30 Thread Bob Zhang
Just for fun, I pasted the same code under BuckleScript playground: https://bloomberg.github.io/bucklescript/js-demo/?gist=efaf57aef9b37a38785681ded0ba35a9 The generated code is below ```js function testProg(n) { var lmt = Pervasives.min(n + 1 | 0, 10); var _i = n; while(t