#πͺ -progaming
1 messages Β· Page 31 of 1
when no .insert 
that is so cursed
are you copying what i did in elle lol because i dont think thats the best way to do that
it is but it works
not really
but i'll probably change it to append the variadic argument directly
yeah gonna do it
idk
appending isnt always correct tho
it isnt?
what if you have
fn foo(i32 x, i32 y, ...) {}
foo(1, 2, "a", "b")
your code will insert it after "b" when it should go after 2
no it'll make it after 2
huh
just like aoc
exactly heh
okay nice it works
i should stop committing qbe output file &Β asm
gn guys
Gn random discord user I don't think I have ever spoken to before
public when
what the heck this thing is actually kinda cool
me neither
i searched blom and sorted by most recently comitted
wtf
final string = new {
call(value) => bbvm::str(value);
final startswith(str query) => new {
call(str search) = {
query = this..query;
nsearch = search|len;
nquery = query|len;
if(nsearch<nquery) return false;
while(i in range(nquery)) if(query[i]!=search[i]) return false;
return true;
}
}
final endswith(str query) => new {
call(str search) = {
query = this..query;
nsearch = search|len;
nquery = query|len;
if(nsearch<nquery) return false;
while(i in range(nquery)) if(query[i]!=search[nsearch-nquery+i]) return false;
return true;
}
}
final index(str query) => new {
call(str search) = {
query = this..query;
pos = this..pos;
nsearch = search|len;
nquery = query|len;
while(i in range(pos, nsearch-nquery+1)) {
different = try while(j in range(nquery)) if(query[j]!=search[i+j]) return true;
catch(different) return i;
}
return nsearch;//fail("Index not found");
}
}
final split(str query) => new {
default maxsplits = 0;
call(str search) = {
query = this..query;
nsearch = search|len;
nquery = query|len;
if(nquery==0) fail("Cannot split on a zero-length string");
ret = list();
pos = 0;
try while(pos<nsearch) {
prev_pos = pos;
pos = search|string.index(query :: pos=pos);
s = search[range(prev_pos, pos)];
push(ret, s);
pos += nquery;
}
return ret;
}
}
}
this system is so cool
well yea
i have no idea how this works
so it uses VM
Erlang is cool
have you seen gleam
Yea
its rust if it was a fpl
Well I just know that it has similar syntax
don't know a lot about the language features
ok but this kinda sucks
no mutable variables, no loops (only through recursion), tail call optimization
this is actually so similar what the heck
no loops?
no loops ya
Isn't loop faster than recursion lol
not if you do tail call recursion optimization
a loop is just a jmp
tail call optimizations just turns recursion into a jmp
also apparently elle has multiline strings because rust is awesome
aswell as unicode in strings because rust chars are wide
oh yea
but yeah it has the same "tail of a block is the return" as rust
import gleam/io
pub fn main() {
let fahrenheit = {
let degrees = 64
degrees
}
// io.debug(degrees) // <- This will not compile
// Changing order of evaluation
let celsius = { fahrenheit - 32 } * 5 / 9
io.debug(celsius)
}
well yea that's what I want to do too
and looks a lot like rust in general i guess
I talked about it in the morning/afternoon
that would be fun
yeah the only issue is ```
let a = 5;
{
let a = 7;
{
a = 9;
print a
}
print a
}
print a
scope
LMAOOOOOOOOOO LOOK AT WHAT SLOPIFY HAS BECOME https://slopify.dev/
you could just say that block returns void
or in rust ()
yea but talking about variable assignment
return types are easy
that's not a big deal
how do variable assignments have anything to do with the return tho
I'm not talking about returns
oh
I'm talking about closures and their scope
This one should print 9, 9, 5
what does it print?
it's not implemented yet xd
wtf is this
i can just make existing be nothing if the variable isnt a redeclaration
that shouldnt be too hard
1 sec
actually thats unrelated
this is the issue
if it finds an addr for the variable it assigns to that addr even if the variable should be newly declared
easy fix
these arent closures
nothing is being captured
in qbe scopes dont exist
theyre a madeup concept in the compiler
each scope is a hashmap from the variable name to (ty, val)
each new scope pushes a new hashmap
each scope end pops the current hashmap
well yea you just have blocks with own scope or how to call it
yea
im thinking of IR blocks like @start lol
blocks open a new scope yes
three blocks
AstNode::BlockStatement { body, location: _ } => {
self.scopes.push(hashmap!());
self.tmp_counter += 1;
let body_label = format!("block.start.{}", self.tmp_counter);
let end_label = format!("block.end.{}", self.tmp_counter);
func.borrow_mut().add_block(body_label.clone());
for statement in body.iter() {
match statement {
AstNode::Literal { kind, .. } => match kind {
TokenKind::ExactLiteral => {
match self.generate_statement(
func,
module,
statement.clone(),
None,
None,
false,
) {
Some((_, value)) => func
.borrow_mut()
.add_instruction(Instruction::Literal(value)),
_ => {}
}
}
TokenKind::Break | TokenKind::Continue => {
self.generate_statement(
func,
module,
statement.clone(),
None,
None,
false,
);
}
_ => {}
},
_ => match self.generate_statement(
func,
module,
statement.clone(),
None,
None,
false,
) {
_ => {}
},
}
}
func.borrow_mut().add_block(end_label);
self.scopes.pop();
None
}
π
and closure is just a block that captures the "return" value
the last expression
yeah
well okay
idk i see closures as capturing lambdas
lambdas which capture variables from surrounding scopes in an env
then it shouldn't be that difficult to make your blocks to actually capture the value
its not but it doesnt really make the code that much cleaner and my semicolon parsing is very messy lol
it's easier to not have semicolons 
but I like them
gleam has True and False like python π
oh what
why do they have the same name
no wonder it isnt working
there we go
the expected output
external fn printf(string formatter, ...);
fn main() {
let a = 5;
{
let a = 7;
{
a = 9;
printf("%d\n", a);
}
printf("%d\n", a);
}
printf("%d\n", a);
}
a = 9 modifies the a from the inner block
the a from the outer scope is left unaffected
nice
ok all the tests pass
i swear that was working at some point im not sure how it broke
but anyway
- if no type is specified (ie
a = 7instead oflet a = 7) store the value at the nearest scope's address with that name - when creating a new addr for that name make sure its unique
seems to work fine
if ur gonna implement scopes you should do this i guess
its a neat way to do scopes
- when entering a new scope push a new hashmap
- when leaving a scope pop the hashmap at end of the array
- when searching for a variable search through the scopes starting from the end
maybe ill add mut lol
mutability is something i can simulate pretty easily in the compiler
except maybe not with ```rs
let x = 0;
let y = &x;
*y = 1;
so true veev

