#๐Ÿช…-progaming

1 messages ยท Page 82 of 1

fleet cedar
#

While a span is start plus end

hoary sluice
#

uhh

pub struct Location {
    pub row: usize,
    pub column: usize,
}

shrug

fleet cedar
#

Row/column ๐Ÿคฎ

hoary sluice
#

that is not my priority rn

#

im working on rewriting my expression parser into a pratt loop instead of nested function hell

#

thats more important

unkempt ember
#

Is this some kind of Lexer ? Sorry if the question is dumb, I'm kinda new to Rust, I don't have the syntax well known yet

hoary sluice
#

its a parser

unkempt ember
#

Ah, wrong step...- Now that you mention it, self.parse_expression should have ring a bell

valid jetty
#

this is the makefile output from make run-math -B

#

itโ€™s a templated makerule

#

rules print commands they run unless you supress them with @ at the start of the line

#

iโ€™ll look when i get on my macbook

#

i canโ€™t read code on mobile

hoary sluice
#

woohoo new parser works

#

function application has higher precedence than binary ops, i think thats the right way to do it add 2 4 - 2 evaluates to 4

fleet cedar
#

That's not a great example of precedence though

#

Because (2 + 4) - 2 and 2 + (4 - 2) are the same

hoary sluice
#

wait im stupid

#

if you replace the - with a / its parsed as 3

#

evaluated as 3*

valid jetty
#

as expected

#

add โ€ฆ surely should parse everything until the end of the function def

hoary sluice
#

this is not a function def

valid jetty
#

i know i mean if you have foo = add 1 2 3 4 / add 5 6

#

the first add should have every arg passed to itself

hoary sluice
#

add adds 2 numbers its not sum but i assume you meant sum

hoary sluice
valid jetty
hoary sluice
#

FAILED tests/if_expressions.icy failed with error: Expected expression at 17:7

#

ignore the file name

valid jetty
#

usually add functions are variadic tho

hoary sluice
#

add 1 2 / add 5 6 evaluates to 0

hoary sluice
#

i just need some function to play with to test

valid jetty
hoary sluice
#

everything here evaluates to 2

if false then 1 else 2
if true then 2 else 1
if false then 1 elif false then 3 else 2
if (2 + 1) == 3 then 2 else 1
if 2 + 1 == 3 then 2 else 1
if 2 + 1 != 3 then 1 else 2

twoIfOneElseOne x = if x == 1 then 2 else 1
twoIfOneElseOne 1
twoIfOneElseOne 17 + 1

add a b = a + b
add 1 1
add 0 (if false then 1 else 2)
add 0 if false then 1 else 2
hoary sluice
#

FAILED tests/if_expressions.icy failed with error: Not a number at 17:6 oops

#

whatever noones gonna notice

#

it didnt work last commit so theres no reason for it to work now

#

oh its failing in the lexer

#

??

#

ok

valid jetty
#

oh yeah also i did what i wanted to do yesterday

#

all of ichigo now uses plain structs instead of pointers to structs, because hashmap buckets are now generic over T and U instead of having arbitrary casts to void * and back

#

for context

hoary sluice
#

i keep adding new features and improving it without changing the loc count

valid jetty
#

thats so real

hoary sluice
#

whens the elle interpreter coming

#

ellei

valid jetty
# hoary sluice i have no idea what any of this means
use std/prelude;
use std/collections/hashmap;

struct Object {
    HashMap<string, Object *> *entries,
    void *value,
}

fn Object::ensure_init(Object *self, string key) {
    if !self.entries {
        self.entries = HashMap::new();
    }

    if !self.entries.contains_key(key) {
        self.entries[key] = #alloc(Object);
    }
}

fn Object::__load__(Object *self, string key) -> Object * {
    self.ensure_init(key);
    return self.entries[key];
}

fn Object::__store__<T>(Object *self, string key, T value) {
    self.ensure_init(key);
    self.entries[key].value = Box::new(value).value;
}

fn Object::to<T>(Object *self) -> T {
    return *#cast(T *, self.value);
}

fn main() {
    x := #alloc(Object);
    x["foo"] = [1, 2, 3];
    x["a"]["b"] = 1;

    $dbg(
        x["foo"].to<i32[]>(), // <[1, 2, 3] at 0x600003fd5200>
        x["a"]["b"].to<i32>() // 1
    );
}
``` love???
#

i called it Box but its not really a box

#

its just this for now

global pub;

struct Box<T> {
    T *value
}

fn Box::new<T>(T value) -> Box<T> {
    ptr := #alloc(T);
    *ptr = value;

    return Box {
        value = ptr
    };
}
hoary sluice
valid jetty
#

i edited the message lol

#

when i first sent it it was

global pub;

namespace Box;

fn Box::new<T>(T value) -> T * {
    ptr := #alloc(T);
    *ptr = value;
    return ptr;
}
hoary sluice
#

oh lol

valid jetty
#

you can overload deref now

placid cape
#

Hmmm

#

15?

balmy lintel
#

that's insanely low

valid jetty
#

wtf is this rust-looking code.. ๐Ÿ’” ๐Ÿฅ€ ```rs
fn QbeFunction::jumps(QbeFunction *self) {
last := self
.blocks
.last()
.expect("last block should exist")
.statements
.last()
.expect("last statement should exist");

return last.tag == QbeStatementKind::Volatile
    && last.as_volatile.instr.tag == QbeInstrKind::Return;

}

valid jetty
#

ok well

#

i think thats pretty cool

lavish frigate
#

love to see how insane people are becoming like holy cope

#

๐Ÿ˜ญ

fleet cedar
#

At least we have traits and enums

#

And modules

valid jetty
#

he never actually means what he says lol

lavish frigate
valid jetty
#

Crust <333

#

i watched the whole series of streams so far

#

so good

fleet cedar
lavish frigate
#

the more i read into this shit the more insane im becoming GET ME OUT

hoary sluice
hoary sluice
valid jetty
#

thats what i do

lavish frigate
#

i love python

#

/run

some_list = [
  "1. vencord",
  "2. is"
  "3. so",
  "4. stupid",
  "5. frfr"
]

print(len(some_list))
rugged berryBOT
#

Here is your py(3.10.0) output @lavish frigate

4
valid jetty
#

what the hell

fleet cedar
#

