#🪅-progaming

1 messages · Page 114 of 1

supple whale
#

or without letting u change it

winged mantle
#

i guess often java anotation magic does often look like it shouldn't work

shrewd canopy
#

#include <algorithm> & #include <numeric> :)

#

Also shared pointers and easy threading

ivory heath
#

Iostream (io and stream series), String, map, vec, set, algorithm, thread, mutex, atomic, chrono, async. I could go on

winged mantle
#

c++ stdlib is pretty practical

#

except getting the current unix time is crazy

shrewd canopy
ivory heath
lavish cloud
winged mantle
#

timie(NULL) in c is way cleaner though

ivory heath
#

Or are confusing to use like views

#

Which COULD be good

winged mantle
#

that's horrific

lavish cloud
lavish cloud
lavish cloud
#

yeah the problem is namespace pollution

winged mantle
#

it's still hard to remember

lavish cloud
#

using would be perfectly fine if namespace pollution wasn't a thing

fleet cedar
# ivory heath Iostream (io and stream series), String, map, vec, set, algorithm, thread, mutex...

<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

winged mantle
shrewd canopy
# shrewd canopy no its not
#include <chrono>
#include <iostream>

int main() {
    using namespace std::chrono;
    
    std::cout << duration_cast<seconds>(system_clock::now().time_since_epoch()).count();
}

seems easy

winged mantle
#

even java has a shorter way to do it

supple whale
#

Date.now()

#

any1?

fleet cedar
#
use std::time::SystemTime;
fn main() {
  println!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
}
``` Rust doesn't fare much better tbh
winged mantle
#

would it kill anyone to have SystemTime::now().unix_time()

lavish frigate
#

trolley

fn main() {
  println!("{}", chrono::Utc::now().timestamp());
}
shrewd canopy
fleet cedar
#
fn main() {
  println!("{}", jiff::Timestamp::now().as_second())
}
lavish frigate
#

jiff

winged mantle
#

i never wanna use a third party library for dates unless my application is really doing a lot of stuff with them

royal nymph
#

why is it so verbose to get unix time

lavish cloud
#
fun main() {
    println(Instant.now())
}```
winged mantle
#

thank god for the c api but some developers might say its not idiomatic for c++

supple whale
winged mantle
#

and rust uh i guess i would create a helper func

supple whale
#

look at universities

#

XD

fleet cedar
#

It's not a very common operation I guess

#

So no point in golfing it

supple whale
#

getting unix time

#

not a common operation

winged mantle
#

rust and c++ have the most old school java way to do it

fleet cedar
lavish frigate
royal nymph
fleet cedar
#

I can't recall needing it ever, but my memory isn't very reliable

fleet cedar
#

Or those who use jiff

lavish frigate
supple whale
fleet cedar
#

Which is exactly why chrono is not in std

royal nymph
#

what format do you want time in except unix time

lavish frigate
supple whale
lavish frigate
winged mantle
# fleet cedar How often have you needed to do that?

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

supple whale
#

-1

fleet cedar
royal nymph
#

even java has a better date api

winged mantle
#

modern java is decent

lavish cloud
shrewd canopy
royal nymph
#

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

winged mantle
#

would you rather write objective-c++ or javascript with c macros using c's preprocessor

lavish frigate
supple whale
#

but yeah could be a lot better

lavish frigate
#

i will make toxic programming language yaoi out of this, javascript, the langauge that cannot move on from java

royal nymph
#

it's all fucking deprecated

lavish cloud
shrewd canopy
winged mantle
#

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

lavish frigate
#
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

lavish cloud
#

oh in other news

shrewd canopy
lavish cloud
#

I wrote another compose backend

crude star
#

#define fn auto

winged mantle
#

however

lavish cloud
winged mantle
#

if you used this to import everything including stuff you wrote in rust, rust code would be limited to effectively being statically linked right?

supple whale
#

this has been possible since they first introduced resourepacks

winged mantle
#

idk it hurts my head

lavish cloud
winged mantle
#

next time i do rust i should use mold

#

it helped a lot on my pc with c++ taking forever to link

supple whale
#

you did it with items with custom 3d models

lavish cloud
#

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

supple whale
#

ur shit wont work in 1.6.1 either doe xd

lavish frigate
#

wtf is this argument bro

lavish cloud
#

but yes now UIs can be done with compose™

winged mantle
#

