[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 4maids-7.png (487 KB, 850x720)
487 KB PNG
What are you maids working on?

Last thread: >>109815594
>>
How do I reverse a constant string in place?
>>
>>109839807
i--
>>
>>109839807
const doesn't stop you
>>
>>109839807
If you need it mutable, why make it constant?

for (int i = 0, j = s.length - 1; i < j; i++, j--) {
swap(s[i], s[j]); // you get the point
}
>>
>>109839892
>>109839807
template <std::size_t N>
consteval auto reverse_string(const char (&input)[N]) {
std::array<char, N> output{};

for (std::size_t i = 0; i < N - 1; ++i) {
output[i] = input[N - 2 - i];
}

output[N - 1] = '\0';
return output;
}


God created C++ to make you people suffer. But it's pretty handy most of the time.
>>
File: bocchi1.png (1.77 MB, 1280x2238)
1.77 MB PNG
>>109839807
reverseAcc(*s,*acc):: 
eq(strlen(*s),"0") *acc
| ne(strlen(*s),"0") reverseAcc(substring(*s,"1",strlen(*s)), charAt(*s,"0") *acc) ;

reverse(*s):: reverseAcc(*s,"");
>>
>>109840110
That's runtime ye fucking HRTroon !
>>
ERLANG is the BEST programming language.
Learn ERLANG.
>>
My ir
alias life, 42

def add, arg1, arg2
+ arg1, arg2
endef

<> main, argc, argv
@ res, test, 1
<> test, a
add a, life
ret a
>>
Off-topic, but I'd like to share this with smart men like you. And I know you're smart, you'd always help me with my questions.

I have a new theory of sexual arousal, purely physiological, material. Here's my take on why women affect us the way they do and how can we have that influence under control:

https://docs.google.com/document/d/1rau6Cd2_Tb90E0UPvTMrZ75wFnSBq7z_751Yca8PxpE/edit?usp=sharing
>>
Should I have my ir target C or Java bytecode first?
>>
>>109839754
trying to learn python from cs50p lol
>>
does this thread have anything to do with the maid computer schizo?
>>
Still working on the little CRUD app for our company. Here's the schema that I'm currently using:
sqlite> .schema
CREATE TABLE vehicles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
plate TEXT NOT NULL,
maker TEXT NOT NULL,
model TEXT NOT NULL,
year TEXT NOT NULL,
assigned_to TEXT DEFAULT '',
location TEXT DEFAULT '',
last_service TEXT DEFAULT ''
, photo_url TEXT DEFAULT '');
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE records (
id INTEGER PRIMARY KEY AUTOINCREMENT,
vehicle_id INTEGER NOT NULL REFERENCES vehicles(id) ON DELETE CASCADE,
date TEXT NOT NULL,
type TEXT NOT NULL,
description TEXT NOT NULL,
cost TEXT DEFAULT ''
);


The idea is to register vehicles and their reparations or services. But sometimes the vehicles get re-assigned to different workers/technicians. So I'm not sure if I should keep a different table of the technicians to consult whenever adding a new car:

// Checks is a vehicle is already assigned to a worker
// This would mean that another vehicle can not be assigned to the same worker
func (a *App) IsAssigned(technician_name string) bool {
// TODO
}


How would you tackle this?
>>
>>109839807
const std = @import("std");

const reversed: []const u8 = comptime blk: {
var buf = "Hello, Zig!".*;
std.mem.reverse(u8, buf[0 .. buf.len - 1]);
break :blk buf[0 .. buf.len - 1];
};

pub fn main() void {
std.debug.print("{s}\n", .{reversed});
}
>>
>>109841374
worker entity
give it a vechicle NULL reference field FK
>>
EXP main
<> main, argc, argv
@ res, fib, 5
+ res, 48
putc res
ret 0
<> fib, n
ge guard, n, 2
skip guard, {
ret n
}
- n, 1
@ res1, fib, n
- n, 1
@ res2, fib, n
+ res1, res2
ret res1
>>
>>109839807
Go lazy and use a reversed string view, simple as.
>>
>>109841017
C is much more portable
>>
Here's a dumb one for ya: in Beef (pretty much C#) how do I access the data of a LinkedListNode instead of the Node itself? When I do
    public LinkedList <int> numbers = new LinkedList<int>();
numbers.AddLast(4);
numbers.AddLast(8);
numbers.AddLast(12);
if (numbers.First == 4){ DoStuff() }

I get "Unable to implicitly cast 'int' to 'System.Collections.LinkedListNode<int>'"
t. retard
>>
>>109843010
Isn't portability Java's main feature? I think you might be stupid.
>>
>>109843261
numbers.First.Value?
>>
>>109843261
Got it:
    if (numbers.First.Value == 4){ DoStuff() }

It's the .Value thing.
t. Same retard.
>>
Hi /g, Anyone here knows a torrent/site that I can found Pragmatic AI Labs courses?
>>
>>109841839 (Me)
I just tested it and this Fibonacci is working compiled to Assembly. I just need to add some C interop stuff and I should be done with the ARM Assembly target.
>>
The only safe options for raii are assign by copy and borrow checker aren't they?
>>
>>109839807
If you can change it in place, it is not constant.
>>
I hereby propose a new suggestion for every language in existance: The "," operator.
Definition: The exact same as the "." operator except it allows you to put the function before its object.

