#πŸͺ…-progaming

1 messages Β· Page 83 of 1

jade stone
#

i think that's called powershell

winged mantle
jade stone
valid jetty
split timber
#

Java clases can have association, inheritance, dependency, composition, etc these are ways that created objects interact with other objects

valid jetty
#

yeah

fleet cedar
#

Sounds like something someone very bored made up

winged mantle
#

can we have a dynamic version of javascript called javascriptscript

split timber
#

It's literally java API

valid jetty
split timber
#

^

winged mantle
#

java.applet.Applet api my beloved

split timber
#

I love oop so much

valid jetty
#

wait so then @royal nymph why have generics at all are they literally just like "type hints" in python

fleet cedar
#

I deal in programming, not bored people's fantasies

winged mantle
split timber
#

It's programming πŸ’”πŸ’”πŸ’”

valid jetty
winged mantle
#

without generics you need to do this

List list = new ArrayList();
String thing = (String) list.get(0);
valid jetty
#

😭

royal nymph
winged mantle
#

I believe it's essentially syntax sugar for that

valid jetty
#

to be fair it kinda makes sense that its fake because java is a dynamic language

#

just like how typescript types are fake

winged mantle
#

java does not allow duck typing

#

only for generics (kinda) blobcatcozy

#

as soon as you try to get any data it fails though

#

you don't even have to assign it

#

i don't think type confusion is really possible in java without extreme hackery

royal nymph
#

yeah it isn't

#

you'd need to use reflection or unsafe

winged mantle
#

i don't think reflection will allow you to pass in the wrong type

#

i think to break java's memory safety you would need unsafe

fleet cedar
#

I've accidentally passed invalid types to interface-typed parameters in bytecode

#

It's not caught until you try to call a method

winged mantle
#

but it still wouldn't break the memory safety, you would get an exception

fleet cedar
#

Yep

winged mantle
#

is this with methodhandles

royal nymph
#

but reflection can cause a lot of other cursed stuff

#

you can write final fields with reflection

winged mantle
#

i was about to say

#

i remember doing that with some library

fleet cedar
#

But writing to static final fields of primitive/String type does nothing

#

Since they're inlined

winged mantle
#

using reflection on the reflection api to trick it that it's not final

#

but java 9 broke

royal nymph
#

also with usafe you can do shit like instantiate classes without calling their constructor

but once you're using unsafe you're down the deep end anyway blobcatcozy

pearl stagBOT
# royal nymph I wrote this ages ago https://github.com/Aliucord/Aliucord/blob/main/Aliucord/sr...

ReflectUtils.java: Lines 235-253

public static void setFinalField(@NonNull Class<?> clazz, @Nullable Object instance, @NonNull String fieldName, @Nullable Object v) throws NoSuchFieldException, IllegalAccessException {
    if (accessFlagsFields == null) {
        try {
            accessFlagsFields = Field.class.getDeclaredField("accessFlags");
        } catch (ReflectiveOperationException ignored) {
            try {
                accessFlagsFields = Field.class.getDeclaredField("modifiers");
            } catch (ReflectiveOperationException ex) {
                throw new RuntimeException("Failed to retrieve accessFlags/modifiers field", ex);
            }
        }
        accessFlagsFields.setAccessible(true);
    }

    var field = clazz.getDeclaredField(fieldName);
    field.setAccessible(true);
    accessFlagsFields.set(field, field.getModifiers() & ~Modifier.FINAL);
    field.set(instance, v);
}
winged mantle
#

i thought java 9 broke this

royal nymph
#

this is for androd

winged mantle
#

wait is android s tuck on java 8

royal nymph
#

java has no relevance in this

winged mantle
#

jre and jdk

royal nymph
#

the runtime is what matters

#

Android doesn't use jdk

#

idk much about jdk

jdk is cringe and restricts reflective access to internals

winged mantle
#

jdk is not a single implementation anyway..?

fleet cedar
#

Openjdk is an implementation

winged mantle
#

isn't there hotspot and j9 and stuff

#

idk i have expert vague understanding of java

fleet cedar
#

Same as Class<Object> but less type safe

winged mantle
#

isn't ? short for ? extends Object

#

so it accepts anything other than Object

#

or is that wrong

royal nymph
winged mantle
tired vigil
#

Why are java classes instances of a generic Class class

royal nymph
#

<> is generic

royal nymph
#

<?> is like any generic

winged mantle
#

wait that has to be wrong

#

i swear i had issues where i could not put an <Object> value into a <?> value

#

😭

winged mantle
royal nymph
#

it's hard to explain lol

winged mantle
#

I don't think there are any subclasses of the Class class

#

it's generic

fleet cedar
#

Yes, java.lang.Class is final

winged mantle
#

String.class is an instance of java.lang.Class

#

not a subclass

#

the type is Class<String> though

#

i am kinda rusty but i think that's right

fleet cedar
#

Class<String> is a subtype of Class<?>, but not a subclass

winged mantle
#

i wouldn't consider it a subtype so much as a type which fits into it (assignable type)

fleet cedar
#

Yes, that's what subtype means

royal nymph
#

Class<String> is like a reflective representation of the String class

Class<String> stringClass = String.class;

you can use it to query information about the class, look up methods, constructors, etc

#

it allows you to write dynamic code for example

winged mantle
#

i would call it a metaclass

#

class is a class for a class

royal nymph
#

as in call methods from strings

winged mantle
royal nymph
#

load classes from strings

winged mantle
#

ClassLoader.defineClass my beloved

tired vigil
winged mantle
#

it allows things to be typed

fleet cedar
#

Generics pretend to be real

winged mantle
#

i think it means you can call the constructor and not need to cast

tired vigil
#

insane behavior

winged mantle
#

/run

public class Main {
    public static void main(String[] args) {
        "".__proto__.toInt = Integer::parse;
        System.out.println("4".toInt());
    }
}
#

java pro tip

rugged berryBOT
#

@winged mantle I only received java(15.0.2) error output

file0.code.java:3: error: cannot find symbol
        "".__proto__.toInt = Integer::parse;
          ^
  symbol:   variable __proto__
  location: class String
file0.code.java:3: error: method reference not expected here
        "".__proto__.toInt = Integer::parse;
                             ^
file0.code.java:4: error: cannot find symbol
        System.out.println("4".toInt());
                              ^
  symbol:   method toInt()
  location: class String
3 errors
error: compilation failed
royal nymph
#

actually you don't have to cast yeah

winged mantle
#

v you should take an iq test

royal nymph
#

why

winged mantle
#

java iq test

royal nymph
#

Am I that stupid..

winged mantle
#

