#🪅-progaming
1 messages · Page 72 of 1
vim diesel
Watch me stream vim gameplay 24/7 on my OnlyFans link below, thirsty gaymers. Also, timecodes:
DONATE NOW: https://lukesmith.xyz/donate 💰😎👌💯
WEBSITE: https://lukesmith.xyz 🌐❓🔎
0:00 Vim Diesel Let's Play Introduction
0:46 Playing stupid in movement/WASD for gamers!
1:46 Soydevs learn to exit vim with ZZ and ZQ.
3:44 Noob way...
on that note i discovered the best way to take notes
no not really
writing notes as haskell functions
why are there a bunch of ::
rosie did you make types first or other stuff first
wdym
i initially made just functions with no type checking
did u do that too
or type checking first
yes ofc
ofc type checking first?
the initial compiler just generated calls to functions arbitrarily
qbe lets you do that
itll just fail at link time if the function doesnt exist but if you pass wrong arguments its just undefined behavior
this
ok
also im gonna remove shadowing to simplify things
remove scopes
make everything global
lmao
you should look at the first draft of my compiler the code was geuinely beautiful
is that sarcastic
this looks like if a c programmer was forced to write rust
i still dont know if you actually mean its ugly or not cause this looks like very normal rust code with some unneccessary clones
omg i have to finish icypeas literally just so i can rename it to ricypeas and make icypeas be icypeas written in icypeas
im gonna go learn lambda calc now gn
its pretty cursed for what it is
it could barely compile a basic program
that was my code before i deleted it just now
lmao
i just checked out an old branch omg this is nostalgic now
fn add(Int size, ...) {
Int res = 0;
Variadic args[size];
Defer free(args);
for _ = 0 to size - 1 {
res += args yield Int;
}
return res;
}
pub fn main() {
Int res = add.(1, 2, 3, 4);
printf!("%d\n", res);
return 0;
}
back when Dart syntax highlighting looked better than c++ or rust
wlats yield int
HAATEEE
equivalent now
fn add(ElleMeta meta, ...args) {
res := 0;
for i in 0..meta.arity {
res += args.yield(i32);
}
return res;
}
fn main() {
res := add(1, 2, 3, 4, 5);
io::println(res);
}
that for statement 😭
better
ElleMeta 
ElleMeta 
please just make varargs a normal array
look at all of these things you get for free
that means the args must all be 1 type
but you shouldnt have that
dynamic varargs????
as they should be
why not its runtime call introspection
might as well delete the type system
yeah how do you think string::as_string works 😭
Rosie making js
Watch me stream vim gameplay 24/7 on my OnlyFans link below, thirsty gaymers. Also, timecodes:
DONATE NOW: https://lukesmith.xyz/donate 💰😎👌💯
WEBSITE: https://lukesmith.xyz 🌐❓🔎
0:00 Vim Diesel Let's Play Introduction
0:46 Playing stupid in movement/WASD for gamers!
1:46 Soydevs learn to exit vim with ZZ and ZQ.
3:44 Noob way...
but every language that has any kind of reflection only has slow reflection so this is probably slow
you posted this already
it is very much not slow its compile time sugar
when you call a function if the 0th arg is typed ElleMeta the compiler automagically generates the struct and passes it for you
there is no reflection its just strings being created at compile time
but can be inspected at runtime
new part of the vid
cant open the link it puts me into jew youtube
i meant ads youtube
got them mixed up
how do i make android open yt linkr in vanced
enable link handling in the yt app settings
where
"p" -> '"_dP'
i cant live without it
also do you sync vim clipboard with system clipboard?
you delete into the black hole register then paste effectively copying nothing because its deleted
yes
yes i took some time to try it, hence i now know how it works
typing "+p on this takes approximately 4 years
i have 4 spare pcbs
ferris sweep choc
wish i got a corne
i really want those 2 extra thumb keys
i was seriously considering a corne but i mainly program on my laptop so it's not justifiable
LOL that fan into laptop setup is a classic
innovative cooling solution
cant play among us without it
havent gotten rid of it since my last among us session like a month ago
dang 140euro is pretty expensive for what it is
i paid more like 280
that's a horrible deal
or like 220 idr
i bought all the parts myself and built it myself and theres a shortage of choc keycaps and i messed up on shipping
ordered twice from the same shop
got the expensive nice nanos instead of pro micros
gold plated pcb 😎
if bitcoin goes to 120k i might get a voyager
might as well buy a CNC-ed aluminum housing from JLCCNC
im not that rich
altho voyager is pretty big
corne might be a better idea
hmm i wonder if clicky chocs are nice
id love clickies but then i cant use it in an office
insane
what switches do you have in there rn?
though I'm not very familiar with low profile ones
brown tactile 60gf
my keycaps have this annoying slope on the sides
might get new ones soon
oh yeah if I ever buy one i'd want hall effect switches for sure
yea have fun getting low profile hall effect on a well designed pcb
I've used linear switches for so long idk how I would feel using tactile ones
id just get a voyager
im prob gonna buy one soon
its expensive but worth it
365$ but its soo nice
yeah
I'm quite scared of getting an RSI but I'm not actively doing anything to prevent it either
you get a carrying case and extra caps
i saw a review of it where a guy mounted it to his desk almost vertically
yea ive seen it
im scared of getting a keyboard with a trrs connection cause it shorts vcc and gnd if u unplug it
id personally love a tented keyboard with 36 or 42 keys that has a smooth surface, like a glove 80 but with less keys
theres the dactyl which seems almost perfect but im not sure id like it
it looks rough
or dactyl manuform
it has so many rough edges
atp might as well use datahand v2 https://svalboard.com/
consider macos keyboard
very short travel time
nice switches
its amazing to type on
tactile and fast
no
stfu!!
its really good can confirm
my thinkpad keyboard is similar but longer travel time
which i sometimes prefer but whatever
macOS keyboard is peak
Rosie has tiny fingers
low travel => more accurate and faster
i have way less travel time
almost no travel time
all keys are at most 1 away
from home row
and the layout isnt qwerty
what layout are you using
Rosie struggles to push the keys down
semimak jq
its explained here https://semilin.github.io/blog/2021/reflection_on_semimak.html
under ring finger movements
wow that's super interesting
as a side note are your vim keys still hjkl
that is not what travel time means
nope i have the left thumb key on the right half + home row bound to arrow keys
then what
theyre also close physically
high (left), lower (right)
oh
well im using choc switches
which have very short travel time
but theyre mechanical so its higher than on a membrane keyboard either way
nicer for typing fast tho
opens theo stream for 1s, sees this, leaves
this is fake
nah this is legit a ss from his stream 10 seconds ago
@valid jetty this is so hard to get intuition for
no not really
I think I know which video this is from
a boolean in functional programming is a 2 arg function that picks a or b depending on if its true or false
NOT just takes a boolean and makes it return b when path a is taken and vice versa
its really not that complicated
when Rosie says something isn't complicated it usually is complicated
true is λab.a or a => b => a
all NOT does is just, when you take NOT(TRUE) you do (a => b => a)(a => b => b)(a => b => a) which looks confusing when written but idk how explain with words
i think its better like
in functional programming, true and false are both functions that pick something right?
if you define true and false, (definition not required to show the below) then
NOT x = x false true
when its true, you get false, when its false you get true
basically not reverses the order of the args
yeah exactly
const NOT = b => x => y => b(y)(x);
i know what it does i understand it i just want intuition for it
in the case of the image eagely sent, TRUE = λab.a, FALSE = λab.b
so applying NOT TRUE would be doing TRUE FALSE TRUE
i explained under the intuition
function not(b) { return Boolean(b) === false; }
like if i read the equivalent as an imperative function id probably understand it
function not(x) {
if (x) return false;
return true;
}
^^^
yup and i immadiately see what it does
i just need to feed myself more lambda calculus
so i have the same intuition
thinking of TRUE as a function that always picks the first argument is a good way to think about it
also this is really funny and actually makes sense
yes thats what it is
because NOT true would make it just pick the second argument
and how the guy explained it
i know lol
i like the isZero implementation
idk if its in the video
u dont need to teach me lambda calculus ik how it works
lol okk
start with the 2 things i wrote in js a few days ago
try and understand it
tomorrow
okkk
?remind horror in 19 hours
Alright @hoary sluice, in 19 hours: horror
fizzbuzz isnt as interesting as the div impl
i wanted to do it with the Y combinator
did they ever explain how IS_0 works tho
ycomb my beloved
now were talking about the riemann hypothesis?????
i read htis twice and i still dont know what youre saying
math is scarily interrelated
in functional programming functions have only 1 argument
which means, to get the same multi arg functions as normal programming, you have to just accept multiple functions
a funtion like add in functional-style would be like const add = a => b => a + b
which:
if i do add(3) i get back another function!!! if i call that function with anything i get 3 + that thing
typically you call it like add(3)(4) which gives 7, and this is a way you can circumvent the fact that functional languages only allow for a single parameter in functions
so the true function is a function defined like a => b => a
if i do
true(42) and i call that function with ANYTHING i will always get 42 because it picks a no matter what
the false function is similar, its just a => b => b
true is defined as this:
def true(a, b):
return a
false is this:
def false(a, b):
return b
a NOT gate therefore is:
def not(x): # where x is either the true() function or the false() function
return x(false(true))
ERRATA:
• The "Church-Turing Thesis" is different from the "Church-Turing Theorem". The "theorem" is the claim which I discussed in the video- namely, that the Turing machine and lambda calculus are equally powerful. The "thesis" is the informal claim that the two of these systems are a sufficient formalization which capture the idea of "arbit...
this makes it harder to understand i think
yup
@deep mulch watch the video
i think the way i was explaining it is easier maybe
its a good video but you dont need to watch a video to understand booleans
no point in understanding fp bools if thats the only thing u understand
true
i did
the kerning on those italics are horrendous
true

