• Stars
    star
    290
  • Rank 142,981 (Top 3 %)
  • Language
    C
  • Created almost 4 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

☕️ The world's first JavaScript engine written in 1995 by Brendan Eich, now compiled back to JS and WASM!

Mocha 1995

The original Mocha JavaScript engine, ported from Netscape 3.0.2 browser.

mocha-wasm

History

"Mocha" was the code name of the first JavaScript engine, originally written by Brendan Eich in his 10-day May 1995 sprint. For all of 1995 and most of 1996, Eich was the the only Netscape developer working full-time on the JavaScript engine. Untill August 1996, the Mocha codebase still consisted primarily of code from the 10-day prototype.

In late 1996, Eich "stayed home for two weeks to rewrite Mocha as the codebase that became known as SpiderMonkey", the JavaScript engine later released as open-source and currently maintained by the Mozilla Foundation.

Here is the source code of production version of Mocha, which ships as JavaScript 1.1. This version is released in August 1996 with Netscape 3.0. The release of JavaScript 1.1 marks the completion of the initial definition and development of JavaScript.

Live Playground

Besides native binary, the ported Mocha engine can also be compiled to WASM and JavaScript:

Build

For WASM and JS build, please make sure Emscripten is installed and activated (emcc command is available):

$ source build.sh

# build native
$ compile_native

# build WASM
$ compile_wasm

# build js
$ compile_js

The Web build generates out/mocha_shell_js.html and out/mocha_shell_wasm.html as entries. For the native build, there is a binary runtime available:

$ out/mo_shell tests/ack.mocha

Debugging

The CMakeLists.txt is added for single-step debugging on Linux with CLion.

$ cd out
$ cmake -H"../" -B"./" -DCMAKE_BUILD_TYPE=MinSizeRel
$ make

Resources

License

License status of original Netscape source code is unknown yet. This port is intended for historic preservation and educational usage. Don't use in commerial projects!

More Repositories

1

jshistory-cn

🇨🇳 《JavaScript 二十年》中文版
TypeScript
4,205
star
2

beam

✨ Expressive WebGL
JavaScript
516
star
3

react-ssd1306

📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.
C
360
star
4

freecube

⚛ Solve Rubik's Cube with WebGL in 10KB.
JavaScript
127
star
5

sinomap

🌎 Super lightweight canvas map lib.
JavaScript
107
star
6

webgl-seminar

代码清晰、直接、可追溯的一系列 WebGL 示例
JavaScript
105
star
7

learn-wgpu-cn

🇨🇳 《Learn Wgpu》中文版
Rust
104
star
8

nativebird

🐦 Bluebird alternative within ~200 loc
JavaScript
78
star
9

minimal-js-runtime

A toy JavaScript runtime based on QuickJS and libuv.
C
66
star
10

bumpover

🚧 Async data transforming with simple rules.
JavaScript
65
star
11

merry8

📺 Chip-8 emulator for web.
JavaScript
53
star
12

vue-cmap

Vue China map visualizing component, supports drilldown and lazy loading.
JavaScript
39
star
13

fe-native-lang

Native language guide for FE developers.
C
31
star
14

crdt-and-local-first

A slide - WIP
Vue
28
star
15

HTML-Toy-Parser

一个玩具级的 HTML 转虚拟 DOM 编译器
JavaScript
27
star
16

ove-lang

👓 ove-lang, a language for his true fans.
HTML
26
star
17

vue-springbud

不是最简洁的 Vue 生产环境模板
JavaScript
24
star
18

MiyooSDK

🐳 Docker environment for developing Miyoo Linux apps.
Dockerfile
23
star
19

blog

📝 My tech blog.
JavaScript
22
star
20

psp-js

Modern JavaScript runtime for Sony PSP, based on rust-psp and QuickJS.
Rust
19
star
21

nano-mvc

Demo MVC framework in 40 lines, 1KB
JavaScript
18
star
22

slate-doc-cn

🇨🇳 Translation of Slate.js official doc.
14
star
23

rx-elevator-demo

Reactive Demo
JavaScript
14
star
24

flylog

Front end AOP logging and monotoring tool.
Vue
13
star
25

naming-style-demo

前端框架命名风格比较
JavaScript
12
star
26

learn-cs

💾 Resources learning basics.
Assembly
11
star
27

ustc-gpa

GPA calculator for USTCers
JavaScript
10
star
28

naiveScroll

Tiny jQuery full page scroll effect plugin.
JavaScript
10
star
29

repeater

📼 Record browser events as visual test case.
JavaScript
9
star
30

js-framework-intro

JavaScript 框架设计入门
9
star
31

render-adapters-poc

POC for customizing UI framework renderers.
JavaScript
6
star
32

gomoku

JavaScript Gomuku AI for Web
JavaScript
5
star
33

eslint-plugin-pangu-comment

Pangu whitespace for Chinese comments.
JavaScript
4
star
34

zlayer

⚡️ Image render layer with GPU acceleration.
JavaScript
4
star
35

psp-test-app

Simple test app based on rust-psp
Rust
4
star
36

icard-ustc

Consume record analyzer for USTCers
Python
3
star
37

examples

Static HTML examples just for fun :)
HTML
2
star
38

pages-cn

My Blog Dist HTML Pages
HTML
2
star
39

compilExpt

Experimental compiler-related JS project.
JavaScript
2
star
40

rollup-scaffold

A simple rollup config scaffold
JavaScript
2
star
41

visue

vue visualizing dev tool
JavaScript
2
star
42

slate-playground

Pluggable editor playground.
JavaScript
1
star
43

sikuli-coc

HTML
1
star
44

ck.js

cookie lib in 2 lines
JavaScript
1
star
45

legs

Light Easy Gulp Scaffold
JavaScript
1
star
46

n7books

Second hand book exchange platform for USTCers
PHP
1
star
47

nano-computed

explain how computed works in 30 lines.
JavaScript
1
star
48

imdoc

markdown documentation generator
CSS
1
star
49

Markdown-Table-Converter

Edit and reformat markdown table.
JavaScript
1
star
50

tennis-match-recorder

Tennis match recorder and more
JavaScript
1
star
51

ustc-ring

Graduation Ring Exchange Platfrom for USTCers
HTML
1
star