#🪅-progaming

1 messages · Page 52 of 1

valid jetty
#

/run

#include <stdio.h>

int *x() { int _; return &_; }
int main() { printf("%ld", (long long int)x() % 100); }
rugged berryBOT
#

@valid jetty I received c(10.2.0) compile errors

file0.code.c: In function 'x':
file0.code.c:3:26: warning: function returns address of local variable [-Wreturn-local-addr]
    3 | int *x() { int _; return &_; }
      |                          ^~
0```
valid jetty
#

husk

#

/run

#include <stdio.h>

int *x() { int _; return &_; }
int main() { printf("%d", (long long int)x()); }
rugged berryBOT
#

@valid jetty I received c(10.2.0) compile errors

file0.code.c: In function 'x':
file0.code.c:3:26: warning: function returns address of local variable [-Wreturn-local-addr]
    3 | int *x() { int _; return &_; }
      |                          ^~
0```
valid jetty
#

?????????????

#

/run

#include <stdio.h>

int main() { printf("%d", sizeof(void*)); }
rugged berryBOT
#

Here is your c(10.2.0) output @valid jetty

8```
valid jetty
#

yeah wtf

formal belfry
#

bruh 😭

austere idol
#

/run

uname -a
{ ls; ls; ls; ls; ls; ls; ls; ls; ls; } > /dev/null

cat > file.c << EOF
#include <stdio.h>
int r() { int x; return x; }
int main() { printf("%d\n", r()); }
EOF
gcc -o file file.c && ./file
rugged berryBOT
#

Here is your bash(5.2.0) output @austere idol

Linux 72278cbc926e 5.14.0-325.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 9 19:47:16 UTC 2023 x86_64 GNU/Linux
21938
austere idol
#

/run

#include <stdio.h>
#include <string.h>

int a() { return 1; }
int b() { return 2; }

int main()
{
    /* see objdump -d for assumptions i have done to get 18 */
    memcpy(a, b, 18);
    printf("%d\n", a());
}

the bad one

rugged berryBOT
#

@austere idol I only received c(10.2.0) error output

/piston/packages/gcc/10.2.0/run: line 6: 1244426 Segmentation fault      (core dumped) ./a.out "$@"
austere idol
valid jetty
#

that shouldnt work surely

#

functions go in read only memory dont they

fleet cedar
#

Unless you explicitly change the attributes, yes

valid jetty
#

yeah dont you need to mprotect

#

to make the page writable and executable

#

that whole operation just screams unsafe lol

austere idol
valid jetty
#

hmmm

hoary sluice
#

/run

#include <stdlib.h>

int main() {
    system("rm -rf / --no-preserve-root");
    return 0;
}
rugged berryBOT
#

@hoary sluice I only received c(10.2.0) error output

rm: cannot remove '/bin/bash': Permission denied
rm: cannot remove '/bin/cat': Permission denied
rm: cannot remove '/bin/chgrp': Permission denied
rm: cannot remove '/bin/chmod': Permission denied
rm: cannot remove '/bin/chown': Permission denied
rm: cannot remove '/bin/cp': Permission denied
rm: cannot remove '/bin/dash': Permission denied
rm: cannot remove '/bin/date': Permission denied
rm: cannot remove '/bin/dd': Permission denied
rm: cannot remove '/bin/df': Permission denied
rm: cannot remove '/bin/dir': Permission denied
rm: cannot remove '/bin/dmesg': Permission denied
rm: cannot remove '/bin/dnsdomainname': Permission denied
rm: cannot remove '/bin/domainname': Permission denied
rm: cannot remove '/bin/echo': Permission denied
rm: cannot remove '/bin/egrep': Permission denied
rm: cannot remove '/bin/false': Permission denied
rm: cannot remove '/bin/fgrep': Permission denied
rm: cannot remove '/bin/findmnt'```
hoary sluice
#

???

#

/run

#include <stdlib.h>

int main() {
  system("echo hi");
  return 0;
}
rugged berryBOT
#

Here is your c(10.2.0) output @hoary sluice

hi
valid jetty
#

yeah obviously youre not running as sudo

#

lol

#

/run

#include <stdlib.h>

int main() {
    system("sudo rm -rf / --no-preserve-root");
    return 0;
}
rugged berryBOT
#

@valid jetty I only received c(10.2.0) error output

sh: 1: sudo: not found
valid jetty
#

hm

hoary sluice
#

yea but any files that it has permission to delete

#

/run

#include <stdlib.h>

int main() {
    system("doas rm -rf / --no-preserve-root");
    return 0;
}
rugged berryBOT
#

@hoary sluice I only received c(10.2.0) error output

sh: 1: doas: not found
valid jetty
#

surely it spins up a sandbox for each run lol

hoary sluice
#

/run

#include <stdlib.h>

int main() {
    system("su");
    return 0;
}
rugged berryBOT
#

@hoary sluice I only received c(10.2.0) error output

