Cores is an experimental, CPU-focused programming language inspired by CUDA concepts. It is designed to leverage parallel execution, thread variables, and low-level concurrency directly on your CPU, with a Python-like minimal syntax.
-
Threaded Execution: Automatically run blocks in parallel using
times:. -
Shared Variables: Use
pub_var,pub_json,pub_array,pub_bool,pub_int,pub_float,pub_strand their uppercase PUB_* counterparts for global state. -
Lightweight Syntax: Minimal constructs like
do:,times:,end:, andwaitblocks. -
Thread Metadata Access: Inspect threads in runtime with variables such as:
THREAD-NAMETHREAD-NUMBERTHREAD-NATIVE-IDTHREAD-IS-ALIVETHREAD-DAEMONTHREAD-IDENTPUB_VAR
-
Dynamic Variable Assignments: Use
ASSIGNto evaluate and store expressions at runtime. -
Line Management: Use
RM-LINEto remove lines after execution. -
CPU Power Utilization: Designed to maximize your CPU cores without the complexity of GPU programming.
-
Blocks:
do:— Defines a code block that runs immediately.times: (N)— Executes the block N times in separate threads.end:— Concludes a code block.wait— Ensures all threads finish before continuing.
-
Global Variables:
- Variables starting with
pub_are automatically shared across threads. - The uppercase PUB_* versions can be used in expressions and prints.
- Variables starting with
-
Special Keywords:
ASSIGN— Marks a line to execute as a runtime assignment.RM-LINE— Marks a line to be removed from the final code after execution.
-
Thread Info:
- Access metadata for each thread, including name, ID, status, and daemon flag.
-
Execution Flow:
- Replace PUB_* placeholders first.
- Execute ASSIGN lines.
- Extract and update pub_* variables.
- Remove lines marked with RM-LINE.
- Current Stable: v1.0
Cores – Unlocking the Full Potential of Your CPU