#πŸͺ…-progaming

1 messages Β· Page 135 of 1

winged mantle
#

I'm assuming it will start working if i just use spawn

#

since I did call runtime.enter on the main thread (as a random forum post suggested)

glass skiff
#

ok yea i just tried it, it does move to another thread, and runtime.enter() actually just tricks the current thread into thinking a runtime is active, it does NOT provide background workers or the I/O reactor you need

winged mantle
#

wait what

#

it had another error but just using the tokio::main macro seemed to make it go away

#

but the await never finishes

#

so I guess the same issue?

#

weird, I feel like this suggests it's fine

it is fine to poll Tokio futures from a different executor such as the one that evidently is built into gpui. The requirement is that the runtime has been entered before calling Tokio functions that create futures. Once the futures exist, they remember their runtime

glass skiff
#

GUH i can't send anything i keep getting timed out

#

ok i'll send it over multiple messaged

#

if you use cx.spawn i don't think you'll need runtime.enter at all

winged mantle
#

idk it just panics on the main thread without #[tokio::main] or runtime.enter

glass skiff
#

THERE

#

finally

#

whever i try to send it i get timed out

#

also #[tokio::main] blocks the main thread to run it's own loop

#

thus your await never finishes

winged mantle
#

hmm

#

I feel like I don't understand this stuff well enough but I feel like the only way to understand this stuff is by using it regardless

#

how else do you learn other than doing stuff, initially very badly

winged mantle
# glass skiff

what if I want to use reqwest instead of gpui_http_client

glass skiff
# winged mantle how else do you learn other than doing stuff, initially very badly

well you kinda just keep fighting with the compiler until you "understand" how it thinks (helps if you adopt the mindset of never letting anything "just work" but dive into it and try to understand why it "just works"), but after that it then gets REALLY fun and makes you feel so freaking awesome, way more that other programming languages do.

winged mantle
#

I find it funny when people say you need to learn java to make a minecraft mod because I learnt java by making minecraft mods

glass skiff
#

REAL

#

just do stuff until you get better

#

timeouts..

winged mantle
#

why is automod blocking this 😭

glass skiff
#

i really don't know..

#

it's so goofy

#

tokio

#

so it's not tokio

winged mantle
# glass skiff

i wonder what http impl is used by default, I couldn't find any actual implementations of HttpClient lol

#

it just uses NullHttpClient by default

#

that's such a billion dollar mistake...

glass skiff
#

i mean.. i think they did that to so they can avoid forcing specific networking librarys like curl onto every project that uses them.. then again it does make it way harder for someone trying to make a simple api call

#

leaves you to choose whatever you wanna use

#

which in most cases means putting in work into actually implementing that thing you want to use

winged mantle
#

in which case... what value does this abstraction provide

#

anyway wasn't expecting it but thanks for the help

glass skiff
winged mantle
#

I don't usually ask for help however [xkcd 386]

#

people do tend to help when they see me doing something dumb

glass skiff
winged mantle
#

I wonder how one normally creates a gpui app with networking

#

I think I should look at real apps

winged mantle
#

oh I deleted that

#

and asked two questions in the modern era

#

idk I guess I have good reason to be scared of stackoverflow

glass skiff
winged mantle
#

well I couldn't find the actual http impl zed uses 😭

#

I just found the nullhttpclient, fakehttpclient, etc.

glass skiff
#

i should probably stop doing that..

winged mantle
#

I am also scared of posting on reddit

#

I delete if downvoted because I am scared of being roasted

glass skiff
#

sameee

winged mantle
#

I did keep that one that's cool

glass skiff
#

was literally debating answering your question cuz i feared i'd spread misinformation

winged mantle
#

I should have suggested vencord experiment plugin

glass skiff
#

but am not actually too sure.. their code is confusing

winged mantle
#

the one impl I did find of http used javascript fetch

neon bear
#

Imagine
Whole app
Javascript fetch

#

Beloved Javascript

#

What a world that would be

winged mantle
#

it's funny i found myself reading the agents.md of zed as it documents some things

#

I don't think I want to heavily depend on gpui's httpclient as that ties things to the library too much

glass skiff
#

just found out that zed's networking actually uses a wasm target for the agents using ModelContext::spawn so that the task it creates is dropped if the model is also dropped.

winged mantle
#

could this be the impl they use

#

there's a field which stores a tokio handle

#

very interesting

#

I guess you just copy and paste this crate into your project? that's what I saw one project do

#

😭

#

still wouldn't it be cool if non-UI crates in my project didn't have to depend on gpui at all??

glass skiff
#

hm, i guess you could do it like that, i assume they did it like that so the library can have a place to run it's own I/O operations without taking trying to take over the main thread what GPUI is already using

#

yea, they seem to be wrapping the reqwest future in a gpui::Task

#

kills the reqwest automatically when the task is no longer needer

solemn ravine
winged mantle
#

zed is quite a big clone

solemn ravine
#

it is..

winged mantle
#

this project clones zed anyway for some reason

#

the copy and pasting probably wasn't necessary for them

solemn ravine
#

@installate fix

modest wren
#

buh

winged mantle
#

I wonder where to find a good explanation of how tokio actually works

modest wren
winged mantle
#

ah.. cmake.. .take me back to C++ and CMake

#

