EmojiScript: emotion literals, emotional algebra, and more for JavaScript
Branch: master
Clone or download
jlongster Merge pull request #1 from jgmize/linux-font-install
Add font installation instructions for Linux users
Latest commit 06742e6 Jun 1, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin fix script May 30, 2014
macros final updates 🙀 May 28, 2014
runtime restructure, modularize May 27, 2014
.gitignore use node_modules May 28, 2014
README.md Merge pull request #1 from jgmize/linux-font-install Jun 1, 2014
example.js fix terminating cat May 27, 2014
package.json fix script May 30, 2014

README.md

EmojiScript

EmojiScript is an extension of JavaScript that features emotion as a value. Use emotion literals with the most expressive language ever. It is implemented with sweet.js macros (using a fork of it since it doesn't natively support emoji...).

$ npm install emojiscript
$ emo file.js

The file example.js has example code.

EmojiScript is just a set of sweet.js macros, so you can use them individually if you want:

cat runtime/runtime.js && \
  ./sweet.js/bin/sjs \
      -m ./macros/poop.js \
      -m ./macros/algebra.js \
      -m ./macros/error.js \
      -m ./macros/terminating-cat.js \
      example.js

Since it compiles to JavaScript, you get all the features to JavaScript in addition to:

Emotional Algebra

😄  + 🔥  == 😱;
😄  + 💥  == 😭;
😄  + 💧  == 😅;

for(var i=0; i<10; i++) {
  console.log(😄  + i);
}

😄
😅
😆
😇
😈
😉
😊
😋
😌
😍

😍  > 😞  == true;

Discourage Bad Operators

// Instead of
if(obj1 == obj2) { ... }

// Use this
if(obj1 💩  obj2) { ... }

Errors

// Instead of
throw new Error("something is wrong")

// Use this
😡"something is wrong"

Automatic Cat Insertion

// Instead of
var foo = 1 + 2;
var bar = baz();
var user = 😄 + 💥;

// Use this
var foo = 1 + 2😸
var bar = baz()😸
var user = 😄 + 💥😸

Better Expressiveness

if(user < 😄 ) {
  😡 "be happy"😸
}

Can't see all the Emoji?

Ubuntu and other Debian-based systems:

sudo apt-get install ttf-ancient-fonts

Fedora:

sudo yum install gdouros-symbola-fonts

Other Linux distros:

mkdir -p ~/.fonts
cd ~/.fonts
wget http://users.teilar.gr/~g1951d/Symbola.ttf