kotlin!!

lavish cloud
#

we love kotin

winged mantle
#

the more cc flags you have the better programmer you are
-std=c99 -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -fsanitize=address -g

winged mantle
#

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

valid jetty
pearl stagBOT
# valid jetty it's not even that hard to embed assets using C in general https://github.com/ac...

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
valid jetty
#

xxd -i literally gives you a C header file of a static array of bytes and their length

#

it's awesome

deep mulch
#

@valid jetty make elle run on ti 84

valid jetty
#

oh i see..

#

im silly

steel scroll
#

Hi

solid gazelle
#

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

crude star
#

it simply does that

solid gazelle
#

erm i meant doing constant speech-to-text would waste too much battery

lavish frigate
#

luckily google home and alexa dont run on battery! they are plugged in!

jade stone
wild coral
#

i just made it worse

#

😭

deep mulch
nimble bone
#

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.

royal nymph
supple whale
#

apple

#

hey apple

ivory heath
fleet cedar
#

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

supple whale
#

@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

jade stone
supple whale
# supple whale hey apple

🚨 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...

▶ Play video
#

for context :))))

jade stone
fleet cedar
#

I don't know if they have any advantages or just for fun

jade stone
ivory heath
#

But binary bloat

#

Depending on how it’s done

jade stone
#

i haven't looked into it enough to know tbh

shrewd canopy
fleet cedar
supple whale
#

video probs almost as old as u XD

spark tiger
spark tiger
ivory heath
ivory heath
winged mantle
#

floppy bird

solid gazelle
# winged mantle rate

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
solid gazelle
royal nymph
#

obsidiancel

valid jetty
#

i read that as obedience

shrewd canopy
worldly sigil
#

gotta add the +50% cpu usage drm solution too

lavish cloud
jade stone
#

naming things is hard

supple whale
#

"name this function"

jade stone
#

i was more talking about that PartialModuleJumpCodeLensProvider is a tad verbose

supple whale
#

yes sir

#

sir [non-derogatory this time]

jade stone
#

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

dense sand
#

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?

winged mantle
#

i had to edit /usr/share/emscripten/tools/shared.py to get debian's emscripten package to work blobcatcozy

supple whale
#

we love emsc

#

not

valid jetty
deep mulch
valid jetty
#

yes would i ever lie to you

lavish frigate
deep mulch
#

@valid jetty @valid jetty check DMs I sent funny image

deep mulch
#

@valid jetty sentenced to using power apps for a year

steel scroll
#

@runic sundial hey

deep mulch
#

@steel scroll hey

steel scroll
#

hi

deep mulch
#

🦅ly

crimson sparrow
hoary sluice
#

thank you

supple whale
#

BROTHA

#

WE TALKED ABOUT THIS 3 DAYS AGBO

#

MONKEY

valid jetty
#

@deep mulch LOOK AT THIS

ornate quiver
#

When a SSRF is enough: Full Docker Escape on Windows Docker Desktop (CVE-2025-9074)

deep mulch
#

love

spark tiger
hazy pine
#

hop on nudel

spark tiger
#

THIS SHIT BROKE MY EARS

deep mulch
#

repair

spark tiger
#

i knew something was wrong with this when it took me like ten seconds to load this song

deep mulch
#

what do you rate it

spark tiger
#

i lost the ability to rate music after this one

deep mulch
hazy pine
#

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

deep mulch
#

I love

spark tiger
#

i miss when we had to use autocad at school 🥀 💔

deep mulch
#

I miss learning fusion 360 in school

spark tiger
deep mulch
#

I'd only use blender for non functional models

deep mulch
#

@jade stone

#

sadan wears nixos clothes

jade stone
deep mulch
#

is it an unusual

jade stone
deep mulch
jade stone
deep mulch
jade stone
deep mulch
jade stone
deep mulch
hazy pine
#

im awake now

spark tiger
#

why is this site so fucking loud jesus christ man

valid jetty
#

because it's playing pure frequencies

deep mulch
#

faint volume at max

royal nymph
swift rover
winged mantle
#

javascript interpreter

dense sand
#

too bad i write tailwind so i have 1000 character lines

lavish cloud
jade stone
#

I love typescript

royal nymph
#

fire

royal nymph
#

crazy

#

good job

jade stone
#

@supple whale funny perf graph

#