i remember somebody being wrong about c++ and i ended up making like 4 example programs to show each time they got something wrong

valid jetty
winged mantle
winged mantle
valid jetty
winged mantle
#

you don't write generics like that

valid jetty
#

but is the concept right

winged mantle
#

:german:

royal nymph
valid jetty
royal nymph
#

also yeah in usage they're the same but they are still different

valid jetty
winged mantle
#

can you readd the german emote

royal nymph
#

did someone delete

#

or was it never here

winged mantle
#

i swear it was here

#

somebody sent when i said i was using openbox wm with no panel

royal nymph
#

the first method isn't generic at all

valid jetty
#

does java have covariance

winged mantle
#

<T> T make(Class<T> clazz)

#

this would make it useful

valid jetty
#

wait so ? is only a placeholder in arguments?

fleet cedar
#

Yes, List<? extends Foo> is covariant while List<? super Foo> is contravariant

royal nymph
#

? is like a generic wildcard

winged mantle
#

contravariant

fleet cedar
#

Java generics are cursed and half baked

#

Don't try to make sense of them

valid jetty
#

but isnt <T> with no constraints also a generic wildcard???

#

why does ? need to exist

winged mantle
#

so you don't need to add a generic param to the method?

royal nymph
#

T is a generic type

fleet cedar
#

How would you declare a List<T> in a non-generic function

royal nymph
#

you can use ? anywhere

valid jetty
#

hmm i see

royal nymph
#
List<?> list = idgafWhatsInThisList();
valid jetty
#

ok that makes sense

winged mantle
#

how does it differ from List<OBject> this has always confused me

valid jetty
#

im thinking of this from a static typing standpoint but i forgot java doesnt actually care about the inner type of generics

royal nymph
placid cape
#

i think you do

winged mantle
#

i swear this did not work last time itried

royal nymph
#

/run ```java
import java.util.*;

List<Object> list = new ArrayList<Integer>();

rugged berryBOT
#

@royal nymph I only received java(15.0.2) error output

file0.code.java:4: error: incompatible types: ArrayList<Integer> cannot be converted to List<Object>
List<Object> list = new ArrayList<Integer>();
                    ^
1 error
error: compilation failed
royal nymph
#

guh it doesn't import

#

wait what does that work

winged mantle
#

because boxing?

royal nymph
#

you have to cast to List<Object>

winged mantle
#

horror why

#

/run

System.out.println(System.getProperty("java.version"));
rugged berryBOT
#

Here is your java(15.0.2) output @winged mantle

15.0.2
winged mantle
#

java 15

valid jetty
#

/run

import java.util.*;

List<?> list = new ArrayList<Integer>();
royal nymph
rugged berryBOT
#

Your java(15.0.2) code ran without output @valid jetty

winged mantle
#

ohh

valid jetty
#

ok that makes sense

winged mantle
#

trueee

valid jetty
#

i get it now

winged mantle
#

but

#

how does ? make it safe

#

oh wait

#

no it is safe

royal nymph
#

Object is like any in typescript (but you have to cast to get to it)
? is like unknown

valid jetty
#

yeah

winged mantle
#

why would that not be safe wat

#

Object does not implicitly cast 😭

royal nymph
winged mantle
royal nymph
#
List<Object> list = intList;
list.add("Hi");
#

the second line is valid

#

if the cast was allowed this code would pass but fail at runtime

winged mantle
#

wouldn't it be valid with ? too though

royal nymph
#

no

#

I think

#

/run ```java
import java.util.*;

List<?> list = new ArrayList<Integer>();
list.add("hi");

winged mantle
#

/run

List<Integer> intList = Arrays.asList(1, 2, 3, 4);
List<?> list = intList;
list.add("hi");
System.out.println("bazinga");
rugged berryBOT
#

@royal nymph I only received java(15.0.2) error output

file0.code.java:5: error: incompatible types: String cannot be converted to CAP#1
list.add("hi");
         ^
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
error: compilation failed
#

@winged mantle I only received java(15.0.2) error output

file0.code.java:2: error: cannot find symbol
List<Integer> intList = Arrays.asList(1, 2, 3, 4);
^
  symbol:   class List
  location: class temp
file0.code.java:2: error: cannot find symbol
List<Integer> intList = Arrays.asList(1, 2, 3, 4);
                        ^
  symbol:   variable Arrays
  location: class temp
file0.code.java:3: error: cannot find symbol
List<?> list = intList;
^
  symbol:   class List
  location: class temp
3 errors
error: compilation failed
royal nymph
#

my beloved

#

yeah it doesn't let u do it

winged mantle
#

i swear i never saw an error saying CAP

#

i think it was more verbose

#

idk

#

i useed eclipse ide for years

#

i remember now getting errors about captures

royal nymph
#

/run ```java
import java.util.*;

List<Object> list = (List) new ArrayList<Integer>();
list.add("hi");

rugged berryBOT
#

@royal nymph I only received java(15.0.2) error output

Note: file0.code.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
winged mantle
#

fuire

royal nymph
#

yeah see that works

winged mantle
#

that's because you're duck typing

royal nymph
#

yes but this is why you have to explicitly cast to List<Object> xd

winged mantle
#

i understnad now

royal nymph
#

List<?> is safe, List<Object> isn't

valid jetty
#

@hoary sluice do you know about higher ranked trait bounds

winged mantle
#

lol I am remembering this java project I made
(I was trying to create a fully fledged piece of software when i was like 15 blobcatcozy )

#

it comes with solarized dark theme...

#

wait did i really create a http library too

valid jetty
#

i can believe that you manually typed out every single http code's name

winged mantle
#

probably

#

I USED SNAKE CASE BACK IN JS BACK IN 2020 TOO

#

chronic snake case user

supple whale
#

this is where vim-like shortcuts rock

winged mantle
#

i was using eclipse ide

winged mantle
#

this was during lockdown

valid jetty
winged mantle
#

i was probably like 13 or 14 back then

supple whale
#

i just use whatEverThisIs

winged mantle
#

camelCase

valid jetty
#

camelCase

winged mantle
#

i made so many webapps with xss

valid jetty
#

kebab-case

#

PascalCase

#

SHOUTING_SNAKE_CASE

#

snake_case

winged mantle
#

i basically just did fs.readFileSync("filename.html").replace("$CONTENT", content).replace("$USERNAME", usernamew)

valid jetty
#

objc_CursedCaseAkaMixedCase

winged mantle
#

and i parsed cookies manually

#

the golden age of thekodetoad

royal nymph
winged mantle
#

these days my github followers fluctuate between 99 and 100 i don't get it

#

back then i had no followers

#

when somebody followed me i felt like stalking was a more appropriate word

royal nymph
#

or just copy paste a table from Wikipedia or smth and use ide shortcuts to turn it into code

#

@winged mantle I used ai to refactor venapp code to jsx

#

copiloter

winged mantle
#

HORROR

#

i would do it manually or use a jscript with regex

#

i remember one time using xdotool to export many images from gimp

placid cape
valid jetty
#

i love this bug

fleet cedar
#

Good ol' cve-rs

valid jetty
#

true

#

😭

winged mantle
#

would a good architecture for a jason parser be to have a function to read the next token and it returns a union of boolean, number, string, array start, array end, object start, object end, comma

#

or is that dumb

winged mantle
#

jason parser

fleet cedar
#

That's how most json parsers work, yeah

#

Don't know about Jason parsers

winged mantle
#

i mean json

supple whale
#

pov: jason parser

winged mantle
#

json ctron

winged mantle
fleet cedar
#

The specific list of tokens varies from parser to parser though

valid jetty
winged mantle
#

jim

#

immediate mode blobcatcozy

valid jetty
#

tsoding 😭

winged mantle
#

what would a string token look like

#

would it contain the escape codes

fleet cedar
#

Depends on how zerocopy you want to be

winged mantle
#

or maybe you'd then tokenise that separately

fleet cedar
#

The obvious way would be "Foo\nBar" as ```
StrStart,
StrChunk("Foo"),
StrEsc('\n'),
StrChunk("Bar"),
StrEnd,

