OPFN
  • What is this thing?
    • A New Internet
    • Architecture
    • Runtime
  • Installation
    • Environment Setup
  • Quickstart Tutorial
    • "Hello World" Cog
    • Booting, Starting, Caching
    • JSON
    • Cog webserver end-to-end
  • Databases / Cogs
    • Introduction
    • Creating a Cog
    • Using a Cog
    • Inter-Cog Communication
  • Sire Reference
    • Intro
    • Runes
    • Miscellaneous
    • Standard Library
      • Bits (Booleans)
      • Natural Numbers
      • Comparisons
      • Characters and Strings
      • Rows
      • Lists
      • Either
      • Maybe
      • Sets
      • KV Tables
      • Pads
      • Bars
      • Types
  • Deeper
    • Nat Representations
    • R-Expressions
    • Seed files
    • Jets
    • Boot process
    • UI files
  • PLAN
    • In Depth
    • Definition
Powered by GitBook
On this page
  • Finding additional standard library functions
  • Summary of the standard library files
  1. Sire Reference

Standard Library

PreviousMiscellaneousNextBits (Booleans)

Last updated 7 months ago

Finding additional standard library functions

The entire "standard library" is defined in the consecutively-numbered sire/sire_<n>_<name>.sire files. The files are quite readable and we encourage you to explore after becoming familiar with the documentation.

When first navigating a file, check out the list of imports at the top to see what this file depends on. Skimming the list of exports at the bottom (after reading any initial comment at the very top) can give you a sense of file content. Often, the =?= test cases can be very helpful.

Summary of the standard library files

Below is a summary of each of the standard library files. Particularly helpful ones for a beginner are annotated with a 👍. Files that require a more advanced understanding are annotated with a ❗. Most of these files define lower-level dependencies that other higher-order (and easier to understand) subsequent functions rely on.

  • - Defines named wrappers around PLAN operations

  • - Booleans

  • - Natural numbers and operating on them

  • - Comparison, ordering and equality

  • - Rows and basic operations on them

  • ❗ - Representation for rex trees - mostly needed for macros.

  • 👍 - Data structures; rows, lists, maybe, either, etc.

  • 👍 - ASCII characters and strings

  • - Sets

  • 👍 - Tabs

  • ❗ - More rex and macro utilities

  • ❗ - Explains how the # rune is used for macros

  • ❗ - Bit-strings encoded as nats

  • 👍 - Byte-arrays and operations

  • - Syntactic sugar and convenience macros

  • ❗ - Pattern matching

  • ❗ - Binary search trees

  • ❗ - Sire properties

  • - Atomic switch

  • ❗ - Seed; serialization framework

  • ❗ - REPL utilities

  • ❗ - Rex

  • - Datacase/Record

  • ⁉️ - Backend of the sire compiler

  • ⁉️ - Sire-in-sire; can be used to bootstrap itself

Taking a look at the list above, you can also get a sense of how the Sire source files start at the basics of wrapping PLAN and incrementally build on each other until the full system is realized.

By starting with PLAN and going through all the files above, after a (relatively) small investment of time, you could understand the entirety of this computational model. Pretty cool!

sire_01_fan.sire
sire_02_bit.sire
sire_03_nat.sire
sire_04_cmp.sire
sire_05_row.sire
sire_06_rex.sire
sire_07_dat.sire
sire_10_str.sire
sire_11_set.sire
sire_12_tab.sire
sire_13_exp.sire
sire_14_hax.sire
sire_15_pad.sire
sire_16_bar.sire
sire_17_sug.sire
sire_18_pat.sire
sire_19_bst.sire
sire_20_prp.sire
sire_21_switch.sire
sire_22_seed.sire
sire_23_repl.sire
sire_24_rex.sire
sire_25_datatype.sire
sire_26_compile.sire
sire_27_sire.sire