#🪅-progaming

1 messages · Page 72 of 1

hoary sluice
#

huh

#

yes it will

formal belfry
#

vim diesel

valid jetty
#

oh it does wtf

#

i never noticed this

formal belfry
#

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...

▶ Play video
hoary sluice
#

this is normal vim behavior

#

how did u not notice it

#

it gets in the way so much

valid jetty
#

on that note i discovered the best way to take notes

valid jetty
hoary sluice
#

why are there a bunch of ::

valid jetty
#

it helps me remember it for some reason

#

i have no idea why

hoary sluice
#

rosie did you make types first or other stuff first

valid jetty
#

wdym

hoary sluice
#

i initially made just functions with no type checking

#

did u do that too

#

or type checking first

valid jetty
#

yes ofc

hoary sluice
#

ofc type checking first?

valid jetty
#

the initial compiler just generated calls to functions arbitrarily

#

qbe lets you do that

hoary sluice
#

that yes ofc doesnt answer my question

#

i stated two options, you answered yes

valid jetty
#

itll just fail at link time if the function doesnt exist but if you pass wrong arguments its just undefined behavior

hoary sluice
#

ok

#

also im gonna remove shadowing to simplify things

#

remove scopes

#

make everything global

valid jetty
#

lmao

#

you should look at the first draft of my compiler the code was geuinely beautiful

hoary sluice
#

is that sarcastic

valid jetty
#

and this

hoary sluice
#

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

valid jetty
#

it could barely compile a basic program

hoary sluice
valid jetty
#

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

hoary sluice
#

wlats yield int

valid jetty
# hoary sluice wlats yield int

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);
}
deep mulch
#

that for statement 😭

hoary sluice
#

please just make varargs a normal array

valid jetty
valid jetty
hoary sluice
#

but you shouldnt have that

hoary sluice
deep mulch
valid jetty
hoary sluice
valid jetty
deep mulch
#

Rosie making js

formal belfry
#

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...

▶ Play video
hoary sluice
hoary sluice
valid jetty
#

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

formal belfry
hoary sluice
#

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

deep mulch
hoary sluice
#

where

deep mulch
#

open by default

lucid trail
#

"p" -> '"_dP'

#

i cant live without it

#

also do you sync vim clipboard with system clipboard?

hoary sluice
#

you delete into the black hole register then paste effectively copying nothing because its deleted

lucid trail
hoary sluice
#

typing "+p on this takes approximately 4 years

lucid trail
#

i really want one of those

#

crone choc?

hoary sluice
#

i have 4 spare pcbs

hoary sluice
#

wish i got a corne

#

i really want those 2 extra thumb keys

lucid trail
#

i was seriously considering a corne but i mainly program on my laptop so it's not justifiable

hoary sluice
lucid trail
#

LOL that fan into laptop setup is a classic

frosty obsidian
#

innovative cooling solution

hoary sluice
#

havent gotten rid of it since my last among us session like a month ago

lucid trail
hoary sluice
#

i paid more like 280

lucid trail
#

that's a horrible deal

hoary sluice
#

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

lucid trail
#

might as well buy a CNC-ed aluminum housing from JLCCNC

hoary sluice
#

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

lucid trail
#

insane

#

what switches do you have in there rn?

#

though I'm not very familiar with low profile ones

hoary sluice
#

my keycaps have this annoying slope on the sides

#

might get new ones soon

lucid trail
#

oh yeah if I ever buy one i'd want hall effect switches for sure

hoary sluice
#

yea have fun getting low profile hall effect on a well designed pcb

lucid trail
#

I've used linear switches for so long idk how I would feel using tactile ones

hoary sluice
#

id just get a voyager

#

im prob gonna buy one soon

#

its expensive but worth it

#

365$ but its soo nice

lucid trail
#

yeah

#

I'm quite scared of getting an RSI but I'm not actively doing anything to prevent it either

hoary sluice
#

you get a carrying case and extra caps

lucid trail
#

i saw a review of it where a guy mounted it to his desk almost vertically

hoary sluice
#

yea ive seen it

#

im scared of getting a keyboard with a trrs connection cause it shorts vcc and gnd if u unplug it

