#๐ช -progaming
1 messages ยท Page 35 of 1
we had to learn 15 poems for english literature and also 3 stories (an inspector calls, a christmas carol, and macbeth)
Crazy
thankfully because of my special circumstances i got to skip the macbeth exam altogether and it wasnt included in my final grade so that was nice
Ill become a goose farmer i guess
Real I hate literature so much
Macbeth is quite fun actually
somehow i got 8/9 for lit ๐ญ i literally have no idea how at all
I'm learning about shakespear right now
it shouldve been a 6
what's a good place to learn about algorithms
I just realised i have been programming for nearly 10 years just relying on standard libs 
advent of code
look at for example this year's problems
i mean i do not know any sorting algorithms lol
they had a good range i think
well until i watched a youtube video that was far too fast to follow properly
this year was fu-
and i understood what bubble sort is
but i also would be lost when implementing a hashmap
2024 was easier than 2023
https://www.geeksforgeeks.org/sorting-algorithms/ theres a lot
and have wanted to learn how to do it for ages
isn't geeksforgeeks the site which plagiarises stuff and is not very good
lmao
i hadn't known about aoc before last year, and i was just too lazy to finish it all :(
i believe so
but its still useful
๐ญ
theres 2 primary ways you can make a hashmap btw
That's okay, that's why we have internet
one is (imo) easier than the other
i can explain both if youre willing to listen to me yap for a few mins
You can look into papers how to do the hashing etc
and you might not be able to do it on your own for first few times, but then, you'll be able
seems school tm teaches useful programming stuff
(that single school that everyone goes to)
idk in my country they don't learn anything
we've been learning python for five years but i feel like after first year we didn't learn anything new lol
on a secondary school that is specialized in informatics you'll learn only how to do for loop, define functions and that's probably all lol
relying on school is the worst thing to do
that's why I'm so happy that I started programming like 6 years ago
i just kinda know bios exists and was replaced by uefi
when I was 10
i started when i was 8 i think?
wow nice
my first was something php
wait
I also remember c# calculator... probably when I was younger? not sure, maybe at 9
it is
cool
im 16 rn
what if i'm 3 years younger than you
i always talked to people that are older than me
sorry :(
lol was joking
uh they did loads of vendetta stuff?
@winged mantle
2 ways of creating a hashmap which handles collisions for keys' hashes
- static array of linked list of buckets (which are simply structs that hold a key, value, and maybe whether they are full or not)
- growing/dynamic array with just buckets (not a linked list of them) using "linear probing"
linked list approach
- you preallocate a fixed region of memory (a static array), lets say 1024 slots of
Bucket ** - you compute a hash (it can be as simple as just
value % capacity) and that determines your index into this static array - at this point, you add a new bucket to the linked list which holds the key and value you wanna store
- when retrieving, you just hash the key again and look through the linked list at that index until you find the bucket that has your key, and return the value
dynamic array approach
- you allocate a buffer of memory (a dynamic array) of
Bucket * - you compute a hash just like the linked list approach, and then if there is already a value at that index, try the next index in the array, etc etc, wrapping around to the start of the array until you find a free slot that holds no value (this is called linear probing)
- if the index wraps around to what it started then the hashmap is full and you throw an error
- if the hashmap's capacity exceeds some growth factor (such as maybe 75% of the slots are full) you can double the hashmap's capacity so you can store more things
- when you wanna retrieve from the list, compute the hash and then follow the same linear probing path of incrementing the index until you find the key youre looking for. again if youre wrapping around to the index you started on then the key isnt in the hashmap so you just break out and return nothing
the dynamic array approach is typically faster but both are pretty easy to implement (and ive implemented both before)
ai
no i wrote this by hand
fake
ill save it for blom std :D
they are but the linked list hashmap is way easier to implement
linked lists dont exist
omg have you seen that video too
it's a pain to test
yea
this is why i like stdlib :)
she's amazing xddd
hear me out ```rs
use std/collections/hashmap;
use std/prelude;
fn main() {
let map = HashMap::new<i32, string>();
io::assert(map.is_empty(), nil);
map[1000] = "foo";
$assert(map.get(1000) == "foo", nil);
$assert(map[1000] == "foo", nil);
$assert(map.size() == 1, nil);
map.put(1000, "abc");
$assert(map.get(1000) == "abc", nil);
$assert(map[1000] == "abc", nil);
$assert(map.size() == 1, nil);
io::assert(map.contains_key(1000), nil);
map[5] = "meeow";
map[0] = "nyan";
map[-40] = "meep";
map[98] = ":3";
$assert(map.size() == 5, nil);
$assert(map.contains_key(5), nil);
$assert(map.contains_key(0), nil);
$assert(map.contains_key(-40), nil);
$assert(map.contains_key(98), nil);
$dbg(map);
map.remove(5);
map.remove(-40);
$assert(map.size() == 3, nil);
$assert(!map.contains_key(5), nil);
$assert(!map.contains_key(-40), nil);
map.clear();
$assert(map.size() == 0, nil);
$assert(map.is_empty(), nil);
$assert(!map.contains_key(5), nil);
$assert(!map.contains_key(0), nil);
$assert(!map.contains_key(-40), nil);
$assert(!map.contains_key(98), nil);
$assert(!map.contains_key(1000), nil);
let string_map = HashMap::new<string, i32>();
for char c = 'a'; c < 'f'; c += 1 {
string_map["{}".format(c)] = math::next_power_of_2((i32)(c - 'a') * 30);
}
$dbg(
string_map.contains_key("b"),
string_map.contains_key("foo"),
string_map["d"],
string_map
);
io::println("All HashMap tests have passed!".color("green").reset());
}
you just compare the result of something to what it should be\
yeah
i don't think this is enough
i should add support for module importing and write simple test lib too
i would not trust this hashmap as a database
(and hashmaps are the best database
)
if you implement it with a linked list theres not much reason not to trust it
its pretty intuitive
i test my software manually
which is fun

(not)
(good luck trying to stop regressions)
struct __internal_ElleGC_Header @nofmt {
bool marked;
i32 size;
void *data;
};
struct __internal_ElleGC_HashNode @nofmt {
void *key;
__internal_ElleGC_Header *value;
__internal_ElleGC_HashNode *next;
};
struct __internal_ElleGC_HashMap @nofmt {
__internal_ElleGC_HashNode **buckets;
i32 capacity;
};
fn __internal_ElleGC_HashMap::new(i32 capacity) {
__internal_ElleGC_HashMap *map = mem::malloc(#size(__internal_ElleGC_HashMap));
map.buckets = mem::malloc(capacity * #size(__internal_ElleGC_HashNode *));
map.capacity = capacity;
return map;
}
fn __internal_ElleGC_HashMap::hash(__internal_ElleGC_HashMap *self, void *key) {
return (key ^ (key >> 16)) % self.capacity;
}
fn __internal_ElleGC_HashMap::insert(__internal_ElleGC_HashMap *self, void *key, __internal_ElleGC_Header *value) {
let hash = self.hash(key);
let current = self.buckets[hash];
while current {
if (current.key == key) {
return;
}
current = current.next;
}
__internal_ElleGC_HashNode *node = mem::malloc(#size(__internal_ElleGC_HashNode));
node.key = key;
node.value = value;
node.next = self.buckets[hash];
self.buckets[hash] = node;
}
fn __internal_ElleGC_HashMap::find(__internal_ElleGC_HashMap *self, void *key) {
let hash = self.hash(key);
let current = self.buckets[hash];
while current {
if current.key == key {
return current.value;
}
current = current.next;
}
return nil;
}
``` (with some things omitted for brevity) this is the whole impl
why ๐ญ
because this thing is purely an internal symbol i never want this to collide with any other module ever
i wish there was a thing where you could learn things
std should be also readable
yeah this is the GC
what if one were to name their function the same as an internal function
the actual hashmap in the stdlib is readable https://github.com/acquitelol/elle/blob/rewrite/std/collections/hashmap.le
oh okay
how do you build a fast language without unsafe rust
i will not star this just to make you feel sad
its not a fast language
it lacks optimizations
im gonna sleep good night guys
i bet nasa uses javascript
maybe at some point ill rewrite the compiler in llvm instead of qbe
and tomorrow ill finally work on blom again
shouldnt be that hard actually?
qbe is now more of an annoyance instead of helpful because the compiler has gotten so advanced
just create same enums for llvm instead qbe
i just realised
i know its not that easy, but will help
i don't need to learn anything
it is a lot harder
i can use chatgpt
llvm has concrete explicit types unlike qbe
thats a really bad way
i8* is a type in llvm while its just l in qbe
and in llvm you use getelementptr instead of calculating the offset into the struct directly
and other things like that
how delisional - i could not possibly get a job by the time i have learnt enough - chatgpt will have already taken all of them!
it would have to be completely from scratch
if you use AI to stop thinking thats really bad
wait hyroo did you end up implementing structs
okay i dont get that far xe
what can i say to make the sarcasm obvious
no i didnt have any time bcs of school
tomorrow i want to finish infix functions and work on structs
will you make a->b for (*a).b
uh idk need to think about that
what how
i have been for like almost a year now thats how i learnt so much so fast
fraud
in elle i made auto deref so you can do a.b and it will be (*a).b or a.b depending on the context if it helps you think
try getting expelled!
interesting
(not that that's what i did that is a secret)
nvm gonna sleep ill think about that tomorrow :D
aren't you too old to be going to school
i mean at least primary/secondary/elementary/high school
who
You
im 17
legally enrolled in high school but i attend college instead through a free state program
explode
gimme some of ur age >,< i wanna leave this country already
i get that a lot
maybe talking to people like 6 years older than me on a daily basis does a lot
im 16 lol
i was so excited for the day where my age would surpass everyone else's
wait
maybe it worked
maybe my fast ageing pills worked
where was that one picture of me showing off my mirror
this thing
like develop gcc
lmfao yeah totally
(again)
i could never read the slop that is gnu code
i wanted to make a linux file manager for a little bit of learning
so dark
idk how to make things not look ugly though (this is figma)
(it's even harder to make not ugly code)
estrogentwink went and increased the contrast
pro tip: more space
put more padding
everything is so close together
let it breathe
i mean it's a pc app
i do enjoy a bit of big buttons to make them easy to click
but there's a point where it makes no difference
linux users love clutter
look at how close this icon is to the edges
i think it is too flat personally
that too but you can fix it with more sections if those sections have different colors and layouts
but idk how to make something have a bit of gradients shadows etc. without looking dated
lc.define skeuomorphism
ugh
lc.define glassmorphism
whatever
and the buttons are too small so it's mediocre accessibility
i would start by standardizing your spacing rules
yeah ik this is just the exact stage to do that
but for it to look good it needs to be a slow mockup most likely
its interesting that you aren't using any premade component library
i guess designers think about stuff which may seem pointless to the average person like parts of icons ligning up
why would i use that

its just way easier
i want to create something unique and implement it into a qt style
but not so unique that it looks like it was made by an alien i suppose
i would still go and look at the design docs for other design systems
they'll typically have spacing guides and whatnot
and could give you inspiration
main thing i was actually worried about - i don't think spacing is that hard if you put time into it - was the colours
it looks very bland
and looks very close to gnome
and i don't want it to just look like gnome's file manager
colors are always gonna be similar tbh
theres only so many that work in ui contexts
but i would like a bit of older style buttons with actual texture
without it looking that old
best dark mode shade
e.g. elementary os looks very modern but the buttons look way better than generic modern buttons imo
(aka single colour)
they seem to have multiple strokes
i didn't see how you could do that in figma
and i don't even know how they do it with css
for context thats not a selfbt
rust ๐ฅฐ
:3
for now
lol i was about to clear reactions
heat me
imagine not being admin
wtf is that account +1 reacting everything
macos de
gn
i love shift click in reaction picker to react without exiting dont ban me
vmute exoodev 24h explode
v+ brain rot @formal belfry
wait this is rosie
thats the person i was referring to
rosie selfbot...,
.
file manager i usually use
did they actually write the button as a component or just use a 9slice texture
๐
it's gtk
so they used css
probably
hopefully....
oh you can abuse box-shadow to create multiple borders
idk if you speak linux
<3
@frosty obsidian sudo dnf history undo 131
why does finder look so ugly
i mean why do the labels not align properly
yeah that looks less pretty than i remember
no i think its just the button labels in the header
why did somebody turn finder into chrome
i have like 3 different ones
the kde one, another random one and firefox is a special boy
this is my saturday file manager
friday file manager?
friday was made by microsoft for advertising purposes
depenes on what app opens it
i don't like the square folder icons tbh
microsoft in the 90s
my file managers are dolplin, nemo, nautilus, firefox, ls, zed, nvimtree
and intellij
internet explorer and file explorer
i have thunar and nautilus i think
used to have pretty much the same ui
idk macos can look nice sometimes
gotta try all the file managers
personally i think blur should not be a thing
even though i feel nostalgic for windows 7 and vista aero
whats wrong with blur i love it
it's too blurry
too distracting

at least windows 7 and vista only applied it to titlebars
the kode tode
oh and as well i expect it consumes more power
but probably not that much if you're a good programmer
like apple
look i need an excuse
@deep mulch unhusk
man linux lessons in school were so fun, teacher says create an ubuntu (they always use ubuntu idk why) vm, install a game and play it, you have 4 hours
press super -> type super tux kart -> enter -> enjoy the next 3 hours and 57 seconds
nop
if i want to make this simple desktop environment thing i've been wanting to do for fun i need excuses to keep it simple
YOU HAD LINUX LESSONS?????
u clearly have never seer r/unixporn
i have
im in a technical high school
but i dont bother to make it look that nice
4 hours of super tux kart?
@valid jetty hiiii
install steam
we once had like 2 hours to create a file in midnight commander
now its just learn economics and low pass filter formulas every day for a year
vhdl too
@hoary sluice ๐ฆ ly
legal eagel
gn
i should make a yt channel illegal eagle where i post myself commiting felonies
i'm going to have to put apple users dni โ ๏ธ in my bio
apple users dni
sonic/touhou fans dni
macos is literally linux but with actually nice design choices
no
linux is a kernel
you get the same benefits as linux because its unix based
it is not
linux is a kernel is a great excuse which i should use more often
rosie probably thinks of ubuntu when thinking of linux
macos is the bloat of windows and the shell of linux
no i think or alpine or arch
or void
trying but yall yap too much
macos is pretty good but the grass is always greener until you eat it (??) or something (???)
it is bloated how exactly
rosie never tried arch
i tried arch
name one way in which macos is more bloated than a linux distro
regular system freezes
also
i actually installed it on a brain chip so it also made my brain freeze
there is an app for everything
I'd just like to interject for a moment. What you're referring to as Linux,
is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.
Linux is not an operating system unto itself, but rather another free component
of a fully functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day,
without realizing it. Through a peculiar turn of events, the version of GNU
which is widely used today is often called "Linux", and many of its users are
not aware that it is basically the GNU system, developed by the GNU Project.
There really is a Linux, and these people are using it, but it is just a
part of the system they use. Linux is the kernel: the program in the system
that allocates the machine's resources to the other programs that you run.
The kernel is an essential part of an operating system, but useless by itself;
it can only function in the context of a complete operating system. Linux is
normally used in combination with the GNU operating system: the whole system
is basically GNU with Linux added, or GNU/Linux. All the so-called "Linux"
distributions are really distributions of GNU/Linux.
had to sit there while my parents were having to learn how to use arch to fix the issue
lmao thats not really bloat because macos is heavily optimized
macos users would die to protect their glorious os
my point is that i have access to all tools i would have on linux without dated ui
dated ui != linux
you dont have access to steam
you could make a linux distro look exactly like macos
and WSL doesnt count WSL is slop
yes, i do
no you dont
as somebody who uses linux i must confess a lot of apps do look outdated
macos has its own version of wine like proton called crossover
i can run most windows games perfectly fine
you can play sims 2 and crab game
and i dont even play games that often
isnt crossover paid ๐ญ
not if youre good with computers
i think wine is for macos anyway
hmmmmmmm
i mean it works on macos
also crossover works on linux
i like linux because i can pretend my old hardware still works fine
yeah but usually people use proton on linux
but seriously
i was disappointed that my mac (before it broke anyway) would stop getting security updates pretty soon
ok wait i can actually phrase it perfectly
and even being something several years old to be fair it still worked fine for me
i would probably have ended up putting linux on my mac
macos allows me to have an operating system with all the tools i need to be productive without needing to spend 90% of my time configuring it to look nice
this is how i feel on some desktop environments to be fair
i just use gnome where there aren't that many settings and i don't feel confused
again, you dont need to speed 90% of your time configuring if you just choose the right distro
and it honestly feels quite a lot like macos
in a good way
(to me)
(i understand why people don't like it)
you use templeos
wrong
true
elleos
idk macos is like the perfect trade off for me
rosie isnt allowed tob ehappy
- looks nice out of the box
- unix based, aka clang, binutils, git, ld, ar, as etc everything i need works without needing to use an emulated environment (wtf is git-shell when i first heard of that i genuinely wanted to just completely shut down that windows pc) ((i know on linux you have this too))
- fast because (at least mine) runs on arm
@valid jetty has no arms
no bc genuinely wtf is git shell
this is what computer scientists have been asking for your attention for all this time
you cant run git on windows because its windows
you need a dedicated shell specifically to run git
well ya can run it on linux
or use wsl but whatever
idk
horror
i wanted to install elle on a school pc because i was genuinely curious to see how fast it was
worst mistake of my life
i spent ~4 hours and didnt even get rust installed
the pricing of apple products follows no sense
ok yeah thats reasonable
wdym +$200 for each bump in storage
im not paying +$800 for 1tb of storage instead of 256gb when i can buy a 1tb ssd for $120
and many developers would rather go for something which is both cheaper and gives them more freedom even if in all of the options there are of course going to be some disadvantages compared to macos
Provided file is too long.
yeah ofc
Provided file is too long.
i had to reinstall
ive had this macbook for about 3 years by now? it has really been worth it i think
index.html: Lines 30-36
<div class="panel">
<h2><h3>Main</h3></h2>
<!-- due to mainly ratelimit reasons images for now are grabbed from ez.gg ~ https://e-z.gg/ -->
<!-- these are to be switched to nest.rip ~ https://nest.rip/ or PixelVault ~ https://pixelvault.co/ in the near future -->
<!-- also if friend host their own image that can be used... avif, and webp for images... gif, apng for anything animated is preferred -->
i thnk i spent about ยฃ800 on it because i got a student deal
i think its closing up on 4 years actually
windows is weird
easy to screw your os up but it's really hard to customise some things
@valid jetty hii
like getting rid of edge
you can't
in the process of trying i destroyed my install
pov i try to update only a few libs on arch instead of pacman -Syu
why wouldnt you use pacman
at least linux is customisable without it feeling like a battle against the os
the registry editor is so cursed
@deep mulch @deep mulch elle runtime
programs went from taking 800ms to taking 14ms to compile
just by making something so agressive, it makes me not even consider using it
i use arc atm but only because ive been conditioned
i will switch to firefox at some point
in macos it is enough for me to just unpin it from the dock
on windows i feel the need to remove it
i unpinned everything i dont use
why is spotify pink
i had a weird thing on firefox where the icons stay black in dark mode
well ,some of them
but then i saw on windows the icons are hidden
it is weird...
weird
perhaps it is picking up some systemwide preference
i kind of like the dock because it holds a lot and gets smaller instead of having multiple pages
and then when you hover it zooms
i mean is there really any reason to keep it small
zoot is evil
@valid jetty@valid jetty
it will always take the same amount of vertical space right
and i do not auto hide
(is this weird)
i auto hide because it gets in the way sometimes
i never liked autohide
i prefer how the linux/bsd gnome desktop does things where you use the activities button or a hot corner to show it
although i suppose it is a longer trip for your mouse
but it also shows an expose like view which is pretty nice anyway because you can see all windows previewed
i mean mission control
whatever it's called
mission control is nice but i havent found myself using it recently
@valid jetty hiii
nono macos has mission control too
(failed)
gnome is like macos ui but more unified
the search (similar to spotlight) and dock (well i think it's technically called dash) and applications is all in this mission control like thing
then again macos allows you to see what you're doing at the same time as searching which is better
yea close enough
how do you keep your hands from sweating when playing
doesnt it make it harder to play
rosie has no sweat glands
damn
oh btw for as long as the combo is rainbow thats considered "all perfect"
i think i held it until about 700 combo or something
sort of like no 100s in osu!
lol and this is essentially launchpad but with far too many apps
not my fault i totally did not install too many apps
@ornate quiver remove your sweat glands so you dont sweat
how
i will do

i have to wipe down my tablet/pen with alcohol every so often cause my hands always become covered in cold sweat when i play for a while
@hoary sluice this looks so much more bloated than macos
horror
i installed a billion things
@hoary sluice
i hate this too
why can't it just implicitly convert
0L :)
wait it's real
what the hell
is this not the opposite of kotlin philosophy
it's like a less explicit java
still annoying when comparing variables
yeah kotlin sucks in terms of type conversions
in elle the type system is pretty out of your way
isn't it meant to make you write less
it kinda is yeah
most critisisms of kotlin are about how implicit everything is
including some of mine
this may be slightly too cursed but oh well
use std/io;
fn main() {
$assert('a' == "a", nil); // Will use 'a' == "a"[0]
$assert("a" != 'b', nil); // Will use "a"[0] == 'b'
$assert("a" == 'a', nil); // Will use "a"[0] == 'a'
$assert('a' == "abc", nil); // Will use 'a' == "abc"[0]
io::println("All string to character tests have passed!".color("green").reset());
}
i legitimately did
i had a dream where i wrote kotlin and enjoyed the task of doing so
@deep mulch we should make a KEEP proposal to implicitly allow int and long comparisons
i have no idea where this idea that programming kotlin could possibly be fun came from
0.toLong() โค๏ธ
probably from the propaganda from people like wing
because most of the time it is fun
the fun keyword
okay
except when you stumble into a stupid design choice aftet a while
wait i mentioned this twice lol
still no ternary
soon
arent ifs exprs in kt tho
yes but there's no good way to format them
it becomes super ugly
and verbose
if x { y } else { z }
elle x ? y : z
js x ? y : z
c x ? y : z
java x ? y : z
ruby x ? y : z
dart x ? y : z
c# x ? y : z
ballerina x ? y : z
zig if (x) then y else z
haskell if x then a else b
go ```go
var res int
if x {
res = y
} else {
res = z
}
rust `if x { y } else { z }`
py `y if x else z`
lua `if x then y else z end`
from memory
i bet you impress a lot of people at parties
wha
hey thats mean
vencord party 
i thought that was sarcastic
it was
you wouldn't impress a lot of people
but you would impress the people worth getting to know
I HATE GO
all programmers are femboys or trans or bearded men or are only doing it for the money 
which one are you
@valid jetty hiii
distrotube so insane
a lot of people in the linux community hate that channel
i agree
yes
lol
@ornate quiver alibabacord
aliexpresscord
i love discord detecting jadx gui as Minecraft
how
oh that reminds me I need to fix my pkgbuild
bc they are both just ran as jars
and discord just matches exe name for most game detection
why minecraf
Minecraft doesn't have any discord integration so its all discord has
wing will quit leaving programs open
yes because i was working on gloom yesterday as well
you will close when finished
and jadx takes a million years to initialize
@frosty obsidian whats your system uptime
i have bots running 24/7
@deep mulch i moved my markdown stuff to the assets folder
the template is now loaded from a file
so i can now start adding styles
We call them apps now
get a good CA certificate
it worked months ago
git?
yes
tbh just use ur ssh key to sign its soo much easier
error: gpg failed to sign the data:
[GNUPG:] KEY_CONSIDERED 00C1FDCE0485B1DE248401FCB05EB0663B06A5F9 2
[GNUPG:] BEGIN_SIGNING H10
[GNUPG:] PINENTRY_LAUNCHED 3
gpg: signing failed: Bad CA certificate
[GNUPG:] FAILURE sign 83886180
gpg: signing failed: Bad CA certificate
a
ughhhhh of course searching for gpg: signing failed: Bad CA certificate has nothing useful
??
pinentry was the issue??
i did a thing
you can do this [i32;] now as shorthand for Array::new<i32>()
and you can also obviously do [f32; 1, 2, 3]
wha
use std/prelude;
fn count_maximum<T>(T[] nums) {
let pos = T neg;
for num in nums {
if num < 0 { neg += 1; }
if num < 0 { pos += 1; }
}
return math::max(pos, neg);
}
fn main() {
$dbg(count_maximum([f32; -2, -1, 0, 0, 1]));
}
``` is this cursed
gn
thats a lot of lines
14190 are rust
5642 are elle
the other 1753 are like misc things
sql
what even is that
guhhhh how do i cast a void pointer to a funciton that returns an int in c
who the fuck came up with this notation
(int (*)())
which is why i dont use gnome
(not actually why, kde just has a lot more features)
htis is corrcet
why is manager not en enum
this made me spent 2 hours on 2019 day 19
@hoary sluice my monitor has a DP mode
iโm gonna win 2025
oh also apparently if i enter the BIC (british informatics olympiad) at my school and do well i can get into IOI and WEOI @hoary sluice
idk if iโm gonna attend because iโve been sleeping like nothing and the event is monday next week so iโm gonna be super tired
but itโs still a possibility maybe
"sqlite is the database system for phones" wtf is this shit ๐ญ
enter it
oh shit i cant do ioi anymore
i wont be in school next event
well im eligible but qual ended 3 days ago in austria
but so tired :C
it's kind of accurate
sqlite dbs are littered all across android
if you need anything more than a basic config then sqlite is #1 option
java bindings literally included in android api
lightweight, portable, reliable, self contained
sqlite is great for a lot of things really
Yea but i mean, they specifically said its for phones. It has much more us cases and not android apps only
oh yeah
E.g. mc plugins
u have a good chance of winning ioi global
5 hours for bfs
i installed many things ๐ญ
Wow
I'm finally at home
Elledocs when
@valid jetty @placid cape send ur zed config ๐ฅบ
sure
a collection of my configs, themes and other stuff - xhyrom/dotfiles
@hoary sluice
ty
GUHHHHHH why can't I infer a returned assertion in typescript
dejavu mono looks boring af
maple mono >>>
i just have firacode everywhere
i use noto sans in terminal
blurred bg
why is it black
because espresso is black
theres catppuccin espresso??
catpuccin blur extension adds it
wtf
why is it green
one of these not sure
its the one you have installed...
yeah i didnt see that XD
yeah the one made by jens
looks like my infix function parser works
uhh idk
i didnt learn all the shortcuts yet
i have also nvim configuration because i used nvim before
you dont need to know all the shortcuts to use it
with lsp etc
i found out about zz today after using vim for like 2 years
"vim_mode": true,
i dont really like it sorry
your background is too bright
/ not enough blur
idk
i prefer mine
but the mocha one does look similar
i just dislike the catpuccin color scheme for the actual code a little
i like pinks and purples
yeah it does that when you take a screenshot of a window
this looks nice
maybe
oh this looks nice
i wonder how much more popular zed is gonna be on the aoc 2025 survey
and on the stackoverflow survey
it wasnt even in the chart last year https://survey.stackoverflow.co/2024/technology#most-popular-technologies-new-collab-tools
this hurts my eyes
why is the 2 written in primary school teacher font

I'll start using real vim again when treesitter doesn't spit 20 errors a second
WDYM
typescript โค๏ธ
type AssertedType<T extends Function> = T extends (a: any) => a is infer R ? R : never;
export function findParrent<F extends Function, T extends Node = AssertedType<F> extends Node ? AssertedType<F> : never>(
node: Node,
func: F extends (node: Node) => node is T ? F : never
): T | undefined {
while (!func(node)) {
if (!node.parent) return undefined;
node = node.parent;
}
return node;
}
get this out of my eyes please
yeah ๐ญ
i made a parser!!
yay
i wanted to write a glr parser generator but i couldnt find any good resources other than a paper on elkhound
what is glr?
nice
but i would name tokens as symbols
so i dont have Token#Times/Multiply but Token#Asterisk
A GLR parser (generalized left-to-right rightmost derivation parser) is an extension of an LR parser algorithm to handle non-deterministic and ambiguous grammars. The theoretical foundation was provided in a 1974 paper by Bernard Lang (along with other general context-free parsers such as GLL). It describes a systematic way to produce such algor...
tree sitter uses this
oh cool
@hoary sluice i made it backwards compatable with the old signature
type IsNever<T> = [T] extends [never] ? true : false;
type AssertedType<T extends Function, E = any> = T extends (
a: any
) => a is infer R
? R extends E
? R
: never
: never;
export function findParrent<
T extends Node = never,
F extends Function = never,
R extends Node = AssertedType<F, Node>,
>(
node: Node,
func: IsNever<T> extends true
? F extends (a: Node) => a is IsNever<T> extends true ? R : T
? F
: never
: (a: any) => a is IsNever<T> extends true ? R : T
): IsNever<T> extends true ? R | undefined : T | undefined {
while (!func(node)) {
if (!node.parent) return undefined;
node = node.parent;
}
return node;
}
fuck you
whats wrong with it 
its ts
i love type metaprogramming
please no
ive spent hours doing this 
https://github.com/type-challenges/type-challenges
ts is just not a superset with added typing ๐ญ
and enums, namespaces and decorators iirc
im proud of my creation https://github.com/type-challenges/type-challenges/issues/30594
why do you define own uppercaseaz?
cant you use Capitalize
or you dont want any "builtins"
i did this ages ago
oh
not insane, but i liked doing this one
type GetOptional<T> = {
[K in keyof T as {} extends Pick<T, K> ? K : never]: T[K]
}

transmute actually just works directly
i didnt consider this
for the reccord that is valid
because of endianness thats actually in the form AABBGGRR tho
gotta love endianness
i am so desperate i have started applying to javascript jobs
yooo i added strings!!
you love typescript
are you making a language too omg
im waiting for the part where everything becomes a big mess and starts falling apart
why so verbose
because i love verbose
VariableDeclarationExpression
when you have to do operator precedence parsing
for binary operations
i mean currently it seems to work
but im 100% sure theres some bug in this
type uint32_t = bit[32];
is wild
@valid jetty do you have a separate function for each operator
i foun a really cool approach
wdym
how do u do precedence parsirg
statement.rs: Lines 661-710
fn parse_arithmetic(&mut self) -> AstNode {
let position = self.find_lowest_precedence();
let operator = self.tokens[position].clone().kind;
let tokens = self.tokens.clone();
let left =
tokens[self.position..=if position > 0 { position - 1 } else { position }].to_vec();
let mut raw_right = tokens[position..=tokens.len() - 1].to_vec();
raw_right.remove(0); // Get rid of the operator
let right_end_index = if let Some(index) = raw_right
.iter()
.position(|token| token.kind == TokenKind::Semicolon || token.kind.is_ternary_start())
{
if raw_right[index].kind.is_ternary_start() {
index
} else {
index + 1
}
} else {
raw_right.len()
};
// Separate the right-hand side expression up to a semicolon
let right = raw_right[..right_end_index].to_vec();
// Shift the position across the size of the expression
self.position += left.len() + right_end_index;
let node = AstNode::BinaryOperation {
left: Box::new(Statement::new(left, 0, &self.body, self.shared).parse().0),
right: Box::new(Statement::new(right, 0, &self.body, self.shared).parse().0),
operator,
treat_as_string: true,
dunder_methods: true,
location: self.current_token().location,
};
if self
.next_token()
.is_some_and(|token| token.kind.is_ternary_start())
{
self.advance();
self.parse_ternary_node(node)
} else {
node
}
}
parser.rs: Lines 201-237
fn parse_binary_with_precedence(&mut self, precedence: Precedence) -> Result<Expression> {
let mut left = self.parse_unary()?;
while !self.is_eof() {
let current_token = if let Some(c) = self.current() {
c
} else {
break;
};
let current_precedence = Precedence::from(current_token.kind);
if current_precedence <= precedence {
break;
}
if !try_consume_any!(
*self,
TokenKind::Ampersand,
TokenKind::Caret,
TokenKind::Pipe,
TokenKind::Plus,
TokenKind::Minus,
TokenKind::Star,
TokenKind::Slash,
TokenKind::Percent,
TokenKind::Equal,
TokenKind::EqualEqual,
TokenKind::Less,
TokenKind::LessEqual,
TokenKind::Greater,
TokenKind::GreaterEqual,
TokenKind::At,
TokenKind::Colon,
TokenKind::Hash
) {
break;
}
let operator = self.previous().ok_or(ErrorKind::UnexpectedEndOfFile)?;
i fucked it up
parser.rs: Lines 201-247
fn parse_binary_with_precedence(&mut self, precedence: Precedence) -> Result<Expression> {
let mut left = self.parse_unary()?;
while !self.is_eof() {
let current_token = if let Some(c) = self.current() {
c
} else {
break;
};
let current_precedence = Precedence::from(current_token.kind);
if current_precedence <= precedence {
break;
}
if !try_consume_any!(
*self,
TokenKind::Ampersand,
TokenKind::Caret,
TokenKind::Pipe,
TokenKind::Plus,
TokenKind::Minus,
TokenKind::Star,
TokenKind::Slash,
TokenKind::Percent,
TokenKind::Equal,
TokenKind::EqualEqual,
TokenKind::Less,
TokenKind::LessEqual,
TokenKind::Greater,
TokenKind::GreaterEqual,
TokenKind::At,
TokenKind::Colon,
TokenKind::Hash
) {
break;
}
let operator = self.previous().ok_or(ErrorKind::UnexpectedEndOfFile)?;
let right = self.parse_binary_with_precedence(current_precedence)?;
left = Expression::Binary {
lhs: Box::new(left),
operator,
rhs: Box::new(right),
};
}
Ok(left)
}
mine works in a slightly convoluted way i think
mine is so clean i love it
is there a better way to write ```rs
let current_token = if let Some(c) = self.current() {
c
} else {
break;
};
theres probably a macro for this
i basically have this stream like
| 1 | + | 2 | * | 3 | + | 4 | / | 5 |
i basically traverse this stream and find the index and precedence of the lowest precedence arithmetic operator in the list
if there are more than 1 of the same operator then the last one will be chosen (to allow left->right evaluation)
then i take the operator at that index, and i split the stream into 2 at that index and call the function on that again to find the lowest precedence and parse that
so the thing above would be parsing
left: | 1 | + | 2 | * | 3 |
right: | 4 | / | 5 |
operator: +
now the left hand side also has multiple ops so that one finds the lowest one, +:
left: | 1 |
right: | 2 | * | 3 |
operator: +
and the right hand side is just a single arithmetic expr:
left: | 4 |
right: | 5 |
operator: /
i dont know if this algorithm has a name but i came up with it myself
let Some(current_token) = self.current() else {
break;
};
yeah that syntax is so good
thats kinda similar to what i do
if i see a token that has lower precedence than the current precedence (initially none, and is set to the precedence of the last parsed op) then i return the expr immediately, otherwise i parse the operator and call myself with the last precedence
oh and i also break if the next token isnt an operator
[object Object]
i think my actions finally have consequences
i had a free period earlier for an hour and i fell asleep while waiting
if i didnt predict that i would fall asleep then i wouldnt have set a timer and i wouldve missed my lesson
i think i got somewhere around 2 hours of sleep last night so
fun
guh?
parser.go: Lines 119-147
func (p *Parser) parseExpressionWithPrecedence(precedence tokens.Precedence) (ast.Expression, error) {
left, err := p.ParsePrimaryExpression()
if err != nil {
return nil, err
}
for !p.IsEof() && precedence < p.Current().Kind.Precedence() {
op := p.Current()
if op.Kind == tokens.Identifier {
break
}
p.Consume()
right, err := p.parseExpressionWithPrecedence(op.Kind.Precedence())
if err != nil {
return nil, err
}
left = &ast.BinaryExpression{
Left: left,
Operator: op.Kind,
Right: right,
Loc: right.Location(),
OperatorLoc: op.Location,
}
}
return left, nil
}
@hoary sluice managed to shrink it down to this 
a bit more sane
export function findParrent<
T extends Node = never,
F extends Function = IsNever<T> extends false ? (n: Node) => n is T : Function,
R extends Node = IsNever<T> extends false ? T : AssertedType<F, Node>,
>(
node: Node,
func: F extends (n: Node) => n is R ? F : never
): R | undefined {
while (!func(node)) {
if (!node.parent) return undefined;
node = node.parent;
}
return node;
}
it could be really simple if i wasnt too lazy to change all the uses
and it could be even simpler if i casted
i think i might write a deque
shouldnt be that hard
but after that im genuinely lost on what to implement next
write also heap
true
because in python you have deque() and then for heap you need to import heappop heappush
yeah
its weird
eah
yeah*
i really want to do enums
what else would i need to do hm
but first structs, then lambdas and then maybe that
just look at different languages
or try to build some real project
and you'll find out quickly
traits?
for structs
true
i think you wanted traits
maybe ill limit traits to a dunder function only
then work on elle in elle
so like you should be able to do
fn foo<T: add>(T x) {
}
and im sure youll find out whats missing
and if there doesnt exist a T::__add__ method then itll crash
yeah thats amazing
maybe its also time to take a break from elle and focus on the huge list of past due physics assignments
because now you can do
fn foo<T>(T a, T b) { return a + b }
even if you cant use + on them right?
maybe compiler will catch it
finally school โจ xdd
- should compile to binop for primitives and
T::__and__(a, b)for non primitives
yeah that might be fun
elle in the browser or something
i would need to polyfill everything tho
i can almost compile identically to JS
with some very subtle differences
oh yea
you can maybe try wasm backend
wait
qbe has none
i know but
i could write my own

