#πͺ -progaming
1 messages Β· Page 115 of 1
https://www.youtube.com/watch?v=FdMh0TN6SlA @nimble bone
Website: https://www.mikekohn.net/micro/sega_genesis_java.php
This is a graphics and sound demo I wrote in Java, compiled it with javac, and further compiled it into native code using Java Grinder so it runs on a Sega Genesis (Sega Mega Drive) emulator.
For more information including source code and a video of the demo running on a real Sega G...
java is everywhere
agreed
it's way better than not having it
but it's still running a horrific version of opengl
guh i wanna try and learn typst so much but i have no idea what i can use it for
what kind of assignments
cuz here we only get homework and it's basically do N tasks from the book and write it down to copybooks
have you seen my programming language with japanese syntax
i mean i have seen it but not like i could understand anything :isob:
ι’ζ°γγγͺγ³γζ΄ζ°οΌζ΄ζ°γxοΌγ
γγͺγ³γοΌγ%d\nγγxοΌγ
γ
ι’ζ°γγ‘γ€γ³οΌοΌγ
ζ΄ζ°γx οΌγ1οΌ2οΌ3γΌ4γ
γγͺγ³γζ΄ζ°οΌxοΌ3γΌ4γ»3οΌ
7οΌγ
γ
thats one of my school assignments
im writing a dissertation on the implementation of it
in typst
put it into google translate
it makes a surprisingly readable piece of code
-# <:i:1323844562875187291> Translated from π―π΅ Japanese to πΊπΈ English β’ Google Translate
Function Print Integer(Integer x) `
Print("%d\n", x).
Function Main() `
Integer x = 1 + 2 * 3 - 4.
Print Integer(x * 3 - 4 3% 7).
well i kinda do have an assignment i can use typst for but uhh
so basically one of the bonus homework we got was to make a text/slideshow/whatever about the difference between euler diagrams and venn diagrams
but uh
apparently its like
which is kinda too small to use typst for
like idk what i can say about it more
idk
i can show you what a typst document looks like if you want
so you can get a feel for what you can do
theyre not
oh
i put .ts for the syntax highlighting
oh ic
i think if i made .typ it wouldnt even embed a preview
for the record you wont be able to compile this into a pdf because you dont have the corresponding references and text files
but yeah
dude i hate discord why does syntax highlighting just stop working when i open the code in fullscreen
yeah </3333
i just find typst kinda cool for quickly writing some math
seems much easier than latex
but yeah i really need to find a good task i can do with it
can u easily print typst docs
oh okay i might try to use it for my annual school project
i have no idea what theme ill choose though
idek if it will be math/cs related
god im going feral
there are plugins for all kinds of shit
like organic chemistry and fundamental particles
and a bunch of other stuff
our like head teaches told me i should try making an english class school project but like i have no idea what kind of project i can make π
it sounds so boring like what can i say about english
im still figuring this stuff out
does this look good to use for my aiohttp bs
AUTHORIZATION = {
"website": {
"BaseURL": "placeholder",
"Headers" : {
"Authorization": "Basic " + base64.b64encode(f"{os.getenv('placeholder')}:{os.getenv('placeholder')}".encode()).decode(),
"User-Agent": "placeholder"
}
},
"website2": {
"BaseURL": "placeholder",
"Auth": {
"user_id": os.getenv('placeholder'),
"api_key": os.getenv('placeholder')
}
}
}
API_HANDLING = {
"website": {
"method": "GET",
"endpoint": "/posts.json",
"params_type": "query",
"response_format": "json"
},
"website2": {
"method": "GET",
"endpoint": "/index.php",
"params_type": "query",
"response_format": "xml"
}
}
horror
in my lexer 5..myVar and 5 .. myVar is outputs different tokens
Type Lexeme Data
float 5. 5.000000
dot .
symbol myVar
int 5 5
dot-dot ..
symbol myVar
it thinks the former is accessing myVar as a property of 5. and the latter is concatenating 5 and myVar
i should not support trailing decimal
Do you have a separate concatenation operator
yeah
Okay here is a lesson in language design: explain your reasoning behind adding a concat operator and why you are not just using addition
so that it's clear what you're doing
it's a dynamically typed language :p
easy solution is to just require 5.0
and not allow 5. as a shorthand
(you can just do 5f)
im just trying to get you to think about the things you add :^) why have a concat operator?
isn't this clearer
print("1 + 1 is " .. 1 + 1)
then again it probably won't support auto conversion
i suppose with strict enough rules it's not really needed
it would come more handy in js where things make no sense 
i mean there is logic to it but it's confusing

