Intel 8080 CPU emulation in JavaScript

This week end, I wanted to try a real world project to play more with TypeScript. Why TypeScript? Because I wanted to leverage a few ES6 features but also type checking. Note that I did not use strong typing, but just relied on the inference of types provided by the TypeScript compiler. A few years ago, I wrote an Intel 8080 CPU emulator in ActionScript 3 and thought this would

Read more

A JavaScript refresh

  Versions Assembly language of the web No compiling Tools REPL Getting started A dynamically typed language Variables and scope Type conversions Runtime exceptions Primitive and composite datatypes Boolean Number Object and properties Almost everything as an object Null and undefined Loops Array Iterator Date Function Context of execution Prototype, the good old friend Closure Garbage collection Object pooling We will cover here some of the key concepts of JavaScript

Read more

From microphone to .WAV with: getUserMedia and Web Audio

Update: The new MediaStream recording specification is aiming at solving this use case through a much simpler API. Follow the conversations on the mailing list. A few years ago, I wrote a little ActionScript 3 library called MicRecorder, which allowed you to record the microphone input and export it to a .WAV file. Very simple, but pretty handy. The other day I thought it would be cool to port it to

Read more

Concurrency in JavaScript

Just like with Flash, JavaScript code runs by default on the UI thread, and any expensive computation will usually affect the UI responsiveness. As you may know, at 60 fps, you have around 16ms (1000ms/60) per frame to do what you have to do (computations, rendering and other misc logic). If you exceed that budget, you will alter the frame rate and potentially make your content feel sluggish or worse,

Read more

Writing cross-platform apps with Node-WebKit

Last week, the daycare where my son stays told me they were desperately looking for an application to save them a lot of precious time. Every month, they have someone from the school spend 3 hours dealing with invoices. The process is crazy manual, no automation at all: An Excel (xls) spreadsheet contains all the tuitions due by parents and is updated every month. A new PDF is created manually

Read more