All output is logged to console. So to use thislang you'll need to open up the console in your browser. Click the Run button to run the code. If you w

BlueBlazin / thislang

submited by
Style Pass
2021-07-28 13:00:08

All output is logged to console. So to use thislang you'll need to open up the console in your browser. Click the Run button to run the code. If you want, you can also explore the outputs from the tokenizer, parser, and compiler.

For a while after first learning Javascript, I struggled with understanding/remembering how this worked in JS. A couple years ago I thoguht why not rewrite javascript (or rather a subset of it) to get a better understanding of this.

To my own surprise, I actually did it. Of course, you don't need to implement javascript to understand how this works but it was a convenient excuse to convince myself to do it.

The shape system of thislang is a (potentially) massive tree data structure. Whenever an object is created with properties, or a property is added to an object, this tree is walked from its root in order of the property names as they appear on the object.

Thislang will create shapes for all properties and share them whenever it can. However, because the structure holding them is a tree, all shapes are retained in memory. Even those shapes whose originating objects no longer exist.

Leave a Comment
Related Posts