The advantage of this:
Lifetime.ClearPersistent(ID); //yoda speech
ClearPersistent,Lifetime(ID); //propa english
>>
>>109843558
No.
>>
>>109843558
>another feature I'll never use
>>
>>109843674
>>109843679
t. retards.
>>
>>109843712
. is in order of encapsulation, which makes sense. Reversing it doesn't.
>>
>>109843737
my proposal would also ban orders of encapsulation greater than 1.
>>
>>109843757
Still doesn't make it any more sensible.
>>
Is Haskell meant to make getting things done hard?
>>
>>109843831
It was invented as a joke, you aren't supposed to actually use it.
>>
>>109843842
I mean it's great as far as FP goes. It still sucks because FP.
>>
I am working on what ever the hell this is called.
It's like a state driven interpreter or something.
>>
Bend released, Haskell is deprecated.
>>
>>109843288
Java has bytecode portability wherever a runtime already exists. You just run it.
C has code portability wherever a compiler already exists. You just compile it.
There are C compilers for many more targets than Java runtimes.
Therefore, C is more portable.
>>
>>109844226
The strongest argument against C portability is the existence of cmake.
>>
>>109844316
I don't use it. You can just not use it.
>>
>>109844316
build tools were a mistake
incremental builds were a mistake
>>
rust is an ai psyop. since rust is unreadable and unwritable by humans we will have to use ai if 100% of the code is written in rust. that is why rust is being pushed so heavily
>>
>>109844990
*and un maintainble by humans
>>
>>109843938
so you just leak a string every time you set the state?
turn on address sanitizer + ubsan and -Wall -Wextra -Wpedantic
>>109844316
nah C programmers are the most autistic about code purity. cmake is for C++ devs that have embraced complexity.
And then there are C programmers who use cmake, which to me just sounds like either a library developer or a former C++ programmer who switched to C but still needs their IDE to work.
>>
>>109844990
Stop projecting your inability onto others.
>>
>>109845009
No.
>>
>>109845047
im not doing that its true.
>>
File: podo.png (39 KB, 425x366)
39 KB PNG
>>109841374
>Still working on the little CRUD app for our company.
>How would you tackle this?
https://www.jotform.com/form/262601847313050
>>
>>109841374
>>109841679
ya just create a workers/technicians table and throw a foreign key onto the service records or the vehicle or both. you could also just do like just a basic ass text field on the record so when you fetch the latest service if its empty you assign the worker or some logic like the same technician that did the previous service on the car gets the car service again type deal
>>
>>109839807
#include <stdio.h>
#define STR "hello"
#define REVERSE(s) ((char[]){ (s)[4], (s)[3], (s)[2], (s)[1], (s)[0], '\0' })

int main(void) {
printf("%s\n", REVERSE(STR));
}

O(1)
>>
>>109845122
there is still one more leak but you fixed the leak that matters.
also you turned a harmless leak into an infinite loop during an OOM. are you actually just trolling rn?
JK it took me at least 4 years for me to notice these things immediately.
Also during OOM the only sane option is to just assert because at least you know where it failed (you can easily make your own asserting malloc wrapper that includes the __LINE__ and __FILE__ to diagnose OOM without needing assert, but you are essentially creating your own assert).
Also why are you building your code without debug info or optimizations? A truly pointless build. asserts would be disabled.
You are on linux, but on windows, msvc has "sane defaults" which are good enough for most people except I think asan is a hard requirement.
I stumbled upon learning that zig has a built-in C compiler (using clang but turned into 100mb), and it tries to set some sane defaults like ubsan + warnings, and it does some caching to speed up builds (I hate this, but technically this lets you skip using makefiles I think?). Never used it though. Unfortunately it seems to use the trapping variant of ubsan (and you need the ubsan runtime, which is not included probably to save space, while clang is like 10x larger), so without a debugger, you will just see sigill-crash which is not too helpful, when usually it would show a helpful stderr message (distros can store the coredump if you know how to find and open it).
>>
>>109845500
>you turned a harmless leak into an infinite loop during an OOM
*also during EOF which is ctrl+Z on windows, Ctrl + D on linux.
>>
>>109845515
>turned a harmless leak
**Oh the error was always there, I thought it was added in. MY bad.
>>
>maidnigger yet again usurps another thread with his schizoid delusion
the maidnigger continuously just waits the moment until the thread is at post 309 to rush and IMMEDIATELY make a new thread, and link his next maidnigger thread to reach bump limit (creating threads BEFORE the old one even reached bump limit)
you can check yourself how many recent threads are just spammed with off topic near the end, only to rush to the bump limit
this is extremely uncourteous and dishonest behavior, not just towards other posters in the thread but the whole board
there is no need to immediately create another thread other than to hijack the OP

spam posts should be reported
avatarfagging is also not allowed
>>
I finally know the real term of what I'm making. I'm making a DSL for gas. DSL's are fun
>>
TIL: holyC has a logical XOR
not sure if based.

I64 a, b;
a=0x1;
b=0x2;

for(a=0;a<4;++a) {
for(b=0;b<4;++b) {
"\ta: %d, b: %d\n", a, b;

if(a^b) {
"$FG,2$Hello, XOR\n$FG$";
}

if(a^^b) {
"\t\t$FG,5$Hello, XOR_XOR\n$FG$";
}
}
}
>>
>>109846172
In C this is just a != b
>>
>>109846237
oh, right... Well anyways, lets touch grass and then make something epic
>>
>>109846237
well, for 0 or 1, not sure about non bool values
>>
I have no idea how to design globals / locals for my programming language
why does Lua have separate dynamic _ENV lookups for globals instead of making sure the entire codebase is compiled into a single logical unit?
>>
Does anyone know how I generate the whole templeOS website from inside templeOS with all the source included and the linerep and so on?
Like this: https://tinkeros.github.io/WbTempleOS/
And that: https://tinkeros.github.io/WbTempleOS/Home/Web/LineRep.html#l548

