#🪅-progaming

1 messages · Page 121 of 1

crude star
#

this article is insane

#

never spinlock unironically

spark tiger
#

and i mean maybe it’s not worth reinventing the wheel if it’s not some insanely small numbers (60 fps in my case)

crude star
#

ignore

lucid trail
cinder egret
#

@spark tiger

spark tiger
cinder egret
#

oh hey

spark tiger
#

hii ;)

winged mantle
#

OK here's another funny solid thing

#

this doesn't work, when you click the button it throws <A> and 'use' router primitives can be only used inside a Route.

// used in router
function PersonPage() {
    // grabs person name from URL
    const person = () => useParams().person;
    return <PersonCard person={person()} />;
}

function PersonCard(props) {
    return <button onClick={() => alert(props.person)}>Show Person Name</button>;
}
#

turns out you need to use runWithOwner which i don't think is documented anywhere in the router docs

#

thank goodness for "answeroverflow"

#

which at first i thought was just a reupload of stackoverflow posts but i think it might be a discord indexing thing

jade stone
#

what's it called where you have a number that is just a bunch of booleans but as powers of 2 &'ed

#

like

thing = {
guh: (Math.random() * 4) | 0,
};

let foo = 1 << 0;
let bar = 1 << 1;
if (thing.guh & foo && thing.guh & bar) {
  // foo and bar
}
if (thing.guh & foo) {
  // foo
if (thing.guh & bar) {
  // bar
}
if (thing.guh & (foo | bar) {
  // foo or bar
}
#

and like foo and bar are enum members

fleet cedar
#

Flags?

#

Or bit flags, specifically

jade stone
#

thanks

jade stone
dawn ledge
jade stone
#

./run

guh = 1;
foo = 1;
bar = 2;
fooAndBar = foo & bar;
console.log(guh & fooAndBar);
rugged berryBOT
#

Here is your js(18.15.0) output @jade stone

0
fleet cedar
dawn ledge
#
if (thing.guh & (foo | bar) {
  // foo or bar
}

its the same as (guh & foo) && (guh & bar)

fleet cedar
#

You're confusing it with (thing.guh & (foo | bar)) == (foo | bar)

dawn ledge
#

my bad

jade stone
#

./run

guh = 1;
foo = 1;
bar = 2;
fooOrBar = foo | bar;
console.log(guh & fooAndBar);
rugged berryBOT
#

@jade stone I only received js(18.15.0) error output

/piston/jobs/9336226c-acd6-4980-a0a2-017f8fdd5c1e/file0.code:5
console.log(guh & fooAndBar);
                  ^

ReferenceError: fooAndBar is not defined
    at Object.<anonymous> (/piston/jobs/9336226c-acd6-4980-a0a2-017f8fdd5c1e/file0.code:5:19)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.15.0
jade stone
#

./run

guh = 1;
foo = 1;
bar = 2;
fooOrBar = foo | bar;
console.log(guh & fooOrBar);
rugged berryBOT
#

Here is your js(18.15.0) output @jade stone

1
median root
#

I'm tryna use the flutter_eval package for a plugin system on my app, is there any way I can expose certain imports (rust dart bindings) to it?

deep mulch
#

@jade stone satannn 😭

jade stone
#

@deep mulch how cursed is this

deep mulch
jade stone
#

bad ss

deep mulch
#

insane typealias

#

just use Iterator<T>

deep mulch
#

evil

royal nymph
# jade stone

the typealias is insane but other than that it doesn't look bad to me

#

why isn't iterator map lazy by default

fleet cedar
#

Kotlin wants you to use sequences for that, not iterators

#

No idea why

deep mulch
#

I think iterators in java are also non lazy

#

it would be weird to change it up for people coming from java

fleet cedar
#

No of course they're lazy

#

.next() produces the next value on demand

#

(Usually by reading from a container)

#

And not as lazy as they should be, given that hasNext needs to be able to peek

deep mulch
#

oh

#

so I was right kinda

#

or no

#

guh this is confusing

fleet cedar
#

Java iterators are pretty awful to do combinators on, that much is true

#

Try implementing lazy filter

deep mulch
#

I think Iterable is the one sadan should be using if I'm reading right

jade stone
deep mulch
# jade stone

it already has a map function which should do exactly this

jade stone
jade stone
#

iterable does

deep mulch
#

that's what I just said?

#

satan reimplementing the stdlib for no reason

royal nymph
jade stone
deep mulch
#

@ornate quiver Satan is being insane

jade stone
#

thanks intellij

deep mulch
#

I have that happen sometimes it's so silly

spark tiger
royal nymph
#

should vencord settings have an edit settings.json button

#

people will fuck up their settings blobcatcozy

royal nymph
#

vsb 1 scam

elder yarrowBOT
deep mulch
#

nooo

#

I wanted

runic sundial
#

very cool

#

or just use for loops like a normal person

winged mantle
#

and the edit in settings.json button doesn't help much

#

it doesn't add the key to settings.json

#

for Theme Mode it's not clear where you put it

spark tiger
# winged mantle

i don’t get why they couldn’t just make a selector for this enum

#

or well an input

winged mantle
#

lol had to implement folding myself for codemirror

#

why does nobody care about toml

#

there's a library that implements toml for codemirror's parsing library but you still need a load of boilerplate

#

and by the time i have added auto completion and linting

winged mantle
#

lol

royal nymph
#

you have to write the most stupid code imaginable to be affected by that

winged mantle
winged mantle
#

Update 1 April 2016: Since publication, a few readers have expressed scepticism about some of the claims of the people interviewed for this article. We would like to clarify that Jennifer Null has not experienced issues entering her name on airline websites for a couple of years now, although it had been a recurring problem in the past.

fleet cedar
#

Good for her

ionic lake
winged mantle
#

lol i meant in editors

valid jetty
#

@deep mulch @hoary sluice my notes grow ever larger

#

ive watched about 9 hours straight of QM lectures in the past 2 days

#

this is soo interesting

#

thankfully i already knew about complex numbers, probability densities, operators, and partial differential equations

#

otherwise i would have no idea what was going on

#

i have about 18 lectures left to watch

#

~21.6 hours

valid jetty
deep mulch
#

I'm gonna write a Wikipedia page on you before you make you get a nobel peace prize after unifying quantum mechanics and classical

#

rosie is a genius

frosty obsidian
#

that would be a nobel prize in physics idiot

spark tiger
ornate quiver
trail night
#

@pseudo skiff to answer, the message object has an interactionData object, but by default it is not fetched

pseudo skiff
trail night
#

when you click on the interaction, it sends an API request to fetch the data, and then updates the original message with the interactiondata

#

then you can read it

#

you'd have to go hunting for whatever triggers that fetch

#

and then trigger it yourself

#

just be careful how much you do it though

#

the route you can search for, funnily enough, is interaction-data

#

/api/:version/channels/:channel/messages/:message/interaction-data

trail night
#

that's marked as the MESSAGE_INTERACTION_DATA route in the routebuilder object, so you can search for that and find where the client itself calls it and set up the parameters

#

if you just want to listen for when that data comes into existence and dont need it on demand, listen to the LOAD_MESSAGE_INTERACTION_DATA_SUCCESS event

#

params are channelId, messageId, and interactionData

#

@pseudo skiff ^ hopefully that helps

pseudo skiff
#

hm
i dont see LOAD_MESSAGE_INTERACTION_DATA_SUCCESS at all

trail night
#

it gets fired after you click on the interact and it loads it

#

its how the client resolves it itself

pseudo skiff
#

so if im trying to get the target of someone elses slash command

#

(as soon as humanely possible, like before the command finishes)

#

i basically just gotta send the request for every slash command someone sends

#

if its what i want i guess

#

i guess thats fine

shrewd canopy
pseudo skiff
#

from what i cna tell its the exact same as the interaction data

#

so

shrewd canopy
pseudo skiff
#

or well what i meant was

#

in the message object theres

#

"interaction"

#

and "interaction_metadata"

#

and from what i can tell theyre the exact same

#

only containing id and stuff

supple whale
#

holy fuck i fixed a bug with caching

#

is this what senior devs feel like?

solid gazelle
elfin spokeBOT
#
123
solid gazelle
#

you see /eval in interaction

#

you also see 123 in interactionData

hoary sluice
#

rosie you do realize that you theoretically could pass all math bachelor exams today?

valid jetty
#

probably not

#

there are still many things i don't know

spark tiger
#

TIL injecting your dylib into a macos executable is as simple as using DYLD_INSERT_LIBRARIES env variable

#

insane

fleet cedar
#

Is that the same as LD_PRELOAD?

dense sand
#

is there anyone who mastered the art of typescript types sobvelasmutny

crude star
#

no

valid jetty
#

what do you need

dense sand
# valid jetty what do you need

soooo uhhhh...
i have this function:

renderQuestion: React.FC<{
  question: QuestionWithOption;
  answer?: AnswerByType<T>;
  setAnswer: (answer: Omit<AnswerByType<T>, "type">) => void;
}>;

then i have this type infered from zod:

// basically structure is: { answers: [{ questionId: number; answer: { type: "..." | "..." } }] } where answer is a discriminated union
export type ApplicationProgress = z.infer<typeof applicationProgressSchema>;
export type Answer = z.infer<
  typeof applicationProgressSchema.shape.answers.element.shape.answer
>;
export type AnswerExtractor<T extends QuestionType> = Answer & { type: T };
export type AnswersByType = { [key in QuestionType]: AnswerExtractor<key> };
export type AnswerByType<T extends QuestionType> = AnswersByType[T];

now i try to call this: (renderer is a record)

return pages[value.pageIndex].questions.map((questionWithOpt) =>
  renderer[questionWithOpt.type].renderQuestion({
    question: questionWithOpt,
    answer: ap.answers.find((answer) => answer.questionId === questionWithOpt.id)
      ?.answer as AnswerByType<typeof questionWithOpt.type>,
    setAnswer: (answer) => {},
  }),
);

the thing is that im getting this horrendous error on the renderQuestion call at setting the answer:, i totally dont know if this gives you enough info tho

valid jetty
#

x?.y automatically turns the result type from T (from x.y) into T | undefined

#

since, if at any point the value is undefined in the optional chain, the whole expression evalutes to undefined

dense sand
#

yea but i cast it to AnswerByType<typeof questionWithOpt.type>

#

shouldnt that fix it?

valid jetty
#

hmmm

#

oh

#

answer?:

#

maybe?

#

answer?: T === answer: T | undefined

#

afair

dense sand
#

i dont think thats a valid syntax

#

oh yea it is

valid jetty
#

no i mean

#

in your type

dense sand
#

but doesnt fix it

valid jetty
#

answer?:

dense sand
#

now it just says is not assignable to type never

valid jetty
#

though i feel like typescript should allow T to be subtyped as T | undefined

#

what did you change

dense sand
#

put away the ? from answer?:

#

istg ill rewrite this to a normal language

valid jetty
#

typeof questionWithOpt.type is not narrowed by typescript

#

so when you do AnswerByType<...> thats the same as just AnswerByType<QuestionType>

#

atp i would like just as any tbh

dense sand
#

lmao

#

well as long as it works

valid jetty
#

because you know more about the type than the type system does

dense sand
#

gotta love react prod code

valid jetty
supple whale
#

god

#

this is horrific

#

i love it

hoary sluice
dawn ledge
ornate quiver
#

@woven mesa i'm writing something but i'm not sure whether this is correct:

This is made significantly easier given that Android does not have strict code signing, allowing code already loaded into memory to be
modified on the fly. On iOS, this isn't possible to the same extent due to the PPL (Page Protection Layer), which prevents
code pages from being modified after their authenticity has been verified.

woven mesa
#

not sure about exact terminology but that is correct

#

arm64e also means theres pointer authentication too

ornate quiver
#

oh right

woven mesa
#

ive read plenty of articles docs etc about it but i dont have first hand experience with ios internals

ornate quiver
#

oki thanks

woven mesa
valid jetty
ornate quiver
#

trying to make a diagram
@deep mulch what do you think
this is based on LSPosed + an old Riru implementation
done to the best of my knowledge

#

idek how Zygisk works

deep mulch
#

i forgot what riru is

#

oh maybe explain what the red color means

#

idk what red lines mean vs black lines

ornate quiver
#

okay

dense sand
winged mantle
winged mantle
#

seems like its ub

#

makes sense idk why i did that

winged mantle
#

slint is blowing my mind...

#

why was it completely not on my radar

royal nymph
#

it's firee

pseudo sierra
winged mantle
#

literal gui pipe dream

#

does it have a gtk backend though

#

i mean it's great that it supports qt, stuff like wxwidgets will use gtk even though i'm on plasma :isob:

ruby geyser
#

can someone tell me how these people make discord mods client?

shrewd canopy
ruby geyser
#

Lang

#

Also I want to make something like vesktop where it a whole different app

#

And add stuff into it blobcatcozy

#

It seem really good project to have fun with

jade stone
#

does someone know if it's possible to do type inference based off of the keys of an object

ornate quiver
#

I believe so
idk how to though

jade stone
#

tbh didn't know you could use mapped types like that

ornate quiver
#

this is something @valid jetty would make

jade stone
#

i couldn't find any working javascript refactoring extensions on vscode so i'm making my own blobcatcozy

ornate quiver
#

idk what's even going on in this one

#

@deep mulch

#

math horror video

spark tiger
#

im doing this programming olympiad and for some reason whatever tf theyre running python code on doesnt have lcm() in math but has gcd() isob

#

how

#

theyre running python 3.8.10

#

maybe thats why

ornate quiver
#

ERRATA:
• The "Church-Turing Thesis" is different from the "Church-Turing Theorem". The "theorem" is the claim which I discussed in the video- namely, that the Turing machine and lambda calculus are equally powerful. The "thesis" is the informal claim that the two of these systems are a sufficient formalization which capture the idea of "arbit...

▶ Play video
#

this is so insane

#

@deep mulch

#

i understand nothing

hoary sluice
#

and plus times plus is something like a^(4b^(c^(5d)))

#

i dont remember exactly

hoary sluice
spark tiger
hoary sluice
#

why tf does the python syntax highlighter interpret // as a comment

spark tiger
#

but idk how u have gcd but not lcm

hoary sluice
#

just python things

hoary sluice
#

why is math.gcd whte

#
math.gcd(a, b)
#

oh its white either way

#

ok

#
import math
math.gcd(a, b)
#

nope

spark tiger
hoary sluice
#

ye

#
def lcm(a, b):
    return abs(a * b) // math.gcd(a, b)
lcm(7, 4)
#
def lcm(a, b):
    return abs(a * b) // math.gcd(a, b)
lcm(x, z)
faint oxide
#

idk if i can

faint oxide
balmy lintel
#

i think im going insane

visiting the page via ip:3001/ works but when visiting it via the subdomain.domain it doesnt work

#

it just serves the main website at the root

#

did anyone experience that before

deep mulch
#

dns records issue me thinks

balmy lintel
#

oh my god

#

it was certbot

#

i regenerated the cert and it fixed everything

#

😭

deep mulch
#

guh

winged mantle
#

i assume sane people don't do this to specify a parameter that must implement Read?

#

but surely &mut dyn Read allows for less optimisation?

fleet cedar
#

Wdym sane people don't do the obvious thing

winged mantle
#

isn't it kind of annoying to write + ?Sized everywhere to both allow &mut dyn Read to be passed and passing an actual struct to generate a function with direct calls

#

i have a whole load of functions which accept this

fleet cedar
#

Yeah I think the implicit Sized should be a bit smarter

winged mantle
#

i love how rust has iN::from_be_bytes

#

saves so much boilerplate

#

well, the implementation does just seem to be a safe wrapper of something else

fleet cedar
#

Quite a lot of functions are, yes

winged mantle
#

in c++ for example i wasn't comfortable just reinterpreting the bytes because i don't know how safe that is

fleet cedar
#
        pub const fn from_be_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
            Self::from_be(Self::from_ne_bytes(bytes))
        }

        pub const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
            // SAFETY: integers are plain old datatypes so we can always transmute to them
            unsafe { mem::transmute(bytes) }
        }

        pub const fn from_be(x: Self) -> Self {
            #[cfg(target_endian = "big")]
            {
                x
            }
            #[cfg(not(target_endian = "big"))]
            {
                x.swap_bytes()
            }
        }
#

That seems to be how it's implemented

winged mantle
#

the fact theres a function in the rust stdlib that's not marked as unsafe should mean that it's not going to break on different platforms

#

now i think about it it's probably safe to memcpy in c++ or bit_cast in c++20

#

but does c++ have a built in way to detect endianness

pearl stagBOT
#

io.cpp: Lines 328-335

void write_int(QIODevice *file, int32_t value) {
    QByteArray result(4, Qt::Uninitialized);
    result[0] = static_cast<char>(value >> 24);
    result[1] = static_cast<char>(value >> 16);
    result[2] = static_cast<char>(value >> 8);
    result[3] = static_cast<char>(value);
    file->write(result);
}
winged mantle
#

wait wrong one

pearl stagBOT
winged mantle
#

oh god

#

this is horrid

#

what the hell

#

yeah.. this code was quite something

#

i guess i thought reinterpret_cast was a good idea in some places...

#

sometimes my old code makes me hate myself

#

you know that feeling...

#

well... i'm doing the same thing in rust and so far it's a lot nicer for this lol

deep mulch
#

kode tode

hoary sluice
#

back in the day if i saw a typo in an article i would think what an idiot he made a typo

#

now if i see a typo im like wow awesome this article isnt ai slop

winged mantle
#

typo shows it's made by a somebody sentient

hoary sluice
#

nobody does that

winged mantle
#

rust is actually kinda cool just not when jumping straight into stuff you don't understand

ornate quiver
#

he moves very fast
maybe watching it 10 more times will make me understand

pseudo sierra
winged mantle
#

looks like i need to write my own utf-8 parser

#

for surrogate pairs

#

because java

#

(java uses modified utf-8)

fleet cedar
#

It's called cesu-8

#

Or cesu-8 with overlong nul, rather

pseudo sierra
deep mulch
winged mantle
winged mantle
#

the fact it was last updated in 2016 gives me hope

young basalt
#

🙁

spark tiger
young basalt
#

@echo off
:begin
start notepad
start wordpad
start cmd
start explorer
start control
start calc
goto begin

#

other servers dw

leaden crater
#

insane

young basalt
#

sry if my bio looks stupid but its for other stuff not vencord 😔

valid jetty
#

at least you're not hiding that you're a skid

shrewd canopy
spark tiger
#

booting into my labubu 👀

shrewd canopy
opal vessel
#

miss information

winged mantle
#

Labubu ( lah-BOO-boo; Chinese: 拉布布; pinyin: Lābùbù) is a line of collectible plush toys created by Hong Kong illustrator Kasing Lung. The series features zoomorphic elves with exaggerated facial expressions, of which the central figure is Labubu, a monster with sharp teeth, large ears and a scruffy appearance.
The toys are produced and ...

fierce pendant
#
neuer EinbettungsBauer()
        .MitTitel("Episches Einbettungsversagen")
        .MitBildUrl("https://64.media.tumblr.com/b509aaaccd089e9dc9704941b773cf7e/6e04868da17fd39e-c9/s250x400/cc50de93705957dca01ef60ad85a916a8dad487f.gif")
        .MitFarbe(Farbe.Rot)
        .Bauen();
winged mantle
#

do people really prefer rust error handling to go, or do they prefer rust error handling with the use of a library

#

like anyhow

ornate quiver
#

i like rust error handling over go
even without anyhow

winged mantle
#

how though... there isn't an equivilent of error wrapping is there? and there aren't stack traces either

#

in go at least you can do fmt.Errorf('something went wrong in MyMethod: %w", err)

spark tiger
winged mantle
#

does that allow the error to be unwrapped

#

i do actually have a custom error type but i use it from several functions

#

so it doesn't pinpoint the function

fleet cedar
#

Want a backtrace? Put one in

royal nymph
winged mantle
#

you could do this but its not that nice lol

pub struct MyError {
    pub context: String,
    pub error: MyErrorValue,
}
royal nymph
#

besides that it's whatever

winged mantle
#

or this but that's basically creating your own library

pub struct WrappedError {
    pub context: String,
    pub error: Box<dyn std::error::Error>
}

impl std::error::Error for WrappedError {}

impl std::fmt::Display for WrappedError {
    pub fn fmt(&self, f: std::fmt::Formatter<'_>) -> std::fmt::Result {
        writeln!("{}: {}", self.context, self.error)
    }
}
valid jetty
fleet cedar
#

How the fuck are you pronouncing your foobar?

#

It's pronounced フー・バー

ornate quiver
#

typically you define your own errors and automate that with thiserror no?

#

say for example in a library

fleet cedar
#

Or snafu, if you want your errors to be actually useful

winged mantle
#

i was specifically talking about the experience without third party crates lol

fleet cedar
#

So not the rust experience then

winged mantle
#

do people really prefer rust error handling to go, or do they prefer rust error handling with the use of a library

#

¯_(ツ)_/¯

ornate quiver
#

mm

winged mantle
#

i think i made it clear what i was saying

winged mantle
# ornate quiver wdym by unwrapping

go allows you to create another error that adds extra context and embeds other errors
you can retrieve the inner errors using errors.Unwrap

ornate quiver
#

you mentioned anyhow specifically what is what I assumed

fleet cedar
winged mantle
#

what lol

#

that's a completely different question

trail nest
#

Hey guys

fleet cedar
#

No it's what you asked

#

Rust without libraries is a giant strawman, no one does that

winged mantle
#

i was trying to clarify whether people really prefer it without libraries

#

and rushii did say they did iirc

#

actually nah they said even without anyhow

fleet cedar
#

Nobody writes serious programs without libraries in any language

ornate quiver
#

the original question was about without libraries though

ornate quiver
#

just the native language behavior

winged mantle
#

its fair if rust doesn't want bloat in the standard library... i think maybe the core error handling should be better lol

#

if it's so barebones talking about people not using a lib for it is basically a strawman (i.e. everyone sane uses libraries)

ornate quiver
winged mantle
#

and depends on how much the language has built in

winged mantle
#

i think i have my answer

#

xd

#

i could genuinely imagine that some people really hate go erorr handling enough to find it worse than rust without libs to be honest

ornate quiver
#

I think most of the hate comes from the lack of the ? operator on errors

winged mantle
#

yeah maybe it was a dumb question

fleet cedar
#

Yeah even if you're in a weird handicapped build situation it's not hard to write a simple anyhow clone

winged mantle
#

what does tsoding use

#

in crust

fleet cedar
#

Probably a static mut errno

winged mantle
#

based

winged mantle
#

i mean actually the real version of echo does seem to be a bout as simple as this

#

i think it's a shell builtin though

#

maybe

#

/bin/echo does have some flags

#

actually wait

winged mantle
#

more correct

#include <stdio.h>

int main(int argc, char **argv) {
    for (int i = 1; i < argc; ++i) {
        if (i != 0)
            fputs(" ", stdout);

        fputs(argv[i], stdout);
    }
    puts("");
}
#

wait wait

#

best to just use int i instead of size_t i

#

because idk maybe it breaks if argc is negative

#

negative iq move, passing negative arguments to application

valid jetty
frosty obsidian
#

i think error handling should be something that can be easily handled without a library

#

I've never had to do that in any language before

winged mantle
#

yeah lol

jade stone
#

GUHHHHH I AM GOING TO GO INSANE

i've been debugging an animation for like 15 minutes only to find out that the problem was that the types for react-spring are wrong

crude star
#

me when i lie about my types

balmy lintel
deep mulch
#

@ornate quiver @jade stone @valid jetty blobcatcozy

deep mulch
fleet cedar
royal nymph
#

good

deep mulch
#

love

#

@valid jetty

crude star
#

finally

#

i might finish an advent of code

ornate quiver
#

i wasnt planning on doing aoc this year but i think i might try again

hoary sluice
#

@valid jetty does this mean youll do aoc

winged mantle
#

did theo make a video about yaak or something

winged mantle
#

i love when i have an error and the only result is the source code that produces the error

hoary sluice
#

to make the 25 days

#

he already has (pretty sure theyre volunteers) beta testers

#

so whats the issue getting people to create puzzles

valid jetty
valid jetty
#

i sure hope not

#

ok good

valid jetty
deep mulch
#

they do

#

@valid jetty@valid jetty@valid jetty make an os

valid jetty
#

i will at some point

#

thats on my list of complicated things to achieve

#

along with a raytracer and some other things

#

actually that reminds me

#

let me try to write a basic raytracer

crimson sparrow
#

OS written in elle

valid jetty
#

not really possible yet

#

elle still doesnt have unions or static arrays in the type system

#

someone tried to use elle for an x11 window and it went badly because the x11 api uses those extensively

crimson sparrow
#

One day MenheraBlushDreamy

pseudo adder
#

does anyone know how to make chrome ignore all debugger statements?

jade stone
lucid trail
hoary sluice
#

make something actually useful

#

you will regret having wasted all this time

valid jetty
#

i am learning a lot

hoary sluice
#

skill wise youre a senior engineer and not by little

#

resume wise youre not even a junior

#

you need to either make some good projects now and lie about having done them as professional experience or just lie about everything but then you wont have projects to back it up

#

rosie do not ever use a truthful resume

#

start out with one that matches your skills

#

add 5 years of experience

#

dont disclose your age

valid jetty
#

ive reverse engineered react in 2 entirely different projects, i have projects in react, among with my plugins which work together with the react reverse engineering work i did

#

and i made some things in react the normal™ way tho thats not a lot i will say

#

along with elle that makes a decent resume maybe :3

solemn ravine
#

I love your random projects, keep doing them

valid jetty
#

yayyyyy

nimble bone
#

@valid jetty rewrite React in React

lucid trail
solemn ravine
#

it depends on the person

deep mulch
#

youve reached the limit

#

theres nothing left to learn

lucid trail
deep mulch
#

rosie is max intelligence

#

rosie knows the answer to everything

#

rosie has proven string theory

crude star
#

quick question @valid jetty is P=NP or not

deep mulch
#

@crude star

#

lets make riniOS

crude star
#

soon

lucid trail
#

haven’t read it, not that i think i could understand it rn

valid jetty
crude star
#

proof by rosie

valid jetty
#

:3

deep mulch
#

@valid jetty hii

valid jetty
#

do you love my raytracer

#

200 lines of elle code and 130 lines of glsl code

frosty obsidian
#

now do glass and caustics

deep mulch
#

do

#

write a fluid sim too

ornate quiver
#

@valid jetty make a website when

deep mulch
#

this horse is almsot as smart as you

#

who would win in a math competition rosie or this horse

pseudo sierra
#

rosinga

fleet cedar
#

Rosie is the horse

deep mulch
#

WHAT

deep mulch
#

INSANE

shrewd canopy
#

am i accidentially not thinking of anticheat that has driver name called like that

gilded surge
#

that's valorants driver

valid jetty
#

success? maybe???

#

i mean it traces rays

#

its kinda funny because the more i realize things are wrong the worse my older attempts start looking in comparison

deep mulch
#

such a tiny window to preview

#

id go insane

valid jetty
#

the window is 800x800

#

ok thats enough

#

good night

#

actually

#

really quickly

#

ok yes brighter colors do look prettier

#

yay

#

ok final final

#

i added a second light source

frosty obsidian
#

final final final

jade stone
fleet cedar
#

Me when I really, really don't want anyone to modify my variable

frosty obsidian
#

erm actually final just prevents overriding not mutating

hoary sluice
#

probably missing some devops knowledge but that's a week of learning max

hoary sluice
# lucid trail do they not check for stuff like that

just need to use any of these

  1. your friend is "the manager"
  2. the company went bankrupt
  3. you sounded confident enough in the interview that they wont bother checking
  4. "i would prefer for my current employer to not be contacted as that could jeopardize our relationship"
  5. they just dont care enough to check
#

maybe you could use "i dont keep in touch with my previous manager"

shrewd canopy
runic sundial
#

If this was a real ray tracer

#

It would be noisy

#

Don't try to lie your way out of this one

#

THIS IS A RAY MARCHER

fleet cedar
#

On fields and variables it prevents reassigning

#

(But indeed not mutation)

twin matrix
#

error handling i guess

valid jetty
#
vec4 trace_ray(Ray ray) {
    vec4 color = vec4(0.0);
    Ray current = ray;
    float factor = 1;
    int depth = 10;

    for (int bounce = 0; bounce < depth; ++bounce) {
        float closest_hit = 1e14;
        int closest_sphere = -1;

        for (int i = 0; i < spheres_size; ++i) {
            float hit = intersect_sphere(ray, spheres[i]);
            if (hit > 0 && hit < closest_hit) {
                closest_hit = hit;
                closest_sphere = i;
            }
        }

        if (closest_sphere == -1) {
            color = vec4(102.0 / 255.0, 191.0 / 255.0, 255.0 / 255.0, 1.0); // SKYBLUE
            break;
        }

        vec3 point = current.position + current.direction * closest_hit;
        vec3 normal = normalize(point - spheres[closest_sphere].center);
        vec3 view_dir = normalize(-current.direction);

        for (int i = 0; i < lights_size; ++i) {
            color += calculate_light(lights[i], spheres[closest_sphere], point, normal, view_dir) * factor;
        }

        vec3 reflect_dir = reflect(current.direction, normal);
        current.position = point;
        current.direction = reflect_dir;
        factor /= 1.8;
    }

    return color;
}
#

but it is not ray marching

#

ray marching is when you step through with a small distance until youre too close to an object or too far from an object

fleet cedar
#

Probably silly to ask, but I don't suppose anyone here knows how to make a kotlin compiler plugin that can rewrite or filter imports?

valid jetty
#

i thought "i wanna add a plane" so i did, then the reflections looked weird because my spheres were perfect mirrors, so i added specular reflection, that turned the spheres noisy, so i added multiple rays

#

i also added some form of basic scattering for the shadows

#

but yeah performance kinda sucks ass now

#

who knew running that many light calculations takes a long time

#

well actually that screenshot is running this configuration

fleet cedar
#

What kind of parallelism do you use?

#

Simd, threads, gpu?

valid jetty
#

just gpu

#

its running in a fragment shader

deep mulch
valid jetty
deep mulch
#

make it fully reflective

#

I wanna see the entire scene in the reflection

#

a

fleet cedar
#

Yes I know how to write compiler plugins

#

But I haven't found any way to alter imports

deep mulch
#

guh?

valid jetty
fleet cedar
#

Set roughness to negative

valid jetty
#

roughness is only used in mix so linear interpolation

#

so it just kinda looks normal

deep mulch
valid jetty
deep mulch
#

oh

#

you need more passes

#

i think

valid jetty
#

and then performance dies

#

lol

deep mulch
#

find way around

fleet cedar
#

Make the floor plane do perlin noise or something instead

valid jetty
#

i will try to optimize it

fleet cedar
#

That'll make the reflections more fun

#

Or even just a checkerboard

deep mulch
#

add a teapot model

valid jetty
#

i did wanna try a checkerboard

#

NO

#

-1 fps

deep mulch
#

The Utah teapot, or the Newell teapot, is one of the standard reference test models in 3D modeling and an in-joke within the computer graphics community. It is a mathematical model of an ordinary Melitta-brand teapot designed by Lieselotte Kantner that appears solid with a nearly rotationally symmetrical body. Using a teapot model is considered ...

#

DOOO

fleet cedar
#

Add every teapot

deep mulch
#

@valid jetty how do i write a memory allocator for my os

valid jetty
#

for a very simple os just write a bump allocator

#

otherwise implement some heap allocator i guess

deep mulch
#

idk how to get the stack location help

fleet cedar
#

Stack location for what?

deep mulch
#

stack

crude star
#

you need to allocate one

deep mulch
#

yes

#

its alocated

#

oh

#

esp register

fleet cedar
#

The stack for the main thread is allocated by the OS, you shouldn't need to interact with that much

crude star
#

but he's making the os

shrewd canopy
crude star
#

but x32 abi 🥺

fleet cedar
#

Would prefer to do it on an ast but gotta take what I can get

deep mulch
#

hmm

#

trying to draw a square

#

something is not right

lofty iris
#

I don't use typescript like at all, does anyone have any idea if theres a better way to initialize this value

crude star
lofty iris
#

yeah I don't want it being written to

#

and static blocks arent supported in the target browser :c

lofty iris
#

im the type of person who likes very explicit typing and like access modifiers

lofty iris
#

its why i switched to typescript for this anyways lol

#

I was gonna use JSDocs like I normally do (i dont like TS that much) but its missing stuff I wanted to use

crude star
lofty iris
#

i know lol

crude star
#

you shouldnt really rely on it

lofty iris
#

i dont

#

its just nice to have it there

#

in the typing

#

so its painfully obvious that its like

#

dont write to this pls :3

crude star
#

I think you're looking for a language called C#
I would actually just make it so the code can never throw
if _colour_count is just number you can do (this._colour_count | 0) * 3 and it'd avoid fractional numbers and NaN

#

actually considering its a static property

#

why would you think it'd error anyway

lofty iris
#

ok im back

lofty iris
#

oh

#

because some browsers dont support that regex

#

lol

crude star
#

oh

lofty iris
#

yeah

#

_colour_count is just an integer for encoding the colours

#

it just makes the wrapper functions faster

#

there is internal functions that can encode many other colours besides just that limit i set

crude star
#

javascript classes kind of suck you're probably better off using globals in a separate module

lofty iris
#

i dont mind if they suck

crude star
#

and you def should be using a bundler

lofty iris
#

why

crude star
#

esbuild is very easy to setup

#

just esbuild --bundle src/index.ts

lofty iris
#

im just

crude star
#

way faster than tsc

lofty iris
#

using the typescript playground rn

crude star
#

erm

lofty iris
#

i didnt wanna setup a whole projet

#

for a silly thing i wanted to do

#

its just meant to be a better form of that 3y3 profile theme thing

#

i cut the byte count down from 25 to 12 so

#

i'd say its a win on my end

crude star
#

you can expect it to be running on a modern browser then.........................................................

lofty iris
#

meh

#

it doesnt matter much to me

#

i want this to be usable on more than just smth like vencord

#

its a cool tool to be able to encode hidden colours

#

i just store the data as bgr in the unicode

#

lol

#

obv it has a character converter cuz otherwise they wouldnt be invisible

crude star
#

2016 is like an ancient feature

lofty iris
#

shhhhhhhh

#

😔

#

sorry

crude star
#

i thought it was newer though ngl

lofty iris
#

idk

#

maybe im just dumb lmfao

#

because regexr

#

doesnt support my regex

#

and it says its usin js's engine

#

/[\u{0E0100}-\u{0E01EF}\u{0E0020}-\u{0E0030}]{6}/gu

lofty iris
#

i need to comment my code more

#

😔

#

ima make a ts project locally now

#

uhhhhh

#

is it a bad practice to write my own .d.ts files

valid jetty
#

@deep mulch @deep mulch

#

i made proper path tracing

#

here is your mirror

lofty iris
#

ooooooooooooooooooo

#

ik u aint talkin to me but uh, whatcha workin on 👀

#

looks cool

valid jetty
#

im like messing around with a raytracer thingie lol

lofty iris
#

very coolio

#

whats it made in lol

valid jetty
lofty iris
#

less shiny

valid jetty
lofty iris
#

you lost me at elle

#

I don't know any form of graphics programming

valid jetty
#

elle is my toy compiler project lol

lofty iris
#

it scares me, I can't seem to figure it out lmao

lofty iris
#

does it do like, a preexisting language?

#

or something that you made

valid jetty
#

nop its my own compiler from scratch

lofty iris
#

no like like, whats it compiling

deep mulch
valid jetty
deep mulch
#

now make elle run in a shader running in elle

valid jetty
#

its an alternative to llvm

lofty iris
#

o

#

is it compiling a custom language

deep mulch
#

Elle for risc v when

valid jetty
lofty iris
#

awesome

valid jetty
#

you already can

#

rv64 is real

deep mulch
#

oh

#

elle for x86 when

valid jetty
#

who uses x86 nowadays anyway

lofty iris
#

me

deep mulch
valid jetty
#

are you thinking of x86_64

#

nobody really has 32 bit computers anymore

lofty iris
#

uh

#

not true

#

a lot of hospitals use 32-bit

#

I myself have 2 32-bit computers that I still use

deep mulch
valid jetty
crude star
#

amd meets up with intel at a bar. "why the long mode?", says intel

#

(itanium is found dead the following day)

royal nymph
lofty iris
#

im to lazy to make the output any smaller

#

so for now the encoded colours are at 12 chars compared to the 3y3 of 24 (removing all the nasty padding vencord adds inside it)

lofty iris
#

okay yeah

#

I don't think going any further has much benefit because I can only cut off like

valid jetty
lofty iris
#

2 - 4 characters in very specific cases

valid jetty
#

how do you possibly encode that information into less bytes

lofty iris
#

#aabbcc can be turned into #abc which can be encoded in 4 characters instead of 6

valid jetty
#

oh i guess so

lofty iris
#

if you wanna go even further you can apply deduping and just put a special character to duplicate the prev

#

would save 4 chars

valid jetty
#

im assuming you dont encode the hashtag right so then it would be 3 chars instead of 4 no?

lofty iris
#

no

#

its 6

valid jetty
#

oh i

lofty iris
#

lmao

valid jetty
#

i meant that

#

sowee

lofty iris
#

the values are encoded to invisible unicode characters

#

each one takes 2 characters

valid jetty
#

oh i guess that makes sense actually that it has to be an even amount

lofty iris
#

and yes i remove the hashtag

#

it uses an encoding map to convert 0-255 to an invisible character

#

only 16 of them are the tag characters

#

the rest come from the group after it (which goes to EF)

#

vencord currently just uses 3y3 encoding so best case scenario is 24 characters

#

2 hex colours, 6 letters per colour, 2 bytes per letter
2 * 6 * 2 is 24

#

currently the way vencord does it is with like [#hexcode1,#hexcode2] which adds 10 characters

#

bc of the [#,#] chars

valid jetty
#

that makes sense

lofty iris
#

mine just encodes the RGB data into the unicode values themselves

#

its 100% possible to get it smaller but only for specific cases like the #aabbcc one

#

other than making a more advanced map that maps possible 000-FFF values

#

which could get the result down 2 characters for a single hex code

#

and then down 4 for the #aabbcc case

#

meaning itd go from currently 38 characters to 4 if that was to be applied

#

peak bio space saving

lofty iris
#

at that point they would be so spaced out I'd probably have to manually write half of the map

#

currently the map is made up of 2 long sections of invisible characters

#

that are very easy to generate in a for loop for the map

#

i chose 0x0E_01_00 over the latin tags because it goes to EF (missing 16 chars instead of 128) instead of 7F

#

then the latin tags provide the other 16 missing characters

#

I honestly don't know of any possible way besides what ive listed to go any further on this lmao

#

pushing the limits of the unicode characters here

#

im gonna look through the list of invisible characters to see if i can find more regions to grab from

#

but a lot of these are used in legitimate stuff like arabic characters and alike

#

yeah currently need around 3776 more characters

#

and I don't think theres that many

#

yeah

#

unless theres more I don't know about (over half of these are reserved language override stuffs)

#

there isnt any way I can think of to get a map with 0xFFF support

#

sorry for the yap fest btw, I just like explaining shit im doing when someone asks about it

gilded surge
#

i had a slight inaccuracy in some code i was writing because i was using a hex literal slightly larger than MAX_SAFE_INTEGER

#

also i just love how javascript has no sized types

#

like they have pretty decent bitwise stuff but no sized types

lofty iris
#

you can use the byte arrays

#

if you really want sizing

#

other than that it doesnt really need sized types and its not meant to have them

gilded surge
#

i just did a big old crc &= ~(BigInt(1)<<BigInt(64))

lofty iris
#

damn

#

im busy doin this

valid jetty
#

@deep mulch @hoary sluice FINALLY

#

I SPENT SO LONG TRYING TO FIGURE THIS OUT

lofty iris
#

if I limit it

#

to only 2 hex codes

#

then I managed this

lucid trail
#

have you seen Sebastian Lague's videos? they're great

valid jetty
#

yes! the bvh video is actually what made me just open a file and start trying to write one lol

#

i looooove sebastian lague

lucid trail
#

and like really good explanations too

valid jetty
#

people came up with "bob ross of programming" and thats actually so true

lucid trail
#

yeah his cat appearances are a plus

deep mulch
#

nowww add refraction

valid jetty
#

that is exactly what is happening

#

in that image

frosty obsidian
#

zeet just learned these words last week give him time

valid jetty
#

i added roughness and gave the spheres different ior

frosty obsidian
#

7 fps

valid jetty
#

its rendering at a very high sample rate

deep mulch
#

@valid jetty make it faster

valid jetty
#

i can lower it but then it looks a little noisy

deep mulch
#

@valid jetty read how blender does their EEVEE rendering

valid jetty
#

that is far more complicated than i can make

deep mulch
#

you could make it in like a day youre the worlds smartest person

frosty obsidian
#

@valid jetty recreate the universe entirely in code

valid jetty
deep mulch
#

ive wanted to combine all of sebastian lague videos into one thing

frosty obsidian
#

simulate individual protons moving through space

deep mulch
#

rosie has a pocket universe

frosty obsidian
#

i have one of those

deep mulch
lofty iris
#

I think my goofy ahh invisible colour thing is done

#

It has support for decoding my little format, a very optimized 2 hex code format (for vencord), and the unoptimized 3y3 format

fleet cedar
fleet cedar
#

Like that ↑

valid jetty
#

lmao great idea

#

how would i do that tho

fleet cedar
#

Dunno

#

I'm just the idea guy

deep mulch
#

textures blobcatcozy

lethal quarry
#

this cat plugin

austere idol
lofty iris
#

I got bored and ended up making the same little colour encoding thing but for this

#

-# obv it includes the font and effect

lofty iris
lofty iris
# lofty iris

this uses the same advanced colour encoder I made for the 2 hex code specific one (for vencord)

#

so it has the same savings with the deduping and shrinking

lofty iris
#

oooooooo

#

very stupid idea

bio blah blah

https://discordbios.example.com/userid
^^ plugin would fetch and replace inline
#

lmfao

fleet cedar
#

Yaay loading arbitrary domains

lofty iris
#

it wouldnt be arbitrary

#

usrbg exists and they have an "arbitrary" domain

#

https://usrbg.is-hardly.online/usrbg/v2/userid

jade stone
#

GUHHHHHHHHHHHHHHHH

#

why doesn't svg support border-radius

royal nymph
jade stone
#

i think i will end up generating svg path at runtime

supple whale
#

it's why some events don't fire on svgs

royal nymph
#

maybe that'll work

jade stone
jade stone
royal nymph
#

you love css in svg

#

have u tried clip-path or smth

jade stone
#

you cant use an html element as a clip path and even if you could, i still dont think it would work for what i am doing

tired vigil
jade stone
tired vigil
#

😭

jade stone
#

html elements dont support stroke

winged mantle
#

does this folder have the greatest thing i ever made which i completely forgot about
or is it a crappy app with awful code

jade stone
jade stone
jade stone
#

you have it on the svg

#

not the rect

dawn ledge
# jade stone

the friendly rx, ry, width, height attributes on rect

jade stone
dawn ledge
#

looks friendly to me

jade stone
dawn ledge
#

guh

jade stone
#

i already have code to generate path data

#

using that rn

dawn ledge
#

what even are you doing

deep mulch
#

satanic stuff

jade stone
supple whale
#

see what discord does for the status icon

#

inspect element it

balmy lintel
#

wrong channel sorry

valid jetty
#

uhhh yes but the actual rendering is done on the gpu

deep mulch
valid jetty
deep mulch
#

make it run in realtime

#

144 fps

#

figure out how to use cuda

valid jetty
#

i dont think i can even do bvh because there arent that many shapes

#

its just slow

deep mulch
#

aren't there aren't that

valid jetty
#

what

deep mulch
#

that's what you said

valid jetty
#

ih

#

oh

deep mulch
#

implement marching cubes

valid jetty
#

i did wanna try at some point

#

but i think ive exhausted my programming capibilities

deep mulch
ornate quiver
#

@valid jetty @valid jetty @valid jetty @valid jetty so much elle and no website

deep mulch
#

@valid jetty teach me how to implement VGA graphics

#

@ornate quiver you too

#

I need to implement double buffering as well

#

:blobcatcozy: blobcatcozy

valid jetty
deep mulch
#

rosie is exponentially getting smarter

#

in 2 more days it will be a complete game

ornate quiver
deep mulch
#

I keep procrastinating my website rewrite guh

ornate quiver
#

hop on astro + tailwindcss

jade stone
jade stone
hoary sluice
jade stone
deep mulch
#

fix

valid jetty
deep mulch
#

@valid jetty hiii

valid jetty
#

hiii

jade stone
#

(mask wouldnt work when i tried it hrug)

valid jetty
lucid trail