Like jython but worse
class __main__ {
public static void main(string[] args) {
System.out.println(args[0]);
}
}
from sys import argv
def main():
print(argv[0])
if __name__ == "__main__":
main()
is there anything else i need to say in the docs about this
its kinda intesting to see how much bloat and abstraction that tiny little example compiles into
use std/prelude;
fn main(string[] args) {
let program = args.pop();
for arg in args {
if arg == "foo" {
io::println("i received a foo!");
}
}
}
``` this compiles into this main function
keep in mind thats the main function only
theres other things that have to be compiled too
like the allocator and dynamic arrays and other stuff
Wait does pop remove from the beginning?
Makes more sense
oh my god @hoary sluice
commonjs: bundling at its finest
requirejs: the better commonjs
webpack: fixing requirejs
rollup: fixing webpack
parcel: fixing rollup
esbuild: to be used with rollup
vite: fixing rollup
turbopack??? rolldown??? parcel 2???? bun???? when will it end holy shit
rspack: fix webpack slowness
horror
await IO\request_output()->writeAllAsync("Hello World!\n");
i think that may just be worse than System.out.println("Hello, World!");
the js ecosystem has gone too far
we need to go back to cjs
works fine
i made lambdas nicer + added multiline lambdas
use std/prelude;
fn main() {
let exclaim = fn(string x) x <> "!";
let whisper = fn(string x) x.to_lower();
io::assert(exclaim("Hello, world") == "Hello, world!", nil);
io::assert(whisper("Hello, world") == "hello, world", nil);
let multiline = fn(f32 x) {
let foo = math::sqrt(x) * E;
return (i32)(foo / 4);
};
io::assert(multiline(81) == 6, nil);
io::println("All lambda tests have passed!".color("green").reset());
}
still no capturing
but its nicer than before
Provided file is too long.
Damn
i did a thing idk how silly this is
use std/allocators/heap;
use std/prelude;
fn main() {
let heap = HeapAllocator::new();
defer heap.free_self();
mem::$scoped(
heap,
fn() {
i32 *x = #env.allocator.alloc(#size(i32));
*x = 39;
io::dbg(x);
}
);
}
and HeapAllocator is just the bare minimum allocator interface
use std/libc/mem;
global pub;
struct HeapAllocator {
i8 _;
};
fn HeapAllocator::new() {
HeapAllocator *allocator = mem::malloc(#size(HeapAllocator *));
*allocator = mem::malloc(#size(HeapAllocator));
allocator._ = 0;
return allocator;
}
fn HeapAllocator::alloc(HeapAllocator *self, i32 _size) {
return mem::malloc(_size);
}
fn HeapAllocator::realloc(HeapAllocator *self, void *ptr, i32 _new_size) {
return mem::realloc(ptr, _new_size);
}
fn HeapAllocator::free(HeapAllocator *self, void *ptr) {
return mem::free(ptr);
}
fn HeapAllocator::free_self(HeapAllocator *self) {
mem::free((void *)(*self));
mem::free(self);
}
what $scoped does is use the allocator you specify for the duration of that function and then use the original allocator (arena in this case) for everything else
NO
import syntax is good, actually
I am a deno fan, they took standards and did it well
jsx and the bundlers and the such however, I will never understand
holy shit i can do this lmfao
use std/libc/mem;
namespace HeapAllocator;
global pub;
fn HeapAllocator::new() {
return (HeapAllocator *)nil;
}
fn HeapAllocator::alloc(HeapAllocator *self, i32 size) {
return mem::malloc(size);
}
fn HeapAllocator::realloc(HeapAllocator *self, void *ptr, i32 new_size) {
return mem::realloc(ptr, new_size);
}
fn HeapAllocator::free(HeapAllocator *self, void *ptr) {
return mem::free(ptr);
}
fn HeapAllocator::free_self(HeapAllocator *self) {}
maybe CAllocator?
idk maybe
i have ArenaAllocator already
next i need TempAllocator and TrackingAllocator i guess
This video was sponsored by Flexispot.
π₯FlexiSpot Amazon Prime Day Deal Up to 60% OFFπ₯
10 100% Free orders on July 16th & July 17thπ
US site: https://amzn.to/3XBuaxV
Upgrade your workspace with OC6 Ergonomic ChairοΌhttps://amzn.to/3XLNwAq
In this episode we learn the whole process of casting a decimal number formated as a string to a number tha...
i saw this video and i was like "i can write that whats so complicated"
so i did
use std/prelude;
fn to<T>(string x) {
T res = 0;
for c in x {
res = (res * 10) + (c - '0');
}
return res;
}
fn main() {
io::dbg(to<i32>("12345"));
}
how could they possibly stretch this out for 10 mins
oh my god why is it stretched out so much
LMAO I WAS SO RIGHT
i literally wrote the exact thing they did
WOW I LOVE WHEN TITLES ARE ALL CAPS
(also the voice sounds fake)
now add support for hexademical, floats, etc
AI SLOP
yeah forgot that phrase oops
the video doesnt go into that but i have some ideas to go about this
This video was sponsored by Flexispot.
π₯FlexiSpot Amazon Prime Day Deal Up to 60% OFFπ₯
10 100% Free orders on July 16th & July 17thπ
US site: https://amzn.to/3XBuaxV
Upgrade your workspace with OC6 Ergonomic ChairοΌhttps://amzn.to/3XLNwAq
In this episode we learn the whole process of casting a decimal number formated as a string to a number tha...
is this elle
yes
use std/prelude;
fn to<T>(string str) {
T res = 0;
let radix = 10;
let start = 0;
if str.len() >= 2 && str[0] == '0' && str[1] == 'x' {
radix = 16;
start = 2;
}
for i in start..str.len() {
let c = str[i];
res *= radix;
if radix == 16 {
if c >= '0' && c <= '9' {
res += (c - '0');
} else { if c >= 'a' && c <= 'f' {
res += (c - 'a' + 10);
} else { if c >= 'A' && c <= 'F' {
res += (c - 'A' + 10);
}}}
} else {
res += (c - '0');
}
}
return res;
}
fn main() {
io::dbg(to<i32>("12345"));
io::dbg(to<i32>("0xFF"));
}
``` hex support
now add an optional base argument
oh actually this is slightly wrong
js parseint() actually has this iirc
I think it's parseint()
yeah it does
parseInt(str, radix)
silly
idk how to do floats
11.1234 could be turned into 111234 / 10^4
where 4 is the number of digits after the decimal
thats actually what i do for elle floats
fn parse_float(&self, token: Token) -> AstNode {
let value = match token.value {
ValueKind::String(val) => val,
_ => todo!(),
};
if !value.contains(".") {
panic!("Invalid float literal provided");
}
let nodes: Vec<&str> = value.split('.').collect();
let left = nodes[0];
let right = nodes[1];
let exponent = right.len();
let original = String::from_iter([left, right]).parse::<i128>().unwrap();
AstNode::BinaryOperation {
left: Box::new(AstNode::Literal {
kind: TokenKind::FloatLiteral,
value: ValueKind::Number(original),
location: self.current_token().location,
}),
right: Box::new(AstNode::Literal {
kind: TokenKind::FloatLiteral,
value: ValueKind::Number(10_i128.pow(exponent as u32)),
location: self.current_token().location,
}),
operator: TokenKind::Divide,
treat_as_string: false,
dunder_methods: true,
location: self.current_token().location,
}
}
@royal nymph ```rs
use std/prelude;
fn string::to<T>(string self) {
if self.contains(".") {
let parts = self.split(".");
let joined = parts.join("");
let exponent = math::pow(10, parts[1].len());
return (T)(joined.to<i32>()) / (T)exponent;
}
T res = 0;
let radix = 10;
let start = 0;
if self.to_lower().starts_with("0x") {
radix = 16;
start = 2;
}
for i in start..self.len() {
let c = self[i];
res *= radix;
if radix == 16 {
if c >= '0' && c <= '9' {
res += c - '0';
} else { if c >= 'a' && c <= 'f' {
res += c - 'a' + 10;
} else { if c >= 'A' && c <= 'F' {
res += c - 'A' + 10;
}}}
} else {
res += c - '0';
}
}
return res;
}
fn main() {
io::dbg("12345".to<i32>());
io::dbg("0xFFFF".to<i32>());
io::dbg("11.1234".to<f32>());
io::dbg("0".to<i32>());
io::dbg("".to<i32>());
}
Rosie when sleep????
@valid jetty
everything besides wasm needs to be made illegal
my aunt won a horse
isn't that a donkey
no its a horse
It is beautiful
oh wait donkeys have huge ears
is it a baby horse
cool horse
Provided file is too long.
what the fuck
Provided file is too long.
bruh
lol this is amazing
Just sent the GitHub link
try using a line range (e.g. L1-L10)
itβs all on one line
Provided file is too long.
Provided file is too long.
Provided file is too long.
whoa
β discord-status β β βCheck if discord incidents are happening
forgejo-down? β β βCheck if Ninos Forgejo is down
help β β βList all commands or get help for a specific command
plugin β β βProvides information on a plugin
source-code β β βGet the source code for this bot
Use v!help <command> for more information on a specific command!
ok maybe not
I understand why it says it's long π
index.html: Lines 30-36
<div class="panel"> <div class="maxwell"></div>
<h1> <span class="fa6-solid--cat"></span> Meow:3 <span class="fa6-solid--cat flipped"></span> </h1>
<p>Welcome to my Website</p>
<p><d>By: KrystalSkull</d></p>
<p><d3> The best way to reach me is either Telegram, or Discord</d3></p>
<p><d3> <span class="openmoji--warning"></span> <e3 class="warning"> WARNING: The 'pages.gay' mirror as a sync delay of 1hour </e3> <span class="openmoji--warning"></span> </d3></p>
</div>
yeaβ¦
Lmao
Guys im so out of ideas what to try to make π
Please give me some ideas
Like anything
a language
Idk how do i build ast from the tokens
youll learn
none of us knew before we started
idk, im writing an interpreter first and only then thinking about whether i want it to compile or not
initially
Idk ill use kotlin from the start, so ill just use ASM
if ur gonna make it compile then use qbe
To build the classfiles i mean
Do i just concat bunch of strings based on the ast?
To make a valid qbe intermediary
idk theres a book on it and @valid jetty is the qbe person not me
idk anything abt qbe only that its simple to use
Right
yeah
well yea you just create QBE IR from your ast
but I recommend you to create some sort of qbe abstraction and not to have a compiler that just returns string from each statement
u0 
U0 void, but ZERO size!
quiz: coroner software or programming language?
you could be special and compile to erlang BEAM bytecode
is jvm not special to you? >:(
there are so many languages that compile to jvm
there are only 3 which im aware of that compile to beam (erlang, elixir, gleam)
This list of JVM Languages comprises notable computer programming languages that are used to produce computer software that runs on the Java virtual machine (JVM). Some of these languages are interpreted by a Java program, and some are compiled to Java bytecode and just-in-time (JIT) compiled during execution as regular Java programs to improve ...
its really not sometimes
erlang is really fast, isn't it?
the error diagnostics kinda suck and if the program is very big and you dont know what the potential issues are youre kinda on your own
yea
elixir can handle a lot of connections
okay my prolog implementation probably works (for correspondence seminar)
now i can work again on blom
i should probably get started on those 20 assignments that are due
well yea you should
I must also read one book
create voice assistant backend or something like that
and also do math (not that hard thought) but i need to learn slovak
damn every time i put a use another module every function just gets like a new prefix
like first i wanted to just combine a number and some words, so i used sprintf()
but then i found out that's bad, so i used snprintf()
and now i'm trying to make a function which can take more or less arguments, so now its vsnprintf()
what's the next evolution
so silly
in python i would've just like combined all of that while defining the new string in the same line
What are you doing lol
Just get some speech to text library and pump it into chatgpt api xd
i have no idea
well i have somewhat of an idea
i think
Yea that's what I'll do
But I need to create application to work with the hardware so you can e.g. connect it to wifi or stuff like that lol
well idk i haven't chosen yet
i already worked with raspberry so yeah that's probably the easiest
wait is that actually allowed lol
I'll probably go with that
I'm doing it for one competition with my two friends but im the only one who know how to code and hw
so I have to do everything
do i know them or is that someone from school
from my school
jopgamer can print it if you dont have 3d printer
i have but I need to make it first
true
3d modeling is fun lol
i did some thingies in the past
these are the only things i still have but there are probably more
but did you make a photorealistic donut
oh
yeah
@valid jetty why float in elle is done using binary operations?
because when i first wrote it i didnβt realise qbe allows you to put float literals in d_
like d_1.2
is LaTeX a compiled programming language
screw it i should work on my economics work again
oh okay
Depends on your definitions
i mean we have pdftex or whatever is that called
which technically makes it compile to pdf
@valid jetty is there a way to differentiate assignment from lambda without looking ahead until i see a $ or an =
expression = declarationns ;
declaration = IDENTIFIER ":" { "_" | IDENTIFIER } | assignment ;
assignment = IDENTIFIER { primary } "=" expression | lambda ;
lambda = { IDENTIFIER } "$" expression | if ;
if = "if" expression expression { "elif" expression expression } "else" expression | binary ;
binary = unary { ( IDENTIFIER | OPERATOR ) unary } ;
unary = ( "!" | "-" | IDENTIFIER ) unary | primary ;
primary = "true" | "false" | "null" | "(" expression ")" | NUMBER | STRING | IDENTIFIER ;
Pdf could be viewed as a program for drawing pages, in which case pdftex et all is a compiler with heavy comptime facilities
Latex is not a programming language though, it's a stdlib/framework
latex is turing complete
idk what the difference between tex and latex is
ah
the format is called .tex and the package is texlive but everyone says latex so idk which one im using
Nobody uses raw tex though
yea and compile with pdftex
is raw tex just latex without packages?
Tex is the language, pdftex/luatex is the compiler, latex is the stdlib, texlive is the distro
or without the whole begin{document} thing
Raw tex doesn't have usepackage, documentclass, environments, and I think most math mode stuff, among other things
is \While{} tex or latex
ngl chatgpt is very good for help with latex
Presumably yes
how is tex turing complete then
Well, considering latex is implemented in tex
huh
Think of it like rust no_std maybe?
wtf lol
wasted a few days on https://github.com/esp-rs with no std
write an interpreter in latex
How can i render 100x100 grid of moving emojis in react without causing lag
you dont
thereβs a few ways to optimize that
Funny it was causing lag only in prod
I just had a giant 2d array which i mapped to react nodes
Thats probably not that efficient

i cant belioeve they named error after the site
so true
oh okay thats reasonable
(z) should be valid, but it sees (, tries to parse an expression and then consume a ), but in icps an identifier can be used as a unary operator so it thinks im calling z on )
i think im gonna rework unaries later and just disallow identifiers as unary operators for now
the way i do wrapped is
-> encounter (
-> is next token a type?
-> if yes parse a type conversion expr
-> else parse a wrapped statement
-> if parsing a type conversion, expect (, advance, consume a type, expect )
-> else consume tokens with a nesting variable set to 0 initially
-> if encountering ( increment nesting
-> if encountering )
-> if nesting == 0 then break, the wrapped statement is finished
-> else decrement nesting
-> parse that token stream recursively into an astnode
Nice I like that
its a little more "involved" than that i guess
TokenKind::LeftParenthesis => {
let next = self.next_token();
if let Some(token) = next {
let ty_name = token.value.get_string_inner().unwrap_or("".into());
if token.kind == TokenKind::Identifier
&& (self.shared.struct_pool.borrow().contains_key(&ty_name)
|| self.shared.generics.contains(&ty_name)
|| token.value.is_base_type()
|| token.kind == TokenKind::LeftParenthesis)
{
let next = self.next_token_seek(2);
if let Some(next) = next {
if next.kind == TokenKind::LeftCurlyBrace
|| next.kind == TokenKind::DoubleColon
{
self.parse_wrapped_statement()
} else {
self.parse_type_conversion()
}
} else {
self.parse_type_conversion()
}
} else {
self.parse_wrapped_statement()
}
} else {
self.parse_wrapped_statement()
}
}
Left recursion is fun
the thing is that a lot of things can be the start of a type
(Foo), ((i32, i32)), (i32), (T), (Foo *)
types can be more than 1 token so
shrug
You don't parse expressions as expr := atom | expr op atom, but expr := atom (op atom)*
Also makes it much easier to handle operator precedence imo
parsing is hard
how do you differentiate ((i32, i32))x and ((i32)x + 1) without doing a ton of lookahead
maybe c style cast just isnt a good idea lol
#cast(T, expr) may be the way to go
instead of (T)expr
i was trying to parse lambda arg identifiers without consuming the $ first so params were always empty and since cur is $ it made infinite empty lambdas
wait no i was skipping the identifiers and getting stuck on the $
okay compiler is done, now it's time to fix analyzer
and then interpreter
or I'll ignore interpreter for now
yay it can parse this now ```rs
x : int int int 3 + 3 x a b = (n t $ n + t)
I can't
more readable like this
x : int int int
3 + 3
x a b = (n t $ n + t)
What's the 3 + 3 for, confusing the parser?
Yes
giggled at that
the parser is expected to understand that 3 isnt a type and hence start a new expression
tho its probably better to require a newline or semicolon here
i should probably include location in every expr
and some better error handling
rn if theres a syntax error all i get is .unwrap failed: ExpressionExpected with no location info
If it's recoverable it's nice to insert an error quasi-expr so you can continue chugging on and give more errors
Lol
currently i panic if there's an error but there's usually good diagnostics
Panicking isn't a good error mechanism
Since it's by definition a bug in the program
ok i have forgotten to consume a keyword on 4 separate occasions now
Add better next_if primitives
Yep, you need an advance_if_is function
thats try_consume_any
u can input vararg tokens
(so it has to be a macro)
also rn binary expressions are left to right
gotta figure out the whole runtime precedence thing first
You mean 1 + 2 * 3 == 9?
well its not equal to anything rn cause i dont interpret anything yet
but yes
this is what adventofcode will do to you
600kb of aoc
cool statistic
Explain
qbe devs are so good
Here is your py(3.10.0) output @fleet cedar
2400.0
Hm, guess 2.4k per day isn't too unreasonable for a verbose language
kotlin isnt that verbose π
a lot of it is utils
grid has 1130 lines
grid is 42.76kB
qmake
They've been trying for 40 years, why do you think the next one would suck less
lc.xkcd standards
fuck you
π₯
@ public feels slightly verbose hm
in elle i make the main function public automatically actually lol
heh
well ill make this probably too
fairsies
like implicit casting but explicit is more important
because it makes distinguishing between ((i32, i32))x and ((i32)x + 1) much easier idk
should be type first? idk
anyway ill do that later im rewatching squid game s1
hmmm π€
you tried to do -1 on a usize casted to a signed integer
thereβs a lot of work that still needs to be done lol
iβve been following the progress
well yea but it's cool that they're working on it
yeah
when elle ui framework @valid jetty
the raylib in question
not c++ bindings
when elle cmake
native ui library in elle
@royal nymph
*you can use sdl and/or glfw if u want 
thats cheating
HORROR
pattern matching as in regex? or like rust's match?
rust match
do
Do you want to make enums with values?
Like in rust
@valid jetty jsx support when
@royal nymph i made js
nono just normal enums
technically very possible
<Foo bar={baz} /> compiles to React.createElement(Foo, { bar: baz }) in modern react
ummm wrong
it actually compiles to
jsx(Foo, { bar: baz })
in modern react 

