8000 feat: Rust target · Issue #24 · Mnehmos/mnehmos.nls.lang · GitHub
[go: up one dir, main page]

Skip to content

feat: Rust target #24

Open
Open

Description

@Mnehmos

Overview

Emit Rust code from .nl files.

Command

nlsc compile src/math.nl --target rust
✓ Generated src/math.rs (58 lines)

Type Mapping

NLS Rust
number f64
string String
boolean bool
list of X Vec
CustomType struct CustomType

Challenges

  • Ownership semantics (borrow vs move)
  • Error handling (Result<T, E> vs panic)
  • Guards → Result::Err vs panic!

Implementation

  • Add emit_rust() in emitter.py
  • Generate structs from @type blocks
  • Generate functions from ANLUs
  • Handle guards as Result returns

Exit Criteria

  • Generated Rust compiles with cargo build
  • Idiomatic Rust code (clippy clean)

Activity

  1. added this to the Phase 4: Ecosystem milestone on Jan 17, 2026
  2. added a commit that references this issue on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitterCode generation targetsenhancementNew feature or requestmulti-targetCross-platform compilation

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0