Syntax Deep Dive

Info: Chimerix syntax is inspired by Lisp-like structures but with a modern twist. Everything is an expression. Parentheses () define scope and data, just like in the grammar definition.

Core Grammar

The language relies on a powerful concept: Paths and Groups. Unlike C-style languages with statements, Chimerix flows through transformations.

Comments start with a semicolon ;. This keeps the hash # free for other operators or macros if needed in the future.

Example
; Defining a list of constants
Config = [
  "localhost"
  8080
  true
]

Uniquely, Chimerix uses special string literals called "Paragraphs" and "Cat Strings". Why? Because documentation matters.

Paragraphs
doc = ,,,
header This is a raw doc
It can contain multi-line text
without escaping quotes.
,,,

Operators

|> Pipe Right <| Pipe Left :: Cons .. Range >= Compare : Apply . Access

Example: HTTP Router

; A mock implementation of a router
Router = (
  get = (path, handler) ->
    register:"GET":path:handler
)

App = Router.(
  route = get:"/home":(res -> res:send:"Hello")
)