#πŸͺ…-progaming

1 messages Β· Page 43 of 1

hoary sluice
#

ill be doing mandatory military service

#

definitely cant do it at 6 am

#

hopefully ill have time to do it in the evening

valid jetty
#

oh husk

hoary sluice
#

cause women need voting rights

#

even when sending men to mandatory military service

placid cape
#

lol

ornate quiver
spark tiger
dense sand
hoary sluice
ionic lake
#

they should hop on a boxing match, larry elison vs ryan dahl

valid jetty
hoary sluice
#

read ahead messed me up

spark tiger
supple whale
#

i have a css challenge

placid cape
supple whale
#

and fuck i'm 99% sure its not possible

placid cape
#

but I have 30s instead 15s

#

@hoary sluice @valid jetty

supple whale
placid cape
#

Zed team doesn't work on windows support, only community works on it

#

that's why they don't provide windows builds

hoary sluice
placid cape
#

yea I know

valid jetty
#

tape on letter with 10% margin and smooth scroll

formal belfry
#

@woven mesa @woven mesa you said this was possible how

#

@broken shore do you know..

#

I wanna render macos button as image

#

because bored

broken shore
formal belfry
#

idk

hoary sluice
#

i need to learn to type without mistakes

woven mesa
#

like u would normally

atomic brook
hoary sluice
hoary sluice
#

@valid jetty is this husk or blobcatcozy

#[macro_export]
macro_rules! builtin {
    ($name:ident, $location:ident, $($arg_name:ident),* => $body:block) => {
        pub fn $name(args: Vec<Value>, $location: Rc<Location>) -> Result<Value> {
            let mut iter = args.into_iter();
            $(
                let $arg_name = iter.next().ok_or_else(|| Error::new(ErrorKind::InvalidArguments, Rc::clone(&$location)))?;
            )*
            $body
        }
    };
}

#[macro_export]
macro_rules! add_builtins {
    ($($name:ident),*) => {
        pub fn add_builtins() -> HashMap<String, fn(Vec<Value>, Rc<Location>) -> Result<Value>> {
            let mut builtins = HashMap::new();
            $(
                builtins.insert(stringify!($name).to_string(), $name as fn(Vec<Value>, Rc<Location>) -> Result<Value>);
            )*
            builtins
        }
    };
}

builtin!(print, location, value => {
    println!("{}", value);
    Ok(Value::None)
});

builtin!(add, location, a, b => {
    match (a, b) {
        (Value::Integer(a), Value::Integer(b)) => Ok(Value::Integer(a + b)),
        (Value::Float(a), Value::Float(b)) => Ok(Value::Float(a + b)),
        _ => Err(Error::new(ErrorKind::InvalidArguments, Rc::clone(&location))),
    }
});

builtin!(sub, location, a, b => {
    match (a, b) {
        (Value::Integer(a), Value::Integer(b)) => Ok(Value::Integer(a - b)),
        (Value::Float(a), Value::Float(b)) => Ok(Value::Float(a - b)),
        _ => Err(Error::new(ErrorKind::InvalidArguments, Rc::clone(&location))),
    }
});

add_builtins!(print, add, sub);
fleet cedar
#

Shouldn't you do some check that there aren't too many args?

hoary sluice
#

thats next

#

after currying

fleet cedar
#

You are checking that there's not too few arguments though

hoary sluice
#

i added auto print here cause you cant chain functions yet

hoary sluice
#

im not checking that theres too many compared to the type definition

#
fn : a b c
fn a b = a + b
fn 7 7

is valid

#

it just ignores the part behind the :

fallen nebula
#

Is my mixed usage of C and C++ a Sin or not ?

fleet cedar
#

πŸ”Ž

fallen nebula
still jolt
#

I use C-way if it's better/I already know it (like printf) and C++-way if it's more convenient (like std::string)

#

probably also a sin

fallen nebula
#

It's exactly what i did

#

I used getline and ifstream because streaming the config lines just feel perfect
But otherwise my code is pretty much C because it kinda just works nicely enough

fleet cedar
#

I don't understand how anyone could be masochistic enough to use strcpy and its ilk when std::string is available

fallen nebula
#

I kinda forgot why

#

But i'm pretty sure i had to use C style strings

#

Also it's like fine

fleet cedar
#

.c_str() exists for when you need that

fallen nebula
#

I think that was the reason

#

Also i'm not annoyed by pointers, null, malloc, etc

viscid grove
#

why am i so slow

#

