#πͺ -progaming
1 messages Β· Page 80 of 1
they've detained citizens before
especially naturalized ones
and I'm not talking about me
vset-name πΊπΈ-politics
not when you're forced to do it
i want to have an actual summer break but instead im stuck doing this shit
erm well actually
i read thing about cis women being escorted out of female bathrooms because theyre like butch lesbians or whatever 

vset-name πͺ -progaming
republicans when going after trans people affects all people
INSANE
@royal nymph new chat #politics
i go after rosies
I Follow Vees
wow smh
thats literally os evil
os evil
os evil
WHAT
so evil
omf
os evil
omg
erm well actually she was talking about me...
she said rosies plural
becuase you're not rosie, you're rosie.pi
i was trying to find a wikihow about editing your own message to link to rosie but it gave this instead
@hoary sluice what would i call a conditional compilation attribute???
i wanna have something like enum AddressFamily @only_compile_if(target="linux") {}
obviously i wouldnt call it only_compile_if but idk what to call it
maybe just @if
Rust calls it cfg
but thats control flow graph i dont think its a very descriptive name
That is an unrelated thing cfg can also be an abbreviation of, yes
Don't see how that's relevant
oh it stands for configuration
i genuinely thought it stood for control flow graph because youre manipulating the control flow at compile time (by not generating specific parts)
That doesn't make sense since control flow is not involved whatsoever
#[cfg] trims things off the ast
yeah i guess
???? are you stupid??????????
idk why whenever i read cfg my head went "control flow graph!"
theres some basic conditional compilation i guess
it uses rust env::consts values unless you specify them yourself when compiling
oh and btw if i make the conditions match it works
@hoary sluice echo server opinions???
use std/prelude;
use std/libc/socket;
const PORT = 8080;
const BUFFER_SIZE = 1024;
fn main() {
fd := socket(AddressFamily::INET, SocketType::STREAM, 0);
defer close(fd);
if fd == -1 {
$panic("Failed to create socket: {}", get_error());
}
addr := sockaddr_in {
sin_family = AddressFamily::INET,
sin_port = htons(PORT),
sin_addr = in_addr { s_addr = InAddr::ANY },
};
if bind(fd, &addr, #size(addr)) < 0 {
$panic("Failed to bind to port {}: {}", PORT, get_error());
}
if listen(fd, 0) < 0 {
$panic("Failed to listen at port {}: {}", PORT, get_error());
}
$printf("Server is listening on port {}", PORT);
char buffer[BUFFER_SIZE];
clientSocket := accept(fd, nil, nil);
while (received := recv(clientSocket, buffer, BUFFER_SIZE, 0)) > 0 {
send(clientSocket, buffer, received, 0);
}
}
``` i think its more readable than C
i want to make a socket abstraction to allow you to do this easier but i dont really know the best way to approach that
readability refactor (sorta)
looks nice
ty
i need a proper website
but i don't really see the point unless it has a very pointless gimmick
id do that in python:
class MyServer(Server):
async def on_connection(self, connection: Connection):
while True:
data = await connection.read(1024)
await connection.send(data)
server = MyServer()
server.run(port=8080)
idk if ur language has oop
i have trouble parsing $panic as a place where the code stops in my brain
oh no obviously i can do something along those lines
but this is supposed to be using C apis
if c had rust syntax
rewrite it in rust
patch highlight.js
@valid jetty does ellesp highlight unreachable code
but it doesnt scream
make the speaker play a sampled scream
Change $panic to $cringe
well shes using rust highlighting, and you probably need like a billion users to get added
pr ```elle to highlight.js
altho it has stuff like ebnf which i cant imagine a lot of people send oftan
i mean pr elle to highlight.js the ``` thing is markdown sdfhjksfgh
It's not like discord maintains the highlighters themselves
i am very intelligent
guys is blazingly fast the π or the β‘ ?
my iq is hotter than the sun
π
and memory safe π¦Ί π
β‘ vite
NOO
whats the β‘for then?
so chatgpt can make its slop look better i think
β‘vite
ah lovely
I couldnt think which was the best to use
π§Ά yarn
this is #πͺ -progaming not #LIBERAL EVIL
bun
π¦ deno?
i think the elle version is easier to read?
to be honest i prefer the required explicit return type
it is but it also looks like just a C reskin when side by side
i mean thats what let is for
lmfaoo
thats only because its a direct usage of the C apis
in an ideal world i abstract all of this away into a nice custom socket api
@valid jetty
C++ π§
imo the first one
I don't think this fair for c - you didn't use the
(struct e) {
.field1 = "value1",
.field2 = "value2"
}
syntax
rosie you pick what i make tomorrow
- let bindings
- io
- better argument parsing order
should i allow both let in and where?
io
maybe do what 98 said and allow where inline and let in outline
whats the opposite of inline
named function
and at that point they're basically the same... which isn't a bad thing
let in is not a named function
it's pretty impressive to create a language where you can actually write readable code

impossible*
yeah but thats what the opposite of an inline function is
i am very biased towards c like syntax in terms of how easy i find something to read tbh
oh hm

inline variable binding
stuff like this throws me off
i think its a good idea to have both so you have the choice
i feel like there's a missing bracket at the end... so i would end up adding it
i am very biased towards programming using english sentences (fp)
and there is a bracket at the start so it looks fine at a glance
too much choice isnt always good tho
you only cant do this in C because variable declarations are statements (though variable redeclarations are expressions)
putting where in a normal function isnt very good
no i mean while without parens
oh you were talking about the wrapping
that's a neat feature
requiring parens is bs
at least you get a decent error
now let me present:
if true
doThing
if youre not me and competent enough to write a parser its possible
(this is a joke i'm sure you don't but there are probably reasons)
i just made it if then else to not bother parsing
you can do if true doThing in most cases
(not in elle) but parsing it is possible
thats any functional language
i discovered https://ballerina.io/ a while ago and i like its syntax
import ballerina/io;
// Uninitialized integer variable `value`.
int value;
// Uninitialized final string variable `name`.
final string name;
function init() returns error? {
// Initialize the `value` variable to 5.
value = 5;
// Initialize the final variable greeting to `James`.
name = "James";
if value > 3 {
// The initialization will fail with this error message.
return error("Value should less than 3");
}
}
public function main() {
// This will not be executed because the init function returns an error.
io:println(name);
}

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state o...
what does it mean if you say functional code
this gives
import ballerina/http;
import ballerinax/googleapis.sheets;
configurable string githubPAT = ?;
configurable string repository = "ballerina-platform/ballerina-lang";
configurable string sheetsAccessToken = ?;
configurable string spreadSheetId = ?;
configurable string sheetName = "pull-requests";
type PR record {
string url;
string title;
string state;
string created_at;
string updated_at;
};
public function main() returns error? {
http:Client github = check new ("https://api.github.com/repos");
map<string> headers = {
"Accept": "application/vnd.github.v3+json",
"Authorization": "token " + githubPAT
};
PR[] prs = check github->/[repository]/pulls(headers);
sheets:Client gsheets = check new ({auth: {token: sheetsAccessToken}});
_ = check gsheets->appendValue(spreadSheetId, ["Issue", "Title", "State", "Created At", "Updated At"],
{sheetName: sheetName});
foreach var {url, title, state, created_at, updated_at} in prs {
_ = check gsheets->appendValue(spreadSheetId, [url, title, state, created_at, updated_at],
{sheetName: sheetName});
}
}
``` every language all at once vibes
can you not say "that python 3 code is functional"
everything is a function and functions dont have side effects, so if foo(5) = 7 then itll always be 7
i have no idea what syntax highlighting to put
thats not what fp means
as soon as you say functional coding it becomes a specific type of language?
i love macos
its like oop
the discrepancy makes no sense
but functionally not object oriented
functional means its based on functions not that it works
it's like the burger inside the burger
you also call that a burger? just because that's how we do things doesn't mean it makes sense
print (sum (map (^2) (filter even [1..10])))
why can nobody tell when i'm trolling
typically people say "purely functional" to have no ambiguities but its also usually just called "functional"
cause its a normal misconception
everything these days is bait π
elle is probably vibe coded bait
your fault for missing the cues
everything else i say is a troll
this is the first time ive seen u speak since like december i think
love?
TIL the burger inside the burger is called... "patty"?
but i swear that's also refered to as burger
yeah it is lol
we need to change terminology
we should call code which works functional code and code which is in a functional language, "patty"
π
i cant tell when somebody doesnt understand the concept or is baiting
i don't mean it in bad faith i'm just kidding with people
i talk with so many people that i dont know someone's skill level at any one time
:3
code which works is usually functional either way cause code from other paradigms usually doesnt work
LMAO
i thought it was quite the opposite
rosie what does rust the video game have to do with compilers
How do you think they made the game
its hard to write fp that compiles and then doesnt work
altho its also hard to write fp
none
fn abort() -> !
fn abort() -> never
fn abort() -> _
fn abort() -> aborts
fn abort<T>() -> T
i have only heard about functional programming languages in situations including but not limited to trains running late because of buggy haskell code, a lift breaking due to the code being written in elixir /j
That's how haskell does diverging functions
fn abort() -> ion_is_bad
that means you need to explicitly pass some type when calling abort lol
i need to know if it terminates so i can make defer call its deferrents before its called
Yeah molecules should just have the right number of atoms out of the box
i have seen a lot more broken websites than broken haskell
why are languages so liberal and pro abortion
But what about ```rs
fn first() {
defer println!("first");
second();
}
fn second() {
defer println!("second");
abort();
}
all cause tur*ng couldnt solve his stupid problem
--pro-choice to enable abort --pro-life to prevent abort from working
yeah idk how to do this kind of thing lol
--normal will make a while true
is ther a relativeTimestamps plugin for vencord where instead of a message saying 12:43:45 2025-02-20 its more like 3mo 12d 7h 44m ago or smth like this?
is it even a idea to make abort-like functions not make defer call its deferrents???
fn aborts() -> unreachable
Well yeah that's what abort does
Exits immediately no questions asked
most languages assume that termination will call the defer things inside i guesss
well yeah but i meant just any termination function
including exit and stuff
abort should invoke kill -9
computer science so woke
Some diverging functions abort, some unwind, some simply loop forever
even turing machines are gay
good point
yop all fake and gay, lambda calculus ftw
i wonder how go does it
do not take inspiration from go
@valid jetty im gonna have to make an stdlib framework before io probably
and builtin functions
all tomorrow hopefully
go is pretty sane in this case
it just does unwinding for stuff like panic but not for os.Exit
go is never sane, which is wly microsoft uses it
lmfao
gn
printf support soonβ’οΈ?
the thing is that because your language is interpreted you can easily make unicode functions
gn
u mean function names unicode?
yes
yea i have to remove one is_alpha check for it
Why would interpretedness have any impact on unicode names
because in compiled languages you cant put unicode as a name in symbols for object files, so you need to mangle it
Yeah but all the ones that are not vulnerable to code injection attacks do
Sanitize/escape your data when inserting it in another format, that's a universal fact
No matter if it's sql, html, json, or llvm
uhh sure
@winged mantle hows THIS compared to C
use std/prelude;
use std/net;
const PORT = 8080;
const BUFFER_SIZE = 1024;
fn main() {
server := TcpServer::bind(PORT).expect("Failed to bind server");
defer server.close();
$printf("Server is listening on port {}", PORT);
buffer := Array::with_capacity<char>(BUFFER_SIZE).fill(0);
connection := server.accept().expect("Failed to accept connection");
while (res := connection.read(buffer)).is_ok() {
received := res.unwrap();
if received <= 0 {
break;
}
connection.write(buffer.slice(0, received)).expect("Failed to send response");
}
}
cool
Is that just an echo server
yes
is this nicer
use std/prelude;
use std/net;
const PORT = 8080;
const BUFFER_SIZE = 1024;
fn main() {
server := TcpServer::bind(PORT).expect("Failed to bind server");
defer server.close();
$printf("Server is listening on port {}", PORT);
buffer := Array::with_capacity<char>(BUFFER_SIZE).fill(0);
connection := server.accept().expect("Failed to accept connection");
defer connection.close();
while received := connection.read(buffer).resolve_to<i64 *>(
fn(i64 res) (&res),
fn() nil
) {
connection.write(buffer.slice(0, *received)).expect("Failed to send response");
}
}
it feels odd that you have pointed in an interpreted language
i might be stupid
lmao
rust using C apis only doesnt look like C because rust devs made it a pain in the ass to write unsafe code
if you could write it normally rust would look a lot more like C
i made a special function for the resolve_to<T * case
use std/prelude;
use std/net;
const PORT = 8080;
const BUFFER_SIZE = 1024;
fn main() {
server := TcpServer::bind(PORT).expect("Failed to bind server");
defer server.close();
$printf("Server is listening on port {}", PORT);
buffer := Array::with_capacity<char>(BUFFER_SIZE).filled();
connection := server.accept().expect("Failed to accept connection");
defer connection.close();
while received := connection.read(buffer).to_nilable() {
connection.write(buffer.slice(0, *received)).expect("Failed to send response");
}
}
``` this is probably the most readable it will get
although it does ignore the error
(so did the code before)
my sister want to learn programming, what if i get her to start by learning elle
Insane
Get her to learn Python
@hoary sluice what the hell

