#programmers-off-topic

1 messages ยท Page 9 of 1

dapper sinew
#

oh im currently making my own mod!

#

but its techinally build and changed from tutorial code... granted its nothing like it anymore lol. which is what i mean by cant code from scratch

#

since i read the tutorial and learned why stuff worked i can now code from that, but i still need that buffer piece if that makes sense

uncut seal
#

@solar junco the downside of hiding unused UI...

solar junco
uncut seal
#

no, I meant not knowing about a discord channel (but it was just a joke anyway)

solar junco
#

YEP that is a downside

#

but the benefit of not having to scroll for 5 minuts to reach the 3 channels I use on this discord outweights the negative ๐Ÿ˜‚

uncut seal
#

yeah I know, I hid most of the channels of this server since I'm never using them

strange copper
#

Does C# want you to compare strings with .Equals() like Java or is == equality safe in this land

#

i guess moreso what is the convention since it looks like it's safe to == comparison for general string/string comparisons

tranquil grove
#

(more to the point, I've always seen == preferred in C# for normal strings SDVkrobusgiggle)

pliant snow
#

Thats very brave. Nixos was maybe the most developer unfriendly distros ive used

gilded hound
#

๐Ÿ˜ฉ I do a lot of different types of development, and on different environments on a daily basis, so NixOs ends up being the easiest way to keep things consistent.

pliant snow
#

i ran into lots of issues just getting LSPs and stuff set up

#

it was a lot of just making my own bin directory, which kinda defeats the point

gilded hound
#

Interesting, it works fine for my use case. I mostly work on simulation/ML which involves working a lot with clusters I have no real control over. Normally this is delt with solely by docker, but I find Nix flakes with docker to be pretty much the perfect solution to all my problems.

cinder karma
#

Question: why are my pin numbers not zero indexed

cinder karma
#

I now know more than I'd like about invisible walls in a very old game I've never played

safe dragon
#

pannenkoek2012 strikes again

#

annoying Dutch people by mispronouncing the word pannenkoek since 2010

dapper sinew
#

anyone know how to batch make symlinks on Linux?

#

i have multiple files i need symlinked and i dont wanna type em all out in different commands

pliant snow
#

I mean, the obvious answer would be to put them in a folder and just symlink the folder

#

otherwise, if they have a common naming structure, you could do it in a loop

dapper sinew
#

ahh im needing it to update retroactively, im symlinking my windows install and Linux install of Stardews content stuff and mods

pliant snow
#

I'm not too familiar with sdv modding, I guess it's not simple enough to just symlink some mods folder then

dapper sinew
#

oh it is

#

im just symlinking the content and other files as well

#

its like 6 total but im lazzzyyyyy

pliant snow
#

yeah, unless they have a pattern in their name and you can use some wildcard, I think you just have to specify them

dapper sinew
#

dang

#

welp, ill stop being lazy then

paper adder
dapper sinew
#

QOL mod

#

along with it making some stuff a bit more challenging

paper adder
#

what do you have in mind to make life more quality

dapper sinew
#

im trying to eventually give every item a use

#

along with making stuff more connected

#

example, i changed the seed maker to have a chance to fail, which outputs fiber, but that fiber can be composted into fertizers

#

so you in theory only need to throw stuff out in the mid to late games

#

unless youre one to make whole factories

paper adder
#

turning stardew into factorio would be so epic tho

#

i like that idea, though does it not just kind of nerf the seedmaker? unless fiber is really that great

#

fertilizer is useful

dapper sinew
#

i did it :3

#

batch symlink

paper adder
#

what's that

dapper sinew
paper adder
#

i know what batch files are, not symlink

dapper sinew
#

uhhh google will be able to explain it better since i barely know myself, but they are basically links to other files but... better and useful

pliant snow
#

I'm not quite sure that qualifies as batch lol

gaunt wadi
#

symlinks are short for cinnamon links, they're links that are great in pastries and other baked goods

dapper sinew
#

to me at least

pliant snow
leaden marsh
leaden marsh
leaden marsh
# dapper sinew

Is there a reason it has to be a one-liner? Typically the advantage of using a shell script would be to allow for several commands to be done in sequence, with better readability

dapper sinew
#

I was lazy

leaden marsh
#

Well congrats on getting it working! Excited to see what comes of your modding journey

dapper sinew
ivory shadow
crystal wren
#

I suppose it depends on your target audience for the templates...

I know a whole bunch of Stardew modders probably wouldn't touch that, but a handful that would.

ivory shadow
#

Yeah, I've got no clue really just figured a starter project would be nice for people. I should really keep it simple.

#

The common project mainly has something in it just to show off how to use the common project.

crystal wren
lethal walrus
#

fun indeed

ivory shadow
#

Oh right, I should add property stuff

#

I only have fields.

cinder karma
#

is this what they teach in ui devs school?

ivory shadow
#

I have never actually been to UI school, but that seems like the kind of thing someone who teaches would come up with.

#

It would also explain Microsoft's love of ribbon UI in Office and Windows.

#

The problem with "rectangular menu" is that it's trying to reinvent the wheel. The wheel being toolbars. We already had those. And rectangular menus make things problematic the moment you introduce sub-menus as a concept.

#

Pie menus are very nice in the right situation, but they are situational.

pliant snow
#

i feel like the ribbon menu is the exact opposite of what that picture wants to encourage

ivory shadow
#

The ribbon menu is pretty much exactly what the rectangular menu in that image is

pliant snow
#

eh, i think its closer to the linear one on its side, although there are some stacked items, i think thats more because they run out of screen space lol

ivory shadow
#

Just because Microsoft did a shit job implementing it, doesn't mean it isn't a rectangular menu, lol

#

I just don't like rectangular menus as a concept. Again. Give me a toolbar.

#

Put the money toolbar in the bag UI.

pliant snow
#

you'll get a pie menu and you'll like it

cinder karma
#

is it weird I don't....hate the menu MS does?

#

until I need to opne a new file, and suddenly I lose the ability to find anything

safe dragon
#

I think the ribbon is a fine design strategy

#

pie menu though... I thought it was called a dial menu

crystal wren
#

The pie menu is great for stylus based inputs for sure.

safe dragon
#

radial menu or pie menu...

#

where did I get dial from

#

the pie menu is great in steam input

#

for joysticks

cinder karma
#

Pie is fine for controlers or controller-like behaviors

#

I don't want to see it anywhere else

marble jewel
#

Also UI is influenced by input devices which there are more now than ever

pliant snow
#

you can set a pie menu in steam input?

safe dragon
#

yes

marble jewel
#

There is no one size fits all ui

safe dragon
#

steam input calls it radial menus but same thing

#

they're handy especially for games that assume you have a whole list of keyboard shortcuts available

cinder karma
#

tbh also it depends on like, what' you're doing

#

my least favorite ui thing is when I have to dig through nine million menus to figure out how to, say, set <insert random CAD attribute> to <different material>

safe dragon
#

checks Edit menu... nope
checks Tools menu... nope

#

I'm not even thinking of a specific app for that one... it's in so many

#

for very complex programs I just want a search tool which then in its result also tells me where to find it in the future

#

gonna redesign VS Code to use a ribbon instead of the command palette thing

#

(I love the command palette)

cinder karma
#

Another software I use thinks ยฅ is a character people should type often

safe dragon
#

I once had to set my windows region to japan for some visual novel and all my / characters turned into that one

#

I guess you might type it often... if that's your currency symbol

#

meanwhile I use the euro and have no idea how to type one so I always copy paste it from somewhere

safe dragon
#

it is when I set my keyboard to use the dutch language mode on windows computers

#

not that I have an alt gr key currently set up on my keyboard layout

#

I could just add a euro symbol to my symbol layer

#

but I don't type it often enough to have bothered

lethal walrus
#

ah

safe dragon
#

got the essentials...

lethal walrus
#

do you press some modifier to get that

safe dragon
#

yeah the middle bottom key on my right thumb pad

lethal walrus
#

i'm assuming you don't have a seperate keyboard for symbols

safe dragon
#

I've been using split keyboards for quite a while at this point

lethal walrus
#

why is f11 and f12 on both?

safe dragon
#

idk why they're not just transparent like the rest on my symbol layer

#

it's the same spot

lethal walrus
#

ah

gray moth
#

What version of Visual Studio is currently the best?
I've been using a older 17.2.3 until recently, but updated to the latest version since I needed .net 8 for a mod I am maintaining and it's god aweful.
Everything is slow and basic features (like ctrl+click to go to definition) kind of don't work

#

It's honestly impressive just how much worse it got

safe dragon
#

uh idk for me the best version is generally just the newest version

#

haven't had any serious issues on recent versions

#

well, new ones anyway

gray moth
#

are you using win 11 by chance?

safe dragon
#

was required to by work yes

#

I only use visual studio for work

dapper sinew
#

grrrrr ST isnt working

#

i love that terminal but NixOS is saying no

dapper sinew
#

i have no clue what any of that is

#

im new to NixOS lol

pliant snow
#

well then

safe dragon
#

spicy

pliant snow
#

it wouldnt be an open source project without people making a big fuss about things

safe dragon
#

it seems to be a little more than average though

#

hyprland drama has yet to result in this at least

pliant snow
#

something tells me nothing will come of this letter

safe dragon
#

some people will leave the project but none of em are probably going to be the one this letter is about

dapper sinew
#

btw, anyone here gotten Reshade to work on Linux?

safe dragon
#

I don't even know what that is so no

pliant snow
#

i didnt think it was something anyone had working on linux

safe dragon
#

this sounds kinda like some other project... that I forgot the name of

#

it was some pun on vulkan

#

vkBasalt

#

right

#

basalt cause vulcanos...

#

looks like vkbasalt supports reshade shaders(at least some of em)

#

I give it a 10% chance you can get reshade itself working decently

pliant snow
#

i tried looking to that at one point i think

#

I also def played thru a game with a custom shader a year or so ago... but i dont remember how i did it

ivory shadow
#

I had to do a meme edit after a discussion with someone.

marble jewel
#

This needs to be a command

#

Reminds me of this one

#

!god

indigo mistBOT
#
wide adder
thin estuary
#

libretro is fun

uncut seal
#

I have a question about what is possible modding-wise, I'm currently making a Framework for Highly Customizable Furniture, and for now I managed to do it through Harmony and without having to modify the game's save data. But my next step is customizable hitboxes and according to what I understand from the code, it would require to patch A LOT of methods through Harmony.

What I think could make it easier is to derive a CustomFurniture class from the vanilla Furniture class and overwrite the methods I want to change.
My issue being : is it possible at all to have the game instantiate a CustomFurniture instead of a Furniture when it encounters a furniture added by my Framework? And how would I do that?

crystal wren
#

You could do that with about a million individual transpiler targets! SDVkrobusgiggle

thin estuary
crystal wren
#

But yeah, this is more on-topic than off.

uncut seal
#

Sorry, I didn't see that I had answers

willow knot
#

okay so ive been tossing this idea back and forth in my mind but i cant get it to wirk

#

i want to make like a log system where i can input a new entry into the shell and it creates a new log with the entry number 1 above the last one (is the last entry was entry one, this one is assigned as entry 2)

#

but getting this to work properly has been

#

a pain

#

is there a way to like

#

logname = lognumber + 1

#

but like update lognumber each time a new entry is created so lognumber doesnt reset every time the program is opened

#

also like

#

im thinking the logs could be written to a seperate file but then whats the point of having the system if you can just open taht txt file

#

mauybe i can save them as strings but like

safe dragon
#

where are the logs being sent or stored in this case

willow knot
#

im trynkg to decide becuasei cant get my write to file to wor

#

it says the path doesnt extist but i checked the path and it does but im just confued

#

i write half this while high so uh its rough but heres what i have soi far

#

im suree theres some command or something that i dont know how to use or something i just havent learned yet so if the answer is obvious please excuse me

#

i had the ("/Desktop/logdata.txt") with "a" at the end before idk why i got rid of it

#

ok i readded teh append

#

dont mind the readlog so much rn thats for later

#

i toyed with the idea of putting them into a dictonary but i dont know how to make it not read the whole dictonary at once

safe dragon
#

can't imagine that path is correct. From where are you running the file?

willow knot
#

ohh

#

wait

#

ok hold on

#

do i have to have them in teh same folder bc i did that and it didnt work

#

lemme try smth

safe dragon
#

If it comes from desktop I'd use the absolute path. So the whole C:// shebang

#

else you'd use a relative path and remove that first slash at the front

willow knot
#

a relative path is if like

#

im going down the directory from where the py is right

safe dragon
#

yeah

willow knot
#

what if theyre in the same folder

cinder karma
#

Question for the general public

willow knot
#

or would i have to make a new folder so it goes down the directory

cinder karma
#

If I say "right angle banana" do you know what I mean

safe dragon
#

open("input.txt") will look for a file of that name directly in the same folder as the py

willow knot
willow knot
#

would this work if

#

this is the case

safe dragon
#

the open should work at least

willow knot
#

excuse the mess im on my laptop but this is what i thought of atra

safe dragon
#

I'm not familiar with python so idk how it does things here

willow knot
#

hmm ok lemme try it

#

ok i got it to write it into the logdata.txt! thats good

#

lets see here

#

now my issue is

#

i want to assign that lognumber to whatever the new logentry is

#

so when i go to readlog i can type in the lognumber and it spits out the entry associated with it

#

but i dont know how to do that....

pliant snow
#

In python it's also often suggested to do like

with open("path/to/file", 'r') as my_file:
  # Do stuff with my file

which will automatically close when youre done

willow knot
#

ooh that shortens things

pliant snow
#

If you always want it to increase I think you have a few options.

  • If you won't ever delete old entires, just get the number of log files and add one
  • If you do plan on allowing deletion of entires, you could find the largest filename and add 1
  • Or, store the index value somehow (which is how things like SQLite does it)
willow knot
#

okay i know what i have to tackle now: linking lognumber with the logentry, making sure the logsequence doesnt reset whenever i start program, and getting the reading to work

#

all the entries wil be on one file

#

it not creating a new file its just appending to the end

safe dragon
#

in real world scenarios you'd probably use something better suited than a text file to achieve that but the simplest possible approach would just to read from the file how many "lines" there already are in the file and just using that + 1

pliant snow
#

I was gonna say, this sounds perfect for a SQL database

willow knot
#

ok so

#

this is a box im gonna have to open

#

what would be better suited to this than a txt file

#

bc i was encountering the issue anyways taht if it writes it all to a text file anwyas theres no point to the readfile

pliant snow
#

The usual recommendation is that putting stuff in a txt file is fine if you're just writing stuff out for humans to read, but if the program is going to have to read it back, there are more ideal methods

willow knot
#

i want it so that i can input text data and have it sotred under a lognumber and then later input that number and it read back the text taht was written for taht log

#

also lemme just look up sql database rq

pliant snow
#

A perfect task for a SQLite database

#

thats literally what Bouncer does

safe dragon
#

sqlite is a good place to start cause you're working with a simple file still

pliant snow
#

Yeah, other SQL versions exist, which can store things in more or less the same way, but many of them are programs that you have to have running whenever your python program runs (which is fine on a server, a huge pain on your desktop computer), but SQLite is just a fancy file saved on your drive

#

You can sort of think of SQL databases as excel spreadsheets, but ones that computers can access very easily

#

But are more towards combining different tables together than doing weird equations

safe dragon
#

simplest alternative is some simple document database cause key: value pairs is about as easy as it gets

#

sqlite doesn't scale too great at the very high end but that's completely irrelevant in this case

willow knot
#

YEAH

#

oops caps

safe dragon
#

it also doesn't have the sheer number of features something like postgres would have

pliant snow
#

You could use the autoincrease functionality, but idk if you can have it spit out what that autoincrease value is without a second query..

safe dragon
#

you don't really need to anyway. The auto generated id is basically already what you want you don't even need an extra field

willow knot
#

do i do the uh pre release of the source code download

pliant snow
#

Are you on windows?

willow knot
#

yeah

pliant snow
#

You might have it installed

#

if you run python

#

then import sqlite3 what happens

willow knot
#

like this (i did this once befpre but forget how i did it sorry)

pliant snow
#

perfect

#

thats what you wanted

#

its already installed

willow knot
#

sweeeet

#

ok awesome awesome awesome time to figure this out

#

so i can use this database to pair a lognumber with the logentry?

#

since its like a table

#

ok time to do a lot of googling

#

THERES A KEYWORD INDEX

#

id have to add run sqlite at the top of my code tho yeah

safe dragon
#
  1. connect to the database(the file)
  2. create a table if it doesn't already exist due to some previous setup process
  3. insert a new row into that table
willow knot
#

ok how does

#

ok ok ok let me get my brain in order

#

connecting to the database is "the file" a seperate file or

safe dragon
#

gotta learn some SQL. A useful skill to have tbh in almost any tech field

willow knot
#

ok

#

any like place oyu rec me starting

#

like where did u learn

#

or do i just gotta raw dog it into google search

pliant snow
#

This might be a good start

willow knot
#

oh fuck yes

#

thank you both so much

safe dragon
#

yeah the

import sqlite3
con = sqlite3.connect("somename.db")
willow knot
#

i really appreciate it

safe dragon
#

it'll autocreate the file if it doesn't yet exist

willow knot
#

oh sick

#

and just so i have all my stuff straight con is short for connect right

pliant snow
#

the trick is that if it doesn't exist, you'll have to run a step to set it up the way you want. But if it does exist, you dont want to overwrite what's already there

safe dragon
#

you could probably get away with just a create table if not exists query you execute first

willow knot
#

mmk

safe dragon
#

in bigger projects you'd have some setup file to create the initial database for you the way you expect it

#

with migrations and all sort of stuff

#

but starting simple...

safe dragon
#

to be fair, the database isn't the complex part of your programs

#

for you

pliant snow
#

it's making it idiot proof

cinder karma
# willow knot

To be fair I didn't say jack or plug but this is a right angle banana

willow knot
#

oh

safe dragon
#

why call it a banana...

pliant snow
#

the other end is the banana

#

thats the socket

safe dragon
#

I'd have understood a right angle plug

pliant snow
#

.img banana plug

pliant snow
#

the metal tips kinda bow outwards like a banana

safe dragon
#

with some imagination

pliant snow
#

yes

safe dragon
#

honestly I gotta stop using postgres for little hobby projects it's so inconvenient

#

I'll just use sqlite next time...

pliant snow
#

I haven't used a non-sqlite database since college I think

#

governor 100% shouldn't be still using it, but here i am

safe dragon
#

most of my work is based around working with some far too big and complicated MSSQL database

ivory shadow
#

Postgres for life

pliant snow
#

I probably should start looking into something like postgres... doing what I'm doing with sqlite is probably not advised

#

I like just having a file tho

safe dragon
#

has it ever actually caused problems

#

does it look like it might cause problems soon...

pliant snow
#

the only time I've had any issue was I think because of the SQLite GUI I was using

willow knot
#

i see here how to call data using the data inputed, but how do i call using the auto cenerated id like you mentioned crumble? im a little lot on that since im scrolling though and i dont think theres anything pointing to that

ivory shadow
#

The bot is probably single thread single process right? Nothing wrong with sqlite for that

#

Sqlite is used for some pretty big and popular projects too. It's stable and good enough.

pliant snow
#

Each of the commands do run asynchronously, but yeah. I think the more significant thing I did was mount the SQLite file into two different docker containers so both the webpage and bot could access it lol

#

granted, the webpage is read only

#

so im not in any hurry to really change it

safe dragon
willow knot
#

ok

#

ok lemme try this

safe dragon
#
CREATE TABLE logs (
   log_entry TEXT NOT NULL,
);
#

it'd probably help if you get some program that can help you look at what your database looks like

#

and query on it

willow knot
#

hwews what im dealin with. thinking i can cur.excecute (SELECT) using the number = rowid

safe dragon
#

I'm gonna switch to a pc I'm gonna go nuts trying to type code on a phone screen

willow knot
#

and then print row

#

fuck i gtg i need to helo my mom with grocery shopping

#

im bringing a notebook and some pens with me tho so i can try and write this down on paper and get it sotred out in my mind

#

unjumble my thoughts

#

thanks for all the help so far

pliant snow
#

I've never used cursor() before

safe dragon
#

idk about this scenario but cursors in MSSQL were designed by satan himself to to mess with sql devs

#

this seems to be a different thing

pliant snow
#

I've always just done con.execute("CREATE TABLE ...etc")

safe dragon
#

apparently that's just a shorter version where it creates a temporary cursor for you behind the scene

pliant snow
#

very kind of it

safe dragon
#

this is for T-SQL/MSSQL but I thought it was funny

#

seems like if you're doing mulitple executes in a row you should be getting the cursor yourself and use that cause else it will re-create one every single time

#

idk why this is called a cursor it doesn't seem to be what I'm used to with cursors aka pure evil

#

cursors in T-SQL are essentially pointers to rows in a table that you can shift to other rows(usually the next one)

#

the very ugly cousin of a foreach loop

willow knot
#

LMAO

#

yeah the python sql guide was lie "use cursor bc you end and then make new one later so uhhh"

#

and i was like "ok that makes sense to me"

cinder karma
#

My new tweezers: apparently can cause reproductive issues in the state of California

willow knot
#

oh yeah my melon soda does that too

#

a lot of things do that apparently

#

im not in cali tho so im fine /j

pliant snow
willow knot
#

does this make sense

#

wait oops i have to put logs as the thing

pliant snow
#

The thing inside of execute is a string, so it won't know what number is, it'll think you're searching for the literal word "number".

willow knot
#

so i put like readlog(2) and it selects the readlog with rowid 2

pliant snow
#

You'll want something like

res = cur.execute("SELECT * FROM logs WHERE rowid = ?", [number])
willow knot
#

OHHH right i cant put existing strings into these

pliant snow
#

I think you also need to call fetchall or fetchone on it as well

willow knot
#

yeah

#

but i wanted to doubel check first

#

oppugh fuck you if not exists command in python

#

wait i can make an exception!!!!!!!!!!!

#

NVM

#

im doing this later

#

but i got some of it goin i think

#

thanks again for all your help guys

dapper sinew
#

hehehehe, i got nano on windows

pliant snow
#

c-congrats

dapper sinew
#

i will turn windows into linux somehow

#

i need it

#

Windux

pliant snow
#

no one tell them about WSL

dapper sinew
#

i know about that

#

but it dont WANNA WORK AAAAAAA

cinder karma
#

I literally use git bash on windows

#

This is how you can tell I'm actually an Old

pliant snow
#

i use git bash

#

i think many people in corporate places still use it

dapper sinew
#

i use it sometimes

#

but im lazy so i just use whats in front of me

modest jewel
#

It's few days now, I really want to know what's wrong with my code. The code is a mess because I don't have time to come out with a good design system so I hope you can get it.

modest jewel
#

I think the problem is in the code, also, my mode is reprogramming(is this right word) crow of game do i think it's better to ask for help here

sand frost
#

No, this is for off-topic stuff

#

like "hey guys, what's the best IDE and why is it vim?"

sonic mirage
#

"also, does anyone happen to know how to exit it? it's been 12 years"

cinder karma
#

Gotta keep the shitposting quotient up

strange copper
#

i used VIM until I realized I could use VS Code's SSH extension for remote work and then I never touched VIM again

sonic mirage
#

In my Comp Sci 1 class I did almost the whole course writing C++ in vim by SSHing into the school's server because for some reason I thought that was the only way to write it. I was computer savvy at the time, so I guess I just never thought about it just being a flat file you could edit with any editor, such as one on my own computer.

strange copper
#

C++ feels it deserves cryptic treatment

#

like no syntax highlighting, "look at me i'm low level"

sonic mirage
#

Yeah, we learned all the low level stuff by writing it ourselves. Linked lists and such.

strange copper
#

we did that too but it was definitely not in the intro sequence

sonic mirage
#

I haven't touched C++ since CS2

strange copper
#

real

sonic mirage
#

Prior to those two courses, I did Python in an Intro to Programming course I took as an elective for another major. Turns out it clicked with me, as I spent most of class helping other students with their code. Haven't touched Python since that class though either lol

#

I then switched to Comp Sci

strange copper
#

sounds like you would have enjoyed TAing

cinder karma
#

Do I appear to be an actual software dev? People keep asking me that.

pliant snow
#

you appear to be a cat with a power drill

strange copper
scarlet hollow
#

Found my way to the merch store for Cypress, the testing library (don't ask) and omg they have the cutest nerdy kiddo clothes

strange copper
#

cypress is fun, what's the merch like

scarlet hollow
strange copper
#

wait they kinda cooked

scarlet hollow
#

They did!

#

Especially love the onesie (the first one)

strange copper
#

that baby onesie test never gonna pass tho ๐Ÿ˜ญ

#

kid not gonna sleep

modest jewel
#

Crash!

scarlet hollow
sand frost
pliant snow
#

everyone is a software dev if they believe โœจ

safe dragon
#

I don't believe

cinder karma
#

Every time LabVIEW boots and paused on loading system.reflection I'm mildly amused

willow knot
#

i got that whole log thing to work!

#

heres the code rn. its ery bare bones

#

i have some kinks to work out but in the end i fugured it out!!!!

pliant snow
#

time for us to nitpick every little thing

willow knot
#

thanks again for all the help yesterday

#

LMAO

#

honestly ill take whatever crit i can get

#

im an art student im used to it, and i know itll help me learn

#

theres a LOOOOT i dont know

#

so if you have greivences, by all means, go ahead

#

my next task for this project which will probably be a little thing i come back to tinker with code wise every once and a while, is amking it so i dont have to re run the code everyt ime to rad a log or make a enw one

pliant snow
#

that should be a pretty easy change

willow knot
#

im thinking of implimenting a loop but id have to fiddle a bit since ya know

#

i dont know a lot

#

the last time i made a program repeat i shoved the whole code into a new def repeat command

#

and i KNOW theres easier ways to do it than that

#

just not quite sure what they are

#

or rather, how to approach them

cinder karma
#

Quick thing: I usually use ruff to format my python

willow knot
#

whats ruff

#

is that another ide

cinder karma
#

Autoformatter

willow knot
#

ohhh

lethal walrus
cinder karma
#

Nah, just something I install into the ide to consistently format my code

gilded hound
willow knot
#

whats a linter

#

like wht is linting in code

pliant snow
#

its a program that gives suggestions for cleaning up code

willow knot
#

ooh installable via pip

#

ooh neato

pliant snow
#

you'll need to either run it separately, but more popular is you set it up so your editor shows suggestions

willow knot
#

THERES A HITCHIKERS GUIDE TO PYTHON

#

I LOVE HITCHIKERS GUIDE TO THE GALAXY

pliant snow
#

here, i'll give you some feedback

gilded hound
#

Have you tried hitchhiker's guide to fractional sobolev spaces?

willow knot
#

i have not

pliant snow
#

what happens if you run your program and type in "Create new log"

willow knot
#

man i should read that book again

#

OOOH FUCK

#

I HAVE TO LOWERCASE EVERYTHING

pliant snow
#

you do

#

at least right now

willow knot
#

HOLD ON WHAT WAS THT THING AGAIN I HAVE IT

#

uh uhuh

#

casefold

pliant snow
#

what is casefold

willow knot
#

make all letters small

safe dragon
#

casefold is essentially a lower that lowers more characters

willow knot
#

but like it works diff for other languages

pliant snow
#

oh i just always used lower lol

willow knot
#

bc i think lower turns like hu

pliant snow
#

does it lower in place

willow knot
#

รŸ

#

it amkes that ss

safe dragon
#

I doubt it lowers in place

willow knot
#

but i think casefold doesnt? or the other wya around

#

what does lowering in place mean

pliant snow
#

it means it should be action = action.casefold()

willow knot
#

huh

gilded hound
#

Casefold just lowers more characters

safe dragon
#

basically. casefold() does not modify whatever it is run on. It has a return value you have to assign back to some variable

willow knot
#

ohh...

#

huh. didnt know that. it orked fine on another project like this

#

well the more i know

#

a very simple project i made like a week or so ago

#

this wsa my first ever thing i coded

gilded hound
#

That wouldn't be actually lowering the case.

willow knot
#

oh. guess i hust got lucky wiht people who tested it

gilded hound
#

Not too
mention you should use lower unless you really need casefold

safe dragon
#
original = "WitH caPitAL LeTters"
lowered = original.casefold()

print (original)
print (lowered)

as you can see the original is never changed in the casefold()

pliant snow
#

ah yes, spongebob case

safe dragon
#

yes

willow knot
#

ohh i see

#

will using action = action.casefold() casue any weird issues? like should i make it action2 = action.casefold() or smth

pliant snow
#

nah, its fine, so long as you never need the original action again

willow knot
#

no, theres no reason fo rit to exist capitalized

#

ok cool

safe dragon
#

also yeah. You're probably never going to notice the difference but casefold has some strange things it lowers like รŸ into ss

willow knot
#

yeah

#

would using casefold instead of lower be a bad habit to get into

gilded hound
#

Yes

willow knot
#

why /genuine

gilded hound
#

Casefold is worse for performance and you have no reason to use it

willow knot
#

why is it worse for performance (i beleive you im just trying to learn more and knowing why i should or shouldnt do things helps me a lot)

gilded hound
#

Well it handles more things, so it needs to do more.

#

The main reason why you shouldn't use it, is because of use case. If you don't need it why use it?

willow knot
#

fair enough

safe dragon
#

there's no real measurable performance difference between casefold and lower as far as I know

willow knot
#

i guess if the program is big enough and youre casefolding enough things, but ig thats the case for most anything

gilded hound
#

Not any significant one.

willow knot
#

thank you fo rthe input yall! even though its rough around the edges, i made a code that uses a database within my first week of coding, andim proud of that

#

its super simple yeah but im learning!! and doing things with my time!!!1

#

i even got an npc and maps to work in stardew coding (with plenty of help ofc) in that week!

safe dragon
#

tbh if the performance difference between casefold and lower ends up being a big enough concern in any project... you probably shouldn't have been using python in the first place

gilded hound
#

^^ it's not worth the effort of writing performant Python

willow knot
#

yall have all been so nice to me i wanna thank you again for putting up with my admittedly sometimes idiodic questions

safe dragon
gilded hound
#

Yup, and you eventually just write the whole thing in c anyways

willow knot
#

im guessing performant python is like a code meant to perform certain tasks yeah

safe dragon
#

performant means fast and/or memory efficient in this case

willow knot
#

ohhh

#

as in able to perform many tasks quickly and well without takinig up memory ok ok ok

#

im gonna learn c eventually but

#

its

#

very daunting

safe dragon
#

python trades performance for convenience a lot which means it's poorly suited for anything where performance really matters

willow knot
#

im gonna spend time in python wrapping my head around a lot of the basics and getting used to the workflow

gilded hound
#

Python's a good place to start, don't worry about learning C for a while

willow knot
#

the stardewmodding stuff uses javascript right?

safe dragon
#

C# or apparently json(idk I'm not a modder)

willow knot
#

oh

#

i mean the files are json

lethal walrus
willow knot
#

so yeah

gilded hound
#

json covers mostly everything, csharp for what's left

willow knot
#

that mightbe where i take my journey next after i learn more in python since i have experience in that with my cruddy mod

gilded hound
#

although, I remember Trent was working on an F# mod, so that's another possibility

willow knot
#

i

#

didnt even know f# was a thing

safe dragon
#

it's the functional programming brother of C#

willow knot
#

ohhh

#

f for function

safe dragon
#

which I'm sure is followed by the question "what is a functional programming language"

willow knot
#

n

#

no

#

i have google

safe dragon
#

functional programming vs other approaches is a whole argument you could dedicate your entire computer engineering career on hc_pensive

gilded hound
#

I've been learning functional python, helps to write more performant python code, that I unfortunately have to write

safe dragon
#

interesting. functional programming isn't known for performance. More for correctness guarantees

gilded hound
#

Its to avoid using ugly nests of while loops, definitely not the best possible, but it's the next best thing

#

I'd rather just rewrite everything in C, but we struggle to write sensible code here so that won't work lol

willow knot
#

so what i can gather and feel free to correct me. functional is more focused on gathering precise and accurate results and data based on whatever it is youre doing rather than doing that thing super fast and such like performant is

#

so while performant would be used fo rthings liek games where being fast and smooth is important

#

functional might be used for things like science whre extreme accuracy is more important

#

but they can still be used for the other scenario

#

jsut more the way my brain is kinda processing the ideas

safe dragon
#

I've written and deleted an explanation like 10 times

gilded hound
#

Same, its a complicated topic

#

A quick response would be they're both performant. Its not functinoal vs performant, its functional vs OOP

#

In science, we do tend to use functional programming, because we usually have a set of data, and operations we perform on that data, and we want to do a lot of things concurrently.

willow knot
#

ok

#

so i guess... permormant is like functional but faster and a bit more loosey goosey?

safe dragon
#

the main performance caveat of "pure" functional programming is immutable datastructures. What that means is for example that if you had a list [1, 2, 3]. If you wanted to add a new number to this list, 4, you would modify the original list and turn it into [1, 2, 3, 4]. In pure functional programming you would instead opt to create a new separate list [1, 2, 3, 4] while leaving the original intact. (Languages that do this have clever tricks to not truly copy over the entire list but that's not something you see as a user of the language)

gilded hound
#

Performant is just a way to describe your code. Like it runs really well

willow knot
#

oh

#

ok

#

sorry for all the fuss, but i do know more now

safe dragon
# safe dragon the main performance caveat of "pure" functional programming is immutable datast...

functional programming likes this immutability because it makes it safer to reason about.

Like say you have a list again and you pass it to some function. In a mutable environment you do not know if the list will still look the same after the function is done without checking whether whatever you called changes it, which isn't always reasonable or possible. In an immutable environment however you don't have to worry about this because the list you sent would never change suddenly

#

there are functional programming languages that allow for mutation and there's a lot of imperative languages that have ways to try and have ways to make sure something cannot be modified or give easy insight into whether it will be

#

so it's not a clear cut thing

#

but that is one of the big things that is usually treated differently in functional vs imperative

#

the casefold()/lower() thing here is an example of what would be functional programming approved. It doesn't modify whatever you called it on, it just returns a new "version" of it without messing with the original

#

in a fancy term this benefit is called referential transparency

gilded hound
safe dragon
#

I'm only at 9.5 years smh

#

well I guess 10...

#

fine, a decade

#

and yeah I wouldn't worry about it for now. You can form strong opinions about this later and argue with people online

#

and then all come together in that you all like rust

#

welcome to #lost-rustaceans

willow knot
#

Idk what rust is but I'm sure I'll get there eventually

#

Unless you mean the game rust in which yes

#

Seriouy though, everyone here has been so helpful and patient, it's made the learning process enjoyable

safe dragon
#

rust is a programming language, probably not a good one to try and get into rn

cinder karma
#

Aggravation is realizing you're somehow editing the wrong file

#

Pro tip: if none of your changes work, try an assert False

safe dragon
#

reminding me of a much worse version of this I had with some programming language where it was just refusing to recompile some specific changes

#

I went insane trying to figure out why my code wasn't working

#

ended up completely deleting the old build for a clean build and suddenly it worked

#

I forget which language it was

#

might've been rust actually

dapper sinew
#

mmmm art code

safe dragon
#

is that piet

#

it is

#

hello world in Piet

dapper sinew
safe dragon
#

love esoteric programming languages

willow knot
#

ooh

#

that looks cool

dapper sinew
#

im determined to learn the uwu one

#

but idk how to run it so no sense in learning it yet

crystal wren
safe dragon
#

that's evil

dapper sinew
safe dragon
#

the uwu language...

#

dear god

#
UwU is this fibonacci?

a iws 1
b iws 1
c iws 0

OwO *notices 100 gweatew than a *
    c iws b 
    b iws b pwus a
    a iws c
    n iws n pwus 1
stawp

nuzzels a
dapper sinew
#

you cant tell

willow knot
#

That's horrid

dapper sinew
#

but im dying of laughter

willow knot
#

I love ot

dapper sinew
#

theres also PythOwO

safe dragon
#

the name reminds me of an actually legitimate language which in my mind is still esoteric

crystal wren
dapper sinew
#

i want MC commands as useable code

#

but sadly i havent found anyone thats done it yet

safe dragon
#

MC commands are already usable code

dapper sinew
#

i meant syntax and all

#

i cant slap execute @e{type=arrow} ~ ~ ~ run summon arrow ~ ~ ~ into a terminal

safe dragon
#

I do wonder what exactly that would do

#

you did remind me of sethbling's compiler for datapacks

#

basically created his own language that then compiles into valid minecraft datapacks

dapper sinew
#

i just wanna state how much i hate python and pip, they NEVER seem to work Path wise

#

grumpy noises

safe dragon
#

all my homies hate pip

#

I don't ever use python but I've had to install stuff with pip a few times and half the time it just breaks

dapper sinew
#

it really does Cry

#

it have more fever dreams than AI does

#

i swear, it works only when it wants

#

im dying

#

hahaha

lethal walrus
pliant snow
#

I never use pip on my host machine. I either use python-* packages or a container anymore

winged grove
#

if stardew valley was programmed in assembly how different and faster would the game be? Sorry i've always heard that assembly is crazy hard to program

pliant snow
#

The short answer is "it wouldnt be", as it's not really feasible to program stuff in assembly anymore. Since SDV needs to run on modern computers and consoles, you have to use the functionality that the console creators allow you to use, which doesn't really accommodate assembly (at least not very easily).

cinder karma
#

But I don't really do personal python projects that often anymkre

#

I tend to use dotnet8 or rust these days

safe dragon
#

assembly also isn't a cheatcode to good performance. Assembly only gives you good performance if you actually know what you are doing which, chances are, you won't be

winged grove
#

you'd be able to run it on anything if it was programmed in assembly? I'm just wondering about the pros and cons, I remember rct being programmed with that back in the day

pliant snow
#

When you program something in assembly, you have to program it for a specific processor type, so it actually would run on even less things than it does now, for example he'd have to completely rewrite it from scratch for modern Macs

#

The pros are basically none these days

sand frost
#

Thereโ€™s lots of rendering shit that would be super painful probably

cinder karma
#

Beating the compiler in assembly requires you to be smarter than a compiler dev

#

And compiler devs are scary smart

winged grove
#

Ah I see

sand frost
#

I donโ€™t want to write an audio driver by hand, either

pliant snow
#

coward

sand frost
#

Thatโ€™s me

#

Abject cowardice

cinder karma
#

Sometimes I have quibbles with how the compiler choses

safe dragon
#

compiler devs wouldn't even see me I am less than an ant to them

winged grove
#

It sounds like you have to be mad man to program any new games in assembly nowaday from what it seems

cinder karma
#

But I wouldn't be able to do better across any decent project

sand frost
#

I am but a simpleton who does not touch my wifi drivers or my audio drivers

pliant snow
#

There are games being made in assembly, but for systems that have the tools to support it, like old NES and Game Boy and such. You'll still find people making new games for them

#

I was just playing a new sega game today, although that one was made in C i think

safe dragon
#

weak

winged grove
#

but maybe in assembly you have more control over your code? I'm no programmer but I love to research this stuff from time to time

pliant snow
#

Control... I suppose. But it's not a level of control you need anymore and you'd prevent yourself from using any other tools that exist to make things easier

safe dragon
#

you'd just be making things more difficult for yourself with essentially no benefit

pliant snow
#

I know enough game boy assembly to get around, but even then if I were making a game boy game I would just use a C compiler

#

and you too can learn game boy assembly with my overly verbose guide coming soonโ„ข๏ธ

devout vault
#

I had a lot of fun using mips back during computer organization class

#

Was gonna make a small game with it but couldn't find an emulator that had all the features I wanted

winged grove
#

What about game boy color assembly? Somebody should make The Legend Of Zelda Oracle of Secrets! How possible would that be if you knew the know how in assembly, how different is og boy vs color? @pliant snow

pliant snow
#

Somebody should make The Legend Of Zelda Oracle of Secrets!
I think they already did lol

OG game boy vs Color is extremely similar. It's the same CPU and functionality, the only difference is how the graphics are laid out

winged grove
#

my heads going to explode they made one dang

#

I gotta checkl that out

pliant snow
#

oh secrets, I read seasons

#

theres no difference between game boy and game boy color assembly tho

winged grove
#

Those games, seasons and ages had a third version called Oracles Of Secrets, they scrapped it for the gbc. It would've been neat the play that third version

pliant snow
#

if you wanted to make that, you probably would start with just hacking the released titles rather than creating a whole engine from scratch

winged grove
#

You'd have to change game mechanics. this is what someone says from a reddit post "According to what I've read the original idea was actually for the third game to be about colors. Nayru was originally going to be a painter and you were going to use a magic paintbrush to solve color puzzles.

Meanwhile Farore was going to have the time travel mechanic, except it was only going to change the time of day, not send you back and forth 400 years.

Eventually the third game was scrapped and the time travel mechanic was moved over to Nayru's game as that one was reshaped into the Oracle of Ages, but the color mechanic still survives to a degree, that's why there's so many puzzles based around colors in that game."

pliant snow
#

speaking of game boys and rust tho if anyone wants to proof read a series of articles about a Rust game boy project ๐Ÿ‘€

safe dragon
#

I've read at least a paragraph of it once

winged grove
cinder karma
#

Insert meme of celebrating because the error message changed

pliant snow
#

if youre really lost-crustaceans, what greater joy could there be

safe dragon
#

actually using rust

pliant snow
#

gross

safe dragon
#

you're right. Rust is bout praising it online, not using it

ivory shadow
cinder karma
#

I don't know, it has a debugger

ivory shadow
#

True. I argued that myself... even though it's an awful debugger

safe dragon
#

it does have a debugger

#

I've never gotten it to work

#

but it's there

gilded hound
#

I've gotten it to work, but its awful and I don't recommend it. SDVpufferfear I still remember watching my ram usage climb to 64 then my computer crashing.

cinder karma
#

/me changes position of two lines of code that should have nothing to do with each other

#

code works now

#

(Timing issue I think)

cinder karma
#

Is anyone good at handling out of memory?

#

My computer keeps on crashing because opengl can't allocate more memory

thin estuary
#

My VS memory leaks when I try to profile anything

tranquil grove
#

when I tested some LLM junk, python was pretty good at telling me "your graphics card doesn't have a terabyte of memory, reboot with lower settings" SDVkrobusgiggle

#

operating systems themselves, generally pretty upset about it

cinder karma
#

Arr you sure you don't have a tb of vram

tranquil grove
#

windows says I don't, and I trust it completely

#

(that said, it's also bad about freeing up memory after python scripts sometimes)

sand frost
#

Brand new sentence โ€œI trust windows completelyโ€

#

I swear Matlab has haunted shit in it regarding memory usage

#

Specifically with recording videos

gilded hound
sand frost
#

Yipes

gilded hound
#

They don't implement thread affinity properly SDVpufferweary

supple ether
#

wish there was a less stupid way to specify that a method should only return the implementing type on an abstract class
maybe I could do something with interfaces but god there's already so many generics

#

c# I love you but sometimes you have some Serious Holes

thin estuary
#

interface ISomething<T> where T : ISomething<T>

safe dragon
#

I've recently found that you can completely balloon your memory usage and clog up the signalr message bus in Blazor Server simply by holding a key down while whatever you focus on has an @onkeydown

#

I just watched my memory usage go up to 900MB

#

just by holding down a button

#

luckily the feature to control this has been moved further and further back...

#

first was planned for .net 8, then .net 9 and now it has already been moved to .net 10

#

had to rewrite something for work to avoid this dang issue hc_pensive

crystal wren
#

How can they consider this a low priority issue? SDVpufferfear

safe dragon
#

they work in mysterious ways

crystal wren
#

Makes me glad I'm not interested in Blazor!

safe dragon
#

it's a very versatile web framework but yeah stuff like this is just baffling sometimes

crystal wren
#

Gotta beat me screwing around 10+ years ago making super trivial pages using C++ because I can. SDVkrobusgiggle

pliant snow
#

maybe its an easter egg

crystal wren
#

I love how actually possible that first comment is.

safe dragon
#

mainly cause they're an emacs user

cinder karma
#

This one enjoyed shouting at everyone passing by haha

sonic mirage
#

We have a goose couple that comes back to our office building every year to nest. Except its up against the building along the driveway to get to the back of the building, where we all park. So the male is constantly attacking our cars as we drive by. Luckily we can go into the neighboring building's driveway and get to our back lot from theirs, but their driveway and lot are a bunch of crazy angles and hills, so it's not great. Anyways, geese can suck a lot of the time.

fierce meteor
#

okay guys so i need help with transpiling

#

I get the concept

#

but is there an easy way to get the equivalent CIL code i need to generate by editing the decompiled game functions?

#

I use Rider on MacOS

cinder karma
#

I assume every goose yelling at me is yelling about ui/ux sins

#

The more geese you have angry at you, the more sins

lethal walrus
#

it feels so good to see strings you recognise in an assembly/c decompile

safe dragon
#

mov

lethal walrus
#

ooooh
debug features are in the switch build

#

the smapi diagnostic check is in it too, doesn't make sense to remove it tbf

#

.. what?LooseSprites\\TutorialImages\\FarmTut

lethal walrus
#

:o it has the macro running text

devout vault
lethal walrus
#

:o i found the chatbox

#

oo savegame class

#

SDVpufferthink there's no save fixes it appears
nvm it has the lastappliedsavefix field

fierce meteor
#

Can transpiled harmony patches access mod namespaces?

#

Just for accessing static / const objects / functions / primitives

thin estuary
#

you can access anything with reflection

safe dragon
#

even private methods

#

you can break just about anything with reflection

#

I have no idea what a harmony patch is but I assume a modding thing

thin estuary
#

yeah

fierce meteor
#

You can patch existing game functions to implement modded features

#

Prefix and postfix are simple enough

#

Transpilation is somewhat more advanced

pliant snow
#

Wtf is reflection

crystal wren
#

It's "let me see your private things, please".

cinder karma
#

it used to be called introwospection

crystal wren
#

Unusable. Rust is dead now.

cinder karma
#

Friendship with Rust over. Becoming even more insufferable - learning OCAML

crystal wren
#

Aww, man... I mean the renewal process is easy, but...

safe dragon
#

reflection is what I do when the type system fails me or would make things more complicated than it's worth...

safe dragon
#

I still don't know why people are suddenly getting into ocaml lately

fierce meteor
#

Ocaml is trash

#

Learn haskell instead

safe dragon
#

I don't want to

#

reading haskell enthusiast forum posts feels like I entered some conference for theoretical mathematicians

#

I've done an entire year of advent of code in haskell and written a simple compiler in it for school but still I feel like people who really love haskell are living in a different universe

uncut seal
#

try uiua, I'm currently taking part in a small code golf competition and uiua is the meta, is pretty fun to learn imo

pliant snow
#

please, you think crumble hasnt tried uiua

safe dragon
#

I've done 2 days of advent of code in uiua...

#

๐Ÿ˜Œ

#

uiua is a little much for me

#

especially uiua that isn't extremely inefficient

#

I think I just did the one where you had to find 2/3 numbers in a lost that add together to 2020

#

normally a fairly trivial problem and in theory trivial in uiua but my solution was slow as hell, it took like half a second while my rust solution took like half a millisecond or something

#

the uiua solution had like a ton of Cartesian products in it

#

found it

pliant snow
#

how do they expect you to type that

safe dragon
#

you write the actual function name and the formatter replaces it

pliant snow
#

oh so theres an intermediary step

#

a compiled and interpreted language, excellent

safe dragon
#

for uiua, yes. Most other array programming languages have specialized keybinds per character

#

APL even has dedicated keyboards

cinder karma
#

Habha

safe dragon
#

I refuse to believe array programming languages are used in production anywhere

safe dragon
# safe dragon

oh right I also had the short version for this:
โŠƒ(รท6/+โ™ญร—โŠƒ(=2020โŠž+โŠž+..)(โŠžร—โŠžร—..))(รท2/+โ™ญร—โŠƒ(=2020โŠž+.)(โŠžร—.))โŠœparseโ‰ @\n.&fras"input.txt"

#

I'm sure it could be much shorter

uncut seal
#

My uiua code to give the first 100 prime numbers : โˆต((&p|)>1โงปยฐ/*.)+2โ‡ก540

uncut seal
safe dragon
#

definitely not optimized in any sense of the word but I can't even read my own code here

#

I think the rice paddies ็”ฐ things are the Cartesian products

#

I forget

uncut seal
#

one of the participants in the code golf competition is so good at it, he got a solution shorter than mine in half the time it took me to get mine for every exercise

uncut seal
safe dragon
#

I've never done code golf though I understand the appeal

uncut seal
#

so yes

safe dragon
#

I'm honestly more prone to overly verbose code for the sake clarity

#

split calculations into pieces just so that I can give proper names to intermediate sections of the calculation...

uncut seal
safe dragon
#

would be very counterproductive in code golf to be verbose...

uncut seal
#

either way I like uiua because it's the first time I code in a stack based array language and it's pretty funny to work around no variables

safe dragon
#

it's write only code but at least it's fun

pliant snow
#

all my code is write only

safe dragon
#

how do you get approval on your PRs

cinder karma
#

Chocolate

pliant snow
dusky oriole
#

Hii, can someone help me install a mod to stardew valley? Like I read a bit about it and saw I need to install Smapi and Content Patcher, are these two reliable and without viruses?

pliant snow
#

They are, they are widely tested and used for mods

dusky oriole
#

Oh thank you!

pliant snow
#

i think thats the right one

fierce meteor
#

hey guys anyone familiar with CIL / transpiling?

#

do branches with two operands pop them from the stack?

high willow
#

I wonder if anyone will be able to get with Moolah's Money Mod ngl

fierce meteor
#

I need some help with my transpilation code

safe dragon
#

I'd love to help you but I barely know what transpilation is

#

I mean I've technically written one before but even then

#

I feel like if anyone did want to help they'd need to know from what language you're transpiling and into what other language

lethal walrus
#

given the discord I'd have to assume c#, though given the channel could not be

safe dragon
#

though the question remains what the target language is then

#

I did once write a very basic and not even close to feature complete transpiler from C# to some funky little finite state machine

#

idk at what point it stops being transpilation and becomes compilation

#

I guess that's more a compiler since a finite state machine is a much lower level abstraction

fierce meteor
#

C#

#

stardew related

#

actually it's more of a CIL question

#

do branch statements pop their operands from the stack?

crystal wren
#

I'll be keeping an eye open for this help actually happening, because I need to steal the wisdom.

thin estuary
#

I find the question weird, since operands normally are unrelated to the stack, other than for the instructions which literally put them on the stack

#

Like ldc.i4

pliant snow
#

I know next to nothing about CIL, although its stack based isnt it? So one would assume yes

fierce meteor
fierce meteor
# thin estuary Like ldc.i4

i shouldn't have said operand, i meant branches such as bne that operate on the top two elements of the stack

#

I have a suspicion that my use of bne is wrong... CIL probably can't compare two strings that way

#

do i have to call a function? e.g. string.equals for this?

thin estuary
#

pretty much any instruction that reads from the stack, does so by poping

fierce meteor
#

in other words, let's say i loaded two ints on the stack, then i beq'ed somewhere else, i don't have to worry about popping them?

fierce meteor
thin estuary
#

the simplest way is to call your own static method which does whatever you need

#

instead of trying to figure that out on the CIL level

marble jewel
#

The more complicated you make the CIL, the more likely you are to break things

fierce meteor
#

am I using Label properly in my code?

marble jewel
#

KISS applies to transpilers (Keep it simple S****d)

pliant snow
#

You can say stupid on the internet

marble jewel
#

i.e. don't unnecessarily overcomplicate things. You'll regret it later.

safe dragon
#

my philosophy is the opposite

#

build anything as if it needs to handle a billion people using it even if the only person to ever see it is me

thin estuary
pliant snow
#

Begin with the contribution guidelines

thin estuary
#

(i didn't check if this IL makes sense though)

safe dragon
#

get the readme and contribution guidelines set up and then cargo new

thin estuary
#

but that IS how you use Labels in transpilers, yes

marble jewel
#

There is such a thing as "over-engineering" and/or "over-optimizing" before you have working code

safe dragon
#

I'm the master of both

thin estuary
#

yield return new CodeInstruction(OpCodes.Ldarg_S, "weaponItemId");
this definitely is wrong though

marble jewel
#

SpaceCore has a nitfy "identify locals by name" thingy

#

Otherwise, this expects a short value

thin estuary
#

that's an arg though

marble jewel
#

Yeah, either case this needs the index of the argument, not the argument name

thin estuary
#

and please don't use the _S variants, you're making it harder for yourself

cinder karma
#

You can use the _S variants fine tbh

#

As long as you use a byte

#

Especially for arguments

#

Anyways

#

== has a name

#

Is op_Equality

safe dragon
#

y'all doin some arcane stuff

crystal wren
#

I'm trying to puzzle out what the _S variant would be without Googling going just by the context of Atra saying "as long as you used a byte"...

marble jewel
#

_S = short

crystal wren
#

Oh, well that's fairly obvious in hindsight.

safe dragon
#

that's what I assumed

marble jewel
#

The _S variant just means you do (short)5 instead of 5 that's the extra work

safe dragon
#

not that I have any idea what on earth ldarg is

marble jewel
#

Or 5s perhaps?

fierce meteor
#

Damn i thought ldarg with vaeiab(e name works cauae i saq it in dot peek

safe dragon
#

educated guess would be that ldarg is should for load argument or something

ivory shadow
#

Yes, it is exactly load argument.

safe dragon
#

what that actually means though I don't know

marble jewel
#

Ldarg are for arguments, Ldloc are for locals

#

Both refer to the arguments or locals by their index (not name)

fierce meteor
#

Push that argument to stack

thin estuary
ivory shadow
#

Also you need to be careful with ldarg because static functions start their arguments at zero, while instance functions start their arguments at 1 and the instance itself is zero.

safe dragon
#

I've never even looked at IL the dotnet IL this might as well be machine code to me

marble jewel
#

We aren't necessarily getting into SDV specifics yet

#

Harmony is a whole programming topic on its own

#

In fact, you may get more help on Harmony's official Discord

ivory shadow
#

Talking about IL isn't even necessarily harmony specific. You can write methods using IL.

marble jewel
#

True, although I wouldn't know where to begin doing that

ivory shadow
#

Stuff like ```csharp
internal static Func<T> CreateGetter<T>(this FieldInfo field) {
if (field is null)
throw new ArgumentNullException(nameof(field));
if (typeof(T) != field.FieldType)
throw new InvalidCastException($"{typeof(T)} is not same as field type {field.FieldType}");
if (!field.IsStatic)
throw new ArgumentException("field is not static");

if (!FieldGetters.TryGetValue(field, out var getter)) {
    DynamicMethod dm = new(MakeAccessorName("Get", field), typeof(T), null, true);

    var generator = dm.GetILGenerator();
    generator.Emit(OpCodes.Ldsfld, field);
    generator.Emit(OpCodes.Ret);

    getter = dm.CreateDelegate(typeof(Func<T>));
    FieldGetters[field] = getter;
}

return (Func<T>) getter;

}

marble jewel
#

Harmony is still magic to me

safe dragon
#

when would you ever write something in IL instead of just writing it in C# or something and then compiling it to IL

marble jewel
#

I've delved into doing non-Harmony IL stuff once, it was scary

#

I did a thing where I created generic delegates and had to generate IL

ivory shadow
#

Writing something in IL lets you do two things:

  1. generate a function at runtime that's highly specialized for a specific thing that isn't obvious at compile time (probably, but rare)
  2. generate a function to ignore access stuff without being slow as fuck like normal reflection
safe dragon
#

I mean I've never had a use for doing anything with the IL other than look at what it generated in very rare cases but I guess this is a thing that's done in modding

devout vault
#

Slightly on topic but SDV writes raw IL to generate the splitscreen state swap code

ivory shadow
#

Granted in .NET 8 you can set up to ignore access restrictions, but if you're stuck on, say, .NET 6 for some reason...

devout vault
#

(I wrote that fun bit of code...)

thin estuary
#

creating duck-typing proxies like my lib Pintail does; making a weird hook thing that lets you pass in any Delegate, skipping any arguments you don't care about, and making it work with some full method definition somewhere

thin estuary
#

that one was "fun" to implement

marble jewel
#

My IL generator use case was dynamically subscribing to net events as part of a content pack format

safe dragon
#

I'm learning more and more that modding involves doing some arcane stuff that you would definitely never ever use or even get away with using in most traditional software projects

thin estuary
#

that's correct

safe dragon
#

you can get away with anything if you own it

fierce meteor
ivory shadow
#

Video games are all about slapping code together

marble jewel
safe dragon
#

reverse engineering rival products sounds like it'd be interesting and maybe illegal I'm not entirely sure

thin estuary
#

nicee

marble jewel
#

One limitation of this is that it doesn't currently handle multiple binary expressions chained together

devout vault
#

Pidgin?

marble jewel
#

I kept on getting stack overflows when I tried supporting AND and OR recursively

devout vault
#

Looks spooky

safe dragon
#

ah now parser combinators are something I know

marble jewel
#

It still needs work, but it works well enough for now

fierce meteor
marble jewel
#

I can do things like "(this or !that) and other"

crystal wren
#

I only know Pidgin as an IM client from the olden days...

ivory shadow
#

That's what I was thinking, DH

fierce meteor
devout vault
safe dragon
#

I like parser combinators they're fun

marble jewel
#

Anyway, the consensus is that the feature, although technically sound is not very-well liked in the hands of average mod users

#

But like, I make most of my mods for myself, and share the results with others

devout vault
#

That's how it starts...

#

frameworks lurking ominously in the background

marble jewel
#

It's funny too because the default config options I ship with are the ones I want to play with

crystal wren
#

I still like that my biggest mod came from me watching the Haunted Chocolatier trailer, and thinking "hey, that would be cool to be able to do in Stardew!"

marble jewel
#

So when people ask me to change it, it's like... I'm already being nicer than I have to by offering options.

ivory shadow
#

My biggest mod came from "if I need to scroll through this entire twenty pages of recipes one more time I am going to strangle someone"

safe dragon
marble jewel
#

Meta

safe dragon
#

someday I will install smapi and try a mod

crystal wren
devout vault
#

It'd make more sense to have trailers preview before movies

marble jewel
devout vault
#

Wait, that's on topic, sorry

safe dragon
#

uh I've technically played sdv since the very first hour the game got released but I've never reached year 2 peepohappy

marble jewel
#

Because, if you ever get into mod making, those days are over /s

#

Spring Day 3, for all eternity

safe dragon
#

no worries there I never play the game to begin with

#

I joined this server in the hype of the game releasing "soon" but then never really got that into it when it did finally release

#

but made friends and stuck around anyway

marble jewel
#

Modding is notoriously debugging the same day to test one thing

safe dragon
#

that's honestly just software development

marble jewel
#

Facts. Although Software Development it's easier to make proper unit tests.