#πŸͺ…-progaming

1 messages Β· Page 80 of 1

cinder egret
#

you're sooo insane you're literally a legal citizenfr

#

rename this chat to #politics @royal nymph

valid jetty
#

CALCULUS IS FUN THOUGH

#

i llove calculus

ornate quiver
#

and I'm not talking about me

nimble bone
ornate quiver
cinder egret
valid jetty
#

i read thing about cis women being escorted out of female bathrooms because theyre like butch lesbians or whatever blobcatcozystars

cinder egret
nimble bone
#

vset-name πŸͺ…-progaming

valid jetty
#

republicans when going after trans people affects all people

solid gazelle
nimble bone
solid gazelle
#

when i saw politics channel

valid jetty
#

make it

#

fres goes crazy 39 times a day

royal nymph
#

i go after rosies

solid gazelle
#

I Follow Vees

valid jetty
#

thats literally os evil

#

os evil

#

os evil

#

WHAT

#

so evil

#

omf

royal nymph
#

os evil

valid jetty
#

omg

cinder egret
valid jetty
#

she said rosies plural

cinder egret
#

becuase you're not rosie, you're rosie.pi

valid jetty
#

:(

#

true

#

but youre not rosie, youre faylorist

royal nymph
# royal nymph os evil

i was trying to find a wikihow about editing your own message to link to rosie but it gave this instead

valid jetty
#

@hoary sluice what would i call a conditional compilation attribute???

#

i wanna have something like enum AddressFamily @only_compile_if(target="linux") {}

#

obviously i wouldnt call it only_compile_if but idk what to call it

#

maybe just @if

fleet cedar
#

Rust calls it cfg

valid jetty
#

but thats control flow graph i dont think its a very descriptive name

fleet cedar
#

That is an unrelated thing cfg can also be an abbreviation of, yes

#

Don't see how that's relevant

valid jetty
#

oh it stands for configuration

#

i genuinely thought it stood for control flow graph because youre manipulating the control flow at compile time (by not generating specific parts)

fleet cedar
#

That doesn't make sense since control flow is not involved whatsoever

#

#[cfg] trims things off the ast

valid jetty
#

yeah i guess

hoary sluice
#

the hypocrisy is crazy

hoary sluice
cinder egret
#

πŸ‡ΊπŸ‡Έ πŸ¦…

valid jetty
#

theres some basic conditional compilation i guess

#

it uses rust env::consts values unless you specify them yourself when compiling

#

oh and btw if i make the conditions match it works

valid jetty
#

@hoary sluice echo server opinions???

use std/prelude;
use std/libc/socket;

const PORT = 8080;
const BUFFER_SIZE = 1024;

fn main() {
    fd := socket(AddressFamily::INET, SocketType::STREAM, 0);
    defer close(fd);

    if fd == -1 {
        $panic("Failed to create socket: {}", get_error());
    }

    addr := sockaddr_in {
        sin_family = AddressFamily::INET,
        sin_port = htons(PORT),
        sin_addr = in_addr { s_addr = InAddr::ANY },
    };

    if bind(fd, &addr, #size(addr)) < 0 {
        $panic("Failed to bind to port {}: {}", PORT, get_error());
    }

    if listen(fd, 0) < 0 {
        $panic("Failed to listen at port {}: {}", PORT, get_error());
    }

    $printf("Server is listening on port {}", PORT);

    char buffer[BUFFER_SIZE];
    clientSocket := accept(fd, nil, nil);

    while (received := recv(clientSocket, buffer, BUFFER_SIZE, 0)) > 0 {
        send(clientSocket, buffer, received, 0);
    }
}
``` i think its more readable than C
#

i want to make a socket abstraction to allow you to do this easier but i dont really know the best way to approach that

formal belfry
#

readability refactor (sorta)

valid jetty
#

looks nice

formal belfry
#

ty

winged mantle
#

i need a proper website

#

but i don't really see the point unless it has a very pointless gimmick

shrewd canopy
#

idk if ur language has oop

winged mantle
valid jetty
#

but this is supposed to be using C apis

winged mantle
#

would be much better if panic appeared as a different colour

hoary sluice
winged mantle
#

patch highlight.js

hoary sluice
#

@valid jetty does ellesp highlight unreachable code

winged mantle
#

i propose

#
  • change $panic("message") to scream "message"
hoary sluice
#

but it doesnt scream

winged mantle
#

make the speaker play a sampled scream

fleet cedar
#

Change $panic to $cringe

hoary sluice
winged mantle
#

pr ```elle to highlight.js

hoary sluice
#

altho it has stuff like ebnf which i cant imagine a lot of people send oftan

winged mantle
#

i mean pr elle to highlight.js the ``` thing is markdown sdfhjksfgh

fleet cedar
#

It's not like discord maintains the highlighters themselves

winged mantle
#

i am very intelligent

median root
#

guys is blazingly fast the πŸš€ or the ⚑ ?

winged mantle
#

my iq is hotter than the sun

hoary sluice
#

and memory safe 🦺 πŸ›Ÿ

winged mantle
#

⚑ vite

hoary sluice
#

NOO

median root
hoary sluice
winged mantle
#

⚑vite

median root
#

I couldnt think which was the best to use

winged mantle
#

🧢 yarn

hoary sluice
winged mantle
#

bun bun

median root
valid jetty
#

i think the elle version is easier to read?

winged mantle
valid jetty
#

you can specify that

#

you can do all 3

winged mantle
#

i think that would be better as auto a = 0

hoary sluice
valid jetty
valid jetty
#

thats only because its a direct usage of the C apis

#

in an ideal world i abstract all of this away into a nice custom socket api

hoary sluice
#

@valid jetty

winged mantle
valid jetty
#

imo the first one

winged mantle
hoary sluice
#

rosie you pick what i make tomorrow

  1. let bindings
  2. io
  3. better argument parsing order
hoary sluice
hoary sluice
#

maybe do what 98 said and allow where inline and let in outline

#

whats the opposite of inline

valid jetty
#

named function

winged mantle
# valid jetty

and at that point they're basically the same... which isn't a bad thing

hoary sluice
winged mantle
#

it's pretty impressive to create a language where you can actually write readable code

valid jetty
hoary sluice
#

not inline function

#

just inline anything

winged mantle
#

i am very biased towards c like syntax in terms of how easy i find something to read tbh

valid jetty
#

oh hm

winged mantle
hoary sluice
#

inline variable binding

winged mantle
#

stuff like this throws me off

valid jetty
#

i think its a good idea to have both so you have the choice

winged mantle
#

i feel like there's a missing bracket at the end... so i would end up adding it

hoary sluice
winged mantle
#

and there is a bracket at the start so it looks fine at a glance

hoary sluice
valid jetty
hoary sluice
#

putting where in a normal function isnt very good

winged mantle
#

no i mean while without parens

valid jetty
#

oh you were talking about the wrapping

winged mantle
#

that's a neat feature

hoary sluice
valid jetty
#

at least you get a decent error

winged mantle
#

but i like writing
if (true)
doThing();
too

#

simply use ai parsing

hoary sluice
#

now let me present:

if true
    doThing
winged mantle
#

you would need ai to guess what you're trying to do

hoary sluice
winged mantle
#

(this is a joke i'm sure you don't but there are probably reasons)

hoary sluice
#

i just made it if then else to not bother parsing

valid jetty
#

you can do if true doThing in most cases

winged mantle
#

love how groovy does

#

println "hello"

#

python 2 vibes

valid jetty
#

(not in elle) but parsing it is possible

hoary sluice
winged mantle
#

wdym

#

python 3 functions pretty well too and i don't see it

valid jetty
#
import ballerina/io;

// Uninitialized integer variable `value`.
int value;

// Uninitialized final string variable `name`.
final string name;

function init() returns error? {
    // Initialize the `value` variable to 5.
    value = 5;
    // Initialize the final variable greeting to `James`.
    name = "James";
    
    if value > 3 {
        // The initialization will fail with this error message.
        return error("Value should less than 3");
    }
}

public function main() {
    // This will not be executed because the init function returns an error.
    io:println(name);
}
hoary sluice
#

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state o...

winged mantle
#

what does it mean if you say functional code

valid jetty
#

this gives

import ballerina/http;
import ballerinax/googleapis.sheets;

configurable string githubPAT = ?;
configurable string repository = "ballerina-platform/ballerina-lang";
configurable string sheetsAccessToken = ?;
configurable string spreadSheetId = ?;
configurable string sheetName = "pull-requests";

type PR record {
    string url;
    string title;
    string state;
    string created_at;
    string updated_at;
};

public function main() returns error? {
    http:Client github = check new ("https://api.github.com/repos");
    map<string> headers = {
        "Accept": "application/vnd.github.v3+json",
        "Authorization": "token " + githubPAT
    };
    PR[] prs = check github->/[repository]/pulls(headers);

    sheets:Client gsheets = check new ({auth: {token: sheetsAccessToken}});
    _ = check gsheets->appendValue(spreadSheetId, ["Issue", "Title", "State", "Created At", "Updated At"],
                {sheetName: sheetName});

    foreach var {url, title, state, created_at, updated_at} in prs {
        _ = check gsheets->appendValue(spreadSheetId, [url, title, state, created_at, updated_at],
                    {sheetName: sheetName});
    }
}
``` every language all at once vibes
winged mantle
#

can you not say "that python 3 code is functional"

hoary sluice
#

everything is a function and functions dont have side effects, so if foo(5) = 7 then itll always be 7

valid jetty
#

i have no idea what syntax highlighting to put

hoary sluice
winged mantle
#

as soon as you say functional coding it becomes a specific type of language?

south moon
#

i love macos

hoary sluice
#

its like oop

winged mantle
#

the discrepancy makes no sense

hoary sluice
#

but functionally not object oriented

valid jetty
#

@winged mantle

hoary sluice
#

functional means its based on functions not that it works

winged mantle
#

it's like the burger inside the burger

#

you also call that a burger? just because that's how we do things doesn't mean it makes sense

hoary sluice
#
print (sum (map (^2) (filter even [1..10])))
winged mantle
valid jetty
#

typically people say "purely functional" to have no ambiguities but its also usually just called "functional"

hoary sluice
#

everything these days is bait 😭

#

elle is probably vibe coded bait

winged mantle
#

everything else i say is a troll

hoary sluice
#

this is the first time ive seen u speak since like december i think

winged mantle
winged mantle
#

TIL the burger inside the burger is called... "patty"?

#

but i swear that's also refered to as burger

valid jetty
#

yeah it is lol

winged mantle
#

we need to change terminology

#

we should call code which works functional code and code which is in a functional language, "patty"

valid jetty
#

😭

valid jetty
winged mantle
#

i don't mean it in bad faith i'm just kidding with people

valid jetty
#

i talk with so many people that i dont know someone's skill level at any one time

#

:3

hoary sluice
valid jetty
#

LMAO

winged mantle
#

i thought it was quite the opposite

hoary sluice
fleet cedar
#

How do you think they made the game

hoary sluice
valid jetty
hoary sluice
#

altho its also hard to write fp

hoary sluice
valid jetty
#

fn abort() -> !
fn abort() -> never
fn abort() -> _
fn abort() -> aborts

hoary sluice
fleet cedar
#

fn abort<T>() -> T

valid jetty
#

that

#

what

winged mantle
#

i have only heard about functional programming languages in situations including but not limited to trains running late because of buggy haskell code, a lift breaking due to the code being written in elixir /j

fleet cedar
#

That's how haskell does diverging functions

valid jetty
#

that means you need to explicitly pass some type when calling abort lol

#

i need to know if it terminates so i can make defer call its deferrents before its called

fleet cedar
hoary sluice
winged mantle
#

why are languages so liberal and pro abortion

fleet cedar
hoary sluice
winged mantle
#

--pro-choice to enable abort --pro-life to prevent abort from working

valid jetty
hoary sluice
fleet cedar
#

Either unwinding or simply that abort aborts

#

What about --noob-life

molten haven
#

is ther a relativeTimestamps plugin for vencord where instead of a message saying 12:43:45 2025-02-20 its more like 3mo 12d 7h 44m ago or smth like this?

valid jetty
#

is it even a idea to make abort-like functions not make defer call its deferrents???

fleet cedar
#

Exits immediately no questions asked

valid jetty
#

most languages assume that termination will call the defer things inside i guesss

valid jetty
#

including exit and stuff

hoary sluice
#

abort should invoke kill -9

winged mantle
fleet cedar
#

Some diverging functions abort, some unwind, some simply loop forever

winged mantle
#

even turing machines are gay

fleet cedar
#

They are different

#

But also not

valid jetty
#

good point

hoary sluice
valid jetty
#

i wonder how go does it

hoary sluice
#

@valid jetty im gonna have to make an stdlib framework before io probably

#

and builtin functions

#

all tomorrow hopefully

valid jetty
#

it just does unwinding for stuff like panic but not for os.Exit

hoary sluice
#

go is never sane, which is wly microsoft uses it

valid jetty
#

lmfao

hoary sluice
#

gn

valid jetty
#

the thing is that because your language is interpreted you can easily make unicode functions

valid jetty
hoary sluice
valid jetty
#

yes

hoary sluice
#

yea i have to remove one is_alpha check for it

fleet cedar
#

Why would interpretedness have any impact on unicode names

valid jetty
#

because in compiled languages you cant put unicode as a name in symbols for object files, so you need to mangle it

fleet cedar
#

Unicode names affect the lexer and the mangler

#

Nothing else

valid jetty
#

i mean yeah

#

but not all compiled languages mangle

fleet cedar
#

Yeah but all the ones that are not vulnerable to code injection attacks do

#

Sanitize/escape your data when inserting it in another format, that's a universal fact

#

No matter if it's sql, html, json, or llvm

valid jetty
#

uhh sure

valid jetty
#

@winged mantle hows THIS compared to C

use std/prelude;
use std/net;

const PORT = 8080;
const BUFFER_SIZE = 1024;

fn main() {
    server := TcpServer::bind(PORT).expect("Failed to bind server");
    defer server.close();

    $printf("Server is listening on port {}", PORT);

    buffer := Array::with_capacity<char>(BUFFER_SIZE).fill(0);
    connection := server.accept().expect("Failed to accept connection");

    while (res := connection.read(buffer)).is_ok() {
        received := res.unwrap();

        if received <= 0 {
            break;
        }

        connection.write(buffer.slice(0, received)).expect("Failed to send response");
    }
}
winged mantle
#

cool

valid jetty
#

yes

#

is this nicer

use std/prelude;
use std/net;

const PORT = 8080;
const BUFFER_SIZE = 1024;

fn main() {
    server := TcpServer::bind(PORT).expect("Failed to bind server");
    defer server.close();

    $printf("Server is listening on port {}", PORT);

    buffer := Array::with_capacity<char>(BUFFER_SIZE).fill(0);
    connection := server.accept().expect("Failed to accept connection");
    defer connection.close();

    while received := connection.read(buffer).resolve_to<i64 *>(
        fn(i64 res) (&res),
        fn() nil
    ) {
        connection.write(buffer.slice(0, *received)).expect("Failed to send response");
    }
}
winged mantle
#

it feels odd that you have pointed in an interpreted language

valid jetty
#

elle is not interpreted lol

winged mantle
#

i thought it was

valid jetty
#

nop

#

has been compiled since day 1

winged mantle
#

i might be stupid

valid jetty
#

lmao

winged mantle
#

holy c

valid jetty
#

rust using C apis only doesnt look like C because rust devs made it a pain in the ass to write unsafe code

#

if you could write it normally rust would look a lot more like C

#

i made a special function for the resolve_to<T * case

#
use std/prelude;
use std/net;

const PORT = 8080;
const BUFFER_SIZE = 1024;

fn main() {
    server := TcpServer::bind(PORT).expect("Failed to bind server");
    defer server.close();

    $printf("Server is listening on port {}", PORT);

    buffer := Array::with_capacity<char>(BUFFER_SIZE).filled();
    connection := server.accept().expect("Failed to accept connection");
    defer connection.close();

    while received := connection.read(buffer).to_nilable() {
        connection.write(buffer.slice(0, *received)).expect("Failed to send response");
    }
}
``` this is probably the most readable it will get
#

although it does ignore the error

#

(so did the code before)

hazy pine
#

my sister want to learn programming, what if i get her to start by learning elle

valid jetty
#

do not πŸ™ there will be probably a lot of issues

#

its still work in progress

shrewd canopy
valid jetty
#

@hoary sluice what the hell

formal belfry
ornate quiver
#

get her to learn rust

stone cipher
#

does anyone know if a "saved gifs" and a "favorited gifs" section would be possible to code

#

like this

#

i dont do much plugin related coding but if its possible i kinda wanna try

#

and smth like this to save or favorite

placid cape
valid jetty
#

scratch πŸ₯€πŸ’”

lavish frigate
#

what is the output of this code

def add_to_list(item: str, your_list: list = []):
  your_list.append(item)
  return your_list
  
print(add_to_list("A"))
print(add_to_list("B", []))
print(add_to_list("C"))
shrewd canopy
#

["A"]
["B"]
["A", "C"]

#

Did i guessed it right

lavish frigate
#

yes

shrewd canopy
lavish frigate
#

😭

nimble bone
#

unironically it is a great and useful language in the big 2025

valid jetty
valid jetty
lavish frigate
#

yes

valid jetty
#

i remember figuring that out when i saw people setting it to None and then at the top of the function putting if x is None: x = []

#

i love python

lavish frigate
#

like people always make fun of js for stuff like 1 + "1" and 1 - "1" and sure thats bad but i mean who even does that realistically but python actually has problems that can very easily happen realistically and its insane

hoary sluice
lavish frigate
#

hm?

hoary sluice
#

python is the 2nd weirdest language behind js

valid jetty
#

typeof(null) is β€œobject”

#

js also has real problems

#

that can happen

lavish frigate
#

i use that in my code

#

i dont complain

lavish frigate
valid jetty
#

i mean i guess but you’d expect it to compare the reference to 0, and an empty array is not a null pointer so it should not return true but whatever

valid jetty
# lavish frigate who uses typeof to check the type of objects
window.reactHandler = async () => {
    const getFiber = (node) => Object.values(node)?.[1]?.children[1]?._owner;
    const handler = await lazyDefine(
        () => document.querySelector('#app > div > div'),

        // This is necessary because null's type is "object"
        target => {
            if (!target) return false;

            const node = getFiber(target).stateNode;
            return node && typeof node === 'object';
        },

        undefined,
        Infinity
    );

    return getFiber(handler);
};
``` sometimes necessary in reverse engineering of things
lavish frigate
valid jetty
#

that function checks if(type of target === object) by default

#

if null didn’t return object as it’s type, i wouldn’t need to manually make a callback

#

and i remember spending ages debugging that

lavish frigate
#

(my code)

valid jetty
#

yeah i mean that’s sane in most cases

lavish frigate
#

and thats why we should get rid of null implement rust option types introduce a breaking change to the web and force everyone to update their website

#

whos with me πŸ—£οΈ πŸ”₯

valid jetty
#

πŸŽ€πŸŽ€πŸŽ€

lavish frigate
#

now you just gotta rewrite the entire js std to use options instead of null

valid jetty
#

truee

nimble bone
#

rewrite @valid jetty to use options isntead of null

fleet cedar
#

You'd also need to rewrite the whole ecosystem to use constructive types rather than descriptive

lavish frigate
#

who cares about the ecosystem its all garbage anyway we gotta do a whole restart

valid jetty
lavish frigate
#

lc.xkcd standards

visual shellBOT
lavish frigate
#

my favourite

fleet cedar
#

Oh and change the runtimes to not be monotyped

lavish frigate
#

Rust is so good it’s even being taught at cppcon

#

Why is it even called cppcon and not the more appropriate conpp

fleet cedar
#

Naming things y'know

hazy pine
hoary sluice
#
poll_question_text

how to make variable bindings

victor_answer_votes

2

total_votes

4

victor_answer_id

1

victor_answer_text

let foo = x in bar = body

royal nymph
formal belfry
#

@royal nymph

lavish frigate
fleet cedar
#

/run ```js
console.log([] ? "yes" : "no")

rugged berryBOT
#

Here is your js(18.15.0) output @fleet cedar

yes
lavish frigate
#

😭

#

insane

#

its all soo so insane

valid jetty
#

wait what the fuck

#

so that means

#

[] is truthy but when coerced to a boolean it’s false

#

😭😭😭😭😭😭😭

formal belfry
#

best lang

royal nymph
#
[] == ""     // true
"" == false  // true
formal belfry
#

@royal nymph

#

@royal nymph

royal nymph
#

simply don't use ==

coral geyser
#

Is there a way to patch content in javascript files inside /assets?
seems like regular patches don't work

fleet cedar
#

Patches are on webpack chunks

#

What other files are you looking for

coral geyser
fleet cedar
#

What files do you want to watch

coral geyser
#

Not anything specific, just certain ones that call invoke("NOTIFICATIONS_SEND_NOTIFICATION)

fleet cedar
#

What files do that that are not webpack chunks

coral geyser
#

I think the filenames change though

fleet cedar
#

Yeah that's webpack

coral geyser
fleet cedar
#

Then fix your patches

#

Patch helper is right there

royal nymph
coral geyser
#

Some are inside channels/id/WebpackModulexxxxx

fleet cedar
#

Those don't exist

royal nymph
#

when you patch a module, it creates a new file under /channels. it's not possible to edit in place. the one in /assets is then no longer used

royal nymph
formal belfry
#

@royal nymph

coral geyser
coral geyser
royal nymph
#

then you didn't do it properly

#

if you did it properly there will be a file with Patched by [YourPluginName] comment at the top

#

did you enable your plugin

coral geyser
#

Yes

#

I can find the patch inside those WebpackModulexxxxx

spark tiger
#

how bad is this error handling fr

spark tiger
#

am i tripping or did they update the devtools font

fleet cedar
#

Result<_, String>
Jail for twelve years

hoary sluice
#

Not even @valid jetty has worse error handling

spark tiger
#

HOW DO I DO BETTER THEN

hoary sluice
#

make an error type

#

use anyhow and/or thiserror

fleet cedar
#

Anyhow for don't-care errors, snafu for structured errors

spark tiger
#

errors piss me off sm istg im finna js use unwrap() and make it panic every timefr

#

does anyhow have some macro or something to quickly unwrap Options?

#

or regular rust

#

like idk path.to_str().some_or_else(bail!("some error"));

#

i think it's better now thumbsup

hoary sluice
#

ok_or

valid jetty
#

why does macos have such a wildly different set of values for errno than linux

#

ughhhh

fleet cedar
#

Why the .to_str()

spark tiger
fleet cedar
#

.arg() takes any impl AsRef<OsStr>, including PathBuf

valid jetty
#

im assuming context doesnt exist on PathBuf

spark tiger
#

rustc: mismatched types
expected &str, found PathBuf

spark tiger
#

not arg

hoary sluice
#

what even is to_str

fleet cedar
#

.args() is more limited, yes

valid jetty
#

oh i see

fleet cedar
hoary sluice
#

oh is it from pathbuf

spark tiger
#

that works too now

#

though i'm not sure if Result<()> is like a good way to uh

valid jetty
#

and so it begins

fleet cedar
#

Much better, no?

valid jetty
#

this is gonna take a while...................................................

fleet cedar
#

Why are you discarding the output though

valid jetty
#

oh wrong reply

spark tiger
#

yeah

#

i don't even think it actually returns anything

#

can only error i think

valid jetty
#

surely you capture the stderr stream and if it has data you put that into an Err too

spark tiger
#

that's honestly such a dumb way to work with amnezia (basically wireguard) but it works lol

#

oh wait is anyhow gonna output the stderr error

#

im not sure how using ? with anyhow::Result works

fleet cedar
#

It works the same as ? on any other Result

spark tiger
#

how can i log the error after that then

#

can i use like to_string() or something

valid jetty
#

.expect() i guess?

fleet cedar
#

Print it

valid jetty
#

you can do expect_err iirc

spark tiger
#

so something like that is fine?

valid jetty
#

yeah

spark tiger
#

ight i see

fleet cedar
#

Just do, y'know, what you want to do in case of error

spark tiger
# spark tiger that works too now

also like what if any of the errors these functions return in Results don't contain anything other than just uhhh the enum? like errors can be just enums without any fields, right?

#

guh errors are so confusing isob

fleet cedar
#

Errors are values like any other

valid jetty
#

errors are just enums arent they??

fleet cedar
#

Often yes

valid jetty
#

wtf there isnt a c function to get the symbolic name of an errno??????

#

theres strerror but that returns a human readable string and not the name of the error

#

like i want ENOPROTOOPT not Protocol not available

#

how are you ever supposed to get this errno lol

spark tiger
#

i'm trying to like look at how different public functions in stdlib return errors and it's always like some different approach

fleet cedar
#

Maybe if you're trying to communicate with an external device

spark tiger
#

so far i've seen const_error!, types, enums, structs , jfc isob

valid jetty
#

but if youre trying to do that and the device is powered off, youll just be unable to find the device

hoary sluice
#

like always

valid jetty
#

hmmmmmmm

#

true,,,,,,,,,,,,,,,,,

#

isnt it double l 😭

#

cancelled

fleet cedar
#

Us vs uk spelling I think

#

And/or name length restrictions

hoary sluice
#

cancelled is correct

#

color is correct

valid jetty
#

always wondered why they only put 1 s here

hoary sluice
#

-ize is correct

valid jetty
#

because if its supposed to be "oh shorten the error name"

#

you have errors that are much longer

#

surely you can fit 1 more S in there

hoary sluice
#

nop

valid jetty
#

ok well macos done

#

holy spam,

frosty obsidian
#

i didn't consider it spam

valid jetty
#

it filled my whole screen lol

frosty obsidian
#

it was long but not spam imo

valid jetty
#

shug

#

shug

#

wtf

#

shug

#

shrug

#

,,,,,,,,,,,,,,,

spark tiger
#

hold on gonna rotate my monitor to comfortably read rosie posting

frosty obsidian
#

shug

valid jetty
#

this time its not even anything that insane 😭

#

literally just an enum with all the errnos on macos

#

its what i can do after thats cool

hoary sluice
#

@valid jetty my uni class has 19 people and 2 of them have austrian last names

#

like 13 of them are yugoslavs

#

couple turks and albanians

valid jetty
#
fn Errno::__fmt__(Errno self, i32 nesting) {
    // binops cast out to its repr type :)
    return "{} ({})".format(strerror(self + 0), self + 0);
}
``` and its even cooler what i can do AFTER that
hoary sluice
#

idk if the uni is just that international or if they put everyone who doesnt sound german into the same class

valid jetty
#

!!!!!!!!

hoary sluice
#

when will you finally rewrite elle in elle

valid jetty
#

eventually

shrewd canopy
spark tiger
#

i keep forgetting whether i'm supposed to use String or &str in structs...

frosty obsidian
#

a programming language has only truly made it when its compiler is written in itself

valid jetty
fleet cedar
valid jetty
#

its inferred at compile time

valid jetty
hoary sluice
valid jetty
#

its like in C where you have a sized String and then a StringView which is just a borrowed view into that memory

hoary sluice
#

my cpu is not yet overloaded

#

and neither is my ram

#

actually they are but thats cause of local ml

spark tiger
#

okay i probably want just String for it

hoary sluice
#

it is not often that you need to borrow a string in multiple places

#

and put it into a struct

spark tiger
#

yeah

valid jetty
#

SO GOOD

#

but maybe it should pass the caller down

spark tiger
#

why am i coding so damn slow, like i've written only a few strings so far isob

valid jetty
#

ok this is cool

#

strongly typed errors instead of just a string

#

i feel like my biggest bottleneck is no pattern matching but thats really hard and idk how to approach that

#

ok time to set that up for linux

#

thankfully linux has errno as a command in moreutils

winged mantle
valid jetty
#

when i make a file abstraction this is gonna be so useful to have these things already setup

valid jetty
winged mantle
#

rip πŸͺ¦

coral geyser
#

Quick question, are you allowed to use 3rd party libraries in plugins that are going to be submitted?

spark tiger
valid jetty
#

I DONT GET IT

#

YOU CAN TYPE ENAMETOOLONG BUT NOT AN EXTRA O IN ENOLCK?????????

winged mantle
#

should i name my language the french word for "him" to annoy rosie

#

lui

valid jetty
#

to be honest elle isnt called that because of french

#

lol

winged mantle
#

what's it named after

valid jetty
#

not really anything

#

it was going to be called bubble originally

winged mantle
#

i swear ages ago

#

i wrote down on some paper my ideas for a language called parchment blobcatcozy

valid jetty
#

if you call the language parchment it NEEDS to have fantasy keywords

#
shard scroll main() {
    ink x = "Hello, World!"
    shard y = 39
    scribe("%s, %d\n", x, y)
    recede 0
}
valid jetty
#

nooo thats so sad

#

doneee

#

now when i make abstractions for C functions (like a file or command api) i can return strongly typed errors

#

ok cool caller successfully tracked :3

spark tiger
#

hermes???

#

πŸ˜”

#

who cares about education if you can get a birkin bag

#

holy drip

#

exactly

hoary sluice
valid jetty
#

what

#

isnt it beautiful

#

@hoary sluice

#
// server.le
use std/prelude;
use std/net/tcp;
use shared;

fn main() {
    port := 8080;
    server := TcpServer::bind(port);

    while server.is_err_and(fn(Errno err) err == Errno::EADDRINUSE) {
        port += 1;
        server = TcpServer::bind(port);
    }

    server := server.unwrap();
    defer server.close().unwrap();

    connection := server.accept().expect("Failed to accept connection");
    defer connection.close().unwrap();

    foo := Foo { x = 39, y = 'f', z = 4.2 };
    $printf("Sending {}", foo);
    connection.write_raw(#cast(void *, foo), #size(Foo)).unwrap();
}
// client.le
use std/prelude;
use std/net/tcp;
use shared;

fn main() {
    port := 8080;
    client := TcpClient::connect("127.0.0.1", port);

    while client.is_err_and(fn(Errno err) err == Errno::ELOOP) {
        port += 1;
        client = TcpClient::connect("127.0.0.1", port);
    }

    client := client.unwrap();
    defer client.close().unwrap();

    Foo foo;
    client.read_raw(&foo, #size(Foo));
    $printf("Received {}", foo);
}
hoary sluice
#

@valid jetty i went back to sway

#

kde is unbearable

#

i almost had a panic attack

formal belfry
#

plasma 6?

hoary sluice
#

yes

formal belfry
#

huuh

#

whats bad about it

hoary sluice
#

too much for me

formal belfry
#

understandable

hoary sluice
#

i used kde for a long time

hoary sluice
formal belfry
#

no

hoary sluice
#

within a decade i will be using some obscure openbsd fork and banana wm

frosty obsidian
#

twm user goes back to a typical desktop experience and is shocked

hoary sluice
#

its not that it doesnt tile

#

its just annoying to configure

#

too much bloat

formal belfry
#

I spent 20 years configuring kde

hoary sluice
#

disabling window decorations is impossible

#

you have to enter a regex and entering any variation of *, *. or $*.^ doesnt work

#

oh i got it the other way around

#

maybe ^*.$ wouldve worked

frosty obsidian
#

isn't it .*

hoary sluice
#

it is

#

im literally braindead

#

i am going outside

frosty obsidian
#

i think i figured out why it didn't work then

hoary sluice
#

and i know regex idk why i decided to invert it completely

#

literally the 4 char string i tried but reverse is the correct one

valid jetty
valid jetty
frosty obsidian
#

actually it wouldn't match anything

hoary sluice
#

and its not a valid regex

#

it is entirely reversed

#

its supposed to be $.*^

hoary sluice
#

at least screenshare works

fleet cedar
lucid trail
hoary sluice
frosty obsidian
hoary sluice
#

i thought the one rosie replied to was the original one so i reversed it

#

yet again shows why i dont like regex

#

pack the most complicated parsing into as few bytes as possible

hoary sluice
frosty obsidian
#

i remember ^ because of simpleast

fleet cedar
#

I don't use ^ and $, I mapped them to H and L

hoary sluice
#

i use _ and $

valid jetty
#

@hoary sluice strings in structs over the network

#

(serialized by hand)

use std/collections/array;
global pub;

pub struct Foo {
    i32 x;
    string y;
    f64 z;
};

fn Foo::to_bytes(Foo self) {
    res := [u8;];

    res.extend([self.x].to_repr<u8>());
    res.extend([self.y.len()].to_repr<u8>());
    res.extend(Array::from_string(self.y));
    res.extend([self.z].to_repr<u8>());

    return res;
}

fn Foo::from_bytes(u8[] res) {
    self := #alloc(Foo);
    offset := 0;

    self.x = res.read<i32>(&offset);
    len := res.read<u64>(&offset);
    self.y = res.slice(offset, offset += len).to_repr<char>().join("");
    self.z = res.read<f64>(&offset);

    return *self;
}
valid jetty
# valid jetty
poll_question_text

which never type?

victor_answer_votes

1

total_votes

1

victor_answer_id

2

victor_answer_text

never

hoary sluice
winged mantle
#

writing a simple function to print a 64-bit signed int in intel asm is a nightmare

#

spent hours getting it not to segfault... now it just says the first digit

valid jetty
#
.globl _main
.align 8
_main:
    adrp x10, number@PAGE
    ldr x1, [x10, number@PAGEOFF]
    adrp x9, buf@PAGE
    add x9, x9, buf@PAGEOFF
    add x9, x9, #20         // start at end
    mov x8, x9
    mov x3, #0              // digit count

loop:
    cbz x1, or_insert_z
    mov x4, x1
    mov x5, #10
    udiv x6, x4, x5
    msub x7, x6, x5, x4     // x7 = x1 - x6 * 10 (remainder)
    add x7, x7, #'0'
    strb w7, [x8, #-1]!     // store digit and decrement x2
    mov x1, x6
    add x3, x3, #1
    b loop

or_insert_z:
    cbnz x3, write_buffer
    mov x7, #'0'            // if no digits, store '0'
    strb w7, [x2, #-1]!
    mov x3, #1

write_buffer:
    mov x7, #'\n'
    strb w7, [x9]
    add x3, x3, #1

    mov x0, #1              // stdout
    mov x1, x8              // x2 is the buffer start
    mov x2, x3              // length of the string
    bl _write

    mov x0, #0
    bl _exit

.section __DATA, __data
.align 3
buf:
    .space 21               // buffer for number and newline
.align 3
number:
    .quad 3939393939393939393
``` i spent more time than i would like to admit trying to get a newline to print
valid jetty
#

@hoary sluice quine

fn main() {
    x := "fn main() {
    x := \"?\";
    io::puts(x.replace(#[63], x.replace(#['\\\\', '\\\\'], #['\\\\', '\\\\', '\\\\', '\\\\']).replace(#['\"'], #['\\\\', '\"'])));
}";
    io::puts(x.replace(#[63], x.replace(#['\\', '\\'], #['\\', '\\', '\\', '\\']).replace(#['"'], #['\\', '"'])));
}
ionic lake
#

now make a 2048 terminal game in elle

valid jetty
#

thats like very doable 😭

spark tiger
#

wow the biggest non-gov bank here has .net and python internship jobs available to apply for, should i try trollface

placid cape
#

yea

spark tiger
#

idk my resume is kinda weak. basically all my .net experience is being a contributor and not-so-active maintainer of a foss game

#

and a lethal company mod lol

#

i kinda prefer just contributing to oss rather than making something from scratch

#

it’s only this year when i decided i wanted to code something myself with rust

spark tiger
#

can i apply for both jobs

#

i mean i probably can

#

but

#

aight i’ll try

#

tomorrow is the last day

#

i wonder if i can get like two weeks off or something during internship

#

cuz i have an important event during summer

#

that i can’t miss

#

which involves traveling to another city

#

so i’m not sure if i’ll be able to do work

#

ok done

#

i’m a bit scared though

#

so far they’ve only requested full name, city and email

hoary sluice
#

unless theyre like super nice and understanding

spark tiger
#

idek anything else

spark tiger
# hoary sluice nop

fuck 😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭

#

i’m scared

#

they sent it to me three fucking times im crying 😭😭😭

hoary sluice
#

why

#

theyre either gonna accept u or reject u and ull never hear from them again

spark tiger
spark tiger
valid jetty
# hoary sluice https://youtube.com/shorts/j5l_hmD1LXU

Join the free discord to chat:
discord.gg/TFHqFbuYNq

Join this channel to get access to perks:
https://www.youtube.com/channel/UC39VnEdRvgJmIKBDdmj0dIQ/join

Shout out to the editor:
https://thehalalmedia.carrd.co/

Chapters:
0:00 Intro
0:48 Level 0
1:11 Level 1
1:36 Level 2
2:09 Level 3
2:51 Level 4
3:20 Level 5
3:49 Level 6
4:16 Level 7

β–Ά Play video
#

which one are you

hazy pine
#

x++;

#

stupitd

valid jetty
#

for once, an actually good medium article

winged mantle
fleet cedar
#

That's the joke yes

winged mantle
#

wow

#

that was a guess

#

i guess i actually did learn something from that video i watched explaining two's compliment

valid jetty
#

yes because ~x == -x - 1

#

so -(-x - 1) == x + 1

hazy pine
#

negating is flipping and adding one and ~ is just flipping, so you're flipping then flipping again (so do nothing) then adding one

#

silly

royal nymph
hoary sluice
winged mantle
# winged mantle
poll_question_text

What's your favourite register?

victor_answer_votes

2

total_votes

7

victor_answer_id

8

victor_answer_text

rsp

victor_answer_emoji_name

πŸ“š

median root
#

whats so good about the stack pointers bro

#

rax HAS to be on top

fleet cedar
#

But rax is just a boring general purpose register

#

Admittedly the best of them

valid jetty
#

x3 on arm64 >>>>>>>>>

#

best register

fleet cedar
#

I like grinning cat register

hoary sluice
#

@valid jetty is elle_error! really your only way of handling errors

deep mulch
#

@valid jetty only checks dms every 500 years

valid jetty
#

true

#

@deep mulch what specifically about qbe ir do you want to know

deep mulch
#

everything

#

how do I even call print

valid jetty
#

do you understand the philosophy behind intermediate representation

#

as in, you compile to that and then make that compile to assembly

deep mulch
#

yes

valid jetty
#

if they dont exist, it will just throw an error at linking time

#

i can quickly explain exactly what you need to do to call print

#

if you want

deep mulch
#

how init a variable as "g" then print g

#

what would the qbe ir look like

valid jetty
#
data $fmt = { b "%d\n", b 0 }

export function w $main() {
@start
    %g =w copy 39
    %res =w call $printf(l $fmt, ..., w %g)
    ret 0
}
``` this is what a print of a number looks like
#

ill go through it line by line

deep mulch
#

rosinga is a creature

valid jetty
#
data $fmt = { b "%d\n", b 0 }

this defines a static memory allocation. strings in QBE are not primitive types, so the best you can do is allocate literals like this in static memory. the $fmt variable is then globally accessible and you get back a pointer to the start of that region (so essentially we just defined a static C string)

export function w $main() {

this defines a function with the name main, which returns a w (word/32 bit int)

@start

this defines a "label", all functions must have at least 1 label, but this is useful later for when you want to do control flow like loops and conditions because you can jump to these labels

%g =w copy 39

defines a "temporary" with the name g, and =w specifies that its type is a w (word/32 bit int). copy 39 is just a way to put that constant value of 39 into it (you cant just do %g =w 39 because the rhs of an assignment must be an instruction)

%res = w call $printf(l $fmt, ..., w %g)

calls printf with the l $fmt variable from earlier (the l specifies to read it as a long, ie a 64 bit signed integer in this case), then the ... tells QBE where the variadic arguments begin, then the w %g tells qbe to pass the %g variable as a w (word/32 bit int)

ret 0

..returns 0

#

oh and

#

the sigils ($, %)

#

$ means global

#

% means temporary

deep mulch
#

guh?

valid jetty
#

oh and if it wasnt clear, the b 0 at the end of the $fmt thing terminates the C string, because c strings are not sized theyre null terminated

deep mulch
#

byte zero

valid jetty
#

yep

deep mulch
#

what if I bit you and you got rabies

valid jetty
#

evil,,,,,

#

wait until you learn about stack allocation lol

#

ill let you mess around for a bit longer with these simpler examples before you move to that because it ramps up in complexity slightly

deep mulch
#

slightly

valid jetty
#

yeah its still not that complicated

deep mulch
#

wrong

valid jetty
#

its basically doing this

int main() {
    int x[1];
    *(x + 0) = 39;
    printf("%d\n", *(x + 0));
}
``` but by hand
deep mulch
#

HUSK

#

WHAT S THAT

valid jetty
#

..? 😭

deep mulch
#

*(x + 0)

#

????

valid jetty
#

add 0 to the address of the buffer and then dereference it

#

essentially identical to x[0]

#

youll get used to it after messing around with it for a bit

valid jetty
deep mulch
#

guh!

valid jetty
deep mulch
#

I'll try maybe when I'm home

valid jetty
#

okkk

valid jetty
#

zoot did you see the tcp server stuff

median root
#

ESPECIALLY in asm

#

i really hate how my return adresses are also pushed onto the same stack as the one im tryna use

lucid trail
valid jetty
#

yeah true

#

any low level language can look esoteric lol

spark tiger
#

doing an online test for that internship thing i posted earlier today and jfc it took them like 20 minutes to check if my solution passes all the tests lol

#

insane

hoary sluice
#

@fleet cedar is this good

#[derive(Error, Debug)]
pub enum LexerError {
    #[error("not a number")]
    NotANumber,
    #[error("unterminated string")]
    UnterminatedString,
}

#[derive(Error, Debug)]
pub enum ParserError {
    #[error("expected expression")]
    ExpectedExpression,
    #[error("incomplete if")]
    IncompleteIf,
    #[error("missing closing parenthesis")]
    MissingClosingParenthesis,
    #[error("missing parameter")]
    MissingParameter,
    #[error("unexpected end of file")]
    UnexpectedEndOfFile,
}

#[derive(Error, Debug)]
pub enum InterpreterError {
    #[error("division by zero")]
    DivisionByZero,
    #[error("expected expression")]
    ExpectedExpression,
    #[error("invalid arguments")]
    InvalidArguments,
    #[error("invalid identifier")]
    InvalidIdentifier,
    #[error("invalid token")]
    InvalidToken,
    #[error("overflow")]
    Overflow,
    #[error("unsupported expression")]
    UnsupportedExpression,
}

#[derive(Error, Debug)]
pub enum ErrorKind {
    #[error("lexer error: {0}")]
    Lexer(#[from] LexerError),
    #[error("parser error: {0}")]
    Parser(#[from] ParserError),
    #[error("interpreter error: {0}")]
    Interpreter(#[from] InterpreterError),
}

#[derive(Error, Debug)]
pub struct Error {
    pub kind: ErrorKind,
    pub location: Option<Rc<Location>>,
    pub help: Option<String>,
}
valid jetty
#

its good but imo its a little overkill

fleet cedar
#

I usually go with something like ```rs
struct Diag {
level: Level,
main: Note,
sub: Vec<Note>,
}
struct Note {
text: String,
span: Span,
}

valid jetty
#

mine could benefit from a simplification


#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Location {
    pub file: Rc<str>,
    // so we can report the import location instead
    // of the real location for errors that weren't
    // in the current file
    pub alt_start: Rc<Position>,
    pub alt_end: Rc<Position>,
    pub start: Rc<Position>,
    pub end: Rc<Position>,
    pub ctx: Rc<str>,
    pub above: Option<Rc<str>>,
    pub extra_info: Rc<str>,
}
#

(locations are used to get an error string which can be used for anything later, you just call the appropriate function)

fleet cedar
#

Why are you rcing your positions

#

Aren't they small Copy types

valid jetty
#

good point tbh

#

theyre just 2 usizes

fleet cedar
#

Two?

valid jetty
#

row col

fleet cedar
#

Sounds wasteful

valid jetty
#

thats pretty cool

valid jetty
fleet cedar
#

Why use two usizes when you can use one

valid jetty
#

use one and do row * i + col orrr

fleet cedar
#

Just a byte offset

#

What else?

valid jetty
#

i use the position for reporting "file:row:col"

fleet cedar
#

Yes

#

Row:col is great for displaying

valid jetty
#

you can technically do that with a byte offset but its just kinda more work

fleet cedar
#

No

#

It's less work

#

Only need to convert offset to row/col for those positions that are displayed, rather than every token

valid jetty
#

i mean i guess but this is such a tiny optimization that surely it doesnt really matter

spark tiger
#

i've only solved 3 tasks out of 7 so far and idk how to solve further im killin myself

#

these fucking leetcode ass tasks

hoary sluice
hoary sluice
spark tiger
#

how was it

hoary sluice
#

hard and i got rejected

#

got accepted the year after that when i won their actual coding contest and not a simulated private one

spark tiger
#

i only got 2/7 correct so far isob there isn't even any point in doing further test i belive

#

fmllllllllllllllllll

hoary sluice
#

can u not just vibe code it

spark tiger
#

i can but why

hoary sluice
#

to solve it faster

#

just make sure to not upload the vibe coded code like i did in 2023

spark tiger
#

i mean idk if i cant solve this they will definitely find out im not as skilled as i made it seem

hoary sluice
#

no they wont

valid jetty
#

atp eagely probably vibe coded aoc 2024 :3

hoary sluice
#

the recruiters wont ever talk to you after that

hoary sluice
valid jetty
spark tiger
hoary sluice
hoary sluice
spark tiger
#

yes

valid jetty
#

you will get heavy impostor syndrome even if you dont vibe code and get in

spark tiger
#

i mean it's not about understanding, it's more about being able to come up with such solutions

#

if i can't, then what's the point

hoary sluice
valid jetty
#

i mean a quick way to be able to come up with them is to literally vibe code them, if you understand them eventually youll just subconsciously memorize the general pattern of solutions and be able to come up with them mostly on your own

hoary sluice
#

no thats a bad idea

valid jetty
#

obviously dont vibe code the actual coding contest questions

#

but you can do it to practice questions

spark tiger
#

well i mean that one is a real test

hoary sluice
#

"separate errorkind into lexererror, parsererror, interpretererror" would take me like an hour to do manually

valid jetty
#

typing assistant ?? 😭

#

oh

#

yeah i do that all by hand

hoary sluice
#

why

valid jetty
#

im always terrified the ai makes some assumption which is incorrect about my code

#

then does it wrong

#

and makes me spend an extra 3 hours debugging

hoary sluice
#

i verify it??

#

it got it wrong like 7 times in a row

valid jetty
#

lmaooo

hoary sluice
#

it literally wrote UnexpectedEnd of file as an enum variant WITH THE SPACES

valid jetty
#

i would rather go through code that i personally wrote and have full understanding over rather than trying to parse the ai slop and figure out what it was trying to do

hoary sluice
#

i dont vibe code icypeas to that point

#

i did that with voice assistant

#

frontend

#

backend not really

#

i wrote almost none of the qml

#

and it doesnt work anymore

valid jetty
#

which means you need to go through and read code you didnt write for no reason

valid jetty
#

did your free trial to those slop services expire or something

hoary sluice
valid jetty
#

😭 😭

hoary sluice
# valid jetty wait what lmao

i switched from catppuccin to breeze theme and it stopped working cause breeze depends on some qt package that when installing still doesnt work

#

i need to link it properly

#

pretty sure this is a nixos issue

#

either way my partners hardware doesnt work and this frontend isnt even part of the diploma thesis, its only the backend

valid jetty
#

my gpt is so empty lmfao

hoary sluice
#

mit gpl3 compat is such a real question to ask gpt

valid jetty
#

thats "in the last 7 days" "in the last 30 days" "april" "january"

valid jetty
hoary sluice
#

rosie secretely uses claude and makes us think she doesnt slopcode

valid jetty
#

i cant even login to claude actually

#

lmfao

#

1 sec

hoary sluice
valid jetty
#

do what i do

#

chances are youre never going to throw the same error more than once

#

if you are you can just factor it out into a macro

hoary sluice
#

so just ignore all of rusts error handling?

#

does elle die after the first error

#

or does it recover

#

in lexer/parser

valid jetty
#

ok FINALLY

valid jetty
#

thats easy to improve upon

hoary sluice
#

ok ur right this is unneccessary

valid jetty
#

pretty simple idk

#

and greppable

spark tiger
hoary sluice
#

rosie i have main func and test() func which runs tests, main returns ExitCode what should test return

valid jetty
#

also ExitCode surely

ionic lake
#

rosie........hi

valid jetty
#

if a test fails it returns ExitCode::FAILURE or whatever

valid jetty
hoary sluice
#

ok whatever illl just do that

valid jetty
#

why did you say it like that lol

ionic lake
#

i just wanted to say hi

valid jetty
#

hiii

ionic lake
#

how are we doing this lovely day

valid jetty
#

@hoary sluice this probably spent about 1 year worth of electricity for my house

valid jetty
#

are you also being silly

ionic lake
#

yes im being silly in balatro

valid jetty
#

wow

#

what even is the hype with balatro lol

#

i keep seeing it but i have no idea what it is

#

i know its a card game of sorts

#

by the way @hoary sluice what tests are you even running

hoary sluice
#

wtf is balatro

valid jetty
#

its a game

#

im sure youve seen something about it before

hoary sluice
hoary sluice
formal belfry
#

ask zoot

valid jetty
#

ok i thought you like did pre-gen output tests through rust or something

#

thats the tests where you generate the expected output of a program at a point when you know its functional and then later you compare the output to the expected output

hoary sluice
#

nah ill prob make assert soon

#

its not hard

valid jetty
#

i kinda wanna do this with my manual tests but i havent yet

spark tiger
hoary sluice
#

just need io

valid jetty
#

wait its interpreted im stupid

spark tiger
#

i wonder if you can configure your rust app not to compile on any target other than X

valid jetty
#

you can lol

spark tiger
#

oh neat

hoary sluice
#
assert x y = if x != y then panic else print("success or idk if it should print anything")
valid jetty
#

add a #[cfg(target="macos")] to every single top level structure (struct, function, enum)

valid jetty
#

on non-macos platforms it will never generate those things and therefore fail to compile

formal belfry
#

lua

hoary sluice
formal belfry
#

oh

#

Balatro uses lua

hoary sluice
#

lua is evil

formal belfry
#

good lang

spark tiger
formal belfry
#

i went to an acedemic meet and some guy beside me wouldnt shut up about lua

#

i need lua appkit bindings

spark tiger
#

aw

valid jetty
#

but you can kinda do this

fn main() {
    let target = std::env::var("TARGET").unwrap();

    if target != "x86_64-unknown-linux-gnu" {
        panic!("uwu");
    }
}
``` in build.rs
formal belfry
#

the only thing i dont like about lua is how there isnt really an idea of classes or anything

spark tiger
hoary sluice
#

the only thing i dont like about lua is everything

spark tiger
#

syntax is ass

#

imho

formal belfry
valid jetty
#

well yeah i guess

#

but neither was js until they introduced classes officially

#

you could do it with prototypes before just like you can do it with metatables now

hoary sluice
#

rust also doesnt have classes does that mean its bad

valid jetty
#

omg i remember getting SO confused over wtf pairs and ipairs does

formal belfry
#

true

valid jetty
#

i think i get it now but still that was so annoying

formal belfry
#

Lua has great potential for scripting but nobody makes anything with it

#

other than like

#

balatro roblox and garry's mod i guess

valid jetty
#

iirc everything is a dictionary in lua, so doing pairs(a) where a is an array would give you index, value, but ipairs specifically iterates until the first nil in the array while pairs iterates the whole array

hoary sluice
#

@valid jetty best cli

fn main() -> ExitCode {
    test()
}
formal belfry
#

luarocks is garbage

valid jetty
#

why do you have test in your runtime it should be a build-time function

formal belfry
#

i wish lua had basic stuff like a fs lib but it doesnt

valid jetty
#

because its inherently a mini embedded scripting langugage i guess

#

its purpose is to be embedded anywhere easily

formal belfry
#

it would go so hard as a python replacement though

valid jetty
#

iirc there are lua forks that offer that

#

have you seen the roact stuff to make react in luau

formal belfry
#

yes

#

i touched roblox for 2 seconds and didnt ever again

#

i never used that but it seems silly

#

fuck off

ionic lake
# valid jetty i know its a card game of sorts

its a deck building game where you see number go up till naneif (infinity in lua ig)

you basically play out specific moves (hands) that give mult (multipler) multiplied by slots (points), there are some good easy hands and some difficult to do hands but it all depends on your deck of cards and what you have currently at hand during gameplay, theres also leveling for hands later on which influence your build, you also have jokers which are like powerups and give you a specific ablity to your run's build, then theres tarots which are a one-time use thing i guess if that makes sense

formal belfry
valid jetty
#

idk i think so

formal belfry
#

😭

valid jetty
#

so they basically gameified poker

#

well

#

poker is already a game