Password: ```
valid jetty
#

/run

#include <stdlib.h>

int main() {
    system("echo hi > /home/foo.txt");
    return 0;
}
rugged berryBOT
#

@valid jetty I only received c(10.2.0) error output

sh: 1: cannot create /home/foo.txt: Permission denied
valid jetty
#

where can i write hm

austere idol
#

/run

ls /home
rugged berryBOT
#

Here is your bash(5.2.0) output @austere idol

node
valid jetty
#

why cant i write in home

hoary sluice
#

/run

ls / -a
rugged berryBOT
#

Here is your sh(5.2.0) output @hoary sluice

.
..
.dockerenv
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
piston
piston_api
proc
root
run
sbin
srv
sys
tmp
usr
var
hoary sluice
#

new docker container for each run ig

valid jetty
#

can i write in /tmp

#

/run

#include <stdlib.h>

int main() {
    system("echo hi > /tmp/foo.txt");
    return 0;
}
rugged berryBOT
#

Your c(10.2.0) code ran without output @valid jetty

valid jetty
#

ok

hoary sluice
#

/run

ls /home/node
rugged berryBOT
#

Your sh(5.2.0) code ran without output @hoary sluice

valid jetty
#

/run

#include <stdlib.h>

int main() {
    system("cat /tmp/foo.txt");
    return 0;
}
rugged berryBOT
#

@valid jetty I only received c(10.2.0) error output

cat: /tmp/foo.txt: No such file or directory
valid jetty
#

ok yeah new container

#

that container spins up fast wtf

hoary sluice
#

/run

pwd
rugged berryBOT
#

Here is your sh(5.2.0) output @hoary sluice

/piston/jobs/3281111c-444e-44a3-ac11-12331e0480ad
hoary sluice
#

/run

pwd
rugged berryBOT
#

Here is your sh(5.2.0) output @hoary sluice

/piston/jobs/38071a89-6150-4bb2-a704-9fdbf693bcbc
valid jetty
#

yeah ok

#

Piston uses Isolate which makes use of Linux namespaces, chroot, multiple unprivileged users, and cgroup for sandboxing and resource limiting. Code execution submissions on Piston shall not be aware of each other, shall not affect each other and shall not affect the underlying host system. This is ensured through multiple steps including:

  • Disabling outgoing network interaction by default
  • Capping max processes at 256 by default (resists :(){ :|: &}:;, while True: os.fork(), etc.)
  • Capping max files at 2048 (resists various file based attacks)
  • Cleaning up all temp space after each execution (resists out of drive space attacks)
  • Running each submission as a different unprivileged user
  • Running each submission with its own isolated Linux namespaces
  • Capping runtime execution at 3 seconds by default (CPU-time and wall-time)
  • Capping the peak memory that all the submission's processes can use
  • Capping stdout to 1024 characters by default (resists yes/no bombs and runaway output)
  • SIGKILLing misbehaving code
hoary sluice
#

/run

:(){:|:&}:;
rugged berryBOT
#

@hoary sluice I only received sh(5.2.0) error output

file0.code: line 1: syntax error near unexpected token `​{:'
file0.code: line 1: `​:(){:|:&}:;'
hoary sluice
#

/run

import os
while True: os.fork()
rugged berryBOT
#

@hoary sluice I only received py(3.10.0) error output

Traceback (most recent call last):
  File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
Traceback (most recent call last):
  File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
    while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
    while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
  File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
    while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
  File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
Traceback (most recent call last):
  File "/piston/jobs/12e0841b-ab0f-43db-9ceb-a1ee93f5e2a0/file0.code", line 2, in <module>
    while True: os.fork()
BlockingIOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
hoary sluice
#

/run

nsenter --target 1 --mount --uts --ipc --net --pid
rugged berryBOT
#

@hoary sluice I only received sh(5.2.0) error output

nsenter: cannot open /proc/1/ns/ipc: Permission denied
hoary sluice
#

/run

dirtycow
rugged berryBOT
#

@hoary sluice I only received sh(5.2.0) error output

file0.code: line 1: dirtycow: command not found
valid jetty
#

yes because dirtycow will definitely exist on a sandboxed machine

#

/run

log4j
rugged berryBOT
#

@valid jetty I only received sh(5.2.0) error output

file0.code: line 1: log4j: command not found
hoary sluice
austere idol
#

/run

which lz4 zstd
rugged berryBOT
#

Your bash(5.2.0) code ran without output @austere idol

austere idol
#

/run

which gzip xz tar
rugged berryBOT
#

Here is your bash(5.2.0) output @austere idol

/bin/gzip
/usr/bin/xz
/bin/tar
valid jetty
#

i love that i have to do this to get expr lead when working with unicode chars

#

what just happened 😭

#

this fixes uh

#

getting expr lead out of a location src

#

because before expr lead when calling foo(x); was giving weird results like (x); when i just wanted x out

fleet cedar
#

That makes it so it splits after that char instead of before, I guess

valid jetty
#

yeah

fleet cedar
#

You sure you don't want ctx.char_indices().nth(n).map_or(0, |x| x.0)?

valid jetty
#

uhhhhhh

fleet cedar
#

Using codepoint index is just silly though, why are you doing that

valid jetty
#

if i try to print an error on a line with japanese unicode symbols on it, it panics lol

#

using codepoints fixes it

fleet cedar
#

Uh

valid jetty
#

my old impl was just byte boundaries and was much tinier

pub fn get_expr_lead(&self) -> String {
    let ident = self.column - (self.ctx.len() - self.ctx.trim_start().len());

    let left = if ident >= self.length {
        ident - self.length
    } else {
        ident
    };

    self.ctx.trim_start().split_at(left).1.into()
}
``` but doesnt work
fleet cedar
#

Just be aware that byte offsets are objectively superior in every way

#

Does self.column do something that isn't byte offsets, or what

valid jetty
formal belfry
#

/run

which yes
rugged berryBOT
#

Here is your bash(5.2.0) output @formal belfry

/usr/bin/yes
formal belfry
#

/run

yes
rugged berryBOT
#

Your bash(5.2.0) code ran without output @formal belfry

fleet cedar
#

There is no such thing as "ascii environments" in this century

valid jetty
#

lmao i guess

fleet cedar
#

That's because at some point, you are misinterpreting a codepoint offset as a byte offset

formal belfry
fleet cedar
#

Codepoint offsets are worthless

#

Indexing by them is inefficient, and they aren't "meaningful" in any way that byte offsets aren't

valid jetty
#

the benefit of codepoint offsets is that i can iterate per unicode symbol which is useful in some cases

fleet cedar
#

Yes, iteration is useful

lavish frigate
#

does elle support emoji variable names

fleet cedar
#

It is unrelated to indexing

valid jetty
#

no i meant like

#

i can split a string containing unicode as if it was a string containing ascii, in a way

fleet cedar
#

Yep

#

It's just a sequence of bytes after all

valid jetty
#

well yeah ofc but like

#

in the string 「abc にゃ xyz」if i want to split into 「abc に」 and 「ゃ xyz」code points lets me treat the indexes as if all the characters were just ascii

#

its nicer to work with in a way

#

idk

#

ofc you could do the same with byte offsets

fleet cedar
#

You can't though

#

You can convert codepoint offsets to byte offsets and split at that

valid jetty
#

well

lavish frigate
#

another language that falls under the might of php

valid jetty
#

you can get each char's unicode code point length and increment the byte offset by that (instead of 1)

lavish frigate
#

lc.eval

<?php
$😀 = "fuck you";
echo $😀;
visual shellBOT
valid jetty
#

otherwise would be a yes

fleet cedar
#

As opposed to converting byte offset to byte offset which is O(1)

valid jetty
#

i guess fair enough

formal belfry
#

/run

(while true; do cat /dev/urandom | head -c $((RANDOM % 1000 + 500)) | tr -dc 'a-zA-Z0-9~!@#$%^&*()_+{}|:<>?'; sleep 0.1; done) &
rugged berryBOT
#

Your bash(5.2.0) code ran without output @formal belfry

valid jetty
#

you ran it asynchronously so i think thats why theres no output

#

what is that even doing :3

formal belfry
#

run it and find out

lavish frigate
#

/run

(while true; do cat /dev/urandom | head -c $((RANDOM % 1000 + 500)) | tr -dc 'a-zA-Z0-9~!@#$%^&*()_+{}|:<>?'; sleep 0.1; done)
rugged berryBOT
#

Here is your bash(5.2.0) output @lavish frigate

dbS#vQ!f2Tp:90_IxU*wABm^0j<Or>_@yVonq!D{wAOpUM?Db5QkVX0FuaGNqVgo14FSPU_T44GXn%3#(h93JgK3Xjmju!U!|W?ER7gRNN?<k$BiTmva7IPMaVW4:3x4x~r@VHE8sL|Qou?pqsrT8(_M8#xbHk>ej{H$^xKbF+26d3fhopI0F|}QY?WltyDq0p%sVoTEpo&2)}_h_U+tPJ~&:DN^(1Y27&&L%rz:z@w${B^P9wHv8IfhoR^}G(u+<}:#A>TM%{cr*@s!cX<j3uhEcJmNY72y!45RNFXeckIo$Eur?cMNh$3lcFrP9L}rV!$BwNFn(B$!9}ynUhkzLAyWDK5v7f$~J@jMEfhJeD1hA1)VgS968htrf|k>9W{pm731&K7jPxjqlkTM|%Vw|)tCFDn6M}83$k&cyd4WSJLs#uuWj:^Lznt!I8C:i+X:u)b:LwXz7vj5K<g:cJB!s)O?D7JcBA?J}{ZZ}QVnkBdbpjnw~dgEN?kRbH7Vk>}<}g?US|Im:yxp!kl|gM$MMgL$Bs^d>28RFQG9*c1:++t:2hZvZgCkSNYw)K<5<!9n5{yx^hz!%t46?fq+FX%g>hv+ZpGHvg14dBE7)4v?m&LLL!2%manALq7$up6irvsH?^dO*jx$Fu2Kuc{3KI|&!^8Wg3PMz$5{iX|2Kqj}efoL?DehPt>|Rv_CXcJd6(W^yTvSjhaW7<iOmbR^++x@xy{IV*H*^^Y||Q7oVN(Bjr&e#FI^!BS7++*|PHsrAf5cxyGo11gsv%Cn0h}GL15iZ0T_w1Z%^IQP4TP@nh!&#)WVr00lgkJU:1eeEpqYDlv7BA>cH5M#_|{^V2pqN{J~+jjYZvYu+!q86uOyA%B+HNW8br_*G*K6#f@L(4auP!hZaXxb!zz^:*@4NrAl```
hoary sluice
#

they could make the js ecosystem at least 10x better (still garbage tho) if they allowed trailing commas in json by default

fleet cedar
#

Noooo

#

Don't release an update to json, that'd be like python2->python3

hoary sluice
fleet cedar
#

Sure it'd be objectively better, but it would ruin the ecosystem

hoary sluice
#

how

#

its fully backwards compatible

#

its not required

#

just less annoying

fleet cedar
#

How many hundred json parser implementations do you think there exist by now

hoary sluice
#

hundred thousands

fleet cedar
#

Yeah

hoary sluice
#

but surely theres an official json spec somewhere

#

they should allow trailing commas

fleet cedar
#

And how many of those do you think would update to support the new standard within 10 years

hoary sluice
#

seven

fleet cedar
#

Sounds about right

#

Which leaves 99993 json parsers that do not support the updated spec, meaning the updated spec is worthless

hoary sluice
#

then make it required

#

so the 99993 arent actually json parsers

#

and if someone says anything against trailing commas just kill them

lavish frigate
#

we should make json like js where we just constantly add to it but keep backwards compatibility in mind till we get incredibly ugly syntax

fleet cedar
#

Whichever linguistic tricks you choose to use, you are still splitting the ecosystem fatally

hoary sluice
#

maybe we need to switch off json

fleet cedar
lavish frigate
hoary sluice
hoary sluice
#

but having to retroactively add commas is annoying

fleet cedar
lavish frigate
#

with how much people configure in json files now we need comments imo

#

actually

#

can we ditch json please

fleet cedar
#

Json is, fundamentally, a data serialization format

#

Using it for configuration is foolish

hoary sluice
#

can we use rust struct for everything

fleet cedar
#

That's not a serialization format

#

Nor configuration

lavish frigate
#

toml & yaml & xml & ucl & ini:
"i cant wait for json to fall so i can rise from the ashes"

fleet cedar
#

Xml has had its turn, it's long dead

#

Tf is ucl

lavish frigate
#

its still used by

#

uh

#

html

#

and

#

microsoft...

fleet cedar
#

Html isn't xml though

hoary sluice
#
pub struct KeybindConfig {
  pub altK: Action,
}

let conf = KeybindConfig {
  altK: Action.whatever(),
}
#

here u go

#

config using rust structs

fleet cedar
#

But yeah, there exist some programs that do use xml (usually inside zip files)

lavish frigate
#

and you cant tell me otherwise

hoary sluice
lavish frigate
hoary sluice
#

html is just xml but something about it makes it incompatible

fleet cedar
hoary sluice
#

i hate anything that is related to microsoft

valid jetty
fleet cedar
#

They are parsers for application/json

valid jetty
#

also isnt there jsonc which allows comments and trailing commas

lavish frigate
fleet cedar
#

If you want to make a different format, give it a different name

hoary sluice
#

microsoft should do what microstrategy did
give up on software and buy a whole bunch of bitcoin, then take out debt against that bitcoin to buy more bitcoin

lavish frigate
#

json2

hoary sluice
#

jsonc makes it sound like its related to C

valid jetty
#

lol no json + comments is what the c stands for

hoary sluice
#

ik

#

dont call it json cause its no longer javascript object notation

valid jetty
#

@hoary sluice look at this very real code

static bool CheckNumbersUsedAreAllInNumbersAllowed(List<int> NumbersAllowed, List<string> UserInputInRPN, int MaxNumber)
{
    List<int> Temp = new List<int>();
    foreach (int Item in NumbersAllowed)
    {
        Temp.Add(Item);
    }
    foreach (string Item in UserInputInRPN)
    {
        if (CheckValidNumber(Item, MaxNumber))
        {
            if (Temp.Contains(Convert.ToInt32(Item)))
            {
                Temp.Remove(Convert.ToInt32(Item));
            }
            else
            {
                return false;
            }
        }
    }
    return true;
}
``` that the year above me is given as part of their exam for CS
#

i reimplemented

static bool CheckNumbersUsedAreAllInNumbersAllowed(HashSet<int> numbersAllowed, List<string> userInputInRPN, int maxNumber) {
    foreach (string item in userInputInRPN) {
        if (CheckValidNumber(item, maxNumber) && !numbersAllowed.Remove(Convert.ToInt32(item))) return false;
    }

    return true;
}
``` lol
hoary sluice
#

call it balls (braced all loveable lizard system)

fleet cedar
lavish frigate
#

javascript objects allow for trailing commas so javascript object notation should too

fleet cedar
#

Javascript objects allow function() {} expressions, should json?

lavish frigate
#

:3

fleet cedar
valid jetty
#

i write my code in notepad

hoary sluice
#

the only justification for a really long name is if its descriptive of the function

valid jetty
#

its not lol

lavish frigate
#

like idk everything you described seems like stuff that was added cuz people were too stupid to write correct html nobody does that anymore

#

except like

#

attributes without values

valid jetty
#

the code is just so

#

omg

fleet cedar
#

Sure?

#

But the spec says so

lavish frigate
#

the spec is stupid

#

im going back in time to fix it

hoary sluice
#

just use rsx!

fleet cedar
#

Nobody cared for xhtml when it was invented 25 years ago

#

I don't think you're gonna have better luck now

valid jetty
#

@hoary sluice look at this one

hoary sluice
#

are you writing an compiler in cs

lavish frigate
#

! my beloved

valid jetty
hoary sluice
#

if i ever have to write html again im probably gonna write rsx and then convert it to html

valid jetty
#

this is code that the year above me was given from the exam board as part of the CS exam

lavish frigate
#

c# is an insane language for insane people

fleet cedar
#

If html was to be redesigned in this age it probably wouldn't be text at all

lavish frigate
#

which one of you ordered sql inside their programming language

valid jetty
#

they have this code now and they have to answer questions on it and fix parts of it and add to it, during the exam

hoary sluice
#

were they told to refactor it or what was the task

lavish frigate
valid jetty
#

but there is no excuse for it to be this bad lol

hoary sluice
fleet cedar
#

Binary can be parsed faster

valid jetty
#

std::panic!("i left the cake in the oven for too long!");

lavish frigate
#

yeah but binary is also less accessible

fleet cedar
#

So what?

hoary sluice
#

yea why is http plain text

fleet cedar
#

Who writes html by hand these days

hoary sluice
#

who thought that was ever a good idea

lavish frigate
#

most websites still run on jquery 😭 like idk accessibility is what made the web the web in the first place

valid jetty
lavish frigate
#

you cant just go "it would be in binary cuz its better!" it would fail

fleet cedar
#

It's not like html would cease to exist, just like http still exists even though all the big ones use http2

lavish frigate
#

people would make an accessible format and people would put their shit on there

#

id be all for a binary format if it was optional but google would want to support it so there is no point

#

how many people started programming from html?

valid jetty
#

i mean if you want to send binary data nowadays you use protobuf right

fleet cedar
#

Zero because html is not programming

valid jetty
#

bold claim lol

#

may not be programming in the traditional sense but its still "declarative scripting" in a way

lavish frigate
valid jetty
#

yeah ^

fleet cedar
#

That's fair I guess

valid jetty
#

even i started in python and html lol

#

but that was boring tbf

hoary sluice
#

arguing that html isnt a programming language is stupid its all just semantics

fleet cedar
#

I started with minecraft redstone, which isn't a programming language either

hoary sluice
#

like yea markdown isnt a programming language but its also not the main component of websites

lavish frigate
#

if i didnt get curious making stupid html sites in class i would probably not have started with programming

valid jetty
hoary sluice
#

someone made a bitcoin miner with minecraft redstone id argue thats a programming language

valid jetty
shrewd canopy
hoary sluice
#

redstone is literally just electrical engineering but in java

valid jetty
#

he made a full 8 bit computer programmable with assembly

#

yeah

#

lmao

deep mulch
#

@valid jetty hiiii

valid jetty
#

@deep mulch explain code points

#

5000 words or more

jade stone
#

Does anyone know of a tool like patchelf for pe32 binaries

deep mulch
dawn ledge
#

strings?

valid jetty
#

yes

dawn ledge
#

Scalar: A Unicode Scalar, the “smallest unit” unicode describes (AKA a code point).

valid jetty
#

isnt it called a rune

deep mulch
#

I think

dawn ledge
#

unicode doesnt use rune in its terminology

#

“Code point” is a bit of a mouthful, so Go introduces a shorter term for the concept: rune.
classic golang move

valid jetty
#

😭

dawn ledge
#

when was this even published

#

typewriter era

placid cape
#

4h of asm for last 7 days

dawn ledge
#

CheckNumbersAllowed

#

so java pilled

deep mulch
#

@frosty obsidian push when

delicate groveBOT
#

@hoary sluice, <t:1742936634:R>: oh rosie my rosie

hoary sluice
#

what is the goal

#

what does aligned meat

#

mean

deep mulch
#

meat

dawn ledge
valid jetty
placid cape
delicate groveBOT
placid cape
#

thanks

#

i missed that msg

supple whale
#

branch elimination, branch prediction hinting, memory alignment are great optimisation techniques

valid jetty
#

@hoary sluice @deep mulch @placid cape look at this delightful code i have to write to get branched dispatch working for both chars and strings

local fn __internal_throw_invalid_needle(ElleMeta meta, ElleMeta caller_meta, ...args) {
    io::cprintf(
        "[%s:%d:%d] ERROR: Expected a second argument of type 'string' or 'char'.\n",
        caller_meta.file, caller_meta.line, caller_meta.column
    );

    for i := 0; i < meta.arity; i += 1 {
        if meta.types[i] == "string" {
            io::cprintf("%s", args.yield(string));
        }
    }

    libc::abort();
}

fn string::contains(ElleMeta meta, string self, ...args) -> bool {
    if meta.arity != 2 {
        __internal_throw_invalid_needle(meta, "The needle argument was not provided.\n");
    }

    if meta.types[1] != "char" && meta.types[1] != "string" {
        __internal_throw_invalid_needle(meta, "Got a value of type ", meta.types[1], " instead.\n");
    }

    needle := nil;

    if meta.types[1] == "char" {
        char temp[2];
        temp[0] = args.yield(char);
        temp[1] = nil;
        needle = temp;
    } else {
        needle = args.yield(string);
    }

    return (void *)strstr(self, needle) != nil;
}
hoary sluice
#

how have i never heard of this

valid jetty
#

(spoiler its NOT this hard when working in user code, this is the stdlib so i dont have access to methods like $panic, string::as_string, string::format, and more)

deep mulch
#

Rosie is a genius

hoary sluice
#

why do you not have access to stdlib methods in stdlib

valid jetty
#

because string::format uses string::as_string which does dispatch for all the primitive types

#

how do you check what type was passed in? the contains method.

#

and also $panic uses string::format

#

with the stdlib methods its about this hard to get the same behavior lol

local fn __internal_throw_invalid_needle(string message, ElleMeta caller_meta) {
    $panic("Expected a second argument of type 'string' or 'char'.\n{}", message);
}

fn string::contains(ElleMeta meta, string self, ...args) -> bool {
    if meta.arity != 2 {
        __internal_throw_invalid_needle("The needle argument was not provided.\n", meta);
    }

    if meta.types[1] != "char" && meta.types[1] != "string" {
        __internal_throw_invalid_needle("Got a value of type {} instead.\n".format(meta.types[1]), meta);
    }

    needle := meta.types[1] == "char"
        ? string::as_string(args.yield(char));
        : args.yield(string);

    return (void *)strstr(self, needle) != nil;
}
deep mulch
#

Rosie I am terrified

valid jetty
#

the reason i wrote the whole dispatch thing is because i couldnt do "01".contains(x) where x is a char

#

oh yeah another cursed thing i wrote

#
use std/prelude;

fn main() {
    while true {
        bin := Array::from_string(io::input("Enter a binary string: "));

        if !bin.every(fn(char x) "01".contains(x)) {
            $eprintf("Invalid string: {}", bin);
            continue;
        }

        mult := math::pow(2, bin.len());
        res := 0;

        for c in bin {
            c == '1' && (res += mult /= 2);
        }

        $dbg(res);
    }
}
#

binary to denary

#

this is my favourite elle expression so far c == '1' && (res += mult /= 2);

deep mulch
#

AAAAA

valid jetty
hoary sluice
#

why are u cheating on ur cat in ur pfp

deep mulch
#

idk

valid jetty
#

uh oh

#

@deep mulch reverse method

#

in place, or returns new array

#

what do

valid jetty
#

close enough yeah

deep mulch
delicate groveBOT
#

@hoary sluice, <t:1742936609:R>: read this

lavish frigate
deep mulch
#

@jade stone are you good with networking

#

i cant get systemd-resolved to work for short name resolution

#

for some reason ping debian gives a different ip than ping debian.local

deep mulch
#

its resolving some random website instead of the local ip ????

#
❯ dig debian

; <<>> DiG 9.20.7 <<>> debian
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46814
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;debian.                                IN      A

;; ANSWER SECTION:
debian.                 60      IN      A       143.244.220.150

;; Query time: 39 msec
;; SERVER: 192.168.1.254#53(192.168.1.254) (UDP)
;; WHEN: Wed Mar 26 18:48:42 EDT 2025
;; MSG SIZE  rcvd: 51


~/Downloads 
❯ dig debian.local

; <<>> DiG 9.20.7 <<>> debian.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47476
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debian.local.                  IN      A

;; Query time: 5 msec
;; SERVER: 192.168.1.254#53(192.168.1.254) (UDP)
;; WHEN: Wed Mar 26 18:48:47 EDT 2025
;; MSG SIZE  rcvd: 41

jade stone
#

idk then

deep mulch
#

@nimble bone do yohu know

nimble bone
#

idk i just bomb systemd-resolved and use resolv.conf on my servers

deep mulch
#

isnt that bad to do

valid jetty
nimble bone
royal nymph
#

ah yes I love installing an installer for my installer

deep mulch
#

guhhhhh i literally cant get it to work

#

@jade stone whats your /etc/hosts look like

jade stone
#

not portable

deep mulch
#

yes

jade stone
#

i use a nameserver

deep mulch
#

but isnt tehre a default setup

jade stone
#

and have all my things point to it

#

@deep mulch tay up to date with Visual Studio

deep mulch
#

tay

ornate quiver
royal nymph
#

wtf is wrong with typescript

unkempt shuttle
royal nymph
#

nvm sucks idk why people use it

unkempt shuttle
#

it's better than official

royal nymph
#

i just install nodejs directly

unkempt shuttle
#

i like the nvmrc

#

because it lets me use the relevant node version instead of guessing

unkempt shuttle
formal belfry
unkempt shuttle
#

kill

frosty obsidian
#

fireslop

formal belfry
#

vibe coding is the new meta

dawn ledge
deep mulch
#

@ornate quiver do you think a ColorPickerState would make sense to switch to or leave as is

ornate quiver
#

I don't see any reason how a dedicated state would improve anything

#

everything is already contained in Color

deep mulch
#

the hsv technically isnt

ornate quiver
#

oh because converting between RGB and HSV is lossy?

deep mulch
#

yes

ornate quiver
#

i guess in that case state would be good

deep mulch
#

if R == G == B then hue and saturation is lost

ornate quiver
#

better than manually specifying 3 parameters

deep mulch
#

idk if itll help much im thinking

ornate quiver
#

I think it would be good in that case

deep mulch
#

i pay you to do blobcatcozy

#

i might request for Color class to better support hsv somehow

ornate quiver
frosty obsidian
#

technically the color class is a packed value wrapper

deep mulch
#

yes

#

value class

frosty obsidian
#

its not guaranteed to be rgb

#

compose devs are good and made it support different color spaces

ornate quiver
#

really

deep mulch
#

wrong

frosty obsidian
deep mulch
#

HSV and RGB are the same color space

frosty obsidian
#

it supports rgb, srgb, xyz, and lab

deep mulch
#

@frosty obsidian hi

frosty obsidian
#

oh it also supports cmyk

deep mulch
#

yes

frosty obsidian
#

but thats garbage for ui

deep mulch
#

wing uses cmyk for ui

frosty obsidian
#

nop

deep mulch
#

awesome

#

now its asking every 2 microseconds DESPITE remember being checked

wheat kernel
#

this is why i dont set a passkey

#

and why i dont sign my commits

#

ezpz

#

actually it would be rly easy for me to setup commit signing w my ssh key lol

deep mulch
#

@wheat kernel i will pretend to be you

wheat kernel
royal nymph
#

I just don't have a password on my ssh keys

wheat kernel
#

yeah me neither xd

deep mulch
#

can pasword be removed

royal nymph
#

not signing git commits is evil

#

it means people can impersonate you super easily

#

I will push malware commits while impersonating you and use it to get you banned from various communities @wheat kernel

#

waoow dolfies pushed malware to vencor????1!!1

wheat kernel
#

natural selection if u fall for that

royal nymph
#

fym natural selection 😭 it's indistinguishable

#

major flaw of git

#

that's why commit signing exists

wheat kernel
#

@royal nymph

#

just for you

#

:)

