Relationship to Luau
Relevant source files
The following files were used as context for generating this wiki page:
Pop Lang is a native, strongly and statically typed programming language heavily inspired by the Luau language. While it adopts Luau's readable syntax and ergonomic features, it is not a clone or a compatibility layer. The project prioritizes stronger semantic guarantees, native abstractions, and a robust static type system over strict Lua compatibility.
The goal is to maintain a "Luau-first" feel for programmers while removing the dynamic foundations—such as universal tables and gradual typing fallback—that characterize Luau and Lua. This ensures that every operation has a statically known meaning suitable for native compilation and high-performance runtimes.
Sources: architecture/01-vision-and-principles.md:3-12, README.md:17-30, architecture/09-relationship-to-luau.md:3-6
Feature Classification Strategy
Pop Lang accounts for Luau's features using a specific architectural inventory. No relevant Luau feature is silently omitted; instead, each is categorized by how it is integrated into the Pop Lang model.
| Class | Meaning |
|---|---|
| Adopt | Preserve the concept with closely related semantics (e.g., closures). |
| Adapt | Preserve the capability but fit it to Pop's native object/type model. |
| Replace | Offer a clearer first-class construct for the use case (e.g., records vs tables). |
| Reject | Exclude for documented semantic, safety, or complexity reasons. |
| Defer | Keep out of the initial language until interactions are fully designed. |
Sources: architecture/09-relationship-to-luau.md:8-20
Feature Integration Matrix
The following table highlights the specific direction for major Luau language areas:
| Luau Area | Pop Lang Direction | Class |
|---|---|---|
| Gradual Typing | Keep local inference; reject dynamic fallback. | Adapt |
| Type Annotations | Core input with soundness rules; no any operations. | Adopt / Adapt |
| Tables | Literal ergonomics kept; require static key/value types. | Adapt |
| Tables as Objects | Use structural records, nominal classes, and interfaces. | Replace |
| Metatables | Use typed operator/iteration protocols and classes. | Replace / Defer |
require Modules | Use file-scoped namespaces and bubble.toml dependencies. | Replace |
| Implicit Globals | Entirely excluded; every name must be resolved statically. | Reject |
number type | Replaced with explicit width types (e.g., Int64, Float64). | Replace |
Sources: architecture/09-relationship-to-luau.md:22-60, README.md:180-195
Architectural Identity and Transitions
Pop Lang explicitly transitions away from Luau's table-centered architecture toward a model where distinct concepts have distinct native representations.
This diagram shows how Pop Lang decomposes the universal Luau table into specific, typed native constructs.
Sources: architecture/19-architecture-conformance-and-regression-policy.md:95-125, README.md:144-155
Lua Regressions
A "Lua Regression" is defined as any change that causes Pop Lang to revert to Lua's dynamic or table-centered conventions. These are considered release-blocking bugs. Prohibited regressions include:
- Introducing
Any,Dynamic, or operational unknown types. - Implementing classes or modules through metatables or hash lookups.
- Resolving program members from runtime strings.
- Permitting implicit globals or mutable environments.
Sources: architecture/19-architecture-conformance-and-regression-policy.md:93-125, AGENTS.md:28-32
Syntax and Aesthetics
Pop Lang maintains a "Luau-First Surface Syntax" to ensure familiarity for Luau developers. Braces are reserved for data and typed-initializer literals rather than declaration blocks, and the language avoids the visual dialects of JavaScript, Rust, or C#.
The relationship between Luau syntax and Pop's extensions.
Sources: architecture/decisions/0005-luau-first-surface-syntax.md:13-18, architecture/01-vision-and-principles.md:14-25
Naming Conventions
Pop Lang establishes a stricter naming convention than Luau to ensure API coherence:
- PascalCase: Namespaces, Types, Interfaces, Enum cases, Attributes.
- camelCase: Functions, methods, fields, locals, parameters.
- UPPER_SNAKE_CASE: Constants only.
- Rejected: Lowercase
snake_caseis not allowed in Pop source.
Sources: architecture/decisions/0005-luau-first-surface-syntax.md:19-21, AGENTS.md:175-185
Conclusion
The relationship between Pop Lang and Luau is one of aesthetic inheritance but architectural divergence. By adopting Luau's surface-level beauty—such as its lightweight syntax and closure model—while rejecting its underlying dynamic machinery, Pop Lang positions itself as a robust, native alternative for general-purpose software development where static guarantees and performance are paramount.
Sources: README.md:235-245, architecture/01-vision-and-principles.md:131-140