#💽Programming Chat v2
1 messages · Page 39 of 1
so YOU'RE the person sending me files byte by byte over torrents
and making me have 1 byte/second speeds
that's ada without any SIMD
just regular numerics
the one on the right is the ada library with SIMD
imagine needing a library for simd...
there's an experimental api in std::simd but also stable simd support for x86 and x86_64 in core::arch
core::arch isn't experimental
but the abstrations in std::simd are
invlpg &atp
In What Mode
protected mode with cpl 0
BOOOOOOOORRING
naw
my cpu would say something like
flags set [PROTECTED_MODE_ENABLE]
cause its that cool..
ugghhh intellij froze
u dont know what cpl is do you
privilege
but why would you expect me NOT to know what CPL is
cuz this isn't cpl
this is moving out of real mode
... do you not know what the initial cpl is after moving out of real
dont need it
ok have fun with that
no.
now ur programs have to worry about where they get loaded into memory
if u have 2 programs that wanna get loaded in the same spot whatcha gonna do
ur programs also have to worry about the actual physical ram size
whatcha gonna do if ur program can't fit
solution
dont
if your program is that dependent on pages maybe it doesnt deserve to run
have you thought about that..
maybe if ur os doesnt do its primary job of making convenient abstractions for userspace programs then it doesnt deserve to run
nah
I bet that PAGING_ENABLED flag is never gonna get set
not at the current stage
👎
i need proof my os runs first!!
paging ❤️
ah yes my favorite instruction Approximation to the Reciprocal Square Root of Packed Double PrecisionFloating-Point Values With Less Than 2^-28 Relative Error
fast inverse sqrt!!!!
ew no
and i REALLY hope these are never called
me when I try to run a vm on your cpu
ugh that syntax
match r {
0 => todo!("SGDT/VMCALL/VMLAUNCH/VMRESUME/VMXOFF"),
// ...
}
❤️
literally the same thing
except better
u have to type (r)
what about doing this
also hold this
[18:31:29;591/WARN [modloading-worker-0/Processor] flags set 0x0000000000000004 [PARITY_FLAG]
[18:31:29;592/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE5 ( , ): 0xAC lodsb al, [si [0x0000000000008D10]]
[18:31:29;594/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE6 ( , ): 0xE2 loop 0x00001F05 @ 0x-6
[18:31:29;597/WARN [modloading-worker-0/org.bread_experts_group.breadmod.BreadMod] kotlin.NotImplementedError: An operation is not implemented: ALPHA
drops
what
you're not a sql database idot.
that's what you think
DROP DATABASE whatever_atp_said;
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE6 ( , ): 0xE2 loop 0x00000001 @ 0x-6
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE8 ( , ): 0x89 mov [ebp+0x-10 [0x0007FFD4]], eax
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AEB ( , ): 0x8B mov eax, [ebp+0x-4 [0x0007FFE0]]
[18:44:27;778/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AEE ( , ): 0x3B cmp [ebp+0x08 [0x0007FFEC]], eax
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF1 ( , ): 0x72 jb 0x-750A
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF3 ( , ): 0x89 mov esp, ebp
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF5 ( , ): 0x5D pop ebp [0x0007FFF0]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF6 ( , ): 0xC3 ret 0x000089CC
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CC ( , ): 0x59 pop ecx [0x0000BFC0]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CD ( , ): 0x5E pop esi [0x00100000]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CE ( , ): 0x8B mov edx, [0x00008218]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089D4 ( , ): 0xBF mov edi, 0x00008327
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089D9 ( , ): 0xB9 mov ecx, 0x000082D2
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089DE ( , ): 0xB8 mov eax, 0x000082C6
[18:44:27;781/WARN [modloading-worker-0/Processor] 0x0000:00000000000089E3 ( , ): 0xFF jmp esi
[18:44:27;784/WARN [modloading-worker-0/org.bread_experts_group.breadmod.BreadMod] kotlin.NotImplementedError: An operation is not implemented: Unrecognized opcode (0xAB)
sighhh
whhyyyyy
i wish there was a way to dump all teh instructions qemu runs
are you trying to set that memory before you enable protected mode and longjump
see how its operating on 32-bit regs here without 66 set
its in protected mode, and GDT is set earlier before the giant loop by QEMU
its just not initializing the memory @ 0x100000 which is where esi is set to return to
idk maybe fix it...
a breakpoint shows up until the return to esi that the VM is running almost parallel to QEMU
(with the only difference being QEMU has CS set to 8 for some reason)
ugh thats probably why
CS isn't offsetting 0x100000
im not allowed the modify the code running inside
this is QEMU
sorry
GRUB*
lemme just cause loop to crash again
see
in QEMU this would set CS to 0x8 but in my CPU it doesn't see a segment on ljmp for some reason
can we smash this guy with hammers
ok I applied 😅
wait
theres reactions in this channel now??
crazy work
🙏 the gods that be
also kinda random thought, but, linalg in java is terrible
is that what the library in the middle is for
java
no im asking you
oh
I think?
in java, at least, for mods, we usually just use JOML
oh hm whats joml
I've only used ejml in Java tbh
opengl oriented math lib
ah, cool
I wonder how it performs against https://github.com/lessthanoptimal/ejml
is EJML supposed to be accurate/consistent?
I believe so
cause JOML might be faster as you dont need either for rendering
hm interesting
I mean to be completely honest I end up JNI'ing expensive math calls to cpp anyway
and by extension to eigen
JNI would be too expensive for us
ok expected
just writing
oh yea for sure
JNI is awesome
what
awful
not awesome
LOL
I was thinking awful and typed awesome somehow
and theres also the fact that like
for some awful reason a mod developer who made the backbone of the loader we work on made this new "union file system"
you end up with like a million double args to it for each field in each object, cause passing objects through ffi is even worse
so is it that your CS thing in your cpu is messed up?
which just makes loading from fs/jars a really convoluted process
thats my theory
i need to find where QEMU does the ljmp though
classic java dev activity btw
cause the decoder on my end sees no segment
it should be grub doing the ljmp
it is
ljmp longjump?
yeah
im just saying QEMU is decoding it differently
I see
causing their CS to be set while mine isnt
ohhhhh now I'm getting it
(LJMP is just like a goto, but it sets additional things in the cpu after you set a GDT, for ex. where your code is)
ye
I just wasn't sure if LJMP was the instruction
or like if thats what yall meant
and if u havent enabled protected mode before the first ljmp u get sent into real mode
jmps all the way down
kinda related but do most compilers turn a if, elseif, else chain into a jump table? or does it depend on the code
Near jump, relative displacement - just an offset to IP
Far jump, absolute direct - directly sets CS/IP
Far jump, absolute indirect - directly sets IP thru a memory addr/register
mm I'd imagine so but I'm not sure
if they can/determine it to be more optimal
cause jump tables are way more efficient
yea thats what I thought too
I wasn't sure if theres any cases where branching is preferred
it just depends on the heuristics the compiler does
ye ok
probably if you're branching a long distance
(the compilers can still ignore it)
:<
oh btw #embed is cool I only recently learned about it
#include <stdio.h>
int main(void) {
register int i = 1;
register int j = 2;
register int k = i + j;
printf("%d\n", k);
}
the compiler very well might just put them all in a memory address somewhere... :<
tl;dr
#include <assert.h>
int main (int, char*[]) {
static const char sound_signature[] = {
#embed <sdk/jump.wav>
};
static_assert((sizeof(sound_signature) / sizeof(*sound_signature)) >= 4,
"There should be at least 4 elements in this array.");
// verify PCM WAV resource signature (at run-time)
assert(sound_signature[0] == 'R');
assert(sound_signature[1] == 'I');
assert(sound_signature[2] == 'F');
assert(sound_signature[3] == 'F');
return 0;
}```
BREAK *0x8235
and cpp got it recently too!
P1967 #embed was adopted for C++26
oh cool
just make ur own file format -> C binary array converter and #include it
istg if this is another disconnect between Operand Size and Address Size im gonna kill someone
not in the instructions ive seen so far
but a 32-bit mod r/m can reference an SIB byte after it
making a one byte r/m into a 2 byte one
if that counts
and instructions themselves can be coded using a modr/m or the 0x0F prefix
0x0FEA /4
0xEA is a group instruction whose behavior depends on if the (reg) part of the modrm after it is /4
the culprit
this behavior can be useful like so
whats math.map
does it take a list of values and transform them to another list
maps value from 1 range to another
its super nice for converting fixed range floats to shorts or whatever
oh yeah we have something like that in kotlin
ye
super useful sometimes, but ours is applicable to every type
:<
also I find it hilarious that lua made all these functions callable with strings that get coerced into numbers
so now new functions follow that standard too
but if you do that you drop like all optimizations
lol
erm... (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
yea but this would end up everywhere
ok just...make a function
now I need it in a diff file
inline int map_to_pwm(int val) {
/**
* OldRange = (OldMax - OldMin) = 100 - (-100) = 200
* NewRange = (NewMax - NewMin) 255 - 0 = 255
*
* NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
* = (((val - (-100)) * 255) / 200) + 0
*/
return std::round((((val - (-100.0)) * 255) / 200));
}
yeah ik
but now math.map
😃
and it gets fastcalled
yay
nvm it don't
I lied
too many args
ermmm..
what thou sigma⁉️
well
my code technically maps a value from one range to another
specifically -100 to 100 to 0 to 255
do you know how to view the machine code in gdb
I don't think u can view the binary
worst debugger ever
you could uh
try dumping the memory in hex
x/<integer number of words>w <memory address>
@spare quartz
bnasck
no i was bleedinmg ..
0x82efea66
BIOS DISC CPY 0x00000000002C1800 -> 0x00000000002C9800 @ 0x0000000000008000
0x82e0
😭
ugh thats why
i think
it even gives the wrong answer 😭
are you Cracked
What’s the solution?
cs.readSegmentDescriptor().flags.DB
this determines if something is actually in 32/16 bit
also 64 bit
but we can ignore that
128-bit :3
not real.
You’re right it’s not 16-bit so it’s not real
32-bit is imaginary
TODO("E@#$")
this should theoretically be it
CS is set...
still is jumping to nowhere though..
For legacy mode, Load byte at address DS:(E)SI into AL. For 64-bit mode load byte at address (R)SI into AL.
Funny words
rep stos
F3 AA REP STOS m8 ZO Valid Valid Fill (E)CX bytes at ES:[(E)DI] with AL.
lmfao is this code british
"oi, REP STOS m8"
finally I have uninstalled mysql from my mac 😌
I had to install it from the stupid https://dev.mysql.com/downloads/ for a class last semester
and I couldn't work out how to uninstall it
but I did
port 3306 is free again
oooooookay my branches are fucked
cpu branches
oof
who uses branches anymore
just do the computation and load eip 
single commit on main, keep amending it
erm what the sigma
you joke but, thats a real thing I've seen people do
😭
beats stitching histories when you accidentally push a key 👍
its ok guys bitbucket got draft prs recently
I promise its good
guys use bitbucket its awesome and has no flaws
that's when you just gotta delete the repo on gh and rm -rf .git on your local repo
NO 😭
how does that tech work btw
git reset --soft HEAD~3
git commit -am "my bad guys i fucked up the repo"
git push --force
so good
what did I just say
I didn't even specify what tech
cooked
I meant like I've heard how if you push your discord api keys for a bot to gh you'll get an email or a notif about it being public
I forgot which party the email/notif comes from
was it gh or discord
must be discord right
how does that work?
probably just has a webhook for whenever you add a connection
a connection?
sigma
or something higher up agreed upon at the company-company level
oh wait, its through that?
you should push a key to gh and test 
i dont get alerted though since the repo i pushed a key on was private
NOOOOO
wait thats genius
LOL
again probably
thats how i would do it
discord might have funny relations with gh though letting them do something more direct
it's probably github
🥲
github probably keeps track of your connection with discord
scans your repos for keys
and then does soemthign with that
but how does it know something is a key?
regex
keys have a general form to them
🧌
yeah
oh huh
discord keys look a certain way
or it just scans through the bots you own
discord will warn you too if you try to paste somethign that looks like a key
wait no
I don't think you give it access to do that
discord resets keys no matter who uploads it
theres actually a repo dedicated to doing that
wha
i need to find it
some guy operates a repo that scans other git platforms and adds it to a TXT file
ok atp so
and when discord/gh sees it, causes a reset of the added key
I grabbed a key from one of my bots
and changed it a bit
discord still warned me that it might be a key
so it's gotta be regex
probably
cant find the repo i was trying to find exactly but
close one
his bot just modifies the raw git history
clearly a masterful gambit
no im kididing
sorry im uninformed lol
i dunno if github would log that as activity though
reverse engineered it
aaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
this triggers the regex
you just sent it?
oh
oh my god watch it be like, a run-on counter with a few delimiters
instead of regex
real
aaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaa
thats funny af
side topic but honestly discord search is impressive
its speedy
theres prob papers about search at scale
i never really understood how those searches worked tbh
i know theres like indexing that windows does for example but not much beyond that
yea, but like searching servers with hundreds of millions of messages is still
fast?
maybe they're cutting corners somewhere but it seems solid
like, woah
(it don't)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
lol
it flagged that
im pretty sure it encodes your ID, email
oh gotcha
but not much beyond that
thats cool
those are the delimiters, i guess
ur a delimiter.
you're a crab
ur a corpse
whats ada's spirit animal
8AF1
your mascot is dead
a bird
its a hummingbird
a dead woman named ada lovelace
great contributions to cs
but shes dead
kys!!!
hm you can say that about a lot of people that are dead
good contributions all around
yeah shes touted as the first programmer
oh wth it was actually 1800s
which means WE... have a programmer with 200 years of experience
wait they've been coooking for like forever
all of your rustlets are babies..
a dead programmer*
no....
can you run ada on it
yes
you know why...
why
Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852), also known as Ada Lovelace, was an English mathematician and writer chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, the **Analytical Engine. **
:3
:3
yes it is
that's ada running it
meow

Rule #1 of programming
Ada always loses
Rust beats Ada, Ada beats C, C beats Rust
:3
State of the art lmao
QEMU is such a useful tool
also this too
nerd...
MAN
i really need to watch what i repost on twitter
i dont want some femboy furry on this guys feed 😭
Bro what 😭
whenever you get a webp file... remember him!!
!!!
working on it
hey thats why I said working on it
we're removing your funding.
disaster
I just put https://github.com/HarryXChen3/LuauSandbox in and that debugger thing I was working on as examples
pray its goated enough
that debugger thing
heres how thats turning out btw
https://media.discordapp.net/attachments/1343768167075414168/1343768167356305501/401766971-3b43c24a-6c9a-42dc-a2de-4ada2c42f7d8.png?ex=67be7921&is=67bd27a1&hm=6360035853ea263b7afe0ec6bebd02b1dc94507a8255e0fa9653ba72fe762f39&=&format=webp&quality=lossless&width=1128&height=670
thatll be farrrr beyond whatever they're expecting honestly
nah im kidding
I get that you're a hater but I think thats only cause ada has no libraries for you to use (there aren't any other users)
not true ...
I think it looks sick
thanks imgui!
imgui in roblox is sick
imgui in normal computing is complex for some reason
"simple" "not bloat" (complex, bloat)
win
yep! absolutely love the look and feel
wdym
fr
101% factual
lies..
yet another instruction format change
oops
hat could've been bad..
totally normal class names im making
RegisterMemorySelectorSingleOperandGroupInstruction
mrmd sounds like a drug..
has science gone too far?
the decoder grows stronger everyday.
you cant tell me its not beautiful
the entire decoding annex is so big
It’s Kotlin, ergo, not beautiful
(joking)
In other news I’ve fucked my NixOS dual-boot on my MacBook by trying to triple-boot with Fedora
so uh gotta figure that out tomorrow
but look at it branch,,
i THINK this perfectly encodes 0F 22 /r MOV CR0–CR7, r32
how
omg... sylveon!!! 
wouldn't be the first one to get it
Triple boot?? I think i found the problem
I know I know
Also congrats on physicist
Did you get it working? 🙏
Thanks! I thought I'd just spend 20 mins or so on it and see if that'd work
Trying
Good luck triple boot sounds scary
002939
Its not too bad its just that Fedora installed grub which messed some stuff up and then NixOS didn’t set up stuff quite right either
I’m basically having to reinstall NixOS with grub set from the get-go
But triple boot isn’t too bad you just need to set one bootloader that’s capable of finding other OSes, like grub using os-prober
oh ok that doesn't sound too difficult
yea, maybe not, it just sounds scary - realistically, are you really using all 3? and can it really not be solved by using wsl/a vm?
oh its a macbook ain't it, no wsl then
a vm maybe?
bring back bootcamp apple..
One use case could probably be done by a VM, but for another I really don’t wanna try to figure out USB passthrough
what are the use cases?
I normally run NixOS but I decided to install Fedora because I want to try to program a FPGA with Quartus Prime directly from my laptop rather than having to use another PC
And NixOS is weird so I wanna see if its even possible from a “normal” distro
I wish but we have to use Quartus Prime for this class
i think its just intel vivado
Dm
this is like the fourth revision of all instructions 💔
i dunno how to top this though
*org.bread_experts_group.breadmod.client.tool_gun.ToolGunScreen and org.bread_experts_group.breadmod.client.tool_gun.ToolGunScreen$ScreenTabs disagree on InnerClasses attribute *
thats a new error..
Ok well
I basically just wiped NixOS and put Fedora on it instead
Kinda gave up on the whole triple boot lol
im going to strangle a computer
@rustic vine good news, I did not do this to myself in vain
Quartus Prime CAN program the FPGA from Fedora
hooray
RegisterMemoryImmediateOperatingLengthDoubleOperandInstruction...
neat, how does it run? stable and good perf?
forgot StrategyFactory
x86..
Pretty fine but it has issues with suspend as I expected
I might try to get Quartus working with usb passthrough
suspend? like to sleep/hibernate?
Yeah
It’s plagued Linux on T2 Macs since Sonoma
do they still have the t2 chip (on newer macs)
I have a 2020 Intel MacBook
Before M1
thats what im wondering
Well they don’t make Intel MacBooks anymore
The M1 has its own stuff idk
do they just not have t2 chips
I’m not sure
oh okay
this new instruction format is a lot.. better
already back up to 73 opcodes
scpsl time
oh gotcha, thats rough
@spare quartz
😭
This is really simple to do
Yep. We got the Doom engine running purely in TypeScript types. Like. For real. We’ve prepared two more videos, one answering “why we did this” (storytime format) and another answering “how we did this” (technical deep-dive). What would you like to hear about for those?
It’s all open source: https://github.com/MichiganTypeScript/typescript...
Okay… but why
webdevs will webdev
Ts poisoning
This is eerily similar to how a JVM looks
Ohhh
Cause it’s a WASM implementation
good on him for simulating addition/carrying though
this is what i do
Lmao
when you accidentally push MS-DOS 6.22 to the BM erpo 😭
from scratch vs in scratch
wtf is scas
oh its just memcmp
cool
hopefully this lets us actually use BIOS int 0x10
IT OWRKS
YOOOOOOOOOOOOOOOOOOOO
heres it without the speed limiter and with correct keyboard recognization
i think its pretty decent
the CPU is independent of minecraft
org.bread_experts_group.breadmod.experimental.computer will work virtually anywhere
But…..neoforge…..
But………neoforge…………..
But…………….neoforge……………………….
epic
wait so this is what you were doing!?!??
wdym
yes 😭 what else could i have possibly beend oing
idfk'
60% done with the first half..
overall the instructions look like they're doing well against QEMU
only problem MS-DOS wise is si not being set right due to QEMU having a prepped IVT
damn
ImmediateSigned8SingleOperandOperatingLengthDependentInstruction
these interface names are crazy
qemu sounding like temu 2
holy shit i love being able to seek for memory addresses in this cpu
makes undercovering instruction bugs so much easier
wat it would just be full of furry art
bread
Sick! That's awesome
do we fw this script so far
do you want me to be picky
get rid of the warns and prints unless they are for debugging
define the function in 1 of the 2 ways
local module = {}
function module.func(args)
end
return module
-- or
local function func(args)
end
return table.freeze({
func = func
})```
everything else actually looks ok
should i get rid of the module.Functions table or keep it in there
alright
function module.equip(character: Model)
local PossibleTool = character:FindFirstChildOfClass("Tool")
if PossibleTool then
local config = PossibleTool:FindFirstChildOfClass("Configuration")
if config then
local RealTool = PossibleTool
sounds = { -- i intend on this staying as a global
core_folder = RealTool:FindFirstChild("Sounds"),
equip_sfx = RealTool:FindFirstChild("Sounds").Equip,
reload_sfx = RealTool:FindFirstChild("Sounds").Reload,
}
-- debugging goes here now :)
-- back to the show
if sounds.equip_sfx then sounds.equip_sfx:Play() end
print("Gun equipped")
end
end
end
like this?
lgtm
you can make the if config then a guard statement
if config then
-- code
end
-- can be change into
if not config then
return
end
-- code```
it reduces nesting
especially when the code inside is long
same with PossibleTool tbh
also try to keep consistent casing
will come back to help you
don't use globals
oh ok
ye
they're bad in quite a few ways
I can explain in more detail the motivations for what I've said a little later
what if... lua had reflection/introspection...
NO!
hehehea
and one question
where should i store the gun state (ex. is the gun equipped, firing, reloading, etc)
a table works
within this module?
local gun = {
equipped = false,
firing = false,
reloading = false
}```
well
depends on how you want to structure your gun
you can do oop style if you wanted
ehhh
I would obviously advocate for ecs
i'm not that into oop
but maybe thats not something you wanna get into (ecs)
well, a table with functions and properties in it is essentially oop
don't need to bother with any inheritance or anything
that stuff is yuck
:<
metatables are kinda yuck too
WIN
ok yea so
heres an example of how I setup my "oop" stuff
its literally just
local function A()
end
local function B()
end
local function C()
end
return function(args)
return {
A = A,
B = B,
C = C
}
end
the function I return from the module is the oop "constructor"
what if i make a type called Gun with the properties/available states in there, then i create an object with that type
oh yea, at the top of that I declare the type of the "object" yea
you don't need to do that unless you want to use the typechecker (I would totally recommend that too)
sure, thats fine
alright
methods take a self argument, which isn't anything special, just a convention
when you call a function using table:func() it implicitly passes the table you called it with to the first argument
so something like circularbuffer:clear() implicitly passes circularbuffer to the clear function
you can also always do circularbuffer.clear(circularbuffer)
but thats a lot of duplication
which is why a:b() exists
should be noted that the type itself doesn't actually exist at runtime in the object (compared to OOP languages which store a tag/form of type ID to an object)
what are they used for at runtime
optimizations
and they can affect varargs and multret behavior (kinda, it can look like they are)
oh i mean it in how other oop languages use tags; like determining how to dispatch a function
no yea ik
I was just adding on
they don't exist and don't affect it
with caveats
it better not cause any o0/1 differenecs ... grrr.. .
hm wdym
theres no guarantee optimization levels don't affect behavior
the whole point of them is to affect behavior
yeah but theres an amount of a programs behavior that we expect to remain constant throughout each level
and any differences there is evil...
Gun.Handle = PossibleTool.PrimaryPart
Gun.Name = PossibleTool.Name
Gun.Ammo = config.Ammo
Gun.MaxAmmo = config.MaxAmmo
Gun.IsAutomatic = config.IsAutomatic -- this is 100% not the best way to do it but i'm a bit lazy
do we think this is too, how do i call it, spammy?
oh lord the formatting
local gun = {
Handle = PrimaryPart
-- etc...
}```
thanks
also the typename
fwiw
this is 100% not the best way to do it but i'm a bit lazy
that prob is the best way to do it
yes you could maybe do it with a loop
but I don't think thats maintainable
and not typechecked!
only if config gets really big is where i'd say just iterate over config
you could enforce field semantics with metatables, but only if you really, really care for the safety
another day another java.util.NoSuchElementException: Key 4 is missing in the map.
man
don't!
local Types = require(Modules.Types)
local Gun: Types.Gun = nil
Gun = {
Handle = PossibleTool.PrimaryPart,
Name = PossibleTool.Name,
Ammo = config.Ammo,
MaxAmmo = config.MaxAmmo,
IsAutomatic = config.IsAutomatic,
Reloading = false
}
this is just a compiled snippet
- they're slow
- they don't typecheck well
- just enforce it with typechecking
the only time i found it useful to enforce such semantics was during the jvm 😭
could've prob done the same with typechecking at compile time
not compile, typecheck time?
stack/object fields aren't determinable that way by nature
since they have to be dynamically read and loaded
also why not just, put the type in the same file?
true
that feels more convenient than having to require a separate file
so in that case, i don't need the export?
you prob should?
oh alright
export type Gun = {
}
local function shoot()
end
return function()
return {
shoot = shoot
}
end
local gun = require(path.to.gun)
local a_gun: gun.Gun = gun()```
lol what
nothing im just rambling to myself
classic
will probably be fine
lol I had a bug in my circular buffer impl that I only found yesterday using it
it you tried to iter it when it was empty it would iter the full capacity of the buffer and provide N nils
so its a circular buffer right
yeah
it tracks head and tail indexes
so when its empty
head = 1, tail = 1 (indexes start at 1, bruh)
when its full,
head = 1, tail = 1
ohh
yes?
ok so, I wasn't checking the size
I made a special case for when its full (head = 1, tail = 1)
because I can't iterate from 1 to 1
the special case was to iterate from head to capacity
but I forgot empty is also 1, 1
so now I check size == capacity AND 1, 1
and now its covered by a test!
CAPACITY!!! N!!! CASE!!! TEST!!!
true
stop writing your progarms to yell at peopel :<
lol
I think it looks nice
PrimaryPart is optional on Models
swapping it between Part and BasePart just gives the same error
check if it exists
basepart? could not be converted to basepart
alright ty
or assert it
so you have an optional basepart
and you expect a non-optional
assert that it exists or cast it
yeah bc models don't need a PrimaryPart
mwahahaha
also u should use rojo and vsc 😈
don't listen to this guy he's off his meds
so i should use the assert() function for this?
ye
if you're certain a PrimaryPart should exist on the model
assert(condition, reason?)
I beat you this time
damn
ughhh i hate floppies
can't continue work on ms-dos cause it uses stupid cylinder-head-sector reading
upload as file