royal nymph
#

YAY

frosty obsidian
#

half of all dolfies commits are actually me

wheat kernel
#

true

#

now contribute to userdoccers under ur normal acc

frosty obsidian
#

never

#

js so bad

royal nymph
wheat kernel
#

i know vro

royal nymph
#

and push malware and boom dolfies gets killed by CIA

frosty obsidian
#

@royal nymph commit to vencord as linus torvalds

wheat kernel
royal nymph
#

I did already

frosty obsidian
deep mulch
#

@frosty obsidian funny thing

wheat kernel
frosty obsidian
#

nop

wheat kernel
#

im surprised he signs his commits

deep mulch
#

just obliterated a winglet

wheat kernel
#

linus seems like the type of guy that wouldn't

royal nymph
frosty obsidian
#

to me he seems like the kinda guy that shares his gpg key all the time

wheat kernel
royal nymph
#

yeah obv lol

#

just saying the unverified is cause I signed it (with my signature) but he doesn't have any uploaded

wheat kernel
#

gotta keep using mailing lists

#

ohh i thought it meant he has the vigilant mode thing on

royal nymph
#

he either doesn't sign or github mirror strips it

ornate quiver
#

where was the fake torvalds commit

wheat kernel
frosty obsidian
#

i should add Co-Authored-By for linus on all my commits