/run ```py
some_list = [
"1. vencord",
"2. is"
"3. so",
"4. stupid",
"5. frfr"
]
print(some_list)

rugged berryBOT
#

Here is your py(3.10.0) output @fleet cedar

['1. vencord', '2. is3. so', '4. stupid', '5. frfr']
valid jetty
#

oh

#

i love when python carries over dumb features from C

valid jetty
#

that thing is a lexing-time feature in C so you can do like

#define INT_FORMAT "%d"

int main() {
    printf("hi " INT_FORMAT " sillies", 39);
}
#

but its kinda useless in python because macros dont exist

#

lol

lavish frigate
#

insane ๐Ÿ˜ญ

#
#define INT_FORMAT "%d"

int main() {
    printf(`hi ${INT_FORMAT} sillies`, 39);
}
lucid trail
lavish frigate
#

they should add this

valid jetty
lucid trail
#

just like C fr!

lavish frigate
valid jetty
#

yes i think it is exactly from C

valid jetty
hoary sluice
#

@valid jetty @fleet cedar this is unironically cut my loc by like 30% lol

                Ok(Statement::new(
                    StatementKind::Declaration { name, types },
                    location,
                ))

                // after
                Ok(Statement::Declaration { name, types }.at(location))
valid jetty
#

interesting

#

zed has inline diagnostics

#

honestly kinda cool

hoary sluice
#

urgent

#

my life was incomplete

#

up until now

#

actually i remember researching it but i think i got sidetracked and ended up not setting it up

valid jetty
# hoary sluice how to
"diagnostics": {
  "inline": {
    "enabled": true,
    "update_debounce_ms": 150,
    "padding": 4
  }
},
#

you dont need the other fields

hoary sluice
#

@valid jetty my r-a stopped working help

#

nvm it works

valid jetty
#

it just kinda does that sometimes

#

๐Ÿ’”

hazy pine
#

rewrite full kernal in rust

hoary sluice
#

rust is so awesome

#

i did a whole bunch of refactoring and once i see there are no errors i know it will work

valid jetty
#

thats a good rule of thumb while your codebase is still <1kloc

#

at a point you can no longer be sure though

#

at least youll get no segfaults

royal nymph
visual shellBOT
royal nymph
#

pissbot so unusable

blazing haven
valid jetty
# royal nymph lc.tldr

tldr: maintainers of the kernel are stuck up and dont want to add a second programming language to their precious C code for no purpose other than "it complicates maintaining the project" even though the rust maintainers are only providing safe wrappers around C drivers and not writing any critical code in rust

royal nymph
#

valid

hoary sluice
#

except for logic errors it will always work

#

so true

#

@placid cape @valid jetty i just got an email from an @ups.com domain about a package so im assuming its not a scam and since i didnt order anything its probably the kotlin merch that i won finally being sent out

lavish frigate
hoary sluice
#

the words "embracing" and "go" do not belong in the same sentence

valid jetty
#

love go devs

lavish frigate
#

the fucking "and all my new friends are kinda stupid" really is the cherry on top

#

A modern URL bar (in @diabrowser):

โ€ขย Page Title not "/2025/12/seo-spam" gibberish
โ€ข Space on both sides of "/" for readability
โ€ขย Hover to reveal & edit URL
โ€ขย Emphasize domain for trust+security

Dia isn't just AI. It's refined browser basics too, @browsercompany style. https://t.co/Fle8qqNeYo

โ–ถ Play video
hoary sluice
fleet cedar
#

Showing title instead of address is the stupidest things any browser have ever done

hoary sluice
glacial mirage
#

dont tab titles literally show this lmao

fleet cedar
#

I rather have 200 tabs than 200 windwos

hoary sluice
hoary sluice
lavish frigate
#

the tab bar is perfectly fine

#

thats why it has been used for like a billion years

hoary sluice
#

im glad firefox allows you to smoothly drag tabs out of the window to open a new window

lavish frigate
#

till 3 years ago when everyone started to do vertical tabs cuz they couldnt think of any other way to make their browser more shit

hoary sluice
hoary sluice
#

im not saying i dont want multiple buffers

#

i dont want the tab bar at the top

#

zed doesnt allow you to remove this bar

#

i only use ctrl p

#

so its just in the way

hoary sluice
#

any statement i make is automatically ragebait ๐Ÿ˜ญ ๐Ÿ˜ญ

valid jetty
#

way more horizontal space than vertical space, and usually on articles or various websites the content is centered anyway leaving a bunch of useless empty space on the sides

lucid trail
#

yeah vertical tabs are great. glad they're adding it to Dia

hoary sluice
#

@valid jetty i will never gain loc

#

i would be the worst twitter employee

valid jetty
fleet cedar
#

Commits that reduce lines are the best ones

valid jetty
#

true

valid jetty
dense sand
#

they made gimp pretty

valid jetty
#

gimp is gnu software ?? ๐Ÿ˜ญ

#

im switching to krita

fleet cedar
#

A bigger issue than being gnu is that gimp sucks

valid jetty
#

yeah

#

i lied i usually use photopea

dense sand
#

photo pee

valid jetty
#

ughhhhhhhhhh i cant believe this

#

my error ctx strings were always off slightly and i thought i was selecting them wrong

#

then i tried to put non ascii characters in the file and suddenly the ctx strings became really wrong

fleet cedar
#

Ctx string as in source spans/locations?

valid jetty
#

yes

#

..it was broken because the ctx is constructed out of a start and end in bytes while the line starts were counted by chars

fleet cedar
#

What have I told you about counting chars

valid jetty
#

the ultimate result of like an hour of debugging

fleet cedar
#

Repeatedly

valid jetty
fleet cedar
#

char_indices btw

valid jetty
#

oh

#

well not really

#

because i dont want to iterate over the chars i want to iterate over the bytes

#

but i can .enumerate

fleet cedar
valid jetty
#

hmmm

#

i dont think this will help much because ill need to consume the iterator anyway

#
let start = *self.line_starts.get(at)?;
let end = *self.line_starts.get(at + 1).unwrap_or(&self.input.len());
let line = self.input.get(start..end)?;
fleet cedar
#

let line_starts = memchr::memchr_iter(b'\n', input.as_bytes()).collect();

#

Looks nice and is faster than anything you can write by hand

south moon
#

huskbot

fleet cedar
#

Also, just add input.len() to the vec to skip that edge case

valid jetty
#

i mean yeah but a whole dependency just for this loop doesnt sound like an amazing idea

valid jetty
south moon
#

nina so scary

fleet cedar
#

Much better than writing it yourself

valid jetty
#

maybe its warranted if i need to do this in multiple places but i think its fine for now

#

i think this could be called premature optimization because its not like its slow in its current state or anything

#

it would be really funny if it was broken before because of these non-ascii comments

#

(though i dont think thats the case)

fleet cedar
#

I don't think I have proclaimed my hatred for the cross product sufficiently in this discord

valid jetty
#

lmfao

fleet cedar
#

Also that formula doesn't make sense

#

The magnitude of the vectors is scalars, so you're doing the cross product between two scalars

valid jetty
#

actually yeah thats just copied over from the other function(s) lmao

#
fn Vector3::angle(Vector3 self, Vector3 v2) {
    f32 dot = self.dot(v2);
    f32 lengths = self.length() * v2.length();

    if lengths == 0.0 {
        return 0.0;
    }

    f32 cos_theta = dot / lengths;
    cos_theta = math::fclamp(cos_theta, -1.0, 1.0);

    // Unwrap the cos(ฮธ) into just ฮธ
    return #cast(f32, math::acos(cos_theta));
}
``` this is the impl
#

