#πͺ -progaming
1 messages Β· Page 19 of 1
i knowd that!!!!
I think the latter will require you to write struct Struct to refer to it
*actual bonus points if you derive default though
yes
it's c, not c++
Why is c so weird
it was created before we born
mentality behind it is not understandable by us (esceptinally rust developers)
Not me
its literally asm with syntax sugar
Iβm the oldest person on earth
π
Probably 50 years ago writing struct Struct made it easier for compilers to parse, but then a decade later they decided this fucking sucks and made better compilers with typedefs
that's similar to
struct Struct {
int a;
char* b;
};
struct Struct Struct_create(int a, char* b) {
struct Struct s = {a, b};
return s;
}
(i know that there is shorter way to do that, but i forget it)
That's the name of the alias you're defining
..?
ive made a couple small programs in C but im not very well versed in C
OH
its the name
im stupid
yeah okay
why put the name at the end tho..
if declared as a struct, you will write struct Struct
if declared as a anonymous struct with typedef, you can do struct_t (Struct) without struct
Because typedef has the same syntax as variable declarations
int x; x is a variable of type int
typedef int x; x is an alias for type int
small programs meaning single file with 129 lines
Typedef syntax gets much more fun with function types and pointers
pointers π¨
C'mon, you know you love it
i mean yea kinda
pointers are kinda stupid yes but they are also fun to work with because i love challenges
figuring out how to make a dynamically sized array in c from scratch was fun
functions: typedef void Function(int, int);
pointers: ...
@dawn ledge hii
But the fun thing about function types is that you can't really use them for anything, not unlike rust's unsized types such as str
So you almost always do typedef void (*Function)(int, int); to get a function pointer type
haii
anyone used the zig build system before? i dont understand why these dont produce the same exact output
first one makes file thats 3.5kib second one makes a file thats 2 megabytes
so clearly the second one isnt being dynamically linked against the system library right? i dont know what im doing wrong :(
tf
it doesnt link the same at all
wait is that the output for the linking of the buildscript? what is going on π΅
zig moment
@deep mulch help
im encountering the weirdest thing
a variable is null but somehow returning false if you do == null
and its only happening in one place
wing
and only in a release build
show
show code
wing forgor
fun Navigator.navigate(screen: Screen) {
println(parent)
if (items.any { it.key == screen.key }) return
if (parent == null) {
println("has no parent")
runCatching { push(screen) }
return
}
else runCatching { parent!!.navigate(screen) }
}
wheres parent defined
Navigator
show
its just a val on the naviagtor that defaults to null
if its only release maybe proguard is removing something during minification
println(parent) prints null when parent == null returns false?
yes
the first print statement prints null but the second print statement is never reached
weird
have you tried debugger
or that wouldnt be possible cause its release build only
does parent get set to null anywhere in the navigator ro somewhere else
try ```kt
if (parent == null) {
println("has no parent")
runCatching { push(screen) }
return
} else {
println(parent)
runCatching { parent!!.navigate(screen)
}
see if its null when it prints there
same code for them all?
the same component
maybe youre forgetting something in the component
oor maybe
where does parent get assigned
are u sure it's not just this
yes
anyway that code is kinda meh anyway cause u keep referencing the same thing
fun Navigator.navigate(screen: Screen) {
if (items.any { it.key == screen.key }) return
val p = parent
if (p == null) {
println("has no parent")
runCatching { push(screen) }
return
}
else runCatching { p.navigate(screen) }
}
do
not the minification
parent is already a val
i think proguard would just inline parent
it cant be changed
are u sure
yes
then your issue shouldnt happen
i checked source
nop
parent is a constructor param
its provided only when i create a new navigator
which i dont do here
do if (parent.also { println(it) } == null)
since thats the closet it can get
i think
in case somehow its getting set to a value in the time between function calls
compose snapshot system might be related
do
none of this really explains why its only happening on this component and in a release build
try minifyEnabled = false anyways
even if that works its a terrible solution
i know
but just try it
narrow down the issue
if thats the issue then we can figure out rules for proguard
I'm still waiting on it to build with this
why did it have to be weird on release build
so long to compile
i had to make tiny adjustment
oh
whar
the account settings screens key shouldn't be being used twice
now that could be minification causing two screens to have the same qualified name
maybe
which is what voyager uses for keys
does changing it fix
maybe
that would explain why its that specific screen and only in a release build
although still no clue how proguard gave two classes the same qualified name
what if its compose compiler messing up
actually i did bump agp to 8.6 recently
well it worked
so minification is the cause
im gonna downgrade agp and see if that fixes it
i know everything
this is still an odd issue
yes
i love agp breaking things
thats the only thing I've changed recently enough to cause the issue
maybe you can report
i probably will
youll need to make reproducer
theyll ask you for it
does 8.5 work
waiting for gradle sync
it will explode
nop
guh
ill revert it even further to 8.1.4
what were you on before updating
8.1.4
it duplicated the qualified name again
but with a different name
interesting
womp
chat is hibernation on luks a good idea
id need to suspend to disk
32gb of ram into swap
It seems like it would take longer to boot, then if you didnβt hibernate
oh interesting
rusher what would you do if i stole your laptop
kill

Justified. Laptops are sacred.
very
I mean, if you're the type to never close any windows, then yes, hibernation in general is a good idea
and the performance impact won't matter much
yeah im the kind of person to never close anything
although the laptop is very fast so i maybe ill just shutdown instead
my main concern isnt the performance so much as the wear on the ssd
i have 48gb swap on luks
my desktop has 72gb swap on luks 
i never use it all
what the fuck
for the times I theoretically hibernate my desktop
on ssd?
yop
crazy
oh wait i just realized only used memory is written to disk
i dont think its gonna be big wear on ssd then
i thought it would encrypt and write 32gb to disk every time i hibernate

laaaazy
I never shut off my desktop
I finally got luks/lvm/mkinitcpio/uki to all collaborate
I can boot directly from uefi without any bootloader
@deep mulch are you proud
never
i got a headache because no way to turn down brightness from kernel console
love
just write directly to sysfs
is the plugin submission page in the docs (https://docs.vencord.dev/plugins/submission/) supposed to be blank
oh fuck that's smart
thank you so much
Plugin Submission is simply just a PR to https://github.com/Vendicated/Vencord
Can the github maintainers please add "plugin-submission" "plugin-fix" and some other reasonable labels for PRs cause it's kind of confusing otherwise imo
To differenciate between a PR that's a new plugin or just a fix of one or something else entierly
do
Why
I used to keep laptop on to not wait modded minecraft launch again
its gpu died
well that was probably coincidence

Part of me wants to use luks, but I don't want to type a password every time I boot

I've gotten used to typing in a password on boot because of zfs
reminds me of my uncle who died after drinking water... thats why you shouldnt drink water but might be a coincidence π₯Ί π
how do I make this return itself?
import { EventEmitter } from "events";
export default class RPCServer extends EventEmitter {
constructor();
}
in action:
and the class im typing
nvm
I had a type overriding the module

worth it
i am going to go fucking insane
thanks, i love it when my errors are caught by some random thing and not shown to me
you cant fetch external resources on localhost right?
i get used to typing password so much that it is got infused into my muscule memory
javascript does not have overloading
ts is js with source typing
ah
you can only have signature overloads, not definition overloads
signature as in name?
in classes you can overload like ts class a() { function a(param: string): string function a(param: int): string function a(param: string | int): string { return param.toString() } }
you specify te signatures separately and then write one single function for all the signatures
this is not just for classes, you can do this anywhere
which one of you non rustacians was this
love is unnecessary yes
I need too
I have wasted 3 months trying to get love and I wish I just didn't want it now
valid request tbh
love like all other things is a basic human need and desire
its unnecessary and unexpected and unwanted but why do people desire it so badly ?
feeling wanted and having purpose is one of the main things people search for in life and being loved includes those
it hurts and it's emotional and stressful but it's also a really beautiful thing, and it's part of life so i believe you just let it bother you until you realize why it's so important :3
just realized this is programming lmao
sowwy
i switched to webstorm :)
google dot IT????!!
im sorry for you
hope you can recover soon
kind of crazy it shows a webstorm link as second resut
result
Hi everyone, I'm trying to develop my first Vencord plugin, and I have a question, where should I look if I want to update my userPresence Status ?
Oh yes, thx 
okay @lavish frigate maybe ts isnt that bad cuz making a discord bot is 100 times easier in this π
yop
now i gotta compile zed from source cuz im on windows :(
yeah this'll take a long time
oh okay thanks i didnt rlly search much for a build since the official guide told me to build it myself
rust moment
ig its ssupposed to be fast since its made in rust?
yo its like vscode just different
neovim better
eh i use intellij for java
i use webstorm for ts rn cuz ion feel like installing 2 million extensions into vscode to have an acceptable coding experience
lsp so good
sublime text so good
what do I do in this position
Alt+SysRq+B
wtf is sysrq
windows documentation where
didnt help
bedauerlich
rust takes a while to compile
yeah ic
but uhh is there any way to make it so if you press a button, it makes a message in another channel, and if u press a button on that message it will give the original button presser a role?
Hi back, i'm tring to update a userPresence, using this code : ```ts
// Use LOCAL_ACTIVITY_UPDATE to update to the userPresence
FluxDispatcher.dispatch({
type: "LOCAL_ACTIVITY_UPDATE",
activity: {
state: "zZZzZZ...", // String
type: 4, // ActivityType: 4 = CUSTOM
flags: 1 << 0, // ActivityFlags: 1 << 0 = INSTANCE
},
socketId: "AutoCustomStatus"
});
What should I pass in my `activity` object? I don't find any documentation on that, and I don't want something with a rich presence like the customRPC plugin.
helix :3
Find how it's passed in the actual code
I'm not sure if you're talking about text status or rpc but just search for the flux type in sources, add a breakpoint and look at the args
bc its a text editor and not an ide
that is a very wrong way to look at things
a code editor rather
pretry much the same
zeds own website pushes that
i am saying that "x is written in y so it must be fast" is flawed
I think it's pretty hard to say what is a text editor and what is an IDE
can't you just install plugins to basically make vscode an ide for example
the text/code editor just edits files
IDE does debugging and all useful things in one place
yeah vscode is a code editor but can be turned into an ide
its cursed
doesn't vscode support debugging and running
but don't most IDEs have all of their fancy functionality from plugins too lol
does but at its core it doesnβt have any lang specific features beyond running a file
intelliJ based IDEs rarely require any pluggers and are miles ahead from base vscode so
but from what I understand that is how IDEs work, you can just get specific packages which come with a ton of plugins
pluggers 
at least with Eclipse pretty sure Eclipse for Java Developers is basically just the Eclipse platform with Java Development plugins
eclipse rules
ides are just suped up code editors typically tailored to a language or ecosystem
they usually require little setup and include all the necessary tools out of the box
couldn't you just fork vscode and add plugins by default
then it would basically be an IDE
and doesn't vscode already come with plugins by default
iirc vscode is a typescript ide ootb
eh anything can be a ts ide
i don't really think plugins are what makes something an ide
but I thought IDEs were just a platform for plugins + a ton of plugins
anything can have plugins
vencord is an ide
apparently this is all thats actually required
vscode doesn't have a whole lot out of the box
they leave additional functionality up to the user
same as zed
@frosty obsidian i cant get the dumb thing to work on android
every single time its 5 trillion duplicate classes
i think a funny way to tell if something is a text editor or ide is if it has a command pallet
vscode has command palette
I actually implemented command palette in minecraft before in cursed mod
i don't think any of the jetbrains ides have a command pallet
pretty sure they do
zed has one
yeah it's double shift
im not seeing anything about a command palette
googling just reveals people that want one to be added
double shift isn't a command pallet
its search
oh nvm
missed it
πΏ
nvm then
no its not
a text editor lets you just edit text nothing fancy, maybe some rich text, such as ms word, goog docs, etc
a code editor is the same as a text editor but more tailored for code with like syntax highlighing and all, such as zed, vscode, and the 50 other vscode reskins
an ide is what shitbrains makes, software completely tailored for just one language or framework
even text editors have command pallets, eg. notion, is that an ide?
nuh uh
.
(i was scrolled up lol)
well maybe it is clear to you but if you ask many people I think there will be many different opinions...
I think the most ambigious thing would be that vscode sort of feels like a typescript IDE...
even if it's not super integrated...
I guess with virtually everything given enough people there will be different opinions
i might be talking nonsense as always

i think i would agree with your definitions but with vscode the line does feel blurry to me
it does but because jetbrains can't use normal keybinds it's Ctrl+Shift+A
no its double shift
that searches for everything, ctrl+shift+a only searches for actions
like ctrl+n is new window search for classes
you can just type / to do commands
a text editor lets you just edit text nothing fancy, maybe some rich text, such as ms word, goog docs, etc
That's a word processor
a code editor is the same as a text editor but more tailored for code with like syntax highlighing and all, such as zed, vscode, and the 50 other vscode reskins
That is closer to what people call a text editor
to me nano is a text editor
what is the difference bewteen these in typescript
function func1(a: Type1 | undefinied, b: number){
return;
}
function func2(a?: Type1, b: number) {
return;
}
well the second isn't valid
? means the argument is optional, aka you don't need to pass it
| undefined means the argument type also can be undefined, but you still have to pass it
doesnt the optional params have to best last
is trying to patch this stupid?
i don't even know how to replace something here though
also i don't even think that's the place i'd need to patch anymore
this code is so confusing
because it is
Is ed a text editor?
you're unnecessarily convoluting it
A text editor is a program designed for editing text files. Msword is not a text editor, since it's meant to edit rich documents, not plain text
suckless mention
get this man outtaa here
im gonna kill
in this day and age every toher text editor supports rich text
unless youre on notepad
GNU ed has nothing to do with suckless though?
i mean suckless users are indeed crazy about ed :^)
Uh, what
You do know the difference between rich text and syntax highlighting, right?
yes i do
i clearly stated syntax highlighing is a feature of code editors not text editors
I'd hazard to say there are very few text editors that are not code editors (notepad being one of the few), since few people who aren't programmers deal with plain text files
how are yall still arguing abt this π
Arguing is what this channel is for isn't it
i never said text editors are code editors tho π
yeah ig
does someone know how u can like get the original guy who pressed a discord button between interactions
a text editor lets me quickly put together words using characters from the following table:
while code editors let me inscribe runes into the magic rocks powering my computer
Are you stuck in the eighties with their 7-bit character sets?
21-bit character sets represent
Yes
mods crush this person's skull
Lobotomised! π¨
rip kyu
Point taken, I'll stick to primarily ascii
and thats why ASCII wins
How do i make a good discord client?
you dont
Hey, yesterday I tried to create a plugin that allows updating userPresence (only the text status). I asked here how I should "update" this status, and you suggested I check the customRPC plugin, which I did. But after some research, I realized that RPC and TextStatus are completely different. I can't continue using the CustomRPC plugin as an example...
Is there an existing way to update the status?
rule eleven?
@iron latch I TOLD YOU ASCII WAS 7 BITS
Damn ok, well i tried
GRRRR
what for
users can already change their status cant they?
This just says a very complicated way to ask how to do an animated status
Yep of course they can, I just want to make a status that can switch between a day/night status lol
check the function for pressing update status i guess?
Arff sorry you're right, it's sort of Animated Status '-' mb
yes what else is it 6 bits
huh what
protip: you could press this icon to prettify the code
ik
it's prettified by default
but undoing it made the regex easier
well not really the regex but the find
at one point you write regex without unprettfiying it lol
you just know what's different
It's just deleting the artificial whitespace pretty much
I always am
show code
if u can't fix errors showing to u what to do how are you gonna fix errors which don't actually throw errors
think about it
errors that dont throw erros are easier to understand imo
u haven't had an issue where you need to mentally visualize and understand why it happens then
not in ts
in c# yeah
i think i fixed it
nvm
what is this
im littarly doing what stackoverflow ask me to
2.5k lines of html element attribute data
assert still didnt work and with neither
but ill update it so its the same as on my pc
perhaps use a bundler that'll embed the json file in the build :^)
im new to this thing :(
esbuild so good
yeah but the problem is that the json file contains the discord token
.env:
you should import it on runtime
nah .env sint required
dont import config via an import statrement
oh
use fs read and json parse it
because realistically you'll end up with a bundler, and importing via an import statement; the bundler will just embed the file
what ide do u use for ts
nvim
nvim on top
oh
if you want another electron app to take another 40% of your computer resources you can use vscode
or if you have infinite ram you can use shitbrains
jetbrains is good :(
i mean maybe not the best for ts but for other languages it is
18 is old asf install 20 or better yet 22
i did
idk what that is i used some template for discordx
i said atleast
i really dont understand why they didnt add types to js but just create a new language
ts is by microsoft js is web standards
Javascript is a compilation target that browsers (and some other environments) run
introducing jsdoc
Typescript is a language for humans to write
js-compatible types can be written in fancy comments
start the file with // @ts-check
ecmascript foundation was a mistake
node js is the downfall of programming ngl
then add /** @type {whatever} */ where appropriate
or just use typescript directly
programming has fallen... millions must learn rust
Who the fuck would rather write /** @type {...} */ than : {whatever}
rust isnt bad but i think its like hella overhyped
!remindme 4h a
Alright @elder scaffold, in 4 hours: a
people who can't have a compilation phase
how ppl feel when their terminal is build in rust (it is 0.001 ms faster)
It's just a phase
it has become increasingly popular in libraries cause it's simpler to publish
idk who said i should use tsx but it works thx
Make a compiler from ts to js-with-comments 
i can't use tsx, so I use js for my react code
not tsx as in typescript jsx but tsx as in the script runner
oh
^
i also can't use tsx because it doesn't work
thx
what if we added the typescript syntax to js but just ignored all type checking
millions have learnt rust, programming has risen
That's what python did and I hate it
didnt they want to do that on js
like add type hinting sytnax for ides or somethin idk
I agree
People should switch to java already
@dawn ledge do not
JVM better than node
It has use cases
jvm is worse than node
I agree
Not agree
chat
today is the day
Photoshop
are discord bots good in java
no
in what should i make it then
no
uhhh
nerd
thanks
whats that
im rewriting erlpack in zig because i hate cpp native node
Scratch
interesting
Javacord is just ok, pycord is really convenient tho
JDA is more actively maintained IIRC but I remember the API being a little weird
the message api feels like "do you want to get the content, the raw content, the cooked content, the formatted content or the unformatted content"
the what
tf is the difference
OMG
BASED!
CompletableFutures are just so nice when working with discord bots lol
rust
Isn't that just async/await without the syntax sugar and performance
tldr: they were storing billions of things in LRU cache and go garbage collector was a bottleneck
so they switch to rust
crust
Go is purple, Rust is blue.
u can see the spikes in go cause gartbage collector running every 2 minutes
WHAT!
nice that the rust garbage collector cant bottleneck..
funnicons
funnicons
colorblind be like: that's the same color
so hard for me to differ them in that image
ur colourblind?
is this better
or this
that's good
better have them opposite on the color spectrum
yeah dsicord doesnt give a fuck about a11y
i just hueshifted by 130 degrees (?)
"rust garbage collector"??
cant bottleneck
that is the joke
there isnt a gc in rust
in rust we trust
oh right
okay bro
maybe they just wanted to make a rust gc
the motivation is apparently "In Servo we use bindings to the Spidermonkey Javascript engine. Since Javascript is a garbage collected language, the Rust representations of Javascript objects are also garbage collected."
i cant even use their package because it doesnt work on electron so i had to write my own implementation, im now rewriting that
@elder scaffold, <t:1726660247:R>: a
hello ts nerds
so i have this
interface Foo {
...
}
function bar<Q>(query: Q, arguments: Foo<Q>) { ... }
how do i make foo extendable
similar to how you can add custom intrinsic jsx elements
nvm figured it out
Isn't custom intrinsic a contradiction?
banger
no clue
couldnt care enough
i am making a very thin wrapper over document.createElement
no vdom crap
okay people
typescript is fucking with me
here's my MRE
function thing<
A,
F extends (arg: A) => string,
S extends string,
I extends F | S
>(init: I, ...args: I extends F ? [A] : (string | number)[]) {
if (typeof init === "function") {
// do some things
return;
}
thing2(args);
return;
}
function thing2(args: (string | number)[]) {
// do some other things
}
hi
why does it not narrow args as (string | number)[] when calling thing2
it REFUSES to narrow down
i've written much more unreadable typescript type horrors
this is the simplest of all
what's wrong here?
its not narrowing the type
i should make a language called John
it can't infer that
because init (which is I) is not a function at thing2 and since args is I extends F ? [A] : (string | number)[] i well... atleast expect it to narrow
cant you just cast it to the type you need
honestly those generics are hell and you should rewrite it probably xD
jusggest better code
please
type FunctionType<A> = (arg: A) => string;
type InputType<I> = I extends FunctionType<any> ? [A] : (string | number)[];
function thing<A, F extends FunctionType<A>, S extends string, I extends F | S>(
init: I,
...args: InputType<I>
): void {
if (typeof init === "function") {
// do some things
return;
}
thing2(args as (string | number)[]); // Type assertion for clarity
return;
}
function thing2(args: (string | number)[]): void {
// do some other things
}
Explanation of Improvements:
-
Type Aliases:
- We introduce type aliases
FunctionTypeandInputTypeto make the code more readable and easier to understand. FunctionTyperepresents the type of functions that take an argument of typeAand return a string.InputTypeuses conditional types to determine the expected type ofargsbased on the type ofinit.
- We introduce type aliases
-
Clearer Conditional Logic:
- The conditional logic inside the
thingfunction is now more concise and understandable. It checks ifinitis a function usingtypeof init === "function"directly, avoiding unnecessary type checks.
- The conditional logic inside the
-
Type Assertion:
- We add a type assertion
as (string | number)[]in the call tothing2to explicitly tell the compiler that theargsare of the expected type. This improves clarity and can help prevent potential type errors.
- We add a type assertion
Benefits:
- Improved readability: The code is more easily understood with the use of type aliases and concise logic.
- Enhanced maintainability: The
export function html<
Q extends ElementNames | QueryWithData | string,
P extends Record<string, any>,
H extends HTMLComponent<P>,
I extends H | Q
>(
init: I,
...args: I extends H
? [P]
: [Q, ...(AttributesForQuery<Q> | HTMLArgument)[]]
): Element {
if (typeof init === "function") {
// TODO
return init(args[0]);
}
const element = create(init);
applyArgs(element, args);
return element;
}
this is my real code
ElementNames | QueryWithData are just strings
and HTMLComponent is just (props: P) => Element
(raw dom elements)
so was i right
.
they are good but
it can't infer it backwards like that
you need a cast in some way
@royal nymph would you rather only write java for the rest of your life or C++
imagine
well im just gonna cast
if (typeof init === "function")
return;
init = () => "lol";
to make what you want possible, it'd have to make the typeof check erase the Function type
but what if you want filter: string | Function
and then
if (typeof filter === "string")
filter = s => s.includes(filter)
for that to work it can't erase Function from the type
just cast is what you want :p
@royal nymph can you help me with something
its with zsh
in my zshrc at the start i have ZPLUGINDIR=${ZPLUGINDIR:-${ZDOTDIR:-$HOME/.config/zsh}/plugins}
terminal opens fine and properly sets it
when i open terminal in vscode somehow its getting set to ~

try adding
echo "$ZPLUGINDIR"
echo "$ZDOTDIR"
maybe one of them has insane value somehow
ZDOTDIR is equal to home dir in vscode terminal and in external terminal its unset
evil
love
figure out why it happens
or remove ZDOTDIR
zeet dir
yop
actual horror
every time i look at this channel after a while there is a new insane problem from some mentally insane developer
react with its game changing features, now i dont have to type the extra -2 lines
(technically extra -5 but whatever)
that seems like a built-in thing other than useEffect
also you can pass signals to other functions
Text editors do not edit rich text.
Markdown:
fym dawg, so youre telling my an editor with syntax highlighting and stuff is "closer to what people call a text editor" by your standards but it cant fucking edit rich text?
okay, would the distinction of if the application saves the text buffer directly or if it saves it in a special format be enough to classify an editor as a "text editor" or a "word processor"
does anyone else have issues with linux firefox & pipewire/pipewire-jack
changing the output sink just breaks the audio completely until i restart ff
nvm i had to install pipewire-pulse and enable the user service
seems to fix somehow
Iirc I had to disable pipewire-pulse and stick to pipewire-alsa, because for some reason -pulse would switch the volume unit from decibel to useless percent
@royal nymph did it without type casts :^)
this is so horrid
i think i'll just cast
I thought about this but apparently Firefox v53+ no longer supports alsa
That hasn't been any issue to me
NO FISH????
// Utility function to simulate a delay (basically sleep)
const sleepDelay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
// Main sleep function with combined features that i need to use
const sleep = async (
isSleeping = false, // Default value for isSleeping
messages = { // Default custom messages that i will use
awake: "You're still awake, lazy af person",
asleep: "Goodnight"
},
delay = 0 // delay before "Goodnight" message that i dont need
) => {
// Input validation for the isSleeping parameter (super nerdy)
if (typeof isSleeping !== "boolean") {
throw new Error("isSleeping must be a boolean value");
}
// If there's a delay and isSleeping is true, wait for the delay
if (isSleeping && delay > 0) {
console.log("Going to sleep...You fogot how to parry, dodge.. Oh wait, wrong game.");
await sleepDelay(delay); // Wait for the specified delay (in milisecounds)
}
// Return the appropriate message based on the isSleeping state
return isSleeping ? messages.asleep : messages.awake;
};
// Usage examples
(async () => {
try {
console.log(await sleep(true)); // Outputs: Goodnight
console.log(await sleep(false)); // Outputs: You're still awake, you lazy af person.
// Custom messages and delay.. ( who needs it, use it.)
console.log(await sleep(true, { awake: "Still up, what now", asleep: "Sweet dreams,Drake is still behind your walls" }, 2000));
// Waits for 2 seconds, then prints: Sweet dreams, Drake is still behind your walls
// Testing with invalid input
console.log(await sleep("yes")); // Throws an error, duh.
} catch (error) {
console.error(error.message); // Handle input validation error of error even occures
}
})();
// And yes, this is literally a code about sleeping in javascript language.
did you know you could use codeblocks to recognise the lang
fu- aight ill fix after
have i ever spoken
about how much i FUCKING HATE THE ASYNC KEYWORD
LIKE
?????
DONE BY WHAT
BY WHO
WHEN
Why do you not like async
what
Async is great
async in js makes a lot of sense βΉοΈ
where does the work get done??
im not smart enough to understand it so im safe!
java script can do whatever
sleeping function
eventloop
yes but that's just one potential implementation
you need the 2nd line thats it
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
console.log("test");
await sleep(1000);
console.log("this runs after a second")
no thanks
It was not a question
ill go with the other one
shuddup i love my red/blue functions
||Monads||
Nu huh, I'n done being nerdy, im going to the fucking shadow realm
f
why
it makes sense
you also do it irl
when you're coooking something and it has to boil for 20 minutes do you just stand next to it and wait or do you suspend the cooking and go do something else, then come back once it's time

You are supposed to wait and watch smh
Or do you endanger yourself and burn your house down smh
Okay, but you just explained the exact parts that the language hides from you.
The actions are independent. Time is passing and the cooking happens as 'time passes'
While in programming, that 'async' work needs to be done by something
It's closer to cooking food, and yelling at your brother in the living room who's watching TV to take out the trash
Yes, the async stuff is being done by something (usually the os, or the browser in case of js), but the point is, you can do other things in the meantime
My issue is that it is implicit
Most other languages require explicitly tokio::spawn()ing it or similar, yeah
If that's what you mean
it's explicit
ok, where do the async tasks get done?
you mark the function as async capable and explicitly suspend by using the await keyword
by the OS
do you want to write assembly code to interact with the OS
No
Where does the reading "happen" if you call .read() synchronously?
No, I want to know that there's a thread somewhere which will do these tasks. A thread that I own.
but that's not how async js works
Js doesn't have threads
so then it's time sharing?
async is not multi threading
It's handled by the same event loop that dispatches click events and setInterval
async is allowing you to do something else while you wait for completion of an external source
aka ^
Is onClick unacceptable levels of magic?
if you block the process, e.g. via infinite loop, your async things will never unsuspend because the event loop is stuck
In which case browser might pop up a message about "script is making the page slow, wanna kill it?"
then why the fuck is it called async
Because async programming is the ability to do things faux-simultaneously
if what im reading is correct, it's just "Take this task, schedule it to be done some time later"
Makes sense for web requests
Or rather, the ability to do other things while waiting
How stupid is it to write a small program that reads some variables from files and parses them, mounts drives, copies something from one filesystem to another while doing a checksum of it, then does some stuff with that file which is really a disk image and mounts it using a loop device, and then mounts an overlayfs of that being the lower and some tmpfs being the upper
in Java or Node?
tl;dr: I want to write an initramfs script in a stupidly overcomplicated for the task language

There is one half of me wanting to do this ironically and the other half wants to do it unironically
my soul does know I should use another language though
@nimble bone LET ME MAKE NODEOS OR JAVAOS LIVE INSTALLATION DISK INITRAMFS
make in node then
YES
how much more worse can you get than a bash script
@nimble bone i will make 400mb UKI
could I make something that wastes storage more than the average node_modules folder just for a fucking system to copy a filesystem to ram and boot into it?
ofc i can
you will live in a hopper chain in a sorting machine
I don't like fish
@formal belfry
huh
btw why is vencord itself not in the vencord org, but on vendicated's profile?
some github pro shenanigans or?
one reason is to give Ven visibility
If it was in the org it wouldn't be so directly tied to them
and also some org limitations I think
any specifics?
i'm looking to move my project to an org
and idk if its a mistake or not
i dont think so
if you want a nice project on your profile directly then dont
the one downside is that it is no longer attached with ur name
repo on your user account = wow you made this
org repo pinned to your account = is this guy piggy backing off some org project he made 1 commit to?
yeah for me that's a good thing
my project is less than legal
so the less ties to me the better
name the org after your username 
consider not uploading it at all
do u mean miru
XDDDD
when is miru getting avistaz support
yeah
too late for damage control
piracy, torrenting
it shouldnt be
yeah its not illegal perse imo
yeah but thats not ur fault xd
its just a proxy
well obviously the use case is illegal stuff but
makes doing illegal stuff easier :^)
the program itself does nothing illegal
but in practice it incenticises piracy
just like how you can use torrent clients for only legal purposes
which is illegal in many countries and I could get extradited to said countries
yeah i definitely use my torrent clients to download old book archives, i swear
well you could do some things to "protect" yourself
eg add disclaimers and don't use examples that showcase pirated content
time to make miru webpage a blank page
qbit is generalized, so it gets away with it, mine is specifically targeted at anime media
with avistaz support π
it already supports full custom css
DSFKDSJFDFDS
and custom js extensions
nothing is stopping me from hijacking your webpack
does is support shiggy
rest u can just pr to the project
via CSS content sure
most normal client mod core developer
I meaaan
miru v6 is a vite webpack hybrid
so have fun lmfao
it's funny cuz i've never even touched a webpack config
i mean
just fork it
like migu
I have no idea what settings produce the code I see
so true
unfortunately this project won't work next month
real
because the author made it with ill intent
so I decided to also act with ill intent
hehe

yeah the guy is delusional
they killed aniwave miru is all i have
I made my own code for it
and he's like, omg u steal code
lol no, that pr was broken as shit
didn't work at all
broken
ujst like my code
miru v6 is gonna go hard
trust
I wrote so many libs for it while on vacation
rewrite miru in RUST
i'll skip school to work on rust miru
webview or non webview
wasm 
non webview, normal webview is way too limited for what miru needs
i meant pure rust
I usually spit facts
:(
there are no good torrent libs for rust
can always write one :^)
webtorrent is like 70% of mirus functionality
true
there's no lib that comes close to how easy webtorrent is to build upon
?remind me in 6 months rust web torrent lib
Alright @dawn ledge, in 6 months: rust web torrent lib
libtorrent is there, but it's insanely hard to work with and doesn't support webrtc
and miru os gonna be a website on a few years
so webrtc is needed
I'm working on making a live showroom for airing episodes with global twitch like chat
wait webtorrent works on the browser?
it's like 80% done
yes, but webrtc only
neat
tcp and utp doesn't work
nope
why bother maintaining a rust and web client when you can only do one
anyways good night