(actually I specifically avoided C++ here because I didn't want to use asio 😭)

modest wren
#

should've really aded a commit reference to it

solemn ravine
#

wow its beautiful

modest wren
#

how does the plist look?

#

on the binary that was built?

solemn ravine
#

yeah hold on im rebuilding

modest wren
#

forgor to say

#

when building the project on macos you need to add -DCONFIGURE_BUNDLE=ON

solemn ravine
modest wren
#

does that solve it??

solemn ravine
#

also set the minimum deployment target for macos to like 10.13 or something, using set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")

modest wren
#

does that use my own provided plist when doing that?

solemn ravine
#

no it just makes the app actually ocmpile

#

let me see about the plist

modest wren
#

I need the special plist for the reason that I have custom URL registration

solemn ravine
#

seems fine

modest wren
#

does it have this?

solemn ravine
#

yeah

modest wren
#

gimme a sec

#

can you install the app on your system temporarily so your computer recognises the URL?

#

also does the binary have the icon?

solemn ravine
#

okay

#

xcode using my certificate by default is evil

modest wren
#

sam distributed sharity blobcatcozy

solemn ravine
modest wren
#

buh this internet is so slow

modest wren
#

literally

solemn ravine
#

xd

#

never is..

#

eh well you can always copy it over manually

modest wren
#

does this url work sharity://sharity.is-dominating.me/?path=%2Fws&key=5C3P9rDCodyVLelY3lY4%2FpY54Byau6z2YOaRdO8uF2w?

solemn ravine
#

malware

#

will this install various

#

virus

modest wren
#

nop

#

sharity is a p2p file sharing platform

#

so it will just connect you to me

solemn ravine
#

M WALRE

#

@modest wren the url does nothing but it does open the app

#

this is such a cursed app

modest wren
#

it works well on windows, linux and android

#

it'll indeed be cursed on MacOS as I can't test it there

solemn ravine
#

xD

modest wren
#

and idk MacOS stuff, like all the plist stuff required and so

#

I thought the way macos would open the url would be like

solemn ravine
#

plist stuff is really simple

modest wren
#

run the binary and pass the URL as the argument

solemn ravine
#

plist is just info about an app really

#

then it will register stuff if needed based on that

#

well and other things bundled within the app and so on

solemn ravine
modest wren
#

the way I do URL stuff

#

is I just pass it as an argument when the binary is ran

#

like ./sharity-client url

#

but that's not how it is done on MacOS

solemn ravine
#

I mean

#

that works I guess

#

people bundle entire clis and guis in the same binary sometimes

modest wren
#

doesn't work

#

cause the open URL uses custom stuff

solemn ravine
#

heh

modest wren
#

that is MacOS API stuff

#

and I can't develop Objective-C++ code and try it out

#

well, if you can get the icon to automatically bundle on build that would be great

#

send me your version ot the CMakeLists as well afterwards (if you can or cannot get the icon to work)

solemn ravine
#

icon doesnt bundle

#

idk how to fix that anyway

#

not cmake enthusiest

modest wren
solemn ravine
#

that did not do anything

modest wren
#

Buh

#

Well that's fine for now

#

Thank you so much!!

#

Is there any command for creating dmg files?

pearl stagBOT
# solemn ravine https://github.com/claration/Impactor/blob/main/.github/workflows/build.yml#L202...

build.yml: Lines 202-226

- name: Codesign
  run: |
    mkdir -p dist/dmg
    mv dist/${{ env.BUNDLE_NAME }}.app dist/dmg/
    codesign --deep --force --options runtime \
      --sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" dist/dmg/${{ env.BUNDLE_NAME }}.app

- name: Create DMG
  run: |
    mkdir -p dist/out
    create-dmg \
      --volname ${{ env.BUNDLE_NAME }} \
      --background "package/macos/background.png" \
      --window-pos 200 120 \
      --window-size 510 350 \
      --icon-size 100 \
      --icon ${{ env.BUNDLE_NAME }}.app 160 155 \
      --hide-extension "${{ env.BUNDLE_NAME }}.app" \
      --app-drop-link 350 155 \
      dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg dist/dmg

- name: Notarize DMG
  run: |
    xcrun notarytool submit dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg --apple-id "${{ secrets.APPLE_ID_EMAIL }}" --password "${{ secrets.APPLE_ID_PASSWORD }}" --team-id "${{ secrets.APPLE_ID_TEAM }}" --wait
    xcrun stapler staple dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg
modest wren
#

ty

solemn ravine
#

create-dmg is on brew, so in the runner you can just do that

modest wren
#

ic

solemn ravine
#

it just makes it really simple to create fancy dmgs

modest wren
#

dmg is what is used for shipping and distributing apps right?

solemn ravine
modest wren
#

okay nice

solemn ravine
modest wren
#

ah

solemn ravine
#

its strange because its not an installer

#

and you can run apps while its still inside the mounted disc

#

itll just give u a big fat warning if u do

modest wren
#

well just want something to make it more convenient for the user blobcatcozy

solemn ravine
#

this is the way then

modest wren
solemn ravine
#

put ur self on bypass

modest wren
#

nah

#

just gonna PR

solemn ravine
#

I will never make myself pr for each commit on my own repos

#

despair

modest wren
#

I usually do more bigger PRs

#

so usually I never single commit onto main

#

time to wait

solemn ravine
#

where mac

#

u will add

modest wren
#

I will add

#

when Mac is fully supported

solemn ravine
#

now I have to remove the deps u made me install to usr/local

modest wren
#

thanks for helping blobcatcozy

solemn ravine
#

the bloat

modest wren
#

did it install a lot?

solemn ravine
#

naaahh

#

I just prefer it nice and tidy

modest wren
#

fair enough

#

cause PKGBUILD is p easy to use

solemn ravine
#

it does run though

modest wren
#

I usually just create PKGBUILD

modest wren
#

time to wait for GH actions to build OpenSSL

#

I pray the android build still works

#

I cannot be arsed patching the QR scanning project again

solemn ravine
modest wren
#

nop it doesn't work

solemn ravine
modest wren
#

on gh actions?

solemn ravine
#

locally

#

Last time I had a depend on OpenSSL on gh actions it was horrible and it was in a rust project

#

I had to quickly find an alternative so I never had to use it

#

my app has like 10 crypto libraries in it it’s so awful

modest wren
#

pain

#

I get that

solemn ravine
#

I sentence you to compiling aws crypto, ring, and openssl

modest wren
#

KMS

#

they broke the windows installer again

#

wdym 😭

#

oh wait

modest wren
#

@solemn ravine yay

shrewd canopy
modest wren
#

what's schannel?

shrewd canopy
#

TLS library by ms

modest wren
#

is it OpenSSL compat?

modest wren
#

then I can't use it lol

#

I'm using a library that needs OpenSSL

signal wadi
#

did something

fierce pendant
#

typescript <3 <3 <3 <3

shrewd canopy
winged mantle
#

it feels hard to to use async rust without Arc or unsafe blobcatcozy

#

Arc feels like a slipppery slope...

fierce pendant
valid jetty
#

elle

fierce pendant
fierce pendant
valid jetty
#

skip all whitespace until non-whitespace, read a char, determine what kind of token it will be depending on what the char is, then consume the appropriate token, and repeat

#

for example if it starts with a digit parse a number, if it starts with a letter parse it as an identifier (and then turn it into a keyword if necessary), etc.

#

unfortunately the tokenizer is the easiest part

fierce pendant
fierce pendant
valid jetty
#

no you should just keep trying

fierce pendant
deep mulch
#

@valid jetty hiii

torpid solar
#

Go Go Go Go Go Go <3 <3 <3 <3

gilded surge
gilded surge
signal wadi
#

managed to make my own discord desktop client that uses 300-400MB ram by

#

"removing" "unnessessary" stuff

placid igloo
#

/run ```ts
setImmediate('console.log("hello")'

rugged berryBOT
#

Here is your ts(5.0.3) output @placid igloo

file0.code.ts(1,36): error TS1005: ')' expected.
placid igloo
#

guh

#

/run ```ts
setImmediate('console.log("hello")')

rugged berryBOT
#

Here is your ts(5.0.3) output @placid igloo

file0.code.ts(1,1): error TS2304: Cannot find name 'setImmediate'.
placid igloo
#

/run ```ts
setTimeout('console.log("hello")', 1)

rugged berryBOT
#

@placid igloo I only received ts(5.0.3) error output

node:internal/validators:421
    throw new ERR_INVALID_ARG_TYPE(name, 'Function', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "callback" argument must be of type function. Received type string ('console.log("hello")')
    at setTimeout (node:timers:141:3)
    at Object.<anonymous> (/box/submission/file0.code.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.15.0
placid igloo
solid gazelle
#

@placid igloo

placid igloo
royal nymph
#

ve ```js
setTimeout(console.log, 1, "hi", "nexxxxxx")
sleep(100)

elder yarrowBOT
solid gazelle
#

what does that mean

#

I see

placid igloo
#

ve g

fierce pendant
#

npm name squatting is so hard nowadays πŸ˜”

supple whale
#

pov: you resized a react project

supple whale
#

we love react devs

#

2 scroll bars on a single element

pseudo sierra
#

react devs banned from life

ornate quiver
solemn ravine
#

FINALLLY

ornate quiver
#

yop

#

can't use it in libraries though because of msrv

deep mulch
#

wait

#

you couldnt already do that?

#

so horror

ornate quiver
#

the other way was

[dependencies.serde]
version = "1.0"
features= ["derive"]
pseudo sierra
fierce pendant
#

ty

supple whale
#

LMAOOOOO

#

my AI just fucking DIED

#

I MEAN LMAO it keeps going

fierce pendant
solid gazelle
#

how could I add debouncing to this? ```js
export const ImageFetchStore = proxyLazy(() => {
class ImageFetchStore extends Flux.Store {
public resultsForQueries: any[] = [];
getImages(query: string) {
Native.getImages(query).then(result => {
if (this.resultsForQueries.length > 3) {
this.resultsForQueries.shift();
this.resultsForQueries.push({ query, result });
this.emitChange();
}
});
}
getResultForQuery(query: string) {
return this.resultsForQueries.find(e => e.query === query)?.result;
}
}
let self = new ImageFetchStore(FluxDispatcher, {});
return self;
});

#

so that getImages doesnt spam the native function

#

okay i figured it out πŸ˜…

solemn ravine
#

did u

supple whale
#

btw @jade stone

#

you can legit fully do virtual lists with letting the browser handle the visibility of elements

#

with this you can even disable listeners for shit, or unmount components

desert galleon
#

Do someone got a plugin for seeing the last time someone log in?

woeful zinc
desert galleon
#

πŸ‘

supple whale
#

@royal nymph obligatory ping

#

this api fucks, jesus christ, its so good

#

its like a better intersectionobserver

elder yarrowBOT
patent vortex
#

(there is none)

steep haven
#

also this idea for a plugin seems a bit... creepy? imo?

supple whale
#

or less creepy that seeing people in channels that arent meant to be visible?

#

or less creepy than seeing the last activity of a private/invisible channel?

#

be more specific ^^

steep haven
supple whale
#

see above.

steep haven
#

saw above

#

.

supple whale
#

then you're hopefully competent enough to answer ur own question based on that

steep haven
#

i already said it is creepy

#

so what is your exact problem to my message at this point

supple whale
#

so are all the other stalking features in vencord

#

its no different than what it already offers

#

and most other chat clients also have this kind of feature

#

ex: steam, matrix

steep haven
#

ok i'll maybe rephrase it. it is creepy IF used in a creepy way like stalking (which is my main reason of pointing out at the question from above)

umbral mirage
#

omg it's the hayase person

steep haven
#

it's fine if used in a normal way. but considering how people are, especially on discord, a lot of them don't do that

fierce pendant
winged mantle
#

the lack of distinction between types and variable names in go naming conventions feels really bad

#

this would look like a function pointer call to a c developer

#

it's actually a cast 😭

#

also I had some code which did PluginData[foo]() and that looks like a call of a function inside an array/map when it's actually using generics

shrewd canopy
#

and reinterpret_cast

winged mantle
#

oh i guess C++ also often has snake_case class names which look like variable names 😭

#

but at least it would be (type*) instead of (*type)

#

and it uses angled brackets for templates plugin_data<foo>()

#

IMO you should start your types with capital letters and functions and variables with lower case letters

#

I guess it's neat to be able to tell internal functions from the name too but types vs other stuff feels like a more important distinction

#

just copy JS and use # to prefix internal functions

deep mulch
#

the kode tode

shrewd canopy
#

@versed cape #🧩-plugin-development message its all done in RPCServer singleton (specifically in handleRequest), for all commands just search by \w\.T)\(\w+\.e$_\.\w+,{ (regex)
for events search by \.ZE4\.\w+\]:{, but that shows functions that check if you can subscribe to event and return another function with state, for actual event dispatches search for \.dispatchToSubscriptions\(\w+\.ZE4\.\w+
the RPCServer#dispatchToSubscription method has three arguments (dispatchToSubscriptions<T extends keyof RPCEvents>(event: T, args: RPCEventArgs<T>, data: RPCEventData<T>): void which will dispatch it to all clients that subscribed to event with same args, this assumes that RPCEventArgs<T> gives argument's structure by event name, same for RPCEventData)
can't type in #🧩-plugin-development so have to ping here

undone sonnetBOT
versed cape
undone sonnetBOT
slim rose
#

how do i make it small

#

like bruh

dense sand
tired vigil
shrewd canopy
slim rose
dawn ledge
fierce pendant
median root
#

What do we think the best regex standard is (and why) just outta interest?

fallen nebula
#

am i crazy ?

#

i just wanted an assert

jade stone
jade stone
#

you are not sane

fallen nebula
fallen nebula
jade stone
#

it's just how i'd write it

fallen nebula
#

mmmmm

deep mulch
#

@valid jetty hiii

fleet cedar
#

More than thirty seven I think

solemn ravine
#

@woven mesa rate

woven mesa
valid jetty
fierce pendant
solemn ravine
#

@woven mesa

solemn ravine
#

aren’t u refesigning the website

#

@young flicker make it fancy yk

#

I lowkey cooked with the design on ts

#

pixelmator

#

Uploading video rn

#

proud of how it turned out

#

the text has a gradient and a transparent border

deep mulch
#

now make it voxel simulation or something with marching cubes and make planets get ripped apart by the black hole @valid jetty

#

make it so galaxies and planets are procedurally generated with dynamic weather systems and atmosphere and add a first person mode that lets you land on planets that also has reentry drag and escape velocity you have to worry about
also add a base building system and health system

#

add a way to build custom ships as well

royal nymph
#

@deep mulch

deep mulch
#

@young flicker you cant send that

#

punishment is due

woven mesa
gusty sentinel
#

does anyone have any ideas why opening devtools in discord is so inconsistent with Ctrl+Shift+I, and yea i have the fully goofy ahh flag in my config file

tired vigil
#

wdym

gusty sentinel
#

Like, I managed to get it open once but it doesn't want to open anymore, im scratching my head trying to figure out why it doesn't open consistently for me

#

only way I've been able to open it consistently is on macOS because there is a menubar

tired vigil
#

weird, that shortcut always works for me

#

do you use like a custom keybinds plugin or something

#

that could be intercepting shortcuts and stuff

gusty sentinel
#

I don't believe so, that was my first thought, but nothing that would explictly do that, I've also tried removing the modifications from discord altogether and still didn't work

gusty sentinel
#

seems to work when i spam all the ctrl + shift keys and the i key, and even then takes like 5 presses before it does anything, i have never understood this issue

solid gazelle
#

or is it only discord

fallen nebula
slim rose
#

same

fierce pendant
#

show it some elysiajs code and it will act normally

fallen nebula
fierce pendant
placid igloo
#

,remind

#

ga

#

?remind 15h check if tidal's x-tidal-token is static ("vNVdglQOjFJJGG2U")

delicate groveBOT
#

Alright @placid igloo, in 15 hours: check if tidal's x-tidal-token is static ("vNVdglQOjFJJGG2U")

pearl stagBOT
royal nymph
#

7 years ago

#

2019 was 7 years ago posttroll

shrewd canopy
#

publish on ports when 😁

pseudo sierra
#

vee von vitler is just a hater

#

top 3 ranked husker

elder yarrowBOT
#
Top <:husk:1026532993923293184> Reactors

13855 ​ ​ ​@deep mulch
10626 ​ ​ ​@solid gazelle
10604 ​ ​ ​@nimble bone
9571 ​ ​ ​@young flicker
8331 ​ ​ ​@vital plume
7860 ​ ​ ​@cinder egret
5927 ​ ​ ​@royal nymph
4665 ​ ​ ​@granite geyser
4359 ​ ​ ​@ornate quiver
3661 ​ ​ ​@jade stone
3033 ​ ​ ​@dark peak
2929 ​ ​ ​@balmy lintel
2906 ​ ​ ​@thorny ingot
2117 ​ ​ ​@cerulean plover
2078 ​ ​ ​@pseudo sierra
1987 ​ ​ ​@nimble minnow
1789 ​ ​ ​@clear thunder
1682 ​ ​ ​@torn seal
1580 ​ ​ ​@sonic oak
1464 ​ ​ ​@native spruce

66 ​ ​ ​You

deep mulch
#

nop

#

vencord just very huskworthy server

#

vee husked

#

i must follow in the steps of my father

pseudo sierra
#

zt vees little minion

solid gazelle
#

nicee what AI did you use

barren wave
#

I know that plugin requests are closed but is there a way to commission one?

solemn ravine
#

@pearl parrot

jade stone
barren wave
jade stone
barren wave
jade stone
barren wave
frosty obsidian
#

neat

fierce pendant
#

i couldve done this with one perl script and a cron job

pseudo sierra
#

true

winged mantle
#

do people really hate js this much

solemn ravine
#

how it do that

#

dont lie

fierce pendant
solid gazelle
#

is there easier way to do this?

shrewd canopy
# solid gazelle is there easier way to do this?
function addSeparator<A, S>(arr: Array<A>, sep: S): Array<A | S> {
  let res: Array<A | S> = [...arr]; // copy
  for (let i = arr.length - 1; i > 0; --i) {
    res.splice(i, 0, sep);
  }
  return res;
}

const result = addSeparator([1, 2, 3, 4], 'hi');
console.log(result);

this?

solid gazelle
#

yay

delicate groveBOT
#

@placid igloo, <t:1773184726:R>: check if tidal's x-tidal-token is static ("vNVdglQOjFJJGG2U")

placid igloo
fierce pendant
#

god

shrewd canopy
#

for strings it's best to use Array#join(String) anyway

pearl stagBOT
supple whale
#

wtf are ya'll people

#
function join (arr, sep) {
  const joined = []
  for (const el of arr) joined.push(el, sep) 
  joined.length = joined.length - 1
  return joined
}
tired vigil
#

also I love the O(n^2) complexity for something so simple

royal nymph
#

Also guys this operation is called intersperse

#

I'm surprised none of u know its name

#

unknowns solution is the most sane

#

or use a generator so you get it as iterator

solid gazelle
#

Mine best

glacial mirage
#
arr.flatMap(e => [sep, e]).slice(1)
#

yummy

supple whale
supple whale
#

i remember seeing an issue for that yes

royal nymph
#

why are they not following spec 😭

#

isn't there literally an extensive ES test case they can use to test bun

#

how did they not catch it

supple whale
#

sir, date is still not correct on bun XD

#

same for a bunch of textencoder cases

#

btw @royal nymph do you know anything about discord's game sdk?

#

the C++ shit thats somewhat new?

#

cuz im trying to find people that used it or know anything about it

#

but XD

#

TLDR i want it to use for "self-botting" and possibly for custom call implementations

#

cuz i want to interface with discord without discord's app, for a matrix client

#

i take that crying emoji as you have no clue abt it

#

boo

royal nymph
#

i dont yeah

supple whale
#

yeah but knowing you you'll be an ass about it XD

#

something something "ew its for a JS project, we should go to 8086 assembly, web was a mistake" etc XDDD

#

anyways, if u have any experience using it feel free to share what it was like, and what it was useful for or could/couldnt do

#

i know it doesnt have message history, but only live chat, but thats about it, idk about shit like members, assets, calling etc

shrewd canopy
supple whale
#

they are kinda like IRC bouncers

#

running 24/7 on a server

#

so the lack of message history etc isnt a problem

#

but idk what other limits/capabilities it has

#

which is why im asking about them, so i can make the decision myself

supple whale
#

which is asked about its limitations

#

not an opinion on how you view what im trying to do

#

which is roughly inline with what i expected u to do kekw

pearl stagBOT
placid igloo
#

RegExp.escape

pseudo sierra
#

RegExplode

royal nymph
fierce pendant
proud spire
#

Is there a plugin that automatically completes quests on Discord?

elder yarrowBOT
dense sand
#

guys its so over, they're cancelling free claude models with github student pack!!!

unkempt ember
#

Makes sense. Anthropic is labelled as " Supply chain risk " by the american gouvernements, therefore, american companies can't make deal with them anymore.

dense sand
#

no it applies to GPT models too

unkempt ember
#

AH !

unkempt ember
#

What do you mean ?

royal nymph
#

American companies absolutely can make deals with them

deep mulch
#

@royal nymph vencord will partner with anthropic

royal nymph
#

yop

fierce pendant
#

i already use buns bundler as a replacement for the bundler that vencord uses

#

its 3x faster!

#

i also use the runtime for running all the scripts

unkempt ember
# royal nymph American companies absolutely can make deals with them

Indeed, I just checked again, I guess my brain extracted a bit too much :

Even for Department of War contractors, the supply chain risk designation doesn’t (and can’t) limit uses of Claude or business relationships with Anthropic if those are unrelated to their specific Department of War contracts.

I got this from anthropic.con website.

fierce pendant
#

no

#

please dont

#

i am sorry

royal nymph
#

public execution via firing squad for your severe offense of running vencord code with bun

tomorrow at 2:30 afternoon CET

#

be there or be square

fierce pendant
#

that was a joke

#

i used pnpm with node

#

please

#

please

#

please leave me alive

#

please

#

bitte v

#

bitte

#

ich bitte dich an

royal nymph
#

okay

fierce pendant
#

bitte

royal nymph
#

you live this time

fierce pendant
#

thank you

#

uhh

warm rampart
#

W

fierce pendant
#

when will i killed

vagrant crescent
#

isnt bun good

supple whale
#

:bunslop:

#

@dense sand

supple whale
#

i will enjoy it too

fallen nebula
deep mulch
supple whale
#

damn

#

fuck vite

#

but vite 8 looks unironically good

#

they FINALLY got forwardConsole and a good devtools plugin

#

wepback has had that for years now, but now that vite has it too....

fierce pendant
fallen nebula
supple whale
fallen nebula
vagrant crescent
#

wow so many purple names

jade stone
#

So good

deep mulch
#

@jade stone

supple whale
#

doesn't work for dev

#

so we're back to dev prod discrepancy in vite

pseudo sierra
#

???

#

js ecosystem so fucking ass bro wth

#

@young flicker

#

@young flicker

jade stone
#

oh, esbuild had this view and it was really good to work with

#

you can't click on anything, it is only a shallow view

fierce pendant
#

thats a big bundle

jade stone
#

oh, i bundle monaco-editor(which has an inline build of typescript) and typescript

#

that's like >1/2 of it

fierce pendant
#

nice

solemn ravine
#

how does that work

pseudo sierra
#

is this paigefiles

solemn ravine
#

tell

#

add hot reloading to appkit

pseudo sierra
#

paikit when

#

paipal

#

@young flicker

solemn ravine
#

@young flicker

solemn ravine
#

what is this

#

how does the expand button work

#

are the title bars manually done

#

Idk what that means

#

how

#

no vagueposting @young flicker

#

write in appkit @young flicker

#

why does the window look like that

#

You removed like every window decoration

deep mulch
#

@young flicker Hello

#

unhusk

#

@young flicker I Would Die 4 U

burnt nexus
#

im trying to figure out how yall find the patches, many people say use react dev tools

#

and for a beginner i really dont know where to find the react dev tools

#

checked the console, theres tabs that opened?

woven mesa
#

real

pearl parrot
#

click on the arrow next to the tab bar at the top of devtools and you will see react devtools

#

make sure that theyre enabled

#

Settings -> Vencord

supple whale
#

@little halo any ideas?

#

is tihs not how u use satisfies?

burnt nexus
supple whale
#

wrong sadan @jade stone

#

fascinating

deep mulch
fierce pendant
#

snowy satan

supple whale
#

@jade stone how about them apples

#

28k nodes

jade stone
#

idk what a node is

supple whale
#

fucking dom node

jade stone
#

oh

#

love

supple whale
#

fuck man i remember seeing this virtual scroll lib which only did like a single element of updates when scrolling but i cant find it now

#

it was so good i need it

pulsar crest
#

pro gaming

royal nymph
#

contrast-color() is landing in Chrome 147, making it Baseline Newly Available in all modern browsers.
οΈ€οΈ€
οΈ€οΈ€This feature takes any color value and returns either black or whiteβ€”whichever provides the highest contrast against the input color.
οΈ€οΈ€
οΈ€οΈ€i.e. color: contrast-color(purple) returns white ⬇️

**πŸ’¬ 16β€‚πŸ” 75 ❀️ 887β€‚πŸ‘οΈ 50.4K **

β–Ά Play video
#

lmao the mdn docs have no feature support test so it just doesnt work

deep mulch
#

fix

frosty obsidian
tired vigil
supple whale
#

but still nice util ig

fierce pendant
lavish cloud
deep mulch
#

where does IElementType come from

lavish cloud
#

kotlin-compiler-embeddable

#
import org.jetbrains.kotlin.com.intellij.psi.tree.IElementType
import org.jetbrains.kotlin.lexer.KotlinLexer
import org.jetbrains.kotlin.lexer.KtTokens
``` relevant imports
#

I'd recommend picking custom colors though

fierce pendant
#

its the time of the month where i wanna remake adobe flash from schratch

lavish cloud
#

it's kinda ass but the basics are there

deep mulch
#

i might build off of yours

#

tbh

lavish cloud
#

πŸ‘

deep mulch
#

i wonder if it would be practical to make a library using this, but it would require shipping the compiler with it

lavish cloud
#

already working on one tbh

deep mulch
#

it better be kmp

#

actually can kotlin compiller embeddable even be used on non jvm

lavish cloud
deep mulch
#

@lavish cloud theres a KotlinParser, wouldnt that be better to use

lavish cloud
#

I think that might turn it into an AST which makes it more difficult to parse, no?
Also idk how that treats unresolved references

fallen nebula
fallen nebula
#

wanted to show what it would look but i no kotlin configured

lavish cloud
deep mulch
#

guh

#

self hosted maven

winged mantle
#

looking at python it seems insane how much exceptions are used

#

I see some code trying to access a key in a dictionary than catching KeyError

#

why not just use the in operator

lavish cloud
#

or dict.get

winged mantle
#

I do remember reading somewhere that the pythonic way is often just to catch exceptions

tired vigil
#

pythoneers are so insane

worldly sigil
#

not enterprise enough, needs more OOP multiple levels of inheritance and 400 try-catch blocks for maximum instability

shrewd canopy
#

we dont use @ operator at all in python

#

and if we do then its mostly mathematics stuff

lavish cloud
#

Exactly

#

They're overloading matmul

tired vigil
#

Why does python have a separate matrix multiplication operator
What other ways are there to multiply two matrices 😭

fleet cedar
#

Because numpy users don't understand types

#

So they can't distinguish between arrays and matrices

#

And thus instead need to distinguish between matrix multiplication and elementwise multiplication

tired vigil
#

Insane

dense sand
#

oh wow

supple whale
#

@jade stone

jade stone
supple whale
#

@jade stone idk you're a monkey bro

#

idk why you said the anchor and positoning api is bad

#

it works perfect

solid gazelle
#

idk you're a monkey bro

supple whale
#

tgats true too

fleet cedar
#

We're all monkeys

solid gazelle
fallen nebula
#
public <T extends Packet> T receive(State state, Class<T> clazz) {
    Packet packet = receive(state);
    if (packet == null) {
        return null;
    }
    if (!clazz.isInstance(packet)) {
        LOGGER.error("Received packet is of type {}, expected {}", packet.getClass().getSimpleName(), clazz.getSimpleName());
        return null;
    }
    return clazz.cast(packet);
}

private Packet receive(State state) {
    Integer packetSize = new VarInt(this.dataInputStream).value;
    if (packetSize == null) {
        LOGGER.error("Failed to read packet size from client");
        return null;
    }
    byte[] packetBytes = new byte[packetSize];
    try {
        this.dataInputStream.readFully(packetBytes);
    } catch (IOException e) {
        LOGGER.error("Failed to receive packet from client", e);
        return null;
    }
    ByteBuffer buffer = ByteBuffer.wrap(packetBytes);
    return switch (state) {
        case HANDSHAKE -> HandshakeC2SPacket.fromBuffer(buffer);
        case STATUS -> null;
        case LOGIN -> LoginC2SPacket.fromBuffer(buffer);
    };
}

am i crazy ? yes probably
yes this is manual vtable by hand kinda

pearl parrot
supple whale
#

god bits-ui is shit

#

it performs so horrific

#

my route took 800ms to load

#

it was their fucking avatar component

#

i loaded 50 avatars on route navigate and that took almost fucking a second

#

wrote my own with blackjack and hookers, 10ms

#

idk why ya'll were struggling with it

#

but its cinema

dense sand
supple whale
#

hash routed

dense sand
#

good for you

supple whale
#

so SSR doesnt apply

dense sand
#

damn i hate ssr so much

supple whale
#

this is a client navigation

#

its purely fucking eval of an image src

#

its nuts

#

next was fucking bitsUI popover

#

its also so horrificly expensive mounting 80 of them also took almost a second

supple whale
supple whale
#

for using bun

#

and react

#

shitΒ²

dense sand
#

im currently trying tanstack start/router and the flow makes so much more sense

supple whale
#

auto type inference and safety, no config, no fuckery

#

just works, does all for u

rugged temple
#

Guys, if I published my plugin on GitHub, can I somehow promote it through this community?

dense sand
supple whale
#

preloading routes on hover

#

so good

fierce pendant
supple whale
#

yes but its react

#

so its automatically worse

#

because react

fierce pendant
#

actually not

#

i use tanstack start with solidjs on my site

#

i hate react too gang

#

i would never use react

supple whale
#

solid is just slightly less shit to use, and much faster react

#

its still not an enjoyable experience for me

fierce pendant
#

i understand

valid jetty
#

@deep mulch @solid gazelle json parser

#

theres operator overloading for JsonValue, if you do x[0] it will interpret it as an array

#

if you do x["a"] it will interpret it as an object

#

if it isnt of that type, you get an error

#

also syntax error

solid gazelle
#

@valid jetty make json writer

valid jetty
#

thats easy

solid gazelle
#

yay

valid jetty
#

i wrote that in like 20 lines before

solid gazelle
#

make goroutines @valid jetty

#

nvm

valid jetty
#

fres did i show you my black hole

solid gazelle
#

WHAT

#

yeah i saw it

#

its pretty good!!

solid gazelle
#

@valid jetty elle try catch?

valid jetty
#

you have result

solid gazelle
#

@valid jetty does elle have uuuuuuuuuuughhhhhhhhhhhh

#
import std.stdio (Stdout, Stdin)

trait pub BaseHandler {
  fn test() {}
}

type MyHandler {}
impl BaseHandler for MyHandler {
  fn test() {
    Stdout.new.print("it works")
  }
}

fn test_handler(handler: BaseHandler) {
  handler.test()
}

type async Main {
  fn async main {
    test_handler(MyHandler() as BaseHandler)
  }
}
``` can u do that in Elle
#

sry nvm

valid jetty
#

you sent me this before lol

solid gazelle
#

yeah i rember now

#

pattern matching

valid jetty
valid jetty
#

its a hot mess rn

solid gazelle
fierce pendant
#

when am i making my language

#

i literally wrote a whole spec sob

valid jetty
#

im just doing shit

#

look at this beautiful object parser

if self[*i] == '{' {
    *i += 1;
    map := HashMap::new<string, JsonValue>();

    for ;; {
        while self[*i].is_whitespace() { *i += 1; }
        if self[*i] == '}' { *i += 1; break; }

        if self[*i] != '"' { return None(); }
        start := *i += 1;
        while self[*i] != '"' { *i += 1; }

        key := self.slice(start, *i);
        *i += 1;
        while self[*i].is_whitespace() { *i += 1; }

        if self[*i] != ':' { return None(); }
        *i += 1;
        while self[*i].is_whitespace() { *i += 1; }

        if _, value := self.parse_json_at(i) {
            map[key] = value;
        } else {
            return None();
        }

        while self[*i].is_whitespace() { *i += 1; }
        if self[*i] == ',' { *i += 1; continue; }
        if self[*i] == '}' { *i += 1; break; }
        return None();
    }

    return Some(JsonValue {
        tag = JsonValueKind::Object,
        object = map
    });
}
shrewd canopy
valid jetty
#

this is much cleaner than my impl before parsing from index 0 every time

shrewd canopy
fierce pendant
#

uhh

#

help

valid jetty
#

the string part is just

if self[*i] == '"' {
    start := *i += 1;
    while self[*i] != '"' { *i += 1; }

    value := self.slice(start, *i);
    *i += 1;

    return Some(JsonValue {
        tag = JsonValueKind::String,
        string = value
    });
}
#

i could probably do that

fierce pendant
valid jetty
#

sure

fierce pendant
valid jetty
#

this is interesting

fierce pendant
#

W

valid jetty
#

this has also been in development for almost 6 years be realistic please

fierce pendant
#

now i am sad that i didnt make this 6 years ago

#

lol

fierce pendant
valid jetty
#

not really

#

its a layer on top of js

fierce pendant
#

typescript's type system is more advanced than anything you will ever create /saturn

valid jetty
#

i mean

#

sure?

#

but typescript is not a statically typed scripting language

#

its a superset of the dynamically typed scripting language js

#

its like saying python with statically typechecked inlay hints is now a statically typed scripting language

fierce pendant
#

okay maybe typescript isnt a statically typed scripting language but the typing system can run doom!!!!!

valid jetty
#

i know lol

fierce pendant
#

at this point just dont write it in typescript πŸ₯€

valid jetty
#

i wrote that as a joke lol

fierce pendant
#

i hope

#

those types are cursed

valid jetty
#

not really

#

the ts type system is just a functional language

shrewd canopy
#

im making 100% type-safe i18n in ts rn

fierce pendant
#

i tried that before (gave up)

fierce pendant
fierce pendant
deep mulch
#

@valid jetty

#

ro ieeee

#

Ro IEEE

fierce pendant
#

she ro on my internet till i explore 'er

lost cosmos
#

my browser really hates the filename v.gif for some reason

#

ven.gif is fine but not v.gif

#

😭

deep mulch
#

@valid jetty doing matrix factorization in my linear alg class

#

scary stuff

#

rosie be like: thats easy i love matrix factorization

pseudo sierra
#

shrimply an issue of skill tbh git gud

deep mulch
valid jetty
# shrewd canopy have you considered merging key and strings parsing logic into one fn instead a...

cant you just do this

if self[*i] == '{' {
    *i += 1;
    object := HashMap::new<string, JsonValue>();

    for ;; {
        skip_whitespace(self, i);
        if self[*i] == '}' { *i += 1; break; }
        key := self.parse_json_at(i);
        
        if key.is_none_or(fn(value) value.tag != JsonValueKind::String) { 
            return None(); 
        }
        
        key := key.unwrap().as_string();
        skip_whitespace(self, i);

        if self[*i] != ':' { return None(); }
        *i += 1;
        skip_whitespace(self, i);

        if _, value := self.parse_json_at(i) {
            object[key] = value;
        } else {
            return None();
        }

        skip_whitespace(self, i);
        if self[*i] == ',' { *i += 1; continue; }
        if self[*i] == '}' { *i += 1; break; }
        return None();
    }

    return Some(JsonValue { tag = JsonValueKind::Object, object });
}
twin matrix
#

wrap it up

#

cargo is so much worse than npm

shrewd canopy
dense sand
#

is this nextjs slop

shrewd canopy
valid jetty
#

its not really any slower than having a specific string parse state because an invalid state (you have a non-string key) is unlikely

#

that statement i sent is part of parse_json_at its a recursive call

supple whale
#

@jade stone holy fuck i had no idea

#

check this

jade stone
supple whale
#

doing new Map(initidata).values().toArray().map(a=>somemap(a)).sort((a,b) => b-a) will mutate the underlying values iterator

#

shit

#

sorry even further

jade stone
#

?? Js is insane

supple whale
#

IKR

#

dude i just spent like 20 minutes debugging why all my fucking channels in a list were progressively being replaced

#

as notifications flowed in

#

and i needed [...rooms].sort()

#

;-;

#

cuz the fucking sort for some reason fucked up the iterator from the map object

#

quite nuts

solid gazelle
supple whale
#

wait no, im wrong about that

#

something is fucking wrong here

supple whale
#

i need shit to be reactive

#

dms is a map

#

and i need to convert the map into a reactive list, via lastactive, which returns a subscription store

#

cuz then i can do:

#
<div class='flex size-full flex-nowrap'>
  <div class='h-full overflow-y-auto overflow-x-clip w-70 border-r border-black/10 dark:border-white/10 shrink-0 text-muted-foreground p-2'>
    <div class='text-muted-foreground text-[10.5px] my-2 px-1.25'>Direct Messages</div>
    <div class='gap-0.5 flex flex-col'>
      {#each $sorted as { room } (room.roomId)}
        <Button variant='ghost' class='w-full rounded-[6px] px-1.5 py-1 h-auto justify-start gap-2.5' href='/#/app/dm/{room.roomId}' active={$page.params.roomId === room.roomId}>
          <RoomImage {room} class='size-6 rounded-full bg-muted' />
          <div class='text-nowrap text-ellipsis overflow-hidden font-medium text-xs'>
            {room.name}
          </div>
          <div>
            1
          </div>
        </Button>
      {/each}
    </div>
  </div>
  <slot />
</div>
#

and simply that each will re-order without re-mounting the components

#

automatically

#

as notifications flow in

shrewd canopy
#

what vs is smoking

supple whale
#

yes

#

cuz 4 > 5

#

by a landslide

#

:)))

fierce pendant
#

nah wtf

supple whale
#

for newcomers 5 is better because its explicit

#

but once u know how 4 works, its soooooooo much better because you write so much less boilerplate

#

but yeah sv4 is funky if you dont know how their compiler and rectivity works

#

i spent many hours looking at [and contributing to] their compiler

#

that said, only visibilityState and fullscreenElement bindings ended up merged

#

they didnt add my pictureInPicture bindings because firefox doesnt support it

#

its always fucking firefox

#

shit, this was 3 years ago at this point

#

look how they massacred my boy D:

fierce pendant
valid jetty
#

@deep mulch i added a little section for things made in elle

fierce pendant
#

i started with svelte 5 and going to svelte 4 would be weird

valid jetty
#

there are 2 more but i cant talk about them yet because theyre in escrow

#

theyre school projects which means i cant publish the source code publically or they might be flagged for plagiarism

#

as soon as theyre cleared (i get my final grade) i will clean the commit history and add them

#

theyre the rhythm game and the japanese programming language

deep mulch
#

insane

fierce pendant
#

insane

solid gazelle
valid jetty
#

i love holes

#

on another note i didnt even notice that

fierce pendant
#

i love women

solid gazelle
#

casn u help me do this btw i cant code

#

what do i change

#

ahh ok

#

nvm im dumb i got it

valid jetty
#

theres quite a few issues with that code

#

hold on ill fix everything and explain it

solid gazelle
#

yayyy

valid jetty
#

alright hi so this is the correct code

use std/prelude;

external fn pthread_create(u64 *thread, void *attr, fn(void *) -> void *start, void *arg) -> i32;
external fn pthread_join(u64 thread, void **retval) -> i32;

struct Domain<T> {
    u64 thread
}

fn Domain::spawn<T>(fn() -> T f) -> Domain<T> {
    u64 thread = 0;
    
    pthread_create(&thread, nil, fn(arg) {
        f := #cast(fn() -> T, arg);
        return Box::new(f()).to_ptr();
    }, f);
    
    return Domain { thread };
}

fn Domain::join<T>(Domain<T> self) {
    ret := nil;
    pthread_join(self.thread, &ret);
    return *#cast(T *, ret);
}

struct Wawa {
    string name,
    i32 width,
    i32 height
}

fn hey() {
    io::println("i run in a different thread!");
    h := Box::new(Wawa { name = "hi", width = 20, height = 10 });
    io::println(h);
    return h;
}

fn main() {
    dom := Domain::spawn(hey);
    result := dom.join();
    io::println("result:\n", result);
}
solid gazelle
#

yayy

#

wht is ab ox

valid jetty
#

hold on ill explain

#
  1. std/io is part of std/prelude, thats redundant
  2. void on its own is not really a valid type, im honestly surprised the code even compiled like that. the signature of pthread_create accepts void*
  3. all thread memory will be freed after the thread joins. to mitigate this, i put the return value into a Box, which essentially means:
    • allocate new heap memory of size T
    • store the value T inside via shallow copy
  4. &h is not allowed and is UB, all stack memory is invalidated after the function returns. essentially, when hey returns, &h becomes an invalid pointer
  5. -> Wawa * and Domain::spawn<Wawa*> are unnecessary because elle can infer all of that, you can just have Domain::spawn(hey)
fossil socket
solid gazelle
#

i understand

#

awesome

fossil socket
#

I tried to get into programming so many times

valid jetty
solid gazelle
#

i guess undefined behaviour yeaahh

valid jetty
# solid gazelle i understand

as a rule of thumb, think of Box::new(value).to_ptr() as:

T *ptr = mem::malloc(#size(T));
*ptr = value;
return ptr;
#

its not exactly this because it allocates using the current allocator bla bla bla

#

but basically a box is just putting the value into heap memory

#

in fact you can read the source code of it

#

elle has a merit that it is easy to look into its src code (at least the stdlib)

#

actually wait

valid jetty
#

itll be copied later

solid gazelle
#

are you susure

valid jetty
#

yes

solid gazelle
#

i rtried just sending Wawa and name worked but widht and hegiht were wrong

valid jetty
#

its a struct it will be copied abiding by the c abi

solid gazelle
#

oh ok

valid jetty
#

hm

solid gazelle
#

when i wasnt boxing it

valid jetty
#

like at the spawn time

solid gazelle
#

wasnt

valid jetty
#

like this box

#

oh ok

solid gazelle
#

i see

#

awesome

#

it just works

#

:)

valid jetty
#

yayy

solid gazelle
#

elle lovely @valid jetty

#

do u think i can install the zed extension on vscode

fierce pendant
lucid trail
#

though there's probably an extension that lets you point it to a ts grammar

jade stone
deep mulch
#

@jade stone saladdd 😭

valid jetty
#

@solid gazelle

solid gazelle
deep mulch
#

ro ieeee

#

@valid jetty what if you made pointers annoying like C++ so you had to use -> to access

valid jetty
#

i specifically made it so you dont have to do that

solid gazelle
#

add decorators @valid jetty