(this isn't my first attempt)

#

although my first attempt last night somehow i got like 120 wpm i think

#

but forgot to get a good ss

valid jetty
#

ur not slow

#

100+ is good

#

70-90 is avg

#

140+ is like 倖出ろ系

#

or like 草触らγͺい系

viscid grove
#

but look how bad i am at brainfuck :(

hoary sluice
#

progamin

atomic brook
#

Most of them is around 40

dense sand
#

I never learnt how to type with all ten fingers

ornate quiver
#

i just introduced my mom to monkeytype lmao
55wpm english 70wpm russian

atomic brook
#

My friend tried monkeytype in school

#

36wpm English

#

I'm 100% sure that my mom will be even slower

#

My gf was around 45 if I'm not mistaken

ornate quiver
#

lol i thjink i just convinced my mom to try a mechanical kb

viscid grove
ornate quiver
#

i type faster than when I used a membrane ages ago

hoary sluice
hoary sluice
winged mantle
#

why does firefox pack js files into a jar

#

😭 why did discord pick an emoji from another server

#

it has meta-inf and all

dense sand
winged mantle
#

pretty sure firefox has no java code so it's weird

dense sand
#

Idk why webjars exist

spark tiger
keen spoke
winged mantle
#

jar is for java though...

keen spoke
#

java archives can contain resource files and assets, aka files that are not .class

#

relative to classpath those files can be read from the jar through a file pointer in a jar (zip) file system

dense sand
#

perhaps tomcat somhow?

#

again mentioning

keen spoke
#

In firefox case probably whatever runtime they use

dense sand
#

Wow no shit

#

I mean jarfiles are just a zipfiles

#

But I honestly think its webjars, like theres no other use for this

#

Try downloading any webjar and see if the content is similiar

keen spoke
keen spoke
dense sand
#

Ok

dense sand
#

The jar file doesn't contain any classes

#

Only resource related files

#

Why isnt it in a different format then? Why specifically jar

keen spoke
#

(or use internal apis if the runtime is in java)

dense sand
#

Thats extremely unlikely

keen spoke
#

Its 100% either of those

dense sand
#

Why would they do that

keen spoke
keen spoke
#

Fun fact, even YouTube on Android does that

#

Even more fun fact, react native does that

#

Aka discord for android

dense sand
#

Webview shit isnt it

#

Webjars are used similiarly

keen spoke
#

"webview" is a broad term

#

React native renders on an android view

#

Can be considered a "webview"

dense sand
#

Well react native uses native components

keen spoke
#

Huh

#

Native to?

dense sand
#

The platform

#

It targets

keen spoke
#

A system runs off multiple platforms, you mean the runtime platform or the host platform

keen spoke
# dense sand It targets

Uhh, i don't think it supports AOT compilation. RN saves a bundle.js or cjs aka js bytecode and the RN runtime implemented natively to android runs it

dense sand
#

That means, that react native will e.g. for text use androids native text component

keen spoke
#

Uhh

#

Fr?

dense sand
#

Yea iirc

keen spoke
dense sand
#

Never worked with it

keen spoke
#

Flutter compiles dart AOT to host platform code (iirc)

dense sand
#

I suppose they have wrapper library for each platform

keen spoke
#

Aka native, not dalvik/art

#

Which is what android textview is

#

And i dont think RN does dalvik/art either

dense sand
#

I mean the flutters approach would sound most suitable

keen spoke
#

Both is suited, RN is a runtime, the same way dalvik is

#

Or art (android runtime)

#

RN runs .js files, art runs .dex files

#

Both are implemented native to the host (android)

#

You can have a fully native android apk, zero dalvik/vm

#

So you can launch a RN runtime without any dalvik runtime

dense sand
#

Thats not true

#

Atleast

keen spoke
#

It is true

dense sand
#

I dont think so

keen spoke
#

Hold on

dense sand
#

Doesnt your react native app compile to apk?

#

That means that it has classes.dex

keen spoke
#

(its easier)

#

But android NDK provides all android apis natively

#

RN technically can be developed entirely without needing dalvik apis

dense sand
#

Just dont use react native at all and you're good

keen spoke
#

Why

#

Either you use .dex or .js

#

Same deal

dense sand
#

Better alternatives

#

Just use flutter or sum

keen spoke
#

I mean, js is dynamically typed, java is statically typed

#

Whatever suits your needs

keen spoke
dense sand
#

Kmp looks good too

keen spoke
#

Shitass dev env, shitass language dart

keen spoke
#

You mean kotlin

dense sand
#

No

keen spoke
#

You do

dense sand
#

Kmp can target android

#

It will give you the apk

keen spoke
#

KMP is a build system framework. It just applies the android plugin to the module

#

And the kotlin plugin to register kotlin/ as a src and compile via kotlinc

#

So what gives you the apk is simply the android gradle plugin

#

Kmp is just orchestrating it for you in the build system cleanly

dense sand
#

Cool

keen spoke
#

Kotlin compiles to .class the same way java does. Then d8 from android transpiles .class to .dex

#

The android plugin and kotlin plugin in gradle work together to pull that off

keen spoke
dense sand
#

Not an android dev here tho

keen spoke
#

Kotlin is goated

dense sand
#

Yea

#

Agreed

#

I did aoc last year in it

#

I like it more and more

#

Definitely better for gradle than groovy

keen spoke
dense sand
#

Groovy dsl is horrible

keen spoke
#

Good thing gradle switched to declarative kotlin

dense sand
#

Yup

#

Developing gradle plugins in kotlin was actually enjoyable

#

Altough gradle api itself is still ass

keen spoke
#

Gradle is cool too, since its driven by plugins. Theres a java, kotlin but also even a node js or cpp plugin etc

keen spoke
#

But it needs to be complex to be flexible

dense sand
#

It lacks proper documentation

#

For developing plugins

keen spoke
#

Well docs is difficult especially for a rapid changing api at such a scale

dense sand
#

I had to ask multiple times on forums cuz I couldn't find some stuff

keen spoke
dense sand
#

But other than that it's quite enjoyable to use

keen spoke
dense sand
#

Well its been quite a while since i made plugins too lol, so perhaps things changed

keen spoke
ornate quiver
keen spoke
ornate quiver
#

yeah

ornate quiver
keen spoke
#

The analogy is wrong

winged mantle
#

i just wrote !== nullptr

#

😭

hoary sluice
#

also my backup codes are written on paper so just burn the paper cause its insecure

dense sand
#

thanks for letting me know

nimble bone
#

i don't save backup codes

austere anchor
dense sand
#

i dont even save my 2fa backups

#

i love when i have to commit name this

nimble bone
jade stone
austere anchor
#

do yall know if this is good way of seperation or not

#

should i be making a seperate crate for cli?

austere anchor
nimble bone
#

i have no opinions but i can tell that it is Blazingly Fast and Memory Safe

austere anchor
#

this used to just be the cli+lib combined into files

#

(i.e. without the cli folder)

valid jetty
valid jetty
#

because if yes then that’s fine

valid jetty
#

both

#

is apticket.rs completely different to cli/apticket.rs but they’re linked in some way

austere anchor
#

you mean img3.rs and cli/img3.rs? then yes

valid jetty
#

then yeah that’s fine

austere anchor
#

no need to separate out the cli from the lib into another crate?

#

hm

#

also @valid jetty which idea is better: having a bunch of const [u8; 4] or an enum solely for consts which implements To<[u8; 4]>

valid jetty
#

you mean Into<[u8; 4]>? enum all the way tho

austere anchor
#

ok cool i shall transform it into enums

austere anchor
#

is there any way to make this better

valid jetty
#

impl Copy which gives you MyType from &MyType and then you shoot 2 birds with 1 stone

austere anchor
#

that's just (&value).into()

valid jetty
#

yeah i meant you no longer need to make it for both owned and roref

austere anchor
#

so

hoary sluice
valid jetty
#

now in landscape mode

hoary sluice
#

disgusting

ornate quiver
valid jetty
#

hope it helps

ornate quiver
#

thanks bestie

hoary sluice
dense sand
#

anonymous hackers once again terror the os internals

hoary sluice
dense sand
#

what exit code is cold blood

hoary sluice
#

1

fleet cedar
valid jetty
#

what exit code is Exception: code turned into hatsune miku

dense sand
#

39

valid jetty
#

true

median root
#

Ok, is it flutter thats eating half a gig of ram or my horrible optimization skills.

dense sand
#

Both

median root
#

Is flutter just not well optimized?

fallen nebula
#

guys i'm becoming a crab

balmy lintel
#

5 billion tabs

fallen nebula
#

i have around 700 tabs rn

#

my browser is my mind
and my mind is a stack

#

and someone forgot to pop

median root
fallen nebula
#

i'm calling function inside of functions inside on functions and that never ends

median root
#

good luck finding your way back

placid cape
#

@hoary sluice how much your hardware for voice assistant cost?

hoary sluice
placid cape
#

nice

#

mine is like 300€ because I don't pay for it

#

so it has rpi 5 8gb ram etc.... xdddd

gray heron
#
<div class="tabs">
      <div class="tab">
        Home
        <button class="close-btn" style="">x</button>
      </div>
      <button class="addTab" aria-selected="true">+</button>
    </div>
.close-btn {
  color: white;
  background: transparent;
  border: none;
  height: 100%;
  margin-top: 0px;
  font-size: 100%;
}
.tabs {
  height: 5vh;
  width: 99vw;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0;
  margin-top: 0px;
  margin-left: 0px;
}
.tabs:first-child {
  margin-left: 0.3vw;
}
.tabs::-webkit-scrollbar {
  display: none; /* For Chrome, Safari, and Opera */
}
.tab {
  display: inline-block;
  padding: 1vh;
  border-radius: 10px;
  border: 0;
  background-color: #25252a;
  color: #ffffff;
  font-size: 2vh;
  height: 2vh;
  line-height: 1.3vh;
  vertical-align: middle;
  box-shadow: 0px 0px 7px 1px #9902b9;
  margin-top: 0.6vh;
  margin-left: 0.1vw;
}
.addTab {
  display: inline-block;
  padding: 1vh;
  border-radius: 10px;
  border: 0;
  background-color: #25252a;
  color: #ffffff;
  font-size: 2vh;
  height: 4vh;
  line-height: 1.3vh;
  vertical-align: middle;
  box-shadow: 0px 0px 7px 1px #9902b9;
  margin-top: 0.6vh;
  margin-left: 0.1vw;
}
.tab:hover {
  background-color: #333333;
}

i cannot for the life of me get the text vertically centered 😭

#

@nimble bone

austere anchor
#

@valid jetty is it a better idea to create a struct that borrows from the data it's read from (&'a [u8]) or make the struct own the data (Vec<u8>)

valid jetty
#

is cloning critical to the performance of your program

austere anchor
#

maximum would be about 200 MBs

#

idk if that's considered large enough for perf issues

ionic lake
#

cloning is bad unless cheap

valid jetty
#

of data in a single vec???

#

is the vec gonna be modified

austere anchor
austere anchor
valid jetty
#

husk

austere anchor
#

but like modified entirely not just one slice

#

for context this would be like img3 ramdisks

valid jetty
#

well then you can have an Rc<Vec<u8>>

#

no lifetime

#

and you can change out the underlying data by just setting the field to a new rc

austere anchor
#

but so is it a good idea to have a reference then?

valid jetty
#

yes

austere anchor
#

hm

valid jetty
#

cloning an array with 200mb of data isn't a very good idea

#

so either have an rc (which is very cheap to clone because it just clones the pointer and increments the ref count) or have a &'a

#

but depending on how you're using the array &'a might be more painful

austere anchor
#

what about a std::borrow::Cow

valid jetty
#

hmmm

#

i think that might be better but you said you don't wanna mutate specific parts of the vec only swap out the whole thing

#

so Cow may not be necessary

austere anchor
#

hm

#

perhaps

austere anchor
valid jetty
#

why would it move the value

austere anchor
#

so then i wonder if there's any perf benefit over straight up moving from the initial data buf to the struct

austere anchor
#

value being T would imply a move

#

i would imagine this is also one of the reasons why it doesn't have a lifetime

valid jetty
#

to create the rc yea, but the benefit is that the value is not tied to a lifetime unlike &'a [u8]

#

lifetimes are good until you get stuck in 'a does not live long enough hell

austere anchor
#

as that would entail no cloning

valid jetty
#

yes because Rc<Vec<u8>> is a lot cheaper to clone than Vec<u8>

#

as vec<u8> would clone its whole buffer too

#

rc would just clone the reference

#

i mean, that's also assuming you're gonna be passing the vec anywhere else or cloning the entailing struct

#

if the only thing you're doing is

  • put the data in the struct
  • loop through the data 10 lines later
  • drop the struct

there's not really a difference

austere anchor
#

i would imagine this struct is mostly pass-by-(mutable)-reference

#

i believe it is safe to say that the struct itself or it's data won't be cloned unless it's an operation which changes the Vec<u8> anyways (?)

valid jetty
#

then it's probably just easiest to use whatever is easiest out of the data you have that you're going to put into it

#

like if you have a &'a [u8] just use that

austere anchor
#

hm

hoary sluice
#

idk what the advantage is of lifetimes vs owned type & rc

valid jetty
#

however refs require explicit lifetime management even though they're stack allocated

#

technically a 'static is possible if you wanna leak everything lmao

#

probably fastest for compilers

hoary sluice
valid jetty
#

dropping can be an overhead if you do it very often

valid jetty
#

since when have windows devs ever cared about performance lmao

hoary sluice
valid jetty
#

and most macos devs make ios apps so again, not really using rust

hoary sluice
valid jetty
#

think of the stack like a cache

hoary sluice
#

like everything related to the code, ie tokens, ast have to be heap allocated cause their size is not known at compile time right ?

valid jetty
#

you don't have a lot but it's very fast to access

hoary sluice
#

ok im watching a video on stack vs heag tomorrow

valid jetty
#

you have a Box<AstNode> because it's impossible to calculate the size of a recursive struct

#

you need to add indirection

#

it's like having a struct with itself inside in C

#

vs having a struct with a pointer to itself in C

hoary sluice
#

yes and that goes on the heap cause idk its size at compile time??

valid jetty
#

no, that goes on the heap because it's a very ergonomic abstraction, and because refs can't be null

#

if refs could be null then you could have a &Self

austere anchor
valid jetty
#

it is in ram it's just faster to access than the heap

#

it's allocated in exactly the same way

#

or well

#

on the IR level it is

austere anchor
valid jetty
#

alloca/alloc8 vs malloc

austere anchor
#

there should be no reason except for the fact that most of it is in cache

valid jetty
#

stack allocation is just subtracting a number lol

austere anchor
#

like an access on the heap should be the same perf as access on the stack no?

#

(not counting cache)

#

allocation is defo fast bc of what you mentioned

valid jetty
#

i think cache locality is the only reason it's faster

austere anchor
#

hm

#

so i guess the true benefit of the stack is just that allocs are faster?

valid jetty
#

yeah

#

both are pointers in C there's no reason 1 pointer should be slower to access than another pointer

austere anchor
#

so you could also allocate a static array using malloc in your program and just use that for similar perf

valid jetty
#

i mean yeah that's actually what most VLAs in C do lol

#

the buffer is just a malloced static array

austere anchor
valid jetty
#

which is the realloc'ed when you wanna change its size

austere anchor
#

thus being on the stack

valid jetty
austere anchor
#

interesting

valid jetty
#

you can't exactly "free" memory on the stack

austere anchor
#

i always assumed they were alloca'd

valid jetty
#

unless you do bookkeeping and then like make free chunks and make an allocation wrapper

#

but at that point just use the heap

austere anchor
#

!

valid jetty
#

lmao

valid jetty
austere anchor
#

why does it grow and shrink

#

i dont think it should

pearl stagBOT
# valid jetty even elle's are <https://github.com/acquitelol/elle/blob/rewrite/std/runtime/col...

array.le: Lines 78-101

fn Array::with_capacity<T>(i32 initialCapacity) -> T[] {
    T[] array = #alloc(Array<T>);

    array.elements = #alloc(T, initialCapacity);
    array.size = 0;
    array.capacity = initialCapacity;

    return array;
}

fn Array::new<T>(ElleMeta meta, ...args) -> T[] {
    T[] array = Array::with_capacity(2);

    for i32 i = 0; i < meta.arity; i += 1 {
        array.push(args.yield(T));
    }

    return array;
}

fn Array::resize<T>(T[] self, i32 newCapacity) {
    self.elements = #realloc(self.elements, T, newCapacity);
    self.capacity = newCapacity;
}
valid jetty
austere anchor
#

once it's known in runtime i think atleast C's VLAs stay at the same size

valid jetty
#

usually vla's are known to be arrays that you can push and pop from

austere anchor
#

i bet there's no resize function for VLAs in C

valid jetty
#

what do you mean by vlas in C

austere anchor
#

i have never heard this

valid jetty
#

char x[]?

austere anchor
#

yes

valid jetty
#

that's not what i'm talking about lol

austere anchor
#

??

#

what else could you possibly be talking about

valid jetty
#

vla's are used in most scenarios to refer to like, the resizable dynamic arrays

#

hang on

austere anchor
#

oh you're using the wrong terminology i think

#

"Growable arrays (also called dynamic arrays) are generally more useful than VLAs because dynamic arrays can do everything VLAs can do, and also support growing the array at run-time. For this reason, many programming languages (JavaScript, Java, Python, R, etc.) only support growable arrays. Even in languages that support variable-length arrays, it's often recommended to avoid using (stack-based) variable-length arrays, and instead use (heap-based) dynamic arrays.[4]"

valid jetty
#

whaaaaa

austere anchor
#

VLAs are strictly runtime allocated static arrays

valid jetty
#

ive always called them vlas

austere anchor
#

well now you know

#

and yeah ofc those growable arrays need to be on the heap

#

that's basically just a Vec<T> atp

valid jetty
#

i wrote an example thing but its too late lmao

#

oh well

#
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int len;
    int cap;
    int *buf;
} IntArray;

