#🪅-progaming
1 messages · Page 114 of 1
i guess often java anotation magic does often look like it shouldn't work
#include <algorithm> & #include <numeric> :)
Also shared pointers and easy threading
Iostream (io and stream series), String, map, vec, set, algorithm, thread, mutex, atomic, chrono, async. I could go on
no its not
Chrono.
annotations being used as metadata for runtime is fine imo but annotations for compilers is bleh
timie(NULL) in c is way cleaner though
The issue is to many damn ones exist
Or are confusing to use like views
Which COULD be good
the only c++ example i've seen is
std::chrono::duration_caststd::chrono::nanoseconds(std::chrono::system_clock::now().time_since_epoch()).count()
that's horrific
or in some cases like codecvt the stl classes have been deprecated and there's no alternative in place
this is why C++ should have imports for specific types instead of using namespace std::chrono; which includes them in the current NS
Using.
Oh wait you said that
yeah the problem is namespace pollution
it's still hard to remember
using would be perfectly fine if namespace pollution wasn't a thing
<iostream> sucks.
<string> lacks a lot of operations (starts_with was added in c++23), and it being generic over character type is pure nonsense
<map>/<set> are fairly decent
<algorithm> is just an indecipherable grab bag of random functions. Some good, some bad, many exist only for iterator pairs but not ranges
<thread>/<mutex> are ok I guess
<chrono> is decent except timezones was bolted on post-hoc and still isn't supported in all compilers
Never used <async> so can't say anything about that
it's more concise in java and javascript
#include <chrono>
#include <iostream>
int main() {
using namespace std::chrono;
std::cout << duration_cast<seconds>(system_clock::now().time_since_epoch()).count();
}
seems easy
use std::time::SystemTime;
fn main() {
println!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
}
``` Rust doesn't fare much better tbh
would it kill anyone to have SystemTime::now().unix_time()

fn main() {
println!("{}", chrono::Utc::now().timestamp());
}
time.time() in 🐍
fn main() {
println!("{}", jiff::Timestamp::now().as_second())
}
jiff
i never wanna use a third party library for dates unless my application is really doing a lot of stuff with them
why is this api so ass
why is it so verbose to get unix time
fun main() {
println(Instant.now())
}```
thank god for the c api but some developers might say its not idiomatic for c++
because people think the more complex something is, the smarterer it is
and rust uh i guess i would create a helper func
rust and c++ have the most old school java way to do it
How often have you needed to do that?
i wish rust would just include chrono in std since everyone is using chrono anyway but oh well
I can't recall needing it ever, but my memory isn't very reliable
Except those who use time
Or those who use jiff
try to build an app without having a dependency that uses chrono challenge 👹
wait this excludes the utility libs, once sec
Which is exactly why chrono is not in std
what format do you want time in except unix time
nobody uses gif
add this
usually those have a feature to switch to chrono too
i guess you could argue the root issue is that in many languages working with time is awful and e.g. in javascript to add 10ms to a time the easiest way would be new Date(otherDate.getTime() + 10), didn't think of that
Inside the program: SystemTime, Instant, or some timezone aware type, depending on usage
For serialization: ISO 8601
js is the only sane language with a date api this bad
even java has a better date api
modern java is decent
meanwhile
fun add10Millis(instant: Instant) = instant + 10.milliseconds
I might need a timestamp since 1601 year (winapi moment)
Javascript stole the date api 1:1 from Java but Java later literally deprecated that api cause it was designed horribly and made a new api

