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