Add typed language foundations for 0.1.0-rc.3 - #15
Merged
Conversation
Add decimal and exponent literals, complete numeric ordering, and explicit target-type conversions under ADR 0040. Carry exact conversion kinds through compile-time IR, HIR, and MIR so verification and optimization retain one portable contract.\n\nImplement checked conversion behavior in the MIR interpreter, LLVM, and strict C11 backends, including NumericConversion traps and direct IEEE rounding without double-rounding through Float64.
Define Luau-shaped concatenation, interpolation, and escape decoding as a closed static contract. Lower primitive formatting through backend-neutral HIR and MIR operations so the interpreter and native backend produce identical UTF-8 values without reflection or dynamic dispatch.\n\nAdvance the native runtime ABI for allocating string helpers and keep constant string composition available to the runtime-free C subset.
Define the first numeric for form as an inclusive, fixed-integer range with once-only bound evaluation and an immutable loop binding. Add typed break and continue semantics for while, repeat, and numeric for loops without introducing dynamic iteration.\n\nPreserve the source concepts in HIR and lower them to verified MIR control flow with checked progression, typed zero-step traps, block arguments, and mandatory backedge safe points. Keep generalized iteration deferred to the nominal Iterable and Iterator contracts.
Define the lazy, statically typed conditional-value contract in ADR 0043 and synchronize the language architecture. Parse and type-check Luau-shaped if expressions and elseif chains, preserve them in HIR, and lower them through typed MIR control-flow joins shared by compile-time evaluation and native backends.\n\nMark joins unreachable when every statement arm terminates so nested elseif chains cannot expose undefined live-state values during LLVM edge splitting.
Define compound assignment as a closed typed extension of Pop Lang's existing numeric and string operators. Preserve mutable field and array targets through HIR so receivers and indexes evaluate once, then lower them to existing checked MIR load, operation, barrier, and store instructions.\n\nReject immutable and mismatched targets, trap on indexed bounds before evaluating the right-hand side, and keep captured local mutation on shared cells across interpreter and native backends.
Define exact fixed-pack returns and comma-shaped local bindings without Lua value adjustment or a dynamic variadic carrier. Preserve target, value, and store ordering through verified HIR and MIR tuple projection so interpreter and LLVM behavior agree.\n\nReject the managed representation explicitly in the runtime-free C subset and support deterministic fixed-pack bindings in restricted compile-time evaluation.
Permit one-based literal projection from fixed tuples while preserving the exact element type. Reject computed and invalid indexes during type checking, carry the operation through verified HIR, and reuse the canonical MIR tuple projection across compile-time evaluation, the interpreter, and LLVM.
Define optional typed lookup and insert-or-replace assignment for associative tables. Carry closed table operations through verified HIR and MIR, preserve deterministic insertion order, and add precise native growth behind ABI 1.6 while keeping fixed arrays unchanged.
Substitute deterministically evaluated namespace constants into typed runtime bodies. Preserve exact types and visibility while avoiding mutable globals, runtime name lookup, and backend-specific constant machinery.
Resolve non-generic namespace aliases to their exact target types before HIR construction. Support alias chains while rejecting cycles and type arguments without introducing nominal identity or backend operations.
Introduce payload-free enum declarations with stable typed case identities and exact same-enum equality. Preserve enum declarations and constants through verified HIR and MIR, execute them in the interpreter, and lower their compact discriminants to LLVM i32 values.
Retain ordered semantic type arguments in HIR and fully specialize reachable concrete function and data instances during MIR lowering. This makes generic functions, records, and tagged unions executable without runtime type lookup or dynamic values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expand the statically typed Pop Lang foundation for
0.1.0-rc.3and add theroadmap toward the first supported
0.1.0release.This change adds:
forranges,break, andcontinue;elseif;ROADMAP.mdcovering the remaining0.1.0release blockers;Optional narrowing, generalized iteration, the complete typed-error workflow,
and the remaining production runtime/tooling work are intentionally tracked in
the roadmap rather than presented as completed.
Architecture traceability
architecture/04-intermediate-representations.mdarchitecture/07-implementation-roadmap.mdarchitecture/08.1-closed-design-questions.mdarchitecture/12-type-system-architecture.mdarchitecture/13-syntax-and-nomenclature.mdarchitecture/19-architecture-conformance-and-regression-policy.mdconcrete backend-neutral MIR.
ROADMAP.mdidentifies0.1.0-rc.3as the current release candidate andrecords the accepted path to
0.1.0.implementation-roadmap documents.
Verification
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo test --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningsIf a check was not run, explain why:
for the generic implementation before the final compile-time generic test was
added.
explicit_generic_compile_time_calls_use_concrete_static_typesfails becausethe compile-time evaluator publishes no constant for the generic call. This
remains a blocker before merge.
passed.
ROADMAP.mdlinks resolve andgit diff --checkpassed.crates, including
too_many_linesandOption<Option<T>>warnings.Review notes
Known limitations and follow-up work:
specialization. Type-argument inference, portable generic reference metadata,
and typed code sharing remain later work.
behavior instead of providing a fallback.
standard-library completion, Package/Workspace tooling, and final release
gates are tracked in
ROADMAP.md.popbook/is local untracked content and is not included in this pull request.