IntArray *IntArray_new(int cap) {
    IntArray *self = malloc(sizeof(IntArray));
    
    self->len = 0;
    self->cap = cap;
    self->buf = malloc(sizeof(int) * cap);
    
    return self;
}

void IntArray_push(IntArray *self, int value) {
    if (self->len + 1 >= self->cap) {
        self->cap *= 2;
        self->buf = realloc(self->buf, self->cap);
    }
    
    self->buf[self->len++] = value;
}

void IntArray_free(IntArray *self) {
    free(self->buf);
    free(self);
}

int main() {
    IntArray *x = IntArray_new(8);
    IntArray_push(x, 1);
    IntArray_push(x, 13);
    IntArray_push(x, 39);
    
    for (int i = 0; i < x->len; ++i) {
        printf("x[%d] = %d\n", i, x->buf[i]);
    }
    
    IntArray_free(x);
}
wispy gyro
#

Pp

valid jetty
#

this is what ive been calling VLAs

#

but i guess i was wrong

valid jetty
#

macos devs write ios apps

#

windows devs write c# apps

#

what do linux devs write? C and rust

#

good luck getting swift or c# working well on linux

#

it makes sense

dense sand
#

Apparently i cant run my jvm implementation on avr because it has only 4kib ram

dense sand
languid ibex
#