in elle, strings are aliases to char *. a + b adds b to the pointer (which may be an offset in chars). a <> b concatenates the 2 strings
its nicer than making + concat and being forced to do #cast(void *, a) + b)
the humble !=..
lua core
adding strings with + feels so cursed...
i've been doing too much c
and using strcat and snprintf
probably best to limit the amount of syntax
iirc go has that?
in elle to do this its probably even more cursed lol
if the type youre trying to concat isnt a string, you have to:
foo <> "{}".format(bar);
or
"{}{}".format(foo, bar);
``` its kinda fucked
i think i will just have a format function instead of f strings
yeah no i have that too
i planned f strings too π
i think i will have a load of useful global functions
hmmm
i don't think i want to support static methods anyway
i would like format("hello {}", name) or format("hello %s", name) best
why are you huskin g i don't want to make java
public static volatile transient final booolean;
you know lua has namespaces right
aren't they just tables
well yeah i guess
Foo = Foo or {}
function Foo.bar(a, b)
return a + b
end
print(Foo.bar(1, 2))
is transient even valid on a static field
i don't know
it's been a while since i did java for real
iirc some of the access modifiers are encoded the same and just treated differently for different member types
./run
public class Main {
public static volatile transient final String foo;
static {
Main.foo = "bar";
}
public static void main(String[] args) {
System.out.println(Main.foo);
}
}
@jade stone I only received java(15.0.2) error output
file0.code.java:2: error: illegal combination of modifiers: final and volatile
public static volatile transient final String foo;
^
file0.code.java:4: error: cannot assign a value to final variable foo
Main.foo = "bar";
^
2 errors
error: compilation failed
./run
public class Main {
public static volatile transient final String foo = "bar";
public static void main(String[] args) {
System.out.println(Main.foo);
}
}
@jade stone I only received java(15.0.2) error output
file0.code.java:2: error: illegal combination of modifiers: final and volatile
public static volatile transient final String foo = "bar";
^
1 error
error: compilation failed
./run
public class Main {
public static volatile transient String foo = "bar";
public static void main(String[] args) {
System.out.println(Main.foo);
}
}
Here is your java(15.0.2) output @jade stone
bar
bar
i will copy META-INF/MANIFEST.MF
mfing manifest
i made a dumb mistake (first time doing recursive descent)
it's not very recursive
bnf really helps me understand what is going on
are you hand rolling your parser
yeah
is it weird to have an expression for unary +
oh wait
i guess types could overload unary + maybe
but it would be kind of bad practice to make it return anything other than itself
i don't want coercion in the core lib
i simply have it for the symmetry with unary minus tbh
unary minus acts like a mul by -1, unary plus acts like a mul by 1
i think i've only ever used unary + in c++ to convert capture-less lambda to function pointer

why husk
./run
console.log('test')
Here is your js(18.15.0) output @paper path
test
does clang format not allow you to align struct members

oh it does
but you can't exclude functions
or local variables
horrible font
i didn't fall in love with any vector fonts so i used a bitmap one
well really just a ttf port of a bitmap font with antialiasing disabled
it's nicer to read
more sharp
without looking strange like cleartype
sorry
This reminds me of some other Google projects that spawn like 400 thread because they thought that giving each thread its own dedicated function and using channels as communication was smart
finally
i think i will skip doing a tree-walk interpreter and go straight to bytecode because it feels more interesting
The Underhanded C Contest was a programming contest to turn out code that is malicious, but passes a rigorous inspection, and looks like an honest mistake even if discovered. The contest rules define a task, and a malicious component. Entries must perform the task in a malicious manner as defined by the contest, and hide the malice. Contestants ...

sounds like just programming in C as a contest βββββββββ
Thats a really cool idea actually
Wonder why it stopped
people were getting too good at it...
if this was still going jia tan would probably get first place
i have an idea
linux++
linux but c++
torvalds is having a heart attack
Well canβt get any worse than Linux so not sure what Linux++ would really do
the true linux++ was macos all along
insane @crude star
This feature is experimental and is subject to change. Disable it by passing --no-experimental-strip-types CLI flag.
insane that they shipped an experimental feature as default
they support enums and other special ts syntax with --experimental-transform-types
INSANE
.npmrc:
node-options = "--disable-warning=ExperimentalWarning --experimental-transform-types"
skull issues?
the only annoying part is that you need to import files with .ts extension
node try not to ruin a cool feature challenge (impossible)
% time tsx -p 0
0
tsx -p 0 0.56s user 0.11s system 147% cpu 0.453 total
% time node -p 0
0
node -p 0 0.03s user 0.02s system 100% cpu 0.047 total
100ms
i cant wait that long
INSANE
(the actual problem is that they use --keep-names which for some reason causes my code to slow down)
i forgot why
make ur own tsx
i mean with this feature the only thing you need to do is add a module resolver
for extensionless
making soon
are we fileshaming now
(you have very limited "premium requests" so you cant main sonnet)
it's not that limited tbh, I used them quite a bit last month and didn't really use that much
sadan and vee being ai bros is to be expectedβ¦..
oh mb
husking instantly at the same time.. the deep state is against me
grok so good
isn't grock just a chat gpt wrapper
grok is like chatgpt but racist
LOOOL
no
yea with fascist prompt
tsserver try to autocomplete symbols property challenge (impossible)
this is the second issue i've reported on this
simply dont use symbols
@haughty socket guh
just typescript parse time
odd symbols work fine for me
soo handy
i forgot
use that
its good
oh, this looks like a neat API, i wonder why it isn't showing up in typescript

ill enjoy using it in three years
polyfills my belove
Ponyfill for upcoming Element.scrollIntoView() APIs like scrollMode: if-needed, behavior: smooth and block: center. Latest version: 3.1.0, last published: 2 years ago. Start using scroll-into-view-if-needed in your project by running npm i scroll-into-view-if-needed. There are 992 other projects in the npm registry using scroll-into-view-if-ne...
vencord uses rspack soon
naaaaah
I will never stop using esbuild
I love esbuild for its simplicity
vite 
I used rollup and disliked it
i really don't understand webpack and such
like it kinda makes sense having dynamic modules, but if they all get packed in the same chunk then..???
elaborate?
doesn't vite just use rollup as a backend 
why not just compile like esbuild does
girl wdym
yeah
using vite for a Discord bot is crazy
afaik it's a bit weird on node tho
but you could just use tsc
hold on, give me a few minutes to compile
isn't it like 10x or smth like that
btw how is typescript in node implemented? @crude star if you know
like what parser does it use
does it use tsc and be slooow
yeah i heard that name
ducko wrote
no i made that up
wtf its swc
oh, it uses swc wasm build
technically i do.... i have my bot as a workspace package which i install into my dashboard app written in nuxt, as a nuxt server plugin

wtf does this mean, its regular uint8_t 
that sounds utterly insane
is it because of constness?
oh yea im dumb af i put const on the struct variable that the field is defined in 
no it's completely fine, actually
i can run my bot standalone without the dashboard
doing this also gives me free access to everything from oceanic
@robust jackal
I think at some point i should stop and ask myself why
func progressCallbackCFunction(current, total C.int64_t, ptr *C.void) {
ptrInt := int64(*((*C.int64_t)(unsafe.Pointer(&ptr))))
}
why is ferris portrayed as seething, he looks enthusiastic about sharing knowledge
Does Vencord, discord servers allow you to create RTC and other connections?
For example, only for sound, and work on the basis of streaming, but for sound?
i love compose
sane
do this for rini native @crude star
@haughty socket
HOLY ABOMINATION
There's no way that's necessary
But I can't prove it
bro elysia is probably the most overengineered framework it absolutely is necessary
That covid pandemic format
@royal nymph adding π§ to all my vencord prs
the emojis are evil
It's scaring me
I never tried elysia I just follow aom cause hes cute
conventional commits but with emojis bc mentally im a 5 year old
i think this was the most insane type i ever wrote
type IsNever<T> = [T] extends [never] ? true : false;
type AssertedType<T extends Function, E = any> = T extends (
a: any
) => a is infer R
? R extends E
? R
: never
: never;
export function findParrent<
T extends Node = never,
F extends Function = never,
R extends Node = AssertedType<F, Node>,
>(
node: Node,
func: IsNever<T> extends true
? F extends (a: Node) => a is IsNever<T> extends true ? R : T
? F
: never
: (a: any) => a is IsNever<T> extends true ? R : T
): IsNever<T> extends true ? R | undefined : T | undefined {
while (!func(node)) {
if (!node.parent) return undefined;
node = node.parent;
}
return node;
}
ooo pretty picture π€€ π€€
but i'm really stupid so it can be done like this instead
https://github.com/sadan4/VencordCompanion/blob/main/packages/ast-parser/src/types.ts#L6-L18
is that array really needed in isnever
they aren't even consistent with it
they use docs and doc
sometimes they use pencil and paper emoji and sometimes its a book
oh, yes
it's the only way to tell if something is never
bro had a front row seat
Does never extends T not work
iirc no
Not a type
is never the nan of typescript
NaT
as in nan != nan
I always just refer to this
yeah its pretty bad when you need a table like that
glad my language is more sane in that regard
you never use that
Yeah, but can your generics parse JSON and play Doom
I usually just refer to this:
||
thing as any
||
My edge case
you really don't
no its sane and has a very extendable library for that
Black bar my beloved
Top left
I tried clicking on it
Didn't work
Discord mobile has no bugs
Clock on the top left
Are you on Alibabacord
obviously
thanks i didn't know what time it was and really wanted to know
It updated 2 days ago
Tbh my phone felt pretty sluggish during the QPR
you mean right now?
Less now
yeah its not in beta anymore
But it was pretty bad a bit ago
I only have bug fix available
breaking news: betas tend to be worse in performance
qpr1 should be released
idk why you're not getting it
Pre cache companion where I calculated 1.5mb of cacheable data every load
i accidentally stayed on the beta program so now im stuck on qpr2 beta release that added annoying pip bug
It took me like 6 months to implement caching because i am lazy
horror
not exactly programming, but does anyone know how to add something to the main windows 11 context menu (1) instead of the more options version (2)?
I kind of want to remove edit in notepad and notepad++, and add edit with vscodium there
I haven't been able to find anything online
guys im looking for a frontend stack which is not nextjs but is react, any tips? like so far tanstack router with vite was my option, but ill take any recommendations
afaik the βmore option context menuβ uses registry to add actions to it, so id assume the simplified windows 11 version uses it as well. what i would do is open regedit and try to search for Edit with Notepad++
you canβt
tbh just disable the new menu it sucks
vencord will have soon
how
tanstack router with vite is tanstack start, and then there's react router and waku
otherwise, you can assemble the tanstack pieces yourself, or you use wouter for routing and other things
im looking at waku and it actually looks very nice
I like it
ditch react and switch to Compose for Web obv /s
no results for Edit With Notepad++
I thought this was what was adding it, idk though. when I removed it, it didn't disappear, but maybe it needs a computer restart for some reason
latter
Channel desc says so
doesn't that ship skia as wasm and render to a canvas
<10MB on a website I use it for
yes
oh and this also includes embedded ffmpeg
what site
one that I cant share because of nintendo ninjas
downside: you have to use JS
Why is the smallest file bigger when gzipped
similar to how encoding a as base64 gives YQ==
it becomes bigger instead of smaller

π
encoding anything in b64 will by definition make it bigger
it encodes 3 bytes into 4 chars
shhh you get the idea
only?
i assume that's not all code you wrote

should this be safe to do
no dont dualboot windows and linux on same disk
that's not supported by Windows itself
its all fun and games till Windows' updates (or bootloader) overwrite grub (or vice versa)
no, the main deps i use are classnames, react, react-dom, react-router, tailwindcss, react-spring, and zustand
what the fuck is in there
my entire app is fucking 1MB
w/o assets
2MB with C code compiled to JS via WASM2JS
XD
you mean the 1mb one
it's all of discord's intl keys
we need to make satan stop using react
what if we make satan use react
then tell all react devs they're doing what satan wants them to do
then they'll stop using JS
TRUE
Bro doesnβt know
?
nina #1 react shill
yes
but also wouldnt I have been 12 years late
programming languages derived from historic religious figures
No
but react was released 12 years ago so wouldn't satan have used it back then already
12 years late would be lizard people, not satanic, satanic takes a while to get on new tech
why are we even having this discussion satan isnt real
satan is real
@jade stone?
@jade stone ?
ive created a list of plugin ideas, is there any that u guys would object to? or say i shudnt bother with?
Just wrap the link in <>
<C:\Users\lando's pc\Documents\VAULT\Collection of Pictures>
oh shit that sorta works thanks
I guess, but I meant for the one that involves links
why does you keyboard have an osu skin
affection addiction, peak spotted
insane
tsserver insane
proposing making fn it == y as shorthand for fn(x) x == y
opinions??
while server.is_err_and(fn(err) err == Errno::EADDRINUSE) {
server = TcpServer::bind(port += 1);
}
shorthand
while server.is_err_and(fn it == Errno::EADDRINUSE) {
server = TcpServer::bind(port += 1);
}
that is batshit insane
this would come with a foreach shorthand too
for <expr> {
$dbg(it);
}
as a shorthand for
for x in <expr> {
$dbg(x);
}
just use kotlin already
It being a keyword here only valid in the for scope? Like a this for objects in OOP?
This feels like delving into function and also unreadable insanity
it's not a keyword
for 0..10 {
$dbg(it);
}
is shorthand for
for it in 0..10 {
$dbg(it);
}
there's no special case fuckery, it just automatically declares a variable for you if you don't give it a name yourself
Yes in the first one where is it being defined as the variable
yeah
oh what
that was a question
the first one is semantically equivalent to the second one
i'm not sure what you mean by where
Yes but where in for 0..1 do you define IT being the value
you don't
^^^ it's implicit
So itβs a keyword
unless you do for x in y in which case x will be the name
doesn't have to be
no lol
the first one basically creates the second one
it's syntax sugar
it would be a keyword if it had some special binding or special meaning but it's just the default name for the variable in the foreach unless you specify one yourself
basically if you don't add the ... foo in ... part, it will assume you want ... it in ...
Whatβs the benefit of this
Apart it not being clear (I guess the benefit is confusing people new to the language?)
very often i just wanna iterate values of something which is iterable and i don't wanna come up with a name for the element lol
kotlin has it
and jai
I think itβs potentially very misleading f
and odin (iirc)
those are not real languages sorry
i'm pretty sure swift also has it
just type a random letter guh
oh yeah
usually i use x
and it's annoying
i think scala uses _ instead of it?
ugly
yeah i don't like that either
the only other one i would consider is $ but that's out of the question because that's the alias to create tuples
tuple.le: Lines 25-29
fn Tuple::new<T, U>(T x, U y) -> (T, U) {
return Tuple { x = x, y = y };
}
external fn Tuple::new<T, U>(T x, U y) @alias($) -> (T, U);
why are tuples limited to 2 elements π π π π
triple.le: Lines 32-36
fn Triple::new<T, U, V>(T x, U y, V z) -> Triple<T, U, V> {
return Triple { x = x, y = y, z = z };
}
external fn Triple::new<T, U, V>(T x, U y, V z) @alias($$) -> Triple<T, U, V>;
any more and you might aswell just use a struct tbh
horror
@crude star@valid jetty hiiii
yop
Pair<T, U> and Polycule<T, U, V>
why
it's fine because most of the time you won't even see the name of the tuple type
there is a type alias of (T, U) to Tuple<T, U>
unusable language
elle syntax evil
steal julia pairs a => b
actually very usable
or kotlin a to b
i'm writing all of my school projects in it and it's more pleasant than c#
well anything more pleasant than C#
im writing all my school projects in riniscript and its more pleasant than malbolge
@deep mulch
hiiiii
Malbolge was very difficult to understand when it arrived, taking two years for the first Malbolge program to appear. The author himself has never written a Malbolge program. The first program was not written by a human being; it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.
this is elle
this is the rini
wtf are you formatting
if i ever implement infix functions i deffo wanna have this, yes
would make
$map(
$("a", 1),
$("b", 2),
$("c", 3),
);
into
$map(
"a" to 1,
"b" to 2,
"c" to 3
);
i also wanted to fix that fucked up array init syntax
[i32; 1, 2, 3];
into
[1, 2, 3]i32;
or
[Note;];
into
[]Note;
x := []Note;
GUH
20mb file with ~400 lines
edit: 30 lines
wdym guh
which part is guh
is the new syntax guh or the old syntax or what
π
both
what do you propose instead
i kinda like the 2nd one, it makes some symmetry between the value and the type
the type is Note[], the value is []Note
the js formatter i use can do it in ~10s (my guess from watching it, not an actual time)
but it's not perfect
waiting on that 
What it does have π
use js-beautify
371.4m downloads per week is insane https://www.bleepingcomputer.com/news/security/hackers-hijack-npm-packages-with-2-billion-weekly-downloads-in-supply-chain-attack/
it uses nothing
node runs typescript directly now
no
use relative imports
you can assign them in package.json
"imports": {
"#framework": { "types": "./src/framework/index.ts", "default": "./src/framework/index.ts"
}
},
here you go
Entries in the imports field must be strings starting with #.
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"strict": true,
"verbatimModuleSyntax": true,
"module": "nodenext",
"moduleResolution": "nodenext",
"noEmit": true,
"target": "esnext"
}
}
my paige is so useless
tbh
dont use tsx
why do you need
tsx is not supported by node
jsx components v2
so baddd
my paige is so dumb man
paige is not dumb at all
just a bit frustrated...
wait are you using oceanic?
It's because oceanic.js is still on cjs, and it's not mixing well
I fixed it by downgrading tsx but well you could probably enable the cjs typescript flags
horror
node --disable-warning=ExperimentalWarning --experimental-transform-types src/index.ts
just works
never using anything else now (lie)
Version is tsx@4.7.0
esbuild src/index.ts --bundle --platform=node --format=esm --sourcemap=inline | node --enable-source-maps -
are you filesystem loading
jiti also works? im getting a different error but feel free to try
you need to define jsxFactory
in tsconfig
i think ur using venbot cv2 code but look into its tsconfig
esbuild based iirc
no it's using babel
yes it just basically compiles with esbuild's transform api and then sends it to node
then its in build.mjs
use my shitty replacement https://github.com/rniii/tetris-vendor/blob/main/src/commands/tetris.ts#L69-L87
tetris.ts: Lines 69-87
ActionRow([
TextButton("swap", {
style: ButtonStyles.SECONDARY,
emoji: { name: "π" },
}),
TextButton("hard-drop", {
style: ButtonStyles.SECONDARY,
emoji: { name: "β¬" },
}),
TextButton("none1", {
style: ButtonStyles.SECONDARY,
label: "\u200b",
disabled: true,
}),
TextButton("rotate-left", {
style: ButtonStyles.SECONDARY,
emoji: { name: "βͺοΈ" },
}),
]),
@young flicker
dude just ```ts
const TextDisplay = (content: string): TextDisplayComponent => ({
type: ComponentTypes.TEXT_DISPLAY,
content,
});
my math prof used maple mono on her slides
@young flicker you still want it?
FLUTTER
just import runtime somewhere and make them global functions
and set jsxFactory and jsxFragment in your tsconfig
should work
actually
node doesn't support it probably