the other one does actually use the cross product

// Vector3 rotation follows Rodrigues' Rotation formula:
// as defined by:

// v_rot = v โ‹… cos(ฮธ) + (u ร— v) โ‹… sin(ฮธ) + u โ‹… (u โ‹… v) โ‹… (1 - cos(ฮธ))

// --- Where:
// v is the original vector
// u is the normalized axis of rotation
// ฮธ is the angle of rotation
// ร— denotes the cross product
// โ‹… denotes the dot product
// ----------
deep mulch
#

@valid jetty hiii

valid jetty
#

@deep mulch minklang

deep mulch
#

how

valid jetty
#

magic

deep mulch
#

@valid jetty wyd

valid jetty
#

working on ใ„ใกใ”

#

look the location is in the right place

deep mulch
#

English

valid jetty
#

off by one

#

but whatever

#

close enough

deep mulch
#

@valid jetty rosinga

valid jetty
#

nop

deep mulch
#

pleasee

valid jetty
#

@deep mulch

deep mulch
#

For

#

whys it say For and not for

valid jetty
#

For is the internal name of the token

#

it makes it greppable

deep mulch
#

surround by tilda and make lowercase

#

and still greppabl i think

fleet cedar
#

I didn't bother giving my tokens names

#

It's just Ident("for")

valid jetty
#

i technically do something like that

deep mulch
#

elle finish when

valid jetty
#

but i specialize some identifiers into new tokens

fleet cedar
#

Not that that language has for but anyway

valid jetty
#

but there are so many places to change

deep mulch
#

or maybe single quot

#

o

valid jetty
#

maybe this is the point where anyhow wouldve actually been useful

fleet cedar
#

I have ```rs
#[derive(Debug, Clone)]
pub enum TokenKind {
Ident(Box<str>),
RawIdent(Box<str>),
String(Box<str>),
Int(i32),
Float(f32),
Punct(char),
}

valid jetty
#

the places where an error exists are greppable but still annoying

deep mulch
#

rewrite elle 5 times

#

today

valid jetty
#

thats a very simple language

valid jetty
deep mulch
#

soon

#

elle will run on the jvm

valid jetty
#

absolute coding

#

oh spam

#

sorry

fleet cedar
#

Of course there's also ```rs
#[derive(Clone)]
struct RawToken {
pub start: u32,
pub end: u32,
pub line: Option<u32>,
pub token: TokenKind,
pub matched: u32,
}

valid jetty
valid jetty
#

i make my token kind and value seperate

fleet cedar
#

That sound pointless, the value still needs to be an enum with various variants

valid jetty
#

i mean yes

#

but there are a lot of kinds of tokens

fleet cedar
#

Unless you store their raw string representation

valid jetty
#

i dont wanna give every enum variant a value

fleet cedar
#

That's a lot of tokens yeah

#

Most of those would just be Punct('?') for me

valid jetty
#

true but it allows for sane comparisons in the parser

#

although

#

probably possible to just do what you said

#

but id have to make it a string

deep mulch
#

do

valid jetty
#

as there are such puncts as .. or <= or >>= and those are counted as 1 token

fleet cedar
valid jetty
#

i shoudlve made . be an arithmetic operator

pearl stagBOT
valid jetty
#

so tiny

#

whatt

fleet cedar
#

That function parses the interior of ```rs
{
1001 => $L0;
1002 => $L1;
1003 => $L2;
}

valid jetty
#
fn parse_switch(&mut self, delim: TokenKind) -> AstNode {
    let mut cases = Vec::new();
    let mut location = self.current_token().location;
    
    while self.current_token().kind != delim {
        let case = self.get(&[TokenKind::IntegerLiteral]);
        self.advance();
        self.expect_tokens(&[TokenKind::RightArrow);
        self.advance();
        let label = self.parse_label();
        self.advance();
        self.expect_tokens(&[TokenKind::Semicolon]);
        self.advance();
        
        cases.push((case, label));
    }

    set_end!(self, location);

    return AstNode::Switch(Switch {
        cases,
        location
    });
}
#

this is how i would do it

#

more verbose

deep mulch
#

sometimes i wodner if i got lead poisoining accidentally

#

maybe thast is why i am dumb

valid jetty
#

ur not dumb you just need to spend hours every day doing it for a whole year and youll get it too

fleet cedar
#

What do you do if the get or expect_tokens fails?

valid jetty
#

get will throw an elle_error if the current_token is not an IntegerLiteral

#

so does expect_tokens

fleet cedar
#

But still keep going?

valid jetty
#

advance cannot fail, it will not advance if its at the end

valid jetty
fleet cedar
#

What, does it panic or something

valid jetty
#

probably returning some Result is a good idea

fleet cedar
#

How do people even come up with things like that

valid jetty
#

what lol

#

well its not a panic

#
#[macro_export]
macro_rules! elle_error {
    ($loc:expr) => {{
        let _ = std::fs::remove_dir_all(unsafe { $crate::misc::constants::BUILD_PATH.unwrap() });

        // Panic in debug mode so you can see the line number where the error occured in the compiler
        if cfg!(debug_assertions) {
            panic!("{}", $loc);
        }

        eprintln!("{}", $loc);
        std::process::exit(1);
    }};
}
``` might aswell be
fleet cedar
#

Nasty

valid jetty
#

good enough for now

fleet cedar
#

It seems only binops and the => in flat syntax switches use .operator()

deep mulch
#

@valid jetty hii

fleet cedar
#

The three supported syntaxes are ```rs
get_var 6; set_temp 0;
get_temp 0; push 1001; binop ==; jnz $L2;
get_temp 0; push 1002; binop ==; jnz $L3;
get_temp 0; push 1003; binop ==; jnz $L4;
goto $L5;

    switch #6 {
        1001 => $L0;
        1002 => $L1;
        1003 => $L2;
    } $L3;
``````rs
        switch arg5 {
            case 1001:
                arg5 = 15.0;
                break;
            case 1002:
                arg5 = 0.0;
                break;
            case 1003:
                arg5 = -(15.0);
                break;
            default:
                arg5 = 0.0;
                break;
        }
``` (Latter shows more than the others, since the switch part there is interleaved with its bodies)
valid jetty
fleet cedar
#

Decompiling and recompiling the scripts of a specific game, with byte-perfect roundtripping

valid jetty
#

interesting

#

what do you mean by scripts?

fleet cedar
#

The things that control everything that happens in the game

#

Like, when you talk to an npc or whatever

valid jetty
#

ah i see

fleet cedar
#

Though ngl, that particular switch is pretty weird

