nandi/rustnimpublic Fork 0
ae9f986fc43d0fc9ab029946e2c7a25cdc72b4ed
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Scaffold rustnim: Rust->Nim transpiler, type mapping 1a218c2 · on ae9f986fc43d0fc9ab029946e2c7a25cdc72b4ed · nandi · 17h ago
base16ct-1.0.0-transcript.txt · 28 lines · 1.2 KBText Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Crate:   base16ct 1.0.0 (crates.io), 613 LOC, pure Rust, no_std
Command: r2many transpile -from rust -to nim <file>.rs -o <file>.nim
Build:   CGO_ENABLED=0 go build ./cmd/r2many   (succeeds)

src/lib.rs      unmatched delimiter ")" at 3346    -> no file written
src/error.rs    unterminated string at 411         -> no file written
src/display.rs  unmatched delimiter ")" at 174     -> no file written
src/lower.rs    unmatched delimiter ")" at 815     -> no file written
src/upper.rs    unmatched delimiter "(" at 817     -> no file written
src/mixed.rs    <no error, exit 0>                 -> mixed.nim  (see below)

Every failing offset lands on a lifetime:
  error.rs:411    fmt::Formatter<'_>
  display.rs:174  pub struct HexDisplay<'a>(pub &'a [u8]);
  lower.rs:815    pub fn encode<'a>(src: &[u8], dst: &'a mut [u8])

mixed.rs contains three functions (decode, decode_vec, decode_nibble).
The complete emitted Nim program was:

    {
    }

Flag behaviour on the same input:
  -native      -> strict native frontend for "rust" is not implemented
  -no-runtime  -> 1/1 translations failed: [{nim DIRECT_NATIVE_UNAVAILABLE (stage=direct)}]
  (default)    -> exit 0, empty program written

Control: R -> Nim on the project's original source language does emit real code.