#๐ช -progaming
1 messages ยท Page 60 of 1
i always want to rewrite to rust when i have mental breakdown because something doesnt work
Do
id have to probably redo the classfile parser
this feels so weird to me because it just inherently feels so objective-C/java like
i just like the win32 api style of naming
itโs so objc coded ๐ญ๐ญ๐ญ
wth i never did objc ๐ญ
Method *methods = class_copyMethodList(uiColorClass, &methodCount); this is objc
๐ญ
you can see where im coming from right
+ (UIColor *)simpleColorWithIndex:(int)index preferences:(NSUserDefaults *)preferences originalColor:(UIColor *)originalColor {
NSString *key = [NSString stringWithFormat:@"flora%@Color", index % 2 == 0 ? @"Primary" : @"Secondary"];
NSString *colorFromDefaults = [preferences objectForKey:key] ?: (index % 2 == 0 ? @"e8a7bf" : @"d795f8");
UIColor *colorAtKey = [self colorFromHexString:colorFromDefaults];
NSDictionary *original = [Utilities hsvColorWithColor:originalColor];
NSDictionary *custom = [Utilities hsvColorWithColor:colorAtKey];
id saturationInfluence = [preferences objectForKey:@"floraSaturationInfluence"];
id lightnessInfluence = [preferences objectForKey:@"floraLightnessInfluence"];
double saturationSplit = saturationInfluence != nil ? [saturationInfluence doubleValue] : 0.40;
double lightnessSplit = lightnessInfluence != nil ? [lightnessInfluence doubleValue] : 0.20;
// Use the custom color, with 40% saturation influence and a 20% brightness influence.
// Alpha is not affected by the custom colors. This is intentional.
return [UIColor colorWithHue:[[custom objectForKey:@"hue"] doubleValue]
saturation:[self averageWithSplit:saturationSplit firstValue:[original objectForKey:@"saturation"] secondValue:[custom objectForKey:@"saturation"]]
brightness:[self averageWithSplit:lightnessSplit firstValue:[original objectForKey:@"brightness"] secondValue:[custom objectForKey:@"brightness"]]
alpha:[[original objectForKey:@"alpha"] doubleValue]];
}
GetMethodByName seems like a bad idea, since name is not a key in that table
other than the [] syntax
what
anyways if i were to rewrite in rust i guess i could use https://github.com/Palmr/classfile-parser
and fork it and edit to my needs
but i dont feel like rewriting 2K loc, even if its not that much
maybe on my next mental breakdwon
Makefile my beloved
GetInstructionByName -> GetInstructionName?
yea i will rename it someday
im SO glad i added else if it makes these things so much neater
fn rune::encode(rune *self) -> string {
c := self.inner;
res := "";
if c <= 0x7F {
res.push(c);
} else if c <= 0x7FF {
res.push(0xC0 | (c >> 6) & 0x1F);
res.push(0x80 | (c & 0x3F));
} else if c <= 0xFFFF {
res.push(0xE0 | (c >> 12) & 0x0F);
res.push(0x80 | (c >> 6) & 0x3F);
res.push(0x80 | (c & 0x3F));
} else if c <= 0x10FFFF {
res.push(0xF0 | ((c >> 18) & 0x07));
res.push(0x80 | ((c >> 12) & 0x3F));
res.push(0x80 | ((c >> 6) & 0x3F));
res.push(0x80 | (c & 0x3F));
}
return res;
}
instead of
fn rune::encode(rune *self) -> string {
c := self.inner;
res := "";
if c <= 0x7F {
res.push(c);
} else { if c <= 0x7FF {
res.push(0xC0 | (c >> 6) & 0x1F);
res.push(0x80 | (c & 0x3F));
} else { if c <= 0xFFFF {
res.push(0xE0 | (c >> 12) & 0x0F);
res.push(0x80 | (c >> 6) & 0x3F);
res.push(0x80 | (c & 0x3F));
} else { if c <= 0x10FFFF {
res.push(0xF0 | ((c >> 18) & 0x07));
res.push(0x80 | ((c >> 12) & 0x3F));
res.push(0x80 | ((c >> 6) & 0x3F));
res.push(0x80 | (c & 0x3F));
}}}}
return res;
}
so much math for jvm initialization i cannot believe it
@dense sand sending a null pointer exception in your direction
me too
Leaking 20 mib of java classfiles your way
the horrendous switch is expanding
even i have else if lmao ๐ญ
If you make a jvm that costs <1mb for all programs I will be quite impressed
add when statement when
Same time as she adds sum types probably
shes obviously gonna call it match
DONT CALL IT WHEN
we need when
let foo = false
when foo == true {
console.log(":3")
}
console.log("a")
foo = true
console.log("b")
a
:3
b
thoughts??
yield yield yield yield yield yield yield yield yield yield yield
I have doubts as to whether that would work together with any other language features
@valid jetty why does it change the address by 8 bytes instead of 4 for the b->v
Like, any whatsoever
why
What if you call a function that changes the watched expression but changes it back before returning
it would be implemented so that the when condition runs every time the value of the variable changes
Now you're leaking implementation details
let mut foo = Foo { bar: 98 };
when foo.bar == 32 { println!("whatever"); }
foo.do_something();
``` does this trigger the when or not
does do_something change bar?
48->4c is 4 bytes, 4c->50 is 4 bytes, what's the problem
Maybe? That's an implementation detail
id implement it quite literally just so it runs all when conditions and potentially their code whenever the value of a variable/property is changed internally not sure why anything else matters
oh im stupid
i didnt know why it was wrong
So now everything a function does is observable, rather than only the output
Are you trying to make Hyrum as powerful as a god or
whatever sure
Thanks for showing me that
I love
@deep mulch
defer, but more versatile and broken?
defer but not defer
Mostly because it works completely differently and has different use cases and is stupid to compare to defer
thats an interrupt service routine triggered by a flag
WHat is that thing
so.. signals
the c compiler works in magical ways
Write better code with Augment for free today https://fnf.dev/4lnbewC
Let's take a first look at Llama 4 herd - a new family of multi-modal large language models from Meta. We also breakdown a controversial memo from the CEO of Shopify about prioritizing AI throughout its business.
#ai #programming #thecodereport
๐ฌ Chat with Me on Discor...
more models to use while vibe coding
hold on i just looked over again
wdym it only goes up by 4
48 -> 4c is 4
4c -> 50 is 4
yea i was stupid
@deep mulch you will be forced to use functional programming for the rest of your life
yop
i tried a Native electron app iframe event observer but nope! can't change the URL.
you'd think MutationObserver would show iframes for discord but nope!
can't beat a good ol' setInterval, cache checker and document.querySelectorAll muahaha. anyway now i can actually toy with music embeds
& while i'm here, i made a solid few tweaks to the 'visual refresh' CSS too https://gist.github.com/yunruse/1c3850d49f3bc2d69d2d91738da7b29b
look at FixSpotifyEmbeds ๐ญ
that was my first port of call ;-;
no amount of frame.executeJavaScript tomfoolery in "dom-ready" or even anything in "frame-created" seemed to get the thing to actually change its src - perhaps some reasonable security thing
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 := meta.types[1] == "char"
? #[args.yield(char), '\0']
: args.yield(string);
return (void *)strstr(self, needle) != nil;
}
``` reflection !!!
"abc".contains("ab");
"abc".contains('a');
delete
it's so ulgy
classes!!!
use std/prelude;
struct Animal {
void *speak;
void *inner;
};
fn Animal::speak(Animal *self) {
fn *speak = self.speak;
speak(self.inner);
}
namespace Cat;
fn Cat::speak(Cat *self) {
$println("the word that a cat would say");
}
fn Cat::new() {
animal := #alloc(Animal);
animal.speak = Cat::speak;
animal.inner = nil;
return animal;
}
struct Dog {
string name;
};
fn Dog::speak(Dog *self) {
$printf("woof im {}!", self.name);
}
fn Dog::new(string name) {
self := #alloc(Dog);
self.name = name;
animal := #alloc(Animal);
animal.speak = Dog::speak;
animal.inner = self;
return animal;
}
fn main() {
cat := Cat::new();
cat.speak();
dog := Dog::new("zoot");
dog.speak();
((Cat *)dog).speak();
}
DELETE
Implement type errors next
wdym
oh
horror
i am NOT making elle a fully dynamic language
ive learnt from python and javascript that its just not a good idea
@royal nymph love?
function rosieWith<T>(arg: T, callback: Function) {
const descriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf(arg));
for (const [key, descriptor] of Object.entries(descriptors)) {
typeof descriptor.value === "function" && ((window as any)[key] = descriptor.value.bind(arg));
}
callback();
for (const [key, descriptor] of Object.entries(descriptors)) {
typeof descriptor.value === "function" && delete (window as any)[key];
}
}
rosieWith([1, 2, 3], () => {
console.log(map(x => x * 2)); // [2, 4, 6]
});
// ๅฎ่กใใใJavaScriptใซใจใฉใผใ็บ็ใใพใใ:
// map is not defined
console.log(map(x => x * 2));
nop
i thought this was elle at first and was about to say "ts!" yeah it is ts im a dumbass
is there a simpler way to do that
You can very easily not do that
use actual with?
its deprecated lol i wanted to recreate the fuctionality
for no reason in particular its just funny
it's deprecated for a good reason ๐ญ
this is cooler
const validIdentifierRe = /^[A-Za-z_$][\w$]*$/;
const reservedKeyWords = ["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "false", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "null", "return", "super", "switch", "this", "throw", "true", "try", "typeof", "var", "void", "while", "with"];
const isValidIdentifier = k => typeof k === "string" && validIdentifierRe.test(k) && !reservedKeyWords.includes(k);
function getValidIdentifierKeys(obj) {
const keys = Reflect.ownKeys(obj).filter(isValidIdentifier);
const proto = Object.getPrototypeOf(obj);
if (proto) keys.push(...getValidIdentifierKeys(proto));
return keys.filter((k, idx) => keys.indexOf(k) === idx);
}
function realWith(obj, func) {
const keys = getValidIdentifierKeys(obj);
const values = keys.map(k =>
typeof obj[k] === "function"
? (...args) => obj[k](...args)
: obj[k]
);
return Function(...keys, "return " + func.toString())(...values)();
}

insane..
js so bad
That wouldn't have access to the actual lexical scope, would it?
something something alignment yadayada cache lines
also is that -O3
compiler flag for max optimizations
yea i dont do pragma
i was just doing a simple address thing for school, and i was stupid
tho the ability to know where something is, makes me really want to segfault intentionally
what am i looking at
...why?
namespace crimes, which are in the top three funnest kinds of programming crime
programming crime
delicious delicious syntax sugar
who is taking us to jail
have u committed any crimes ๐
almost definitely! plus i'm probably illegal in at least 100 countries
whats a transpiler
the compiler is trans so its a transpiler
the kind of thing that TypeScript uses where it inputs code and outputs code
that too
a minifier is a basic kind of transpiler
@valid jetty nixvim is so much easier to configure than normal lua
youre using go now????
no this is from a tsoding stream
n*x
im serious
its so easy
everything works
im almost done
ive spent like 2 hours on this
(not including time spent crying that i couldnt get it set up)
as soon as you stray from god (mainstream distros) youre being brainwashed by the devil (nixos) to believe that all of the big problems you encounter are your fault (im not religious but this is the best analogy i can make)

still less total time spent than lua config
zozin
joking
idk how the hell people use it
tbh linux is nightmare if you use nvidia gpu
dont use nvidia then
@valid jetty
too real
anyone know how to use a native.ts file and a index.ts file but you need to use the index.ts file to interact with the native.ts file
// inside your native.ts:
export function myFunc() {
console.log("I'm doing Electron tomfoolery yippee")
}
// In the imports of your index.ts:
const Native = VencordNative.pluginHelpers.YourPluginName as PluginNative<typeof import("./native")>;
// To call from your index.ts:
Native.myFunc()
They can be async as well if needed
WAHOO!
Note that in some plugins (eg fixSpotifyEmbeds.desktop) this isn't necessary because native.ts just Does Stuff at the global level; because that's already ran there's no need to call in or anything
@jade stone help me with C++
for some reason the macro says params is unused even though it is
#define jni_func_name(name) Java_dev_zt64_mpvkt_LibMpv_##name
#define jni_func(return_type, name, ...) JNIEXPORT return_type JNICALL jni_func_name(name) (JNIEnv *env, jobject obj, ##__VA_ARGS__)
idk, i just use clangd
insane
thats a formatter, not a LSP
@deep mulch https://clangd.llvm.org/
so good
to set it up, just run bear -- make
i think clion uses clangd
ughhh so many warnings @jade stone
its always stull like this Clang-Tidy: 'apiType' declared with a const-qualified typedef; results in the type being '_jobject *const' instead of 'const _jobject *'
like what would i even do about that
love
bumpers!
nvm I guess?
read electron IPC docs and any every plugin that uses a native.ts
insane
function foo<O extends object, K extends keyof O>(thing: O, key: K) {}
guhhh forgot i could do that 
ended up inlining keyof O
O[keyof O] my beloved
got it, [this](#๐ช
-progaming message) helped alot.
The syntax for the "import" scared me for a bit when reading other plugins
Note for future people, if you want your native.ts func to take arguments, you need a dummy unused arg in the native.ts function, it looks like this:
// inside your native.ts:
export function myFunc(_, arg0, arg1) {
console.log(`I'm doing Electron tomfoolery yippee ${arg0} ${arg1}`)
}
// In the imports of your index.ts:
const Native = VencordNative.pluginHelpers.YourPluginName as PluginNative<typeof import("./native")>;
// To call from your index.ts:
Native.myFunc("arg0", "arg1")
@robust jackal need more context on what you're trying to do with the scene that you have
like whats your current code
you can find logs here
where are you applying that to
oh this is interesting
I do wonder if you could just put
.compatMentionCounter(
WVStore: WVStore,
pingCountText: pingCountText
)```
on appmenu
yeah im not sure i havent tried that before
ill experiment with it later (playing game rn
nvm ill do it now
have a project that actually setup
@robust jackal wait cant you use .onChange(of: ) { _ in
instead of .onChange(of: ) { _,_ in
this should work on macos 13
since you're not using before and only after this should work, though its deprecated (but who cares!)
cursor ai
Alright @robust jackal, in 10 hours: โฆ
Did it work?
no shit
js config is terrible and we should explode js package devs who use them
why
@ionic lake taskyyy
hey
I'm having the same issue too, did you find a fix?
lmao
get a life
@robust jackal, <t:1744181536:R>: โฆ
LMAO
has any1 here ever used workbox?
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
import { clientsClaim, skipWaiting } from 'workbox-core'
import { build, files, prerendered, version } from '$service-worker'
const precache = [...build, ...files, ...prerendered, '/'].map(file => ({
url: file,
revision: version
}))
precacheAndRoute(precache)
cleanupOutdatedCaches()
clientsClaim()
skipWaiting()
is this enough?
or do i need some extra shit
if i have a string, is there any easy/performant way in C to create a "hash"-like number i can use to compare strings so i dont have to use strcmp
you want consistent number size?
do you char c[] = "blah" or string c = "blah"
char ptr
so char
yes i guess
i'd do smth around the idea of
long num = 0;
for (auto i = 0; i < c.size(); ++i) {
num += 31 * (long)c[i];
}
smth like that?
mm sure
very pseudo code
havent written C code in like.... 3 years
so i'm going hard off of memory
you could also use % if u want a somewhat consistent size
but there are defo better ways of doing it xd
cant do this?
char* c = "blahc";
char* d = "blahd";
while (*c && *d) {
if (*c != *d) {
return *c - *d;
}
c++;
d++;
}
``` ?
oh you want to string compare?
A/B problem lol, i thought u wanted a persistent hash XD
yea well ill be storing a large amount of strings in map like structure, where the stirng is the key, and using strcmp for each entry isnt very effective
idk if c has more than strcmp / strncmp
this is basically strcmp implementation
also you dont seem to handle \0
you.... could do a cursed map-map-map
its in && i think
it will implode ur memory requirements tho
yep!
except u use bitwise shift instead of mult
i will probably use it then
which yeah makes more sense
thanks
ayyyyy, stonks, i'm not THAT much of a dumbass
lmao
now help me
XD
actually never used workbox b4
simhash
lc.g simhash
Nov 19, 2012 ... Simhashing is one of my favourite algorithms. It's somewhat simple, brilliant in its approach, but still not obvious enough for most people.
average internet plebian not embracing the superior light mode
great now you can explore hdr support in wayland and explain it to me
light mode was so bad they made dark mode, because if it was good, there would be light mode 2 but there isnt, however there is dark mode 2 ๐ฅ
light mode so good it didnt need a sequel, nothing could be as good as it is
unfortunately for you i'm only interested in debian 12
and no other linux distro
@valid jetty just got around to adding elseif, was pretty easy ```diff
let cond = parse_expr(parser, ctx)?;
let then = parse_tree(parser.delim('{')?, ctx.sub());
let els = if parser.keyword("else").is_ok() {
-
Some(parse_tree(parser.delim('{')?, ctx.sub()))
-
if parser.clone().keyword("if").is_ok() { -
Some(vec![parse_stmt(parser, ctx)?]) -
} else { -
Some(parse_tree(parser.delim('{')?, ctx.sub())) -
} } else { None };
debian 6
uuuh
i think the core for bookworm is 6
but its called debian 12?
i dont get it ngl
oh my god ๐ญ๐ญ๐ญ
yes
Debian releases do not follow a fixed schedule. Recent releases have been made around every two years by the Debian Project. The most recent version of Debian is Debian version 12, codename "Bookworm". The next up and coming release of Debian is Debian 13, codename "Trixie".
Debian always has at least three active branches at any time: "stable",...
it sounds funny
thanks dude, i couldn't figure that out lol
how did you do red green
@fleet cedar hi i request your wisdom
Speak
my parser is technically multi pass, as in, i parse imports first, then structs, then functions and constants
which means the parser before ignored every token that was invalid, just skipped it entirely without throwing an error because it could be a valid token but the wrong pass
now i explicitly skip primitive parsing instead and throw an error
but is there a saner way to do that
what i mean is, before, every token that was deemed "invalid" was skipped, which means you can put top level statements and have them be completely ignored by the parser
now i explicitly do this sort of thing for every structure when its the wrong pass
if !should_parse {
if external {
while self.parser.current_token().kind != TokenKind::Semicolon {
self.parser.advance();
}
self.parser.expect_tokens(vec![TokenKind::Semicolon]);
self.parser.advance();
} else {
while self.parser.current_token().kind != TokenKind::LeftCurlyBrace {
self.parser.advance();
}
self.parser.expect_tokens(vec![TokenKind::LeftCurlyBrace]);
self.parser.advance();
let mut nesting = 0;
loop {
if self.parser.current_token().kind == TokenKind::LeftCurlyBrace {
nesting += 1;
}
if self.parser.current_token().kind == TokenKind::RightCurlyBrace {
if nesting > 0 {
nesting -= 1;
} else {
break;
}
}
self.parser.advance();
}
self.parser.expect_tokens(vec![TokenKind::RightCurlyBrace]);
self.parser.advance(); // Go past the right curly brace
}
return None;
}
but is there a better way to do that
like for structs its
if !should_parse {
if namespace {
while self.parser.current_token().kind != TokenKind::Semicolon {
self.parser.advance();
}
} else {
while self.parser.current_token().kind != TokenKind::RightCurlyBrace {
self.parser.advance();
}
self.parser.expect_tokens(vec![TokenKind::RightCurlyBrace]);
self.parser.advance();
}
self.parser.expect_tokens(vec![TokenKind::Semicolon]);
self.parser.advance();
return None;
}
That does sound a bit nasty
The optimal strategy obviously depends on the language being parsed
i still need to skip the tokens, but i also dont want to do the naive "parse anyway but dont add it to the final ast"
for big structs or functions with big bodies that could be performance degrading
I strongly recommend matching together delimiters before doing the main parsing
It makes everything so much nicer
what do you mean matching together delimiters?
Have tokens as a tree instead of a list
Yeah for example
and tag it as "unparsed function" then skip that when its the wrong pass?
wait wdym a tree
At the lexing stage (or just after), I pair delimiters together so instead of fn foo ( arg1 : num ) { print ( arg1 ) ; } it's fn foo (...) {...}
i wouldve thought just like a Vec<Token, Vec<Token>)> and the example would be vec![Token::of("fn"), vec![...]]
ah
And then for the first parse stage I just chuck that whole {...} into the ast node to be parsed later
i see thats probably a better way to do it yeah but then is it really a token stream
Depends on how you define token stream
I do store it as a flat list, but the cursor type exposes it as a tree
yeah but under very loose terms you could consider this a parsing
Yeah it's a matter of definitions
What I do know is that it's very convenient, and gives pretty decent error recovery cheaply
tbh having a preprocessing of the tokens before theyre properly parsed isnt a bad idea
ok i think ill put this under a todo and work on it in a day or two probably thank youuu
@deep mulch @placid cape @hoary sluice opinions?
// by default all private
fn foo() {} // foo is implicitly private
pub fn bar() {} // bar is explicitly public
global pub; // every function in the module is public
!pub fn foo() {} // foo is explicitly private
fn bar() {} // bar is implicitly public
// by default every method is defined unless specified with the `external` keyword
fn foo() {} // requires `{}` if not external
external fn bar(); // if external, requires just `;` and throws if you try to provide a body
global external; // every function in the module is external
!external fn foo() {} // explicitly defined, requires `{}`
fn bar(); // implicitly external, requires just `;`
i already implemented this, its a more extensible system than global pub and local like i had before
global external is useful for header files which are pretty much always only external functions
i cant tell if this is a sane thing to have in the language though
idk about the global one
it would be easier to just prefix with pub as needed
you already can
you can do that
but if you want to make them all public at once and only make specific ones private
not worth the effort to implement imo
there i changed it, does that make more sense lol
@valid jetty
i already implemented it
writing raylib bindings in elle
thats why i added global external
the raylib bindings are quite literally just external functions, structs, and enums
add automatic generation when
at some point but that essentially means writing a whole C parser
C headers can contain C code
why
a .h file can be a .c file in disguise
idk
how does cgo do it
To use cgo write normal Go code that imports a pseudo-package "C". The Go code can then refer to types such as C.size_t, variables such as C.stdout, or functions such as C.putchar.
If the import of "C" is immediately preceded by a comment, that comment, called the preamble, is used as a header when compiling the C parts of the package. For example:
// #include <stdio.h>
// #include <errno.h>
import "C"
The preamble may contain any C code, including function and variable declarations and definitions. These may then be referred to from Go code as though they were defined in the package "C". All names declared in the preamble may be used, even if they start with a lower-case letter. Exception: static variables in the preamble may not be referenced from Go code; static functions are permitted.
thats a big thing to write lmao
annotations
In this video I discuss the story of how Microsoft Developed a BASIC interpreter for the Altair 8800 and why Bill Gates Open Sourced the code for this first program that Microsoft ever developed to celebrate 50 years of the companies existence.
See the source code here
https://images.gatesnotes.com/12514eb8-7b51-008e-41a9-512542cf683b/34d561c8...
yeah i would make a syntax like
use foo/bar @c;
there is already an annotation/"attribute" syntax in elle why not use it
use foo/bar.h
no bc elle imports dont have an extension
you just use foo/bar;
where there exists a ./foo/bar.le file
guh?
why does my brain work like thisssss
between 22:00 and 4:00 my brain was so clear and i could think properly of how i want to do xyz
now itโs 4:10 and my brain is suddenly super cloudy and i just canโt think properly anymore
how does this happen
chloroform
Sleep
rosie discovers the effects of sleep deprivation
Is it possible to make the .bat file that compiles Vencord so that it automatically selects the stable (which is the only) version and patches it without having to press enter?
thanks
what the heck
ai slop or nah
chat
IM NOT READIN ALL AT
the fudg
my brain hurts trying to comprehend that
ok bruh dont put your git diff into chatgpt.com
why?? why????
why does that guy speak an ai model
bruh
im like
30% zoomed out
and its still going
oh ma god
this merge request is werid
aDdEd FoR xDg ShElL
this guy de formatted every file bruh
Love all these
Do you add that in random unrelated places in your PRs?
new lines? if u dont add an empty comment the line break will get molested by the formatter
๐
that is hilarious
nahh
bro edited this in
Somehow I don't see that pr getting merged
why would it
lol
im just alughing because i got called autistic
at 3am in the morning
definitely not the time to be looking at hyprland slop
blud used shittier
why are u doing 2 line breaks
Ello
@hoary sluice huge
do i call it
fn BeginMode2D(Camera2D camera) @alias("rl::begin_mode_2D"); // Begin 2D mode with custom camera (2D)
fn EndMode2D() @alias("rl::end_mode_2D"); // Ends 2D mode with custom camera
or
fn BeginMode2D(Camera2D camera) @alias("rl::begin_mode_2d"); // Begin 2D mode with custom camera (2D)
fn EndMode2D() @alias("rl::end_mode_2d"); // Ends 2D mode with custom camera
snake_case shouldn't have capital letters
yeah but begin_mode_2d feels weird
No it doesn't
maybe begin_mode_2D feels weirder
warning: function `begin_mode_2D` should have a snake case name
--> src/lib.rs:1:4
|
1 | fn begin_mode_2D() {}
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `begin_mode_2_d`
|
= note: `#[warn(non_snake_case)]` on by default
```The rustc has spoken
Yeah that suggestion isn't great ngl
!pub is an interestic concept ๐ค
i had global pub and local before but i dont wanna add a new keyword for everything you can make global module-wide
so you can just do !pub for private and !external for non-external
Yeah that's good
is code duplication here acceptable
cant you just do a thing like
function read_entity(reader: StringReader, prefix: string, error: string): string | Error {
if (reader.skip_over(prefix)) {
const id = reader.read_until(">");
reader.read();
if (is_snowflake(id))
return id;
} else {
const id = reader.read_until(" ");
if (is_snowflake(id))
return id;
}
return { error };
}
export function read_role(reader: StringReader): string | Error {
return read_entity(reader, "<@&", "Expected role mention or ID");
}
export function read_channel(reader: StringReader): string | Error {
return read_entity(reader, "<#", "Expected channel ping or ID");
}
what language is this
and whats the difference between the 2 codeblocks
oh
everything lowercase
you should never use capital letters except in type names and in documentation
whoever invented capital letters is a bad person
@hoary sluice did you see !pub
.
no
0xff 
0xFF
๐๐ฟ 
i think u should have implicit private and explicitly mark everything, no global no !
until you have a big binding
the horrors
why did u put global pub everywhere
beautiful
having to mark every function as public and external when there are 556 functions to mark just adds a bunch of repetition for no reason especially considering there are 0 functions with a body
better than having unreadable sections
its not unreadable
if you want, i can get rid of global pub and add scoped specifiers
pub external {
fn foo(); // public external
fn bar(); // public external
}
fn baz() {} // private, non external
that doesnt make it better i just dont like stuff like that in general
impl block in rust is already far enough
yeah but rust is verbose asf
the good kind of verbose
tell me why i have to specify pub on the struct itself and every single member of the struct
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct MemoryOperation {
pub left: Box<AstNode>,
pub right: Box<AstNode>,
pub value: Option<Box<AstNode>>,
pub left_location: Rc<Location>,
pub right_location: Rc<Location>,
pub value_location: Rc<Location>,
pub is_deref: bool,
}
like i get why but
its annoying
why not pub by default like a sane language
rust is a sane language
why is every field hidden unless you explicitly mark it as visible
because private by default makes a lot more sense
Why would exposing your guts be the default
youd rather not expose something on accident and the compiler will tell you than expose something on accident and have the compires not tell you
i mean maybe but for big structs that kind of verbosity is annoying
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct Function {
pub linkage: Linkage,
pub name: String,
pub variadic: bool,
pub external: bool,
pub builtin: bool,
pub volatile: bool,
pub format: bool,
pub lambda: bool,
pub unaliased: Option<String>,
pub usable: bool,
pub imported: bool,
pub generics: Vec<String>,
pub known_generics: HashMap<String, Type>,
pub arguments: Vec<((Type, Value), bool)>,
pub return_type: Option<Type>,
pub blocks: Vec<Block>,
}
maybe those bool flags should just be a flags: u32
but thats optimistic refactoring
Absolutely not
flags: FunctionFlags, where struct FunctionFlags(pub u32);
husk
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct Function {
priv linkage: Linkage,
priv name: String,
priv variadic: bool,
priv external: bool,
priv builtin: bool,
priv volatile: bool,
priv format: bool,
priv lambda: bool,
priv unaliased: Option<String>,
priv usable: bool,
priv imported: bool,
priv generics: Vec<String>,
priv known_generics: HashMap<String, Type>,
priv arguments: Vec<((Type, Value), bool)>,
priv return_type: Option<Type>,
priv blocks: Vec<Block>,
}
why is that syntax highlighted
you wanna do c++ public: private: blocks?
so you dont accidentally expose things and cause too much garbage to show up on autocomplete/docs its one of the most sane things about rust
cause the dicord lsp is good ilek that
Lsp in discord code blocks when
im saying to have a way to toggle it
that will just cause confusion
it doesnt take that much effort to write pub 20 times
hmmmm
:norm _ipub youre done
Or block selection
you dont need a member to be public more often than not like look at oop language its insane everything is just made private for "getters" and "setters"
dreamed up by the utterly deranged
lol yeah in oop languages that stuff is horror
at least C# has like int member { get; protected set; }
and that kind of thing
its funny how everyone is doing a functional shift now
we are finally recovering after the atomic bomb that was java
this was generated from doing (orig cond) && !(newCond)
why are you not using nvim
they need to stop teaching java in schools and start teaching OCaml instead
so true
start all kids on the current version on icps (if statements, 1 argument functions with no currying, a print statement, and nothing else)
LMAO THE We had a tool for that ๐ญ๐ญ๐ญ๐ญ๐ญ๐ญ๐ญ๐ญ๐ญ
this one is funnier than other ones ive seen
STOP DOING PHP
YEARS OF GENERATING HTML yet NO REAL-WORLD USE FOUND for going higher than HTMX
Wanted to go higher for anyway for a laugh? We had a tool for that: It was called DRUGS!
Insane
Few reasons
It sucks on windows, even more so on arm where a bunch of extensions just don't build
I'm developing a vscode extension
The ui is nice for things like tests
I hate lua
oh firefox... how much i hate you...
you running windows on arm?
arent you a nix enthusiast, where are you running nix
nixvim exists for this reason
fun fact im working on a companies website rn and they are proud of having ai generated stuff so i have to add this to pages lol
Didn't we already talk about this
My laptop does not support linux
Yes
yes
what feature 
how... fucked is it? like how many "fucking hell X doesnt work again" have u had?
also did u try gaming on them?
position anchors
yes i know which is why i asked where youre running nix
does nix run in wsl or something
or do you have a different machine
i run nix on my desktop
it does, and i do that on windows on my desktop, but while it should work on wsl, there's no arm build of nixos-wsl to download

you have windows on your desktop too?
yes, i play valorant sometimes
i installed it last month just for that
@valid jetty we should implement bluetooth over ip
can u run debian arm with nix installed
almost done with raylib bindings
well not really
i did all the structs and enums
and 185/556 functions
i wish i could craft a regex to do this but i cant
it has to convert pascal case to snake case and align everything which is just a lot more effort than i would like to make a regex out of
i dont think this is very easy to do with :norm either
because i still have to convert pascal case to snake case
Just ask ChatGPT to do it lol
im scared itll get it wrong tho
there are some assumptions i make
like, the const keyword doesnt exist in types
so const unsigned char * is just u8 * but the ai doesnt know that
Oh well
but users also support @ or @!
and at that point i think code readability would be sacrificed
idk i just wrote what you showed in 1 function
repeating it is probably fine, but i would do like if (prefix === "<@") read.skip_over("!"); in the single function and just move on
yea but it's a pain in the ass to do it
cba for my laptop
ah i would never think of this thanks
(seriously)
(i never do things like that ๐ญ)
this somehow feels... better to me
yeah thats good
somehow listing every expected parameter makes it feel.. less hacky
just use the discord client code :3
i also did null instead of error... because if i want translation the parser having that responsibility is weird
wondering whether if i translate bot i should translate slash command names
(would help if i actually knew any languages other than english)
yes, sometimes I go on their ASUS Zenfone 9 board
Product was vibe-coded, rejected
snake case in js/ts is cursed
242 / 556 functions done
278 is halfway
@hoary sluice have you ever heard of a https://en.wikipedia.org/wiki/Centripetal_CatmullโRom_spline
In computer graphics, the centripetal CatmullโRom spline is a variant form of the CatmullโRom spline, originally formulated by Edwin Catmull and Raphael Rom, which can be evaluated using a recursive algorithm proposed by Barry and Goldman. It is a type of interpolating spline (a curve that goes through its control points) defined by four con...
don't worry
i am a human code purist
yeah i think i should use camelCase but it will take forever to rework
i feel like if you're vibe coding you've gotta be throwing code quality out the window
lol
another spline to haunt me at night
i am sick and tired of curves and splines
centripetal catmull-rom spline โค๏ธ
i don't really know what my overall opinions are
i find it kind of cringy but would i say ai has no place in code at all
idrk
the problem will sort itself soon enough
when there are no more capable people anymore because all they did was rely on ai xd
demand for real programmers will skyrocket then
you will be one of them
i have quite literally not once in my life used ai to assist me in coding, debugging or anything of the sorts
i just would not like my code having ai generated stuff in it
okay boooomer
i would want to look at code and know who wrote it
ai is not a person
it feels weird
hinders your personal growth and gatekeeps knowledge from yourself if you have someone do the heavy lifting for you (and thats even assuming the ai does it properly, which it most likely doesnt)
don't make me be mean ๐
yeah thats exactly why im trying to not rely on ai
i don't use ai full stop
i dont wanna fry my brain and lose my actual knowledge and skill
only for the memes
lmao
also best case: the ai does everything properly just the way you want
... but you don't know that until you manually check every line the ai produced... soooo.... might aswell do it urself
i think i have a similar sentiment to linus torvalds
lmao yeah EXACTLY
why make ai write it when i have to check everything anyway
but i don't see ai coding really being something that interests me
if anything its more effort because when i write it myself i know exactly how i wrote the code and how it works
AI is useful as a "more advanced google search" for finding solutions, rather than solving problems, that's it
when ai writes it i have to first understand the code it wrote
i often get frustrated by not finding stuff on google
but i feel like in those cases ai would hallucinate?
try different search engines
ai is good for that actually
depending on what it is u r looking for
sometimes there is just something on the tip of my tongue and google is just not helpful anymore
i was trying to work out what the typescript type for anything apart from null is
i ask ai more or less paraphrasing what i want and it tells me what its called
could not find anything directly answering that
thats the one usecase ive found for it
{}
i wasn';t suure if it was {} or what
i was trying to double check
NonNullable<unknown> is {}
but i thought nonnullable made all of the values non null

the undefined
was getting confused with Required
yeah, cuz i'm forcefully entering the update page when there's no update
so it goes "wtf how u get here"
i have a page which appears when you're not logged in
better than a crash ig
is the appropriate text for the button to log in continue?
normally if there's no update and u enter the update page it kicks you out back to the app
thats squid game
elaborate what xd
no i was saying thats the name of a "film" u remember
xd
squirrelbot and squid game sounds close enough
(it doesnt)
ah
i am german
movie is a weird one
because it should be talkie
wasn;t that the original name
for movies with sound
nvm
did i imagine that
Is it possible to somehow run a .bat file from vencord (for example, by command)?
xd
i honestly find snake case easier to read
it's like a written sentence with spaces
just ignore the underscores
less mental effort than trying to identify words by capital letters which could look different between fonts
Does separating the words take conscious effort for you?
yes 3 seconds ago
when i read this
yeah, through native.ts
it's funny how refactoring my parsing to be cleaner has solved so many issues

that is to say, it's cleaner and shouldn't be any slower either or mean more code
there was something super dirty which i realised i could totally just use regex
i was also using exceptions for user facing errors when i realised i could just use a discriminated union
I guess it's hard when it's being parsed to Record<string, OptionValue> | { error: string } but i think i'll do { result: Record<string, OptionValue> } | {error: string }
wondering
in discord commands is it better to have like
.say 'quoted string: \'hello\'.' or
.say 'quoted string: ''hello''.'
i guess escaping with backslash is invisible
neither
i am supporting unquoted strings
but i thought i might as well support quoted too
maybe for like polls so it knows the boundary between each option
.poll 'hawaiian pizza' 'meatbals'
do it the discord.py way
wonder if i should do imagegen in my bot to be fancier embeds or that's just bad for accessibility therefore pointless
suffer
how does discord.py do it
i just greedily eat everything until - or -- for flag
no clue
but it does it well
i once wrote a hybrid command framework for oceanic handling flags and strings
unfortunately my back up has been thanos snapped
if it's not the last positional argumenrt
if you want to help i want to make it standalone to use in other bots
to allow for server specific prefix i think i will have a preParse option that's passed into the command handler instance
which returns something like { prefix: "!", trimWhitespace: true }
true
vee will force pinned package vesrion
i wish, sadly i cant since my laptop broke down (again) and the machine im on currently is windows (god forbid i every do any serious dev work on windows)
view.py: Line 155
# to embed a quote inside the string you must escape it: "a \"world\""
yeah that's kind of ugly
they don't have to
it's only if you want to use quoted string
but i don't think there's a better solution for poll
(idk if there's any reason to do a poll command any more anyway but there are probably similar commands)
its optional
you cant really discern if "hello "world"" is ["hello", "world", ""] or ['hello "world"']
other than escaping
and i'd much rather go with \ since its the defacto way of escaping things in strings

when do you use it besides programming
if you really want you can support all sorts of quotes (like single, jp, ...) so people can nest them instead of escaping

i support single and double
idk if i am gonna try to translate commands yet
i probaly should not
who the hell translates prefix commands
many do
โ ban โ โ โBan one or more users with an optional reason and delete message days
set-name โ โ โEdit the current channel's name
set-topic โ โ โEdit the current channel's topic
role-add โ โ โAdd a role to one or more users
role-remove โ โ โRemove a role from one or more users
mute โ โ โMute one or more users
prune โ โ โDelete a number of messages
rule โ โ โQuery a rule and send it
slowmode โ โ โSet the slowmode for the channel
submissionpass โ โ โAllow this user to post one submission
unban โ โ โUnban one or more users
threads โ โ โWatches your threads to make sure they always stay open! Specify a channel to watch all threads in that channel.
whybanne โ โ โWhy Banne?
Use vyardฤฑm <command> for more information on a specific command!
This button is not for you! ๐ข
pull a donovan dmc and encode all the contextual data as base64 in the command id
no but there's melon bot (the server bans all tรผrk bots so makes sense there is no yardim bot)
#nodb
i asked before
what about slash commands
wouldn't it be kind of annoying to translate them
maybe only descriptions
always hate when bots do not have a command registered and they tell you that they dont
why?
like i mean the names
discord has localisation for slash commands
maybe, just maybe, you know MAYBE i wasnt asking you, stupid bot
even better when they have a generic prefix and command name so normal conversation triggers the bot stares at @elder yarrow menacingly
dw i already fixed the venbot stuff
would you really want to run /verbieten instead of /ban 
also you dont have to b64
since command ids dont have to be valid utf8
but what how
isn't json utf-8 based
idk
it's been about two years since i wrote a json parser
@valid jetty what are all the ways youre learning japanese
i need to learn kazakh but theres almost 0 resources
json doesnt have to be utf8 :^)
and if that doesnt work just send a multi part form body
yeah but isn't discord accepting it as utf-8
um actually that's not a correct translation
then why does everyone send base64 instead of raw bytes
the correct translation would be (ver)bannen
cause yes
yes
just shorten to /ver maybe?
digga aber dann heisst der endpoint auch gleich und der joke funktioniert nicht, nenne es /abschieben
/stummschalten nutzer:@winged mantle grund:hat sich wie eine hsin verhalten
bahahahahaha
ver is the "to" in to be
lmaoo nah
is that a swear
/and
what is?
to-ban ver-bannen
ver
german laughing like banana but you keep adding na
banananana
yeah this
verlaufen = get lost
verbannen = ban from somewhere
vertrieben = expelled
verloren = lost
it's hard to explain lol
lc.gem explain the german prefix ver- (as in verlaufen, verloren, vertreiben). keep it short
The German prefix ver- is complex and doesn't have one single meaning. However, it often implies:
- Going astray or wrong: as in verlaufen (to get lost - run wrongly), verloren (lost).
- Completion or finality: sometimes intensifying the verb's meaning.
- A negative or opposite outcome: as in vertreiben (to drive away - drive off).
It's best to learn the meaning of each ver- verb individually.
idk it's an odd prefix u can't really translate
"ba" + + "a" + "a" + + "a" + "a"
no
"ba" + (+"a") + "a" + (+"a") + "a"
its literally just a direct translation of "to" in the context of "to be"
how you would actually write it if you wanted it to be readable
thats the thing
oh
you should never write it if you want it to be readable
and the actual suffixes aren't really similar
are we talking about string concatenation or ver verbs
you love german prefixes
this is one messagee
containing javascript
i have a friend who knows one word in chinese
nah it's not throwing lmao
a lot of these have nothing to do with legen and are just coincidences
actually idk does ueberlegen come from legen
"ich habe es verlegt" roughly translates to "i put it somewhere and dont remember where"
it's kinda different from "ich habe es verloren" (i lost it)
verlegt is like I forgot where it is but it's still around
verloren is like I lost it and it might be gone for good but who knows
its a way to say you lost something if it was important and the person youre speaking to will kill you if you say you lost it
is it time to finally start using firefox got 3 months before manifest v2 completely stops working on chrome
i hate this
use floorp
maybe cause its the same language family
misplaced implies you just forgot where it is but it's still around
damn why is github giving away copilot for free now
misplaced is soft, lost is hard
what in the firefox fork is this
its like if cigarette companies started giving them away for free
never falling to peer pressure for cigarettes (dont have peers)
To scrape more code
REAL
guhh its been long since ive used vsc
how do i uh add ts support
do i need to install something
one might forget where they put their keys but not lose them
like treesitter grammars and lsps
anki is so good
and i wanna add teuida and airlearn to that list but teuida is more asian languages
372/556 :3
i have a weeb friend
@valid jetty hiii
Rosie addicted
Because it changes every meaning of a word individually
how is it possible when you use regex.exec on a global regex and set the lastIndex manually that the resulting index is under lastIndex
ah it can't
interesting how much faster the stdlib is
i wish there was a startswith with offset
kind of funny how the the built in method is faster even if you use slice
/run ```js
console.log("Hello".startsWith("ell", 1))
Here is your js(18.15.0) output @fleet cedar
true
wait what
nice
makes code cleaner and faster
this is why you use built in methods where possible
they will have microoptimised them an incredible amount

or maybe it's mainly from being native code i can't really think of a more efficient way
probably
556 what
functions converted from C to elle from the raylib headers
@hoary sluice the thing i cant craft a refactor expr for
because it has to be converted using the right elle types, the alias converted from pascal case to snake case, and the alignment has to be correct
its easier to just do it by hand than craft some expr to do it for me
yeah it is
@valid jetty hii
upgrade to pro
idk if this is preferred behavior
@hoary sluice ITS DONE
enums are funny
who needs enums anyway
Nodejs and native code? No way
nodejs has a lot of native code
and its support for native code is surprisingly good
there's close to 0 overhead, which is insane
But a lot of builtins are in js
Nope sometimes it's not even in native
or at least I think
Well idk what's the current situation
depends on what
Good night
most of it uses native code
i made myself a v8 sandbox just so i can inspect node code and profile it
the mandelbrot example runs with the new raylib bindings :3333
i think im gonna try to make a uv mango via elle
but yeah a lot of it is js, but the important shit is most of the time native
the stuff in js is definitely JIT'd so it probably doesn't matter
only the performance sensitive stuff is in native if it can do it better
yeah, for the most part
unfortunately most of streams and buffer is written in js, at least most of the very often called shit
those are like the 2 massive outliers from that rule
which is why its always better to just use uint8 than buffer
and why its always better to use async iterators than buffers
because async iterators, even with the insane overhead they have, are still almost 40% faster than node streams
and forunately you can do
const asyncIt = stream[Symbol.asyncIterator]()
or simply
for await (const value of nodeStream) {}