I am going to go insane
hi
goat bro thanks
this is prolly a bad time for me to make vencord plugins today
thanks ddos
I take it back @lavish frigate the devil does use react
β€οΈ
wtf lmaoo
did you not even look at the preview in obs
sadan ignoring 2/3rds of the screen
default i think
it came with the kde that i installed
_makePanel.nix: Lines 18-31
{
alignment = "left";
widgets = [
{
kicker = {
icon = "nix-snowflake-white";
};
}
{
appMenu = {
};
}
];
}
RECORDED THE WRONG MONITOR award
no i just mean the widget (or w/e kde calls them) comes preinstalled
global menu is included by default you just have to add it to a panel yourself
HLJS supports nix
Something shat itself
React is not defined
define it??
half life js
@jade stone loves vue
vue is so evil i'm learning next.js
have fun
https://mk.absturztau.be/notes/aceuesggkv4j05ck
so like whats the compromised package here?
color-name but it seems it already got reverted
Is this an help channel?
π #π₯-vencord-support-π₯
(Auto-response invoked by @pseudo sierra)
v
seriously how is this ever undefined
this has to be a problem with the minifier right?
when registerContext gets imported shouldn't that contexts variable be initialized?
idgi
what bundler are you using
rolldown
What blunder are you using
its undefined if the function gets called before that line
registerContext(whatever);
const contexts = new Set();
@crude star
a bunch
t
this is how the error occurs
but it should be fine no??
wait
I get it
I think where it sets contexts here should be at the top
how do I even fix that π
I think it's circular import bc context imports plugins set from plugin and then plugin imports registerContext from context
which is usually fine I think but bc the set gets defined at the bottom of those init things it BREAKS
@lyric latch ik u use rolldown do u have this issue too or naw
yeah but init_plugin also calls init_context
yeah
how do I even fix this tho
π
yea that's what I was doing before but eh
is it acceptable
to have like
a registry.ts file
where I have the contexts set and the plugins set and whatever else