(red functions are mine, others are from libs i'm using)

supple whale
#

is this firefox

jade stone
supple whale
#

it's just a list rather than a good timings graph

#

are u using some node inspector instead of chromiums V8 inspector?

dense sand
#

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?

fleet cedar
#

You can use a lookup table but I'd guess switch is faster

shrewd canopy
fleet cedar
#

There's lot of lore on how to do efficient opcode dispatch

dense sand
fleet cedar
#

Eh, 50 empty slots doesn't do any harm

#

That's 400 bytes; whether that matters is up to you

dense sand
#

right

livid cedar
#

I am bashing my head against a wall

ionic lake
#

is it drywall or what

fleet cedar
#

You should eat the drywall

jade stone
supple whale
supple whale
#

they can attach to any v8 process

#

and are waaaaaaaaay better for what u need

jade stone
supple whale
#

if it runs node or deno u can

jade stone
supple whale
#

thats nodejs

supple whale
#

because you're zoomed our and rendering an octilion samples?

#

try doing that in react and you'll run out of system memory XD

jade stone
#

why did i write that

crude star
#

insane

jade stone
dense sand
#

okay so i apparently tailscale cant route webrtc through exit nodes

#

any tips what else could i use?

jade stone
dense sand
#

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

jade stone
#

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

dense sand
#

okay

#

they even block AUR

past osprey
jade stone
dense sand
#

hmm it doesnt work even with the tailscale

#

maybe they are getting ddosed again

supple whale
supple whale
#

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

dense sand
#

tailscale + headscale server

supple whale
#

depends on how u use it

#

it is a true vpn

#

IF done right

dense sand
#

i use my rpi at home as exit node

#

with headscale server on my vps

supple whale
#

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

dense sand
#

💀

#

i might as well just write an email to the local sysadmin to unblock discord webrtc

supple whale
#

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

dense sand
#

couldnt he just block the service/protocol as whole

supple whale
#

ehhh

#

depends on his tooling/competency

#

webrtc is suprisingly secure so its hard to "chery pick" blocking

#

like u can with http restrictions

dense sand
#

iirc mullvad worked a bit, but cant remember

#

and it costs money

supple whale
#

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 ^^

dense sand
#

oh wow

supple whale
#

webrtc is fucking black magic ^ 2

dense sand
#

damn like what am i supposed to do 😭

supple whale
#

personally i'd roll over and shit myself

#

XD

#

nah u can probs figure it out

dense sand
#

yea thats what ive been doing for the past year

supple whale
#

AI is good at this kind of shit unironically

#

and i cant imagine noone has solved this for tailscale

jade stone
supple whale
#

then you're not even trying to nuke performance XD

jade stone
supple whale
#

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

jade stone
#

i love when i send 5800 warnings to console

supple whale
#

pfff

#

if there's no + after the number you're completly fine

supple whale
supple whale
#

use a map like a human being

jade stone
supple whale
#

should be

#

try it and see

jade stone
#

time to clone blobcatcozy

#

hopefully their build system isn't insane

jade stone
supple whale
#

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

jade stone
#

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

ivory heath
lavish frigate
supple whale
#

its tree shaked

#

so if u imported the same funct in multiple places then it would be duped

jade stone
supple whale
#

not necessairly double

#

as i said

#

tree shaking exists

#

and if u dont double import like a dumbass its not a problem

jade stone
#

Guh
I'll look at what I have when I get home

supple whale
#

thats threading

#

not multi-threading or thread pool

#

important to outline that

jade stone
#

(and after I fix a chromium dev tools bug I found)

jade stone
supple whale
#

threading is "throw this one thing onto a separate single thread"

#

multi-threading is "split this algorithm between multiple threads at once"

jade stone
#

Yeah that's basically what I need

supple whale
#

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

jade stone
supple whale
#

xD

jade stone
supple whale
#

then what is it

jade stone
jade stone
supple whale
#

then yeah abslink does threading

#

multi-threading in JS is CBT

jade stone
#

Yeah I was aware of this

supple whale
#

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

winged mantle
ivory heath
#

And what is a separate algorithm is hard to define

supple whale
#

yep exactly

runic sundial
#

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.

ivory heath
#

You can make a argument that a entire program is one algorithm to do its job

#

Which makes it undefinable

runic sundial
#

It's a ridiculous def

ivory heath
#

I think they’re wrong for different reasons

runic sundial
#

Since when does threading mean "putting a task on a different thread"

#

It just means talking about the threads

ivory heath
#

I think you’re comparing apples to oranges

#

I’m complaining about something being undefinable

#

And you’re complaining about bad names

runic sundial
#

I think you're delusional and I'm going to bed

ivory heath
#

Good night ven sodalove

runic sundial
dense sand
ionic lake
#

not taking notes from flat-list believers 🫷

dense sand
#

dorm wifi is peak

supple whale
#

costs a whoping $10.1 USD per month

dense sand
supple whale
#

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? ^^

dense sand
#

no lol

#

so i have following plan for 12$: 5gb local + 5gb international + 30gb extra slow local data

supple whale
#

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

supple whale
#

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

winged mantle
#

after using a bitmap font everything looks blurry

supple whale
#

haha subpixel rendering

winged mantle
#

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)