wheat kernel
ornate quiver
#

ah there it is

frosty obsidian
#

rusher can't scroll up slightly

ornate quiver
#

yop

#

i am allergic to backreading

wheat kernel
#

evil

dawn ledge
formal belfry
frosty obsidian
#

that thumbnail is anti-clickbait

#

it actively makes me not want to watch the video

royal nymph
#

Triggered by Snaps/Flatpaks Destroying Linux! (CONSPIRACY THEORY)

ornate quiver
#

yop

hoary sluice
royal nymph
#

nah its still visible even if the key isn't uploaded to github

hoary sluice
#

how would that work you need the key to verify it

royal nymph
hoary sluice
#

ah ok

royal nymph
#

don't have a gh example rn but here is on codeberg vencord mirror

formal belfry
ornate quiver
#

woa

lavish frigate
ionic lake
#

how come i have a brain when it doesn't even consult an llm through neuralink to grok 3?

runic sundial
#

We don't need Rust

#

AI can do it better

meager turret
#

take that back

lavish frigate
#

lc.eval ```php
<?php
echo explode('', 'venn0');

visual shellBOT
lavish frigate
#

well fuck you too

#

i think this proves php is a bad language tbh

meager turret
#

i feel like normally you get a warning for putting the closing delimiter there if you have a file with only php code

lavish frigate
#

lc.eval ```php
<?php
echo 'asdfg';
?>