ohhhhhhhhhhhhhhhhhhhhhhh
wait that makes sm sense

thx goat
it works!
@lyric latch do you know why this happens
lol
https://github.com/rolldown/rolldown/issues/4934 smth similar ig but not fully
also it's already closed
maybe people should avoid using too many libraries
reinventing the wheel can have advantages
of course you need to use some its just sometimes ridiculous
No I think this is fine
use libraries for things which are actually hard
No purposefully use libraries which got hacked
there's just one problem with that
In case you didnβt get it all of these were under the latest supply chain attack
yeah that's the point people should avoid using too many libraries
it increases the probabability of being affected by some kind of attack
probababilitiy
Most people donβt use any of these directly but they are part of some larger framework which people do use
framework authors are people too
I donβt think so
I actually think they are plue

Actually I think people should get more into assembly making an 6502 emulator has been quite fun
i made one too but had no idea how to test it without attaching a display

i guess it is doable to use nes test rom without ppu
also 6502 isn't just nes specific
Someone made an amazing guide which also includes test roms with the goal of running super Mario
I can send it later Iβm outside rn
outside? with your laptop?
No Iβm sending this on my phone in car rides the pic I sent was from yesterday
how does anyone ever go outside with their laptop??
(sorry i just found it funny to say this because of a conversation i had with some other people)
on patreon but its a free post
and in case you dont want to actually read this the test roms are at the very bottom
the roms
i prefer to work things out without tutorials
im deviating extremely from the tutorial because the tutorial is extremely basic
but the tutorial contains a lot of small stuff you can easily overlook
like you cant tell me you can find out yourself that the nes decrements the stack by 3 on startup????
did you see some of his youtube videos
really good


