#๐ช -progaming
1 messages ยท Page 105 of 1
json databases 
not a database
it's never changed after it's written
wouldn't a database be faster for lookup
no real point in using a database for this
too complex
the only thing i might do is minify the json a bit to save space
Aaaand this kind of pointless pedantry is why even experienced users leave projects. Ironic bringing up context, considering nobody here was honestly stupid enough to not figure out what "database" referred to in context (considering, again, there is literally only a single json file). Y'all just wanted to wave your superior technical knowledge over the 'newbie' for not using your brand of terminology โ on a semantic technicality that was irrelevant to the discussion. Bye. :)
Aaaand this kind of pointless pedantry is why even experienced users leave projects. Ironic bringing up context, considering nobody here was honestly stupid enough to not figure out what "database" referred to in context (considering, again, there is literally only a single json file). Y'all just wanted to wave your superior technical knowledge over the 'newbie' for not using your brand of terminology โ on a semantic technicality that was irrelevant to the discussion. Bye. :)
Aaaand this kind of pointless pedantry is why even experienced users leave projects. Ironic bringing up context, considering nobody here was honestly stupid enough to not figure out what "database" referred to in context (considering, again, there is literally only a single json file). Y'all just wanted to wave your superior technical knowledge over the 'newbie' for not using your brand of terminology โ on a semantic technicality that was irrelevant to the discussion. Bye. ๐
Aaaand this kind of pointless pedantry is why even experienced users leave projects. Ironic bringing up context, considering nobody here was honestly stupid enough to not figure out what "database" referred to in context (considering, again, there is literally only a single json file). Y'all just wanted to wave your superior technical knowledge over the 'newbie' for not using your brand of terminology โ on a semantic technicality that was irrelevant to the discussion. Bye. ๐
hmm
i think i wanna rewrite the http part of my app in go
or rust or anything as i don't want to use a sloplang like js for something connected to the web

(dumb reason i just idk)
good reason
i guess js is potentially more vulerable to dos
it would probably be really bad since my db access stuff is in js though
i guess i could make a transpiler
transpile simple js which only does db stuff to go
I have a great idea! create a syntax to declare db structure and then it auto generates queries!
oh? that's called an orm?
what's an o-r-m?
Aaaand this kind of pointless pedantry is why even experienced users leave projects. Ironic bringing up context, considering nobody here was honestly stupid enough to not figure out what "database" referred to in context (considering, again, there is literally only a single json file). Y'all just wanted to wave your superior technical knowledge over the 'newbie' for not using your brand of terminology โ on a semantic technicality that was irrelevant to the discussion. Bye. ๐
i guess i will just try to create more separation
mmmmm im bored
saw t3 on my youtube feed [i pressed dont recommend this channel like 3 times now], saw he made a slack clone
UI doesnt let me send emojis
send a message of 100k ๐ 's directly via websocket
website doesnt load anymore
db error
:)))))))))
too much free time on my hands
fucking ai slop
ITS STILL HERE GOD FUCKING DAMN IT YOUTUBE HOW MANY TIMES DO I NEED TO PRESS DONT RECOMMEND
@nimble bone watch