@royal nymph you will learn clay
and jsx is bound to React.createElement in tsconfig
no...
This blog site has been archived. Go to react.dev/blog to see the recent posts. Although React 17 doesnβt contain new features, it will provide support for a new version of the JSX transform. In this post, we will describe what it is and how to try it. Whatβs a JSX Transform? Browsers donβt understand JSX out of the box, so most React users rel...
i mean in the end you can customize what function will be used
thatβs what i meant
:p
ah
i swear every fucking time someone tries to explain dp it's the coin change problem
EVERY TIME
is there no other fucking example you can give???
the neferious lanternfish:
Hey guys, just wanted to wish you all a happy new year. Discord is filled with ready-made messages that you don't even read, you just copy and paste to every server, I don't like that, I like writing from my heart. Our friendship, from the deepest to virtual, is very important to me and couldn't ever be represented by a cookie-cutter message from anywhere. So, I'd like to thank you all, you're the best dominating egirl roleplaying server I've ever interacted with.
that implies youve interacted with multiple dominating egirl roleplaying servers
yeah and
Yeah I can kinda believe that
WHAT
@placid cape
ok i have a question because idk how this really works
at my current level of education (sixth form), iβm supposed to start a project next school year where iβm basically on my own and have to make something
iβm not entirely sure what yet but i wanna make a compiler
and i need to heavily document and reference what i did
can i reference myself
and elle
lol
oh my friend is doing that
idk
apparently everyone is doing like a simple website
yeah idk because i deffo wanna make a compiler but i donβt wanna seek out resources to reference when i already know all the things
i wanna write the compiler in elle
he wants to make an interpreter in python (i convinced him)
yay
but you didnβt answer the question
is my code a valid reference
can i reference elle compiler code when writing a compiler in elle
it wonβt be a self hosting compiler for elle because thatβs too ambitious but i still wanna make something small but big enough to score full marks
well yeah thatβs fair
no creativity
and cs students who take cs and donβt program in their free time wonβt really get anywhere so idk
you donβt learn anything in class
yea hes that type of person
idk the reqs
which, someone who doesnβt program in their free time?
yes
fair
if i have to seek out references when i already know the content iβll just give up and make a basic thing
because im not doing that
idk i have to do smth similas but u need extensive docs
yeah you do here too
just reference elle?
its a diploma thesis so u have to write a thesis
oh lol
explaining what it is and the process of making it, ur mistakes, etc
mine would probably be more of a dissertation
that is exactly what i need to do
but they also want references for where you learnt the content
how long does it have to be
iirc at least 10,000 words?
I just took a random project I had done on my spare time, bullshitted a few pages of report, and passed
hm ig thats similar
That school was kinda crap ngl
they also expect at least 2-3k lines of code with warranted complexity
like you canβt just do a super easy thing which takes 10 lines in 400 lines and say u wrote 400 lines
im making the software for a voice assistant
my team partner is doing hardware
or ai
nah thats 5 lines of python
its not in the reqs but theres basically nothing to do besides nlp
openai whisper
wdym
free tts / stt from openai
as in i didnβt even know claude was a thing until aoc started
my extent of ai was chatgpt 3.5 turbo
another part of it is a frontend in qt/c++ but im oflloading half the work to ffmpeg cause recording audio in qt is hard
cause i made a brainrot generator lol
the gui is in qt c++, the audio rec is ffmpeg
ah
theres like QAudioRecorder but it just doesnt work
horror
i honestly forgot latex was a thing
ill have to use that now just because i can
my class is genuinely retarded
i donβt start anything until like october 2025 so i have plenty of time to prepare
most of them are writing it in word and in german
writing it in word is fair tho
no its not π
its 100-150 pages of word thatll get really messy
and u have 0 version control
i was originally gonna write it in notion because it has latex support and syntax highlighting for code in various languages and it looks nice and you can have multiple pages and export it to a website
also one guy in my clasr made a nextjs website purely with chatgpt and nothing works and he has no idea how anything works
loveeeee
thatβs the software developer who is being laid off by big companies
π
he will never even get hired
he works part time as a waiter
and on holidays in construction
3.5k/month
the only reason i started doing competitive programming and like algorithms and stuff was so i could pass job interviews actually
because they seem to love throwing leetcode style problems at you even though thatβs definitely not something you will need to use for the job
i started doing competitive programming cause i wasnt creative enough to come up with a project and now i can pass job interviews as a byproduct
i mean knowing the entire kotlin stdlib like the back of my hand has been pretty handy
imo interviews should be more like βhow well do you know gitβ βhow well do you work in a teamβ βcan you decode the shitcode and hack upon hack in our project from 30+ people working on itβ instead of βcan you reverse this linked listβ
but oh well
how well do u know git is meh
nono because if iβm a hiring manager and someone is βAdd files via uploadβing theyβre not getting hired iβm sorry
u can learn basics in 5 mins and when shit breaks a colleague will teach u how to rebase in 5mins
yeah i guess
if its a junior position i might consider them
Esp internship
but you should still know how to like, merge conflicts, commit amends, rebasing
you donβt learn that in 5 mins
many companies use ftp
yes u do
it took me forever to learn how to fix merge conflicts through the stupid vscode interface for it lol
the CLI is sooooo much simpler
u can explain basics in 5 mins and merge/rebase in another 5 mins
its intuitive in intellij
the cli is the best
for add commit push yea, for rebase and merge no
βgit rebaseβ
oh noooo files A and B have conflicting changes
remove the parts you donβt want from file A
git add A
git rebase βcontinue
remove parts from B
git add B
git rebase βcontinue
success!
so hard
click the arrow
success!
idk i guess
also rosie make sure to never make the mistake of working in an agile scrum company
literal torture
lmfao
and test driven development too
yeah true
I would unironically have gotte about 4x as much stuff done without jira and stand ups
if only you could just push to master
lmfao
me when i need to make a whole pr and get it reviewed in 2 weeks for a 2 character typo fix and the person reviewing happens to nitpick another 513 changes i should make to fit their code style (itβs a 40 line file in python)
at least thatβs what i imagine it being like from the videos iβve seen on youtube
"hey the chart is offset to the left"
"ok i will open a jira ticket for that, and make sure you write proper tests for it"
bitch its 1 character in the css
this literally happened
at least ur getting paid for doing nothing
this exact scenario
no fucking way
it was something with the chart, he left 70 comments on my pr
also that time i forgot to enable eslint and had to spend hours fixing working code
like if what theyβre doing is clearly wrong or inefficient iβll leave a comment and tell them the more efficient way to write it but code style nitpicks are evil
also did i mention its in typescript
at least itβs typescript
i had the joy of reading corporate code once lol
my school uses this maths homework website called sparx
there was so much frontend processing that the backend being in kotlin basically didnt matter
i wanted to figure out how it works to write a client mod for it
the fucking
horrors
the main window is a huge switch statement of strings to switch to different windows
itβs in react
it uses react + react redux saga and everything is a dispatcher event
at least they eventually rewrote the whole thing and now it uses react query and is sane but still
still hard to mod
1 project a worked on had 750 thousand files for a supermarket website, i dont understard how you can even generate that many files, and thats only a part of it
my classmate wrote a switch ta convert a string to an 8 bit number in arduino c cause he couldnt figure out the stdlib function for it
literally just switch (c) {
case '1': 1
case '2': 2
}
it was a library string
fuck 2024
oh right happy new year
this year i solemnly swear to be as retarded and annoying as possible to everyone i talk to
that is my vow
this year im gonna do aoc in templeos (i wont)
wasm moment
btw happy new year guys if you already have it
message from my server if you want to read :)
oh wait
You're 16 now?
we're the same age
that's cool
yea
how old did you think i was?
lmao
november 6th
I'm not American hehe
okay I'm gonna sleep since I have to wake up at 7am :d
you are 2
why is there so many june birthdays here
there's like 5 people within a week of my birthday
New year new me, I'll finish at least 2 projects this year!!
New year new me, I'll surely finish at least 1 project this year!!
some things never change
My procrastination is crazy
me when i drop a nuke over your house:
In the end it's all just a fortnite royale rumble
i haven't slept yet
sleep is for the weak
i think i just binged the whole of squid game s1 in a single night
i already saw it but that was several years ago by now
i just have the last episode to watch
if i get a good 2 hours of sleep i can wake up and binge s2
if its 6.11 its november, if its 6/11 its june

