#🪅-progaming

1 messages · Page 42 of 1

placid cape
#

well you're probably right

hoary sluice
# placid cape well you're probably right

rust has convinced me that everything the code does should be visible to you, if you create a struct using only some parameters and others get filled in for you it could cause confusion, if you use ::default its obvious what youre trying to do; you can also do new_with_param2 or whatever where some params are defauld but theres and explicit method for it

valid jetty
#

??? what’s bad about that

supple whale
#

c's memory fuckery will always be bad to me

dense sand
#

i mean

#

for me, its actually pretty easy

#

well atleast it has become much easier to understand

supple whale
#

yeah its not bad

#

its jut gotten weird for me when i try to read C/C++ data from another language and all of a sudden its a "oh yeah, this is somewhere else in memory, here's where, try figuring out how big it is yourself"

dense sand
#

if its not struct, there is not many possible sizes it can be, just try all of them fr

supple whale
#

oh did u ever fuck with pthreads?

#

i'm trying to compile pthreads via emcc

blazing haven
#

just loop through entire ram until u find what you are looking for

supple whale
#

and i keep getting thread startup failure

blazing haven
#

/jk

supple whale
#

and i want to cry

supple whale
#

XD

valid jetty
blazing haven
#

see what happens

#

xd

blazing haven
supple whale
#

you just have a lot of memory to go tru

blazing haven
#

i think if people were to learn it properly when they start out with visual aids they'd not hate it so much

supple whale
#

simply

dense sand
#

can someone tell me what value that is pushed to the op stack actually is

#

is it a string

#

i suppose i can refer to this too

supple whale
#

yeah sorry, java memory is the one thing i never understood

#

even v8 memory is simpler

fleet cedar
#

Not necessarily a machine pointer, I think jvm likes to shift and scale it so it fits in 32 bits

#

But something that the jvm knows how to interpret as a pointer

hoary sluice
#

is he retarded??

dense sand
#

sir this is programming

blazing haven
#

actually its progaming

hoary sluice
blazing haven
#

"planning"

#

i think this counts

#

the cat is clearly planning something

hoary sluice
#

big huge thesaurus sounds very amogus if you dont know what thesaurus means

dense sand
#

kittycat

hoary sluice
dense sand
#

jk i know what it is

hoary sluice
#

big huge tyrannosaurus rex

#

if i make a company im calling it "big huge <the service it provides>"

#

wouldnt you love to eat at big huge restaurant

#

buy a big huge ai subscription

hoary sluice
plush hollow
dense sand
#

whoever suggested me to use libarchive, thanks! it seems so easy to use

deep mulch
#

@valid jetty do you love

#

learning DES and AES blobcatcozy

placid cape
#

xd

#

enjoy

hoary sluice
fleet cedar
#

Only thing that's husk about that is the fallback arm

hoary sluice
fleet cedar
#

If you add another variant you won't get any error that you forgot to add it to interpret

#

And why would you even have expressions that can't be evaluated

hoary sluice
#

actually yea i kept it to have an error when i add a new expression, am now realizing that i get that by default and i get it at compile time without the extra branch

#

cause i needed a fallback branch to not have compile time errors before i added any actual arms

fleet cedar
#

What is it you think is husk about it

hoary sluice
#

implementing it

dense sand
#

I love abstraction

#

My favorite concept

fleet cedar
#

Abstraction can be both good and bad

#

Java is kinda infamous for overusing the bad kind for example

#

Though I haven't seen this supposed overabstraction in reality, so the reputation is probably overinflated

#

...Except in gradle. That one's completely impossible to navigate, at every layer

dense sand
#

Is it worth breaking windows compatibility for being able to use posix function which makes my life a little bit less painful

dense sand
dense sand
#

C

fleet cedar
#

If c or c++, probably worth it

dense sand
#

Ill look into the manpages if there isnt a better way

#

And if i dont find a better way ill go for it

placid cape
fleet cedar
#

Transpile me to brainfuck

hoary sluice
hoary sluice
dense sand
#

xddd

hoary sluice
fleet cedar
#

I have luckily not

hoary sluice
#

ive had to work on one for a month

#

kotlin project

#

supermarket frontend

fleet cedar
#

I have seen some constructors and functions taking 35 arguments and showing clear signs of having used guice in the past, though

hoary sluice
#

i was about to order a rope and chair

hoary sluice
dense sand
hoary sluice
#

yes

#

non spring enterprise kotlin jvm projects are rare i think

dense sand
#

i mean you have ktor

#

or micronaut

#

and things

#

springs infrastructure and core is pain in ass itself

hoary sluice
#

ktor is a lot smaller tho

#

right

hoary sluice
dense sand
#

ktor is made for kotlin

fleet cedar
#

Why does everyone hate doing things straightforwardly

hoary sluice
#

better than the other java frameworks

fleet cedar
#

If I want to pass an argument, I pass it as an argument

hoary sluice
dense sand
hoary sluice
#

same

dense sand
#

ended up switching to elysiajs

hoary sluice
#

i had a ticket to fix some cors stuff or whatever idr, it took me 2 days

dense sand
#

like dont get me wrong, spring data jpa is awesome

#

the whole spring's database support is imo very nice and well made

#

same for serialization and stuff

hoary sluice
#

oh yeah i needed to make tests get a bearer token i think

dense sand
#

but the security

dense sand
#

oh my god

#

i mean its all hibernate under the hood

hoary sluice
#

i had to migrate a mysql with spring vomit in it to postgres, it took 2 weeks and was never realeased to prod

dense sand
#

well i always started with psql

hoary sluice
#

the system was a decade old maybe it wasnt as popular back then

dense sand
#

love working on legacy software

#

that backend survived 2nd world war

hoary sluice
#

did u know mysql is named after the cofounders daugther My

#

he actually made mariadb and maxdb too, guess what

#

im guessing his daugther maria saw mysql and maxdb and was like dad can i have my own db so he forked mysql

dense sand
#

lmao

hoary sluice
#

"what db do u use?"
"oh one my dad made for me"

spark tiger
#

which way is going to be faster for parsing a file:

  1. doing small read calls directly on a File wrapped in BufReader
  2. or reading the whole file into Vec<u8> and then reading from it
fleet cedar
#

Depends on the size

spark tiger
#

though i’m not sure how i’ll be able to seek if i choose the latter

spark tiger
fleet cedar
#

But if it's smaller than a gig, fs::read is usually more ergonomic imo

spark tiger
fleet cedar
#

Yes, since that's what std::fs::read does

spark tiger
#

got it, thank ya

spark tiger
#

do i have to use something like Cursor?

fleet cedar
#

io::Cursor can seek, yes, but then you lose the ergonomic benefits

spark tiger
#

argh

fleet cedar
#

I'll just plug my gospel crate

#

It's pretty handy for reading binary data from byte slices

spark tiger
#

i wanna see how it's implemented

#

oh yeah kinda expected that being it like that

#

though isn't Cursor just a pos and the data too?

fleet cedar
#

Yeah

#

Cursor could provide an ergonomic interface if it wanted, but it prefers Read

#

Much nicer to do f.u32()? than { let mut buf = [0; 4]; f.read_exact(&mut buf)?; u32::from_le_bytes(buf) }

