pocketlang/docs
Thakee Nathees f5e2f15d23 negative index, range slice and more
... string concat with .. operator
    exponent operator with ** operator
2022-05-08 23:19:33 +05:30
..
GettingStarted negative index, range slice and more 2022-05-08 23:19:33 +05:30
Reference documentations are refactored 2022-05-07 17:47:58 +05:30
static documentations are refactored 2022-05-07 17:47:58 +05:30
wasm native interface refactored 2022-05-05 12:54:15 +05:30
_sidebar.md documentations are refactored 2022-05-07 17:47:58 +05:30
.nojekyll documentations are refactored 2022-05-07 17:47:58 +05:30
404.html documentations are refactored 2022-05-07 17:47:58 +05:30
index.html documentations are refactored 2022-05-07 17:47:58 +05:30
README.md negative index, range slice and more 2022-05-08 23:19:33 +05:30

Pocketlang v0.1.0

Pocketlang is a lightweight & fast object oriented programming language designed for embedding and scripting. Including the compiler, bytecode VM and runtime it's a standalone executable which is less than 300KB and the language itself can be compiled in less than 4s without any external dependencies.


Simplicity is the zen of pocketlang. The syntax is more of an executable pseudocode. Compiling the language itself takes just a single gcc/msvc command. No configuration is required to embed it in another application. pocket VM along with its compiler and standard runtime are a single executable that's less than 300KB. It's not just small but much faster with memory efficient dynamic type system, self adjusting heap for garbage collection, tail call optimization, single pass compilation etc, that makes it compete with main stream langages like python, ruby, wren and lua. And more things that makes pocketlang a swiss knife of programmers.

What it looks like

# A recursive fibonacci function.
def fib(n)
  if n < 2 then return n end
  return fib(n-1) + fib(n-2)
end

# Prints all fibonacci from 0 to 10 exclusive.
for i in 0..10
  print("fib($i) = ${fib(i)}")
end

Features

  • No setup. Single binary and your're good to go.
  • REPL
  • Object oriented
  • Dynamic typing
  • Concurrency
  • Garbage collection
  • Operator overloading
  • First class functions
  • Lexical scoping
  • Embeddable
  • Direct interop with C
  • Highly optimized loops
  • Tail call optimization

Getting Started

Note that at the moment there isn't any releases and it's actively being developed. To get your hands dirty clone the source and build it. Compiling the language itself takes just a single gcc/msvc command. See README for more detail.