I couldn't find a script to do it in any of the projects and there is just the ToHtml example in the Demo directory that just shows how to convert one DolDoc file.
>>
File: fractions on MAIDS OS.png (123 KB, 1920x1080)
123 KB PNG
>>109839754
I got compiled fractions working in MAIDS OS! Fractions automatically reduce, and all operators produce reduced fractions.
>>
>>109846408
How is the cycle time comparison to floating point?
>>
>>109846408
i dont see any tests for when the numerator is bigger then the denominator
>>
>>109846441
Wouldn't floating point be faster cuz it has the actual gate or whatever in the arithmetic thing nowadays?
>>
File: fractions on MAIDS OS2.png (169 KB, 1920x1080)
169 KB PNG
>>109846441
MAIDS doesn't have floating point numbers, because I don't like them. It only has integers in the core language. Fractions were made by writing a little fractions library in MAIDS, rather than anything being built into the core language. I could probably do the same thing for floating point numbers, but it would be slow and also I don't like them and don't want to use them for anything. My fractions library is orders of magnitude slower than doing floating point arithmetic with FPU hardware instructions.

>>109846510
That works too. You can see it in the attached screenshot. It also returns an integer when the result is an integer, instead of printing a fraction with a 1 for denominator. This is also in the screenshot. The fraction operations can also use integers, because they know an integer has the integer as the numerator and 1 as the denominator.
>>
File: sakuya shrug.jpg (228 KB, 850x1247)
228 KB JPG
>>109845697
The last bump happens at 309, newmaid. 310 doesn't bump. There is no reason to persist in a doomed thread full of a schizo ranting about the CIA for 50 posts, followed by a low-effort troll baiting a low-IQ poster into having a fight over if AI usage is good or not for another 50 posts. All that's left at that point is to make a new thread, and hope the disruptive posters stay in the old abandoned thread that nobody is looking at but them.
>>
>>109846851
>"newmaid"
>still tries to impose xirs culture onto the board
and then you wonder why people use your threads as designated shitting streets
>>
>>109846768
nice!
>>
File: 1731628774064820.gif (1.88 MB, 540x960)
1.88 MB GIF
>>109845047
He's right, rust is actually trash.
>>
>>109846881
It is us maids that truly understand the intricacies of 4chan thus us maids being the designated maintainers of the threads once a thread reaches bump limit. An uncivilised airhead like you is incapable of taking up such a responsibility. *pouts*
>>
>>109848192
when this thread dies wait and see since youre so sure about yourself
>>
what do we think of dijkstra's GCL?

just curious. it's one of those languages that no one talks yet it's so influential

and dijkstra was mogging corporate fags back in the 70s before twas cool
>>
File: into-the-trash.jpg (36 KB, 666x500)
36 KB JPG
>>109848327
>formal programming language
>>
>>109844033
big if truke
>no type classes
its over
>>
>>109848364
>>
File: ellen joe.jpg (141 KB, 1103x1103)
141 KB JPG
>>109848364
Computer Science is a branch of Mathematics. You should use formalisms. You're not a mathlet, are you anony-chan?
>>
>>109848364
yep it doesnt compile to your x86, anon.

yep, programming languages are formal mathematical notations at their core, anon. except that devs are so retarded they can't do any formal shit
>>
>>109848517
using current formal systems is like trying to fit a square peg into a round hole
found the mathlet

>>109848564
a formal computer language != computer languages being formal at their core
a formal computer language is a coputer language built with the idea of formal proof in mind, from the ground up

oooor so i was told
>>
maidniggers are a parasite, a cancer. they have absolutely no courtesy or synergy with the thread, board or website
they are squatters - they unlawfully claim ownership and refuse to leave when told so
maidniggery is completely unsolicited and shoved down everyone's throat more aggressively than ads on social media sites
even real women are not this aggressive with demanding attention
>>
>>109848679
ever heard of curry howard correspondence, mathlet? propositions are types, proofs are programs.

actually every programming language is just lambda calculus, the silicon is just a dumb implementation detail that rapes the cool math
>>
>>109848746
>even real women are not this aggressive with demanding attention
thats a good point
this wave of maidshittery started with maidniggers trying to get attention, not receiving it, then getting all pissy, trying to take over the thread by grossing everyone out

turns out sterile math tryhardism isnt as popular as they thought
>>
>>109848749
>every programming language is just lambda calculus
untrue, e.g. pi calculus
>>
File: dr-manhattan-3.jpg (17 KB, 300x149)
17 KB JPG
>>109848749
>and thats how you end up with lisp, or with c that contains more annotations than code, proper
my exact point, tryhard
if you werent a complete poser you would work on/with novel solutions instead of religiously regurgitating whats already known to be lame and insufficient
>>
>>109846881
Newfaggot meltie kek
>>
>>109848773
>Anonymous 09/18/26(Fri)13:51:17 No.109848773â–¶
> >>109848749 (You)
> >every programming language is just lambda calculus
> untrue, e.g. pi calculus
curry howard still applies to pi calculus

cf. linear logic and session types
>>
>>109848819
>lambda gets btfod by side effects
and thats where your models bite the dust
thankyouverymuch come visit again, tell your friends to come too
>calls others mathlets
lemao
>>
>>109848364
>deterministic programming language
>>
File: kernighan.jpg (86 KB, 850x400)
86 KB JPG
>>109848849
>>
>>109848835
gcl is an imperative language bud