oh wait rusher sent already
didnt read chat award
yeah i have a thing against installing extensions
insane
they are waaaaaaaaaay too priviliged
like the perms given to extensions are fucking insane
you sound like a wokie 
nah i sound like a person that doesnt want to get hacked
i usually just use userscripts
or convert extensions to userscripts
because then they randomly wont auto update to include malware
as has happened 100 times in the past 6 months on chromium
the only thing more consistent than v8 0 days are extensions updating to include malware
vee doesnt backread
silly
manti did this without even trying
yoppp
โSo what do you think about the opportunity,โ Benโs recruiting agent asked. He thought about it for a few moments. It wasnโt exactly what he was looking for, but then again, he had been out of work since November of 1989 โ nearly three whole months โ and figured he should probably get back in to the swing of things. He told the recru...
sometimes slower is better
@royal nymph make vencord slower
@royal nymph add invasive telemetry to vencord
it will be so good
trust
made completely server-side quest markers
making them ignore shading was a nightmare
BLESSED
this will save me from brainrot
i can now HIDE AI CONTENT WITH 2 CLICK
woah
how
resource pack?
Pushing this conf to prod
is this a sane way to do this
import patcher from '@core/patcher';
import utilities from '@utilities';
import logger from '@core/logger';
const { lazyDefine, findReact, name } = utilities;
function handler() {
const tableNode = document.querySelector('[class*="_Table_"]');
if (!tableNode) return;
const Table = findReact(tableNode);
if (!Table) return logger.debug('Failed to find React Fiber of LB Table:', Table);
patcher.before('type', Table, (args) => {
const users: unknown = args?.[0]?.users;
if (Array.isArray(users)) {
users.find(user => user?.isCurrentUser).firstName = name.firstName;
}
});
}
export default async function () {
const page = await lazyDefine(() => document.querySelector('[id="root"]'), undefined, Infinity);
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => mutation.type === 'childList' && handler());
});
observer.observe(page, { childList: true, subtree: true });
return () => observer.disconnect();
}
every time the root renders something different in the main content island, the function to patch changes and my patch indirectly gets unpatched
though idk if a mutation observer for every time the root changes ever is good for performance
but it works
# gil goes vroom vroom
for filename in filenames:
fn = join(dirname, filename)
with open(fn, "rb") as f:
print(fn)
tasks.append((fn, f.read()))
@valid jetty teach me complex and imaginary numbers applying to fractals and keep it dumbed down for me 
I wonder if Rosie knows quantum mechanics and thermodynamics
the first law of thermodynamics is you do not talk about thermodynamics
Which font look the best with M3 design? I want to make my app look as similar as possible to the official google apps, but google sans is not open source
true
roboto
flutter or compose
oh
good luck then
I've yet to see a flutter app manage to use m3 properly
font all wrong, icons wrong, colors wrong
I hate flutter
jetpack compose if you're just making an android app
ive yet to see a flutter app manage to not look and feel like unfixable mess
kmp is just kotlin multiplatform
compose multiplatform is the cross platform ui stuff
yop
hello frends
.text-contrast {
color: hsl(from var(--your-color-variable) h s calc((l - 60) * -10));
fill: hsl(from var(--your-color-variable) h s calc((l - 60) * -10));
}
goodbye
@valid jetty literally me https://youtube.com/shorts/8EP1-i-Z7eg?si=3D2Tl8FNShpqAvq7
Paid partnership with favorite oss, overengineered editor Zed.dev
...so that more people use it and improve the neovim mode.
Dear AI editor maker, this is who used your editors also.
vim
neovim
treesitter
vscode
rust
AI editor
#nextgenai #codeeditor #programminghumor
programminghumor
programmingjokes
codeeditor
Does anyone here know D /gen
typo 
what the fuck is this supposed to mean?? 
yes please let me edit my helm charts with blazingly fast editor
community discord selling NFTs
who does ts
me when i come back to old code i wrote
@nimble bone @pseudo sierra my code is so slow ๐ญ
horror
tbh the top 3 times are good
i can't do anything about the time it takes over the network or writing to disk
and 4s to format every discord module is really good
but the bottom 2 need work
esp since i'm computing things more than once
HORROR FLAMEGRAPH
lowered the bottom time by 7000ms with one simple trick
the bloodstreams of the damned flow through the walls of hell
fun fact, it's not a good idea to parse the exact same ast twice
23k times
@crude star hii
hi
did someone say Kotlin
nop it's typescript
salad crazy
@deep mulch my friend cant stfu about flutter, do you have any proof how to show them bad m3 app in flutter
yes, than you dependabot for telling me my electron compliation scripts are vulerable to attacks
i hate these crazy dependency trees
Have the same error somewhere in our vue codebase, absolute pain in ass and the warning is annoying
yeah its vite
i use vite for bundling my native electron code, because some guy wrote some insane tooling around it, and even tho its vite, it has the best DX for electron out of anything i've ever used
it has automatic bytecode compilation for nodejs threads [aka what browsers do for websites to speed up loading on re-visits], which speeds up nodejs load times a fuckload
it has automatic debugger attaching to all electron contexts, be it main, thread or windows
and split type declarations, so that you have different globals and libraries for the native electron code, and the UI code, so u wont randomly get nodejs types and cjs imports in ur UI code, but you will in the native nodejs threads
its still fucking vite, and i hate it, but the DX is so good its unfunny, the guy cooked
Next generation Electron build tooling based on Vite.
oh wow 
I like flutter idk why people hate on it
Still 1000x better than react native (๐คข)
you're comparing shit to garbage
sure its better
but fuck is it not a high bar
mfw will write 300 lines of code and go "ah yes finally, my single button is finished"
like breugh
anyone knows what this error could be caused by?
Typescript
Most of the time is in the abandoned library that Iโm using
which I need to move to the updated version of
cable might be acting weird
idk
seems to be an arch thing
@deep mulch any idea how to get the route out of NavHostController?
i need it for my topbar, but its crashing with java.lang.ArrayIndexOutOfBoundsException: length=3; index=2027439596
oh
there's no destinations in it
I think if you use .get instead of [] it will be nullable and not error
in your topBar
generic linux shit
this isnt even an adb or android problem
it simply cant connect to the adb server
ive had errors like that but they usually go away after restarting everything
Why the gap above 
stop doing questionable stuff jetpack or i will be forced to use flutter
guhh you didnt do the thing
enableEdgeToEdge
and NoActionBar style
*.filter should be self-explanitory, .take drops the event subscription after n dispatches (.when("click").take(2) = automatically unsubscribes after you click twice)
i have the first, but how do iset this?
use a webview like a real g
webview gaming
i already do it
i think the only thing i dislike about this is unsubscribing which is:
otherwise this is very cool!
use AppCompat instead of Material i think
the search bar is wrapped on box, which is positioned correctly
i tried to put it away, but it did it anyway
thats not stdlib
no thats mine
@Composable
fun GenericTopBar(
title: String,
) {
TopAppBar(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = NavigationBarDefaults.containerColor
),
title = { Text(text = title) }
)
}
whers the searc bar coming from
FinderScreen which is opened from SearchScreen
well that doesnt seem to be the problem actually
Box(
Modifier
.fillMaxSize()
.semantics { isTraversalGroup = true }
) {
SearchBar(
modifier = Modifier
.align(Alignment.TopCenter)
.semantics { traversalIndex = 0f },
inputField = ...,
expanded = true,
onExpandedChange = { },
) {
Column(Modifier.verticalScroll(rememberScrollState())) {
}
}
}
if i put border on the box, its covers the whole screen, like completely
youre not applying the scaffold padding
huh?
the box is on top of the scaffold because of the fill max size
youre missing the innerPadding
so applying innerPadding would uncover the top bar?
but i see the bottom bar
if i replace the SearchBar with Text, the gap goes away
so i think the problem is just in the SearchBar styling
well youre supposed to have text in the top bar or have it hidden
well i said that if i remove the top bar entirely, its still there
how did you remove it
i commented it out
show
ended up just writing my own implementation
guh
who up zooting
who up zooting
loicence
who up zooting
if discord was to migrate from webpack to rspack would that break webpack related mods?
waitt
im probably asking in the wrong channel
but I don't seem to have access to #๐งฉ-plugin-development
likely yes
ofc not
im currenly trying out rsbuild and it's so amazing, discord might think it's amazing too
rsbuild fixes my vite issue related to sharing chunks with web workers and main thread
also that build time is insane
vite is so fucking assssss
i dont understand why every1 loves it so much
it has so many issues its unfunny
webpack is so much better, its just slower at startup
and fucking everything now uses vite, and im forced to use it, because nothing else wants to support webpack anymore
cant even fucking use sveltekit on webpack
because its vite only....