i know next to nothing about css but is anyone able to make this work again? or like, an emojis get bigger ONLY when hovering type of thing, not constantly?? smthin for the blind fucks with tiny emojis πŸ˜”

dense sand
#

seems pretty trivial to me

#

i only changed the --custom-emoji-size-jumbo-emoji css variable from 3 rem but idk if thats the intended way

#

oh your saying not constantly

#

idk lol

languid ibex
#

yeah i dont want all emojis huge constantly just like, basically the ability to click n make 'em big or hover them so theyre easier to see for a moment :x
but that snipit is the only thing i found, and it doesnt seem to work anymore

dense sand
#

again ive never done this before

#

it might be the wrong approach

languid ibex
#

πŸ™ i love u

dense sand
#

maybe play with the css a bit so it looks centered or sum

placid cape
#

@hoary sluice what do you use for nlp?

spark tiger
dense sand
#

i mean

#

writing embeds would be kinda cool in jsx

fleet cedar
#

That looks like jsx, sure, but I don't see where react comes in

dense sand
fleet cedar
#

Foolish

dense sand
#

yea

dense sand
#

Css is becoming turing complete

hoary sluice
#

i also have a parser thats just a match statement

supple whale
dense sand
#

i still do that

supple whale
#

or storing UI state in # and querying it with *=

