#๐Ÿช…-progaming

1 messages ยท Page 35 of 1

placid cape
#

you can write recipe for some food

#

if it's long, our teacher doesn't read it and just gives 1

valid jetty
#

we had to learn 15 poems for english literature and also 3 stories (an inspector calls, a christmas carol, and macbeth)

dense sand
#

Crazy

valid jetty
#

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

dense sand
#

Ill become a goose farmer i guess

placid cape
#

Real I hate literature so much

still jolt
#

Macbeth is quite fun actually

valid jetty
#

somehow i got 8/9 for lit ๐Ÿ˜ญ i literally have no idea how at all

placid cape
#

I'm learning about shakespear right now

valid jetty
#

it shouldve been a 6

winged mantle
#

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 blobcatcozy

valid jetty
#

look at for example this year's problems

winged mantle
#

i mean i do not know any sorting algorithms lol

valid jetty
#

they had a good range i think

winged mantle
#

well until i watched a youtube video that was far too fast to follow properly

spark tiger
winged mantle
#

and i understood what bubble sort is

#

but i also would be lost when implementing a hashmap

placid cape
valid jetty
winged mantle
#

and have wanted to learn how to do it for ages

#

isn't geeksforgeeks the site which plagiarises stuff and is not very good

valid jetty
spark tiger
valid jetty
#

but its still useful

winged mantle
#

๐Ÿ˜ญ

valid jetty
placid cape
valid jetty
#

one is (imo) easier than the other

#

i can explain both if youre willing to listen to me yap for a few mins

placid cape
#

You can look into papers how to do the hashing etc

winged mantle
#

i wish i had kept going to school after the age of 13 lol

placid cape
#

and you might not be able to do it on your own for first few times, but then, you'll be able

winged mantle
#

seems school tm teaches useful programming stuff

#

(that single school that everyone goes to)

placid cape
spark tiger
#

we've been learning python for five years but i feel like after first year we didn't learn anything new lol

placid cape
#

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

winged mantle
#

lol i remember something about bios

#

which i forgot

placid cape
#

that's why I'm so happy that I started programming like 6 years ago

winged mantle
#

i just kinda know bios exists and was replaced by uefi

placid cape
#

when I was 10

winged mantle
#

i started when i was 8 i think?

placid cape
#

wow nice

winged mantle
#

i did jquery

#

i thought jquery was a programming language

placid cape
#

my first was something php

winged mantle
#

wait

placid cape
#

I also remember c# calculator... probably when I was younger? not sure, maybe at 9

winged mantle
#

isn't 18 - 8 = 10

#

maths

placid cape
#

it is

winged mantle
#

cool

placid cape
#

im 16 rn

winged mantle
#

young

#

i never talk to anybody 2 years younger than me

spark tiger
placid cape
#

i always talked to people that are older than me

winged mantle
#

stop talking to me

#

nope,. none of this happened

placid cape
#

sorry :(

winged mantle
#

lol was joking

placid cape
#

okay xd

#

do you know nexpid?

winged mantle
#

uh they did loads of vendetta stuff?

placid cape
#

i think yea

#

he's a really nice guy i know him for a loooong time

valid jetty
#

@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)

winged mantle
#

ai

valid jetty
#

no i wrote this by hand

winged mantle
#

fake

placid cape
#

ill save it for blom std :D

winged mantle
#

:o ok thanks interesting

#

linked lists are generally bad

valid jetty
#

they are but the linked list hashmap is way easier to implement

placid cape
#

linked lists dont exist

winged mantle
#

the problem is

#

how do you know when your algorithm actually works

valid jetty
winged mantle
#

it's a pain to test

placid cape
winged mantle
#

this is why i like stdlib :)

placid cape
#

she's amazing xddd

placid cape
#

delete all your tests

#

.

winged mantle
#

oh that's another thing i need to do

#

unit tests

placid cape
#

watch the video

#

this one

valid jetty
# winged mantle how do you know when your algorithm actually works

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());

}

winged mantle
#

i have never written a unit test lol

#