i thought they already switched to it for desktop
I don't think so?
isn't there still webpack boilerplate everywhere
also webpackChunkDiscord_app
discord already uses rspack
really?
I thought rspack and webpack had a different runtime
rspack uses the same webpackChunk global pollution name
but it has a slightly different runtime
for example wpRequire.c doesn't exist in rspack
or maybe I'm just wrong
after svelte became more react like, I stopped using it
I can just use react or solidjs lol
the SFC paradigm kinda suck too
it makes more sense for smaller components to be in the same file
rspack is the best iteration, it's both fast when building for production and fast when in dev
Hold on, let me send you a link.
RS pack isn't the best though because it doesn't have support for all the hooks that webpack does.
packages/discord-types/webpack/index.d.ts: Line 71
export type WebpackRequire = ((moduleId: PropertyKey) => ModuleExports) & {
oh wow
it is rspack
that's insane
I assume this was not a recent move
if rspack could brand itself as webpack compatible and even discord started using it, maybe it's not really that bad
๐ค
afaik rspack is even starting to maintain its own versions of dead webpack plugins
or maybe webpack plugins are just that reliable to the point you don't need to maintain it at all
this is a second time my android studio absolutely ate all ram and cpu and i was force to reboot via power button
TIL in typescript there's a difference between method and function property declarations in interfaces
even if you use the safer function property declaration you can still bypass it by declaring as a method
wait or can you
cursed
it's still very much not react
but I'm also still on svelte 4
you're just wrong
it just depends on your config or something
sometimes it's missing even on webpack
maybe based on if your code ever uses require.cache explicitly
Had to rewrite C++ code but in Swift because of an issue someone faced when installing a modified app (I literally missed this entire part)
I hate that I need to do this just because iOS doesn't like mismatched nested identifiers
i didn't technically need to rewrite it either but I had to just to add a single feature in the app which wouldve needed me to rewrite some of the c++ code (hell no, this is not my code or my program)๐ I don't like dealing with 3rd party shit clearly
@valid jetty
and theres windows company policy for one project so every employee has to use windows doesnt matter which project theyre on ๐คฎ
Thats a good idea
Force Windows/macOS on employee computers
And there's WSL on Windows so no need for vbox
scary
imagine if js made it so that toString on string added quotes
so whenever you concatenated strings they had quotes added
nop
JSON.stringify simply?
String.prototype.toString = function () { return JSON.stringify(this) }
thank you for coming to my ted talk
does that actuall work..
/run
String.prototype.toString = function () {
return JSON.stringify(this);
};
let name = "minker";
console.log("hello " + name);

ah, right
makes sense
XD
XDDD
lmao what
oh browser ran out of memory
gg
HMMMMMMM
imagine if there was a c++ time library that allowed time travel with scope guards
chrono::tardis tardis(-1 * chrono::MINUTE);
and it would send the thread into the past
what if you then wrote a function to go back in time and stop the function from being written
i guess that's unrealistic
what about doing it in a dynamic language
does python have destructors
override __del__ method
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
... def __del__(self):
... print('Being deleted rn!')
...
>>> print(Foo())
<__main__.Foo object at 0x00000218FA894890>
Being deleted rn!
>>>
def time_travel():
with Tardis(-1 * MINUTE) as tardis:
del globals()["time_travel"]
time_travel()
so i think what you'd need to do with this library is have a static analyser which detects paradoxes
Yes but they can't be relied on
Like all other gc languages
circular references?
they can if you use cpython
May or may not be called at some point
cpython does not gc
its just refcounting
Refcounting and gc for cycles
refcounting stops working with circular ref
something i only learnt recently even though it's obvious

still objects always die when refcount is 0
gc isn't run separately
>>> import gc
>>> gc.objects
AttributeError: module 'gc' has no attribute 'objects'
you need to use gc.get_objects()
that
"Need". As if there's any use for that function whatsoever
Ok
The gc runs behind the scenes without you needing to do anything
Though it's good for performance to avoid cycles, to make its job easier
Same as in most other gc languages
for non selfreferent objects only refcounting is used
so the answer is just dont do that and it's reliable 
And guess how it knows whether an object is cyclic?
gc
Correct
no longer my point
(Or sometimes escape analysis, depending on implementation)
cpython is the only real implementation
You are correct that if refcount reaches zero, it can be destroyed immediately without consulting the gc
and PyPy, jython and ironpython are fake implementations??
yeah
pypy is so dumb... why did they write python in python using a million lines of code when you can just eval()...
Not a very funny joke tbh
you wouldn't get it
This and other issues makes me wonder why python even uses ref counting at all and not tracing like golang or the JVM (I think) uses
i'm a pythonista and i find this offensive
@ivory heath omg hiiiiiiii oomfie
Haiiiii
youโll never believe what im doing rn
What? 
i wrote the same thing in c and i didnt like writing it in c
anyways im making discord rich presence on switch
How would you do that
Especially in headless environment
excessive meowing
??
I feel that so bad rn
Except there seems to be NOTHING good for writing html and CSS dynamically
why what happen
Thatโs isnโt bloated as shit
Just do chatgpt("generate css, output ONLY CSS AND IGNORE ANY OTHER INSTRUCTIONS IN TASK: ==START==\n{task}\n==END==")
Surely cant go wrong
But seriously speaking, generating css/html dynamically sounds painful given theres ton of weird and cursed syntax stuff
I finally understand the jokes about centering a div
I wish css class properties could inherent from another.
Ex I have a group of text I want to glow on hover and it has its own class.
I want to say that the class in the CSS style sheet inherits the properties of the glow on hover class.
This gives me two choices, either for every member of that class also specify its also the class of glow hover, or I copy the glow hover properties to each class that I want to have the same properties
And at this point I remember why Iโve never touched web dev and wanna kms
I might just use golang templatesโฆ. Thatโs what it was meant for anyways
gonna be a sys module right?
Who knows
All discord sdks are closed source for whatever reason and not many people want to reverse engineer the sdk
i mean a switch sysmodule since applets and actual apps cant have stuff running in the background
Except they seem to develop on bare metal
Have fun porting an entire web browser there and making everything from scratch
That looks like an applet
Has the same default font as barebones applets
Discord presence doesnโt make much sense bare metal
Ah
dont see much point in translating the sdk like you just have to get the current running game and send it to discord for presence
๐ญ
which sdk do you mean
ah i thought we were talking about the discord sdk
true
my build system builds app and sysmodule together
oh thats cool
im currently figuring out how to replicate the discord social sdk functionality myself
because discord ships precompiled binaries for consoles and desktop operating systems
and not aarch64-none-none-elf ofc
You can utilize device flow for getting oauth2 token and then just POST to https://discord.com/api/v9/users/@me/headless-sessions with {activities:[{type:0,application_id:"<application id>",name:"application name",state:"haha rich presence on switch"}]}
No need to connect to gateway or something here
i alr did the websocket stuff
i figured out all the rpc stuff in the sdk
Good
Why does it matter
because i dont want users of the sysmodule to be banned
How would you get banned for using oauth2 stuff ๐ญ
There isnt even antispam for Bearer tokens
Yeah the headless sessions endpoint isnt usable by user tokens
Yeah but sdk.social_layer_presence expands to it
https://docs.discord.food/topics/oauth2#umbrella-oauth2-scopes
hmm
how do you keep the presence going
if its wss then the activity disappears when disconnect etc
how it work on here
Just post to the endpoint every 20 minutes
If an existing headless session already exists, try updating it, but may or not fail (in which case, create a new one)
fr
pi@prusa:~ $ apt-get moo
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
..."Have you mooed today?"...
@deep mulch
love
insane
but i have one more question
what about existing activities
Wdym
how tf do i make this in swift 
i mean ik itโs just like literally an image put at the same location dynamic island is
but how do i even calculate it
hardcode it
pixel values
on a real note this might be useful to you? https://github.com/unbound-app/loader-ios/blob/main/sources/Utilities.m#L492-784
ty! looks kinda hard tho
just wish there was like a lib for that
considering switching my codebase to use braces everywhere as contributors are more likely to use braced style
however
cant you like use formatter
idk
i'll probably find some js parser and do it that way
because i'm weird
wait you can probably get away wwith regex
idk braces are so ugly to me
they're like braces in teeth
so clean
ignore snake case
i refactored almost everything to use camelCase but some stuff still uses it

i am though...
obssessing over braces and casing seems like a thing that will make your codebase get nowhere in a year
lmao
obsessing?
well not obsessing
more like people have told me to switch from both
also it took like barely any time to refactor anything
EVIL SNAKE CASE
it's because it's parsed from TOML
i am probably the only person who would make a discord bot configured through TOML
I like snake case
nop i would use toml instead of json
and i would use snake case in typescript/js
idk is only 8k loc after spending an insane amount of time on something over the last year more like 0.5x
to me:
constants use SHOUTING_SNAKE_CASE
functions use snake_case
variables use camelCase
types use PascalCase
this is how i try to write code when there is no other enforced style
imagine if you used that in zig
where variables are snake_case and functions camelCase
i like using PascalCase for most globals including some constants
the only exception is for types like rune which can be lowercase because why not
primitive constants = SCREAMING_SNAKE
object "constants" (enums etc) = PascalCase
no rune isnt a keyword, its not even a primitive type
thats fair
in c++ i would do
constants, macros -> YELLING_SNAKE
variables, functions, namespaces -> quiet_snake
enums, classes -> PascalCase
because everyone does things differently
rune is specifically an enum to an i32 which is large enough to hold a utf8 code point ```rs
// ใชใใกใใฃใฆๅใจใคใชใขใน
enum rune @repr(i32) @nofmt {}
external fn rune::encode(rune self) @alias(rune::fmt) -> string;
hop on english comments
its completely arbitrary but it feels right because most other primitive types are lowercase
tbh idk why i did that
theres a lot of these kinds of comments
i am kind of concerned...
what's the typical amount of loc to write in a year in a project you're pretty motivated with
at the very least errors in japanese are fine because the front-end is """"supposed"""" to be used by someone who understands japanese
elle is sitting at 35kloc and ive been working on it since april 2024
but maybe thats just because rust is more verbose than go
vencord fork rewritten in Piet
i guess i'm doing things in typescript and saving over 500 lines from not using braces
8kloc isnt bad if youre also doing other things
i spent all of my free time and got less sleep on a lot of nights debugging stuff
i also avoid writing any "crap" code
i love writing shitcode
make it work, make it correct, make it fast, make it clean (as in, the steps)
is how i work
if i commit something it has to be at least half decent
even if it has lots of duplication

fixed
if (!(message_edit === true))
continue;
rust modules are really annoying but every other module system makes me want them

but i think in reality sometimes you want rust like modules, other times you don't
so rust should make modules work like js unless you add the annoying keyword before mod
is deno and https://lume.land/ any good does anyone know
and esm should support a
"use annoying";
directive
yes but if you care I like vitepress more and it also works on nodejs
idk i just heard about deno a lot lately
its trendy
yeah deno is good
vto is vento, njk is nunjucks, pug is pug, eta is https://eta.js.org/
Lighweight, powerful, pluggable embedded JS template engine
are any of these even good
or like
is md enough
yes
vitepress uses vue but its good enough for you to use it
basically its pipeline is like, treating markdown files as vue templates and then compiling them
browsers don't have cjs
LOL
i did some awful regex to add braces
and it increased LOC so much...
confirms it's a bad idea
they use ESM
Insane
Braces >>>>
Unless it's a simple return / break statement
/continue
wouldn't that be kind of inconsistent
if (someThing)
return;
if (someThing) {
otherThing();
}

for (const element of array) if (element.isEpic)
element.explode()
does this code scare you
am i insane
warn if __proto__ is enabled and also enable additional mitigations just in case 
wtf is --disable-proto=throw
makes accessing __proto__ throw
you can still do const myObj = { __proto__: null }
yeah
and on an object with a null prototype looking up/setting the __proto__ property behaves as normal (no special meaning as usual)
it's just to try and stop prototype pollution
but you could still theoretically pollute ({}).constructor.prototype 
imo you should always have braces
because you can accidentally write
if (someThing)
a();
b();
c();
``` and b and c run unconditionally
sounds scary
The reason why it matters is because other thing could be like array.map.filter.reduce whereas a return break continues always a one statement thing.
Yes
I disagree with that because most of the time your formatter will fix that for you and then it won't look like that.
i dont format my code with an autoformatter 
it doesnt work correctly in my code editor depending on the specific formatting requirements of the project im working in
zed just makes it format with my global one which often changes the amount of spaces and stuff like that its annoying
so i just turn it off
erm.. shrimply don't write shit code
i mean true

glad i always manually do python -m black -S -l 125 discord (or python -m ruff check <project.name> & python -m ruff format <project.name>)
always braces but no parens
bad
๐ญ
if foo then bar() end :)
did you mean
bar() unless not foo
that also works
yop
does elle have ellevis operator
yes
thats valid elle code
@deep mulch peak?
#!/usr/bin/env -S ellec --silent --run
use std/prelude;
namespace DIR;
enum DirentType @repr(u8) {
Dir = 0b00000100,
Reg = 0b00001000,
}
struct Dirent {
u64 ino,
u64 seekoff,
u16 reclen,
u16 namlen,
DirentType type,
char name // opaque static array
}
external fn opendir(string path) -> DIR *;
external fn readdir(DIR *dir) -> Dirent *;
external fn closedir(DIR *dir);
fn collect_files(string path, string[] out) {
dir := opendir(path) ?: $die();
defer closedir(dir);
while dirent := readdir(dir) {
if [".", ".."].contains(&dirent.name) { continue; }
out_path := "{}/{}".format(path, &dirent.name);
if dirent.type == DirentType::Dir {
collect_files(out_path, out);
} else if dirent.type == DirentType::Reg {
out.push(out_path);
}
}
}
fn generate_sources() {
path := "src";
$printf("Generating files at {}...", path.color("green").reset());
collect_files(path, files := [string;]);
io::write_to_file("docs/srcs.txt", files.join("\n"));
$printf(
"Generated {} files at {}!",
"{}".format(files.len()).color("green").reset(),
path.color("green").reset()
);
}
fn compile_docs() {
path := "docs/main.typ";
$printf("Compiling typst at {}...", path.color("green").reset());
libc::system("typst c {} --root ..".format(path));
$printf("Compiled {}!", path.color("green").reset());
}
fn main() {
generate_sources();
compile_docs();
}
this is my build script for ichigo docs
no
ellefmt
horror
no i dont like fmts
it makes the code look more consistent, sure
but for example this
would not work
it would remove the extra spaces
even though it looks better with the spaces
i like the control
oh go formatter actually formats like that
its neat
@valid jetty rename elle to Rust 2
its rust 0.3 at best
rosie is remaking rust
just the syntax
its not my fault, i just work in rust for 8 hours a day
my brain starts thinking the rust way
@deep mulch imagine if elle ended up like this https://github.com/acquitelol/elle/tree/master?tab=readme-ov-file#-example-syntax
thats crazy
ok nick
@valid jetty hiii
hiiii
Hi rosie and zoot
hiii tasker
hiiiiiiii
tbh i dont think lazy iterators were influenced by rust i just really like how rust does them
@valid jetty
@valid jetty
how is the namespace DIR a valid type to pass as a param
I may be insane
It's 5am and I got bored so I wrote an xml parser on my phone
Send help
@deep mulch
- I managed to fix the issue in the SearchBar(the weird gap above) - by setting
WindowInsetsto 0dp - I'm rethinking the design choices a bit - so I have a question. You click the TextInput which triggers the searchbar. Should in your opinion be the searchbar in a separate screen or be laid on top of the current screen? I have the latter now, but the code seems such a mess
Iirc theyโre called anchors
that's so easy to spot compared to other mistakes you can make even with braces
I think you're overcomplicating it
you can just have the search bar below the filters, if you're using Column its simple
me too (it's grown on me)
that looks pretty enough but in languages with parens having both parens and braces for a single statement looks really ugly to me for some reason
i doubt the results would fit there and it would look good
-# this is an old version
this is what i wanted ideally
If it were me I would make it able to parse from: and to: but that would be harder for a beginner
is from and to the primary filtering
im guessing this is a navigation app?
yes
even without an autoformatter it will be fixed in most editors
pressing enter will automatically unindent
I think Google maps would be good inspiration maybe
tap the destination after searching and then you get a from and to field
there was a faumous vuln in webkit with this
but tbh i think they were just writing shitcode 
and any amount of scrutiny would've made this bug obvious
dd a condition without dding the goto
this is why you shouldn't let your kids use vim
they copied and pasted this sequence of checks a load of times
it was just broken in one of them
Everyoneโs shaking their heads First of all, I assume that by now, everyone who has ever read a single tweet in his/her life has heard about Appleโs instantly infamous โgotofailโ bug by now, and most of you have probably already read Imperial Violetโs analysis of it. To sum up the debacle in short: A duplicate... Read more
this is among my favourite topics of endless debate including tabs vs spaces
and i am sad to admit there is a pretty big advantage to spaces
it's because github's code suggestion editor doesn't allow tabs, it focuses the next element if you use them
then again, to insert spaces you also need to press space repeatedly
so probably just copy and paste the comment into sublime text
(this is my solution)
Thats good
Next forbid vbox and allow only wsl
not the nixos horror
DIR on its own isnโt, a pointer to DIR is
itโs treated as an opaque pointer
you could put void* but with this itโs more typesafe
the namespace keyword declares a type which exists but has no shape
itโs main purpose is to put functions under its name, like ```rs
namespace Foo;
fn Foo::bar() {}
hence itโs a namespace
because an empty struct canโt really exist, i would have to make a single empty field
with the namespace, it never even goes into the IR
in c you can do that to reference a struct that exists elsewhere but you don't have the definition
functions that take a namespace pointer are reduced just to l
thatโs basically what i did
thatโs what namespace DIR is
DIR is a struct that exists somewhere in C code
w*ndows
after microsoft has made tsgo (typescript-go) will they make csgo (c#-go)
real
i can't wait for typescript-go
my code takes a worrying amount of time to typecheck
enable incremental
struct Foo; can just be different than struct Foo {}
i mean yes but i also want the semantic that the namespace keyword is used to make a namespace that you declare functions into
i could do that tbf
it would actually simplify the parser quite a bit
sadly
forced at gunpoint
RUST
for.. both?
luckily ๐ญ
i honestly donโt know what to answer with
the question is so insane
yeah, golang for both - a psychopath
gleam
@valid jetty I love the kazakh economy
when i was there in june i bought an ice cream for 56 eurocents
next day it was 55 cents
then 54 cents
last week it was 51 cents
rn 1 euro is 620 tenge
in like 2010 it was 100
maybe soon itll be 1000 so its easy to convert
@royal nymph do you love the typescript type system
type Succ<T extends number, acc extends number[] = []> = acc['length'] extends T
? [...acc, 0]['length']
: Succ<T, [...acc, 0]>;
type Add<T extends number, U extends number, acc extends number[] = []> = acc['length'] extends U
? T
: Add<Succ<T>, U, [...acc, 0]>;
type Mul<T extends number, U extends number, Res extends number = 0, acc extends number[] = []> = acc['length'] extends U
? Res
: Mul<T, U, Add<Res, T>, [...acc, 0]>;
type Prec<T extends number, acc extends number[] = []> = [...acc, 0]['length'] extends T
? acc['length']
: Prec<T, [...acc, 0]>;
type Sub<T extends number, U extends number, acc extends number[] = []> = acc['length'] extends U
? T
: Sub<Prec<T>, U, [...acc, 0]>;
type LessThan<A extends number, B extends number, acc extends number[] = []> =
acc['length'] extends A ? true :
acc['length'] extends B ? false :
LessThan<A, B, [...acc, 0]>;
type Div<A extends number, B extends number, acc extends number[] = []> = LessThan<A, B> extends true
? [...acc, 0]['length']
: Div<Sub<A, B>, B, [...acc, 0]>;
type Eval<T extends string> = T extends `${infer A extends number} ${infer Op extends string} ${infer B extends number}`
?
Op extends '+' ? Add<A, B> :
Op extends '-' ? Sub<A, B> :
Op extends '*' ? Mul<A, B> :
Op extends '/' ? Div<A, B> :
never
: never
type Res = Eval<'15 / 3'>
at compile time
idk how to make it work for non-natural numbers
you could probably do it by turning the numbers to strings
Eh, just make a meme on a light blue/white background
i wrote superhuman code by hand Pogomega
i cant find the original tweet this is the thumbnail for the tsoding stream
types should not be able to imitate values
type
script
if your language allows this syntax its a bad language
yes
unsane
i think treating types as values at compile time is a powerful tool
zig does this nicely
types being values are useful for things like this
type EnumToObject<Keys extends string[], Acc extends string[] = []> =
Keys extends [infer First extends string, ...infer Rest extends string[]]
? { [K in First]: Acc["length"] } & EnumToObject<Rest, [...Acc, First]>
: {};
type Split<T extends string, D extends string, Acc extends string[] = []> =
Trim<T> extends `${infer First}${D}${infer Rest}`
? Split<Trim<Rest>, D, [...Acc, Trim<First>]>
: [...Acc, Trim<T>]
type Whitespace = " " | "\n" | "\t";
type Trim<T extends string> =
T extends `${Whitespace}${infer R}`
? Trim<R>
: T extends `${infer R}${Whitespace}` ? Trim<R> : T;
function enu_m<T extends string>(x: T) {
return x.split('\n').filter(Boolean).reduce(
(acc, cur, i) => ({ ...acc, [cur.trim()]: i }),
{} as EnumToObject<Split<T, '\n'>>
);
}
const x = enu_m(`
First
Second
Third
Fourth
Fifth
`);
// x.Fourth: 3
console.log(x.Fourth); // 3
i just like hating on typescript
nop
type
script
can immediately tell this language was invented by microsofst
where is Eighth
they made typescript because types start with Uppercase and microsoft loves making everything uppercase
comptime glaze
i love when mobile data is 5x faster than home wifi
and 2x faster than home ethernet
and 10x more uplnk
โค๏ธ
thats what makes it great
i truly love microsoftware
I truly hate you
c# โค๏ธ โค๏ธ โค๏ธ
i love waiting 10 seconds to compile my 4 line random number generator program
you're just saying things now
no eagely just loves lowercase types he loves when linters shout at him
ocaml types are lowercase
i heavily doubt eagely has ever written ocaml lmao
rust types are lowercase until they arent
hey guys , i have many errors such as i can't open vencord installer , i can't check server permissions , in the right , the roles up of the people are invisible. is this for all or just me?
and i dont know why the installer isnt working
#๐ฅ-vencord-support-๐ฅ <--------------- you want to be here
i have nothing against uppercase types
but i do hate uppercase everything
uppercase variable names, uppercase method names, uppercase cli commands
aka everything that microsoft does
no i was too busy setting up a vm on my work laptop to not have to use windows
I dont like nixos just because every time my friends with nix have laptop at school they only configure their fucking system and never do any other work on that laptop
Like every time
No real work done
you will one day clean the house of a nix user
i am using basic distro and mostly defaults because i don't want to set things up or for things to break because i can't be bothered
@woven mesa
didn't know you could do this..
rust has the same problem you have no room to talk 
@solemn ravine i ended up taking random pure swift implementations of crypto functions etc and adapting them to work on embedded swift and now it works
idk how to do ipc
@woven mesa search works btw
they havent learned from https://en.wikipedia.org/wiki/Billion_laughs_attack
In computer security, a billion laughs attack is a type of denial-of-service (DoS) attack which is aimed at parsers of XML documents.
It is also referred to as an XML bomb or as an exponential entity expansion attack.
lmaoooo literally
yaml bomb
if you're insane you can search for specific types as well, like public.png
yay
why do you need ipc
wait is this hoisted?
can you only use pointers after they were defined?
or can u use them before they were defined
because if u can use them b4, then that means u can just create streamable JSON using YAML
aka define structure with pointers which refrerence json objects, since yaml surpports json
yaml being a superset of json is crazy
anchors cant be hoisted
they look for the most recent definition
damnnnnnnn wasted potential
pretty neat
Imagine not using Hyper-V :)
@hoary sluice true
i mean it wouldnt be too bad if this idiot formatted the code correctly
๐ญ
i fucking hate theo now
โIf you arenโt spending at least $20 a month on AI tools I donโt think you can keep up.โ ๐ค
what are you not spending at least 20 bucks a month to triple your technical debt the second you touch the code?
what kind of syntax is this
https://boxlang.ortusbooks.com/
what is this language
vibecoded language
what if a language where you can rent properties
nop
no
no, you won't be able to go back
i always use AI for only small code snippets, but im a bit scared of using it for the whole fucking project
like im sure it can do some basic html or js
but i wouldnt trust it with fucking nextjs codebase
isnt that made by m****soft
im not voluntarily using a m****soft product
RUST
But youโre already on w*ndows smh
So at that point youโre just downloading more bloat
what twitter viewer is this
nitter
also yeah i used to watch theo regularly but i feel like heโs pretty arrogant now
not voluntarily
i said voluntarily
for a reason
what reason
corporate policy
can you run a linux vm and do all your work inside it
its literally just because one of their projects is a bank and they want windows
nixOS is perfect for this!!!
there are discussions on allowing linux, a lot of people support it and are actively fighting for it but the ceo is stubborn
yes thats why im tryna set it up
why is the ceo making these kinds of decisions what ๐ญ
small company
like 50 employees
oh well good luck
Because linux desktop is unstable
And companies dont want to deal with dumb linux errors
They want an OS where everything works out of box
2/10 rage bait, makes some sense
xcancel
? this is for developers
"modern" "jvm" ok
idk bro I never use yaml I just saw funny tweet
@Composable
fun AppNavHost(navController: NavHostController = rememberNavController()) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
Log.d("AppNavHost", "Current route: ${navBackStackEntry?.destination?.route}")
val currentScreen = Screen.getScreenByClassName(navBackStackEntry?.destination?.route)
Scaffold(
modifier = Modifier.fillMaxSize()
) { innerPadding ->
NavHost(
navController = navController,
startDestination = Screen.Home,
modifier = Modifier.padding(innerPadding),
) {
composable<Screen.Home> { HomeScreen() }
composable<Screen.Search> { SearchScreen(navController = navController) }
}
}
}
@deep mulch is there any way to make the initial screen not null? like when i open my app, the it logs null
๐ญ
youre running Log on every composition before the ui draws
LaunchedEffect(navBackStackEntry) {
Log.d("AppNavHost", "Current route: ${navBackStackEntry?.destination?.route}")
}
well the thing is, i set a transition, but it skips it for the first one, like why???
https://cdn.discordapp.com/attachments/1274245018780958751/1400361919348604928/Screenrecorder-2025-07-31-08-17-43-251.mp4?ex=688c5c2b&is=688b0aab&hm=9777accf7d594292fe32ad3b1c839b1f458b8e31cf759eba7baf0eee64431672&
whats your HomeScreen function look like
markdown fail
@Composable
fun HomeScreen() {
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
) {
Text("Hello")
}
}
whats yhour bottom bar code look like
@Composable
fun BottomBar(navController: NavHostController) {
NavigationBar {
Screen.bottomNavItems.forEach { screen ->
NavigationBarItem(
icon = { Icon(painterResource(screen.icon), contentDescription = screen.label) },
label = { Text(screen.label, fontFamily = FontFamily.Default) },
selected = navController.getCurrentScreen() == screen,
onClick = {
navController.navigate(screen) {
popUpTo(navController.graph.startDestinationId) {
saveState = true
}
launchSingleTop = true
restoreState = true
}
}
)
}
}
}
i dont think youre navigating correctly
๐ค
uh
if its just laggy then thats cause emulator slow
or debug
or youre doing computation on ui thread
no but the animation is skipped entirely on the firest screen
as seen in the video
anyways the navigation code is from google docs
try just navController.navigate(screen)
hmm still, well it doesnt matter that much
ai is the future
(this literally just produces number for every tuple type passed in)

googled so many things, asked duck.ai so many questions
matt pocock saves the day as always
https://www.linkedin.com/posts/mapocock_parseint-on-the-type-level-in-typescript-activity-7141048747689500673-Jnxa
(though perplexity did make use of this in its solution i didn't want to use ai code)
He should totally update his reset-ts library to include the new iterator methods frfr
(I tried modifying the IteratorObject's type definitions myself but gave up cuz it somehow fucked up jsx types)
this is so good
does this look vibecoded... (I didn't even use the ai code as it was bad and that's no fun)
this is the best thing ever
you can't refactor the enum names
but who cares
i wish you could iterate over an object's properties with an index in the type system
it's basically a string enum but single constants can be represented by multiple values and strings are turned into numbers
if you mean like ProperyName<Person, 1> where Person is {age: number, name: string, skills: Array<string>} (and you expect result to be 'name') then sure if there's something that allows to index an union type
i wanted to convert
{
Red: ["red", "rouge"],
Green: ["green", "vert"],
}
to
{
Red: 0,
Green: 1
}
hello progamers
Hello
what does your nav host component look like?
@frosty obsidian hi
without the added context thats actually really funny
i never liked PHP (the language)
was always a TypeScript kinda guy
@neon bear
PHP is and always will be my comfort language
PHP and typescript shouldn't really be compared imho
for backends
thats what i meant xd
i would rather compare it to python, even then
it's not really a fair comparison
Anyways, the changes to PHP in the last few years have been game changing for most people
personally, I liked PHP because it was weakly typed
but now everything can be typed
honestly i'm just not really the guy for the syntax in my honest opinion its too unfamiliar for me
fair 
I never liked JS or any of the variations
ah so we are basically the opposite haha
so i understand
yeee
I started out like
retheming websites for people on HF
generally just swapping from one bootstrap dashboard to another, about 90% of the time.
~2015 through 2018, everything I touched off HF related to web stuff was PHP.
yeah
PHP just became my go-to for everything
then after "the incident", argument with someone who was glazing python hard
I doubled down, anything where I could've used python
I used PHP instead
:')
i originally used svelte actually for some small projects when i started out so that gave me some experience before i actually just moved on to react, and eventually nextjs
so i was always kinda rooted in a typescript environment
and i've used php in some minor instances and i know how to somewhat interpret it in my brain
oh xdd
i've honestly never liked vue

