3 Commits

Author SHA1 Message Date
bb0a288210 chore: bump version to 0.1.2 2026-02-18 21:16:44 -05:00
5d7f4633e1 docs: add explicit commit instructions to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:09:27 -05:00
d05b13d840 fix: JS backend compiles print() to console.log()
Bare `print()` calls in Lux now emit `console.log()` in JS output
instead of undefined `print()`. Fixes BUG-006.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:09:07 -05:00
5 changed files with 19 additions and 6 deletions

View File

@@ -71,7 +71,16 @@ cd ../packages/markdown && ../../lang/target/release/lux test
**Do NOT commit if any check fails.** Fix the issue first. **Do NOT commit if any check fails.** Fix the issue first.
### Commit after every piece of work ### Commit after every piece of work
**After completing each logical unit of work, commit immediately.** Do not let changes accumulate uncommitted across multiple features. Each commit should be a single logical change (one feature, one bugfix, etc.). Use `--no-gpg-sign` flag for all commits. **After completing each logical unit of work, commit immediately.** This is NOT optional — every fix, feature, or change MUST be committed right away. Do not let changes accumulate uncommitted across multiple features. Each commit should be a single logical change (one feature, one bugfix, etc.). Use `--no-gpg-sign` flag for all commits.
**Commit workflow:**
1. Make the change
2. Run `./scripts/validate.sh` (all 13 checks must pass)
3. `git add` the relevant files
4. `git commit --no-gpg-sign -m "type: description"` (use conventional commits: fix/feat/chore/docs)
5. Move on to the next task
**Never skip committing.** If you fixed a bug, commit it. If you added a feature, commit it. If you updated docs, commit it. Do not batch unrelated changes into one commit.
**IMPORTANT: Always verify Lux code you write:** **IMPORTANT: Always verify Lux code you write:**
- Run with interpreter: `./target/release/lux file.lux` - Run with interpreter: `./target/release/lux file.lux`

2
Cargo.lock generated
View File

@@ -770,7 +770,7 @@ dependencies = [
[[package]] [[package]]
name = "lux" name = "lux"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"lsp-server", "lsp-server",
"lsp-types", "lsp-types",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "lux" name = "lux"
version = "0.1.1" version = "0.1.2"
edition = "2021" edition = "2021"
description = "A functional programming language with first-class effects, schema evolution, and behavioral types" description = "A functional programming language with first-class effects, schema evolution, and behavioral types"
license = "MIT" license = "MIT"

View File

@@ -44,7 +44,7 @@
printf "\n" printf "\n"
printf " \033[1;35m \033[0m\n" printf " \033[1;35m \033[0m\n"
printf " \033[1;35m \033[0m\n" printf " \033[1;35m \033[0m\n"
printf " \033[1;35m \033[0m v0.1.1\n" printf " \033[1;35m \033[0m v0.1.2\n"
printf "\n" printf "\n"
printf " Functional language with first-class effects\n" printf " Functional language with first-class effects\n"
printf "\n" printf "\n"
@@ -62,7 +62,7 @@
packages.default = pkgs.rustPlatform.buildRustPackage { packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "lux"; pname = "lux";
version = "0.1.1"; version = "0.1.2";
src = ./.; src = ./.;
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
@@ -79,7 +79,7 @@
}; };
in muslPkgs.rustPlatform.buildRustPackage { in muslPkgs.rustPlatform.buildRustPackage {
pname = "lux"; pname = "lux";
version = "0.1.1"; version = "0.1.2";
src = ./.; src = ./.;
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;

View File

@@ -1066,6 +1066,10 @@ impl JsBackend {
let arg = self.emit_expr(&args[0])?; let arg = self.emit_expr(&args[0])?;
return Ok(format!("String({})", arg)); return Ok(format!("String({})", arg));
} }
if ident.name == "print" {
let arg = self.emit_expr(&args[0])?;
return Ok(format!("console.log({})", arg));
}
} }
let arg_strs: Result<Vec<_>, _> = args.iter().map(|a| self.emit_expr(a)).collect(); let arg_strs: Result<Vec<_>, _> = args.iter().map(|a| self.emit_expr(a)).collect();