#🪅-progaming
1 messages · Page 108 of 1
no
it takes so long to compile because rust has 1 billion zero cost abstractions, which means traits and templating of generics
generic deduction is a very slow algorithm (i believe exponential) and rust does so much fucking templating on top of templating that compile times are driven through the roof
which is also why big rust libraries take so long to compile, because they also do a shit ton of templating
thats also the main reason zig takes 15 seconds to produce a hello world on my machine
generics are extremely slow to compute
elle doesnt take very long because i dont compute many generics, if i did, it would also be extremely slow
A lot of compiler stuff has dragon theme for some reason
The Dragon Book, the ryu algorithm, and ghidra are others
why is it called zero cost if it costs a lot of time
rust is faster than C in most cases
typically the opposite is true but both when optimized to their limits perform nearly identically or comes down to compiler quirks
yeah, but for a naive developer, using rust constructs will yield better code than writing the equivalent code in C
zero runtime costs
but for a naive developer
is gonna wrap eveything in a arc mutex and call it a day
im talking more about using vecs and optionals and stuff
writing your own dynamic array in C will likely be slower than the rust out-of-the-box std::Vec
yeah probably
i think most people should use c++ if they need something like that
templating for example in C is a nightmare
this is just copium lmao (rosies statement)
okay but no one does this 😭
you watched too much tsoding
open C library
dynamic array
Nobody writes C these days, but those that do probably have a vec implementation
I wonder why they never tried.... or mentioned this exists https://pkg.go.dev/runtime#GC
even something like stb_vec is probably gonna be slower than rust vec
you can disable the GC auto run and exclusively call it yourself when conditions are met which they seem to have wanted to do
isnt that just an arena allocator now
except it doesnt free everything so i guess not
huh?
a common pattern in non-managed languages is
- allocate everything into a big region
- free it all at once at the end
instead of manual allocation and freeing in every place
the manual gc, which im going insane because thats not
^
oh yeah.
memory arenas were a proposal for golang
but there is no standard way to pass them
and the stdlib for it to actualy be useful would have to be updated to support it
so its on the back burner rn
i like the way i did it but i dont think golang can do this because threading and stuff
- allocator is an abstract structure that holds function pointers to the current allocator stuff like alloc, free, realloc, etc
- this is set in a thread global static structure
- functions call the function pointer from there to allocate memory and get back a pointer
now a gc would automatically free, if you swap the allocator to arena you manually free after you call various memory-allocating functions
though idk how the "thread global static structure" plays in go
!lc.gem can you explain this greentext for me?
almost every useful C library that ive looked at the source code for has its own dynamic array implementation somewhere within it
I wish the stdlib was as good for c as it is for c++ but no generics makes that really hard.
its easy to do with macros
oh so doesnt that mean you dont have to write your own? are they just as fast as std::Vec?
no lol the custom vec implementations are usually slower, but what i meant is in C everyone reinvents the wheel for dynamic arrays because its C (and because its not a lot of code)
rust has specialized implementations for particular types
a naive implementation of a vec will be slower than the rust one for primitive types
how about you C deez nuts
this is the canonical way to do it but not all compilers support it and improper usage can be a nightmare to debug
you can even make generic functions like this
if i ever need generics im just gonna use C++
yeah
naive or native?
naive
c++ and rust std:vec are near fast as possible and use multiple optimizations under the hood
sort for example for both if the compile time size is known will use not a generic sorting algorithm like quicksort but the mathmaically fastest for X elements for small size arrays
@valid jetty rewriting elle to use llvm when
Since C is the best, and C++ is incrementing on C… doesn’t that mean that it overflows making C++ the worst? Follow for more programmer humor
Since C is the best, and C++ is incrementing on C… doesn’t that mean that it overflows making C++ the worst? Follow for more programmer humor
when are we rewriting you in llvm
the search for intellegent life continues
Thanks for the follow kind lady!
@crude star the 87th flower
just found out that it was fucking raycast that caused issues with clipboard in my entire os
now im kinda curious to find out why exactly it does this
first idea is that it doesnt close clipboard properly?
it has clipboard history
a huge part of their clipboard manager is made in rust
so it looks quite different in pseudocode in ida
i guess i can try to hook winapi's CloseClipboard func with detour and make it log it into the console to see if it actually closes it properly?
i mean it’s kinda good
i can have spotlight on windows
raycast my beloved
Just use powertoys for that…
it’s a private beta for windows so i can kinda forgive them for this
power toys doesn’t have plugins
raycast hate is forced
Pretty sure it does though
last time i used it it was very slow on my laptop though
No idea if these are legit but they exist: https://github.com/hlaueriksson/awesome-powertoys-run-plugins
soon i’ll have actual spotlight so i don’t really need neither of these
yeah its very vc coded
i dont even want it to be good but it is
wait i don’t even need to use detours i can just use procmon i think?
“vc coded”?
nvm they lied to me
simply powertoys sir
its way better
currency converter is fucking goated, i use it so much
lc.wa 10 usd to btc
😭
okay uh i found this though im not really sure what this gets me
the ux is so much nicer than powertoys run or flow launcher tbh
flow launcher was the goat for me back when powertoys ran like shit on my old laptop
same 
but recently its just gotten worse
the everything integration stopped working for me completely
although raycast file indexing is absolute dogshit too
so idk
powertoys has an everything plugin
3rd party
the file search stops working for me after a few hours 😭 I still haven't figured out the cause
cinema
no that's not the point
can it convert time
like
6am utc to your local
one thing about raycast though is
but they seem to be improving this
last time i checked it was 600ish mb
now its only 400mb
it does seem to have that option but you have to scroll to find it, you can't actually type in a timezone 😭
also funny how they redesigned the ui after raycast dropped
youre not big nutty
I am but a small nut 
wait i just noticed is this the same pfp?
nope but ig it does have kinda the same vibe
so many people have told me I remind them of big nutter
small nutty
it was fuicking removed
LOL
WTF?
maybe I'm just typing it wrong idk
nah they flat out removed it
💀
looks like you can create your own time format which will be displayed in the list
natural language input is so much nicer than having to configure Da\y nu\mber yourself
the plugin existed but was removed
idk why
the plugin let u do & 10 am PST to UTC
yay the vibecode is working

