| Scaffold rustnim: Rust->Nim transpiler, type mapping 1a218c2 nandi 8h ago | 1 | #!/usr/bin/env bash |
| 2 | # Reproduce every finding. Requires Go 1.26+ and network access. |
| 3 | set -u |
| 4 | here=$(cd "$(dirname "$0")" && pwd) |
| 5 | work=${1:-$here/.work} |
| 6 | mkdir -p "$work" && cd "$work" |
| 7 | |
| 8 | [ -d Code-Transpiler ] || git clone --depth 1 https://github.com/tarekwasfy01/Code-Transpiler |
| 9 | cd Code-Transpiler |
| 10 | export TMPDIR=$PWD/.tmp && mkdir -p .tmp |
| 11 | |
| 12 | echo "=== Building CLI ===" |
| 13 | CGO_ENABLED=0 go build -o "$work/r2many" ./cmd/r2many || exit 1 |
| 14 | |
| 15 | echo |
| 16 | echo "=== CLI: rust -> nim (exit code, then stderr tail) ===" |
| 17 | for f in "$here"/cases/*.rs; do |
| 18 | out=$work/$(basename "$f" .rs).nim |
| 19 | rm -f "$out" |
| 20 | msg=$("$work/r2many" transpile -from rust -to nim "$f" -o "$out" 2>&1) |
| 21 | code=$? |
| 22 | printf '%-24s exit=%s %s' "$(basename "$f")" "$code" "$(printf '%s' "$msg" | tail -1)" |
| 23 | [ -n "$msg" ] || printf '<no error>' |
| 24 | if [ -f "$out" ]; then printf ' emitted: %s' "$(tr -s '\n' ' ' < "$out")"; fi |
| 25 | printf '\n' |
| 26 | done |
| 27 | |
| 28 | echo |
| 29 | echo "=== Frontend prober: UAST node kinds actually produced ===" |
| 30 | mkdir -p cmd/dbg && cp "$here/prober/main.go" cmd/dbg/main.go |
| 31 | for f in "$here"/cases/*.rs; do |
| 32 | printf '%-24s ' "$(basename "$f")"; go run ./cmd/dbg rust "$f" 2>&1 | tail -1 |
| 33 | done |
| 34 | printf '%-24s ' "05-equivalent.R" |
| 35 | go run ./cmd/dbg r "$here/cases/05-equivalent.R" 2>&1 | tail -1 |