<< 22-03-2023 >>

00:00:20FromDiscord<Elegantbeef> Probably best to install a nix OS
00:00:24FromDiscord<Elegantbeef> Sorry i cannot help myself
00:00:37FromDiscord<Bizarro> although, looking at the changes in PR #20084, wchar_t has been replaced by WideCString
00:00:42FromDiscord<Bizarro> interesting
00:00:46FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4rtN
00:00:49FromDiscord<michaelb.eth> @Bizarro ^
00:01:38FromDiscord<Bizarro> sent a code paste, see https://play.nim-lang.org/#ix=4rtO
00:02:24FromDiscord<michaelb.eth> have you tried Windows Terminal, without changing the OS-level locale?
00:02:26FromDiscord<michaelb.eth> it might help
00:02:30FromDiscord<michaelb.eth> might not
00:02:38FromDiscord<Bizarro> Also, I cannot recommend changing the C:\Users\xxxxx folder name, it's unsupported and also breaks things (OneDrive, for example... I had to create a directory symlink to make it work again)
00:03:03FromDiscord<Bizarro> In reply to @michaelb.eth "have you tried Windows": Yes, I use Windows Terminal because it's the default on Windows 11
00:03:39FromDiscord<michaelb.eth> ah, okay, I don't do that much with Windows, supporting it is usually something I "fix" at the last
00:03:58FromDiscord<michaelb.eth> so I didn't realize Windows Term is default for 11, but that's good to hear
00:04:12FromDiscord<Elegantbeef> The best windows support is shipping them a flash drive with a \nix os 😄
00:04:32FromDiscord<michaelb.eth> hopefully 🤞`cmd.exe` eventually vanishes from use
00:04:33FromDiscord<Bizarro> In reply to @Elegantbeef "*Probably best to install": I've used them, but not for work...
00:04:36FromDiscord<Elegantbeef> Anywho i'll shush the "windows bad"
00:05:23FromDiscord<michaelb.eth> eh, it's a bit of a mess, for sure, but there are a bajillion users, so it's a tough call whether to give up on it or try to face it on its own terms
00:06:49FromDiscord<Elegantbeef> You see no one uses my software, so I just live in the world that only my PC exists
00:07:28FromDiscord<Bizarro> In reply to @michaelb.eth "eh, it's a bit": Yes, I use both, Linux and Windows, so I think Nim shouldn't disregard Windows' problems...
00:07:53FromDiscord<michaelb.eth> for my part, I don't really want/like to do any software dev stuff for Windows unless I can "cheat" by using MSYS2 😄
00:08:19FromDiscord<Bizarro> Anyway, thank you very much for your help. Since it's already fixed on devel, no issue should be opened.
00:15:57FromDiscord<Bizarro> And, by the way, I've just installed Nim also in WSL 😉
00:16:44FromDiscord<konradmb> I remember Araq uses Windows for development, so it's hardly disregarded...↵(@Bizarro)
00:16:57FromDiscord<Elegantbeef> I think he now uses a m1 mac
00:17:53FromDiscord<konradmb> ... with Windows VM
00:17:59FromDiscord<konradmb> jk, I don't know
00:18:22FromDiscord<Bizarro> In reply to @konradmb "I remember Araq uses": Thanks for the info, it's good to know, even if he uses a Mac now.
00:42:30*genpaku quit (Ping timeout: 250 seconds)
00:45:18*azimut quit (Remote host closed the connection)
00:45:39*azimut joined #nim
00:47:16*beholders_eye quit (Ping timeout: 250 seconds)
00:51:23*genpaku joined #nim
01:03:17*ltriant quit (Ping timeout: 268 seconds)
01:10:05FromDiscord<Ayy Lmao> Can you not use a ref object as a key to a table by default? I seem to be having issues.
01:11:38FromDiscord<Elegantbeef> You need to pass a flag, refer to the hashes module
01:13:07FromDiscord<Ayy Lmao> Oh I see. Why is this a preview feature? You can hash pointers right?
01:13:54FromDiscord<Elegantbeef> Cause it wasnt enabled previously
01:14:41FromDiscord<Ayy Lmao> Is there a way to define flags in a nim module so I don't have to pass it in?
01:14:47FromDiscord<Ayy Lmao> The module would depend on it.
01:14:52FromDiscord<Elegantbeef> `{.define: ...>}`
01:14:59FromDiscord<Ayy Lmao> Sweet, thanks!
01:16:58FromDiscord<Ayy Lmao> In reply to @Elegantbeef "`{.define: ...>}`": Oddly that doesn't work but passing it manually to the compiler works.
01:17:18FromDiscord<Elegantbeef> Well then you cannot
01:17:28FromDiscord<Elegantbeef> You did put the define before the import right....
01:18:38FromDiscord<Ayy Lmao> I am putting it in a module that is imported into something else. It's working if I put it at the first line though.
01:22:12*nanxiao joined #nim
01:28:41*ltriant joined #nim
01:37:17FromDiscord<QuiteQuietQ> sent a code paste, see https://play.nim-lang.org/#ix=4rud
01:37:44FromDiscord<QuiteQuietQ> i am trying to give a type to a variable that holds a set
01:39:15FromDiscord<huantian> `let x: set[range[0..uint16.high.int]] = {1,2,3,3}`
01:39:29FromDiscord<huantian> `uint16.high` returns an `uint16`, but you're trying to store normal ints in the set
01:39:47FromDiscord<huantian> so you have to convert `uint16.high` to an int ~~only a tad cursed~~
01:40:59FromDiscord<QuiteQuietQ> aha, thanks
01:41:53FromDiscord<Arathanis> Is it possible to temporarily unscope certain variables? Or more accurately, only include certain variables in a block?
01:42:18FromDiscord<Elegantbeef> you could shadow the variables with a template
01:42:45FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4ruf
01:42:53FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4ruf" => "https://play.nim-lang.org/#ix=4rug"
01:43:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ruh
01:45:20FromDiscord<Arathanis> Ok do it is much easier to shadow scoped variables explicitly rather than shadow all but a set of selected variables?
01:46:33FromDiscord<Elegantbeef> There is no mechanism to disable scope, you'd need to use a macro to achieve that
01:46:59FromDiscord<Arathanis> intriguing. any direction in how i could look into implementing something like that?
01:49:31FromDiscord<Elegantbeef> Use `owner` on your scoped symbols and ensure no other variable shares the owner unless it's in the list
01:50:59*jmdaemon quit (Ping timeout: 260 seconds)
01:51:02FromDiscord<Arathanis> where can i find docs on `owner`? Or is it the `owned` type constructor found here: https://nim-lang.org/docs/system.html#owned
01:53:36FromDiscord<Elegantbeef> Macros
01:53:36FromDiscord<Elegantbeef> https://nim-lang.org/docs/macros.html#owner%2CNimNode
01:55:32FromDiscord<Elegantbeef> You may need an intermediate macro
01:55:37FromDiscord<Elegantbeef> But it might work regardless
01:57:08FromDiscord<Arathanis> Intermediate macro?
01:57:29FromDiscord<Elegantbeef> A macro that takes you code rewrites it so then you can introspect it
01:58:01FromDiscord<Arathanis> ohhh got it
01:58:38FromDiscord<Elegantbeef> You may need to emit a procedure internally
01:59:11FromDiscord<Arathanis> otherwise it sounds like its a matter of a macro that basically does: for every symbol referenced in this block, ensure the owner is either tihs block or nobody unless its an explicitly scoped symbol
01:59:13FromDiscord<Rika> In reply to @Elegantbeef "There is no mechanism": Technically there is, using functions lol
01:59:51FromDiscord<Arathanis> i guess "no owner" makes no sense
02:00:05FromDiscord<Arathanis> so either its owned by the containing block or its one of the explicitly scoped symbols on the macro
02:00:21FromDiscord<QuiteQuietQ> sent a code paste, see https://play.nim-lang.org/#ix=4ruk
02:01:05FromDiscord<Arathanis> In reply to @Elegantbeef "You may need to": this is the intermediate macro wrapping the block in a procedure so I can use that proc as the "self" scope?
02:01:31FromDiscord<Elegantbeef> Pretty much arthanis
02:01:46FromDiscord<Elegantbeef> fmt cannot be used cause the macro does not see `{msg}`
02:01:48FromDiscord<Elegantbeef> It sees a string
02:01:50FromDiscord<Arathanis> awesome. thank you for the help
02:01:56FromDiscord<Elegantbeef> you want `echo ">> ", msg`
02:03:16FromDiscord<Elegantbeef> It's pretty much you check that the owner is not the same as your scoped variables, if it is you check that it's in the list of scoped variables
02:04:11FromDiscord<Elegantbeef> Technically you could also use `locals` and use that to check
02:04:38FromDiscord<Elegantbeef> Where you pass `locals` to a typed argument and just check that every symbol in your AST is not in there
02:04:41FromDiscord<Diogenes of Toronto> sent a code paste, see https://play.nim-lang.org/#ix=4rul
02:04:55FromDiscord<QuiteQuietQ> macro sees only the string, because it is in a template, which is evaluated during compilation? compared to proc, where the macro sees even the variable?
02:06:37FromDiscord<QuiteQuietQ> In reply to @Diogenes of Toronto "this raises an io": the file can be at different location than where your executable is created
02:07:19FromDiscord<Diogenes of Toronto> executable is nin the same directory
02:07:24FromDiscord<Arathanis> so im probably going to totally butcher this cause i dont actually understand, but if im understanding correctly its because a template is not a proc.↵↵`msg` is an alias inside the template for the string literal assigned to `msg` in the template signature, not actually a variable called `msg` with type string
02:07:34*ltriant quit (Ping timeout: 265 seconds)
02:07:45FromDiscord<Elegantbeef> Correct
02:07:52FromDiscord<Elegantbeef> Templates are code subsitution
02:08:05FromDiscord<Elegantbeef> They work on the ast, the template when expanded does not have a `msg` in scope
02:08:10FromDiscord<Elegantbeef> You can either use `%` or alias msg by doing `let myMsg = msg`
02:08:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rum
02:10:05FromDiscord<BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4run
02:10:33FromDiscord<Elegantbeef> Are you building release?
02:10:39FromDiscord<QuiteQuietQ> cool, thanks!
02:12:07FromDiscord<BobBBob> yeah release fixed it a lot haha, ill have to remember that
02:14:21FromDiscord<Rika> In reply to @Elegantbeef "You can either use": Aliasing will give another error because of sanitisation
02:14:42FromDiscord<Elegantbeef> Right needs to be aliased with `{.inject.}` or the template marked `{.dirty.}`
02:16:09FromDiscord<Rika> In reply to @Diogenes of Toronto "this raises an io": Did you solve your problem?
02:16:30FromDiscord<⎝⪩﹏⪨⎠> Generics are weird. https://media.discordapp.net/attachments/371759389889003532/1087922721658261524/image.png https://media.discordapp.net/attachments/371759389889003532/1087922721947656274/image.png
02:17:09FromDiscord<Elegantbeef> `openarray` cannot be in a field without views enabled
02:17:12FromDiscord<Elegantbeef> So practically it cannot be
02:17:16FromDiscord<Elegantbeef> use `seq[T]`
02:17:44FromDiscord<Elegantbeef> secondly what the hell is `tree.root: ... = @[]`
02:18:25FromDiscord<Elegantbeef> Thirdly you need to do `BinTree[T]` since there is in generic inference
02:18:39*ltriant joined #nim
02:18:57FromDiscord<⎝⪩﹏⪨⎠> Ignore whatever is inside newTree.
02:19:03FromDiscord<Rika> In reply to @Elegantbeef "secondly what the hell": What he means is that you don’t need to (or can’t) specify the field name
02:19:07FromDiscord<⎝⪩﹏⪨⎠> It's just garbage I wrote.
02:19:10FromDiscord<Rika> Name? Type
02:19:57FromDiscord<⎝⪩﹏⪨⎠> In reply to @Elegantbeef "use `seq[T]`": Alright.
02:20:27FromDiscord<Arathanis> @ElegantBeef how do you use an intermediate macro?
02:20:40FromDiscord<Elegantbeef> You make a macro that then calls your macro inside
02:21:32FromDiscord<Arathanis> Have a brief example of how you grab the intermediate macro's AST to then process using the primary macro?
02:21:37FromDiscord<Arathanis> Maybe I am just failing to visualize it
02:23:43termervisit #nim
02:23:46termersee Elegantbeef
02:23:53termerjust another one of those days
02:24:31FromDiscord<⎝⪩﹏⪨⎠> Now I have to initialize the thing. https://media.discordapp.net/attachments/371759389889003532/1087924740527759430/image.png https://media.discordapp.net/attachments/371759389889003532/1087924740792008765/image.png
02:24:58FromDiscord<Elegantbeef> https://github.com/beef331/fungus/blob/master/src/fungus.nim#L383-L394 for instance
02:24:58FromDiscord<Elegantbeef> `kindOf` is declared above this macro
02:25:17FromDiscord<Arathanis> In reply to @termer "see Elegantbeef": https://tenor.com/view/moo-cow-windy-flowing-hair-gif-16646426
02:27:21FromDiscord<Elegantbeef> you literally just call the macro
02:27:22FromDiscord<Elegantbeef> https://github.com/beef331/fungus/blob/master/tests/tbasic.nim#L13
02:27:23FromDiscord<Elegantbeef> Here i call from
02:27:24FromDiscord<Elegantbeef> Which then inturn calls kindof
02:27:38*azimut quit (Ping timeout: 255 seconds)
02:27:46FromDiscord<Elegantbeef> Ah a day is a day
02:27:55FromDiscord<Elegantbeef> Like i said
02:28:03FromDiscord<Elegantbeef> `BinTree[T]`
02:28:30FromDiscord<Elegantbeef> Nim does not have generic inference
02:28:31FromDiscord<Elegantbeef> Is this thing on
02:29:06FromDiscord<Arathanis> ohh i think i understand now, i had it reversed
02:29:42FromDiscord<Arathanis> the outer macro generates the wrapping proc, then when it generates the new AST it places the introspection macro around the now proc wrapped block so it can perform the inspection.
02:32:11FromDiscord<dedraiaken> Anyone have any guesses as to what my cause a memory access issue here? https://media.discordapp.net/attachments/371759389889003532/1087926671363027025/image.png
02:32:12FromDiscord<Elegantbeef> Right and you might not need the proc with locals
02:32:36FromDiscord<dedraiaken> raw is an `ptr UncheckedArray[char]` and the echo lines above it work fine
02:32:47FromDiscord<h4x0r_kn0wn_as_4ch4n> anyone here codes malware in nim?
02:32:48FromDiscord<dedraiaken> (edit) "an" => "a"
02:33:12FromDiscord<ringabout> So?
02:35:25FromDiscord<Rika> Weirdest question to ask
02:36:26FromDiscord<Gumbercules> In reply to @h4x0r_kn0wn_as_4ch4n "anyone here codes malware": only the stuff running on your machine
02:36:31*ltriant quit (Ping timeout: 240 seconds)
02:36:51FromDiscord<Gumbercules> otherwise I spend most of my time writing haikus in Nim
02:36:52*jmdaemon joined #nim
02:37:15FromDiscord<⎝⪩﹏⪨⎠> In reply to @h4x0r_kn0wn_as_4ch4n "anyone here codes malware": That would be against the rules.
02:37:22FromDiscord<Gumbercules> what rules?
02:37:30FromDiscord<Diogenes of Toronto> stupid i didnt open the file
02:37:50FromDiscord<Diogenes of Toronto> omg
02:37:52FromDiscord<SpiderDave> creating malware is enough for intent to do something illegal and would violate discord's tos
02:38:07FromDiscord<Gumbercules> I mean, plenty of people study malware
02:38:18FromDiscord<Gumbercules> and security
02:38:34FromDiscord<SpiderDave> sure, but it's not something that any programming community would openly allow on their discord
02:38:44FromDiscord<Gumbercules> Asking if anyone writes malware does not signal ill intent
02:38:46FromDiscord<SpiderDave> <@&371760044473319454>
02:38:59FromDiscord<Gumbercules> unless it were a programming community which focused on studying malware
02:39:07FromDiscord<Gumbercules> I mean, this isn't kick or ban worthy
02:39:26FromDiscord<SpiderDave> no, but it's the kind of things trolls type to start arguments exactly like this one
02:39:42FromDiscord<SpiderDave> so just making sure moderator sees it
02:39:51FromDiscord<Gumbercules> I don't know if anyone is trolling anyone rn
02:40:20FromDiscord<Gumbercules> Doesn't seem like it
02:40:43FromDiscord<Elegantbeef> locals does exist arathanis so you might be able to just use that
02:40:49FromDiscord<Elegantbeef> dedraiaken does one need to allocate the register in any fancy way?
02:41:02FromDiscord<Elegantbeef> I mean intialise it
02:41:38FromDiscord<SpiderDave> anyone know how to fix this pong sdl2 example? it's showing the paddles as black for me: https://github.com/nim-lang/sdl2/blob/master/examples/pong.nim
02:41:56FromDiscord<SpiderDave> if i change the background i can see them but i dont know how to get the paddles to show otherwise
02:43:13FromDiscord<dedraiaken> In reply to @Elegantbeef "dedraiaken does one need": hmm well the code was working previously with other array types... let me do an experiment..
02:45:02*ltriant joined #nim
02:47:31FromDiscord<ajusa> Anyone know if hax is still around? Or did they move to the other Nim related group? Had a question about fusion/matching
02:49:54FromDiscord<ringabout> In reply to @ajusa "Anyone know if hax": Yeah, https://discord.com/channels/371759389889003530/371759607934353448/1087799236806062241↵I think here is fine
02:51:22FromDiscord<ajusa> In that case, @haxscramper are you still planning on maintaining fusion/matching, or have you moved on to hmatching, or something else?
02:52:22FromDiscord<Gumbercules> In reply to @ajusa "In that case, <@608382355454951435>": I think they're probably sleeping rn
02:52:40FromDiscord<Gumbercules> tmk hax is not doing shit with fusion
02:52:46FromDiscord<ajusa> Yeah I assume they'll see it tomorrow with the notification
02:52:53FromDiscord<ajusa> Fusion is weird
02:52:59FromDiscord<ajusa> No clue what happened
02:53:01FromDiscord<Gumbercules> yeah, it's a failed experiment I believe
02:53:07FromDiscord<Gumbercules> it's a long story
02:53:31FromDiscord<Gumbercules> I think most of the maintainers felt like they weren't getting any support and it was taking way to long to get things done / get things mainlined
02:53:47FromDiscord<Gumbercules> and meanwhile they were maintainingthe packages, so I think eventually people got miffed and said F it
02:53:54FromDiscord<Gumbercules> (edit) "maintainingthe packages," => "maintaining the modules,"
02:54:14FromDiscord<ringabout> The matching is scheduled for Nim 2.x anyway. ↵https://github.com/nim-lang/RFCs/issues/503↵> Find a way of allowing a syntax like of Value(let x, var y) and embrace an official pattern matching solution that makes use of this syntax.
02:55:04FromDiscord<Gumbercules> glad our roadmap is guarded by angels
02:55:21FromDiscord<ajusa> Yeah I'm hopeful, but not optimistic about syntax changes to Nim at this point
02:55:50FromDiscord<Rika> Kinda scary ngl
02:55:55FromDiscord<ajusa> IIRC araq has been pretty against syntax sugar in the compiler, he usually directs folks to macros instead
02:56:11FromDiscord<ajusa> Yeah if the syntax becomes part of Nim 2 we'll have a python 2/3 split
02:56:23FromDiscord<ajusa> Unless you explicitly write code the old way
02:57:03FromDiscord<Gumbercules> as long as additions and changes are opt-in or have a deprecation strategy, I think it's fine
02:58:07*ltriant quit (Ping timeout: 250 seconds)
03:06:08FromDiscord<amadan> Anyone have experience using musl for making static binaries? followed the steps here https://scripter.co/nim-deploying-static-binaries/ and a simple 'hello world' crashes with a segfault
03:13:58FromDiscord<⎝⪩﹏⪨⎠> Solved.
03:24:38*ltriant joined #nim
03:47:45FromDiscord<SpiderDave> ok so for that pong example question i figured out that removing the line to display scores fixes the ball and paddle color, so it may be something wrong in drawScores. i dont know how to fix it though
03:48:07FromDiscord<Elegantbeef> Pong?
03:48:16FromDiscord<SpiderDave> yeah my previous message above
03:49:36FromDiscord<amadan> In reply to @amadan "Anyone have experience using": alright switched to compiling with zig instead and now can build binaries that please aws lambdas
03:52:21*nanxiao quit (Quit: Client closed)
04:29:37FromDiscord<Elegantbeef> @SpiderDave\: what os are you on?
04:30:17FromDiscord<SpiderDave> windows 7
04:30:41FromDiscord<Elegantbeef> 64bit?
04:30:42FromDiscord<SpiderDave> so i figured out it's this that seems to affect it `defer: texture.destroy`
04:30:46FromDiscord<SpiderDave> yeah x64
04:30:58FromDiscord<SpiderDave> i remove that and it looks fine (but then it leaks memory so it's needed)
04:32:51FromDiscord<Elegantbeef> What version of Nim?
04:32:51FromDiscord<Elegantbeef> I will say it works fine here on linux, so seems it's an OS or Sdl2 issue on windows
04:34:04FromDiscord<SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4ruJ
04:35:13FromDiscord<SpiderDave> ok at least that narrows it down; might have to use something else for this kind of thing
04:42:55*derpydoo joined #nim
04:43:21*sagax joined #nim
04:47:04*ltriant quit (Ping timeout: 265 seconds)
04:50:16*nanxiao joined #nim
04:58:40*xaltsc quit (Ping timeout: 265 seconds)
05:02:32*ltriant joined #nim
05:03:03FromDiscord<Gumbercules> @SpiderDave looks fine to me - https://media.discordapp.net/attachments/371759389889003532/1087964638836178994/image.png
05:03:17FromDiscord<Gumbercules> on Windows
05:03:27FromDiscord<Gumbercules> what version of SDL2 do you have installed?
05:03:28FromDiscord<Elegantbeef> Time to blame windows 7? \:d
05:05:02*rmt joined #nim
05:15:17*rockcavera quit (Remote host closed the connection)
05:15:30*ltriant quit (Ping timeout: 268 seconds)
05:19:26FromDiscord<SpiderDave> ok i swapped out a different dll and it works yay
05:43:32*ltriant joined #nim
05:46:40*arkurious quit (Quit: Leaving)
05:48:21*derpydoo quit (Ping timeout: 255 seconds)
05:53:54*azimut joined #nim
06:08:49*jaywack joined #nim
06:17:09*nanxiao quit (Quit: Client closed)
06:25:43FromDiscord<⎝⪩﹏⪨⎠> What do you think about my way of printing binary trees: https://media.discordapp.net/attachments/371759389889003532/1087985440465899550/image.png
06:28:24FromDiscord<Elegantbeef> why not `s.add genString`?
06:28:29FromDiscord<Elegantbeef> Do you not like your memory?!
06:28:44FromDiscord<huantian> hey people are just not used to mutable strings be default 😛
06:29:02*nanxiao joined #nim
06:29:34FromDiscord<⎝⪩﹏⪨⎠> Ok.
06:29:46FromDiscord<Elegantbeef> StringBuilder is bad
06:29:54FromDiscord<huantian> you can use `result` instead of your own `s` though, save yourself a return
06:30:32FromDiscord<⎝⪩﹏⪨⎠> In reply to @huantian "you can use `result`": What's the difference between not using an explicit return and using the implicit one.
06:31:15FromDiscord<⎝⪩﹏⪨⎠> In reply to @Elegantbeef "StringBuilder is bad": Is there a better way to represent a binary tree with no recursion and straight from the array?
06:32:40FromDiscord<Elegantbeef> No clue how you want this to print, i was just joking about string builders in other languages
06:35:13*advesperacit joined #nim
06:35:49FromDiscord<⎝⪩﹏⪨⎠> In reply to @Elegantbeef "why not `s.add genString`?": Because compiler complains.
06:36:10FromDiscord<⎝⪩﹏⪨⎠> Wait, nvm.
06:36:52FromDiscord<⎝⪩﹏⪨⎠> This is the way I want it to be printed: https://media.discordapp.net/attachments/371759389889003532/1087988246706913290/image.png
06:37:14FromDiscord<demotomohiro> @⎝⪩﹏⪨⎠ Recursive procedure usually rewriten with loop with stack.
06:37:15FromDiscord<Yardanico> In reply to @Elegantbeef "Do you not like": or just s &= stuff
06:37:31FromDiscord<Yardanico> Nim has an overload for &= that just does add
06:43:26FromDiscord<⎝⪩﹏⪨⎠> But well, at the end it works as I expected and wanted it to work.
06:43:36FromDiscord<⎝⪩﹏⪨⎠> Not like the first time I did it in Lua.
06:43:40FromDiscord<⎝⪩﹏⪨⎠> That was a mess.
06:43:44FromDiscord<huantian> haha
06:44:35FromDiscord<⎝⪩﹏⪨⎠> In this approach, I treat the `root` array as the tree.
06:45:03FromDiscord<⎝⪩﹏⪨⎠> And the array only contains tuples with the value and the name of the node.
06:45:48FromDiscord<⎝⪩﹏⪨⎠> Instead of proper parent/child objects with their respective references to their left and right children.
06:46:09FromDiscord<⎝⪩﹏⪨⎠> I don't know if this approach is at least useful or efficient, but meh.
06:46:35FromDiscord<Elegantbeef> Using integers instead of pointers is pretty much the corner stone of data oriented design
06:46:47FromDiscord<Elegantbeef> It also serialises easier
06:47:46FromDiscord<huantian> huh ngl never heard of data oriented design before
06:48:03FromDiscord<Elegantbeef> Comes up a lot with ECS
06:48:24FromDiscord<huantian> interesting↵never used ECS either lol didn't get caught up in the hype
06:48:27FromDiscord<⎝⪩﹏⪨⎠> Wait what.
06:48:59FromDiscord<Elegantbeef> The premise is instead of using pointers you use an index into a global buffer
06:49:15FromDiscord<Elegantbeef> This gives you contiguous memory that is cache efficient and also easily serialisable
06:49:24FromDiscord<⎝⪩﹏⪨⎠> Hmm... so this is the first time I kind of made an efficient approach to a problem in my life.
06:49:40FromDiscord<huantian> I'd assume that would only be on the low level, and you'd want to implement higher level abstractions?
06:50:08FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4rpp↵vs.↵https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/binarytrees/2.nim↵Basically
06:50:36FromDiscord<Elegantbeef> Of course in Nim you can use macros and the like to make it equivalent to the reference API
06:50:49FromDiscord<Elegantbeef> But in like C of course it's not really possible 😄
06:51:41FromDiscord<Elegantbeef> This comes up in compilers, ECS, and pretty much anything that needs speed and to be serialised easily
06:52:13FromDiscord<Elegantbeef> With modern cpus it's especially good to use this style of design since cache is so important
06:54:02FromDiscord<haxscramper> In reply to @ajusa "In that case, <@608382355454951435>": (1) no, (2) yes, moved, (3) maybe I will write v2.
06:54:57FromDiscord<huantian> In reply to @Elegantbeef "This comes up in": huh neat↵well I'll care about that when i need that ig
06:55:26FromDiscord<ajusa> In reply to @haxscramper "(1) no, (2) yes,": Awesome thanks! I'll keep opening issues in that case, glad it isn't dead. Very useful project 🙂
06:55:44FromDiscord<Elegantbeef> Realistically it can be though of as your own allocation system, since what it kinda is. You have your own memory that you have pointers to, but they're integers instead of pointers.
06:56:02FromDiscord<haxscramper> I just moved it, I'm not actively working on it at the moment
06:56:39FromDiscord<haxscramper> You can of course create issues but I can't say I will be fast to fix them
06:57:01FromDiscord<haxscramper> Go be honest implementation is pretty bad, so v2 is more likely to happen
06:57:45FromDiscord<huantian> In reply to @Elegantbeef "Realistically it can be": so the usefulness is that by controlling how memory is laid out yourself, you keep relevant data contiguous
06:58:38FromDiscord<Elegantbeef> Well you do not have pointer indirection and when you load an element from the cache you're likely to load the next
06:58:39FromDiscord<huantian> would it then be useful as parts of a larger system? so you wouldn't design your entire program using the principles, but maybe certain bits would benifit
06:58:55FromDiscord<Elegantbeef> Unless your data is like 64bytes or bigger than a cache line
06:59:33FromDiscord<Elegantbeef> The benefit is purely that you're playing to the advantage of modern caching. When you iterate a collection you load in N number of elements based off your data size and cache line size.
07:00:01FromDiscord<Elegantbeef> This is one reason why iterating bytes is faster than iterating int64s
07:00:18FromDiscord<Elegantbeef> With most CPUs when you fetch the first byte of an array you get 63 bytes after it
07:00:37FromDiscord<Elegantbeef> So now you do not need to go back to memory to read 63 elements assuming you do not thrash your cache
07:01:15FromDiscord<Elegantbeef> I will say games using ECS heavily use this
07:01:31FromDiscord<Elegantbeef> They do not use ECS for everything since it's a bit tedious for some systems, but they do for a lot
07:01:44FromDiscord<Elegantbeef> Though not everyone needs ECS, it's just a way of designing to best suit the CPU
07:03:14FromDiscord<Elegantbeef> If you think about in a game you might go "Iterate all objects that have Position, Transform, Renderer" and render them, if your data is stored contiguously in an array you do not have to go back to memory like you would if they were pointer objects
07:04:00FromDiscord<huantian> huhhh yeah I can see how that would be helpful
07:04:45FromDiscord<Elegantbeef> Huan got way more of an explanation than they wanted 😛
07:04:49FromDiscord<huantian> time to build my next game with ECS
07:05:17FromDiscord<Elegantbeef> Polymorph is pretty nice 😄
07:05:22FromDiscord<huantian> In reply to @Elegantbeef "Huan got way more": nah more explanation is just more learning!
07:06:05FromDiscord<huantian> is ECS something helpful for all games though?
07:06:19FromDiscord<Elegantbeef> Nah
07:06:26FromDiscord<Elegantbeef> Most people do not need ECS
07:06:31FromDiscord<Elegantbeef> It really comes into play with tonnes of entities
07:06:44FromDiscord<huantian> ah i see
07:07:03FromDiscord<Elegantbeef> Though it is also compositional based
07:07:05FromDiscord<Elegantbeef> So it does make the code less dependant on strict structures
07:07:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rvf
07:08:04FromDiscord<Elegantbeef> It only cares that it has a `Position, Draw, Size` component
07:08:22FromDiscord<Elegantbeef> This is not polymorph, this is my small and simple ecs
07:09:41FromDiscord<huantian> how small and simple!
07:10:13FromDiscord<Elegantbeef> \< 500loc with 1 macro
07:10:14FromDiscord<huantian> so this example code would find everything with those component and draw a ball on it?
07:10:23FromDiscord<Elegantbeef> Yep
07:10:37FromDiscord<huantian> i can see how that'd be useful
07:10:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rvj
07:10:57FromDiscord<Elegantbeef> Is how the balls are instantiated
07:11:34FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/yeacs.nim shameless ECS if you want to see
07:11:44FromDiscord<Elegantbeef> Example is in toys for toys folder
07:12:21FromDiscord<huantian> huh so are all entities equal? like nothing distinguishes a ball from anything else that has those components right
07:12:33FromDiscord<Elegantbeef> Correct entities are just numbers really
07:12:50FromDiscord<Elegantbeef> In fact this is what i consider an entity
07:12:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rvk
07:14:43FromDiscord<Elegantbeef> Generation is important cause if you add/remove an entity/component you need to go "Yep this pointer is invalidated"
07:16:34FromDiscord<Elegantbeef> Which is why in my `addComponent` i take in a mutable entity, as it mutates that
07:16:50FromDiscord<Elegantbeef> I will be honest that my ecs was made mostly just to do it with the fewest macros possible, so it's not the most intelligent
07:17:10FromDiscord<Elegantbeef> But it's a good place to learn how they practically work
07:22:17FromDiscord<huantian> maybe I should make my own ecs then 😛
07:22:53FromDiscord<Elegantbeef> Need it to get down to 0 macros
07:23:14FromDiscord<huantian> maybe try with 0 type defs as well
07:25:10FromDiscord<huantian> in oop land, if you wanted to make a special ball you would inherit from your Ball class. with ecs, would you add a component that makes it do something special?
07:25:25FromDiscord<Elegantbeef> Correct
07:25:32FromDiscord<Elegantbeef> Then you define a system to operate on that
07:25:49FromDiscord<Elegantbeef> A system in my ECS was like that `drawBall` proc
07:26:07FromDiscord<huantian> the component itself then knows nothing about the entity it's attached to
07:26:11FromDiscord<Elegantbeef> ECS seperates data from implementation hence the System and Component
07:26:37FromDiscord<Elegantbeef> Yea the components are best described as data buckets
07:26:49FromDiscord<Elegantbeef> They're generally just types with your required data
07:27:16FromDiscord<Elegantbeef> Polymorph though does allow you to persistently hold onto an entity
07:27:26FromDiscord<Elegantbeef> Mine would error that you have an old generational index
07:28:06FromDiscord<huantian> the system then is what's able to do the equivalent of accessing information from the "parent class"↵it's what's able to do something special with the special ball
07:28:24FromDiscord<Elegantbeef> Indeed
07:28:38FromDiscord<Elegantbeef> Systems operate on components by querying for components
07:28:46FromDiscord<Elegantbeef> draw ball queried for `Position, Size, Draw`
07:29:28FromDiscord<Elegantbeef> So any archetype that has those 3 components is iterated over
07:29:28FromDiscord<Elegantbeef> I doesnt matter if it also has `SuperSpecialBall` or `DeathBall`
07:30:12FromDiscord<huantian> what if then I wanted say a ball with a `Bounce` component to display differently than a normal ball?
07:30:29FromDiscord<Elegantbeef> You implement anti selectors
07:30:39FromDiscord<Elegantbeef> `Draw and not SpecialDraw` or whatever
07:31:08FromDiscord<huantian> mm
07:31:29FromDiscord<Rika> Ngl this is making me interested in game design and programming
07:31:36FromDiscord<Elegantbeef> You should be able to query both positive and negative components in an ideal world
07:33:25FromDiscord<huantian> same rika I wanna make a game now \:p
07:34:21FromDiscord<Elegantbeef> I do not have a negative query system
07:34:22FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/lvr
07:34:24FromDiscord<Elegantbeef> I did mean to add one, just needed to think about how to do it without a macro
07:34:54FromDiscord<huantian> it feels pretty easy for systems to, i guess, conflict if you don't carefully design your code?
07:35:12FromDiscord<huantian> but that's just a feeling lol
07:35:21FromDiscord<Rika> I think that’s true for a lot of things
07:36:10FromDiscord<Elegantbeef> It's very compositional so it's relatively easy to resolve conflicts
07:37:22FromDiscord<huantian> mm yeah it'd be similarly (or probably even more) bad with oop and inheritance
07:39:06FromDiscord<huantian> actually speaking of game dev, I was considering making a multiplayer focused taiko clone at some point... but the main challenge with that would probably be audio and networking
07:39:18FromDiscord<huantian> probably not things solved by using an ECS lol
07:39:58FromDiscord<Elegantbeef> Ah i just realised how i could do the negation query 😄
07:40:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4rvp
07:40:41FromDiscord<Elegantbeef> Ah sorry `type Not[T: not Not] = distinct T` is the real solution
07:40:49FromDiscord<huantian> that's a lot of nots
07:40:52FromDiscord<Elegantbeef> taiko?
07:41:14FromDiscord<huantian> funny japanese drumming rhythm game
07:41:46FromDiscord<Elegantbeef> Uh huh
07:43:26FromDiscord<huantian> you can probably find some insane gamplay if you just youtube taiko no tatsujin
07:44:10FromDiscord<huantian> but anyways, would be an interesting project imo, multiplayer sync for rhythm games sounds like a fun challenge
07:44:22FromDiscord<huantian> but I have no idea how to do it
07:44:28FromDiscord<Elegantbeef> One of the least ECS required project 😄
07:44:42FromDiscord<Elegantbeef> Well there's the trick you cannot sync it
07:45:11FromDiscord<Rika> You don’t really need exact syncing for rhythm games
07:45:22FromDiscord<Rika> They only need to be consistent at the end when scoring is done
07:46:03FromDiscord<Elegantbeef> Cmon huan i want a playable prototype by next week
07:46:07FromDiscord<Rika> Networking isn’t as difficult as it would be with a fighting game let’s say, but inspiration can be taken from what they do since they’re both very similar in how timing can be done
07:46:34FromDiscord<Rika> Audio has a few tutorials but I lost the links to articles about it
07:46:47FromDiscord<Elegantbeef> I do not imagine rollback works well for a rhythm game
07:48:28FromDiscord<huantian> In reply to @Rika "Networking isn’t as difficult": That is an interesting avenue to explore, I don’t know specifically how it works with fighting games either but sounds like it could be helpful
07:49:09FromDiscord<huantian> It is definitely easier with rhythm games because the players don’t directly interact
07:49:22FromDiscord<Rika> In reply to @Elegantbeef "I do not imagine": Well it’s not necessary
07:49:48FromDiscord<huantian> Their actions are only displayed on the other players’ screens, but each player isn’t dependent on the actions of any other
07:49:53FromDiscord<Rika> Since as said above, each player is independent of each other in terms of outcome
07:50:20FromDiscord<Girvo> Is it possible to "disable" effects/exception tracking? Basically making the `raises` pragma a no-op?
07:50:27FromDiscord<Rika> I don’t think so
07:50:30FromDiscord<Girvo> Okay cool
07:50:38FromDiscord<Girvo> I'll fix up what's causing it in Chronos then
07:50:40FromDiscord<Elegantbeef> Just add a closing transition and send the score 😄
07:51:48FromDiscord<Elegantbeef> Calculate an average ping between players whilst playing, wait that long times 3 before showing scores, sweep the rest under the rug
07:52:17FromDiscord<Rika> Some games display real time score too though
07:52:22FromDiscord<Rika> While playing
07:52:35FromDiscord<Rika> Most do I believe
07:52:42FromDiscord<huantian> With a taiko clone ideally I’d like to show the actual gameplay in addition
07:53:01FromDiscord<huantian> (edit) "With a taiko clone ideally I’d like to show the actual ... gameplayof" added "live-ish" | "in addition" => "of the other players too"
07:53:31FromDiscord<huantian> ~~otherwise I’d just play osu!taiko~~
07:53:51FromDiscord<Rika> The approach I’d think of immediately would be to display the perfect animation until the real event has been received, if not received on time then do not display the real event
07:54:42FromDiscord<huantian> Yeah that sounds like the best way to do it
07:55:10FromDiscord<Elegantbeef> Pretty much all you can really do
07:55:22FromDiscord<Rika> In regular gameplay there is the normal assumed latency of input and corresponding compensation, replace that with network latency compensation for network game display
07:55:46FromDiscord<Rika> If you want to generalise, you can have “physical input” and “network input”
07:55:53FromDiscord<Elegantbeef> Ah delay input
07:56:01FromDiscord<Elegantbeef> I forgot rika is in japan 😛
07:56:11FromDiscord<Rika> What about?
07:56:15FromDiscord<Elegantbeef> Those japanese fighting games still do delay instead of rollback
07:56:22FromDiscord<Rika> I don’t play fighting games
07:56:36FromDiscord<Rika> I’ve been playing rhythm games for nearly a decade and pretty much half my life though
07:56:41FromDiscord<Elegantbeef> I know you do not play any games but arcades
07:57:21FromDiscord<Elegantbeef> So huan how long for that playable prototype?!
07:57:46*kenran joined #nim
07:58:19FromDiscord<Rika> The hardest part of starting a game is choosing the engine or internals lol
07:58:23FromDiscord<huantian> In reply to @Rika "If you want to": That’d probably be something good to build the core of the game on as well, though sounds like a pain to test if it’s so entwined with the base game itself
07:58:28FromDiscord<Rika> Next after that is making a name lol
07:58:37FromDiscord<huantian> In reply to @Elegantbeef "So huan how long": 5 years probably
07:58:56FromDiscord<huantian> In reply to @Rika "Next after that is": Naming programming projects is always hard haha
07:59:18FromDiscord<Rika> In reply to @huantian "Naming programming projects is": Just choose the name of an anime character you like and pin it as the internal name
08:00:24FromDiscord<huantian> Lol
08:01:57FromDiscord<huantian> I don’t know if I’d design the base game systems with networking in mind from the beginning, or try to get a minimal local version first then add multi on it
08:02:16FromDiscord<ElegantBeef> Bridge are died
08:02:23FromDiscord<huantian> ono
08:02:26FromDiscord<ElegantBeef> The answer is you make your game with networking in mind
08:02:57FromDiscord<huantian> That sounds like a pain to test tho
08:03:33FromDiscord<huantian> Maybe that’s just me being lazy though
08:04:31FromDiscord<huantian> Also I actually was considering Godot 4.0, I wanna try it out with all its new fancy improvements
08:06:44FromDiscord<huantian> Probably won’t use gdscript, maybe C#?
08:07:51FromDiscord<ElegantBeef> You can join the other prolific godot rhythm game https://store.steampowered.com/app/1216230/Project_Heartbeat/
08:08:40FromDiscord<huantian> That looks like it is very much inspired by project diva lol
08:08:51FromDiscord<huantian> Just without the miku
08:09:53FromDiscord<huantian> Ngl I cannot read project diva I don’t understand how people play that game↵I have too much skill issue
08:10:25FromDiscord<ElegantBeef> I havent played any of these games since like guitar hero 3
08:10:46FromDiscord<ElegantBeef> The closest i've gotten in recent years is playing super hexagon, and that's not close
08:12:16FromDiscord<huantian> You should go play rhythm doctor, this is a very unbiased recommendation
08:13:22FromDiscord<ElegantBeef> I think i'll pass
08:13:34FromDiscord<huantian> Dang 😔
08:14:12FromDiscord<ElegantBeef> I'm a smooth brain that mostly plays shooty shooty games
08:15:35FromDiscord<huantian> Those games require me to sim which is hard
08:15:54FromDiscord<huantian> Also i have to know what to shoot
08:16:26FromDiscord<ElegantBeef> I get it you're american so it doesnt feel right shooting inside something that's not a school
08:16:28FromDiscord<Rika> Sorry I was playing 🙂 lol
08:16:31FromDiscord<Rika> I am back
08:16:56FromDiscord<huantian> In reply to @ElegantBeef "I get it you're": Yeah I also need to not die to people shooting me which is tough
08:17:11FromDiscord<ElegantBeef> Just shoot them first, problem solved
08:17:23FromDiscord<huantian> Ah I see
08:17:41FromDiscord<Hourglass [She/Her]> In reply to @ElegantBeef "I get it you're": DAMN
08:17:42FromDiscord<huantian> In reply to @Rika "Sorry I was playing": Playing 🙂?
08:17:47FromDiscord<Hourglass [She/Her]> Beef is out for BLOOD
08:18:05FromDiscord<ElegantBeef> It wasnt that impactful
08:18:23FromDiscord<Hourglass [She/Her]> I mean, bullets do get pretty messy
08:18:33FromDiscord<ElegantBeef> Insert a comment about the kids taking the brunt of it
08:18:36FromDiscord<Rika> Hit detection when there is sizeable latency lol
08:19:20FromDiscord<Hourglass [She/Her]> In reply to @ElegantBeef "*Insert a comment about": Damn
08:19:27FromDiscord<ElegantBeef> These arent that good
08:19:32FromDiscord<ElegantBeef> Anyway Nim huh
08:19:48FromDiscord<Hourglass [She/Her]> In reply to @ElegantBeef "These arent that good": Still makes me chuckle lmao
08:19:57FromDiscord<Hourglass [She/Her]> In reply to @ElegantBeef "Anyway Nim huh": Ah yes Nim
08:20:06FromDiscord<huantian> Are there GDExtension bindings for Nim yet?
08:20:43FromDiscord<ElegantBeef> Someone did start on them
08:20:46FromDiscord<ElegantBeef> No clue if they're usable
08:20:54FromDiscord<ElegantBeef> https://github.com/Hapenia-Lans/gdextension-nim
08:21:13FromDiscord<huantian> I see
08:21:58FromDiscord<huantian> Yk I wonder if a peer to peer system would work well for rhythm game multi
08:22:50FromDiscord<huantian> You wouldn’t have to go though a central server right? Or is that just optimistic
08:23:04FromDiscord<ElegantBeef> You need some master server for matchmaking unless you do direct IP connect
08:24:15FromDiscord<huantian> Definitely
08:24:19FromDiscord<Rika> Peer to peer makes things more complex
08:25:08FromDiscord<ElegantBeef> Well generally when people mean p2p they mean one person is chosen as a host and others connect to them
08:25:15FromDiscord<System64 ~ Flandre Scarlet> Hi, I will have a programming context next week and I will use Nim↵Do you know some useful libraries / packages I can use that doesn't have dependencies? I'll have to do console apps
08:25:28FromDiscord<Rika> Dependencies in terms of what
08:25:46FromDiscord<ElegantBeef> illwill is probably your best bet
08:26:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "Dependencies in terms of": I won't have Internet access, so I'll need to download the libraries to install them later
08:26:23*Notxor joined #nim
08:26:24FromDiscord<System64 ~ Flandre Scarlet> but if there are deps, it will be a mess
08:26:25FromDiscord<ElegantBeef> It's pure Nim with no external dependencies
08:26:44FromDiscord<huantian> In reply to @ElegantBeef "Well generally when people": Yeah I feel like with that setup it is added complexity with minimal benefit
08:27:06FromDiscord<huantian> Though maybe a mesh style where each player is connected to each other would have some benefits?
08:27:29FromDiscord<ElegantBeef> In unlikely scenarios the latency might be lower than to a server 😄
08:28:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "It's pure Nim with": Oh thanks! Might be useful!
08:28:39FromDiscord<ElegantBeef> There is also nimwave, no clue if it has external deps
08:29:30FromDiscord<System64 ~ Flandre Scarlet> Oh wow, someone made a TRACKER in the terminal!
08:29:48FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1088016669001121812/nim-mod-1.png
08:29:57FromDiscord<huantian> In reply to @ElegantBeef "In unlikely scenarios the": Hey it can’t be that unlikely!
08:30:52FromDiscord<ElegantBeef> Well in my case my ISP routes shittily so my ping to people in my town is actually comically high
08:31:06FromDiscord<ElegantBeef> I'm like < 3 km away but my ping is like 100ms
08:31:13FromDiscord<huantian> Wow
08:33:54FromDiscord<huantian> Hm if you did use a centralized server, would you want to batch the data from each other person? No right, that would mean that the person with the highest ping would bottleneck everything
08:34:08FromDiscord<huantian> This is where my inexperience with networking and games shows lol
08:35:35FromDiscord<ElegantBeef> I think the solution is that you play the notes perfectly until you have a response from the client, you then play the notes with the result the client provided
08:35:57FromDiscord<ElegantBeef> It's not 1:1 with what they did but it's an approximation of what they did
08:36:38FromDiscord<ElegantBeef> Though even with 300ms ping from client to host that's within some human reaction time
08:37:12FromDiscord<ElegantBeef> So aside from extremely high latency you should generally be able to have correct notes
08:37:58FromDiscord<ElegantBeef> Institute some limited rollback on the remote players
08:40:43FromDiscord<huantian> And you’d do that for each online player
08:41:18FromDiscord<huantian> I’d probably build with max 4p so only 3 online players at most
08:45:55*fallback quit (Read error: Connection reset by peer)
08:46:19*jmdaemon quit (Ping timeout: 265 seconds)
09:56:07*jmdaemon joined #nim
09:57:28*dv^_^ quit (Quit: Ping timeout (120 seconds))
09:57:55*dv^_^ joined #nim
10:23:49*beholders_eye joined #nim
10:26:01*jmdaemon quit (Ping timeout: 240 seconds)
10:40:01*beholders_eye quit (Ping timeout: 240 seconds)
10:47:49*nanxiao quit (Quit: Client closed)
11:02:37*beholders_eye joined #nim
11:14:22FromDiscord<Entikan> is it normal for nim to gobble up a random core when tokenizing/parsing? https://media.discordapp.net/attachments/371759389889003532/1088058078005571685/a.png
11:20:49*rmt quit (Ping timeout: 276 seconds)
11:33:24*beholders_eye quit (Ping timeout: 252 seconds)
11:33:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "illwill is probably your": Btw, does it support custom colors?↵Or it only can use 16 colors?
11:35:06FromDiscord<Yardanico> In reply to @Entikan "is it normal for": if it does that for a long time (say, more than 1 minute) you might've hit a bug in the compiler :)
11:38:33FromDiscord<Entikan> In reply to @Yardanico "if it does that": 1:02 to be exact
11:38:43FromDiscord<Yardanico> and it still hangs or finishes after that?
11:38:50FromDiscord<Entikan> it finishes
11:39:06FromDiscord<Entikan> starts compiling
11:39:10FromDiscord<Yardanico> oh, at least it's not too bad, is your project big or not? it might be macros or something else that's causing the compiler to spend a lot of time doing stuff
11:39:18FromDiscord<Yardanico> and what external libraries are you using
11:40:06FromDiscord<jmgomez> Anyone familiar with `typeIt` around?
11:40:20FromDiscord<Entikan> In reply to @Yardanico "oh, at least it's": it's pretty big, and under construction (nim-panda3d). My ARM is the only machine with this problem atm.
11:40:50FromDiscord<jmgomez> (edit) "`typeIt`" => "`assume/typeIt`"
11:41:13*rmt joined #nim
11:43:35FromDiscord<ringabout> Which compiler are you using?
11:45:34FromDiscord<Entikan> gcc, cpp. Though the problem happens before compiling
11:46:38FromDiscord<Yardanico> well there's no easy well to tell really, maybe the compiler just spends a lot of time on some part of your code
11:46:44FromDiscord<Yardanico> especially since you say it works fine on other devices
11:46:50FromDiscord<Yardanico> are you using the same nim compiler version on all of them?
11:47:45FromDiscord<Entikan> pretty sure. But thanks I'll do some more experiments
12:10:24*kenran quit (Remote host closed the connection)
12:20:19FromDiscord<gaet> In reply to @System64 "Btw, does it support": Illwill's fork https://github.com/ansiwave/illwave added truecolor support
12:41:29FromDiscord<ricky> do APTs hire usin nim take homes still
12:45:03*kenran joined #nim
12:54:54FromDiscord<PunchCake> whats ORC short for in memory managment
12:54:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @gaet "Nimwave's fork https://github.com/ansiwave/illwave ": Windows compatible too?
12:55:21FromDiscord<PunchCake> arc = atomic ref count↵orc = ??
12:56:21om3gawhat you think, which one is faster, arc or orc?
12:56:44FromDiscord<PunchCake> idk what orc means so i cant say
13:00:46FromDiscord<ringabout> O probably means cycle, which looks like a cycle.
13:01:40FromDiscord<ringabout> As a whole, it means ARC + cycle collecting.
13:02:09FromDiscord<ringabout> (edit) "O probably means ... cycle," added "a"
13:03:21FromDiscord<ringabout> ARC means automatic reference counting.
13:05:12FromDiscord<demotomohiro> iirc, ARC doesn't use atomic counter.
13:06:25FromDiscord<PunchCake> hm ok
13:06:27FromDiscord<jmgomez> TBH I feel like ARC is misleading, people tend to associate it with regular refc but AFAIK it's much more: RAII, move semantincs, etc.
13:06:34FromDiscord<PunchCake> but orc isnt stop the world right?
13:06:35om3gato be fair I don't care what it uses :)
13:06:39FromDiscord<jmgomez> (edit) "TBH I feel like ARC is misleading, people tend to associate it with regular refc but AFAIK it's much more: RAII, move semantincs, ... etc." added "no atomics,"
13:06:58om3gathe speed matters
13:07:08om3gaoverhead
13:07:42FromDiscord<PunchCake> so wait if orc isnt stop the world then literally my program will run just like im writing C++ but with the usage of smart pointers and a bonus cycle collector that doesnt stop my program execution
13:07:46FromDiscord<PunchCake> that sounds nice
13:08:33FromDiscord<jmgomez> In reply to @PunchCake "so wait if orc": To be precise smart pointers should be slower due to what I mentioned about
13:08:43FromDiscord<jmgomez> (edit) "about" => "above"
13:09:02FromDiscord<PunchCake> hm
13:09:13FromDiscord<PunchCake> so with ORC pretty much the GC is free right?
13:09:30FromDiscord<jmgomez> In reply to @PunchCake "so with ORC pretty": not free, but cheap
13:09:49FromDiscord<PunchCake> very cheap
13:10:13om3gaand arc is more expensive?
13:10:26FromDiscord<PunchCake> arc leaks
13:10:32FromDiscord<PunchCake> orc doesnt
13:10:37om3gaoh... can leak
13:10:43FromDiscord<PunchCake> orc can leak?
13:11:31FromDiscord<jmgomez> That would be considered a bug
13:12:00FromDiscord<PunchCake> yeah whats the point of a GC if its gonna leak anyways
13:12:11FromDiscord<PunchCake> (edit) "yeah whats the point of a ... GC" added "cycle collector"
13:13:11FromDiscord<demotomohiro> ARC is cheaper than ORC.↵ARC doesnt leak as long as you dont make circler dependencies.
13:13:40om3gaarc is faster than orc
13:13:51om3gaat least with my latest project
13:14:07FromDiscord<PunchCake> In reply to @demotomohiro "ARC is cheaper than": if im drawing a triangle in opengl its gonna leak one way or another
13:14:48om3gaPunchCake: mapped C lib?
13:14:58om3gabinded, or whatever
13:15:08om3gaor native nim code?
13:15:29FromDiscord<PunchCake> what do you mean?
13:15:38om3gahow you use opengl
13:15:45FromDiscord<PunchCake> bindings
13:15:54FromDiscord<demotomohiro> In just reference counter, if objA refers objB and objB refers objA, they are leaked. ORC can detect such cycle and collect them correctyl.
13:16:19om3gaPunchCake: it might be leaks are produced by use of that lib
13:16:25FromDiscord<PunchCake> no
13:16:37FromDiscord<PunchCake> in C++ i make use of weak ptr to avoid leaks
13:16:42FromDiscord<PunchCake> nim doesnt have that with arc
13:16:47FromDiscord<PunchCake> so i gotta use orc
13:17:15FromDiscord<demotomohiro> @PunchCake You can even draw single triangle in OpenGL without using ref types.
13:17:31FromDiscord<PunchCake> wdym
13:17:50FromDiscord<PunchCake> a triangle hard to have 3 pointes connected to each other
13:17:55FromDiscord<PunchCake> hence a tri angle
13:17:59FromDiscord<PunchCake> tri
13:18:19FromDiscord<demotomohiro> ref types in Nim works like a std::shared_ptr<T> in c++.
13:18:46FromDiscord<PunchCake> is there a weak ptr ref type?
13:18:56*Notxor quit (Remote host closed the connection)
13:19:43FromDiscord<demotomohiro> Drawing single triangle in OpenGL is just pass an array[3, Vec3f].
13:20:19FromDiscord<PunchCake> i dont think you understand
13:20:41FromDiscord<PunchCake> how i do it i draw 3 points and then draw lines connecting to each other and i fill it up
13:20:59FromDiscord<PunchCake> you cant make a triangle without 3 dots unless your gonna reinvent math or something
13:22:43*fallback joined #nim
13:22:55FromDiscord<demotomohiro> @PunchCake https://nim-lang.org/docs/destructors.html#lent-type↵lent type or cursor is similar to weak type.
13:23:07FromDiscord<PunchCake> https://media.discordapp.net/attachments/371759389889003532/1088090485026979840/image.png
13:23:26FromDiscord<PunchCake> https://media.discordapp.net/attachments/371759389889003532/1088090559270367313/image.png
13:23:33FromDiscord<PunchCake> sorry for the very bad drawing but you get the point
13:24:52FromDiscord<PunchCake> point 1 -> point 2 -> point 3
13:24:54FromDiscord<PunchCake> all connected
13:26:00FromDiscord<demotomohiro> That is different from how I used to draw a triangle. OpenGL implementation automatically fill triangle with glDraw(GL_Triangles, ...).
13:26:14FromDiscord<PunchCake> sent a long message, see http://ix.io/4rwH
13:26:14FromDiscord<PunchCake> ok shit
13:26:51FromDiscord<PunchCake> In reply to @demotomohiro "That is different from": i like to do it the mathematical way
13:31:10*beholders_eye joined #nim
13:31:40FromDiscord<demotomohiro> @PunchCake That sounds like you implement rasteraizer yourself.↵GPUs has rasteraizer and OpenGL users usually just use it.
13:35:32FromDiscord<PunchCake> In reply to @demotomohiro "<@655759729477287956> That sounds like": Yeah thats what i do
13:52:25*fallback quit (Read error: Connection reset by peer)
13:54:33*Phytolizer joined #nim
13:59:31FromDiscord<PunchCake> whats a good rest api framework for nim?
14:01:31*jmdaemon joined #nim
14:05:50FromDiscord<jmgomez> There is prologue, jester, mummy among others
14:06:31*jmdaemon quit (Ping timeout: 240 seconds)
14:06:56*rockcavera joined #nim
14:07:53FromDiscord<PunchCake> In reply to @jmgomez "There is prologue, ": whats the most stable and actively developed?
14:11:07FromDiscord<jmgomez> Not sure, jester is the more starred and mummy is the newer. I personally use prologue. jester and prologue are both based on httpbeast. Prologue is quite similar of how a traditional sinatra based mvc server works so if you used one before you should feel confortable with it ↵I think ringabout maintains Prologue which is one of the core devs of Nim so that's a plus
14:12:08FromDiscord<Rika> Jester is owned by someone that no longer associates with Nim
14:12:28FromDiscord<Rika> Take that with a pinch of salt or something
14:13:15FromDiscord<Rika> (I don’t recall if what I’m saying is true, haven’t followed closely)
14:15:40FromDiscord<PunchCake> i think i
14:15:49FromDiscord<PunchCake> will use Prologue
14:18:55*sagax quit (Ping timeout: 276 seconds)
14:30:07*fallback joined #nim
14:45:00*jmdaemon joined #nim
14:48:48*mronetwo quit (Write error: Connection reset by peer)
14:48:48*noeontheend quit (Remote host closed the connection)
14:48:48*henrytill quit (Write error: Connection reset by peer)
14:48:49*adigitoleo quit (Remote host closed the connection)
14:48:53*oddish quit (Remote host closed the connection)
14:50:01*adigitoleo joined #nim
14:50:09*oddish joined #nim
14:50:09*mronetwo joined #nim
14:50:35*henrytill joined #nim
14:51:30*noeontheend joined #nim
14:54:33om3gaArmenian politician Alen Simonyan admitted that Yerevan intends to ratify the Rome Statute
14:54:55FromDiscord<ringabout> ?
14:55:32om3gasorry, wrong window
14:59:33*fallback quit (Read error: Connection reset by peer)
15:02:11*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
15:02:29*jmdaemon joined #nim
15:15:36FromDiscord<Rika> Lol
15:20:11anddamRome Statue?
15:20:23anddamStatute*
15:20:49Amun-Raanddam: https://en.wikipedia.org/wiki/Rome_Statute
15:21:25om3gaWhen I'm tired sometimes I paste in wrong windows
15:22:01om3gaonce I sent nude picture of girl to my manager at work, manager is woman
15:22:11Amun-Raouch
15:23:05om3gano prob, she said good shape she has
15:23:15FromDiscord<Rika> Who was the nude girl
15:23:31om3gaI don't remember
15:24:18om3gathe problem was when I wrote texts with swear words on all employee meeting in Telia
15:25:10om3gathat was not very fun and little bit disappointing for me
15:25:59om3gabut it was their fault, why they not muted text window
15:26:01om3gahaha
15:31:19*fallback joined #nim
15:32:01*Notxor joined #nim
15:39:24*Phytolizer quit (Remote host closed the connection)
15:49:28FromDiscord<Coachonko> What is your opinion on Go's `defer` blocks?
15:50:32*adigitoleo quit (Remote host closed the connection)
15:50:33*mronetwo quit (Remote host closed the connection)
15:50:33*noeontheend quit (Write error: Broken pipe)
15:50:34*henrytill quit (Remote host closed the connection)
15:50:34*oddish quit (Remote host closed the connection)
15:51:22FromDiscord<Yardanico> In reply to @Coachonko "What is your opinion": Nim has them
15:51:38FromDiscord<pmunch> Are they different from Nims defer blocks?
15:51:42FromDiscord<Yardanico> i don't think so?
15:51:46FromDiscord<Coachonko> I couldn't find them in the docs
15:51:51FromDiscord<Elegantbeef> Yea, they're in a worse language
15:51:59FromDiscord<Coachonko> In reply to @Elegantbeef "Yea, they're in a": lmao
15:52:01FromDiscord<Yardanico> In reply to @Coachonko "I couldn't find them": the manual has docs for (almost) everything
15:52:01FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#exception-handling-defer-statement
15:52:16FromDiscord<Yardanico> that's where you would look for all actual language features
15:52:24FromDiscord<pmunch> https://nim-lang.org/docs/manual.html#exception-handling-defer-statement
15:52:30FromDiscord<Coachonko> I searched but couldn't find
15:52:38FromDiscord<Coachonko> Excuse me my brain is smooth ok
15:52:43FromDiscord<pmunch> Damn it, you beat me to it
15:53:23FromDiscord<pmunch> That was meant at Yardanico, I wasn't racing to call you a smooth brain
15:53:42FromDiscord<Elegantbeef> Be honest, you were a little
15:54:34FromDiscord<Coachonko> So it's basically sugar for try/finally
15:54:40FromDiscord<Yardanico> yes, just how it should be
15:54:44FromDiscord<Phil> Nim bots are mean I tell you
15:54:58FromDiscord<Elegantbeef> I thought we were median
15:55:00*adigitoleo joined #nim
15:55:09*mronetwo joined #nim
15:55:11*oddish joined #nim
15:56:24*noeontheend joined #nim
15:56:53*henrytill joined #nim
16:05:07FromDiscord<Phil> Nah, average
16:09:48*kenran quit (Remote host closed the connection)
16:11:44*arkurious joined #nim
16:18:32FromDiscord<Rika> mean average
16:24:35*Notxor quit (Ping timeout: 268 seconds)
16:29:13*beholders_eye quit (Ping timeout: 246 seconds)
16:37:27*Notxor joined #nim
16:48:47*jmdaemon quit (Ping timeout: 264 seconds)
17:00:40FromDiscord<halc> damn, just found out about new style concepts and they look neat but they still buggy :(
17:16:14NimEventerNew post on r/nim by iffycan: Show: embed directories in the executable, see https://reddit.com/r/nim/comments/11ypoi6/show_embed_directories_in_the_executable/
18:19:25*jaywack left #nim (Good Bye)
18:31:56*Notxor quit (Remote host closed the connection)
18:35:05*fallback quit (Read error: Connection reset by peer)
18:41:41*beholders_eye joined #nim
18:47:41*fallback joined #nim
19:12:05*jmdaemon joined #nim
19:14:52FromDiscord<kfdvh> Is there a way to cancel HTTP request?
19:17:05FromDiscord<kfdvh> Seen https://frontside.com/effection
19:19:51*Notxor joined #nim
19:23:06FromDiscord<Gumbercules> Yay, another JS framework!
19:24:28FromDiscord<Gumbercules> They can't even get mobile css correct. I don't have high expectations. https://media.discordapp.net/attachments/371759389889003532/1088181416585609360/Screenshot_20230322-142341_DuckDuckGo.jpg
19:24:39FromDiscord<Gumbercules> https://media.discordapp.net/attachments/371759389889003532/1088181465960956004/Screenshot_20230322-142341_DuckDuckGo.jpg
19:26:57FromDiscord<Gumbercules> In all seriousness though, I don't think you can "cancel" a HTTP request in Nim.
19:27:36FromDiscord<Gumbercules> You can provide a timeout for a synchronous request
19:29:12FromDiscord<System64 ~ Flandre Scarlet> Hi, do you know how I can name the terminal window please?
19:29:17FromDiscord<System64 ~ Flandre Scarlet> On Windows
19:31:04FromDiscord<Gumbercules> And asyncdispatch provides with timeout - but I don't think you can cancel a request / future
19:31:51FromDiscord<Gumbercules> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowtexta
19:32:34FromDiscord<Gumbercules> I'm not sure what terminal you're referring to, but this is how you set the title of a window in the windows api
19:34:10FromDiscord<kfdvh> In reply to @System64 "On Windows": `SetTitle` in Windows API
19:34:18FromDiscord<kfdvh> (edit) "In reply to @System64 "On Windows": ... `SetTitle`" added "something like"
19:38:43FromDiscord<kfdvh> In reply to @Gumbercules "And asyncdispatch provides": thanks anyway
19:41:18FromDiscord<Gumbercules> In reply to @kfdvh "thanks anyway": Sorry to disappoint. If you're targeting the JS backend you could always wrap effection or whatever.
19:42:32*rmt quit (Ping timeout: 268 seconds)
19:47:43FromDiscord<jmgomez> there is an implementation of futures for js, did you check out https://github.com/juancarlospaco/nodejs @kfdvh ?
20:45:26FromDiscord<System64 ~ Flandre Scarlet> Btw, is there some data structures I must absolutely know? (beside of arrays/seq / objects, obviously)
20:48:17FromDiscord<firasuke> Am I using the correct data type? I have a sequence of strings being passed to a `proc`, I need to sort these strings into other data types (strings that begin with `s` for example in a separated data structure, and another one for those beginning with `t` and so on). What should I use to reduce the cost of copying sequences of strings over and over again?
20:52:59FromDiscord<Elegantbeef> Copying strings isnt that expensive assuming you're using arc/orc
20:53:28FromDiscord<Elegantbeef> If you can use move semantics moving a string is just copying two integers
21:11:59FromDiscord<firasuke> I see, thanks
21:14:58*mal``` quit (Quit: Leaving)
21:16:31*advesperacit quit (Ping timeout: 240 seconds)
21:31:02*mal`` joined #nim
22:31:01FromDiscord<kfdvh> In reply to @jmgomez "there is an implementation": not targeting nodejs
22:31:18FromDiscord<kfdvh> (edit) "nodejs" => "nodejs. JS can't cancel Promise"
22:31:20FromDiscord<kfdvh> (edit) "In reply to @jmgomez "there is an implementation": not targeting nodejs. JS can't cancel Promise ... " added "either"
23:04:53FromDiscord<jmgomez> In reply to @kfdvh "not targeting nodejs. JS": the lib isnt for NodeJS though. Just an unfortunate name, most modules should work on vainila js.↵If js promises cant be canceled, I suggest you to either polyfill them or bind the futures to something else
23:06:48FromDiscord<Odi> sent a long message, see http://ix.io/4ryX
23:09:34FromDiscord<Gumbercules> In reply to @Odi "Not a question, but": I mean, this is pretty obvious - most of us just have lives and shit to do. Be the change you want to see in the world, is my advice to you.
23:11:59FromDiscord<Odi> In reply to @Gumbercules "I mean, this is": I gladly can follow you up on this, bro. I allready got 300 videos up on youtube(in regards to training). But if you I have posted
23:12:19*derpydoo joined #nim
23:12:19FromDiscord<Odi> (edit) " I have posted" => "will follow me up on this, i can gladly try to contribute=)"
23:14:52FromDiscord<Gumbercules> In reply to @Odi "I gladly can follow": If I thought YouTube videos would solve Nims problems in terms of marketing and popularity, I would have already made some. Hanging around here for seven years has convinced me otherwise. @Kiloneie has made quite a few videos to my knowledge. They might be someone to follow up with regarding your idea.
23:16:59FromDiscord<Odi> In reply to @Gumbercules "If I thought YouTube": Valid point😊 can i ask you what you think will solve Nims problem in terms of marketing and polularity? Do you have any spesifics in mind or do you think there is just a to niche language?:)
23:17:10FromDiscord<Gumbercules> The best way to attract people to a PL is to build cool shit with it. That or having bags of money from corporate sponsors.
23:17:28FromDiscord<Gumbercules> Zig became popular because of tooling like zigcc
23:17:35FromDiscord<Gumbercules> Rust had mozilla
23:17:58FromDiscord<Elegantbeef> Go had google
23:18:01FromDiscord<Gumbercules> In reply to @Gumbercules "Zig became popular because": Well that and a dedicated paid marketing person who already had experience in that subject.
23:22:14*azimut quit (Ping timeout: 255 seconds)
23:27:31FromDiscord<jmgomez> Nim has NimForUE 😛 jk
23:29:09FromDiscord<jmgomez> Was checking Verse out which was "launched" today and it seems to be a cool lang but not sure if the paradigm shift will play nice with the status of things. Definitely people will embrace it for UE
23:30:29FromDiscord<jmgomez> The only thing I know so far it's that Nim "compiles" faster and it probable run faster too
23:31:45FromDiscord<kfdvh> In reply to @Odi "Valid point😊 can i": the standard library
23:32:24FromDiscord<kfdvh> (edit) "In reply to @Odi "Valid point😊 can i": ... thelibrary." added "better" | "library" => "library. e.g. (futurestreams / asynctools) async stuff is too fragmented"
23:32:28FromDiscord<Elegantbeef> The main issues with Nim are the tooling and compiler bugs
23:32:45FromDiscord<Elegantbeef> Bleh stdlib hardly matter when you have the ability to use packages
23:33:06FromDiscord<Elegantbeef> Nimph, Nimble, Atlas all exist and can be used for external packages
23:33:36*Notxor quit (Remote host closed the connection)
23:34:34FromDiscord<jmgomez> Yeah, definitely tooling. At this point compiler bugs arent that bad I think
23:34:59FromDiscord<Elegantbeef> Use static generic and you'll find one
23:35:48FromDiscord<Elegantbeef> Or even just normal generics
23:35:55FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/issues/21558
23:35:57FromDiscord<jmgomez> In reply to @Elegantbeef "Use static generic and": I mean, I opened a few around generics but to be fair most mainstream langs can do that
23:36:04FromDiscord<jmgomez> (edit) "can" => "cant"
23:36:34FromDiscord<jmgomez> The really really problematic that may turn people away are/were around gc
23:37:19FromDiscord<jmgomez> IMO at this point tooling it's the number one thing. Not saying those arent important but tooling really turns people away. I personally prefer no bugs
23:37:55FromDiscord<demotomohiro> In reply to @Odi "Not a question, but": I wrote Nim FAQ: https://internet-of-tomohiro.netlify.app/nim/faq.en.html
23:42:26FromDiscord<willyboar> In reply to @Gumbercules "Well that and a": I stand on this. Totally agree. Nim lacks a community manager with focus to marketing. Even small things matters.