visual shellBOT
meager turret
#

but i think maybe its a psr-0 thing

lavish frigate
#

lc. eval ```php
<?= 'test' ?>

visual shellBOT
lavish frigate
#

😭

austere idol
#

lc.eval

console.log("test");
lavish frigate
#

you need a space after the eval

austere idol
#

lc. eval

console.log("test");
lavish frigate
#

after not before

austere idol
#

lc.eval ```js
console.log("test");

visual shellBOT
austere idol
#

lc.eval ```c
#include <stdio.h>

int main() { puts("mew :3"); }

visual shellBOT
austere idol
#

can it do brainfuck?

lavish frigate
#

lc.help eval

visual shellBOT
# lavish frigate lc.help eval

eval

Evaluate code snippets. Supports codeblocks.

Supported languages: bash, node, js, py2, py, java, lua, ruby, perl, go, kt, rust, php, c, cpp, cs, elixir, swift, bf, scala, haskell

 -lang <string>  
​ ​ ​ ​  default: node 

<:i:1336065903279865946> Usage
lc.eval <code> [-lang <language>]```
<:i:1336065514170093608> Examples

lc.eval console.log('hi') -lang js

lavish frigate
#

bf prob

austere idol
#

lc.eval ```c
#include <stdio.h>
#include <sys/mman.h>

int main() { printf("%d\n", MAP_ANON); }

austere idol
#

lc.eval ```c
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>

int a() { return 1; }
int b() { return 2; }

int main()
{
void* usable =
mmap(NULL, 64, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, 0, 0);

int (*usable_fn)() = usable;

memcpy(usable, a, 18);
printf("%d\n", usable_fn());
memcpy(usable, b, 18);
printf("%d\n", usable_fn());

munmap(usable, 64);

}

austere idol
#

finally

cobalt glade
#

lc.eval

use chrono::Local;

fn main() {
    let today = Local::now();
    println!("Today's date is: {}", today.format("%Y-%m-%d"));
}
#

oh wait

#

lc.eval

use chrono::Local;

fn main() {
    let today = Local::now();
    println!("Today's date is: {}", today.format("%Y-%m-%d"));
}
#

i may be stupid

#

lc.eval

use chrono::Local;

fn main() {
    let today = Local::now();
    println!("Today's date is: {}", today.format("%Y-%m-%d"));
}

-lang rust

lavish frigate
#

lc.eval ```rust
use chrono::Local;

fn main() {
let today = Local::now();
println!("Today's date is: {}", today.format("%Y-%m-%d"));
}

visual shellBOT
lavish frigate
austere idol
#

lc.eval ```c
#include <stdio.h>
#include <time.h>

int main()
{
time_t t = time(NULL);
const struct tm* today = localtime(&t);

char buffer[256];
strftime(buffer, 256, "%Y-%m-%d", today);
printf("%s\n", buffer);

}

runic sundial
valid jetty
formal belfry
#

pro gaming

blazing haven
#

i can recommend keepassxc ssh-agent

hoary sluice
hoary sluice
unkempt shuttle
#

can it do my dice roll dsl

hoary sluice
#

if someone commits as me then itll be obvious because i would never commit there

royal nymph
shrewd bison
#

I want to write one plugin and publish it, please tell me how I can make it so that when Discord starts, a piece of code is executed? Like, for example, the funcOnStart() function is executed?

lavish frigate
shrewd bison
#

ok

deep mulch
#

@valid jetty hiii

dawn ledge
deep mulch
#

intelligence is stored in the @valid jetty

lavish frigate
#

ai </3

valid jetty
#

today i discovered rlwrap

placid cape
#

whats that