#

Is that variable an int or float?

#

Seems to be that it's either float -180..=180, or a constant 1001..=1003 for preset angles

valid jetty
#

is there a way you can compile to some higher level pseudocode??

hoary sluice
#

and was full of extremely verbose error handling

valid jetty
#

lmao

fleet cedar
hoary sluice
#

it wasnt parsing ifs as arguments properly

hoary sluice
fleet cedar
hoary sluice
#

yes

fleet cedar
#

What even is the right parse there

#

Slap some parens

hoary sluice
#

it was parsing it as add 2; if x then 4 else 5

hoary sluice
fleet cedar
#

Could also steal haskell's $ operator

hoary sluice
#

$ isnt used for the same function im pretty sure

#

in haskell its still just add 2 if x then 4 else 5

fleet cedar
#

/run ```hs
main = print if true then 2 else 4

rugged berryBOT
#

@fleet cedar I received hs(9.0.1) compile errors


file0.code.hs:1:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
1 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:1:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
1 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory
hoary sluice
#

i use $ in place of the . in lambdas

#

/run

print 3
rugged berryBOT
#

@hoary sluice I received hs(9.0.1) compile errors


file0.code.hs:1:1: error:
    Parse error: module header, import declaration
    or top-level declaration expected.
  |
1 | print 3
  | ^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:1:1: error:
    Parse error: module header, import declaration
    or top-level declaration expected.
  |
1 | print 3
  | ^^^^^^^
chmod: cannot access 'out': No such file or directory
fleet cedar
#

Oh lol

hoary sluice
#

are u sure its print

#

/run

putStrLn "hi"
rugged berryBOT
#

@hoary sluice I received hs(9.0.1) compile errors


file0.code.hs:1:1: error:
    Parse error: module header, import declaration
    or top-level declaration expected.
  |
1 | putStrLn "hi"
  | ^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:1:1: error:
    Parse error: module header, import declaration
    or top-level declaration expected.
  |
1 | putStrLn "hi"
  | ^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory
fleet cedar
#

/run ```hs
main = print 98

rugged berryBOT
#

Here is your hs(9.0.1) output @fleet cedar

98
hoary sluice
#

/run

main :: IO ()
main = putStrLn "Hello, World!"
rugged berryBOT
#

Here is your hs(9.0.1) output @hoary sluice

Hello, World!
fleet cedar
#

print = putStrLn . show

hoary sluice
#

oh you dont need the type

fleet cedar
#

But anyway, ```
Unexpected if expression in function application:
if true then 2 else 4
You could write it with parentheses
Or perhaps you meant to enable BlockArguments?

hoary sluice
#

/run

main = print if true then 2 else 4
rugged berryBOT
hoary sluice
#

/run

main = print if true then 2 else 4
rugged berryBOT
#

@hoary sluice I received hs(9.0.1) compile errors


file0.code.hs:1:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
1 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:1:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
1 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory
hoary sluice
#

???

#

/run

main :: IO()
main = print if true then 2 else 4
rugged berryBOT
#

@hoary sluice I received hs(9.0.1) compile errors


file0.code.hs:2:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
2 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:2:14: error:
    Unexpected if expression in function application:
        if true then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
2 | main = print if true then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory
hoary sluice
fleet cedar
#

/run ```hs
main = print $ if True then 2 else 4

rugged berryBOT
#

Here is your hs(9.0.1) output @fleet cedar

2
hoary sluice
#

why does it require parens

#

/run

main :: IO()
main = print if True then 2 else 4
rugged berryBOT
#

@hoary sluice I received hs(9.0.1) compile errors


file0.code.hs:2:14: error:
    Unexpected if expression in function application:
        if True then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
2 | main = print if True then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory

file0.code.hs:2:14: error:
    Unexpected if expression in function application:
        if True then 2 else 4
    You could write it with parentheses
    Or perhaps you meant to enable BlockArguments?
  |
2 | main = print if True then 2 else 4
  |              ^^^^^^^^^^^^^^^^^^^^^
chmod: cannot access 'out': No such file or directory
hoary sluice
#

im not tryna make a haskell reskin

fleet cedar
#

Same reason why print sin pi doesn't work I assume

hoary sluice
#

this is parsed as print(sin(pi))

fleet cedar
#

Not in haskell

hoary sluice
#

wait

#

i meant

fleet cedar
#

It's (print sin) pi

hoary sluice
#

print(sin)(pi)

#

yea thats correct

#

if you want to print sin pi you need to do print (sin pi)

#

or just print 0

fleet cedar
#

And it would be inconsistent if print if ... was parsed as print (if ...) rather than (print if) ...

hoary sluice
#

with print if there is no ambiguity

fleet cedar
#

I'm not saying it's ambiguous

hoary sluice
#

the if is just an argument

fleet cedar
#

I'm saying it's difficult for humans to read

#

Programming languages are designed for humans, after all

hoary sluice
#
foo x y = x / y + y
foo if a == 7 then 3 else 1 7
#

ok this probably isnt the best

#

but you can put parentheses if you want to

fleet cedar
#

Yeah 1 is not a function, you can't give it a 7

hoary sluice
#

i dont want to have to put unneccessary parentheses when writing aoc

fleet cedar
#

Haskell is among the lowest-parentage languages I know

hoary sluice
deep mulch
#

eagley

hoary sluice
#

i think it actually would consume the 7 if the 1 was an ident

#

but i just explicitly block it from calling integers

fleet cedar
#

So you need else (foo bar) to have a function there?

#

Oh, weird special cases

#

Okay

hoary sluice
#

parse call is only invoked for identifiers

#

thats uh

#

wrong

#

but fine for now

#

wait what

#

oh shit i broke (manual) currying

#

oops

#

didnt have a test case for manual currying

blazing haven
#

but it's a screenshot xd

frosty obsidian
#

that font is called Maple Mono if you actually want to use it

hoary sluice
#

@valid jetty @deep mulch

#

passed math matura now i cant figure out this

blazing haven
valid jetty
#

i keep thinking its my own screenshot

blazing haven
#

im still testing this monaspace neon font rn

blazing haven
deep mulch
blazing haven
valid jetty
#

@hoary sluice is it sane to have all of this in the prelude

use std/collections/hashmap;
use std/collections/triple;
use std/collections/tuple;
use std/collections/array;
use std/option;
use std/result;
use std/limits;
use std/string;
use std/types;
use std/cast;
use std/time;
use std/core;
use std/math;
use std/rand;
use std/box;
use std/io;
frosty obsidian
valid jetty
#

all of it parses and compiles in like 150ms

deep mulch
#

@frosty obsidian hiiii

frosty obsidian
#

or if you have a good ide you can disable font features there

valid jetty
#

so bloat isnt an issue

deep mulch
hoary sluice
#