youre arguing with haskell tourists. stop embarrassing yourself, mathlet. cope
>>
>>109848856
>desperately attempts to avoid the fact that all his religion is born from the desperate need to protect a model that is empirically mentally hemiplegic
wow. much sicence. how math
>>
>>109848819
yes but its not lambda calculus
>>
>>109848853
based duck Dijkstra
>>
>>109848891
edgar "gotos confuse me" dijkstra
keklmao
>>
>>109848875
he doesn't know about the linear lambda calculus kek

the canonical proof term assignment for linear logic is the linear lambda calculus.

everything always reduces back to church
>>
>>109848974
>no side effects
>no states
cope.
your formalism is cargo cult from an era when people were merely theorizing about computers
>>
>>109848980
you should really learn how compilers work kek

just because you aren't smart enough to understand the math, doesn't mean it isnt the reason your compiler has ssa form
>>
Why are there so many women in math but so few in software?
>>
>>109849014
>nuh learn my mental retardation so that youre gonna see the world like i do
how about: no

im not gonna invest any time in your mental illness when the first basic principles break spectacularly upon the slightest inquiry
>>
>>109849031
all the useless tranies went into type theory
theres no xx women in either
>>
hurrrrrrrrrrrr
durrrrrrrrrrrrrrrrrr
huurrrrrrrrr
duuuurrrrrrrrr
>>
>>109848974
the pi calculus is literally not the lambda calculus
why are you so retarded?
>>
>>109849042
cope harder kek
>>
>>109849064
>cope harder
about what?
>>
What's the best syntax for indexing an array other than array[index]?
>>
>>109849128
array with index subscript
>>
MaidOS should be written in erlang+lisp
>>
>>109849149
Is anything even written in Erlang?
>>
>>109849162
Not yet
>>
>>109849171
the absolute state of fpfags
>>
File: glasses.jpg (44 KB, 620x675)
44 KB JPG
>>109846237
Wrong, it is (!a^!b).
>>
>>109849171
Go to the bathroom.
>>
>>109849277
Only if you come with me
>>
If you aren't a maid why bother coming to a maid thread? Just gtfo. Simple as. So many simpletons that don't have any common sense. >.< *face palm*
>>
>>109849770
I want to learn how to be a maid, shut the hell up oldmaid... Imagine being this newfriendphobic
>>
How's this?
array->index
>>
File: black survival maid.jpg (229 KB, 850x1259)
229 KB JPG
>>109849966
*curtsies* Maybe make the arrow go the other way? *does heart hands* <3
array<-index
>>
>>109850133
I use that direction for assignment. Maybe I'll make it universal Idk.
array<-index = value
>>
>>109850475
array=index <- value
>>
>>109850483
To me that looks like replacing the whole array. I could just go full Haskell.
array<-{
index = value
}
>>
Just go with array.index = value you losers.
>>
File: blue archive maid.jpg (282 KB, 850x1133)
282 KB JPG
>>109850475
>>109850496
Maybe more arrows that get chained together?
array<-index<-value

Or, maybe make it more moe?
array <3 index <3 value 
>>
index[array = value]
>>
revise array, index, slotsize, value
retrieve array, index, slotsize
>>
>>109850561
array[index = value]
>>
>>109850627
value += [index]array
>>
>>109850547
array->index<-value
>>
put index value in array
>>
  /----\
v |
array index
|
value -/
>>
>>109849128
>What's the best syntax for indexing an array other than array[index]?
In my lisp it will be:
(Get index array)
(Set (Get index array) newValue)

I might even have just:
(index array)
>>
>>109851134
Why would anyone use LISP on purpose?
>>
>>109851093
https://scrambledeggsontoast.github.io/2014/09/28/needle-announce/
tragically no longer works
>>
>>109851176
i get paid to use it
>>
File: summer.png (1000 KB, 1280x720)
1000 KB PNG
>>109851379
>i get paid to use it
how the fuck did you manage that?? you're living the dream.
>>
>>109839754
sexo with meido
>>
I don't program a thing until i have a water bottle full of almond milk in front of me.
Then I do everything with 8 bit pointers
>>
I had the fun time of finding that the PS3 samples for NoRSX don't run on my PS3, so my template I had made for AoC also doesn't work.
And then most other ps3library samples also wouldn't run.
But eventually I found that the Tiny3D library samples work, so I guess I will be rebasing on that.
>>
>everything is an expression
>lets that introduce a new scope
>special forms instead of syntax
after careful consideration I've decided that I hate Lisp, compiling this shit is a pain
>>
File: 1788833118343737.jpg (76 KB, 736x929)
76 KB JPG
anyone ever played with syzkaller before? i'm setting mine up, and it's pretty fun honestly
i already found like 10 different warnings
>>
File: 1770582064489104.jpg (29 KB, 720x400)
29 KB JPG
>Project is not compiling
>VSCode can't find Ninja
>Check the installation, I have Ninja installed
>Realize I installed VSCode via Flatpak and that's why it's not seeing it
>>
>>109853150
lol
>>
array<-index
array<-(index value)

myfunc(\a, b = a + b)
myfunc(1, 2)