winged mantle
#

that means nested tokens though

#

which feels kinda πŸ₯΄

fleet cedar
#

No

#

That is a sequence of five non-nested tokens

valid jetty
#

you should be doing whitespace trimming in your lexer anyway lol

winged mantle
#

oh wait

#

i see ty

valid jetty
#

whitespace denotes separation but should be removed when actually parsing

winged mantle
#

wait

valid jetty
#

so toml

winged mantle
#

what if you wrote a python object notation parser

#

pon

valid jetty
#

pon

winged mantle
#

jon

#

i already had the jon idea

#

parse syntax like

new Map() {{ put("key", "value"); }}

#

that would be so fire

#

wait can you do Map.of

lavish frigate
winged mantle
#

chloe moment

lavish frigate
#

MAD cuz jealous

formal belfry
#

how do i access

lavish frigate
#

gave you perms

winged mantle
#

is it normal to have structs of function pointers in c

#

just like interface

formal belfry
#

WHY IS NEMMY THERE

#

insane

fleet cedar
#

Sure, manually implemented vtables are pretty common

lavish frigate
winged mantle
#

struct InputSource {
char (*read)();
}

lavish frigate
#

we have to balance out the rust love with stupidity sometimes

#

dw about it

valid jetty
#

pls

formal belfry
#

rosie is like 12

winged mantle
#

and then make a FILE based InputSource which implements buffering

#

and String which just moves cursor

lavish frigate
winged mantle
#

that doesn't need a struct though

#

that could just be a single function

valid jetty
#

what serverβ€”

winged mantle
#

β€”

valid jetty
#

evil

formal belfry
#

β€”

valid jetty
#

β€”

winged mantle
#

硡希[猫ART]
β€” 15:48
β€”

lavish frigate
formal belfry
#

Roie 🌻

valid jetty
#

i know 😭

winged mantle
valid jetty
#

硡希[猫ART]
β€” 15:48
β€”

winged mantle
#

maybe i should call this lib jay instead

#

people might think i'm weird for being obsessed with jason citron

pearl stagBOT
#

Emoji not found. The emoji set chosen might not have this emote as an image.

visual shellBOT
#
You need to specify an emoji to enlarge.
winged mantle
#

😭

#

hf!jumbo :jasonzoom:

pearl stagBOT
winged mantle
#

horror

#

vprune by bots 3

#

guh why is before: 2021 barely doing anything

#

i wanna filter ai slop

#

searching about tokenization has loads of ai results

valid jetty
#

watch the tsoding combinators video

winged mantle
#

why not split number into tokens

#

why not have exponent as token blobcatcozy

#

i have already written a json parser before i just did not conceptualise and separate the process of tokenisation

fleet cedar
winged mantle
#

whaty's the benefit of tokenisation for something as simple as json

#

the point is numbers have separate parts

#

the negative sign

#

the exponent

fleet cedar
#

What would be the benefit of that, other than making parsing harder?

winged mantle
#

well. it feels weird to do this for strings but not numbers

#

but fair

#

i guess at the tokenisation stage you need to recognise escapes in strings

#

with numbers you can just read until the next char which is not relevent

#

thank you for all the advice

#

is it bad to do barrel file in c

#

oh wait

fleet cedar
#

Do you need special woodworking tools for making barrels??

winged mantle
#

just separate .c files

#

i mean like json.h file which includes all headers

#

like barrel file in js

#

file which does nothing apart from reexport

#

c modules support when

#

cpp modules are fire

#

it just occured to me that in c i don't think you can bind functions

fleet cedar
#

Can't do much without a self yeah

ornate quiver
#

thank

supple whale
#

welp i made gemini shit itself

#

even AI cant handle service workers

#

telling it, try again or 12 orphans will die fixes the problem

ornate quiver
#

i had gemini keep failing last night with the same thing

#

no matter what i typed

deep mulch
#

sorry

winged mantle
#

c would be so much better if strings were like this

struct str {
    int len;
    char *d;
}

blobcatcozy

fleet cedar
#

Rust says hi

winged mantle
#

this would basically be like string slice

valid jetty
fleet cedar
#

Or std::string_view

winged mantle
#

at first i thought of

struct str {
    int start;
    int len;
    char *d;
}
#

but srting slices aren't generally aware of the whole string, are they?

deep mulch
#

roieeee

valid jetty
#

you can just offset the pointer

#

you don’t need to store start separately

winged mantle
#

and that also would be annoying

fleet cedar
valid jetty
#

not..really?

winged mantle
#

oh yeah

#

ofc

fleet cedar
#

That'd be messy and useless

winged mantle
valid jetty
#

and a len-start len

winged mantle
#

i think just length and string is fine

#

wait how does string_view in cpp work

#

what if the source string gets deleted

fleet cedar
#

Well then you get a uaf

#

Just another day in c++

winged mantle
#

makes sense

valid jetty
#

string_view is like &str where string is String

winged mantle
#

i was thinking you could add to reference counter.. but c++ strings are like unique_ptrs

valid jetty
#

if you know rust

fleet cedar
#

Some std::string implementations do indeed refcount I think

winged mantle
#

i think qstring does

#

i have mainly programmed with qt

#