so evil
get her to learn rust

does anyone know if a "saved gifs" and a "favorited gifs" section would be possible to code
like this
i dont do much plugin related coding but if its possible i kinda wanna try
and smth like this to save or favorite

python
scratch
scratch π₯π
get python'd!!!!!! rekt nerd
what is the output of this code
def add_to_list(item: str, your_list: list = []):
your_list.append(item)
return your_list
print(add_to_list("A"))
print(add_to_list("B", []))
print(add_to_list("C"))
yes
Hopefully will be solved by https://peps.python.org/pep-0671/ soon β’οΈ
π
she should start with JS
unironically it is a great and useful language in the big 2025
@hoary sluice @placid cape love?
is this the thing where the default argument in functions is shared between them lol
yes
i remember figuring that out when i saw people setting it to None and then at the top of the function putting if x is None: x = []
i love python
yes
like people always make fun of js for stuff like 1 + "1" and 1 - "1" and sure thats bad but i mean who even does that realistically but python actually has problems that can very easily happen realistically and its insane
yea
i never said python was good either
hm?
python is the 2nd weirdest language behind js
empty array is falsey lol
typeof(null) is βobjectβ
js also has real problems
that can happen
well thats just convenient honestly
i use that in my code
i dont complain
who uses typeof to check the type of objects
i mean i guess but youβd expect it to compare the reference to 0, and an empty array is not a null pointer so it should not return true but whatever
window.reactHandler = async () => {
const getFiber = (node) => Object.values(node)?.[1]?.children[1]?._owner;
const handler = await lazyDefine(
() => document.querySelector('#app > div > div'),
// This is necessary because null's type is "object"
target => {
if (!target) return false;
const node = getFiber(target).stateNode;
return node && typeof node === 'object';
},
undefined,
Infinity
);
return getFiber(handler);
};
``` sometimes necessary in reverse engineering of things
like if i know an array can have objects i dont use typeof because like its just gonna give me "object" anyway
that function checks if(type of target === object) by default
if null didnβt return object as itβs type, i wouldnβt need to manually make a callback
and i remember spending ages debugging that
specifically i usually do something && typeof(something) == "object" && (more refined check for a specific object here)
(my code)
yeah i mean thatβs sane in most cases
and thats why we should get rid of null implement rust option types introduce a breaking change to the web and force everyone to update their website
whos with me π£οΈ π₯
πππ
now you just gotta rewrite the entire js std to use options instead of null
truee
rewrite @valid jetty to use options isntead of null
You'd also need to rewrite the whole ecosystem to use constructive types rather than descriptive
who cares about the ecosystem its all garbage anyway we gotta do a whole restart
iβm using Result<T, E>
if anyone does the xkcd standards thing again im taking them out back and killing them
lc.xkcd standards
my favourite
Oh and change the runtimes to not be monotyped
Rust is so good itβs even being taught at cppcon
Why is it even called cppcon and not the more appropriate conpp
Naming things y'know
what do you think shes doing
how to make variable bindings
2
4
1
let foo = x in bar = body
In js? no it isn't
@royal nymph
the
/run ```js
console.log([] ? "yes" : "no")
Here is your js(18.15.0) output @fleet cedar
yes
wait what the fuck
so that means
[] is truthy but when coerced to a boolean itβs false
πππππππ
best lang
cause its coercing it to a string
[] == "" // true
"" == false // true
simply don't use ==
Is there a way to patch content in javascript files inside /assets?
seems like regular patches don't work
What files do you want to watch
Not anything specific, just certain ones that call invoke("NOTIFICATIONS_SEND_NOTIFICATION)
What files do that that are not webpack chunks
Yeah that's webpack
my patch logic doesnt seem to work in those?
all javascript files are inside /assets
Some are inside channels/id/WebpackModulexxxxx
Those don't exist
when you patch a module, it creates a new file under /channels. it's not possible to edit in place. the one in /assets is then no longer used
those are created in memory by vencord
@royal nymph
oh
Might be misunderstanding something, but even after patching this, a breakpoint still triggers on the function I just replaced
then you didn't do it properly
if you did it properly there will be a file with Patched by [YourPluginName] comment at the top
did you enable your plugin
how bad is this error handling 
am i tripping or did they update the devtools font
Result<_, String>
Jail for twelve years
Death sentence
Not even @valid jetty has worse error handling
Anyhow for don't-care errors, snafu for structured errors
errors piss me off sm istg im finna js use unwrap() and make it panic every time
fine
does anyhow have some macro or something to quickly unwrap Options?
or regular rust
like idk path.to_str().some_or_else(bail!("some error"));
i think it's better now 
ok_or
why does macos have such a wildly different set of values for errno than linux
ughhhh
Why the .to_str()
idk it doesn't work without it
.arg() takes any impl AsRef<OsStr>, including PathBuf
im assuming context doesnt exist on PathBuf
rustc: mismatched types
expected&str, foundPathBuf
oh im using args
not arg
what even is to_str
.args() is more limited, yes
oh i see
Converts a path to a str, obviously
oh is it from pathbuf
and so it begins
Much better, no?
this is gonna take a while...................................................
Why are you discarding the output though
i think they just wanna run the command
oh wrong reply
surely you capture the stderr stream and if it has data you put that into an Err too
that's honestly such a dumb way to work with amnezia (basically wireguard) but it works lol
oh wait is anyhow gonna output the stderr error
im not sure how using ? with anyhow::Result works
It works the same as ? on any other Result
.expect() i guess?
Print it
you can do expect_err iirc
so something like that is fine?
yeah
ight i see
Just do, y'know, what you want to do in case of error
also like what if any of the errors these functions return in Results don't contain anything other than just uhhh the enum? like errors can be just enums without any fields, right?
guh errors are so confusing 
Errors are values like any other
errors are just enums arent they??
Often yes
wtf there isnt a c function to get the symbolic name of an errno??????
theres strerror but that returns a human readable string and not the name of the error
like i want ENOPROTOOPT not Protocol not available
how are you ever supposed to get this errno lol
i'm trying to like look at how different public functions in stdlib return errors and it's always like some different approach
Maybe if you're trying to communicate with an external device
so far i've seen const_error!, types, enums, structs , jfc 
but if youre trying to do that and the device is powered off, youll just be unable to find the device
i thought you said ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
like always
always wondered why they only put 1 s here
-ize is correct
because if its supposed to be "oh shorten the error name"
you have errors that are much longer
surely you can fit 1 more S in there
nop
i didn't consider it spam
it filled my whole screen lol
it was long but not spam imo
hold on gonna rotate my monitor to comfortably read rosie posting
shug
this time its not even anything that insane π
literally just an enum with all the errnos on macos
its what i can do after thats cool
@valid jetty my uni class has 19 people and 2 of them have austrian last names
like 13 of them are yugoslavs
couple turks and albanians
fn Errno::__fmt__(Errno self, i32 nesting) {
// binops cast out to its repr type :)
return "{} ({})".format(strerror(self + 0), self + 0);
}
``` and its even cooler what i can do AFTER that
idk if the uni is just that international or if they put everyone who doesnt sound german into the same class
!!!!!!!!
when will you finally rewrite elle in elle
eventually
That looks fine but I'd explicitly specify values for all variants
i keep forgetting whether i'm supposed to use String or &str in structs...
a programming language has only truly made it when its compiler is written in itself
i mean imo its not necessary
Depends on whether you want to own the value, same as everywhere else
its inferred at compile time
what if idk 
String creates owned memory which can be cloned, &str is a reference to a string owned somewhere else
i use String in every struct
its like in C where you have a sized String and then a StringView which is just a borrowed view into that memory
my cpu is not yet overloaded
and neither is my ram
actually they are but thats cause of local ml
okay i probably want just String for it
it is not often that you need to borrow a string in multiple places
and put it into a struct
yeah
why am i coding so damn slow, like i've written only a few strings so far 
ok this is cool
strongly typed errors instead of just a string
i feel like my biggest bottleneck is no pattern matching but thats really hard and idk how to approach that
ok time to set that up for linux
thankfully linux has errno as a command in moreutils
when i make a file abstraction this is gonna be so useful to have these things already setup
uhhhhhh im on arm64 smhhh
rip πͺ¦
Quick question, are you allowed to use 3rd party libraries in plugins that are going to be submitted?
none, i like 32-bit registers more π
what's it named after
i swear ages ago
i wrote down on some paper my ideas for a language called parchment 
if you call the language parchment it NEEDS to have fantasy keywords
shard scroll main() {
ink x = "Hello, World!"
shard y = 39
scribe("%s, %d\n", x, y)
recede 0
}
whatt
nooo thats so sad
doneee
now when i make abstractions for C functions (like a file or command api) i can return strongly typed errors
ok cool caller successfully tracked :3
hermes???
π
who cares about education if you can get a birkin bag
holy drip
exactly
@valid jetty whens the court date
what
isnt it beautiful
@hoary sluice
// server.le
use std/prelude;
use std/net/tcp;
use shared;
fn main() {
port := 8080;
server := TcpServer::bind(port);
while server.is_err_and(fn(Errno err) err == Errno::EADDRINUSE) {
port += 1;
server = TcpServer::bind(port);
}
server := server.unwrap();
defer server.close().unwrap();
connection := server.accept().expect("Failed to accept connection");
defer connection.close().unwrap();
foo := Foo { x = 39, y = 'f', z = 4.2 };
$printf("Sending {}", foo);
connection.write_raw(#cast(void *, foo), #size(Foo)).unwrap();
}
// client.le
use std/prelude;
use std/net/tcp;
use shared;
fn main() {
port := 8080;
client := TcpClient::connect("127.0.0.1", port);
while client.is_err_and(fn(Errno err) err == Errno::ELOOP) {
port += 1;
client = TcpClient::connect("127.0.0.1", port);
}
client := client.unwrap();
defer client.close().unwrap();
Foo foo;
client.read_raw(&foo, #size(Foo));
$printf("Received {}", foo);
}
plasma 6?
yes
too much for me
understandable
i used kde for a long time
is that an insult
no
within a decade i will be using some obscure openbsd fork and banana wm
twm user goes back to a typical desktop experience and is shocked
its not that it doesnt tile
its just annoying to configure
too much bloat
I spent 20 years configuring kde
disabling window decorations is impossible
you have to enter a regex and entering any variation of *, *. or $*.^ doesnt work
oh i got it the other way around
maybe ^*.$ wouldve worked
isn't it .*
i think i figured out why it didn't work then
and i know regex idk why i decided to invert it completely
literally the 4 char string i tried but reverse is the correct one
what
this would match literally anything
actually it wouldn't match anything
thats the point
and its not a valid regex
it is entirely reversed
its supposed to be $.*^
Uh, ^.*$?
itβs either stage manager or tiling wm for me, no in between
yes whatever
its meant for people used to windows so makes sense tbh
i thought the one rosie replied to was the original one so i reversed it
yet again shows why i dont like regex
pack the most complicated parsing into as few bytes as possible
maybe i can remember it now because i realized the ^ and $ in vim are stolen from regex
i remember ^ because of simpleast
I don't use ^ and $, I mapped them to H and L
i use _ and $
@hoary sluice strings in structs over the network
(serialized by hand)
use std/collections/array;
global pub;
pub struct Foo {
i32 x;
string y;
f64 z;
};
fn Foo::to_bytes(Foo self) {
res := [u8;];
res.extend([self.x].to_repr<u8>());
res.extend([self.y.len()].to_repr<u8>());
res.extend(Array::from_string(self.y));
res.extend([self.z].to_repr<u8>());
return res;
}
fn Foo::from_bytes(u8[] res) {
self := #alloc(Foo);
offset := 0;
self.x = res.read<i32>(&offset);
len := res.read<u64>(&offset);
self.y = res.slice(offset, offset += len).to_repr<char>().join("");
self.z = res.read<f64>(&offset);
return *self;
}
which never type?
1
1
2
never
unreachable
writing a simple function to print a 64-bit signed int in intel asm is a nightmare

spent hours getting it not to segfault... now it just says the first digit
i liked doing that in past
i tried to do this on macos arm64
.globl _main
.align 8
_main:
adrp x10, number@PAGE
ldr x1, [x10, number@PAGEOFF]
adrp x9, buf@PAGE
add x9, x9, buf@PAGEOFF
add x9, x9, #20 // start at end
mov x8, x9
mov x3, #0 // digit count
loop:
cbz x1, or_insert_z
mov x4, x1
mov x5, #10
udiv x6, x4, x5
msub x7, x6, x5, x4 // x7 = x1 - x6 * 10 (remainder)
add x7, x7, #'0'
strb w7, [x8, #-1]! // store digit and decrement x2
mov x1, x6
add x3, x3, #1
b loop
or_insert_z:
cbnz x3, write_buffer
mov x7, #'0' // if no digits, store '0'
strb w7, [x2, #-1]!
mov x3, #1
write_buffer:
mov x7, #'\n'
strb w7, [x9]
add x3, x3, #1
mov x0, #1 // stdout
mov x1, x8 // x2 is the buffer start
mov x2, x3 // length of the string
bl _write
mov x0, #0
bl _exit
.section __DATA, __data
.align 3
buf:
.space 21 // buffer for number and newline
.align 3
number:
.quad 3939393939393939393
``` i spent more time than i would like to admit trying to get a newline to print
@hoary sluice quine
fn main() {
x := "fn main() {
x := \"?\";
io::puts(x.replace(#[63], x.replace(#['\\\\', '\\\\'], #['\\\\', '\\\\', '\\\\', '\\\\']).replace(#['\"'], #['\\\\', '\"'])));
}";
io::puts(x.replace(#[63], x.replace(#['\\', '\\'], #['\\', '\\', '\\', '\\']).replace(#['"'], #['\\', '"'])));
}
now make a 2048 terminal game in elle
thats like very doable π
wow the biggest non-gov bank here has .net and python internship jobs available to apply for, should i try 
yea
idk my resume is kinda weak. basically all my .net experience is being a contributor and not-so-active maintainer of a foss game
and a lethal company mod lol
i kinda prefer just contributing to oss rather than making something from scratch
itβs only this year when i decided i wanted to code something myself with rust
can i apply for both jobs
i mean i probably can
but
aight iβll try
tomorrow is the last day
i wonder if i can get like two weeks off or something during internship
cuz i have an important event during summer
that i canβt miss
which involves traveling to another city
so iβm not sure if iβll be able to do work
ok done
iβm a bit scared though
so far theyβve only requested full name, city and email
.NET π
nop
unless theyre like super nice and understanding
fuck ππππππππππππππππππππ
iβm scared
they sent it to me three fucking times im crying πππ
who
why
theyre either gonna accept u or reject u and ull never hear from them again
cuz idk what to expect
yeah and iβm gonna be put on virtual wall of shame
Join the free discord to chat:
discord.gg/TFHqFbuYNq
Join this channel to get access to perks:
https://www.youtube.com/channel/UC39VnEdRvgJmIKBDdmj0dIQ/join
Shout out to the editor:
https://thehalalmedia.carrd.co/
Chapters:
0:00 Intro
0:48 Level 0
1:11 Level 1
1:36 Level 2
2:09 Level 3
2:51 Level 4
3:20 Level 5
3:49 Level 6
4:16 Level 7
which one are you
4
for once, an actually good medium article
isn't -~ the same as +1
That's the joke yes
wow
that was a guess

i guess i actually did learn something from that video i watched explaining two's compliment
negating is flipping and adding one and ~ is just flipping, so you're flipping then flipping again (so do nothing) then adding one
silly
user states their age in this message
user comes out as a furry in this message
What's your favourite register?
2
7
8
rsp
π
I like grinning cat register
@valid jetty is elle_error! really your only way of handling errors
yep! :3
very effective
@valid jetty only checks dms every 500 years
do you understand the philosophy behind intermediate representation
as in, you compile to that and then make that compile to assembly
yes
qbe is actually very nice in the way that you dont need to define the interface of functions (unlike llvm), qbe doesnt need to know they exist at all
if they dont exist, it will just throw an error at linking time
i can quickly explain exactly what you need to do to call print
if you want
data $fmt = { b "%d\n", b 0 }
export function w $main() {
@start
%g =w copy 39
%res =w call $printf(l $fmt, ..., w %g)
ret 0
}
``` this is what a print of a number looks like
ill go through it line by line
rosinga is a creature
data $fmt = { b "%d\n", b 0 }
this defines a static memory allocation. strings in QBE are not primitive types, so the best you can do is allocate literals like this in static memory. the $fmt variable is then globally accessible and you get back a pointer to the start of that region (so essentially we just defined a static C string)
export function w $main() {
this defines a function with the name main, which returns a w (word/32 bit int)
@start
this defines a "label", all functions must have at least 1 label, but this is useful later for when you want to do control flow like loops and conditions because you can jump to these labels
%g =w copy 39
defines a "temporary" with the name g, and =w specifies that its type is a w (word/32 bit int). copy 39 is just a way to put that constant value of 39 into it (you cant just do %g =w 39 because the rhs of an assignment must be an instruction)
%res = w call $printf(l $fmt, ..., w %g)
calls printf with the l $fmt variable from earlier (the l specifies to read it as a long, ie a 64 bit signed integer in this case), then the ... tells QBE where the variadic arguments begin, then the w %g tells qbe to pass the %g variable as a w (word/32 bit int)
ret 0
..returns 0
oh and
the sigils ($, %)
$ means global
% means temporary
guh?
oh and if it wasnt clear, the b 0 at the end of the $fmt thing terminates the C string, because c strings are not sized theyre null terminated
byte zero
yep
what if I bit you and you got rabies
evil,,,,,
wait until you learn about stack allocation lol
ill let you mess around for a bit longer with these simpler examples before you move to that because it ramps up in complexity slightly
yeah its still not that complicated
wrong
its basically doing this
int main() {
int x[1];
*(x + 0) = 39;
printf("%d\n", *(x + 0));
}
``` but by hand
..? π
add 0 to the address of the buffer and then dereference it
essentially identical to x[0]
youll get used to it after messing around with it for a bit
guh!
if any of this doesnt make sense just ask btw
I'll try maybe when I'm home
okkk
zoot did you see the tcp server stuff
yeah but the stack is a HUGE headache for me (not as a concept but to work with)
ESPECIALLY in asm
i really hate how my return adresses are also pushed onto the same stack as the one im tryna use
you make it pretty easy to understand, the syntax just seems esoteric
doing an online test for that internship thing i posted earlier today and jfc it took them like 20 minutes to check if my solution passes all the tests lol
insane
@fleet cedar is this good
#[derive(Error, Debug)]
pub enum LexerError {
#[error("not a number")]
NotANumber,
#[error("unterminated string")]
UnterminatedString,
}
#[derive(Error, Debug)]
pub enum ParserError {
#[error("expected expression")]
ExpectedExpression,
#[error("incomplete if")]
IncompleteIf,
#[error("missing closing parenthesis")]
MissingClosingParenthesis,
#[error("missing parameter")]
MissingParameter,
#[error("unexpected end of file")]
UnexpectedEndOfFile,
}
#[derive(Error, Debug)]
pub enum InterpreterError {
#[error("division by zero")]
DivisionByZero,
#[error("expected expression")]
ExpectedExpression,
#[error("invalid arguments")]
InvalidArguments,
#[error("invalid identifier")]
InvalidIdentifier,
#[error("invalid token")]
InvalidToken,
#[error("overflow")]
Overflow,
#[error("unsupported expression")]
UnsupportedExpression,
}
#[derive(Error, Debug)]
pub enum ErrorKind {
#[error("lexer error: {0}")]
Lexer(#[from] LexerError),
#[error("parser error: {0}")]
Parser(#[from] ParserError),
#[error("interpreter error: {0}")]
Interpreter(#[from] InterpreterError),
}
#[derive(Error, Debug)]
pub struct Error {
pub kind: ErrorKind,
pub location: Option<Rc<Location>>,
pub help: Option<String>,
}
its good but imo its a little overkill
I usually go with something like ```rs
struct Diag {
level: Level,
main: Note,
sub: Vec<Note>,
}
struct Note {
text: String,
span: Span,
}
mine could benefit from a simplification
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Location {
pub file: Rc<str>,
// so we can report the import location instead
// of the real location for errors that weren't
// in the current file
pub alt_start: Rc<Position>,
pub alt_end: Rc<Position>,
pub start: Rc<Position>,
pub end: Rc<Position>,
pub ctx: Rc<str>,
pub above: Option<Rc<str>>,
pub extra_info: Rc<str>,
}
(locations are used to get an error string which can be used for anything later, you just call the appropriate function)
Two?
row col
Sounds wasteful
thats pretty cool
why
Why use two usizes when you can use one
use one and do row * i + col orrr
i use the position for reporting "file:row:col"
you can technically do that with a byte offset but its just kinda more work
No
It's less work
Only need to convert offset to row/col for those positions that are displayed, rather than every token
i mean i guess but this is such a tiny optimization that surely it doesnt really matter
i've only solved 3 tasks out of 7 so far and idk how to solve further im killin myself
these fucking leetcode ass tasks
how else
i had to do a coding contest too for an internship once
how was it
hard and i got rejected
got accepted the year after that when i won their actual coding contest and not a simulated private one
i only got 2/7 correct so far
there isn't even any point in doing further test i belive
fmllllllllllllllllll
can u not just vibe code it
i can but why
to solve it faster
just make sure to not upload the vibe coded code like i did in 2023
i mean idk if i cant solve this they will definitely find out im not as skilled as i made it seem
no they wont
atp eagely probably vibe coded aoc 2024 :3
the recruiters wont ever talk to you after that
i vibe code everything
wow...........
idk this one says they will interview you
i vibe coded https://github.com/eagely/meowmod
Forge 1.8.9 utils mod for hypixel skyblock. Contribute to eagely/MeowMod development by creating an account on GitHub.
do the tasks have a time limit
yes
if you get vibe code from an ai and dont understand what its doing you should probably work more on your understanding and knowledge and try again
you will get heavy impostor syndrome even if you dont vibe code and get in
i mean it's not about understanding, it's more about being able to come up with such solutions
if i can't, then what's the point
there needs to be levels of vibe coding
i mean a quick way to be able to come up with them is to literally vibe code them, if you understand them eventually youll just subconsciously memorize the general pattern of solutions and be able to come up with them mostly on your own
no thats a bad idea
obviously dont vibe code the actual coding contest questions
but you can do it to practice questions
well i mean that one is a real test
a lot of icypeas is written with ai because i use it as a typing assistant and a search engine
"separate errorkind into lexererror, parsererror, interpretererror" would take me like an hour to do manually
why
im always terrified the ai makes some assumption which is incorrect about my code
then does it wrong
and makes me spend an extra 3 hours debugging
lmaooo
it literally wrote UnexpectedEnd of file as an enum variant WITH THE SPACES
i would rather go through code that i personally wrote and have full understanding over rather than trying to parse the ai slop and figure out what it was trying to do
i dont vibe code icypeas to that point
i did that with voice assistant
frontend
backend not really
i wrote almost none of the qml
and it doesnt work anymore
i mean yeah but if youre refactoring a lot of code chances are itll make mistakes that arent obvious at first glance
which means you need to go through and read code you didnt write for no reason
wait what lmao
did your free trial to those slop services expire or something
for some yea but i make new accounts
π π
i switched from catppuccin to breeze theme and it stopped working cause breeze depends on some qt package that when installing still doesnt work
i need to link it properly
pretty sure this is a nixos issue
either way my partners hardware doesnt work and this frontend isnt even part of the diploma thesis, its only the backend
my gpt is so empty lmfao
mit gpl3 compat is such a real question to ask gpt
thats "in the last 7 days" "in the last 30 days" "april" "january"
no bc actually π
rosie secretely uses claude and makes us think she doesnt slopcode
but actually im so lost how do i fix my error handling
do what i do
chances are youre never going to throw the same error more than once
if you are you can just factor it out into a macro
so just ignore all of rusts error handling?
does elle die after the first error
or does it recover
in lexer/parser
ok FINALLY
ok ur right this is unneccessary
claude too pricey
rosie i have main func and test() func which runs tests, main returns ExitCode what should test return
also ExitCode surely
rosie........hi
if a test fails it returns ExitCode::FAILURE or whatever
taskylizard...........hi
ok whatever illl just do that
why did you say it like that lol
i just wanted to say hi
hiii
how are we doing this lovely day
@hoary sluice this probably spent about 1 year worth of electricity for my house
im being silly !!!!!!!
are you also being silly
yes im being silly in balatro
wow
what even is the hype with balatro lol
i keep seeing it but i have no idea what it is
i know its a card game of sorts
by the way @hoary sluice what tests are you even running
wtf is balatro
there are no asserts yet its literally just a bunch of icypeas expressions stuffed in a file https://github.com/eagely/icypeas/tree/main/tests
nono
because solitaire is cool or something
ask zoot
oh ok i was gonna say
ok i thought you like did pre-gen output tests through rust or something
thats the tests where you generate the expected output of a program at a point when you know its functional and then later you compare the output to the expected output
i kinda wanna do this with my manual tests but i havent yet
wrong picture
just need io
i wonder if you can configure your rust app not to compile on any target other than X
you can lol
oh neat
assert x y = if x != y then panic else print("success or idk if it should print anything")
add a #[cfg(target="macos")] to every single top level structure (struct, function, enum)
if then else
on non-macos platforms it will never generate those things and therefore fail to compile
lua
haskell
lua is evil
good lang
i mean yeah but can't you like set up your cargo.toml so whenever you run cargo build on a not supported target, it just says you can't build it
i went to an acedemic meet and some guy beside me wouldnt shut up about lua
i need lua appkit bindings
i mean not really
aw
but you can kinda do this
fn main() {
let target = std::env::var("TARGET").unwrap();
if target != "x86_64-unknown-linux-gnu" {
panic!("uwu");
}
}
``` in build.rs
the only thing i dont like about lua is how there isnt really an idea of classes or anything
oh okay that's what i thought of too but but thought maybe there was a better way
metatables?
the only thing i dont like about lua is everything
I mean exactly like classes
well yeah i guess
but neither was js until they introduced classes officially
you could do it with prototypes before just like you can do it with metatables now
rust also doesnt have classes does that mean its bad
omg i remember getting SO confused over wtf pairs and ipairs does
true
i think i get it now but still that was so annoying
Lua has great potential for scripting but nobody makes anything with it
other than like
balatro roblox and garry's mod i guess
iirc everything is a dictionary in lua, so doing pairs(a) where a is an array would give you index, value, but ipairs specifically iterates until the first nil in the array while pairs iterates the whole array
nvim config :3
@valid jetty best cli
fn main() -> ExitCode {
test()
}
luarocks is garbage
π
why do you have test in your runtime it should be a build-time function
i wish lua had basic stuff like a fs lib but it doesnt
because its inherently a mini embedded scripting langugage i guess
its purpose is to be embedded anywhere easily
it would go so hard as a python replacement though
iirc there are lua forks that offer that
have you seen the roact stuff to make react in luau
yes
i touched roblox for 2 seconds and didnt ever again
i never used that but it seems silly
fuck off
its a deck building game where you see number go up till naneif (infinity in lua ig)
you basically play out specific moves (hands) that give mult (multipler) multiplied by slots (points), there are some good easy hands and some difficult to do hands but it all depends on your deck of cards and what you have currently at hand during gameplay, theres also leveling for hands later on which influence your build, you also have jokers which are like powerups and give you a specific ablity to your run's build, then theres tarots which are a one-time use thing i guess if that makes sense
Didn't roblox make an entire typescript transpiler to luau just for roact
idk i think so
lol i see
π
