#🪅-progaming
1 messages · Page 84 of 1
oh yeah idk why i dont have pub use for it
you need to use pub mod to export the sibling modules
@hoary sluice 🦅ly
yes but i dont know if mod.rs is meant to only house exports or if it can house the entire module
or a big part of the module
It houses the contents of the module
sorry i was just getting confused
What the module contains is up to you
do you mean conventionally
yes
Search your feelings
What does it say?
A collection of lints to catch common mistakes and improve your Rust code.
tho i dont have mod foo { .. } twice
You have a mod parser; inside a mod parser;
Which is indeed questionable
But if you want it that way, simply #[expect()] it
do yall know about any good website which would teach math for game dev? like i know what is matrix but how does relate to some position or shit in games, no clue
I don't really know of any (neither I have a ton of experience with matrixes), but you can view them as a generic tool for problem solving. Both CPUs and even more GPUs can do matrix calculations very fast, and in some cases this gives you a great advantage. An example is simple image filters, you can define a matrix that maps ARGB in to ARGB out for each pixel, and then any of those simple color filters can be applied using the same code instead of reimplementing the logic for each of them. At first it sounds like waste of computing power, but even for something as simple as a grayscale filter it's much faster
In graphics they're mostly used for converting between coordinate spaces
@hoary sluice look at how easy it is to add new functions with C interop
lmao i just went down a massive rabbit hole
this is real debugging done by real software developers
i have rust interop
(one way)
whats that
@hoary sluice LOOK AT THIS https://gist.github.com/acquitelol/787ce7af581c87523e355c1ab714c2b5
why are you screaming at me 😢
shouldve compiled to haskell
fac n = if n == 1 then 1 else fac (n-1) * n
fac 50
icypeas to haskell compiler for factorial functions in one line of python
for line in open(0): print(line, end='')
get it because its also valid haskell
idk
i didnt explicitly implement it like that
it might be lazy by accident
i didnt implement multi arg call parsing and i have working multi arg parsing
so maybe the lazy evaluation also just happens
if i do
loopForever = loopForever
f x y = x
f 42 (loopForever)
``` do i get 42 or a hang
you get 42
well you get expected expression but thats because functions require an argument
oh
ok well what if i do
loopForever a = loopForever a
f x y = x
f 42 (loopForever 0)
stack overflow
however if you dont pass the 0 it for some reason compiles
well
interprets
idk why
oh yea cause loopForever by itself is a function so you just pass the function to f and it gets ignored
ok well ig tomorrow i make lazy eval
its not hard
lmao
YES it works on linux now
good
@valid jetty pov: you spent 10 minutes thinking of a commit message and came up with this https://github.com/eagely/icypeas/commit/6eb5af70413f25d1094624d85f86c569bc6c740d
had to look up if scopes was the correct word for this but then i remembered that i dont actually care
lmaooo
whenever theres a potential breaking change with past versions of the compiler
or, if i forget, whenever theres a refactoring commit
as im not in 1.0 yet i can bump minor for breaking changes
if the change doesnt break past versions of the compiler but the change is significant enough i will bump patch
@hoary sluice look at how many import duplications im saving
each Module '...' is already imported. is an early return
im saving a lot more duplicate imports by not having imports
Mincho font in terminal 
https://www.youtube.com/watch?v=z7cfF7O7pGg WHO HAS TIME FOR THIS
I'm running:
- Arch Linux with a custom kernel (just to fix some driver issues)
- BSPWM in Xorg
- EWW for status bar and widgets
- Rofi for app launcher and exit menu
- My own tool for rendering live wallpapers with GLSL fragment shaders
https://github.com/ikz87/GLWall - My own notification manager
https://github.com/ikz87/yawns - Custom pico...
balala
yeah
balala
@hoary sluice do i allow constants to be defined on enums
on one hand
on the other hand
this isnt ambiguous
you can define functions on enums but the syntax is a little nicer for lambdas
for example
// なんちゃって型エイリアス
enum rune @repr(i32) @nofmt {}
const rune::__fmt__ = fn(rune self, i32 nesting) self.encode();
instead of
// なんちゃって型エイリアス
enum rune @repr(i32) @nofmt {}
fn rune::__fmt__(rune self, i32 nesting) { return self.encode(); }
its as simple as 1 comment
i can technically lie and do this which is honestly funnier
// なんちゃって型エイリアス
enum rune @repr(i32) @nofmt {}
external fn rune::encode(rune self) @alias(rune::__fmt__) -> string;
😭
$dbg("猫".utf8_decode());
@valid jetty this is such an insightful an interesting video especially towards the end https://youtu.be/Zv-XNlE1s8E
Mathematicians developed a method for turning spheres inside out. This video explains the process
Gaming Channel ► https://www.youtube.com/channel/UC68fF7KHl6Os3JsIa7Mh4rg
Gamer Supps Discount Code: HUGGBEES ► https://gamersupps.gg/huggbees
Twitter ► https://twitter.com/HuggbeesTV
nah i just got to 17:30 and it gets crazy
rosie moment
@woven mesa idk how im gonna do this but I wanna add a swipe gesture to my app that reveals a sidebar
sidebar would contain settings
meret also gonna do that too
I kinda want
like
the whole app to shift right
would be neat
okay I should make the controller but with certain constraints so it matches a sidebar
overengineering ui my beloved

@valid jetty @valid jetty @valid jetty @valid jetty
@deep mulch have you made any progress
yo W rice bro just add perkeo to dupe windows and its perfect
rofi pack theme too
Im at work rn
can't until later
@native spruce marvis does it so the gesture is continuous (bad demonstration bc i was eating)
you drag to open and then move finger up or down whilst continually holding
let go to open selection
yummy
"add bowls and domes, and subtract saddles"
V - E + F = 2 MENTION???
why does she sound like furina
what the hell is this 😭
LMAO
WHAT THE FUCK AM I WATCHING
HOW DOES IT JUST GET WORSE AND WORSE
how to turn a sphere inside out
OH MY GOD
I think I have a long time ago
@valid jetty you're so smart you probably turn spheres inside out in your mind
you can imagine every single step with visualization
@valid jetty probably solved some unsolved thousand year math problem
@runic sundial do you also happen to know how to assimp? If I load all the meshes directly from scene.mMeshes they don't get the right materials, but for some reason building a scene tree from scene.rootNode down doesn't render anything at all for some of them
@hoary sluice @deep mulch do this https://www.youtube.com/shorts/ehv-Ls9Idw8
🚀 https://neetcode.io/ - Get lifetime access to every course I ever create!
Checkout my second Channel: https://www.youtube.com/@NeetCodeIO
🥷 Discord: https://discord.gg/ddjKRXPqtk
🧑💼 LinkedIn: https://www.linkedin.com/in/navdeep-singh-3aaa14161/
🐦 Twitter: https://twitter.com/neetcode1
📷 Instagram: https://www.instagram....
what format?
wavefront atm
how are the materials annotated in the obj?
i did it in probably the simplest way possible in like 3 mins
use std/prelude;
struct Node {
Node *left,
Node *right,
i32 value
}
fn Node::print_on_sep_lines(Node *self, i32[][] levels, i32 nesting) {
while levels.len() < nesting + 1 {
levels.push([i32;]);
}
levels[nesting].push(self.value);
if left := self.left {
left.print_on_sep_lines(levels, nesting + 1);
}
if right := self.right {
right.print_on_sep_lines(levels, nesting + 1);
}
return levels.map<string>(fn(i32[] level) level.join(" ")).join("\n");
}
fn main() {
root := Node {
left = &Node {
left = &Node {
left = nil,
right = nil,
value = 4
},
right = nil,
value = 2
},
right = &Node {
left = &Node {
left = nil,
right = nil,
value = 5
},
right = &Node {
left = nil,
right = nil,
value = 6
},
value = 3
},
value = 1
};
$println(root.print_on_sep_lines([i32[];], 0));
}
``` surely its not *that* hard
I know the obj is correct cuz online viewers handle it just fine
mtllib bmw.mtl
How are you loading the file into assimp?
fun loadScene(path: String, target: GameObject) {
val flags = Assimp.aiProcess_Triangulate or
Assimp.aiProcess_GenSmoothNormals or
Assimp.aiProcess_FlipUVs or
Assimp.aiProcess_CalcTangentSpace or
Assimp.aiProcess_JoinIdenticalVertices or
Assimp.aiProcess_FindInvalidData
val io = makeIO()
val scene = Assimp.aiImportFileEx(path, flags, io) ?: throw RuntimeException("Unable to load scene: ${Assimp.aiGetErrorString()}")
println("Imported scene: $scene")
io.OpenProc().close()
io.CloseProc().close()
// attempt at using the tree representation
loadObject(scene.mRootNode()!!, scene, target)
// Everything renders, but materials don't load
// if (scene.mNumMeshes() == 1) {
// val meshRef = AIMesh.create(scene.mMeshes()!![0])
//
// loadMesh(meshRef, scene, target)
// } else {
// for (meshIdx in 0 until scene.mNumMeshes()) {
// val meshRef = AIMesh.create(scene.mMeshes()!![meshIdx])
// val meshName = meshRef.mName().dataString()
// val child = GameObject(meshName)
// target.addChild(child)
//
// loadMesh(meshRef, scene, child)
// }
// }
scene.close()
}
but the scene tree is also weird because a lot of objects are in there multiple times
sometimes standalone, sometimes as child of another part
I'm unsure if scene.rootNode would even work right with an obj
private fun loadObject(node: AINode, scene: AIScene, target: GameObject) {
println("${node.mName().dataString()} => [${node.mNumChildren()}, ${node.mNumMeshes()}]")
if (node.mNumMeshes() == 1) {
val meshRef = AIMesh.create(scene.mMeshes()!![0])
loadMesh(meshRef, scene, target, null)
} else {
for (meshIdx in 0 until node.mNumMeshes()) {
val meshRef = AIMesh.create(scene.mMeshes()!![meshIdx])
val meshName = meshRef.mName().dataString()
val child = GameObject(meshName)
target.addChild(child)
println("${node.mName().dataString()} => mesh $meshName")
loadMesh(meshRef, scene, child, null)
}
}
println("${node.mName().dataString()} => End meshes")
for (childIdx in 0 until node.mNumChildren()) {
val childRef = AINode.create(node.mChildren()!![childIdx])
if (childRef.mNumMeshes() == 0 && childRef.mNumChildren() == 0) continue
val childName = childRef.mName().dataString()
val child = GameObject(childName)
target.addChild(child)
println("${node.mName().dataString()} => child $childName")
loadObject(childRef, scene, child)
}
println("${node.mName().dataString()} => End children")
}
I believe it's more so for gltf/usd
any suggestions on what to do then?
not too experienced with assimp, but I would validate that it even finds the mtl
assimp has an error message out iirc, might try malforming the mtl and seeing if it logs an error or not
Just to validate that it can find it
I mean it can find it if I go through the scene root
just not if I loop over the meshes
Might be just how assimp is structuring the data internally, check their docs
or the rust docs of the assimp library lmaoo
Personally? I wouldn't bother with *.obj past simple demo meshes.
You should just make the jump straight into something like gltf or another more advanced format that assimp supports.
Obj is only really worthwhile if you need to "load a mesh quick and ez", past that it really sucks.
mostly because dealing with sub-meshes, materials, and additional vertex data with objs is a huge pain
Obj is maybe easy, but it's definitely not quick
You'll want a binary format for quick
Define quick
You can make like a 100LoC Obj parser in nearly any lang from lua to c++
That's what I define as "quick and easy"
But yeah, binary *.glb/gltf files are way faster to load huge meshes with.
And you can parse most formats in one line of cargo add
Didn't know cargo worked with Kotlin, will need to look into that
Most other formats also have "scenes" and some have pre-packed buffers you may need to decode or hope the library has utilities to do that with.
While objs are just verts and faces in a plain text file, easier for novices to deal with.
h
Obj as bootstrap, gltf as real deal
@woven mesa does @Observable have an equivalent to ObservableObject().objectWillChange
no
it works differently
no combine
(combine isnt on linux
@formal belfry use withObservationTracking
i couldnt figure out how that works
im just gonna get this working with combine first
you have to create a new observation trackign thingy after the property changes and the callback fires
if you end up stickign with combine ig use opencombine
idk what u working on tho
xrpc 2 electric boogaloo
o
does that mean i have to review a massive pull request
i will be prepared
finally
@formal belfry https://x.com/kuroijart/status/1923797017530372307?s=46
I am being trolled so hard right now
this is so close to working but rpc just doesnt show up
@woven mesa fix
this code is so clean too bad it doesnt work
I made a swordrpc wrapper months ago and it still holds up its so insanely clean
pohm y godasvbdhsda
huge okay
now time to want to die by simply using AXSwift
@woven mesa@woven mesa@woven mesa@woven mesa@woven mesa@woven mesa
I think i might need to make RPC client soon
what did you do
qbe types have to be written in a specific order to maintain C abi compatibility
^^^
Box<Option<Node>> holds an Option<Node> *, so as its a pointer its just l (a 64 bit int) and doesnt depend on anything
but Node depends on Box<Option<Node>> and Option<Node> depends on Node
so i had to write this thing to print them in the right order
(they wont be in the right order by default, the compiler doesnt guarantee that)
the result is this https://github.com/acquitelol/elle/blob/rewrite/tests/manual/tree.le
generic recursive structures
with pretty-printed types and stuff
Why Box<Option<Node>> rather than Option<Box<Node>>
true actually
yeah that actually simplifies it quite a lot
because it can infer T for Option::None here now
works
absolute explosions
terrifying
@valid jetty now sleep after a long hard day of Elle work
Rosie would rather die than sleep
tbh mood
it was not a hard day
i just messed around and things worked out
who needs sleep anyway
you are not human I think
so true
Yo, any good way of fetching all users from servers to compare? Aka find overlap.
Discord intentionally makes it hard to get all members, to hinder spambots
rip
if you have ManageRoles/BanMembers/KickMembers permissions then you can send OP 8 (requestGuildMembers) with query:"" and limit:0 and you'll start getting GUILD_MEMBERS_CHUNK events, containing all guild members
otherwise no
yep. It is ripperoni
If I have a user inputting an api key somewhere, what is the best way to store it so that you cant just access it anywhere and you need some kinda passwd? Like even if someone has my computer they cant just go onto the app and grab the key without a password or run around my file system to get it.
store it in a file called IMPORTANT_API_KEY_DO_NOT_OPEN.txt on the users desktop
Store it on the system keyring
ah yes the good old honor system
does linux have one? and does the keyring do all the actual encryption stuff itself?
so it asks for passwords whenever it is read from too?
ive only seen it used a few times on macos
Linux itself does not, but both gnome and kde do
ah lovely so what do i do about the linux people
Check what other programs do
I've had to set an envvar to get python poetry to not crash from not having a keyring, so that probably supports it
oh yippie more rust dependencies
just what I wanted in life
me when I get a new blazingly fast 🚀 memory safe 🦺 library for my birthday
I might just do the obvious option and encrypt the api key making use of the password hash from the user
and just store that encrypted thing in a file somewhere in sharedprefs
This looks pretty promising
AES-GCM
now to find a library that supports it
@hoary sluice i added tuple destructuring !!!!!!!!!!!!!!
a bfs hasnt looked this ergonomic in years
fn Node::print_on_lines(Node *self) {
i32[][] levels = [];
queue := [$(self, 0)];
while !queue.is_empty() {
node, level := queue.remove(0).unwrap();
if levels.len() == level {
levels.push([i32;]);
}
levels[level].push(node.value);
if _, left := node.left {
queue.push($(left.to_ptr(), level + 1));
}
if _, right := node.right {
queue.push($(right.to_ptr(), level + 1));
}
}
return levels
.map<string>(fn(i32[] level) level.join(" "))
.join("\n");
}
but yeah basically you can do this
the variables are assigned to x, y, z in the RHS, and its also an expression which evaluates to the LHS
for Option<T> and Result<T, E> the LHS is is_ok or is_some
which means you can write this
while _, current := lexer.next_token() {
tokens.push(current);
}
https://light-theme-hurts.my-ey.es/2pnb9xR.mp4
I figured out the issue
apparently despite opengl remembering everything all the time
it doesn't remember shader uniforms
so if I glUseProgram(a) and set uniforms, then go glUseProgram(b) and set uniforms, going back to glUseProgram(a) keeps the uniforms set on b
Now I just need to figure out why it's stuttering and why that weird artifacting happens on the side of the car
sounds about right
its jsuch a genericly used lib everywhere
i think i first saw it for unity mods, then probs rtx remix the most often
its a workhorse and a half lol
ok uh
stupid question but
how did the person who made this put 2000 images of cheese into a slideshow
no way you do that by hand
There's billions of ways to do that
- script the mouse/keyboard interactions
- generate a powerpoint file with a script
- generate the video with a script without going through a slideshow
But however they did it they're a hero
can you show me some example or something
No
ok
Me when ffmpeg + bash
is there a way to prevent Discord from automatically unmuting my mic whenever i join a VC?
i think it's very possible to hand select 2000 images of cheese as a long term project
if you picked 10 cheese a day it would take less than a year
I suppose ordering the cheese would be hard
wait
there's no way this video has 2000 cheese
you would need to show 10 cheeses a second for it to be 200 seconds
no that's 200 minutes
huh i don’t think it does that for me
be honest yes it has
however now u can actually do aoc purely in elle
@valid jetty is elle lazy evaluated
nop
i know i was joking
smh
it doesnt need to be ..???
its procedural
short circuiting things like && and || are lazy
or ?:
but does it hurt
i mean not really other than to implement
like is there ever a scenario where youd rather evaluate strictly
i mean no but the implementation of it is pointless
It makes implementation harder, costs more memory, costs a branch on every variable access, and makes it harder to reason about performance
@hoary sluice you love
(the model also gets a convex hull assigned)
All in the kotlinx
Oh and it gets weird with side effects
this is true actually
i didnt think about that
im surprised it runs faster than 1 fps
https://nodejs.org/en/learn/test-runner/using-test-runner why does it feel like this explains nothing

why are recursive generic structures so fucking painful
like a ```rs
struct Node<T> {
Option<Box<Node<T>>> left,
Option<Box<Node<T>>> right,
T value
}
monomorphization for this is a nightmare
How so?
because i have to define what Node<T> is before i know what Node<T> is
make it Node<JS> please
In rust that is solved by Box<T> being the size regardless of T (at least of T: Sized)
Wdym it's just a gl progm
the problem isnt the size, that works fine
i need to generate this struct in 2 passes
first pass, just collect the fields, so that I know what fields exist
second pass, partially monomorphize what I can
I had to put 90% of my code in a Box<T> and even then it didn't allow for some stuff that needed generics
but the problem is that, when trying to monomorphize Node<T>, it reaches the definition for Node<T> which is exactly the same as the current thing being monomorphized
so it just infinitely monomorphizes Node<T> causing a stack overflow
How is that case different from non-generic recursive types?
iirc it was something like
DataColumn<I, V> {
withIndex(index: Index<A>): DataColumn<A, V>
}```
because non-generic types dont need to be partially monomorphized
a ```rs
struct Node {
Option<Box<Node>> left,
Option<Box<Node>> right,
i32 value
}
I don't see why this would be a problem
while a ```rs
struct Node<T> {
Option<Box<Node<T>>> left,
Option<Box<Node<T>>> right,
T value
}
its technically not if i just limit the monomorphization depth to 1
What does partial monomorphization mean
if you have a ```rs
struct Bar<T> {
T x
}
struct Foo<T> {
Bar<T> x
}
``` when generating Foo<T>, you need to monomorphize Bar<T> with T, but you dont actually know what T is yet, so you have to partially monomorphize it into a non-generic structure that includes the generic T, that is then fixed up later when monomorphizing Foo<T> with some T
I don't understand the "you need to monomorphize Bar<T>" part
its kinda hard to explain but its for cases like this
struct HashMap_Bucket<T, U> {
T key,
U value,
bool full
}
struct HashMap<T, U> {
HashMap_Bucket<T, U> *[] table,
u64 size,
u64 capacity
}
``` you know that the `Array<T>` struct holds a `HashMap_Bucket<T, U> *`, but you dont know what `T` and `U` are so you need to generate a partially generic struct `Array<HashMap_Bucket<T, U> *>`, which has a defined `T` being `HashMap_Bucket<T, U> *`, but that now depends on `T` and `U` being defined later
i probably could explain this better if i knew the theory lmao
i have no real way to explain it so, sorry if im making no sense
Why are you trying to monomorphize things at all before you have the types
because Array<T> lives in a different context to HashMap_Bucket<T, U>
you know what the T for Array<T> is at all points, its HashMap_Bucket<T, U>
??
hold on
Which is not a type yet
.
it technically is as far as the type system is concerned
^^^
It is not
It's simply an invalid expression
Just like x is not a valid lambda calculus term, whereas \x. x is
i mean i get what you mean but you have to describe the relationship between (in this case) what Array<T>'s T is and what T is when monomorphizing HashMap<T, U>
because T means something different depending on the pass of monomorphization that youre on
Wait so this doesn't work? But that's a super easy to do thing in any lang with generics or even in C++ templates
no this does work
this is what doesnt
Anyway, why are you monomorphizing types before the arguments are given
because im messing around and seeing what sticks lol
@valid jetty hiii
i didnt research into how youre actually supposed to monomorphize things
sleep !!
smh
i find it very funny running grep -r stackoverflow\.com node_modules
you can see all of the lib devs rely on stackoverflow as much as you
ok anyway whatever
@hoary sluice @deep mulch you can do all of this now
you can also use let syntax or specify a type and itll cast the variables to that type
ie
thats just shadowing
lol
but i was talking about the destructuring
instead of ```rs
res := queue.remove(0).unwrap();
node := res.x;
level := res.y;
you just do
```rs
node, level := queue.remove(0).unwrap();
you can do x := y := 0
you can define destructuring on any type by defining the __tuple__ and __triple__ methods
struct Foo {
i32 a,
string b,
f32 c
}
fn Foo::__tuple__(Foo self) {
return $(self.a, self.b);
}
fn Foo::__triple__(Foo self) {
return $$(self.a, self.b, self.c);
}
a, b := Foo { a = 1, b = "a" };
a, b, c := Foo { a = 1, b = "a", c = 1.3 };
why not something like kotler and do a componentN N being the place
would allow for more than just 2
bad
because ill do that when tuples exist with arbitrary length
Why not just have __tuple__ return an arbitrary length tuple
@valid jetty
struct Baller {
i32 foo,
string bar
}
.foo, .bar = Baller { foo = 42, bar = "explode" }
add
because that means i need to have compiler sugar to generate arbitrary length generic structs which i havent done yet
struct Baller {
i32 foo,
string bar
}
val foo2: .foo, bar2: .bar = Baller { foo = 42, bar = "explode" }
ill do that along with getting rid of $ to initialize it
i do want to generalize the syntax
rename Elle to Rust and change logo to a Rust
Tuple and triple is a very silly terminology at any rate, since a triple is a tuple
because the tuple type is (T, U), the triple type is Triple<T, U, V> the init function for a tuple is $(x, y), the init function for a triple is $$(x, y, z), and the destructuring syntax is x, y := z or x, y, z := w
its all over the place and i kinda hate it
AWFULLLLLLLLLLL WHAT IS THIS
you love
atp just use js 😭
@valid jetty@valid jetty
%s/tuple/pair/g
rosie doesnt know how to find and replace
interface Baller {
foo: number,
bar: string
};
const { foo: foo2, bar: bar2 } = { foo: 42, bar: "explode" } satisfies Baller;
``` @deep mulch
satisfies Baller; is ulgy
sure i guess
rosie is insane
you do if you want it to have interfaces like in a strongly typed language
or make a class
but cl*sses
satisfies is like a cast but not a strong cast
yeah
True
ellescript
interface Thing {
numberOfTimesItExploded: number
}
const someThing = { numberOfTimesItExploded: 42 };
const asThing = someThing as Thing;
const satisfiesThing = someThing satisfies Thing;
honestly speaking though, there hasnt ever been a time when i needed a tuple with more than 3 elements inside
satisfies is cool
if you need a tuple with more than 3 elements we have a tool for that: its called a struct
@valid jetty what about like
If you see tuples bigger than that then either you want a named struct, or you're doing something very cursed like bevy or something
yeah this is my primary usecase for it
exactly
r, g, b, a := col;
thats why i havent had the incentive to make arbitrary named tuples
i did actually have this problem in my head
rosie will add iota keyword
i knew it
which does what 😭
Oops I accidentally ```
a, r, g, b = col;
you solve problems in your mind
i already have enums
fix
a: .a, r: .r, g: .g, b: .b
idk why it's called iota

Yes but type checker didn't catch it so it broke in prod
the only real usecase for iota is for enums when go doesnt have real enums tho
its some greek word
developers fault i think
its a greek letter
😭
@royal nymph
Developer's fault for using a tuple instead of a named struct yeah
V
in computer science its like "a small increment" because it goes up by 1 each time you reference it
thats why its called iota afaik
i mean
that too
idk
r, g, b, a := col
``` is way neater than
col.r, col.g, col.b multiple times in a function
android moment
if the dev cant read that the order is rgba thats their fault
let Rgba { r, g, b, a } = col;
sometimes it is argb and that is annoying
^^
enum Foo {
startAt100 = 100,
a, // 101
b, // 102
c, // 103
d // 104
}
``` there is no other purpose for iota surely
you love
Argb is the correct one
@frosty obsidian soon RGB will be replaced by CMYK
cmyk is terrible for anything other than printers
ACMYK or go home
@frosty obsidian
contrast, meep, yellow, kontrast
oh cyan magenta yellow, key
i got it
why do they call it key just call it lightness
@deep mulch you forgot to rewrite pipette to use oklab
bc its a different concept
cmyk is subtractive
i cant
oh
you'll be the first
never
you could be rich
how
Should be just called black
Black bird, black moon
Black sky, black light
Black, everything black
Black heart, black keys, black diamonds
Is that poetry
@valid jetty@valid jetty@valid jetty@valid jetty@valid jetty
@deep mulch minklang
yes
i think ill just push tuple destructuring like this, whatever
im not doing arbitrary-length tuples today
that will take forever
do
Btw are you making elle and いちご just for fun or do they have any specific purpose
いちご is supposed to be a school project but its very overkill, so both are for fun
im learning a lot
hmm i just realized what having tuple destructuring means
thats cool
i took exam about this yesterday bruh
why when i open the server this is the first thing i see
zooter im a big fan of kotlin but not everything has to be exactly like kotlin
it was just an example
variable length destructuring isn't a Kotlin specific thing
componentN is kind of a meh solution
it's the only one I could think of
you can make variable length destructuring just not with arbitrary functions
js has peak destructuring
nop
js is unequivocally terrible no matter where
[𝐄𝐗𝐓𝐑𝐄𝐌𝐄𝐋𝐘 𝐋𝐎𝐔𝐃 𝐈𝐍𝐂𝐎𝐑𝐑𝐄𝐂𝐓 𝐁𝐔𝐙𝐙𝐄𝐑]
js only good for websites
be honest componentN is not the best solution
especially when the stdlib doesnt do more than component5
component(n) would be awesome i think
How would you do it then
Especially when you need to preserve compat with JVM
component(n) would be slower
And also impossible to type correctly
how about componentN and component(n) but componentN is preferred and the stdlib has up to component5 and then arbitrary component(n) (for collections)
what's the difference between componentN and component(n)
or dont put it into a function and make an actual language construct for it
componentN doesnt have branching, component(n) does
I don't get it
And also component(n) would need to be typed as Any?
And you'd have to manually cast it to the correct type
But for collections wouldn't you just do collection.get(n)
@woven mesa im making a proper swift rpc package
20 projects are already named SwiftRPC but im naming mine that
it won't use sockets so you can use it in a sandboxed app
doesn't discord recommend using slayer sdk instead of rpc for rich presence now?
yop
we need name based destructuring
val [name, id] = data
has anyone noticed that different languages have a different "feel"
kinda like driving different cars
idk how to explain it idk if im just crazy
does vencord have that plugin where if u put over 2000 characters it splits it into multiple messages
vns
so true
i dont really know
its not public though
Whats not public

// node does not currently support unit tests using typescript >:(
import { register } from "node:module";
import path from "node:path";
import { pathToFileURL } from "node:url";
register("@swc-node/register/esm", pathToFileURL(path.join(import.meta.dirname, "node_modules")));
yes you can, its public
just fill form in and they will automatically give access
o
TIL node has swc built in

they use it for --experimental-strip-types (which no longer needs a flag but ye) and --experimental-transform-types
but for some reason --test does not support it
and using https://github.com/nodejs/amaro didn't give me much luck either
(which is just a swc wrapper tbf)
@royal nymph why do you bundle using esbuild in venbot instead of using https://github.com/egoist/esbuild-register which adds a hook to require 
no
his paw got hit and his face was full of blood
we found him in a ditch at the side of the road
wtf :(
wondering why he didnt come home today
i hope hes ok :c
no hes dead
getting hit by a car at 9 years old was not how i was expecting him to die bro
it was like 30m away from our house i dont understand why he got hit
its not like he was lost
weve had cats die before but this just hits different
ive known him for more than half my life
honestly? its still fucking dogshit, for me by far simply tsx is by far the best
not perfect when it comes to workers, but as good as it will get tbf
but when i want typescript with nodejs i usually jusst go for deno
because ts in nodejs is still cancer and has issues no matter what u try
wdym
node's ts impl
it works fairly well
its ass
doesnt work for dependencies which need to be in js not ts, its file extension handling is fucky and ignores tsconfig
it's unfinished and you need to pass a flag to actually transform but i think in the future it will be better
but for my case it works just fine
for simple things its fine
problem is, TS is useless for small simple libs
TS is useful when you're doing complex shit, which is when node's ts impl starts to become problematic
it works just fine for me in my pretty complicated project - i don't expect that much lol
i don't expect it to typecheck
i dunno what the dependency issue is
most typescript options only have an effect on typechecking
i don't use jsx
nah i mean raw ts
fuck tsx
react is a cancer XD
like for example
import lib from 'lib/src/main.ts'
wont work
so like, cool you can use TS, your deps cant
legit just deno index.ts
works better
well - that's just something it doesn't do - not a problem with what it does
every dependency that supports node.js will work just fine
I do see the annoyance if you have a monorepo and are depending on other internal packages
wait whgar
i dont remember one of them didint work
that's an esm thing you need extension
and you need explicit index.ts
unless the type stripping also requires that
but i'm using esm anyway 
yeah it ignores tsconfig
yeah its defo not usable imho, i just wish deno was more widely supported in shit like android or electron or vscode
i just appreciate node somewhat catching up with other runtimes so i can just use what's familiar and stable and have nice stuff like that even if it's not quite on the same level 
so i could fucking ditch node
i don't really care about these problems
i just use esbuild or something else if i have to
yeah, when i have no errors in my editor during dev, i want to have no errors at runtime
tsx is bae in that regard
like it just works
its insane to me how many alternatives to tsx there are there which just dont work
isn't it really sloow by default because it just uses tsc
you run tsx and it magically works first try
ts𝕏
nah it uses esbuild
i swear i used another library where it used tsc
yeah there's one that uses import hooks
i mistakenly used it in prod one time
the memory usage and cpu usage on that shit was NUTS
SA comes up to me like "yo your k8s instance is using like 2 gigs of ram for some simple script, wtf u doing"
node-ts/ts-node?
oh probably
yeah that shit implodes RAM and CPU usage
idk how it has 30 mil dls per week
i swear i copied the lib i was using from another project
when its so bad
ts-node uses tsc afaik
package.json: Lines 5-19
"scripts": {
"start": "ts-node src/main.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@discordjs/rest": "^2.2.0",
"@types/express": "^4.17.21",
"discord-api-types": "^0.37.75",
"dotenv": "^16.4.5",
"express": "^4.18.3",
"ts-node": "^10.9.2",
"tweetnacl": "^1.0.3"
},
yeah i made that mistake once
it seems like a "good choice" because it has nice clean hooks into node
but nope, bad idea
Hi
i feel i have come a long way since then even thought it was only a year ago
yeah i've known ts for years, but only seriously started using it like a year ago
i still fucking hate typescript because of its insane per-project setup and god awful default settings
which is why i've put off using it for years
but its gotten better now
then i used C++
then I used python
then i used rust
then i used typescript xD
(do NOT ask about C++)
you procedurally used worse and worse languages for the job XD
i don't know why i considered c++
rust had awful support for discord bots for ages, mainly because json and web and yeah
yeah bro i couldnt tell you
i will never touch C/C++ for a personal project
its fucking hell
i think just because it had coroutine support
i barely know any rust at all, and its so much better to compile and import dependencies its insane
like even with my utter incompetence in rust i still get the job done faster than in C/C++ because i can actually compile things and import dependencies and it just fucking works
FUCK MAKEFILE
rust is decent for discord bots however I to this day have concerns regarding using serenity for a large scale project as it doesn't seem to handle ratelimits correctly?
rate limits.... are a complex thing
like hardest things in programming
- naming shit
- caching
- rate limits
no cap.
buckets, bursts, refreshes, retries
its... hard as shit
sounds about right
poise is a pretty nice framework though and it uses serenity
yeah libraries for web tech in non-web languages is usually 🐶💧
however i prefer to roll my own command handling stuff
things irk me i love how every command handler seems to say type .help command_name for wrong usage instead of having a button you can press
it's not that hard to make a button... this is not an unsolved computer science problem...
also fuck tsc
it fucking scans node_modules deps which are in ts and errors build if they have ts-config incompatibilties
nope
but supposedly that does bad things
skipLibCheck doesnt help that
my node_modules deps themselves are in ts, and have their own tsconfigs
but tsc ignores them
and it uses the root tsconfig from my project
ignoring the scoped tsconfig in the dep
skipLibCheck doesnt work around that, because tsc NEEDS to compile that dependency, as its TS only, there's no JS code for it to import
unless you're not using node, libraries generally compile to a dist folder and only publish that
yeah i'm not using node libs
esbuild handles it correctly
but tsc which i use in my action hooks errors
it's gotten to the point where i use eslint for type checking because it fucking works better
shrimply get it to cd into every package and run tsc and rewrite the package.json to import from the output folder
unironically that's the official solution
a script which adds // @ts-ignore at the start of every .ts file in node_modules
thats the current solution on tsc's github regarding the problem
i feel like some developers of big libraries are trolls they want to annoy people who open issues as much as possible
its a ts problem not a tsc problem
isn't tsc part of ts
It is good that TypeScript errors here, even if it is an overall terrible user experience.
expert troll who managed to be employeed by microsoft /s
i think if somebody opens an issue saying something is broken i should gaslight them into thinking they have problems
i need to look at this https://gist.github.com/felskov/84fa477e87fb18f3ff7bee4ee2ce1c57
and they should get a therapist
i will just close every issue from now on
"get a therapist"
supposedly its tsc but without dep checking
in all seriousness honestly with issues like these i think there's usually some technical reason that's hard to understand

I wonder if Lina is in a state now where I can submit to testflight hmmm
Whats Lina
out of curiosity how different is react js to react native and what's the learning curve like trying to pickup react native if you already know react js
im biased but I highly recommend against it. it's buggy and performance isn't gonna be like a proper native framework
it's just not a good solution for multiplatform applications
Its mostly identical, just use <Button>foo</Button> instead of <button> for example, and RN has own styles thing instead of css
but anything that is JS/TS shouldnt be used outside of web browsers
i want one for svelte ngl
only took half a year
resell for $500
buy for 100$ @deep mulch
okay
probably not cuz coders are dirty nerds who are not interested in spending $$$ on clothes 😭
looks at furry community... fair....
i don’t even pay for my software why would i pay for merch
i would much rather spend the money on 地雷系
mfw man is talking to himself
i would spend all my income on an extremely rare and pretty piece of clothing for $2000 ngl
yall would not..?
my limit is $100 or $150 for a single piece of merch
I would not spend $2000 for a tshirt
exactly
still can’t believe ts is real 😭😭😭
id wear
i mean the fact that vetements has a fucking java t shirt not the price (it’s a fair one imo)
Who the would pay $878 for that
me
Looking at a random clothes store's website, I could buy 125 tshirts for that money
How to increase the size of server icons?
(Auto-response invoked by @jade stone)
me if it’s a design i like, a brand i like, rare and interesting piece
what store
no i’m actually not that’s why i don’t have any expensive clothes 😭😭😭😭
Then what the hell are you on about
Who pays more than like
20 dollars for a shirt ever
Better be a fucking golden shirt
i’m saying if i was earning shit i would consider paying that much for a tee if i fw sm
bro fuck ice cream u can’t rock dat
I can eat it
I want ice cream now
Accept my apolocheese for the outburst
I will now investigate the viability of ice-cream
u gon b sick from that much ice cream
I only want like a scoop
But the idea is that you can always get a scoop
And if you can control yourself
or a t shirt
It is good
need 😭😭😭
You need to charge your phone
@hoary sluice @deep mulch @placid cape I DID IT
I ACHIEVED PEAK
fn Array::map_with<T, U, V>(T[] self, fn(T, V, u64, T[]) -> U mapping, V arg) -> U[] {
let new_self = Array::with_capacity<U>(self.len());
for u64 i = 0; i < self.len(); i += 1 {
new_self.push(mapping(self[i], arg, i, self));
}
return new_self;
}
fn Array::map<T, U>(T[] self, fn(T, u64, T[]) -> U mapping) -> U[] {
let new_self = Array::with_capacity<U>(self.len());
for u64 i = 0; i < self.len(); i += 1 {
new_self.push(mapping(self[i], i, self));
}
return new_self;
}
STRONGLY TYPED FUNCTION SIGNATURES IN THE TYPE SYSTEM
!!!!!!!!!!!!!!!!!!!!!!!
wtf am i looking at
this is hard to read fix
how
wdym...
too much self
why can't self just be implicitly an argument
developer shouldn't have to always specify it as the first arg
I think it would be easier
@valid jetty @valid jetty
magic
Decades of experience with c++ and java have learned that explicit self is better
^^^
does this support non local functions too@valid jetty
wdym
map(someFn)
yes you can pass any function to it
fn Array::truncate(i64[] self) {
return self.map(i64::truncate);
}
fn Array::promote(i32[] self) {
return self.map(i32::promote);
}
as long as it has a signature and isnt just a void* or something
fn Array::truncate() {
return self.map(i64::truncate);
}
fn Array::promote() {
return self.map(i32::promote);
}
``` fixed
any type can have functions defined on it
Int is a type
it sounds cursed but it is actually really really powerful
@valid jetty can function be defined on null
because you can do stuff like this
global pub, external;
fn isalnum(char arg) @alias(char::is_alphanumeric) -> bool;
fn isalpha(char arg) @alias(char::is_alphabetic) -> bool;
fn iscntrl(char arg) @alias(char::is_control) -> bool;
fn isdigit(char arg) @alias(char::is_digit) -> bool;
fn isgraph(char arg) @alias(char::is_graphic) -> bool;
fn islower(char arg) @alias(char::is_lowercase) -> bool;
fn isupper(char arg) @alias(char::is_uppercase)-> bool;
fn isprint(char arg) @alias(char::is_printable) -> bool;
fn ispunct(char arg) @alias(char::is_punctuation) -> bool;
fn isspace(char arg) @alias(char::is_whitespace) -> bool;
fn isxdigit(char arg) @alias(char::is_hexdigit) -> bool;
fn tolower(char arg) @alias(char::to_lowercase) -> bool;
fn toupper(char arg) @alias(char::to_uppercase) -> bool;
'a'.is_digit()
``` and this is a 0 cost abstraction which, in the IR, literally just does `isdigit('a')`
null isnt a type
nil is a void*
I null
not 0 zero cost it should skip function call

well
can you declare function on void*
it calls into crt
in rust can you call functions on ints idk
yes ofc
probably
there is a special compiler intrinsic specifically for pointers and void pointers
that being __void_ptr__ and __ptr__
fn __void_ptr__::__fmt__(void *self, i32 nesting) {
return "<unknown at {}>".__internal_formatter_do_not_use_unless_you_know_what_youre_doing__(self);
}
!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);
}
stop putting functions on primitives
ints were never meant to be .toStringed
ugly but it doesnt need to be pretty
Rosie will add proper visibility modifiers and remove __
its an internal function
@valid jetty tomorrow Elle will be released
Where else would you put the function for tostringing an int
sounds like a common thing though ain’t it
sprintf
rust has stuff like saturating_sub which essentially does (x - 1) < 0 ? 0 : (x - 1)
its useful to have methods on ints
and any type in general
more like sub_without_overflow?
The less special primitives are, the better
private fn voidptr::fmt(i32 nesting) {
return "<unknown at {}>".format(self)
}
fixed
wait
i think there's a good argument to not allow operator overloading and only make primitives have them

but i understand why people like operator overloading
Sure, if you want to encourage primitive abuse
good for working with special units
5.km + 2.mi
or something
thank you rust
@valid jetty do you love my ideas
Based
one day I will just rewrite Elle in Kotlin
yeah you can do this in elle
😭
allow doing not like in c++
/run
#include <iostream>
if (not false)
std::cout << "hi\n";
Here is your c++(10.2.0) output @winged mantle
hi
I'll make Elle feature complete in Kotlin before you finish Elle @valid jetty
i was thinking of the other times
@valid jetty make compose in elle
i was thinking of this other example
make ellex
which is honestly funnier
@valid jetty like jsx but for elle
evil
is it weird that i named a file wish_dot_com
imagine if you add units to primatives
print((5 miles).unit) // miles
print(typeof(5 miles)) // int
where it's still the same type
infix getters would be funny
infix is kinda clean
yes
/run
println 'hi'
Here is your groovy(3.0.7) output @winged mantle
hi
I like as long as it's not abused too much
why don't languages have a print operator if printing is used so much like
🖨️"hello world"
why husk
get special programming keyboard
all necessary symbols
why don't programming languages add support for exporting with tarrifs
5 mi / 3 hr // mph
9.8 m / 1 sec ^ 2 // m/s²
i don't understand why you need units lioke that
@valid jetty Elle repl
just do 5 * MILES
i see