spark tiger
#

also idk why but i can't stop bothering about this implementation, even though that's basically what byteorder does but i keep thinking something might be odd

fleet cedar
#

If the choices are File+BufReader vs fs::read+Cursor, I'd probably go with File+BufReader since you aren't making any use of having the whole file in memory anyway

spark tiger
#

huh, what are the uses? I thought the main benefit is just that you don't need to do syscalls when reading from memory unlike reading from file

fleet cedar
#

BufReader buffers it so the syscalls are sparse enough to not matter

#

Could always benchmark it if you need to know

dense sand
#

oh nice

#

i wrote a java class file parser during weekend and want to somehow optimize it

#

so now wondering how to optimize the reading

#

im just now using fread calls

#

but idk if reading it whole and then having cursor and offsetting accessing the memory would be more efficient

#

so i essentially have the same question ig

#

but i mean

#

premature optimizations are bad

#

well i will see how fast it is after i read and parse the whole java.base jmod into memory

spark tiger
#

i’m so confused i’m just asking chatgpt to reverse engineer it for me atp isob

#

i’m like one step from finally being done with this fucking file format but i can’t figure out the last piece

fleet cedar
#

What is it talking about

spark tiger
#

i can send the prompt

#

I’m reverse engineering a proprietary
binary file format used for storing game assets. Well, there are actually three different files:

  1. bigfile.bfn — used for storing file names and file tree. The structure is the following: first there are 4 bytes (u32) that represent the size of the folder’s name. Then there is the string - the folder’s name - that has that many amount characters as the u32 we just got. After that we have another 4 bytes (u32) that represent the amount of files in the folder, let’s call it files_len. After that there are files_len amount of the following structure: 4 bytes (u32) that amount of bytes that represent a utf-8 file name. Then there’re another 4 bytes (u32) — the amount of subfolders in the folder we’re in. And the cycle repeats
  2. bigfile.bfdata — the biggest size-wise file out of these, which as could be guessed contains the binary data for the files from the previous file
  3. bigfile.bfdb — the least researched file which, it seems, should link the file names with the binary data they contain. The issue is that I haven’t managed to reverse engineering it yet. I decided to pick one file from bigfile.bfn and found the address and size of the binary data it has in bigfile.bfdata. The way I could confirm that this file name exactly links to this data is by using binwalk. It shows which files are contained in the file’s binary by searching for signatures and magic bytes. That way I could find all the PNGs and I decided to take the last one, thinking that the order of files in bigfile.bfdata and bigfile.bfn. I was correct. That way I had the matching file name and the data it represents. Searching for the address of the file’s name from bigfile.bfn didn’t get any results in bigfile.bfdb. But searching for little-endian byte representation of the address of the file data was successful and just 8 bytes before it I found LE-bytes that represent the size of the file data. The question is can you help me guess how they can link the file name with file data?
hoary sluice
#

why are u using emdashes in a prompt

#

is the prompt written by ai

spark tiger
fleet cedar
#

Fellow em dash enjoyer

spark tiger
#

yes — i love them

#

they kinda pretty ngl

#

dashes are too ugly

fleet cedar
#

Hyphens are fine as hyphens

#

But for punctuation, em dash is best

#

Your description of bfdb is a rambling mess, so it's no surprise gpt couldn't make sense of it

#

I can't either

valid jetty
#

〜ー>>>>

#

full width lettters >>>>>

dense sand
fleet cedar
#

No chōonpu is bad, don't

spark tiger
fleet cedar
#

Did you try just taking the nth entry for the nth file

valid jetty
#

the only way a threaded gc would win is if you make a generational allocator to go with it

#

basically long-lived allocations (ones that survive a GC sweep) are ignored for a while

spark tiger
# fleet cedar Did you try just taking the nth entry for the nth file
  1. I don't know like how many bytes are used for one entry in this file, so I can't tell where this nth file will be
  2. And I actually think it's not built like that, because I took the last file from bigfile.bfn and found its data in bigfile.bfdata, so I knew both addresses of file name and file data. Tried to search for the latter in bigfile.bfdb - found the result but it was not at the end at all
#

guh i hope u get what i mean

spark tiger
#

"yeah, my hex editor has achievements blobcatcozy"

valid jetty
#

during the marking stage, if more things are allocated, youll end up infinitely iterating through the list as more things are added until the allocation stops

#

and then never free anything until the end

#

so if you block, things cant be allocated during mark and sweep

#

thats why a generational allocator works well here

fleet cedar
valid jetty
#

you block for small allocations

#

and dont block for big ones

fleet cedar
#

Or is it bad that it would'nt check all the values?

valid jetty
#

what if during the time it takes to mark, an object goes out of scope

fleet cedar
#

Then you'll get it next run

valid jetty
#

i guess

#

this function is the issue

local fn GCAllocator::__internal_mark_region(GCAllocator *self, void **start, void **end) {
    let current = start;
    let end_ptr = end;

    while current < end_ptr {
        let ptr = *current;

        // not nil && is a multiple of ptrsize && isnt clearly invalid
        if ptr % #size(void *) == 0 && ptr && ptr > 0x1000  {
            let block = self.map.find(ptr);

            // only mark if not already marked because
            // recursively marking more is expensive
            if (bool)block && !block.marked {
                block.marked = true;

                self.__internal_mark_region(
                    block.data,
                    block.data + block.size
                );
            }
        }

        current += #size(void *);
    }
}
#

although

#

i dont know if its still an issue

#

my original approach with pthreads was before i made the hashmap so it iterated through all allocated chunks to see if one matches

fleet cedar
#

Just checking if the value is in the right region sounds quite dangerous, what if it's just an integer that happens to be in that range

valid jetty
#

thats why theres a further check later on

#

self.map.find(ptr) would return nil (0) if it doesnt find it

#

the stuff here ptr % #size(void *) == 0 && ptr && ptr > 0x1000 is just a narrowing/filter to not search obviously incorrect things

fleet cedar
#

Random idea for making the iteration faster: make each object's header contain object size and number of references, and always put object references directly after header

valid jetty
#

it holds the size

struct __internal_ElleGC_Header @nofmt {
    bool marked;
    i32 size;
    void *data;
};
fleet cedar
#

Then you know that the first N values after the header are references, and once done with that you skip M bytes to get to the next object

wispy kernel
valid jetty
#

it scans the stack for pointers tho

#

not contigious memory

fleet cedar
#

Right, but why is the scanning function recursive then

valid jetty
hoary sluice
#

@valid jetty is this horror?

valid jetty
fleet cedar
#

Yeah an integer pointing to an object is harmless, will just make that object live slightly longer

valid jetty
#

like imagine you put a Foo* inside a Bar* which has a reference on the stack

#

you wouldnt want the Foo* to be freed even though there is no reference to it on the stack (because its inside of the Bar* which IS on the stack)

fleet cedar
#

Once you've gotten the Bar* from the stack, you know there's a Bar there and don't need to scan anything since you already know its layout, you can just recursive that directly without scanning

valid jetty
hoary sluice
#

idk should i just clone locations

fleet cedar
#