why is there no | NULL type in C

#

(this is a joke)

valid jetty
#

there’s is, it’s called a raw pointer

#

πŸŽ€

winged mantle
#

πŸŽ€

deep mulch
#

πŸŽ€

winged mantle
#

but the problem with using your own strings in the stdlib does not support

fleet cedar
#

That's ok, c++ stdlib is crap anyway

winged mantle
#

C

fleet cedar
#

C barely has a stdlib

winged mantle
#

ig i could implement my own stdlib

#

that would be a cool project

deep mulch
#

@valid jetty what is starting nginx on my server

valid jetty
winged mantle
#

mutates...

ionic lake
winged mantle
#

why is there no man entry for bufsiz

fleet cedar
#

Wtf is bufsiz

winged mantle
#

you mean i can't just use man as C google

winged mantle
deep mulch
winged mantle
#

buffer size

ionic lake
#

nice

winged mantle
#

CVE-2025-3248 is a critical code injection vulnerability affecting Langflow, a popular tool used for building out agentic AI workflows. This vulnerability is easily exploitable and enables unauthenticated remote attackers to fully compromise Langflow servers. The issue is patched in Langflow 1.3.0.

supple whale
#

nah its way more than that

#

that endpoint is giga sanitised, they just overlooked that python decorators can run code

#

because python

frosty obsidian
#

don't use ai garbage and that won't happen

supple whale
#

again if you read the code for more than a quarter of a second then you'd see its not ai garbage

frosty obsidian
#

no im calling langflow as a product garbage

supple whale
#

they had to work around dogshit problems in python with dogshit python solutions

#

just because python's ast doesnt process imports correctly

#

woeful

winged mantle
#

a real experienced programmer human would write this confusing code with no comments

#

i have no idea if this is undefined behaviour blobcatcozy

#

maybe i should just allocate buffer separately

hoary sluice
winged mantle
#

seems like fgetc buffers for you?

#

even java does not do that

hoary sluice
#

@valid jetty we need to hold a who knows more italian brainrot animals competition

hoary sluice
#

@valid jetty im scared, i vibe fixed my parser and it works now

#

on monday i will wake up and my parser will have exploded

#

woohoo you can remove the parens now

shiftLeft x n = x * 2 ** n
shiftRight x n = x / 2 ** n 
shiftRight (shiftLeft 2 8) 8

instead of

shiftLeft x n = x * 2 ** n
shiftRight x n = x / 2 ** n 
(shiftRight (shiftLeft 2 8)) 8
#

@fleet cedar @valid jetty i remember some language had a parser that had significant whitespace for unary -, so foo - x would be a binary op and foo -x would be passing -x to the function foo

#

is that blobcatcozy or husk

fleet cedar
#

Haskell does that with an optional feature flag

hoary sluice
#

apparently like all of the popular functional languages do that

hoary sluice
#

i cant find a lot of info on it

hoary sluice
#

yea should i do this

winged mantle
#

i love reading glibc source code to work out the best thing to do

pearl stagBOT
# winged mantle https://github.com/bminor/glibc/blob/21e54f160f6245f959cca1f48bad9cca487c2570/li...

genops.c: Lines 326-349

if (_IO_vtable_offset (fp) == 0 && _IO_fwide (fp, -1) != -1)
  return EOF;

if (fp->_mode == 0)
  _IO_fwide (fp, -1);
if (_IO_in_put_mode (fp))
  if (_IO_switch_to_get_mode (fp) == EOF)
    return EOF;
if (fp->_IO_read_ptr < fp->_IO_read_end)
  return *(unsigned char *) fp->_IO_read_ptr++;
if (_IO_in_backup (fp))
  {
    _IO_switch_to_main_get_area (fp);
    if (fp->_IO_read_ptr < fp->_IO_read_end)
  return *(unsigned char *) fp->_IO_read_ptr++;
  }
if (_IO_have_markers (fp))
  {
    if (save_for_backup (fp, fp->_IO_read_end))
  return EOF;
  }
else if (_IO_have_backup (fp))
  _IO_free_backup_area (fp);
return _IO_UFLOW (fp);
fleet cedar
#

Please light that on fire

winged mantle
#

i think i will just use fread

hoary sluice
#

im so glad im using rust

winged mantle
#

i barely have an understanding of threading maybe i should learn it more sometime

#

does anyone truly understand threads

#

or do they just pretend to

fleet cedar
#

Wanna see something cursed?

valid jetty
winged mantle
valid jetty
#

because it was easier to parse

fleet cedar
#

/run ```java
\u0053\u0079\u0073\u0074e\u006d\u002e\u006fu\u0074\u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0022\u0048e\u006c\u006c\u006f\u002c\u0020\u0057\u006f\u0072\u006cd\u0021\u0022\u0029\u003b

rugged berryBOT
#

Here is your java(15.0.2) output @fleet cedar

Hello, World!
hoary sluice
#

expr

valid jetty
#

is that not making it easier to parse

winged mantle
hoary sluice
#

no cause sometimes its just ambiguous

valid jetty
#

ah

#

fair

#

foo x - 3

hoary sluice
#

@valid jetty would 100 silverback gorillas be able to beat 1 rosie

#

wait shit

valid jetty
#

foo x (-3)

hoary sluice
#

other way around

fleet cedar
#

That's just regular java

valid jetty
#

foo (x - 3)

fleet cedar
#

Bot does add public static void main though

valid jetty
#

can the silverback gorillas write compilers

#

didn’t think so

hoary sluice
#

well ok i didnt specify that you dont have an F35

valid jetty
#

it’s basically

#

generic lifetimes but on steroids

hoary sluice
#

wtf is a generic lifetime

#

arent lifetimes always generic

valid jetty
#

to put it simply, you can define an Fn trait item on a trait impl, and that trait item may take an argument which has a lifetime, but you’ll only know that lifetime when calling the function, even though the lifetime has to be somehow specified trait wide for than Fn trait item

hoary sluice
#

i use literally 0 lifetimes anywhere besides impl debug and display

valid jetty
#

so the solution is that higher rank trait bounds

hoary sluice
#

this sounds super niche

valid jetty
#

you have a for<'a> Fn(&'a i32) and you can specify this lifetime trait-wide rather

#

for any trait 'a, that is the Fn trait item that type T is

hoary sluice
valid jetty
#

it’ll just infer the lifetime that you’re talking about at the call site

#

@fleet cedar can you explain this simpler lmao

#

it’s an advanced concept it’s kinda hard to explain simply

#

i’ll try to explain via code examples when i get home

#

i’m currently out at the front of my school at 9pm πŸŽ€πŸŽ€

fleet cedar
#

I have never written a hrtb in my life

valid jetty
#

oh

#

i mean neither have I

hoary sluice
#

i think im mainly having trouble understanding this because ive never seen the syntax for<'a> for normal lifetimes either

valid jetty
#

but it’s still a cool concept to know

hoary sluice
#

this just sounds extremely useless

deep mulch
#

@valid jetty omg hiii

hoary sluice
#

oh its literally just Fn(&'a str) where 'a is predefined in the trait vs Fn(&'a str) for all 'a

#

ok

valid jetty
#
fn foo(x: &i32) { dbg!(x); }

fn main() {
    let cb: for<'a> Fn(&'a i32) = foo;
    {
        let tmp = 3;
        cb(&tmp); // lifetime &'a
    }
    {
        let tmp = 4;
        cb(&tmp); // lifetime &'b
    }
}
``` it’s a way to concretely type this
hoary sluice
#

