Welcome

Welcome to the documentation of the Nara programming languague.

Nara is a compiled, static+strong typed language made for fun & learning. It is compiled to a custom bytecode format, and executed in a custom virtual machine.

This page details the main design choices of the language, if you want to install Nara go to the installation guide

Why?

A long, long time ago (2019), I found about F* in Reddit. It sparked a special interest in me, about programming languages, their theory, syntax, semantics, type systems, compilation, etc etc etc. And ever since i've wanted to write my own programming language.

That's it. Because i want to.

Now, this language has gone throug a lot of changes & revisions. At first i wanted a indentation-based syntax like F#/OCaml, but thought of compiling down to JS (the hot thing at the time). Then I accepted the fact that braces are superior and changed the syntax. Then, when I was forced to write PHP at work, I pivoted to compile down to PHP. And finally, I decided to just write my own VM. And in this journey, the thing has been written & rewritten in: TypeScript, F#, OCaml, ReScript, Rust, and finally Zig.

Design

The languages borrows from all the places I put my nose on: F#, OCaml, Haskell, Erlang, Elixir, Scala, Java, Kotlin, C#, Go, C, Rust, Zig, Clojure, Racket, CoffeeScript, LiveScript, ReScript, ReasonML, Gleam, TypeScript, and others that I forgor 💀.

This led me through OOP, Functional, Imperative, Reactive, Dynamic typed, Static typed, a bit of macros, indentation based, ASI, and many things.

And from all those places, I intend to create something perfect for me.

Goals

The language should:

  • Be statically typed
  • Be compiled
  • Be BLAZINGLY FAST at dev,build & runtime.
  • Be implemented in a FAST language (zig).
  • Allow type shenanigans like TypeScript, but better.
  • Be garbage collected
  • Have a built in code formatter, LSP, linter, runner, etc.
  • Have a GOOD docs/API site
  • Have type inference (but not full blown Hindley-Milner)
  • Be functional first, allow other paradigms
  • Have clear mutable/immutable semantics
  • Be consistent
  • Have a simple instalation and configuration (a single binary)
  • Support neovim & vscode
  • Solve other inconsistencies/problems I personally have with other langs
  • Be bootstraped maybe?

Image: Friendship ended with Rust, now Zig is my best friend.

That's it. We'll see how long until I run out of motivation. I don't intend to become the next thing, but hopefully I learn more about compilers internals.