@valid jetty you dont need assert! when you can just make all your tests evaluate to either 2 or true if theyre correct

fleet cedar
hoary sluice
#

thats what i did yes

#

my lexer doesnt have floats

#

well it does but they dont work

valid jetty
#

you will 2 << x

hoary sluice
#

so i can only do 2 ** 1

blazing haven
#

ill give it a shot this weekend

hoary sluice
blazing haven
#

cba doing it tonight

valid jetty
valid jetty
frosty obsidian
#

i have recently started using it in my ide

#

but ive used it in my terminal for a while

valid jetty
#

i use noto sans in my terminal

#

imo it doesnt fit in the terminal

blazing haven
#

i still use hack nerd font mono

#

in my terminal

valid jetty
#

ok nvm

#

maple mono looks great in the terminal

#

idk why i switched away from it a while ago

frosty obsidian
#

i actually think it shines in the terminal

hoary sluice
# valid jetty add them

here u go


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

shines bright like a diamond diamond

hoary sluice
#

ignore the lisp ()()()()()()()( my parer is terrible

valid jetty
#

this is the speed of compiling ใ„ใกใ”

hoary sluice
#

@valid jetty im coining a new term its called rosiecoding

#

youre gonna be my ai now

valid jetty
#

husk

#

@hoary sluice my toy compiler with japanese syntax is almost as big as icypeas

hoary sluice
#

why no can work (foo 2) 3 when foo 2 evaluates to anything other than a futcino how to get parser to correctly thatn

valid jetty
#

Let's evaluate this problem.

#

Your issue:

hoary sluice
#

skill

valid jetty
#

Function calls are not parsed correctly, due to presumably inconsistencies in your parser.

#

How can you fix this?

hoary sluice
#

@deep mulch its working i manipulated her into thinking its a funny bit but in reality shes fixing my parser

valid jetty
#

โ€” Print the state of your parser at different points
โ€” Try using a simpler language like Python
โ€” Create a parser for a procedural language instead

#

If done effectively, you should have your parsing issues fixed in no time!

hoary sluice
#

noo i forgot to enable reasoning

valid jetty
#

Is there anything else I can help you with?

hoary sluice
valid jetty
#

Okay. Here is a basic example for your parser in Python:

#
def par
hoary sluice
#

@deep mulch order an h100 its going at 1 token per second

valid jetty
#

nop it just failed to finish that prompt

#

try again

hoary sluice
#

oh

frosty obsidian
#

@valid jetty can you make my code studio gibly

valid jetty
#

what does that evn mean ๐Ÿ˜ญ

hoary sluice
#

i thought you were abt to

#
def parser(tokens) -> List:
  index = 0
  while ind
valid jetty
#

LMAOOOO

#

I SHOULDVE DONE THAT

#

or even better

#
def parser(tokens) -> List:
    # Write your actual parser logic here
    return []
hoary sluice
#

so true

valid jetty
#

idk why this is so funny to me ๐Ÿ˜ญ

hoary sluice
#

qatar just gave trump a 400mil $ boeing

#

๐Ÿ˜ญ

valid jetty
#

what ๐Ÿ˜ญ ๐Ÿ˜ญ

#

are we great yet

hoary sluice
#

they gave him a 400 mil $ jet out of the goodness of their heart because they are so rich and nice and like giving gifts

valid jetty
#

mhm

#

@hoary sluice do you have the latest icypeas changes pushed

hoary sluice
#

the ones where i broke the parser or the ones where i broke it even more?

valid jetty
#

ok i phrased that wrong

#

does upstream match local

hoary sluice
#

no, locally the parser tries to use any expression it evaluates as a function and parses it and the expr to its right as a call

#

i know thats stupid and doesnt work

#

and makes me need to write it like lisp

#

well it works if the expression you evaluate is actually a fuction

valid jetty
#

1.add(3).mul(4).sub(5)

hoary sluice
#

(foo 1) 2 will work if foo takes 2 or more arguments

hoary sluice
#

1 $ add 3 $ mul 4 $ sub 5 much nicer

fleet cedar
#

/run ```rs
println!("{}", 1.5f32.atan2(2.5))

rugged berryBOT
#

Here is your rs(1.68.2) output @fleet cedar

0.5404195
hoary sluice
#

sub (5 (mul (add 3 1) 4))

#

:huks

#

shit thats wrong

fleet cedar
#

5 is still not a function

hoary sluice
#

sub ((mul (add 3 1) 4) 5)

#

ur right

#

neither is 16

#

sub (mul (add 3 1) 4) 5

valid jetty
#

(i32::times should be implicitly defined)

fleet cedar
#

Loops just aren't necessay

valid jetty
#

goto in a functional language??

fleet cedar
#

If someone needs repetition they can define the y combinator

hoary sluice
#

wtf is that

valid jetty
#

true

#

idk how eagely is gonna define Ycom in icypeas though lmao

#

i could never be confident its being parsed right

hoary sluice
#

i dont need y combinator if i have named functions

frosty obsidian
valid jetty
#

gambling

#

so many reactions ๐Ÿ˜ญ

#

i love gambling

frosty obsidian
#

ok ill gamble

#

all in on 6

#

vroll 6

elder yarrowBOT
frosty obsidian
#

shit

hoary sluice
#

??? are u stupid

valid jetty
#

ill gamble too

hoary sluice
#

put it all on 24

valid jetty
#

all in on 39151

#

vroll 100000

elder yarrowBOT
valid jetty
#

shit

hoary sluice
#

all in on 24

fleet cedar
#

I bet four pieces of tuna on 98

hoary sluice
#

vroll 37

elder yarrowBOT
hoary sluice
#

NOOOOO

#

when are we gonna host vencord poker

abstract peakBOT
fleet cedar
#

oh no

frosty obsidian
#

i don't know how to play poker

fleet cedar
#

I know how to play poker in video games

#

But not the real deal

valid jetty
#

@hoary sluice joinnn

#

quick

median root
valid jetty
#

too late

median root
valid jetty
#

WOW

#

ok

#

smh

fleet cedar
#

I know a much more important skill however

frosty obsidian
fleet cedar
#

How to not play poker

valid jetty
#

discord poker is literally the most simple environment to be in

#

you get a free $1000 of ingame money every time you join

abstract peakBOT
hoary sluice
#

join up

#

is this not a vc

valid jetty
#

nop

hoary sluice
#

i just installed discord cause vc doesnt work in the browser lol

valid jetty
#

ouch

#

slay

fleet cedar
#

Did you step on a lego?

hoary sluice
#

theft

valid jetty
#

lmao

hoary sluice
#

98 join

fleet cedar
#

Nah, I'm playing games that are fun

hoary sluice
#

so poker

valid jetty
#

mm gambling

hoary sluice
#

rosie has the 2

valid jetty
#

nop

hoary sluice
#

rosie just folded four of a kind to bluff next round

valid jetty
#

mhm totally

south moon
#

we are pros

valid jetty
#

ouch

south moon
#

thats why ts called progaming

valid jetty
#

yay

#

i love gambling !!!!

hoary sluice
#

beginners luck

valid jetty
#

im not a beginner

south moon
#

i suck at this game

hoary sluice
#

youre 16 how can you not be a beginner

valid jetty
#

i played poker at school all the time during lunch

south moon
#

can we play gartic phone

hoary sluice
#

after rosie beats us all sure

south moon
#

alright

hoary sluice
#

does discord have gartic phone

valid jetty
#

yea

south moon
#

wow

hoary sluice
#

rosie do you have all the probabilities memorized

valid jetty
#

true

south moon
#

@frosty obsidian why don't you type

hoary sluice
#

wait why is wing so poor

hoary sluice
south moon
#

true

#

i meant type

valid jetty
#

yayyy

hoary sluice
#

rosie actually has all the probabilities memorized

valid jetty
#

:3

hoary sluice
#

my activity crashed

valid jetty
#

wtf

#

what just happened

south moon
#

erm

valid jetty
#

did it crash

#

๐Ÿ˜ญ

#

NOOOO MY

south moon
#

discord quality

hoary sluice
#

oh did it crash for everyone

south moon
#

can we play gartic now

valid jetty
#

WOW

#

okay

#

smh

#

i was gonna win that

#

i had 2 doubles

formal belfry
frosty obsidian
#

don't keep playing games in here

#

not the right channel

south moon
#

where do we play

hoary sluice
#

ok lets play gartic but not in discord

#

on the website

south moon
#

alr

#

ill host it

valid jetty
south moon
#

im not regular

valid jetty
#

oh

#

then in here i guess lol

south moon
#

but i should

hoary sluice
#

who cares this is our personal chat anyways

#

join vc

#

@frosty obsidian give regular

valid jetty
#

uhhh i cant vc lol

#

ill just text

south moon
hoary sluice
#

its 10 pm

#

wdym

south moon
#

true

valid jetty
#

9pm

#

but i still cant vc

frosty obsidian
#

play it in bot commands or something

hoary sluice
#

do u not have headphones

#

yes

south moon
#

ok

valid jetty
#

if you wait like 5 mins i will be able to vc

frosty obsidian
#

no

south moon
#

what is the r slur

valid jetty
#

everywhere is slur friendly if youre brave enough

south moon
#

rock

frosty obsidian
#

vee is fine with that but im not personally

valid jetty
south moon
#

the word rock is allowed

hoary sluice
#

wheres the lobby

south moon
valid jetty
#

@hoary sluice

#

it knows exactly what i want (i barely use any of those languages)

#

i love microsoft slop

south moon
#

copilot

#

now with windows every time you turn on your pc it opens copilot

#

(im on macos tho)

#

(fortunately)

hoary sluice
#

are we playing gartic or not

south moon
#

yes ill send link

valid jetty
#

in a min

hoary sluice
#

@valid jetty do u not have headphones

south moon
#

ads

#

@hoary sluice join

#

@valid jetty

hoary sluice
#

how does gartic bypass ublock

south moon
#

idfk

hoary sluice
#

@frosty obsidian join

valid jetty
south moon
#

are yall gonna speak

hoary sluice
#

so can u vc

south moon
#

not me

valid jetty
#

ill join vc but i wont talk

south moon
#

same

valid jetty
#

ok

hoary sluice
#

but then its boring

south moon
#

i feel uncomfortable talking

hoary sluice
#

@deep mulch WHERE ARE YOU

valid jetty
#

joined

south moon
#

nice

#

do we start or do we wait someone

valid jetty
hoary sluice
valid jetty
#

the

hoary sluice
#

its not fun with 3 ppl

valid jetty
#

true

south moon
#

yes but stay in vc

valid jetty
#

we need at least 6

#

@deep mulch can you mute this person please

#

ok now that ive got your attention

#

join gartic phone

south moon
#

NOO OMAR

frosty obsidian
#

guys use the text in voice thing

nimble bone
#

i need to make an anti Bun license

hoary sluice
#

even i recognize the characters by now

deep mulch
#

just say ichigo

hoary sluice
#

ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ” ใ„ใกใ”

deep mulch
#

insanity

valid jetty
#

just use english everywhere

deep mulch
#

you use yappanese too much

nimble bone
deep mulch
#

@nimble bone@nimble bone@nimble bone

nimble bone
#

zoottuah

deep mulch
#

frestuah

ornate quiver
#

guh I didn't know you guys were playing

#

I would've joined

south moon
formal belfry
#

why

#

hop off

formal belfry
#

World runs on blazingly fast and stable bun ๐Ÿš€

south moon
#

is pnpm better

formal belfry
#

how do you improve a bot that literally just reads things and reacts with an emoji occasionally

#

insane

south moon
#

i want to make something else

#

like when you talk about apple iHusk

#

i mean when you say something cringy about apple

south moon
south moon
south moon
#

@formal belfry soo

#

what do you recommend

spark tiger
#

@formal belfry omg scug

cedar wind
#

Not sure if this is the right place to ask but I'm trying to change my profile picture with this It works for every profile element except the avatar. It correctly sets the pending avatar but on save it reverts back. Any ideas? ```const input = document.createElement('input');
input.type = 'file';
input.accept = 'image/*';
input.onchange = (e) => {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = () => {
const pfpBase64 = reader.result;
console.log("Base64 string:", pfpBase64);
const { FluxDispatcher } = window.Vencord.Webpack.Common;
if (FluxDispatcher) {
FluxDispatcher.dispatch({ type: "USER_SETTINGS_ACCOUNT_SET_PENDING_AVATAR", avatar: pfpBase64 });
FluxDispatcher.dispatch({ type: "USER_SETTINGS_ACCOUNT_SET_PENDING_BANNER", banner: pfpBase64 });

} else {
  console.error("l");
}

};
reader.readAsDataURL(file);
};
input.click();```

ornate quiver
#

what the fuck

deep mulch
#

virus

spark tiger
#

in newer versions

jade stone
spark tiger
whole cove
#
{
  foo: Bar {
    key: Type "value",
    stuff: Date "asdff",
  }
}
#

what do we think about tagged-json5

#

i wrote a parser for it

whole cove
fleet cedar
jade stone
whole cove
#

this way i can generate them without wriitng a schema

whole cove
#

i think its pretty clean, jokes aside

ornate quiver
#

@deep mulch i decided to translate one of my hw problems into latex for some reason

$$
\int_{0}^{1} \frac{x^2+x+1}{(x+2)(x+1)^2}dx
$$
$$
\frac{x^2+x+1}{(x+2)(x+1)^2} = \frac{A}{(x+2)} + \frac{B}{(x+1)} + \frac{C}{(x+1)^2}
$$
$$
{x^2+x+1} = \frac{A\cancel{(x+2)}(x+1)^2}{\cancel{(x+2)}} + \frac{B(x+2)(x+1)\cancel{^2}}{\cancel{(x+1)}} + \frac{C(x+2)\cancel{(x+1)^2}}{\cancel{(x+1)^2}}
$$
$$
\begin{aligned}
x^2+x+1
&= A(x+1)^2 + B(x+2)(x+1) + C(x+2) \\
&= Ax^2 + 2Ax + A + Bx^2 + 3Bx + 2B + Cx + 2C \\
&= (A+B)x^2 + (2A+3B+C)x + (A+2B+2C)
\end{aligned}
$$
$$
\begin{align*}
A+B=1 \\
2A+3B+C=1 \\
A+2B+2C=1 \\
\end{align*}
$$
$$
\begin{bmatrix}
1 & 1 & 0\\
2 & 3 & 1\\
1 & 2 & 2\\
\end{bmatrix}
^{-1}
\cdot
\begin{bmatrix}
1\\
1\\
1
\end{bmatrix}
=
\begin{bmatrix}
3\\
-2\\
1
\end{bmatrix}
\begin{matrix}
=A\\
=B\\
=C\\
\end{matrix}
$$
$$
\frac{x^2+x+1}{(x+2)(x+1)^2} = \frac{3}{(x+2)} + \frac{-2}{(x+1)} + \frac{1}{(x+1)^2}
$$
$$
\begin{align*}
\int_{0}^{1} \left( \frac{3}{(x+2)} + \frac{-2}{(x+1)} + \frac{1}{(x+1)^2} \right)dx
\ \ &=\ \left[\ 3ln|x+2| -2ln|x+1| -\frac{1}{x+1} \ \right]^1_0 \\\\
&=\ 3ln(3) -2ln(2) -\frac{1}{2} -3ln(2) + 1 \\\\
&=\ 3ln(3) -5ln(2) + \frac{1}{2} \\\\
&=\ ln(27) -ln(32) + \frac{1}{2} \\\\
&=\ ln(27/32) + \frac{1}{2}
\end{align*}
$$
#

there was no point to doing this and i wasted an hour

hoary sluice
#

@valid jetty i usually sleep till like 12 but today at 10 i had a dream where i had to nCr(7, 3) and then the 7 multiplied such that it became nPr and i woke up and had to verify that nCr(n, r) = nPr(n, r) * f(n, r) โˆƒf โˆ€n, r

fleet cedar
#

What is nCr

#

The weird choose operator?

hoary sluice
#

and it was like 7 numbers in a line and then each number duplicated

hoary sluice
#

so f = 1/(x!)

deep mulch
#

insanity

spark tiger
#

also how tf do you sleep until 12

hoary sluice
nimble bone
#

no nett no spend!

lavish frigate
#

These people man

valid jetty
spark tiger
valid jetty
valid jetty
south moon
nimble bone
#

rm bun.lockb
pnpm i
git add *
git commit -m 'switch to the objectively better package manager'
git push origin main

spark tiger
fleet cedar
#

Well yeah don't want to add any dotfiles of course

spark tiger
#

wha

#

just add it to gitignore then?

valid jetty
#

@hoary sluice look at this auto-generated formatting of my array

[compiler:146:5] PrimitiveFunction *func = PrimitiveFunction {
    name = ้™ค็ฎ— (_E999A4E7AE97)
    args = [
        Argument {
            name = x (_78)
            type = ๆ•ดๆ•ฐ (_E695B4E695B0)
        },
        Argument {
            name = y (_79)
            type = ๆ•ดๆ•ฐ (_E695B4E695B0)
        }
    ]
    body = [
        Return {
            value = Box {
                value = BinOp {
                    left = Box {
                        value = Literal {
                            kind = Identifier
                            value = Number(x)
                        }
                    }
                    right = Box {
                        value = Literal {
                            kind = Identifier
                            value = Number(y)
                        }
                    }
                    op = div
                }
            }
        }
    ]
}
#

oh actually

#

proper box fmt

[compiler:146:5] PrimitiveFunction *func = PrimitiveFunction {
    name = ๅ‰ฐไฝ™ (_E589B0E4BD99)
    args = [
        Argument {
            name = x (_78)
            type = ๆ•ดๆ•ฐ (_E695B4E695B0)
        },
        Argument {
            name = y (_79)
            type = ๆ•ดๆ•ฐ (_E695B4E695B0)
        }
    ]
    body = [
        Return {
            value = Box(BinOp {
                left = Box(Literal {
                    kind = Identifier
                    value = Number(x)
                })
                right = Box(Literal {
                    kind = Identifier
                    value = Number(y)
                })
                op = rem
            })
        }
    ]
}
#

and this is all auto-generated from __fmt__ functions

#

@fleet cedar i just realized

#

pointers are not always aligned to the size of a pointer

#

because if you do this

struct Foo {
    u8 a,
    i32 b
}

fn main() {
    foo := Foo { b = 39 };
    x := &foo.b;
}
``` you have a very misaligned pointer
#

the memory layout of structs needs to be packed though to maintain C abi compatibility ๐Ÿ˜ญ

fleet cedar
#

What

#

They need to be aligned as per C rules to maintain C abi

valid jetty
#

if the struct is packed the pointer cannot be aligned though

#

if youre pointing to a sub-pointer-size offset in the struct

fleet cedar
#

Yes

#

Packed structs are very much a rare special case

nimble bone
#

@valid jetty rewrite Elle in Ichigo

split timber
valid jetty
#

i think i understand how this works

#

i need to align the struct to the size of its widest member i think

fleet cedar
#

Each field is aligned to, well, its alignment, and then the struct is aligned to the highest of that

valid jetty
#

yeah makes sense

#

so then this shouldnt be

!external fn __ptr__::__fmt__<T>(T *self, i32 nesting) {
    let res = "invalid";

    if #cast(bool, self) && #cast(void *, self) % #size(void *) == 0 {
        res = (*self).__fmt__(nesting);
    }

    return "<{} at {}>".__internal_formatter_do_not_use_unless_you_know_what_youre_doing__(res, self);
}
``` it should be
```rs
!external fn __ptr__::__fmt__<T>(T *self, i32 nesting) {
    let res = "invalid";

    if #cast(bool, self) && #cast(void *, self) % #align(T) == 0 {
        res = (*self).__fmt__(nesting);
    }

    return "<{} at {}>".__internal_formatter_do_not_use_unless_you_know_what_youre_doing__(res, self);
}
fleet cedar
#