What does Location contain

valid jetty
hoary sluice
hoary sluice
valid jetty
#

the data is just an opaque pointer to anything

#

it allocates a blob of memory of the size you want

fleet cedar
#

Thought it was a pointer to an object

valid jetty
#

yeah but an Object is anything

fleet cedar
#

If it's just arbitrary data, that's a different matter

valid jetty
#

yeah

valid jetty
#

i just meant like in general

fleet cedar
#

Pretty rare to have gc with unstructured data

hoary sluice
valid jetty
#
struct Foo { i32 a; };
struct Bar { Foo *b; };

fn Foo::new(i32 a) {
    foo := #alloc(Foo);
    foo.a = a;
    return foo;
}

fn Bar::with_100() {
    bar := #alloc(Bar);
    bar.b = Foo::new(100);
    return bar;
}

fn main() {
    bar := Bar::with_100();
    // here Foo * doesnt live anymore because Bar::with_100 returned
    // its only reference is inside of Bar
    // so if you didnt recursively check then it would be incorrectly freed

    // note that #alloc(T) === (T)#env.allocator.alloc(#size(T))
    // where #env.allocator is some arbitrary allocator that has an alloc and realloc method on it
    // as a result the allocator cannot ever know the layout of T because the language is statically typed
    // all it can know is the size of the allocation you want
}
hoary sluice
#

i think i have to clone it either way

valid jetty
hoary sluice
#

or is there a way to have

struct Expression {
  kind: ExpressionKind,
  location: Location
}

enum ExpressionKind {
  SomeKind(Token)
}

struct Token {
  kind: TokenKind
  location: Location
}

where the location inside expression kind is the same location as inside expression

valid jetty
#

what are the fields of Location

fleet cedar
#

No, if you have a value that's stored in two places, then it'll be stored in two places

valid jetty
#

if Location is small enough you can just clone it around lol thats what i do

hoary sluice
#
pub struct Location {
    pub row: usize,
    pub column: usize,
}
valid jetty
#

yeah

hoary sluice
#

als

#

alr

fleet cedar
#

#[derive(Copy)]

valid jetty
#

just clone it

#

or that yeah

fleet cedar
#

Also store utf8 offset instead of row/col

valid jetty
#

if you plan to add strings you wont be able to do that

hoary sluice
#

whats the diff between copy and clone

valid jetty
#

clone is explicit with .clone()

hoary sluice
fleet cedar
#

Smaller and more useful

hoary sluice
#

i dont have access to the file in Error

#

so how do i know the row

fleet cedar
#

Convert it when showing to user

valid jetty
hoary sluice
#

i have that rn

fleet cedar
#

Copy is memcpy and can happen implicitly

#

Clone is user-defined and explicit

valid jetty
#

if you wanna put a string in there you wont be able to copy it because String doesnt implement the Copy trait

hoary sluice
fleet cedar
#

Yeah but putting a String in a Location sounds pretty silly

hoary sluice
#

id have to pass along a file

#

name

#

which is bigger

fleet cedar
hoary sluice
#

the user doesnt wanna see error at index 5642

valid jetty
hoary sluice
fleet cedar
#
#[derive(Clone, Copy)]
pub struct Span {
  pub start: usize,
  pub end: usize,
}
valid jetty
#

and its pretty fast

hoary sluice
#

i think

fleet cedar
#

If you want to make your ast 4 times the size I won't stop you but it seems pretty silly

hoary sluice
fleet cedar
hoary sluice
#

thats the exact same size

valid jetty
#

if i want to have a pretty error then all of that is necessary

fleet cedar
valid jetty
hoary sluice
#

how do i turn an offset into row col when printing

fleet cedar
#

Start/end encodes twice as much information as row/col in the same size

fleet cedar
hoary sluice
#

it doesnt encode the row

fleet cedar
#

No but you can easily find that from the source

valid jetty
#

start end is 1d??

hoary sluice
valid jetty
#

unless you mean uh

fleet cedar
#

The error does not have it

#

The thing that prints the error has it

hoary sluice
#

you want me to borrow the source code in location / error printer?

valid jetty
#

how do you know what file the offset is referring to?

fleet cedar
#

Concatenate them together or something

hoary sluice
#

isnt a borrow just as big as a usize

valid jetty
fleet cedar
#

&str is 16 bytes

valid jetty
#

this sounds ultra hyper optimized

#

whats the point

hoary sluice
#

ok but like i dont wanna save 48 bytes

valid jetty
#

at that point write it in C lol

fleet cedar
#

Why do slow clunky rust when I can do fast ergonomic rust

hoary sluice
#

if i can borrow location instead of cloning it that is a very small change in the code

fleet cedar
#

That would mean putting lifetimes everywhere though

#

Which is a very large change

hoary sluice
#

no itd mean putting location in an rc

#

or something

#

cause i dont wanna borrow the expr

fleet cedar
#

Ah, heap allocate your usizes

hoary sluice
#

thats gonna cause problems

valid jetty
hoary sluice
#

also in rosies case its completely irrelevant cause its just gonna increase compile times by 3 picoseconds and add 48 bytes of ram usage

#

for me its gonna increase runtime by 3 picoseconds

fleet cedar
#

48 bytes per ast node

#

And 4 .clone() calls per ast node

hoary sluice
#

at that point might as well change the index to a u16 and dynamically adjust it to a u32 when the file size is bigger than 65536

valid jetty
#

lmfao

valid jetty
#

.clone will clone 8 bytes

hoary sluice
#

im using i128 for my ints i think i can save some bytes there

hoary sluice
valid jetty
#

@hoary sluice do the erlang int encoding scheme

fleet cedar
#

I mean you can do whatever you like but I'm gonna stick with small Copy types for spans

hoary sluice
#

ok im gonna clone location for now and if im bored and have nothing to do i will save the 48 bytes

valid jetty
hoary sluice
#

a non finished interpreter doesnt care abt 48 bytes

valid jetty
#

xdddddddd

#

basically unicode encoding

#

but for just values in general

#

ultra efficient memory usage

valid jetty
hoary sluice
#

isnt beam super slow

valid jetty
#

no?

fleet cedar
#

As a counterpoint to "I don't have the string to compute line/col", you also don't have the source to print source snippet

valid jetty
#

i now have this working