Lmao
Rosie I have a challenge for you
Try to sleep for more than 5 hours a day :d
impossible
impossible
@deep mulch
@leaden crater
@placid cape
@valid jetty ```
fn main() {
val x = 55
println("Hello, world! " + x)
}
[Token(kind=FN), Token(kind=IDENTIFIER, value=main), Token(kind=LPAREN), Token(kind=RPAREN), Token(kind=LBRACE), Token(kind=VAL), Token(kind=IDENTIFIER, value=x), Token(kind=EQ), Token(kind=NUMBER, value=55), Token(kind=IDENTIFIER, value=println), Token(kind=LPAREN), Token(kind=LITERAL, value=Hello, world! ), Token(kind=ADD), Token(kind=IDENTIFIER, value=x), Token(kind=RPAREN), Token(kind=RBRACE)]
now what
Time for parser
what's today's regular color i WONDER
greeb
thats the thing that builds the tree and ties everything together right
genuinely who the hell is sleeping that much
like unemployed ppl??
5 hours is a lot?
kinda
i sleep like 3 hours at night
and then 3ish in the evening
yay nice
now you implement a parser
depending on how your language works this could be a little different but typically you take that token stream and you go “is it the FN token?” “ok let’s parse a function”
and then you consume all the tokens and by the end you have a struct with the function’s name and body
parsing the body is the interesting part because you have to go recursively parsing statements and then expressions
i would recommend watching a video on how this works because it’s easier to understand than for me to type it i think
but essentially you turn
FN
main
(
)
{
print
(
“hi”
)
}
into
Function {
name: “main”,
body: [FunctionCall {
name: “print”
arguments: [StringLiteral {
value: “hi”
}]
}]
}
okay
nini @valid jetty @valid jetty
nini
nini
ZOOT IS MAKING A COMPILER?????
THIS IS THE BEST DAY OF MY LIFE
i bet its in kotlin
you will die shortly
you are not a rabbit
you are not 74
although you might be very soon
Yup
u can see from the print output
thats kotlin enum formatting
@valid jetty https://youtu.be/RcVA8Nj6HEo
ERRATA:
• The "Church-Turing Thesis" is different from the "Church-Turing Theorem". The "theorem" is the claim which I discussed in the video- namely, that the Turing machine and lambda calculus are equally powerful. The "thesis" is the informal claim that the two of these systems are a sufficient formalization which capture the idea of "arbit...
nop wrong link
Ben Lynn is a serious programmer who has written a large number of great Haskell articles. In the wider programming community, his Git Magic guide is very popular as well.
watch this
now make it 8 hours of sleep every day
@valid jetty i think im just gonna make lambda calculus valid icypeas syntax
either
add : int int int
add a b = a + b
or
λxy.x+y a b
or
\xy.x+y a b
So is \xy.x+y there a function that's applied to the arguments a b?
Similar to haskell (\x y -> x + y) a b
my lambdas before this were { identifier } $ body
required () unless theyre on their own line
yes
except instead of doing it the stupid way with lambda x y: x + y or (x y $ x + y)
who is gonna be typing λ
i am NOT copy pasting that every time i want a function
ctrl shift u 03bb enter
Έ
oops
λ
typed 0388 there cause i did unpress number layer toggle 
if ur too lazy to type ctrl shift u 03bb you can just use \ like in hs
what
rust throwing the best warnings
rust hates clean code
clippy::restriction my beloved
how tf is rust able to make such amazing analysis of my code
rust being so predictable that it can actually infer what may have went wrong is so awesome.
@valid jetty hiii
like this is cool
cool
yeah that's amazing
@valid jetty what fields should my token class have
mine has kind, value, and location
@valid jetty help how do i make the parser
collect all the tokens into an array and then make functions like "expect_token(TokenKind)" and then start iterating the tokens and expect one of the top-level statement keywords
would elle be a good reference
also make an advance function and stuff
uhhhhhhhhhhhhhhh
elle is a lot more complex than a basic compiler so not really
if anything ichigo is a good reference
though the ichigo one doesnt do binop parsing
what is binop
and + - * / was arithmetic operations
You're confusing it with bitwise
ichigo just does the basic ones as a function
fn Parser::add_arithmetic(Parser *self, string name, string op) {
self.tree.push(Primitive::Function(
name,
[Argument::new("x", "整数"), Argument::new("y", "整数")],
[AstNode::Return(
AstNode::BinOp(
AstNode::from_token(Token::new("identifier", ValueKind::String("x"))),
AstNode::from_token(Token::new("identifier", ValueKind::String("y"))),
op
)
)]
));
}
fn Parser::add_arithmetic_methods(Parser *self) {
self.add_arithmetic("加算", "add"); // 「かさん」と読みます
self.add_arithmetic("減算", "sub"); // 「げんざん」と読みます
self.add_arithmetic("乗算", "mul"); // 「じょうざん」と読みます
self.add_arithmetic("除算", "div"); // 「じょざん」と読みます
self.add_arithmetic("剰余", "rem"); // 「じょうよ」と読みます
}
And &&/|| aren't bitwise anyway
does ichigo not do a tree
it does its right there
self.tree.push
the top level usually isnt AstNode, its a "Primitive"
i am struggling to read elle
how
primitive is top level stuff (functions only in ichigo but for elle thats functions, enums, namespaces, structs, constants)
astnode is just a statement
That's a strange definition of primitive
idk thats what i called it when i first wrote this thing
yea
how does adding a fullstop to string create an error...
description is just a plain string type
😭
and if i add something after the fullstop and remove it again the error goes away - the same code sometimes has an error and sometimes does not
??
race condition in typescript compiler?
restarting also makes the error go away
Probably some weird lsp synch issue
is expression just another name for an ast node
No
oh
isn't it something which has a value
Typically you'd have a typed ast where statements are one type, expressions are another, etc
so a node would be the base for everything?
?
like the tree would be made from nodes and expressions would be an implementation of the node
Nah, there's no point in having a Node trait imo
Like, what behavior would that represent
yep you should rename it @valid jetty
idk I thought it was the standard type
maybe look at some of the repositories listed on https://monkeylang.org/
I will do
Traits are useful when they're useful
If they aren't useful, no point in having them
I don't do rust so idk much about traits
report it
The same is true for all abstractions
it's basically an interface
Abstractions that aren't useful aren't useful
oh
idk how to reproduce lol
just create issue on github with the video
some ts boy will reproduce it
a good issue should have a minimal reproducible example
yea
but i think it's still better to create the issue even without a minimal example than not to create one
well idk
i’m adding enums
do i make Foo::A or Foo.A???
to keep it consistent i’ll probably do Foo::A
How do you use :: vs . in other cases?
:: is used for non-instance methods of structs
ie Foo::new() (without a self instance)
In rust it's that you have . if lhs is a value and :: if there's a type/path
::
ok yeah so similar thing
alright i’ll do :: then
are enum variants always known at compile time
like their inner value
not really if you want an enum with strings or one that starts at something other than 0
i know but i mean the repr type lol
Unimportant other than ffi
ya ya but useful for printing them
i have basic ones done tho
ideally theyre not a function theyre just sugar for a enum-typed literal
But what's the value in printing the memory representation, do you write strings as "Hello" = 48 65 6c 6c 6f too?
lol no that part is unfinished
when im done itll show the variant name
right now the formatter just does an explicit cast to the enum repr type
it would be returning a string
they are if you want them to be
theyre not lol
theyre by definition logical because they have short circuiting/lazy evaluation built in
in a non-functional environment thats an important distinction because doing foo && bar() could have side effects
@deep mulch https://craftinginterpreters.com/contents.html
you dont have a parser yet so whether its an intepreter or a compiler doesnt matter
this is correct i think
not if i make || and && bitwise operators and or and and logical

not if i make | and & bitwise, || and && logical, and or and and logical + short circuiting
THATS WORSE
ulgy
information overload grahhh
what would you rather do
.
but non-instance functions use ::
you do foo_instance.xyz() but FooTheType::xyz()
it would make sense to have :: for enums
no explicit self is good
its good for looking at signatures of functions
you know whether its an instance method or not
it just clutters code
if you're operating in the scope of the instance it makes sense the methods come from the instance
??? you can have both
Maybe if you see it as the type doing things, rather than the method doing things
struct Foo {
i32 x;
};
fn Foo::x() {
return 42;
}
fn Foo::y(Foo *self) {
return self.x + 1;
}
if there was no Foo *self how would you know whether you do Foo::y() or foo_instance.y()
without reading the source code
imagine the function has 1000 lines of code
elle discord support when
at some point in the distant future lol but idk if ill be the one to make that
@hoary sluice, <t:1745444598:R>: horror
x isn't defined anywhere so it's safe to assume x is defined on the instance
at least maybe compromise by removing self as a required parameter and implicitly have it available
Guhhh
implicit return type 
that solves nothing
again you have to know the source code when you call the function
fn Foo::y(): i32 {
return self.x + 1;
}
but what if Foo::y is a static (non instance) method
?
the main problem is you dont know, as the caller, whether its an instance method or not
okay but I don't understand the implicit return type cause you can argue the same situation for the self
yeah thats a thing i would get rid of if i could
but explicit return types means refactoring hundreds of functions and its too late now
How the heck you want to know if the method is static or not without explicit self/keyword?
Implicit return type requires global reasoning, which is slow and fragile
but you can still do it... it's still manageable
never too late
the implicit return type also serves the purpose of ensuring all code paths return the same type (or an implicitly convertible one)
I'd do it
idk
maybe static fn
don't make elle second javascript
Elle will have JavaScript concatenation
yeah so keyword like in java
yss
huh
it's not really magic at this point it's in almost every language xD
and explicitly calling with :: looks like it would bypass virtual function
(idk if you have this feature but still..)
"Many languages do it" doesn't mean it's not magic
@winged mantle kode tode
yes i like that this is a thing
what would the problem be though
it's not like people will have trouble understanding it
I think having more ways to do the same thing is confusing
yea, it cna be a thing so why not allowing it
it's nice
it's useful if you have a local variable with the same name
i am currently making a python learning tool for the raspberry pi that helps others learn python 100% free and pretty easy!
In rust the only difference between self and not is that you can call them with dot syntax
Nothing else
im so good at performance 
do i allow strings to be values in the enum
popsicle
so you can doo
enum Bar {
Colon3 = ":3",
Abc = "abc"
};
enum EBar {
Colon3 = ":3",
Abc = "abc"
};
horror
peak
maybe
enum Bar string
enum Bar<string>
til u can use windows executables inside wsl
why not just allow any values
like enums in typescript
hm
Yeah but TS is a completely different type system paradigm
Lattice based, rather than semiring based
as long as rosie doesnt implement something insane like
enum Guh {
a = 3,
b = "b"
}
elle enums???????????
Do you want real enums or something rust's enums?
these are real enums
but the issue arises that i cant very easily account for offsets when the variants can be strings
Enums are superior to named constants in every way
"{}".format(my_thing)
you cant #cast(string, my_thing) because thats an IR-level promotion demotion of types
Elle macros/comptime when
Elle pre processor when
@valid jetty i have to write a paper on 4g vs 5g until tomorrow and i have 0 idea where to even start
fuck this im just gonna watch italian brainrot compilations
horror
@hoary sluice will learn about 5g protocol
@deep mulch
40, 41, 42
look at the output
i cant
i will fix elle syntax
whats wrong with it
this looks identical to rust
const slice = threads[page] ??= client.threads(media.id, page)
rust 2
pls dont assign costants to enums
thats not what enums were made for
enums are not a static hash map
if you want a static hash map you should use a static hash map
welp i need to migrate to oxlint
esling is dying
my ts server is too
i'm running out of ideas
this one is special in that you can only assign string, int, and char literals to it
i want to make it very restrictive
nope literally die never using elle ever again
omg so its a static hash map but it doesnt work for non primitive types
make enums be like in rust
rust did them perfectly
pretty much
i beg dont use @repr thats so ugly
suggest syntax then
copy rust
rust literally has #[repr(u8)] for enums
i did see zoots msg
i was gonna say make enums without constant assignment, implement good pattern matching for them and then add rust like tuple values and struct enums or whatever theyre called
struct values?
uhhhh i wanna save that for when i eventually do tagged enums with generics
elle more like typescript
What repr stands for?
representation
Oh okay
the type of the underlying enum
i thoght it meant reproducible in c
I like it
@deep mulch be quiet!
enum Guh(char)
idk
@deep mulch shut uuup
@deep mulch sybau
python ahhhh extend class syntax
@hoary sluice
i think its time to watch italian brainron compilations
ughhhhh i think its time for the cursed question
you are
capybari cocosini
zeet disable huskbot
: what happened on 16/7/2024
never
there aren't 16 months idiot
i remembered the date i didnt even need to check 
what happened on 07/16/2024
america try not to be wrong challenge (impossible)
nop
how does (zig | go | jai | odin | v) do the syntax for repr of enums
It's better than ((u8) (...)), comptime function
go doesn't have enums
i know about that actually
it's just a group of constants lol
infinitely better than the current syntax
zeet loves ts enums
nop
type Something int
const (
Abc Something = iota,
B,
C
)
go
@valid jetty add iota
What do you like about it? the iota thing?
yeah the fact it scales for each constant
@frosty obsidian i wish kotlin enums had iota
yea that's the only good thing about it
don't know what iota is
its the current value
Number counter
its a counter
ok well i think actually im gonna leave enums like this for the time being
Zig enums:
const Value2 = enum(u32) {
hundred = 100,
thousand = 1000,
million = 1000000,
next,
};
i have to write documentation + fix treesitter + other stuff
interesitng
Zig's enums allow you to define types with a restricted set of named values.
does zig inline enums to the value?
how does it know the growth factor
isnt that what every language does
enums are compile time sugar
not jvm
husk
enum Color as u8 {
red // the default start value is 0
green // the value is automatically incremented to 1
blue // the final value is now 2
}
v 🤮
where comma
thats the same as elle except for the as u8
\n
@valid jetty do you know how brr brr patapims court case is going
nop
It only increases by one and you can overwrite it, like in typescript
all i know about zig's enums is that you can do this and it's very convenient
enum Color @repr(u8) {
Red,
Green,
Blue
};
``` elle
okay what about
oh its like odin
swift
ig
the attribute order doesn't matter or? @valid jetty
now its just rust but the # and @ are swapped around
elle already is rust
nope order doesnt matter but it must be between the enum name and {
all languages have been made already
@frosty obsidian frog lang
just capture all annotations and use them
thats just where its checked for
i would make my own language but i have too many other projects
annotations should be optional imo
Like java
noone is forcing you to @repr(u8)
if you dont it will just use i32
@deep mulch in my showperms rewrite i have every permission in one big enum and i use the ordinal as the shift amount
enum Color : u8 {
Red,
Green,
Blue
}
there's 51 permissions now
by far the best of all
don't agree
discord will run out at some point
that works
show it
hm?
getting dangerously close to my idea
technically this is inconsistent with function return types and constants
if i were to make it consistent with constants it would be
enum u8 Color {
Red,
Green,
Blue
};
and with functions
enum Color -> u8 {
Red,
Green,
Blue
};
but both of those are bad
even closer to my bad idea
my idea best
zeet knows thats true
putting a colon when a colon is not used in like any other part of the language is pretty bad i think
(λc.λr.λg.λb.c r g b) (λr.λg.λb.r) (λr.λg.λb.g) (λr.λg.λb.b)
this is the only real solution
i hate that i understand what you wrote
@valid jetty is an alien
@frosty obsidian what was your idea
i said u8 enum Guh as a joke earlier
def red(r, g, b):
return r
def green(r, g, b):
return g
def blue(r, g, b):
return b
def match(one_of, r, g, b):
return one_of(r, g, b)
made it intentionally bad and zeet fell for it
theres only 3 problems in computer science
coming up with syntax for enums, cache invalidation, naming things, and off by one errors
there are no problems in computer science
you can use bracket notation to compute everything
rosie knows everything
should i allow for bool literals
in enum defs
you can already do hex and binary and stuff because those are just lexing-time syntax sugar
No
Keep the annotation
@repr?
idk i dont mind
im drawn to both @repr(u8) and just u8
though parsing that will be kinda annoying
jsfuck
I would use annotation to keep consistent
you can define any computation using only the iota combinator and parentheses, if you use () to denote iota then you can express any computation using only the characters ( and )
this is the identity combinator written using only ()
(()(())) (()(()))
Or I remember that you said you want something like Struct[alloc=...] {}
in constructors
yeah
nope i mean literally only ( and ) and nothing else
thats just inventing a second system for annotations tho surely
hmm ok
Btw do you have hardcoded annotations?
In formal language theory and computer science, Iota and Jot (from Greek iota ι, Hebrew yodh י, the smallest letters in those two alphabets) are languages, extremely minimalist formal systems, designed to be even simpler than other more popular alternatives, such as lambda calculus and SKI combinator calculus. Thus, they can also be considere...
jot
for now yes because they flip booleans or change things internally at the parsing stage
no need to over-engineer it
#[derive(Debug, Clone)]
pub enum Attribute {
// Allows an external function marked by this to be renamed to another symbol
Alias,
// Ensures a function marked by this is not cleaned up if it is never used
Volatile,
// Ensures no formatter is set by default on a struct marked by this
NoFormat,
// Automatically runs the formatter on every parameter of a function marked by this
Format,
// Representation of the inner type in an enum
Repr,
}
impl Token {
/// Ensures an attribute is valid and returns its enum variant
pub fn parse_attribute(&self) -> Attribute {
if self.kind != TokenKind::Identifier {
elle_error!(self
.location
.borrow()
.error("Tried to parse an attribute on a non-identifier token"));
}
let attribute = self.value.get_string_inner().unwrap();
match attribute.as_str() {
"alias" => Attribute::Alias,
"volatile" => Attribute::Volatile,
"nofmt" => Attribute::NoFormat,
"fmt" => Attribute::Format,
"repr" => Attribute::Repr,
_ => todo!("more attributes: {attribute}"),
}
}
}
👍
rewrite the elle compiler in elle and then include the entire source code of the elle elle compiler in every elle program to allow elle users to use elle to rewrite elle elle syntax and then compile the elle elle compiler that the elle user just modified using the elle elle compiler to give them an elle elle compiler that compiles elle as they desire so you end up with elle elle macros without having to implement elle elle macros in the elle elle compiler
oh and for the record unwrap on get_string_inner is safe because tokens with the kind Identifier will always have a string value
i love infinitely recursive quines
but how is it a quine
Which one do you like more? rust's macros or zig's comptime
its like a rust proc macro except you modify the source code directly instead of via an exposed api named the "proc macro"
never used zig before
saw it like twice i think
proc macros are amazing
use .expect
in case it isnt safe
it is absolutely safe
there are a billion asserts everywhere that Identifier will only ever have string
use dioxus::prelude::*;
pub fn App() -> Element {
let mut count = use_signal(|| 0);
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
}
}
use expect
this is the point of expect
you expect it to work
what if you get a cosmic bit shift
i usually just use .unwrap_or_else(|| elle_error!())
@placid cape ```rs
use yew::prelude::*;
html! {
<div>
<div data-key="abc"></div>
<div class="parent">
<span class="child" value="anything"></span>
<label for="first-name">{ "First Name" }</label>
<input type="text" id="first-name" value="placeholder" />
<input type="checkbox" checked=true />
<textarea value="write a story" />
<select name="status">
<option selected=true disabled=false value="">{ "Selected" }</option>
<option selected=false disabled=true value="">{ "Unselected" }</option>
</select>
</div>
</div>
};
this is valid rust
yeah !!! i love proc macros
btw lmao
i accidentally dreamed up of that pattern on my own
fn main() {
rl::init_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Counter :3");
defer rl::close_window();
rl::set_target_fps(60);
counter := 0;
while !rl::window_should_close() {
rl::begin_drawing();
defer rl::end_drawing();
rl::clear_background(BACKGROUND);
mouse_pos := rl::get_mouse_position();
render_button("Increment", 1, mouse_pos, &counter, fn(i32 *counter) { *counter += 1; });
render_button("Decrement", -0.35, mouse_pos, &counter, fn(i32 *counter) { *counter -= 1; });
render_button("Reset", -1.7, mouse_pos, &counter, fn(i32 *counter) { *counter = 0; });
count := "Counter: {}".format(counter);
rl::draw_text(count, (SCREEN_WIDTH - rl::measure_text(count, 40)) / 2, 100, 40, WHITE);
}
}
although not with move because screw move semantics
cool
well yeah that's not possible in zig
what abt it
i wonder if theres a neater way to approach that
@valid jetty listens to this https://youtu.be/JWxYFXCInbg
Unknown P jumped on the remix of ‘Opp Thot’ by Poundz #unknownp
accurate statement
oh god you havent heard mc hammersmith before
look him up :)
this is a remix of a song where one of the lyrics is unironically "i could never wifey an opp thot"
@valid jetty @valid jetty
@valid jetty
not a good mock cause its like old jazz or smth and not drill like the actual english rappers
its meant to be satire
literally read the lyrics
yes i know but the one i sent does it better cause it uses the same genre
its not funny when he does it 713 times
why were enums so fucking easy to implement
i was expecting to spend a few days i did it in like 4 hours
though i guess theyre stupider enums because they cant hold a value but theyre still enums
@valid jetty hiii
bananas
what even is this type????
which is better
@deep mulch @nimble bone @royal nymph

should really make a trait for it 
trait UnwrapElleError<T> {
fn unwrap_elle<F>(&self, f: F) -> T
where
F: FnMut(Location);
}
impl<T, E> UnwrapElleError<T> for Result<T, E> {
fn unwrap_elle<F>(&self, f: F) -> T
where
F: FnMut(Location)
{
// panic or whatever the macro does
}
}
this is great and all until you realize things can have more than just an on_click handler 😔
also immediate mode ui is pain
(personally)
great idea
april 25 2025
That is today
so bad
i stayed up way too late fixing lint warnings
Did you have hundreds of unaddressed lints or did you change your clippy settings
i changed my clippy settings
all + pedantic + nursery + cargo iirc
i wanted to go through them 1 by 1 because there was like 700 and i don’t wanna just apply random changes to my code that large
(i’m not done yet)
Top Track
Kitchen Wall Clock Ticking - Extended Version
ASMR Sound Studio
yeah i left it overnight for a day or two as sleeping noise before i realized
lol
thankfully i realized early enough that there aren’t that many scrobbles
Rosie sleep scrobbler...
i love breaking c abi..//
What They're Doing Is Very Smart but Also Very Dangerous…
Yes
x.bar() is the same as X::bar(x)
Other than dot syntax implicitly adding & or &mut as needed
ty
@valid jetty how do i handle result values that cant be err because the parser already makes sure its correct
Why is it a Result if it can't be err
in this case the parser looks for an identifier, thats the function name, then it checks if its followed by another TokenKind::Identifier and if its not it throws an error, then when the interpreter looks at the ast it sees a Token followed by a Token wrapped in a Expression::Call, both those tokens have kind = TokenKind::Identifier but the interpreter doesnt know that
Sounds like your ast is insufficiently typed then
yea it probably is
should i make the function name String
Assignment {
name: Token,
parameter: Token,
body: Box<Expression>,
},
vs
Assignment {
name: String,
parameter: String,
body: Box<Expression>,
},
well not actual string, itd be a string with a location
sigmalicious
Types should always reflect what the variable contains
So the name can be {
kind is identifier, value is the string name
no thats rejected by the lexer
yea it was easiest in the parser to just use token since what the parser sees is a token and just forwards it
so youre saying i should make a eparate type in the parser for identifiers
Yes
If something has a specific type, then the type of the thing should reflect that
same thing for functions then i guess
but idk
functions are wrapped inside Value and are siblings of Integer, Boolean, etc, so anything can evaluate to a function but inside the call evaluation i have to unwrap value even tho it can only be Function
i did not think about this when i designed the enums
oh wait it just work
s
nvm
ok identity functions and literals work
foo x = x
foo 3
foo x = 7
foo 3
bar y = foo y
foo x = x
bar 8
this returns 8
woohoo
now make recursion
you saw the talk you should know how ;3
i know how but my code is ugly and i dont have nearly enough features to warrant recursion
i have literally only number / string / bool literals but no operations on them so to calculate anything you have to write out the lambda calculus implementation
well surely you make numbers and strings out of church notation right
making them just interpret to the right thing means the language isnt really purely functional unless 3 is sugar for \f x -> f (f (f x))
thats slow tho
i could yes
at least i hope
do it !!!!
the best thing about church numerals is that you can do stuff like for = \n x -> n x to loop
like for 3 (print "hi")
nope i dont think i can
wait
idk
what should this evaluate to
b y = y
a x = b
a 3 4
4 right?
yes
how do i make true in this
\x.\y.x is true right
im not completely sure if it preserver the environment but i intended for everything to be global
true1 y = x
true x = true1
true 3 4
ill try this in a bit
yes
but the point isnt to play with alternate syntax named lambda calculus
its to make sugar for it
lmao
you should make a language like apl
i feel like if you properly learn it you can be faster than a functional lang
is that the one uiua is inspired by
yes and bqn
banana
the goal isnt purely just to be faster at aoc i also just wanna make a language
currying is one of the concepts of all time
i didnt think itd just work
that’s what i said
.
oh i thought u mean learn apl
what paradigm is apl
i mean i wanna make pretty much just sugary haskell with different monad/type handling
functional iirc
or well
its a lot more terse
technically its an "array" language
but i think its still functional
@fleet cedar i can have a &Box<Option<Type>> where Type doesnt implement Copy
i can prevent cloning it and get a Option<&Type> without consuming the inner T by doing this
ty.as_ref().as_ref().map_or_else(|| name.into(), |ty| format!("{name}({})", ty.display()))
but as_ref twice is really ugly and i cant find a more concise way to do that
How do you get a Box<Option<T>> in the first place? Generics stuff?
yeah
I'd probably do Option::as_ref(ty).map_or_else to get those derefs happening automatically
the Enum type's rhs can optionally be the repr type which becomes Type::Word if it doesnt exist, ie
Type::Enum(String, Box<Option<Type>>)
i have to Box<T> it because Option<T> includes the size of the Type and if i dont itll be recursive without direction (infinitely sized)
i see
Option<Box<T>> is better than Box<Option<T>> if you can
Anyone here interested in learning python, java or html?
@valid jetty hii
@deep mulch minkscript when
soon
this is so nice
- Self::Enum(_, inner) => inner.clone().map(|x| x.is_map_to_int()).unwrap_or(false),
+ Self::Enum(_, inner) => Option::as_ref(inner).is_some_and(Self::is_map_to_int),
@deep mulch loves java
Just asking, are you?
well i already know all of them
anyone here knows those already
i mean...
always want to
There are people who don’t
And I just wanted to ask
@valid jetty it works