So you only print aligned structs, and just a pointer otherwise?

#

Eh, good enough I guess

valid jetty
#

thats what it currently does

#

if i add proper alignment it will print all structs

valid jetty
#

are the members not aligned to the highest alignment

fleet cedar
#

No, { u8, u8, u8, u8, u32 } is 8 bytes, not 20

valid jetty
#

if i have a char and an int and a double, the char and int should both be aligned to 8 bytes right

valid jetty
#

oh i see

#

that makes sense

hoary sluice
valid jetty
#

kotlin has iterators like haskell?

hoary sluice
#

@valid jetty i fixed my function application parsing but the MINUS OPERATOR BROKE???

#

im so glad i have tests

winged mantle
#

rust has iterators like c??

fleet cedar
#

Okay but I have to object to that

#

C does not have iterators

hoary sluice
#

it does if you want it to

winged mantle
#

#define iterate(array) for (size_t i = 0; i < sizeof(array) / sizeof(*array); ++i)

valid jetty
valid jetty
#

does it think - is a function

winged mantle
#

why use c++ iterators when you can do this

iterate(myints, int)
   printf("%d\n", item);
}
hoary sluice
winged mantle
#

isn't rust iterator more like stream

#

myInts.stream().map(Integer::toString).collect(Collectors.toList())