table {
x = 0
y = 0
0 = 1
42 = 0
}
>>
>>109845122
this is damn near some of the most disgusting code i have ever seen
>>
>>109853150
git clone https://github.com/neovim/neovim.git
cd neovim
git checkout v0.12.5
mkdir -p $HOME/neovim
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install
export PATH=$PATH:"$HOME/neovim/bin"
nvim
>>
>>109853150
switch to Emacs
>>
How do I make something in Haskell more useful than solving some Project Euler problem?
>>
>>109853312
write a slow port scanner that can pause / resume its entire state
>>
>>109853315
Why make it slow?
>>
>>109839754
I'm already getting filtered by stack and heap. All this time I was told that stack was fast storage and heap was slow but it looks like I was taught the wrong thing.
The heap isn't slow, in fact it's literally the same memory as stack stored in RAM.
What other lies have techbros told me?
>>
>>109849171
The most used message broker in the world is written in erlang.
>>
>>109853600
I am noob, but isn't it that it doesn't matter only if that heap memory is in cache? If the data isn't on the cache and it's on the stack it's only an offset of the stack pointer but if heap is not cached it has to go find it?
>>
So are u misunderstanding or am I?
>>
>>109853600
not really
what happens is that elements of the heap get cached in the... cache
on top of having stuff explicitly on the cache too

its complicated
just do C
and once youll get some experience youll either move to another lang
or youll learn the intricacies of that because you will be working with it
>>
>>109853600
>>109853645
brothers, you should listen to your professor when she talks. What the fuck is wrong with you?
First of we don't know where heap or stack are stored and it doesn't matter.
Stack is literally just a stack structure. One pointer. Push increments, pop decrements.
heap usually requires a lot more lookup, possibly some address calculation and so on.
The physical memory absolutely doesn't matter in this case
>>
>>109853686
>she
fuck off with your lgbtshit
also: wtf are you even saying
>>
>>109853686
wouldnt the stack be stored under where the return address be %rbp. or does that not matter. i thought the predictability to where it is is why people say stack is faster. since the stack is a relative offset to the return address. idk im self taught
>>
>>109853710
im visualizing the prolog of assembly of is that just abstract bs
>>
>>109853686
It does matter where it's stored, there's register that define where the stack is pointed towards so a stack ptr bump is easy for allocation.
But heap doesn't have that, unless you have the memory location in cache it's not going to be as fast.
>>
>>109853707
i fucking LOVE how people get triggered by that. Thanks!
>>109853710
Yes, predictable is the keyword here. You know where the stack is at any time. It doesn't matter where it is physically located tho.
See you have this link script for example:
MEMORY
{
RAM (rwx) : ORIGIN = 0x80010000, LENGTH = 64K
LED (rwx) : ORIGIN = 0xf0000000, LENGTH = 4K
/* VGA (rwx) : ORIGIN = 0x90900000, LENGTH = 16K
UART (rw) : ORIGIN = 0x10010000, LENGTH = 4K */
}

ENTRY(_start);
SECTIONS {
. = ORIGIN(RAM);

.text : ALIGN(4) {
KEEP(*(.text.boot))
*(.init)
*(.text .text.*)
} > RAM

.rodata : ALIGN(4) {
*(.rodata .rodata.*)
} > RAM

.data : ALIGN(4) {
*(.data .data.*)
} > RAM

.bss : ALIGN(4) {
__bss = .;
PROVIDE(__bss_start = .);
*(.bss .bss.* .sbss .sbss.*)
__bss_end = .;
} > RAM

. = ALIGN(4);
__stack_top = ORIGIN(RAM) + LENGTH(RAM) - 4;
}

__stack_top is at the end of the memory. Then in assembly you just get that symbol/address and store it in your stack pointer (risc-v here):
.section .init
.globl _start
_start:
la sp, __stack_top

Then on a function call this happens:
    call help_cmd // this is just a jump and link pseudo-instruction - store current PC into ra and jump to location
[...]
help_cmd:
addi sp, sp, -16 // get some space on the stack
sw ra, 0(sp) // store return address
sw s0, 4(sp) // save other callee-saved registers that you want to use
sw s1, 8(sp)

[...] more code here [...]

lw s1, 8(sp)
lw s0, 4(sp)
lw ra, 0(sp)
addi sp, sp, 16 // restore everything and return
ret


SIMPLE AS THAT
>>
>>109853728
PS: cisc does exactly the same, it just hides a lot from you
>>
>>109853498
to take it easy
>>
>>109853686
>she
based

>>109853707
it doesn't matter whether the data is on the heap or the stack
what matters is getting your data into the CPU cache
jumping around memory addresses that isn't in the cache is slow
sequential access to the stack or heap is fast
the stack is small and hot (REALLY frequently accessed) so it will almost always be in the cache
>>
>>109853728
>triggered
go back, trany

sequential access to the ... heap is fast
it depends.
yes, i know what im talking about

things are complicated...
>>
wouldnt heap be fast only if you are ONLY using heap (big buffer w.e?). is that what u mean by sequential access?
>>
in any case youre better off trying to fit your stuff on the stack
and benchmark your shit regardless
>>
>>109853793
>go back, trany
i am very far away from lgbtq cucks, but I just love how you nerds get triggered by such simple things. It's amusing
>things are complicated...
duh. But if some brainlet with a tiktok attention span asks about the difference between heap and stack and then you come round the corner that there are a gazillion edge cases that have to be considered instead of just explaining what the things are and why stack is usually considered faster, then you are just a brainlet retard yourself and didn't fucking understand the point
>>
>>109853808
that style where u pre allocate a block so its pretty much a stack so the memory is predictable
>>
>>109853808
i think he misspoke
because even in seq access youre bound to ram speed