hoary sluice
#

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

valid jetty
#

consider macos keyboard

#

very short travel time

#

nice switches

#

its amazing to type on

#

tactile and fast

deep mulch
#

no

hoary sluice
valid jetty
#

its really good can confirm

#

my thinkpad keyboard is similar but longer travel time

#

which i sometimes prefer but whatever

lucid trail
#

macOS keyboard is peak

deep mulch
#

Rosie has tiny fingers

lucid trail
#

low travel => more accurate and faster

hoary sluice
#

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

lucid trail
#

what layout are you using

deep mulch
#

Rosie struggles to push the keys down

hoary sluice
#

under ring finger movements

lucid trail
#

as a side note are your vim keys still hjkl

valid jetty
hoary sluice
hoary sluice
#

theyre also close physically

lucid trail
#

high (left), lower (right)

hoary sluice
#

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

supple whale
#

opens theo stream for 1s, sees this, leaves

hoary sluice
#

this is fake

supple whale
#

nah this is legit a ss from his stream 10 seconds ago

hoary sluice
#

@valid jetty this is so hard to get intuition for

valid jetty
#

no not really

lucid trail
#

I think I know which video this is from

valid jetty
#

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

deep mulch
#

when Rosie says something isn't complicated it usually is complicated

valid jetty
deep mulch
#

IDK

#

😭

valid jetty
#

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

lucid trail
#

basically not reverses the order of the args

valid jetty
#

yeah exactly

lucid trail
#

const NOT = b => x => y => b(y)(x);

hoary sluice
valid jetty
#

in the case of the image eagely sent, TRUE = λab.a, FALSE = λab.b

so applying NOT TRUE would be doing TRUE FALSE TRUE

valid jetty
winged mantle
#

function not(b) { return Boolean(b) === false; }

hoary sluice
#

like if i read the equivalent as an imperative function id probably understand it

valid jetty
hoary sluice
#

i just need to feed myself more lambda calculus

#

so i have the same intuition

valid jetty
#

thinking of TRUE as a function that always picks the first argument is a good way to think about it

hoary sluice
#

also this is really funny and actually makes sense

valid jetty
#

because NOT true would make it just pick the second argument

hoary sluice
#

and how the guy explained it

valid jetty
#

i like the isZero implementation

#

idk if its in the video

hoary sluice
#

u dont need to teach me lambda calculus ik how it works

valid jetty
#

lol okk

hoary sluice
#

i just need to see more examples and understand them

#

so i can read it fast

valid jetty
#

start with the 2 things i wrote in js a few days ago

#

try and understand it

hoary sluice
#

husk tomorrow

valid jetty
#

okkk

hoary sluice
delicate groveBOT
#

Alright @hoary sluice, in 19 hours: horror

valid jetty
#

fizzbuzz isnt as interesting as the div impl

#

i wanted to do it with the Y combinator

hoary sluice
valid jetty
#

did they ever explain how IS_0 works tho

hoary sluice
#

idk yet

#

probably

#

now hes talking about y combinator i think

valid jetty
#

ycomb my beloved

hoary sluice
#

now were talking about the riemann hypothesis?????

deep mulch
hoary sluice
#

math is scarily interrelated

valid jetty
# deep mulch i read htis twice and i still dont know what youre saying

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

hoary sluice
# deep mulch i read htis twice and i still dont know what youre saying

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))

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...

▶ Play video
formal belfry
#

the hell

#

what is this

valid jetty
hoary sluice
#

@deep mulch watch the video

valid jetty
#

i think the way i was explaining it is easier maybe

hoary sluice
#

nope

#

neither is a good explanation

#

the video is a good explanation

valid jetty
#

its a good video but you dont need to watch a video to understand booleans

hoary sluice
valid jetty
#

true

deep mulch
valid jetty
#

why husk i spent time writing that

#

smh

formal belfry
#

pdf

valid jetty
#

oh

#

.

#

i love ghost pinging zoot

lucid trail
#

the kerning on those italics are horrendous

valid jetty
#

true

valid jetty
#

i forgot this is a real thing you can do

