Add minimal C++ Portal (.prtl) compiler pipeline and CLI#1
Draft
JoeySoprano420 with Copilot wants to merge 6 commits into
Draft
Add minimal C++ Portal (.prtl) compiler pipeline and CLI#1JoeySoprano420 with Copilot wants to merge 6 commits into
JoeySoprano420 with Copilot wants to merge 6 commits into
Conversation
Copilot
AI
changed the title
[WIP] Implement Portal in C++
Add minimal C++ Portal (.prtl) compiler pipeline and CLI
May 27, 2026
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.
Portal is defined as a semantic-native AOT systems language with
.prtlsource and a staged compiler pipeline (lexing → parsing map table → AST → semantic adjustment → optimization → IR → LLVM-ASM hybrid lowering → executable emission).This PR introduces a compact C++ reference implementation of that pipeline and documents how to build and run it.
Compiler baseline (
portal.cpp).prtlprograms.#,;,--, and// ... ;)Program/Statement)<input>.prtl.out).CLI behavior
portal <file.prtl>for compilationportal --self-testfor a built-in pipeline smoke path.prtlextension for source input.Documentation updates (
README.md)Example usage:
Original prompt
Implement this in C++
Portal (.prtl)
Industrial Canonical Edition
Portal is a native-speed Ahead-of-Time systems programming language built around computerized grammar, virtual syntax, universal semantics, and conditional-oriented execution.
File extension:
.prtl
Portal transforms expressive human-structured source code into aggressively optimized native machine execution through a semantic compiler architecture that lowers source into LLVM-ASM hybrid infrastructure before emitting portable executables.
Portal is designed for:
native systems software
runtime engines
rendering infrastructure
parallel execution systems
simulation frameworks
operating-level tooling
high-performance applications
game engines
AI execution environments
machine-oriented orchestration
native desktop platforms
compiler infrastructure
executable automation systems
Portal combines:
strong static typing
machine-oriented execution
semantic-driven compilation
compiler-friendly structure
conditional logic flow
deterministic parsing
modern readable syntax
aggressive optimization
universal interoperability
compile-time abstraction dissolution
semantic inference systems
intrinsic runtime tuning
into one cohesive industrial language architecture.
Executive Identity
Portal is a semantic-native systems language.
It is designed around the principle:
Portal eliminates excessive punctuation, symbolic clutter, and abstraction overhead while preserving full systems-level power and native performance.
Portal programs compile:
.prtl
→ lexical analysis
→ parsing map table
→ AST
→ semantic adjuster
→ optimizer
→ IR
→ LLVM-ASM hybrid lowering
→ code generator
→ portable executable
The compiler architecture is designed to maximize:
optimization visibility
semantic deduction
deterministic execution
native interoperability
compile-time reasoning
executable efficiency
Core Language Philosophy
Portal is based on:
Conditional-Oriented Execution
Execution is structured around:
conditional flow
semantic routing
contextual logic
layered resolution
execution legality
flow deduction
Programs are interpreted semantically before they are lowered structurally.
Universal Semantics
Portal does not rely solely on token sequences.
Instead, the compiler uses:
semantic interpretation
contextual deduction
parser layering
structural analysis
execution profiling
compiler-side inference
to determine executable meaning.
Virtual Syntax
Portal syntax is intentionally flexible internally while remaining deterministic externally.
The language uses:
semantic interpretation
compiler-guided restructuring
contextual matching
structural folding
inference layering
instead of punctuation-heavy grammar models.
Metal-Driven Rulesets
Portal’s legality system is machine-oriented.
Rules are determined through:
executable validity
opcode legality
optimizer visibility
memory safety boundaries
target architecture rules
profiling analysis
execution feasibility
Typing System
Portal is:
strongly typed
statically typed
compiler-verified
inference-assisted
Typing is explicit where necessary and inferred where safe.
Primitive implementation details remain abstracted beneath the semantic layer.
Hidden Primitive Architecture
Portal internally supports primitives such as:
bool
char
int
float
enums
flows
constructs
val
var
init
but their low-level representation is abstracted behind compiler semantics.
The programmer works with expressive structures while the compiler manages primitive realization internally.
Syntax Philosophy
Portal intentionally minimizes punctuation.
Symbols only exist where they improve:
compiler determinism
structural clarity
semantic distinction
execution legality
Everything else is handled through:
indentation
semantic grouping
contextual interpretation
parser inference
Core Structural Symbols
Comments
Portal comments use:
// comment ;
Comments terminate formally with:
;
This preserves deterministic parsing.
Statement Closers
Portal uses:
;
as the authoritative closure marker.
Example:
val health = 400 ;
Benefits:
deterministic token boundaries
parser acceleration
simplified AST segmentation
reduced ambiguity
Preprocessors
Portal preprocessors use:
Example:
#link graphics ;
#import renderer ;
#profile aggressive ;
Preprocessors operate at compiler level.
Active Indentation
Indentation is semantic.
Indentation directly affects:
scope ownership
parser hierarchy
execution grouping
optimization visibility
semantic layering
Example:
flow combat ;
;
Unsafe Regions
Unsafe execution is explicitly marked using:
--
Example:
-- raw.memory.write address value ;
or:
-- inline.asm ;
...