Skip to content

Instantly share code, notes, and snippets.

@Raynos
Last active August 29, 2015 13:57
Show Gist options
  • Save Raynos/9658555 to your computer and use it in GitHub Desktop.
Save Raynos/9658555 to your computer and use it in GitHub Desktop.

JavaScript minus minus (JS--)

A slimmed down version of javascript without features.

Features

Module system

import is syntax, not a function, not dynamic.

import foo from 'bar'

return myModuleExports

Values

  • null
  • Booleans
  • Unicode strings
  • Integers
  • Floating point numbers
  • Structs

Arrays and Objects

Like JS but no methods, just data structures.

Also immutable by default.

For back compat with JSON

Tail recursion

Everything is an expression where possible

no if, no for

first class functions + closures

function foo(x) {
  function bar() {
    return x * 2
  }

  return bar
}

No function expressions, no anon functions.

No exceptions, no try catch

New features

  • macros?

Hmm...

A lisp in JS syntax ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment