#๐ช -progaming
1 messages ยท Page 82 of 1
uhh
pub struct Location {
pub row: usize,
pub column: usize,
}

Row/column ๐คฎ
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
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
its a parser
Ah, wrong step...- Now that you mention it, self.parse_expression should have ring a bell
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
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
That's not a great example of precedence though
Because (2 + 4) - 2 and 2 + (4 - 2) are the same
as expected
add โฆ surely should parse everything until the end of the function def
this is not a function def
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
add adds 2 numbers its not sum but i assume you meant sum
this would be an error
i mean yeah i guess
FAILED tests/if_expressions.icy failed with error: Expected expression at 17:7
ignore the file name
usually add functions are variadic tho
add 1 2 / add 5 6 evaluates to 0
add a b = a + b
i just need some function to play with to test
if itโs integer arithmetic 10/11 will still be 0
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
speking of ints lemme try floats
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
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
i keep adding new features and improving it without changing the loc count
thats so real
i have no idea what any of this means
whens the elle interpreter coming
ellei
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
};
}
isnt that exactly what a box is supposed to be
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;
}
oh lol
you can overload deref now
that's insanely low
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;
}
every single tsoding tweet is always ironic
he never actually means what he says lol
the more i read into this shit the more insane im becoming GET ME OUT
sluggishly slow
tsoding does not have enough split screen subway surfers for me to watch whole vods
i recommend watching them at 1.5x
thats what i do
i love python
/run
some_list = [
"1. vencord",
"2. is"
"3. so",
"4. stupid",
"5. frfr"
]
print(len(some_list))
Here is your py(3.10.0) output @lavish frigate
4
what the hell
/run ```py
some_list = [
"1. vencord",
"2. is"
"3. so",
"4. stupid",
"5. frfr"
]
print(some_list)
Here is your py(3.10.0) output @fleet cedar
['1. vencord', '2. is3. so', '4. stupid', '5. frfr']
dont you love?
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
insane ๐ญ
#define INT_FORMAT "%d"
int main() {
printf(`hi ${INT_FORMAT} sillies`, 39);
}
are them implicitly concatenated?
they should add this
yes
just like C fr!
yes i think it is exactly from C
lol
@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))
how to
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
"diagnostics": {
"inline": {
"enabled": true,
"update_debounce_ms": 150,
"padding": 4
}
},
you dont need the other fields
it just kinda does that sometimes
๐
Rust adoption in the Linux Kernel has hit a few snags. In this video we'll explore why existing C maintainers want nothing to do with Rust and why Rust maintainers are resigning from their projects.
Free Rust training: https://letsgetrusty.com/bootcamp
rewrite full kernal in rust
rust is so awesome
i did a whole bunch of refactoring and once i see there are no errors i know it will work
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
lc.tldr
pissbot so unusable
me too 
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
valid
its 1.6k smh
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
the words "embracing" and "go" do not belong in the same sentence
the fucking "and all my new friends are kinda stupid" really is the cherry on top
bro???? are you fucking stupid https://vxtwitter.com/joshm/status/1922989591776129361
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
YES I WANT A THIRD PLACE TO SEE THE TITLE BECAUSE TWO ISNT ENOUGH
Showing title instead of address is the stupidest things any browser have ever done
browser tabs arent the best feature in general
dont tab titles literally show this lmao
Wdym
I rather have 200 tabs than 200 windwos
this is what happens when you are bored and cant think of new features
tabs are fine but the tab bar is meh
the tab bar is perfectly fine
thats why it has been used for like a billion years
im glad firefox allows you to smoothly drag tabs out of the window to open a new window
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
qwerty and row staggered keyboards arent perfectly fine and theyve been used for more than a billion years
same as tabs in an editor
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
any statement i make is automatically ragebait ๐ญ ๐ญ
to me it makes sense
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
yeah vertical tabs are great. glad they're adding it to Dia
this is why you stop worrying about how your code is structured and just go and make stuff
Commits that reduce lines are the best ones
true
i will also never gain loc apparently
they made gimp pretty
A bigger issue than being gnu is that gimp sucks
photo pee
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
Ctx string as in source spans/locations?
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
What have I told you about counting chars
the ultimate result of like an hour of debugging
Repeatedly
i know ๐ญ
char_indices btw
oh
well not really
because i dont want to iterate over the chars i want to iterate over the bytes
but i can .enumerate
Returns an iterator over all occurrences of the needle in a haystack.
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)?;
let line_starts = memchr::memchr_iter(b'\n', input.as_bytes()).collect();
Looks nice and is faster than anything you can write by hand
huskbot
Also, just add input.len() to the vec to skip that edge case
i mean yeah but a whole dependency just for this loop doesnt sound like an amazing idea
@nimble bone
Yep
nina so scary
Much better than writing it yourself
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)
I don't think I have proclaimed my hatred for the cross product sufficiently in this discord
lmfao
Also that formula doesn't make sense
The magnitude of the vectors is scalars, so you're doing the cross product between two scalars
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
// ----------
@valid jetty hiii
@deep mulch minklang
how
magic
@valid jetty wyd
English
@valid jetty rosinga
nop
pleasee
@deep mulch
i technically do something like that
elle finish when
but i specialize some identifiers into new tokens
Not that that language has for but anyway
probably not a bad idea to wrap by tilde
but there are so many places to change
maybe this is the point where anyhow wouldve actually been useful
I have ```rs
#[derive(Debug, Clone)]
pub enum TokenKind {
Ident(Box<str>),
RawIdent(Box<str>),
String(Box<str>),
Int(i32),
Float(f32),
Punct(char),
}
the places where an error exists are greppable but still annoying
hm
thats a very simple language
you do it
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,
}
better layout than elle i think
oh whatt
i make my token kind and value seperate
That sound pointless, the value still needs to be an enum with various variants
Unless you store their raw string representation
i dont wanna give every enum variant a value
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
do
as there are such puncts as .. or <= or >>= and those are counted as 1 token
Those are handled just fine with .operator() https://github.com/Aureole-Suite/Ingert/blob/main/ingert-syntax/src/lex/cursor.rs#L135
i shoudlve made . be an arithmetic operator
flat.rs: Lines 120-132
fn parse_switch(delim: Parser, ctx: &mut Ctx) -> Vec<(i32, Label)> {
do_parse(delim, |parser| {
let mut cases = Vec::new();
while !parser.at_end() {
let case = parser.int()?;
parser.operator("=>")?;
let label = parse_label(parser, ctx, false)?;
parser.punct(';')?;
cases.push((case, label));
}
Ok(cases)
}).unwrap_or_default()
}
That function parses the interior of ```rs
{
1001 => $L0;
1002 => $L1;
1003 => $L2;
}
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
sometimes i wodner if i got lead poisoining accidentally
maybe thast is why i am dumb
ur not dumb you just need to spend hours every day doing it for a whole year and youll get it too
What do you do if the get or expect_tokens fails?
get will throw an elle_error if the current_token is not an IntegerLiteral
so does expect_tokens
But still keep going?
advance cannot fail, it will not advance if its at the end
atm no but its a macro so i can switch out what it does pretty easily
What, does it panic or something
probably returning some Result is a good idea
How do people even come up with things like that
yeah
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
Nasty
good enough for now
It seems only binops and the => in flat syntax switches use .operator()
@valid jetty hii
interesting
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)
what is the purpose of this language?
Decompiling and recompiling the scripts of a specific game, with byte-perfect roundtripping
The things that control everything that happens in the game
Like, when you talk to an npc or whatever
ah i see
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
is there a way you can compile to some higher level pseudocode??
ok except my parser literally just didnt work
and was full of extremely verbose error handling
lmao
What do you mean?
it wasnt parsing ifs as arguments properly
compile to icypeas
As in, add 2 if x then 4 else 5?
yes
it was parsing it as add 2; if x then 4 else 5
the whole point is to not have to do that
Could also steal haskell's $ operator
$ isnt used for the same function im pretty sure
in haskell its still just add 2 if x then 4 else 5
/run ```hs
main = print if true then 2 else 4
@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 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
Oh lol
@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
/run ```hs
main = print 98
Here is your hs(9.0.1) output @fleet cedar
98
/run
main :: IO ()
main = putStrLn "Hello, World!"
Here is your hs(9.0.1) output @hoary sluice
Hello, World!
print = putStrLn . show
oh you dont need the type
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?
/run
main = print if true then 2 else 4
@hoary sluice
Unsupported language: None
Request a new language
/run
main = print if true then 2 else 4
@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 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
whats the problem tho
/run ```hs
main = print $ if True then 2 else 4
Here is your hs(9.0.1) output @fleet cedar
2
@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
im not tryna make a haskell reskin
Same reason why print sin pi doesn't work I assume
this is parsed as print(sin(pi))
Not in haskell
It's (print sin) pi
print(sin)(pi)
yea thats correct
if you want to print sin pi you need to do print (sin pi)
or just print 0
And it would be inconsistent if print if ... was parsed as print (if ...) rather than (print if) ...
with print if there is no ambiguity
I'm not saying it's ambiguous
the if is just an argument
I'm saying it's difficult for humans to read
Programming languages are designed for humans, after all
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
Yeah 1 is not a function, you can't give it a 7
i dont want to have to put unneccessary parentheses when writing aoc
Haskell is among the lowest-parentage languages I know
if consumes eagerly
eagley
i think it actually would consume the 7 if the 1 was an ident
but i just explicitly block it from calling integers
the parser
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
i just wondered why my discord monospace font is so cool
but it's a screenshot xd
that font is called Maple Mono if you actually want to use it
ill check it out
i have a different problem lol
i keep thinking its my own screenshot
im still testing this monaspace neon font rn
๐ญ
โ2
sqrt(2)
@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;
if you don't like certain aspects of it theres a python script in the repo that lets you configure
all of it parses and compiles in like 150ms
@frosty obsidian hiiii
or if you have a good ide you can disable font features there
so bloat isnt an issue
too slow
@valid jetty you dont need assert! when you can just make all your tests evaluate to either 2 or true if theyre correct
Two to the power of one
LOL WHAT
you will 2 << x
so i can only do 2 ** 1
the font looks rly tempting
ill give it a shot this weekend
i dont have bitshifts
cba doing it tonight
its so nice i love it
add them
i have recently started using it in my ide
but ive used it in my terminal for a while
ok nvm
maple mono looks great in the terminal
idk why i switched away from it a while ago
i actually think it shines in the terminal
here u go
shiftLeft x n = x * 2 ** n
shiftRight x n = x / 2 ** n
(shiftRight (shiftLeft 2 8)) 8
shines bright like a diamond 
ignore the lisp ()()()()()()()( my parer is terrible
why no can work (foo 2) 3 when foo 2 evaluates to anything other than a futcino how to get parser to correctly thatn
skill
Function calls are not parsed correctly, due to presumably inconsistencies in your parser.
How can you fix this?
@deep mulch its working i manipulated her into thinking its a funny bit but in reality shes fixing my parser
โ 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!
noo i forgot to enable reasoning
Is there anything else I can help you with?
yop rewrite the parser in python
@deep mulch order an h100 its going at 1 token per second
oh
@valid jetty can you make my code studio gibly
what does that evn mean ๐ญ
LMAOOOO
I SHOULDVE DONE THAT
or even better
def parser(tokens) -> List:
# Write your actual parser logic here
return []
so true
idk why this is so funny to me ๐ญ
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
the ones where i broke the parser or the ones where i broke it even more?
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
this is why you make an imperative style parser and then add really good chaining semantics
1.add(3).mul(4).sub(5)
(foo 1) 2 will work if foo takes 2 or more arguments
/run ```rs
println!("{}", 1.5f32.atan2(2.5))
Here is your rs(1.68.2) output @fleet cedar
0.5404195
5 is still not a function
you should make this the only way to do loops
(i32::times should be implicitly defined)
Loops just aren't necessay
goto in a functional language??
If someone needs repetition they can define the y combinator
wtf is that
true
idk how eagely is gonna define Ycom in icypeas though lmao
i could never be confident its being parsed right
i dont need y combinator if i have named functions
i did that and got some venture capital funding what's next
๐ฒ 3
shit
??? are u stupid
ill gamble too
put it all on 24
๐ฒ 47643
shit
all in on 24
I bet four pieces of tuna on 98
vroll 37
๐ฒ 18
oh no
i don't know how to play poker
what balatro?
too late
how does one not learn poker?
I know a much more important skill however
never played it before
How to not play poker
discord poker is literally the most simple environment to be in
you get a free $1000 of ingame money every time you join
nop
i just installed discord cause vc doesnt work in the browser lol
Did you step on a lego?
theft
lmao
98 join
Nah, I'm playing games that are fun
so poker
mm gambling
rosie has the 2
nop
rosie just folded four of a kind to bluff next round
mhm totally
we are pros
ouch
thats why ts called progaming
beginners luck
im not a beginner
i suck at this game
youre 16 how can you not be a beginner
i played poker at school all the time during lunch
can we play gartic phone
after rosie beats us all sure
alright
does discord have gartic phone
yea
wow
rosie do you have all the probabilities memorized
true
@frosty obsidian why don't you type
wait why is wing so poor
its not a vc
yayyy
rosie actually has all the probabilities memorized
:3
my activity crashed
erm
discord quality
oh did it crash for everyone
can we play gartic now
where do we play
im not regular
but i should
who cares this is our personal chat anyways
join vc
@frosty obsidian give regular
true
true
play it in bot commands or something
ok
if you wait like 5 mins i will be able to vc
what is the r slur
everywhere is slur friendly if youre brave enough
rock
vee is fine with that but im not personally
return address
the word rock is allowed
wheres the lobby
what a great idea! yes! true! they should keep this in consideration!
@hoary sluice
it knows exactly what i want (i barely use any of those languages)
i love microsoft slop
copilot
now with windows every time you turn on your pc it opens copilot
(im on macos tho)
(fortunately)
are we playing gartic or not
yes ill send link
in a min
@valid jetty do u not have headphones
ads
@hoary sluice join
@valid jetty
how does gartic bypass ublock
idfk
@frosty obsidian join
i do but i went to get water and cookies
are yall gonna speak
so can u vc
not me
ill join vc but i wont talk
same
ok
but then its boring
i feel uncomfortable talking
@deep mulch WHERE ARE YOU
joined
nice
do we start or do we wait someone
@celest gorge join gartic https://garticphone.com/?c=0080527e38
yeah but im scared to talk in vcs ๐ญ
why
same
the
its not fun with 3 ppl
ok
true
yes but stay in vc
we need at least 6
@deep mulch can you mute this person please
ok now that ive got your attention
join gartic phone
NOO OMAR
guys use the text in voice thing
untrue
ENGLISH
just say ichigo
nop its ใใกใ not ichigo
ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ ใใกใ
insanity
why bother have languages anyway
just use english everywhere
you use yappanese too much
insane
@nimble bone@nimble bone@nimble bone
zoottuah
frestuah
whyy
guh I didn't know you guys were playing
I would've joined
darwin made huskbot with bun so i cba to use pnpm
if you want to make a pr and change to pnpm feel free https://github.com/dxamima/huskbotplus
this was in spite of @nimble bone I think
World runs on blazingly fast and stable
๐
how do you improve a bot that literally just reads things and reacts with an emoji occasionally
insane
i want to make something else
like when you talk about apple 
i mean when you say something cringy about apple
i want to code but idk what to code
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();```
why is buns lockfile executable
what the fuck
virus
i think itโs jsonc now tho
in newer versions
Still have no idea why they thought a binary lock file was a good idea
apparently they first had a json lock file, then made their own lockb format and now are moving back to jsonc lmao
Insane
{
foo: Bar {
key: Type "value",
stuff: Date "asdff",
}
}
what do we think about tagged-json5
i wrote a parser for it
it was supposed to be faster or sm
Actually, I kinda like it
Insane syntax
The children yearn for typescript interfaces
i made it because i was exporting to or importing from JSON in my js app, but i had to recreate my classes each time
this way i can generate them without wriitng a schema
ok let's see YOU take a shot at it
i think its pretty clean, jokes aside
@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
love
@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
and it was like 7 numbers in a line and then each number duplicated
if you rewrite it using their definitions it becomes immediately obvious that the rhs has an extra factor of x!
so f = 1/(x!)
insanity
sorry but what the actual fuck
also how tf do you sleep until 12
no school no jbo
no nett no spend!
what the hell goes on in your dreams
yes nett yes spend yes goat
like JavaScript
i will ping you next time !!
idk it was in the original huskbot repo
very difficult task:
rm bun.lockb
pnpm i
git add *
git commit -m 'switch to the objectively better package manager'
git push origin main
git add * instead of git add . ๐ฅ
Well yeah don't want to add any dotfiles of course
@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 ๐ญ
if the struct is packed the pointer cannot be aligned though
if youre pointing to a sub-pointer-size offset in the struct
@valid jetty rewrite Elle in Ichigo
Why you having algebra & discrete maths dreams
i think i understand how this works
i need to align the struct to the size of its widest member i think
Each field is aligned to, well, its alignment, and then the struct is aligned to the highest of that
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);
}
So you only print aligned structs, and just a pointer otherwise?
Eh, good enough I guess
hold on
are the members not aligned to the highest alignment
No, { u8, u8, u8, u8, u32 } is 8 bytes, not 20
if i have a char and an int and a double, the char and int should both be aligned to 8 bytes right
oh
oh i see
that makes sense
javascript has iterators like kotlin???
kotlin has iterators like haskell?
@valid jetty i fixed my function application parsing but the MINUS OPERATOR BROKE???
im so glad i have tests
rust has iterators like c??
it does if you want it to
#define iterate(array) for (size_t i = 0; i < sizeof(array) / sizeof(*array); ++i)
thats not what an iterator is lol
also what ๐ญ
does it think - is a function
true
#define iterate(array, itemtype) for (size_t i = 0; i < sizeof(array) / sizeof(*array); ++i) { itemtype item = array[i];
why use c++ iterators when you can do this
iterate(myints, int)
printf("%d\n", item);
}
prefix has higher precedence than infix and - is both prefix and infix
isn't rust iterator more like stream
myInts.stream().map(Integer::toString).collect(Collectors.toList())

If you mean "don't java iterators suck", then you are right
why use an iterator when you can use a spliterator
yeah
this is still not an iterator tho
From what I understand, "spliterators" are similar to https://docs.rs/rayon/latest/rayon/iter/trait.ParallelIterator.html
Parallel version of the standard iterator trait.
I don't
why not
Because java is pain
Eh
imagine if you could do this
public IntSupplier counter() {
int i = 0;
return () => i++;
}
Its not that bad
java says no
you can in js
Kotlin and Java are nice to work with
All things considered, it's better than rust or c++ imo
js is surprisingly pleasant to use ๐ญ
you can't really say they are "better"
i love js
different tools for different jobs
java if you want migraine

rust if you want trendier memory safe migraine

i used js lambda syntax rofl
i believe this would work
int i = new int[] { 0 };
return () -> i[0]++;
function* counter() {
for (let i = 0; true; i++) {
yield i;
}
}
for (const i of counter()) {
console.log(i);
}
sooo good (I never ever use generators)
I KNEW IT
actually i did use generators once for recursive file system reading
generators good
denotes that the function is a generator
im so smart
makes js generate sugar for the iterator
no it doesn't, it's a language feature
well i mean yeah but the generator itself is an object
i think java is the real C with classes, at least syntax wise
java is the terrible I think
i wish there were better java libraries for discord
i like rusts build system, package management, docs for libs not docs for the lang itself, macros. i dislike the learning curve, docs for the lang itself, breadth/depth of packages available to you, and any c/c++ FFI
oceanic.java
java slow 
good
who care javacord
i pesronally prefered it to jda
jda feels weird to me
i swear there are multiple methods to get message content
Java discord apps
then why did the ai slop browser company use swift instead of java
take THAT java lover
all java libraries feel weird cause java itself is weird
It is
JDA
also i swear sending messages also implicitly resolves stuff
too much implicit stuff
@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
apart from... you have to explicitly run queue on async operations
which is easy to forget