fn main() {
    x := 1;

    {
        x := "a";
        $assert(x == "a", nil);

        {
            x = "b";
            $assert(x == "b", nil);
        }

        $assert(x == "b", nil);
    }

    $assert(x == 1, nil);
    io::println("All variable shadowing tests have passed!".color("green").reset());
}
``` lmao
fleet cedar
#

Which means your architecture is limiting your functionality unnecessarily

valid jetty
#

before it didnt let you declare x with a different type in nested scopes

hoary sluice
#

im gonna put the filename into location eventually

#

and then i can do indexing

#

i probably should do the start end thing as well

valid jetty
#

isnt it technically cheaper to have Rc<String> if youre cloning?

fleet cedar
#

Rc<String> is just silly, but Rc<str> is good if you want to clone a lot

valid jetty
#

why is it silly

fleet cedar
#

Because it's an unnecessary indirection

#

You need to follow two pointers instead of one to get the data

hoary sluice
#

just clone the src code :3

fleet cedar
#

Of course, having a String of the entire program source in each ast node is the most ergonomic

valid jetty
fleet cedar
#

Yeah it's better than String if you want to clone

#

But Rc<str> is better than Rc<String>

hoary sluice
#

does rust have lateinit

fleet cedar
#

You mean LazyLock?

hoary sluice
#

null variable that panics if its used before initialization

fleet cedar
#

No

hoary sluice
#

basically saying idk the value rn but i promise ill know it before using you

fleet cedar
#

.expect() like a civilized person

#

That said, nothing except your conscience prevents you from writing one yourself

#

And of course there's MaybeUninit if you want to go the unsafe route, but don't

hoary sluice
#

oh wait this is gonna recursively clone location

#

im gonna buy a rope and a chair

#

nvm

#

is there a point in boxing an expr if i know all recursive calls to it will be boxed

#

that wasnt english

#

if i have

struct Expr {
  expr: Box<Expr>
}

is there a point in boxing the top leve expr

#

can i remove this box

fleet cedar
#

Boxing things unnecessarily is typically unnecessary yes

hoary sluice
#

well i dont have box intuition yet

#

sorry

placid cape
#

i should add let or something after refactoring parser

fleet cedar
#

How does the code that assigns location look

hoary sluice
#

idk maybe i should just use an option lol

fleet cedar
#

That looks like you can just do let mut location: Location; and assign it later

hoary sluice
#

so rust does have lateinit????

fleet cedar
#

It gives a compile error if it's not assigned when used

#

Not a panic

#

Pretty sure java does the same

#

I figured since you were asking about a specific runtime behavior, you wanted that behavior at runtime

hoary sluice
#

this is an explicit boolean that is initialized to false inside a loop which means this if will always be executed

#

kotlin can detect that so surely rust can

#

ok i give up im initializing it to 0, 0

valid jetty
fleet cedar
#

Personally I'd do ```rs
consume(If);
let cond = parse_expr()?;
let body = parse_block()?;
let location = cond.location.clone();
let mut branches = vec![(cond, body)];
while try_consume(Elif) {
let cond = parse_expr()?;
let body = parse_block()?;
branches.push((cond, body));
}

hoary sluice
#

ohh

#

good idea

valid jetty
#

i made Rc<Location>

#

can you tell which one is which

hoary sluice
#

if i put 20 bucks on 493ms how much would i get if i was right

#

7 mil?

#

1:350k odds seems worth my 20 bucks

valid jetty
#

lmao

hoary sluice
#

zed's ctrl + / is very bad

#

it doesnt go to next line by itself and it doesnt put the // at the start of the line

dense sand
#

@mossy ether do you know how to use libarchive

#

cuz like, how do i read the whole entry

#

this was my attempt

hoary sluice
#

no it doesnt

valid jetty
#

oh ok it has this too

mossy ether
#

well without the while loop

#

nvm it's handled differently, you need your own allocated buffer

#

uhhh

dense sand
#

i dopnt mind mallocs or shit

#

i just want to read it fully

valid jetty
#

this passes

use std/prelude;

fn main() {
    x := "foo";
    $assert(x == "foo", nil);
    x := 1;
    $assert(x == 1, nil);

    {
        x = 2;

        x := "a";
        $assert(x == "a", nil);

        {
            x = "b";
            $assert(x == "b", nil);
        }

        $assert(x == "b", nil);
    }

    $assert(x == 2, nil);
    io::println("All variable shadowing tests have passed!".color("green").reset());
}
``` ive just made a dynamic static language
hoary sluice
#

@valid jetty which commit msg is better

fleet cedar
#

The feb one would be fine as six commits

hoary sluice
#

yea i kinda just forgot to commit the other stuff

blazing haven
hoary sluice
#

before starting on interpreter and expression location

dense sand
hoary sluice
hoary sluice
blazing haven
blazing haven
hoary sluice
#

most of it is sects of furries

hoary sluice
blazing haven
#

xd

#

based

hoary sluice
#

and people who like cats ferrets

mossy ether
mossy ether
#

beware that it doesn't null terminate it if you want a string

placid cape
dense sand
hoary sluice
# placid cape yes

oh and people who make prs in personal repos are listed in bold in the manifesto

placid cape
#

what

mossy ether
hoary sluice
hoary sluice
placid cape
#

no because im merging them

hoary sluice
#

do u do schizophrenic code review

#

where u point out ur own mistakes

placid cape
#

i just use PRs because i hate having everything in one commit

hoary sluice
#

like rubber duck debugging but written

placid cape
#

and also this is nice

hoary sluice
#

way too much hassle for me

#

i just spent like 10 minutes writing this commit messages and now i wanna go back to making 7000 line commits named ":3"

spark tiger
hoary sluice
placid cape
#

or just put all commit msgs to the final msg

hoary sluice
#

why not just commit frequently

hoary sluice
spark tiger
# hoary sluice i think everyone here uses zed

this accidently reminded me of how i used to randomly open this server (before i actually started talking here) and see people having fucking jetbrains writerside as their role icon, i thought ppl here were actually using it isob

valid jetty
#

@hoary sluice can you tell how to use this syntax based on how its defined [<T;>? <expr>...?]

placid cape
#

in start PRs are probably useless but later when you have a structure and everything works i would use them

balmy lintel
# placid cape

you guys are insane, just directly commit everything with random commit messages so you dont remember what you changed in that commit

hoary sluice
#

what language is this

valid jetty
#

im trying to make a concise definition for how you can initialize an elle array without bnf

#

maybe i should just use bnf

hoary sluice
hoary sluice
#

just use ebnf

spark tiger
#

lc.g ebnf

visual shellBOT
pearl stagBOT
# hoary sluice https://github.com/eagely/icps/blob/main/src%2Fgrammar.ebnf

src/grammar.ebnf:

expression = declaration ;
declaration = IDENTIFIER ":" { "_" | IDENTIFIER } | lambda ;
lambda = { IDENTIFIER } "$" expression | assignment ;
assignment = IDENTIFIER { primary } "=" expression | if ;
if = "if" expression expression { "elif" expression expression } "else" expression | binary ;
binary = unary { ( IDENTIFIER | OPERATOR ) unary } ;
unary = ( "!" | "-" ) unary | primary ;
primary = "true" | "false" | "null" | "(" expression ")" | NUMBER | STRING | IDENTIFIER ;

spark tiger
valid jetty
#
array ::= "[" [type ";"] [elements] "]" ;
elements ::= expression {"," expression} ;
``` is this right
hoary sluice
#

grammar notation and writing

valid jetty
#

yes i think so

hoary sluice
#

Wikipedia uses =

#

i think ::= is pointless and annoying since its for human eyes only

placid cape
#

After some cleanup I'll start working on std

#

and generics

hoary sluice
valid jetty
#

i built my own on top of posix ones

placid cape
#

I'll use functions from libc

hoary sluice
#

are those just posix wrappers

placid cape
#

Rosie you don't have private keyword or something to not expose it outside the file?

#

Or why everything is with __........

valid jetty
#

i do but i want to prevent duplicate symbols

#

