Skip to content

Files

Latest commit

Jun 13, 2024
27fa85d · Jun 13, 2024

History

History
This branch is 2 commits ahead of, 24 commits behind master.

stdlib

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 27, 2022
Aug 23, 2022
Nov 28, 2023
Sep 29, 2022
Jan 13, 2023
Aug 23, 2022
Jun 5, 2024
Sep 27, 2022
Nov 28, 2023
Jun 13, 2024
Nov 2, 2022
Aug 15, 2022
Mar 30, 2023
Jun 30, 2022
Jun 5, 2024
Nov 28, 2023
Nov 28, 2023
Sep 9, 2022
Jul 1, 2022
Aug 16, 2022
Aug 16, 2022
Jun 30, 2022
Aug 16, 2022
Sep 26, 2022
Sep 26, 2022
Jun 5, 2024
Nov 28, 2023
Jun 30, 2022
Nov 2, 2022
Aug 23, 2022
Nov 28, 2023
Jun 13, 2024
Apr 23, 2020
Aug 15, 2022
Jun 22, 2022
Jul 1, 2022
Jul 1, 2022
Jan 3, 2023
Sep 26, 2022

Flux Standard Library

This directory contains the implementation of the Flux standard library.

Code Organization

A Flux package is represented as a directory containing at least one file with a .flux extension. The package name is declared within the file using the package clause. Package names should be the same name as the directory.

Test files may placed in the same directory as the packing using the _test.flux suffix on the file name. The test files must have a _test suffix for the package name and the prefix must match the name of the non test package.

Because the above mirrors the Go package structure it is common to also have .go file and _test.go files that mirror the .flux files.

A typical Flux package structure:

stdlib/strings/
├── flux_gen.go
├── flux_test_gen.go
├── replaceAll_test.flux
├── replace_test.flux
├── strings.flux
├── strings.go
├── strings_test.go
├── subset_test.flux
├── title_test.flux
├── toLower_test.flux
└── toUpper_test.flux

The files flux_gen.go and flux_test_gen.go are generated using the builtin command. They contain the AST of the various .flux files in the package as Go structs. All *_test.flux files are encoded into flux_test_gen.go the non test .flux files are encoded in flux_gen.go

NOTE: The flux_test_gen.go file is not a Go test file as we want to include the Flux test code into the normal build. This enables downstream projects that import Flux to run the test suite define in the standard library against their implementation.

Third Party Contributions

We collect third part contributions into the contrib package. See the README for details on how to contribute a third party package to Flux.