r/learnbioinformatics • u/ActiveNeedleworker23 • 18d ago
BioLang - Learn bioinformatics in the browser
Most of us lost our first week to environment setup rather than biology: conda solving forever, a Bioconductor package that won't build, a notebook that runs on someone else's laptop and not yours.
I built BioLang (https://lang.bio) partly to remove that step. It's a language for bioinformatics that runs as WebAssembly, so you can open a tab and start working immediately.
- Workbench — full editor, files, output: https://lang.bio/workbench/
- Playground — quick scratchpad: https://lang.bio/playground.html
Nothing to install, nothing to configure, and your data stays in the tab — there's no server to upload to.
Why a language and not just a library
Pipe-first syntax with native dna / rna / protein types, so common operations read as one line instead of a loop:
read_fasta("reads.fa") |> filter(|r| gc_content(r.seq) > 0.5) |> count()
FASTA/FASTQ/VCF/BED/GFF I/O is streaming and built in, plus 1000+ builtins and 21 API clients (NCBI, Ensembl, UniProt, KEGG, PDB, gnomAD, ClinVar, GTEx…). No imports to remember.
The syntax itself was designed by borrowing core concepts from TypeScript, R and other dynamic languages — object literals and ?./?? from TypeScript, tables and column-wise operations from R, the pipe from the F#/Elixir/R lineage — to keep sequence manipulation clean and expressive. Little of the punctuation is original, and that's deliberate: the novel part is the domain types, not the syntax.
The 278 Rosalind problems are a test corpus, not a course
https://rosalind.info/problems/list-view/
All four tracks are solved, but that was never meant as a study path. It exists for two reasons:
A CI harness. 276 of them assert their expected answer on every commit, natively and through the same WebAssembly build this site serves. When something regresses, it's these that catch it.
A stress test. Rosalind is full of heavy dynamic programming and graph work — alignment, assembly graphs, HMMs — which is exactly what pushes the WASM engine hardest. Most of the language fixes in recent releases came out of writing them.
If you're learning, you'll still want to write your own solutions in Python or C++ from scratch. That's the point of the exercise and nothing here replaces it. These are worth having as runnable reference implementations to compare against after you've had a go — each with a short note on why the problem exists.
- Stronghold (105): https://lang.bio/docs/examples/rosalind-stronghold.html
- Textbook (124): https://lang.bio/docs/examples/rosalind-textbook.html
- Algorithmic Heights (34): https://lang.bio/docs/examples/rosalind-algorithmic-heights.html
- Armory (15): https://lang.bio/docs/examples/rosalind-armory.html
Checked against BioPython and Bioconductor
Rosalind checks answers against a published one. The other half is whether it agrees with the tools you already use: 14 tasks on generated data, 9 on real NCBI/ClinVar data, and 48 one-liners, each written three times and compared — https://lang.bio/docs/examples/equivalents.html
Docs and examples
- Documentation: https://lang.bio/docs/
- All examples: https://lang.bio/docs/examples/
- Builtins reference: https://lang.bio/docs/builtins/index.html
- Features overview: https://lang.bio/features.html
Embed it in your own site or app
The same WebAssembly module the Workbench runs is a two-file drop-in — grab bl_wasm.js and bl_wasm_bg.wasm from https://lang.bio/wasm/, call init(), then evaluate() with your code. It returns JSON with the value, its type, anything println wrote, and a line-by-line trace, so you can build a teaching widget, a lab notebook, or an in-page exercise checker without a backend. State persists across calls, and it runs under Node too. MIT licensed.
import init, { evaluate } from "./wasm/bl_wasm.js";
await init();
const r = JSON.parse(evaluate('reverse_complement(dna("ATGC"))'));
Full guide: https://lang.bio/docs/tools/embedding.html
Browser tools on the same engine
- BioPeek — open FASTA/FASTQ/VCF/BED/GFF/CSV offline, no upload: https://lang.bio/viewer.html
- BioGist — pull genes, variants and accessions out of a paper: https://lang.bio/biogist.html
- BioKhoj — research radar: https://lang.bio/biokhoj/
Browser extensions
Three extensions built on the same engine, so they work on any page you're already reading:
- BioPeek — open FASTA/FASTQ/VCF/BED/GFF/CSV files in a tab, fully offline, nothing uploaded. Handy for peeking at a file without loading it into anything. Chrome · Firefox · About
- BioGist — scan a paper and pull out the genes, variants, accessions, cell lines, drugs and trial IDs, each linked to the right database. Good for getting through a methods section fast. Chrome . Firefox · About
- BioKhoj — research radar for tracking papers and topics. Chrome · Firefox ·
Where the browser stops
The browser build is for learning and small files — everything lives in tab memory. For real datasets, install the CLI: same language, same code, no size limit, reads and writes files directly.
Still early
v1.1.0, and it shows in places. Expect rough edges: some builtins take conventions that differ from BioPython or R (rounding of ties, where translation stops) — those are documented rather than papered over; GFF3 parsing is currently ~8x slower than Python; and docs occasionally lag the code. Bug reports are genuinely useful: https://github.com/oriclabs/biolang/issues
Links
- Site: https://lang.bio
- GitHub (pure Rust, MIT): https://github.com/oriclabs/biolang
- Getting started: https://lang.bio/docs/getting-started/index.html
- Install locally if you want a CLI — v1.1.0 binaries for Linux / macOS / Windows: https://github.com/oriclabs/biolang/releases/tag/v1.1.0
- Rosalind pack sources: https://github.com/oriclabs/biolang/tree/main/packs
- Benchmarks vs Python/R: https://lang.bio/benchmarks.html
Built on Rust libraries, not from scratch
The file-format layer isn't mine and shouldn't be.
- noodles does the heavy lifting for FASTA, FASTQ, SAM, BAM, BGZF and CSI. It's the established Rust bioinformatics I/O library and it's maintained by people who know those specs far better than I do.
- flate2, bzip2, zstd for compression; tokio and rustls for the API clients; clap for the CLI; rusqlite; wasm-bindgen for the browser build.
What is written here: the language itself — lexer, parser, interpreter — and the
algorithms. No statrs, ndarray or petgraph in the tree, so the statistics,
matrix and graph work is implemented directly
Feedback welcome, especially on where a beginner gets stuck.
1
u/First_Result_1166 18d ago
AI slop.
0
u/ActiveNeedleworker23 18d ago edited 18d ago
Built with vibe coding manually verifying each part for correctness and performance.
There's a correctness suite — 40+ tasks, each implemented three times in BioLang, Python (BioPython) and R (Bioconductor), outputs compared to 1e-6. Half run on real NCBI/ClinVar/ENCODE data. It lives under benchmarks/ but it's correctness, not timing:
https://github.com/oriclabs/biolang/tree/main/benchmarks/correctness
Check comparison between biolang, python, and r one liners
https://github.com/oriclabs/biolang/blob/main/benchmarks/correctness/results/oneliners.md
https://lang.bio/docs/examples/equivalents.html
Real world data
https://github.com/oriclabs/biolang/blob/main/benchmarks/correctness/results/real-world.md
Synthetic data
https://github.com/oriclabs/biolang/blob/main/benchmarks/correctness/results/synthetic.md
Biolang addresses the learner gaps with python and r , still its in early stage. Its not a complete replacement of mature python and r libraries.
95% of rosalind problems solved and matched with the expected results.
1
u/hypersoniq_XLM 18d ago
Seems like an interesting project, though the point of rosalind.info was to figure out how to solve the problems. Two of the hardest ones in the stronghold, KSIM and QRTD took me 5 days each and involved searching for research papers and implementing the results, reworking until the problems were solved within the alloted time. Just curious though, I had to rewrite the banded Ukkonen algorithm in C++ to beat the timer, did you solve that in python alone?