what is cb

valid jetty
#

(yes it’s not just useful in traits)

valid jetty
hoary sluice
#

yea i understand it

valid jetty
#

πŸ™πŸ™

hoary sluice
#

its just a generic lifetime

#

why is it called hormone replacement therapy

valid jetty
#

thats.. exactly what i said

valid jetty
hoary sluice
#

oh was steroids the joke here

valid jetty
#

😭😭😭

#

glad someone got it

hoary sluice
#

is it on steroids because hrt or is it on steroids because its somehow better than just generic

valid jetty
#

both

hoary sluice
#

how is it not just a normal generic

valid jetty
#

it’s like a level above generic lifetimes

hoary sluice
#

ohh

#

i thought this was what generic lifetimes were

valid jetty
#

because instead of saying you have an 'a for the duration of the function or trait, you’re saying you have a lifetime you don’t know yet but will when you call the function

#

it’s really hard to explain this lmao

hoary sluice
#

instead of it being generic on the trait its generic on the function

fleet cedar
#

The trait bound itself is generic

valid jetty
#

yea this ^^

#

it can take any other lifetime

hoary sluice
#

its literally just βˆ€'a

fleet cedar
#

Yes

valid jetty
#

yeah that’s a good way to put it

fleet cedar
#

Hence why it uses for keyword

valid jetty
#

yep

hoary sluice
#

^

valid jetty
#

for all analogy

hoary sluice
#

?

fleet cedar
#

What would be the difference

hoary sluice
#

wait are they equivalent in this case

valid jetty
#

well it’s like β€œfor all 'a that this Fn trait item is called with”

#

which is essentially β€œfor any” as far as the type system is concerned

fleet cedar
#

It's just a for all

hoary sluice
#

whats the mathematical difference between for any and for all

#

or is there none

valid jetty
#

tbh i don’t know the formal difference but i’m sure mathematicians had nothing better to do than prove that they are different

hoary sluice
#

This seems to depend on the context: "For all x∈X P(x)
" is the same as "For any x∈X P(x)" On the other hand "If for any x∈X P(x), then Q" means that the existence of at least one x∈X with P(x) implies Q, so P(x) doesn't need to hold for all x∈X to imply Q.

fleet cedar
#

"For any" is an english phrase, not math

hoary sluice
fleet cedar
#

Convention

hoary sluice
#

im gonna put for any in a proof and you cant do anything about it

valid jetty
#

anything can be a mathematical term if you use it in a paper and people cite it enough

hoary sluice
valid jetty
#

i could call the theory of everything β€œski bidi ri zz” (idk if those words are filtered) in my next paper and if people cite it in future papers it’s now a mathematical term

fleet cedar
#

I'm gonna put an apple pie in a proof

#

