#programming

1 messages · Page 43 of 1

opaque wharf
#

For one person

opaque sigil
#

My x86-64 is kinda rusty, what is rbx used for here

stark needle
#

will y'all be sad if i explode

sage crag
#

the main thing here is the amount of popping from the stack that is happening

#

i do not trust it

opaque sigil
#

I mean

sage crag
#

this is the program

opaque sigil
#

Doesn't the calling convention say things should be put on the stack

#

Past a couple arguments

stark needle
sage crag
#

which it isnt

stark needle
#

Turing completeness of transformers

sage crag
opaque wharf
opaque sigil
#

Idk I haven't slept yet my brain is kinda mush rn neuroPogHD

sage crag
#

i barely have enough symbols to objdump enub

opaque sigil
#

gl though

#

Also take more samples smh

sage crag
sage crag
#

not my fault the program is too fast

#

...i guess i should increase the loop length

opaque sigil
#

100 neurOMEGALUL

sage crag
#

i forget im not in a vm anymore

sage crag
#

m data

#

3.3kb binary is ok for this

#

still smaller than zig hello world

tender river
#

i mean i guess you'd think they tested it properly and stuff

opaque sigil
#

Now this looks a lot more reasonable already

sage crag
#

if not its mildly concerning

tender river
#

no idea how polling works in perf cupsama

sage crag
#

its only going to give a rough heat distribution

#

i set the polling rate to 50000 when the default is like 1000

#

so theoretically its accurate

#

interestingly there is a lot of time spent in Arena.realloc too somehow 🤔

#

i guess that makes sense if im copying a hundred million elements

opaque sigil
#

Constant resizing would do that yeah

sage crag
#

im already multiplying capacity by 2 each time

#

amortisation already optimal

opaque sigil
#

Preallocate neuroPogHD

sage crag
#

either way its not really a big deal to worry about this while the compiler is doing nothing

sage crag
#

very smart

#

without preallocation

opaque sigil
sage crag
#

with preallocation

opaque sigil
#

I wonder, how does one even figure out which instruction to attribute a sample to

sage crag
#

i like looking at it even though its not perfectly accurate

opaque sigil
#

I guess there's nothing stopping you from inserting some information

#

And treating each instruction as a block

sage crag
#

382 mb vec lol

opaque sigil
#

Are the other 4 functions from libc

sage crag
#

i do not know what they are

#

probably some syscall or page fault handler

opaque sigil
#

Yeah I guess

sage crag
tender river
opaque sigil
#

Only one way to find out

sage crag
#

or more likely its just absolute jumps being inserted in the compiler i guess

tender river
#

but i could literally inspect every register in the API

sage crag
tender river
#

so just record the eip

opaque sigil
#

Hmmm

sage crag
#

m

#

im not interested in making the vec faster for now i think

#

inserting 100 million elements in 220ms is surely enough for anyone

#

also notably goes up to 280ms if you dont preallocate

opaque sigil
#

What's next menherathonk

sage crag
#

useful things that arent simple data structures hopefully

#

file I/O for one

opaque sigil
sage crag
#

unicode characters & strings for another

#

im procrastinating it a bit though

opaque sigil
#

unicode neuroDespair

sage crag
#

its ok i have most of the useful codepoint handling stuff written already in ableos

#

for font loading lol

opaque sigil
#

Ah nice

tender river
# sage crag file I/O for one

i wrote some cursed code that converted stdin and stdout to be nonblocking to play with epoll but ran into some compiler panics with inlining

sage crag
#

why is there async in the most sync language enub

loud lion
#

guys, how good are you at coding you would say?

opaque sigil
#

No

tender river
#

no

sage crag
#

nuh

#

the scale is too large to be meaningful

#

and too vague lol

tender river
loud lion
#

can you say hack into X headquarters?

sage crag
#

yeh totally enub

tender river
#

i cannot confirm nor deny having already done that

sage crag
loud lion
#

SeemsGood

sage crag
tender river
#

stateless code too

sage crag
#

stateless binary

tender river
#

eax? we dont do that here

sage crag
#

e�x and r�x are my favourite registers

loud lion
#

guys, do you know lean4?

tender river
#

i only know lean the proof checker

loud lion
#

yep

sage crag
#

i know of it

tender river
#

oh it looks like lean4 is its implementation

loud lion
#

want to learn how to contribute to the mathlib in lean

opaque sigil
loud lion
#

I wouldn't dare xD

opaque sigil
#

Missed opportunity smh

loud lion
tender river
tender river
#

a proof that type being the type of itself allows you to construct a contradiction, thus proving anything

loud lion
#

so they made it into a theorem?

#

something something they can't add it into an axiom

tender river
#

its hard to prove

tender river
loud lion
#

Aren't there big foundational problems with set theory already with universes?

rigid snow
#

why are we talking about type theory again

tender river
olive sable
#

does this both execute the indented code?

opaque sigil
#

Yes

olive sable
#

huh

#

interesting

loud lion
rigid snow
#

that's how i understand it

ruby timber
#

Yeah

#

Each case isn't its separate scope, that's why when once case executes, if it's not followed by break, the next also executes

opaque sigil
opaque sigil
#

treat it as jumping to the corresponding value and executing from there on

dry charm
#

Also the reason why in multiple languages even though you declare a variable in a case branch, it still complains about duplicate variable name declaration

rigid snow
#

match statements in c++ when

dry charm
#
switch(something) {
  case "a":
    int num = 4;
    break;
  case "b":
    int num = 3; //ERROR: Already declared above
    break;
}

