my brain is leaking

This commit is contained in:
fatmeat 2025-06-06 16:42:49 +02:00
parent ac1cb044c6
commit 87bb15eecf
9 changed files with 130 additions and 136 deletions

View File

@ -1,13 +1,5 @@
#include <dlfcn.h>
int main(void) {
#ifdef _WIN32
#else
#endif
return (0);
}

View File

@ -50,6 +50,7 @@ h3 {
.foreground-container {
max-width: 960px;
min-height: 720px;
margin: 0 auto;
background-color: rgba(0, 0, 0, 0.85);
box-shadow: 0 0 20px var(--secondary-color);
@ -96,13 +97,12 @@ nav ul li a:hover {
color: var(--background-color);
}
footer {
.footer-container {
max-width: 960px;
margin: 0 auto;
background-color: rgba(0, 0, 0, 0.85);
box-shadow: 0 0 20px var(--secondary-color);
padding: 2rem;
bottom: 0;
position: relative;
z-index: 1;
border-radius: 2% / 1.5%;
@ -139,6 +139,14 @@ ul {
list-style: none;
}
#docs-list {
display: flex;
gap: 1em;
flex-direction: column;
flex-wrap: nowrap;
list-style: none;
}
footer a {
text-decoration: none;
color: var(--primary-color);

View File

@ -79,12 +79,8 @@ main {
}
.section-content {
display: none;
margin-top: 1rem;
}
.section.open .section-content {
display: block;
margin-top: 1rem;
}
pre {

View File

@ -6,8 +6,8 @@
<link href="../assets/IosevkaSS15-Regular.ttf" rel="stylesheet">
<link rel="stylesheet" href="../css/sterling.css">
<link rel="stylesheet" href="../css/global.css">
<title>Sterling Documentation</title>
<script src="../js/sterling.js"></script>
<title>Sterling Documentation</title>
</head>
<body>
<div style="width:100%">
@ -41,36 +41,36 @@
<li>Header files: <code>.sth</code></li>
</ul>
<section class="section">
<h2 onclick="toggleSection(this)">Function</h2>
<h2>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) ??
//globally visible, default linkage
static //translation unit-local only
inline //inline-only, no symbol emitted
asm //raw assembly function, globally visible
static_asm //raw assembly function, TU-local only
inline_asm //inline-only asm, no symbol emitted
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) {
u32 add(u32 a, u32 b) {
return (a + b);
}
fn_inline u32 max(u32 a, u32 b) {
inline u32 max(u32 a, u32 b) {
return ((a > b) ? a : b);
}
fn exit() {
// equivalent to fn void exit()
exit() {
// equivalent to void exit()
}
</code></pre>
@ -78,7 +78,7 @@ fn exit() {
<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) {
asm void* memset(void* dst, u8 value, u64 size) {
test rdx, rdx
je .done
@ -97,11 +97,11 @@ fn_asm void* memset(void* dst, u8 value, u64 size) {
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Syscalls</h2>
<h2>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() {
asm void exit() {
mov rax, 60 ; syscall: exit
mov rdi, 0 ; exit code
syscall
@ -112,15 +112,15 @@ fn_asm void exit() {
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Register Access</h2>
<h2>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() {
u64 get_rbp() {
return rbp;
}
fn void set_rsp(u64 val) {
void set_rsp(u64 val) {
rsp = val;
}
</code></pre>
@ -129,7 +129,7 @@ fn void set_rsp(u64 val) {
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Types</h2>
<h2>Types</h2>
<div class="section-content">
<pre><code>
@ -162,7 +162,7 @@ u32 raw_val @raw; // raw_val = ? can be poopoo data
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Memory Model</h2>
<h2>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>
@ -186,7 +186,7 @@ typedef struct(bitfield) {
</section>-->
<section class="section">
<h2 onclick="toggleSection(this)">Control Flow</h2>
<h2>Control Flow</h2>
<div class="section-content">
<h3>Loop</h3>
@ -226,7 +226,7 @@ for_each (tmp : array(T)) {
<pre><code>
fn u32 test(u32 x, u32 y) {
u32 test(u32 x, u32 y) {
if (x == y) {
}
@ -265,7 +265,7 @@ fn u32 test(u32 x, u32 y) {
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Dynamic Arrays with Aligned Layout</h2>
<h2>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>
@ -280,14 +280,14 @@ struct ArrayView {
</section>
<section class="section">
<h2 onclick="toggleSection(this)">Dynamic Linking</h2>
<h2>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>
<h2>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>
@ -315,7 +315,7 @@ struct ArrayView {
<h3>Example</h3>
<pre><code>
meta fn print_fields_of(T) {
meta print_fields_of(T) {
for (field : fields(T)) {
print("Field: ", field.name, " of type ", field.type);
}
@ -341,14 +341,14 @@ meta_codegen(name, ast_block) // gated for advanced use
</section>
<section class="section">
<h2 onclick="toggleSection(this)">ABI and Interop</h2>
<h2>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>
<h2>Threading</h2>
<div class="section-content">
<p><em>TODO: Describe standard threading model, scheduler integration, context switching, green threads API.</em></p>
@ -392,9 +392,9 @@ meta_codegen(name, ast_block) // gated for advanced use
<h4>Thread Primitives</h4>
<pre><code>
fn thread_spawn(void fn() entry_fn) -> thread_id;
fn thread_join(thread_id tid);
fn thread_exit();
thread_spawn(void fn() entry_fn) -> thread_id;
thread_join(thread_id tid);
thread_exit();
</code></pre>
<h4>Fiber Primitives</h4>
@ -407,47 +407,39 @@ typedef struct fiber {
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;
fiber_spawn(void fn() entry_fn) -> fiber_id;
fiber_yield();
fiber_resume(fiber_id id);
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);
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>
<h2>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>
<h2>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>
<a href="mailto:dev@sleepeesoftware.fr"><h4>email</h4></a>
</section>
<section>
<a href="https://sleepeesoftware.fr"><h4>website</h4></a>
</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>
<p style="text-align: center;">Copyright @ 2025 <a href="mailto:dev@sleepeesoftware.fr">Sleepee Software</a><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>
</footer>
</div>
</body>
</html>

View File

@ -150,20 +150,9 @@ revoke_token(token_id)</code></pre>
<h2>Philosophy</h2>
<p>This OS is not a POSIX clone. It is a deterministic, capability-secure, user-controlled computing environment built to reject legacy complexity and embrace verifiable simplicity.</p>
</main>
<footer>
<section>
<a href="mailto:dev@sleepeesoftware.fr"><h4>email</h4></a>
</section>
<section>
<a href="https://sleepeesoftware.fr"><h4>website</h4></a>
</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>
<p style="text-align: center;">Copyright @ 2025 <a href="mailto:dev@sleepeesoftware.fr">Sleepee Software</a><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>
</div>
</footer>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleepee Software</title>
<!-- Google Font -->
<link href="../assets/IosevkaSS15-Regular.ttf" rel="stylesheet">
<!-- style --->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/base.css">
<!-- icon -->
<!--<link rel="icon" type="image/png" href="/assets/favicon-96x96.png" sizes="96x96" />-->
<link rel="icon" type="image/svg+xml" href="/assets/favicon.svg" />
<link rel="shortcut icon" href="/assets/favicon.ico" />
<link rel="manifest" href="/assets/site.webmanifest" />
</head>
<body>
<a href="http://localhost:8080/html/SterlingLang.html" class="card-body">
<h2 class="title">COUCOU</h2>
<p class="description">
test 32332323490838329ew0
</p>
</a>
</body>
</html>

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleepee Software</title>
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
<link href="../assets/IosevkaSS15-Regular.ttf" rel="stylesheet">
<!-- style --->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/base.css">
@ -49,15 +49,16 @@
</section>
<section id="project-section" class="hidden">
<h2>Documentations</h2>
<ul>
<div id="card-container">
<h2>Projects</h2>
<div id="docs-list">
<li><a href="html/SterlingLang.html">Sterling Lang</a></li>
<li><a href="html/SterlingOsDesign.html">Sterling OS</a></li>
</ul>
<h2>Projects</h2>
<ul id="repo-list">
</div>
<div id="repo-list">
<p>Loading...</p>
</ul>
</div>
</div>
</section>
<!-- TODO: make login a popop that allow to use irc and blog -->
@ -87,12 +88,9 @@
</section>
</main>
</div>
<footer>
<p>Copyright @ 2025 Sleepee Software<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>
<br>
<a href="mailto:dev@sleepeesoftware.fr"><h4>Contact me</h4></a>
</p>
<footer class="footer-container hidden">
<p style="text-align: center;">Copyright @ 2025 <a href="mailto:dev@sleepeesoftware.fr">Sleepee Software</a><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>
</footer>
<script src="js/index.js"></script>
</body>

View File

@ -5,6 +5,7 @@ document.querySelectorAll('nav ul li a').forEach(link => {
document.querySelectorAll('main section').forEach(sec => sec.classList.add('hidden'));
const section = document.getElementById(target);
if (section) section.classList.remove('hidden');
if (target == 'project-section') load_card();
});
});
@ -15,49 +16,54 @@ document.getElementById('login-form')?.addEventListener('submit', function(e) {
// TODO: call backend API for authentication
});
function load_card() {
const docslist = document.getElementById("docs-list");
docslist.innerHTML = "";
const docsitem = document.createElement("div");
docsitem.innerHTML = `
<a class="card-body" href="html/SterlingLang.html" target="_blank">
<h2 class="card-title">Sterling Lang</h2>
<p class="card-description">Sterling Programming Langage</p>
</a>
<a class="card-body" href="html/SterlingOsDesign.html" target="_blank">
<h2 class="card-title">SterlingOs</h2>
<p class="card-description">Sterling Operating System Design Documents</p>
</a>`;
docslist.appendChild(docsitem);
fetch("/gitea-repos/")
.then(res => res.json())
.then(repos => {
const list = document.getElementById("repo-list");
list.innerHTML = ""; // Clear "Loading..."
repos.forEach(function(repo) {
const item = document.createElement("li");
const item = document.createElement("");
item.innerHTML = `
<strong><a href="${repo.html_url}" target="_blank">${repo.name}</a></strong>
<p>${repo.description || "No description"}</p>`;
<strong><a class="card-body" href="${repo.html_url}" target="_blank">
<h2 class="card-title">${repo.name}</h2>
<p class="card-description">${repo.description || "No description"}</p>
</a>`;
list.appendChild(item);
});
})
.catch(err => console.error("Error fetching repos: ", err));
}
/*
onload
*/
window.addEventListener('DOMContentLoaded', function() {
const loadingScreen = document.getElementById('loading-screen');
if (loadingScreen) {
loadingScreen.addEventListener('click', function() {
loadingScreen.style.display = 'none'; // hides the full screen
});
}
});
document.addEventListener("DOMContentLoaded", function() {
const loadingScreen = document.getElementById('loading-screen');
const loadingText = document.querySelector('.loading-text');
loadingScreen.addEventListener('click', function() {
loadingScreen.style.display = 'none';
document.querySelector('.foreground-container').style.display = 'block';
});
});
document.getElementById("loading-screen").addEventListener("click", function() {
document.getElementById("loading-screen").style.display = "none";
const container = document.querySelector(".foreground-container");
container.classList.remove("hidden");
container.classList.add("fade-in");
const footer = document.querySelector(".footer-container")
footer.classList.remove("hidden");
footer.classList.add("fade-in");
});
});

View File

@ -1,11 +1,3 @@
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 => {
@ -22,11 +14,6 @@ function downloadOfflineVersion() {
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';