supple whale
#

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

winged mantle
#

t he number of people who probably book an appointment with optians because they think their eyes are bad

supple whale
#

i know they were made orginally for the edge chromium shit

supple whale
#

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

ornate quiver
#

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

tired vigil
#

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

supple whale
#

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

winged mantle
#

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

supple whale
#

google:

#

also google:

#

back to compiling nodejs for android we go

stark timber
#

gg

fleet cedar
#

Wish web had 16kb page size requirements

ivory heath
#

why massive page sizes?

nimble bone
#

which btw is a library

winged mantle
#

why is c++'s solution to errno being not that great to have no way to know what went wrong blobcatcozy

nimble bone
#

not a framework

ivory heath
crude star
#

page size as in memory page size fr

nimble bone
#

oh i didnt gi

#

yeah still applies

crude star
#

no it doesn't

winged mantle
#

just make all websites with wasm and raylib

ivory heath
#

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

winged mantle
#

on skillshare

crude star
#

probably because phones have too much ram now

#

either way your code should always support dynamic page sizes

winged mantle
#

i think i have like 3gb on mine

#

need a lot of ram to play subway surfer?

ivory heath
#

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

worldly sigil
#

wtf does "Faster camera launch" even mean fortedCry

crude star
#

iirc ARM has configurable page sizes

ivory heath
# crude star 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

crude star
#

yeah not quite actually using larger page sizes it seems

valid jetty
supple whale
#

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

ivory heath
#

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

supple whale
#

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

deep mulch
#

@valid jetty SLEEP

ivory heath
ornate quiver
#

nvm i misread what you guys were talking about

jade stone
#

does anyone where know vite well?

#

i think it's going insane

#

i included i large json file

#

and it did this

royal nymph
jade stone
royal nymph
#

you mean values

jade stone
#

yeah

#

same thing

#

tbh im kinda shocked they dont just do JSON.parse("json as string here")

royal nymph
#

that is so cursed

jade stone
#

(or at least look into it a bit more)

royal nymph
#

what does ur source look like

#

where u umport the json

pearl stagBOT
royal nymph
#

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

jade stone
#

yeah but vite should do this

royal nymph
#

vite is crazy

#

has someone tried getting ai to guess i18n keys

jade stone
#

esbuild

#

terser

royal nymph
jade stone
royal nymph
#

what the bloat is ur app

#

this is what u get for using react and lodash

jade stone
royal nymph
#

oh fair

#

you could make vite split it into its own chunk (why doesnt it already do this)

jade stone
#

routes on my site are already lazy

jade stone
royal nymph
#

150mb??

#

do u mean kb

#

probably cause it isnt minified yeah

jade stone
#

no

royal nymph
jade stone
#

?raw just gives the raw file as string

#

doesn't minify

royal nymph
#

ik

#

but how is it 150mb

jade stone
#

19k lines of whitespace

#

dont want to minify it in source

royal nymph
#

how does a 150mb json become less than 1mb by just removing spaces

#

that makes no sense

#

you mean kb right

jade stone
#

yeah

#

whoops

royal nymph
#

then why did u say no 😭

jade stone
#

i thought mb because it went over a mb 😭

jade stone
royal nymph
#

lmao

royal nymph
#

especially when using brotli

#

but yeah mb dont do that

#

just get viter to fix blobcatcozy

jade stone
#

yop

supple whale
tired vigil
supple whale
#

I remember fighting it when I needed dynamic Json imports of metadata which has like some 2k files which totals 200MB

supple whale
#

JS eval simply

