https://github.com/kmilkevych/pebble-lang
https://github.com/kmilkevych/pebble-lang
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kmilkevych/pebble-lang
- Owner: KMilkevych
- License: gpl-3.0
- Created: 2025-02-24T09:42:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-24T11:22:30.000Z (8 months ago)
- Last Synced: 2025-02-24T11:29:39.984Z (8 months ago)
- Language: Zig
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.org
- License: LICENSE
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 n1declare 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