fleet cedar
#

If you mean "don't java iterators suck", then you are right

winged mantle
#

why use an iterator when you can use a spliterator

valid jetty
valid jetty
winged mantle
#

why can nobody tell when i'm trolling

fleet cedar
winged mantle
#

introducing /troll tone tag

#

it's been a while since i used java

#

i miss java

fleet cedar
#

I don't

winged mantle
#

why not

fleet cedar
#

Because java is pain

jade stone
#

Eh

winged mantle
#

imagine if you could do this

public IntSupplier counter() {
    int i = 0;
    return () => i++;
}
jade stone
#

Its not that bad

winged mantle
#

java says no

winged mantle
#

that's my main complaint

jade stone
#

Kotlin and Java are nice to work with

#

All things considered, it's better than rust or c++ imo

valid jetty
#

js is surprisingly pleasant to use ๐Ÿ˜ญ

winged mantle
#

you can't really say they are "better"

winged mantle
winged mantle
#

java if you want migraine

valid jetty
winged mantle
#

rust if you want trendier memory safe migraine

valid jetty
winged mantle
#

i believe this would work

int i = new int[] { 0 };
return () -> i[0]++;
valid jetty
#

vee is about to say generator functions exist

#

im calling it

royal nymph
#

sooo good (I never ever use generators)