you cannot materialize data or code into your cpu
it has to come from somewhere
>>
>>109853808
I think that's what the hipsters call areas nowadays, yes.
The slow parts are allocation and reallocations when your stuff grows
>>
File: Joker_war_wojak.png (262 KB, 600x701)
262 KB PNG
>>109853815
>because even in seq access youre bound to ram speed
retard.
You could have your stack on a fucking tape drive. Then your heap would be one trillion gazillion times faster. What is your fucking point?
>>
>>109853811
>and then you come round the corner that there are a gazillion edge cases
yeah and thats what i said
>do c
>then if you stick to it, you will be confronted with all the details volens nolens
>>
>>109853819
that sounded mentally retarded
but in an original way
>>
File: haha.jpg (132 KB, 2000x2029)
132 KB JPG
>this genius MIT guy doesnt know what identity map implies
FUCKING RETARD NIGNOG
https://archive.org/download/TerryADavis_TempleOS_Archive/videos/2014/2014-09-01T00%3A05%3A00%2B00%3A00%20-%20TempleOS%20-%20Memory%20Identity%20Mapped%2C%202%20Gig%20Code%20Heap%20%280Oyl7Z6Vx34%29.mp4
>>
>the wonderswan has a knockoff 8086 CPU in it
I have to make code for this.
>>
>>109853600
stack is usually faster in practice because it is much more likely to be in L1 cache

>What other lies have techbros told me?
that manual memory management is difficult and needs a million smart pointers and reference counters and other stupid shit when you can trivialize things by using arenas
>>
File: 20260919_171106476.jpg (702 KB, 1600x1176)
702 KB JPG
Ha ha, things are looking up, Anons.
Now to start working on the SPE assembly. Gonna have this small C program running on the PPE that just hands input and display while the SPEs do the solutions.
>>
>>109853312
what do you want to make
>>
File: reimu.jpg (296 KB, 850x1200)
296 KB JPG
>>109846768
I made a script that lets me load code I wrote in the MAIDS interpreter, into the disk image, so I can test it on the MAIDS compiler on MAIDS OS. This has helped tremendously in finding subtle bugs. I got Boolean Logic working, and am now working on getting Combinatory Logic working, and then I will do Lambda Calculus. After this, I will probably try to make the compiler faster (compiled MAIDS is currently slower than interpreted MAIDS in an interpreter made in core Java), and maybe make it into a supercompiler.

I am also debating removing a sugar syntax from my language, because it doesn't feel useful.
foo:: ?{guard, success_branch, fail_branch};


Is equivalent to:
foo:: 
guard success_branch
| !guard fail_branch;


And I feel like the second is as readable or more readable than the first, and eliminating the first would make the language have less things in it.

The only time the first is any good is if I need to nest things:
foo::
?{
guard1,
success_branch1,
?{
guard2,
success_branch2,
fail_branch1
}
};


Where the equivalent guarded alternations are this:
foo::
guard1 success_branch1
| !guard1 guard2 success_branch2
| !guard1 !guard2 fail_branch1;


I think the guarded alternations still look better.

My brain got crunched by thinking about conditionals before I fully embraced goal-direction and backtracking. I think I am going to remove that sugar syntax. It is less readable, and requires counting delimiters, paying attention to commas, walking a binary tree in your head to determine what code goes where, and remembering how conditions effectively composed together as you walk the tree. All to mimic conditional syntax which is both worse to read and worse to write than guarded alternations.

What do you maids think?
>>
>>109854782
you are mentally ill
but the amount of effort you put into your shit can only command respect

ill still call you a fucking retard but from now on its an endearing term
>>
the rest of you posers can stfu btw
theres one maid ITT
the rest of you are posers until you show at least *some skills
>>
>>109853600
(De)allocating up stack-allocated memory is fast compared to normal malloc stuffs. Also when people say heap is slower, they probably meant in the context of GC.
>>
any cute maid wanna be my gf
>>
File: snailcat-laughing.png (1.52 MB, 1254x1254)
1.52 MB PNG
>>109855673
>when people say heap is slower, they probably meant in the context of GC.
>>
>>109855683
hmm maybe
it's tempting
>>
>>109855683
>>109855692
>advanced maid computer research
>>
>>109855692
please
>>
>>109855736
what projects do you do? what languages do you use? what paradigms do you enjoy?
>>
Should an ir have native structs?
>>
>>109855769
just syntactic sugar around arrays. i don't see why not
>>
>>109855745
>what projects do you do?
made a cli calcuator
>what languages do you use?
c
what paradigms do you enjoy?
imperative
>>
>>109855835
if you like C, then i like you
u can post contact if u want i guess
>>
INFO  vkx::context::tests > [ Loader Message ]    VK_LAYER_OBS_HOOK
INFO vkx::context::tests > [ Loader Message ] Type: Implicit
INFO vkx::context::tests > [ Loader Message ] Enabled By: Implicit Layer
INFO vkx::context::tests > [ Loader Message ] Disable Env Var: DISABLE_VULKAN_OBS_CAPTURE
INFO vkx::context::tests > [ Loader Message ] Manifest: C:\ProgramData\obs-studio-hook\obs-vulkan64.json
INFO vkx::context::tests > [ Loader Message ] Library: C:\ProgramData\obs-studio-hook\graphics-hook64.dll
// Later...
ERROR vkx::context::tests > [ VUID-vkGetDeviceQueue-flags-01841 ] vkGetDeviceQueue(): queueFamilyIndex (0) was created with a non-zero VkDeviceQueueCreateFlags in vkCreateDevice::pCreateInfo->pQueueCreateInfos[0]. Need to use vkGetDeviceQueue2 instead.