theres no mangling

placid cape
#

ohhh

#

well yeah makes sense

#

I should implement name mangling

#

And @mangle(false) or something

#

and I should also make todo table or something

valid jetty
# hoary sluice i thought u had a bunch of `__builtin_do_not_use_unless_youre_cool_fopen__`

theres an attribute called @fmt that you can put on a function to say that every argument passed in should be put through its formatter

so here

fn string::format(ElleMeta meta, string fmt, ...args) @fmt -> string {
    for let i = 0; i < meta.arity; i += 1 {
        meta.types[i] = "string";
    }

    return __internal_fmt(fmt, meta, args);
}
``` you can pass anything and the compiler will turn it into a string using the type's `__fmt__` method

however if you know what youre doing and want to use the basic formatter that will not call the fmt method, you use
```rs
fn string::__internal_formatter_do_not_use_unless_you_know_what_youre_doing__(ElleMeta meta, string fmt, ...args) -> string {
    return __internal_fmt(fmt, meta, args);
}

the difference is that this one wont work for any non-primitive type because its not calling __fmt__ of the type

hoary sluice
#

me when my function is secretly __main.is_structname_a9f3b8d2-47c5-6e1d-82f0-3b7a9c4e5d61_function__

hoary sluice
valid jetty
#

and the stringifier for primitives basically does this lol

fn __internal_to_string<T, U>(i64 args, string fmt) {
    T arg = args.yield(U);

    let length = io::snprintf(nil, 0, fmt, arg);
    let res = #alloc(char, length);
    io::sprintf(res, fmt, arg);

    return res;
}

// !! Do not use this unless you know what you're doing !!
// If you want to turn a value of arbitrary type to a string
// please use string::as_string or string::as_string_wrapped
fn __to_string(string ty, i64 args, bool wrap) {
    if ty.starts_with("i8") {
        return __internal_to_string<i8, i8>(args, "%d");
    }

    if ty.starts_with("i16") {
        return __internal_to_string<i16, i16>(args, "%d");
    }

    if ty.starts_with("i32") {
        return __internal_to_string<i32, i32>(args, "%d");
    }

    if ty.starts_with("i64") {
        return __internal_to_string<i64, i64>(args, "%ld");
    }

    if ty.starts_with("u8") {
        return __internal_to_string<i32, u8>(args, "%u");
    }

    if ty.starts_with("u16") {
        return __internal_to_string<i32, u16>(args, "%u");
    }

    if ty.starts_with("u32") {
        return __internal_to_string<i32, u32>(args, "%u");
    }

    if ty.starts_with("u64") {
        return __internal_to_string<i64, u64>(args, "%lu");
    }

    // ...
}
#

looks a little cursed but its the best way to dynamically do it

hoary sluice
#

what if the type is u32balls

valid jetty
#

well the only way that could happen is if the type is a struct

#

which means you shouldnt use the internal formatter

hoary sluice
valid jetty
hoary sluice
#

why are u doint startswith anyways

valid jetty
#

for pointers

#

i32*

hoary sluice
#

oh

valid jetty
#

thats the main reason i made the name so explicit like that

#

its very easy to use it wrong and get weird results

#

if you do the right thing youll be fine

placid cape
#

You should implement mangling and get rid of ___________

valid jetty
#
struct u32balls { u32 x; };