istg if i received this id never contribute to oss ever again 
@hoary sluice hmmmmmmmmmmm
@valid jetty is secretly theo
nuke valorant
nooo it’s fun
I'm gonna start bhopping in ur games
they broke bhop in cs2 anyways so
yea I'm gonna start doing it in valorant
i don’t think u can even like gain velocity higher than sprinting by bhopping in val
Why
yop
just cheat
this is so over i think i didn’t get into zed windows alpha test 
or just compile the source urself
yeah i’ve already been using it for half a year, but i’d really like to get into the official alpha so i can like report bugs directly to them and get quick feedback
oh I didn't even know they had something like that
I just thought it was kinda secret that it actually works fine on windows and everyone was pretending that it doesn't
I got it from scoop myself
et
well rhe windows alpha announcement was like this week so if you don’t actively follow the development of zed you wouldn’t have known this
actually i found this out by pure accident lol
my font broke in zed after a recent update so i went to their #windows to see if anyone has reported anything similar lately and found out they’re doing a windows alpha lol
Ohhh 😭
I did hear abt that issue, but I don't use it regularly so I didn't even notice anything wrong w/ the font
Btw is it possible to configure zed to run rust-analyzer all the time instead of just after saving? (like how jetbrains products do it)
The only way I found was to set up automatic file saving to once per second
Which is kinda weird cuz like what if I don't want to save the file (but ig jetbrains also does that by default)
read from here down a bit.
#🪅-progaming message
I have explained the joy of rust at length on my channel, HOWEVER, some of what I have mentioned breaks down when interacting with async rust.
Though the compiler is getting more and more helpful with each iteration, async is still a sharp edge, especially for newcomers.
But you don't have to use it.
👉Get Rust training from Let’s Get Rust...
youre using box for loop ranges?
or for what
iterator environments use Box yeah
use std/iter/core;
global pub;
struct Intersperse<T, AnyEnded> {
Iterator<T, AnyEnded> base,
Option<T> next,
T separator,
bool emit
}
fn Iterator::intersperse<T, AnyEnded>(
Iterator<T, AnyEnded> self,
T separator
) -> Iterator<T, SingleEnded> {
Intersperse<T, AnyEnded> intersperse = Intersperse {
base = self,
next = Option::None(),
separator = separator,
emit = false
};
return Iterator {
env = Box::new(intersperse).to_ptr(),
next = fn(Intersperse<T, AnyEnded> *env) {
if env.emit {
env.emit = !env.emit;
env.next = env.base.next();
return env.next.map_with(fn(_, env) env.separator, env);
}
val := env.next.or_else_with(fn(env) env.base.next(), env);
if val.is_some() {
env.emit = !env.emit;
env.next = None();
}
return val;
},
next_back = nil
};
}
the iterator itself is just a struct that holds some void*
struct Iterator<T, AnyEnded> @nofmt {
// type erasure to prevent super nested chains
// of iterators having really long generics
void *env,
fn(void *) -> Option<T> next,
// !! nil if iterator is not DoubleEnded !!
// unfortunately no good way to enforce this
// than to use an Option<T> but that has its
// own downsides and isnt always ideal
fn(void *) -> Option<T> next_back
}
so technically they dont need to be boxed
but since elle has a gc, boxing is the neatest solution
@valid jetty rewrite elle in assembly
clearly never used kx coroutines before
me neither
wrong youre the expert
insanityy
hwak tuah
EVIL
the nix police are coming for you @deep mulch
why does dbg box the value
why doesnt it show the exit code
not sure
well this issue is like very recent like maybe one week old
so you might have heard about some other complains abut font
but currently it’s really bad
what does boxing a value mean?
I think it just means it’s heap allocated
i havent heard of boxing a value before but im not very good at pro-gaming
no

whats even the use of box
like in general
neat heap allocation
instead of
ptr := #alloc(Foo);
*ptr = Foo { x = 1 };
``` you just do ```rs
Box::new(Foo { x = 1 });
struct Box<T> @nofmt {
T *value
}
fn Box::new<T>(T value) -> Box<T> {
ptr := #alloc(T);
*ptr = value;
return Box {
value = ptr
};
}
typically boxing in memory safe languages is described as putting something into heap memory safely
like java, rust
elle is not memory safe so Box is just a convenience module
@valid jetty
hiiiii
cute
you can box a struct if you want a circular reference
1 year ago..
box is the simplest container there is
there’s more complex ones like Rc, RefCell, UnsafeCell, etc
Someone found it lmao
May i ask what is this?
Read up on the convo
miawo
whos that
yeah but why, why would you need to allocate on the heap
why use a box when you can use a vec with one element
its a lot more useful because you can put more things in it if you want
when you don’t know the size at compile time, such as in a recursive struct
struct Node {
Option<Box<Node>> left,
Option<Box<Node>> right,
i32 value
}
Would that not compile without the box?
nop
ahh ok that makes sense, thanks :3
Worded my question badly, is that a no it wouldnt compile or a double negative? :)
it would not compile
^
oh icic
you end up with
struct Node {
struct Option<Node> {
struct Node { … },
bool is_some
} left,
…
}
Box<T> adds indirection
and you can’t have that that in rust without the either a Box or a reference, but a reference requires a lifetime
well you can use a refcell but that has a different purpose
Should have been inline LOL
Yep lmfao
lisp is memory safe
The one and only thing that I found "cool" about Zed was the promise of a gpu-accelerated, fast and responsive text editor
But like
Their project pivoted into AI slop
So vscode?
lets fork it

