Generated code optimizations and tricks

I’ve been playing with generated (native) code in order to test how compilers (specific or in general) translate a = a + 1 and a++, and found some other interesting optimizations.

Read more »

Заметки ES6: значения параметров по умолчанию

Read this article in English, Chinese.

В этой небольшой заметке мы затронем еще одну тему ES6 — параметры функций со значениями по умолчанию. Как мы увидим, там есть некоторые тонкости.

Read more »

ES6 Notes: Default values of parameters

Read this article in Chinese, Russian.

In this small note we’ll cover another ES6 feature, function parameters with default values. As we will see there are some subtle cases there.

Read more »

Pattern Matching

In this article we briefly describe the generic topic of pattern matching in programming languages. We’ll see that this powerful technique is present in our every day programming, even if we may not notice it.

Read more »

Essentials of interpretation. Checkpoint: part 1

This article describes in some details our interpreter which we have created during the course Essentials of interpretation. We summarize intermediate results and the main parts of the evaluator making notes which were omitted in the code articles.

Read more »

Essentials of interpretation. Intro.

“Essentials of interpretation” is a new series which consists of small lessons on interpretation of computer programs. The lessons are implemented in JavaScript and contain detailed comments. The sources can be found on the appropriate GitHub repository.

Available lessons:


Read more »

ECMA-262-5 in detail. Chapter 3.2. Lexical environments: ECMAScript implementation.


In this chapter we continue our consideration of lexical environments. In the previous sub chapter 3.1 we clarified the general theory related with the topic. In particular we have learned that the concept of environments is closely related with concepts of static scope and closures.

Read more »

JavaScript. Array “extras” in detail.

This is an external article written specially for Opera software and placed on the Opera’s developer center website.

In this article we’ll look at the functionality made available by the new methods of array objects standardized in ECMA-262 5th edition (aka ES5). Most of the methods discussed below are higher-order (we’ll clarify this term shortly below), and related to functional programming. In addition, most of them have been added to different JavaScript implementations since version 1.6 (SpiderMonkey), although these were only standardized in ES5.

Read more »

Note 4. Two words about “hoisting”.

My recent playground was the toy Scheme interpreter written in CoffeeScript. In the chapter of the metacircular evaluator of the SICP book, there is a section — 4.1.6 Internal Definitions suggesting to solve one interesting and subtle issue related with the (inner) definitions of functions.

Read more »

Note 3. CoffeeScript. Scheme on Coffee.

After the recent ECMAScript article on lexical environments, I wanted to provide some practical implementation of the general scope theory and variables look-up in the environment.

A good candidate for that became a toy Scheme interpreter written in the new and excellent language CoffeeScript. Also, beside the environment features, this task is quite interesting to play with interpreters themselves and their theory.

Read more »