formal belfry
#

function*

#

what is the *

valid jetty
#

I KNEW IT

royal nymph
#

generators good

valid jetty
formal belfry
#

im so smart

valid jetty
#

makes js generate sugar for the iterator

royal nymph
formal belfry
#

I have never seen that before thatโ€™s so cool

valid jetty
#

well i mean yeah but the generator itself is an object

winged mantle
#

what the husk

#

i used to be such an insane java dev

valid jetty
#

i think java is the real C with classes, at least syntax wise

formal belfry
#

java is the terrible I think

royal nymph
#

Java is good

#

Java better than Swift I think @formal belfry

#

Java better than elle

winged mantle
#

i wish there were better java libraries for discord

jade stone
winged mantle
#

oceanic.java

formal belfry
#

java slow snat

royal nymph
#

Java is super speed

#

faster than rust

winged mantle
#

javacord was discontinuned

formal belfry
#

good

royal nymph
#

who care javacord

winged mantle
#

i pesronally prefered it to jda

#

jda feels weird to me

#

i swear there are multiple methods to get message content

formal belfry
#

Java discord apps

valid jetty
#

take THAT java lover

royal nymph
#

all java libraries feel weird cause java itself is weird

winged mantle
#

it has three methods to get content

winged mantle
#

also i swear sending messages also implicitly resolves stuff

#

too much implicit stuff

valid jetty
#

@royal nymph do you document your code with throws NullPointerException or is it just a given that your code will throw that exception at any point

winged mantle
#

apart from... you have to explicitly run queue on async operations

#

which is easy to forget

royal nymph
#

you don't document NPE unless it explicitly and deliberately throws NPE like Objects.requireNonNull

valid jetty
#

does java have phantom types

royal nymph
#

actually even requireNonNull isn't marked as throwe NPE lol

winged mantle
royal nymph
#

personally i would mark it

shrewd canopy
winged mantle
#

idk i use eclipse

#

probably intellij only

spark tiger
jade stone
winged mantle
#

can we have a dynamic version of java called javascript

#

where you can do

String field = "out";
System[field]["println"]("Hello world");
formal belfry
#

Java Lite

winged mantle
#
String getID(any value) {
    return value.id;
}
valid jetty
#

does java have this @royal nymph

formal belfry
#

how

royal nymph
#

Java generics are fake

formal belfry
#

Youโ€™re fake

winged mantle
#

i love how with java generics you can duck type

valid jetty
#

wdym

#

explain

split timber
#

My java project got a 7,5 ๐Ÿ˜ข๐Ÿ˜ข๐Ÿ˜ข๐Ÿ˜ข I used a dependency class as association

royal nymph
#

Java generics are not real

split timber
#

The rest was fire tho

royal nymph
#

they are erased at compile time

fleet cedar
#

I used a dependency class as association
What does this sentence mean

royal nymph
#

and converted to object

valid jetty
#

husk

#

wtf

winged mantle
# valid jetty wdym

you can do this and it doesn't have an errors at compile time or run time

public void doThing(List<BaseClass> aList) {
    List<SubClass> castedList = (List) aList;
}
split timber
valid jetty
#

how does it know that Array<double> needs to hold a bigger size than Array<float>???

winged mantle
#

it will only throw a cast exception when you call get and it's the wrong type

winged mantle
#

you have to use wrapper types

#

List<Double>

split timber
#

That probably tanked my grade a whole point

royal nymph
split timber
royal nymph
#

Java has boxed classes for all primitives

valid jetty
#

love

winged mantle
#

it's better than js boxed primitives

royal nymph
#

int and Integer
long and Long

valid jetty
#

so it has to be List<Integer>

winged mantle
#

they automatically convert

fleet cedar
#

What is an "associaton" and "dependency"

royal nymph
valid jetty
#

๐Ÿ˜ญ

royal nymph
#

Integer is just a wrapper class that holds an int

winged mantle
#

except because they're nullable the conversion can cause npe iirc

royal nymph
#

that wrapper class Integer can also be null tho

#
Integer x = null;
winged mantle
#

are we both saying the same things

valid jetty
#

what even is java about ๐Ÿ˜ญ

fleet cedar
#

Sounds like the kind of things someone made up to fail students on tests

#

Certainly nothing you encounter in real life

valid jetty
#

seems like a language i wouldnt touch with a 2 foot pole

lucid trail
valid jetty
#

im pretty sure theyre talking about composition vs inheritance and whether an object can exist without its host and stuff

#

dependency and association and stuff

split timber