venditor
it is barely capacible of handling directories with 50+ files
i wonder why
wait fr?
lifecycle of a current day product:
conception -> forming basic ideas -> coming out with the project -> promising a ton of stuff -> making a good product that works -> REALISE YOU CAN SELL OUT TO AI -> ADD A BUNCH OF AI GARBAGE -> PRODUCT SUFFERS MASSIVELY -> SELL OUT TO INVESTORS FOR THAT FINAL PAYCHECK -> Death
seems like zed doesnt have option to disable ai garbage
it does
so forking is the only way
just not all of it
unless they updated the settings names or added more this works nicely
{
"features": {
"edit_prediction_provider": null
},
"collaboration_panel": {
"button": false
},
"chat_panel": {
"button": "never"
},
"assistant": {
"enabled": false,
"version": "1",
"button": false
},
"show_edit_predictions": false,
"edit_predictions": {
"enabled_in_assistant": false,
"disabled_globs": ["**"]
}
}
the only remnant of ai will be this at the bottom right but i mean its only like 30px² on your screen
and they did
☹️
how to disable that "collaboration_panel" entirely, i force denied it in calling home
That’s beautiful
the update just removed assistant.version
ah

jetbrains so heavy 😩
🙄
That's what I did.

All so I get to keep using IntelliJ (my beloved)
It can have as much ram as it wants
I allow it
love how jetbrains resells the same product 10 times with a different name and different default plugins
Pretty sure you can just pay one license for all of em
Sure but that license costs 10x the license for a single one
No?
I have a school license, it's fine, but I'd prefer if there was just one blank ide that u can fully configure
You can technically
But the thing is, their IDEs are more than just the plugins.
CLion/RustRover have some native lang features which IntelliJ lacks
Or Rider
Stuff built-in for C#
Which is not isolated into a plugin
dijkstra 2 before gta 6
@valid jetty make your own algorithm when
when i go to uni ill have a lot of free time as im very ahead so it could actually be fun to try and improve on the algorithm
first of all lemma 3.3 is like a pq but i feel like that can be made faster
and the algorithm is recursive
nop
i feel like an iterative rewrite could make it much faster
i can optimise this by simply not needing to do pathfinding
not relevant in the academic world but relevant in real life when recursion is very heavy compared to iteration
i might try write it in elle
lol
make elle faster
nop
oh yeah zoot did i show you tuple destructuring
nop
use std/prelude;
// OBJECTIVE:
// Given a tree:
// 1
// / \
// 2 3
// / / \
// 4 5 6
//
// Print each level on a new line:
//
// 1
// 2 3
// 4 5 6
struct Node {
Option<Box<Node>> left,
Option<Box<Node>> right,
i32 value
}
fn Node::print_on_lines(Node *self) {
i32[][] levels = [];
queue := [$(self, 0)];
while !queue.is_empty() {
node, level := queue.remove(0).unwrap();
if levels.len() == level {
levels.push([i32;]);
}
levels[level].push(node.value);
if _, left := node.left {
queue.push($(left.to_ptr(), level + 1));
}
if _, right := node.right {
queue.push($(right.to_ptr(), level + 1));
}
}
return levels
.map(fn(level) level.join(" "))
.join("\n");
}
fn main() {
root := Node {
left = Option::Some(Box::new(Node {
left = Option::Some(Box::new(Node {
left = Option::None(),
right = Option::None(),
value = 4
})),
right = Option::None(),
value = 2
})),
right = Option::Some(Box::new(Node {
left = Option::Some(Box::new(Node {
left = Option::None(),
right = Option::None(),
value = 5
})),
right = Option::Some(Box::new(Node {
left = Option::None(),
right = Option::None(),
value = 6
})),
value = 3
})),
value = 1
};
$dbg(root);
$println('\n', root.print_on_lines());
}
look at print_on_lines, its a bfs
WHY HUSK
actually hold on those Option:: dont need to be there
fn main() {
root := Node {
left = Some(Box::new(Node {
left = Some(Box::new(Node {
left = None(),
right = None(),
value = 4
})),
right = None(),
value = 2
})),
right = Some(Box::new(Node {
left = Some(Box::new(Node {
left = None(),
right = None(),
value = 5
})),
right = Some(Box::new(Node {
left = None(),
right = None(),
value = 6
})),
value = 3
})),
value = 1
};
$dbg(root);
$println('\n', root.print_on_lines());
}
i feel like you guys are husking the wrong thing, im talking about this
node, level := queue.remove(0).unwrap();
they did it's literally one setting now
{
"disable_ai": true
}
also
they have vscode-like code editor called fleet
though i've never used it and i'm not sure if it's actually any good
i feel so stupid struggling to figure out how to include detours.h in my c++ file 😭
why does it need to be so complicated like why can’t i just do cpp add detours
u literally #include "detours.h"
let me check
yes it works
even that button is gone
'detours.h' file not found (clang pp_file_not_found)
unfortunaly extension installation is still imperative
fuck if i know 
idk how to get it
like
where am i supposed to get it
at the long cpp shop
ngmi
oh
get vcpkg
its linked in the readme
what did they mean by this https://github.com/microsoft/Detours/blob/9764cebcb1a75940e68fa83d6730ffaf0f669401/Makefile#L37
Makefile: Line 37
realclean: clean
yeah no it's fucking crazy that's how you install a library manager in 2025
2019*
it didnt even put it in path apparently...
scoop install vcpkg
this is so funny even their own package manager doesnt have it 
oh nvm i missed this part
anyways just installed it with scoop
vcpkg
cmake
nmake
ninja
what else do i fucking need to just use detours jesus fucking christ 😭
gradle 
what else does it need oh my god why is it so difficult
Use cmake
thats what im doing
yet it says something like oh you need nmake
oh you need ninja
oh you need mingw makefiles
why does it need to be so fucking complicated
i managed to obtain detours.h file without any of this tho
grabbed it from vcpkg's installed folder
is everyone here using zed
I use VSCode
i also use vscode
❤️
Idk if this is the right channel, is there any plugin that sorts the items in those thread-like channels based on reaction count
(Auto-response invoked by @shrewd canopy)
Alright sorry
yeah atp im just gonna find a detours lib in rust lol
?crate retour
yeah found this one already
detours is evil
polyhook on top!!!
C++20, x86/x64 Hooking Libary v2.0. Contribute to stevemk14ebr/PolyHook_2_0 development by creating an account on GitHub.
cool ass pfp lmao
You have to delete Cmake cache every time you change generator
what are u even hooking
Detours my beloved
(Why is poly hook better)
just winapi for one app idk there might be an easier way to do that but
more lightweight, more hooking methods, a lot easier to work with then detours etc
I found detours pretty easy to work with.
ya and polyhook is easier to work with because its made by a normal person and not the cucks at microsoft lol
just use minhook lol
yeah, but polyhook doesn't support arm 64
i might try this because i really don’t wanna use c++ https://github.com/CCob/MinHook.NET
is there any way to turn off recent activity without just turning everything off 
isnt detouring arm still weird/new
Probably but this isn't the channrl for it
It's worked fine for me 
its prograsmming
But my main windows machine is an arm64 laptop so ineed that support
asmtk and asmjit dont support arm i think tho
yea ngl arm windows just sounds wrong
why would i ask that in the support channel
If you want to program a vencord plugin go to #📖-info
Why your laptop is on ARM
stop husking like it’s just a fact that apple is the best in arm
nooo
like genuinely if not apple with m-series i don’t think we’d ever see so many apps being ported to arm
snap dragon is
at least in near future
apple is the best in software support for arm
nooo
android is
hmmm
apple is good at top end arm hardware i guess
sd beats apple in power efficiency and low-power compute, but it can't reach the same speeds that the new m4 chips can
but yeah windows for arm is an insanely good thing
not for windows, but for the software support for arm
because arm is fucking goated, and not enough software supports it
i’m curious if base m4 is faster than my cpu touch for like build time
apple is the best arm easily
almost definetly
apple's m4 can beat almost all intel xeons
its not a joke, shit's powerful
x86 is more goated than ARM honestly
eeeh
in what it accomplished thus far?
sure
in its future?
no
what even is it that makes arm that much better
not being x64
its actually that simple
but for the most part its the power efficiency
arm is a LOOOOOOT more power efficient
and its not even close
arm is more power efficient, uses risc, better performance per watt etc
wait really?
there's a lot of reasons for that, for the most part its because of the more modern instruction set
oh yeah
"risc"
yea
@grok what is risc
it took us 30 minutes to compile our chromium build on a 72 core xeon server, it took 60 minutes on an m4 chip
have you ever seen an arm opcode list
the server pulled over 1300W btw
tell me its still risc
but it’s 2 times slower 😭😭 idgi am i missing the sarcasm
I mean its still a lot more simple in my experience then x86
hmm what kind of project can i build to compare build time
chromium
llvm
i mean i don’t wanna wait an hour for it to finish lol
the jvm is good too
Intel CPUs are designed for performance, not efficiency
build openjdk
and they fail at both!
also preferably something in rust so it’s just cargo build instead of some cursed shit
zed
??
i think it wouldn’t be fair to since they use different dependencies for each system i believe
yea most do
i don't forgive intel and amd for both being idiots and splitting the x86 specification into 2
wait till you learn of all the arm specs
XD
there are so many vers its unfunny
they're from the same company at least ... right?
meanwhile intel only owns 32bit x86 while amd owns x86-64
Because I like cattery life
@hoary sluice opinions
onion Foo {
A(i32),
B(string),
C(i32[])
}
-# #size(Foo) == max(#size(i32), #size(string), #size(i32[]))
unwraps to
enum __Foo_tag {
A,
B,
C
}
struct Foo {
__Foo_tag _tag,
i32 *A,
string *B,
i32[] *C
}
then you can
if Foo::A(value) = x {
$dbg(value);
}
and it unwraps to
if x._tag == __Foo_tag::A {
value := x.A;
$dbg(value);
}
is this a union struct
tagged union yea
🧅
what's the difference
if Foo::A(value) = x 
what does taht do
bro has not discovered the joys of pattern matching yet 😹
no difference, its just not a feature in elle yet
basically a variant of Foo::A is of type i32
now x is some Foo
Foo::A(value) = x basically says "if x is of Foo::A unwrap the variant into variable value"
i hope this makes sense
well the if statement checks if x is specifically of Foo::A and x would still be assigned to some Foo so that syntax wouldnt make a lot of sense
overwriting a variable like that sucks
wouldnt it just be an assertion
variable isnt overwritten, only compiler knows its that type
nott really, Foo::A(value) and value are 2 different things, Foo::A holds the value, they are of different type and value
again not sure if im explaining this in an understandable manner
ive written enough rust to the point where i just do and dont think so i forget the details 🔥
our government wants to set maximum walking speed 💀
well at what point does walking turn into running
all assignments in rust are based on pattern matching, even the most primitive ones 
and i love pattern matching
you can just put in some values and then take them out again... no one can stop you
struct Test(isize, isize);
fn main() {
let Test(a, b) = Test(1, 2);
println!("{}", a + b);
}
im like ai bros but instead of ai i preach pattern matching
what if we used pattern matching in... uh.... mod and use..!!!
use idk::*;
its kt if x is Foo::A { let value = Foo::A(x.unwrap()); }
what???????
minimum walking speed
🦅ly
@hoary sluice i improved the generic inference
now i can pass Iterator::empty() and infer the generics based on what .__iter__ returns
and match rust's behavior
@valid jetty why husk
rust 0.5
why are width and height part of the array
that's how i get them and too lazy to make another struct
hop on
struct {
uint32_t width, height;
std::vector<uint32_t> pixels;
} iconData
i should
@valid jetty @valid jetty @valid jetty
zoot pings me every 2 seconds
c++ my beloved
Napi::Uint8Array arr = Napi::Uint8Array::New(env, value.size());
memcpy(arr.Data(), value.data(), value.size());
return arr;
im like 40% sure there's a better way to do this
also chad napi user
napi is just what cmake.js defaults to
but it was a bit annoying to setup
wtf is cmakejs
execute_process(COMMAND node -e "f = require('fs');n=require('node-addon-api').include;f.writeFileSync(1, n.substring(1, n.length-1, 'utf-8'))"
OUTPUT_VARIABLE NAPI_PATH
)
i'll give you one guess
yeah i dont think you need to serialize it manualyl as uint8
i just need to send somewhat large (~128^2) arrays of u32 back to js
im using c++ wrapper 
yep.
this is some giga micro optimised turbo max performance code
so its good as a reference
@supple whale
napi_create_uint32...
its a fucking NAPI built in function
and its x10000 faster than that
its a built in macro
from my googling that just converts a u32 to an javscript number
not an uint32 array
fuck wrong one
you're right
wait i read the code giga wrong
1 sec
wait is this documented wrong?
Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(
info.Env(),
nativeArray->data(),
arrayLength /* size in bytes */,
[](Napi::Env /*env*/, void* /*data*/, std::vector<uint8_t>* hint) {
std::unique_ptr<std::vector<uint8_t>> vectorPtrToDelete(hint);
},
nativeArray.get());
nativeArray.release();
Napi::Uint8Array byteArray = Napi::Uint8Array::New(info.Env(), arrayLength, arrayBuffer, 0);
so yeah what u sent
u just didnt show the ab build
but i rmeember there was a faster method
speed in this does not matter that much
ah yeah i remember now
you pass a buffer, and use the pointer of that buffer in C
yeah the ab new probs will work fine
napi is great, but its horrendously easy to write performance destroying code with it
and its horrendously difficult to profile
i wasted many hours trying to profile napi code
Wdym?
IT MIGHT BE OVER https://github.blog/news-insights/company-news/goodbye-github/
Sure technically the original x86 and amd 64 are owned by both respectively but they have perpetual licenses from each other
GitHub and its leadership team will continue its mission as part of Microsoft’s CoreAI organization
Intel makes extensions to amd64
have we reached the extinguish part

