Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
TheOnlyMrCat edited this page Sep 21, 2019 · 2 revisions

Welcome to the Lok wiki!

Lok is an object-oriented programming language, designed like C++ with different syntax. The creator of the language wanted to remove the number of links a compiler makes with its standard libraries.

Key differences between C++ and Lok

Syntactic

  • All type and namespace names have to be included in angle brackets <>
  • Most parentheses () have been replaced with square brackets []
  • Square brackets around if, for, rpt, and while have been made optional
  • In variable declarations and type casts, types go after the variable name
  • The auto type has been replaced with empty angle brackets <>
  • Constructor definitions begin with new instead of the type name

Functional

  • No headers. All files are sources and it's possible to load symbols from other sources using `load "file name or id"
  • No pointers. Memory stored on the heap acts like std::shared_ptr.
  • Classes and structs have more difference than access modifiers; it changes the default memory allocation
    • Classes are allocated on the heap and passed by reference
    • Structs are allocated on the stack and passed by value
    • It is possible to modify this allocation location with &, $, and %.
Clone this wiki locally