2 ms·
Amen. Babel gets a lot of things right (and arguably has a tougher job than a 3to2 compiler would, given the speed of change and the target breadth / problem su
by chrisweekly 6y ago
Amen. Babel gets a lot of things right (and arguably has a tougher job than a 3to2 compiler would, given the speed of change and the target breadth / problem surface area).
- masklinn 6y ago> arguably has a tougher job than a 3to2 compiler would It doesn't. Not that its job is easy, but its job is to take constructs which are brand new and translate them to an older version of the language. Of the same language. It doesn't have to deal with the language or the APIs literally working differently when used the same way. The Python version of Babel would be 3to3 compiler.
- kqr 6y agoBabel is not limited to JavaScript frontends. You can take any language and write a Babel front-end for it. This is, for example, how Fable compiles F# code to JavaScript. Those two languages are very different from each other -- far more differences than Python 2 and Python 3 -- and it works brilliantly.