bitpacking makes me go fucking insane
37%
37% for 10 bit values and 25% for 12 bit
and for anything larger than a few thousand samples it runs at GIGABYTES a second single threaded
scary
C++ has it too https://en.cppreference.com/w/cpp/utility/any.html
i want to scrape a website but its protected by CF check, is there any way to bypass it?
Literally the whole point of CF is to stop people like you
i know, i just want my train data 
headless Chrome unfortunately
like puppeteer?
yeah or playwright
but it seems like the check screen appears always, even if i open it on firefox, i get the CF check screen
tried to use puppeteer but cloudflare still blocked it
flaresolverr 

he contributes to rust itself and owns syn, thats why probably
plus serde
im using anyhow, syn, cargo-expand, and proc-marco2 directly
its pretty much the same for old nodejs
who knows what else transitively
how is this still not a thing
insane
Alright @dense sand, in 5 hours, 20 minutes and 1 second: arch linux presentation
guhh why is there no method to get T or E from Result<T, E> where T and E implement a common trait
What type would that method return?
Sure
then that
But that's one type, not two
Box<dyn T>
Can't be generic over traits though
You could certainly have a fn either(&self) -> &dyn Debug where T: Debug, E: Debug
can you make a macro that does basically
if let Ok(v) = x { v as impl T } else { x.unwrap_err() as impl T }
i'm typing on my phone and can't test any of this
if it seems like garbage, it is
No, both if branches have to have the same type
hmmmm
i see
i think you can only return impl in function signatures
well yeah but the macro wouldn't have an explicit return type
i don't remember how you cast an rval to a particular trait to perform specifically that trait's methods
You can Debug::fmt(&foo)
boxed dyn
because foo.bar() is ambiguous there was some way to call bar on the right trait without Foo::bar(&foo)
i don't remember what the syntax is tho
i don't think that's a thing
you don't have to box
you can just as &dyn T
hopefully the optimizer will refrain from creating a vtable
/run ```rs
trait T {}
struct A {}
struct B {}
impl T for A {}
impl T for B {}
fn foo(x: bool) -> impl T {
if x {
A {}
} else {
B {}
}
}
@crude star I received rs(1.68.2) compile errors
error[E0308]: `βif`β and `βelse`β have incompatible types
--> file0.code:12:5
|
9 | / if x {
10 | | A {}
| | ---- expected because of this
11 | | } else {
12 | | B {}
| | ^^^^ expected struct `βA`β, found struct `βB`β
13 | | }
| |___- `βif`β and `βelse`β have incompatible types
|
help: you could change the return type to be a boxed trait object
|
8 | fn foo(x: bool) -> Box<dyn T> {
| ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
10 ~ Box::new(A {})
11 | } else {
12 ~ Box::new(B {})
|
error: aborting due to previous error
For more information about this error, try `βrustc --explain E0308`β.
chmod: cannot access 'binary': No such file or directory
error[E0308]: `βif`β and `βelse`β have incompatible types
--> file0.code:12:5
|```

