Builtins Reference
BioLang ships with 1000+ built-in functions spanning bioinformatics, statistics, data wrangling, visualization, and systems programming. Every function is available without imports — just call it.
Not sure which statistic to use?
Start with Guided Statistics. It explains centre, spread, shape, missingness, transformations, study design, and model checks in plain language while keeping every clue inspectable.
Showing all 1000+ builtins
| Name | Category | Signature | Description |
|---|---|---|---|
| Core | print(values...) -> nil | Print values to stdout without newline | |
| println | Core | println(values...) -> nil | Print values to stdout with newline |
| len | Core | len(value) -> int | Return length of string, list, or map |
| type | Core | type(value) -> string | Return type name as string |
| range | Core | range(start, end, step?) -> list | Generate integer sequence |
| abs | Core | abs(n) -> number | Absolute value |
| min | Core | min(a, b) -> number | Return smaller of two values |
| max | Core | max(a, b) -> number | Return larger of two values |
| int | Core | int(value) -> int | Cast to integer |
| float | Core | float(value) -> float | Cast to float |
| str | Core | str(value) -> string | Cast to string |
| bool | Core | bool(value) -> bool | Cast to boolean |
| assert | Core | assert cond, msg? | Assert condition is truthy or abort |
| debug | Core | debug(value) -> value | Print debug representation, return value |
| typeof | Core | typeof(value) -> string | Alias for type() |
| is_nil | Core | is_nil(value) -> bool | Check if value is nil |
| to_string | Core | to_string(value) -> string | Convert any value to its string representation |
| map | Collections | map(list, fn) -> list | Apply function to each element |
| filter | Collections | filter(list, fn) -> list | Keep elements where fn returns true |
| reduce | Collections | reduce(list, fn, init?) -> value | Accumulate list into single value |
| sort | Collections | sort(list) -> list | Sort in ascending order |
| sort_by | Collections | sort_by(list, fn) -> list | Sort with custom comparator |
| push | Collections | push(list, value) -> list | Append element to end of list |
| pop | Collections | pop(list) -> value | Remove and return last element |
| shift | Collections | shift(list) -> value | Remove and return first element |
| zip | Collections | zip(a, b) -> list | Pair elements from two lists |
| enumerate | Collections | enumerate(list) -> list | Pair each element with its index |
| flatten | Collections | flatten(list) -> list | Flatten nested lists one level |
| reverse | Collections | reverse(list) -> list | Reverse element order |
| unique | Collections | unique(list) -> list | Remove duplicate elements |
| first | Collections | first(list) -> value | Return first element |
| last | Collections | last(list) -> value | Return last element |
| take | Collections | take(list, n) -> list | Take first n elements |
| drop | Collections | drop(list, n) -> list | Drop first n elements |
| any | Collections | any(list, fn) -> bool | True if any element matches predicate |
| all | Collections | all(list, fn) -> bool | True if all elements match predicate |
| find | Collections | find(list, fn) -> value|nil | Find first matching element |
| find_index | Collections | find_index(list, fn) -> int|nil | Find index of first match |
| chunk | Collections | chunk(list, size) -> list | Split list into chunks of given size |
| window_slide | Collections | window_slide(list, size) -> list | Sliding window over list |
| group_by | Collections | group_by(list, fn) -> map | Group elements by key function |
| stat.explore | Guided Stats | stat.explore(values, options?) -> record | Explain centre, spread, shape, and review clues |
| stat.scan | Guided Stats | stat.scan(table, options?) -> record | Whole-table first pass and prioritized next steps |
| stat.means | Guided Stats | stat.means(values, options?) -> record | Compare means and their compatible spread measures |
| stat.decision_map | Guided Stats | stat.decision_map(options?) -> record | Question-led map of suitable statistical approaches |
| stat.compare_groups | Task-first Stats | stat.compare_groups(a, b, options?) -> record | Explicit two-group method, assumptions, alternatives, and result |
| stat.paired_change | Task-first Stats | stat.paired_change(before, after, options?) -> record | Preserve matched pairs in an explicit paired analysis |
| stat.count_association | Task-first Stats | stat.count_association(counts, options?) -> record | Explicit chi-square or Fisher count-table analysis |
| stat.stratified_association | Task-first Stats | stat.stratified_association(strata, options?) -> record | Tarone-adjusted Breslow-Day odds-ratio homogeneity test |
| stat.glm_diagnostics | Guided Stats | stat.glm_diagnostics(x, y, options?) -> record | Binomial or Poisson model diagnostics |
| stat.random_intercept_model | Guided Stats | stat.random_intercept_model(x, y, clusters, options?) -> record | One random-intercept model with pooling diagnostics |
| stat.cox_diagnostics | Guided Stats | stat.cox_diagnostics(time, event, x, options?) -> record | Cox fit and survival-model diagnostic clues |
| mean | Math | mean(list) -> float | Arithmetic mean |
| median | Math | median(list) -> float | Middle value of sorted list |
| stdev | Math | stdev(list) -> float | Standard deviation (sample) |
| variance | Math | variance(list) -> float | Variance (sample) |
| sum | Math | sum(list) -> number | Sum of all elements |
| quantile | Math | quantile(list, q) -> float | Q-th quantile (0.0 to 1.0) |
| ttest | Math | ttest(a, b) -> map | Two-sample t-test |
| ttest_one | Stats | ttest_one(values, mean) -> record | One-sample, two-sided t-test |
| fisher_exact | Stats | fisher_exact(a, b, c, d) -> record | Fisher exact test for a 2 × 2 table |
| power_t_test | Stats | power_t_test(effect, alpha?, power?) -> record | Approximate required sample size per group |
| glm | Stats | glm(formula, table, family?) -> record | Binomial, Gaussian, or Poisson model |
| cor | Math | cor(a, b) -> float | Pearson correlation coefficient |
| sqrt | Math | sqrt(n) -> float | Square root |
| log | Math | log(n) -> float | Natural logarithm |
| random | Math | random() -> float | Random float in [0, 1) |
| upper | String | upper(s) -> string | Convert to uppercase |
| lower | String | lower(s) -> string | Convert to lowercase |
| split | String | split(s, delim) -> list | Split string by delimiter |
| join | String | join(list, sep) -> string | Join list elements into string |
| replace | String | replace(s, old, new) -> string | Replace all occurrences |
| contains | String | contains(s, sub) -> bool | Check if string contains substring |
| format | String | format(template, args...) -> string | Format string with placeholders |
| table | Tables | table(columns) -> table | Create table from column map |
| csv | Tables | csv(path, opts?) -> table | Read CSV file into table |
| select | Tables | select(tbl, cols...) -> table | Select columns from table |
| mutate | Tables | mutate(tbl, name, fn) -> table | Add or modify column |
| left_join | Tables | left_join(a, b, on) -> table | Left join two tables |
| pivot_wider | Tables | pivot_wider(tbl, names, vals) -> table | Pivot from long to wide format |
| matrix | Matrix | matrix(rows) -> matrix | Create matrix from nested lists |
| matmul | Matrix | matmul(a, b) -> matrix | Matrix multiplication |
| pca | Matrix | pca(mat, n_components) -> map | Principal Component Analysis |
| sparse_matrix | Sparse | sparse_matrix(entries, r, c) -> sparse | Create sparse matrix from triplets |
| log1p_cpm | Sparse | log1p_cpm(mat) -> sparse | log(1 + CPM) normalization for scRNA-seq |
| regex_match | Regex | regex_match(s, pattern) -> bool | Test if pattern matches string |
| regex_captures | Regex | regex_captures(s, pattern) -> list | Extract capture groups |
| json_parse | JSON | json_parse(s) -> value | Parse JSON string |
| json_keys | JSON | json_keys(value) -> list | Get keys from a JSON object |
| now | DateTime | now() -> datetime | Current date and time |
| date_diff | DateTime | date_diff(a, b, unit) -> int | Difference between two dates |
| verify_checksum | Hash | verify_checksum(path, expected) -> bool | Verify MD5, SHA-1, or SHA-256 by digest length |
| sketch | Hash | sketch(sequence, k, sketch_size) -> list | MinHash sketch for sequence similarity |
| read_text | Filesystem | read_text(path) -> string | Read file contents as string |
| glob | Filesystem | glob(pattern) -> list | Find files matching glob pattern |
| http_get | HTTP | http_get(url, opts?) -> response | HTTP GET request |
| bio_fetch | HTTP | bio_fetch(db, id) -> map | Fetch record from biological database |
| sparkline | Viz | sparkline(data) -> string | Unicode sparkline chart |
| boxplot | Viz | boxplot(data, opts?) -> string | ASCII boxplot |
| plot | Plotting | plot(data, opts?) -> svg | Generic plot dispatcher |
| heatmap | Plotting | heatmap(mat, opts?) -> svg | Heatmap from matrix data |
| volcano | Plotting | volcano(tbl, opts?) -> svg | Volcano plot for DE analysis |
| manhattan | Bio Plots | manhattan(tbl, opts?) -> svg | Manhattan plot for GWAS |
| circos | Bio Plots | circos(tracks, opts?) -> svg | Circos plot for genomic data |
| cell_embedding | Bio Plots | cell_embedding(coords, labels) -> svg | UMAP/tSNE cell embedding plot |
| container_run | Containers | container_run(image, cmd, opts?) -> map | Run command in container |
| biocontainer | Containers | biocontainer(tool, cmd) -> map | Run BioContainers tool |
| chat | LLM | chat(prompt, opts?) -> string | Send prompt to LLM |
| llm_models | LLM | llm_models() -> list | List available LLM models |
| s3_download | Transfer | s3_download(bucket, key, path) -> string | Download from S3 |
| sra_fastq | Transfer | sra_fastq(accession, outdir) -> list | Download FASTQ from SRA |
| par_map | Advanced | par_map(list, fn, threads?) -> list | Parallel map across threads |
| provenance | Advanced | provenance(value) -> map | Get data provenance/lineage |
Browse by Category
Core
17 functions — print, len, type, range, casting
Collections & HOFs
24 functions — map, filter, reduce, sort, zip
Math & Statistics
Core summaries, tests, models, probability, and maths
Guided Statistics
39 explainable tools — inspect, visualize, diagnose
String Operations
18 functions — split, join, replace, format
Table Operations
32 functions — csv, select, join, pivot
Matrix
18 functions — matmul, svd, pca, eigenvalues
Sparse Matrix
9 functions — sparse ops, log1p_cpm, tfidf
Regex
6 functions — match, find, replace, captures
JSON
6 functions — parse, stringify, read, path
DateTime
7 functions — now, format, parse, add, diff
Hash & Encoding
10 functions — sha256, base64, sketch
File System
18 functions — read, write, glob, mkdir
HTTP & Network
10 functions — get, post, download, bio_fetch
ASCII Plots
8 functions — sparkline, bar_chart, boxplot
SVG Plots
14 functions — scatter, heatmap, volcano
Bio Plots
21 functions — manhattan, circos, oncoprint
Containers
5 functions — container_run, container_pull, tool_search, tool_info, tool_pull
LLM Chat
5 functions — chat, analyze, code, config
Transfer
10 functions — ftp, s3, gcs, sra_fastq
Advanced
20 functions — par_map, spawn, provenance
New in recent releases: additional sequence utilities, expanded sparse matrix ops, and new bio plot types bring the total to 1000+ functions. Check the individual category pages for the latest additions.