Not being able to query instantiated device queue properties seems like a gap in Vulkan's API. How is a layer supposed to know I created a queue with non-zero creation flags? I guess it could hook vkCreateDevice and read out the queue infos but that seems excessive.
>>
Literally no one likes C except for jeets who start with it in college.
>>
File: blog.jpg (279 KB, 4000x2250)
279 KB JPG
>wanted to build a custom supplemental disk for my own templeOS setup and dev environment
>spent the whole fucking day finding the right ISO file, writing docs for myself and I don't know what
Doesn't feel that good to not have done any REAL progress, but at least I have a better overall system now.
Now my brain is empty, I'd wish to continue, but the drugs are slowly fading and I should watch some movies or something.
Ok afk.
Maybe I can hustle more later
>>
>>109855913
C is cute tho
>>
>>109855886
u first
>>
>>109855938
C is ugly hackable language.
>>
File: c for baby.png (70 KB, 724x464)
70 KB PNG
>>109855938
it is i love C it's so nice and fun and easy to read
>>109855943
ur the one who wanted a maid gf
>>
File: tsukasa.jpg (360 KB, 850x1287)
360 KB JPG
>>109855960
>C for baby
Please make C for maids. Then writing C can become very moe *does heart hands*
>>
>>109855999
i already have that
unfortunately it is proprietary and so i cannot share with the class
>>
>>109855904
>I guess it could hook vkCreateDevice and read out the queue infos but that seems excessive.
it probably does this because i think how else could validation layers work? everything needs to be retrievable? (thus stored and tracked)
>>
>>109855960
noko@cumallover.me
>>
>>109856032
Layers can hook anything but for something like an OBS plugin that's probably just interested in tracking present calls making them hook device creation to get information about a queue seems roundabout and cumbersome. Why not a vkGetDeviceQueueInfo that tells you about the queues a device was created with?
>>
>>109856125
>why not a getXInfo for X
because you can make this argument for the entire API
>>
>>109855958
That's the cute part about it
>>109855960
>heh look at all the weird things i can do because the language definition is not perfect
Ok, fuck you? Doesn't fucking matter. Just write it as the lord intended and then it's cute
>>
>>109856226
i wasn't being sarcastic lol i literally love C because it is nice and easy to read
i just thought the image was cute i wasn't trying to be snarky
>>
File: golang-nerd-banner.png (118 KB, 2000x1000)
118 KB PNG
>>109856262
That's why I love Go, too, btw. It has the same beauty.
Sadly the js fags complained so much about the verbosity such that they now slowly try to add all the fuck features.
I hope the latest generic additions won't transform the language into the functional cringe that rust and js do with one trillion function calls in one statement.
>>
>>109856104
sent, but these domains get their mail dropped a lot. ideally let me know if you receive it
>>
C is a demon.
>>
File: ski combinators on MAIDS.png (133 KB, 1920x1080)
133 KB PNG
>>109854782
I got SKI calculus working on MAIDS OS! I haven't removed the syntactic sugaring. I will remove it later. For now I will just stop using it and when I run into code where I already used it I will rewrite it as a guarded alternation.
>>
https://cosmos-language-lab-0819.asd-user56.chatgpt.site/
Use the Cosmos Vibe language...
>>
>>109858031
>transpiled to prolog
sounds like another worthless memelang
>>
>>109856299
i hope it's a succubus
>>
>>109858766
can't spell succubus without C
>>
>>109858817
Sukubus.
>>
>>109859062
fuccubus
>>
>>109859148
Functionbus?
>>
File: Piet_hello.png (354 B, 30x29)
354 B PNG
Building a Piet interpreter.
>>
>>109859531
It works!
>>
>>109856295
nta but ya its sad generics got adopted. in general its such a readable language. generics are a pile of trash and with more and more people using ai codes I'm sure everything will turn into an unreadable rust level mess within a few years.
>>
File: maidcard.png (163 KB, 1320x1208)
163 KB PNG
>>109859531
>>109859632
ohh thats cool I've never heard of piet, but that looks pretty fun! nice job.
>>
I keep coming across bizarre AI psychosis driven mega projects https://github.com/ext-sakamoro/ALICE-Eco-System
>>
>>109859902
https://www.dangermouse.net/esoteric/piet.html

Don't congratulate me just yet. My handling of white blocks isn't quite right yet.

The real challenge will be to write a higher level language that compiles to a png.
>>
>>109859930
>rust
every time
why has rust become the poster child for vibe shitters
>>
I have no idea how to do lambdas in my language

>>109859936
clankers know it and it's hard to fuck up
>>
This.... "thing" can now read script files.
>>
Guys I hate how slow and FUCKING clunky Emacs is, but at the same time somehow it feels way more "complete" or "powerful" might be a better word, than every fucking thing else out there.
What do I do.
>>
>>109860196
Use Nano.
>>
>>109860196
What can you do in emacs that you can't in another editor?

I've tried to get into emacs for years, but I just don't give a shit about customizing my text editor.
>>
File: file.png (185 KB, 2559x1439)
185 KB PNG
>>109860207
Splitting windows is kinda effortless.
The file navigation is also kinda efortless, being able to jump around files anywhere in the system.
I also love doing SPC C C to open compile mode, which let's me just do stuff like, for example, go run . as shown in pic related.
Also, and you might have heard this multiple times before: Org-Mode.
>>
>>109860240
>splitting windows is kinda effortless
In a regular OS gui, moving windows around is trivial. No set of keyboard commands will ever be as intuitive and easy as moving windows around with the mouse. Even in vim, :tabnew works fine for me.

>file navigation is effortless
So just like every other editor and OS.

>I also love doing SPC C C to open compile mode
It's fine, but having a terminal open with the compile command ready isn't a hardship to me. Or using vim's :term.