Fun SMILE

olive sable
#

whats the diffrence between match and switch?

rigid snow
#

match is what you expect switch to be, each case is a separate scope

olive sable
#

ahh

#

okay

#

so is it better to use match?

opaque sigil
#

it doesn't exist

#

you don't have a choice

rigid snow
#

(in c++)

olive sable
#

oh

#

fuck

#

ok nvm

dry charm
#

which lang

olive sable
#

C++

dry charm
opaque sigil
#

you can make it work but for the sake of everyone's sanity let's say you cannot

rigid snow
#

macros? neurOMEGALUL

dry charm
#
#define match switch

LULE

olive sable
#

nah

opaque sigil
#

you can have a variadic match function i guess

#

no macros needed

rigid snow
#

oh hell nah

olive sable
#

im having issues cuz the tutorial did everything in 32 bit but i need it in 64 bit bwaadow

#

need to update my sdl stuff

tender river
# loud lion Does type theory solve all the issues present in set theory?

there are ways of solving set theory's problems while staying within the framework of set theory, but in a sense yes, some type theories were designed in a way that allows you to avoid paradoxes, imo you should prefer one over the other based on their other properties (like that type theories are easy to use for automated theorem proving, while set theories are convenient for encoding arbitrary relations or predicates)
in the first place, it depends on what you want to reason about

opaque sigil
tender river
dry charm
#

Most of the languages use Equality check for switch no?
I'm 100% sure Java and Kotlin works

tender river
#

well it wouldnt work in C

olive sable
#

uh

fast pagoda
#

rip

noble zodiac
#

uhm....

rough bloom
#

LULE rip previous conversation

olive sable
#

what got deleted?

noble zodiac
#

that was a little too aggressive

fast pagoda
#

20 messages lolol

#

it DID remove the spam

#

there were only 11 of those tho

sour harness
#

some aggressive cello pounding got deleted

olive sable
#

idk wht that means but sure

tender river
#

rip

olive sable
#

is that automated or did a mod do that anually?

safe path
#

npc it wasn'tm e

noble zodiac
#

very good read, also contains lisp

olive sable
#

lisp sounds like the programminglanguage of snakes

noble zodiac
#

nah thats lisssssssssP

rough bloom
#

speaking of programming languages, Google released their incident report about how they took down half the internet yesterday
https://status.cloud.google.com/incidents/ow5i3PPK96RduMcb1SsW
it was (probably) Go's fault, they didn't handle an error and dereferenced a null pointer
wouldn't have happened with Rust neuroSMH

#

-# there's also a few other factors at play there but let's ignore those and just blame Go

noble zodiac
#

no language will save you if you just dont handle errors

rough bloom
#

but they can try to save you from accidentally not handling errors

fast pagoda
rigid snow
#

what do you mean you manually have to check for each error

fast pagoda
olive sable
#

its a openglneuroHypers
idk why it went to 1.0 tho, it should be 2.0

fast pagoda
#

classic pink default

rigid snow
#

compiling straight to wasm

#

who needs native anyway

fast pagoda
#

For some customers, the monitoring infrastructure they had running on Google Cloud was also failing, leaving them without a signal of the incident or an understanding of the impact to their business and/or infrastructure.
double OOF

rigid snow
#

also if you think using gcp is a good idea you have to know google does not dogfood off gcp at all

#

what they use internally is very different

#

that’s why no google products had an outage

#

maybe gemini

fast pagoda
#

i would imagine that's largely because most of it existed before gcp

rigid snow
#

if i was a gcp customer i would imagine they offered their existing developments on gcp

fast pagoda
#

they definitely have it integrated at least partially

opaque sigil
fast pagoda
#

but the backend for gmail for example wouldve been in place for years

#

not much reason to onboard it to the "platform" as a whole

#

probably just fr that reason too lol

#

backup

#

i know for a while amazon's services were separate from aws as well

#

they have been trying to do otherwise with new stuff

#

i think theyre mostly all aws now though
will issue not skill issue

shadow sinew
# dry charm ``` switch(something) { case "a": int num = 4; break; case "b": ...

The problem is that you're declaring num twice. What you probably want is to declare int num; before the switch statement and then assign either 4 or 3 to it with just num = 4 etc.

BTW you can't switch on strings like this in C++ since you'd just compare the string pointers not the content. This might seem to work in trivial code if you for instance assign a string literal "a" to something since the compiler will figure out that it can use the same memory region for both "a" literals, but it'll fail if you for instance read user input into a buffer and try to compare.
The easiest way to deal with this in C++ is most likely to do an if-else with std::string comparison.

dry charm
noble zodiac
#

switches in C++ support fallthrough so you can end up in multiple different cases

opaque sigil
#

they should just add pattern matching in c++29 neuroPogHD

noble zodiac
#

but you can just create a scope yourself if you really want to so its wahtever

dry charm
opaque sigil
#

okay but that's boring

dry charm
#

In C# I just do the cursed scoping:

switch (something) {
  case "a": {
    var num = 4;
  } break;
  case "b": {
    var num = 3;
  } break;
}

LULE

opaque sigil
#

hey, if it works it works

#

pretty comfy to type too

tender river
#

comfy evilDeadge

#

then again its C# i'm expecting too much

#

when i made some unity mods i did start with C# but it very quickly pushed me out to F#

dry charm
#

it became natural as well

#

it's like a weird lambda

noble zodiac
#

often times thats exactly what it is

tender river
#

