- Let’s Build A Simple Interpreter
- Let's Build a Compiler, by Jack Crenshaw
- Project: A Programming Language
- Understanding Compiler Optimization - Chandler Carruth - Opening Keynote Meeting C++ 2015
- Adventures in JIT compilation
- Juozas Kaziukėnas - Building An Interpreter In RPython - PyCon 2016
- Anders Hejlsberg on Modern Compiler Construction
- Build Your Own Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run the file contents in the correct scope or sandbox. Expose | |
// the correct helper variables (require, module, exports) to | |
// the file. | |
// Returns exception, if any. | |
Module.prototype._compile = function(content, filename) { | |
// Remove shebang | |
var contLen = content.length; | |
if (contLen >= 2) { | |
if (content.charCodeAt(0) === 35/*#*/ && | |
content.charCodeAt(1) === 33/*!*/) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install pre-requisites | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y nasm | |
sudo apt-get install -y qemu | |
# Download the sources | |
curl https://gist.githubusercontent.com/ghaiklor/3ef5a07b3de1beb964555183dee18621/raw/59cb9ba42fd71631b0bc0c55e2a27c38f0e8ffaf/boot.asm > boot.asm | |
curl https://gist.githubusercontent.com/ghaiklor/d63e5183773770e07854b5d799ef3a44/raw/fcdc0652fa1c39c5e76379e1bd58ac49922feeeb/loader.asm > loader.asm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[org 0x7C00] | |
[bits 16] | |
KERNEL_OFFSET equ 0x1000 | |
mov [BOOT_DRIVE], dl | |
call load_boot | |
call execute_boot | |
load_boot: |
NOTE: this gist is outdated, refer to this repository instead - https://github.com/ghaiklor/iterm-fish-fisher-osx
- Download and install iTerm2 (it has better color fidelity than the built in Terminal).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Size of one chunk when requesting with Range | |
* @type {Number} | |
* @private | |
*/ | |
const CHUNK_SIZE = 204800; | |
/** | |
* Concat two ArrayBuffers | |
* @param {ArrayBuffer} ab1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"$schema": "https://json.schemastore.org/tsconfig", | |
"compilerOptions": { | |
"allowUnreachableCode": false, | |
"alwaysStrict": true, | |
"composite": true, | |
"declaration": true, | |
"declarationMap": true, | |
"esModuleInterop": true, | |
"forceConsistentCasingInFileNames": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new context. | |
Local<Context> context = Context::New(isolate); | |
// Enter the context for compiling and running the hello world script. | |
Context::Scope context_scope(context); | |
// Create a string containing the JavaScript source code. | |
Local<String> source = String::NewFromUtf8(isolate, "'Hello' + ', World!'"); | |
// Compile the source code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"commonjs": true, | |
"es6": true, | |
"jest": true, | |
"node": true | |
}, | |
"extends": [ | |
"eslint:all", | |
"plugin:@typescript-eslint/all", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// The purpose of this example is to show | |
// how you can block the event loop with JavaScript. | |
// There is 3 routes | |
// / respond with Hello, World text | |
// /block uses JavaScript while for 5 seconds | |
// /non-block uses setTimeout for 5 seconds | |
// Do the following |
NewerOlder