meanwhile js still has the dogshit api from java
truly wholesome
would you rather write objective-c++ or javascript with c macros using c's preprocessor
thats beautiful
Intl makes it quite good tbf
but yeah could be a lot better
i will make toxic programming language yaoi out of this, javascript, the langauge that cannot move on from java
it's all fucking deprecated
can we bring back java applets instead
Probably objective-c++ honestly
wait theoretically you could do this
#include <stdio.rust>
fn main() {
puts("Hello world");
}
though i guess you would be stuck with static linkage
wait you probably can avoid that
but i wouldn't know how as i haven't used rust's c interop
the idea was in stdio.rust
fn puts(s: &str) {
println("{s}");
}
rather than actually calling c functions
which would mean it would be duplicated everywhere you used it
:(
that's not a lot to duplicate but if you made a whole compat layer for everything it might add up
cpp!(r"
#include <iostream>
int main () {
std::cout << "Hello, World!" << std::endl;
return 0;
}
"#);
im glad whatever syntax highlighting library discord uses doesnt support rust raw string literals
oh in other news
extern "C" { fn strlen(s: *const u8) -> i32 }?
I wrote another compose backend
#define fn auto
however
so wacky UIs like this are now possible in vanilla using only a modded server 
if you used this to import everything including stuff you wrote in rust, rust code would be limited to effectively being statically linked right?
this has been possible since they first introduced resourepacks
idk it hurts my head
yes but now its doable with compose
also resource packs couldn't do this dynamically, you'd need to replace the entire chest texture at the time
next time i do rust i should use mold
it helped a lot on my pc with c++ taking forever to link
nope
you did it with items with custom 3d models
that wasnt a thing yet back in 1.6
and doing that means that for the end user there's a slot they can hover over to see an item tooltip
but since a few versions ago you can now put custom textures of any size in fonts and put them in the title
yeah it was added in 1.7.10
ur shit wont work in 1.6.1 either doe xd
yep
wtf is this argument bro
but yes now UIs can be done with compose™
kotlin!!
we love kotin
Someone in Discord linked to this tweet and I figured I'd take a stab at singing it in my totally not awful fake accent: https://twitter.com/bhilburn/status/971019559095427075/photo/1
Download:
WAV: https://kaslai.com/files/program_in_c.wav
MP3: https://kaslai.com/files/program_in_c.mp3
the more cc flags you have the better programmer you are
-std=c99 -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -fsanitize=address -g
it's not even that hard to embed assets into your executable with raylib
best game engine
wait that does load every time
this is a very normal duck
it's not even that hard to embed assets using C in general
https://github.com/acquitelol/mizu5/blob/mistress/Makefile#L1-L34
Makefile: Lines 1-34
TMP ?= tmp
SRC ?= src
FXCG ?= ../libfxcg
MK3GA ?= mkg3a
GCC ?= sh3eb-elf-gcc
NAME = mizu5
CFLAGS = -Isrc -Itmp -lfxcg -lgcc -lc -nostdlib -Os -Wall -Wextra -Wpedantic
FXCG_FLAGS = -L$(FXCG)/lib -I$(FXCG)/include -T$(FXCG)/toolchain/prizm.x
EXTRA_CFLAGS = -flto -ffat-lto-objects -mb -m4a-nofpu -mhitachi
SRCS = $(wildcard src/*.c)
all: $(TMP) $(NAME).g3a
$(NAME).g3a: $(TMP)/$(NAME).out assets/sel.bmp assets/uns.bmp
$(MK3GA) -n basic:$(NAME) -i uns:assets/uns.bmp -i sel:assets/sel.bmp $< $@
$(TMP)/$(NAME).out: $(TMP)/data.h $(SRCS)
$(GCC) -o $@ $(SRCS) $(CFLAGS) $(FXCG_FLAGS) $(EXTRA_CFLAGS)
$(TMP)/data.h: $(TMP)/$(NAME).bin
xxd -i $< > $@
$(TMP)/$(NAME).bin: assets/$(NAME).png
ffmpeg -y -i $< -f rawvideo -pix_fmt rgb565be $@
.PHONY: $(TMP)
$(TMP):
mkdir -p $(TMP)
.PHONY: clean
clean:
rm -rf tmp
rm $(NAME).g3a
xxd -i literally gives you a C header file of a static array of bytes and their length
it's awesome
@valid jetty make elle run on ti 84
i used it too...
Hi
how does google home listen for "hey Google" without constantly taking mic input?
nvm chatgpt solved it
i was looking for smth like that in nodejs

it simply does that
erm i meant doing constant speech-to-text would waste too much battery
I don't think it uses text-to-speech. It probably does it in a way similar to Shazam
i have live access to your mic and camera btw
So in short: a small, power-efficient neural net runs constantly to listen for “Hey Siri,” and only when it thinks it heard it does the full Siri pipeline activate.
it records everything you say 24/7 and sends it to Google and NSA servers
hey apple
apple
hey apple
okay so maybe we have different ideas on what’s good. I mainly like them all because they are fast and efficient. If algorithm has it most likely it’s going to be faster than whatever you do.
I would like to know why you think iostream sucks.
Ugly syntax with << and arcane stateful modifiers for formatting
And no, c++ stdlib is not fast
Certain parts might be, but for example unordered_map is burdened by specific rules about iterator invalidation that limit implementation performance
And while I don't know how fast <regex> is at runtime, the templateness of strings means it has to be entirely templates and thus entirely header-only, which gives poor compile times
@dense sand i fixed my nodejs build
but i accidentally nuked 5k build minutes on gh in the process
because i forgot to cancel my other builds
X D
for regex i'm pretty sure theres a constexpr version that compiles the regex at compile time
@spark tiger https://www.youtube.com/watch?v=DD5UKQggXTc
🚨 NEW MERCH! http://amzn.to/annoyingorange 🚨
➤ NEWEST VIDEO: http://bit.ly/30MinsAO
➤ AO GAMING CHANNEL! ▸ http://bit.ly/AOGaming
➤ Don't be an apple! Subscribe! It's FREE! ▸ http://bit.ly/AOSub
KITCHEN CARNAGE MOBILE GAME!!!
iOS: http://apple.co/1GLnKuz
iOS iPAD: http://bit.ly/KitchenCarnageHD
ANDROID: http://bit.ly/KitchenCarn...
for context :))))
Yeah there's a few of those
https://github.com/hanickadot/compile-time-regular-expressions from a quick google search
I don't know if they have any advantages or just for fun
if you compile the regex at compile time won't that lead to better perf
i haven't looked into it enough to know tbh
Optimizations already bloat binary (just look at AVX/SSE'd function) so it's fine
ts so niche 🥀
Arguably less bloat that including a regex compiler in the runtime
you're just not old enough
video probs almost as old as u XD
i’ve seen images of this orange before but never the full video
almost
Depending on how many you have
some cases it’s actually shorter to use then but I get your point
dude? it's 2025??
here's 3 things that you MUST add to your game
- Battlepass
- NFT trading
- AI bots
and your game better be built in Rust with (bitcoin style) encryption, simple apps in PHP and Python aren't enough anymore
so awesome 9.5/10
obsidiancel
i read that as obedience
you forgot kernel-level anticheat
gotta add the +50% cpu usage drm solution too
You forgot to add a bitcoin miner
unironically the only good use for AI
"name this function"
i was more talking about that PartialModuleJumpCodeLensProvider is a tad verbose
hmmm i wonder what most of my bundle size comes from
i think one of the funnier things is that i'm including both acorn and typescript in one bundle
and that both of them are directly* used by me
im currently working on github composite action(whcih will be used by others) which has flow like this. basically, you should provide input as list of paths to dockerfiles and it will check if the user has paid, build and push the images and publish some config(which is stored in root of repo). what i struggle with currently is how to build the images in matrix, any tips on this?
i had to edit /usr/share/emscripten/tools/shared.py to get debian's emscripten package to work 
is this real
yes would i ever lie to you
yeah
nop
@valid jetty @valid jetty check DMs I sent funny image
@valid jetty sentenced to using power apps for a year
@runic sundial hey
@steel scroll hey
hi
🦅ly
Part List - AMD Ryzen 9 9950X3D, GeForce RTX 4090, Fractal Design Torrent ATX Mid Tower
how did you know i asked about ssds
thank you

Creating the sound of the pulverizing pumping techno I danced to at Mutek this year
My music and socials: https://linktr.ee/switchangel
#livecode #algorave #electronicmusic #sounddesign #mutek
@deep mulch LOOK AT THIS
HOW
When a SSRF is enough: Full Docker Escape on Windows Docker Desktop (CVE-2025-9074)
@deep mulch i made a breakcore thing
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
listen
love
holy shit strudel looks so much fun i really gotta try it instead of learning fl 
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
listen to my beautiful creation
hop on nudel
I FUCKING HATE U
THIS SHIT BROKE MY EARS
repair
i knew something was wrong with this when it took me like ten seconds to load this song
what do you rate it
i lost the ability to rate music after this one
woah what is this
strudel
the only times i've heard of strudel was that one todepond stream and it left me feeling high so great first impressions
i should spend some time trying to learn it
i miss when we had to use autocad at school 🥀 💔
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
STRUDEL IS SO EASY TO USE
I miss learning fusion 360 in school
um just use blender???
i have a tf2 hat
give
buy one
where
idk, i got this at pax east
get me one
soon

Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
this sounds like an alarm sound
im awake now
why is this site so fucking loud jesus christ man
because it's playing pure frequencies
faint volume at max
this video is really creepy
woahhh
Noice
javascript interpreter
too bad i write tailwind so i have 1000 character lines
early parts of this video remind me of old VGM like https://music.youtube.com/watch?v=gSYwlvVCjLg for some reason even though it's not really similar
Provided to YouTube by TuneCore
Colin McRae Rally 2 Theme · Jonathan Colling
Colin McRae Rally (Original Video Game Soundtrack)
℗ 2016 Octagon Music
Released on: 2016-10-13
Auto-generated by YouTube.
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
this link is so good
fore
fire
someone make a song like this in strudel https://www.youtube.com/watch?v=o7zG6_Ca0D0
Provided to YouTube by Repost Network
Tanzen und koffico gucken · Tekknomeister
Self Titled
℗ Okkultesblut
Released on: 2022-10-10
Auto-generated by YouTube.
Strudel is a music live coding environment for the browser, porting the TidalCycles pattern language to JavaScript.
@supple whale funny perf graph
(red functions are mine, others are from libs i'm using)
Node
why is the graph so shit
it's just a list rather than a good timings graph
are u using some node inspector instead of chromiums V8 inspector?
given i have 205 instruction handlers(functions), whats the best way i can run the handler based on opcode? using switch doesnt seem like a good idea for this size, right?
You can use a lookup table but I'd guess switch is faster
If there is no big breaks between opcodes then you can use big array of function pointers
There's lot of lore on how to do efficient opcode dispatch
that was my idea, but last 2 member skip all the way to 0xFE & 0xFF from 0xCA
Eh, 50 empty slots doesn't do any harm
That's 400 bytes; whether that matters is up to you
right
I don't suppose anyone could help me out in: https://discord.com/channels/1015060230222131221/1141154160650240050
I am bashing my head against a wall

is it drywall or what
You should eat the drywall
This is just a viewer for the .cpuprofile file in vscode
ah yeah i remember it was doggy
anyways why not use chromium dev tools instead
they can attach to any v8 process
and are waaaaaaaaay better for what u need
I don't Know if I can attach with chromium stuff tools to this
if it runs node or deno u can
Vscode extension host
thats nodejs
because you're zoomed our and rendering an octilion samples?
try doing that in react and you'll run out of system memory XD
insane

okay so i apparently tailscale cant route webrtc through exit nodes
any tips what else could i use?
Probably not headscale
yea wow
like i need to get discord voice calls working... because i use them for work
but like half of the shit is blocked here
even normal vpns
I'd look into cloudflare
Maybe cloudflare warp or smth like that
Or tunnels
My school started blocking tail scale so I moved over to cloudflare warp VPN or whatever it's called
evil
Download it at home or off a tethered connection
not terrible
private VPN
from what i know webrtc is very hard to get working on VPS correctly
90% of the time they either leak outside of the VPN or dont work at all
simply because of how many random ports that shit needs
dont i have that now basically?
tailscale + headscale server
but the last guy i knew how to do WebRTC over private VPNs was getting paid $15k/mo
so it requires competency i do not possess
💀
i might as well just write an email to the local sysadmin to unblock discord webrtc
that requires him to know what he blocked
which he likely doesnt
since again its some giga specific random ports
and some of which are dynamic
couldnt he just block the service/protocol as whole
ehhh
depends on his tooling/competency
webrtc is suprisingly secure so its hard to "chery pick" blocking
like u can with http restrictions
they use some fortiguard ass filter which is pretty hard to bypass
iirc mullvad worked a bit, but cant remember
and it costs money
they could simply block stun/turn addresses
and that'd be the best way to do it
that said thats tcp and udp black magic which i myself do not understand
i've worked with this protocol for 4 years now btw ^^
oh wow
webrtc is fucking black magic ^ 2
damn like what am i supposed to do 😭
yea thats what ive been doing for the past year
AI is good at this kind of shit unironically
and i cant imagine noone has solved this for tailscale
😭
if your single hover event doesnt look like this:
then you're not even trying to nuke performance XD
From what I can tell like 90% of the time is coming from a library I use that collects variable usage
anyways i added animated icons to my app
shit fucks
and svelte makes it so horrificly simple
thank you random person on the internet
for doing a lot of the legwork for animating svgs

would it kill them to improve the perf
i wish you could easily use threads in node
i need to process 23k asts then merge the results

I got a lib for that^^
fucking hell switch statements
use a map like a human being
would a map be faster even with having to account for the default case
how easy does it make it
because the BARE MINIMUM for js threading as of now is:
import { expose } from 'abslink'
export default expose({
add: (a: number, b: number) => a + b
})
and
import { wrap } from 'abslink'
import worker from './exposed.ts?worker'
const threaded = wrap(worker)
const res = await threaded.add(1, 3) // 4
if you want automagically type inferrence you'd do
main
import type extensionLoader from './worker'
import { wrap } from 'abslink/worker'
const Loader = wrap<typeof extensionLoader>(worker)
const life = await Loader.stuff()
worker
import { expose } from 'abslink/worker'
export default expose({
async stuff() {
return 42
}
})
and with this TS will know that life is 42
and not any
how do deps work with this
right now i'm using esbuild
so would the deps get duplicated
if the worker has to be in a seperate file
Why? Best case for a map they perform nearly identically and worse case the map is far slower
probably
its tree shaked
so if u imported the same funct in multiple places then it would be duped
So I have to double my bundle size just for threads 😭
not necessairly double
as i said
tree shaking exists
and if u dont double import like a dumbass its not a problem
ex:
Guh
I'll look at what I have when I get home
(and after I fix a chromium dev tools bug I found)
What's the difference between threading and multi-threading?
multi
threading is "throw this one thing onto a separate single thread"
multi-threading is "split this algorithm between multiple threads at once"
Yeah that's basically what I need
brug
A/B question
mf answers "yes"
mf reacts and doesnt answer
bruh
@jade stone
@jade stone
@jade stone
@jade stone you mf @jade stone
answer
XD
The messages sent in a different order on my screen
Nop
I just need threading
Yeah I was aware of this
its pretty much old C/Java style atomics with synchronous blocking across threads
and there are no language/compiler/libraries which make it less cance
thread pooling is just threading with a queue and job IDs, so its just an array, its piss easy
jfc makes me think of john f kennedy
This is pedantic garbagio unless it’s only in the scope of JS. Very few at all use this distinction
And what is a separate algorithm is hard to define
yep exactly
That threading/multi-threading distinction is the same as people saying that writing in any interpreted language is scripting and it must be compileable for it to be considered programming
If that I said makes no sense then you can see the point.
I think using scripting and programming are not the right terms to use but the concept of interpreted and compiled is important.
It’s just most people don’t know that some so called “scripting” languages are compiled like python. Few are actually interpreted line by line besides like brain fuck
You can make a argument that a entire program is one algorithm to do its job
Which makes it undefinable
This is definable
That's the point
It's a ridiculous def
I think they’re wrong for different reasons
Since when does threading mean "putting a task on a different thread"

It just means talking about the threads
I think you’re comparing apples to oranges
I’m complaining about something being undefinable
And you’re complaining about bad names
I think you're delusional and I'm going to bed
Good night ven 
the time picker on iphones alarm app isn’t actually circular it’s just a really long list
not taking notes from flat-list believers 🫷
dorm wifi is peak
just buy 2.14PB of mobile data like a human being
costs a whoping $10.1 USD per month
i pay 12$ for 5gb
i cant flex anymore
now they just list it as "unlimited"
but they used to show the full 2.14PB data usage
and they also took away my 5GB internaltional data
now i only have 5GB in all of EU and 1GB international
well "I"
each one of the numbers on this plan, which is like 5
so i guess mult all that by 5 XD
did i mention all the data is full 5G speeds? ^^
no lol
so i have following plan for 12$: 5gb local + 5gb international + 30gb extra slow local data
i begged my dad to buy this plan when i was in high school when i found out abt it on some forum, and we both agreed its been the best decision for our quality of life by a land slide
5GB international kinda fucks ngl
man the sheer comfort of not having any data limits
open youtube at any time, at 4k60fps
fuck cares
download shit when ur out and about
dont need to worry about finding public wifi or connecting to wifi when visiting some1
THE COMFORT
all of my "Only on WIFI" settings on all my apps are turned off
after using a bitmap font everything looks blurry
haha subpixel rendering
even firefox text looks a bit blurry (chromium text is usually worse than firefox for some reason)
(for some reason with discord app on linux it's also stuck with greyscale font rendering unless you use an older font renderer)
yes firefox is known for its very good sub pixel rendering for fonts
which chrome for the most part lacks
or to be more specific, chooses to ignore system settings for it
that said, i think microsoft made some PRs to chromium to improve its cleartype integration
so it should be a lot better than it was say 4 years ago
but idk the exact results and timeline of those changes
t he number of people who probably book an appointment with optians because they think their eyes are bad
i know they were made orginally for the edge chromium shit
most people are fucking blind
i have it worse, cuz i'm on a QDOLED
which suuuuuuuuucks for subpixel rendering
the tops of my letters are green, and bottoms are purple
since QDOLEDs are traingle shaped
anyone just not ever really noticed font rendering differences
I've used both chromium and ff and they look the same across any platform
and i have 20/20 vision
The only difference about firefox in terms of font rendering that I noticed is that font weights are disproportionate kinda, like the font is thicker on the x axis, in chrome it's more even
ya'll fucking blind then
font rendering is a fucking pain for me
and i unironically considered using a mac for this exact thing
i went as far as to make my own subpixel rendering implementation just to fix this shit in my font renderers
i saw a clever c trick
replace decimal point wit h locale specific decimal point before using strtof
so that it works whatever the language is

how...
gg
Wish web had 16kb page size requirements
why massive page sizes?
why is c++'s solution to errno being not that great to have no way to know what went wrong 
not a framework
wdym?
no it doesn't
just make all websites with wasm and raylib
the only advantage to larger page files is a smaller lookup table for defering memory addys, besides that why does it matter
4KB is standard and far beyond performant enough
why is google trying to 4x it
probably because phones have too much ram now
either way your code should always support dynamic page sizes
google lies a FUCK ton so i highly doubt their claims here
page table is a hardware feature not software and if its really that big of a issue you have deeper rooted problems in your code base
or this is a ARM skill issue
wtf does "Faster camera launch" even mean 
iirc ARM has configurable page sizes
OK, so now we know how to set up the control registers, we need to know the in-memory structures. ARM is more flexible than x86 in terms of page size. While x86 supports 4KB and 4MB pages, ARM supports 4KB, 64KB and 1MB pages. It can also support 16MB pages, but this is optional (guaranteed The first level translation table is 16KB in size when N = 0. Generally, it is 2^(14-N).
the linux kernel however and others can emulate different sized page tables for apps
generally speaking only specific applications need them and usually due to poor memory optimization
because google said so
we do not argue with google
for they are the ones paying me
if i dont comply i get nuked
trully that simple
but yeah iirc its something to do with their pixel chips
which only do 64 bit and only 16kb page sizes and up
because something something faster cpu that way if u dont need to support smaller instructions
or smth
idfk
thats how i understood it
its purely arbitrary what is implemented in hardware
x86 supports 4KB and 4MB because if you wanna be normal you use 4KB and if you need to allocate a lot for some reason 4MB remove 99.9% of overhead
but yeah old apps will still work
its just newer are forced to use 16kb
probably some future proofing shit
IE looking 4 years ahead
tho their forced requirements are becoming HIGHLY questionable as you say
for example their new API for watch activity is only given to apps which are manually reviewed
and to get approved you need to have >100k daily active users
which is might as way say "only netflix, amazon and hbo"
its brainless
@valid jetty SLEEP
large pages...?
what?
nvm i misread what you guys were talking about
does anyone where know vite well?
i think it's going insane
i included i large json file
and it did this
whats the issue?
like half the JSON keys are randomly extracted to variables
yeah
same thing
tbh im kinda shocked they dont just do JSON.parse("json as string here")
that is so cursed
do it urself
maybe, but first i want to file an issue with vite
(or at least look into it a bit more)
index.tsx: Line 12
import mappings from "./keys-mapping.json";
you will
import mappingsJson from "./keys-mapping.json?raw";
const mappings = JSON.parse(mappingsJson);
it's more optimised anyway
but vite should do this ootb
idk why it doesnt
yeah but vite should do this
give it a list of all known i18n keys & strings
then just give it the string you want and tell it to guess the key based on the existing keys
people have done smart brute-forcing, but nothing like that yet
900kb how
what the bloat is ur app
this is what u get for using react and lodash
that is the entire list of discord mappings 
oh fair
you could make vite split it into its own chunk (why doesnt it already do this)
i could but it wouldn't change anything
routes on my site are already lazy
this is 150mb larger than terser 
no
how
how does a 150mb json become less than 1mb by just removing spaces
that makes no sense
you mean kb right
then why did u say no 😭
dum
lmao
ironically this hardly matters cause with compression it makes a super tiny difference in what's actually sent over the wire
especially when using brotli
but yeah mb dont do that
just get viter to fix 
yop
to my knowledge vite doesn't support Json imports and instead either in lines or as a string or converts it to a js object
Don't forget, it's almost always faster to do JSON.parse on a raw string than to include the parsed json in your source code 
I remember fighting it when I needed dynamic Json imports of metadata which has like some 2k files which totals 200MB
Why
JS eval simply
json has a very limited set of possible expressions, while js itself is much more complex to parse and evaluate
https://www.youtube.com/watch?v=ff4fgQxPaO0
Because the JSON grammar is much simpler than JavaScript’s grammar, JSON can be parsed more efficiently than JavaScript. This knowledge can be applied to improve start-up performance for web apps that ship large JSON-like configuration object literals (such as inline Redux stores).
Presented by: Mathias Bynens - https://goo.gle/2Oh2tq6
More...
also iirc recently they've made some big perf improvements to JSON.parse and JSON.stringify in v8
and it's still shit
unironocally this is why Json imports fuck
and why it's brainless that vite still doesn't support them
fucking webpack did 4 years ago before it eve became standardised
ideas for fastest way to serialize data from webview -> java -> nodejs?
currently using JSON so a string
and not too happy with it
java? 🤨
yes, android apps are unfortunately all wrapped with java
so if i want to communicate or launch my native layer i need to use java
no way around it
Shrimply rewrite app in java/kotlin
????
it already uses java
its the thing i want to escape
because there's no easy way to serialize JS objects because of it
Well if you want speed then maybe don't use nodejs and webview mess
there's nothing faster available on the market for android as of now
so sure, if you come up with some giga turbo fast solution for this i'll take it
until you do, dont trashtalk this, esp considering how much insanely faster it is than any of the competition
i'm the only mobile torrent client that can do a full gigabit download LOL
simply java cant compete with native compiled c++
https://gist.github.com/eisenwave/5cca27867828743bf50ad95d526f5a6e this is how i feel...
in languages where the type is auto by default (you might say the type is syntactically optional), i think it's even worse because adding a redundant type is generally not idiomatic
for example, people don't generally write something like this
let my_pos: Vec3 = player.position();
even though it does enhance readability and makes it clear that this is a player existing in 3d space
Rust :)
okay, sure, rewrite all of nodejs in rust
i'll sit here and wait
in c++ it's nice how it's basically a no brainer to write Vec3 my_pos = player->position(); as auto my_pos = player->position(); is the same length
yet some people still do the latter..
oh and i said " available on the market" for a reason, your headcomped theoretical Rust implementation is meaningless if it doesnt exist
ignoring the years of timesink that'd be
vs a single week
This is 100% mitigated by just using a good code editor that displays the inferred type

least insane JS development workflow
like idk how it is on c++ so just like mind convert my rust examples to c++ but rust analyzer just puts in the type as if i had written it myself, without type inference iterators for example would SUCK:
im not typing all of this out just cuz your code editor called "notepad.exe" that you swear by doesnt have any modern features making you write a 50000 page blog post about how "(language feature) sucks!!!!"
That's not even valid
You can't have impl FnMut in locals
had to add this 😁
i mean are you always gonna read all code in an ide/editor with plugins
also i don't like inlay hints...
I don't like inlay hints, but hover is lovely
I'd rather just edit the actual code when something is unclear
for example if i have like 10 parameters i don't want to rely on inlay hints to show their names
i'd rather pass a struct/object/builder/anything
or if, like in most cases, the types of a variable are short and the code is less readable without them i'd rather have them explicit
except in practice i never do that in a language which uses : type notation as it makes it extra long since you always have to write let/var and it kind of looks weird of you virtually never use the implicit syntax
Yes
At least for me
Why would I read code in anything else
Sometimes you read code on github
But mostly for skimming, and inferred types is fine for that
I always read code on github
neat, i can see how horrificly inefficient my phone is
I love how fucked up video software is that no one knows what’s happening
Are any of yall familiar with any open source allocators which i can simply give a memory block and it will treat it as linear heap space and be able to make allocations inside of this memory block? In C i mean
Isn't this basically what an arena is
Kinda
yea well the thing is that i want deallocations too
Why not self manage the memory
like write my own allocator?
Segment the memory yourself
im unsure with what strategy would i choose...
like i was thinking of using free list to manage it, but idk if it suits the case
I’m assuming this isn’t anything massive
its for JVM objects
Oof
its a small project, so i was thinking of just using free list allocator + some basic GC
but like... why reimplement the wheel, maybe someone made something better already?
yeah, if i actually go and review a pr where id need to know the types i do it in my code editor
im glad github cli makes that easy
https://github.com/acquitelol/elle/blob/rewrite/std/runtime/allocators/gc.le copy the elle gc to C
it's simple and small, and it uses a linked list so it's relatively fast for many small allocations
you just need to keep track of the stack top, which essentially just means putting a variable in your main function and then putting its address into static memory
void *stack_top = NULL;
int main() {
int x;
stack_top = &x;
}
``` basically this
@valid jetty hiii
type inference kinda makes it hard to review code
i also look at code on github very frequently
i don't want to clone a whole project and wait for all of its dependencies to i nstall
How big are the projects you’re working on then?
Even when I was working on some Google projects that are massive that was never a issue
not working on
just looking at
i don't want to fiddle around with a development environment to just read code lol
making code readable does have value
Just to read?
yes
you could always just press . to open vscode (well, unless you're on mobile I suppose)
yeah that's fair
yeah github doesn't really do a good job of highlighting extensions at all
I only now noticed that lmao
i would just advocate for languages being optimised for readability without special tooling
proper ides are generally a pain
lighter editors with lsp are pretty nice
kotlin extensions are so nice to work with, but yeah, having to open up IntelliJ on every Kotlin project would be a pain
i think kotlin is one of the worse offenders of being easier to write than read
from what i've heard
i feel like the kotlin eclipse extension exists only to traumatise people into just using intellij
bad example but works ```kt
repeat(x) { ... }
(0..<x).forEach { ... }
(1..x).forEach { ... }
for(it in (0..<x)) { ... }
I've stopped using Eclipse so long ago and yet I still remember just how painful it was to use compared to IntelliJ
for anything else than java/kotlin/jvm-based langs I just use sublime text with an lsp plugin
somethikng weird about rust is how the formatting is really excessively split into lines by default
somebody told me it was to optimise for git diff
but i think you should just optimise for actually reading it
it makes the code read more like just english words which I kinda like, but I see how people could dislike it
in notepad or anything
¯\_(ツ)_/¯ Kotlin/Native is also nice
that sounds cursed
even in git diff
sometimes it's like
my_thing
.other_thing
.do_thing(
"a whole load of arguments",
12345,
true,
true,
)
when it could just be
my_thing.other_thing.do_thing(
"a whole load of arguments",
12345,
true,
true
)
and still have the nice argument splitting
just do .find(x=>x != null)
but then you're evaluating everything and turning it into a list
find will give you the first thing only
well, yes, but you have to do .map().find() if you'd wanna emulate firstNotNullOfOrNull
yeah it's just a for-loop
yeah that's kinda ugly
idk I usually just format my code like I like reading my code
I think the first one is infinitely more readable than the second one, literally no need to conserve lines ever
Peoples overobsession with keeping the line count as small as possible hurt the larger community so much
you can just use iterators
fair
beautiful
function firstNotNullOfOrNull<T, R>(arr: Array<T>, mapper: (value: T) => R) {
return arr.values().filter(it => it !== null).map(mapper).take(1).next().value ?? null;
}
eh maybe take(1) isn't needed actually
beautiful
function firstNotNullOfOrNull<T, R>(arr: Array<T>, mapper: (value: T) => R) {
for(const v of arr) {
const mapped = mapper(v);
if(mapped != null)
return mapped;
}
return null;
}
🙄
why do you need a helper
wouldn't it be much more readable just to do
const thing = mapThing(array.find(x => someCritereaMet(x)));
wouldn't the most common usecase be where null is basically saying criterea isn't met
filter_map is a pretty nice function
so you can just have the function to map and check critiria separate
Avoids duplicating checks and stuff
maybe if you don't call it firstNotNullOfOrNull
and it's built into the language so people don't have to learn your utils
Yes that name is nonsense
https://github.com/JetBrains/kotlin/blob/2.2.20/libraries/stdlib/common/src/generated/_Arrays.kt#L1323 you can scroll up/down to find some more nonsense names honestly
there's probably worse
you can write native programs with kotlin which is kinda cursed and also kinda big (the thingy I wrote compiled is 7.6MB and it's only 162 lines + 1/2 libs)
just use go or c#
too lazy to learn go and c# is horror to use
@winged mantle
go if you';re developing server software and you want to slow it down with gc for some reason
(i love gc)
c# if you're developing a game and you want to slow it down with gc for some reason
and kotlin if you want your X to be 100MB and slow it down with gc for some reason? 
yes
I mean most sane devs wouldn't use Kotlin native if speed is important
using kotlin is premature pessimisation
jb is improving the native memory model and binary size last I checked
speak the language of your cpu\
@winged mantle speaks assembly
x86 assmembly, with keywords translated to french
x86 assembly with kotlin extensions
fun main() {
mov(eax, 10)
add(eax, 1)
}
soon
operator fun eax.plus(other: Int) = add(this, other)
fun main() {
mov(eax, 10)
eax += 1
}
I will add assembly to kotler
i feel like i'm a kinda bad programmer because i don't look at the generated assembly for my software
to micro optimise it
requested changes on this pull request
Please do it like this, it generates better asm:
I like micro optimizing
how do you declare a function as having internal linkage in kotlin
I LOVE FLAT MAP
fn Iterator::flat_map<T, U, AnyEnded>(Iterator<T, AnyEnded> self, fn(T) -> U cb) {
return self
.map(cb)
.map(fn(x) x.__iter__())
.reduce(fn(acc, it) acc.chain(it))
.unwrap_or_else(fn() Iterator::empty());
}
``` MY BELOVED
Pattern matching my beloved
does javascript have take on an array?
yeah its not used too commonly
iterators for sync data doesnt make much sense in JS
for async that changes doe
yerp
it doesnt change much tbf
instead of doing take(1, map(values())) you now do . chaining
Why do people rave about itters
Only case I’ve seen use of them is “as completed” on a list of futures
no1 is raving about them
i shill async iterators because they are horrendously powerful with the language features JS provides
since they are effectively language level data streams for network, disk, rendering, etc but with language level features
like async * function or for await of
Yeah of course I love them for that too
but sync iterators arent insanely useful, they have their uses, but they arent common imho
But literally anything else why do I care about having a fancy for I = 0; I < len; I++
because a map or a set or a header object wont let you do a for i len
so they return iterators simply
not everything is indexed or even unique keyed
well most maps let you do .keys() or the language has built in itters for them
yep
and thats an iterator
:)))))
at which point u might as well to .values()
and skip the .get(key)
Yeah, which is just a list you iterate over
okay that’s fair
they can be ofc, and often are, but its not a rule
you can modify something mid iteration and have it show up at the end of an iterator
just like editing a list would fuck up ur for i len loop
but yeah sync iterators overall have few uses
usually its for shit that's hashed, or non-unique keyed
or for data generation
like RC4 encryption, or seeded generation
Okay so like this, why do I need to be within a explicit for loop where I’m constantly getting seeds?
Just call a .next() or whatever on the object when I need it
sure as a consumer its no diff
but for generation it you no longer need to manage the state
because u can do while(true) yield math*math
and having the data in the closure
instead of fucking around with OOP
You can have state without OOP
god you're autistic, and i dont mean that in a derogatory way
but in a "uhmmm aschktually you can do X" way
sure its possible
you could also write it all in brainfuck
no1 is stopping you
its about developer comfort
this doesnt even make any sense
if anything it should be (a === b) !== c
python has the same syntax
python 
a == b == c expands to a == b and b == c
same for is
and all other comparison operators
its more useful if you wanna write a < b < c
it becomes a < b and b < c
It’s not you can just do it X way but it just seems like anti patterns.
Why do we want to indent all of our code with an extra layer instead of calling a function on an object. If we don’t want a statefull object or share a stateful object between multiple parts of our code just make it a function call.
An itter for promises as competed is actually useful because we don’t know what object will be competed first. We can’t just make it a function call on a list of promises because implicitly we want to remove each promise as they pop and would make it otherwise more complicated and less DRY to not use a itter
???????
@valid jetty dont support this in elle pls
she will
/run ```py
print(-1 < 0 < 1)
Here is your py(3.10.0) output @crude star
True
i dont plan to, chained binops just feels like a pain to parse

ive always hated that in python
is and not < operator symbols due to the non descriptive nature of natural language
english
well you have to do a backtrack after to turn (-1 < 0) < 1 into (-1 < 0) && (0 < 1)
no you dont
that shouldnt parse like that
/run ```py
print(-1 < 0 < 1)
print((-1 < 0) < 1)
Here is your py(3.10.0) output @crude star
True
False
rosie insane
thanks 🙏
if you add parens you're explicitly breaking the chain
well yeah??? because the second one is what would happen without chained binps silly
i just meant like
the way thge ast is setup
Binop(Binop(-1, 0, LessThan), 1, LessThan) into Binop(Binop(-1, 0, LessThan), Binop(0, 1, LessThan), And)
this is what i meant
ijust expressed it through code
you'd make a Cmpop node which is n-adic
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation.
Originally specified in the late 1950s, it is the second-oldest high-level programming language still in common use, after Fortran. Lisp has changed since its early days, ...
you asked for it
Every language that’s tries to be dynamic always comes back to lisp
lisp is fundamental
as demonstrated https://github.com/jart/sectorlisp
I can’t deny that lisp is awesome but I’d appreciate if it was readable to non aliens


