• Stars
    star
    599
  • Rank 74,745 (Top 2 %)
  • Language
  • Created about 10 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Immutable Records, Vectors, Maps and Sets for ECMAScript

Immutability and referential transparency has many known benefits and ability for optimization. Several modern JavaScript libraries take advantage of this, and many more functional compile-to-JS languages.

This is based upon the Value Types proposal (Typed Objects / Explainer).

All these types provide value equality for both == and ===.

Record

Records are a new value type that represents the value type analogy of an immutable object.

const xy = #{ x: 1, y: 2 }; // frozen value type
const xyz = #{ ...xy, z: 3 }; // functional extension

Immutable Vector

ImmutableVector is a new value type that represents the value type analogy of an immutable array, without holes. It cannot be sparse.

const xy = #[ x, y ]; // frozen value type
const xyz = #[ ...xy, z ]; // functional extension

Immutable Map

ImmutableMap is an immutable version of Map. Any mutable operation returns a new ImmutableMap instead of mutating the existing reference.

const a = ImmutableMap([['x', 1], ['y', 2]]);
const b = a.set('y', 3);
a.get('y'); // 2
b.get('y'); // 3

Immutable Set

ImmutableSet is an immutable version of Set. Any mutable operation returns a new ImmutableSet instead of mutating the existing reference.

const a = ImmutableSet([1, 2]);
const b = a.add(3);
a.size; // 2
b.size; // 3

Status of this Proposal

This was presented to TC39 in 2015 but the value of having it in the engine is still unproven and this is a large implementation burden for VMs. It effectively doubles the existing data structures. Therefore, we need to gather more arguments for why it needs to be included in the language and how it would be used.

Known Issues

See why this matters.

More Repositories

1

ocamlrun-wasm

OCamlrun WebAssembly - OCaml Bytecode Interpreter in WASM
Shell
255
star
2

ecmascript-generator-expression

Proposal for do Generator Expressions in ECMAScript. Work in progress. Edit Add topics
96
star
3

ecmascript-undefined-propagation

ECMAScript proposal to relax the rules to return `undefined` for property access on `null` or `undefined` instead of throwing.
76
star
4

ecmascript-shallow-equal

A proposal for ECMAScript for Object.shallowEqual.
51
star
5

link.js

Link.js is a module loader and conversion tool. It supports Labeled Modules, CommonJS and Asynchronous Module Definitions (AMD).
JavaScript
29
star
6

art-illustrator

This project provides Adobe Illustrator ExtendScripts to export graphics to ART Script files.
JavaScript
17
star
7

ecmascript-scoped-constructor-arguments

An idea for ECMAScript.
11
star
8

linq-to-sqlxml

A document database emulator on top of Microsoft SQL Server XML columns
C#
11
star
9

blink-devtools

This is an unofficial mirror of the Blink Developer Tools.
JavaScript
11
star
10

ast-js

Provides an Abstract Syntax Tree (AST) to generate ECMAScript code.
JavaScript
9
star
11

signapk

A .NET port of Android's SignApk tool.
C#
9
star
12

art-svg

SVG Parser for ART
JavaScript
9
star
13

calyptus.mvc

Calyptus MVC is a server side MVC web application framework for the .NET and Mono platforms.
C#
8
star
14

art-morph

Plugin for ART that allow you to morph between two paths.
JavaScript
7
star
15

art-canvas

Canvas renderer for ART
JavaScript
7
star
16

coretools

Experimental draft of the Core of MooTools Core
JavaScript
7
star
17

calyptus.lob

Calyptus Lob provides Large Object (BLOB/CLOB/...) support for DDD ORMs on the .NET/Mono platforms. Such as NHibernate.
C#
6
star
18

labeled-modules-spec

This is the home of the Labeled Modules specification. It's derived from the CommonJS Modules specification.
JavaScript
6
star
19

react-builds

Just to show the diff of builds
JavaScript
5
star
20

mootools-editable

JavaScript
5
star
21

collectables

A unified model for event composition and collections for JavaScript. Enumerables, Scales, Observables, Futures, Promises, Sets, Lists, Maps etc.
JavaScript
4
star
22

mootools-lang

Language Files for the MooTools JavaScript Library
JavaScript
3
star
23

art-script

Provides a stub API to easily generate ART Script files (.art.js)
JavaScript
3
star
24

art-scene

Placeholder for something awesome regarding animation and interaction in the ART project.
3
star
25

calyptus.resourcemanager

The Web Resource Manager is a server side tool to manage JavaScript, CSS, and other resources for the .NET and Mono platforms. It can be used with or independently of ASP.NET.
JavaScript
3
star
26

ecmascript-realm-snapshot

Proposal for Realm snapshots in ECMAScript. Work in progress.
2
star
27

mootools-draggable

Native HTML5 draggable and DragEvent support for MooTools
JavaScript
2
star
28

prepack-2

Prepack is a partial evaluator for JavaScript. Prepack rewrites a JavaScript bundle, resulting in JavaScript code that executes more efficiently.
JavaScript
1
star