fn main() {
    $printf("i have {} balls (marbles!!!)", u32balls { x = 39 });
}
``` if youre sane nothing will break
#

but if youre unsane you can do

struct u32balls { u32 x; };

fn main() {
    $println("i have {} balls (marbles!!!)".__internal_formatter_do_not_use_unless_you_know_what_youre_doing__(u32balls { x = 39 }));
}
#

which gets you what you would expect i guess

hoary sluice
#

i meant golf balls

hoary sluice
valid jetty
#

so true

#

weirdly enough its a slightly different amount of balls each time i run it 😱 i wonder why that is

hoary sluice
#

random number generator??

valid jetty
#

real,

hoary sluice
#

is it undefined behavior

valid jetty
#

i mean as a random number generator yes

#

@hoary sluice @placid cape if the user is compiling elle code into an object file should i link with libelle?

#

or would they link with it when compiling the main executable

hoary sluice
#

i mean like does it pull a valug from a random unallocated memory

hoary sluice
valid jetty
#

not used tho

hoary sluice
#

idk enough about linkers to answer that

valid jetty
#

i might just pass -Wno-unused-command-line-argument to the linker lol

hoary sluice
#

gn

valid jetty
#

i can just do this lol

pearl stagBOT
haughty socket
#

i havent touched typescript in a bit but

#

this is so fire

#

@royal nymph did u know this hapopened its s of ire

royal nymph
#

what if obj[key] is a getter

#

that returns different thingh every time

fleet cedar
#

I sure hope that doesn't pass code review

valid jetty
#
fn main(string[] args) {
    contents := io::read_to_string(args[1]);
    grid := contents.split("\n")
        .map<char[]>(Array::from_string)
        .map<string>(fn(char[] x) x.join(" "))
        .map<i64[]>(string::nums)
        .map<i32[]>(Array::truncate);
    ts := find(grid);

    $dbg(solution(grid, ts, false));
    $dbg(solution(grid, ts, true));
}
#

ts 💔 = find(grid)

#

ts pmo 💔

native spruce
#

@woven mesa theres a ton of customization for the tabview too

#

I think im gonna use this

#

this makes codebases so much better 😭

#

I dont have to make a million wrappers

#

maybe thats a bit much

#

I still need to make some wrappers I guess

woven mesa
native spruce
#

at most I wanna support ios 16

woven mesa
#

ah

native spruce
#

not impossible though

#

why do they have a different animation for the files app when using a tabviewsidebar

fading timber
#

This may be off topic, but I'm trying to inject betterdiscord or vencord into the discord-portable version I found on github. since the discord-portable I found on github is old, the index.js part I marked is missing. what should I do with the file= path instead?

wheat kernel
native spruce
#

@broken shore do you know why it adds a new navigationbar if I use anyview

broken shore
#

show code

native spruce
#

let view: any View
view: RedView(),

viscid grove
#

what is that?
I think compact is mispelled as compat

broken shore
viscid grove
#

oh

#

like for compatibility?

broken shore
#

it's a custom extension for View

#

extension View {
func compatNavigationTransition() ...
}

viscid grove
#

yeah but what does compat mean

#

probably the definition and the usage are spelled that way

wheat kernel
#

compat means compatibility dawg

viscid grove
dense sand
fleet cedar
#

Is that asan?

#

Try with miri

#

Or were you the c++ guy?

dense sand
#

no

hoary sluice
fleet cedar
#

What do you do if the body starts with a (

#

Wrap it in {}?

eternal wigeon
#

guys im a little scared fr

#

I'm setting some apps on my server with docker and this shit comes back for no reason when I delete it. they RECREATE THEMSELVES

#

4 containers that use my 80 and 443 ports and i cant delete

#

i didn't docker compose up dokploy i dont even have any docker compose for that and dont use that

#

i stopped, they restart, i stopped and removed containers, they are created again

#

they are re-creating when i delete wtf is this anyone knows?

hoary sluice
fleet cedar
#

How come that's not parsed as a function call?

valid jetty
#

probably because if and else are tokens with priority?

fleet cedar
#

I mean the (false)(false) part

valid jetty
#

yeah

#

consume if
consume condition expr
consume body expr

#

actually hm

fleet cedar
#

Why does "consume condition expr" not consume the <expr>(<expr>*)

valid jetty
#

idk ask eagely

hoary sluice
#

(right now it doesnt matter that false is a literal, but its never going to be parsed as a function call cause its a literal)

#

{} is not valid syntax rn

#

it is tokenized as

[src/main.rs:19:13] &tokens = [
    LeftBrace, None, 1:1,
    False, Boolean(false), 1:7,
    RightBrace, None, 1:9,
]
#

but the parser doesnt use them

#
fn parse_if(&mut self) -> Result<Expression> {
    if !self.current_is(TokenKind::If) {
        return self.parse_binary();
    }

    try_consume_any!(*self, TokenKind::If);
    let condition = Box::new(self.parse_expression()?);
    let body = Box::new(self.parse_expression()?);
    let location = condition.location.clone();

    let mut branches = vec![(condition, body)];
    while self.current_is(TokenKind::Elif) {
        try_consume_any!(*self, TokenKind::Elif);
        let condition = self.parse_expression()?;
        let body = self.parse_expression()?;

        branches.push((Box::new(condition), Box::new(body)));

        if !self.current_is(TokenKind::Elif) {
            break;
        }
    }

    let mut otherwise = None;
    if self.current_is(TokenKind::Else) {
        try_consume_any!(*self, TokenKind::Else);
        otherwise = Some(Box::new(self.parse_expression()?));
    }

    Ok(Expression::new(
        ExpressionKind::If {
            branches,
            otherwise,
        },
        location,
    ))
}
#

basically

consume if
loop {
  condition = consume expr
  body = consume expr
}

consume else {
  body = consume expr
}
#

whenever i implement function calls im prob gonna add some kind of {} requirement

hoary sluice
fleet cedar
#

Simple enough solution

austere anchor
#

husk

austere anchor
hoary sluice
#

its either make if foo foo else bar only work sometimes or make it work never

hoary sluice
fleet cedar
#

Do like python

hoary sluice
hoary sluice
hoary sluice
#

so it only works sometimes

blazing haven
#

foo if True else bar

austere anchor
#

true ? foo : bar

hoary sluice
placid cape
#

python

dense sand
#

who here understands the format of java class file

#

im parsing this thing, attribute_name_index is a reference to a constant pool entry which is an array(indexed from 1), however, i get number like 178, which is actually offsetted by 1 for no reason, the entry i need is 1 lower. theres nothing about this in docs

#

the thing is that this doesnt always apply, which is kinda weird xd

#

like sometimes its correct, sometimes its not, so i just cant use - 2 for no reason

#

this is how i use it

placid cape
#

@valid jetty you're following python's behaviour with for loops?

#

this returns 10 in elle

valid jetty
#

wdym? that seems reasonable to me

#

oh you mean like

#

the x shadowing the previous x?

#

hmmmmm idk i may fix that in the future

#

its not very hard to fix tbh

#

yeah there

placid cape
#

👍

valid jetty
# placid cape

btw the idiomatic way is something like

use std/prelude;

fn main() {
    x := 75;
    $dbg(x);

    for x in 0..10 {
        $dbg(x);
    }

    $dbg(x);
}
#

it does the x = for you

placid cape
valid jetty
#

oh lol i see

hoary sluice
#

how can i remove the ugly is_print without having borrow after move token?

TokenKind::Identifier => {
    self.advance();

    let mut is_print = false;
    if let TokenValue::Identifier(name) = &token.value {
        if name == "print" {
            is_print = true;
        }
    }

    let identifier =
        Expression::new(ExpressionKind::Identifier { token }, Rc::clone(&location));

    Ok(if is_print {
        Expression::new(
            ExpressionKind::Print {
                expression: Box::new(identifier),
            },
            Rc::clone(&location),
        )
    } else {
        identifier
    })
}
#

i dont have functions yet but id like to see if my code works so i need some kind of io

dense sand
#

first time in my life im using ***

valid jetty
hoary sluice
valid jetty
#

feels so wrong to read old elle code

fn input(String message) {
    Long stdin = fdopen(0, "r");
    Char buf[1024];

    printf(message);
    fgets(buf, 1024, stdin);

    Long len = strlen(buf);
    Long index = len - 1;
    Long newline = buf + index;

    newline <- Byte 0;
    return buf;
}
fleet cedar
#

Teenagers are always cringe

valid jetty
#

now its like

fn io::input(string message) -> string {
    buf := #alloc(char, 4096);

    io::print(message);
    io::fgets(buf, 4096, __internal_stdin);

    buf[buf.len() - 1] = '\0';
    return buf;
}
``` lol
valid jetty
fleet cedar
#

They grow up so fast

valid jetty
eternal wigeon
#

anyone know why my vscode typescript is stupid?

#

are all typescript IDEs like this?

spark tiger
#

guh it'd be so good if it worked

hushed pebble
#

but that's likely normal

dense sand
#

Lsp thing

royal nymph
#

French rust

eternal wigeon
#

like when I birefly learned java it was hell but at least the autocompletion on jetbrains ide wasn't completely stupid

hushed pebble
#

but I think it is

eternal wigeon
#

suggesting objects from everywhere except the type the function accepts

hoary sluice
dense sand
hoary sluice
#

@placid cape i was wondering why the last few weeks my zed discord presence didnt work, turns out when i reinstalled zed i forgot to install the extension 😭

spark tiger
eternal wigeon
valid jetty
hoary sluice
#

omg rust has nested if let

#

im about to cry

valid jetty
hoary sluice
#

i just made function names required to be both strings and identifiers at the same time so now u cant declare functions

#

idk what i was cooking

eternal wigeon
#

i mean 170.x ip really wants to access sexpack on my proxy

hoary sluice
#

5v

dense sand
hushed pebble
#

could probably use a macro

valid jetty
#

@hoary sluice so when are you gonna use the erlang encoding scheme for icps

dense sand
#

i wanted something more optimized so this wouldnt be so performance non-efficient

valid jetty
hoary sluice
#

ok so i have functions now, however

  1. guards dont accept any arguments yet
  2. there is absolutely 0 type checking, not even for the amout of arguments
  3. types dont exist at all yet so when i say int i actually mean an identifier with no associated value called int

hence this is valid code

add : int int AAAAAAAA a a a
add = print 3
add 2 3 "marbles"

and it outputs 3

#

very useful indeed

hoary sluice
#

it also requires me to have types

#

and working functions

#

with arguments

dense sand
#

2 million calls of bswap16 xd

#

i wonder how much more efficient would it be if i inlined it

green gulch
#

hate apple

#

2nd time and they wont say the issue

spark tiger
#

argh why does this keep happening

dense sand
#

hmm, im thinking of rewriting my class_file structure into a more usable format

#

the issue is that i would like the whole thing reconstructable back

valid jetty
valid jetty
#

much nicer

royal nymph
valid jetty
#