i didn't understand a single word of this other than "advent of code"
implemented all official 6502 instructions now, in the RAM you can see (in order) Fibonacci, Hello World, 0 - 16, and some test bytes
wtf is this
arch linux presentation
@dense sand, <t:1757515199:R>: arch linux presentation

πͺ
nyaa~
rust macros my beloved
@jade stone next_sadan
better image
tf
LMAO
have an appetite for c++ again π but i think i want to avoid iostream this time
and write it more like c
is this weird
no
i feel an urge to write pre c++11

but it's probably not that pleasant
idk i just want to return pointers from things
and basically write c with classes
and have wanted to for a while
i imagine c++11 irons out some quirks
and has some things that i would otherwise need to implement myself for no good reason
basically forget about lambdas or any metaprogramming if you don't want it to be painful
that or use a LOT of boost
i think it's the metapgoramming that turns me off c++ sometimes
i used to use boost::bind and boost::function so much
i've tried c many times but it always feels like well... c++ is basically just c without handicaps.. right
the real problem with c++ is it's a slippery slope
what do you mean? hides her c++26 codebase under the table
i think c is an impressive language considering it often makes modern languages look dumb with the way they do things
C:
struct Person {
const char *name;
int age;
}
Java (before records):
(give me a second)
public class Person {
private String name;
private int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
@Override
public boolean equals(Person other) {
if (this == other)
return true;
if (other.getClass() != Person.class)
return false;
return Object.equals(this.name, other.name) && this.age == other.age;
}
@Override
public int hashCode() {
return Objects.hash(this.name, this.age);
}
}
OK OK, c doesn't give you equals and hashCode for free either
but if you don't implement them in java right away you might be in for some surprises, because every object has these methods with default behaviour if you don't specify your own
You don't have to make them private in Java
string_view
string views are far too handy - i implemented them while making a c interpreter
for the lexer
You know you can do this in c too right?
Many apis do it as well
true
opaque pointesr
it's just this... at least at one point was like the default way of doing things
using opaque pointer/pimnpl outside of a library would be a bit weird?
Hidden state is common to do all the time in c libs
C libs do exactly what youβre complaining about that Java does
i never fucking understood why people are so adamant on encapsulation
especially when you define a setter
like why define a setter and getter at all just make the field public
Itβs common at least in Java or some other oop languages because there is implicit logic that is ran when state is updated
Letβs say for example we have a vector class.
The could for example just change the int that says how long the memory allocation is to whatever we want.
Instead we have a .set() or .reserve() that implicitly calls Malloc or whatever we use
Or you trust the user to manage our state
And the end user will never do it correctly.
C is amazing in its simplicity but it does not stop you from blowing your whole god damn foot off
If anything with asinine things like inconsistent implementations of strings itβs very easy to do so
lol yeah i don't think getters are bad in all situations
i don't think joining together two strings is that much harder than c++ but i can see why a beginner would struggle
char *dup_n_cat(char *a, char *b) {
char *new = malloc(strlen(a) + strlen(b) + 1);
strcpy(new, a);
strcat(new, b);
return new;
}
this is... correct... right..? π
c strings are also not that efficient though
strcat is iterating the string again for the null terminator
Yes, or you get a uint8_t/char array with a size_t to use
The fact it isnβt even standardized
Oh also you forgot to free the first two strings. Or did you not pass ownership of it?
Is the string from a lib and it owns it and if you rub a deconstruct or later it will free an invalid pointer and crash?
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
char *__nstrcat(char *strings[], int n) {
size_t sizes[n];
size_t length = 0;
for (size_t i = 0; i < n; ++i) {
sizes[i] = strlen(strings[i]);
length += sizes[i];
}
char *result = malloc(sizeof(char) * (length + 1));
size_t index = 0;
for (size_t i = 0; i < n; ++i) {
char *current = strings[i];
for (size_t j = 0; j < sizes[i]; ++j) {
result[index] = current[j];
index += 1;
}
}
result[index] = '\0';
return result;
}
#define nstrcat(...) __nstrcat((char *[]){ __VA_ARGS__ }, sizeof((char *[]){ __VA_ARGS__ }) / sizeof(char *))
int main() {
char *res = nstrcat("a", "foo", "..mroww", "\n");
printf(res);
return 0;
}
anilist
as all other anime metadata in the app
well.. for the most part
I've never seen the relations visualized through a graph automatically (ik that people usually make these graphs by hand) so I was wondering if there's like an endpoint that returns all related anime, or do you like have to recursively fetch everything
GraphQL π
their gql server shits itself after 3 recursions
so i need to run multiple queries
abd de-duplicate
π
dude URQL is fucking INSANE
automatic entity normalized offline caching its nuts
i just run a query, and URQL goes "ah, I've seen that one before" and resolves the query based on the data in your cache without needing to run network requests
like what???
recrusiverelations <3
you dont want to know what kind of mental state i was cooking this in
i think i was up at 4am today coding it
cuz i couldnt sleep
so i forced myself to code
huh... why would you free some strings passed to you
i just had a strange thought
i feel like i might end up writing a c++ projcet without using stdc++ at all
if you use new i assume you need it at runtime though?
"vector is too annoying to use, i'll just use malloc and realloc"
i am basically writing legacy c++
in 2025
Thatβs just how some of them be
For example ffmpeg will return a char ptr of the string name of a pixel format if you pass the enum value
But never actually clarifies if for example if itβs a static const global or a copy you must free
Because the pointer and ownership is passed to you
it's probably returning literals
It is but the api isnβt very clear on it
c doesn't really have a concept of ownership
yeah but you can't assume everything a function returns to you now belongs to you
