vextoly/website

<?php
declare(strict_types=1);
$year = date('Y');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cryn · vextoly</title>
<meta name="description" content="Cryn: a compiled, statically typed systems language with a tiny core.">
<meta name="color-scheme" content="dark">
<meta name="theme-color" content="#000000">
<link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Ccircle%20cx='32'%20cy='32'%20r='29'%20fill='%23000'%20stroke='%23fff'%20stroke-width='6'/%3E%3Ccircle%20cx='32'%20cy='19'%20r='5'%20fill='%23fff'/%3E%3Crect%20x='27'%20y='29'%20width='10'%20height='26'%20rx='5'%20fill='%23fff'/%3E%3C/svg%3E">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<div class="pride" aria-hidden="true"></div>
<header class="site-header">
  <div class="wrap">
    <a class="wordmark" href="/">vextoly</a>
  </div>
</header>
<main class="wrap doc">
  <h1>Cryn</h1>
  <p class="intro">
    A compiled, statically typed systems language with a tiny core.
    The machine has cells, connections, focus, one working value, and a value stack.
    37 English commands. No symbolic operators, no semicolons, no braces.
    Whitespace and indentation have no meaning.
    Static types with defined behavior: fixed-width integers, IEEE floats, overflow wraps, division by zero aborts, float-to-int saturates, indexing is bounds-checked.
    Files are first-class handles with read, write, both, and append modes.
  </p>

  <h2>Example</h2>
  <pre><code>define main
    set 10
    push
    set 20
    add
    output
    return
end</code></pre>

  <h2>The machine</h2>
  <ul>
    <li><strong>Cells and connections</strong> are a graph of typed memory cells. A cell holds one value and connects to other cells by name or by an index. Arrays are indexed connections. Linked lists are stored as addresses in cells. There is no separate struct keyword. The world is the collection of all cells.</li>
    <li><strong>Focus</strong> identifies the currently selected cell. move navigates by name or index and anchors the focus. back returns to the previous focus. home returns to the frame root. The focus is a stack of cell references, with the frame root at the bottom.</li>
    <li><strong>Working value</strong> is one typed value that commands read, write, and compute on. It is the only immediate value in the machine. It is also the return value of a transformation.</li>
    <li><strong>Value stack</strong> saves values while the working value does something else. It is also used for passing arguments to calls. Push, pop, swap. The stack must be empty at return. The checker enforces this at every program point.</li>
    <li><strong>Control flow</strong> uses compare to set a condition, then jump label or jump label when less or greater or equal. mark defines labels. Loops are backward jumps. There is no if, while, or for. The checker tracks the working value type, focus, and stack shape at every label. All paths reaching a label must agree.</li>
    <li><strong>Threads</strong> use spawn to start a zero-parameter transformation in a new thread, and wait to join all spawned threads and synchronize memory. Communication is through shared world cells and heap blocks. A race on an aligned cell of eight bytes or less yields an unspecified value of the cell's type and never tears. exchange is an atomic swap of the working value with the focused cell, the only ordering primitive besides wait, and enough to build locks.</li>
  </ul>

  <h2>Compiler</h2>
  <p>
    The bootstrap compiler is portable ISO C11 with no dependencies beyond a C compiler and pthreads.
    It lowers Cryn source through a typed IR to readable C, then invokes the host C compiler to produce a native executable.
    Both GCC and Clang are supported as host compilers.
    No runtime is needed after compilation. The generated program is a normal executable with no graph overhead, no garbage collector, and no VM.
  </p>

  <h2>Get it</h2>
  <p>
    <a href="https://git.disroot.org/Vextoly/Cryn">Repository</a> ·
    <a href="https://git.disroot.org/Vextoly/Cryn/wiki/Learning-Cryn">Tutorial</a> ·
    <a href="https://git.disroot.org/Vextoly/Cryn/wiki/Language-Reference">Language reference</a> ·
    <a href="https://git.disroot.org/Vextoly/Cryn/wiki/Architecture">Architecture</a>
  </p>

</main>
<footer class="colophon">
  <div class="wrap footer-inner">
    <p>© <?php echo $year; ?> vextoly</p>
    <p><a href="/privacy.php">privacy</a></p>
  </div>
</footer>
</body>
</html>