Skip to content

Code0987/vibez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vibez

A Python-ish programming language with natural English + light Gen Z slang. Indentation-based, fun to write.

Quick Start

# Install deps
npm install

# Run a file
npm run start examples/hello.vibez

# Interactive REPL
npm run start

Example

name = "bestie"
age is like 21

if age is greater than 17:
    spill "Welcome, " + name
otherwise:
    spill "Sorry bestie"

define a function called double that takes n:
    give back n * 2

spill double(21)   # 42

Features

  • Variables: x is like 42 or x = 42
  • Print: spill "hi" / spill the tea on x
  • Booleans: fr (true), nah/cap (false)
  • Conditionals: if / otherwise if / otherwise
  • Loops: while, for each x in list
  • Functions: define a function called name that takes a and b:
  • Lists: nums = [1, 2, 3], nums[0]
  • Math: +, -, *, /
  • Logic: and, or, not
  • Inc/Dec: x goes up by 1, x goes down by 1
  • Return: give back x or ghost x

Files

Path Description
src/runner.js CLI + REPL entry
src/tokenizer.js Lexer
src/parser.js Recursive-descent parser
src/interpreter.js Tree-walking runtime
examples/ Runnable .vibez example files
PLAN.md Full spec, keywords, grammar

Testing

npm test          # Jest, 90%+ coverage

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors