31: JavaScript is the New C - JSToElm
All Episodes

31: JavaScript is the New C

My thesis is that in a few short years JavaScript will be considered in the same realm as programming in C. Meaning to write an application in JavaScript will be considered "mid level", error prone, dangerous (dangling pointers), lowest common denominator, and only really used when you need to leverage a specific use case. To say in 5 years we won't be using JS, is incorrect, I think it will have the same longevity as C. It is built into the fabric of so many things as a dependency. I would say, I think day to day developers will **NOT** be writing in plain JavaScript, but rather a higher level language, that will target JS at compile time.

C Lang JavaScript
operating systems everywhere the web everywhere
Compile Target Compile Target
Null references Undefined
Performance Yeah, JS is stupid fast too

JavaScript is the new C

  • JavaScript is Dead, long live JavaScript
  • Used to be really straight forward to get started with JS. Open a text editor / browser and write some code.
  • JS ecosystem now has task runners, bundlers, transformers, CommonJS / ES Modules, minify, source maps, package management w/ npm, dev servers, prod performance builds, virtual DOM rendering, V8 performance,
  • I would contest that JS has never been an is “easy” language to master, but an easy platform to be productive in. With the list above, I believe that easability is now gone.
  • Languages that interact with C, but would you want to write your next application in C?

    • C++
    • Java
    • Golang
    • C#
    • Python
    • Haskell
    • Objective C
  • Languages that interact with JS, but would you want to write your next application in JS?

    • Elm. Elm is a purely functional programming language that compiles to JS, HTML, and CSS. …
    • Dart. Read Modern JavaScript. …
    • TypeScript. TypeScript is a superset of JavaScript; a valid JavaScript program is also valid TypeScript but adding static typing. …
    • PureScript. …
    • CoffeeScript. …
    • ClojureScript. …
    • Scala.js. …
    • Reason…
    • and on and on…
  • Is it that silly of a question ? We’ve seen the recent explosion of languages that currently target JS to enable them take advantage of not just the web, but the ecosystem that comes with JS, PORTS cough cough
  • Languages that are built as supersets of C and JS have a common theme, “to overcome perceived shortcomings of C/JavaScript”
  • Where does web assembly fit in all this?

    • Well, this transition to higher level languages that compile to JS, has been happening for roughly 10 years now. And it’s just now, I think, reaching a tipping point of main stream. Look at us here! We have just barely begun to scratch the surface of this potential.
    • I want wasm today too, but sadly it will like be years before we see the fruits of labor happening in that space now. But man it’s so cool to follow.
  • From the author himself, circa 2011

    “The new “better is better” hope for multiple languages is NaCl. It was the driver for the Pepper API that failed by being too chromium-specific. Hope springs eternal, but IMHO the C/C++ toolchains will have CFI enforcement for portable safe binary code sooner than the browser vendors will agree on NaCl and Pepper2 or 3.The “worse is better” hope is compilation to JS combined with language and VM evolution. That is my bet. And I am putting money on it at Mozilla.”

  • JavaScript++

    • I rest my case!

Picks

Resources

Follow

Published 5 Apr 2018

A show about learning Elm, Functional Programing, and generally leveling up as a JS developer.
JavaScript To Elm on Twitter