Agenda
- JavaScript + Node.js
- JPyScript
- Demos
- Other Projects
Node.js
- JavaScript Runtime
- Based on Google V8 JavaScript Engine
- One thread for JavaScript
- Asynchronous operations via LibUv
- Native Modules
- Module Ecosystem
## A Web Server
```js
var http = require('http');
http.createServer(function (req, res) {
res.writeHeader(200, {'Content-type': 'text/plain'});
res.write('Hello ');
res.end('World');
}).listen(8000);
```
Vibrant Community
Express
- Web Framework
- Based on Connect
- MVC routing and views
- Minimalist
Internal Implementation
- Lexer
- Parser
- Commands and Expression
- Top module
- TDD
Variables
- Maps Python variable to JavaScript variable (variable.py)
- Hoisting (badvariable.py)
- Supports global, nonlocal (canvasserver.py)
Classes
- Spikes
- Wrapping constructors, prototypes
Import
- Resolve to local files (test_calc.py)
- Resolve to modules (domath.py)
- Resolve to Node.js modules (!)
Web Demos
- Using http
- NPM install
- Using express
- Using socket.io
Browser Demos
- Executing text/python
- Using the canvas
THE END
BY Angel 'Java' Lopez / www.ajlopez.com / @ajlopez