More annoyingly avx-512 is like 12 sub extensions with a baseline profile that does not include them all yet it’s “avx-512”
Arm isn’t risc
It’s not the ISA it’s the chip design.
The only actual advantage arm has is better instruction decoding. Nothing else. That’s also more of a max clock speed limitation
ARM processors are based on RISC principles
Here is a guy who actually knows what he’s talking about with the primagen on a live stream https://youtu.be/xCBrtopAG80?si=injFRQpuLE5oI5z0
Recorded live on twitch, GET IN
Article
https://hackaday.com/2024/03/21/why-x86-needs-to-die/
Guest
My Stream
https://twitch.tv/ThePrimeagen
Best Way To Support Me
Become a backend engineer. Its my favorite site
https://boot.dev/?promo=PRIMEYT
This is also the best way to support me is to supp...
They’re not. It’s just marketing
Arm has a butt load of complex instructions used all the time
I mean, isn't stuff like the load/store architecture still maintained, and most of the core instructions are a lot more simple compared to x86
marketing
No. Because risc is slow
The actual limitation of modern CPUs is instruction throughput
RISC adds absurd levels of overhead
no, memcpy is right here
i'm just an idiot using it
i forgot the *sizeof(u32)
What overhead are you referring to?
yeah it works
still not the correct way of doing it
the only thing i can think of is multiple loads for the hi and lo bits of a big integer literal into registers because instruction sizes are constant
I mean I don't think that's an absurd level of overhead personally, isn't it mainly for simplicity, and can't things like literal pools etc mitigate this?
maximum speed
Instruction sizes are not constant in x86 or arm.
a little late lol
you already talked about it?
yeah i know they’re not, this is the overhead i’m talking about
minimum walking speed: 10kph, maximum walking speed: 5kph /silly
oh I see :d
@placid cape
yea yea
Let’s create a hypothetical.
Let’s say we want to count the number of 1 bits in a uint64.
A primative way of doing so would % 2 the number, check if it 1 or not yada yada.
The cpu has to decode every single instruction of the loop to execute our code. This also means that for the most part the scheduler itself cannot run operations to perform it quicker in parallel because it has limited reasoning capabilities and only has a short sight into the future.
If the cpu had an instruction to do this for us it could easily do it in one cycle because internally it has context of the problem.
Modern CPUs, if we make this a for loop don’t literally decode each instruction one by one and have a cache of decoded instructions in l1, but it would still be slower to look up what to do in l1 instead of it being implemented internally in the CPUs byte code itself
We want to saturate as much of the cpu as possible and we do that by compacting as much compute into one instruction
Multiple simple cores add overhead EX more decoders to do this so having thousands of little arm cores isn’t more efficient either
Intel partially tried to get around making smaller but still fast cores with rentable units till they scraped it
so you're saying the decode overhead of simple instructions & the inability to optimise certain patterns makes RISC less efficient then having specialised instructions even if they make the ISA more complex?
Yes
Adding instructions is cheap as shit
Most of a modern CPUs is NOTHING but l1-3 cache and the schedule trying to saturate the core as much as possible
Intel TRIED to avoid this with itanium
You encoded multiple, up to 8 instructions into one very long one and it would execute them all in parallel in one cycle
Instruction count means jack shit
Cassie goes over it very well in this video
It's the cache & scheduling?
That take up power and die space yes.
Schedulers are so convoluted and fucked up that Intel alderlake can unroll loops AT RUN TIME IN HARDWARE
Intel and AMD both have massive power hungry schedulers and pipelines to try and eak out as much performance as possible. Even down to the per transistor level have gaps between what TSCM calls "gadgets" to make sure they don't overheat at the ridiculous clock speeds they're ran at.
arm takes a step back and sacrifices throughput for in some cases complex instructions. EX: what apple and the arm company is trying to do with matrix operation instructions.
Or in general have less power heavy overhead for simple tasks that are normally memory bound like serving a website
hence where they get power efficiency from.
nothing to do with ISA
apple is interesting as they just throw l1 cache and instruction decoders at the problem with a shallow but wide pipeline
M series cpus still lack single core performance despite being generation(s) ahead of x86 in actual silicon nodes
im giga excited for the near future of SD processors
and with the VERY rapidly growing support for ARM its gonna be nuts software side too
when the iphone came out it removed like 40 products off of the face of the planet because ur phone can do that
and i feel like the new SD chips will do that too, where ur phone will simply become your everything thats mobile
like a mobile console and laptop, just attach a telescopic controller or a lapdock
because the new SD chips are actually that powerful to be able to do that
if snapdragon finally, properly, supports UEFI
it really doesnt need to
you're thinking of the SD laptops
where sure, thats a problem
but fuck those in the first place, just use ur phone
i mean the explosion in arm software support those laptops caused is sick
why would i use my phone for anything
why not?
lol?
if its powerful enough, whats the reason to not do it
"oh yeah let me just use my x2 slower and weaker laptop?
just.... why?
use a lapdock that's 10% of the price and simply attach ur phone
that is... if google doesnt fuck up the display server for AVF for android
they already delayed it from a16
there is a lot i want to do i cant do on android without a custom rom
dude
its full linux
AVF with a display server is legit just raw linux
you can run anything on it
out of curiosity like what
so anything you wouldnt be able to do is a linux limitation
i depend on root but custom rom not so much
oh wait no you wouldnt be able to read the raw usb serial, i think that's protected
other than that, full linux
can i replace the kernel? 
and what phones support this?
as of now? none because google delayed it
root is virtually impossible on certian phones
but planned support is all non-samsung phones
with i think some exceptions for mali? from what i understood there were GPU driver issues?
dont quote me on that
well fair but just don't buy shitty phones 
either way its still vapourware
nope, if you compile android yourself it works
its just few people bother since its unstable
but people ran shit like oolama or gimp on it just fine
sicne its just debian with a display server
unstable, need an android i can load a custom rom on, deal with shitty gpu performance and nothing supporting arm natively still well
sure ill use it
no you dont need a custom rom
its coming to normal android
all android phones will have it
horrorcode
.
not right now
yeah nrn
but its coming
and the GPU support and perf is better than what you'd get from android apps
that much is already confirmed
tho its a bit lower than what the GPU can actually do because of sandboxing
but we dont have exact figures :(((
we only have a "yep its faster than bionic and android's java display server"
bionic like apples SOCs?
no, bionic like android's native C libraries that are called bionic
or cpp?
i dont remember
ah
and considering you can already run shit like cyberpunk 2077, witcher 3 and crysis remastered at 60 fps on bionic
i cant imagine how good raw linux will be
without the android bullshit
well 2077 runs at like 30 fps on lowest
but it runs
still vapourware and i dont have an android 
Might look into it except i dont wanna murder my phones battery in months and or have it attatched to a fake laptop with a dongle
yeah for now it is
once it releases in a few months its gonna be utterly fucking massive
some people from ltt said that framework might entertain the idea of a lapdock
and a lapdock from them would fuck
active cooling for your phone.
but yeah i agree battery murdering is real, lapdocks come with their own batteries u can charge the phone with
and most high end phoens nowdays support charge bypass
so it wont touch the battery
so that kinda unfucks it
the heat exposure will still kill them
but yeah, this, i can only run my phone at 100% with overclocking for like 30-ish minutes
and then it starts throttling
heat doesnt do that much, it still fucks it a bit, but nowhere as much as a full cycle would
but i agree, it is a potential problem
still, not that it matters much
with how much money you wont be spending on an actual laptop or mobile console like steam deck, you could simply afford to change the phone every 3 years XD
thats what kinda excites me
since you lapdock or telescopic controller wont become obsolete all of a sudden
like the phones hardware can and will
horrorcode
IconData WindowContext::getWindowIcon() const {
Atom actualType;
i32 actualFormat;
u64 nitems;
u64 bytesAfter;
u8* propRet;
IconData ret;
if (XGetWindowProperty(display.get(),
window,
atoms._NET_WM_ICON,
0,
-1,
False,
XA_CARDINAL,
&actualType,
&actualFormat,
&nitems,
&bytesAfter,
&propRet)
== Success) {
if (propRet && nitems > 0) {
std::println("actualType: {}, actualFormat: {}, nitems: {}, "
"bytesAfter: {}",
actualType,
actualFormat,
nitems,
bytesAfter);
auto data = (u64*)propRet;
ret.width = *data++;
ret.height = *data++;
ret.data.resize(ret.width * ret.height);
// turn argb -> rgba
// we would need to do this in js anyway, so might as well do it
// here where it will be faster
for (size_t i = 0; i < ret.data.size(); i++) {
ret.data[i] = argbToRgba(*data++);
}
}
}
return ret;
};
but yeah, for now vapourware
and its annoying me because google was meant to release it with android 16 and fuckign didnt
they shipped the pKVM linux shit with full debian and networking
but didnt ship the fucking display server
REEEEEEEEEEEE
I think intel is going to die but i hope they keep doing stuff with little cores because this 200 USD walmart special laptop with the N305 is pretty fucking bangin
i hope the CPU division dies, and GPU division lives
the only limiting factor on it is 8GB of ram else outside of gaming why tf would i need better
because these arc cards FUCK
AMD needs competition in x86
x86 isnt going anywhere. itanium didnt kill it
itanium was x86
?
let me trashtalk ur argbtorgba function
show it
its here
oh its a single position
i thought it was a bitmap
void decodeBitmap(double alpha, size_t *data, ASS_Image *img, int w, int h) {
uint32_t color = ((img->color << 8) & 0xff0000) | ((img->color >> 8) & 0xff00) | ((img->color >> 24) & 0xff);
uint8_t *pos = img->bitmap;
uint32_t res = 0;
for (uint32_t y = 0; y < h; ++y, pos += img->stride) {
for (uint32_t z = 0; z < w; ++z, ++res) {
uint8_t mask = pos[z];
if (mask != 0)
data[res] = ((uint32_t)(alpha * mask) << 24) | color;
}
}
}
mine was that
i suck at c++ but that was the best i came up with
huh was IA-64 not intel's attempt at 64bit x86 or am I mixing up something
it wasnt X86 it was something new
oh this one is fun!, this is segfault city!
not RISC or CISC it was EPIC
its one of the few things that can crash chromium
imagedata
when constucting imagedata you gotta check the CPU arch
intel foresaw the hellscape we live in with modern FAT cpu cores and tried to avoid it making cores clock high with high IPC
because if its 32bit arm you'll crash chromium if you use references of uint8
insane
haha
you're telling me?
im the one that found that bug, took me fucking 3 months to track down why 5% of my userbase was crashing
and its still not fixed
yeah computers are smart
const data = hasBitmapBug
? self.HEAPU8C.slice(pointer, pointer + reassigned.w * reassigned.h * 4)
: self.HEAPU8C.subarray(pointer, pointer + reassigned.w * reassigned.h * 4)
promises.push(createImageBitmap(new ImageData(data, reassigned.w, reassigned.h)))
oh yeah
there are 2 bugs with imagedata
the segflaut, and the incorrect pointer reference
by the way this is over engineered
inline uint32_t argb_to_rgba(uint32_t argb) {
return ((argb & 0x00FFFFFF) << 8) | ((argb >> 24) & 0xFF);
}
and this one https://github.com/ThaUnknown/jassub/issues/28
its compiler explorer
thanks

send me your function please im to lazy to type it out and i wanna benchmark it
is the & 0xFF needed?
hop on ocr
#include <cstdint>
uint32_t argbToRgba(uint32_t argb) {
return ((argb & 0xFF000000) >> 24) | // A
((argb & 0x00FF0000) >> 8) | // R
((argb & 0x0000FF00) << 8) | // G
((argb & 0x000000FF) << 24); // B
}
uint32_t argbToRgba2(uint32_t argb) {
return ((argb & 0x00FFFFFF) << 8) | ((argb >> 24) & 0xFF);
}
no.
forgot o0
not great not terrible
i wish i could profile wasm like i can profile js
DWARF just doesnt fucking work
im trying to benchmark this shit but clang optimized out all the code.
isnt there a spreadsheet of clock cycles for given instructions?
u could simply check how many clocks the instructions take vs eachother
i guess.... i wanted real world performance tho
i remember doing that for 8080 ages ago
fair, different cpus might have different timmings for it
??????
argbToRgba: 1.51251e+06 us, checksum=2147464837549209034
argb_to_rgba: 919292 us, checksum=2147518598361242314
why isnt the total the same
cause....
@jade stone the functions name is wrong this isnt to RGBA its BGRA
thats why it uses a bswap
idk why i didnt realize that earlier
shit bro I need to get u to look at my entire C++ codebase and unfuck it
yeah
i realized that too
use this then and be happy
uint32_t argb_to_rgba(uint32_t argb) {
return ((argb & 0x00FFFFFF) << 8) | ((argb >> 24) & 0xFF);
}
never happy with snake_case
rename it IDGAF
#include <cstdint>
#include <chrono>
#include <iostream>
#include <vector>
#include <random>
// First version
uint32_t argbToRgba(uint32_t argb) {
return ((argb & 0xFF000000) >> 24) | // A
((argb & 0x00FF0000) >> 8) | // R
((argb & 0x0000FF00) << 8) | // G
((argb & 0x000000FF) << 24); // B
}
// Second version
uint32_t argb_to_rgba(uint32_t argb) {
return ((argb & 0x00FFFFFF) << 8) | ((argb >> 24) & 0xFF);
}
template <typename Func>
void run_benchmark(const char* name, Func func, const std::vector<uint32_t>& data) {
auto start = std::chrono::high_resolution_clock::now();
uint64_t sum = 0;
for (uint32_t px : data) {
sum += func(px);
}
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::micro> elapsed = end - start;
std::cout << name << ": " << elapsed.count() << " us, checksum=" << sum << "\n";
}
int main() {
constexpr size_t N = 1000000000;
std::vector<uint32_t> pixels(N);
std::mt19937 rng(12345);
std::uniform_int_distribution<uint32_t> dist(0, 0xFFFFFFFF);
for (auto& px : pixels) {
px = dist(rng);
}
run_benchmark("argbToRgba", argbToRgba, pixels);
run_benchmark("argb_to_rgba", argb_to_rgba, pixels);
}
technically overkill
i dont care.
@ivory heath wanna fix my C++ code and the build system for the wasm it's made for?
I'll pay ya XD
if youre doing ANYTHING with image scaling or conversion use ZIMG please. It uses Z.lib under the hood and is basically the fastest way to do anything....
except it uses planar RGB because interlaced is cursed
https://github.com/sekrit-twc/zimg
should have asked me like a month ago when i was still into writing C++. im back into writing golang.
gg
i think i just encountered a vite bug 
what the hell is a f16
i thought all floats were either 32 or 64 bits
it is just shrunk f32
for comparsion, f32 has 8 exponent and 23 fraction bits
"half-precision floating-point format"
also, 8-bit and 4-bit floats exist
soon elle will be a rust compiler
did you think floats being locked to 32 or 64 bits was commanded by God or something?
whats preventing me from making a 128 bit float
make your code run very slow
struct integer {
bool b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31;
};
and quadruple memory usage
Gonna pr to rust and make arrays 1 indexed
just needs a borrow checker
ya
lol
elle is doing the same though it’s slowly just turning into rust lol
Well GC Rust is cool but so is having a borrow checker… it’s clear that a borrow checker provides a bunch of benefits (or detriments for some use cases) it would be nice to have a more varied selection of languages using a borrow checker
But it’s your project and at the end of the day you choose what u wanna do with it
the only thing is that borrow checkers are very hard to actually write, you have to do some heavy static analysis and go deep into type theory
That’s true
Huhh did it actually
what THE FUCK is bool?
octuple*
Floats go all the way down to 8 bit.
Below that it does not really make any sense
learning IEEE 754 and doing floats by hand made me die
4 bit floats are the minimum size where it makes sense
one sign bit, two exponent bit, one significand
I guess having exponential vs 1-6 is good for ai models….
But they typically use int4 cause it’s cheaper.
1-bit is gaining popularity in vector databases, though last I heard it doesn't work well for ai
how can you even store useful data with 1-bit?
you dont
No embed in preview ?
indentaion: 2 spaces or 4 spaces?
It's not like the value really represents anything, it's all you need is a distance function
And you can compute distance/similarity between 512x1 just as well as you xan with 512x32
Just a bit less precise
I don't understand the specific algorithms for binary quantization, but I hear they work pretty well considering the savings
rate
What other values can it represent?
you'd still need +-0 and a NaN, so maybe like 5 unique finite numbers? (negative and positive)
How is infinity even defined in floats, is that just the highest/lowest value 
NO!!!!!!!!!!!!!!!
One tab
unportable
huh
NO NO NO
THE HIGHEST VALUE IS NAN
here's our infinities
infinity is filled exponent but empty fraction
i <3 spreading misinformation on internet
Oh 😭
Good

which horrific font is that
is that comic sans mono
i think so
i used my skills at this code
if (true) {
await Vencord.Updater.update();
(window.VesktopNative ?? DiscordNative).app.relaunch();
} else {
console.log("no updates")
}```
did i cook
🔥
this is already in vesktop???
if true 🔥
tytytyty
is this good or what should I use for basic nodejs threading @supple whale
nodejs threading already exists with node_worker
if you mean inline threading you will wait 6 years minimum
ik but it doesn't have any worker pool functionality afaik