you don't document NPE unless it explicitly and deliberately throws NPE like Objects.requireNonNull
does java have phantom types
actually even requireNonNull isn't marked as throwe NPE lol
tbf if it doesn't that's probably a bug
personally i would mark it
Isnt there is CheckReturnValue annotation to prevent that
__internal_formatter_do_not_use_unless_you_know_what_youre_doing__ 
isnt throws only for exceptions that the caller is meant to handle explicitly
can we have a dynamic version of java called javascript
where you can do
String field = "out";
System[field]["println"]("Hello world");
Java Lite
Nashorn 
String getID(any value) {
return value.id;
}
does java have this @royal nymph
how
Java generics are fake
Youโre fake
i love how with java generics you can duck type
My java project got a 7,5 ๐ข๐ข๐ข๐ข I used a dependency class as association
Java generics are not real
The rest was fire tho
they are erased at compile time
I used a dependency class as association
What does this sentence mean
and converted to object
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;
}
Yeah cus I was having an association relationship between two classes when it should have been dependency due to the requirements
how does it know that Array<double> needs to hold a bigger size than Array<float>???
it will only throw a cast exception when you call get and it's the wrong type
lmao
you have to use wrapper types
List<Double>
That probably tanked my grade a whole point
What do those words mean
you can't use primitives in generics
Relationship between classes? ๐ญ๐ญ๐ญ
Java has boxed classes for all primitives
love
it's better than js boxed primitives
int and Integer
long and Long
so it has to be List<Integer>
they automatically convert
What is an "associaton" and "dependency"
yes
๐ญ
Integer is just a wrapper class that holds an int
are we both saying the same things
what even is java about ๐ญ
Sounds like the kind of things someone made up to fail students on tests
Certainly nothing you encounter in real life
seems like a language i wouldnt touch with a 2 foot pole
no i think its real
isnโt it ArrayList
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
Class relationships are a real thing ๐ข๐ข๐ข๐ข

