#🪅-progaming
1 messages · Page 124 of 1
i kind of hate this bc it doesn't work for more than 2 columns
Anyone know how to push changes to github on gitkraken
im having trouble uploading all my files which I was coding locally, just decided yesterday I wanted them to go on a git repo and now it wont push all the files there only the README and SECURITY
.button-grid {
padding: 1em;
display: grid;
gap: 1em;
grid-template-columns: repeat(3, 1fr);
> :last-child:nth-child(3n + 1) {
grid-column: 1 / -1;
}
> :last-child:nth-child(3n + 2) {
grid-column: 2 / -1;
}
}

(terrible please dont do)
becomes more complex the more columns you do lmao
This is why I will never use css/html
@crude star rate
<div class="button-grid-3">
<button>Click Me</button>
<button>Click Me</button>
<button>Click Me</button>
</div>
<button onclick="addButton3()">Add button</button>
<div class="button-grid-4">
<button>Click Me</button>
<button>Click Me</button>
<button>Click Me</button>
</div>
<button onclick="addButton4()">Add button</button>
.button-grid-3 {
padding: 1em;
display: grid;
gap: 1em;
grid-template-columns: repeat(3, 1fr);
> :last-child:nth-child(3n + 1) {
grid-column: 1 / -1;
}
> :last-child:nth-child(3n + 2) {
grid-column: 2 / -1;
}
}
.button-grid-4 {
padding: 1em;
display: grid;
gap: 1em;
grid-template-columns: repeat(4, 1fr);
> :last-child:nth-child(4n + 1) {
grid-column: 1 / -1;
}
> :last-child:nth-child(4n + 2) {
grid-column: 2 / -1;
}
> :last-child:nth-child(4n + 3) {
grid-column: 3 / -1;
}
}
const buttonGrid3 = document.querySelector(".button-grid-3");
function addButton3() {
buttonGrid3.append(buttonGrid3.firstElementChild.cloneNode(true));
}
const buttonGrid4 = document.querySelector(".button-grid-4");
function addButton4() {
buttonGrid4.append(buttonGrid4.firstElementChild.cloneNode(true));
}
tbf you can easily generate this with scss 
(sadly you can't do this with css variables)
@mixin grid-stretch($cols) {
@for $i from 1 through ($cols - 1) {
> :last-child:nth-child(#{$cols}n + #{$i}) {
grid-column: #{$i} / -1;
}
}
}
.my-grid {
@include grid-stretch(5);
}
I would expect for 3 columns the last 2 to simply be split in half
in which case you can just use flexbox for it
yeah xD
but flex for smth like this is always cursed because you have to hardcode width and account for padding, margin, gap
honestly I'm surprised there's no css property for this
it seems like a fairly common use case to want to have n columns but also stretch to fill
:nth-child(odd) is nice I think when you want to colour odd lines of a table darker
flex: calc(1/3 * 100%) and hope the margins aren't big enough to break it
it is cursed though
there's not really clean css solution
with a bit of js you can do a clean solution
combining grid + flex
@valid jetty
why does elle not compile
yuore using reserved keyword gen
is there a cargo option to bypass that
Edition 2024?
i think its supposed to be 2021
but i get this
even tho
its allowed
im using cargo 1.92
nix fixes this
@hoary sluice 🦅ly
@deep mulch
er
@valid jetty @lucid trail how do i run elle
do i need cargo <1.88
do u have a devshell for it
idk i'm just using
cargo --version
cargo 1.88.0-nightly (d811228b1 2025-04-15)
and how did yuo get 1.88
i think i used rustup
rustup 🤢
yeah i know
rust-toolchain.toml:
[toolchain]
channel = "nightly-2025-04-20"
Hello can i link my instagram account to discord somehow?
rust is fucking stupid
on 1.90.0 they stabilized let chains
but only on rust 2024, which i can't use because that also RESERVES the gen keyword
they don't use the keyword, they just reserve it
insane
so i have to stay on rust 2021, which no longer has let chains on rust newer than 1.88.0
it's fucking deranged
why cant you just replace usages of gen
i had this problem too
because there are many and i don't want to do that refactor right now
when using get instead of generation
i also don't want to rename it, gen is a good name
each codegen component is given 3 things, self (the astnode), ctx (stuff like the current function, module, cascading type, whether it's within a a return statement) and gen (stuff like tmp counter, scopes, address map, etc.)
gen stands for codegen, but codegen is too long
gen is the perfect name for that variable
yeah
lmao okay
there's a command to migrate it for you i think
generator?
r#gen but its so ugly
so slow
whats yalls cpu
m3
m1
uhg i cant buy a new mac until liquid glass is over
cause they all come with macos 26
ryzen 7 9700x
try compiling elle
they should do more rust compilation benchmarks
17.96s now
what did u change
i wonder if i can get it under 10s
if i put my fans to max and overclock to like 7ghz
meh thats probably not possible
its rated for 5.76
how
RUSTFLAGS="-Z threads=32" cargo build --release
how????
idk
@lucid trail i want to add a range of builtin methods to static arrays so that you can use them like vectors and matrices but i dont have function overloading
@valid jetty how fast does elle clean build for you
i was thinking to call the vector version of the function vname and then just name for the matrix ones
T[A][B]::mul() and T[A]::vmul()
@valid jetty https://github.com/acquitelol/elle/pull/8
i thought you switched back to kde
this but 16 threads
this has nothing to do with kde
u can have kde on nix
kde is a desktop environment
nixos is an operating system
oh wait no i meant i thought you switched back to a sane distro
i also set power plan to performance
also no im on hyperland
nixos is a sane distro
ok im overclocking my cpu just to compile elle
mv wrote that into stderr
so make thinks its an error
i think it just needs some flag
true
No its unsane
is this cursed
fn __arr__::__iter__<T, N>(T[N] self) {
return Array::slice_from_raw_parts(self.len(), #cast(T *, self)).iter();
}
external fn __arr__::__iter__<T, N>(T[N] self) @alias(__arr__::iter) -> Iterator<T, DoubleEnded>;
long enough id skip over when reading it
ah i really see the benefit of function overloading now
i'm imagining it can't be that hard right
even with function overloading, it would be an ambiguous case without generic constraints
because T1[A1][B1] fits into T2[A2]
its just T2 = T1[A1] and A2 = B1
so if you had function overloading for T[A] and T[A][B] you wouldnt be able to guess which function to call
oh you’re right
very
zoot doesnt know what pointers are
actually would this code even be valid
im concerned because.. it works
maybe it should accept the static array by pointer
actually no i see why that works
it only blits the data when the static array is the return value of a function
in the __iter__ method its essentially moving the static array into the iter function from the caller
there are no copies being made
ummm ok idk how i feel about that behavior
i may make it copy when a static array is accepted by value into a function too
ok ill think about this tomorrow im way too tired
checking rn
@valid jetty @deep mulch
this is running on all 16 cores
half of them are 5.76ghz
other half are 4.2ghz
this is without overclocking
im too lazy to set up overclocking now
already wasted an hour on this
cpu peaks at 74 degrees
@valid jetty merge the pr
Anyone used a custom vitest runner here
Does elle even support windows 🐟
hopefully not
Hopefully it does
Oh I see, we usually think of T[4] the same as T[4][1]
you could coerce them into each other
Who is this "we" and how can they possibly be this wrong?
i meant humans when thinking of 1d matrices and vectors
Mathematicians, and linear algebraists in particular, are indeed typically very bad at types
flagging added
stylistic changes
it goes from blue to green to yellow/gold to darker and darker reds
8 is a very dark red
basically just gets warmer
nop
someone already made a compose mine sweeper it looks very similar @frosty obsidian
yeah i know
i'll merge after i push all my static array type work
there are like 8 commits incoming
Do hexagons or triangles instead of squares to make it a little more unique
wing forgot
Yn
Cursor @frosty obsidian
Ew, non-monospace ligature
intellij vim plugin is pretty decent
I think it is monospace, just compressed into 1ch width
which means that the cursor movements will be fucked up
If the string fi is not the same width as fo, it's not monospace
hmm true ig
fi should naturally be one cell wide of course
oh my god parsing * vs ** vs *T vs **T is going to be horrible isn't it
yeahhhh
it's only not ambiguous if all cases in the syntax where a type may be are different from the cases where an expression can be
i think i'm gonna use ~T
never vibecoding with Opus 4.1 thinking again
did you mean?
hi, im looking for python developers.
paying $10k for py job.
dm me for pof and more details pls
ok yeah i can parse this now, it's not ambigious because it's clear where types are allowed and where it isnt
@young flicker
Nope
It has support for like zero builtin vim commands
So making a custom config is borderline impossible if you're doing anything but remapping keys
https://projecteuler.net/problem=949 drops this and leaves
A website dedicated to the fascinating world of mathematics and programming
@valid jetty hii
hi, im looking for python developers.
paying $10k for py job.
dm me for pof and more details pls
DM @young flicker
or @jade stone
or @frosty obsidian
you can use 1 space too
just use it consistently
yesterday on github i found something interesting..
https://github.com/oliver-ni
^ from this profile when i click on their "pokétwo repo" it takes me to ..poketwo/poketwo and not oliver-ni/poketwo
is it a github organization? why is that happening?
ahh, so its an different org repo pinned to the "oliver-ni" acc?
yes
i was thinking some binding shi 💀
made under oliver-ni then redirected to poketwo
( dont even makes sense idk what i was rthinking lol )
tyyyy
i think that could happen if the repo was moved to the org
ooh, interesting
The most interesting and accurate technical responses on X come from anonymous accounts with cartoon profile pictures, pictures of toast or other generic items.
The one with corporate headshots and ex-FAANG in their bios usually provide nothing of value.
it enforces one or the other, not both
try to mix tabs and spaces
@Aut4rk Why are you converting FFmpeg's nice Intel ASM syntax to ugly AT&T syntax?
Based
Intel syntax > AT&T
true
hi
?
should be minified to function*foo(){yield}
?remind 4hr learn go and pr minification to esbuild
Alright @jade stone, in 4 hours: learn go and pr minification to esbuild
both terser and swc do this and from what i can gather from reading mdn it's correct and unobservable
XD
afaik minify isnt esbuilt but terser
and afaik terser is context-aware
instead uses ast and does keyword replaces
that makes no sense, what?
no??????????????
yes
you are 100% wrong
esbuild is 100% written in go
terser is written in js
also they are different programs
esbuild is a bundler
terser is a standalone minifier
terser is a bit better than esbuild, however a good amount slower
apple accidentally sourcemapped all their code on apps.appstore a while back, and are now DMCA'ing everything that republishes it
https://github.com/minhducdz99/apps.apple.com
if some1 wants to grab it to learn here it is
@jade stone, <t:1762528130:R>: learn go and pr minification to esbuild
😇 I would never do such a thing
@hoary sluice @deep mulch my github about me is finally real elle code
well the english part was real elle code too but now the jp part can be entirely jp
yappanese
instead of just half of it
was this not previously not possible
it was possible for a while
its been a thing for 4 months
but i just forgot about it in my bio
@valid jetty make roiescript
yapinglish @deep mulch
do yall think a pr would be merged if i moved vesktop tray to libvesktop instead of electron on linux
dont really care to make a pr if there is never a chance itll be added
maybe?

No
No point of doing so
i mean on x11 plasma and some others theres a huge memory leak for electron tray icon setting
just electron bug but 
Go make a issue on Electron Github

Ask in #🖥-vesktop-development
weird had that channel hidden, also i cant speak there lol
RUSSIAN ELLE
Make a mod mail and ask for programming role
how is this server not termed
i thought mods were against tos
@deep mulch give me talking in vencord dev channels prems
haram
yes
harami
Salami
already seen
obvs you're in the tsoding discord
@valid jetty hiii
they optimized this game so much since i last played it
the graphics are beautiful
@young flicker
i tried it
when yuo enter vim on wave its not fullscreen theres an ai sidebar
its like
on all sides its not fullscreen
i tried ghostty but didnt like it
kitty is better for now
I tried ghostty but something was very bad about it I forgot what so I stopped using it
also no packages for debian and rpm based distros is unreal
@valid jetty whats the appeal with ghostty
i dont like it when apps have gtk title bars and configs unneccessarily
made by funny twitter guy
nothing in particular i just have a minimal config and ive been using it for a while without problems
xterm
and u must use twm and X11
or 🪟 and cmd.exe :)
what features
I cant read regulars channel
yes you can disable it
but it shouldnt be there in the first place
ghostty is not made for people on a twm
why x11
why xterm
stable for ages and always works fine
cuz its fast
ok
4.4bsd is also stable for ages
and works fine
are you gonna daily drive it now
sure if all of games/software/drivers worked on it
all games and software from x11 work on wayland
the only thing that doesnt work is x11 tooling like xclip but theres wayland tooling
Xfce doesn't, at least for me
ok thats x11 specific software
bspwm doesnt work eihter
neither does hyprwm
or i3
or banana
Yeah I saw it but I didn't know that was Kitty in the video
i thought it was obvious
Ok
no
they allow you to use per component styles
very long
you can change it to use classes https://docs.astro.build/en/reference/configuration-reference/#scopedstylestrategy
but it's no difference
youre embedding styles into your elements surely you dont care about a few extra bytes
/shrug
where'd my reply go
.
although if youre using something like river wm that doesnt support the ssd protocol gtk uses (FUCK GTK) youre stuck with ugly borders
@frosty obsidian
im not typing all of that again
its not that bloated
there are maybe 7000 lines of code max that i could genuinely get rid of if i refactor the parser and compiler
the rest is kinda necessary
wrong
I rewrite Elle in 200 lines
make Elle faster @valid jetty
oh some elle benchmarks would be interesting
(ping becos you have rust icon)
can you explain
while let Some(x) = x {
}
?
i've tried reading the book
i really can't understand it
let mut iter = vec![1, 2, 3].into_iter()
while let Some(x) = iter.next() {
do_something(x);
}
do you understand it like this?
its the same as
for x in vec![1, 2, 3] {
do_something(x);
}
i don't get the part Some(x) = iter.next()
is this a check? what is this
do you know what if let does
also no
read that first
okay hold on
okay i don't understand this either 😭
i just understand that i can use it to check enum values
if let pat = expr { ... }
``` is shorthand for ```rs
match expr {
pat => { ... }
_ => {}
}
``` (`else` version should be obvious)
```rs
while let pat = expr { ... }
``` is shorthand for ```rs
loop {
match expr {
pat => { ... }
_ => break
}
}```
guessing else is the _ => {}
thank uuuu
do you want to check my project?
No
okay
have u learned how enums work
and what result/option is
i think i know 😭
i mean like the rust specifics of enums
tuple values, struct values, etc
probably not
i've probably learned them before
just haven't used
so i forgor now
learn that before learning while let
'k
what the hell
Oh, learning about provenance for the first time?
well consider this
int xs[5];
int *foo = xs + 5;
int ys[5];
int *bar = &ys[0];
``` if they just happen to be contiguous in memory and `xs + 5` is the same memory address as `&ys[0]`, are they the same pointer? no!
Array#includes will iterate through every element in the array, checking items[i] == item
yeah
Set#has will calculate the hash of item and then check if there is something living at that place in the array
idk what js's set is using
most likely its using a static array of buckets which are linked lists
waa
yeah this is exactly the example
an quite interesting problem
basically the way that a hashmap/hashset works is:
- calculate a ""hash"" of the item
- mod by length of your array
- put the item in that place in the array
- if there are multiple things that hash to the same thing, put them in a linked list at that index
well, at least for open addressing
and then essentially, you assume a hypothetical scenario where each item perfectly hashes to a unique slot in the array and there are 0 collisions
therefore that makes the operation technically O(1) since calculating the hash of the item is not dependent of how many items there are in the set
unlike an array
i hope that makes sense
thank u
im not sure what js uses for its maps and sets
but open addressing is kinda the most common nowadays i think
closed addressing is basically where you have a dynamic array instead of a static array of linked lists
and then you calculate the hash, and if there is a collision, you go to the next slot in the array until there is an empty one
if you run out then you grow the array
this is called linear probing
but the problem with this approach is that if many things hash to the same thing you will end up with loads of collisions and so fragmentation
and then that fragmentation will lead to slow inserts and slow retrieval, eventually approaching O(n)
im not sure exactly how quadratic probing is designed to work but im sure theres a similar problem
you can switch them after this code
so they are the same pointer
because imagine there is an array like
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
and you wanna insert 5
5 hashes to 13
so you insert it
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][5]
now you wanna insert more things...
and you end up here
[ ][12][22][7][15][16][-1][92][26][54][19][3][14][5]
and you wanna insert 192
that hashes to 1
but there is already an item at that slot, so you go to the next one .. and repeat that until you end up at the very first slow which is empty
..essentially O(n)
its undefined behavior
..in case it wasnt obvious i implemented my own closed addressing and open addressing hashmaps and hashsets in elle lmao
the garbage collector uses an open addressing hashmap, the actual hashmap in the stdlib uses a closed addressing system
there are loads of good videos on youtube
yeah this is an open addressing hashmap
a static array of linked lists
rn like react native
you mean "never gotten into"?
@hoary sluice @deep mulch https://www.youtube.com/watch?v=htYh-Tq7ZBI
..or can you? A deceptively simple question with a complex answer – come join a mathematical journey into madness and wonder, in search of answers that might just give you a new perspective on the mathematical constructs we use in our games
Recorded at Dutch Game Day 2023, October 4th
Timestamps:
00:00 Intro
04:34 Talk Start
05:17 Anatomy of...
deriving geometric algebra using vector multiplication!!!!!!!!!
links complex numbers and quaternions using bivectors
fucking awesome lecture
im in cs rn
i love her channel
so good
ahhhhhhh i udnerstand now
rosie is THE smartest
yeah but my grades are bad
oh which unis do you want to go to?
because i was uhhhhhh......... not in the best mental state during my mocks last year
i have AAC right now
edinburgh or leeds
yeah i heard you wont even get an offer unless you have 3A* predicted
which is why im hoping my personal statement and personal circumstances in my reference are enough to get a contextual offer
since its hopefully clear im passionate about cs
well i am applying
I feel like AAA is not that hard, but thats insane
mine was so shit 😭
I don't think says a lot about yourself as a person, more of what you did. like ok you did cool things but why like compilers? or why did you find deriving geometric algebra from first principles so interesting?
yeah im gonna put my extracurriculars into my reference rather than my personal statement
i love playing rhythm games and listening to music but i ran out of characters
i think in particular focus on what excites you about the subject
i mean i did in the first paragraph
well theyre forcing you to structure it really horribly
also keep in mind the admissions people are not necessarily technical people, theres quite a bit of jargon
i have to answer these in order
Why do you want to study this course or subject?
How have your qualifications and studies helped you to prepare for this course or subject?
What else have you done to prepare outside of education, and why are these experiences useful?
idk i was told it is best to include as much technicality as possible in it
the more complicated things there are the more obvious it is that youll succeed at the course
to quote my form tutor quite literally "i have no idea what any of these things mean, and thats very good"
Interesting, I have no evidence to say otherwise
and thats also the sentiment that various other people ive asked have told me
and anyway its not really technical jargon
someone who does computer science at university should know what most things there are
except maybe for like, hermes bundles and monomorphization?
but the other stuff is all pretty standard stuff
thats true
some of my classmates have not heard of UTF-8
like there is no way an admissions person doesnt know what a garbage collector or lazy iterator is
or a flood fill algorithm
why would you assume they are studying cs
well im assuming since im applying for cs i would be reviewed by an admissions officer who is specifically fluent in cs
otherwise to satisfy the admissions officers you would have to make your personal statement as bland as possible and that is not what ive been told by anybody
thats why its not long blocks of text
idk i thought i structured it pretty well
at least compared to initial drafts
which were like 3 paragraphs all with like 2 sentences per paragraph
i loooooved to have super long sentences seperated by a comma
this is a uk uni
everyone in the uk needs to follow this format
you mean this?
yeah, thats true
i dont know
i dont like it either
its achronological
since i made ichigo after elle but i need to talk about it before elle
Achronological means out of chronological order; not arranged in the order events actually occurred.
lmao
actually
can you ask your teachers on monday how many technical terms they understand out of that personal statement
im really curious
husk
i think you're following this too strictly
after all, I didn't, and i got in 4/5
i dont like that youre including your personal website as one of the projects on your personal website
feels like youre fluffing up an otherwise lack of projects
also why do the buttons take 5 years to take you anywhere 😭
the little circle is when i click btw
genuinely i thought my internet died when i clicked on the about button and it did nothing
the first time i clicked it, it genuinely took 10 seconds to take me to the page
it takes 2.5 seconds
seems to be getting faster each time i switch tab?
very strange behavior
WHY DO YOU NEED SOLID FOR A PERSONAL WEBSITE 😭
it should be static html
you hate interactivity
the fact that it is lagging on your phone should be telling you something
its called a personal website because rosie personally chooses what you should be doing
i do
at least for a personal website
for a website where you can look at some text and click on some buttons you dont need a whole ass framework
because thats essentially what a personal website is
a description of you and the things youve done, and buttons to learn more on other websites
?
a personal website is whatever you want it to be can u hear ur own words
whatever..
https://neal.fun/ i am a developer from India and this is my personal website
Games, visualizations, interactives and other weird stuff.
should i replace with static html ?
thats what im saying :3
i should make an entirely interactive website without any js
not even without any framework, no js at all
you can probably do it with radio buttons
css audio when
@hoary sluice lmao
millions will stream html
yes
you understood everything in this
arent those synonyms
cs is so annoying, so tedious
yeah i have to take cs courses as a math major
i dont think its gonna lead to getting a job either way
both are the same on the resume
nerd
idk what that is
you know the guy on twitter who likes dynamic arrays and programming in C
he has a discord server full of nerds
no
i dont interact with twitter
@valid jetty https://www.youtube.com/watch?v=IjIFCyeo47g
#263 In this video I look at one of the lesser known parameters of an operational amplifier which limits the amplitude at which a signal of a certain frequency can be output. While this parameter is determined from the slew rate, its still important to keep in mind since usually you consider the 2 separate.
Datasheets and further reading:
https...
i should join then call rosie a nerd and leave
Such a silly question, of course you should
you wouldn't be able to
you need to subscribe on twitch or get vip to talk there

im not racist err meant to ask wheres his accent from yk sorry
i love how he uses makefiles for rust
i wanna do that with c# and java

spir-v target soon
this is probably not that hard surely, translate it to SPIR-V and you could do metal too
has anyone made a midi file parser
Spirv won't work on macos
this is just painful
being racist against russians is ok tho
@valid jetty all of university cs
Tsoding isnt russian
true but the only time ive seen microservices poorly implemented is oop
yes he is
here is a 2 hour stream fully in russian https://youtube.com/watch?v=f4EOMbmIqqw
References:
- Source Code: https://github.com/tsoding/good_training_language
Chapters:
- 00:00:00 - Intro
- 00:00:56 - Stream
- 01:59:44 - P.S.
and he doesnt have an accent
only a bit of rhotacism or an accent where the r is pronounced differently
Hm okay
I'll watch after game
this was sarcasm btw
he said in a recent stream he never left russia
yeah that's why he doesn't get any money from donations and can't access most webpages
kinda sucks
theres no way tsoding is unable to set up a donation link
nono he is able to
but i meant twitch donations from subs and patreon don't reach him
they are purely ways for him to moderate his discord server and chat lol
i should pay to get access to his server
my cursed ideas would probably be right at home
though it's not like in other cases where even if i don't talk much i know i'm supporting one of my favourite channels :(
@nimble bone working on a project where i need esbuild, rollup, and vite at once 
how
i think ill finish tonight (
)
salad addicted to web dev
salad insane
This isn't web dev
am i crazy or doesnt vite use esbuuild and reollup ourgh
Yes but I don't mean it like that
STINKY SADAN
@jade stone Satan
horror
@valid jetty inko language added web socket
i made a terrible vite/rollup plugin 
i kept having so many things that i just wanted to do at build time instead of runtime, so i made a plugin that would just make it easy to generate modules
and it also generates a d.ts for you
export default class extends
im russian
And how slow is it
About ~250 kilohertz on a 2080Ti.
💀
So not even XP would run on that thing
how
i was joking
@valid jetty why have i been using almost exclusively rust outside work for 2 years and have still never had a use for lifetimes
ive used lifetimes but always ended up refactoring them out
@valid jetty is this correct ```rs
pub fn map<'a, U>(&'a self, f: impl Fn(&T) -> U + 'a) -> impl Iterator<Item = U> + 'a {
self.data.iter().filter_map(move |opt| opt.as_ref().map(&f))
}
pub fn indexed_map<'a, U>(
&'a self,
f: impl Fn(usize, usize, &T) -> U + 'a,
) -> impl Iterator<Item = U> + 'a {
self.data
.indexed_iter()
.filter_map(move |((r, c), opt)| opt.as_ref().map(|v| f(r, c, v)))
}
this is so unreadable lol
ok the lifetime is yet again not needed
@valid jetty @fleet cedar what do i call an in place map
on a grid
unless you're doing async/mt you almost never need lifetimes and even then 'static fixes it 99% of time
ive made enough async stuff
and still have never used lifetimes
map_inplace?
In Ruby you'd name it map!()
this is a really busy couple of weeks for me
left cuz #🖥-vesktop-development message
is it just that you assume T is iter
yea
well no, T is not iter
i assume T implements a method that can turn it into an iter
I love c++ post-mono errors
@valid jetty does Elle have inheritance
does elle have sadan exploder
Does elle have ub
no, thank god
Add
there is polymorphism if you're a bit creative
use std/prelude;
struct Square { i32 length }
const Square::draw = fn(Square *self) (0..self.length).for_each_with(fn(_, self) $println("*".repeat(self.length)), self);
struct Triangle { i32 length }
const Triangle::draw = fn(Triangle *self) (1..=self.length).for_each(fn(i) $println("*".repeat(i)));
struct Shape @nofmt {
void *base,
fn(void *) draw
}
fn Shape::from<T>(T *shape) {
return Shape {
base = shape,
draw = T::draw
};
}
fn Shape::draw(Shape self) {
cb := self.draw;
cb(self.base);
}
fn main() {
square := Square { length = 5 };
triangle := Triangle { length = 4 };
shapes := [Shape::from(&square), Shape::from(&triangle)];
for shape in shapes {
shape.draw();
$println();
}
}
Insane
guys any tips for lightweight, portable rust frameworks for backend development? i need just a simple thing to expose some routes, important is thats its wasm compilable
axum? here's an example: https://github.com/tokio-rs/axum/blob/main/examples/simple-router-wasm/src/main.rs
axum is nice
just don't pull everything from tokio and youll be fine
do you guys think it would be possible to run a simple api from rust using wasm?
and call it like from typescript in node/bun
yes
I actually saw a repo just for that a few days ago when I was looking for something else
do you think axum would work for this
Big fan of saying api when you mean web server
are you asking for an web server api, or you want to expose something from rust to js?
for the latter, napi-rs works great, you just annotate your functions with #[napi] and it does the rest with napi_build
bun and deno have ffi so that's another sleeker option, but more annoying to work with and no node support
Well it is an api - its a web server which i want to serve/manipulate data, therefore an api
Yes but "an api" means literally nothing
a pee eye
guhhhhhhhhhhhh
thanks windows
how
patching my own npm package because i forgot to push it to github 😭
how


i hate windows
GOD FORBID V8 FIX THIS BUG
at least its throwing an assertion instead of segfaulting 
skill issue
i opened an issue with node for them to backport the fix
still not merged 
use newer node then
I really want anonymous unions in rust, is there a way for me to do something like that
don't really want to create a type just for one function
this syntax is cool, I haven't heard of @ in rust before

node is very behind in v8 versions
compared to chromium
Whaa what does that do

basically
it's more powerful than that
you can bind to any stage of the match
Foo(x @ Bar(Baz(19)))
waow
pointers!!
me when "inconsistent use of tabs and spaces in indentation" in python cuz i used nano
😭
I mean backport the fix from v8
why are hard things so hard
hop on micro
if (not updateRichPresence(richPresenceProtocol, inGame, placeId, serverId, start, gameName, richPresenceDetailsFormat, gameIcon, userID)):
richPresenceProtocol.close()
richPresenceProtocol = richPresenceConnection()

good to go
why are you using parens in if
fake python dev
I start doing something and then give up because it seems really hard

could this be because it’s on 64bit
i found the issue
aparently i was feeding a boolean to pypresence
instead of the real stuff
gameIcon = getGameIcon(placeId)
while (inGame and not gameIcon):
gameIcon = getGameIcon(placeId)
time.sleep(15)

guhhhhhhhhhhh
thanks vite
(this error is from a plugin, not vite)
god forbid they tell you the plugin that errored
@valid jetty do you intentionally make the stack grow downwards? I add my offset, but in elle it has to be subtracted
I think nothing is said about the ordering of local variables on the stack, could be a QBE thing. seems like local allocations growing downwards is typical
looks like this has something to do with how cranelift generates the assembly actually, the stack slots are merged
@jade stone satan
Oh
Only one image sent here
no, however the stack grows downwards on 99% of modern cpus
i'm not sure why it grows upwards for you
also subtracting 8 from x's addr is undefined behavior
elle's order of allocations is not the order of variable declarations
SEND THE REST THEN
the rosie grows downwards
@woven mesa
@woven mesa https://github.com/Lakr233/ConfigurableKit
i would expect so
why i do i question the decisions my previous self made
they're always right
i always had a good reason to do a dumb thing
at the very least, variables allocated within other scopes are put into the root scope
that way things are only allocated once
the behavior before was that if you declared a variable in a loop it would allocate new stack memory for it each time and cause a stack overflow
which is obviously horrible and not what you want
well qbe does that for me
In compiler optimization, register allocation is the process of assigning local automatic variables and expression results to a limited number of processor registers.
Register allocation can happen over a basic block (local register allocation), over a whole function/procedure (global register allocation), or across function boundaries traversed...
interesting
that's actually why i have to pass every pointer through a noop function when the gc is enabled
since i don't have access to the assembly level i can't use the registers as roots for the gc, so i need to make sure all variables are on the stack so they're discoverable as roots within the gc
this is not optimal is it
and how does passing a pointer through a noop function ensure variables are on the stack
how did u do
i guess it means qbe can't optimize it
who knows
no, it isnt
i need to ask in the qbe forums if there is another way to do this
maybe a way to get access to the registers
or some other way to ensure variables are always put on the stack
how are you interfacing with QBE in rust rn?
just curious
wait why do i sound so much like an LLM, kinda concerning
i rarely reason
if i were to reason id probably do most of it in latent space
@hoary sluice holy did u see the message sent by the top two teams?
i wrote my own qbe bindings that implement fmt::Display to write them into qbe IR
seems like it invokes a command
oh jumpscare
theyre based on a qbe binding library but ive added maybe an extra 5000 lines of code to them so theyre not really based on that anymore
look in this folder https://github.com/acquitelol/elle/tree/rewrite/src/compiler/qbe
this is where all of that lives
qbe IR has no way to spill it? it wouldn't make sense to not have a stack store instruction
pretty amazing
wdym stack store
they have stack alloc (with an alignment) which returns a pointer that you load and store from like any other pointer
well it invokes qbe, after turning the code into qbe IR
i think theres probably a way to wrap qbe itself into an amalgamation and use it like a library
but this is fast enough and i dont really care about the speed up from not needing to write and read from a 5k-ish line file
ok yeah i see why you'd use that trick to ensure the variables always on the stack
because if i dont, qbe will optimize naive stack allocations into registers
consider
fn foo() {
a := #alloc(i32);
b := a;
a = nil;
}
b is just assigned to a pointer
its a naive stack allocation
it can be put into a register
so qbe will do that
however if you call a function, qbe decides to put it on the stack (since you allocated the variable on the stack originally using alloc8 or whatever, i assume it wants to keep invariants)
optimizations can only happen when youre sure that the code behaves exactly the same
you dont know if the function expects your pointer to be on the stack
i wish i can post a screenshot of the results of the coding contest because this is truly crazy
since it was allocated on the stack you should pass it on the stack, but if you know it will only be used in the current function you can put it in a register
i hope that makes sense
yes and the noop function is what makes it stay on the stack
makes sense
yes
theyre from my home location
st pölten
in my case, i traverse the stack linearly looking for things that look like pointers to see if theyre allocated via the gc

if i have a naive case, qbe doesnt know that the variable actually should be on the stack
terrible
since its just used in the current function
#41 in vienna
so itll put it in a register
same
wait thats not bad
at what stage does this happen? within each block?
AI has changed the game this time
no i couldnt even solve 5
we did level 4 with ai and level 5 without
3h50m leveh 5 solve
gc collection happens when the allocation capacity is full https://github.com/acquitelol/elle/blob/rewrite/std/runtime/allocators/gc.le#L180-L182
gc.le: Lines 180-182
if self.total_size + size > self.threshold {
self.collect();
}
🔥
the capacity increases if a lot of things are still alive after collection* https://github.com/acquitelol/elle/blob/rewrite/std/runtime/allocators/gc.le#L164-L176
gc.le: Lines 164-176
if before_size > 0 {
ratio := freed_size * 100 / before_size;
if ratio < 25 {
self.threshold *= self.growth_factor;
} else if ratio > 75 {
self.threshold /= self.growth_factor;
if self.threshold < GCAllocator::MIN_THRESHOLD {
self.threshold = GCAllocator::MIN_THRESHOLD;
}
}
}
wait really? how did the top two teams do it then?
they said they only used AI and didnt even look at the problem
eagely should i start vibecoding
wow, if ptr && ptr > 0x1000000 {, nice
not what i was expecting
this is genuinely how you check for pointers lol
though, this is fine
im just pruning the list so i dont check things unnecessarily
i mean the top two teams just won a coding contest using nothing but AI
i still check if the value is within the range of an allocated pointer
they were very transparent about it and even rejected the prize
wdym
what uni stuff
no i don't work
i'm just wondering what you're talkng about
oh personal statement?
yeah that's for uni applications lmao
i couldnt send my last message because the automod thought it was spam? weird i was just saying they were very open about what they did and rejected the prize money, they just wanted to send a message that AI is killing the spirit of competition
i cant say i looked into this that much when i chose lol
well i only did that to such a deep level because i don't have amazing grades and i need to have a very good personal statement and reference in place of that
@hearty lintel first place in vienna #5 global on awards ceremony
"did you use ai?"
"yes."
"a lot?"
"yes."
"solely?"
".. almost"
were those different guys
maximizing for fun is good
where did they say that
maybe they had good prompt engineering 😭
its on the CCC discord
i cant send it here because brainrot role
math is so fun!! and less coding than cs, which i find quite tedious. theres a lot of math in cs, no?





