Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ozansz/z-lang
The Sazak Programming Language
https://github.com/ozansz/z-lang
Last synced: 28 days ago
JSON representation
The Sazak Programming Language
- Host: GitHub
- URL: https://github.com/ozansz/z-lang
- Owner: ozansz
- Created: 2019-01-09T15:41:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T14:11:35.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T07:01:55.545Z (about 1 month ago)
- Language: C++
- Size: 1.28 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Z Programming Language
Z is a functional, Turing-complete programming language that uses paradigms of lambda calculus.
## Generic Types
### Integer
### Set
## Built-in Constructs
### S (Global Stack)
`S` is **the only global variable** in the whole Z program code. It is mainly to use as an outout buffer.
### Z (Z-combinator)
Grammar: `Z `
`Z` is used to recursively call lambda functions. As there are no iterative loops in **Z**, recursive calls are the way we do iteration :)
### K (Kombine)
Grammar: `K + `
Lambda function bodies in **Z** consists of exactly one expression. So, we need to *'kombine'* the expressions as a chain. The `K` combinator does this.
```
K f g h t x == f(g(h(t x)))
```### Lambda
Lambda functions are what the **Z** language is built on. Lambda functions,
* Can be anonymous
* Can have zero number of parameters
* Can only be passed `integer`, `set` type of constant or variables, or the `S` as arguments.## Built-in Functions
### ' (Put one char)
Grammar: `' `
Puts the ASCII character equivalent of the given integer argument's value to standard output. If the given argument is of set type or `S`, puts the ASCII character equivalent of the top/first element.
If `S` is given as argument, this function pops the top item from `S`. No such action is taken if a set is given.
Usage:
```
' S
\? (x) (' x)
\? () (' 10)
```### ^ (Peek)
Grammar: `^ `
Returns the first element of given set. If the given argument is `S`, returns the top item. Otherwise, returns the value of the integer argument itself.
Usage:
```
^ S
\y (x) ((!= 0 (^ x)) (' x))
```### << (Pop from && push to)
Grammar: ` << `
Pops one item from `y` and pushes it to `x`. If `y` is of type integer, takes its value and pushes it to `x`. If `x` is type integer, sets its value to taken integer value.