tired vigil
#

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...

▶ Play video
#

also iirc recently they've made some big perf improvements to JSON.parse and JSON.stringify in v8

supple whale
#

and why it's brainless that vite still doesn't support them

#

fucking webpack did 4 years ago before it eve became standardised

supple whale
#

ideas for fastest way to serialize data from webview -> java -> nodejs?

#

currently using JSON so a string

#

and not too happy with it

tired vigil
#

java? 🤨

supple whale
#

so if i want to communicate or launch my native layer i need to use java

#

no way around it

shrewd canopy
supple whale
#

it already uses java

#

its the thing i want to escape

#

because there's no easy way to serialize JS objects because of it

shrewd canopy
#

Well if you want speed then maybe don't use nodejs and webview mess

supple whale
#

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++

winged mantle
#

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

Gist

The case against Almost Always auto (AAA). GitHub Gist: instantly share code, notes, and snippets.

supple whale
#

i'll sit here and wait

winged mantle
#

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..

supple whale
# shrewd canopy Rust :)

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

lavish frigate
supple whale
#

least insane JS development workflow

lavish frigate
#

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!!!!"

fleet cedar
#

You can't have impl FnMut in locals

lavish frigate
winged mantle
#

also i don't like inlay hints...

fleet cedar
#

I don't like inlay hints, but hover is lovely

winged mantle
#

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

lavish frigate
#

At least for me

#

Why would I read code in anything else

fleet cedar
#

Sometimes you read code on github

#

But mostly for skimming, and inferred types is fine for that

royal nymph
#

I always read code on github

supple whale
#

neat, i can see how horrificly inefficient my phone is

supple whale
#

😛

ivory heath
#

I love how fucked up video software is that no one knows what’s happening

dense sand
#

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

tired vigil
#

Isn't this basically what an arena is

ivory heath
#

Kinda

dense sand
ivory heath
#

Why not self manage the memory

dense sand
ivory heath
#

Segment the memory yourself

dense sand
#

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

ivory heath
#

I’m assuming this isn’t anything massive

dense sand
ivory heath
#

Oof

dense sand
#

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?

lavish frigate
#

im glad github cli makes that easy

valid jetty
#

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
deep mulch
#

@valid jetty hiii

winged mantle
#

i don't want to clone a whole project and wait for all of its dependencies to i nstall

ivory heath
#

Even when I was working on some Google projects that are massive that was never a issue

winged mantle
#

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

ivory heath
winged mantle
#

yes

still jolt
#

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

winged mantle
#

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

still jolt
#

kotlin extensions are so nice to work with, but yeah, having to open up IntelliJ on every Kotlin project would be a pain

winged mantle
#

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

still jolt
#