good point tbh

#

i’ll just have .le

dense sand
#

just let it use any extension bruh

royal nymph
dense sand
#

vee

spark tiger
#

why does pnpm have a theo video on their homepage wires

#

i got recommended a webdev news video on youtube and after watching it i found out webdev has WAY more different frameworks and tools than i thought

hoary sluice
#

@valid jetty woo

spark tiger
hoary sluice
#

actual functions!!!

hoary sluice
valid jetty
hoary sluice
valid jetty
#

husk

hoary sluice
#

i think it might be turing complete tho

royal nymph
hoary sluice
#

it should just be the lambda calculus now

#

as long as my currying impl works

royal nymph
#

vite is a rollup + esbuild wrapper

#

webpack is garbo don't use it

#

Vencord & Vesktop use pure esbuild to build everything

spark tiger
royal nymph
#

webpack is fucking shit

#

it's the oldest one that's why it's popular

#

used to be the goto

#

but it's so fucking slow

ornate quiver
#

wtf is that graph

spark tiger
royal nymph
#

Discord switched from webpack to rspack

Fast Rust-based web bundler

spark tiger
#

oh i thought they were still using webpack

royal nymph
#

rspack is webpack replacement that's much faster

ornate quiver
#

why is literally everthing trending negative

#

every single line

spark tiger
royal nymph
#

nah

ornate quiver
#

??

#

2024 especially

royal nymph
#

a lot of good frameworks

#

just use modern shit that uses stuff like vite and don't use ancient shit like webpack or create react app

spark tiger
#

i choose stuff only judging by whether it has a cool logo and golden checkmark

royal nymph
#

bun is kinda overrated

ornate quiver
#

yop

#

so overrated

spark tiger
#

like there aren't that many big projects made in zig

#

all i can remember is ghostty and bun

royal nymph
#

everything is made in rust these days

spark tiger
#

what if i use js instead of ts for my site fr

#

anyways uhh i'll probably stick with astro atp

#

seems trendy enough

#

reminded me i still haven't managed to buy the domain. fortunately porkbun was able to verify my phone number by calling me from their support number. shoutout porkbun !

#

so discord donated $10,000+ to webpack just to end up switching to rspack?? isob

hoary sluice
valid jetty
#

you dont need currying for turing completeness

hoary sluice
#

you do if the only operation you have implemented is print

valid jetty
#

a turing complete system has

  1. iteration
  2. memory
  3. conditions/branching
#

recursion counts as iteration

hoary sluice
#

i was trying to make a lambda calculus

#

i do have if statements

valid jetty
#

still applies tho

hoary sluice
#

and memory using functions

valid jetty
#

as long as youre not trying to like

#

make the language out of axioms

#

with like church numerals and such

hoary sluice
#

well i have numbers i just dont have any math operators

#

anyways i dont have conditions cause my ifs dont work with functions

#
if b print b else print "not b"

the second print gets parsed as an identifier, not a function

#

the fix is making identifiers just functions that return a constant

#

or like

#

calls with 0 args

#

thats a job for tomorrow

#

currently functions are basically just overhead that can do nothing besides print the value or ignore it

valid jetty
#

i improved import paths

#

now the import path is relative to where the file is importing from, instead of where the compiler was invoked from

#

oh and you can do this

use ./resources/../resources/./raylib;
hoary sluice
valid jetty
#

it does

hoary sluice
#

where

valid jetty
#

std/x/y looks for /usr/local/include/elle/std/x/y.le

#

then if that doesnt exist it looks in current dir

hoary sluice
#

alr

#

can u configure it?

valid jetty
#

that will probably come with a flag to turn off colors too i think

hoary sluice
#

or some kind package fie

#

file

valid jetty
#

nope i use a bunch of statics in main.rs

#

lmao

hoary sluice
#

lol

valid jetty
#

probably a good idea to move those away

hoary sluice
#

u should use :3 instead of * in commits

valid jetty
#

whaaa

#

does that make a list?

hoary sluice
#
:3 Add call to grammar
:3 Implement parse_call
:3 Implement function declarations without type checking
:3 Implement function pattern assignments with named parameters only
valid jetty
#

so true

hoary sluice
#

no but it makes :3

valid jetty
#

:3

hoary sluice
#

doesnt even look that bad tbh

valid jetty
#

so many

hoary sluice
#

i probably shouldve taken a look at the haskell compiler before doing all of this

#

wouldve saved a lot of time

valid jetty
#

lmao

hoary sluice
#

or like builtins

valid jetty
#

they work like regular functions theyre just not intended to be called by the developer

#

theres wrappers usually

hoary sluice
#

oh

#

i forgot its a compiler

valid jetty
#

lmao

hoary sluice
#

im prob gonna do a qbe impl once im done with the interpreter

winged mantle
#

i wonder what a less deranged way of doing this would be

#

since all routing is client side i just have the page that loads the app as the 404 page

hoary sluice
#

using rust (it compiles to wasm and can be used on the frontend)

winged mantle
#

same issue if i use client-side routing

#

(it is an spa)

#

maybe i should figure out a way to do routing server side too

#

but also what would be a good way to have script have dynamic content

#

it just passes down some env vars from the server env vars

#
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Dashboard</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" media="screen" href="app.css">
        <script>window.ENV={"REDIRECT_URI":"http://localhost:8080/api/v1/auth/login"}</script>
        <script src="app.js" defer></script>
    </head>
    <body id="app">
        <noscript>
            This website cannot be run in DOS mode
        </noscript>
    </body>
</html>
hoary sluice
#

mangling?