leaden crater
placid cape
#

Rosie I have a challenge for you

#

Try to sleep for more than 5 hours a day :d

dense sand
#

impossible

deep mulch
#

impossible

leaden crater
#

@deep mulch

deep mulch
#

@leaden crater

placid cape
#

@placid cape

deep mulch
#

@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

placid cape
#

Time for parser

leaden crater
deep mulch
deep mulch
spark tiger
#

like unemployed ppl??

placid cape
#

5 hours is a lot?

spark tiger
#

i sleep like 3 hours at night

#

and then 3ish in the evening

valid jetty
#

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”
    }]
  }]
}
deep mulch
#

nini @valid jetty @valid jetty

ornate quiver
#

nini

ionic lake
#

nini

hoary sluice
#

THIS IS THE BEST DAY OF MY LIFE

frosty obsidian
#

i bet its in kotlin

valid jetty
#

@hoary sluice i got 8 hours of sleep (this week) are you proud

balmy lintel
#

you will die shortly

hoary sluice
hoary sluice
#

although you might be very soon

hoary sluice
#

u can see from the print output

#

thats kotlin enum formatting

#

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...

▶ Play video
#

nop wrong link

#

watch this

valid jetty
#

good talk

#

this guy is NOT an inexperienced functional programmer like he says

placid cape
hoary sluice
#

@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
fleet cedar
#

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

hoary sluice
#

my lambdas before this were { identifier } $ body

#

required () unless theyre on their own line

hoary sluice
#

except instead of doing it the stupid way with lambda x y: x + y or (x y $ x + y)

valid jetty
#

i am NOT copy pasting that every time i want a function

hoary sluice
#

ctrl shift u 03bb enter

#

Έ

#

oops

#

λ

#

typed 0388 there cause i did unpress number layer toggle husk

hoary sluice
hoary sluice
#

what

valid jetty
#

rust throwing the best warnings

winged mantle
#

rust hates clean code

valid jetty
#

clippy::restriction my beloved

fleet cedar
#

Rust code is clean af

#

It does not adhere to Clean Code™️'s nonsensical rules though

valid jetty
#

how tf is rust able to make such amazing analysis of my code

calm walrus
#

rust being so predictable that it can actually infer what may have went wrong is so awesome.

deep mulch
#

@valid jetty hiii

valid jetty
#

like this is cool

placid cape
deep mulch
#

@valid jetty what fields should my token class have

valid jetty
deep mulch
#

guh?

#

does EOF get a token?

fleet cedar
#

Some parsers do, others don't

#

Doesn't matter all that much

deep mulch
#

@valid jetty help how do i make the parser

valid jetty
deep mulch
#

would elle be a good reference

valid jetty
#

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

deep mulch
#

guh!

#

husk

valid jetty
#

though the ichigo one doesnt do binop parsing

deep mulch
#

what is binop

valid jetty
#

binary operations

#

+, -, *, /, %,>>, <<, etc

deep mulch
#

oh

#

i thought binary woas just shifting

#

<< || &&

valid jetty
#

nop binary means two

#

two arguments, left and right hand side

deep mulch
#

and + - * / was arithmetic operations

fleet cedar
valid jetty
#

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"); // 「じょうよ」と読みます
}
fleet cedar
#

And &&/|| aren't bitwise anyway

deep mulch
#

does ichigo not do a tree

valid jetty
#

it does its right there

#

self.tree.push

#

the top level usually isnt AstNode, its a "Primitive"

deep mulch
#

i am struggling to read elle

valid jetty
#

how

deep mulch
#

too rusty

#

@valid jetty@valid jetty document ichigo source code

#

and use english

valid jetty
#

uhhhhhhhhhh

#

i need to do that eventually

#

i need to write a paper on it

deep mulch
#

@valid jetty im confused

#

you have primitive and astnode

#

whats the difference

valid jetty
#

primitive is top level stuff (functions only in ichigo but for elle thats functions, enums, namespaces, structs, constants)

#

astnode is just a statement

fleet cedar
#

That's a strange definition of primitive

valid jetty
#

idk thats what i called it when i first wrote this thing