bad example but works ```kt
repeat(x) { ... }
(0..<x).forEach { ... }
(1..x).forEach { ... }
for(it in (0..<x)) { ... }

still jolt
winged mantle
#

i prefer it for java

#

i don't really enjoy jetbrains ides

still jolt
winged mantle
#

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

still jolt
#

it makes the code read more like just english words which I kinda like, but I see how people could dislike it

winged mantle
#

in notepad or anything

still jolt
#

¯\_(ツ)_/¯ Kotlin/Native is also nice

still jolt
winged mantle
#

you're not viewing the file...

#

you're viewing differences

still jolt
#

well

#

fair

#

that's a hilarious name but could be useful for someone blobcatcozystars

winged mantle
#

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)

still jolt
winged mantle
#

find will give you the first thing only

still jolt
#

well, yes, but you have to do .map().find() if you'd wanna emulate firstNotNullOfOrNull

#

yeah it's just a for-loop

still jolt
winged mantle
#

yeah it creates pyramids

#

easy to end up with excessive indentation

lavish frigate
#

Peoples overobsession with keeping the line count as small as possible hurt the larger community so much

tired vigil
still jolt
#

fair ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

royal nymph
#

tsx

#

atrocious

tired vigil
#

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

still jolt
tired vigil
#

🙄

winged mantle
#

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

fleet cedar
winged mantle
#

so you can just have the function to map and check critiria separate

fleet cedar
#

Avoids duplicating checks and stuff

winged mantle
#

and it's built into the language so people don't have to learn your utils

fleet cedar
#

Yes that name is nonsense

still jolt
#

there's probably worse

winged mantle
#

isn't kotlin basically c+++++

#

because java is c++++

#

kotlin is c+=3

still jolt
#

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)

winged mantle
#

just use go or c#

still jolt
#

too lazy to learn go and c# is horror to use

deep mulch
#

@winged mantle

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

still jolt
#

and kotlin if you want your X to be 100MB and slow it down with gc for some reason? blobcatcozystars

winged mantle
#

yes

deep mulch
#

I mean most sane devs wouldn't use Kotlin native if speed is important

winged mantle
#

using kotlin is premature pessimisation

deep mulch
#

jb is improving the native memory model and binary size last I checked

winged mantle
#

speak the language of your cpu\

deep mulch
#

@winged mantle speaks assembly

winged mantle
#

x86 assmembly, with keywords translated to french

still jolt
#

x86 assembly with kotlin extensions ​​​​​​​​​​​​​​​​​​​​

winged mantle
#

fun main() {
mov(eax, 10)
add(eax, 1)
}

deep mulch
#

soon

still jolt
#
operator fun eax.plus(other: Int) = add(this, other)
fun main() {
    mov(eax, 10)
    eax += 1
}
deep mulch
#

I will add assembly to kotler

winged mantle
#

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:

deep mulch
#

I like micro optimizing

winged mantle
#

how do you declare a function as having internal linkage in kotlin

deep mulch
#

internal fun

#

@winged mantle

valid jetty
#

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
lavish frigate
fleet cedar
jade stone
supple whale
#

thats an iterator

#

not an array

#

i think

jade stone
#

oh neat

#

idk .values was a thing to get an iterator

supple whale
#

yeah its not used too commonly

#

iterators for sync data doesnt make much sense in JS

#

for async that changes doe

jade stone
#

oh these are really new

supple whale
#

yerp

#

it doesnt change much tbf

#

instead of doing take(1, map(values())) you now do . chaining

ivory heath
#

Why do people rave about itters

#

Only case I’ve seen use of them is “as completed” on a list of futures

supple whale
#

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

ivory heath
#

Yeah of course I love them for that too

supple whale
#

but sync iterators arent insanely useful, they have their uses, but they arent common imho

ivory heath
#

But literally anything else why do I care about having a fancy for I = 0; I < len; I++

supple whale
#

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

ivory heath
#

sodathink well most maps let you do .keys() or the language has built in itters for them

supple whale
#

yep

#

and thats an iterator

#

:)))))

#

at which point u might as well to .values()

#

and skip the .get(key)

ivory heath
#

Yeah, which is just a list you iterate over

supple whale
#

no an iterator is not a list

#

iterators arent pre-allocated

ivory heath
#

sodathink okay that’s fair

supple whale
#

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

ivory heath
#

Just call a .next() or whatever on the object when I need it

supple whale
#

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

ivory heath
#

You can have state without OOP

supple whale
#

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

placid cape
#

😭

#

this feels weird

royal nymph
#

if anything it should be (a === b) !== c

supple whale
#

this is generic boolean algebra tho?

#

this makes sense

crude star
placid cape
#

python husk

crude star
#

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

ivory heath
#

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

royal nymph
placid cape
royal nymph
#

she will

crude star
#

/run ```py
print(-1 < 0 < 1)

rugged berryBOT
#

Here is your py(3.10.0) output @crude star

True
valid jetty
crude star
valid jetty
#

ive always hated that in python

crude star
#

??

#

its literally parsed the same

ivory heath
crude star
#

english

valid jetty
crude star
#

no you dont

#

that shouldnt parse like that

#

/run ```py
print(-1 < 0 < 1)
print((-1 < 0) < 1)

rugged berryBOT
#

Here is your py(3.10.0) output @crude star

True
False
crude star
#

rosie insane

crude star
#

if you add parens you're explicitly breaking the chain

valid jetty
#

i just meant like

#

the way thge ast is setup

ivory heath
#

Why aren’t () just mandatory

#

Cause fuck remembering order of operations

valid jetty
#

this is what i meant

#

ijust expressed it through code

crude star
#

you'd make a Cmpop node which is n-adic

valid jetty
#

that sounds annoying to turn into IR

#

but i suppose that makes sense

crude star
#

you asked for it

ivory heath
crude star
#

lisp is fundamental

deep mulch
#

lisp scary

lavish frigate
#

I can’t deny that lisp is awesome but I’d appreciate if it was readable to non aliens