>org-mode
I have no idea what I would ever use this for.
>>
>>109860273
>No set of keyboard commands will ever be as intuitive and easy as moving windows around with the mouse.
Keyboard commands are for serious users who want to be efficient. The mouse is for casuals.
>>
>>109853204
>0 = 1
>42 = 0
What da fuck?
>>
>>109849128
haskell uses
vector ! index
list !! index

I guess you could also use something like
array.0

depending on how your language will work
>>
>>109860302
lol
>>
>>109860273
You don't understand. Traditional mouse workflows are incredibly shit once you get used to something like Vim. Well, I started using Vim around 12 years ago and then moved on to NeoVim then tried Emacs with Evil Mode. There really is no easy going back.
And I did try going back. Tried using the superb Sublime Text for a couple of weeks, even vscode. And nah, just can't.
>>
i can almost program with my language i can smell it. any day now...
>>
>>109854782
i agree. ive thought about it and the term i came up with is symbolic fatigue.
>>
>reworking my coroutines in C
>currently relying on global state to store rsp of the main thread and rsp of the current coroutine
>trying to find a way to not do that
>coroutine_yield() fires in the middle of the function so I have no way of tracking the stack to get my variables from before the function call
>could pass the coroutine_state into the function call itself and then the coroutine would have to pass it on to yeild() but that's ugly and annoying
what the fuck am I supposed to do here? the only way to not make these a hack would be to literally fork/patch a compiler to support coroutines in a way that llvm can reason about them
>>
>>109861310
everything u said flew over my head i have no clue what you are talking about. but my divine revelation is telling me when you enter a coroutine(i dont know what a coroutine is) create a copy of the data that it will be mutating. when it yields return everything mutated and update. i dont know i hope you figure it out :3
>>
File: iloveanime.jpg (457 KB, 4000x4000)
457 KB JPG
>coding in templeOS right now
C O M F Y
Soon (TM) my personal website and blog will be ready
>>
>>109861403
It's a function that has its own stack but runs in the same thread, so you can pause the function in the middle and resume its state later.

>create a copy of the data that it will be mutating
I can't do that unless I explicitly pass it as an argument because everything I'm doing is in a stack frame directly outside of the coroutine function. I can only get access to it when the function returns because I have no idea how the calling function is mutating the stack so I have no bearing of where I am
>>
>>109861450
i still dont know what you are saying but i received a revelation. i only heard the word memory arena. i dont know what this means.
>>
>>109860881
Just use notepadplusplus or geddit lol
>>
My God is telling me that you got this and you will figure it out and for you to ask him personally. ^.^
>>
>>109861559
God says...
surv uncalk MLT Burgin aseismic sloughier headlongly six-shooter gied Falcone backstabbing prelunch retired diakonikon malaxed pre-edition Alver Ischepolis scalpel lamedh predictability goosetongue disporous Eras Akiak overfalling oilstock Halette bradycrotic semivisibility pinnulate paddywatch

tfw gotta do 6 headshots. What the fuck, god?
>>
>>109839754
Why are linkers so fucking slow?
How do we make them faster.
>>
>>109839754
>>
>>109862112
thats me on the left
>>
How can I have simple closures in my language?
Locals are currently per-function call slots (like in CIL/C#, no idea what Java does)
I need a way of accessing variables higher up in the stack but it seems complicated as hell, especially if they go out of scope
>>
File: 1784522809924380.png (204 KB, 1843x892)
204 KB PNG
is this how I would write a plugin system in python?

Trying to implment one but its kinda hard to find a balance.

Currently I've basically got a central registry for all registered implementation classes, then in my service layer I just call the result = registry.select_stratagy(MuhKey).concret_method(some_data_context)

all my abstract interfaces have all been single methods, with a supports method returning bool

What I hate it how I have to keep track of all these "contributions" the plugin has, and by doing that I use individual registries for each type of contribution and whenever one is removed or added the event handlers sync it to wherever it needs
>>
>>109862235
this is not the python I grew up with
>>
>>109862179
Lua has add_upvalue instructions iirc
>>
>>109862235
Python has generics now?
>>
>>109862386
yup
>>
>>109861310
babe, your siglongjmp?
>>
spring is coming and im feeling more cute by the day! spring is truly the season of maids and kawainess!
>>
>>109860881
I've used vim for years. I still prefer a mouse for some things.
>>
>>109863190
>spring coming
>in fucking september
shut the fuck up off topic, mentally ill retard
>>
>>109863223
*makes a heart with his fingers*
>>
File: ippon.jpg (24 KB, 390x280)
24 KB JPG
>>109863285
*careses you on the cheek, gently*
*grabs you by your frock, ippons you into the concrete*
>>
>>109863325
*uses every last amount of power left to make 1 last heart shape with his fingers on the ground before passing out kawaii-ly*
>>
>>109856150
I guess but most things in the API didn't have their main entry point invalidated by an extension like queues did
>>
File: demon-eyes-kyo.jpg (140 KB, 768x1024)
140 KB JPG
>>109863357
>your dedication commands respect, maidshitter
*walks away into the cold night*
>>
>>109863395
what do you mean by that
>>
Maidposting is the best thing ever to happen to this board. I hope it lasts for a thousand years.
>>
>>109863486
im perfectly fine with that
just make your own generals
>>
>>109862112
Snailcat maids are extremely cute
>>
>>109863533
wait for snailcat frogs. They are the cutest creatures in existence
>>
>>109862087
>Why are linkers so fucking slow?
IO.
>How do we make them faster.
Make them in memory like fasm.
>But then I can't compile a 1TB exe like Chromium!
Bloat.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.