#

i remember still the old expandable FAQ i made

#

and it expanded with hash

valid jetty
#

malloc failing implies you completely ran out of memory (including virtual memory)

#

if that happens then uhm you have some larger problems

nimble bone
#

tbh that feels a lot like ddbkit

dense sand
#

(i dont null check it either in half of my codebase)

supple whale
#

i feel like i grew a brain tumor by reading this

#

streams ARE ASYNC ITERABLE

#

they have built in async iterators!!!!!

#

you dont need any conversion

#

REEEEEEEEE

#

why are JS devs everywhere so incompetent!

#

it is such a bad example

dense sand
#

just add multithreading to javascript at this point

#

they are overcomplicating shit too much

supple whale
#

workers

#

they are just cancer to work with

#

probably more cancer than java threads tbf

#

which is why i wrote this.

placid cape
supple whale
#

to set up, yes

dense sand
#

oh really huh

#

why th is building next apps so slow

#

like i swear to god every docker build i do takes like 2 mins

#

altough most of it takes the actual bun install lol)

nimble bone
#

your issue is next and bun...

dense sand
#

😭

supple whale
#

i think the issue is react + webpack

dense sand
#

well with node it takes around the same

#

so deps installation takes aroudn the same as the actual next build

#

im a real fan of nextjs but the build performance is horrible

supple whale
#

trust me it can always be worse

#

takes over a minute for my build so far

#

not even halfway done

#

5805 modules transformed

supple whale
#

but its gonna get a lot worse

dense sand
#

Wth are you building

supple whale
#

electron!

dense sand
#

Oh

#

Damn

supple whale
#

electron app via webpack

#

but its gonna change to electron app via webpack via esbuild

#

ofc i skip the electron building part since thats once every few weeks

#

but it takes a few hours

dense sand
#

whats the simplest yet pretty secure way i can do auth in my js app

#

i dont want to mess with stuff like betterauth or authjs or supabase

#

thats too heavyweight

royal nymph
#

google, facebook, etc login

dense sand
#

i cant use use that, because the thing im making is made to be selfhosted

#

wow ass software

balmy lintel
#

bun jumpscare

dense sand
#

yea well it seems like i will end up with sqlite3 dependency 😭

#

i wanted to use atleast some bun features

#

to make my webapp blazingly fast πŸš€ ✨

dense sand
balmy lintel
#

cult

dense sand
#

yep thats what i wanted to do now

#

but sqlite3 bun ass

nimble bone
#

node your beloved

#

my glorious creation

#

@dense sand i should really refactor this project

#

i have a 1000+ loc file with all backend routes

