#đŸȘ…-progaming

1 messages · Page 97 of 1

elder yarrowBOT
#

The Vencord Chrome Extension is up to date! (v1.12.4)

lavish cloud
#

Using Compose for things it was never supposed to be used for

shrewd canopy
lavish cloud
#

Currently only text but I'll look into implementing modifiers and layouts later, maybe even animations

shrewd canopy
lavish cloud
supple whale
#

real OG's remember this being done with armor stands in 2014

#

where you'd make an invis nograv armorstand with an always visible name and color that with shit like squares

#

and servers would make massive floating pixel art like that for banners for shit

lavish cloud
#

That shit was obnoxious as hell lmao

ivory heath
#

a word is a byte.

#

dword is double byte

#

qword is quad word, or 32 bits

#

unless "for some god forsaken reason" the isa you use does not have 8bit words, theyre all just byte

#

FUCK

#

no a word is 2 bytes

#

idk WHY i thought it was 8 bits

#

so just double all my math

#

this is unreadable as hell

#

type script with a borrow checker?

#

In pratice its fine.

#

whatever is linking to your translation unit itself must know the size of the class to allocate in memory

#

this is the only way shared libs can even work

ivory heath
# ivory heath In pratice its fine.

If you want to hide private state you do what i did in this class where the class simply holds a pointer to a struct that you hint in the header but only implement within your source file

#

This also simplifies the class header itself a lot

#

its kinda over kill in this case because all it hides is the pointer but oh well

ivory heath
#

C/C++ are the way they are because they have to be

#

theyre systems languages

ivory heath
ornate quiver
ivory heath
strange matrix
crude star
fleet cedar
#

A word is a poorly defined concept which has different meaning in different contexts

crude star
#

32bit cpu word is 32bit and 64bit cpu word is 64bit

lavish frigate
lavish frigate
hoary sluice
crude star
#

đŸ„č

#

this will generate 20 javascript bindings

#

you're literally writing more js like that

lavish frigate
crude star
#

websys is malware

#