but it['s a pretty siumple concept right?

valid jetty
#

yeah

#

the thing i just sent is pretty much a unit test

winged mantle
#

you just compare the result of something to what it should be\

valid jetty
#

yeah

winged mantle
#

i don't think this is enough

placid cape
#

i should add support for module importing and write simple test lib too

winged mantle
#

i would not trust this hashmap as a database

#

(and hashmaps are the best database blobcatcozy)

valid jetty
#

if you implement it with a linked list theres not much reason not to trust it

#

its pretty intuitive

winged mantle
#

i test my software manually

#

which is fun

#

(not)

#

(good luck trying to stop regressions)

valid jetty
#
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
placid cape
#

why ๐Ÿ˜ญ

winged mantle
#

__internal_u_will_be_fire

valid jetty
#

because this thing is purely an internal symbol i never want this to collide with any other module ever

winged mantle
#

i wish there was a thing where you could learn things

placid cape
#

std should be also readable

valid jetty
#

yeah this is the GC

winged mantle
valid jetty
placid cape
#

oh okay

winged mantle
#

how do you build a fast language without unsafe rust

#

i will not star this just to make you feel sad

valid jetty
#

it lacks optimizations

winged mantle
#

it might be for fun now

#

but in future you know nasa will be using it

placid cape
#

im gonna sleep good night guys

valid jetty
#

lmao i wish

#

gnnnnn

winged mantle
#

i bet nasa uses javascript

valid jetty
#

maybe at some point ill rewrite the compiler in llvm instead of qbe

placid cape
#

and tomorrow ill finally work on blom again

placid cape
valid jetty
#

qbe is now more of an annoyance instead of helpful because the compiler has gotten so advanced

placid cape
#

just create same enums for llvm instead qbe

winged mantle
#

i just realised

placid cape
#

i know its not that easy, but will help

winged mantle
#

i don't need to learn anything

valid jetty
winged mantle
#

i can use chatgpt

valid jetty
#

llvm has concrete explicit types unlike qbe

placid cape
valid jetty
#

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

winged mantle
#

how delisional - i could not possibly get a job by the time i have learnt enough - chatgpt will have already taken all of them!

valid jetty
#

it would have to be completely from scratch

placid cape
#

if you use AI to stop thinking thats really bad

valid jetty
#

wait hyroo did you end up implementing structs

winged mantle
#

what can i say to make the sarcasm obvious

placid cape
winged mantle
#

i know

#

hawaiian pizza is good

placid cape
#

tomorrow i want to finish infix functions and work on structs

valid jetty
#

will you make a->b for (*a).b

winged mantle
#

wait

#

is everyone else making a programming language

placid cape
winged mantle
#

imposter syndrome

#

even though i don't actually have a job

valid jetty
winged mantle
#

(they will lock me up)

ornate quiver
#

fraud

valid jetty
winged mantle
#

try getting expelled!

winged mantle
#

(not that that's what i did that is a secret)

ornate quiver
#

i was gonna ask what for ๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿ˜ญ

#

what the hell

placid cape
#

nvm gonna sleep ill think about that tomorrow :D

winged mantle
#

aren't you too old to be going to school

#

i mean at least primary/secondary/elementary/high school

ornate quiver
#

who

winged mantle
#

You

ornate quiver
#

im 17
legally enrolled in high school but i attend college instead through a free state program

winged mantle
#

you're younger than me?

#

all this time?

ornate quiver
#

lmaooooooo

#

how old are you

winged mantle
#

but you're so mature

#

secret you will steal my age

ornate quiver
#

explode

valid jetty
#

gimme some of ur age >,< i wanna leave this country already

ornate quiver
winged mantle
#

what??

#

i thought everyone was older

valid jetty
#

im 16 lol

winged mantle
#

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

valid jetty
#

the rusher curse

#

@ornate quiver you are 23 tomorrow

ornate quiver
#

NOP

#

rosie is a 60 year old man

valid jetty
winged mantle
#

ok

#

i should do big boy things

valid jetty
#

this thing

winged mantle
#

like develop gcc

valid jetty
#

lmfao yeah totally

winged mantle
#

(again)

valid jetty
#

i could never read the slop that is gnu code

winged mantle
#

i wanted to make a linux file manager for a little bit of learning

ornate quiver
#

so dark

winged mantle
#

idk how to make things not look ugly though (this is figma)

#

(it's even harder to make not ugly code)

valid jetty
valid jetty
#

put more padding

#

everything is so close together

#

let it breathe

winged mantle
#

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

valid jetty
#

yeah but imo thats not enough padding still

#

it feels cluttered

winged mantle
#

linux users love clutter

valid jetty
#

look at how close this icon is to the edges

winged mantle
#

i think it is too flat personally

valid jetty
#

that too but you can fix it with more sections if those sections have different colors and layouts

winged mantle
#

but idk how to make something have a bit of gradients shadows etc. without looking dated

valid jetty
#

lc.define skeuomorphism

visual shellBOT
valid jetty
#

ugh

winged mantle
#

i kinda like the default qt theme

#

but other people do not

valid jetty
#

lc.define glassmorphism

visual shellBOT
valid jetty
#

whatever

winged mantle
#

and the buttons are too small so it's mediocre accessibility

frosty obsidian
#

i would start by standardizing your spacing rules

winged mantle
#

tbf i was making a quick mockup

#

and wondering why it doesn't look very good

frosty obsidian
#

yeah ik this is just the exact stage to do that

winged mantle
#

but for it to look good it needs to be a slow mockup most likely

frosty obsidian
#

its interesting that you aren't using any premade component library

winged mantle
#

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

frosty obsidian
#

its just way easier

winged mantle
#

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

frosty obsidian
#

i would still go and look at the design docs for other design systems

valid jetty
#

i made this a few years ago for a school project

#

its not very good but whatever

frosty obsidian
#

they'll typically have spacing guides and whatnot

#

and could give you inspiration

winged mantle
#

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

frosty obsidian
#

colors are always gonna be similar tbh

#

theres only so many that work in ui contexts

winged mantle
#

but i would like a bit of older style buttons with actual texture

#

without it looking that old

valid jetty
#

#171717 >>>>>>>>>>>>>>>

#

vcozy #171717

elder yarrowBOT
valid jetty
#

best dark mode shade

winged mantle
#

e.g. elementary os looks very modern but the buttons look way better than generic modern buttons imo

#

(aka single colour)

frosty obsidian
#

subtle gradient and a drop shadow is typically enough

#

selfbot moment

winged mantle
#

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

valid jetty
#

for context thats not a selfbt

hoary sluice
#

rust ๐Ÿฅฐ

valid jetty
#

:3

hoary sluice
#

for now

winged mantle
#

lol i was about to clear reactions

hoary sluice
winged mantle
#

imagine not being admin

frosty obsidian
#

wtf is that account +1 reacting everything

valid jetty
#

i love shift click in reaction picker to react without exiting dont ban me

winged mantle
#

vmute exoodev 24h explode

frosty obsidian
#

v+ brain rot @formal belfry

winged mantle
#

wait this is rosie

valid jetty
#

exoodev is not me

#

no idea who that is

frosty obsidian
#

thats the person i was referring to

winged mantle
#

rosie selfbot...,

formal belfry
#

I just reacted

winged mantle
#

file manager i usually use

frosty obsidian
winged mantle
#

๐Ÿ›’

winged mantle
#

so they used css

#

probably

#

hopefully....

frosty obsidian
#

oh you can abuse box-shadow to create multiple borders

winged mantle
#

idk if you speak linux

valid jetty
winged mantle
#

@frosty obsidian sudo dnf history undo 131

frosty obsidian
#

i do not speak fluent linux

#

only conversational

winged mantle
#

i mean why do the labels not align properly

frosty obsidian
#

yeah that looks less pretty than i remember

winged mantle
#

i guess the blur is removed for privacy

#

imagine if png allowed blur effect ...

frosty obsidian
#

no i think its just the button labels in the header

winged mantle
#

why did somebody turn finder into chrome

frosty obsidian
#

old chrome ui

#

guh

winged mantle
#

war crime

#

that is just wrong on so many lev els...

#

don't combine ui designs

hoary sluice
winged mantle
#

so linux

#

oh yes

#

this is my thursday file manager

hoary sluice
#

the kde one, another random one and firefox is a special boy

winged mantle
#

this is my saturday file manager

#

friday file manager?

#

friday was made by microsoft for advertising purposes

hoary sluice
#

depenes on what app opens it

frosty obsidian
#

i don't like the square folder icons tbh

winged mantle
#

true

#

why have a web browser and file browser

#

just have one browser for all

frosty obsidian
winged mantle
#

kde used to do this

#

konquerer

hoary sluice
#

my file managers are dolplin, nemo, nautilus, firefox, ls, zed, nvimtree

#

and intellij

frosty obsidian
#

internet explorer and file explorer

winged mantle
#

i have thunar and nautilus i think

frosty obsidian
#

used to have pretty much the same ui

winged mantle
#

nvm and thunar

#

look i gotta do research

#

why do think i have so many vms

valid jetty
winged mantle
#

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

valid jetty
#

whats wrong with blur i love it

winged mantle
#

it's too blurry

#

too distracting

#

at least windows 7 and vista only applied it to titlebars

deep mulch
#

the kode tode

winged mantle
#

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

valid jetty
#

@deep mulch unhusk

hoary sluice
#

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

deep mulch
winged mantle
#

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

hoary sluice
valid jetty
#

i have

hoary sluice
valid jetty
#

but i dont bother to make it look that nice

deep mulch
#

@valid jetty hiiii

winged mantle
#

install steam

hoary sluice
#

we once had like 2 hours to create a file in midnight commander

winged mantle
#

play

#

play gaem

#

relaex

#

aeh

hoary sluice
#

now its just learn economics and low pass filter formulas every day for a year

#

vhdl too

deep mulch
#

@hoary sluice ๐Ÿฆ…ly

winged mantle
#

legal eagel

hoary sluice
#

gn

valid jetty
hoary sluice
winged mantle
#

i'm going to have to put apple users dni โš ๏ธ in my bio

#

apple users dni

#

sonic/touhou fans dni

valid jetty
#

macos is literally linux but with actually nice design choices

hoary sluice
#

no

deep mulch
#

linux is a kernel

valid jetty
#

you get the same benefits as linux because its unix based

hoary sluice
#

it is not

winged mantle
#

linux is a kernel is a great excuse which i should use more often

deep mulch
#

rosie probably thinks of ubuntu when thinking of linux

hoary sluice
#

macos is the bloat of windows and the shell of linux

deep mulch
#

yop

#

@hoary sluice sleep

valid jetty
#

or void

hoary sluice
winged mantle
#

macos is pretty good but the grass is always greener until you eat it (??) or something (???)

valid jetty
deep mulch
#

rosie never tried arch

winged mantle
#

i tried arch

valid jetty
#

name one way in which macos is more bloated than a linux distro

winged mantle
#

regular system freezes

#

also

#

i actually installed it on a brain chip so it also made my brain freeze

hoary sluice
hoary sluice
# valid jetty no i think or alpine or arch

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.

winged mantle
#

had to sit there while my parents were having to learn how to use arch to fix the issue

valid jetty
deep mulch
#

macos users would die to protect their glorious os

valid jetty
#

my point is that i have access to all tools i would have on linux without dated ui

hoary sluice
deep mulch
#

you could make a linux distro look exactly like macos

valid jetty
#

and WSL doesnt count WSL is slop

valid jetty
hoary sluice
#

no you dont

winged mantle
#

as somebody who uses linux i must confess a lot of apps do look outdated

valid jetty
#

macos has its own version of wine like proton called crossover

#

i can run most windows games perfectly fine

hoary sluice
#

you can play sims 2 and crab game

valid jetty
#

and i dont even play games that often

hoary sluice
#

isnt crossover paid ๐Ÿ˜ญ

valid jetty
#

not if youre good with computers

deep mulch
#

unsurprising its paid

#

given the target audience

winged mantle
#

i think wine is for macos anyway

valid jetty
#

hmmmmmmm

winged mantle
#

i mean it works on macos

#

also crossover works on linux

#

i like linux because i can pretend my old hardware still works fine

valid jetty
#

yeah but usually people use proton on linux

winged mantle
#

but seriously

#

i was disappointed that my mac (before it broke anyway) would stop getting security updates pretty soon

valid jetty
#

ok wait i can actually phrase it perfectly

winged mantle
#

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

valid jetty
#

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

winged mantle
#

i just use gnome where there aren't that many settings and i don't feel confused

deep mulch
#

again, you dont need to speed 90% of your time configuring if you just choose the right distro

winged mantle
#

and it honestly feels quite a lot like macos

#

in a good way

#

(to me)

#

(i understand why people don't like it)

deep mulch
#

wrong

winged mantle
#

true

deep mulch
#

elleos

winged mantle
#

use the right distro!

#

the right distro is the one i use

valid jetty
#

idk macos is like the perfect trade off for me

winged mantle
#

and none of the others

#

yes use what makes you happy

deep mulch
#

rosie isnt allowed tob ehappy

winged mantle
#

windows xp makes me happy

#

but don't worry

#

i only use it for ssh and banking

valid jetty
#
  • 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
deep mulch
#

@valid jetty has no arms

valid jetty
#

no bc genuinely wtf is git shell

winged mantle
#

what is git-shell

#

i have never used git-shell

valid jetty
#

this is what computer scientists have been asking for your attention for all this time

valid jetty
#

you need a dedicated shell specifically to run git

winged mantle
#

well ya can run it on linux

valid jetty
#

or use wsl but whatever

winged mantle
#

:P

#

waiting for lsw

deep mulch
valid jetty
#

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

winged mantle
#

the pricing of apple products follows no sense

valid jetty
#

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

winged mantle
#

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

pearl stagBOT
#

Provided file is too long.

valid jetty
#

yeah ofc

winged mantle
#

even windows is more flexible i think

#

although i do not like that

#

i broke it

pearl stagBOT
#

Provided file is too long.

winged mantle
#

i had to reinstall

valid jetty
#

ive had this macbook for about 3 years by now? it has really been worth it i think

pearl stagBOT
#

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 -->

valid jetty
#

i thnk i spent about ยฃ800 on it because i got a student deal

#

i think its closing up on 4 years actually

winged mantle
#

windows is weird

valid jetty
winged mantle
#

easy to screw your os up but it's really hard to customise some things

deep mulch
#

@valid jetty hii

winged mantle
#

like getting rid of edge

#

you can't

#

in the process of trying i destroyed my install

valid jetty
deep mulch
winged mantle
#

at least linux is customisable without it feeling like a battle against the os

valid jetty
#

the registry editor is so cursed

#

@deep mulch @deep mulch elle runtime

#

programs went from taking 800ms to taking 14ms to compile

winged mantle
#

safari pisses me off much less than edge

#

it's funny

valid jetty
#

ok yeah thats fair too

#

safari on ios >>>

#

safari on macos uh....

#

not so much

winged mantle
#

just by making something so agressive, it makes me not even consider using it

valid jetty
#

i use arc atm but only because ive been conditioned

#

i will switch to firefox at some point

winged mantle
#

in macos it is enough for me to just unpin it from the dock

#

on windows i feel the need to remove it

valid jetty
#

i unpinned everything i dont use

deep mulch
#

why is spotify pink

winged mantle
#

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...

valid jetty
#

weird

winged mantle
#

perhaps it is picking up some systemwide preference

winged mantle
#

and then when you hover it zooms

winged mantle
#

so you can have every app you ever need only one click away

valid jetty
#

you wont husk

#

NOT AGAIN

winged mantle
#

i mean is there really any reason to keep it small

valid jetty
#

zoot is evil

deep mulch
#

@valid jetty@valid jetty

winged mantle
#

it will always take the same amount of vertical space right

#

and i do not auto hide

#

(is this weird)

valid jetty
#

i auto hide because it gets in the way sometimes

winged mantle
#

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

valid jetty
#

mission control is nice but i havent found myself using it recently

deep mulch
#

@valid jetty hiii

winged mantle
#

see

#

i have to stop myself from being the usual gnome shill

valid jetty
#

nono macos has mission control too

winged mantle
#

(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

valid jetty
#

this thing is called mission control on macos idk if its the same as gnome

winged mantle
#

basically

valid jetty
#

yea close enough

ornate quiver
deep mulch
#

rosie has no sweat glands

valid jetty
#

it does idk

#

you just get used to it

ornate quiver
#

damn

valid jetty
#

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!

winged mantle
#

not my fault i totally did not install too many apps

deep mulch
#

@ornate quiver remove your sweat glands so you dont sweat

winged mantle
#

WAIT NO

#

ignore sonic robo blast 2

#

I AM NOT A SONIC FAN

deep mulch
ornate quiver
#

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

valid jetty
winged mantle
deep mulch
#

rosie dum

#

dumdum

valid jetty
#

@hoary sluice

winged mantle
#

true

#

wait

ornate quiver
winged mantle
#

i should run the debloat command

#

sudo rm -rf /

#

(do not attempt)

winged mantle
#

wait it's real

#

what the hell

#

is this not the opposite of kotlin philosophy

#

it's like a less explicit java

ornate quiver
valid jetty
#

yeah kotlin sucks in terms of type conversions

#

in elle the type system is pretty out of your way

winged mantle
#

isn't it meant to make you write less

valid jetty
#

you can compare chars and strings

#

you can cast pointers to any other pointer type

ornate quiver
winged mantle
#

most critisisms of kotlin are about how implicit everything is

#

including some of mine

valid jetty
#

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());
}
winged mantle
#

i legitimately did

#

i had a dream where i wrote kotlin and enjoyed the task of doing so

ornate quiver
#

@deep mulch we should make a KEEP proposal to implicitly allow int and long comparisons

winged mantle
#

i have no idea where this idea that programming kotlin could possibly be fun came from

valid jetty
#

0.toLong() โค๏ธ

winged mantle
#

probably from the propaganda from people like wing

ornate quiver
#

because most of the time it is fun

ornate quiver
winged mantle
#

wait i mentioned this twice lol

ornate quiver
#

still no ternary

deep mulch
#

soon

valid jetty
#

arent ifs exprs in kt tho

ornate quiver
#

and verbose

valid jetty
#

if x { y } else { z }

deep mulch
#

you dont need braces

#

if (g) this else that

valid jetty
#

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

winged mantle
#

i bet you impress a lot of people at parties

valid jetty
#

wha

ornate quiver
winged mantle
#

wdym

#

i would be impressed

#

geniunely

ornate quiver
#

vencord party blobcatcozy

ornate quiver
winged mantle
#

it was
you wouldn't impress a lot of people
but you would impress the people worth getting to know

valid jetty
#

all programmers are femboys or trans or bearded men or are only doing it for the money blobcatcozystars

ornate quiver
#

which one are you

valid jetty
winged mantle
#

DISTROTUBE

#

ok okay why am i not subscribed to this

deep mulch
#

@valid jetty hiii

#

distrotube so insane

#

a lot of people in the linux community hate that channel

#

i agree

ornate quiver
#

why

#

gives community bad image?

deep mulch
#

yes

ornate quiver
#

lol

deep mulch
#

@ornate quiver alibabacord

ornate quiver
#

aliexpresscord

frosty obsidian
#

i love discord detecting jadx gui as Minecraft

deep mulch
#

oh that reminds me I need to fix my pkgbuild

frosty obsidian
#

and discord just matches exe name for most game detection

deep mulch
#

why minecraf

frosty obsidian
#

Minecraft doesn't have any discord integration so its all discord has

deep mulch
#

wing will quit leaving programs open

frosty obsidian
#

i don't have any left open rn

#

im currently working on gloom

deep mulch
frosty obsidian
#

zeet be intelligent challenge

#

thats jadx

deep mulch
#

nop

#

thats what i meant

#

24 hours open

frosty obsidian
#

yes because i was working on gloom yesterday as well

deep mulch
#

you will close when finished

frosty obsidian
#

and jadx takes a million years to initialize

deep mulch
#

@frosty obsidian whats your system uptime

frosty obsidian
#

couple days

#

i restart my pc like once a week

deep mulch
#

wrong

#

i do daily

#

unless i need to run overnight for something

frosty obsidian
#

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

deep mulch
#

good

#

my pkgbuild works now

#

love

nimble bone
deep mulch
#

gpg: signing failed: Bad CA certificate

#

fuckiong

#

i hate signing keys so much

frosty obsidian
#

get a good CA certificate

deep mulch
#

it worked months ago

nimble bone
deep mulch
#

yes

nimble bone
#

tbh just use ur ssh key to sign its soo much easier

deep mulch
#

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

deep mulch
#

ughhhhh of course searching for gpg: signing failed: Bad CA certificate has nothing useful

#

??

#

pinentry was the issue??

valid jetty
valid jetty
#

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]

deep mulch
#

@valid jetty Dmsss

#

Rosie never checks dms

valid jetty
#

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
valid jetty
#

thats a lot of lines

#

14190 are rust
5642 are elle
the other 1753 are like misc things

whole cove
viscid grove
#

what even is that

jade stone
#

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 (*)())

viscid grove
#

wtf is a void pointer

#

oh a pointer without a type

hoary sluice
#

(not actually why, kde just has a lot more features)

hoary sluice
#

why is manager not en enum

#

this made me spent 2 hours on 2019 day 19

valid jetty
#

@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

dense sand
#

"sqlite is the database system for phones" wtf is this shit ๐Ÿ˜ญ

hoary sluice
#

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

valid jetty
ornate quiver
#

lightweight, portable, reliable, self contained

#

sqlite is great for a lot of things really

dense sand
ornate quiver
#

oh yeah

dense sand
#

E.g. mc plugins

hoary sluice
#

5 hours for bfs

valid jetty
#

horror

#

i did another thing

#

i forgot to push

winged mantle
dense sand
#

Wow

placid cape
#

I'm finally at home

dense sand
hoary sluice
#

@valid jetty @placid cape send ur zed config ๐Ÿฅบ

placid cape
#

sure

#

@hoary sluice

hoary sluice
#

ty

jade stone
#

GUHHHHHH why can't I infer a returned assertion in typescript

hoary sluice
valid jetty
#

maple mono >>>

hoary sluice
#

@valid jetty take a look at catppuccin blur in ved

#

zed

placid cape
#

i have dejavu in terminal

#

maple mono looks weird in terminal

hoary sluice
placid cape
#

extension for catpuccin blur themes

#

i use it

hoary sluice
#

similas to urs

placid cape
valid jetty
#

i use noto sans in terminal

placid cape
hoary sluice
#

why is it black

placid cape
#

because espresso is black

hoary sluice
#

theres catppuccin espresso??

placid cape
#

catpuccin blur extension adds it

hoary sluice
#

wtf

placid cape
hoary sluice
#

why is it green

placid cape
#

one of these not sure

hoary sluice
#

its the one you have installed...

placid cape
#

yeah i didnt see that XD

#

yeah the one made by jens

#

looks like my infix function parser works

hoary sluice
#

in zed

placid cape
#

uhh idk

#

i didnt learn all the shortcuts yet

#

i have also nvim configuration because i used nvim before

hoary sluice
#

you dont need to know all the shortcuts to use it

placid cape
#

with lsp etc

hoary sluice
#

i found out about zz today after using vim for like 2 years

placid cape
#

how to enable the vim mode?

#

ill try it

hoary sluice
#

"vim_mode": true,

valid jetty
#

i dont really like it sorry

placid cape
#

try the espresso variant

#

looks much better

hoary sluice
#

/ not enough blur

placid cape
#

okay i enabled vim mode

#

can you tell me some basic shortcuts? :d

valid jetty
#

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

hoary sluice
#

why is it black in the screenshot

valid jetty
#

yeah it does that when you take a screenshot of a window

hoary sluice
valid jetty
#

must take a screenshot of your whole screen

#

yeah

hoary sluice
#

this looks nice

valid jetty
#

true

#

maple mono :3

hoary sluice
#

oh this looks nice

#

i wonder how much more popular zed is gonna be on the aoc 2025 survey

#

and on the stackoverflow survey

#

this hurts my eyes

#

why is the 2 written in primary school teacher font

dawn ledge
#

zed/vscode vim mode users vs real vim users

#

peak experience

hoary sluice
#

light mode + nix

dawn ledge
jade stone
dawn ledge
#

what kinda code do you have

jade stone
#

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;
}
hoary sluice
#