(Probably won't though, lazy)

hoary sluice
#

i wil make the elementary arithmetic operators the following: + - tralaleroTralala / ** %

fleet cedar
#

I remember in some uni lecture the professor redefined the symbol 4, just to show he could

hoary sluice
#

lol

valid jetty
#

lmao

#

i’m sure β€œfor any” is definitely used throughout mathematical papers though

#

i’m willing to bet money that there are papers that use the exact phrase β€œfor any”

hoary sluice
fleet cedar
#

Since most papers are written in english, that seems exquisitely likely

hoary sluice
#

also you dont have any money

fleet cedar
#

Did you plunder her

hoary sluice
#

yop

deep mulch
#

@valid jetty

#

hi

nimble bone
#

@valid jetty huiii

signal oakBOT
deep mulch
#

@robust jackal

#

yes

modern rune
south moon
#

on pastebin 😭

#

is @signal oak open source

spark tiger
#

Introducing Codex: a cloud-based software engineering agent that can work on many tasks in parallel, powered by codex-1. With Codex, developers can simultaneously deploy multiple agents to independently handle coding tasks such as writing features, answering questions about your codebase, fixing bugs, and proposing pull requests for review.

median root
#

guys does this make me a good dev? im removing more code than im adding!1!1!!!

lavish cloud
#

Does anyone know how to OpenGL cuz I can't figure out deferred lighting

undone sonnetBOT
runic sundial
lavish cloud
#

because I'm currently trying to render them all to the window

runic sundial
#

Essential debugging

lavish cloud
#

I know the G-buffer is fine at least

#

but trying to render only the ambient lights is still black (and still erases all drawn content)

runic sundial
#

No I mean like, can you render the gbuffers to the window to debug it?

#

Without the actual lighting passes

#

I'm on the train and the 4G is dying

lavish cloud
hoary sluice
#

gigabased

lavish cloud
runic sundial
#

So what part is busted?

lavish cloud
#

either the way I set up my gbuffer backing textures or the way I bind them to the light shader or the light shaders or the blending or the

runic sundial
#

Also, do you have a debug output wired up yet?

lavish cloud
#

I don't know anything opengl so half of this is just LLM stuff

runic sundial
#

Like, for debug error message

lavish cloud
#

I mean I can run it with renderdoc

lavish cloud
runic sundial
#

Heretic.

lavish cloud
#

I didnt know opengl did error messages other than just printing to stdout

runic sundial
#

Go purchase the OpenGL Superbible 7th edition right now.

#

Opengl can give you asynchronous debug output for errors

#

Or general messages

lavish cloud
#

it doesn't crash or report to stdout rn tho, when there's a problem it usually does

runic sundial
#

How is it even printing to stdout

lavish cloud
#

Β―_(ツ)_/Β―

#

it does so when I fuck up my shader code fwiw

runic sundial
#

Well, just tell the AI it has to fix it

#

Or it goes to jail

lavish cloud
#

I tried on 3 separate AIs

#

all fail to fix the problem

runic sundial
#

Get the OpenGL Superbible and just read it

#

Find a pdf if you're unable to afford a physical copy

#

Just read it and follow the examples provided there

lavish cloud
#

but all opengl docs are written as if you understand opengl already

#

idk what a vertex or renderbuffer or framebuffer or other stuff is

runic sundial
#

Because you opened the unfunny docs

#

Anyway if you don't know what a vertex is I think you're cooked

lavish cloud
#

I know it's different from a fragment at least

#

cuz they both have different shaders

runic sundial
#

There's a lot of stuff but likr

#

If you make it using AI then it will uh

#

Explode

#

I can help explain terms but I will not fix code

lavish cloud
#

ok whats a g buffer, depth buffer, render buffer, draw buffer, frame buffer
and the like differences
and how does opengl know which one to use

runic sundial
#

A gbuffer is an abstract concept, it's a "geometry buffer" and what you usually draw the geometry onto in the middle stages of a deferred renderer

#

A framebuffer is a container which describes a buffer onto which you render. It has textures and renderbuffer attachments.

#

Renderbuffers are special "write-only" textures, you need to blit (manually copy) stuff from them if you ever want to read.

But, they are useful for depth testing.

A depth buffer is a greyscale image that is used to store depth. Depth here means how close or far away from the camera something is.

#

How does opengl know which to use? Framebuffers are used to describe what you're gonna draw onto etc, but the rest is more when you decide to use em

lavish cloud
runic sundial
#

So in a deferred renderer, you create a set of textures. These are your gbuffers. You take these textures and you attach em to a framebuffer. That's your rendertarget.

You can now render stuff with the shader to these textures if you bind that framebuffer beforehand.

Once you're done rendering stuff to it and want to light up the scene, you bind these textures as samplers and another framebuffer for the output for the light or whatever.

Once you're done with the lighting, you bind the window framebuffer (framebuffer zero is the window one usually), and render the final output there.

#

Generally the way a deferred renderer works

lavish cloud
#

ok I think that's what I do (except I draw light passes all to window framebuffer directly with gl blending on)

runic sundial
#

That also works

lavish cloud
#

but then why no work

runic sundial
#

Works if everything is correct

#

Peek this

#

I'm assuming you're using LWJGL3 bindings with Kotlin, and that should have bindings for this included

#

This will let you route all errors to stdout, with stacktraces

lavish cloud
#

There's some stuff during model loading:```
33350 33361 131185 33387 Buffer detailed info: Buffer object 160 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (2), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
33350 33361 131185 33387 Buffer detailed info: Buffer object 161 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.

But nothing during each draw step
valid jetty
#

or whatever the lib is

winged mantle
#

i wish this would work :(

#

executable/.. does not seem to resolve to the directory the executable is in

runic sundial
fleet cedar
#

argv[0] is just a random string that's conventionally a path to the executable

#

There was some systemd tool or something that had a security vulnerability because it assumed argc >= 1

winged mantle
#

you mean it's not even guaranteed that it's present?

hoary sluice
#

it pretty much always is

winged mantle
#

i guess i will allow any path to be passed in

#

this is just an example executable

#

to test the lib

hoary sluice
#

enough to allow relying on it (unless youre systemd ig)

winged mantle
#

in this case testing the streaming functionality

fleet cedar
#

On linux the exe path can be found somewhere in auxv I think, or readlink(/proc/self/exe)

winged mantle
#

tbf it's not like i'

#

m bothering to make it work on anything other than linux

fleet cedar
#

On windows there's some api for it but I don't know it by heart

hoary sluice
winged mantle
#

(in the makefile)

winged mantle
#

idk how you would make it generate a dll tbh

hoary sluice
#

just dont

winged mantle
#

how would makefiles even work on windows

hoary sluice
#

just dont support windows

winged mantle
#

or what if the distro doesn't have a mkdir command for example

hoary sluice
#

if a windows user wants to use my software they can either switch to linux or pay me to port it to windows

winged mantle
#

but makefiles are sh based

#

do you use windows port of sh and coreutils

hoary sluice
#

you mean in the makefile?

winged mantle
hoary sluice
hoary sluice
# winged mantle

if someone uses a distro so obscure that it doesnt have mkdir preinstalled they can either install/alias mkdir or make it themselves, this isnt something you have to worry about

balmy lintel
#

developers who develop on linux and then say "sorry cant fix windows issues" are so annoying

winged mantle
#

still what about windoze

hoary sluice
#

what is $CC isnt set

#

same issue

runic sundial
winged mantle
#

i would first think you'd build in wsl

winged mantle
#

but then you'd still be building a so

balmy lintel
#

sorry

hoary sluice
#

genuine torture

fleet cedar
#

I'm more of a I don't look for bugs on windows but if someone reports one I'll take a look kind of guy

winged mantle
#

so i imagine there's some ports of make to windows which also have some port of sh and coreutils

hoary sluice
#

should be illegal

winged mantle
balmy lintel
hoary sluice
#

its a war

#

they force me to use windows

#

i make linux only software

balmy lintel
#

like imagine getting some job and you never used windows or macos before and they just expect you to learn to use it within 2 weeks

hoary sluice
#

in the name of "corporate security"

runic sundial
winged mantle
#

use freebsd

hoary sluice
#

their threat model is "someone who got fired and is angry will publish the code from their linux computer, if we give him a windows machine we can lock it before firing him"

lavish cloud
winged mantle
hoary sluice
#

its one of those "digital transformation" companies that contract services for random companies, some of which require nda

winged mantle
#

digital renovation

hoary sluice
#

if a company doesnt allow you to use your own laptop or your own os theyre generally evil and should not be worked for

runic sundial
#

so dump the output this framebuffer onto the screen, or to an image or whatever

#

to validate their outputs

hoary sluice
lavish cloud
lavish cloud
lavish cloud
#

how do I show those

runic sundial
#
layout (location = 0) out vec4 gPosition;
layout (location = 1) out vec4 gNormal;
layout (location = 2) out vec4 gAlbedoSpec;
layout (location = 3) out vec4 gTangent;
layout (location = 4) out vec4 gBitangent;
#

Whatever texture is in loc 1

hoary sluice
runic sundial
#

If lighting is broken, validate the TBN values. So Normals/Tangent/Bitangent

lavish cloud
runic sundial
#

if you have render doc you should be able to just, find that texture and render it

#

one sec

lavish cloud
runic sundial
#

And the T and B ones look different?

lavish cloud
#

but the model data shouldn't matter because the ambient shader should essentially just be a solid color

#

T and B?

runic sundial
#

Tangent/Bitangent

runic sundial
#

anyway, send over the fragment shader for the actual render output then

lavish cloud
runic sundial
#

yep, this looks correct.

lavish cloud
runic sundial
#

it's in this yucky blob

lavish cloud
#
@Language("GLSL")
private const val LIGHT_VTX_SHADER = """
    #version 330 core
    layout (location = 0) in vec3 aPos;
    layout (location = 1) in vec2 aTexCoords;
    
    out vec2 TexCoords;
    
    void main() {
        TexCoords = aTexCoords;
        gl_Position = vec4(aPos, 1.0);
    }
"""

private val ambientLightShader = Shader(LIGHT_VTX_SHADER, """
    #version 330 core
    uniform vec3 ambientColor;
    uniform sampler2D gAlbedoSpec;
    
    in vec2 TexCoords;
    out vec4 FragColor;

    void main() {
        vec3 albedo = texture(gAlbedoSpec, TexCoords).rgb;
        FragColor = vec4(ambientColor * albedo, 1.0);
    }
""".trimIndent())
#
val ambientLights = lights.filter { it.type == Light.LightType.AMBIENT }
val ambientColor = ambientLights.fold(Vector3.ZERO) { acc, light ->
    acc + light.color * light.intensity
}

ambientLightShader.use()
ambientLightShader.setUniform("ambientColor", ambientColor)
ambientLightShader.setUniform("gAlbedoSpec", 2)
renderFullScreenQuad()
runic sundial
#

So the vertex shader is just a passthrough meant to be used with a fullscreen pass

#

Have you tried on the ambientLightShader FragColor = vec4(1.0, 0.0, 0.0, 1.0) ?

#

Should make the whole screen red.

#

Just validates that you're doing the full-screen pass at all

lavish cloud
#

so even thats incorrect

runic sundial
#

Next I would:


FragColor = vec4(1.0, 0.0, 0.0, 1.0);
FragColor.rg = TexCoords;

runic sundial
lavish cloud
#

cuz I have blend enabled

runic sundial
#

You're doing a full-screen pass with red and alpha one, most blend functions will just treat it as full opaque

lavish cloud
#
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_ONE, GL_ONE);

// render to gBuffer

// bind textures

// ambient light pass
#

oh

#

how do I fix that

runic sundial
#

This example uses glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

#

Without setting the blend equation

lavish cloud
runic sundial
lavish cloud
#

but that requires stuff to have an alpha

runic sundial
runic sundial
#

Ok, your UVs are perfect.

lavish cloud
# runic sundial Yeah?

but the magenta floor (regular render pass) has no alpha and the car model (deferred lighting render pass) has no alpha

runic sundial
#

My question is why do you intend there to be alpha to begin with?

lavish cloud
#

wdym?

valid jetty
runic sundial
#

Why do you need blending enabled?

lavish cloud
#

because wont every light shader overwrite all old data otherwise

runic sundial
#

Oh, you're trying to mix the color data from multiple shaders?

lavish cloud
#

well

#

yeah

#

thats how deferred lighting works isnt it

#

one pass from ambient, one from each directional and one from each point

#
  • all the data that was rendered before the gbuffer/light passes (e.g. skybox, debug objects, etc)
runic sundial
#

Deferred gives you a lot of freedom, but mixing is generally done in post

#

Like with lights, the power of deferred is that you can do the lights all in one big go

lavish cloud
#

thonk how does that work in one big go?

#

because best I could find with a single shader is a hardcoded limit on lights

runic sundial
#

Do you know how deferred is different from forward?

lavish cloud
#

but modern game engines support up to millions of lights

#

deferred is doing it on the 2d view based on the depth data and stuff iirc?
and forward is doing it as part of the vertex/fragment shader for the object I believe

#

that's what I understood from the wiki page at least

#

and because you're dealing with a simpler view deferred is faster (and can do any number of lights)

runic sundial
#

Forward is "what you see is what you get" lighting. Both can do "any number of lights", but the optimization strategies and pros/cons differ.

#

Like with forward, you light the geometry as it's being rendered.
With deferred, you split the info about the geometry into 'gbuffers' and 'do it later'

lavish cloud
runic sundial
#

The "one big go" has to do with you being able to treat the gbuffers as all the geometry as a set of textures.

So a single lighting pass can do all the lighting at once.

#

gbuffers -> (big fat lighting shader) -> window

#

Is the simplest

lavish cloud
#

ic

#

wait but then how does the big shader know how many lights there are and what types of lights, without hardcoding a limit

runic sundial
#

You, hardcode a limit?

lavish cloud
#

I thought the point of deferred lighting was to not have a limit

runic sundial
#

There is always a limit. Deferred is just one of the ways of having a higher limit.

lavish cloud
#

ic

#

also wait

#

if you have everything as a texture

#

how do you deal with reflective surfaces

#

cuz you'd need to know what's behind a wall in order for a mirror showing what's behind it to work

runic sundial
#

Screen space trickery

lavish cloud
#

or is that where you cheat and put a camera in the mirror, then render that camera output as texture on the mirror

runic sundial
#

What's behind that wall? You've discovered one of the limits of rasterized rendering

lavish cloud
#

so I guess I have to learn raytraced rendering instead then?

runic sundial
#

Raytraced, or one of the tricks to get around it to fake it.

#

Depends on performance targets

#

If you wanted to have "no limit" you can technically do the similar multi-pass you were suggesting, but then you need to have a seperate "luminance" gbuffer.

#

But you should still have a "hard-coded" limit per pass, so each pass can do more than one light at a time.

lavish cloud
runic sundial
runic sundial
#

Anyway with this and disabling blending, you should at least see "something" on the screen.

lavish cloud
runic sundial
#

Either uniform sampler2D gAlbedoSpec; is not bound correctly, or it is black.

lavish cloud
#

gAlbedoSpec comes from ```
vec4 diffuse = material.diffuse * VertexColor;
if (hasDiffuseMap) {
diffuse *= texture(diffuseMap, TexCoords);
}

// Specular color
vec4 specular = material.specular;
if (hasSpecularMap) {
specular *= texture(specularMap, TexCoords);
}

// Store diffuse and specular components
gAlbedoSpec.rgb = diffuse.rgb;
gAlbedoSpec.a = specular.r; // Store specular intensity in alpha

#

hmm yeah gAlbedoSpec is black

runic sundial
#

set gAlbedoSpec.rgb = diffuse.rgb; to gAlbedoSpec.rgb = vec3(1.0, 0.0, 0.0); for more red debudge

lavish cloud
runic sundial
#

there u go

#

issue found

lavish cloud
#

so diffuse.rgb is wrong

runic sundial
#

yOp

#

You can go back and undo the changes made to the other shader, and mayhaps your funny blend modes are correct after all

lavish cloud
#

material.diffuse is set to Color(value=[153, 153, 153, 255])

#

so that should be fine

#

so does that mean VertexColor is wrong?

runic sundial
lavish cloud
#
out vec3 FragPos;
out vec4 Color;
out vec3 Normal;
out vec2 TexCoords;
out vec3 Tangent;
out vec3 Bitangent;
// ---
in vec3 FragPos;
in vec4 VertexColor;
in vec3 Normal;
in vec2 TexCoords;
in vec3 Tangent;
in vec3 Bitangent;
```order of in/out values seems fine
lavish cloud
#

ok figured it out
now why is a light thats above it and pointing up still lighting it up from below

runic sundial
solar thistle
winged mantle
#

i tested this code on a 1gib file and it worked perfectly thumbsup

#

idk if it should stop on null but that's invalid in json anyway πŸ€·β€β™€οΈ

winged mantle
#

i have identified a "problem" with splitting strings into multiple tokens

#

you would need to have context of what the previous token was

hoary sluice
valid jetty
#

what hes doing is very smart but also very dangerous

winged mantle
#

put in json string, outputs ansi highlighted string

#

and it's kinda useful for token parsing to be relaxed and not care about the previous token

#

so even invalid json gets highlighted bun

fleet cedar
#

What are your goals for your parser

winged mantle
#

mainly learning

fleet cedar
#

Performance? Ergonomics? Zerocooy? Resilience?

winged mantle
#

i can use it in my c discord bot!

#

simplicity

#

i guess

#

but some versatility because it will push me further

#

I think I will just make string one token like most parsers

fleet cedar
#

If you want simplicity, step 1 is to not write your own json parser

winged mantle
#

😭

#

it's mainly for learning

#

i just might use this library if i do other c projects

#

and say... not having a whole hashtable impl would make it easier and more lightweight

nimble bone
#

tode insane

deep mulch
#

tode insane

valid jetty
#

@hoary sluice you will not believe how hard this was but

#

self-referential structs are now possible

#

as long as you refer to a pointer

#

so you can do this

struct A {
    Foo *a
}

struct B {
    Foo *b
}

struct Foo {
    A *x,
    B *y
}
``` without forward declaring
#

which means that this is now cleaner than ever

enum AstNodeKind {
    Literal,
    BinOp,
    Funcall,
    Return,
    Declare
}

struct Literal {
    TokenKind kind,
    TokenValue value,
}

struct BinOp {
    Box<AstNode> left,
    Box<AstNode> right,
    string op,
}

struct FunctionCall {
    ObjectString name,
    AstNode[] args,
}

struct Return {
    Box<AstNode> value,
}

struct Declare {
    ObjectString type,
    ObjectString name,
    Box<AstNode> value,
}

struct AstNode {
    AstNodeKind tag,
    @unused Box<Literal> as_literal,
    @unused Box<BinOp> as_binop,
    @unused Box<FunctionCall> as_funcall,
    @unused Box<Return> as_return,
    @unused Box<Declare> as_declare,
}
#

the old(er) version is so much more insane lmao

struct AstNode {
    u32 tag;
    void *as_literal;
    void *as_binop;
    void *as_funcall;
    void *as_return;
    void *as_declare;
};

const ASTNODE_LITERAL = 0;
const ASTNODE_BINOP = 1;
const ASTNODE_FUNCALL = 2;
const ASTNODE_RETURN = 3;
const ASTNODE_DECLARE = 4;

struct Literal {
    string kind;
    ValueKind *value;
};

struct BinOp {
    AstNode *left;
    AstNode *right;
    string op;
};

struct FunctionCall {
    ObjectString *name;
    AstNode *[] args;
};

struct Return {
    AstNode *value;
};

struct Declare {
    ObjectString *type;
    ObjectString *name;
    AstNode *value;
};

struct AstNode {
    u32 tag;
    Literal *as_literal;
    BinOp *as_binop;
    FunctionCall *as_funcall;
    Return *as_return;
    Declare *as_declare;
};
#

im not sure how to approach this better than to do it the way i did

#

basically before i parse the real structs, in an earlier parser pass, i collect all structs enums and namespaces into the struct and enum pools

#

which, to allow for self-referential formatting, also means i need to forward declare the formatting function (if the user didnt specify it shouldnt be generated)

#

that means the number of functions for each struct effectively doubles

#

even though only 1 is generated

hoary sluice
#

@valid jetty woo finally

valid jetty
#

yay !!!

hoary sluice
#

also i notice that when i run fac 49 this is the error:

#

and with fac 50 its a stack overflow

#

ig cause the stack is big enough to compute 49!

valid jetty
#

tail call recursion time?

hoary sluice
#

also is the mod.rs file meant to house only mod, pub use and type or can i put my entire parser in there

valid jetty
#

or something

hoary sluice
#

cause clippy complains about module inception so im assuming it wants me to put the contents of parser.rs into mod.rs

#

@fleet cedar

valid jetty
#

-# blobcatcozystars
mini blobcat

#

ulimit -s 16384 then i guess

#

lmao

hoary sluice
#

stack is 16mb by default on nixos

#

probably

valid jetty
#

oh

#

mine is 8mb

formal belfry
#

anyone else hear that ominous bell tolling????🀣🀣🀣 no?? just me??????😭😭😭😭😭😭

hoary sluice
#

what

winged mantle
valid jetty
valid jetty
#

make ints internally i128 when

hoary sluice
#

they are

valid jetty
#

oh

#

i256 when

winged mantle
hoary sluice
winged mantle
#

Quite frankly, even if the choice of Java were to do nothing but keep the Kotlin, Nix and Rust developers out, that in itself would be a huge reason to use Java

valid jetty
#

or just use bigint tbh

hoary sluice
#

i am not adding i256 as my only dep

valid jetty
hoary sluice
fleet cedar
winged mantle
#

🀣🀣🀣 eagerly when he fidns oytu tthat z??? because the uses rust

hoary sluice
#

is the answer to my question yes or no

deep mulch
#

rosie explosion

fleet cedar
#

It contains the contents of the module

winged mantle
#

pretty sure you can put anything in mod.rs

#

even a recipe for a cake

hoary sluice
winged mantle
#

SMART IDEA

fleet cedar
#

Depends on if you want the module to contain things or only submodules

winged mantle
#

instead of storing 2fa backup codes in obvious places put them in comments in project source code

#

so if malware tries to find 2fa backup codes it will fail

winged mantle
#

but i might remember wrong

winged mantle
#

i last did rust in dec

hoary sluice
#

theres no submodules in there