4kb of compiled js vs this ```js
let element = document.getElementById("coolElem");
if (!element) throw Error("Could not find element");

element.onclick = e => e.preventDefault();

lavish frigate
#

so true like any sane person i also write the 10 lines that could be js in rust and dont only use it for larger projects where the overhead is relatively tiny

crude star
#

cope

#

i have seen this in the wild

lavish frigate
#

right

crude star
#

and like so many fucking rust web frameworks

#

that all use websys like this

lavish frigate
#

you do know that it all gets bundled together and that overhead is per project and not per file... right..? like if i use web_sys in dioxus and have 20 components it doesnt include that overhead 20 times and while i could then port my app to desktop with electron and mobile with react native or whatever i could also have the exact same code and just do dx build --platform android
besides performance critical components (which do not need the DOM) this is the benefit of writing it in rust

crude star
#

the overhead is per js function

#

also per call because you're switching contexts so often

#

there is exactly zero advantage to using rust web frameworks

#

they're slower than js

crude star
#

my pnpm store is 12gb

#

horror

severe python
shrewd canopy
winged mantle
#

it seems hard to time both 700 clock cycles per second and 60 screen refreshes a second

#

i was just imagining a timeline where with marks for both things and the program sleeps until the soonest mark

#

i should just do ticker

#

(because, of course, it's in go)

#

i politely ask go programemers to stop

spark tiger
#

im tryna make it without any guides just like following the reference, docs, wikipedia n all dat stuff

#

tho im so clueless 😭

winged mantle
#

go

spark tiger
winged mantle
#

i'm finding it pretty easy

#

well... maybe i shouldn't say that yet

#

still need sound

#

and input

#

but i was surprised how i managed to actually get the ibm logo to work

winged mantle
#

horror

native spruce
#

@woven mesa

woven mesa
spark tiger
woven mesa
#

so good

spark tiger
#

i mean obv opcodes but like

#

how did u like make it

native spruce
#

@woven mesa I finished the clipboard storage and monitor yesterday

winged mantle
native spruce
#

its just about ui now really

winged mantle
#

names are bad

spark tiger
#

oh thats kinda smart ngl

#

though how do u get such pattern from two bytes

#

i mean

#

like how does it look in code

native spruce
#

@woven mesa I gotta port over some of your code for previews so we can have an easier time writing them

#

after porting I'm maybe gonna put it on github (private)

#

im more happy with this rn since its super tidy

winged mantle
# spark tiger though how do u get such pattern from two bytes

convert the two bytes to padded hex
(so 224 would become 00E0)
then compare chars between the hex string and pattern for each opcode, treating - as always equal to the input
00E0 would match directly to the 00E0 pattern, and 8AA4 would match to 8--4 (8 == 8, skip A, skip A, 4 == 4)
if you added ---- to the bottom it would act like the default case in a switch, if you added it to the top it would catch everything so it's pretty flexible but i don't think that's really needed lol

#

it's a linear search but i don't think that really matters

winged mantle
#

your're welcome

spark tiger
#

i might try to rewrite mine after i saw that if you don't mind me using your solution (and if i manage to adapt it to zig)

winged mantle
#

no its copyright! /s

spark tiger
#

thankkk

winged mantle
#

currently i'm still facing timing issues

#

everything runs slooow

spark tiger
#

would be so much easier to implement that if zig had inheritance

#

or like ifaces or something

winged mantle
#

i don't even have any interfaces in my code

spark tiger
#

yeah but idk if u can do that in zig

winged mantle
#

pretty sure this approach would work just fine in c

spark tiger
#

well i think i might have seen something like that

winged mantle
#

would be surprised if zig was more limiting than c

spark tiger
#

but that probably look like c func or something

#

though i'm kinda afraid that it would be much slower if, say, i chose to use just switch (bytes)

winged mantle
#

/run

// i'm just including everything just in case
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>

typedef struct {
    char *pattern;
    void (*interpret)();
} Opcode;

void starts_with_ab() {
    printf("Opcode starts with AB");
}

void starts_with_01() {
    printf("Opcode starts with 01");
}

Opcode opcodes[] = {
    {"AB--", starts_with_ab},
    {"01--", starts_with_01}
};

Opcode match_opcode(uint16_t insn) {
    char hex[5];
    sprintf(hex, "%04X", insn);

    for (size_t i = 0; i < sizeof(opcodes) / sizeof(*opcodes); ++i) {
      Opcode opcode = opcodes[i];

      bool match = true;
      char *hexTmp = hex;

      
    printf("cmp: %s / %s\n", hexTmp, opcode.pattern);

      while (*hexTmp != '\0') {
          if (*hexTmp != '-' && *opcode.pattern != *hexTmp) {
              match = false;
              break;
          }
          ++opcode.pattern;
          ++hexTmp;
      }
      
      if (match)
          return opcode;
    }

    return (Opcode) { NULL, NULL };
}

int main() {
    uint16_t insn = 0xAB00;
    Opcode opcode = match_opcode(insn);

    if (opcode.interpret == NULL) {
        fputs("agh!", stderr);
        return EXIT_FAILURE;
    }

    opcode.interpret();
}
rugged berryBOT
#

Here is your c(10.2.0) output @winged mantle

agh!cmp: AB00 / AB--
cmp: AB00 / 01--
winged mantle
#

aerkhjer

#

i would find this easier in c++

#

but it's definitely possible and zig is way more modern

spark tiger
#

yep im gonna give it a try ty

winged mantle
#

i spent so long trying to fix this pointless c code

solemn ravine
#

@woven mesa save view btw

woven mesa
#

so cool

#

love

frosty obsidian
supple whale
#

its incredible how incompetent some developers are

#

fucking made it x3 smaller and x100 more readable

royal nymph
#

declaring variables like this is just horror

supple whale
#

that entire thing is pure horror

#

fucking

#

"return false"

#

at the VERY end of the code

#

💀

royal nymph
#

also wtf zero newlines

#

im gonna kill myself

supple whale
#

it was trully horrid

crude star
#

i thought this was go

supple whale
#

JS

winged mantle
#

my chip 8 interpreter now seeems to work pretty well

lavish frigate
#

honestly kinda crazy

winged mantle
#

i feel like it's a bit messy

#

but i also feel like i made some smart choices

ornate quiver
winged mantle
#

you don't even need to do that in modern c

ornate quiver
#

lol yeah

supple whale
#

there was a

while (!this.someState) {
 // wait for state to change
}

in there

#

mf just full blocked the main thread permanently

shrewd canopy
#

Bro never heard of "events"

supple whale
#

i mean

#

admittedly i hate the situation with events in js as of now

#

nodejs events are amazing, but dont exist outside of node/deno

#

w3c events suck dick, but support abort controllers unlike nodejs events

#

nodejs has

const res = await once(emitter, 'statechange')
#

which is UTTER PEAK

#

but for some reason u cant do

emitter.on('statechange', update, { signal: ctrl.signal })
#

like

#

then nodejs events dont suport event maps

shrewd canopy
#

Its typesafe and provides support for custom events

supple whale
#

i legit need to override types for nodejs events

#

and worst part is i cant even use all the methods, because no polyfill for nodejs events implements everything

#

it got to the point where i just considered copying nodejs's code for it and adding types from deno and publishing it as a package

#

which seemed fairly simple

supple whale
#

thats the funny thing!

#

it doesnt

#

because its not C

winged mantle
#

procrastinated something so long sdl 3 is out

winged mantle
#

help i tried to see how much intel asm i remembered and i couldn't remember hello world

lavish cloud
frosty obsidian
#

insane

#

very cool to see how people play with just the runtime

ivory heath
# supple whale its incredible how incompetent some developers are

okay so maybe the return false at the end can be excused because in school or some fucking reason they teach to only have one return statment at the end.
however why didnt they even do

if (['tcpIncoming', 'tcpOutGoing'].includes(this.type)) {
    // Impl here
} else {
    return false;
} 

or actually why is there a return false here at all?
WHO MADE THIS

#

isnt JS suppsoed to be easy? why is it then a pain to look at

ornate quiver
#

fucking wild

#

go isn't 80/20 is more like 50/20
another garbage article defending golang

#

The entire philosophy behind Go is “developers are dumb so they can’t have nice things, but we’ll make them think it’s a nice thing by having fast compile times”. The amount of time it took to add generics is just inexcusable, I remember when Andrew Garrand came to my uni when Go first came out and being asked about it. But, they already had generics, but you’re too dumb to be allowed to use them.

Also, every fucking second line being error handling is absolute insanity. It’s a testament to just how poor the ability to build abstractions are (give me a monad for f’s sake).

There’s no language that makes me more angry than Go, there are other languages which have their own quirks, but they often have the benefit of “we don’t know better”. Go’s developers did know better, and decided “we do know better” - the arrogance and assumption that all developers are dumb AF is just insulting. I would say that Go just feels like a Google product, but it actually feels like an Apple product, you have to use it their way because you’re too dumb - ironic given that Swift seems to actually be a pretty nice language.

Defer is nice though.
https://old.reddit.com/r/ProgrammerHumor/comments/1lm3hlw/zeroiniteverything/n086kbm/

lavish frigate
#

Practically unlimited budget sure but that doesn’t mean they have to waste budget on stuff the company doesn’t need, especially cross platform support

#

This feels like it was written by someone who thinks all languages except go suck

#

They might actually think that

ivory heath
#

people who complain about go, or praise it are insane

#

its just a tool to be used, it does it how it likes to

#

you can argue if its a pro or con

lavish frigate
#

I don’t mind go I just see no good use for it so I won’t ever see myself care for it

royal nymph
#

he's right

#

go is piss easy / simple and that's why it's good

#

crystal moment

#

crystal is impossible to make a good LSP for

ivory heath
#

packaging sucked in go v1

#

golang is a lot better than it was.

lavish frigate
#

Not sure why you are pointing out that swift part here, compiler speed is mostly irrelevant, especially with incremental compilation, crashy? As in if I search for either both have their issues and crashes? and for the cross platform one
 you are talking about swift
 cross platform is absolutely not a priority and Apple mostly doesn’t care about cross platform


ivory heath
#

swift will try and smartly resolve some characteristics at compile time and if it fails to do it within a reasonable time, will fail to compile

#

why swift does not have deterministic behavior built into the language ie beyond me

solemn ravine
#

The compiler imo is fast enough but the failing because its unable to typecheck at a reasonable time error is super annoying. Though, it would take llvm like 20 minutes to even try to even optimize that code because of its unneedlessly complexity so maybe it isn't too bad after all.

royal nymph
#

I never really used swift but that does sound like bad design

solemn ravine
#

It is yeah

royal nymph
#

if it can't type check in a reasonable time it means your type system is too complex / overengineered

solemn ravine
#

can't say I disagree with that

royal nymph
#

crystal has this same problem

its type system is duck typed (you can write code without any types and the compiler recursively analyses your code to figure out all types)

as you can imagine that process is super slow and that's why there will probably never be a good LSP love

ivory heath
#

no langauge should fail because "code too complicated lol"

#

generics can easily do that with recursion

#

part of why go dodged it for so long

solemn ravine
royal nymph
#

how 😭

solemn ravine
#

If you fix it even if its unneedlessly complex it would compile it

ivory heath
solemn ravine
#

but if its too complex and theres an error, it would just end up erroring with some "unable to typecheck at a reasonable time"

ivory heath
#

so it fails without telling you anything

#

amazing

solemn ravine
#

ye

royal nymph
solemn ravine
#

I dunno really, it's super annoying especially when your project is large (for example feather) where this is prone to happen everywhere

royal nymph
#

that sounds terrible

#

how do people develop like that

#

does that mean your ci could just randomly fail??

solemn ravine
#

nah

#

just make sure it compiles trolley

royal nymph
#

can't believe Apple managed to add gambling to their compiler

#

they should make a betting site where you can bet if your code will compile fine or error with that

ivory heath
#

the devs played too much blue archive

solemn ravine
#

only gamblies when u write stupid code dw..

royal nymph
#

are u saying feather is stupid code galore

solemn ravine
#

nope

#

because it compiles

#

surprised it doesnt even break though because of the amount of bullshit in it

#

@royal nymph one of the github actions for a project I maintain has a race condition and its for compiling c code

#

now thats insane..

royal nymph
#

😭

royal nymph
#

I love race conditions

solemn ravine
#

like

#

its so awful

ivory heath
solemn ravine
#

because I have to rerun the action and wait another 10 minutes

royal nymph
#

this is why I love typescript and go

#

they compile instantly

royal nymph
#

slow compile time makes me not want to use a language

#

especially if even building debug build is slow

solemn ravine
#

wanna fix it

ivory heath
#

sure

royal nymph
#

torture

ivory heath
#

what c lib is it?

royal nymph
#

I would make it a script at that point

#

I hate having to write actions so much

ivory heath
#

WHY IS IT A YAML FILE

#

JUST USE CMAKE LIKE A NORAML FUCKING C DEV

#

HOLY SHIT

#

im not fucking fixing this

royal nymph
solemn ravine
ivory heath
#

oh

#

wait

royal nymph
#

I'm jealous

solemn ravine
#

I hate actions too

royal nymph
#

vencord installer ci is only a few hundred lines and I already wanted to end myself while writing it

#

the fact that it's essentially just trial and error because you can't really test it locally 😭

solemn ravine
#

I can usually just wing a ci unless its for a platform I don't use

royal nymph
#

I remember when I was writing some ci that specifically triggered on prs

so to test my changes I had to push to the main branch, then create a new pr and see if it works

#

almost drove me crazy

solemn ravine
#

hahahaha

#

honestly I hate that I can't properly test actions with different branches

#

unless I have a manual trigger for the action (present in main branch)

#

like whyyy

royal nymph
nimble bone
solemn ravine
#

rosie so real for that tho I do that

#

I squash everything.

royal nymph
nimble bone
solemn ravine
#

I do that everyday

royal nymph
#

yeah but no one uses your software so it doesn't matter 😭

solemn ravine
#

okay bitch

nimble bone
royal nymph
#

I meant nino it's your own fault you typed

solemn ravine
royal nymph
#

imagine if I ever force pushed vencord main branch

nimble bone
royal nymph
#

Also many people would kill me

royal nymph
#

anyone who's building from source

nimble bone
royal nymph
#

I mean yeah but doesn't mean you have to break their setup by force pushing

solemn ravine
#

vencord is one of those projects where everything relies on a single git repo existing

nimble bone
#

every time shit goes wrong in my git history or whatever i delete the local repo delete the fork and remake everything from scratch

#

(vencord)

royal nymph
nimble bone
#

updater api

solemn ravine
#

not sure but im not judging it

royal nymph
#

same thing

solemn ravine
#

if vencord relies on a git repo then thats okay

#

as long as it doesnt break

royal nymph
#

vencord still works without the repo it's just that you can't update

solemn ravine
#

ye

royal nymph
#

exactly the same is true for external update servers and github is definitely more reliable than something I would host xD

#

I mean vencloud has been more reliable than github technically but still

nimble bone
solemn ravine
#

@royal nymph make vencord installer override discord update url

#

vencord updater 2

solemn ravine
#

inb4 vencord vps goes down

#

guys why cant my discord run

royal nymph
#

I think discord is a worse example of depending on some service

nimble bone
#

actually it can do vencord @solemn ravine

royal nymph
#

if discord fails to update you literally can't use it

#

if vencord fails to update you can still use it just fine

solemn ravine
#

vencupdate soon

nimble bone
#

discontinue discord desktop patching and exclusively support vesktop

#

& web ofc

ornate quiver
#

it's simplicity does not make it "good"

royal nymph
#

it is very easy lol

#

it is objectively easier than rust, C or C++

solemn ravine
royal nymph
#

nuh uh...

royal nymph
solemn ravine
#

finished writing the functionality for copying the data back to ur clipboard

solemn ravine
#

seems okay

#

to me at least

royal nymph
#

itemsSet.sortBy { $0.item }

solemn ravine
#

is that uhm

#

what is it

#

ts pmo

royal nymph
#

no 😭

#

js sort is even worse

#

js sort makes you return 1, 0 or -1 and I can never remember which order it goes

solemn ravine
#

i cant tell what that is

royal nymph
#

whaaaa

royal nymph
solemn ravine
#

yeah but what language is it

#

that could be anything

royal nymph
#

none

solemn ravine
#

girl made up a language as an example

#

im crying

royal nymph
#

I showed how it should look in swift with ur example fr

solemn ravine
#

u didnt tell mee!!

royal nymph
#

many languages have sortBy

solemn ravine
#

ye but I just couldnt recognize what your example was xD

ivory heath
#

there are no fancy complex types you have to know

#

does it make some things more verbose to do? yes

#

its not the fucking nightmare that is js, rust, c++, java, kotlin

#

If you try and make a shared lib with go tho so help me god he strikes you down from the sky

royal nymph
#

lmao

#

it wasn't really made for that

#

how does that even work with gc

#

you wouldn't want your shared lib to come with its own gc

ivory heath
ivory heath
#

I would be genuine impressed if someone made a shared lib with go

lavish cloud
valid jetty
#

that’s not just js, any sorting function will want to return a positive, negative, or 0 result to indicate whether it’s less than, greater than, or equal

#

this is done the same way in just about every language i can think of except rust which has its Ordering trait

#

if it was an equation,

comparator(a, b) < 0
res < 0
a - b < 0

bring the b to the other side

a < b

#

but the reason why js sorts negative numbers weirdly

#

is because it converts the numbers to strings and compares them lexicographically

#

which is kinda bad but if you never pass a comparator fn you can’t expect too much

fleet cedar
#

Common property among languages with proper type systems

valid jetty
#

ok fair enough yeah

lucid trail
valid jetty
#

it can’t assert that every value in it is a specific type yeah

#

so it just converts them to a string to get a common representation

lavish frigate
#

okay smart people, what would be the easiest way to just proxy video streams in js?
i have to proxy cdn links for an embed site (like fixvx or whatever) since the original site blocks all discord requests (which leads to the client spamming requests and banning itself from discordapp.com Clueless)

#

just passing along the response seems to cause issues, causing either a complete fail to load or weirdness with video seeking

frosty obsidian
fleet cedar
#

Yep, which returns int

#

In both rust and haskell, the Ord trait returns Ordering

winged mantle
#

why is everything using rust slower in chrome blobcatcozy

#

google wants you to write in go

lavish frigate
#

i mean its true, google doesnt care as much about wasm as mozilla

crude star
tired vigil
fleet cedar
#

No, that's an enum

tired vigil
#

🙄

shrewd canopy
lavish frigate
#

nothing compares to the starship operator in php

crude star
#

we're literally talking about the same thing

lavish frigate
crude star
#

and ermm it comes from C++

lavish frigate
#

Spaceship is a much cooler name which instantly signals to you that this id the worst feature ever

crude star
#

wait it might've been perl

#

of course perl

#

@young flicker

nimble bone
#

@pearl dawn protobuf

pearl dawn
#

love

winged mantle
#

this is more than just an empty c++ project... this is the canvas for my vision

valid jetty
#

i can even "see out" my vision

#

get it

frosty obsidian
#

clion

nimble bone
#

@valid jetty

winged mantle
#

every time i rename a file in clion it crashes my whole desktop session

#

the good news is the file does manage to be renamed after a re start

ivory heath
#

man i love using C in go, its so fucking easy

royal nymph
ivory heath
#

sodathink the only issue really is that you have to force the end user to do manual "free"

#

ex: im writing a wrapper for the ffms lib which itself is a wrapper around the ffmpeg library.
You can get a track which is a member of the index of a container file (ex: mkv).
However said index is owned by the index struct and as soon as the user frees it, well then the track is undefined behavior

#

if the index itself leaves scope without the user freeing it, then it is leaked memory.

#

you can use the go runtime finalizer to add it as a function that runs when it leaves sope, but that is up to the GC and not the end user

native spruce
#

@woven mesa I forgot how goated we were

#

rtf is kinda laggy though honestly

hoary sluice
#

@valid jetty

#

im vibe coding a gedcom viewer

#

i havent written a single line yet

#

or paid a cent

#

when is the project gonna implode

#

im waiting

winged mantle
#

using c++ is making me miss go

supple whale
ivory heath
#

I love c/c++ but I don’t need it half the time

slate reef
ionic lake
#

News flash: you're wrong

ivory heath
#

C++ is a lot safer than c and gives a lot of modern language features

slate reef
#

im wrong most of the time

ionic lake
#

thats ok

#

you have time to correct yourself and thats a good thing

winged mantle
#

method pointers

#

ignore the fact that it has multiple names i decided louis is a nicer name

winged mantle
#

idk c++ is overhated it can be fun

lavish frigate
#

fym overhated

#

valid criticism is far from hate, its still one of the like most used languages and a very widely liked language 😭

ivory heath
ivory heath
winged mantle
#

funny

winged mantle
winged mantle
royal nymph
lavish frigate
royal nymph
lavish frigate
#

reading more of this guys other articles

royal nymph
#

😭
"beat c performance with Go by using... checks notes... assembly"

lavish frigate
#

how did go crash cuz of db and rust didnt

#

100% of this guys articles are "GO ABSOLUTELY FUCKING SUCKS AND IT EXPLODES YOUR ENTIRE INFRA but the code was made in 1 hour instead of 2 months in rust and thats why its better"

royal nymph
#

that's the point

#

yes Rust is better in raw performance but Go is pretty close (more than good enough) and way easier and faster to write

lavish frigate
#

idk bro in one article he goes "The code
 let’s just say, junior devs cried", "Build time tripled" and "Logging was a pain
" for rust then posted the source code and they are 50 line scripts where he completely left out said "logging" and comments (which are present in the go code) from the rust code like i think this guy might just be playing into what people are already saying without actual first hand knowledge
https://archive.ph/32zKo

#

especially funny with the logging when axum already comes with tracing layer support... i guess error!("DB error: {err:?}") (equivalent of his go logging log.Println("DB error:", err)) is too difficult...?

#

like sure what he says can be true but this very much seems like written by someone who is farming for clicks with rust instead of someone who actually uses rust (even if it would just be for these tests)

spark tiger
#

😭😭😭 this fucking guy on youtube shorts is talking about how vscode is good because it’s very lightweight and literally shows a footage where it’s using 1gb of ram 😭

spark tiger
#

right but definitely not as little as he makes it seem

#

zed is much better performance-wise

lavish frigate
#

hard to recommend something on any social media platform when there are no official downloads

#

unless you as the creator want "where is windows download!?!??!?!?!" spammed in your comments

spark tiger
#

that CREATOR had a video “why every developer uses linux” fr

#

he definitely uses linux doesn’t he

lavish frigate
#

they are on windows in the screenshot you sent

spark tiger
#

exactly

#

that’s what i’m saying

ivory heath
ivory heath
ivory heath
#

altho who hand writes asm

#

better off just linking to a C lib that go supports

#

there are some... quirks

#

like _test.go cannot import "C" and c stubs are generated per file to avoid name space colision so its not safe to share raw c types between packages

#

you have to share a unsafe.pointer and then type cast it

#

i wish unsafe made more sense. i have a wrapper around it just so i dont lose my fucking mind

#
package unsafer

import "unsafe"

func CArrayToSlice[T any](ptr unsafe.Pointer, count int) []T {
    if ptr == nil || count <= 0 {
        return nil
    }
    return unsafe.Slice((*T)(ptr), count)
}
lavish frigate
#

and this is an official google presentation

ivory heath
#

google lies out their fucking ass to push whatever agenda they want

#

at google, to move up you have to make a product or a study even if

  1. its bullshit
  2. will die off in 2-5 years
#

this is why the google graveyard is massive

spark tiger
#

the video is literally why vscode is the best code editor

ivory heath
#

most of the features you need from either VScode has

#

theyre a normie

#

they dont think youre gonna be editing source files in the terminal with neovim

spark tiger
#

yeah idk just kinda annoys me how they probably never even heard of anything other than vim vscode vs & jetbrains

lavish frigate
#

they have, they just know their audience and you dont

spark tiger
#

one day zed will become mainstream

lavish frigate
ivory heath
spark tiger
#

just kinda annoys me how they all force that publicly accepted opinions like “all developers hate windows”, “all developers like linux”, “all developers love macbooks”, “all developers prefer laptops over pcs”

lavish frigate
#

i think almost everyone who watches programming youtube shorts is a "normie"

spark tiger
#

it was the first short i saw opening the app fr

lavish frigate
#

so basically

#

you take your phone

#

right

#

and you just

#

quit youtube shorts

#

works every time

ivory heath
spark tiger
#

it works most of the time but yt shorts is fucking insane it makes me scroll it even though i understand that literally all the shorts i get no matter what my algorithm is is like funny moments from simpsons or family guy, dumb tech videos or
 yeah that’s it

spark tiger
spark tiger
ivory heath
# ivory heath excluding mac os which is its own... thing > “all developers hate windows”, “all...

Like lets compile something for linux and windows.

linux)
Compile with clang... and youre done

windows)
for some reason depending on the project MSVC is much faster or slower than clang, neither reaching the speed linux does
Also for some reason fat lto is faster than thin lto. Why? Who knows, because thin is always better on linux.
Oh you wanna build something for windows without msys? use this fucked up ass script that builds everything one by one and manually sets up the linker and compiler includes and just fucking hope it works

#

and i could go ON and ON

#

because ive had entire fucking arguments with people about which is the better compiler arg just to learn they use windows where everything is cursed as shit

#

glibc malloc has its own issues and bugs that are effectively never gonna get fixed but no developer is gonna encounter

#

windows... now windows

#

depending on the compiler malloc is just fucked for certian projects like libsvt

#

so i know people that go through the pain that is aliasing minmalloc to malloc to get it working at all or acceptable performance

spark tiger
#

solution is just use rust fr
though idk maybe it also somehow relies on msys like the compiler or whatever

ivory heath
#

msys is an enviroment to compile c/c++ on windows

#

rust cargo handles all of that

spark tiger
#

okay good

ivory heath
# spark tiger okay good

except when one of your crates relies on c code and then msys becomes a requirement again or face linker hell

spark tiger
#

this is kinda like that pic where everything stands and relies on one small brick blobcatcozy

ivory heath
#

which is c but windows hasnt moved in a direction at all to fix the hell that was created

#

everything is statically compiled on windows because of the hell that is this or uses its own folder with its own versions/dependencies

spark tiger
#

wait i’m a bit confused why do we need msys if there is already msvc

#

most likely i’m misunderstanding something but well i haven’t really had much experience compiling any c/c++

ivory heath
#

on linux, if i wanna use for example zimg i just tell clang++ -lzimg and im done because the zimg.h header is stored globally on my system at /usr/include

#

if youre weird and on ubuntu its probably in /usr/local/include
i can then just tell the linker to use -L/usr/lib -lzimg becase the shared object is located within /usr/lib

#

windows does not have this standard.

spark tiger
ivory heath
#

not EWWWWWWWW you do switch statments like THAT?

spark tiger
#

why are there so many languages it pisses me off 💔

ivory heath
#

cause god hates you

spark tiger
#

no like fr how do i even choose with that many languages nowadays

#

i want to learn something new but i just can’t choose what

#

either rust or c or go or zig

ivory heath
#

I wouldn’t use c to make a web server for example

#

I wouldn’t use JS to make a high performance json parser

spark tiger
#

dunno how to explain it with out one phrase

ivory heath
#

C family or rust would would give you fine easy low level control

#

You can do the same in go but its more of a pain in the ass.

#

Rust is opinionated and i personally don’t like it. I’d recommend trying it and c++ both

#

Zig is a more “modern” c you could say

spark tiger
ivory heath
#

I don’t think you will like rust then

ornate quiver
#

i despise c++ but I love rust

spark tiger
wheat kernel
#

fuck ass guild icon

wheat kernel
#

it scared me

jade stone
#

GUHHHH QT INSANE

#

how does ts work

frosty obsidian
#

no idea how qt works but my guess is you need a parent of some sort

austere idol
# jade stone

i dont know any of qt but try to pass a into pushbuttons as parent or something like that

valid jetty
#

more so than rust

runic sundial
valid jetty
#

1 billion casts

#

interfaces are painful to read

#

generics are comptime functions and not part of the type system hence generic inference isn’t a thing

#

there’s more that i can’t think of right now

hoary sluice
#

@valid jetty you know those gambling sites where you can bet on world events

#

like who will be elected

#

if taylon swift will get married this year

#

we need that but for which year i will push my next commit on github

valid jetty
#

can i bet on your downfall

hoary sluice
#

what do you define as downfall

valid jetty
#

idk lol

hoary sluice
#

i dont have far to fall

#

if i lost all my assets and job it would be a minor inconvenience because i dont own a lot

valid jetty
#

your assets include all the projects you’ve worked on in the past

valid jetty
#

lmao whatever

hoary sluice
#

ok my aoc would take a while to get back and i wouldnt redo it but it also isnt very valuable

valid jetty
hoary sluice
#

gonna commit in 30 minutes and claim my 39 cents of profit

valid jetty
#

wow smh..

hoary sluice
#

you can pay with google play gift cards or monero

#

do not redeem it

valid jetty
#

what is your nationality

#

asking for a friend

hoary sluice
#

i am american sir

#

from new york

#

my name is rebecca

valid jetty
#

ok! i see

#

sending gift cards now (by post)

#

you should receive within 17 working days

hoary sluice
#

thanks

winged mantle
woven mesa
#

horror

native spruce
#

that’s how many the entire project in total has

#

that’s like

woven mesa
#

horror

native spruce
#

nothing

#

Smhhhh

woven mesa
#

so much code

#

needs optimising

native spruce
#

ITS SO LITTLE

#

compared to feather at least

woven mesa
#

true

ivory heath
austere idol
supple whale
#

yes!!!!

#

legit main use for revanced is completly nuking shorts from the app

#

welp now that piholes dont rly work for youtube i guess ad blocking too

valid jetty
#

it’s organized chaos

nimble bone
spark tiger
nimble bone
#

you go against TOS @spark tiger

austere idol
spark tiger
spark tiger
shrewd canopy
lavish cloud
austere idol
lavish cloud
#

oh i meant the innertube api itself, not the api wrapper

#

because for that one you don't need to mess with breaking DRM for a key, the URL already has the key if you pretend to be an android client

austere idol
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

lavish cloud
#

oh I have a solution for that one

#

pacman -Rns nodejs pnpm npm yarn

austere idol
lavish cloud
#

oh in that case uhh

#

fuck what was the command

#

xbps-remove or whatever

austere idol
#

xbps-remove -Ro nodejs pnpm npm yarn or whatever

lavish cloud
#

xbps-remove nodejs pnpm npm yarn

#

yeah that

#

solves all your issues

#

then start using a real language

austere idol
#

i want to build my variation of iosevka

#

i cant just "use a real language"

lavish cloud
austere idol
lavish cloud
#

surely that has a download button somewhere

austere idol
#

cursomizer only gives you a custom config which you can use to compile your own variation of the font

lavish cloud
#

smh

austere idol
#

and you have to because it will not compile it for you

#

i love this kind of guides

supple whale
#

i fucking swear typescript i'm about to loose my shit

jade stone
jade stone
lavish cloud
jade stone
spark tiger
#

coffeescript

jade stone
lavish cloud
#

wasm obv /s

for vencord its fine since it's a webapp, but for generating a font there's no excuse to use something more stable than JS

spark tiger
#

uhhh kinda i guess

supple whale
#

all underlying data for uint8 is always arraybuffer

jade stone
jade stone
jade stone
lavish cloud
#

loaded asynchronously yes (I believe)

#

but then any other communication can be done sync

crude star
#

you can compile wasm synchronously even

jade stone
supple whale
#

nah

crude star
#

inline it

jade stone
#

Also, can you modify object prototypes from WebAssembly?

crude star
#

(husk)

#

no

lavish cloud
#

why would you ever need to

supple whale
#

which is where a fuckload of overhead comes from

#

since you're essentially implementing your own v8::serialize and v8::deserialize in JS

jade stone
#

Patching object prototypes is how vencord grabs webpack

crude star
#

why would you ever rewrite that in wasm

jade stone
jade stone
austere idol
lavish frigate
#

ya

#

wait is that the wrong one

crude star
#

9mb of javascript

lavish frigate
crude star
#

emscripten

lavish frigate
jade stone
#

neat

crude star
#

husk

#

it's 2025

#

ocaml can compile to javascript directly we should just use it

shrewd canopy
#

gopherjs exists

lavish frigate
#

the only use ocaml has in current day is compiling the old rust compiler

crude star
#

sadly true

supple whale
#

you can simply compile asm/wasm to js via asm2js

ivory heath
#

How does one translate a call to the win32.h header/shared DLL to JS

crude star
#

easy just use a 0day in v8

worldly sigil
nimble bone
dense sand
nimble bone
#

if i could ban you for that i would

spark tiger
#

if i could bun you

ivory heath
spark tiger
#

vbun

dense sand
ivory heath
#

Exactly

lavish frigate
#

i still dont get the bun hate

dense sand
#

I had to switch to node

lavish frigate
#

i0 l5y d2t u1e k8s

dense sand
#

K8s is kubernetes

#

No one says the full word bruh

lavish frigate
dense sand
#

Im not spending thst much time

lavish frigate
#

whelp that sucks for us both i guess

nimble bone
visual shellBOT
# nimble bone lc.gem decode (as in; k8s is kumertentes and a11y is accessibility)
decode (as in; k8s is kumertentes and a11y is acc


That's an interesting challenge! It looks like you're asking to decode a series of numeronyms, where a number replaces the letters between the first and last letter of a word.

Let's break them down:

  • i0: This one is a bit tricky as the "0" usually represents the number of omitted letters. With only one letter, "i", and a "0", it's likely a typo or a highly unconventional numeronym. It doesn't follow the standard pattern of having letters between the first and last replaced by a number.

  • l5y: This decodes to lazy.

  • d2t: This decodes to dot.

  • u1e: This decodes to use.

  • k8s: As you correctly identified, this decodes to Kubernetes.


Do you have any other numeronyms you'd like to decode, or perhaps some regular words you'd like to try converting into numeronyms?

lavish frigate
#

so true

ivory heath
#

The more I look at bun vs node js the more I wanna kms

#

A fragmented as hell ecosystem within a language with questionable design decisions that already lacks basic features

tired vigil
supple whale
#

deno legit implements nodejs code 1:1

#

they legit copy-pasted their code into deno

#

so if anything deno is a superset of nodejs

ivory heath
#

i never said anything about deno?

supple whale
#

fuck im retarded

#

sorry

#

im tired didnt read properly and assumed

#

brain mega fried, sry

ivory heath
#

average js dev

supple whale
#

yeah bun is doing giga questionable shit

supple whale
#

i spent 14 hours yesterday implementing RC4 DH symmertic key based encryption

#

and then another 6 hours today

#

im so giga fried its unfunny

ivory heath
#

im gonna compute a shit ton of statistics for multiple video encoders to prove an assumption i had about quality speed optimizations

supple whale
#

unfortunately

#

264 is still the best codec out there for quality

#

265 is close behind

#

everything else is ass

#

and if u want size just do av1

ivory heath
#

everything about that was wrong but okay.

supple whale
#

legit every single encoder would agree with that

#

but ok

#

if you care about MAXIMUM quality, and nothing else 264 is still best

ivory heath
#

near lossless sure whatever x264.

#

for getting transparent or extremely high quality at a small file size x265 and svt-av1 are competitive.

supple whale
#

yeah, i can agree with that

#

at high qualities 265 and av1 are close to the same, and they'd likely trade blows

ivory heath
#

please speak in encoders not bitstream standard

supple whale
#

and if u want to just go size down while having mid to meh quality av1 will beat 265 by landslide

ivory heath
#

libaom cant hold shit to x265, but svt-av1 forks can compete with x265

supple whale
#

nah because encoders change day to day, and i'm speaking about max capabilities of the codec, rather than a specific encoding impl

ivory heath
#

if were talking about theory av1 beats HEVC by a land slide

supple whale
#

yup!

ivory heath
#

but libaom cant sodalove

supple whale
#

intels hardware av1 encoder is actually insanely good

ivory heath
#

vp9 theoretically is better than HEVC, but libvpx is dogshit compared to x265 so AkaShrug

ivory heath
supple whale
#

its not very... performant, like its perf scales way worse with resolution than NVENC, but its size:quality ratio is nuts

supple whale
#

i kinda dislike hevc, it feels like its only popular because shit like nvidia kept pushing it, and not because it was actually needed

#

i mean, at least what he's yapping makes sense and is not some made up bullshiit

jade stone
#

@ivory heath ffmpreg

supple whale
#

;-;

ivory heath
supple whale
#

ah, right hdr, i forgot

#

yeah vp9 was doggy

#

i mean it was used in youtube? that's about all i saw for its use

#

at least it was royalty free

#

but yeah not much going on for it

#

neither quality nor size

ivory heath
#

The only problem was google didnt make 10bit support required in the baseline profile.
Almost every single HEVC decoder supports bare minimum main 10 that requires it.

supple whale
#

overall google's interest in HDR was very minimal

#

both in codecs and how they treated it in their products, ie youtube, android, chromium etc

#

which was annoying

ivory heath
#

HDR is a fucking mess in of itself.
google simply made it worse.

supple whale
#

i meaaan

#

for a lot of software sure, but

#

now that chromium has hdr support its insanely good

#

like the software support for hdr in chromium is imho industry leading, at least as a developer that has created modules and implementations around chromium's hdr support

ivory heath
#

chrome does not support dolby vision, chrome also does not have the best tone mapping or scaling

supple whale
#

you can just.... take a bitmap/image "screenshot" of a HDR video, paint it to a canvas, boom that canvas has the HDR metadata, save it to png/jpeg? boom has hdr metadata

supple whale
#

but not in a way you can verify it

#

its a very touchy-feely topic because chromium supports almost every video and audio format in the world

#

even AC4

#

but they wont let u decode video with that metadata because they block it

#

and u need a lot of fuckery to make sure it doesnt block it

#

GIGA annoying as a dev who wants to ship electron apps with extra media codecs

#

i mean i get its because of licensing

#

still fucking annoying

ivory heath
#

I mean you can convert DV to HDR10+ and then display it which chrome does support

supple whale
#

chrome by default only does wia videwine content to my knowledge?\

#

tho last time i checked that was.... 2 years ago

#

so maybe that changed

#

but i rememeber tyring it on the cyberpunk anime with dv metadata and shit was just green XD

ivory heath
supple whale
#

yeah

#

i hate it enough to not bother remembering the name

#

fuck widevine

#

fuck it

ivory heath
#

anyways if you didnt know about it you should try av1an

supple whale
#

i saw it, but the encoding times dont align with my ADHD

#

so i couldnt be bothered playing with it

#

shit takes WAAAAAAAAAAAAAAAAAAAAAY too long

ivory heath
#

av1an makes encodes pausable and supposed to make them faster.

#

were you trying to use target quality or something?

#

if youre using like --preset 6 in svt with a <=8 core cpu guess it does not make that much sense

supple whale
#

ill consider it once they have hardware accel via intel gpus ngl

#

i'm running a 5800x3d and naaaah

#

just naaah

#

i'm a web dev, for me a compile time of 2s is a lot

ivory heath
supple whale
#

when i see native compile times of 30 minutes i fucking shake

supple whale
#

but yeah i assumed that too

ivory heath
#

target quality with hw encoders is cursed as shit and a waste of time

supple whale
#

yeah pretty much

ivory heath
#

this is the first time in months. would you like to know something about video or audio encoding?

supple whale
#

OH

#

ME

#

i want an in place ac3/eac3 to ANY audio transmuxer

#

needs to work with partial streams

#

all you have is the header/metadata of the file

ivory heath
#

ffmpeg?

supple whale
#

nope, libav

ivory heath
#

that is ffmpeg

supple whale
#

no

#

thats 10% of ffmpeg

ivory heath
#

its most of it

ivory heath
supple whale
#

yes but u cant do libav -i input.mp4 -vf fps=1 out%d.png

#

thats an ffmpeg thing

#

libav is just a lib that helps with container decoding

ivory heath
#

libavformat and libavcodec are apart of libav and will help you with your cursed remuxing

supple whale
# ivory heath i can answer later but WHY?

because browsers dont support ac3/eac3 outside widevine, so we wrote a lib which transmux video streams real time from say mkv to MSE, and now we're making the part which converts unsupported audio codecs into... most likely PCM

#

for shit like firefox, safari or android

ivory heath
#

why not opus and aac?

supple whale
#

why opus or aac?

#

its just extra work

#

this is on the client, there's 0 reason to re-encode the audio into another format

#

just... play it as is

ivory heath
#

opus is the most efficent audio codec and is stupidly fast, aac is most widely supported. both are faster and less datarate than fucking PCM

supple whale
#

yeah but... that doesnt matter

#

you're just adding extra steps

#

this is not on the server

#

this is on the client

#

the data is already there

#

why waste CPU encoding it, when the data is already there, you just need to play it

ivory heath
#

yeah and i can transcode opus at 300x real time with 1 thread

supple whale
#

cool

#

but why

ivory heath
#

so im sending 1/10 the data or less?

supple whale
#

yes but you're not sending any data at all?

#

so 1/10 of 0 is still 0?

lavish frigate
ivory heath
#

storing? what are you doing

supple whale
#

playing it back

ivory heath
ivory heath
supple whale
#

this is a 1st in the world solution btw

lavish frigate
supple whale
#

its crazy no1 else in the world did this b4

ivory heath
#

i just use MPV

supple whale
#

all people did was "yeah lets compile all of ffmpeg into wasm, and take the ENTIRE video, load it ALL into memory, and then transcode the ENTIRE video"

#

just.... stream it pls

supple whale
ivory heath
#

yeah its just ffmpeg

supple whale
#

getting HDR working in it makes me want to kms, getting cropping in it makes me want to kms, getting subtitles to render correctly with hdr makes me want to kms

#

there's no fucking ui

#

just holy fuck

#

please

ivory heath
#

all of that works for me lol

supple whale
#

yeah after u spent 14 hours configuring it sure

#

and people are confused why there's so many VLC users, because normies just want shit that works, not shit that you need to spent all day setting up

#

// rant

spark tiger
supple whale
#

@ivory heath attack this man

spark tiger
#

like what else am i supposed to use

supple whale
#

i agree its great because its simple to use, and it just fucking works

ivory heath
#

im playing games with my wife. i will later

supple whale
#

but it has.... a lot of problems

#

with shit like color spaces, subtitle performance and a lot of other shit

spark tiger
#

not like i don't watch any videos other than my shadowplay gameplay

supple whale
#

pretty much yeah

ivory heath
#

used to av1 used like double or triple the cpu usage in vlc because they used a outdated as shit version of their own fucking software (dav1d)

spark tiger
ivory heath
#

join the cult

supple whale
#

i have a growing pain with av1

#

because av1 could be used to greatly improve the video quality on the web

#

but instead, it will get worse because it will be used to cut costs, rather than improve the quality

#

and that fact pains me so much its unfunny :(((

ivory heath
#

discord supprots av1 embeds now

supple whale
#

for me it always did

#

PWAcore

#

:)))

spark tiger
#

lc.g av1

visual shellBOT
supple whale
#

that said, i'm yet to get DTS working in chromium at all

#

supposedly the chromecast version of embedded chromium has it, but i was never able to get it to run or decode outside of it

ivory heath
#

i will never understand web devs

supple whale
#

why?

winged mantle
#

my programming philosophy is DRY (do repeat yourself)

supple whale
#

for me webdev is exactly about not repeating myself

#

i dont need 10 native apps with 10 gpu contexts, with 10 system binding interfaces, with 10 file handlers, with 10 cache handlers

#

just have the browser interface all that for me

#

waaaaaay less resources used, as long as you keep as much possible in the browser

lavish frigate
#

😭

supple whale
#

EKHEM STEAM NUKING PERFORMANCE EKHEM

lavish frigate
#

insane people only in this channel

royal nymph
#

including you

lavish frigate
#

yeah

#

and you are part of it too

supple whale
#

that said, electron is a mistake, chrome is just sleeping on IWAs for some fucking reason

ivory heath
winged mantle
#

web dev? more like web pain

supple whale
royal nymph
ivory heath
#

Using web browser for everything

supple whale
#

yep

ivory heath
#

If it was up to me most things would be a TUI app

supple whale
#

if not more

#

its so brokey its unfunny

royal nymph
supple whale
#

next year most likely?

shrewd canopy
royal nymph
#

its over

supple whale
#

im finishing up hayase

#

then doing my paper

#

and then i'm free

supple whale
#

it uses way less resources than native apps if you've already got a browser open

#

and... thats about it

#

actually you know what?

shrewd canopy
#

no thanks I'm not opening 1.58 MB .pdf file

supple whale
#

mostly pictures tbf

#

only like 12-ish pages of text

lavish frigate
#

why would you use any of that

ivory heath
#

I’m just hearing pure cope rn

#

To be honest

shrewd canopy
#

I'd prefer using a native application over web app
they are actually much more speedy and less bloated than web

lavish frigate
#

(except manga reader i guess..?)

ivory heath
#

You’re assuming bloated as shit native apps

lavish frigate
#

operating systems notoriously dont come with image viewers, audio or video players

supple whale