the Keyword data type is the idiomatic way to describe object/map keys

this-is-a-keyword

Keywords are also an invokable data structure, which when called with an object or a map, extract the value for the given key

key
key
value
value

`_` is an invokable data structure which can be used to define short-hand simple functions

the following expressions are equivalent

_
+
1
x
x
+
1

it works like an object proxy, it stores the method/operator calls. When invoked, the chain of methods get called on the data.

Instead of using the keyword `new`, Coil uses `[]` to instantiate a data type

into is a core iteration method which consumes an iterable into a concrete collection

the typical usage is as such

iterable
into

typically you want to turn an iterable back into an array, but it can also be used to convert from one iterable to another

1
1
2
into
1
2

the argument to into can also contain data, so the iterable get appended to the existing collection

2
into
1
1
2

Iteration methods (.map, .filter, .any?, ...) all take a variable amount of arguments

The arguments are all invokables, which get chained together in the same fashion as `.pipe()`

users
map
age
_
+
1

"transform the users into the age of a user + 1"

.pipe() is a method used by much of the standard library to define concise data transformations

it takes a variable amount of invokable arguments, which are chained together using function composition

it is particularly handy when you are digging deep in some json object

json_data
pipe
users
0
name
length

it's generally helpful to read a pipe backwards, "the length of the name of the first user"

The Coil Programming Language

marcelle rusu (2025)

github

Coil is a programming language I designed and worked on in 2023-2024. It is extremely concise and emphasizes generic programming

It compiles to JavaScript and works seamlessly in the js ecosystem such as npm, React, Svelte, Vite & Deno

The major projects written in Coil are the compiler itself (1500 lines), and Charisma CSS v1 (2000 lines)

Starting as a experiment in generic programming inspired by smalltalk, clojure and ruby, it quickly became something that i genuinely loved working in and used almost daily for 6+ months

While Coil has now been sunset I am very proud of the design of this language, particularly `Invokable (Custom) Data Structures`, which is a design pattern where data structures behave like functions, allowing you to examine and reuse themselves

The following are a series of examples.

view options
Hello World
hello friends
log
hello friends
Functions
add_one
x
x
+
1
add_one
1
2
Core Data Structures
1
string
1
2
three
1
2
3
key
value
key
value
Shared Collection API
1
len
1
1
2
len
2
len
0
len
0
Invokable Data Structures
name
marcelle
marcelle
first
second
third
2
third
four
nil
Lazy Iteration
1
2
3
map
Iterator{}
1
2
3
map
2
3
4
Piping
name
marcelle
pipe
name
marcelle
name
marcelle
pipe
m
Invokable Data + Piping = Concise Iteration
users
name
joe
grade
B
name
jill
grade
A
name
jack
grade
C
name
josh
grade
D
nil
users
filter
name
joe
grade
B
name
jill
grade
A
map
name
joe
jill
Custom Invokable Data Structures (hard-mode)
CondMap
entries
CondMap
CondMap
prototype
invoke
value
entries
find
0
value
pipe
1
nil
grade_to_letter
CondMap
50
F
50
60
D
60
70
C
70
80
B
80
A
nil
grade_to_letter
73
B