deep mulch
winged mantle
#

😭

#

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

fleet cedar
#

Probably some weird lsp synch issue

winged mantle
#

i hope so

#

if this broke ci too that would be a pain

deep mulch
#

is expression just another name for an ast node

fleet cedar
#

No

deep mulch
#

oh

winged mantle
#

isn't it something which has a value

fleet cedar
#

Typically you'd have a typed ast where statements are one type, expressions are another, etc

deep mulch
#

so a node would be the base for everything?

fleet cedar
#

?

deep mulch
#

like the tree would be made from nodes and expressions would be an implementation of the node

fleet cedar
#

Nah, there's no point in having a Node trait imo

#

Like, what behavior would that represent

placid cape
deep mulch
#

idk I thought it was the standard type

placid cape
fleet cedar
#

Traits are useful when they're useful

#

If they aren't useful, no point in having them

deep mulch
#

I don't do rust so idk much about traits

placid cape
fleet cedar
placid cape
fleet cedar
#

Abstractions that aren't useful aren't useful

deep mulch
#

oh

winged mantle
placid cape
#

some ts boy will reproduce it

winged mantle
#

a good issue should have a minimal reproducible example

placid cape
#

yea

deep mulch
placid cape
#

but i think it's still better to create the issue even without a minimal example than not to create one

#

well idk

valid jetty
#

i’m adding enums

#

do i make Foo::A or Foo.A???

#

to keep it consistent i’ll probably do Foo::A

fleet cedar
#

How do you use :: vs . in other cases?

valid jetty
#

ie Foo::new() (without a self instance)

fleet cedar
#

In rust it's that you have . if lhs is a value and :: if there's a type/path

ionic lake
#

::

valid jetty
#

alright i’ll do :: then

#

are enum variants always known at compile time

#

like their inner value

fleet cedar
#

Which ones exist, yes

#

Which one a specific variable contains, no

valid jetty
#

can you put arbitrary code in A = … or is it a constexpr

#

like enum Foo { A = … }

fleet cedar
#

Discriminants are pointless anyway

#

They're useful for some derive macros I guess

valid jetty
#

not really if you want an enum with strings or one that starts at something other than 0

fleet cedar
#

Enums are their own types

#

They aren't strings or integers

valid jetty
#

i know but i mean the repr type lol

fleet cedar
#

Unimportant other than ffi

valid jetty
#

ya ya but useful for printing them

fleet cedar
#

No

#

The variants have names already

valid jetty
#

i have basic ones done tho

#

ideally theyre not a function theyre just sugar for a enum-typed literal

fleet cedar
#

But what's the value in printing the memory representation, do you write strings as "Hello" = 48 65 6c 6c 6f too?

valid jetty
#

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

hoary sluice
valid jetty
#

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

hoary sluice
#

you dont have a parser yet so whether its an intepreter or a compiler doesnt matter

valid jetty
hoary sluice
valid jetty
glacial mirage
#

not if i make | and & bitwise, || and && logical, and or and and logical + short circuiting

valid jetty
#

THATS WORSE

deep mulch
valid jetty
deep mulch
#

.

valid jetty
#

but non-instance functions use ::

#

you do foo_instance.xyz() but FooTheType::xyz()

#

it would make sense to have :: for enums

deep mulch
#

ulgy

#

so :: is for static?

valid jetty
#

yea

#

well its not static

#

it just doesnt require a self

deep mulch
#

implicit self when

#

@valid jetty @valid jetty

valid jetty
deep mulch
#

nop

#

you love 1000 self

valid jetty
#

its good for looking at signatures of functions

#

you know whether its an instance method or not

deep mulch
#

it just clutters code

#

if you're operating in the scope of the instance it makes sense the methods come from the instance

valid jetty
#

??? you can have both

fleet cedar
valid jetty
#
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

dense sand
#

elle discord support when

valid jetty
#

at some point in the distant future lol but idk if ill be the one to make that

delicate groveBOT
#

@hoary sluice, <t:1745444598:R>: horror

deep mulch
#

at least maybe compromise by removing self as a required parameter and implicitly have it available

#

Guhhh

#

