#🪅-progaming
1 messages · Page 101 of 1
it works just like you can define an empty vec without a type annotation and then push some T into it and the vec is inferred to be T
rust doesn’t know what type the integer is when you first define it, it infers it later from context
well if rust can’t determine what type it is, it will usually guess i32, however like 九八 said, if you’re passing it to a trait object you need to specify because rust might guess wrong and break stuff
IMO types should only be infered from the initial declaration of a variable
that would be kinda annoying tho
imagine having to explicitly define the type in .into::<T> or .collect::<T>, just to pass the variable to a function that expects this type anyway
(since the type of the variable can't be inferred on its own, unless there is only a single trait that accepts this specific T)
honestly typescript should add rust's type inference 
horror
i find it weird for a language all about safety to have advanced inference like this where IMO being explicit wouldn't hurt as well as macros
i doubt rust's implementations of either reduce safety in practice, but I think they can hurt readability
it feels weird because a lot of stuff is more verbose so it feels like it mainly serves to balance this issue xD
rust is a very verbose language, having heavy inference helps combat that
like for example elle’s inference isn’t as good but it’s a managed language so the verbosity isn’t as much there
there’s a balance
I have never seen any evicence for the claim that rust us verbose
You need to stop having your eyes closed when it's presented to you in that case
how i can easy edit discord color pallete?
early (before discord theme update) i can edit "hsl" values to these result
But in new versions it not working
--theme-h: 0;
--theme-s: 0%;
--theme-l: 19%;
I`m tried edit this values but it dont work too..
JavaScript really is the most advanced programming language
how does it work 
https://jsdate.wtf/ its pretty insane
yuh i got 9/28
only cares about the september 11 part
works in chrome

i guess firefox handles date parsing PROPERLY
i mean
i think there is another much better solution here that you can use if you clear your mind of the whole needing to have everything be a giant "array" of any type thing
(like structs.... crazy concept i know!)
tbh as a javascript developer idk i only know objects they seem similar tho idk
this is why new projects always have a million deps
firefox handles it differently
what doesnt firefox handle differently
i dont get why people say C is so fast. when i use ffmpeg to convert a video from 4k to 1080p it takes minutes, but when i click the button on youtube, javascript converts it in less than a second?
😭
😭
Why do you need a whole ass library for a conditional
why do you even need a conditional when round()
dude so fucking true
this is why you use julia because it ships all the numpy bloat you need in the stdlib
yeah let me just have a 5000 bit long integer
least insane permission system

🥰
just use a language that has packed structs and variable lengths integers
and have a packed struct with u1 fields, way easier to work with
625 bytes 
is there a js lib for packed structs
import v8 from 'v8'
const binary = v8.serialize(object)
what if there was like a bigint backed proxy
gaming
const myStruct = packedStruct({
hp: 5,
alive: 1,
});
console.log(myStruct.hp); // 0
console.log(myStruct.alive); // false
myStruct.alive = true;
console.log(myStruct.bits().toString(2)); // 100000
/run
function packedStruct(def) {
let bits = 0n;
const result = {
getBits() {
return bits;
}
};
let offset = 0n;
for (const [key, size] of Object.entries(def)) {
const mask = BigInt(parseInt("1".repeat(size), 2)) << offset;
const thisOffset = offset;
Object.defineProperty(result, key, {
enumerable: true,
get() {
const masked = (bits & mask) >> thisOffset;
if (size === 1)
return masked !== 0;
else
return masked;
},
set(value) {
value = BigInt(value);
value <<= thisOffset;
value &= mask;
bits |= value;
}
});
offset += BigInt(size);
}
return result;
}
const myStruct = packedStruct({
hp: 5,
alive: 1,
});
console.log("HP: " + myStruct.hp);
console.log("Alive: " + myStruct.alive);
myStruct.alive = true;
console.log("Alive after update: " + myStruct.alive);
console.log("Raw bits: " + myStruct.getBits().toString(2));
Here is your js(18.15.0) output @winged mantle
HP: 0
Alive: true
Alive after update: true
Raw bits: 100000
this has no perf benefits a real packed struct has btw
if anything its worse
yeah but it's funny
/run
const v8 = require('v8')
class Packeted {
constructor(bits) {
if (bits) {
for (const [key, value] of Object.entries(v8.deserialize(bits))) {
this[key] = value
}
}
}
get bits () {
return v8.serialize(this)
}
}
const x = new Packeted()
x.test = 12
console.log(x.bits)
console.log(new Packeted(x.bits))
Here is your js(18.15.0) output @supple whale
<Buffer ff 0f 6f 22 04 74 65 73 74 49 18 7b 01>
Packeted { test: 12 }
eh
..why
IT WORKS
/run
function packedStruct(e){let t=0n,r={getBits:()=>t},n=0n;for(let[l,u]of Object.entries(e)){let f=BigInt(parseInt("1".repeat(u),2))<<n,i=n;Object.defineProperty(r,l,{enumerable:!0,get(){let e=(t&f)>>i;return 1===u?0!==e:e},set(e){e=BigInt(e),e<<=i,e&=f,t|=e}}),n+=BigInt(u)}return r}
const myStruct = packedStruct({
hp: 5,
alive: 1,
});
console.log("HP: " + myStruct.hp);
console.log("Alive: " + myStruct.alive);
myStruct.alive = true;
myStruct.hp = 7;
console.log("HP after update: " + myStruct.hp);
console.log("Raw bits: " + myStruct.getBits().toString(2));
Here is your js(18.15.0) output @winged mantle
HP: 0
Alive: true
HP after update: 7
Raw bits: 100111
i hate writing code in discord
bu hey it works
wdym
and likely will be the fastest solution you'll be able to ever produce
enough to store hp
no packed struct has 5 bit fields unless theyre other structs
you're wrong assuming this in the first place
???? how much hp are you storing
maybe we're storing boss hp
why would i want an upper limit of 31 hp
ur trolling her too much 😭
i just realised this is wrong
oh wait no it's right
for a mo i thought 1 + 2 + 4 (and therefore 0b111) was eight
video game addict
sir just v8 serialize and deserialize
megaboss has 31 hp
its so so so much safer and faster
but you don't get to specify bit width
lameee
i will publish this to npm
what if format changes in versions
hmm maybe i could support parsing a c struct
true
id say this is the least useful npm package but i forgot stuff like is-even exists
are you suggesting not using javascript?
js devs are sooo insane
why not, its just binary data you'd send over network
^
hasnt changed in a decade
wont change now
anyays if ur dependencies do : "nodejs": "*"
const myStruct = cValue(`
#include <stdbool.h>
struct MyStruct {
unsigned int hp: 5;
bool alive : 1;
}
export MyStruct struct;
`)
then u have a different problem
this is a superset of c that has thee export keyword
the export keyword is used to export the value which is translated into js land
have you seen my type-safe enums
it might be useful
it's a more simple implementation
it's only implements this syntax
for anything more complex, it just uses ai to translate to js on the fly which is less reliable but allows anything
but it's only intended to be used with this syntax
type EnumToObject<Keys extends string[], Acc extends string[] = []> =
Keys extends [infer First extends string, ...infer Rest extends string[]]
? { [K in First]: Acc["length"] } & EnumToObject<Rest, [...Acc, First]>
: {};
type Split<T extends string, D extends string, Acc extends string[] = []> =
Trim<T> extends `${infer First}${D}${infer Rest}`
? Split<Trim<Rest>, D, [...Acc, Trim<First>]>
: [...Acc, Trim<T>]
type Whitespace = " " | "\n" | "\t";
type Trim<T extends string> =
T extends `${Whitespace}${infer R}`
? Trim<R>
: T extends `${infer R}${Whitespace}` ? Trim<R> : T;
function enu_m<T extends string>(x: T) {
return x.split('\n').filter(Boolean).reduce(
(acc, cur, i) => ({ ...acc, [cur.trim()]: i }),
{} as EnumToObject<Split<T, '\n'>>
);
}
const x = enu_m(`
First
Second
Third
Fourth
Fifth
`);
// x.Fourth: 3
console.log(x.Fourth); // 3
``` look !!!!!!!!!
just add an error handler that asks the ai to fix it
type safety
if it doesn't error its working perfectly
what why would you use this it's useless
you're a garbage programmer
it is useless
you made me lose faith in humanity
i wrote it because vee dared me to
ok but on a real note, C structs are not packed lol
the fields are all aligned to the highest aligned field
OK this is out of my depth with typescript
ermmm struct __attribute__((packed))
so if you have a u64 in the struct everything else will be aligned to fit within a multiple of u64
what if you made a javascript to typescript transpiler
ok but 99% of structs arent
not like automatically fixing types
its pretty simple
but we're making packed structs specifically
the typescript type system is a functional programming language
converting the js function code into typescript types
and its turing complete, you can have loops through recursion and conditions via extends :)
function helloWorld() {
console.log("hello world");
}
would get transpiled to
import { Console } from "tcts";
type HelloWorld = Console.Log<"hello world">;
😭
and HelloWorld would compute to the string type "hello world"
wait that would be kinda dumb to simulate the console
instead just do return "hello world";
Console.Log returns an Environment type which has a stdout field
what if npm library to use go inside of js
const fmt = {
Println: console.log
}
that sorta thing
or is that just called deno
deenuts
true
look typescript is easy
fuck i didnt show the hover
in haskell
rosieRange :: Int -> [Int]
rosieRange n = f 0 []
where
f :: Int -> [Int] -> [Int]
f accLen acc
| accLen == n = acc
| otherwise = f (accLen + 1) (acc ++ [accLen])
main :: IO ()
main = do
let foo = rosieRange 10
print foo
its very similar
in a procedural language
well i got carried away with making the array concatenation inline but you get the point
or rather the more efficient way is ```rs
acc.iter().single().chain(Iterator::once(acc.len())).collect()
actually
you can make it look like ts
can we make this even worse
literally nothing worked 
thank you zed
i hate that the extensions in zed use github
cuz my shit is always ratelimited
don't use zed use micro
❌
me when i have a protocol header that takes 3 bits for a tag and 5 bits for version
true
What flavor
pcre2 was my goal although i didn't choose a specific flavour mostly because i was writing it in mainly asm 😭
I wanted to parse regex as fast as possible
i thought the idea of a kernelmode regex parser would be silly so i started with that and then I eventually just ended up writing a tiny os for it
Doesn't pcre2 have an insane amount of features
yes and it was a lot easier to implement stuff when i was doing it in c because im kinda used to it + their lib has a lot of stuff i could steal from
so it's why i just decided not todo a specific flavour and just decided to implement regex in a way that's very basic, just so it'd work while i was writing it in asm
this looks like fun
i love pcre because i can do things like this horror for cannonicalizing regex for vencord patches
I didn't want to manually update mc server constantly for my friends so i'm now writing a whole minecraft server launcher that automatically downloads the latest version

and instead of using shell script i used go
because i don't like shell scripting
and i feel like it will end up being high quality code because i cannot bare hacking things together any more like i used to
when i hacked things together it would just be so horrible adding features to it
screw it, i'm making this properly modular
splitting into packages
love
you aren't using fabric and/or mods?
no it's just a vanilla server
huh
i'm already refactoring
it's just something to keep our vanilla smp up to date
tbf i might want to add a discord bridge
based on reading stdout
don't think there's an existing bridge solution like that (which will not break between updates!!)
it's cool i made smth similar a while back & you're able to use /say in-game & stuff so it's 2way
i forgot stuff like echo, cd, etc. are implemented by the shell not by the system and in my state of being tired i tried to debug why "echo test" in my shell would fail to run the command
if only this actually worked
probably doable somehow with some native hooks
assuming the webview is run in the same process
and that would only work if the webview is chromium anyways
aren't most of of those implemented by both
the shell built-in just shadows
ok I dont get it. nothing is throwing errors in lsp or building, ive literally copy pasted the const Native line from a plugin which works, so why does it refuse to work?
its in native.ts
i have tesseract working in a vencord plugin
checkout https://github.com/sadan4/antitessie
the let worker line was cuz I couldnt find the return type of the worker
???
i mean u were partly right to be fair
but check this out as an example for tesseract in vencord
its been a long while since ive touched any typescript
jesus christ holdon lemme fix my resolution to read this
tldr
if (!window?.Tesseract) {
fetch(
"https://cdn.jsdelivr.net/npm/tesseract.js@6.0.0/dist/tesseract.min.js"
)
.then(async r => void (0, eval)(await r.text()))
.then(async () => {
worker = await Tesseract.createWorker("eng", Tesseract.OEM.TESSERACT_LSTM_COMBINED, {
corePath: "https://cdn.jsdelivr.net/npm/tesseract.js-core@6.0.0/tesseract-core-simd-lstm.wasm.js",
workerPath: "https://cdn.jsdelivr.net/npm/tesseract.js@6.0.0/dist/worker.min.js",
});
})
.then(() => {
worker.setParameters({
tessedit_pageseg_mode: Tesseract.PSM.AUTO
});
});
}
cuz ive added it pnpm add tesseract.js. I saw on the github it was on npm and I thought to myself it must then be on pnpm
So the solution is to handle this in the index.tsx instead of the native.ts?
I was importing the dependency...
if pnpm were actually a npm fork, it would be MUCH slower
nop
nah it's not I checked
giga sad
@valid jetty im prob gonna go to a different uni
and do technical math instead of ict
How would the system implement cd, the program itself keeps track of its working directory and the shell just passes that on when you run a command
command is also implemented by the shell
Part of zshbuiltins
I wouldn’t be surprised if command treats real commands and builtins very similarly
Just swapping how they are ran at execution
I love androidTV
no fuck android tv
this shit is laggy as fuck
i cant use my tv its so fucking slow
finna get an apple tv
See where I said most
Which ones do you mean then 😭
😭 the whole point of command is going over your head
cd?????
well yeah, but its not androidTV's fault
its the TV manufacturers
they release TVs with 2 cores and 2GB of RAM
so kinda what do you expect
get an urgos
or a shield
and you'll see what it means to have a good androidTV
most shitty androidTVs built into the TVs themselves run in 32 bit
https://docs.google.com/spreadsheets/d/15Wf_jy5WqOPShczFKQB28cCetBgAGcnA0mNOG-ePwDc/edit?gid=0#gid=0
good list of "what android TV devices arent shit"
the ugoos is laughably cheap
especially for its hardware capabilities
i have a gen2 chromecast, which is laughably slow, and it outperforms my TCL x10
apple tv seems good enough
1/2 the capabilities at x3 the price of the ugoos
;-;
and it’s only like $120 or so
it starts at $200 with the ethernet version costing $260
mmm, europe prices
lmao ugos is more expensive in us than here
ah right tarifs
its china made
anyways, androidTV is great, cuz u can pirate on it
sideloading apps or patching apps to remove ads or paid features is peak
or shit, even just building ur own via cast recievers
i just tried to install spotify on it from play market but i never figured out how to change region
on app store it was as simple as just changing it in the settings
but with android i have nfi how
i tried a vpn
tried changing account
but nothing worked
i just want to install spotify and like crunchyroll 
lmao are they banned in ur country on play store?
yes
LOL WTF
do yk a way tho
shit, you dont even need to get off ur ass from ur pc to do it
if its banned its banned, and if you couldnt figure out how to get a vpn running then this is probs ur best bet?
cuz im too paranoid to trust a random apk from the internet
well its not really banned
they are signed
its just spotify left this country and they removed their app from russian app stores
but it does work fine without a vpn
(kinda)
yeah so see that's why i dont like android tv
on apple tv i would just install it off app store
then you can even do adb connect 192.168.1.yourTVaddress, and adb install -r ./path/to/apk/on/your/pc.apk
or copy the apk to the tv and install it on there directly
shit, you can even control ur androidTV remotely from ur PC
because why not XD
i believe in octodecimal supremacy

its 512
@spark tiger how to translate dolboeb to english
im a dolboeb
its 64
idk maybe “dumbass”
no???
i just said im a dolboeb
@hoary sluice i love typst
i love programming my pdf
#page(
align(center + horizon)[
#align(center, text(2.25em)[*#title*])
#align(center, text(1.25em, description))
#v(4em)
#align(center)[
#text(1.25em)[Rosie Mewmewmew] \
Catgirl Academy Germany
]
#v(4em)
= Abstract
#align(center, block(width: 80%,
align(left, par(justify: true)[
This project presents the design and implementation of a compiled programming language featuring exclusively Japanese syntax, intended to improve accessibility for native Japanese speakers with potentially limited English proficiency. Traditional programming languages often rely heavily on English-based keywords and constructs, creating barriers for non-English speakers. By replacing these with natural Japanese equivalents, this language seeks to make programming more approachable and intuitive for native Japanese speakers. The goal is to produce a compiler frontend capable of compiling basic functions and control flow structures utilizing Japanese syntax for the source code.
])
))
]
)
i can even embed all of my source code straight into typst
its kinda silly
i wrote a script to do this
#!/usr/bin/env -S ellec --silent --run
use std/prelude;
namespace DIR;
enum DirentType @repr(u8) {
Dir = 0b00000100,
Reg = 0b00001000,
}
struct Dirent {
u64 ino,
u64 seekoff,
u16 reclen,
u16 namlen,
DirentType type,
char name // opaque static array
}
external fn opendir(string path) -> DIR *;
external fn readdir(DIR *dir) -> Dirent *;
external fn closedir(DIR *dir);
fn collect_files(string path, string[] out) {
dir := opendir(path) ?: $die();
defer closedir(dir);
while dirent := readdir(dir) {
if [".", ".."].contains(&dirent.name) { continue; }
out_path := "{}/{}".format(path, &dirent.name);
if dirent.type == DirentType::Dir {
collect_files(out_path, out);
} else if dirent.type == DirentType::Reg {
out.push(out_path);
}
}
}
fn main() {
path := "src";
$printf("Generated files at {}...", path.color("green").reset());
collect_files(path, files := [string;]);
io::write_to_file("docs/srcs.txt", files.join("\n"));
$printf(
"Generated {} files at {}!",
"{}".format(files.len()).color("green").reset(),
path.color("green").reset()
);
path := "docs/main.typ";
$printf("Compiling typst at {}...", path.color("green").reset());
libc::system("typst c {} --root ..".format(path));
$printf("Compiled typst document!");
}
and then in typst
#let embed_code(path, lang) = {
let data = read(path);
[
=== File: #" " #raw(path.split("/").last())
#raw(data, lang: lang, block: true)
]
}
its kinda awesome actually
am i the only one where discord development try to do this request with TLS1.0 and fail with anything higher
it's been quite a while i didn't launch it because it didn't work and so i quickly investigated by using mitmproxy and proxying discord to it
how secure is your network
What's better dbeaver or pgadmin
psql
@young flicker honestly not sure what to do with the ux/ui with clipper
I have 2 variations but if I add too many customization options its just gonna burn me out
or what if I wanted to do that notification center design
its just more redundent code
idk what to do really
not knowing is driving my demotivation

it's secure
what's weird is that it's only that first request
and that canary doesn't have that issue
and vesktop?
and that if i do the request using firefox or curl TLS1.2 works
didn't try
but since stable, PTB work normally, i'd expect it to work
i'm more surprised by the difference between canary and dev
i may abandon the panel idea
because for the most part they are basically the same
update to sonoma and itll automatically do it
I don’t think it’s anything special
Looking at clipper code there’s nothing in significance
im playing with this app idea, but it requires to run arbitrary js from the user, is using web workers a good enough isolation?
uhh
use an iframe
and set srcdoc
hm thats sorta awkward to communicate with though
the intro sounds chatgpt
husk
I have used only pgadmin in past, adding new users is somewhat annoying, cannot say anything about dbeaver
how about this
also look at this diagram made in typst
#align(center)[
#let args = (inset: 1em, corner-radius: 0.25em);
#diagram(
node-stroke: .1em,
spacing: 4em,
node((0, 0), "Source Code", ..args, name: <src>),
edge(label: "Lexer", "-|>"),
node((1, 0), "Token Stream", ..args, name: <tokens>),
edge(label: "Parser", "-|>"),
node((2, 0), "Abstract Syntax Tree", ..args, name: <ast>),
edge(label: "IR Generation", "-|>"),
node((2, 1), "Intermediate Representation", ..args, extrude: (-2.5, 0), name: <ir>),
edge(label: "Optimization", "-|>"),
node((2, 2), "Optimized IR", ..args, name: <opt>),
edge(label: "Codegen", "-|>"),
node((1, 2), "Assembly", ..args, name: <asm>),
edge(label: "Assembler", "-|>"),
node((0, 2), "Object", ..args, name: <obj>),
edge(label: "Linker", "-|>",),
node((0, 1), "Executable", ..args, extrude: (-2.5, 0), name: <exe>),
node(
enclose: (<src>, <tokens>, <ast>, <ir>),
corner-radius: 0.25em,
name: <frontend>,
shape: shapes.bracket.with(dir: top, label: [Frontend])
),
node(
enclose: (<opt>, <asm>),
corner-radius: 0.25em,
name: <backend>,
shape: shapes.bracket.with(dir: bottom, label: [Backend])
),
)
]
still chatgpt
Do you have a source that english keywords affect learning speed? I'd be more inclined to believe that's caused by english docs
well it’s pretty hard to get into when the entire source code is in english
i’ll look for a source
you’re chatgpt
no she doesnt
the reasoning is a lie
she wanted to make a japanese lang cause shes addicted to anime and thinks japan is perfect
not to "help japanese people who dont speak english"
what softward are u gonna build with just ichigo and no english
i literally dont watch anime
the real reason i made the lang is because i thought it would be funny
but i need an actual reason to put on the document for school
how would i write it without it sounding like ai
This project presents the design and implementation of a compiled programming language with exclusively Japanese syntax, which is designed to improve accessibility for native Japanese speakers who have potentially limited English proficiency. Traditional programming languages rely heavily on English-based keywords and constructs, which creates a steep learning curve for non-English speakers. This language aims to replace these with their Japanese equivalents, which would make programming more enjoyable and intuitive for native Japanese speakers. The goal is to produce a compiler frontend capable of compiling basic functions and control flow structures utilizing Japanese syntax for the source code.
sorry i wanted to answer a question not order a yappacino
that was my point, the other stuff i made up for dramatic effect
dramatic effect 😭
^^
well are you using ai to write it
no
put it into gptzero
this sounds human
i think
it doesnt matter as long as u wrote it urself
Just be honest and say you did it to evaluate the capabilities of your other compiler, and/or to explore whether taking inspiration from a different language gives any interesting syntax
well no because they want a """"client"""" for the project
i would do that if i could lol
Just be honest and say you did it because you're unemployed
thank you
why is that so verbose
its written in yappanese
its an abstract
My brain is so cooked that anything which isnt prose sounds excessive to me
i want to score full marks on this thing soooo ofc im gonna yap a lot
Roi e
wrong
mraow
unbeliveably funny how students now have to pass their writing through ai detection tools even if they didnt use ai
last quarter i was writing a paper and using wikipedia as my primary source (it didnt rly matter), but then it seems like that style of writing leaked into my own paper
and it was detected as like 80% ai
spent an hour reorganizing and rewriting words until it was down to 5%
well not really
we moved from plagiarism checkers to ai checkers
it’s the same thing but the slopmeter turned up to 100%
yeah but the slopdetector is 100% unreliable now too
that’s fair
yop
i love diagramming
"C is dead. Javascript will replace it." 
C is dead. Rust will replace it.
That already became real
(Says someone who can't figure out borrowing issues for few days)
its okay
sometimes i just turn my brain off and when i run into issues with the borrow checker i just throw shit against the wall to see what sticks
wrong
right
how
tbh i don’t see why rust got big as The memory safe language
when you have swift ykyk
I have previously blogged about the relatively new trend of AI slop in vulnerability reports submitted to curl and how it hurts and exhausts us. This trend does not seem to slow down. On the contrary, it seems that we have recently not only received more AI slop but also more human slop. The latter … Continue reading Death by a thousand slops →
@valid jetty i applied here https://www.fernuni-hagen.de/studium/studienangebot/bachelor-matse.shtml
Bachelor Mathematisch-technische Softwareentwicklung an der FernUni in Hagen als Fernstudium in Vollzeit oder berufsbegleitend ✅ flexibel, digital & anerkannt ✅ Alle Infos auf einen Blick.
literally bachelor in advent of code
and its fully remote except for some exams
and some seminars
Swift still doesn't have inline assembly lol
insane
how would this be resolved with List<List<T>>
external fun <T> List<T>.foo(other: List<T>): Unit
external fun <T> List<T>.foo(other: T): Unit
@nimble bone
NSIMAGEVIEW SUCKS
yes!
but it's how could it suck ykyk
nin0 stupid
yea i realised
peak
rust existed way before swift
lc.@grok is this true
Yes, if "existed" means inception: Rust's development started in 2006 (personal project by Graydon Hoare, Mozilla-backed by 2009), while Swift began in 2010 (by Chris Lattner at Apple). That's four years earlier—not eons, but "way before" in fast-paced tech. Stable releases flipped it: Swift 1.0 (2014) beat Rust 1.0 (2015).
i thought rust was like 2007 💔
istg i read it somewhere it was as old as that
well not 2007 but
this is why
you missed one letter 
fr.......
this embed is kinda fire but I dont like where the pfp is put 💔
update bro
i think this is parody of that previous message

#include <stdlib.h>
struct Node { struct Node* next; int data; };
struct Array { struct Node* root; long long length; };
void Array_init(struct Array* target) {
target->length = 0;
target->root = NULL;
}
void Array_push(struct Array* target, int val) {
struct Node* n = malloc(sizeof(struct Node));
n->data = val; n->next = NULL;
if (!target->root)
target->root = n;
else {
struct Node* p = target->root;
while (p->next)
p = p->next;
p->next = n;
}
target->length++;
}
void Array_free(struct Array* target) {
for (struct Node* p = target->root; target->root; target->root = p) {
p = p->next;
free(target->root);
}
}
int main() {
struct Array arr; Array_init(&arr);
Array_push(&arr, 1);
Array_push(&arr, 2);
Array_push(&arr, 3);
/* ... */
Array_free(&arr);
}
HUSK
wheres my 
💔
rust so bad !!

v := []int{1, 2, 3}
"why do you need built in syntax for such a trivial thing lol"
different languages can have different philosophies and that's ok!!
rust allows the developer to have more syntactic control
println macro is compiler' builtin
no its not, rust is right and go is wrong
c is right and rust is wrong
crust is correct
imagine rust with exact c syntax
you can do that as long as you wrap it in a macro
Imagine c with actual nice syntax
c is actual nice syntax
imagine candy but healthy
wrong ❌
real
void main() {
println("hello");
}
or
fn main() {
println!("hewwo");
}
?
C gets sucked off so much just for being old and used often it’s old design choices suck in current day free yourself from the shackles of internet brownie points and start being real ❤️
i dont know why discord mobile has syntax highlight for rust but not c
c looks nice if you know it (i dont)
C gets sucked off so much just for being old and used often it’s old design choices suck in current day free yourself from the shackles of internet brownie points and start being real ❤️
struct Thing thing; enum Enum e;
I LUV EXPLICTNESS!!!!!
typedef struct { ... } thing_t; is a gimmick invented by c++ users to omit that struct in every decl
i only wish we had turing complete macro system and automatic type resolution for variable types (e.g.
notDeclared = "eeee";
/* in pre-ansi c it means that you declare an int, and this sucks
* i want it to automatically determine the type (e.g. char*)
*/
i know nothing but c
learn lisp
You are a sheep of old programming language we must get you out immediately.
zig is good enough?
We must also get you a job.
or i need to learn elle to count?
no no no no plz no
Zig isn’t good because I have yet to find a single job opening searching for zig devs
In my eyes this makes it not a real language
sure if you're ready to spam allocators everywhere
and i dont
i hate memory safety
learn cpp

already know (basics)
typical corporate ...
dude no way lmfao ??? https://vxtwitter.com/siriusblack9999/status/1945433558341886094
@valid jetty duckduckgo is down i think
works for me
well yeah in this case you can just Vec::from([1, 2, 3]) but the macro does much more than just that
well technically its
let a = [1, 2, 3];
or if you wanna add a type
let a: [i32; 3] = [1, 2, 3];
unless go arrays are dynamic ofc
the macro essentially boxes the static array [1, 2, 3] and then creates a vec from raw parts (from that boxed value)
yea go arrays are mutable and dynamic
or returns Vec::new() if empty
yeah ^
hm?
go arrays are ass
yes please i asked for arr = append(arr, foo)
lc.g go docs array append
Appending to a slice ... It is common to append new elements to a slice, and so Go provides a built-in append function. The documentation of the built-in package ...
i dislike languages which dont have accessible functions on primitives like i LOVE doing stuff like [].len() or 1.to_string() give me more pls
It is common to append new elements to a slice, and so Go provides a built-in append function. The documentation of the built-in package describes append.
func append(s []T, vs ...T) []T
The first parameter s of append is a slice of type T, and the rest are T values to append to the slice.
you can finance it
youll pay me in 20£ installments for 100 months
+1% per year for the amount alreado paid
hmmmm
in exchange ill pay it back in 12 years
part of the reason why i dislike c i dont want like the
MyStruct *s = new_struct();
struct_do_something(s);
struct_do_something_else(s, 2);
struct_bar(s, "abc");
i like the
let s = Struct::new().do_something().do_something_else(2).bar("abc");
im not still talking im just starting
do you not have your bools actually be floats?
oh my god
yeah i like this more too
i dislike c because it doesn’t have much
part of the reason i dont like old plumbing is because theres new plumbing technology that nobody thought of when my original plumbing was installed, and the new plumbing is objectively better and nobody disagrees so i prefer the new plumbing
this is still crazy to me what do you mean game maker language doesnt have bools instead has constants true and false defined as 1.0 and 0.0 and using them in if statements is dangerous because == doesnt reliably work on floating point numbers
im gonna call my floats tiktoks
????
the thing from mathematics
the set of real numbers
instagram reels
reels mentioned!!
i swear eagely is always ragebaiting
i looked into it more apparently gms devs then do if (true > 0.5) ??????????????????????????????????????????
yeah looool
my floats are called https://www.instagram.com/reel/DIMAMmpCqvu/?igsh=MTRtcHpzYXF1ZGJweQ==
there are fixed-size arrays ([n]T) and slices ([]T)
crazy crazy
you can append to slices
it’s still no reason for pirate software to have a huge 1d array for the entire game state
well its not really fixed-size
i would never ragebait
the poor implementation of gm is not a reason to excuse his poor code
yea 😭
there’s no way that thing was serious
i’ve only seen screenshots
it is
it very much is
serialization goes brr
the storyline_game_array thing is real
ok but you can serialize structs
if the structs are made up of integers or structs or whatever, they can be serialized as long as they don’t hold pointers which things in gm wont
as if fast serialization is that much more important than making sure you can actually continue reading the code 2 months later
""""fast serialization"""" as if seralizing structs isnt almost instant too
too much progaming today now im gonna eat ice cream and spread misinformation on the interwebs
even if you can’t serialize structs you can convert the structs to an array when you need to serialize them
and i exactly thought about that
at the VERY least the huge 1d array could have named constants for the values but it doesn’t even have that
vencord has been talking about the same code for 3 days
and ?? can we not make fun of awful code?! !
a 1d array is just an array
wow very cool
true
we start forgetting about yanderedevs code
This feels like it would take more effort to have everything in one array
oh yeah eagely have you ever tried submitting an email patch before
guys i just found out sbrk(3) is just an array of bytes??
pirateslop
i cant believe my memory goes to an array of bytes
i have never submitted a commit to a foss project in any way
i tried to submit an email patch over fediverse, but the maintainer has silently ignored it until i made a proper pr
pirateslop is just being nice to the compiler and giving it less work to do 😊
hop on tinycc
i always use tcc
remind me of every time something is commited into dwl repo
i love
isn’t this like really bad for memory usage
why
slices do have a capacity higher than length usually
it doesnt always change the pointer
how would one apply a js source map
so basically im exploring an app that uses js for some stuff and
and there are .js.map files
how would one like idk apply it
so my js files make sense
is devtools not using the sourcemaps?
can i use it without devtools
like just with my code editor
or is it not how it works
argh
i found an internal build of one app and i'm trying to see what i can do with it 
why the hell do u have sourcemaps but not the actual source code
im not going to abuse it or anything
im just curious if there's any real impact
besides "haha i got all your internal builds"
or is it already bad enough?
i mean yeah it could be bad
im trying to see what they use for build distribution
so i know what endpoints i can use
im trying to see if i can upload a build
cuz if i can this would be really bad
considering you have to redeclare your variable it implies that append returns a slice, and since it returns something it does not modify the slice you pass in
each append call creates a new slice, copies the stuff into it, pushes your new values, then returns it (this is speculation, i’m really hoping they don’t actually do this)
it does modify
then why do you need to reassign the variable
just read docs girl https://pkg.go.dev/builtin#append

what's the problem
needing a builtin for such a simple concept makes it sound like it’s hell to do anything low-level in go
ok but a lot of networking code is also low level code
yeah its a language meant to be replaced and not meant to be used in real operating systems
considering you can’t even access the pointer of a slice that just means go is not useful as a language
ok girl
why would you even use go to begin with
well no
go prides itself for being peak in networking yet i can’t even access a pointer
java isnt useful as a language
ok but java does not pride itself for being peak in networking
js isnt useful as a language there are no pointers
ok whatever 😭 just feels like it’s gonna become a headache the second you try to do anything actually complicated in go
go prides itself for looking simple trying to do complicated stuff while actually doing the complicated stuff in the worst way possible

ive discovered this game where you have to write assembly code to control microprocessors and do different things
and the docs for this imaginary asm lang are a pdf file that ships with the game, its genius
my favourite function
let x = 0.clone().clone().clone().clone();
let _ = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".clone().clone().clone().clone().clone().clone().clone().clone().clone().clone();
let x = Box::new(0).leak().into::<Box<u64>>().leak().into::<Box<u64>>().leak().into::<Box<u64>>().leak().into::<Box<u64>>().leak().into::<Box<u64>>().leak().into::<Box<u64>>()
stop leaking my boxes.
mmmm yummy memory leak
Shenzhen IO is amazing
what if it's a person does rust prevent people from being cloned
personally i would have ethical concerns if that was allowed
no
rust invented cloning people specifically for this
me & copying rust errors? no way!
kinda cool
If you intend to do something low level
package main
// #include <stdlib.h>
import "C"
var memory *C.uintptr
func init() {
memory = C.malloc(C.size_t(9999))
}
unsafe...
javascript doesn't let you though... it's a useless language...
that reminds me that go interop with C is so weird..
its really not
well in the traditional sense of interop at least
why is every C function namespaced under the C namespace
it should be global and allow you to namespace them yourself
you lose out on a lot of namespacing opportunities
because of how go packages work? lol
oh i guess that makes sense
if im ever gonna write Go ill just import C and write C instead of go
useless language..
Because name spaces are useful.
if you dont want the C name space
import . "C"
wait
thats the kind of thing i would do
isnt C a pseudonamespace
depends on what you mean, there is a golang preprocessor that generates golang bindings to whatever c header youre using and then its linked later
idk i found this sorta weird
AWWW
cannot rename import "C"compilerImportCRenamed
the preamble is just a pseudo header file your file is compiled against.
yeah but all of this stuff feels like a superset of go rather than part of go
if you know what i mean
I dont get what you mean
but i dont know how else go would implement it with as much ease as it is now
i forgot you could do that
does anyone use that
Why would you dirty name spaces?
Sadly useless for me cuz I don’t do dependencies 🔥
I wonder why they dont just do full tree shaking
Skill issue
i dont think so
It does (or dead code removal as it's called outside the jsverse), but this hint prunes the tree a few pipeline steps earlier
Rust does unused function culling at link time.
It does not modify tree structure if cases cannot be reached or skip compiling some functions all together.
It absolutely does prune unreachable branches from control flow
And skipping compiling some functions altogether is what this new hint does
It defers it till it’s required which is a step in the right direction.
It does if it can be guaranteed within a file
It requires a code preprocessor or optimization in IR.
LTO normal never modifies the structure outside of inlining
Better say compilation unit if you mean compilation unit
Inlining, constant propagation, and dead branch removal go hand in hand
One is significantly harder to do with compiled languages
whag
Idk why constants wouldn’t be done at compile time.
Removing unreachable cases post compile is harder to do, especially when the compiler restructures
Why would optimizing post-link ir be harder than pre-link ir
Other than being much bigger so might be slow
I thought you meant post machine code which is where LTO works.
No, lto works on ir
Is this a rust thing?
I didn’t know LTO embedded IR in objects when using LTO
Actually bit code https://llvm.org/docs/BitCodeFormat.html
Well yeah can't embed raw it, need to encode it as a data stream
anyways ignore me then
„No global variables“ uh huh right
he allocated that variable without allocating memory
teach me how thats done
static variables are essentially hidden globals
this is completely unrelated to my question
im ragebaiting
malloc stands for memory allocate
hes telling me he can use variables withuot allocating memory
@valid jetty i love languages where error handling is done using hopes and dreams
like ok thanks for putting 5 lines of comments saying (Required) and not actually making it required
yep, globals with limited access/scope
can you make public readonly variables?
absolutely hate the final keyword
absolutely hate most java keywords
so not globals?
global as in a lifetime equal to that of the programs remaining runtime
the hate on globals is two part:
one that they pollute the global scope (which static variables dont do)
and two that they can make code unpredictable as in you change how your program runs based on something other than input (thus breaking the same input same output philosophy) (static variables absolutely do this)
Whether globals pollute the scope is a language issue
That they enable action at a distance is an inherent issue with global state
yep
the biggest problem i have when developing things is getting stuck on implementing things that aren't inherently difficult, i just often avoid starting until i feel satisfied with my idea of how i should do it (which probably just wastes time because things are never going to be perfect the first time anyway)
i often completely step away from the code and try to work things out in my head
hi
but i feel like it just makes me a 0.1x engineer
maybe it's betteer to let yourself make mistakes because it gives you the context to improve things?
and it's impossible not to anyway
i think you need a balance
my approach limits my motivation
cuz you always get better and youll always get new and better ideas so why wait until i have the better ideas why not just start now and change once i get them
i'm like the opposite of a vibe coder
i make my brain work way more than it needs to

the kode tode vibe codes
yea
i spent ages thinking about structure for my discord bot but it changed several times
and it still relies on loads of global state
well the real problem is highly scattered global state
😭
i personally think ive already figured out a really good structure for (at least py-cord) discord bots
after
10 attempts at writing a bot!
write in rust you spend ages shilling rust
WE CALL THEM APPS NOW
global state isn't inherently bad but i way overdid it
though it's js/ts so i think that's normal practice

i religiously avoid global state
because . ^
i mean you will almost always have a global state
even if you're just passing it down everywhere
global state is better than the crazy DI shenanigans you have to do otherwise
in a discord bot for example a bot token is needed for the entire lifetime of the program 😭
nop
i log into the discord api every time i need the token
so many bot requests a new token for every request
horror...
realistically every discord bot has a singleton of some libraries Client class
no matter how you're representing it
the moment you have an .env or config file, it's cbt to use it in a language like rust
it's so much nicer to have it as a global variable and just access it from anywhere
idk my code is probably fineish
yes you can use lazystatic or smth like that but that's ugly and once you have some more specific config logic you can't do that
in go or js you just make a module for it and export it as top level stuff
..?
maybe even better than average (which i'm careful to say when on average most people think they're better than average)

shows how 100% of the rust haters dont know anything about the language
i did really put a lot of thought
but i don't think it's complete perfection and i also do some things that would be better to be a separate library
cuz its quite literally as easy as using dotenv or serde 😭
like roll my whole own complex prefix command parsing
^
i'm not talking about the parsing part
my biggest issue with rust would be async
pyra wants her imperative language to be like haskell
this video feels like it was aimed at me https://www.youtube.com/watch?v=AiSl4vf40WU
I have explained the joy of rust at length on my channel, HOWEVER, some of what I have mentioned breaks down when interacting with async rust.
Though the compiler is getting more and more helpful with each iteration, async is still a sharp edge, especially for newcomers.
But you don't have to use it.
👉Get Rust training from Let’s Get Rust...
Async Isn't Real & Cannot Hurt You
Async Isn't Real & Cannot Hurt You
async is an issue in an systems language, python and js and whatever hide a fuck ton of complexity and their solutions arent that great either
easy to use sure but its definitely not optimal, something you mostly dont and shouldnt care about in python/js
having to manage your memory already makes async 100000000 times more complicated thats why its also not great to use in c++ and similar either
it's super nice to use in go though
and gos solution like python and js is easy to use but not optimal either
¯_(ツ)_/¯
rust has even more implications to async code than function colouring
(function colouring honestly isn't that bad but i'm sure go developers go on about it
)
go async is the most optimal actually
you just cant be by hiding so much complexity behind simple keywords
you have to pick a path, you have to pick well, but it wont work/be optimal in all situations
please dont ragebait me today its my birthday
if u love simplicity or whatever why aren't you using zig
..?
i dont think ive said i love simplicity here, im saying thats where system languages like rust & c++ are different to other languages
rust devs certainly don't love simplicity
rust tries to be as simple as possible but that doesnt always mean simple in the eyes of a systems language, some things just cannot be simple
after all we are talking about the language where this is how you create a vector
let vec = {
let tmp = Vec::new();
tmp.append(5);
tmp
};
going to go route of hiding all the complexity, shooting you in the leg then screaming at you for asking why it did that isnt solving the complexity

please wrap this in unsafe
for no reason
i just like the unsafe keyword
horror...
why is rust so verbose compared to go
for i := range 10 {
fmt.Printf("Counting to 10: %d", i)
}
let mut i = 0;
loop {
std::io::stdout::write(format!("Counting to 10: {}", i).as_bytes());
if i < 10 {
i += 1;
} else {
break;
}
}
omg happy birbday oomfiee
ty!!!
ummm this is a joke but vec! expands to exactly this...
happy reddit cake day
i do not have reddit !! do not send me reddit memes
wait no it doesnt
for i in 0…10 {
print(i)
}
rust is sane
taylor swift
why would they use let mut
It expands to <[_]>::into_vec(::alloc::boxed::box_new([1, 2, 3, 4]))
have they heard of variable
i believe you can do this
for i in 0..10 {
println!("{i}")
}
technically the real rust solution for this is shorter than the go one
for i in 0..=10 {
println!("Counting to 10: {i}");
}
let (mut a, mut b) = (0, 1)
isn't the go shorter because it's i := range 10
..?
nvm
i swear the loop line looked shorter
what the freak is 0..=10
we don't want to include 10
hbd
ty!!
Array.from(Array(10), (_, i) => console.log(i))
true
js is beautiful ❤️
then remove the =
(0..=10).for_each(|i| println!("{i}"));
for (int i : Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) {
System.out.println(String.format("Counting to 10: %d", i))
}
wait does this work
You know System.out.printf exists, right?
long time since doing java
i know
it's meant to be making each language look bad
like that twitter person
that's my goal today
map(print, range(10))
(apart from go)
Java doesn't need help looking bad
yes it does...
That does exactly nothing
[*map(print,range(10))]
swift async is nice
forgot
Can golf it as *map(print,range(10)),
what do you think the longest await in history was
the longest time an async task has taken before the rest of the function proceeds
Task { @MainActor in
DispatchQueue.main.sync {
print("meow")
}
}
can anyone guess what is printed
imagine if you do await fetch("someurl") and it takes 30 years
doesnt fetch timeout
Just sleep(Duration::MAX).await
Computer reboots
{p}10,/
foiled by windows update
😭
ate is my favourite ios flag
why do you need to turn the string literal into std::string
oh wait
i guess otherwise you would need to do std::string("romfs:/")
but is there no string suffix operator
"romfs:/"_s or something
idk i admittedly never use that
im watching this rn https://www.youtube.com/watch?v=Whs7Fy8lwzA
Now why would I do this? Idk but I had fun lol
github repo: https://github.com/NateXS/Scratch-3DS
how to download and use it is in that link...
for this video I decided to be more in-depth than the debut video, still kinda meme-y but definitely more on the explain-y side than last video. lmk if you guys like this style or if i should go more ...
be on crack