Solutions to common issues when using T.
Problem: Nix is not installed or not in PATH.
Solution:
# Install Nix
sh <(curl -L https://nixos.org/nix/install) --daemon
# Restart shell or source profile
source ~/.nix-profile/etc/profile.d/nix.shVerify:
nix --version
# Should output: nix (Nix) 2.x.xProblem: Flakes not enabled in Nix configuration.
Solution:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.confFor NixOS users, add to
/etc/nixos/configuration.nix:
nix.settings.experimental-features = [ "nix-command" "flakes" ];Then rebuild:
sudo nixos-rebuild switchProblem: Nix is building dependencies from source (first time).
Solution: Be patient. First build can take 10-30 minutes.
Monitor progress:
nix develop --show-traceSpeed up future builds: Nix caches everything in
/nix/store/.
Problem: Inside Nix shell, Arrow should be available. If not, flake may be broken.
Solution:
# Ensure you're in Nix shell
nix develop
# Verify Arrow is available
pkg-config --modversion arrow-glib
# Should output version number (e.g., 10.0.0)If still failing: Try updating flake:
nix flake update
nix developProblem: Not inside Nix development shell.
Solution:
nix develop
# Now dune should be availableProblem: Modules not compiled or dependency issue.
Solution:
dune clean
dune buildIf still failing: Check dune file
includes necessary modules.
Problem: Parser grammar has ambiguities.
Example output:
Warning: 2 shift/reduce conflicts
Solution (for contributors): - Review
parser.mly for ambiguous rules - Add precedence directives
(%left, %right) - Refactor grammar to remove
ambiguity
For users: Warnings are okay if parser works correctly. Errors must be fixed.
Problem: Variable or function doesn’t exist in current scope.
Solution: 1. Check spelling: prnt →
print 2. Check if variable was assigned 3. Check if
function is in standard library
Check available functions:
> type(print)
"Function"
> type(undefined_func)
Error(NameError: ...)
Problem: Incompatible types in operation.
Solution: Explicit conversion (if available):
-- Bad
"Age: " + 25
-- Error: Cannot add String and Int
-- Workaround: Convert manually or use string concatenation with print
-- Note: Alpha does not have a string() conversion function yet
-- Use print for output instead:
print("Age: ")
print(25)
Problem: Operation on NA without explicit handling.
Solution: Use na_rm = true:
-- Bad
mean([1, 2, NA, 4])
-- Good
mean([1, 2, NA, 4], na_rm = true)
Problem: Dividing by zero.
Solution: Guard condition:
-- Bad
x / y
-- Good
if (y == 0) 0.0 else x / y
-- Or use error recovery
(x / y) ?|> \(result) if (is_error(result)) 0.0 else result
Problem: Usually in Arrow FFI or native code.
Debugging:
# Run with valgrind
valgrind --leak-check=full dune exec src/repl.exeWorkaround: Avoid Arrow operations, use fallback:
-- May crash with large native DataFrames
df = read_csv("huge.csv")
-- Try smaller data or manual loading
Report: This is a bug. Please report with minimal reproducible example.
Problem: Silent evaluation (no
print).
Solution:
-- Expressions at top-level are printed
> 2 + 3
5
-- But assignments are not
> x = 10
10 -- (value shown but not detailed)
-- Use print for detailed output
> print(x)
10
Problem: Severe error or assertion failure.
Solution: Restart REPL. Check what caused the crash and report if reproducible.
Problem: Waiting for multiline completion or invalid syntax.
Solution: - Press Ctrl+C to cancel - Check for
unclosed (, {, [
Problem: CSV file doesn’t exist or wrong path.
Solution:
-- Bad (relative to unknown location)
df = read_csv("data.csv")
-- Good (absolute or known relative path)
df = read_csv("/home/user/project/data.csv")
-- Or check file exists first
ls data.csv # In shell
Problem: Arrow infers types from first rows.
Solution: Ensure data is consistent: - No mixed types in columns - Missing values represented as empty strings (inferred as NA) - Numeric columns don’t have text
Workaround: Preprocess CSV externally or load as strings and convert.
Problem: Column names like "Growth%"
not accessible.
Solution: Use
clean_colnames = true:
df = read_csv("data.csv", clean_colnames = true)
-- "Growth%" becomes "growth_percent"
Problem: Alpha interpreter is slow, especially for large data.
Solutions: 1. Reduce data size: Filter early in pipeline 2. Use native Arrow operations when available 3. Chunk processing: Split large files
Example:
-- Slow: Load everything then filter
df = read_csv("huge.csv")
small = df |> filter(\(row) row.year == 2023)
-- Better: Filter during load (if supported) or filter immediately
df = read_csv("huge.csv")
small = df |> filter(\(row) row.year == 2023) -- Filter early
Problem: Loading large datasets exhausts RAM.
Solutions: 1. Use streaming (not
yet available) 2. Process in chunks (manually split
CSV) 3. Reduce data before loading:
bash # In shell, filter before loading grep "2023" huge.csv > subset.csv
Problem: Precision differences across platforms.
Example:
Expected: 2.333333333
Got: 2.333333334
Solution: This is acceptable if difference < 1e-6. Update test to allow tolerance.
Possible causes: 1. Floating-point precision 2. NA handling differences 3. Sorting order for ties
Solution: Check if differences are significant or just numerical noise.
Problem: Arrow libraries not in library path.
Solution: Use Nix shell (this shouldn’t happen):
nix developIf Nix fails, check flake.nix for macOS-specific
configuration.
Problem: File on Windows mount
(/mnt/c/...) instead of Linux filesystem.
Solution: Clone repository to Linux filesystem:
# Bad (Windows mount)
cd /mnt/c/Users/username/tlang
# Good (Linux filesystem)
cd ~/tlangModify eval.ml (for contributors):
let debug = ref true
let eval env expr =
if !debug then
Printf.eprintf "DEBUG: eval %s\n" (show_expr expr);
(* ... *)See what Nix is building:
nix develop --show-traceCheck Nix store:
ls /nix/store/ | grep arrow
ls /nix/store/ | grep ocamlNuclear option (removes all build artifacts):
dune clean
rm -rf _build
nix develop --command dune buildInclude: - Exact error message - Minimal
code to reproduce - Your environment:
bash uname -a nix --version # Inside nix develop: ocaml --version dune --version pkg-config --modversion arrow-glib
Still stuck? Create a GitHub Issue with details!