implicit return type husk

valid jetty
deep mulch
#
fn Foo::y(): i32 {
    return self.x + 1;
}
placid cape
#

?

valid jetty
#

the main problem is you dont know, as the caller, whether its an instance method or not

deep mulch
#

okay but I don't understand the implicit return type cause you can argue the same situation for the self

valid jetty
#

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

placid cape
#

How the heck you want to know if the method is static or not without explicit self/keyword?

fleet cedar
#

Implicit return type requires global reasoning, which is slow and fragile

placid cape
valid jetty
#

the implicit return type also serves the purpose of ensuring all code paths return the same type (or an implicitly convertible one)

deep mulch
#

I'd do it

placid cape
#

don't make elle second javascript

deep mulch
#

Elle will have JavaScript concatenation

placid cape
deep mulch
#

yss

fleet cedar
#

Imo less magic is better

#

So x.foo() being the same as X::foo(x) is a good thing

winged mantle
#

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..)

fleet cedar
#

"Many languages do it" doesn't mean it's not magic

deep mulch
#

@winged mantle kode tode

valid jetty
winged mantle
#

it's not like people will have trouble understanding it

#

I think having more ways to do the same thing is confusing

fleet cedar
#

Agreed

#

Having foo and self.foo be the same thing is just weird

placid cape
#

it's nice

deep mulch
#

it's useful if you have a local variable with the same name

meager solstice
#

i am currently making a python learning tool for the raspberry pi that helps others learn python 100% free and pretty easy!

fleet cedar
#

In rust the only difference between self and not is that you can call them with dot syntax

#

Nothing else

jade stone
#

im so good at performance blobcatcozy

valid jetty
#

do i allow strings to be values in the enum

formal belfry
#

popsicle

valid jetty
#

so you can doo

enum Bar {
    Colon3 = ":3",
    Abc = "abc"
};
formal belfry
#
enum EBar {
    Colon3 = ":3",
    Abc = "abc"
};
valid jetty
#

horror

formal belfry
#

peak

deep mulch
#

enum Bar string

#

enum Bar<string>

spark tiger
#

til u can use windows executables inside wsl

jade stone
#

like enums in typescript

deep mulch
#

hm

fleet cedar
#

Yeah but TS is a completely different type system paradigm

#

Lattice based, rather than semiring based

deep mulch
#

as long as rosie doesnt implement something insane like
enum Guh {
a = 3,
b = "b"
}

placid cape
#

Or idk

hoary sluice
placid cape
#

Do you want real enums or something rust's enums?

fleet cedar
#

Better question

#

Do you want real enums or something like C's enums

valid jetty
#

these are real enums

hoary sluice
#

please make them castable to strings without implementing a switch case for ik

#

it

valid jetty
#

but the issue arises that i cant very easily account for offsets when the variants can be strings

fleet cedar
#

Enums are superior to named constants in every way

valid jetty
#

you cant #cast(string, my_thing) because thats an IR-level promotion demotion of types

placid cape
#

Elle macros/comptime when

deep mulch
#

Elle pre processor when

hoary sluice
#

@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

valid jetty
deep mulch
#

@hoary sluice will learn about 5g protocol

valid jetty
#

@deep mulch

deep mulch
#

@repr(u8) is so odd looking

#

@valid jetty whats the value of B, C, D

valid jetty
#

look at the output

deep mulch
#

i cant

valid jetty
deep mulch
#

i will fix elle syntax

valid jetty
#

whats wrong with it

deep mulch
#

too weird

#

#cast(u8 is ulgy

hazy pine
supple whale
deep mulch
#

rust 2

hoary sluice
#

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

valid jetty
supple whale
#

welp i need to migrate to oxlint

#

esling is dying

#

my ts server is too

#

i'm running out of ideas

valid jetty
#

i want to make it very restrictive

hoary sluice
hoary sluice
#

make enums be like in rust

#

rust did them perfectly

deep mulch
valid jetty
#

suggest syntax then

hoary sluice
#

copy rust

deep mulch
#

enum Guh<char>

#

why is the enum plural

#

enums should always be singular

valid jetty
hoary sluice
#

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?

valid jetty
hoary sluice
#

elle more like typescript

placid cape
#

What repr stands for?

valid jetty
#

representation

placid cape
#

Oh okay

valid jetty
#

the type of the underlying enum

hoary sluice
#

i thoght it meant reproducible in c

placid cape
#

I like it

formal belfry
#

@deep mulch be quiet!

formal belfry
#

@deep mulch shut uuup

hoary sluice
#

@deep mulch sybau

placid cape
deep mulch
#

@hoary sluice

hoary sluice
#

i think its time to watch italian brainron compilations

frosty obsidian
#

char enum Guh trolleylag trolleylag trolleylag

#

i add three trolley emotes and zeet still takes it seriously

valid jetty
#

ughhhhh i think its time for the cursed question

deep mulch
#

you are

hoary sluice
#

capybari cocosini

frosty obsidian
#

zeet disable huskbot

hoary sluice
deep mulch
frosty obsidian
#

there aren't 16 months idiot

hoary sluice
#

i remembered the date i didnt even need to check husk

deep mulch
hoary sluice
deep mulch
#

nop

valid jetty
#

how does (zig | go | jai | odin | v) do the syntax for repr of enums

placid cape
placid cape
deep mulch
#

i mean

#

rosie could just have done cast<u8>(value)

valid jetty
placid cape
#

it's just a group of constants lol

deep mulch
#

infinitely better than the current syntax

frosty obsidian
#

zeet loves ts enums

deep mulch
placid cape
#

go

valid jetty
#
const (
    FOO = 2 * iota - 1 // 0
    BAR, // 1
    BAZ // 3
);
``` i sorta like this
#

yeah

deep mulch
#

@valid jetty add iota

placid cape
valid jetty
#

yeah the fact it scales for each constant

deep mulch
#

@frosty obsidian i wish kotlin enums had iota

valid jetty
#

you could make it double every time and have it be a bitmask

#

its kinda cool

placid cape
#

yea that's the only good thing about it

frosty obsidian
#

don't know what iota is

deep mulch
#

its the current value

placid cape
valid jetty
#

its a counter

#

ok well i think actually im gonna leave enums like this for the time being

placid cape
#

Zig enums:

const Value2 = enum(u32) {
    hundred = 100,
    thousand = 1000,
    million = 1000000,
    next,
};
valid jetty
#

i have to write documentation + fix treesitter + other stuff

placid cape
deep mulch
#

does zig inline enums to the value?

valid jetty
valid jetty
#

enums are compile time sugar

deep mulch
#

not jvm

valid jetty
#

husk

placid cape
#
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 🤮

deep mulch
#

where comma

valid jetty
#

thats the same as elle except for the as u8

frosty obsidian
hoary sluice
#

@valid jetty do you know how brr brr patapims court case is going

deep mulch
placid cape
spark tiger
valid jetty
#
enum Color @repr(u8) {
    Red,
    Green,
    Blue
};
``` elle
deep mulch
#

okay what about

deep mulch
#
@repr(u8)
enum Color {
    Red,
    Green,
    Blue
};
#

so much better

spark tiger
placid cape
#

the attribute order doesn't matter or? @valid jetty

valid jetty
deep mulch
#

elle already is rust

valid jetty
frosty obsidian
#

all languages have been made already

deep mulch
#

@frosty obsidian frog lang

placid cape
#

just capture all annotations and use them

valid jetty
#

thats just where its checked for

frosty obsidian
#

i would make my own language but i have too many other projects

deep mulch
#

annotations should be optional imo

placid cape
valid jetty
#

if you dont it will just use i32

deep mulch
#

nop

#

it will explode

#

OO i know

frosty obsidian
#

@deep mulch in my showperms rewrite i have every permission in one big enum and i use the ordinal as the shift amount

formal belfry
#
deep mulch
#
enum Color : u8 {
    Red,
    Green,
    Blue
}
frosty obsidian
#

there's 51 permissions now

deep mulch
#

by far the best of all

placid cape
frosty obsidian
#

discord will run out at some point

valid jetty
#

ok i have an idea

