#🪅-progaming
1 messages · Page 88 of 1
it's useful in certain cases yeah
like a discord message
if it comes from anywhere, things like msg.guild, msg.channel etc can differ
so you have to manually check all those members
you can instead do like
isInGuildChannel() this is GuildChannelMessage {
return this.guild !== null;
}
if (msg.isInGuildChannel()) {
msg.channel // typed correctly
msg.guild // typed non null
} else if (msg.isInDm()) {
msg.channel // DMChannel
msg.guild // null
}
nicer alternative to manual casting
isVen() this is Ven {
return this.person.kind === 'cute';
}
if ('guild' in msg) {
msg.channel // typed correctly
msg.guild // typed non null
} else if ('dm' in msg) {
msg.channel // DMChannel
msg.guild // null
}
does the same tho?
function isCute(): this is Cute {
return this.message.reader === 'you';
}
TS infers that the msg is a GuildChannelMessage, and you dont need and TS specific syntax
Can you patch the content in /assets?
Yes, that's where the webpack is
yeah level 5 devs make a lot of syntax errors
nvm its not
but why is he casting a nullptr to a function that returns void

void* 0 but i inserted 10 trillion parentheses
@valid jetty I will cast you to a void pointer
no
void(*x)(int) is a function signature in C
void(*)() is a signature that takes no args and returns void
theyre casting 0 to that, then inline-calling it
@valid jetty find my pointers
so effectively the same thing
casting 0 to a void* and casting 0 to a function that returns void are very different things
though the result is the same
both crashes the program
yeah, a segfault
Casting 0 to a pointer, whether void or void(), is no problem; it doesn't break until you dereference/call it
rain doesnt come from clouds unless it rains
Do you?
afaik thats 100% possible
how
@valid jetty lol thats like 80% of the project
chore: lint
lmfao
@valid jetty hiii
@deep mulch minklang
i cargo fmt and cargo clippy --fix before every commit
with pedantic clippy
altho yea this was a clippy lint
soon
pretty sure you have module inception allowed
what
ig this is completely unrelated if theres no commit message visible
meh
lmao yeah
u mean pub use?
yeah
organization
@valid jetty rewrite Elle
eventually i will
this is why i have stayed on approx the same loc for months
rewrite lexer and parser in elle
oh great my zed broke again because i ran out of storage
fuck this stupid 256gb ssd size
macbook:
ok well whatever
fn Lexer::iter(Lexer self) -> Iterator<Token, Lexer, SingleEnded> {
return Iterator {
env = Box::new(self),
next = Lexer::next_token,
next_back = nil
};
}
``` i did this in いちご
the lexer is the Env
rewrite lexer and parser in elle
then in main you literally do this
tokens := Lexer::new(args[0]).iter().collect();
this is it
i could do
but that means serializing the AST into some form the rust needs to read
for codegen
im not doing codegen in elle
this is what im spending my next paycheck on https://www.tuxedocomputers.com/en/TUXEDO-Sirius-16-Gen2-Pre-built--48h-Shipping.tuxedo
Sirius 16 - Gen2: AMD Ryzen 7 8845HS + AMD Radeon RX 7600M XT + Aluminum chassis + Per key RGB keyboard + 80 Wh battery + max. 96 GB DDR5-5600 RAM
or maybe a framework
y
difficult
possible but slightly annoying
idk what to tell you but this code so clean
use std/prelude;
use lexer/lexer;
use parser/parser;
use compiler/compiler;
fn main(string[] args) {
program := args.remove(0).expect("プログラム");
file := args.remove(0).expect("使い方: {} file.igo\n".format(program));
tokens := Lexer::new(file).iter().collect();
tree := Parser::new(tokens).parse();
module := Compiler::new(tree).compile();
io::write_to_file(file.replace("igo", "ssa"), "{}".format(module));
}
it feels scary that unicode works without jumping through hoops
just say the English word
I can't even pronounce that
it doesnt
it may be able to be put inside strings but you cant manipulate those strings
its an array of bytes not an array of utf8 chars
you know what it means
nop
everyone here speaks English so just send the English name
関数 同一(整数 値)『
返す 値。
』
関数 気持ち()『
返す 「大好き〜」。
』
関数 メイン()『
※これはコメントです
整数 フウ = 同一(39)。
文字列 バル = 気持ち()。
プリント(「%dが%s:3\n」、フウ、バル)。
プット(「彼女は「にゃ〜」と言ったの」)。
』
you are addicted I think
no
yes
the point is that the language is supposed to be fully jp

guhh hop off complaining
everyone knows what it means
yeah smh
I figured out how to notifications 
guh
Ooo
I am considering to make site in C++ with Qt
I should make a mobile app for my site but idk how to do webview content stuff
Til Qt supports web
horror
rewrite minkinator with compose
idk
gu
tui dashboard for minkinator
guhh
guy
guys
i joined this server soully to say i added an extra intensity to party mode
i fittingly named it lord and boy is it a mess
W hat
Build terminal UI in Kotlin using Jetpack Compose
Cursed
bruh
I used ink and it was so painful
Yoga is just bog slow and huge
You're better off using rust and ratatui
This looks like garbage lol
is there anyone who can help me with writing revanced fingerprint?
cause like my fingerprint is failing to be found
Look on the nearest polished glass surface
probably ask in the revanced server
ugh...
this is just a terrible idea
oh my god stop trying to put react in everything 😭
bloat central
top 3 ink users are ai slop
should give an idea of what kind of tool this is
React is probably easier to vibe code, makes sense that vibe coding tools would want to use it
true
Rewrite react in react
my internet so bad it showed the message twice but it sent only once
now it deleted both messages
Linux trying not to make everything a pseudofile
But "everything is a file" is like, linux's slogan
@valid jetty never use rust and docker on a raspi
/dev/vee
building my voice assistant takes 20 minutes
@royal nymph i will make vee file
3k loc 300 deps
every time im in my documents folder the prompt has one leading space and its driving me insane
its only the documents folder
its the deps
every language has a dependency problem tbf
only if you're disciplined then you wouldn't have so many deps
Resisting NIH is what takes discipline
More deps means more code you didn't have to waste time rewriting a worse copy of
you do NOT need 300 deps
So real
most of the time you could just take the code and fit in your codebase or simplify it
I once used a random timestamp formatting library from npm
it seemed more complicated to get it to work how i wanted than just writing it myself
you can add deps, but to some degree that the dep itself doesn't do beyond what it needs to do for its job

I feel like there's nothing inherently wrong with doing things which have been done before
i think as a rule of thumb the one time where you mostly should be using a library is when you need something that implements a specification like http or json
i should rewrite apprev to only use the node WebSocket
and try going zero dependency
tbf it sounds easy it already hooks into the gateway for 99% of what it does
dependencies": {
"esbuild": "^0.25.3",
"oceanic.js": "^1.12.0",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
"tsx": "^4.19.4",
"typescript": "^5.8.3"
},
or I guess a better way to say that is the one time you're mostly foolish for not using a library is when you need something which implements a specification
should i try implementing sqlite @winged mantle
or i go back to Json database and state object
@winged mantle rate
it does io on every call 
true
do i need to have a state in the state
to store itself
making a class soon
why not
- make writing add to a queue of promises
- instead of reading on get, make it read when the file changes asyncrounously

why does it read on every get instead of using the proxy target

docker and raspi issue
disciplined enough to implement my own llms as to not use deps?
Its a raspi, what did u expect
exactly this
wtf
it takes 3 mins cargo clean & release on my laptop and a few secs normally
but it needs to clean build every run in docker
well i expected long times but not 20mins
ok please tell me how to rewrite this without 300 deps https://github.com/eagely/voice-backend/blob/main/Cargo.toml
by 300 im obviously including nested deps, they dont disappear just cause u didnt declare them as deps
please tell me how to rewrite this in java with less deps
copy all of the deps into your source tree
what exactly does that achieve
at least you can say technically you have no deps if you instead plagiarise all of them
besides being a pain to use
it will reduce compile times because you dont need to download deps
you could narrow down to just the methods you need but doesn't work all rhe time
(don't do this)
Who gives a fuck about cold build time
what does cold mean
After cargo clean
i have worked on a 0 dep java project before
oh
(Nevermind that cargo clean doesn't delete download caches)
hand rolled json parsing
idc but in docker its always clean
Unless you configure your docker right, yeah
then its more than just clean cause it redownloads
no thanks id rather wait
https://github.com/PrismLauncher/PrismLauncher/blob/develop/libraries/launcher/legacy/org/prismlauncher/legacy/utils/Base64.java#L45-L49 i probably have shared this before but :dukethumbup:
Base64.java: Lines 45-49
/**
* Uses Base64 with Java 8 or later, otherwise DatatypeConverter. In the latter
* case, reflection is used to allow using newer compilers.
*/
public final class Base64 {
and no it wouldnt really work, the recompilation is cause i keep messing up the linking, i have yet to get it to run properly
i first tried to write my own base64 implementation
could only get it to run inside debian docker, now i need it on alpine
cant imagine how it was like to use a computer before 2010

this raspi wouldve been state of the art in 2010
you worked on prism?
she worked on a prism?
she worked on a prism?
i am right now
swiftie launcher
give me name suggestions for my voice assistant
Jim
thx
i have it in python because theres lib for every fucking shit
and i didn't know about porcupine
I thought the whole point of Rust was to make every project a supply chain attack nightmare
you're thinking of javascript
Ah, you’re right
there are literally projects for addition and parity in javascript
that many projects use
wait
:)
yeah rust has almost no downloads on those kinds of crates
supply chain attacks cant happen if people arent stupid
as well as, the fact that js has so many fucking packages means ai is very likely to hallucinate js deps, unlike rust which has far less
supply chain attacks are only a nightmare in js land
yea because people are stupid
and polyfill hell
Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.. Latest version: 7.0.0, last published: 7 years ago. Start using is-number in your project by running npm i is-number. There are 2883 other projects in the npm registry using is-number.
yea literally
93 milion downloads
lol criticising js for its dependencies while the average rust project uses 150 crates
thats true
the rust project may use 150 crates but at least rust devs are conservative and dependencies are only so high because people like to share logic if possible
rust devs love to boast about how low their dep count is, unlike js devs who just pnpm i everything lol
@valid jetty will Elle have built in is even
@valid jetty elle_modules
make it work identically to npm
we have it it’s called %2==0
@hoary sluice’s aoc utils be like
if i make enough progress elle could genuinely be usable for aoc (i’m not participating anyway)
but i have arrays, iterators, gc, i can add deque and a networking library and stuff
it would genuinely be kinda usable
yeah and js devs love to share their is-number logic
what's your point
both use way too many dependencies for random shit
js devs using 150 dependencies: loool lazy js devs just pnpm i anything and have huge supply chain attacks
rust devs using 150 dependencies: actually I am very conservative I just like sharing logic with other highly educated rust developers. rust developers aren't stupid (unlike js devs... ugh) so supply chain attacks can't happen
you're sounding so pretentious lmao
yes those js packages like is-number is-odd etc are laughable and terrible and I wish people would stop using them but
- no one is denying this fact
- rust is literally no better in this regard
- actually most people don't use these packages, it's just that the authors of these libraries have infested the community so much and getting these shitty packages added as indirect dependencies to major packages like express, that's why they're so popular
pretentious people write variable names in french
re point 3
no one willingly installs is-promise, but when you install express, the most popular http server lib you unknowingly install it
it's literally no different in rust lol
no one installs 150 crates
you install 5 crates and those 5 crates pull in 10 other crates that themselves pull in 20 other crates and so on
I would argue in rust you often need more direct dependencies because of standard lib lacking things lol
rookie shit https://npmgraph.js.org/?q=webtorrent
without looking at those deps (maybe there's bs deps), torrent is so complex it is probably warranted
nah
most if is BS
like node-datachannel which uses prebuild install
because it has native code
and that has a gazilion deps
i looked and yeah there's a lot of bullshit
like any sindre library

sindre is the king of bloat
idk why he has as many sponsors as he does
first 2 depth shit is all 100% required
actually even first 3 depth
all this is non bloat
the stuff after it is bloat
i maintain all that shit btw
hell, half of it is mine XD
wait wtf that doesnt include the entire tree
yeah it omitted a bunch of deps
bad website
Is there a way to run this for a local project
am I a noob
my other more complicated project has even less
what the hell... another project i checked which is not mine
why youre not participating in next aoc?
this sounds like an extremely fucking dumb question, but uh how would one learn how to actually build sites? like i don't need to learn html or css basics or hundred tags/styles/etc. but rather how to actually make a good site optimized for small screens, mobile and all that stuff
school

well from my limited knowldege, nowadays its picking the new best "cults" of frameworks and libraries to use
id just pick 1 and stick with it
optimising for mobile is really not as hard as people make it out to be thanks to media queries
you just gotta learn best practices
im gonna stick with jquery 
Hi, I'm a software dev nerd mostly known for full stack TypeScript stuff. Check out me and my stack at t3.gg
are media queries like bootstrap and other stuff
like using the right units (em/rem is very good)
using the right tools for building layouts (flex and grid, avoid float or magic numbers)
😭
media queries are essentially css if statements
IM NO WEBDEV
if the screen is less than 700px wide, apply this css
if you watch all of theo's videos you'll be a webdev genius
@media (max-width: 700px) {
}
oh i see though sounds like a pita 
Oh i remember doing something like this in react a few weeks back
why?
obviously if you use magic numbers (width: 432px) yeah it's a pain
i assume it would probably have like lots of uh cases for @media
i mean for each resolution
.my-card-grid {
--columns: 3;
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
}
@media (max-width: 1000px) {
.my-card-grid {
--columns: 2;
}
}
@media (max-width: 600px) {
.my-card-grid {
--columns: 1;
}
}
simple example
rather a vibe coder genius
lmao

hm alright i'll try that
if it's the easiest way of doing mobile/small screen support
full async ebml parser btw
i wanna see a graph where there is just one thing which depends on itself
is tailwind
or 
...both
also uh remembering the dependencies discussion this chat had half an hour ago would i rather use a dependency for something not-so-hard (like a popup) or just make it yourself
this is just one single example how you can make your ui adapt to different screen sizes
okay that seems neat
build your entire around with stuff like this in mind and always use the right tools (grid, flex)
then it's easy to make it good on smaller sizes
full code
<div class="my-card-grid">
<div class="card">1</div>
<div class="card">2</div>
<div class="card">3</div>
<div class="card">4</div>
<div class="card">5</div>
<div class="card">6</div>
<div class="card">7</div>
<div class="card">8</div>
<div class="card">9</div>
</div>
<style>
.my-card-grid {
--columns: 3;
display: grid;
gap: 1em;
grid-template-columns: repeat(var(--columns), 1fr);
}
.card {
height: 2em;
text-align: center;
background: black;
color: white;
}
@media (max-width: 1000px) {
.my-card-grid {
--columns: 2;
}
}
@media (max-width: 600px) {
.my-card-grid {
--columns: 1;
}
}
</style>
tjank you (ik what flexbox is)
with flex you can do stuff like change the direction the elements flow on mobile
@valid jetty im listening to ferris explain hrtbs
was testing friends' site on my iphone and apparently it didn't work because of something in webkit and my friends have no idea how to fix it 
i had to install raspi os instead of alpine cause one of the cpp deps i had didnt like musl
thats not possible
it would be cool though
(because the entire web ecosysten is husk rn)
though i'm not entirely sure it's because of webkit but well it works just fine in firefox 
you mean
fn foo() {
foo()
}
web dev would be much more fun if it was just gtk
Yop
the graph is very much possible
react + tailwind + shadcn + threejs + chatpgt = 
why does this code feel so wrong to me why do I prefer (new Error).stack
catch (error) {
eval(openAi.completion("fix this error, return only code", error))
}
and a hardcoded openai token 😍
@valid jetty how do u even begin to parse that correctly
does new just consume until ) then stop
javascript parses things weirdly you need parens around lambda body often
consume until non id character?
also tryna use astro for my site but it differs so much than just regular html+css+js 
no i think theres just a special case for constructors
if there is no ( token after the id then it assumes theres no args
which is a fucking weird feature but whatever
It's a really fucking dumb special case, nobody sane would write constructor calls without parens
why tf is it still the only way to download a file in web 🥀🥀🥀
theres no way this is real
then how else
oh no i believe you
web dev is always stupid so this seems real
nah but this one is just extremely fucking dumb idgi at all
like most things in webdev
why do you need to add it to the document to click it lol
Bookwork.tsx: Lines 70-77
logger.log('Exporting bookwork codes...');
const blob = new Blob([JSON.stringify({ azalea: true, listing })], { type: 'application/json' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = `azalea.export-${new Date().toLocaleDateString().replace(/\//g, '-')}.json`;
link.click();
its not ideal but whatever
yeah but still the point is you need to do that goofy .click() that looks so weird
somewhat
i should stop procrastinating and should start building the site ffs
@hoary sluice watch reacher
may i interest you in streaming downloads from browser
i dont think it can ever reach even 1mb naturally lol
ignore the fact that this code is giga old, and i wrote it when i had like a year of experience with JS
well and then you need this....
on the client side
simple
😭
its giga great
because then you can do
<video src='/server/fakeFile.js'>
and you can stream a video created in browser
and do the same with images, iframes, audio etc
and you can ofc create streams to download data generated in the browser too via
if (req.destination === 'document') {
res.headers['Content-Type'] = 'application/octet-stream'
res.headers['Content-Disposition'] = 'attachment'
res.body = 'DOWNLOAD'
}
which then lets u do
<a href='./fakefile' target='_blank'>
which will download the file, but as a stream you implement yourself
i love making browsers do shit they arent really made to do
why can you use js files as a src for videos
he just explained that
oh i didnt realize that was related
?
@royal nymph
this is the most js code i have seen
yeah i worte this like 6 years ago?
or 5?
i was giga nub at js
i could write this x10 better now
are you a 10x developer
im a 9x developer how about that
a pyw
could b e worse
i've learned ()=>{} is actually really bad to use, and function () {} should almost always be preferred
i don't think i wrote it in notepad
this is my best code so far
i re-wrote the entire app a few days ago
and this i guess https://github.com/ThaUnknown/video-deband/blob/main/src/main.js
using opengl in js
.py but it doesn't open a console window
ah
i guess i wanted it to play an annoying tune with no way to stop it
I find it hard to find any of my 2016 code for some reason lol idk if i barely did any or lost most of it
so good
i started writing decent code almost right away cuz i was forced to, i was taught from the start to use eslint, and fix any errors found by it
and boi was it a good way to learn
ServerPropertiesHandlerMixin.java: Lines 23-60
@Shadow
// public boolean onlineMode;
// @Shadow
// public boolean preventProxyConnections;
// @Shadow
// public String serverIp;
// @Shadow
// public boolean spawnAnimals;
// @Shadow
// public boolean spawnNpcs;
// @Shadow
// public boolean pvp;
// @Shadow
// public boolean allowFlight;
// @Shadow
// public String resourcePack;
// @Shadow
// public String resourcePackHash;
// @Shadow
// public String resourcePackSha1;
// @Shadow
// public String motd;
// @Shadow
// public boolean forceGameMode;
// @Shadow
// public boolean enforceWhitelist;
// @Shadow
// public Difficulty difficulty;
// @Shadow
// public GameMode gameMode;
// @Shadow
// public String levelName;
// @Shadow
// public int serverPort;
// @Shadow
// public int maxBuildHeight;
// @Shadow
// public Boolean announcePlayerAchievements;
player.svelte: Lines 2-24
import Captions from 'lucide-svelte/icons/captions'
import Cast from 'lucide-svelte/icons/cast'
import ChevronDown from 'lucide-svelte/icons/chevron-down'
import ChevronUp from 'lucide-svelte/icons/chevron-up'
import Contrast from 'lucide-svelte/icons/contrast'
import FastForward from 'lucide-svelte/icons/fast-forward'
import List from 'lucide-svelte/icons/list'
import Maximize from 'lucide-svelte/icons/maximize'
import Minimize from 'lucide-svelte/icons/minimize'
import Pause from 'lucide-svelte/icons/pause'
import PictureInPicture2 from 'lucide-svelte/icons/picture-in-picture-2'
import Proportions from 'lucide-svelte/icons/proportions'
import RefreshCcw from 'lucide-svelte/icons/refresh-ccw'
import Rewind from 'lucide-svelte/icons/rewind'
import RotateCcw from 'lucide-svelte/icons/rotate-ccw'
import RotateCw from 'lucide-svelte/icons/rotate-cw'
import ScreenShare from 'lucide-svelte/icons/screen-share'
import SkipBack from 'lucide-svelte/icons/skip-back'
import SkipForward from 'lucide-svelte/icons/skip-forward'
import Users from 'lucide-svelte/icons/users'
import Volume1 from 'lucide-svelte/icons/volume-1'
import Volume2 from 'lucide-svelte/icons/volume-2'
import VolumeX from 'lucide-svelte/icons/volume-x'
:^)
oh that was only icons sir
the full imports are way longer
ah o7 @pearl stag
index.ts: Lines 1-9
import { clientsClaim, skipWaiting } from 'workbox-core'
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
import { build, files, prerendered, version } from '$service-worker'
precacheAndRoute([...build, ...files.filter(e => !['/Ameku.webm', '/video.mkv'].includes(e)), ...prerendered, '/'].map(url => ({ url, revision: version })))
cleanupOutdatedCaches()
clientsClaim()
skipWaiting()
has support for groovy plugins https://github.com/TheKodeToad/Spade/blob/v1/Spade/src/main/java/me/mcblueparrot/spade/SpadePluginManager.java#L140-L175
SpadePluginManager.java: Lines 140-175
else if(pluginFile.isDirectory() && pluginFile.getName().endsWith(".plugin")) {
try {
File descriptionFile = new File(pluginFile, "plugin." + ConfigurationSystem.getDefault().getExtension());
Configuration description;
String scriptName;
try {
description = ConfigurationSystem.getDefault().load(descriptionFile);
scriptName = description.getString("script");
Objects.requireNonNull(scriptName);
Objects.requireNonNull(description.getString("name"));
Objects.requireNonNull(description.getString("version"));
}
catch(Throwable e) {
logger.error("Invalid plugin description");
throw e;
}
if(scriptName.equals("plugin") || scriptName.equals("server") || scriptName.equals("scheduler") || scriptName.equals("pluginManager")) {
throw new IllegalArgumentException("Script cannot be called plugin, server, scheduler or pluginManager");
}
File scriptFile = new File(pluginFile, scriptName + ".groovy");
if(!scriptFile.exists()) {
throw new FileNotFoundException("Cannot find script " + scriptFile.getName());
}
ScriptPlugin plugin = new ScriptPlugin(scriptFile);
plugin.setDescription(description);
Binding binding = new Binding();
binding.setProperty("plugin", plugin);
binding.setProperty("server", Spade.getServer());
binding.setProperty("scheduler", Spade.getScheduler());
binding.setProperty("pluginManager", this);
GroovyShell shell = new GroovyShell(Launch.classLoader);
Script script = shell.parse(scriptFile);
script.setBinding(binding);
script.run();
plugins.add(plugin);
}

what's a recommended way to stop path traversal in node.js 😭
when i search i can only find stuff like normalising and checking whether it starts with .. (which isn't the best)
validate user input lol
yeah but how?
then where you are trying to prevent path traversal
i am trying to join a path to a root dir
and throw an error if it goes outside the dir
I don't want to do something myself because there might be an oversight
there's a lot of ways
like a LOT LOT
start with a path.resolve
so path.resolve(base, userinput)
that gives u a normalized path
then you can check that normalized path
i noticed that a lib which did something like that had to change it due to a vuln
their solution now is regex

ig that's fine
for example if(path.relative(base, normalized).startsWith('..')) throw new Error('Nuh-uh')
there are probs better ways of doing it
that also matches paths like ..test, no?
i would rather use something battle tested but for example the impl that express uses feels quite complex
yeah
that sounds about right
UP_PATH_REGEXP is probably a check for ^../
so its legit what i sent u
path.normalize instead of path.resolve
so i got braincells on me after all
checking for .. will break for paths like this
do ^../
.
ohh I now understand that vuln with express's dep
it just allowed you to work out the root path name from seeing if you got an error
what even is the point though
this is just startsWith
maybe old js didn't have
implementation i ended with
you're right resolve does normalize... at least if i understand node source code correctly
ok why are these stupid font files so hard to work with
ive just spent 20mins tryna figure out why my icons were in the wrong place just to find out there like 3 diffrent kinds of .ttf file
and im meant to know that
same extensions too
Most older languages don't even have else if
It's just else any-statement
Yes
That's exactly what I just said
if is a statement, {} is a statement
for some reason it didn't occur to me
@placid cape i got silence detection to work exactly 20 mins before i have to leave to present it
Lol
it was supposed to be on alpine & kde but one of my deps (whisper-rs) assumes u have glibc and im not smart enough to make it work
and alpine uses musl
oh yea
but i dont think my supervisor knows what a linux distro is so its fine
@valid jetty portal 2 is turing complete
I prefer for if
for (const value of arg.value) if (value != null) {
yield value;
}
value is not even nullable
🤫 just an example
is this just sugar for a filter
hey are there some docs or relevant info about plugin development? /getting started?
theres the source code and reading other plugins
thats what taught me most about this
figured since i couldnt find anything just thought i might as well ask
I mean last I checked I didnt really find any extensive documentation on this
thats low key kinda cool
yo is anyone elses new "stable" flutter version flashing black on the screen every 0.7 seconds?
ive had to downgrade back to 3.29.3
I might just sit on this version until some new "magical" exploit that spesifically targets old flutter versions comes out then
@valid jetty these would be builtins
but this isnt really maintainable imo
if theres more than 1 arg it gets annoying to write
make a macro for it
thats my goal
but last time i tried i miserably failed
i need to watch some kinda macro tutorial
btw you can make the a def cleaner
arg.ok_or right
let Value::Integer(a) = arg else {
return err!();
}
lmao
also i think rust should be able to infer the types of arg2 and loc2 because its being assigned directly to the function field
but dont quote me on that
yes
@hoary sluice what do you use for mic, speakers for the rpi?
a usb headset for testing and a usb mic and aux headset (or vice versa i dont remember) for prod
which usb mic
some random one from amazon
im trying to make https://wiki.seeedstudio.com/respeaker_2_mics_pi_hat_raspberry_v2/ this shit working
but of course it doesnt work
ik raspi is garbage to work with
i wrote the software perfectly fine and then took a long time to get the raspi set up
and i had no hardware besides a usb headset
@hoary sluice
yea
i hate it
so much
AAAAAAAAAAAAAAAAAA
well this woulda been useful about 2 years ago
Oh yes I love how it dont tell me how to get one of these native.ts files
touch native.ts, same as any other file
it says
files you can create
so you have to make it yourself
stop spreading misinformation 😡
'touch' is not recognized as an internal or external command, operable program or batch file.
Yeah but like on sensible OSes I mean
just open a text editor and save to that file location then
is there no boilerplate surrounding it where I have to like tell the browser i have a native file?
its just based on the name i think
well what else would I expect from javascript i guess
yeah like this thing:
const Native = VencordNative.pluginHelpers.RandomGary as PluginNative<typeof import("./native")>;
do I not need to do this?
ooh great so I just do this but replace RandomGary with the plugin name and everything should in theory work
import definePlugin, { PluginNative } from "@utils/types";
const Native = VencordNative.pluginHelpers.${pluginName} as PluginNative<typeof import("./native")>;
Native.method()
something like that I think
eh ill try it later
Well the browser won't give a fuck about natives
Only electron does
and why does electron care?
Because electron's literal purpose is frankensteining browser and native
augh I wish we could like not-sandbox
You won't wish that anymore after your first 0day
lmao no way 😭😭😭
@valid jetty 135 xp from 1 lesson
Well are you?
Nop, I'm a supercomputer, it's time to finally just admit it.
@hoary sluice @deep mulch
it wont play
i don’t think you want it to play
wrong
every language ever calls it film
are you just not seeing the video or like
How did you get 135 xp
What's your name on Duolingo
meh its not that creative
theres triple xp boosts now
eagelyxd
i sent you request
yay
i spent a solid 10 minutes trying to figure out why it couldnt resolve the identifier
turns out i named the function println cause i thought i was smart
and then proceeded to call print in the icy code
theres only o
no i
but now i have more or less of a week of free time
so maybe i soon
oo
also
print "hi"
``` evaluates to "hi"
so its like dbg in rust?
so u can do
print 2 + 3
and itll print 2 and evaluate to 5
again its println not print
i forgot again
that is so ambigious lmao
dbg does that???
how
its parsed as Binary(+, Call(print, 2), 3)
yes lol you can do let x = dbg!(funcall()) and the result of x is the result of funcall()
function application has the highest precedence
oh i didnt know that
if you pass more args the result is a tuple of the args you passed in
cursed tuple factory
so println 2 + 3 isnt ambiguous at all

i wouldve expected it to print 5

are you trying to gaslight me or are you trying to gaslight yourself that its better this way
its how haskell does it lol
husk
and it makes more sense
print 2 + 3 isnt valid in haskell cause print doesnt return (or like world monad stuff) but f x + y is (f x) + y
not exactly because you cant even do that in haskell
i mean this is probably real because i got an sms from them when signing up but also i dont have any money in my bitpanda
you can if print is id
id 2 + 3 evaluates to 5
you cant print 2 + 3 tho lol
yea like i said, print returns the world monad
you can do this i guess
main :: IO ()
main = putStr $ show (2 + 3)
hm
thats a solved problem 😭 you return a new state of the World
returning world monad is a stupid workaround based on technicalities
lmao
id rather rosie tell me icy isnt purely functional than make it bad

day 542 of telling you you couldve just made it procedural and all your problems dissapear
but tbf procedural is slower to write
my problems are quickly fading away
and i already made a procedural interpreter
be it not very featureful
purely functional compiler soon
now i just need input, macros for io, make it compiled (
) and i can rewrite icy in icy
(even i dont know how i would approach that)
compile to haskell
aka print(open(0).read())
yes but not the same as in haskell
its the . in lambdas
soon itll get usable enough to where i have to make a readme and docs and an lsp and all that stuff 
is the end goal here to have a situation like vlang
for vlang the primary compilation target is C
whats vlang
enough for me to be able to solve every aoc day without having to add extra features during aoc
I played around with it before
i said end goal
idk if i wanna compile
Elle will compile to JS
but compilers so fun :(((
@valid jetty make Elle compile to Java
im starting uni in september so there might be some other stuff ill be doing
@hoary sluice I thought you were already in uni
i am technically
i finished school in april, doing matura exams now (final exams at the end of high school standardized in europe) and im accepted to the uni, in their cis system, and paid a deposit
and im starting in 3rd semester
so im technically in the 2nd semester rn
tho not actually doing any studying
insanity
js always longer than elle
compile elle to wasm
does qbe target wasm
prob not right
switch to llvm
qbe is limited
rewrite elle in elle on llvm
i dont want my compilation times to quadruple thank you
the earlier you start the better
make your own compiler backend in elle
youre literally using rust and your compilation times are extremely fast why do u care
no i meant
compiling the llvm ir to assembly
do you know how slow it is
your compilation times are already extremely fast so quadrupling them wont hurt
and youre using rust and complaining abt compile times
this guy is making a compiled functional language to then make an OS in
I wanna do that
rust isnt related here, the part im talking about is not elle itself but is the process of translating IR to assembly
qbe is very fast, llvm is not so much
make Elle faster than C@valid jetty
if its 4x slower itll still be fast
but your desensitized to slow compile times due to your rust
statically linking everything and duplicating every dependency is extremely based
i mean not as fast anymore lol, since i added all that monomorphization and extra passes and stuff
kind of
@deep mulch can i shake your tree
this wont go down well, itll probably be kinda slow
yea
i think the best way to go is genuinely to make a C compilation target
C can compile to almost anything
@young flicker
can it compile to Elle
guhh just make Elle support npm modules
girl im sorry to scare you
???
but i think its defined
why
@valid jetty write elle using only rust macros
easiest way to compile to rust
literally built into rust
@deep mulch 100 gorillas vs the sun?
write elle in elle @valid jetty
@deep mulch 100 humans vs 1 human?
who would win
@deep mulch 1 rosie vs 1 zooter?
@hoary sluice i found another edge case to the monomorphization system earlier
why have you been working on monomormonism for the last 6 years
use std/prelude;
struct Foo<T> {
Option<fn(T) -> T> cb
}
fn main() {
Foo<i32> foo = Foo {
cb = Option::Some(fn(x) x * 2)
};
x := foo.cb.unwrap();
$dbg(x(34));
}
``` when the callback is wrapped in another function call
during monomorphization, `Option::Some()` accepts a T, not a function type
even though it can be inferred that `x` is `i32` because `cb` accepts a `Option<T>` where T is a function, the compiler doesnt know that when monomorphizing the function call to Option::Some and as such cant infer the type of `x`
ITS HELL
there are so many edge cases
its going through like 3 steps of monomorphization here
im glad i wont have to mormonize
why any time i search for anything related to compilers, the first result is almost always from a rust / book / forum / other rust-related source
is rust really just used to make compilers and memecoins
Foo<T>linksTtofn(T) -> TFoo<i32>means thatcb's type isOption<fn(i32) -> i32>- that type is passed to use in
Option::Someto infer T (from the return type,Option<T>vsOption<fn(i32) -> i32>) - when deducing a type from
fn(x) x * 2, we dont yet know whatT(from Option::Some<T>) is, soxcant be inferred - i need to do like 4 passes for codegen to properly monomorphize this
- suffering.
its a super fun exercise (i say, with tears rolling down my face)
i could take the lazy way out
and make it so that, if the arg is exactly T and we know T then use a different param ty to monomorphize the lambda with
but that breaks when it becomes
fn foo<T>(Bar<T> x) -> Foo<T>
struct A<T> {
Foo<fn(i32) -> i32> cb;
}
fn main() {
A<i32> a = A {
cb = foo(bar(fn(x) x * 2))
};
}
because its Bar<T> x not T x
omg wait
i dont understand any of this
ignore the logic just know that this is to infer the types of args in lambdas where youre comparing an unknown type to a lambda
im glad i dont care about speed
you used python and beat me
aoc is about writing a good algo not having a fast language
to get on global lb you have to beat the bruteforcers
if you just try bruteforcing you wont win cause thats easy and a lot of ppl do it so theres a lot of competition
well python is also incredibly slow for no reason
i mean from what ive heard its actually way faster these days than it used to be
but still doesnt compare to a compiled language
well ofc
how are ur errors so awesome
spaghetti code
the key to a good error display is spaghetti code
almost as good as rust
Delicious spaghetti makes the error gremlins happy
when are u gonna refactor elle
rewrite it in elle
RIIE
ok i figured out whats actually happening
to make the inference in lambdas work, i deduce generics from the return type before function arguments
which means it learns T = Result<T, E> but doesnt know anything else yet
then it compiles the Result::Ok(...) and learns that T = Result<...> but it already learnt that T = Result<T, E>
idk if i should allow arbitrary conversions from generic to non-generic structs
i have an ideaaaaa
why not
whats zed dbg
the new zed debugger
isnt that ai powered or something
no its codelldb in a fancy panel
and theres ai agents too
its invite only beta but they invite everyone but u have to wait
the fact that it is able to infer EVERYTHING here is kinda insane
oh i remember that email
i already got my invite
nvm
its not an invite
its just the launch post
rosie my job suddenly decided to require windows with no admin and supervision
qemu with gpu passthrough
u cant install apps
what i did is, i still infer the return type generics but now i dont just directly populate known_generics with them
only through baramudi
i keep them seperate until after args are deduced, then i add them if there are still unknown generics
wtf is baramudi
exactly
nah its some kinda enterprise confidentiality management software

😭
whats a neat way to format this 😭
server, port := TcpServer::bind_until(
8080,
fn(server) server.is_ok_or(fn(err) err != Errno::EADDRINUSE),
Option::Some(fn(port) { *port += 1; })
).expect("Failed to bind server");
maybe don't introduce bind_until and just let user do it manually?
true
ehhh thats not that bad
server := TcpServer::bind(port := 8080);
while server.is_err_and(fn(err) err == Errno::EADDRINUSE) {
server = TcpServer::bind(port += 1);
}
clean overall i think
use std/prelude;
use std/net/tcp;
const BUF_SIZE = 1024;
fn main() {
server := TcpServer::bind(port := 8080);
while server.is_err_and(fn(err) err == Errno::EADDRINUSE) {
server = TcpServer::bind(port += 1);
}
server := server.unwrap();
defer server.close().unwrap();
$printf("Server is listening on port {}", port);
buf := Array::bytes(BUF_SIZE);
connection := server.accept().unwrap();
defer connection.close().unwrap();
while (_, received := connection.read(buf)) && received != 0 {
$printf("Received {} bytes: {}", received, buf.join("").replace("\n", ""));
connection.write(buf).expect("Failed to send response");
}
}
@hoary sluice is this a clean api
use std/collections/array;
global pub;
pub struct Foo {
i32 x,
string y,
f64 z,
}
fn Foo::to_bytes(Foo self) -> u8[] {
res := [];
res.extend([self.x].to_bytes());
res.extend([self.y.len()].to_bytes());
res.extend(Array::from_string(self.y).to_bytes());
res.extend([self.z].to_bytes());
return res;
}
fn Foo::from_bytes(u8[] res) {
self := #alloc(Foo);
offset := 0;
self.x = res.read<i32>(&offset);
len := res.read<u64>(&offset);
self.y = res.slice(offset, offset += len).to_repr<char>().join("");
self.z = res.read<f64>(&offset);
return *self;
}
so you can go back and forth
foo := Foo { x = 39, y = "Hello from the server", z = 4.2 };
$printf("Sending {}", foo);
connection.write(foo.to_bytes()).unwrap();
buf := Array::bytes(BUF_SIZE);
client.read(buf).unwrap();
foo := Foo::from_bytes(buf);
$printf("Received {}", foo);
@hoary sluice 😭
this is horrid
What a combo
Remove npm and its good
elle install is_even
@valid jetty if you ever need ideas for Elle just ask me 
But what if she needs good ideas
I have all goodideas
@valid jetty tsoding v2 https://www.youtube.com/live/MUDz4_HkgeA?si=AdbpjW2TiwJvkWgK
Which language humbleOS will ultimately be written in (after I learn enough assembly to make a bootloader) has been a topic of frequent discussion. After muc...
then she can ask me
rewriting elle in elle is a good idea
@valid jetty his nvim setup looks too good im gonna keep working on my rice today
minklang
interesting
how
# add :: fun (~x: Int, to y: Int) -> Int: x + y
# main :: fun () -> Int: {
# x :: 4
# y :: add(x, to: 3)
# y
# }
x :: {}
interesting syntax
oh my god he’s writing a borrow checker
2 names for args
one for the function body one for the caller
yea i know there’s quite a few languages that do this
namely swift and objc
there are definitely more
@hoary sluice
i genuinely cannot tell whether this is real or ai
like
@valid jetty is an ai
AI cannot tell AI from real
weird
page doesn't work through cloudflare
404 for one of the required files
but the conversation is so lifeless
and the knives are magnetic to the wall???
The WMF Magnetic Knife Rack delivers the best of both worlds—a convenient, space-saving storage system that proudly displays your kitchen knives while ensuring all your essential tools are always close at hand. This chic magnetic knife strip open storage system offers the modern convenience of magnetic mounting, delivering the perfect mix of i...
ai convos arent lifeless
theres a magnetic bar lol
Is that nohtyP
@hoary sluice thunks come for free
use std/prelude;
namespace Cat;
fn Cat::speak(Cat *self) {
$println("*mew*");
}
namespace Dog;
fn Dog::speak(Dog *self) {
$println("*wof*");
}
struct AnythingSpeak @nofmt {
void *data,
fn(void *) speak_thunk
}
fn AnythingSpeak::new<T>(T *t) {
return AnythingSpeak {
data = #cast(void *, t),
speak_thunk = fn(data) #cast(T *, data).speak()
};
}
fn AnythingSpeak::speak(AnythingSpeak self) {
cb := self.speak_thunk;
cb(self.data);
}
fn main() {
a := AnythingSpeak::new(&Cat {});
a.speak();
a = AnythingSpeak::new(&Dog {});
a.speak();
}
how are these thunks
There's a billion definitions of thunk, I'm sure it's one of them
my understanding of thunk is its a wrapper for a value that tells the interpreter not to evaluate that value until its used
that is a different kind of thunk
thunks in compiled languages are type-erased values
things like &dyn Speak in rust
or a virtual method in C++
oh
this is horror to read and write tho
well yeah obviously
its free but it also looks free
wellll