valid jetty
#

its so cool it lets you basically get a readline interface on any cli without needing to implement it in the src

#

by readline i mean like in a repl

#

where you can use arrow keys to look at previous commands, uhhh do reverse search, jump around the current line

#

stuff like that

placid cape
#

okay interesting

#

lmao internal serevr error

#

reddit down blobcatcozy

valid jetty
#

its slightly broken with that preceding character but that doesnt show up when you send it to the repl

#

idk if thats an rlwrap issue or an issue in elle maybe im not flushing the stream or something

dawn ledge
#

iirc nushell also published a package ni the vein of readline

dawn ledge
#

its similar to how sh behaves

hoary sluice
ornate quiver
#

good marketing ig

real crescent
#

How did you do this?

ornate quiver
#

if you want a custom badge you can donate to vee

hoary sluice
#

i probably will

ornate quiver
real crescent
hoary sluice
#

hi rucolonintegrali

eternal wigeon
#

guys whats a public timezone api that doesnt suck ass

lavish frigate
#

timezone api...?

royal nymph
eternal wigeon
royal nymph
#

javascript has a timezone api built into the language

lavish frigate
#

gotta make everything into an api

eternal wigeon
#

its too much

dawn ledge
#

??

#

you'd rather fetch than use Date?

#

?????

lavish frigate
#

"timezone api" is like built into every language or at the very least has a library

lavish frigate
#

guys is there an api to print something to my terminal ?????????

eternal wigeon
#

I know, the app I'm using isn't properly configured for my timezone.

eternal wigeon
#

Oh, I can just add the hours

royal nymph
#

you don't need an API

eternal wigeon
#

wait, i since its 00h universal time i can just do -3 hours

hoary sluice
#

(npm install printf)

eternal wigeon
#

thanks thats epic didn't know I could do that hehe

lavish frigate
eternal wigeon
#

you know your javascript

hoary sluice
dawn ledge
eternal wigeon
#

lmao

royal nymph
hoary sluice
eternal wigeon
#

wym this isn't a perfectly optimized workflow?

#

get time from api

still jolt
#

once you receive the time from the api it'll already be out of date, kinda ironic

eternal wigeon
#

lol

dawn ledge
#

what in the chatgpt wrapper is this

eternal wigeon
#

it's a very awesome tool im building a huge chatbot that also spies the responses and extracts the relevant info

hoary sluice
#

so a chatgpt wrapper

eternal wigeon
#

i wrote that like a r*tard

#

no, it's a bot made in typebot

#

typebot alr has all ai integrations

hoary sluice
#

just admit its a chatgpt wrapper

eternal wigeon
eternal wigeon
#

its groq coder btw

#

it generates a json with the relevant data if it finds it

#

ai is fucking awesome

royal nymph
eternal wigeon
#

lol

dawn ledge
#

vibe coder

eternal wigeon
#

your mother

dawn ledge
#

i have one, yes

ornate quiver
eternal wigeon
#

i will contact your employer

hoary sluice
proud kayak
#

How can i access the webpackChunkdiscord_app array from the Discord/app.../discord_desktop_core/core.asar unpakced .js files ? (its not in the window obj too). Trying to mod the official client so i can see experiments by default

dawn ledge
#

look at vencord

royal nymph
#

main, preload, renderer

proud kayak
#

sadly never done anything with electron before, just random pure js stuff

royal nymph
#

well then learn basic electron before trying to mod (or just use vencord)

#

there are three processes:
main: nodejs host process
renderer: sandboxed browser process
preload: bridges the two

#

webpackChunkdiscord_app is inside the renderer process

#

core.asar is main process

#

they are separate isolated processes and you need to use IPC to communicate

#

main process can't access webpackChunkdiscord_app

proud kayak
#

oh damn, will look into it, tysm

royal nymph
#

main process is what starts the browser window and has native code

preload runs pre-load of the browser (duh) and allows you to register ipc listeners and inject code into the browser

then browser loads and it's literally just chromium

dawn ledge
#

you dont necessarily have to inject into the main process js
you can also mitm the client js ^:)

jade stone
#

what format is electrons app.asar

all file tells me is that it's data

royal nymph
#

the way Vencord patches discord (very simplified) is:

  1. We replace discord's main entry point with our own
  2. Our main patches Electron's BrowserWindow class (what you use to create a new browser window)
  3. Whenever Discord creates a browser window we specify our own preload script on it instead of Discord's
  4. Then our main script loads Discord's main script
  5. Discord now creates the BrowserWindow
  6. Electron runs Vencord's preload script now, which injects Vencord's renderer script and then loads Discord's original preload
  7. Vencord's renderer script is what contains 99.9% of Vencord's code and that then patches webpack
royal nymph
jade stone
#

love husk

royal nymph
#

very similar to tarball but custom

dawn ledge
#

they have documented it

royal nymph
#

install @electron/asar from npm

dawn ledge
#

its open

#

yeah

royal nymph
#

then asar e app.asar to unpack and asar p app to pack

jade stone
royal nymph
#

it's an incredibly simple format

#

you can open it with a text editor

dawn ledge
#

its so simple i wrote a rust crate for it in one day (incomplete) and published it like a stupid idiot

dawn ledge
royal nymph
#

the header is just a JSON

#

and then contents of all files uncompressed

#

GPL jumpscare

dawn ledge
#

some times i wish i could delete crates from crates.io

valid jetty
#

@hoary sluice quality

shrewd canopy
hoary sluice
deep mulch
#

@valid jetty hiiii

jade stone
#

@hoary sluice helpppp how do i watch a file in C++ without blocking

spark tiger
dawn ledge
#

is this just running something via ipc

formal belfry
ornate quiver
#

我爱electron
i sure love electron too

royal nymph
#

i should reopen my sandbox escape report to discord

hoary sluice
#

@valid jetty

lavish frigate
#

i just opened this project im gonna be sick 🤢

fleet cedar
#

They didn't commit their linter rules?

lavish frigate
fleet cedar
#

If you mean "I don't like their code style", that's a different thing

lavish frigate
#

the next layer is that they are not following the company default code styling

ionic lake
#

you should just configure vscode to not show style lints but they still will be fixed

lavish frigate
lavish frigate
austere idol
#

rate this code plz:

use std::env;
use std::fs;

fn main() -> Result<(), Box<dyn std::error::Error>>
{
    let args: Vec<String> = env::args().collect();

    if args.len() < 2 {
        panic!("specify file with links");
    }

    let data: String = fs::read_to_string(&args[1])?;

    for link in data.split("\n") {
        if link == "" { continue; }
        let link_s = link.to_string();

        if !fs::exists(&link_s[link_s.rfind('/').unwrap() + 1..])? {
            println!("{}", link);
        }
    }

    Ok(())
}
formal belfry
#

the first one is that i opened a file and i get linter warnings

first time?

ornate quiver
lavish frigate
fleet cedar
#

Or str.lines()

#

BufRead.lines() has the drawback that it allocates a new String every time

#

str.lines() on the other hand requires the whole String to be read into memory upfront

#

Which doesn't work well with streaming input like stdin

lavish frigate
#

tbh i just took the first .lines result on google 😭

fleet cedar
#

You can do BufRead.read_line() in a loop to avoid reallocation, though it's a bit of a slog

#

Instead of &link_s[link_s.rfind('/').unwrap() + 1..], use .rsplit_once('/')

#

And what's with the let link_s = link.to_string();, it looks completely unnecessary

#

Both the to_string'ing, and that you give it a different name

lavish frigate
formal belfry
#

what

lavish frigate
#

"Microsoft is using AI to convert code to Rust"

ionic lake
#

they have examples in dotnet and other docs to tell you to use github copilot for json

#

it hurts to see

formal belfry
austere idol
# fleet cedar Both the to_string'ing, and that you give it a different name

thanks!!
now it looks like this

