Skip to content

interpreter: implement missing builtin functions (18 of 23 missing) #19

Description

@Prestgg1

Goal

Implement all 23 builtin functions in the interpreter runtime.

Current State

interpreter/src/runner/builtin/mod.rs only implements 5 of 23:

Implemented

  • Print, Input, Len, LastWord (broken - calls exit(1)), Sum

Missing Builtins

  • Number - convert to number
  • Range - generate range list
  • Trim - trim string whitespace
  • Sqrt - square root
  • Timer - timing function
  • Max - maximum of two values
  • Mod - modulo operation (may overlap with % operator)
  • Min - minimum of two values
  • Round - round float
  • Floor - floor float
  • Ceil - ceiling float
  • Zig - run Zig code inline
  • StrUpper - uppercase string
  • StrReverse - reverse string
  • StrLower - lowercase string
  • Allocator - allocator function
  • ConvertString - string conversion

All of these fall to _ => Value::Void which silently does nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions