L
LaughinPanda
TableHere FlipThis
W
warning_unreachable_code
hello
W
warning_unreachable_code
how are you doing
W
warning_unreachable_code
yeah i was warning then i switched to error
W
warning_unreachable_code
i'm doing fine
T
TheIbraDev
Write some tests
T
TheIbraDev
How have you been Mario man?
N
NakorBlue
oh right im subbed, i was like wait i dont see adds
T
TheIbraDev
latest streams have been during Nighttime here
W
warning_unreachable_code
do you still update your blog about performance
W
warning_unreachable_code
i forgot about your site
T
TheIbraDev
Just follow modern tech and let it crash
T
TheIbraDev
link it
S
SpirodonFL
https://enlightenedprogramming.com/
R
Rei Ayanami
how are you doing?
T
TheIbraDev
I think i even inserted my email there. Spiro hasn’t sold my info yet
T
TheIbraDev
(yet)
R
Rei Ayanami
can i ask you why you use one monitor? and why your laptop one?
R
Rei Ayanami
did you see the new open ai model?
G
ghostm4gic
hello mr mario
M
Moldy Apple
Odin + your mom = viking babies
K
kelyje
you can use Overview as a reference
K
kelyje
https://odin-lang.org/docs/overview/
T
Tazdij
Nice, using odin :)
T
Tazdij
Really? For me I just download it, extract it, and then add that into my .bashrc it all works. I am on debian 12 though
T
Tazdij
You already have it working here though, so no need
O
olavostauros
who is talking? spiro, spiro minus minus or spiro69?
O
olavostauros
chat is kinda ded
G
ghostm4gic
map
O
olavostauros
instanfce
O
olavostauros
instance
T
Tazdij
I like using zone or region
K
kelyje
Location?
O
olavostauros
what about instance?
O
olavostauros
omg spiro is ignoring my suggestion TearGlove
R
rook_uwu
world, level, sub levels.
G
ghostm4gic
level assume progress to higher one
O
olavostauros
wet_water/solid_land
G
ghostm4gic
zone/region assumes all are equal
T
Tazdij
@olavostauros Instance is already something in programming with a meaning, I avoid it to reduce possibly conflating them
G
ghostm4gic
the only correct answer is map :)
O
olavostauros
@Tazdij gotcha
O
olavostauros
a clusterfuck
O
olavostauros
it's a good idea, a clusterfuck
L
LaughinPanda
Destination?
K
kelyje
let's vote ))
T
Tazdij
I like zone and region, as they don't carry and additional meaning or implicit properties
O
olavostauros
a zone inside a zone
T
Tazdij
Any*
O
olavostauros
we must go deeper
R
rook_uwu
world region east, west, north, south. then zones in regions
G
ghostm4gic
you can see why programmers are so bad at naming
T
Tazdij
Also with zone it is easy to have subzones too
O
olavostauros
clustecrfuck!
O
olavostauros
the nerdzone
G
ghostm4gic
so your ocean will be a zone, and city will be a zone and that's confusing
G
ghostm4gic
but both are maps
L
LaughinPanda
Region and Port.
O
olavostauros
a zone of a zone, within a zone, that is a zone within itself
O
olavostauros
shore?
O
olavostauros
shore/port
O
olavostauros
shore/port/sea
T
Tazdij
@ghost a map is an illustration of the topography of a region ;)
G
ghostm4gic
right, and that's why it matches both
G
ghostm4gic
and you can call ocean a zone, and call port a port
L
LaughinPanda
There's no factions and territories in your game?
O
olavostauros
can I pet the dog in your game?
G
ghostm4gic
you just need different names for ocean, port and both
T
Tazdij
In a data structure though, is there any reason to store it any different than each other? A region/zone/map should be nesting in a hierarchy with each node having a type field
S
SneakyFoxtrot
Yo!
N
NakorBlue
thats it im review bombing this game now.
T
Tazdij
Rofl, honestly doesn't matter, usually just a personal preference that is blown out of proportion
T
Tazdij
Dynamic arrays are contiguous but might be relocated is resized
T
Tazdij
If resized*
T
Tazdij
Im pretty sure, Odin zero initializes arrays without initial values defined
T
Tazdij
you can do multiple return values
K
kelyje
but you can return two values
T
Tazdij
so it is a limitation of the WASM?
O
Owencodes
Oi
G
ghostm4gic
exception
T
TheIbraDev
Gotta go sleep, have s nice stream @spirodonfl !
O
Owencodes
spirod1Hi
D
del_cx
How you finding Odin so far? I picked it up again few months ago too
R
Rei Ayanami
do you use wls on windows? why?
T
Tazdij
Oh, this a function being exported to use in JS. I have never tried it with an exported function
G
ghostm4gic
you can't throw exception?
L
Lafolie_
spirod1Hihi spirod1Hihi spirod1Hihi spirod1Hihi spirod1Hihi spirod1Hihi spirod1Hihi
L
Lafolie_
Odin has multiple returns
T
Tazdij
it did seem to work correctly when they were internal functions without the need to interop with js
L
Lafolie_
^int
G
GhostSpeedRunner
hello
T
Tazdij
Why doesn't returning a struct work?
G
GhostSpeedRunner
im ur 36th subscriber
L
Lafolie_
just return false in the bool return
L
Lafolie_
Oh you can't because of the WASM thing
L
Lafolie_
You can't use a union?
L
Lafolie_
You gotta predeclare the union
L
Lafolie_
static type innit
L
Lafolie_
Just setup the union in the function body
L
Lafolie_
You didn't change the body
T
Tazdij
I think you need declare a variable of type Value, and then set it, and return it
T
Tazdij
in the function body
L
Lafolie_
in the get_value proc set the return value to either false or the array element
L
Lafolie_
v : Value = some_array[index]
T
Tazdij
should only declare v once
L
Lafolie_
right but you are always return the second one now lol
L
Lafolie_
huh. Maybe wasm doesn't support unions
L
Lafolie_
oh, get rid of the v: Value line between the proc and union
L
Lafolie_
You're shadowing so maybe that is screwy?
T
Tazdij
line 32, you still have a global v. but I don't know if that is an issue
L
Lafolie_
So the best way I can think to solve this is a switch
T
Tazdij
does it return an u16 if you give it a valid argument?
L
Lafolie_
oh wait, you'd still need two procs
T
Tazdij
ok, so then it is not liking the union?
T
Tazdij
because it should be copying the value itself into the return
L
Lafolie_
No, that's for checking the union tag
T
Tazdij
can you export the Value definition?
L
Lafolie_
You don't need an enum for that because Odin has tagged unions
L
Lafolie_
Can wasm read a struct?
T
Tazdij
something seems odd, because this sort of thing works with emscripten and C
D
del_cx
Odin macros to generate glue?
D
del_cx
(comp type stuff)
T
Tazdij
Oh, so you are trying to do this without the runtime library odin has, to make all the language features work?
L
Lafolie_
I'm pretty sure I read somewhere that Odin has some extra stuff for the wasm build
L
Lafolie_
like a lib or something
T
Tazdij
odin-dev-2024-03\vendor\wasm\js
L
Lafolie_
Check the source for vendor:wasm
T
Tazdij
no, on your local file system
K
kelyje
https://github.com/odin-lang/Odin/tree/master/vendor/wasm
T
Tazdij
wherever you installed odin at
T
Tazdij
oh hey, looks like it is in the repo too
T
Tazdij
this is the glue code to make it all work
T
Tazdij
I suppose you will just need to write your code in a very particular way, to work within the confines of wasm
P
Protonmat
You have come to the Odin side
P
Protonmat
Im Glad
D
del_cx
val :: 25
D
del_cx
this is const
L
Lafolie_
constants are untyped compile-time symbols in Odin
L
Lafolie_
The only way I can think of really solving this is manually checking the array len before you call get_value_of...
P
Protonmat
You could use a Enum for errors
K
kelyje
let him cook
D
del_cx
If its all single threaded, could you have global variable which is flipped on error, c style?
D
del_cx
e.g. when error happened read this register to find out which value you hit
D
del_cx
error you hit*
D
del_cx
CheckLastError()
D
del_cx
And in JS you just want to make sure that error list length is always 0?
D
del_cx
if get last error returns non 0 we have an error, so it give you ID of latest error instead.
L
Lafolie_
Might be worth your time to ask on the Odin discord about this. Finding it hard to believe wasm has this limitation
L
Lafolie_
well Odin errors are just bools
L
Lafolie_
There's no exceptions
G
ghostm4gic
@Lafolie_ but you have panic right
G
ghostm4gic
so what was wrong with panic(EXCEEDED_LENGTH)
G
ghostm4gic
-1
O
Owencodes
@Rei Ayanami theres nothing wrong with using wls on windows I use it and ik several other devs who do it its a very popular dev enviroment
G
ghostm4gic
i meant 0 -1 should give you max
G
ghostm4gic
if unsigned
L
Lafolie_
@ghostm4gic No, Odin has multiple reterns. So the odiom is to return (value: int, ok: bool)
L
Lafolie_
Bill's rule of thumb is "you made the mess, so you clean it up"
G
ghostm4gic
0xFFFF
L
Lafolie_
but I have no clue about anything wasm
L
Lafolie_
Yeah you have to be explicit about casting in Odin
L
Lafolie_
panic ends execution
L
Lafolie_
Try assert
G
ghostm4gic
but would you continue execution if exceeded length
O
Owencodes
dad me and lafo miss u :D
H
ᎮᏒᎥᎷᏋ
Spiro!!
G
ghostm4gic
but why would
O
Owencodes
spirod1Hearts spirod1WorkingHard spirod1Lurk
L
Lafolie_
assert instead of panic
L
Lafolie_
but it would finish anyways, hrm
G
ghostm4gic
assert(false)
G
ghostm4gic
and end execution
G
ghostm4gic
cause there's something wrong with your math
G
ghostm4gic
and you need to fix your code
G
ghostm4gic
if would be wrong if you go over array length
G
ghostm4gic
depends if you do that or not
G
ghostm4gic
yes, we check it, but this code is wrong if he hits it
L
Lafolie_
Yeah I really think checking length before calling is the simplest way
G
ghostm4gic
so no reason to run it
L
Lafolie_
Yeah
L
Lafolie_
Does the built-in bounds checking not apply to wasm?
G
ghostm4gic
but if you're outside of scope then no need to process that on js side
G
ghostm4gic
js code is wrong
G
ghostm4gic
you just need exception / panic and that's it
L
Lafolie_
Odin has bounds check. Maybe the runtime.js file has something
L
Lafolie_
runtime.bounds_check_error
G
ghostm4gic
and that was great
G
ghostm4gic
yes, that's a different case and more complicated
G
ghostm4gic
then you need some error
G
ghostm4gic
right i understand
L
Lafolie_
okay
L
Lafolie_
So how about this
L
Lafolie_
assert(len(arr) < index, "You're out of bounds, dummy")
H
ᎮᏒᎥᎷᏋ
how did you learn coding?
L
Lafolie_
Replace the if with the assert
L
Lafolie_
Get rid of the if block
L
Lafolie_
Yeah a union would be nice here
L
Lafolie_
or a struct
O
omnifidus
Your "TWITCH ADS ARE PLAYING" message did not go away after the ads were over.
T
Tazdij
lol, stream video thinks there are still ads
R
rvIceBreaker
@SpirodonFL fix your overlay ya dingus
R
rvIceBreaker
endstream
R
rvIceBreaker
laser focus
T
Tazdij
no reason to break your flow state
O
Owencodes
hey spiro made more progress on my personal site :)
O
Owencodes
spirod1Lurk spirod1Hearts spirod1Lurk
O
Owencodes
:)
T
TravisVroman
Oh, didn't realize you were streaming. Also Odin? 9 e's. How are you liking it?
T
TravisVroman
In particular how do you like it as compared to Zig?
T
TravisVroman
That's interesting considering how much you love Zig
T
TravisVroman
Does it win out over C?
H
Hasen Judi
Odin FTW
T
TravisVroman
-WASTED-
T
TravisVroman
I'd jump in and try it if I didn't already have my entire engine written in C LUL
L
Lafolie_
vendor
T
thefallaway
Hello
T
Tazdij
Odin is easily my favorite language of the c-like replacements
T
Tazdij
super good math lib
T
TravisVroman
Does it have a comptime type deal?
T
TravisVroman
Like compile time string hashing?
L
Lafolie_
when blocks are compile time
T
Tazdij
@TravisVroman no, nothing like a Zig comptime
T
thefallaway
Wait vulkan and ratlib in core? That's crazy
G
ghostm4gic
so what makes it better than Zig?
T
TravisVroman
Vulkan is in core Dahek
T
Tazdij
#1 the syntax of zig make my eyes hurt, and odin's doesn't
L
Lafolie_
Bill and Andrew are good friends
T
TravisVroman
That's a good thing imo
L
Lafolie_
Yeah Bill's position is 'BDFL'
T
TravisVroman
If you don't like it, fork it
L
LaughinPanda
But, you're Canadian you have no guns to stick to...
T
TravisVroman
C++ *ahem*
T
Tazdij
Odin is very inspired by the book, "Algorithms + Data Structures = Programs"
T
TravisVroman
Nobody realized that the name of C++ is really just an iterator for bloated bullshi
T
Tazdij
which makes me like it too
T
Tschieses
the core-lib sounds too good to be true - nice * ,*
T
Tazdij
Also there is a huge application in production which is written in odin, so that is at least proof of its ability and utility
T
TravisVroman
Swizzle for shizzle?
T
TravisVroman
I've always thought swizzling should be extended to other languages than shader languages
O
omnifidus
@TravisVroman I don't think there is a bit-swizzle in Odin. :=)
T
thefallaway
But how far have you cooked?
T
TravisVroman
@omnifidus Fair, but any kind of swizzling is a step in the right direction imo
T
thefallaway
I mean it looks kind of straight forward
L
Lafolie_
You can swizzle arrays
L
Lafolie_
not sure about bits
T
thefallaway
"Just go" go = golang Kappa
T
TravisVroman
*Entity Complication System
T
TravisVroman
Aw, bollocks. Poor timing on my part lol
N
NakorBlue
thought it was 24 hours
L
Lafolie_
thanks for the stream <3
T
Tschieses
take care everyone :3 /
S
SpirodonFL
Join our discord and get inspired! https://discord.gg/7ZrQHjUsJ4
T
Tschieses
thanks for the nudge to Odin - will take look at it!
T
thefallaway
Yes
T
Tschieses
sounds fun Kappa
T
TravisVroman
Have a good one