JS Adventure

35761e3936deba2f8189c2d20982c771?s=47 Kyle Simpson
October 10, 2014

JS Adventure

"Choose Your Own JavaScript Adventure"

The JS standard only gets you so far. Want to really step up your game at writing code? You gotta make your own JavaScript.

Yeah, yeah, ES6 is awesome. Everyone knows that. We’re all excited about not having to write the word ‘function’ anymore. But, isn’t it about time we stop obsessing so much about what TC39 puts into the official language spec?

Let’s talk about making and using tools (built in JS, of course!) to customize the language itself to your own liking. We’ll talk about macros, code parsers and transpilers, and other fun tricks to put the control of the language back in your fingers.

Make your own JavaScript. And no, that doesn’t have to stop you from playing nicely with others.

35761e3936deba2f8189c2d20982c771?s=128

Kyle Simpson

October 10, 2014
Tweet

Transcript

  1. 2.

    You are Brendan Eich, employed at Netscape in May 1995.

    Your boss asks you to design a new language for the browser, but gives you only 10 days to complete it. Choose your next adventure! To agree and give it your best shot, turn to page 39. To laugh and walk away, turn to page 262. pg 16 pg 17
  2. 3.

    You’ve learned the ins and outs of JavaScript, but lots

    of things still “bug” you. [] == ![] is just too unbearable to go on. Choose your next adventure! To give up on JS and move to go, turn to page NaN. To explore your own custom JS, turn to page 2 . 01e+2. pg 402 pg 403
  3. 5.

    vs.

  4. 6.
  5. 14.
  6. 15.
  7. 16.
  8. 17.
  9. 20.
  10. 21.
  11. 46.
  12. 51.

    • esprima/acorn (parser) • escodegen (code generator) • escope/eslevels (scope

    analyzer) • istanbul (code coverage) • estraverse (analyze AST) • eslint (pluggable code linting rules) • plato/jscomplexity.org (complexity)
  13. 52.

    • auto-correct misspellings • safely re-arrange scope • consolidate declarations

    • automatically reduce complexity • refactor boolean traps • optimize performance • ...
  14. 54.