#

and 430 loc of frontend

dense sand
#

what is this

#

express?

placid cape
#

wake word

winged mantle
frosty obsidian
#

it would just be another thing to config

#

app id and secret

dense sand
#

I want it to work ootb tho

frosty obsidian
#

i don't think that ideal can last but gl

#

implementing auth yourself is still a possibility

#

its not as hard as you think

dense sand
#

Hmm probably

#

I want to use sqlite for some simple data storing, should sqlite3 package be optimal given bun doesnt work properly?

frosty obsidian
#

i think sqlite isn't enough tbh

#

i would go with postgres

dense sand
#

I want it inside a file tho

frosty obsidian
#

postgres does store it in a file

dense sand
#

Huh? I dont want to have postgres server running

frosty obsidian
#

ig you can always move over if your project outgrows it

dense sand
#

The simple data storing is mostly user credentials and some basic metadata

frosty obsidian
#

oh then yeah it might be fine

winged mantle
#

say you have a system of placheolders where you have a string like "Hello {{name}}!" and name is replaced with params
in node, i wonder if there would there actually be any benefit to "compiling" this string to

{ strings: ["Hello ", "!"], expressions: ["name"] }

?

#

but if there is i bet it would be negligible

#

maybe i should try on that js benchmark site but in chromium

#

(because node is basically v8 right?)

frosty obsidian
#

node is v8

winged mantle
#

is firefox rhino

#

actually nah probably not

supple whale
#

i suck at coding so fucking bad

#

all this code just to make

#

a nestable menu

#

πŸ’€

#

there's probably so much better of a way of doing it

#

idk i feel like i've deteriorated mentally

golden narwhal
#

the air feels better here rn

#

whats good vencord

#

@woven mesa dance

#

WRONG CHANNEL 😭

#

I THOUGHT I WAS IN REGULARS

placid cape
nimble bone
#

very long part of checking if you have a permission to be able to grant it

placid cape
placid cape
nimble bone
#

yop

dense sand
dense sand
#

@placid cape

placid cape
#

XDDDDDDD

#

please no

dense sand
fleet cedar
#

That was pretty obvious I think

#

But why are you writing variable names in czech

dense sand
#

Because teachers

dense sand
#

Ohhh

#

Makes sense

woven mesa
hoary sluice
dense sand
#

Stopky as stopwatch

#

We were doing something with Timer in c# winforms

olive mesa
#

Would any of you programers know a way for me to still receive notifications on my phone while being active on the desktop discord on my pc?

frank moss
spark tiger
#

til vscode has been using ripgrep since 2017 blobcatcozy

#

if only i knew why it's so fast wires

#

i mean there's a writeup by the author but it's too complicated to me

#

