An open API service indexing awesome lists of open source software.

https://github.com/kmilkevych/pebble-lang


https://github.com/kmilkevych/pebble-lang

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

#+title: pebble-lang

* Usage

Run ~zig build run -- compile filename~ to execute the interpreter pipeline on the contents of =filename=

or

run ~zig build run -- interactive~ to start the interactive REPL shell.

* Example

Computing the first =N= fibonacci numbers:
#+begin_src
declare N = 10
declare n1 = 1, n2 = 1, i = 1
while i <= N {

i = i + 1
print n1

declare TMP = n1
n1 = n1 + n2
n2 = TMP
}
#+end_src
which results in output
#+begin_example
1
2
3
5
8
13
21
34
55
89
#+end_example

* Features
** Implemented
- Integer and boolean types
- Basic control flow (if and while)
- PRINT statements
- Basic lexical scoping
- ~break~ and ~continue~ statements
- COMMA declarations, e.g. ~declare x = 1, y = 2, z = 3~

** Not yet implemented
- String types
- Floating point types
- Function calls
- Lists
- Structs
- For-loops
- INPUT statements