deleted song
This commit is contained in:
parent
f5044a2892
commit
485c24839f
12
LICENSE
Normal file
12
LICENSE
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright 2025 Carle-Margueritte Alexandre
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this documentation to deal in the Documentation without restriction,
|
||||||
|
including without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Documentation, and to
|
||||||
|
permit persons to whom the Documentation is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
THE DOCUMENTATION IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
||||||
17
server.go
Normal file
17
server.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fs := http.FileServer(http.Dir("./sterling"))
|
||||||
|
http.Handle("/", fs)
|
||||||
|
|
||||||
|
log.Println("Serving at http://localhost:8080")
|
||||||
|
err := http.ListenAndServe(":8080", nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=https://notube.lol/
|
|
||||||
HostUrl=https://s54.notube.lol/download.php?token=5f15cd14334e4930e9c79f9d74ad31da&key=amwl7fyh9dhxt2au
|
|
||||||
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=https://notube.lol/
|
|
||||||
HostUrl=https://s43.notube.lol/download.php?token=23a13a3144dd96cdd58f3b64daebea4c&key=7pxuaym283gtz06u
|
|
||||||
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=https://notube.lol/
|
|
||||||
HostUrl=https://s44.notube.lol/download.php?token=88de54461ec0988ec579bb2164ec06ed&key=6wi22j8j1ccduili
|
|
||||||
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
HostUrl=https://i.gifer.com/embedded/download/RpdC.gif
|
|
||||||
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
ReferrerUrl=C:\Users\emilia\Downloads\favicon(1).zip
|
|
||||||
BIN
sterling/assets/IosevkaSS15-Regular.ttf
Normal file
BIN
sterling/assets/IosevkaSS15-Regular.ttf
Normal file
Binary file not shown.
138
sterling/css/base.css
Normal file
138
sterling/css/base.css
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
:root {
|
||||||
|
--bg-color: #0f1117;
|
||||||
|
--fg-color: #f4f4f4;
|
||||||
|
--accent-color: #00ffe0;
|
||||||
|
--code-bg: #1a1c22;
|
||||||
|
--section-gap: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: 'Iosevka SS14', monospace;
|
||||||
|
background-color: var(--bg-color);
|
||||||
|
color: var(--fg-color);
|
||||||
|
transition: background 0.3s, color 0.3s;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
background: #000;
|
||||||
|
padding: 1rem;
|
||||||
|
color: var(--fg-color);
|
||||||
|
text-align: center;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 10;
|
||||||
|
box-shadow: 0 0 10px #0008;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3 {
|
||||||
|
color: var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchInput {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
top: 100%;
|
||||||
|
right: 1rem;
|
||||||
|
padding: 0.5rem;
|
||||||
|
border: 1px solid var(--fg-color);
|
||||||
|
z-index: 5;
|
||||||
|
width: 200px;
|
||||||
|
background: none;
|
||||||
|
color: var(--fg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.controls {
|
||||||
|
background: #111;
|
||||||
|
padding: 1rem;
|
||||||
|
border-top: 1px solid #333;
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.controls button {
|
||||||
|
background: none;
|
||||||
|
border: 1px solid var(--fg-color);
|
||||||
|
color: var(--fg-color);
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section h2 {
|
||||||
|
color: var(--accent-color);
|
||||||
|
font-size: 1.25rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-content {
|
||||||
|
display: none;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section.open .section-content {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background: var(--code-bg);
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
/*display: block;*/
|
||||||
|
background: var(--code-bg);
|
||||||
|
/*padding: 1rem;*/
|
||||||
|
margin: 1rem 0;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
color: #aaffaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #00ffe0;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
display: flex;
|
||||||
|
/*flex-flow: column;*/
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
background: var(--code-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
footer section{
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
padding: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer h4 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.controls, #searchDropdown, #searchToggle {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
0
sterling/html/back-end.html
Normal file
0
sterling/html/back-end.html
Normal file
0
sterling/html/exemple.html
Normal file
0
sterling/html/exemple.html
Normal file
0
sterling/html/start.html
Normal file
0
sterling/html/start.html
Normal file
451
sterling/index.html
Normal file
451
sterling/index.html
Normal file
@ -0,0 +1,451 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link href="/assets/IosevkaSS15-Regular.ttf" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="css/base.css">
|
||||||
|
<title>Language Documentation</title>
|
||||||
|
<script src="./js/base.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="width:100%">
|
||||||
|
<header>
|
||||||
|
<h1>Sterling Documentation</h1>
|
||||||
|
<input type="text" id="searchInput" placeholder="Search..." oninput="filterContent()">
|
||||||
|
<div class="controls">
|
||||||
|
<button onclick="toggleTheme()">Toggle Theme</button>
|
||||||
|
<button onclick="window.print()">Export to PDF</button>
|
||||||
|
<button onclick="downloadOfflineVersion()">Download Offline</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
|
||||||
|
<main id="doc-content">
|
||||||
|
|
||||||
|
<p>Version: <code>0.1.0-alpha</code></p>
|
||||||
|
|
||||||
|
<h2>Preface</h2>
|
||||||
|
<p>"An Idiot admire complexity, a genius admire simplicity" <em>Terry A. Davis</em></p>
|
||||||
|
<p>"Master All, Ace One" <em>Boykisser</em></p>
|
||||||
|
|
||||||
|
<h2>Overview</h2>
|
||||||
|
<p>Sterling is a low-level, strongly typed, systems programming language designed for performance, ABI stability, C interoperability, and full control over memory and hardware. It supports metaprogramming, hot-reloading, inline and raw assembly, and is built for multi-file compilation. It also introduces memory safety primitives and modern low-abstraction control flow enhancements.</p>
|
||||||
|
|
||||||
|
<h3>This Document is a work in progress, features are not yet implemented and i use this as a design document to stay true to my vision</h3>
|
||||||
|
|
||||||
|
<h2>File Extensions <em>(subject to change)</em></h2>
|
||||||
|
<ul>
|
||||||
|
<li>Source files: <code>.stg</code></li>
|
||||||
|
<li>Header files: <code>.sth</code></li>
|
||||||
|
</ul>
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Function</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
|
||||||
|
<h3>Qualifiers</h3>
|
||||||
|
<p>Every function must declare its linkage explicitly:</p>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
fn //globally visible, default linkage
|
||||||
|
fn_static //translation unit-local only
|
||||||
|
fn_inline //inline-only, no symbol emitted
|
||||||
|
fn_asm //raw assembly function, globally visible
|
||||||
|
fn_static_asm //raw assembly function, TU-local only
|
||||||
|
fn_inline_asm //inline-only asm, no symbol emitted
|
||||||
|
fn_async //for fiber (coroutine) ??
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>Syntax</h3>
|
||||||
|
<p>All functions must explicitly declare their return type. The only exception is <code>void</code>, which may be omitted for brevity when no return value is intended.</p>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
fn u32 add(u32 a, u32 b) {
|
||||||
|
return (a + b);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn_inline u32 max(u32 a, u32 b) {
|
||||||
|
return ((a > b) ? a : b);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn exit() {
|
||||||
|
// equivalent to fn void exit()
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>Assembly</h3>
|
||||||
|
<p>Write raw x86_64 assembly using <code>fn_asm</code> or <code>fn_static_asm</code>. Symbol, section, and global declaration are implicit.(placeholder)</p>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
fn_asm void* memset(void* dst, u8 value, u64 size) {
|
||||||
|
test rdx, rdx
|
||||||
|
je .done
|
||||||
|
|
||||||
|
mov rax, rsi
|
||||||
|
mov rdi, rdi
|
||||||
|
mov rcx, rdx
|
||||||
|
|
||||||
|
rep stosb
|
||||||
|
|
||||||
|
.done:
|
||||||
|
mov rax, rdi
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Syscalls</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p>System calls are allowed via <code>fn_asm</code> or wrapped using concrete ABI-aware interfaces. Example: (placeholder)</p>
|
||||||
|
<pre><code>
|
||||||
|
fn_asm void exit() {
|
||||||
|
mov rax, 60 ; syscall: exit
|
||||||
|
mov rdi, 0 ; exit code
|
||||||
|
syscall
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Register Access</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p>Sterling exposes raw CPU registers as language-level primitives. This is intended for kernel, embedded, and runtime-critical tasks.</p>
|
||||||
|
<pre><code>
|
||||||
|
fn u64 get_rbp() {
|
||||||
|
return rbp;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn void set_rsp(u64 val) {
|
||||||
|
rsp = val;
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<p>Supported registers: <code>rax, rbx, rcx, rdx, rsi, rdi, rsp, rbp, r8..r15</code>.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Types</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
i8, i16, i32, i64 // signed integers
|
||||||
|
u8, u16, u32, u64 // unsigned integers
|
||||||
|
f32, f64 // 32-bit and 64-bit IEEE floats
|
||||||
|
bool // 1-byte boolean, 0 or 1 only//maybe but not a fan of them
|
||||||
|
char // 1-byte character (UTF-8)
|
||||||
|
</code></pre>
|
||||||
|
<pre><code>
|
||||||
|
T* // Pointer to type T
|
||||||
|
ptr* // Special pointer with implicit coercion allowed
|
||||||
|
void* // Opaque pointer with explicit cast required
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
typedef struct {
|
||||||
|
u32 x = 5;
|
||||||
|
u32 y;
|
||||||
|
} vec2u;
|
||||||
|
|
||||||
|
vec2u a = {}; // x = 5, y = 0
|
||||||
|
vec2u b = {0}; // x = 0, y = 0
|
||||||
|
vec2u c; // x = 0, y = 0
|
||||||
|
</code></pre>
|
||||||
|
<pre><code>
|
||||||
|
u32 raw_val @raw; // raw_val = ? can be poopoo data
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Memory Model</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p>Manual memory management by default. Variables are zero-initialized unless marked <code>@raw</code>. All layout is predictable and cache-friendly. Custom allocators are encouraged.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Stack</strong>: locals</li>
|
||||||
|
<li><strong>Heap</strong>: explicit alloc/free</li>
|
||||||
|
<li><strong>Inline</strong>: structs passed by value</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!--<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Bitfields</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<pre><code>
|
||||||
|
typedef struct(bitfield) {
|
||||||
|
u8 field0 : 3;
|
||||||
|
u8 field1 : 5;
|
||||||
|
} Flags8;
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
</section>-->
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Control Flow</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
|
||||||
|
<h3>Loop</h3>
|
||||||
|
<p>Sterling introduces tagged loops and escape blocks for structured yet flat nested loop
|
||||||
|
behavior:</p>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
loop_outer: loop {
|
||||||
|
loop_inner: loop {
|
||||||
|
if (should_exit_inner()) break loop_inner;
|
||||||
|
if (should_exit_outer()) break loop_outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loop {
|
||||||
|
i32 i;//default init at 0
|
||||||
|
|
||||||
|
while() {
|
||||||
|
do
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loop {
|
||||||
|
i32 i;
|
||||||
|
while() {
|
||||||
|
do
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for_each (tmp : array(T)) {
|
||||||
|
}?
|
||||||
|
</code></pre>
|
||||||
|
<p>This allows control without stack-nesting or excessive flags.</p>
|
||||||
|
|
||||||
|
<h3>Branching</h3>
|
||||||
|
<p></p>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
|
||||||
|
fn u32 test(u32 x, u32 y) {
|
||||||
|
if (x == y) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (x == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (y == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (data) {
|
||||||
|
(a) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
(b) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
block search {
|
||||||
|
loop delta {
|
||||||
|
i32 i;
|
||||||
|
while() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Dynamic Arrays with Aligned Layout</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p>Runtime-initialized aligned linear arrays can be used to simulate array-of-array structures, where all memory layout is controlled explicitly with offsets:</p>
|
||||||
|
<pre><code>
|
||||||
|
struct ArrayView {
|
||||||
|
u8* data;
|
||||||
|
u32 stride;
|
||||||
|
u32 count;
|
||||||
|
};
|
||||||
|
</code></pre>
|
||||||
|
<p>Insertions and deletions move memory explicitly, re-aligning if needed.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Dynamic Linking</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p>Sterling does not rely on dynamic linking by default. Static linking is favored for OS and runtime simplicity. Dynamic linking may be optionally implemented via host-defined facilities in the future.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Metaprogramming</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p><em>also i am not thinking of having something as close as what jai have, if you want solid meta programming look out for when jai become open beta</em></p>
|
||||||
|
|
||||||
|
<h2>Metaprogramming</h2>
|
||||||
|
<p>Sterling supports compile-time metaprogramming via the <code>meta</code> keyword. Meta constructs are evaluated at compile time and allow structured code generation, reflection, and type introspection.</p>
|
||||||
|
|
||||||
|
<h3>Capabilities</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Generate code at compile-time (functions, structs, constants)</li>
|
||||||
|
<li>Inspect type properties: size, alignment, fields</li>
|
||||||
|
<li>Enumerate over struct fields, enum variants, function parameters</li>
|
||||||
|
<li>Branch compile-time logic via <code>meta if</code>, <code>meta match</code></li>
|
||||||
|
<li>Define metafunctions using <code>meta fn</code> (not emitted at runtime)</li>
|
||||||
|
<li>Support platform/target-specific compilation logic</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Restrictions</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Meta code must be side-effect free (pure, deterministic)</li>
|
||||||
|
<li>No runtime reflection or dynamic codegen</li>
|
||||||
|
<li>No access to I/O, filesystem, or arbitrary memory</li>
|
||||||
|
<li>All meta-expansions must type-check</li>
|
||||||
|
<li>Expansion depth and iteration count are bounded</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Example</h3>
|
||||||
|
<pre><code>
|
||||||
|
meta fn print_fields_of(T) {
|
||||||
|
for (field : fields(T)) {
|
||||||
|
print("Field: ", field.name, " of type ", field.type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meta if sizeof(T) > 64 {
|
||||||
|
fn_inline void fast_copy(T* dst, T* src) { ... }
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>Compiler Meta API (proposed)</h3>
|
||||||
|
<pre><code>
|
||||||
|
meta_typeof(expr)
|
||||||
|
meta_sizeof(T)
|
||||||
|
meta_alignof(T)
|
||||||
|
meta_fields_of(T)
|
||||||
|
meta_fn_params(fn)
|
||||||
|
meta_platform() // e.g., "linux", "windows"
|
||||||
|
meta_codegen(name, ast_block) // gated for advanced use
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">ABI and Interop</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p><em>TODO: Specify ABI model (System V AMD64), calling convention details, struct/pointer representation rules. C interaction, emiting ELF/COFF/Mach-O symbol tables .o</em></p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Threading</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p><em>TODO: Describe standard threading model, scheduler integration, context switching, green threads API.</em></p>
|
||||||
|
|
||||||
|
<h3>Fiber (Coroutine)</h3>
|
||||||
|
<p>Using user managed stack that is allocated (usefull for userland threading)</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Each <code>fiber</code> as:</li>
|
||||||
|
<ul>
|
||||||
|
<li>Its own manually allocated stack</li>
|
||||||
|
<li>Registers saved/restored on yield and resume</li>
|
||||||
|
<li>Tracked by a runtime scheduler (or user managed)</li>
|
||||||
|
</ul>
|
||||||
|
<li><code>fiber_yield()</code> triggers context switch, calling back into a fiber scheduler</li>
|
||||||
|
<li>Can be pooled, migrated between threads, or used for deterministic execution (e.g., game loops, scripting)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4>Internal Scheduler Model</h4>
|
||||||
|
<ul>
|
||||||
|
<li>A circular queue or priority queue of fiber_ids</li>
|
||||||
|
<li><code>fiber_yield()</code> pushes current fiber to back of queue</li>
|
||||||
|
<li><code>fiber_resume()</code> pulls next and switches context</li>
|
||||||
|
</ul>
|
||||||
|
<p>This allows async, non-blocking logic to be modeled without system threads.<p>
|
||||||
|
|
||||||
|
<h4>Safety and ABI Guarantees</h4>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>define the fiber stack layout, allowing for precise control (great for embedded targets)</li>
|
||||||
|
<li><code>fiber_spawn</code> can return errors if stack is misaligned or exhausted</li>
|
||||||
|
<li>ABI guarantees for fiber functions: must follow a calling convention you define (e.g., preserved registers)</li>
|
||||||
|
|
||||||
|
<h3>Thread</h3>
|
||||||
|
<p></p>
|
||||||
|
<ul>
|
||||||
|
<li>Created via OS APIs (e.g., pthread, CreateThread, or syscall wrappers)</li>
|
||||||
|
<li>Each thread runs independently; shares global heap and data structures</li>
|
||||||
|
<li>You wrap OS threads and assign them entry points via thread_spawn</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4>Thread Primitives</h4>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
fn thread_spawn(void fn() entry_fn) -> thread_id;
|
||||||
|
fn thread_join(thread_id tid);
|
||||||
|
fn thread_exit();
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h4>Fiber Primitives</h4>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
typedef struct fiber {
|
||||||
|
void* stack;
|
||||||
|
u64 stack_size;
|
||||||
|
void* ip;//instruction pointer
|
||||||
|
u8 flag;
|
||||||
|
} fiber;
|
||||||
|
|
||||||
|
fn fiber_spawn(void fn() entry_fn) -> fiber_id;
|
||||||
|
fn fiber_yield();
|
||||||
|
fn fiber_resume(fiber_id id);
|
||||||
|
fn fiber_self() -> fiber_id;//could also be used instead of fork ex main process fibe_self = 0;
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h4>Optional stack control:</h4>
|
||||||
|
|
||||||
|
<pre><code>
|
||||||
|
fn fiber_spawn_stack(void fn(), void* stack_ptr, u64 size);
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Graphics and Rendering</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p><em>TODO: Describe native rendering interface</em>I have been thinking about supporting amd gpu acceleration with very few set of actual call, very fewer than opengl or other, but i will focus only on one hardware at first</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section">
|
||||||
|
<h2 onclick="toggleSection(this)">Build and Compilation Model</h2>
|
||||||
|
<div class="section-content">
|
||||||
|
<p><em>TODO: AOT compilation, linker behavior, multi-file project structure, module system (if any).</em></p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<section>
|
||||||
|
<h4>email</h4>
|
||||||
|
<p>dev@sleepeesoftware.fr</p>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h4>website</h4>
|
||||||
|
<p>sleepeesoftware.fr</p>
|
||||||
|
</section>
|
||||||
|
</footer>
|
||||||
|
<p style="text-align: center;">Copyright @ 2025 Carle-Margueritte Alexandre<br>Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.<br>
|
||||||
|
Verbatim copying and redistribution of any of the photos in the photos subdirectory is permitted under the <a href="https://opensource.org/license/mit">MIT License</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
33
sterling/js/base.js
Normal file
33
sterling/js/base.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
function toggleTheme() {
|
||||||
|
const root = document.documentElement;
|
||||||
|
const dark = root.style.getPropertyValue('--bg-color') === '#0f1117';
|
||||||
|
root.style.setProperty('--bg-color', dark ? '#ffffff' : '#0f1117');
|
||||||
|
root.style.setProperty('--fg-color', dark ? '#000000' : '#f4f4f4');
|
||||||
|
root.style.setProperty('--code-bg', dark ? '#f0f0f0' : '#1a1c22');
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterContent() {
|
||||||
|
const query = document.getElementById('searchInput').value.toLowerCase();
|
||||||
|
document.querySelectorAll('.section').forEach(section => {
|
||||||
|
const text = section.innerText.toLowerCase();
|
||||||
|
section.style.display = text.includes(query) ? 'block' : 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadOfflineVersion() {
|
||||||
|
const blob = new Blob([document.documentElement.outerHTML], { type: 'text/html' });
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = URL.createObjectURL(blob);
|
||||||
|
a.download = 'SystemsLangDocumentation.html';
|
||||||
|
a.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSection(header) {
|
||||||
|
const section = header.parentElement;
|
||||||
|
section.classList.toggle('open');
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSearch() {
|
||||||
|
const dropdown = document.getElementById('searchDropdown');
|
||||||
|
dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user