get this out of my eyes please

placid cape
#

yeah ๐Ÿ˜ญ

dense sand
#

i made a parser!!

dawn ledge
#

yay

#

i wanted to write a glr parser generator but i couldnt find any good resources other than a paper on elkhound

placid cape
#

what is glr?

placid cape
#

but i would name tokens as symbols

#

so i dont have Token#Times/Multiply but Token#Asterisk

dense sand
#

oh right

#

they have multiple uses not just multiplication

#

ur right

dawn ledge
#

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

placid cape
#

oh cool

jade stone
#

@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;
}
jade stone
dawn ledge
#

i love type metaprogramming

jade stone
placid cape
#

ts is just not a superset with added typing ๐Ÿ˜ญ

jade stone
placid cape
#

yeah yeah

#

im just taliking about the type programming

placid cape
#

why do you define own uppercaseaz?

#

cant you use Capitalize

#

or you dont want any "builtins"

dawn ledge
#

i did this ages ago

placid cape
dawn ledge
#

2023

#

damn already 2 years

jade stone
dawn ledge
dense sand
#

Its like yesterday

valid jetty
#

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

dawn ledge
#

gotta love endianness

hoary sluice
#

i am so desperate i have started applying to javascript jobs

dense sand
#

yooo i added strings!!

jade stone
valid jetty
dense sand
#

