Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elisstaaf/kite
Source code for the "Kite" programming language. Contributions are always welcome! (WIP)
https://github.com/elisstaaf/kite
apache-2-0-license c contribute contributions-welcome functional functional-programming imperative imperative-programming imperative-programming-language interpreter minimal minimalist programming programming-language recursion recursive recursive-functions recursive-programming
Last synced: 2 months ago
JSON representation
Source code for the "Kite" programming language. Contributions are always welcome! (WIP)
- Host: GitHub
- URL: https://github.com/elisstaaf/kite
- Owner: ElisStaaf
- License: apache-2.0
- Created: 2024-11-08T23:36:14.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T21:38:34.000Z (2 months ago)
- Last Synced: 2024-11-20T22:43:19.706Z (2 months ago)
- Topics: apache-2-0-license, c, contribute, contributions-welcome, functional, functional-programming, imperative, imperative-programming, imperative-programming-language, interpreter, minimal, minimalist, programming, programming-language, recursion, recursive, recursive-functions, recursive-programming
- Language: C
- Homepage:
- Size: 132 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Kite Programming Language
=========================Kite is a pure and minimalistic programming language written in C.
It can be a lot, but if I'd *have* to classify it, it's a functional
programming language with imperative elements. This is a sample of what
code written in Kite might look like:let loop = fun(func, times, until)
if times < until do @(func, times + 1, until)
else funclet incr = fun(num)
num + 1let mainloop = fun(k, j, i)
loop(incr(k), j, i)loop(mainloop(1, 5, 25), 0, 10)
Simple program to print the number "100":
# To print without newline:
write(tostring(100)
# or
import io
io.print(100)# To print with a newline:
writeln(tostring(100))
# or
import io
io.println(100)It also includes functions:
let println = fun(v)
writeln(tostring(v)let sum = fun(x)
if x < 2 do x
else x + sum(x - 1)println(sum(3))
This does the same thing as the last example:
let println = fun(v)
writeln(tostring(v))println((fun(x) if x < 2 do x else x + @(x - 1))(3))
Oh, almost forgot about Modules:
import io
io.print(10)
io.println(20)
io.print(30)stdlib/io.kite:
let export print = fun(val)
write(tostring(val))
let export println = fun(val)
writeln(tostring(val))Another module; func:
import func
let test = fun()
writeln(tostring(100))func.loop(test(), 0, 10)
stdlib/func.kite:
let export loop = fun(func, times, until)
if times < until do @(func, times + 1, until)
else func(All modules should be located in ./stdlib/)
Requirements
------------
* https://gcc.gnu.org/install
* https://www.gnu.org/software/make
* https://git-scm.com/downloads or https://github.com/cli/cli#installationInstallation
------------
To install, firstly clone the repo:# git
git clone https://github.com/ElisStaaf/kite# gh
gh repo clone ElisStaaf/kiteThen build an executable using make:
cd kite
sudo make