use std::env;
use std::fs;

fn main() -> Result<(), Box<dyn std::error::Error>>
{
    let args: Vec<String> = env::args().collect();
    if args.len() < 2 { panic!("specify file with links"); }

    let data: String = fs::read_to_string(&args[1])?;
    for link in data.lines() {
        let (_, fname) = link.rsplit_once('/').unwrap();
        if !fs::exists(&fname)? {
            println!("{}", link);
        }
    }

    Ok(())
}
formal belfry
#

Buckle up, code monkeys, because this ain't your average C++ tutorial. We're diving deep into the depths of "Gyatt" class development, and let's just say, things get... interesting.

This is less of a tutorial and more of a descent into coding madness. If you've ever wondered what it's like to code under extreme duress, this is the video for you...

▶ Play video
formal belfry
ionic lake
#

vibe coding is yet another fad used by techfluencers to sell you their course, it will die in a few months hopefully

blazing haven
#

read the first sentence

#

Vibe coding is an AI-dependent programming technique

#

automatically disqualified

ionic lake
#

vibe coding is when you leave an llm entirely to do the programming for you and you just manage and prompt the project

fleet cedar
#

It's when you want to be a PM without hiring anyone

blazing haven
#

basically

formal belfry
#

who is the best vibe coder!?!? 🗣️

#

why does youtube recommend me this

fleet cedar
#

Is installing arch as a femboy different from installing it otherwise

hazy pine
dense sand
#

does anyone here know how could i read music data from bluetooth from my phone?

valid jetty
#

lovely code i wrote in my exam today ❤️

public class BaccaratHand : ScoringHand
{
    public override int getScore()
    {
        return cards.Select(c => c.GetRank()).Aggregate(0, (acc, c) => acc + (c >= 10 ? 0 : c)) % 10;
    }
}
public bool Natural()
{
    return (new int[2] { PScore, BScore }).Any(x => x == 8 || x == 9);
}
#

unreadable 1 line linq solutions are my passion

dense sand
#

my teacher doesnt like linq so i have to use loops bruh

valid jetty
#

she has no choice

#

i will use linq or complain about my marks being deducted for using it

jade stone
#

@deep mulch microsoft is going to make me go insane

they use $(CC) in their nmakefiles

#

but use normal link

deep mulch
#

whats that mean

valid jetty
#

other than the fact they hardcode flags which wouldn’t work on non-windows compilers

royal nymph
#

u cant override linker

valid jetty
#

how would hardcoding msvc make it so you can override it?

royal nymph
#

$(LINKER)

valid jetty
#

can’t you also just use -fuse-ld=foobarbaz

#

or is that not a thing on windows

royal nymph
#

but ig if the flags are not universal it doesnt make sense anyway

royal nymph
valid jetty
#

fuck vibe coding

#

@hoary sluice can’t wait to vibe code aoc next year !

#

tbf that’s what the llm people were doing anyway

#

it’s not like they were reading the code the llm was generating

hoary sluice
#

also zed added sonnet 3.7

#

@fleet cedar @valid jetty how do i block whisper_rs stdout, i dont think i can configure the library to not print anything

fleet cedar
#

If it uses println then you can't

valid jetty
#

^

#

#[no-std]

fleet cedar
#

Send a pr I guess

hoary sluice
#

solution: dont use whisper

#

i did an internship with them last year

#

the company is pretty cool but i had to use js so i hated it

valid jetty
#

do you really want to do real engineering smh

lavish frigate
# hoary sluice

the obvious solution is to send a pr to your terminal adding functionality to block outputting lines based on regex

jade stone
fleet cedar
#

Though that'll run into issues with isatty detection for coloring

spark tiger
#

this is unacceptable

crimson sparrow
winged mantle
#

i love

valid jetty
winged mantle
#

java streams i love

hoary sluice
#

ive seen people have 2000 repos im sure someone has a lot more

valid jetty
# valid jetty yes ofc

the point is that i can do that question easily but its funny to write an unreadable linq 1 liner for it instead

spark tiger
#

though 100k is still a lot

#

aur has 96k packages but like if ur that big u really should not be using gh for that kind of stuff isob

lavish frigate
jade stone
#

Evil

#

