Language Reference
Explore the full syntax specification, including all five bracket levels.
Write your first LOVE-LANG program in under 5 minutes.
Let’s get you writing LOVE-LANG code in the next few minutes.
Every LOVE-LANG program begins with a base statement — a key/value pair that defines a name and assigns it a value.
# The simplest LOVE programmename = "Hello, World!"version = 1description = "My first LOVE programme"LOVE uses = or the keyword is as its assignment operator. Both are equivalent:
greeting = "Hello"farewell is "Goodbye"Install LOVE-LANG
Clone the repository and build from source:
git clone https://github.com/love-metalang/love-langcd love-langgleam buildWrite your first programme
Create a file called hello.love:
@Import[Prelude::*]
name = "LOVE-LANG"version = 0.0.1author = "you"license = "MIT"description = "The List Oriented Virtualized Evaluator"Run it
love run hello.loveLOVE treats everything as typed lists. An L1 expression wraps values in single brackets:
colours = [red green blue]numbers = [1 2 3 4 5]mixed = ["hello" 42 :keyword]Double brackets denote operations — applying a function to arguments:
result = [[ + 1 2 ]] # 3squared = [[ * result result ]] # 9LOVE has a rich type system. Annotate any key with @[Type] or :Type:
name @[String] = "Alice"age :Number = 30active @[Boolean] = truetags @[List] = [developer lisp love]Use @Import to load modules from the standard library:
@Import[Prelude::*]@Import[Invariants::DependencyInjection]@Import[Stdlib::Math]
result = [[ Math.sqrt 144 ]]Here is a real LOVE programme from the examples directory — a static site generator bootstrap:
@Import[Prelude::*]@Import[Invariants::DependencyInjection]
@DependencyInjection[#mode Automatic]init = [#! [args :List[String]] ]
@DependencyInjection[#mode Automatic ::alias[AutomaticMode]]init = [#! [args :List[String]] @and[>] result :List = args -> @apply[self] -> @create[List <- args] -> @filter[@and[True]] ]Language Reference
Explore the full syntax specification, including all five bracket levels.
Compiler Pipeline
Understand the OPERA → MATERIALIZE → SIMULATE compilation workflow.