explaining lambdas to imperative programmers

#

okay imagine a code block with lazy evaluation

noble zodiac
#

bold of you to assume that people know about lazy evaluation

tender river
#

its ok not all of us understand that the principle "you can use this value as many times as you want" can naturally be extended to "you can pretend this value never existed if you want"

winged kraken
#

hello

sage crag
opaque sigil
sage crag
opaque sigil
#

i wonder

#

would it be possible to detect the base of the numbers you're trying to print

#

probably not right

#

well, at least not with help from the compiler

winged kraken
#

who like the web developer and use javascript ?

olive sable
#

i use JavaScript, but i dont write it so evilShrug

knotty current
#

i wrote javascript once and i dont want to write it again

#

undefined is so wrong

#

why is it not a NameError

sage crag
#

i guess so

#

but it would mean wrapping them

#

so, not happily

#

log.print is mean to take format arguments but i havent done it yet

#

lossy conversion

winged kraken
olive sable
#

neuroHypers le triangle
i forgot how much shit you need to do with the vao's and vbo's.
pyOpenGl had those but i switched to zengl for web support and zengl doesnt have those. i need to relearn them

noble zodiac
#

my condolences

olive sable
#

nooo i have bad parenthesis in my code

#

i shouldnt have copy pasted the vertices

opaque sigil
winged kraken
#

how do you learn , do you use websites or youtube?

olive sable
#

you can, but imo you learn the most from trying to use it and problem solving

#

it is handy to watch a video on it first to get an idea of the syntax and how stuff works

opaque sigil
#

i'm a big fan of jumping down the deep end and forcing myself to learn that way but that doesn't work for everyone

olive sable
#

ye same

#

i barely know C++ but im already trying ot get it to work

sage crag
winged kraken
olive sable
#

tbh when lookign at hbland i couldnt figure out how it worked

opaque sigil
#

one downside of trying/using all kinds of languages is i keep getting the syntax wrong neuroPogHD

olive sable
sage crag
#

why is this the same size as the hashmap code

main := fn(): uint {
    arena := lily.alloc.Arena.new()
    defer arena.deinit()

    // emoji := "😊asd"
    emoji := u8.['h', 'e', 0xC3, 0x28][..]

    string := lily.collections.Utf8String(
        lily.alloc.Arena,
    ).from_utf8_bytes_lossy(&arena, emoji)

    return 0
}
opaque sigil
#

wdym

frozen igloo
opaque sigil
#

also i assume utf8 being under collections is only temporary

sage crag
opaque sigil
#

right

#

oh

#

stdlib?

#

idk how the compiler works, does it just throw in everything

sage crag
#

it should still be smaller

sage crag
#

well, a little bit

winged kraken
sage crag
#

for utf8 strings, they require an allocator, so they go in collections at least for now

opaque sigil
#

i guess fair enough

sage crag
#

not interested in fragmenting it much more than it already is

opaque sigil
#

can put it with a proper string type into its own module later though

sage crag
#

forget OwnedString it doesnt exist any more

opaque sigil
#

where's my 7(?) string types

#

i don't remember how many rust had

olive sable
#

ah yes. this may or may not be what the python code looke like on the right

sage crag
opaque sigil
#

probably more

sage crag
opaque sigil
sage crag
#

i will probably make OwnedUtf8String a separate thing again when i can be bothered

opaque sigil
sage crag
dry charm
rough bloom
sage crag
#

str is just the beginning since you can give it different indirection

#

Box, Arc, Cow, &

opaque sigil
#