valid jetty
#
"-std" | "--std-path" => if let Some(arg) = args.next() {
    let leaked: &'static str = Box::leak(arg.into_boxed_str());
    unsafe { STD_LIB_PATH = leaked };
}
``` is there a better way to reassign to a static mut?????????
valid jetty
#

(for now)

hoary sluice
valid jetty
#

omg it all has to be in an unsafe block

valid jetty
#

if i use static mut

hoary sluice
valid jetty
hoary sluice
#

use a Cell

valid jetty
#

yeah ok

royal nymph
#

there's no good way to have globals lol

fleet cedar
#

Statics have to be Sync, whether you use threads or not

winged mantle
#

i get annoyed by that

#

i love globals

#

pros: good excuse not to write tests
cons: makes it harder to write tests

hoary sluice
royal nymph
#

I did this abomination

// :3
#[macro_export]
macro_rules! global {
    ($name:ident : $type:ty, $getter:ident) => {
        pub static mut $name: Option<$type> = None;
        #[inline]
        pub fn $getter() -> &'static $type {
            unsafe {
                $name
                    .as_ref()
                    .expect(concat!(stringify!($name), " must be set before use"))
            }
        }
    };
}

// declare
global! {
    SOME_VARIABLE: Type,
    get_some_variable
}

// get (only after set)
get_some_variable();

// set (oh god make sure this is thread safe or you will explode)
unsafe {
  SOME_VARIABLE = Some(42);
}
hoary sluice
#

but one of the two

valid jetty
#

you cant use cell here actually because it doesnt implement Sync

fleet cedar
#

Use mutex

hoary sluice
#

ok then use a mutex

#

but why does it need to be Sync

royal nymph
#

even if you only have one thread, that's the only proper way without unsafe

fleet cedar
#

No need for arc, globals are inherently shared

fleet cedar
royal nymph
#

alternatively, lazy static

hoary sluice
#

yea i was told to use lazy static and not use actual statics

fleet cedar
#

lazy_static crate is largely deprecated these days, since LazyLock is in std

deep mulch
#

@valid jetty hiiii

winged mantle
#

i feel like the same people who decided on the warnings in jetbrains ides worked on the rust compiler

#

⚠️ this variable might be infected with measles

deep mulch
#

the kode tode

#

the tode who kodes

hoary sluice
hoary sluice
#

go contribute

#

you should be a project manager there

#

idk if they have those

winged mantle
#

zoot kde dev

#

zoot implemented crashes in kwin

hoary sluice
#

zoot created kmines

deep mulch
#

I like kde

valid jetty
#

ok well i did it @hoary sluice

#

you can now disable colors and set the runtime & std lib paths

fleet cedar
#

-noclr? Have you considered using sensible cli syntax

hoary sluice
#

crust

#

rustc???

#

the rust compiler is actually elle

valid jetty
#

i give 2 options

#

-noclr or --no-color-output

fleet cedar
#

-noclr is five flags, not one

valid jetty
#

oh you mean that

#

i like to keep it more than 1 character if possible

fleet cedar
#

You should use standard cli conventions

valid jetty
#

hm yes let me ellec -tnfaskcibgs -o x.o -z -fabc

gray heron
#

i need webdev help chat 😭

#

this is a test document so it's mildly horror but im trying to make the flashlight only appear within the search button

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      body {
        background-color: black;
      }
      .flashlight {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        pointer-events: none;
        background: radial-gradient(
          circle 70px at var(--x, 50%) var(--y, 50%),
          rgba(255, 255, 255, 1) 0%,
          rgba(255, 255, 255, 0) 60%
        );
      }
    </style>
  </head>
  <body>
    <div
      class="wrapper"
      style="
        position: fixed;
        margin: 0.5vh;
        margin-left: 1vw;
        top: 0;
        left: calc(50% + 40vw);
        width: 7vw;
        height: 3vh;
        border: 0;
        border-radius: 20px;
        outline: 0;
        overflow: hidden;
      "
    >
      <div class="flashlight" style="z-index: 9999"></div>
      <button
        id="searchButton"
        style="
          position: fixed;
          margin: 0.5vh;
          margin-left: 1vw;
          top: 0;
          left: calc(50% + 40vw);
          width: 7vw;
          height: 3vh;
          border: 0;
          border-radius: 20px;
          outline: 0;
          color: #ffffff;
          background-color: #25252a;
          font-size: 2vh;
        "
      >
        Search
      </button>
      <script>
        const flashlight = document.querySelector(".flashlight");

        document.addEventListener("mousemove", (e) => {
          flashlight.style.setProperty("--x", `${e.clientX}px`);
          flashlight.style.setProperty("--y", `${e.clientY}px`);
        });
      </script>
    </div>
  </body>
</html>
#

i caant do this dude im crying

royal nymph
#

single - = single letter flag (you can specify multiple and -thing actually is 5 flags t, h, i, n and g)
two -- = long flag

#

these would be equivalent

elle -thing
elle -t -h -i -n -g
#

normally you have one single letter flag and one long flag
so for example

elle --disable-color
elle -C
royal nymph
valid jetty
#

uhh ok

#

but i dont know anyone who knows about NO_COLOR=1 lmao

valid jetty
#

whatever ill do that aswell

royal nymph
valid jetty
#

because im gonna make color on by default im gonna make it as obvious as possible to disable it

#

so ill have --noclr, --no-ansi, and NO_COLOR=1

haughty hinge
# gray heron this is a test document so it's mildly horror but im trying to make the flashlig...

Adjust your clip path to be constraned to the search container

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <style>
    body {
      background-color: black;
    }

    .search-container {
      position: fixed;
      top: 0;
      left: calc(50% + 40vw);
      width: 7vw;
      height: 3vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .flashlight {
      position: absolute;
      width: 100%;
      height: 100%;
      pointer-events: none;
      background: radial-gradient(circle 50px at var(--x, 50%) var(--y, 50%),
          rgba(255, 255, 255, 1) 0%,
          rgba(255, 255, 255, 0) 60%);
      clip-path: inset(0 0 0 0);
    }

    #searchButton {
      width: 100%;
      height: 100%;
      border: 0;
      border-radius: 20px;
      outline: 0;
      color: #ffffff;
      background-color: #25252a;
      font-size: 2vh;
      position: relative;
      z-index: 1;
    }
  </style>
</head>

<body>
  <div class="search-container">
    <div class="flashlight"></div>
    <button id="searchButton">Search</button>
  </div>

  <script>
    const flashlight = document.querySelector(".flashlight");
    const searchContainer = document.querySelector(".search-container");

    searchContainer.addEventListener("mousemove", (e) => {
      const rect = searchContainer.getBoundingClientRect();
      const x = e.clientX - rect.left;
      const y = e.clientY - rect.top;
      flashlight.style.setProperty("--x", `${x}px`);
      flashlight.style.setProperty("--y", `${y}px`);
    });
  </script>
</body>

</html>

@gray heron

royal nymph
#

all these programs support NO_COLOR and explicitly document it

#

there are probably way more that support it but don't document it

#

for example tree

valid jetty
#

ok there

valid jetty
#

did i take it too far

royal nymph
#

HORROR

valid jetty
#

:3

#

you love rust tho

if env::var("NO_COLOR").is_ok_and(|x| !x.is_empty()) {
    disable_colors!()
}
civic oar
#

does anyone have an updated version of like rounded chat bubbles and like maybe for chanel names too

#

actually i found one for messages so just one for channels

viscid grove
valid jetty
ornate quiver
frosty obsidian
#

nop

#

github uses linguist for syntax highlighting

#

and they have some requirements for new languages

valid jetty
pale orchid
#

Oh! Pro gaming! Do any of y'all play Helldivers 2?

dense sand
hoary sluice
spark tiger
#

there were like 4 different PRs fixing this but none got merged isob

#

and i'm not even sure like whether it's an issue in zed or wasm or wasmtime or wasi or ???

#

this is reproduceable with just regular wasmtime but maybe it's intended? idrk

hoary sluice
hoary sluice
#

the windows one is never gonna be stable if the og version keeps crashing

spark tiger
hoary sluice
#

smn

#

smh

spark tiger
hoary sluice
#

isnt that paid

spark tiger
cerulean plover
valid jetty
#

i use the rust lsp but i could live without it

hoary sluice
#

most things i type i let the lsp autocomplete

#

i mostly type lowercase cause i made the bad decision of only getting 34 keys, not 36, so i have 2 less thumb keys and pressing shift requires holding down s or i, so id rather just type it in lowercase and let the lsp autocomplete

#

its become a habit and now i cant write kotlin anymore cause the intellij kotlin lsp is case sensitive

#

maybe i should switch tab and space cause tab has a dedicated key rn

valid jetty
hoary sluice