THIS LESSON IS ACTIVELY BEING WRITTEN
Contents
Intro
The quote for all concepts in StaLang, especially for this lesson
My language โ My rules
JA Proger, 2025
Storage definition
Storage? What's the hell STORAGE concept in programming?
Frankly speaking, it's my idea ๐ to unify many keywords which are wonderfully can be included to this definition โ Storage.
Basic storages
Basic storages in StaLang are
- Data
data - Constant
const - List
list - Matrix
matrix - Alias
alias
Why so?
I just like this. Recall the quote in the Intro section ๐. Well, all of them designed for the purpose of the StaLang.
Let's dive into details.
Data
What is data?
Data is a storage which can brings anything: values, structures instances, functions.
Consider the following example:
type Bulb {
ON,
OFF
}
data five = 5;
data bulb: Bulb = ::ON;
Comparison with other languages:
| Language | Variable keyword |
|---|---|
| StaLang | data |
| Swift | var |
| Rust | let mut |
| Go | var |
| Python | nothing ๐ |
| TypeScript | const |
| Lua | local |
Const
List
Alias
Alias is a storage which stores your custom alias for existed keyword.
There are several requirements to aliases:
- Alias must be a valid ID
alias 0g = out; // You cannot do this. It will raise an error
- Alias cannot be an existed keyword.
alias type = out; // You cannot do this. It will raise an error
Valid example:
alias sexwith = out;
sexwith "girl"; // prints "girl"
ID
Links
GitHub source code: StaLang
GutHub IDE for macOS: StaLang IDE
GitHub Docs: StaLang Docs
Ask any questions in the comments below!
Top comments (0)