Cell is an open source programming language created in 2017.
#966on PLDB | 7Years Old |
git clone https://github.com/cell-lang/compiler
Cell is a very high-level embeddable language. Cell's data model combines a staple of functional programming, algebraic data types, with relations and other ideas from relational databases.
type AddUser = add_user(
id: UserId,
username: String,
signup_date: Date,
first_name: String,
last_name: String,
date_of_birth: Date?
);
OnlineForum.AddUser {
id = self.id;
// Inserting the new user id and setting all the mandatory attributes
insert user(id),
username(id, self.username),
first_name(id, self.first_name),
last_name(id, self.last_name),
signup_date(id, self.signup_date);
// Setting the date_of_birth attribute, if available
insert date_of_birth(id, self.date_of_birth) if self.date_of_birth?;
}
reactive Thermostat {
input:
temperature: Float;
output:
on: Bool;
state:
// When the system is initialized, on is true if
// and only if the current temperature exceeds 28°C
on: Bool = temperature > 28.0;
rules:
// Switching on the air conditioner when
// the temperature exceeds 28°C
on = true when temperature > 28.0;
// Switching it off when it falls below 24°C
on = false when temperature < 24.0;
}
Feature | Supported | Example | Token |
---|---|---|---|
Booleans | ✓ | true false | |
Comments | ✓ | // A comment | |
Line Comments | ✓ | // A comment | // |
Semantic Indentation | X |