The Story of TEMP_JS

TEMP_JS was born out of a desire to help developers focus purely on logic in programming and worry less about superficial rules. It is a statically-typed, transpiled language that embraces simplicity using intelligent type inference to give you the safety of a compiled language with the lightweight feel of a scripting language, combining aspects of famous languages like Python, Rust, JavaScript, and more.

The core philosophy behind TEMP_JS is safety through minimalism. We ditched semicolons and made variables immutable by default to prevent accidental state changes, requiring an explicit mut keyword to allow reassignment. Whether you are iterating through arrays or evaluating complex logical expressions, the language gets out of your way and catches your logical errors at compile-time.

TEMP_JS serves as a complete showcase of modern compiler architecture. Through semantic analysis and constant-folding optimization down to its final JavaScript code generation, everything is designed to make the programmer feel at ease with their work.

Language Features

Core Type System

Variables & State

Expressions & Operators

Control Flow

Safety & Optimization

Static Semantics & Language Constraints

TEMP_JS features a custom static analyzer that enforces type safety, immutability, and safe control flow before your code ever runs. Below are the rules and constraints enforced by the compiler.

Variables and Mutability

Type System

Functions

Arrays and Iteration

Enums and Pattern Matching

Reserved Keywords

You cannot use the following reserved language keywords as variable or function identifiers:

fn, let, mut, if, else, while, for, in, return, break, print, true, false, match, enum

Example Programs

Here are five complete programs covering every syntactic form in TEMP_JS. Try running them or modifying the code!

1. Enums and Pattern Matching

This example demonstrates how to define Enums and use the Match statement to handle data variants. It showcases how TEMP_JS ensures exhaustiveness—meaning you must account for every possible enum variant or boolean state.

2. Functions and String Interpolation

Here you can see Function declarations in action, along with f-strings (formatted strings). This example also highlights how scoping works within if/else branches and how the compiler handles mathematical expressions within print statements.

3. Conditionals and While Loops

This program utilizes a while loop and mutable variables to iterate through a sequence. It combines these with a match statement to transform raw numbers into descriptive strings, demonstrating how the language handles logic flow and state changes.

4. Ranges and For-In Loops

This example showcases the built-in range() function. It demonstrates the three ways to call range (single argument, start/stop, and start/stop/step) and how to use the for-in loop to iterate through these sequences efficiently.

5. Arrays and Mutability

The "Kitchen Sink" example focuses on Array manipulation. It shows how to pass arrays to functions, iterate over them, and perform index assignment on mut arrays. It serves as a practical look at how TEMP_JS handles collections and data mutability.

6. Structs and Field Access

This example introduces structs, TEMP_JS's named record type. It shows how to declare a structs , create both immutable and mutable instances, read fields with dot notation, mutate fields on mut variables, pass structs into functions, and store them in arrays.

7. Interfaces and Method Calls

This example demonstrates interfaces and impl blocks. An interface declares the method signatures a type must provide; the impl block attaches those methods to a struct, with self referring to the instance.

The Creators

Quinn Austin

Quinn Austin

Focused on the semantic analyzer and type inference engine, along with the JavaScript backend. Quinn built out the core logic that makes TEMP_JS safe and reliable.

Colin Bajo-Smith

Colin Bajo-Smith

Worked on Ohm grammar design, custom AST generation pipeline, and the webpage/embedded compiler. Colin ensured the syntax remained clean and minimalist.

Max Lehmann

Max Lehmann

Created constant folding and JavaScript code generation. Max designed and implemented everything relating to the test suites and code flow.