Live data from Hacker News

The State of Babel

babeljs.io

51–60 of 109 posts

Re: The State of Babel

#51
post #30

Earlier quoted context omitted.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

I am a Ruby dev so I definitely don't pretend to know, however it does seem wild that something like Babel is even needed. It seems to me that it's like trying to mix Ruby 1.8.7 and 2x in the same project and needing a tool to translate it into 1.9.3. Why not just write in 1.9.3 if that's the required target? I clearly don't know what I'm talking about but what's wrong with actually just writing the JavaScript that B…

Because browser bugs, platform features, and language features have always been a mish-mash and a set of moving targets. See the ES6 language compatibility tables for a visualization ( http://kangax.github.io/compat-table/es6/ ).

So, the choices are either only use features once you _know_ that a large enough percentage of your target audience supports it, or transpile newer syntax into older, more widely compatible syntax.

Re: The State of Babel

#52

Earlier quoted context omitted.

I am a Ruby dev so I definitely don't pretend to know, however it does seem wild that something like Babel is even needed. It seems to me that it's like trying to mix Ruby 1.8.7 and 2x in the same project and needing a tool to translate it into 1.9.3. Why not just write in 1.9.3 if that's the required target? I clearly don't know what I'm talking about but what's wrong with actually just writing the JavaScript that B…

Nobody's really mixing versions, it transpiles ES6 and above to ES5. You don't have to use Babel, you only use it if you want to use the latest version of JS, ES6. You can happily just use ES5, and many people do. Why use ES6? Firstly, it's a much better version, it solves a lot of problems (chief of all, it has a module system which ES5 doesn't have, not built in at least). Second, JS technology moves incredibly fas…

It will be years and years before transpiling for backwards compatibility is no longer necessary. I breathe a sigh of relief when I learn that our customers are using something as modern as IE 11.

Re: The State of Babel

#53
post #22
post #3

Earlier quoted context omitted.

It's no worse than any other ecosystem. Modern Java development is just as prickly -- the only difference is the complexity is more established. JS is still very "wild-west" because the community is still making rapid progress towards an ideal environment.

I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress", rather than a lack of strong stewardship/leadership leading to people reinventing the wheel. I haven't worked with Java for a long time, but from what I've been hearing from colleagues who are exploring writing production software with it, .NET Core is currently a bit of a mess, showing that even coherent dev stories can easily sli…

> I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress",

It's the field that is progressing rapidly. Browsers are constantly adding new APIs, problems are being solved, etc. The difference is that it's open source

> a lack of strong stewardship/leadership

You can't have leadership in a field which has no owner. It's not like Oracle owning Java and deciding what happens with it.

> people reinventing the wheel.

This is a stereotype by people who don't really know the subject. Every new tool improves on the previous one. For example, grunt was the first JS build tool, it had some issues (huge configurations, and speed) some someone invented gulp, which uses streams for speed and code instead of configuration. But streams don't handle splitting files in bundles and other problems so well, so webpack was invented. There are overlaps but they all solve different problems, and all improve on the previous generation. They are not "reinventing the wheel"

Re: The State of Babel

#54
post #52

Earlier quoted context omitted.

Nobody's really mixing versions, it transpiles ES6 and above to ES5. You don't have to use Babel, you only use it if you want to use the latest version of JS, ES6. You can happily just use ES5, and many people do. Why use ES6? Firstly, it's a much better version, it solves a lot of problems (chief of all, it has a module system which ES5 doesn't have, not built in at least). Second, JS technology moves incredibly fas…

It will be years and years before transpiling for backwards compatibility is no longer necessary. I breathe a sigh of relief when I learn that our customers are using something as modern as IE 11.

Well, yeah, by then we'll have to go back to serve different JS files for different browsers. Luckily old IEs support conditional comments so it shouldn't be an issue.

Re: The State of Babel

#55
post #22

Earlier quoted context omitted.

I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress", rather than a lack of strong stewardship/leadership leading to people reinventing the wheel. I haven't worked with Java for a long time, but from what I've been hearing from colleagues who are exploring writing production software with it, .NET Core is currently a bit of a mess, showing that even coherent dev stories can easily sli…

> I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress", It's the field that is progressing rapidly. Browsers are constantly adding new APIs, problems are being solved, etc. The difference is that it's open source > a lack of strong stewardship/leadership You can't have leadership in a field which has no owner. It's not like Oracle owning Java and deciding what happens with it. > peopl…

How many times do we have to rewrite make in nodeJS?

Re: The State of Babel

#56
post #47

Earlier quoted context omitted.

Except that they are two different versions of JS. It's like transpiling from Java 8 to 6

I'd consider transpiling from have 8 to 6 equally crazy. If the target is Java 6 you write Java 6.

You don't get it. In FE the target is Java 8, 7, 6, 5, 4 and 3. Everybody uses different browsers, on different devices. If you wait for the least common denominator all websites would still look like geocities

Re: The State of Babel

#57
post #55

Earlier quoted context omitted.

> I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress", It's the field that is progressing rapidly. Browsers are constantly adding new APIs, problems are being solved, etc. The difference is that it's open source > a lack of strong stewardship/leadership You can't have leadership in a field which has no owner. It's not like Oracle owning Java and deciding what happens with it. > peopl…

How many times do we have to rewrite make in nodeJS?

Make doesn't solve all the problems those tools solve.

Re: The State of Babel

#58
post #55

Earlier quoted context omitted.

> I disagree that the constant churn in FE/JS is necessarily a sign of "rapid progress", It's the field that is progressing rapidly. Browsers are constantly adding new APIs, problems are being solved, etc. The difference is that it's open source > a lack of strong stewardship/leadership You can't have leadership in a field which has no owner. It's not like Oracle owning Java and deciding what happens with it. > peopl…

How many times do we have to rewrite make in nodeJS?

A lot:

https://www.npmjs.com/search?q=make+build

Re: The State of Babel

#59
post #47

Earlier quoted context omitted.

I'd consider transpiling from have 8 to 6 equally crazy. If the target is Java 6 you write Java 6.

You don't get it. In FE the target is Java 8, 7, 6, 5, 4 and 3. Everybody uses different browsers, on different devices. If you wait for the least common denominator all websites would still look like geocities

Man, I miss geocities...

Re: The State of Babel

#60

Earlier quoted context omitted.

By the way, it's absolutely painless to setup Babel. To use ES6/ES7/ES8 (e.g. async/await), it's just: npm install --save-dev babel-cli babel-preset-latest And then in the package.json: "scripts": { "build": "babel src -d dist --presets latest" }

That's definitely not the impression given by the setup page: http://babeljs.io/docs/setup/ I'm an experienced front-end developer and I must say that that list is intimidating.

You really don't have to use all of them of course. Pick one and that should be good for the environment that's specified there.
Post reply on HN