(or i'm just lazy to read allat)

placid cape
hoary sluice
#

i should probably implement word wrap at some point

#

its hard to do in qt idk why

placid cape
#

faster_whisper is faster than whispercpp

placid cape
# hoary sluice

btw did you use rasa client for parsing or your match service

hoary sluice
frosty obsidian
#

congrats man

placid cape
#

Poggers

#

gj

hoary sluice
#

they banned the ai lmaoo

#

i wouldve been like #20 otherwise

#

nvm

#

#3 with ai

placid cape
#

what do you use for tts? @hoary sluice

hoary sluice
placid cape
#

i can recommend piper

#

extremely fast, accurate

bitter token
#

@austere anchor

#

i just can't understand how to convert a number to sqrt

austere anchor
#

because that would require infinite precision on the numerical side

#

which you don't have

#

so either you get an approximation

jade stone
#

WHY IS THIS VALID JS SYNTAX (i know why its valid, but this should really be a syntax error)

austere anchor
#

or you get a analytical solution from the start

bitter token
#

OHHHHHHHHHHHHHHHHHHHHHH IM STUPID

#

wait wait

jade stone
#
        ['<img src="https://cdn.discordapp.com/emojis/1026533070955872337.webp?size=128" alt=":blobcatcozy:" class="emoji"></img>', 40]
        ['<img src="/assets/creature.png" alt="creature" class="emoji"></img>', 40]
#

ah yes, i love indexing the 40th element on an array

#

because why would i ever forget a comma

bitter token
#

@austere anchor guess what lol

bitter token
#

so i was coding someone's exercice
and it turned to be HE WAS WRONG

#

and i was like wth

#

why is my python giving wrong answers

#

turned out

#

the person in the picture i was coding

#

was wrong

austere anchor
bitter token
#

he got Ο€/3 but instead it should've get Ο€/4

bitter token
#

he did it wrong

austere anchor
#

lol

bitter token
#

so i thought the problem was from me because i didn't add sqrt

#

wthhhh

#

but yeah ig half of my code is useless

#

or maybe i want to find a way to convert decimal number to sqrt

#

i'll look on yt ig

austere anchor
bitter token
austere anchor
bitter token
#

wait let me try

austere anchor
#

so that it satisfies x^2 - 1 = 0

bitter token
#

i still can't figure how to sqdjiqduziqdjqz

austere anchor
austere anchor
bitter token
#

i think i'll leave my code like what it is

#

the solution is all i need

#

@austere anchor ty for help btw Hug

austere anchor
#

but cool ok

bitter token
#

calculating the square root and then putting it is the best option for me mow

austere anchor
#

bc i mean

#

i do believe it is pretty easy to use

bitter token
valid jetty
#

whats so bad about this

spark tiger
austere anchor
#

i.e. a computer algebra system (CAS)

spark tiger
austere anchor
#

like if you do sqrt(2) it will give you sqrt(2) and not 1.414...

#

hopefully that makes sense

fleet cedar
#

You can't have methods on the number 2 either

#

That's usually not considered a noteworthy limitation

#

Impls are on types, not values

valid jetty
#

mathway and wolfram have ways to represent unknown values (and represent expressions as a result, like polynomials and indefinite integrals)

#

a scientific calculator doesn’t have a way to represent generic expressions with unknowns, it just computes the result based on calculations you define

#

the β€œunknowns” you can set aren’t really unknown because they must have a value for the calculator to use them

#

even if you want to do something like a derivative with the scientific calculator you need to define the value of x for which you’re differentiating

#

a CAS system can just represent the β€œexpression” of the derivative instead of evaluating at a definite value

jade stone
#

ive tried max-width, but that hasnt worked

frosty obsidian
#

word-wrap

#

some form of wrapping

#

assuming you already have max width set to 100%

jade stone
#

ah, that worked with max-width set to 100vw

#

tysm

frosty obsidian
#

in your case it wasn't wrapping because it was technically all one word

jade stone
#

love

delicate groveBOT
#

Alright @dense sand, in 7 hours, 53 minutes and 44 seconds: pos test

fleet cedar
#

What's the rooster

royal nymph
#

no idea lmao

austere anchor
royal nymph
#

Coq is an interactive theorem prover first released in 1989. It allows for expressing mathematical assertions, mechanically checks proofs of these assertions, helps find formal proofs, and extracts a certified program from the constructive proof of its formal specification. Coq works within the theory of the calculus of inductive constructions, ...

austere anchor
#

i love coq !

hoary sluice
#

calling ur language coq is crazy

austere anchor
# hoary sluice calling ur language coq is crazy

In arithmetic geometry, the Cox–Zucker machine is an algorithm created by David A. Cox and Steven Zucker. This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E β†’ S, where S is isomorphic to the projective line.
The algorithm was first published in the 1979 a...

austere anchor
#

@fleet cedar current status

#

😭

fleet cedar
#

If all variants have that field, refactor it to a struct Img3Tag { tag: [u8; 4], ty: Img3TagType }

austere anchor
#

the problem is, if i try to refactor it then i would also have problems with (de)serialization

hoary sluice
austere anchor
gaunt skiff
#

how to make vencord plugin

dense sand
#

Learn javascript and webpack shit

spark tiger
gaunt skiff
delicate groveBOT
#

@dense sand, <t:1739880376:R>: pos test

dense sand
#

Thank

viscid grove
royal nymph
viscid grove
#

oh wait yeah i think lockfile is out of date oops

#

sorry

#

oh also is it normal that discord always crashes on startup then recovers since the class roll a few weeks ago?

#

I did try removing userplugins a while ago and i think it still happened

royal nymph
#

that's a you issue

#

it tells you the file even

#

NewPluginsModal.tsx

hushed pebble
hoary sluice
#

its lobotomized haskell

viscid grove
#

what's a soylang

ionic lake
#

anything considered a corny or bad programming language is a soy language

#

but you use what you like, don't let others influence what you should use

viscid grove
#

/run

+[------->++<]>+.----.-[++>---<]>+.--[->++++<]>-.+[->+++<]>+.+++..[++>---<]>--.+[->+++<]>+.+++++++++++.
rugged berryBOT
#

Here is your brainfuck(2.7.3) output @viscid grove

ok will do```
fleet cedar
#

Since when does discord have bf syntax highlighting

viscid grove
#

idk, but a while

#

probably was just added whenever syntax highlighting was added

fleet cedar
#

Yeah it's not like they made the highlight themselves, it's just hljs isn't it

royal nymph
formal belfry
#

excluding Swift

spark tiger
#

iirc

deep mulch
formal belfry
#

excluding

steel scroll
#

@deep mulch

deep mulch
#

how

steel scroll
#

youhave tofriend me

#

this is a new account

fleet cedar
#

Sounds like a scam

steel scroll
#

Naurp

fleet cedar
#

That's barely even a word

steel scroll
#

Narup

mellow phoenix
steel scroll
#

send it to $caitlyn

#

why is everyone gulfs what did i miss

fleet cedar
#

Probably referencing a recent geopolitical moron

mellow phoenix
steel scroll
#

yeah i saw

deep mulch
#

who are you @steel scroll

steel scroll
deep mulch
#

hi

deep mulch
#

tole tole

steel scroll
#

yes

gaunt skiff
#

how to learn TS for make vencord plugins

still jolt
#

step 1: learn TS
step 2: make vencord plugin
step 3: profit?

lucid trail
#

anyone doing the ccc

hoary sluice
#

cloudflight coding contest?

lucid trail
#

Canadian computing competition from UW (today)

hoary sluice
#

that was the only other option 😭

spark tiger
dense sand
#

does someone know why my width transition is not working?

ionic lake
#

what is this for

supple whale
#

because you're not transitioning

#

you're replacing

#

there's no "from" value

#

you change width from 64 to initial to 0

#

you need to do isOpen && "!w-64" and have w-0 on the top class list

#

@dense sand

#

anyways, transitioning width is a human sin and you should be whipped for it

dense sand
#

lmao

dense sand
supple whale
#

you should only ever transition css properties that dont cause layout shifts, recalculations and repaints

dense sand
#

bro im making a sidebar and i want it to open fluently -_-

supple whale
#

aka stuff like transform, opacity, and filters

supple whale
#

it should actually be translate3d because that is even faster, but it requires brain capacity to create

#

a sidebar with a width transition will repaint your ENTIRE dom structure, all elements EVERY SINGLE FRAME

#

or at least all sibling and sub dom elements

dense sand
#

i suppose you would beat me up for this too(but the transition worked here for some reason)

supple whale
#

you have a base value defined

dense sand
#

ohh

supple whale
#

and just hard override it

dense sand
#

hmm

supple whale
#

but yes

#

your balls should be twisted for that

dense sand
supple whale
#

which is painful

#

almost everyone i see has this exact problem

#

which is painful to watch

#

which is also why noone does sidebars, because no matter what u do you will tank ur performance

dense sand
#

welp i hope that atleast the ui libraries like radix solve these things

austere anchor
spark tiger
#

yep

austere anchor
#

when will they stabilize if let ... = ... && cond... tho 😭

ionic lake
#

my default is nightly

austere anchor
#

I hate having pyramids in my code

ionic lake
#

apart from the rust analyzer whining, working on nightly is good

supple whale
austere anchor
#

πŸ’€

ionic lake
#

you can fix that a tiny bit

fleet cedar
ionic lake
#

most likely newer glibc issues

austere anchor
fleet cedar
#

Someone hasn't found the releases section

ionic lake
#

the entitlement in open source is insane

hoary sluice
supple whale
#

depressing that none of my chromium bug reports ever get fixed

placid cape
fallen nebula
hoary sluice
#

@calm ruin are u a girl

calm ruin
hoary sluice
calm ruin
hoary sluice
calm ruin
#

sorry

#

you can come turkey if u want that

valid jetty
#

so many things could be compacted if i had that

austere anchor
deep mulch
#

@valid jetty have you done AES encryption

void leaf
#

could you hypothetically set up a mirror of a repo for the contents of a file and not the actual file itself

#

like the contents of the file, I want mirrored to a different one, but I wanna name the file something else

hoary sluice
#

rosie has become an ai

supple whale
#

so the fucking Google WebView bug which crashes when any WASM is loaded, not is preventing me from releasing my app, and I can't do ANYTHING about it

#

yeah thanks google....

atomic brook
#

Rewrite it fully in js trolley

supple whale
#

i have compiled WASM into JS

#

issue is

#

CHECKING if the device supports WASM ALSO insta crashes all active webviews

#

!!!!

atomic brook
#

Why do you need wasm then

#

Or I'm stupid

supple whale
#

so if i want any form of performant rendering, i need WASM

#

the JS fallback is for dogshit devices which dont support WASM at all

#

but the try-catch will do fuckall in this case, as it insa crashes the webview

supple whale
#

it is not wasm

#

!!!!

#

WTFFF

#

its this:

#

its:

const subarray = new Uint8ClampedArray([255, 0, 255, 0, 255]).subarray(1, 5)
await createImageBitmap(new ImageData(subarray, 1))
#

this is enoguh to crash webviews

hoary sluice
royal nymph
#

an array that holds u8s and clamps them πŸ”₯

hoary sluice
royal nymph
#

or is it every subarray

supple whale
#

its just subarray specifically

supple whale
#

slice doesnt crash

#

subarray aka a view reference does

#

but only on arm32bit devices that are running androidtv

#

its something fucky with hardware acceleration

supple whale
#

uint8clamped is nice for rendering

#

since u dont need to validate ur data if it goes crazy

#

it clamps it for you

hoary sluice
#

oh i thought clamped as in squished together

#

like next to each other

supple whale
royal nymph
#

does it actually matter 😭

supple whale
#

yes lol

royal nymph
#

you use that?

supple whale
#

almost every android tv is 32 bit

#

there are like 3 models in the entire world out of like 9k

#

which arent 32 bit

#

this bug impacts like 40% of my androidTV userbase

#

android automatically defaults to 32 bit when it has <4GB of RAM

#

which tells u a lot about the hardware capabilities of androidTVs

#

anyways, doesnt stop me from running my electron app on them

#

next goal: electron on android auto

#

thats the last champion to conquer

royal nymph
supple whale
#

my app is about watching video

#

tvs are made to display video

#

idk what u expect

royal nymph
#

fuck tvs

supple whale
#

thats giving up userbase for no reason

#

android tv users pay a lot of apps

#

so they'll buy anything

#

also being able to say "hey my singular codebase runs on phones, tvs, pcs both windows and linux, macs, laptops and vr headsets" is quite a flex

#

nodejs is trully what java promised to be and then failed to deliver

valid jetty
#

numbers in js are 64 bit floats so it’s a breath of fresh air to have precision

supple whale
#

no, the point is that it doesnt mod by 255 like normal uint8

valid jetty
#

oh well yea that too

supple whale
#

because uint8 also holds exactly u8s

valid jetty
#

yaya but i thought eagely asked if that is just a normal array

supple whale
#

but yeah, it is not an array, its a typed array, and they are VERY different interfaces

#

they have some simmilarities, like indexes and iteration

#

but their mutability and underlying data is a LOT different

#

since in typed arrays underlying data is direct memory, it lets u work with memory exactly like in C/C++

#

you can create a memory view, write u32 data to it, then read parts as u8 etc

#

and W3C APIs provide a lot of interfaces with said memory views, for example you can simply convert any data into an image, so you can take webassembly program memory, and render it as an image:

#

because why not, javascript will let you!

mellow phoenix
#

vwb 1053445009824821308

elder yarrowBOT
dense sand
#

god i hate how bukkit plugin system works

#

if a plugin depends on another plugin, youre basically forced to use singleton pattern πŸ’€

#

i mean there are serviceloaders but no one uses that

placid cape
#

well yea bukkit plugin system is based on singleton pattern

dense sand
#

yea im just complaining cause it was a good idea back in 2010s xdd

#

but now

#

horrendous