6.11 isn't november, it's a float
isnt it double by default
Depends on the language
Float and double are dumb terms anyway y'know
It's all floats, just of different sizes
long long double
No swearing in this christian minecraft server
well c promotes it internally to double when using in printf
because it does when it's a variadic argument
I thought 6.11 was a double literal (6.11f being the float), but it's implicitly casted when you do something floaty
it being called double is so stupid
like guys we have floats but we need double precision floats, what do we call them? fucking double??
f64 better
isn't long short for long int
Yep
long is just int on windows
long int is the same size as int on windows, you mean
this is why int_xx_t exists
yes
well long is a valid type
long == long int == int on windows
yet another advantage of macro driven c development
long int and int are different types, just the same size https://godbolt.org/z/3cc499d9W
and what does that change
Not much in practice, unless you're doing template shenanigans
ur still gonna have overflows if you port from linux to windows and forget to change long to int64_t
oh c++ exists right
Unfortunately
i dont think it can cause problems in c unless you explicitly try
WHAT
@valid jetty https://youtu.be/JTjNoejn4iA
References:
- Source Code: https://github.com/tsoding/qbe-notes
- https://c9x.me/compile/
- Tsoding Daily - Hare Programming Language - https://www.youtube.com/watch?v=2E3E_Rh3mvw
- https://llvm.org/
- https://en.wikipedia.org/wiki/Static_single-assignment_form
- https://en.wikipedia.org/wiki/Operator-precedence_parser#Pratt_parsing
- https://gi...
why has tsoding done literally everything
Gonna watch it 
few months ago I thought that QBE is something old, not really maintained but I was wrong heh
not osdev
also not really java afaik
maybe dfloat?
Maybe f64
let the int be int, not i32
does anyone know which shadcn component could this be
i want free cookies
already seen
yea i copied your euler number code
oh wait is that test still a thing???
i swear i got rid of it when i made E a constant in the math lib
oh that
yeah that actually used to be a test lol
time to implement BigDecimal haha xdd
truee
python has Fraction
and its actually cool
part3.py: Lines 0-30
part3.py: Lines 1-30
# https://i.imgur.com/ARMCVEV.png
from collections import Counter
from decimal import Decimal, getcontext
from math import floor, sqrt
import sys
getcontext().prec = 1000
sys.set_int_max_str_digits(int(1e10));
def normal(s):
if s == 0: return [1]
ss = str(s)
l = len(ss)
hl = l // 2
if l % 2 == 0:
return [int(ss[:hl]), int(ss[hl:])]
else:
return [2024 * s]
def third_eye(s, mid):
if s < mid:
return []
else:
try:
t = floor(sqrt(s) ** 3)
except OverflowError:
t = floor(Decimal(s).sqrt() ** 3)
return [t, t - 1, t - 2, t - 3]
Oh god
did you figure it out or still need help
What's an indexedvalue, a (usize, T) tuple?
eh i just made my own
yeah it's custom made
fun chart
not that again
THAT SONG
ITS DESTROYING MY BRAIN CELLS
what is normal amount of state hooks to have in a component
1 morbillion
maximally 11
by making the server return appropriate CORS headers
or using your own proxy that adds CORS headers
@valid jetty least obvious off by 1:
i messed up the mapping
yes
Collection<T>.withIndex(): Collection<IndexedValue<T>>
For what day you used it?
2017 day 21
Yea i just sent it using a route in nextjs and its working
@valid jetty i just spent 3 hours parsing 6x6 as divisible by 3 but not 2
my entire solution is useless
Oh lol
i just solved day 9 2015
@fleet cedar wtf u did aoc 2017 in 2017???
Probably? Don't remember which ones I did, but all the ones I've done were live I think
Is that weird
well no
i wish id started aoc in 2015 instead of being 8 years old
Skill issue
imagine some gen alpha gets #1 in aoc 2030 and when asked why they didnt participate in 2015 they can say they werent born yet
does anyone know any good library which can create cool filler backgrounds
yeah same lol
im pretty sure i saw something by theo
wdym
it let you create cool interactive backgrounds
like dotted background which would react to cursor
desktop backgrounds? web backgrounds?
yea for sites
also 2017 day 21 is responsible for 15% of my total runtime cause i cba to do the cool approach
@valid jetty this is so cool https://adventofcode.com/2017/day/22
im trying to patch webpack loader
tldr i can't modify the bundle directly, but can run code before it
function __webpack_require__(q) {
var K = __webpack_module_cache__[q];
if (void 0 !== K) return K.exports;
var re = __webpack_module_cache__[q] = {
id: q,
loaded: !1,
exports: {}
};
return __webpack_modules__[q].call(re.exports, re, re.exports, __webpack_require__), re.loaded = !0, re.exports
}
can't figure out how to hook __webpack_require__
i can monkeypatch Function.prototype.call and get an invocation on the first module load but have to unpatch afterwards for other reasons
@royal nymph help xddd
electron app
which
your short snippet of code is very meaningless
do you have access to __webpack_require__, module cache, modules, etc?
gitkraken
is it exposed on the window perhaps?