pocketlang/docs
Thakee Nathees 5bc9dcad6b method bind implemented
- MethodBind type added.
- Now methods are first class and can be passed around as arguments
  store as a variable and return it from a function and they're first
  class callbales.
- Can bind instance to a method bind using .bind() method
- Class.methods() method added -> return a list of all methods as
  method binds
- Module.globals() method added -> returns a list of all globals
  of that module.
- Var._class -> attribute added which will return the class of the
  variable
- Class.name, MethodBind.name, Closure.name attribute and Modue._name
  attribute added
- Class._docs, Closure._docs, MethodBind._docs attribute added
- MethodBind.instance attribute added
2022-06-06 02:47:31 +05:30
..
GettingStarted Minor code enhancements (read bellow) 2022-05-21 04:15:30 +05:30
Reference method bind implemented 2022-06-06 02:47:31 +05:30
static documentations are refactored 2022-05-07 17:47:58 +05:30
wasm Minor code enhancements (read bellow) 2022-05-21 04:15:30 +05:30
_sidebar.md method bind implemented 2022-06-06 02:47:31 +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 some builtin class methods were added 2022-05-23 23:47:28 +05:30
try-online.html some builtin class methods were added 2022-05-23 23:47:28 +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.