Standard Library
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.
sire_01_fan.sire
- Defines named wrappers around PLAN operationssire_02_bit.sire
- Booleanssire_03_nat.sire
- Natural numbers and operating on themsire_04_cmp.sire
- Comparison, ordering and equalitysire_05_row.sire
- Rows and basic operations on them❗
sire_06_rex.sire
- Representation for rex trees - mostly needed for macros.👍
sire_07_dat.sire
- Data structures; rows, lists, maybe, either, etc.👍
sire_10_str.sire
- ASCII characters and stringssire_11_set.sire
- Sets👍
sire_12_tab.sire
- Tabs❗
sire_13_exp.sire
- More rex and macro utilities❗
sire_14_hax.sire
- Explains how the#
rune is used for macros❗
sire_15_pad.sire
- Bit-strings encoded as nats👍
sire_16_bar.sire
- Byte-arrays and operationssire_17_sug.sire
- Syntactic sugar and convenience macros❗
sire_18_pat.sire
- Pattern matching❗
sire_19_bst.sire
- Binary search trees❗
sire_20_prp.sire
- Sire propertiessire_21_switch.sire
- Atomic switch❗
sire_22_seed.sire
- Seed; serialization framework❗
sire_23_repl.sire
- REPL utilities❗
sire_24_rex.sire
- Rexsire_25_datatype.sire
- Datacase/Record⁉️
sire_26_compile.sire
- Backend of the sire compiler⁉️
sire_27_sire.sire
- 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!
Last updated