im waiting for the part where everything becomes a big mess and starts falling apart

hoary sluice
dense sand
hoary sluice
#

VariableDeclarationExpression

dense sand
#

VarDeclExpr?

hoary sluice
#

Variable

#

or Declaration

#

i have Assignment and Declaration

valid jetty
#

for binary operations

dense sand
#

but im 100% sure theres some bug in this

#
type uint32_t = bit[32];

is wild

hoary sluice
#

@valid jetty do you have a separate function for each operator

#

i foun a really cool approach

hoary sluice
#

how do u do precedence parsirg

pearl stagBOT
# valid jetty https://github.com/acquitelol/elle/blob/rewrite/src/parser/statement.rs#L661-L71...

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)?;
hoary sluice
#

i fucked it up

pearl stagBOT
#

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)
}
valid jetty
#

mine works in a slightly convoluted way i think

hoary sluice
#

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

valid jetty
#

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

hoary sluice
#
let Some(current_token) = self.current() else {
    break;
};
valid jetty
#

yeah that syntax is so good

hoary sluice
#

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]

valid jetty
#

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

spark tiger
#

i got 0 hours of sleep last night

#

that was... very bad

jade stone
pearl stagBOT
# placid cape https://github.com/xhyrom/blom/blob/92e7de6ff2efd56f7e133cba95e84879ee8cadb7/too...

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
}
placid cape
#

