Default Modules

Claro aims to provide an expansive standard library of modules that all Claro programs have an implicit dependency on at all times. Any of these default StdLib modules can be accessed directly with calls like:

Fig 1:


 var l: mut [int] = mut [];
lists::add(l, 1);
lists::add(l, 2);
 print(l);

Output:

mut [1, 2]

and you never need to manually place an explicit dependency at the BUILD level like you normally would for any other module outside the StdLib:

Fig 2:


claro_binary(
    name = "some_binary",
    main_file = "some_file.claro",
    deps = {
        # Deps on modules outside the StdLib require an explicit Build dep.
        "SomeDep": "//path/to/some/dep:module",
    },
)

The StdLib is a WIP - Recommendations are Welcome!

Of course, as Claro's still at a very early stage, a certain level of incompleteness has to be expected. Please don't hesitate to reach out with suggestions in ways that the current standard library could be improved or expanded!