found the image neuroPogHD (it's incomplete)

rough bloom
#

you can probably nest Arcs too
I don't think that should count as infinite string types kek

sage crag
opaque sigil
#

Arc<[u8]> should count at least tbf

rough bloom
#

Arc<str> is fair

#

but idk if that even works

sage crag
#

at least in rust, its not a string

tender river
sage crag
#

str and String are guaranteed to be valid utf8, and OsStr and OsString use the encoding of your os

#

CStr is also (valid?) utf8, but its null terminated

#

Path and PathBuf are OsStr and OsString wrappers

#

but byte arrays have no compile time guarantees which rust loves so much life

tender river
sage crag
#

that's crazy

rough bloom
#

it's not UTF-8 but is usually converted to a normal UTF-8 string to be useful

opaque sigil
#

you can turn it into a rust string via utf8 validation iirc

#

yea

sage crag
#

i dont wanna think about small string optimisations

opaque sigil
#

it's about as disgusting as you'd imagine it be

sage crag
#

random nerd sniping xkcd

tender river
rough bloom
#

thonkspin could you just replace the Rust std String implementation with this?

tender river
#

do NOT confuse it with single sign on though
single sign on is NOT fun and NOT easy

tender river
rough bloom
#

yeah, I think so too
could be interesting to try this out and see how it impacts performance for large builds with many dependencies that don't use this optimization

#

neuroNOTED another item added to the "maybe do this someday" list

tender river
#

its possible to create an extension to the language that allows borrows that are independent of the owning object's moves 🤔

#

then sso would break that

#

like a handle that points to an object rather than a specific location, and you have to guarantee that the object lives for that lifetime rather than stays in place for that lifetime

olive sable
#

no branchless programming aquacry

rare bramble
#

branchless programming my beloved

olive sable
#

who needs branch predicition? just dont have branches NeuroClueless

rare bramble
#

so true

opaque wharf
#

I read SSO immediately goes to Single-Sign On lol

opaque sigil
#

this is what big cpu doesn't want you to know

olive sable
#

if statements are the work of satan and should be banished

opaque wharf
#

SSO is easy. Choose a vendor and be done neuroHypers

rough bloom
opaque wharf
#

Because I don't want to touch the technology underlying SSO with a 9ft pole

hoary lion
#

million different :true: variations

#

btw gm

olive sable
#

which true is the one true true?

#

truetruetrue

#

ive said the word to the point that its lost its meaning

hoary lion
#

TRUE... True... true...
-# true...

olive sable
rough bloom
#

there should be a language where booleans are actually probabilities

#

probably exists already

olive sable
#

guys i think im gonna do it.
i think im gonna make this project have seperate files

#

not one monolith

rough bloom
#

clang will thank you

olive sable
#

may the clang be with you

stone cedar
#

But how many translation units? neuroSmug

hoary lion
#

today I finished d3pm paper

#

seems like that one is for the gemini diffusion

olive sable
nocturne olive
opaque wharf
#

As opposed to .h or .hpp

olive sable
#

idk

sage crag
stone cedar
# olive sable idk what that means so 0

Basically everything that the compiler sees on a single invocation is a translation unit.
So having a ton of headers and a single cpp you would still have a single translation unit.

opaque wharf
#

Smells heavenly

sage crag
opaque wharf
#

The white part is coconut milk, don't worry

olive sable
sage crag
#

the compiler can do it better

opaque sigil
#

i can't wait for sam to ditch emscripten neuroPogHD

sage crag
#

and the code will be easier to read

opaque wharf
#

Sometime the compiler could be smarter than you sam

opaque sigil
#

don't try to be smarter than the compiler unless you can prove it, just don't make its life unnecessarily hard

olive sable
sage crag
#

additionally branches are incredibly cheap on modern cpus

opaque wharf
#

Only do optimization afterwards

#

After profiling

opaque sigil
#

gpus HATE branches

olive sable
opaque wharf
#

Like what konii do

sage crag
opaque wharf
sage crag
olive sable
#

glsl shaders xdx

sage crag
#

but its typically a lot harder to optimise a shader than a cpu program

opaque sigil
#

the things we give up for parallelism

opaque wharf
#

I'm no graphics programmer so I don't know the state of GPU programming lol

sage crag
opaque sigil
#

you can just think of it as

cpu = few smart cores
gpu = many stupid cores

tender river
stone cedar
#

Also depends on what you branch, branching on constants or shader input behaves very differently

opaque wharf
#

All I know about gpu world is just from the funny internet man lol

noble zodiac
#

don't remind me of the nonsense I had to do for branchless code in cuda C

tender river
#

if you could borrow a string's data while still allowing the caller to move the string itself without destroying or mutating it

olive sable
#

gpu cores are like tadpoles. there are many but they have no clue what is happening and most of them will die if left alone

sage crag
noble zodiac
#

we even used X macros SMILE

opaque wharf
sage crag
#

me neither im just a numbers junky

olive sable
#

i need more power!!!!!!!
4k fps is for chumps

rough bloom
#

if it's just about performance, then you can already kill the optimization by just putting it in a Box

sage crag
#

unicode garbage is my favourite kind of garbage

rough bloom
#

or are those characters just not rendered properly kek

tender river
winged kraken
#

do you build any projects with c# ?

sage crag
tender river
#

F# is cool C# god forbid (at least its not java i guess)

noble zodiac
#

I only use C# when I'm forced to

sage crag
winged kraken
#

I know the basic of c# it's more simple than c++

tender river
#

its not hard to be simpler than C++

sage crag
#

true...

rough bloom
tender river
#

in fact, a String's moves don't invalidate the &str

sage crag
stone cedar
#

CSM coming along nicely, now I just need to combine them neuroHypers
-# Camera frustrum is shown in yellow, and sun frustrum shown in grey

stark needle
olive sable
#

I just pass the depth to the fragment shader along with a uniform buffer that holds the thresholds to combine them

#

For optimization each depth is on a singl colourchannel in an rgba image

#

That way you dont need to bind 4 image buffers

noble zodiac
#

wait, since when can clippy emit something as an error?

tender river
stone cedar
#

I have also seen many modern games just use a giant image and reserving different areas for different maps, same difference though

noble zodiac
#

since when? never seen that before

tender river
#

i think clippy::never_loops uses that

#

probably

olive sable
#

Otherwise i could do 32K x 32K xdx

stone cedar
#

I have the leisure to not target anything other than the hardware I own SMILE

noble zodiac
#

I'm 95% certain that clippy is wrong, but I'm also 50% certain that I'm often times not right when I say 95%

noble zodiac
#

let me actually verify it before crying foul

tender river
#

no no why would a code analysis tool know better

noble zodiac
#

as expected, clippy is right

olive sable
#

the amount of includes is already getting out of hand

#

i have turned the gl context into a seperate file now neuroHypers

#

idk what the diffrence is between c, cpp, h and hpp but it seems to work

noble zodiac
#

they are for c and c++

olive sable
#

so what about c vs h?

opaque sigil
#

just conventions (that are kind of enforced by the compilers)

#

c source code vs header

#

the idea is that the header files sort of act as an api spec

#

whether that's internal or public for others to use your library

olive sable
#

okay

#

is it normal to have this many includes?

stark needle
#

H files only have the definition

noble zodiac
#

depends on the library but yea, it can be like that

stark needle
#

Not the declaration

#

Otherwise u get annoying import loops and stuff

opaque wharf
stark needle
#

Which is why u also put the IFNDEF or something I don't remember

rough bloom
noble zodiac
#

what you can do is create a prelude.h, put commonly used header in there and then only include that in your actual source files

stark needle
#

But ye u typically never wanna import the .cpp file

opaque sigil
#

codegen neuroPogHD

olive sable
#

the file looks like this. so its just the definition yes

opaque wharf
#

That includes the fn body

olive sable
#

?

opaque wharf
#

Definition is just the function name, return type, and parameters/arguments

olive sable
#

ah

#

im used to the python meaning of def

rough bloom
noble zodiac
#

bold of you to assume that sdl_createwindow won't give you a null pointer

olive sable
#

it works so evilShrug

opaque sigil
#

not like you can do anything without a window

stark needle
stark needle
#

Then in the cpp file u import the .h

opaque wharf
#

I'm sorry okay, my mind is already full of stuff I better not know about lol

stark needle
#

And write the same function again but with body

opaque sigil
#

reject separate headers and source files, embrace single header libraries neuroPogHD

olive sable
#

why woudl i write it twice?

rough bloom
stark needle
olive sable
#

what the point of having it in a seperatew file if i have to put it in the main anyways?

noble zodiac
#

ah C and forward declarations, my beloved

olive sable
opaque sigil
#

it won't when sdl decides not to give you a window

#

but as i said it's not like that matters in this specific case

noble zodiac
#

wdym, its error checking, you do that in case something doesnt work

opaque sigil
#

you'd have to panic either way realistically

rough bloom
noble zodiac
#

there are a million reasons why sdl might fail

stark needle
opaque wharf
stark needle
#

And a function can't be defined + declared twice

olive sable
opaque wharf
stark needle
#

Pragma once my beloved

noble zodiac
olive sable
#

fine

#

lemme backread the other part of the convo

rigid snow
opaque wharf
rigid snow
#

?

olive sable
rigid snow
opaque wharf
rough bloom
# opaque wharf NICE

it wouldn't even necessarily be because of the missing include guard
even if the header is included only once per compilation unit, the symbols from the header are still present in multiple objects when linking

olive sable
olive sable
opaque sigil
olive sable
#

i want to create neuro monopoly eventually

opaque wharf
#

I forgot about that part

rigid snow
opaque sigil
#

there's nothing stopping you from just having a singular header with all definitions either and just including that

#

or not have a header at all but that doesn't work if anyone else is supposed to use your code from outside

opaque wharf
olive sable
#

no its not

#

jsut need to do some websocket shenanigans

rigid snow
#

you’d have to use websockets but that’s it

#

yeah

#

or webrtc lmao

opaque wharf
#

Oh right, I forgot about websocket. Man it's been a long time since I did anything with that

olive sable
#

im not sure how i would do a server tho. ideally a player gets to host so i dont have to maintain a server myself but that invites hacking

rigid snow
tight tinsel
#

damn you apple why cant i forever loop my audio files!!

opaque wharf
#

So you just need a server for signalling

#

Or become a relay in case of NAT

#

STUN and TURN respectively

rigid snow
#

fuck p2p based multiplayer that’s not what i meant

idle dune
#

Anyone know a good tutorial channel for getting into learning JavaScript

rigid snow
#

because when a player’s potato computer becomes a server and i happen to join it i don’t enjoy the 10 game ticks per second

olive sable
#

why are they all learning javascript?

idle dune
#

Despairge JacaScript is used by RPG Maker MV I’m sorry

olive sable
#

why?

#

fuck rpgmaker

opaque wharf
rigid snow
opaque wharf
#

You already have a browser

#

You can already play with JS

olive sable
#

besides like physical effort

opaque wharf
idle dune
#

Despairge I just wanna make a fun retro inspired JRPG and I already own the software

opaque wharf
#

But yeh, I can see why its annoying

olive sable
#

cout << "host error: potato pc, automatically rerouting host connections";

opaque wharf
idle dune
#

I’ll try that

#

Thanks

opaque wharf
olive sable
#

ideally a core or 4 for the game itself an a core for hosting no?

#

so just choose the one with enough cores that also has the highest clock

opaque wharf
olive sable
#

you could still call the seperate procces from the main game tho i think?

#

altho that probably wont work in webgl ye

opaque wharf
olive sable
#

ill see

opaque sigil
#

Webgl is in fact available in web workers

#

If mdn is to be believed

opaque wharf
#

Good to know then. I don't read much the API availability that I don't really use

rigid snow
#

why aren’t threads a thing in wasm neuroSadge

#

there is a proposal tho

olive sable
#

i guess you'l need to go through js then for a worker thread

opaque wharf
rough bloom
olive sable
#

true

rough bloom
rigid snow
olive sable
#

for now i wont be doing p2p yet. the game engine is not even built yet, i have a single polygon on screen

rough bloom
rigid snow
#

exactly

olive sable
winged kraken
#

I have knowledge of the basics of c++ we took oop and data structure but to be honest data structure was not that easy , so now I want to start c# I want to ask if anyone use it too

opaque wharf
#

What if each peer is also a host so the system is basically byzantine general problem neuroHypers

rigid snow
#

actual nightmare

opaque wharf
olive sable
#

p2p is not yet planned

rigid snow
opaque wharf
olive sable
#

what if 2 imported files use the same import? wouldnt the import happen twice then too?

rigid snow
rough bloom
olive sable
#

ohh

#

i get it now

#

fuck

#

noooooooo

opaque wharf
#

Just use #pragma once

olive sable
rough bloom
opaque wharf
olive sable
#

they cant seriously expect me to #ifndef every single import no??????

opaque wharf
rough bloom
olive sable
#

who designed this?

#

fuck them

opaque wharf
#

Just use #pragma man

opaque sigil
noble zodiac
#

someone 50 years ago did

#

those were some dark times man

rigid snow
# opaque wharf No, I do not play GTA after SA

the list of those things include but aren’t limited to: spawn whatever you want, spawn cages around every player, teleport all players to a specific location, explode every player, spawn a giant fucking LOD mirror copy of the map above it, give any weapons to any players, fly in any vehicle, fly without one, etc.
should give you an idea

olive sable
opaque sigil
#

pragmas are compiler hints

#

In this case once for telling it to only include the file once

rough bloom
opaque wharf
#

#pragma once, if the compiler read it on a file, will only process said file once

olive sable
#

start of the main header, or every header?

rough bloom
#

every header catSUS

opaque wharf
olive sable
opaque wharf
#

Unless the header already have ifndef

#

Which probably true for the sdl and other library

olive sable
#

ye but i need to add it to my own ones

opaque wharf
rigid snow
noble zodiac
#

technically #pragma once is a non-standard feature

opaque sigil
#

I love gcc extensions

opaque wharf
olive sable
opaque sigil
#

There's your include guard

opaque wharf
opaque wharf
olive sable
#

tru

opaque wharf
#

Thats include guard

rough bloom
noble zodiac
#

yea, once was considered but rejected

olive sable
#

it does not like pragma in the main.cpp

rigid snow
#

any semblance of good ux? in MY c??

rough bloom
opaque wharf
#

.cpp or .c doesn't need it

olive sable
#

why not?

#

the scope?

opaque sigil
#

3 standardised, rest extensions

opaque wharf
#

Its very technical

rough bloom
maiden geyser
opaque wharf
#

Yeah, thats the simple answer lol

#

I'm bad at explaining shit

#

Without going on a tangent

noble zodiac
#

also with C++20 you could use modules instead. Not that I would recommend it

maiden geyser
#

imagine using c++20

olive sable
#

idk what the diffrence is bu sounds complicated

opaque wharf
#

They have a chance to make it good. Nope, they butchered it

olive sable
#

why do they have a system that does the same thing as the include system?

opaque sigil
#

Because includes suck

maiden geyser
#

because they're stupid?

opaque sigil
#

They're just copy paste

noble zodiac
#

they wanted to modernize it

olive sable
opaque wharf
#

Tl;dr, we just treat module as if it doesn't ever exists

rough bloom
opaque wharf
# olive sable what?

I've said it before, #include is just basically saying "copy whatever is in the file here"

olive sable
#

why would i?

opaque sigil
#

You can include c files too

rough bloom
opaque sigil
#

There's nothing stopping you

opaque wharf
#

I think

opaque sigil
#

It will not

opaque wharf
sour harness
#

Could have used Rust where all that bs is not necessary :D

opaque wharf
rough bloom
#

yeah, or any other remotely modern language really LULE

rigid snow
opaque sigil
#

Let's be realistic, rust would be even more painful

rigid snow
#

not with imports no

opaque sigil
#

At least here he can use opengl 1:1

rigid snow
#

oh that

#

right

rough bloom
rough bloom
rare bramble
olive sable
#

that would mean no support for most browsers so nah

olive sable
#

its not that easy

opaque wharf
#

But also, sam writes his own GLSL so maybe using the same language family is better

rough bloom
olive sable
# olive sable its not that easy

webgl does not have geometry shaders, no tesselation, no CSM without seperate passes.
lower max buffer sizes, lower version of glsl supported, ....

#

and those are things that cant be just translated

#

you need to change the entire shader function

#

but besides that it should be fine

noble zodiac
#

ok, hear me out

olive sable
#

ia m

#

i have no way to stop you

noble zodiac
#

just generate one big <table> with colored cells that are exactly one pixel for every frame

rough bloom
olive sable
#

you mean pass that to the vulkan renderer?

noble zodiac
#

just raw dog that into html

rough bloom
olive sable
#

ok sure, but that would effectivly be wastin 75% of all the gpu's work since it always does 2x2

#

same reason you shouldnt have a lot of small trianlges

noble zodiac
#

and then you just make 1024x768 css variables to control the colors

#

gigabrain

olive sable
#

absolutly not

noble zodiac
#

it would be hilarious tho

olive sable
#

getting the gpu output and then passing it back to the cpu is a really bad idea

#

and im 99.999% sure that wont help with wgpu comaptebilit

rare bramble
olive sable
#

you're doing WHAT

noble zodiac
#

btw this was a joke. The dom parser will get an aneurysma

olive sable
opaque wharf
#

I'm just sitting here, laughing my ass off

rare bramble
rough bloom
opaque wharf
#

See, this is why webdev is fun

opaque wharf
#

The world is your oyster

olive sable
#

preferably just blit it

noble zodiac
#

you cannot put a value on art

rare bramble
olive sable
#

in my experience copying all the data to another framebuffer when not needed uses 15+% of the total rendertime

#

you really shouldnt

fast pagoda
#

refresh running project
try new display for md
it crashed
how could i have anticipated this

noble zodiac
#

also, this time clippy really is wrong, frfr

rough bloom
fast pagoda
#

i like to live dagnerously

opaque wharf
olive sable
#

dagne rously NODDERS

sour harness
#

When unsafe {} is not enough

fast pagoda
#

they made it too tempting to use

#

calling it that

#

well i gotta try dangerously setting it

tender river
sour harness
#

You're only using standard rust generics, can't be that bad

#

Not even any trait boundaries

opaque wharf
#

Are we entering cursed territory then?

gritty dust
#

good morning programming

fast pagoda
rough bloom
opaque wharf
#

Play roulette instead

fast pagoda
#

lmao

olive sable
#

put the shader maker thingy also in a seperate file cuz it felt right.
im doing this purely based on vibes.

#

it is annoying how half these functions are underlined with red cuz they only work in web

#

in ms word you can atleast press ignore

fast pagoda
#

mine are underlined in red from all the import errors and total failures of awareness on my part

opaque wharf
olive sable
#

i dont

fast pagoda
#

i used to write webpages in ms word

#

wordpad

rough bloom
fast pagoda
#

office 97

opaque wharf
#

Ahh yes, I forgot that MS Word can refers to two distinct product

olive sable
opaque wharf
#

People mostly assume MS OFFICE Word

olive sable
#

basicly the opposite of "it works on my machine"

#

cuz it doenst

rough bloom
#

you mean it doesn't compile at all? kek

#

(without Emscripten I mean)

olive sable
#

nope

opaque wharf
olive sable
#

it compiles with emcc src/main.cpp -o main.html -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_SDL_TTF=2 -s MAX_WEBGL_VERSION=2, but besides that it doesnt

rough bloom
# olive sable nope

if you want to target native then I'd consider that an error LULE
if not then fix your VS Code settings neuroSMH

fast pagoda
#

i always fuck up my config somehow and end up with anything installed in the venv undetected by vscode

#

even tho i have it as the env for the editor too

opaque wharf
stone cedar
opaque sigil
#

Look at bear on GitHub

fast pagoda
opaque sigil
#

And point your ide towards that

opaque wharf
#

I think the error squiggle could be removed with proper cmake

olive sable
olive sable
opaque wharf
#

Basically you do this

#if PLATFORM_NAME == "Win32"
...
#else
...
#endif
gritty dust
#

Pog it worked in my setup at school yesterday btw, I got the vision, coefficients, and serial all working together

opaque wharf
#

And when you compile, you set the flag by doing

g++ -o main ./main.cpp -DPLATFORM_NAME=Web
fast pagoda
olive sable
opaque wharf
olive sable
#

ok

opaque wharf
#

This is why cmake and meson exists

#

It lets you setup complex compilation process

olive sable
#

i think im gonna have to make a seperate context.hpp file for local, since the current one has emscripten fuctions

olive sable
rough bloom
# olive sable what about when compiling to wasm?

full command for wasm would be emcc src/main.cpp -o main.html -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_SDL_TTF=2 -s MAX_WEBGL_VERSION=2 -DPLATFORM_NAME=Web
for native it would be something like clang++ src/main.cpp -o main.exe <big list of include directories and objects from libraries here> -DPLATFORM_NAME=Win32

opaque wharf
olive sable
#

im not expecting it to grow much more

#

just need something to read gltf and i should b good

opaque wharf
#

Yeah, for small project I think its still bearable to use makefile

rough bloom
#

yeah, build systems are a major pain

#

probably fine to skip them for now

stone cedar
#

Or just set up your project to be a natural unity build. Then a small batch/bash file will probably suffice

olive sable
#

i forgot this menu existed in win+v
(☆▽☆)

rough bloom
stone cedar
#

In software engineering, a unity build (also known as unified build, jumbo build or blob build) is a method used in C and C++ software development to speed up the compilation of projects by combining multiple translation units into a single one, usually achieved by using include directives to bundle multiple source files into one larger file.

rough bloom
#

horrible

#

please nobody ever do that

opaque wharf
#

Even I, a chaos lover thinks that is not okay

olive sable
#

havinmg the word unity in my pipeline would rruin my image as a homemade game-engine

opaque wharf
#

I don't even know that paradigm existed tbh

#

Who comes up with that

rough bloom
#

never saw it in any actual project either

opaque wharf
rough bloom
#

must be ancient, from times when single-core processors were a common thing

opaque wharf
#

Yeah, that makes sense

rough bloom
olive sable
#

i hate how some programs have comments like //set atttributes right above a function named setAttribute(args)
like brother we can read we know

stone cedar
#

Depends mainly on linker speed yeah, since linking is single threaded and can be a bottleneck.
I am using it right now, but my project is currently only 4.5k loc so not that big. It is kind of reassuring to me to just hit a button and be certain the build system didn't fuck up but that might be just my msbuild PTSD.

nocturne olive
olive sable
tender river
#

might as well use maven for building c++

olive sable
#

might as well not build

#

just ship the code and let the user figure it out

rough bloom
sour harness
#
  Some tensors share memory, this will lead to duplicate memory on disk and potential differences when loading them again: [{'language_model.lm_head.weight', 'language_model.model.embed_tokens.weight'}].
 A potential way to correctly save your model is to use `save_model`.
 More information at https://huggingface.co/docs/safetensors/torch_shared_tensors```"Good job spending one hour quantizing that model. Oh, you want to store the result? Well, I guess sucks to be you then."
Also the proposed "save_model" function does not exist and the linked web page tells me nothing.
rough bloom
#

at least it's using safetensors
pickles were even more cursed imo

sour harness
#

The fact that the ML eco system is built on Python is cursed

olive sable
#

it doesnt seem to like it

rough bloom
opaque wharf
olive sable
#

ah

tender river
sour harness
opaque wharf
stone cedar
opaque wharf
rough bloom
stone cedar
# opaque wharf Oh, right. The unity build...

If it becomes unmaintainable and I feel the need to restructure I'll think about it. But I kinda want to test the waters and see how far I can go. It also looks like mold currently doesn't run on windows so that is also not working for me rn.

rough bloom
#

LLVM lld is also pretty fast and should work on Windows

opaque wharf
#

Then lld

#

But yeah, you do you

#

If it ain't broke, don't fix it

olive sable
stone cedar
rough bloom
opaque wharf
#

Platform is not reserved right?

olive sable
#

nah, for this one i dont have to specify a variable in the build function

olive sable
rough bloom
olive sable
#

i could ye, but do you mean with the include or jsut a file with 3 if statements?

opaque wharf
#

Or you could also do

#ifndef TARGET_PLATFORM
  #ifdef _WIN322
    #define TARGET_PLATFORM "Win32"
  #elif defined(__EMSCRIPTEN__)
    #define TARGET_PLATFORM "Web"
  #else
    #define TARGET_PLATFORM "Fallback"
  #endif
#endif
olive sable
#

this is getting complicated

opaque wharf
#

Nah, just a suggestion

#

Its just over engineering really lol

olive sable
#

no indentation so i cant tell wtf you're even doing

rigid snow
olive sable
#

im hoping it works on linux too, so fallback for that

#

i hope it crashes on imacs tho, out of principle

rigid snow
opaque wharf
olive sable
#

are yo not supposed to use indentation there?
i like readablility

opaque wharf
#

For hblang I think that shit would be cleaner

opaque wharf
nocturne olive
olive sable
#

im beginning to think yall hate making your files readable, and then complain that C++ isnt readable and go to rust

rigid snow
#

it's just convention

#

you can do whatever you want

olive sable
#

C++ convention is bad tho

nocturne olive
opaque wharf
rough bloom
olive sable
#

i dont see why i would need to do that tho

rough bloom
#

you don't need to

rigid snow
#

it's useful to have for when you need it

opaque wharf
#

Its just when someone need to do cross compilation, usually its done that way

olive sable
#

what even is cross compilation?

opaque wharf
#

I should not have said that

rough bloom
olive sable
#

yes

#

thast is true

nocturne olive
#

I think

olive sable
#

but wouldnt just using #ifdef _WIN32 again work?
or is that bad for some reason?

opaque wharf
sage crag
#

and these get checked at compile time

opaque wharf
#

But then if you use the flag, the compilation can be configured by setting the flag manually

g++ <long ass command> -DTARGET_PLATFORM="Win32"
olive sable
rigid snow
olive sable
#

oh

sage crag
olive sable
#

hmmm

opaque wharf
#

Anything with # is compile time only

olive sable
#

ok i see your point

nocturne olive
rigid snow
nocturne olive
sage crag
opaque wharf
rigid snow
#

from this

#

the it being lib

sage crag
tender river
#

the point is that compile time code is a bit special because it can create types and use dynamic values (@Any()), but there are no type objects at runtime. @use returns a type because types are modules

rigid snow
#

so it is compile time code

opaque wharf
sage crag
#

not a macro though.

rough bloom
olive sable
#

ah shit

#

ok

rigid snow
sage crag
tender river
# rigid snow blah blah

it cant replace macros in the general case but it can replace a whole bunch of conditional compilation; the most complicated part is that parameter and return types are allowed to depend on function arguments (same as zig i think) but i wouldnt call it dependent types since its known at compile time

opaque wharf
#

Now here is the fun part. You see the NOT green one? That is your current active compilation target. With proper VSCode config, you can change it by setting the correct compile_commands.json. That means anything that's only valid on the web won't be underlined as error when you are not targeting it

sage crag
tender river
#

also since the functions arent bijective there arent the analogs of infer in typescript

#

you use @Any() or you dont

sage crag
#

you probably could create an arbitrary binary using just the typesystem though

tender river
#

hard to call it a type system when its just running arbitrary code javascript style neurOMEGALUL

rough bloom
sage crag
#

yeah

#

its a typesystem because its a system with types

tender river
#

also, the type system involves a highly sophisticated termination analysis algorithm - running the compile time code for a while and seeing if it terminates

sage crag
#

this is true

#

old compiler handled this better

#

but new one never recieved anything of the sort because we never write incorrect code right evilLightbulbJuice

sour harness
tender river
#

bet the computer is gonna feel really dumb when i unplug it

sage crag
#

i doubt it will feel when you unplug it

#

i think it is gone

tender river
#

in my experience unplugging computers doesn't make them disappear

rough bloom
tender river
#

are you sure you're doing it correctly

tender river
sage crag
#

if i want to implement arithmetic in pure types

#

i can only go up to the 8th fibonacci number before the compiler starts complaining

#

but before then, it works

rough bloom
sage crag
#

this is not a joke

amber fractal
rough bloom
#

so it is just to stop people from putting an infinite loop in the compile-time code

rough bloom
tender river
sage crag
rough bloom
#

$N := Suc(Suc(Suc(Suc(Suc(Suc(Suc(Suc(Zero))))))))
classic

sage crag
#

at the same time

#

its uh

#

not useful

tender river
#

not useful in hblang

opaque wharf
#

Oh wait, it is

opaque wharf
#

Successor

sage crag
#

kinda rude to make a json compiler tbh

rough bloom
tender river