#
enum Color u8 {
    Red,
    Green,
    Blue
};
deep mulch
#

that works

placid cape
#

show it

valid jetty
#

hm?

frosty obsidian
#

getting dangerously close to my idea

valid jetty
#

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

frosty obsidian
#

even closer to my bad idea

deep mulch
#

my idea best

frosty obsidian
#

zeet knows thats true

valid jetty
#

putting a colon when a colon is not used in like any other part of the language is pretty bad i think

deep mulch
#

it seems like that now but

#

yu will switch to colon for return types

hoary sluice
#
(λ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

valid jetty
#

i hate that i understand what you wrote

deep mulch
#

@valid jetty is an alien

valid jetty
#

@frosty obsidian what was your idea

frosty obsidian
#

i said u8 enum Guh as a joke earlier

hoary sluice
frosty obsidian
#

made it intentionally bad and zeet fell for it

valid jetty
#

theres only 3 problems in computer science

#

coming up with syntax for enums, cache invalidation, naming things, and off by one errors

hoary sluice
#

there are no problems in computer science

#

you can use bracket notation to compute everything

valid jetty
#

that talk was interesting

#

waitttttttt

deep mulch
#

rosie knows everything

valid jetty
#

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

valid jetty
#

@repr?

placid cape
#

Yes

#

It's optional

valid jetty
#

idk i dont mind

#

im drawn to both @repr(u8) and just u8

#

though parsing that will be kinda annoying

placid cape
#

I would use annotation to keep consistent

hoary sluice
# deep mulch rosie knows everything

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 ()

(()(())) (()(()))
placid cape
#

Or I remember that you said you want something like Struct[alloc=...] {}

royal nymph
placid cape
#

in constructors

valid jetty
#

yeah

placid cape
#

So it could be ```rs
enum Color[...=u8] {}

#

but nvm I like the annotation more

hoary sluice
valid jetty
#

thats just inventing a second system for annotations tho surely

placid cape
#

yeah

#

Just keep the annotation

valid jetty
#

hmm ok

valid jetty
#

rust has been garbage collected since 1.81.0

placid cape
#

Btw do you have hardcoded annotations?

hoary sluice
deep mulch
#

jot

valid jetty
#

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}"),
        }
    }
}
placid cape
#

👍

hoary sluice
#

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

valid jetty
#

oh and for the record unwrap on get_string_inner is safe because tokens with the kind Identifier will always have a string value

valid jetty
hoary sluice
placid cape
#

Which one do you like more? rust's macros or zig's comptime

hoary sluice
#

its like a rust proc macro except you modify the source code directly instead of via an exposed api named the "proc macro"

hoary sluice
#

saw it like twice i think

valid jetty
hoary sluice
#

in case it isnt safe

valid jetty
#

it is absolutely safe

#

there are a billion asserts everywhere that Identifier will only ever have string

hoary sluice
#
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!" }
    }
}
hoary sluice
#

this is the point of expect

#

you expect it to work

valid jetty
#

true

#

good point

hoary sluice
#

what if you get a cosmic bit shift

valid jetty
#

i usually just use .unwrap_or_else(|| elle_error!())

hoary sluice
#

@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

valid jetty
#

yeah !!! i love proc macros

valid jetty
#

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

placid cape
#

well yeah that's not possible in zig

valid jetty
#

i wonder if theres a neater way to approach that

hoary sluice
supple whale
#

accurate statement

valid jetty
#

look him up :)

hoary sluice
#

this is a remix of a song where one of the lyrics is unironically "i could never wifey an opp thot"

valid jetty
#

listen to his real music

#

on spotify

hoary sluice
#

does stuff like "ive definitely got a gun" count

#

or does he actually make music

deep mulch
#

@valid jetty @valid jetty

nimble bone
#

@valid jetty

hoary sluice
valid jetty
#

literally read the lyrics

hoary sluice
hoary sluice
#

its not funny when he does it 713 times

valid jetty
#

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

deep mulch
#

@valid jetty hiii

formal belfry
#

bananas

jade stone
#

what even is this type????

jade stone
#

which is better

jade stone
royal nymph
#
const importSourceId = ret[0];
names = ret[1];
jade stone
dawn ledge
#
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
  }
}
dawn ledge
#

also immediate mode ui is pain

#

(personally)

formal belfry
#

april 25 2025

fleet cedar
#

That is today

deep mulch
#

@valid jetty good morning

#

how was your 2 hour sleep

valid jetty
#

i stayed up way too late fixing lint warnings

fleet cedar
#

Did you have hundreds of unaddressed lints or did you change your clippy settings

valid jetty
#

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)

deep mulch
#

Rosie insane

#

@valid jetty sleep more

nimble bone
#

Top Track
Kitchen Wall Clock Ticking - Extended Version
ASMR Sound Studio

valid jetty
#

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

nimble bone
#

Rosie sleep scrobbler...

valid jetty
#

i love breaking c abi..//

spark tiger
#

What They're Doing Is Very Smart but Also Very Dangerous…

hoary sluice
#

@valid jetty

#
rc.clone();
Rc::clone(rc);
#

are there equivalent

fleet cedar
#

Yes

#

x.bar() is the same as X::bar(x)

#

Other than dot syntax implicitly adding & or &mut as needed

hoary sluice
hoary sluice
#

@valid jetty how do i handle result values that cant be err because the parser already makes sure its correct

fleet cedar
#

Why is it a Result if it can't be err

hoary sluice
# fleet cedar 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

fleet cedar
#

Sounds like your ast is insufficiently typed then

hoary sluice
#

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

formal belfry
#

sigmalicious

fleet cedar
#

Types should always reflect what the variable contains

hoary sluice
#

it contains a token

#

a token has a kind, value and location

fleet cedar
#

So the name can be {

hoary sluice
#

kind is identifier, value is the string name

hoary sluice
fleet cedar
#

But Token can be {

#

Thus, the name is not a Token

hoary sluice
#

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

fleet cedar
#

Yes

#

If something has a specific type, then the type of the thing should reflect that

hoary sluice
#

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

valid jetty
#

now make recursion

hoary sluice
#

lmao no way

#

recursion is not on the list of priorities

valid jetty
#

you saw the talk you should know how ;3

hoary sluice
#

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

valid jetty
#

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))

hoary sluice
#

at least i hope

valid jetty
#

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")

hoary sluice
#

nope i dont think i can

#

wait

#

idk

#

what should this evaluate to

        b y = y
        a x = b
        a 3 4
#

4 right?

valid jetty
#

yes

hoary sluice
#

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

valid jetty
hoary sluice
valid jetty
#

wtf

#

nvm

hoary sluice
#

its to make sugar for it

valid jetty
#

you should make a language like apl

#

i feel like if you properly learn it you can be faster than a functional lang

hoary sluice
#

is that the one uiua is inspired by

valid jetty
#

yes and bqn

formal belfry
#

banana

hoary sluice
hoary sluice
#

i didnt think itd just work

valid jetty
hoary sluice
#

what paradigm is apl

#

i mean i wanna make pretty much just sugary haskell with different monad/type handling

valid jetty
#

or well

#

its a lot more terse

#

technically its an "array" language

#

but i think its still functional

valid jetty
#

@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

fleet cedar
#

How do you get a Box<Option<T>> in the first place? Generics stuff?

valid jetty
#

yeah

fleet cedar
#

I'd probably do Option::as_ref(ty).map_or_else to get those derefs happening automatically

valid jetty
#

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)

fleet cedar
#

Option<Box<T>> is better than Box<Option<T>> if you can

valid jetty
#

oh

#

ok thats helpful

#

oh actually not quite because now i have to box unwrap_ors

meager solstice
#

Anyone here interested in learning python, java or html?

deep mulch
#

@valid jetty hii

valid jetty
#

@deep mulch minkscript when

deep mulch
valid jetty
#

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),
valid jetty
placid cape
#

Lol Duolingo is adding chess

#

that's why they have chess engine in their code

deep mulch
#

@valid jetty wyd

meager solstice
placid cape
hoary sluice
main crypt
#

always want to

meager solstice
#

And I just wanted to ask

hoary sluice
#

@valid jetty it works