#🪅-progaming
1 messages · Page 78 of 1
one of them could not name a favourite data structure
i was like ok interesting so i started scrolling and looked at the scrollbar WHY IS IT SOOOO LONG
its like 20-30% comments
but also multiple months of work
yeah i realized
and a big mess of backwards compatibility
my favourite question was the data structure one lmfaoooo
it really brings out how much the teacher knows in a single question
i can imagine this one is for a very specific day in aoc and has neer been used since
oooo i have an idea
should i make a builtin method on enums called entries such that ```rs
enum Foo {
A,
B,
C
};
fn Foo::entries() {
return [Foo::A, Foo::B, Foo::C];
}

this would be done in the same place where the default formatter and the equals method is defined
i think it detects how many cornerns the grid has cause its not actually a grid but a map of 2d point to T so it can be an arbitrary shape
well no shit isHowManyCorners detects amount of corners 🤯 but why is it not called getCornerCount or just val cornerCount get() =
val corners get() =
the shape corner count isHowManyCorners???
i have absolutely no fucking clue what my d12 code does anymore
like wtf is this
import sys
def sol(grid, part2):
ds = [(0, 1), (0, -1), (1, 0), (-1, 0)]
res = 0
rs = {}
v = set()
def dfs(r, c, p):
a = set()
stack = [(r, c)]
while stack:
x, y = stack.pop()
if (x, y) in v or x < 0 or x >= len(grid) or y < 0 or y >= len(grid[0]) or grid[x][y] != p:
continue
v.add((x, y))
a.add((x, y))
for nx, ny in [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]:
if (nx, ny) not in v:
stack.append((nx, ny))
return a
for r in range(len(grid)):
for c in range(len(grid[0])):
if (r, c) not in v:
area = dfs(r, c, grid[r][c])
if grid[r][c] not in rs:
rs[grid[r][c]] = []
rs[grid[r][c]].append(area)
for areas in rs.values():
for area in areas:
bc = 0
sc = 0
for p in area:
for d in [(p[0] + dx, p[1] + dy) for dx, dy in ds]:
if d not in area: bc += 1
for d in ds:
s = set()
for p in area:
x = p[0] + d[0], p[1] + d[1]
if x not in area: s.add(x)
rs = set()
for p in s:
x = p[0] + d[1], p[1] + d[0]
while x in s:
rs.add(x)
x = x[0] + d[1], x[1] + d[0]
sc += len(s) - len(rs)
res += len(area) * (sc if part2 else bc)
return res
with open(sys.argv[1]) as f:
contents = f.read()
grid = [list(row) for row in contents.split('\n') if row.strip()]
print(sol(grid, False))
print(sol(grid, True))
package solutions.y2024
import Solution
import utils.chargrid
import utils.grid.Grid
import utils.point.Point
import java.io.File
class Day12 : Solution(2024) {
override fun solvePart1(input: File) = solve(input) { grid, cur, c -> cur.getCardinalNeighbors().filter { grid[it] != c }.size }
override fun solvePart2(input: File) = solve(input) { grid, cur, _ -> grid.isHowManyCorners(cur) }
private fun solve(input: File, getPerimeter: (Grid<Char>, Point, Char) -> Int): Int {
val grid = input.chargrid()
val seen = mutableSetOf<Point>()
return grid.data.keys.sumOf { p ->
val connected = HashSet<Point>()
val c = grid[p]!!
val q = ArrayDeque<Point>()
q.add(p)
var perimeter = 0
while (q.isNotEmpty()) {
val cur = q.removeFirst()
if (!seen.add(cur)) continue
connected.add(cur)
perimeter += getPerimeter(grid, cur, c)
q.addAll(grid.getCardinalNeighborPositions(cur).filter { grid[it]!! == c })
}
perimeter * connected.size
}
}
}
yours is somewhat readable because you used saner variable names
an yes c and q such sane names
connected
q makes sense but whats c
perimeter
probably short for something that starts with c in the description
lmfao
webdev 🤮
this is why i fucking hate vite
it makes me bald
they create a config for shit, which then never works
like whats the fucking point of alias if it doesnt work!?
ah ofc, vite and its infinite wisdom, "lets use 2 different bundlers, one for dev and one for prod"
and alias doesnt fucking work in dev
REEEE
Streamed Live on Twitch: https://twitch.tv/tsoding
Enable Subtitles for Twitch Chat
Chapters:
- 00:00:00 - Intro
- 00:04:37 - Trying to Boot Alpine in QEMU
- 00:44:14 - Installing Alpine
- 00:55:32 - Setting Up DevEnv
- 01:02:54 - ARM Assembly
- 01:41:48 - SSHing into QEMU
- 01:52:07 - Programming My Smartphone
- 02:05:33 - Outro
References:
-...
woooo arm
new arm chips are fucking insane
i can run cyberpunk at like 30-50 fps on my SD 8g3
its nuts
can we also get leg architecture please
@valid jetty it looks so boring without a company
or well, school
what do i put there
i dont care im doing it anyways
have you seen mine
they are fixing this soon, but is there anything better than vite rn
i am NOT getting hired with a profile like this but that is also not something i’m looking for
(yet)
rspack
unironically
rsbuild 💪
guy i confused that with roll down, there’s so many
yes thats why i did m*ow ltd
@valid jetty lets make foss circle to search
least brainwashed bun fan
yeah legit
i mean it overall isnt looking amazing for deno, i somewhat agree with that, but there's no way in fuck its going under
it cant, its too good
horror
actually good idea tho
@hoary sluice https://vm.vxtiktok.com/ZNdjX2gxt/
🇯🇵Who’s Japans Fav Brainrot?🙀 How were they so in sync 😭🙏 #brainrot #tokyo #tungtungtung #日本 #日本語 #tralalerotralala #japan #timotheechalamet #therizzler
bombardilo crocodilo ruins the joke for everyone
look at the translation
gg , almost 10k
whats up with these horrible recommendations recently
like its always videos with single digit views in my recommended
youtube has been pushing low view videos for a while now
fair enough but they could at least make it relevant
microslop 365
i always see 1 of them per video
We need to switch. Windows and microsoft got hacked
Both got hacked
who says i use windows :3
fuck microsoft
nah dont fuck them thats disgusting
kill them
you are wrong ❌
brainwashed
I hereby invalidate your statement due to slander of the holy operating system called "Windows".
windows 
wrong ❌
wrong ❌
wsl is objectively worse than just using linux
there is no reason to use windows unless you need to use professional software like adobe stuff or you’re a game developer
i don't understand the argument
do you just mean you prefer windows to linux
or you think having both is better than just having one
lol
having both is also kinda worse if you’re actually productive lol
gamedev works on linux
like i heard things about it fucking up partitions when there’s linux and windows at the same time
i know it does i’m talking about the bad games with anticheat
proton is really good these days
just dont use windows like its not that hard
idt u need windows to work on a kernel ac game
to test it sure but idt the guy programming the ui needs windows
c3 headers 💔💔💔💔💔💔💔💔
C3 throwing staticlib C headers into the root dir 💔
what is c3 even about 🥀🥀
I wonder whether the person who wrote that is blind
no
it’s a mix of tabs and spaces
that’s why it looks like that
(i presume, i haven’t actually checked)
That's even worse
💔💔💔💔
opinions on this??????
maybe i can add an @impl attribute
@impl(fmt, equals, entries) or define the dunder method yourself
add dm wallpaper plugin
add brick my pc plugin
yes
make it const
I bought a windows 11 pro license yesterday
So proud of myself :3
@placid cape how did u get screenshare to work on sway
ok thats insanity
crazy person
:)
To my defense:
- It was one of them cheapo licenses (like $30)
- This computer needs to run windows
- I needed full bitlocker and windows sandbox
i figured that out btw @solid gazelle ty
yo, wsg, i'm demi
Links:
Latest blog posts: (rss)
- Welcome, I guess?, April 8, 2025 - The Industrial Revolution and its consequences have been a disas...
:3
Impressive
Insane
:3
nop ❌
literally go on ebay and use the keys on images of pcs
or just dont use windows
literally mangrave or whatever its called
insane person
so true
how can such a big company have such absolutely insanely garbage security practices
its 2025 and their user passwords are unsalted
bro my vencord is crashing every now and then idk why i though its the custom css i put but its still happening when i removed it
Welp, too late now :(
but thank you, will try next time :)
Hopefully there won’t be a next time though 
You're not gonna believe how windows started
(Auto-response invoked by @nimble bone)
wdym
of course it started with bad security, like most other 1900s software
but its 2025 and they have yet to fix any of their security
pretty sure they allowed you to pirate windows back in the day
their marketing was that you could pirate it and they trusted you that youd buy it someday
and it worked
ok well pretty sure they dont want you to pirate it anymore
actually maybe they do cause then they get more data
@hoary sluice reply for screenshare
$30??? that's still a lot
it's way cheaper on predmiumcdkeys
Yeah, pretty sure I was overcharged lol
costs 9.99€ on premiumcdkeys
Honestly, the goal was just to get it finished quickly
Bought it off kinguin because I’ve used it before
@valid jetty elle is so nightly it doesnt have a msrv

icypeas
.is_none_or was unstable in 1.81.0
Does anyone know a good and portable way to turn images into embeddings and then do a very fast lookup of that embedding with some kind of similarity search
Currently using ORB for feature descriptors but since it's variable size it's not very reliable for search
Faiss seems to be what most use for vector search
Don't know about the embedding part
No android support though
That requirement wasn't listed though
But I thought faiss was mostly platform independent, with some dependent optimizations
yessss honestly idk why is none or needs to be unstable at all
it’s like a 2 line function
I forgot to write it down but yeah it needs to support desktop and android ideally
There are millions of two liners
I couldn't find a faiss impl that supported Kotlin Multiplatform at least
Only a small number deserve a spot in std
its warranted
if youve ever looked at the kotlin stdlib youd notice a huge amount of deprecated functions and naming conflicts
.toLowerCase() was deprecated in favor of .lowercase(), itd be hard to find a new name for it again
and every time it happens its confusing
Unlike some (most?) languages rust is very careful about what goes in std, because once there, it can never be changed
how much rigorous testing do you need for something like this lol
ok i guess thats fair
unless you read all the release notes (probably not a huge portion of users)
Well there's at least one significant bug there
wha
Should take FnOnce
oh i guess
but im not that experienced with callbacks somebody who works on the stdlib would know that :3
is anyone familiar with any rich text area component for react?
i need like bare minimum - only like bold/italic/underline/foreground color
naming the function and making sure theres no conflicts in the future
.toLowercase() is easy too but jetbrains messed it up
because of turkish i
you had toİnt
on turkish pcs
cause it used turkish locale
Recording brought to you by American Express. https://americanexpress.io/kotlin-jobs
Enjoyed this talk? Experience it live at KotlinConf 2025—the biggest in history! Grab your tickets now: 🎟️ https://kotl.in/kcnf2025
Have you ever wondered what challenges Kotlin standard libraries encounter? How is the new API affected by insect collecti...
HORROR
întArrayOf
いんたっらよf
what is that
any idea what are these figures made in?
i mean sure but it’s also kinda unsane to use dependencies for filtering lol
iirc bunny had a better approach being latch onto modules and perform stuff that needs them when they’re initialized lazily
even then, filtering for an obscure or less common module that doesn’t depend on much (or anything) is not possible with this
oh does that mean it initializes all the modules with those dependencies for filtering
ok so that’s probably not that bad but did you confirm 100% that module ids don’t change between versions
well then couldn’t you theoretically hard code the id for modules you need and only initialize the exact module instead of even needing to search for it
could be draw.io
or latex
yeah, matplotlib could do this too
suree (not that i have time to work on client mods atm lol)
are you japanese
also why do the phonetic sounds for int look like the letters int
I'm not
@hoary sluice is this you
good afternoon people
i do this
Must be a vibe-coder
Yop
without grok tho
i dont pay for ai
Ask AI to build a compiler
Patiently wait, then paste each response into 5 different Rust files
Hit run on all five
Pick the one that throws the least errors
Iterate
Like a true vibe coder
Imagine not asking your ai hive to write a script to automate the asking and copying
it’s free(?)
oh i didnt know
anyways im not gonna use it
i dont really use ai for programming anymore either way
mainly the zed ai window for refactoring
you sell your soul
if there is no sensitive information in your query then you should use one of the main providers to make them lose more money
(it helps them)
how
do you think they offer their services for free because it doesnt earn them money xd
well they are losing money
they get more out of it because of training data and user feedback
oh if they use my garbage language that i use in prompts thats good
it gets more sloppy
and i dont give user feedback
i wanna try to vibe code a compiler with a lexer and parser which compiles to aarch64 assembly
but in
javascript
so it has the highest success rate
i wont fix ANY errors myself
of what
the cloc script
the neferious "cloc github" query to any search engine
i thought you made it yourself
why does fucking cloc have triple the commits of elle
its in nixpkgs
omg
they put cat * | wc -l into nixpkgs
Isn't cloc deprecated in favor of tokei?
0 comments 🤤
because half of elle's commits are "Read full commit" which are actually 10 commits in 1
at least you dont have a turing complete language with variables, ifs, loops, math and a lot of sugar in 5 (FIVE) commits, one of which is initial commit
actually its FOUR COMMITS
the brother implemented an entire interpreter IN THE FIRST COMMIT
ah yes 1 commit
it is for git bisect lmao
youre working on it by yourself and might just get sidetracked doing something else
yeah i still do that
but now i just unstage parts i dont want to commit
and make it into multiple
so glad noone uses .icy file extension
@valid jetty guess what
add a b = a + b
add 1 2
evaluates to
1
nop its
λIdentifier, Identifier("a"), 41:13.Expression {
kind: Binary {
left: Expression {
kind: Identifier {
token: Identifier, Identifier("a"), 41:19,
},
location: 41:19,
},
operator: Plus, None, 41:21,
right: Expression {
kind: Identifier {
token: Identifier, Identifier("b"), 41:23,
},
location: 41:23,
},
},
location: 41:21,
}
i wanted to it print λa.λb.a+b but i didnt make it pretty print
holy shit tokei is annoying me so much
so now its that
they use another obsure build system called earthly with Earthfiles and i cant even bootstrap it properly on my macbook because i need docker
even though tokei is written in rust
like wtf
ok so it actually does work but ignores the first arg
fn curry_assignment(
&self,
name: Token,
parameters: Vec<Token>,
body: Box<Expression>,
location: Rc<Location>,
) -> Result<Expression> {
let mut curried_lambda = Expression::new(
ExpressionKind::Lambda {
parameter: parameters[0].clone(),
body,
},
location.clone(),
);
for parameter in parameters[1..].iter() {
curried_lambda = Expression::new(
ExpressionKind::Lambda {
parameter: parameter.clone(),
body: Box::new(curried_lambda),
},
location.clone(),
)
}
Ok(Expression::new(
ExpressionKind::Assignment {
name,
parameter: parameters.last().unwrap().clone(),
body: Box::new(curried_lambda),
},
location,
))
}
ignoring the clones and unwrap
shouldnt this work
does 1.. cut the first element
im not tryna make the function idiomatic rn
why does it ignore the first arg
@valid jetty INFECTED BY ELLE BRAINROT
NOOOOO
@fleet cedar its so over 😭
i type dg<enter>
scheme 
the elle mind virus
idk what |- C means
you have no idea the number of times i encounter some bug in the compiler and i $dbg(&x) and then it takes me a solid 2 mins to figure out why theres an error
ok well maybe not 2 mins but yeah
i noticed cause it was white not blue
habit
i think im gonna get rid of those stdlib prefixes
ill keep $dbg and the ones for tuples but $panic and $todo is kinda bad
@valid jetty it work
wtf is dg
yay
its just an ide autocomplete fuzzyfind for dbg
ic
before
after
curried in the parser cause im too lazy
WHY IS IT NOT AN EMBED
before
i need to make a test suite
@valid jetty how do i do this without cloning
fn curry_assignment(
&self,
name: Token,
parameters: Vec<Token>,
body: Expression,
location: Rc<Location>,
) -> Result<Expression> {
let mut curried_lambda = body;
for parameter in parameters.iter().skip(1).rev() {
curried_lambda = Expression::new(
ExpressionKind::Lambda {
parameter: parameter.clone(),
body: Box::new(curried_lambda),
},
location.clone(),
)
}
Ok(Expression::new(
ExpressionKind::Assignment {
name,
parameter: parameters[0].clone(),
body: Box::new(curried_lambda),
},
location,
))
}
do i have to do refs and lifetimes

Reverse parameters and then pop the first one, into_iter the rest
^^^
You can also into_iter() and then next() for the first one, rev() for the rest; that might be slightly cheaper due to not actually reversing the vec
how are you so smart
thats just how rust works lol
tokei hasnt had a commit in 4 months i dont think this one is getting merged
im just gonna put my local build of tokei into path and get rid of the one installed from brew
brew 
slay tho
wdym
this is in the parser
it says in big bold letters feat(parser):
i didnt touch the interpreter
in this commit
i know but just in general
so as long as i can compile a one arg function i can also compile a multi arg function
well i cant cause they dont exist
38 line changes is kinda crazy tho
yea ive been noticing how easy it actually is to add new features
and this shit takes up like 8 lines or whatever (i cant count)
horror
its like 7
@fleet cedar do you know of a rust playground which also has r-a running
like typescript playground
I don't know any
the one bad thing about the official one is that i dont have hover to view diag 🥲
Just run locally for that
lines of C codeblocks in markdown files
yeah i realized eventually
but im confused as to why it says theres md in my rust
i dont think there is
rustdoc?
hmm maybe
yop i think so
yeah it is
woo
six seven??
math finals on thursday does this mean i can integrate by parts
yep
expert tip
learn IBP via the tabular method
its so much easier than applying the formula especially for when you need to apply it multiple times
i dont think we actually need to integrate
Integration by parts by using the DI method! This is the easiest set up to do integration by parts for your calculus 2 integrals. We will also do 3 integrals to illustrate the 3 stops of the DI method.
Dear calculus teachers, please let students use the DI Method (& why it is really the same as integration by parts) 👉 https://youtu.be/8xPfNu...
bprp my BELOVED
learn it anyway its fun
but we need to solve ode by separation, calculate stuff with vectors, trig, solve polynomials, represent statistical models idk what the word for it is like you put a bunch of data into a spreadsheet and it tells you the regression model
when i need it i will learn it
does cloc count elle
that stuff is easy tho
it is yea
i was learning to solve first order ODE by separation like last year in my free time xd
Matura or its translated terms (mature, matur, maturita, maturità, Maturität, maturité, матура, érettségi) is a Latin name for the secondary school exit exam or "maturity diploma" in various European countries, including Albania, Austria, Bosnia and Herzegovina, Bulgaria, Croatia, Czech Republic, Hungary, Italy, Kosovo, Liechtenstein,...
oh
Matura is a matriculation examination and can be compared to A-Level exams, the Abitur or the Baccalauréat.
ok so its like GCSEs
oh
ok
i have to pick between mechanics and stats for my a level further maths subtopic next year
which one do i do
from what i saw a level further maths mechanics is absolute hell but idk
@hoary sluice solve
and basically we have to (most likely from the stuff our teacher has told us) draw a flyback converter and calculate component values, simulate a lowpass or similar simple circuit, create an equivalent circuit using thevenins theorem and the superposition theorem and maybe explain a transistor preamplifier
..........
idk what half of that stuff is lmao
am i done for???
its all in german 😭
yuo have a translator
hes not here today
ah ok
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
····················································································
Twitch ➤ https://www.twitch.tv/cakez77
Twitter ➤ https://t...
im crying 😭
@hoary sluice look at how fucking easy it is to render a cube in raylib
this is the whole code
use std/prelude;
use std/raylib;
enum Screen {
WIDTH = 800,
HEIGHT = 600
};
fn main() {
rl::init_window(Screen::WIDTH, Screen::HEIGHT, "Spinning Cube");
defer rl::close_window();
camera := Camera3D {
position = Vector3::from(4.0),
target = Vector3::zero(),
up = Vector3::xyz(0, 1, 0),
fovy = 45,
projection = CameraProjection::CAMERA_PERSPECTIVE,
};
rl::set_target_fps(60);
while !rl::window_should_close() {
rl::update_camera(&camera, CameraMode::CAMERA_ORBITAL);
rl::begin_drawing();
rl::clear_background(#cast(Color, &0xFF181818));
rl::begin_mode_3d(camera);
rl::draw_cube_v(Vector3::zero(), Vector3::from(2.0), #cast(Color, &0xFFC98FFC));
rl::draw_cube_wires_v(Vector3::zero(), Vector3::from(2.0), WHITE);
rl::end_mode_3d();
rl::end_drawing();
}
}
ofc it gets more complex if you wanna render meshes and stuff
but 36 loc to render this is kinda crazy
is there a way to go to a server (by id) directly from a url in the web version of discord
(sort of how like discord[.]com/channels/1015060230222131221/1223973149222375536 will take you to this channel)
is anyone here familiar with any react highlighters which would highlight fast as you type? i tried shiki but that lags the client
(maybe offloading to webworker would be more performant?)
oh well nope
are you looking for something like monaco
i dont want full editor
just highlighter
isnt shiki already a webworker
you need to offload it to a worker and dynamically use the languages and themes you need
not really a problem of shiki
Was confident that chatgpt would do this well but seems liek not
@valid jetty do you rip off c math lib
math.le: Lines 1-18
global pub, external;
namespace math;
fn acos(f64 x) @alias(math::acos) -> f64;
fn asin(f64 x) @alias(math::asin) -> f64;
fn atan(f64 slope) @alias(math::atan) -> f64;
fn atan2(f64 y, f64 x) @alias(math::atan2) -> f64;
fn cos(f64 x) @alias(math::cos) -> f64;
fn cosh(f64 x) @alias(math::cosh) -> f64;
fn sin(f64 x) @alias(math::sin) -> f64;
fn sinh(f64 x) @alias(math::sinh) -> f64;
fn tan(f64 x) @alias(math::tan) -> f64;
fn tanh(f64 x) @alias(math::tanh) -> f64;
fn exp(f64 x) @alias(math::exp) -> f64;
fn frexp(f64 x, i32 *exponent) @alias(math::frexp) -> f64;
fn ldexp(f64 x, i32 exponent) @alias(math::ldexp) -> f64;
fn log(f64 x) @alias(math::log) -> f64;
fn log10(f64 x) @alias(math::log10) -> f64;
math.le: Lines 1-28
global pub, external;
namespace math;
fn acos(f64 x) @alias(math::acos) -> f64;
fn asin(f64 x) @alias(math::asin) -> f64;
fn atan(f64 slope) @alias(math::atan) -> f64;
fn atan2(f64 y, f64 x) @alias(math::atan2) -> f64;
fn cos(f64 x) @alias(math::cos) -> f64;
fn cosh(f64 x) @alias(math::cosh) -> f64;
fn sin(f64 x) @alias(math::sin) -> f64;
fn sinh(f64 x) @alias(math::sinh) -> f64;
fn tan(f64 x) @alias(math::tan) -> f64;
fn tanh(f64 x) @alias(math::tanh) -> f64;
fn exp(f64 x) @alias(math::exp) -> f64;
fn frexp(f64 x, i32 *exponent) @alias(math::frexp) -> f64;
fn ldexp(f64 x, i32 exponent) @alias(math::ldexp) -> f64;
fn log(f64 x) @alias(math::log) -> f64;
fn log10(f64 x) @alias(math::log10) -> f64;
fn modf(f64 x, f64 *integer) @alias(math::modf) -> f64;
fn pow(f64 x, f64 y) @alias(math::pow) -> f64;
fn sqrt(f64 x) @alias(math::sqrt) -> f64;
fn ceil(f64 x) @alias(math::ceil) -> f64;
fn fabs(f64 x) @alias(math::fabs) -> f64;
fn floor(f64 x) @alias(math::floor) -> f64;
fn fmod(f64 x, f64 y) @alias(math::fmod) -> f64;
fn fmin(f64 x, f64 y) @alias(math::fmin) -> f64;
fn fmax(f64 x, f64 y) @alias(math::fmax) -> f64;
fn round(f64 x) @alias(math::round) -> f64;
and then the extra things i made myself https://github.com/acquitelol/elle/blob/rewrite/std/runtime/math.le#L1-L22
math.le: Lines 1-22
use std/libc/math;
global pub;
fn i64::truncate(i64 self) {
return #cast(i32, self);
}
fn i32::promote(i32 self) {
return #cast(i64, self);
}
fn math::atan3(f64 x, f64 y) {
return math::atan2(y, x);
}
fn math::fact(i64 n) -> i64 {
return n <= 1 ? 1 : n * math::fact(n - 1);
}
fn math::fclamp(f64 value, f64 min_value, f64 max_value) -> f64 {
return math::fmax(min_value, math::fmin(value, max_value));
}
i64::truncate and i32::promote exist so you can do [1, 2, 3].map<i64>(i32::promote)
oh and also the generic ones i forgor https://github.com/acquitelol/elle/blob/rewrite/std/math.le#L1-L45
math.le: Lines 1-45
use std/libc/math;
global pub;
external fn i64::truncate(i64 self) -> i32;
external fn i32::promote(i32 self) -> i64;
const f64 E = 2.7182818284590455348848081484902650117;
const f64 PI = 3.1415926535897932384626433832795028841;
external fn math::atan3(f64 x, f64 y) -> f64;
external fn math::fact(i64 n) -> i64;
external fn math::min(i64 a, i64 b) -> i64;
external fn math::max(i64 a, i64 b) -> i64;
external fn math::clamp(i64 value, i64 min_value, i64 max_value) -> i64;
external fn math::fclamp(f64 value, f64 min_value, f64 max_value) -> f64;
fn math::next_power_of_2<T>(T x) {
T y = 1;
while y < x {
y += y;
}
return y;
}
fn math::sign<T>(T x) -> bool {
return x > 0 ? 1 : -1;
}
fn math::abs<T>(T x) -> T {
return x > 0 ? x : -x;
}
fn math::min<T>(T a, T b) -> T {
return a < b ? a : b;
}
fn math::max<T>(T a, T b) -> T {
return a > b ? a : b;
}
fn math::clamp<T>(T value, T min_value, T max_value) -> T {
return math::max(min_value, math::min(value, max_value));
}
Also sign(0) is usually 0
Though in math you often define sign as x/|x|, where 0 is undefined
does this mean it’s implementation specific for different languages
wtf is atan3
LMAO
Most languages use 0
youre gonna have to deprecate it when you add 3d vectors
But I don't know if all do
originally there was math::atan which you usually pass y/x
but there was cases when you wanted the full range of atan
x is positive sometimes but never negative
so they added atan2 but it takes y, x so it’s easy to refactor y/x into y,x in your code
so as a joke i added atan3 to make it ordered again
You have to define 3d trigonometry first
i already have 2d and 3d vectors bestie
is atan2 x/y where it takes y, x in that order?
I don't know any definition of that
nope the other way around
i meant the angle between 2 lines in 3d space
oh
atan2(y, x) = atan(y/x) in the positive quadrant
^^^^
so whats the problem
it’s ordered y, x so it’s easy to refactor
but i added atan3 as a joke so the arguments are in the right order
Everything else ever uses (x, y)
vectors.le: Lines 209-234
// Vector3 angle follows the following formula:
//
// cos(θ) = (v1 ⋅ v2) / (||v1|| × ||v2||)
//
// --- Where:
// v1 is the first vector
// v2 is the second vector
// θ is the angle of rotation
// × denotes the cross product
// ⋅ denotes the dot product
// ||x|| denotes the magnitude
// ----------
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));
}
but the user doesnt see the parameter names
User needs to remember to pass y, x rather than x, y
isnt it more intuitive to pass numerator, denominator
idk
any other math function takes in x, y in that order and then there’s atan2 which takes them in opposite order
so i just added atan3 as a joke to fix that
what would that even take in lol
i lowkey forgot atan2 is the angle between a vector and the origin and not two vectors so i thought y and x were vectors
atan4(x, y, z) = atan3(atan3(x, y), atan3(y, z))
oh lol
i see
yea no you use this for that
now you need to add atan5 too
thats actually kinda confusing idk if i should use the c definition or the intuitive way
atana
atanarbirtrary
atanN makes more sense yea
vectors.le: Lines 97-99
fn Vector2::angle(Vector2 self, Vector2 v2) {
return #cast(f32, math::atan2(v2.y, v2.x) - math::atan2(self.y, self.x));
}
does this compute the angle between the vectors from one origin or as they are currently
the vectors are not normalized if that’s what you’re asking
it computes the angle between the vectors as they are
wait they are defined as from the origin
uhhh yeah
ok nvm
x = 0, y = 0 is the origin
i did too much vector math lately
i was asking if its the green angle or the blue angle but for it to be the green angle youd need to define each vector using Vec2 start, Vec2 end
@hoary sluice do you plan to support linking with C libs so you can do raylib stuff in icypeas
wait would you
you can just do 180-blue
you get blue i’m pretty sure
why didn’t it work before lol
its an interpreter there is no linking
no we weren’t lol
and if i compile it its likely gonna be to haskell
you still need custom pages
if you can link haskell to c which i dont think you can then sure
the neferious plugin settings page
we weren’t using the custom page for the other settings we were defining hardcoded new routes in their settings renderer
oh that
isn’t that kinda pointless lol
we’ve known how to define those for ages
i guess
@valid jetty my ifs need a delimiter 
what
if false 1 else 2
is parsed as
if false(1) else 2
but im pretty sure this is solvable
maybe it is
but not purely in the parser
id need some kind of function analysis
to see if the value inside the condition is a value or a function
@valid jetty if then else?
expr if cond else expr
wait
hold on
this should work no?
why not ternary?
im considering ternary
aka this expr if cond else expr
just without the ?:
years of using kotlin has made me really miss ? : from java
?: is unreadable
but expr if cond else expr is ok
cause ur not meant to use if statements for large conditionals
ig but it gets annoying
why
just more to type
on my keyboard its easier to type if else than ? :
if takes 2 keypresses, ? takes 2 keypresses
typing : requires positionanig my thumb awkwardly to give space to my index finger
didn't know you used a keyboard like that
assembled it during aoc and was constantly switching between qwerty for aoc speed and this keyboard to learn it outside of aoc
but its really comfy
ifelse
i, e, and s are on the homerow
f and l are positioned neatly next to s
i can see why our opinions differ
on a regular qwerty layout those keys are far apart from each other
i used to use qwertz where thats not the case, which probably also contributes to me not liking ?:
probably
do you type ?: both with your right pinky
@valid jetty @fleet cedar @placid cape
probably the same as python
pointer finger
python one is easier to write but haskell one is more readable imo
i use my left pinky for left shift and use my right index finger for ?:
i feel like if i use the python one id be encouraging nested ifs which i dont rly want
i used to use my pinky for shift, thumb for space, right middle/index for letters and not using right ring/pinky at all, and on the left its a jumble, sometimes i use ring finger sometimes middle finger and sometimes index finger
they really need to put emphasis on the 10 finger system
in school
not very ergonomic for his keyboard
optimally id want schools to teach semimak jq on a split column staggered keyboard but theyre not gonna do that
and less readable in his opinion
if id do ? : then itd be expr if cond else expr, i dont want to use ? : because of what wing said
ícic
i was taught that but it just didn't stick
i very much struggled learning to type and i think it was because of my autism
remember that this is a functional language that currently only uses () for math precedence and no other braces anywhere else so i dont rly wanna introduce {} for ifs
i used to type 160wpm just fine
well yea they try to teach but the kids dont learn
actually most kids did learn
pure FP or nah
it didn't stick for specifically me
my pb was 178 on 10 words and ~110 on 60 seconds on qwerty, now its 182/117 on this keyboard
relatable
kids nowadays aren't really taught to type but kids our age were
fire
and i was typing with 3 fingers on qwerty
it hurts to type 180 for longer than 3 seconds and its hard to do without 10 finger system
gem
im basically just iteratively adding sugar to lambda calculus
churchTrue f s = f
churchTrue 1 2
churchFalse f s = s
churchFalse 1 2
add a b = a + b
add 4 7
addTwice f s = f + s + s
addTwice 1 10
(y $ (x $ y)) 1 2
(y $ (x $ x)) 1 2
(x $ x+2) 1
1 == 1
3 + 4
10 - 5
2 * 3
20 / 4
20 % 3
2 ** 3
5 & 3
5 | 3
5 ^ 3
7 == 7
7 != 8
3 < 10
10 <= 10
15 > 5
15 >= 15
!false
!true
-7
-(-7)
if false 1 else 2
did multi arg functions yesterday
curried in the parser which is meh but it was the easiest option
im more inclined to do if then else
i realized that parsing ternary would be hard
i have to look ahead 1 expression
wait thats not that hard
let index = self.index;
let expr = self.parse_expression()?
if !self.current_is(TokenKind::If) {
self.index = index;
return self.parse_binary();
}
skull emoji
parse_expression() calls parse_if() which calls parse_expression() in a loop
😭 🗿 💀
🐱
if is a function right
copy gleam and use block expressions with {} to represent paren precedence
this is the smartest thing ive seen in a while
using expr blocks for that instead of ()
its semantically the same you just use {} instead of ()
just do precedence like haskell
how is this smart it literally just uses the other character
yeah but you dont need to add an extra case in the parser to handle () you just use an existing feature that is expr blocks
ohh
the humble extra case:
TokenKind::LeftParenthesis => {
self.advance();
let expression = self.parse_expression()?;
if !try_consume_any!(*self, TokenKind::RightParenthesis) {
return err!(
ErrorKind::MissingClosingParenthesis,
token.location,
"Consider inserting a ')' after this expression.",
);
}
Ok(expression)
}
husk
TokenKind::LeftParenthesis => {
self.advance();
let expression = self.parse_expression()?;
if try_consume_any!(*self, TokenKind::RightParenthesis) {
Ok(expression)
} else {
err!(
ErrorKind::MissingClosingParenthesis,
token.location,
"Consider inserting a ')' after this expression.",
)
}
}
clippy didnt clippy this
because its not smart enough for that
also imo the first one is more readable
idk i prefer second
would u make these 2 if conditions an else
i really like maple with the exception of the cursive italics
i built the font myself actually in order to forcefully disable them
since android studio doesn't let you edit font features
i love cursive italics
i didnt like them when first looking at the font but they look nice now
i just don't like that its only a couple characters
it looks too jarring
could also be because i don't use ligatures as i don't like most programming ligatures
oh tbf i only like the cursive italics when in comments and in hover diagnostics
unfortunately I cant set up stuff like that in android studio
unfortunate
specifically because of font features
i can do different fonts for comments
but can't specifically enable or disable maples cursive italics
i only disabled the l and the k though as they were the most out of place
which if is better
1
3
yo since when did kitty support videos in terminal what
evil
@hoary sluice im in the deep depths of addr testing
look at these tests
since like always no?
i think if you were expecting terminal video to be good thats on you
it would still be really fun to completely move over to the terminal
no more firefox no more youtube just lynx and ani-cli/yt-dlp kinda thing
something meant to just display text just won't ever be good for something like video
more graphical stuff just isn't its job
well time to come up with a new "blazingly fast" javascript terminal design making use of react and electron to "efficently" handle the terminal and ui
its gunna have at least 15 emojis in the readme
with a ton of exclamation marks
the kitty dev sure is trying though
@hoary sluice is this you
Yop
I have never once tried running the output from my compiler
But in my defense, I do verify that they are bytewise identical to the files they were decompiled from
is it worth making tests and cleaning up your codebase, or should i continue being lazy
depends on whether or not you want to be lazy now or have a better time later
tests is this woke liberal thing, just test on prod!!
:arrows_counterclockwise: Updating Vencord...
HEAD is now at 578aa5f1 Experiments: Fix client crash with new experiment embed
Already up to date.
:file_folder: Checking plugins in: /home/keira/Documents/Vencord/src/plugins/
:file_folder: Checking plugins in: /home/keira/Documents/Vencord/src/userplugins/
#!/bin/bash
echo "🔄 Updating Vencord..."
cd ~/Documents/Vencord && git reset --hard && git pull
echo ""
update_plugins() {
PLUGIN_DIR="$1"
echo "📁 Checking plugins in: $PLUGIN_DIR"
for d in "$PLUGIN_DIR"*/; do
if [ -d "$d/.git" ]; then
plugin_name=$(basename "$d")
echo "➡️ Forcing update on plugin: $plugin_name"
cd "$d" && git reset --hard && git pull
echo ""
fi
done
}
# Force update core plugins
update_plugins "$HOME/Documents/Vencord/src/plugins/"
# Force update user plugins
update_plugins "$HOME/Documents/Vencord/src/userplugins/"
echo "✅ All done."
for some reason it doesnt hit plugins but only userplugins
Probably because canon plugins aren't in their own repos
Oh...
run git pull at the root and it updates official plugins too
since they come with vencord
userplugins tend to be in their own repos
yes
every official plugin is in the main repo
Wao
Where else would they be?
Can i set my script to run every 3 hours or so and force kill vesktop
Oh cool i js setup a script for it
which one has haskell?
if then else
Is 251 lines of "quick" css alot
who cares
no
Damn
like always it turns out im actually just stupid
@valid jetty i was wondering why i was trying to parse TokenKind::If as a primary expr even tho its not a primary
meanwhile the neferious is_primary:
pub const fn is_primary(self) -> bool {
matches!(
self,
Self::If
| Self::Elif
| Self::Else
| Self::For
| Self::While
| Self::Do
| Self::Loop
| Self::Fn
| Self::Return
| Self::True
| Self::False
| Self::Null
| Self::Identifier
| Self::Integer
| Self::String
)
}
problem is because functions just eagerly eat anything they think might be an argument, this add 99 1 if false else 2 is evaluated as 2
tbh im not so sure about this expr if cond else expr thing anymore
so many ambiguities
horror
anyone knows why devtools lag so much now after the visual refresh
feels the same for me
@valid jetty
help
add 2 if false then 1 else 2
this is parsed as a partially applied add that takes 1 more arg and then 2 in a separate expression
i think
λIdentifier, Identifier("b"), 8:15.Expression {
kind: Binary {
left: Expression {
kind: Identifier {
token: Identifier, Identifier("a"), 8:19,
},
location: 8:19,
},
operator: Plus, None, 8:21,
right: Expression {
kind: Identifier {
token: Identifier, Identifier("b"), 8:23,
},
location: 8:23,
},
},
location: 8:21,
}
2
manti is sinning
actually ik how to solve this
imo parse it like haskell
if x y else z
but make it so that if add 1 2 3 will count as if(add)(1)(2)(3) not if(add(1)(2)(3)) so that you have to wrap the add 1 2 in ()
but realistically if you want to do it like its currently done then you insert a semicolon or a newline after the add 2
meh
ill do it tomorrow
now with if x then y else z you can just yield tokens until then and parse that whole thing as a condition
i dont have time rn
its boring but its more robust i think
thats what im doing
the ifs work
but they dont have precedence over end statement
in a call parse
add 2 if false then 1 else 2
is parsed as
add 2; if false then 1 else 2
thats a terrible way to put it
husk
keep in mind youre gonna have to remember these rules when writing your programs in aoc
well this is not the intended way
and i can just insert ()
add 2 (if false then 1 else 2)
this works
anyways id rather prep for matura tomorrow than work on ifs rn
its not school
school is done
it doesnt count for school
oh and we get our report cards tomorrow so i find out if i have a 1.0 gpa or one of my teachers for some reason screwed me over and i get a 1.055 gpa
WHAT
who stole our dear manti...
i know manti would never stray from java...
i also have holiday tomorrow
@placid cape i just dug up my grades from 2021
why did i not kill myself
2 in programming (fsst)
das war vor 3 jahren in corona
all of them do
this isnt programming wrong channel @royal nymph
wrong channel @royal nymph
der messtechnik lehrer is schon ein (ich will ihn jz ned beleidigen) aber der hätte mir das gönnen können
i open german and see this
wrong channel @royal nymph
wrong channel @formal belfry
English 3????
oh wtf lmao
iirc that was cause i didnt do her advent calendar homework
oh lol
NO WONDER I CANT YIELD PLAIN STRUCTS IN VARIADICS
The vaarg instruction fetches the next argument from a variable argument list. It is currently limited to fetching arguments that have a base type.
this program
type :Foo = { w }
data $fmt = { b "%d\n", b 0 }
function w $foo(...) {
@start
%args =l alloc8 32
vastart %args
# this line breaks C abi
%x =l vaarg %args
# should be:
# %x =:Foo vaarg %args
# vaarg only supports base tys though
%field =w loadw %x
%tmp =l call $printf(l $fmt, ..., w %field)
ret 0
}
export function w $main() {
@start
%struct.Foo =l alloc8 4
storew 123, %struct.Foo
%tmp =w call $foo(..., :Foo %struct.Foo)
ret 0
}
no wonder it doesnt work qbe just straight up doesnt support it
I can explain myself okay..
oh my god every time i look at structs internally i just get more and more confused
i think i understand it and i look and it just makes less and less sense as i go deeper
valid C program btw
#include <stdio.h>
#include <stdarg.h>
typedef struct {
int x;
} Foo;
void print(int n, ...) {
va_list args;
va_start(args, 0);
Foo x = va_arg(args, Foo);
printf("%p\n", x);
va_end(args);
}
int main() {
Foo x = { 39 };
printf("%p\n", x);
print(0, x);
return 0;
}
not possible in qbe because you cant fetch aggregate types
"Full support for the C ABI."
maybe there is a way and im stupid
ok i give up
no matter what i do the data isnt copied
i just get a 0 initialized buffer of the same size
rosie speaks a language nobody on this planet can comprehend
our minds are too naive and feeble to comprehend Elle talk
Is there any way i could encode efficiently a series of numbers into a 1 32bit integer?
how big are the numbers
u mean a bit stream ?
Its a stack like structure and each number is like 2 bits. The thing is that it has to be arbitrary length
You can encode 16 2-bit numbers in a u32
Possibly more depending on distribution
yeah can store 32 1 bit numbers in a u32 integer
💀
little known fact
bit-fields 🥰
You might know im making a jvm and i need a way to store operand stack values. The thing is that there are instructions which require you to know what type of element the top value is(long and double take 2 operand stack entries) and i have no idea on how to figure this out without any sort of metadata
Why would you need metadata, the instruction itself says what type it expects
Though you might need metadata for the gc to know whether something is a pointer or not, unless you're just gonna do "yup looks like a pointer let's go"
Look at dup_x2 instruction for exmaple
i assume metadata is needed for some more atypical things
Yup, copies 8 bytes
Doesn't need any metadata for that
I dont get that
It has 2 forms
And you need to know one of the etrnies computational type
I might be just stupid in that case
In my old version i was having a metadata field beside the actual value which made all the entries larger for hopefully no reason
me after learning print(input())
you should dm
Id dm him with a leetcode
not my screenshot unfortunately (but I would)
OH MY GOD 





ahh yess indeed
why the fuck does this slow my whole website so much
forgot to add deps to a useEffect?
there can me many causes
but if you use react its most likely to be a component unnecessarily updating/not cleaning up in useeffect
React
idk nookies the desktop client on linux just memory leaks it seems lol
i thought that was just me 
you should definitely try filtering styles
how do you mean?
oh yeah
we can't tell from just this code
try memoing SelectItem
do they? devtools have lagged like crazy ever since discord pushed the bundler update, way before visual refresh
what we theorised is that it might be because of the big amount of sources
can it be because bundledLanguages has like 200 entries
how tf do i do that
are you saying you're loading all 200 languages into memory immediately?
yes thats what the export does

does that only contain the language names or does it contain all the translated strings in all languages
assuming this is localisation
but its like import("shiki/languages/${lang}")
oh it's shiki
its shiki
yeah still don't load everything into memory
you probably wanna create a separate file for each language and lazy load them
maybe create one bundle with all the most popular languages and load that ahead of time
theres like 200 languages wdym lazy load them in each separate file 😭
but this wont solve what i need though? i want the user to have option to select whwat language highlighting he wants and then apply it, idk if its possible to lazy load each like this
OMG
NO MORE GARBAGE VALUES
@hoary sluice WE WIN
2 changes:
- when storing something at an address, if the value were storing is a struct i blit the bytes there instead of assigning the address directly (this was just incorrect behavior)
- when passing arguments to a variadic function, if its the non-required arguments all parameters are
into_base'd which means the struct decays purely to its pointer which fixes the ABI breakage
SO GOOD
YOU CAN STORE STRUCTS INLINE NOW
@valid jetty @placid cape im so angy
qbe said NOTHING about variadic arguments passed needing to be non-abi
religion teacher gave me a 2 for absolutely no reason
i wasnt in school 4 times cause of open door day at uni / sick / train cancelled but hes not even allowed to grade that cause its not my fault
1.083 GPA ouch
its a Freigegenstand (optional class)
so its still 1.0
oh
but its ugly
oh ok thats fine then surely
and im gonna complain
lmfao
i mean noone cares about gpa
in high school
or anywhere
good thing is today was hardware matura and i def passed and i never have to do hardware ever again
@supple whale if you have javascript object, is it possible to pass it down to C with emscripten?
@placid cape STRUCTS BY VALUE TO VARIADIC FUNCTIONS
i think realistically only the other way around
ie c struct to js

gimme money pls
contact
vibes
