Files
bara-lang/experiments/web-target/js_wrappers.nim
T
dimgigov ba0b300917 feat: add fullscreen TUI and project updates
- New TUI screens: Main Menu, Compile, Run, REPL, AI Generator, AI Settings, Help
- AI configuration persisted in ~/.config/cljnim/config.json
- Added illwill dependency for terminal UI
- Updated experiments, examples, docs, and core modules
2026-05-09 01:53:23 +03:00

20 lines
522 B
Nim

# JS-friendly wrappers around Clojure-generated code
# These expose plain JS types (number, string) instead of CljVal
import cljnim_runtime_js
# Import the generated Clojure functions
include build/math
proc jsSquare*(x: int): int {.exportc.} =
let r = square(cljInt(x.int64))
return r.intVal.int
proc jsFactorial*(n: int): int {.exportc.} =
let r = factorial(cljInt(n.int64))
return r.intVal.int
proc jsGreet*(name: cstring): cstring {.exportc.} =
let r = greet(cljString($name))
return r.strVal.cstring