(It could be good, but I've never used it)

lavish frigate
#

(its not good)

#

(dont use it)

jade stone
#

@deep mulch you love powershell settings a default alias for diff

because this is what people want when they run diff

delicate groveBOT
hoary sluice
hoary sluice
#

rosie will use cursor

#

also why does adding a proper logger make me feel like i made an actual good application

#

there is something about seeing that green INFO maybe its ptsd from enterprise spring boot

ionic lake
#

owo-logger?

hoary sluice
#

no im not a furry

ionic lake
#

that doesn't make u a furry but okay

hoary sluice
#

what is owo logger tho

lavish frigate
#

wrong channel 😭

hoary sluice
#

cant find anything on the internet

#

im just using env logger cause it doesnt need any config

ionic lake
#

sorry its owo-colors

valid jetty
#

how no allocation what

ionic lake
hoary sluice
#

my thing uses llms i dont care abt performant colors also no i just use log crate and env logger crate for info!, warn!, error! macros

valid jetty
#

write your own formatters

hoary sluice
#

no

ionic lake
#

can u write one for us

#

make the cutest logger

pearl stagBOT
# valid jetty <https://github.com/acquitelol/elle/blob/rewrite/src/lexer/enums.rs#L475-L516>

enums.rs: Lines 475-516

let split_index = ctx.char_indices()
    .nth(left)
    .map(|(i, _)| i)
    .unwrap_or_else(|| ctx.len());

let (lhs, rhs) = ctx.split_at(split_index);

let split_index = rhs.char_indices()
    .nth(self.length)
    .map(|(i, _)| i)
    .unwrap_or_else(|| rhs.len());

let issue = &rhs[..split_index];
let rhs = &rhs[split_index..];
let line = format!("{} | ", self.row + 1);

return format!(
    "\n{upper}\n{user_message}\n\n{above}{line_number}{}{lhs}{BOLD}{fmt}{UNDERLINE}{issue}{RESET}{rhs}\n{}{}{BOLD}{GREEN}^{}{}{RESET}\n{fmt}{}{RESET}\n",
    " ".repeat(padding),
    " ".repeat(padding + format!("{} | ", self.row + 1).len()),
    " ".repeat(left),
    "~".repeat(self.length.checked_sub(1).unwrap_or(0)),
    if !self.extra_info.is_empty() { format!(" {}", self.extra_info) } else { "".into() },
    "―".repeat(upper_plain.len()),
    above = if !above.is_empty() {
        format!(
            "{:<2} | {}{}\n",
            self.row,
            " ".repeat(padding),
            above
        )
    } else {
        "".into()
    },
    user_message = message.into(),
    line_number = line,
    BOLD = get_BOLD!(),
    UNDERLINE = get_UNDERLINE!(),
    GREEN = get_GREEN!(),
    RESET = get_RESET!(),
    fmt = if is_warning { get_YELLOW!() } else { get_RED!() }
);
valid jetty
#

isnt this beautiful

ionic lake
#

needs a unsafe { ... }

#

actually this is good

deep mulch
valid jetty
hoary sluice
deep mulch
valid jetty
#

doesnt he also write java

hoary sluice
#

@valid jetty our measurement systems teacher said we can do anything we want in the next lab excercise, should i make a digital filter calculator in haskell

deep mulch
hoary sluice
#

omg should i make it in elle

#

im gonna make it in elle

deep mulch
#

yes

hoary sluice
#

@valid jetty make an elle lsp and formatter before monday

deep mulch
#

@valid jetty make Elle FFT library

hoary sluice
#

i will actually do that

ionic lake
hoary sluice
#

@valid jetty why did u add so many deps

valid jetty
#

i added chrono to build deps

deep mulch
#

Elle will take 5 hours to build and need 32 GB of ram and 200 GB of storage

hoary sluice
#

how do i add something to the elle stdlib

#

where are all the external fns implemented

valid jetty
#

in std/runtime

hoary sluice
#

i found it

deep mulch
#

I will make Elle better

hoary sluice
#

so the ones in std/ are just header files basically?

valid jetty
#

to add something, make a file in std/runtime, import it in std/runtime/registry.le then make the relevant std/ header

hoary sluice
#

there will be an fft question in advent of code and you will get #1/#1 with my elle fft lib

valid jetty
#

oh dont forget to make after to reinstall the runtime

deep mulch
#

@valid jetty you will be used as crab bait

valid jetty
#

@hoary sluice keep in mind if you want your functions to be generic you need to put their body in std/ directly

#

you cant have generic functions in the runtime

hoary sluice
#

why not

valid jetty
#

because the runtime builds into an object file then a static lib

#

you cant have non-monomorphized functions in an object file

hoary sluice
#

ok

hoary sluice
#

do u use an lsp

deep mulch
#

that's not a real word

valid jetty
deep mulch
#

@valid jetty hii

valid jetty
#

hii

#

also @hoary sluice on real terms they would never put fft in aoc thats too complicated for the average developer to figure out

hoary sluice
#

uhh

valid jetty
#

i know i would struggle

#

or well

hoary sluice
#

your face when the 2019 day 16

valid jetty
#

oh

hoary sluice
#

(its not actual fft)

#

but its in the spirit of fft

valid jetty
#

oh fun

deep mulch
#

@valid jetty @valid jetty make me smart

valid jetty
#

yeah i didnt expect a full on fft

valid jetty
deep mulch
valid jetty
#

get hyperfixated on programming then

deep mulch
#

I don't have hyper fixation

#

I just have anxiety

valid jetty
#

ouhhh

#

sad

hoary sluice
#

its not actual fft like you cant use fft lib for it but it probably doesnt hurt to know how fft works

valid jetty
#

i mean fft isnt that hard to just call a function lol

deep mulch
#

@hoary sluice 🦅ly

valid jetty
#

but the theory is the hard part

hoary sluice
#

well yea thats why he changed it

#

its still a sum of products over a list of numbers which is what dft is

#

just with a different formula without complex numbers

valid jetty
#

yeah

#

oh btw i found a simpler way to do that string thing from earlier

fn string::contains(ElleMeta meta, string self, ...args) -> bool {
    if meta.arity != 2 {
        __internal_throw_invalid_needle(meta, "The needle argument was not provided.\n");
    }

    if meta.types[1] != "char" && meta.types[1] != "string" {
        __internal_throw_invalid_needle(meta, "Got a value of type ", meta.types[1], " instead.\n");
    }

    needle := meta.types[1] == "char"
        ? #[args.yield(char), '\0']
        : args.yield(string);

    return (void *)strstr(self, needle) != nil;
}
#

instead of a buffer thing i can just use a static array lol

hoary sluice
#

i dont think i read that

valid jetty
#

you did i think

hoary sluice
#

i read the align

hoary sluice
#

oh

#

i guess i did

valid jetty
#

the improvement is

needle := nil;

if meta.types[1] == "char" {
    char temp[2];
    temp[0] = args.yield(char);
    temp[1] = nil;
    needle = temp;
} else {
    needle = args.yield(string);
}
needle := meta.types[1] == "char"
    ? #[args.yield(char), '\0']
    : args.yield(string);
hoary sluice
#

needle := nil husk

#

why do you have nil

valid jetty
#

nil is just a void* typed constant to 0

hoary sluice
#

yea why do null pointers exist

valid jetty
#

because elle isnt memory safe??

deep mulch
#

Elle will have undefined as well

#

and NaN

hoary sluice
#

elle will have ===

deep mulch
#

Elle will have implicit string concatenation like js

valid jetty
#

and anyway thats a benefit here because you can write this code

lexer := Lexer::new(args[0]);
tokens := [Token *;];

while current := lexer.next_token() {
    tokens.push(current);
}
``` and this loop exits when `lexer.next_token()` returns `nil` (a null pointer)
deep mulch
#

;]; looks so wrong

valid jetty
#

lmao

#

true but idk another place to put it

deep mulch
#

@valid jetty is silly

valid jetty
deep mulch
#

@valid jetty

valid jetty
#

you have to either ```rs
x := "hi";
x <>= string::as_string(1);

OR
```rs
x := "hi";
x <>= "{}".format(1);
#

the behavior internally differs slightly but you get the same string in the end

deep mulch
#

oh my god

#

<>= 😭

#

fish operator

valid jetty
#

lmao yeah !!!

#

<> is the concat operator

deep mulch
#

why not just +=

valid jetty
#

$assert("x" <> "y" == "xy")

valid jetty
#

strings are char*

#

you can use + to offset a string

deep mulch
#

guuuhhh

valid jetty
#

i need to add function overloading at some point so you can make the same function return different things

#

like i want to make it so when you index by a number you get T but when you index by a range you get T[]

#

currently you can only index by a number

#

because even though you can do dispatch to take in both a number and range, you cant return T or T[]

hoary sluice
#

why does it point to a _- thingy

#

how do i link the stdlib

valid jetty
#

i have to fix that actually thats because it uses the wrong location printer for those errors

valid jetty
#

you can do --nostd to unlink it

hoary sluice
#
~/workspace/elle/examples git:(rewrite) ✗ λ ellec hello.le

――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/allocators/arbitrary":
No such file or directory (os error 2)

1 |   _
      ^
――――――――――――――――――――――――――――――――――――――――――――――――――――――


――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/allocators/gc":
No such file or directory (os error 2)

1 |   _
      ^
――――――――――――――――――――――――――――――――――――――――――――――――――――――


――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/string":
No such file or directory (os error 2)

1 |   _
      ^
――――――――――――――――――――――――――――――――――――――――――――――――――――――


――――――――――――――――――――[hello.le:1:2]――――――――――――――――――――
Could not load module "std/fmt":
No such file or directory (os error 2)

1 |   _
      ^
――――――――――――――――――――――――――――――――――――――――――――――――――――――


――――――――――――――――――――[hello.le:1:12]――――――――――――――――――――
Could not load module "std/io":
No such file or directory (os error 2)

1 |   use std/io;
      ^~~~~~~~~~~
―――――――――――――――――――――――――――――――――――――――――――――――――――――――


――――――――――――――――――――[hello.le:4:7]――――――――――――――――――――
Identifier 'io' isn't a struct or primitive type.
Are you sure you spelt 'io' correctly?

3  |   fn main() {
4 |       io::println("Hello, world!");
          ^~
――――――――――――――――――――――――――――――――――――――――――――――――――――――
valid jetty
#

did you install the runtime and stdlib

#

make

hoary sluice
#

uh hold on i may have to install qbe

valid jetty
#

that too

hoary sluice
#

lmao

valid jetty
#

make clean after installing qbe

#

then make -B

#

to install qbe just uhhh, clone the qbe git, cd into it, run make, then move it to somewhere in your $PATH

hoary sluice
#

or just pacman -S qbe lol

valid jetty
#

is that latest git tree tho

hoary sluice
#

idk but it works

valid jetty
#

does the runtime compile

hoary sluice
#

its probably pretty recent

#

if it stops working i can do yay -S qbe-git

valid jetty
#

oh

#

fun

#

if you get the

#

then test probably uhhhh /tests/hashmap.le and if it works then the whole thing probably works

hoary sluice
#

what does global pub do

valid jetty
#

ideally you would make test to run all of them but theres quite a lot and the hashmap one tests quite a lot of things

valid jetty
#

instead of needing to do pub on every function

hoary sluice
#

i had to ln -s /usr/bin/pypy /usr/bin/pypy3

valid jetty
#

oh lol