this is my precedence

#

i can actuallyremove the if op.Kind == token.Identifier

jade stone
#

@hoary sluice managed to shrink it down to this blobcatcozy

#

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;
}
placid cape
#

this is actually not that bad

#

but i dont like it anyway

jade stone
#

and it could be even simpler if i casted

valid jetty
#

parrent

#

parrot parent

jade stone
#

yop

#

i love parsing asts blobcatcozy

placid cape
#

i finally implemented not equal โœจ

#

now i really have to work on structs xddd

valid jetty
#

i think i might write a deque

placid cape
#

shouldnt be that hard

valid jetty
#

but after that im genuinely lost on what to implement next

placid cape
#

write also heap

valid jetty
#

true

placid cape
#

but please write it with same api like deque

#

and not like python

valid jetty
#

maybe i can do enums or unions because those dont exist yet

#

lmao i love heappop

placid cape
#

because in python you have deque() and then for heap you need to import heappop heappush

valid jetty
#

yeah

placid cape
#

its weird

placid cape
#

yeah*

#

i really want to do enums

valid jetty
#

what else would i need to do hm

placid cape
#

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

valid jetty
#

true

placid cape
#

i think you wanted traits

valid jetty
#

maybe ill limit traits to a dunder function only

placid cape
#

then work on elle in elle

valid jetty
#

so like you should be able to do

fn foo<T: add>(T x) {

}
placid cape
#

and im sure youll find out whats missing

valid jetty
#

and if there doesnt exist a T::__add__ method then itll crash

placid cape
#

yeah thats amazing

valid jetty
#

maybe its also time to take a break from elle and focus on the huge list of past due physics assignments

placid cape
#

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

valid jetty
#
  • should compile to binop for primitives and T::__and__(a, b) for non primitives
placid cape
#

๐Ÿ‘

#

and i think you also wanted transpiler if im not mistaken?

valid jetty
#

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

placid cape
#

you can maybe try wasm backend

#

wait

valid jetty
#

qbe has none

placid cape
#

i know but

valid jetty
#

i could write my own

placid cape
#

this one wanted to work on wasm support in qbe

#

this can help a lot

valid jetty
#

hmmmm useful

#

tyy