<< 16-07-2021 >>

00:04:38FromDiscord<ajusa> Are there any fast lock free queue implementations in Nim? I think there is the new std/channels and a package called lockfreequeues, are those recommended?
00:39:47FromDiscord<Hi02Hi> I'm not an expert, but I think there are different considerations for a multithreaded queue. For example, if you can guarantee only 1 thread will dequeue, you can also garuntee there will never be worries there. The terminology is Multiple Producers, Single Consumer (MPSC). Similarly, there are SCMP, MPMP, and SPSC (the single threaded queue).
00:46:21FromDiscord<ajusa> Hm yeah, what I'd be looking for is a SPSC queue then
02:18:56*aeverr quit (Ping timeout: 255 seconds)
02:36:07fn<ForumUpdaterBot99> New thread by Geohuz: How can I run a procedure with specified time interval, see https://forum.nim-lang.org/t/8235
02:53:46*pro1 joined #nim
02:56:56*pro quit (Ping timeout: 272 seconds)
03:08:31FromDiscord<Ænigma> `"nim c -o:'game.exe' --out:'bin' -r"` I feel like a derp, what am I doing wrong? xD
03:10:20FromDiscord<ElegantBeef> not giving a file to compiler
03:10:23FromDiscord<ElegantBeef> (edit) "compiler" => "compile"
03:12:19FromDiscord<Ænigma> Hah! Derping for sure, I got it working, but it's ignoring the --out flag
03:12:43FromDiscord<ElegantBeef> `-o` is the same as `--out`
03:12:49FromDiscord<ElegantBeef> you want `--outDir`
03:14:54FromDiscord<Ænigma> Oh thanks, that worked 🙂
03:43:52*arkurious quit (Quit: Leaving)
03:48:50FromDiscord<Ænigma> Could someone tell me what I'm doing wrong? 😦 https://media.discordapp.net/attachments/371759389889003532/865439809505984542/Screenshot_2.png
03:51:13FromDiscord<ElegantBeef> ~~Aside from writing nim like it's python~~ 😛↵What's in component.nim
03:51:23FromDiscord<ElegantBeef> I feel like you didnt do `Component`
03:51:48*rockcavera quit (Remote host closed the connection)
03:52:15FromDiscord<Ænigma> Haha. And yeah actually I think you're right. I derped.
03:52:24FromDiscord<Ænigma> I haven't been awake very long. e.e
03:52:54FromDiscord<Ænigma> I'm porting a prototype I was working on with Ruby and Gosu over to Nim.
03:53:09FromDiscord<Ænigma> Decided I didn't like Ruby.
03:54:10FromDiscord<ElegantBeef> Also you have a folder named ECS but are making an EC setup 😛
03:55:39FromDiscord<Ænigma> How so? Entities will contain components, components contain data, systems will process the entities depending on their components?
03:55:43FromDiscord<Ænigma> Though granted I am new to the ECS idea.
03:56:25FromDiscord<ElegantBeef> Well you're using inheritance which makes ECS less useful
03:56:50FromDiscord<ElegantBeef> One big benefit of ECS is that components are cache aligned
03:57:23FromDiscord<Ænigma> Hmm..how else would I store all my components in a single list/array/whatever without polymorphism? :Thonk:
03:57:39FromDiscord<ElegantBeef> Polymorph and similar ECS libraries do as such
03:58:45FromDiscord<Ænigma> So what would you recommend doing besides inheritance then?
03:58:59FromDiscord<ElegantBeef> Basically if you know the stride of an entity in a list you can rather easily fetch components based off that
03:59:10FromDiscord<ElegantBeef> Well if you want ECS i'd suggest polymorph
03:59:46FromDiscord<ElegantBeef> If you want your own ECS(that's designed to benefit from ECS) i'd suggest the PDF from flecs
04:00:00FromDiscord<ElegantBeef> If you dont care if it's designed to benefit from the ECS process carry on as is
04:00:40FromDiscord<Ænigma> Hmm..at this point I'm trying to learn. I suppose some more batteries included would help, but I also kind of wanted to do it myself even if it was terrible. 😄
04:00:56FromDiscord<Ænigma> I mean I'm not new to gamedev just new to some of these newer ideas like ECS and Nim itself.
04:01:07FromDiscord<ElegantBeef> Well https://github.com/SanderMertens/flecs_not_for_dummies/blob/master/flecs_not_for_dummies.pdf is a good resource
04:01:54FromDiscord<Ænigma> By the way, I also noticed that Nim can compile for Nintendo Switch? Would something like Nico work with that? I'm assuming the raylib bindings don't.
04:02:10FromDiscord<ElegantBeef> If sdl2 works with the switch yea probably
04:02:29FromDiscord<ElegantBeef> I dont have a switch devkit so cannot say anything about what works there(and even if i could i couldnt :P)
04:02:40FromDiscord<Ænigma> Yeah, true. I don't have one either.
04:03:02FromDiscord<Ænigma> But I'm getting serious about gamedev and nintedo switch is my goal. I've released 2 games now with countless failed ones.
04:03:45FromDiscord<ElegantBeef> Countless failed ones is just gamedev
04:04:12FromDiscord<Ænigma> Yeah, been a long time though.
04:04:33FromDiscord<Ænigma> Probably 10 years. But I finally said screw this I'm gonna make something and finish it, and that was December and Feburary.
04:04:42FromDiscord<Ænigma> I finished them I mean.
04:04:51FromDiscord<ElegantBeef> Also unless you really like/need the ECS paradigm there isnt really any purpose in using it
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:37*supakeen joined #nim
04:06:54FromDiscord<ElegantBeef> Also there are many ECS implementations you could look at for reference on how to avoid using polymorphism https://github.com/search?q=language%3Anim+ecs
04:08:50FromDiscord<Ænigma> Looks like generics or something.
04:08:58FromDiscord<Ænigma> That's a programming concept I don't really know. 😄
04:11:03FromDiscord<Ænigma> `proc addComponent[T](w: World, eid: EntityId, component: T) =`
04:13:24FromDiscord<Ænigma> I think I'll forego the ECS paradigm for now.
04:15:52FromDiscord<ElegantBeef> sorry to dissuade you
04:16:50FromDiscord<ElegantBeef> Worth noting that this is basically what you were going to end up with https://github.com/enthus1ast/ecs/blob/master/src/ecs.nim
04:17:00FromDiscord<ElegantBeef> Not very cache efficient due to using ref objects
05:01:56fn<ForumUpdaterBot99> New Nimble package! latinize - Convert accents (diacritics) from strings to latin characters., see https://github.com/AmanoTeam/Latinize
05:01:57fn<R2D299> itHub: 7"Latinize is a library and CLI tool written in Nim, it's indeed to convert accents (diacritics) from strings to latin characters."
05:09:23FromDiscord<Ænigma> @ElegantBeef WHat's the difference between `thing = object` and `thing = ref object of RootObj`
05:10:40FromDiscord<ElegantBeef> `ref` is a managed pointer, so it's a ref allocated object instead of stack allocated
05:11:04FromDiscord<Ænigma> Why would you want an object to be a pointer? :Thonk:
05:11:14FromDiscord<Ænigma> I mean I know Rust and C++ so I know what a pointer is.
05:11:20FromDiscord<Ænigma> I just don't understand the practical use.
05:11:29FromDiscord<ElegantBeef> Reference semantics
05:11:40FromDiscord<ElegantBeef> So oop like C#/Java
05:12:06FromDiscord<Ænigma> Oh so if you pass it, it passes the reference, and doesn't copy?
05:12:31FromDiscord<ElegantBeef> Well nim does do pass by reference for large objects as an optimization, but it's not something you need to worry about
05:12:48FromDiscord<Ænigma> Okay then so basically I don't understand. xD
05:12:53FromDiscord<ElegantBeef> Lol
05:13:10FromDiscord<Ænigma> I guess I should ask
05:13:12FromDiscord<Ænigma> WHen should I do which
05:15:55FromDiscord<ElegantBeef> Well references are useful for when you have an object that references a the same object, like a tree or linked list
05:16:19FromDiscord<Ænigma> Okay so basically it's just a reference then.
05:16:23FromDiscord<ElegantBeef> Nim's references are just managed pointers
05:16:23FromDiscord<Ænigma> So...
05:16:30FromDiscord<Ænigma> That means there can only be 1 of them?
05:16:33FromDiscord<Ænigma> Of that type
05:16:34FromDiscord<Ænigma> ?
05:16:41FromDiscord<ElegantBeef> No?
05:16:44FromDiscord<Ænigma> :Thonk:
05:17:11FromDiscord<Ænigma> I guess what I'm not understanding is, what is the point, can you not take a `thing = object` and do something like `doAThing(&thing)`?
05:17:29FromDiscord<ElegantBeef> I dont know what `&thing` does
05:17:35FromDiscord<Ænigma> In C++ that's a reference.
05:18:28FromDiscord<ElegantBeef> That's a reference to `thing`?
05:18:32FromDiscord<Ænigma> Yes
05:18:37FromDiscord<Ænigma> So I guess mabe in nim it wouldbe like
05:18:45FromDiscord<Ænigma> `doAThing(ref thing)`?
05:18:50FromDiscord<ElegantBeef> Well you can do that with pointers in Nim, but you cannot make a stack allocated object a `ref` magically
05:19:04FromDiscord<ElegantBeef> References in nim are managed which means they work with the GC
05:19:12FromDiscord<Ænigma> So..
05:19:27FromDiscord<Ænigma> Okay I think I get it.
05:19:40FromDiscord<ElegantBeef> So you cannot create a reference like that you'd either use `.addr` or have the `proc doThing(a: var Thing)`
05:20:21FromDiscord<Ænigma> Okay.
05:20:26FromDiscord<Ænigma> Now I'm actually wondering the opposite.
05:20:33FromDiscord<Ænigma> Why you would want to do `thing = object`
05:20:34FromDiscord<Ænigma> xD
05:20:50FromDiscord<ElegantBeef> Cause you dont often need heap allocated objects
05:20:58FromDiscord<ElegantBeef> If you dont need references you dont use them
05:21:30FromDiscord<Ænigma> But if I do need a reference, I can just do `thing.addr`?
05:21:33FromDiscord<ElegantBeef> no
05:21:35FromDiscord<Ænigma> o.o
05:21:37FromDiscord<ElegantBeef> that's for a pointer
05:21:47FromDiscord<Ænigma> :Thonk:
05:21:56FromDiscord<Ænigma> Oh wait
05:22:06FromDiscord<Ænigma> THat's to dereference the pointer
05:22:15FromDiscord<Ænigma> ?
05:22:27FromDiscord<ElegantBeef> Nim has `ptr T` `pointer` and `ref`s the first two are unmanaged pointers, and the latter is a managed one
05:22:35FromDiscord<ElegantBeef> No nim's dereference operator is `[]`
05:22:41FromDiscord<ElegantBeef> `.addr` gets a `ptr T`
05:23:03FromDiscord<Ænigma> Okay so basicaly what you're saying is
05:23:56FromDiscord<Ænigma> If I do the ref of RootObj I can just pass the thing around and always reference the same thing in memory, but if I do the other thing I have to use managed pointers if I want to pass it by reference like in C++ I hafta keep track of it?
05:24:09FromDiscord<ElegantBeef> Nope
05:24:26FromDiscord<ElegantBeef> Nim has `var T` for proc parameters which lets you pass as a reference
05:24:37FromDiscord<ElegantBeef> It's a mutable reference
05:24:40FromDiscord<Ænigma> Ah
05:25:13FromDiscord<Ænigma> Okay I think I get it.
05:25:17FromDiscord<Ænigma> Maybe.
05:25:18FromDiscord<Ænigma> xD
05:25:41FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3t8m
05:26:31FromDiscord<Ænigma> Wait
05:26:33FromDiscord<Ænigma> Is that a method?
05:26:43FromDiscord<Ænigma> I haven't found those yet in the manual.
05:26:51FromDiscord<ElegantBeef> Nim has UFCS so procs can be used like a method or like C style
05:26:56FromDiscord<Ænigma> That's whats up
05:27:11FromDiscord<ElegantBeef> `proc` and `func` are statically dispatched, and `method` is dynamically dispatched
05:27:35FromDiscord<Ænigma> I have no idea waht that means.
05:27:50FromDiscord<ElegantBeef> It means there is no runtime logic to decide what procedure to call
05:28:03FromDiscord<Ænigma> I guess I should clarify I'm not really a programmer, I'm a game developer, most of the computer science stuff goes over my head xD
05:28:27FromDiscord<Ænigma> That kind of makes sense.
05:28:43FromDiscord<ElegantBeef> `new T` makes a reference of T
05:28:44FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3t8n
05:28:53FromDiscord<ElegantBeef> Yea i'm a game dev as well
05:29:30FromDiscord<Ænigma> Ah yeah okay.
05:30:47FromDiscord<Ænigma> I actually dropped C++ and Rust because it was a little too complex for my liking. I guess rather C++ wasn't that complex really overall (aside from the metaprogramming black magic) but it's just I prefer to google or ask in discord how to do something, and I don't know if what I'm googling is the right answer when there's like 30x different ways to do something because of all the legacy, and most c++ people I've met in discord are elist
05:30:58FromDiscord<Ænigma> (edit) "elist" => "elitist"
05:32:50FromDiscord<linux user> is execCmd() depened on shell??
05:38:59FromDiscord<Rika> By default yes
05:39:08FromDiscord<Rika> (AFAIK)
05:39:21FromDiscord<Rika> In reply to @Ænigma "I actually dropped C++": Why did you drop rust though?
05:39:28FromDiscord<linux user> does it open a new shell or the existing?
05:39:40FromDiscord<Rika> I can see how some C++ programmers can be asshats
05:39:53FromDiscord<linux user> so you sure it will work in windoze?
05:40:02FromDiscord<Rika> In reply to @richard stallmen(crazy GNU guy) "does it open a": Not a detail I know (it probably opens a new one?), better off reading the code
05:40:11FromDiscord<Rika> Rather
05:40:35FromDiscord<Rika> Okay I don’t really know the details
05:40:37FromDiscord<linux user> i used execProcess , but the process cant use stdin
05:40:39FromDiscord<Rika> Best to read the code
05:40:43FromDiscord<Rika> Ah
05:40:45FromDiscord<linux user> ok
05:41:10FromDiscord<Rika> That’s because the in and out of the process is separate from the main ones
05:41:28FromDiscord<linux user> https://media.discordapp.net/attachments/371759389889003532/865468151755177994/Screenshot_2021-07-16-11-11-19.jpeg
05:41:35FromDiscord<linux user> smol
05:42:40FromDiscord<Rika> I mean read the code of the exec command proc
05:42:43FromDiscord<Ænigma> In reply to @Rika "Why did you drop": Because it was a little too Verbose for my liking, and there it seemed the more deeer I dove into gamedev with it the more I had to learn or there was always a "gotcha" moment and I would just drop it.
05:42:44FromDiscord<ElegantBeef> osproc has the abillity to share streams
05:42:55FromDiscord<Rika> In reply to @Ænigma "Because it was a": I see
05:43:28FromDiscord<Rika> I’m not very confident that Nim would be as easy as you think it is
05:45:37FromDiscord<ElegantBeef> Uh oh bung is typing, i was never here
05:45:37FromDiscord<Bung> In reply to @richard stallmen(crazy GNU guy) "": exec apis means run and exit , for osproc module you need startProcess
05:45:56FromDiscord<Bung> dont worry , not the nimscripter thing haha
05:46:08FromDiscord<haxscramper> With poUserParentStreams flag enabled
05:46:23FromDiscord<haxscramper> I think it is called this way
05:46:29FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/865469331747504149): With poUseParentStreams flag enabled
05:47:23FromDiscord<Bung> you can also use https://github.com/cheatfate/asynctools
05:47:26fn<R2D299> itHub: 7"Various asynchronous tools for Nim language"
05:47:50FromDiscord<generic linux user> In reply to @Bung "exec* apis means run": i was asking about passing stdin options, mpv reads from stdin for example p for pause...
05:48:57FromDiscord<Bung> oh that should do as hax just described
05:49:10*beshr quit (Remote host closed the connection)
05:53:01FromDiscord<generic linux user> yes mate
05:56:14FromDiscord<generic linux user> sent a code paste, see https://paste.rs/k50
05:58:08FromDiscord<Rika> Prolly needs osprocs?
05:58:19FromDiscord<ElegantBeef> `poUseParentStreams`
06:00:43FromDiscord<generic linux user> oops
06:01:33FromDiscord<generic linux user> it coming again, but did you guys meant startProcess() or execProcess()?
06:05:08FromDiscord<generic linux user> https://media.discordapp.net/attachments/371759389889003532/865474107133657094/Screenshot_2021-07-16-11-34-59.jpeg
06:05:14FromDiscord<generic linux user> bruhbruhbruhbruh
06:06:39FromDiscord<Bung> that depends whether you need intergrate with the sub process
06:09:02FromDiscord<generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3t8A
06:09:13FromDiscord<generic linux user> it sends the process to bwckground and exits
06:15:45FromDiscord<haxscramper> You either fully share processes or use existing ones
06:16:04FromDiscord<haxscramper> You can also pipe data to process's stdin in loop
06:16:49FromDiscord<haxscramper> `process.inputStream().write(stdin.readLine())`
06:27:36FromDiscord<generic linux user> how do i know what the process is then
06:27:56FromDiscord<generic linux user> i typed PLAYER , it says error returns string ,
06:28:10FromDiscord<Rika> What do you mean? You store the process in a variable how would you lose it
06:28:52FromDiscord<generic linux user> sorry i discarded it
06:33:57FromDiscord<generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3t8I
06:34:05FromDiscord<generic linux user> (edit)
06:34:11FromDiscord<generic linux user> (edit)
06:34:26*PMunch joined #nim
06:34:43FromDiscord<Rika> So does it work
06:35:49FromDiscord<generic linux user> nope
06:36:11FromDiscord<generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3t8J
06:36:42FromDiscord<generic linux user> why did i name it brr
06:36:46FromDiscord<generic linux user> 😳
06:36:50FromDiscord<generic linux user> (edit) "https://play.nim-lang.org/#ix=3t8J" => "https://play.nim-lang.org/#ix=3t8K"
06:37:08FromDiscord<Rika> Eeh tainted string means you have taint mode on?
06:37:36FromDiscord<Rika> Wait why is it a different value name?
06:37:42FromDiscord<Rika> I mean variable name
06:39:47FromDiscord<generic linux user> i didnt turn it on tho
06:42:40FromDiscord<ElegantBeef> Exec process doesnt return the process it returns a string
06:43:01FromDiscord<ElegantBeef> > A convenience procedure that executes command with startProcess and returns its output as a string.
06:44:19FromDiscord<generic linux user> startProcess
06:46:11FromDiscord<generic linux user> confilcts upon stream and file
06:50:15*max22- joined #nim
06:52:41*pro1 is now known as pro
06:54:17FromDiscord<generic linux user> seems i cant skip using shell↵https://github.com/nim-lang/Nim/issues/8153
07:02:02FromDiscord<generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3t8W
07:02:08FromDiscord<generic linux user> works just like execCmd , a bit sus
07:10:25*neceve joined #nim
07:31:53FromDiscord<enthus1ast> @generic linux user\: btw mpv is every easy to embden, and the nim wrapper is good
07:32:25FromDiscord<generic linux user> there is?
07:33:00FromDiscord<enthus1ast> https://github.com/daniel-j/nim-mpv
07:33:02fn<R2D299> itHub: 7"Nim bindings for libmpv using Nimterop"
07:33:59FromDiscord<enthus1ast> And there I use it\: https://github.com/enthus1ast/muk
07:34:01fn<R2D299> itHub: 7"crossplattform terminal music player. Inspired by moc and mpd."
07:35:51FromDiscord<generic linux user> yepp, linker errors
07:36:13FromDiscord<enthus1ast> Sure you must link to libmpv ;)
07:36:26FromDiscord<enthus1ast> And download it for your os
07:36:46FromDiscord<enthus1ast> If on linux it should find it, though
07:38:18FromDiscord<enthus1ast> https://github.com/enthus1ast/muk/blob/master/src/muk.nims
07:44:48FromDiscord<generic linux user> i tried -lmpv tho
07:44:49FromDiscord<willyboar> I like illwill a lot. I was checked it a couple of months ago to build a tui static site generator
07:46:09FromDiscord<enthus1ast> Have the libmpv library next to your executable?↵(@generic linux user)
07:46:25FromDiscord<generic linux user> libmpv.a?
07:46:31FromDiscord<generic linux user> or the header files?
07:46:46FromDiscord<enthus1ast> Libmpv.a
07:47:49FromDiscord<enthus1ast> Or help the c compiler find it by -L
07:48:33FromDiscord<generic linux user> oki
07:49:27FromDiscord<generic linux user> https://media.discordapp.net/attachments/371759389889003532/865500358859554827/Screenshot_2021-07-16-13-19-16.jpeg
07:50:18FromDiscord<generic linux user> -lmpv
07:50:24FromDiscord<enthus1ast> Illwill misses the unicode support, I've a half finished prototype lying around but it's not yet usable, so only really usable for english input↵(@willyboar)
07:56:32FromDiscord<enthus1ast> Have not tested muk with clang, so you yound a dragon \:)↵(@generic linux user)
07:57:46FromDiscord<enthus1ast> But muk is a complex example. When you just want to embed mpv for playing and controlling video, then I would use a simpler example
07:59:02FromDiscord<enthus1ast> https://github.com/daniel-j/nim-mpv/blob/master/examples/simple.nim
08:00:08*Schnouki quit (Ping timeout: 252 seconds)
08:01:55*Schnouki joined #nim
08:09:50FromDiscord<Bung> @ElegantBeef the rest part you get idea in your mind ?
08:12:46FromDiscord<ElegantBeef> I actually dont know how to do the Nim -> nimscript part atm, since i assume i need to make an object with all the proper symbols
08:15:48FromDiscord<Bung> variable -> pnode -> string -> pnode does not work?
08:15:48FromDiscord<haxscramper> Is this still about nimscripter?
08:16:08FromDiscord<haxscramper> I can write more robust POC implementation, but it would rely on hnimast
08:16:18FromDiscord<haxscramper> For passing data around
08:16:29FromDiscord<Bung> yeah, beef done some nims -> nim part
08:17:01FromDiscord<Bung> nim -> nims part havn't yet, so I can't pass variable to nims proc
08:17:13FromDiscord<generic linux user> Thanks guys, seems to work
08:18:09FromDiscord<generic linux user> In reply to @enthus1ast "https://github.com/daniel-j/nim-mpv/blob/master/exa": since i qm developing in termux , and in thevpast i have tried to compile libmpv.a , it failed↵android is linux , but dies stuff a bit on its own way
08:18:19FromDiscord<generic linux user> (edit) "dies" => "does"
08:18:25FromDiscord<generic linux user> (edit) "qm" => "am"
08:18:30FromDiscord<generic linux user> (edit) "thevpast" => "the past"
08:19:18*Schnouki quit (Ping timeout: 265 seconds)
08:20:27FromDiscord<Bung> @haxscramper that would help me and beef out, you can use my forked small repo https://github.com/bung87/nimscripter
08:20:30fn<R2D299> itHub: 7"Quick and easy Nim <-> Nimscript interop"
08:20:40*Vladar joined #nim
08:21:14*Schnouki joined #nim
08:21:14FromDiscord<haxscramper> What I'm mostly asking is - you ok with addition hnimast dependency?
08:21:26FromDiscord<ElegantBeef> Well it doesnt compile on devel 😄
08:21:34FromDiscord<ElegantBeef> Forgot to make the issue
08:22:28FromDiscord<haxscramper> I will look into this
08:22:57FromDiscord<Bung> guess better strip out nimble
08:23:30FromDiscord<Bung> since them both use compiler package, depends on compiler package is fine
08:24:17FromDiscord<Bung> my fork version will also remove compiler package as dependency.
08:24:51FromDiscord<haxscramper> so much for optional dependnecies
08:25:14FromDiscord<haxscramper> this garbage is so annoying
08:25:28*neceve quit (Ping timeout: 246 seconds)
08:26:06FromDiscord<haxscramper> I will look into that as well
08:26:54FromDiscord<Bung> you can update your nim version every commit then you will find your package depends on compiler package has much more compatible issue : )
08:28:33FromDiscord<haxscramper> I don't usually develop against devel
08:28:48FromDiscord<haxscramper> I have things to do instead of playing catch-up game with moving target
08:29:10FromDiscord<ElegantBeef> Yea but sadly i have PR in devel that fixes `std/` imports in VM
08:29:23FromDiscord<haxscramper> They are broken?
08:29:32FromDiscord<ElegantBeef> They were for me 😄
08:31:49FromDiscord<haxscramper> Can you link the issue?
08:32:17FromDiscord<ElegantBeef> No cause that'd involve there being one
08:33:32FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/commit/d96469037ecc1ee7982b420cbe6ce34e91d18b01 my PR for it
09:03:55*pro quit (Quit: WeeChat 3.2)
09:06:51*pro joined #nim
09:34:48*Schnouki quit (Ping timeout: 255 seconds)
09:34:59FromDiscord<Tuatarian> I have a bit of a weird situation
09:35:26FromDiscord<Tuatarian> I have been using nim + raylib for a game development project, and for some reason, kaspersky seems to think my binaries are malware?
09:35:38FromDiscord<Tuatarian> uds winshell exploit or something like that
09:35:45FromDiscord<Tuatarian> I've been using it for a while, I doubt it's malware
09:36:03FromDiscord<Tuatarian> and it only seems to complain a few hours after running & closing the binaries
09:36:05FromDiscord<Tuatarian> which is even stranger
09:36:07FromDiscord<Tuatarian> any ideas?
09:36:45FromDiscord<ElegantBeef> Since around Nim 1.4.6(maybe even earlier) is a false positive for a virus by a lot of anti-virus vendors
09:42:11FromDiscord<enthus1ast> Report it as a false positive
10:15:52*maxime_ joined #nim
10:17:15*max22- quit (Ping timeout: 268 seconds)
10:19:21*maxime_ quit (Remote host closed the connection)
10:19:44*maxime_ joined #nim
10:26:06*pro quit (Ping timeout: 255 seconds)
10:27:44*maxime_ quit (Ping timeout: 268 seconds)
10:58:00FromDiscord<JH> what the easiest/best way to remove characters at the end of a string in nim?
11:00:03FromDiscord<haxscramper> https://nim-lang.org/docs/strutils.html#delete%2Cstring%2Cint%2Cint
11:04:50*maxime_ joined #nim
11:12:45*g42x joined #nim
11:21:29FromDiscord<enthus1ast> also strip() for some usecases\: https://nim-lang.org/docs/strutils.html#strip%2Cstring%2Cset%5Bchar%5D
11:25:42FromDiscord<JH> perfect! thanks guys
11:33:56arkanoidwhat's the advantage of using nlvm instead of clang?
11:53:25*xet7 quit (Remote host closed the connection)
11:54:13FromDiscord<haxscramper> How can I get subtype name at runtime?
11:54:44FromDiscord<haxscramper> I've seen mentions of `typeinfo` being deprecated with ARC/ORC - is there any solution that would still work
11:55:24*xet7 joined #nim
11:57:46*maxime_ quit (Ping timeout: 268 seconds)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:07:07*g42x quit (Quit: Client closed)
12:28:46*g42x joined #nim
12:43:09*rockcavera joined #nim
12:43:09*rockcavera quit (Changing host)
12:43:09*rockcavera joined #nim
12:49:43*maxime_ joined #nim
13:12:49*Lord_Nightmare2 joined #nim
13:14:49*fputs_ joined #nim
13:18:34*mahlon_ joined #nim
13:18:48*xet7 quit (*.net *.split)
13:18:49*Lord_Nightmare quit (*.net *.split)
13:18:49*stkrdknmibalz quit (*.net *.split)
13:18:49*fn quit (*.net *.split)
13:18:49*mahlon quit (*.net *.split)
13:18:49*fputs quit (*.net *.split)
13:18:49*Amun-Ra quit (*.net *.split)
13:18:51*Lord_Nightmare2 is now known as Lord_Nightmare
13:22:44*fn joined #nim
13:23:57FromDiscord<arnetheduck> In reply to @arkanoid "what's the advantage of": each transformation step is lossy which means missed optimisation opportunities and takes time - `nim -> clang -> llvm -> ...` is a longer, slower and more lossy pipeline than `nlvm -> llvm -> ...` - ie faster and better codegen, but you lose some C FFI capabilities
13:25:45FromDiscord<arnetheduck> there are things you cannot express in C either - memory and stack layout for the GC, debug information, certain forms of trampolines for callbacks, certain forms of constants etc
13:25:45*Amun-Ra joined #nim
13:26:15*xet7 joined #nim
13:40:08*maxime_ quit (Ping timeout: 268 seconds)
13:41:58*arkurious joined #nim
13:45:58*g42x quit (Quit: Client closed)
14:24:42*g42x joined #nim
14:36:46*Vladar quit (Ping timeout: 252 seconds)
14:39:46*Vladar joined #nim
14:49:27*g42x quit (Quit: Client closed)
14:50:58*maxime_ joined #nim
14:52:50FromDiscord<Yinisiki> Please Please... i need help.. I did everything i could do to install nim... but it keeps failing... here are my efforts... i just want to install nim! https://media.discordapp.net/attachments/371759389889003532/865606906533249124/nim.mp4
14:56:18FromDiscord<juan_carlos> Nim compiler has no GUI, looks installed?, open a terminal window like powershell or cmd.exe and run nim --help
14:56:43FromDiscord<generic linux user> ofc i have never seen a compiler eith ui
14:56:49FromDiscord<generic linux user> 👀
14:57:27FromDiscord<Yinisiki> ya the command ran well
14:57:38FromDiscord<juan_carlos> Done then, thats nim
14:57:39FromDiscord<generic linux user> installation ok
14:57:45FromDiscord<generic linux user> look for nimble
14:58:07FromDiscord<generic linux user> wait , if you tyoe nim then it will print the std help
14:58:12FromDiscord<generic linux user> but try to compile one
14:58:19FromDiscord<Yinisiki> yes, even nimble command worked
14:58:20FromDiscord<generic linux user> maybe if the libs arent installed?
14:58:46FromDiscord<Kermithos> sent a code paste, see https://paste.rs/6aW
15:01:54*g42x joined #nim
15:02:04FromDiscord<Yinisiki> just ran it... there is a helloWorld.exe created on my desktop but it closes as soon as i open it https://media.discordapp.net/attachments/371759389889003532/865609232367616020/unknown.png
15:02:18FromDiscord<Kermithos> In reply to @Yinisiki "just ran it... there": open it via your cmd
15:02:31FromDiscord<Kermithos> or add -r as command
15:03:08FromDiscord<Kermithos> https://nim-lang.org/docs/nimc.html
15:04:03FromDiscord<juan_carlos> `nim r helloWorld.nim` from the cmd.exe
15:04:29FromDiscord<generic linux user> he didnt even execute it
15:04:33FromDiscord<generic linux user> .\Helo.exe
15:04:35FromDiscord<generic linux user> bruh
15:04:52FromDiscord<generic linux user> i cant undertsnad whats with the --run option, from go?
15:04:54FromDiscord<Yinisiki> wow it just printed hello world....
15:04:58FromDiscord<generic linux user> yes
15:05:02FromDiscord<SolitudeSF> holy...
15:05:02FromDiscord<generic linux user> 😐
15:05:06FromDiscord<Yinisiki> SUCCESS!!
15:06:11FromDiscord<Yinisiki> i THOUGHT i COULD RUN iT LikE PyTHON...
15:06:14FromDiscord<generic linux user> you said it aldready
15:06:17FromDiscord<Clonkk> Now you get to do some reading about what a compiler is and the difference between source code and binary.
15:06:23FromDiscord<generic linux user> In reply to @Yinisiki "i THOUGHT i COULD": thats what -r
15:08:06FromDiscord<Yinisiki> Thanks a lot guys... this is really a friendly community.. i will continue with the docs from here!!
15:08:17FromDiscord<Rika> gl
15:09:16FromDiscord<juan_carlos> Everything starts with a Hello World
15:09:24FromDiscord<juan_carlos> ...Then you learn to add Bugs to it.
15:09:44FromDiscord<dom96> In reply to @Yinisiki "Thanks a lot guys...": if anyone ever gives you shit for not knowing something then let me know, we all gotta start somewhere 🙂
15:10:12FromDiscord<dom96> (me or one of the other `@Moderator`'s that is)
15:12:23FromDiscord<Yinisiki> In reply to @dom96 "if anyone ever gives": Thats really kind of you dom!!
15:13:18FromDiscord<generic linux user> dommomom
15:13:21FromDiscord<Clonkk> It actually is a friendly community. But you're asking question about OS usage not about Nim. There really is no need to be dramatic, noone was mean to you. You just need to learn about what a compiler is (in opposition to a scripting language such as Python) and about console usage.↵(@Yinisiki)
15:13:30FromDiscord<generic linux user> (edit) "dommomom" => "dommoomoom"
15:13:49FromDiscord<generic linux user> yes , console is 🙂
15:13:57FromDiscord<Clonkk> There is nothing insulting in saying you need to learn about the tools you want to use
15:14:33FromDiscord<SolitudeSF> i dont think he was sarcastic
15:14:34FromDiscord<dom96> huh, interesting. I didn't take what Yinisiki said sarcastically
15:14:58FromDiscord<Rika> me neither
15:14:58FromDiscord<dom96> I still don't think it was meant to be sarcastic
15:16:03FromDiscord<Clonkk> Oh, well my bad then. carry on
15:16:03FromDiscord<Clonkk> I thought it was sarcasm, I guess the `...` threw me off
15:22:10FromDiscord<generic linux user> ...?
15:27:55FromDiscord<Ayy Lmao> How do you launch a program from NimScript? Like a .exe on Windows for example
15:28:40FromDiscord<juan_carlos> gorgeEx
15:32:22FromDiscord<Ayy Lmao> Awesome, that works. Thanks!
15:36:48FromDiscord<generic linux user> nimscript?
15:37:02FromDiscord<generic linux user> icant see the usage , like why !python?
15:38:27FromDiscord<SolitudeSF> ?
15:38:53FromDiscord<Rika> it is useful to run external programs in nimscript, the usual usecase is to run something within a nimble task
15:40:00FromDiscord<generic linux user> 🆘 but 🆗
15:43:01FromDiscord<juan_carlos> NimScript because Windows BAT is ugly (?).
15:43:40FromDiscord<haxscramper> I'm getting segmentation faults when I switch to `ORC`, but things work fine with default refc. But other part of an application crashes when I have refc enabled, and I need to switch to orc to fix that
15:43:56FromDiscord<haxscramper> On top of that - when I use orc segmentation fault has no stacktrace
15:43:57FromDiscord<generic linux user> wierd
15:43:58FromDiscord<Rika> already tried valgrind and friends?
15:44:11FromDiscord<Rika> or asan?
15:44:18FromDiscord<Rika> not sure if asan works well with nim actually
15:44:24FromDiscord<haxscramper> I'm like 99.9% sure that the bug is due to `nil` dereferencing
15:44:31FromDiscord<haxscramper> And I can get stacktrace from GDB as well
15:44:39FromDiscord<haxscramper> But nim's stracktrace is completely empty
15:44:50FromDiscord<Rika> might be some weird internal function
15:44:56FromDiscord<haxscramper> Running with valgrind will take million years, but I will try now
15:45:16FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tbl
15:45:28FromDiscord<haxscramper> I add to sequence somewhere and it segfaults
15:46:47FromDiscord<Rika> is this threaded code?
15:47:09FromDiscord<haxscramper> no
15:47:38FromDiscord<haxscramper> Single-threaded, C backed, no release
15:48:33FromDiscord<haxscramper> For some reason things are literally falling apart with haxdoc - constant random crashes even for parts of the code
15:49:12FromDiscord<hamidb80> hey
15:49:18FromDiscord<generic linux user> helo
15:49:33FromDiscord<hamidb80> can someone explain me `noconv` pragma ?
15:50:16FromDiscord<Rika> its a calling convention i believe
15:50:25FromDiscord<Rika> In reply to @haxscramper "For some reason things": thats really strange
15:50:29FromDiscord<Rika> i dont know how to help
15:50:57FromDiscord<hamidb80> what is calling convention?
15:51:26FromDiscord<juan_carlos> how function call code is emitted.
15:52:29FromDiscord<Rika> well its a bit difficult to explain further
15:52:32FromDiscord<haxscramper> Valigrind reports `Invalid read of size 8` for ORC
15:53:11FromDiscord<Rika> https://en.wikipedia.org/wiki/X86_calling_conventions
15:53:34FromDiscord<haxscramper> And a lot of `Use of uninitialised value of size 8` for refc
15:53:51FromDiscord<haxscramper> But that one comes from `incRefAT1eRuflKWyTTBdLjEDZbgsystem`
15:53:56FromDiscord<Rika> it's a kinda low level concept, you kinda need to know how memory and asm works and stuff
15:55:41FromDiscord<hamidb80> In reply to @Rika "it's a kinda low": i just forked https://github.com/hamidb80/coverage/blob/master/cibuild.sh and have no idea why yglukhov is doing this
15:55:52FromDiscord<hamidb80> (edit) "https://github.com/hamidb80/coverage/blob/master/cibuild.sh" => "https://github.com/hamidb80/coverage/"
15:56:24FromDiscord<Rika> https://nim-lang.org/docs/manual.html#types-procedural-type
15:56:33FromDiscord<Rika> if you want specifically what noconv means
15:56:57FromDiscord<hamidb80> thanks
15:57:47FromDiscord<Rika> i just checked the usage
15:57:50FromDiscord<Rika> i dont know why either
15:57:56FromDiscord<Rika> maybe its best to ask him directly
16:06:52FromDiscord<Ayy Lmao> I'm trying to use NimScript to move a .dll file on Windows and keep getting `access is denied`. Does anyone know how to deal with this? Launching the terminal as admin doesn't seem to work
16:07:35FromDiscord<juan_carlos> Windows can lock DDLs silently, try copying it.
16:07:48FromDiscord<Ayy Lmao> Copying seems to give the same issue
16:09:56fn<Prestige99> must have to do with the destination?
16:10:21fn<Prestige99> can you copy it to your desktop?
16:10:34FromDiscord<Ayy Lmao> I've tried multiple destinations to check that, as well as my desktop
16:10:43fn<ForumUpdaterBot99> New Nimble package! xom - Transform XML trees into performant JavaScript DOM calls at compile-time., see https://github.com/schneiderfelipe/xom
16:10:43fn<R2D299> itHub: 7"Transform XML trees into performant JavaScript DOM calls at compile-time using Nim code."
16:11:41fn<Prestige99> Then it seems you don't even have read permissions on the dll (I would think) which seems odd
16:11:54fn<Prestige99> But I don't use Windows so 🤷
16:13:18FromDiscord<hamidb80> i'm on the Windows
16:13:18FromDiscord<Ayy Lmao> I seem to be able to get the .dll to be where I need it to be by using `"--outdir:"` in the compiler when I build it. I guess that works for me
16:13:21FromDiscord<hamidb80> send your code
16:14:43FromDiscord<Ayy Lmao> In reply to @hamidb80 "send your code": It's just calling `mvFile` or `cpFile` on a .dll in NimScript
16:19:26FromDiscord<hamidb80> 😐 https://media.discordapp.net/attachments/371759389889003532/865628703668830218/unknown.png
16:20:13FromDiscord<generic linux user> due to security reasons
16:20:21FromDiscord<generic linux user> file managemnrt disabled in javascript
16:20:36FromDiscord<generic linux user> you dont want a website writing files to your disk
16:20:52FromDiscord<hamidb80> In reply to @richard stallmen(crazy GNU guy) "you dont want a": what about nimscript?
16:20:58FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/865629091133653061/unknown.png
16:21:01FromDiscord<generic linux user> i dont know that much
16:21:08FromDiscord<juan_carlos> For NimScript it is cpFile
16:21:44FromDiscord<hamidb80> In reply to @juan_carlos "For NimScript it is": where is it documented?
16:22:27FromDiscord<juan_carlos> https://nim-lang.github.io/Nim/nimscript.html#cpFile%2Cstring%2Cstring
16:52:59FromDiscord<kaushalmodi> In reply to @hamidb80 "where is it documented?": I find it useful to bookmark this page: https://nim-lang.github.io/Nim/theindex.html↵↵Just Ctrl+F "cpFile" on there.
16:54:02FromDiscord<aleclarson> is step debugging nim code possible in vscode?
16:54:27FromDiscord<aleclarson> or rather, is it implemented by a plugin?
16:54:40arkanoidarnetheduck, late thanks for your answer (and for your effort on nlvm)
16:56:10arkanoidis {.noSideEffect.} and {.raises: [].} and {.experimental: "strictFuncs".} sufficient to enforce a pure function?
16:56:24FromDiscord<aleclarson> In reply to @aleclarson "is step debugging nim": oh i found this. has anyone tried it?↵https://github.com/jasonprogrammer/nim-debug-example
16:56:26fn<R2D299> itHub: 7"A walkthrough for setting up debugging of Nim code in VSCode"
17:00:26*ozzz joined #nim
17:09:03FromDiscord<Rika> In reply to @arkanoid "is {.noSideEffect.} and {.raises:": enforce to the best the nim compiler can yes, but it is still circumventable if you mean that
17:16:13*stkrdknmibalz joined #nim
17:27:17*rockcavera quit (Remote host closed the connection)
17:43:37arkanoidRika, sure, I'm not expecting nim to be haskell. Thanks for the feedback
17:43:53FromDiscord<Rika> i dont remember what i said
17:44:01FromDiscord<Rika> oh you mean the thing i just said
17:44:01FromDiscord<Rika> okay
17:44:20FromDiscord<Rika> actually maybe gcsafe too would help
17:52:24FromDiscord<cynahc> Is there a pragma to selectively disable bounds checks by proc?
17:57:17FromDiscord<haxscramper> No, bound checks are placed in implementations of `[]` & other `seq` procs
17:58:01FromDiscord<haxscramper> I've seen example of casting `seq` to underlying implementation
17:58:16FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tbX
17:58:44FromDiscord<haxscramper> IIRC it is different for new and old runtime
17:58:54FromDiscord<haxscramper> Why do you want to disable them/
18:00:35FromDiscord<cynahc> I was playing around with benchmarking some different memory alignment options in the ECS fashion. I know there's the compiler flags to disable them. I also found `{.push boundChecks:on.}` in the tests.
18:18:42*pro1 joined #nim
18:22:27*pro1 is now known as pro
18:27:12*maxime_ quit (Ping timeout: 250 seconds)
18:54:57*maxime_ joined #nim
19:22:12*g42x quit (Quit: Client closed)
19:39:39*carmysilna joined #nim
19:45:02FromDiscord<@bracketmaster-5a708063d73408ce4> I have a weird I allow the arg type to be `int or uint` and I need to check within the procs body whether or not I passed in int or uint
19:45:05FromDiscord<@bracketmaster-5a708063d73408ce4> how might I go about this
19:45:20FromDiscord<@bracketmaster-5a708063d73408ce4> a solution that does the check statically(at compile time) is fine
19:47:56FromDiscord<@bracketmaster-5a708063d73408ce4> `is` seems to do what I want here
19:48:02FromDiscord<Rika> `when it is int`
19:48:25FromDiscord<Rika> the check will always be at compile time
19:48:43FromDiscord<Rika> its just a matter of if you use runtime if or compiletime when
19:48:55FromDiscord<@bracketmaster-5a708063d73408ce4> first time I'm hearing of `when`
19:49:05FromDiscord<Rika> ? really
19:49:05FromDiscord<Rika> how
19:49:12FromDiscord<@bracketmaster-5a708063d73408ce4> found it
19:49:13FromDiscord<@bracketmaster-5a708063d73408ce4> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
19:49:16fn<Prestige99> Isn't it in the 1st tutorial
19:49:18FromDiscord<@bracketmaster-5a708063d73408ce4> well, I always used if
19:49:26FromDiscord<@bracketmaster-5a708063d73408ce4> it may have been
19:49:36FromDiscord<@bracketmaster-5a708063d73408ce4> I did do the tutorials - perhaps I"m forgetful
19:49:48fn<Prestige99> `when isMainModule` for instance
19:49:48FromDiscord<@bracketmaster-5a708063d73408ce4> https://nim-lang.org/docs/tut1.html#control-flow-statements-when-statement
19:49:54FromDiscord<@bracketmaster-5a708063d73408ce4> yup - you're right it was
19:50:05FromDiscord<@bracketmaster-5a708063d73408ce4> I never use that lol
19:50:20FromDiscord<@bracketmaster-5a708063d73408ce4> ALthough I've only been nimming officially for two months going on three now
19:52:16fn<Prestige99> It takes some time to learn, no worries
20:34:58FromDiscord<hiros> What are the known nim dialects?
20:35:14fn<Prestige99> dialects?
20:37:47FromDiscord<hiros> You know how with lisp for example there's racket, clojure, and scheme? But it's still lisp in nature? What are languages that are like that for nim?
20:43:02FromDiscord<carmysilna> new user here, but I think its just nim. Lisp is kind of special in that it has dialects, not many languages are like that
20:43:38FromDiscord<Rika> no one has made a dialect of nim yet i believe
20:43:49FromDiscord<Rika> there are similar languages but they arent forks of nim either
20:44:00FromDiscord<Rika> just "took inspiration"
20:44:54FromDiscord<Rika> indeed lisp is the exception in having dialects; thinking about C, it doesnt have as many dialects as lisp yet being much much much more popular
20:46:32FromDiscord<hiros> C is already pretty tiny to begin with. So not much you could do with a dialect of C that wouldn't become a new language entirely. It would be silly to think C++ is a C dialect.
20:49:57FromDiscord<Rika> i had whatever haskell was using in mind more
20:50:00FromDiscord<Rika> c--?
20:50:03FromDiscord<Rika> i dont know the name
20:51:41FromDiscord<InventorMatt> Nim with curly brackets could be considered a dialect
20:53:35FromDiscord<carmysilna> Its Cmm, I think, for, C minus minus
20:58:18*pro quit (Quit: WeeChat 3.2)
21:25:33*maxime_ quit (Quit: Leaving)
21:37:35*Vladar quit (Quit: Leaving)
21:39:35*carmysilna left #nim (#nim)
22:01:50*rockcavera joined #nim
22:01:50*rockcavera quit (Changing host)
22:01:50*rockcavera joined #nim
22:10:05FromDiscord<stu002> If I have a `proc` that accepts a proc parameter `proc (x: int, y:int): bool` do I always need to wrap the builtin `==` proc to pass it as a parameter?
22:12:17FromDiscord<ElegantBeef> I dont follow what you mean
22:12:37FromDiscord<ElegantBeef> if a proc you pass to a proc matches the type signature it'll let you pass it
22:16:30FromDiscord<theangryepicbanana> In reply to @ElegantBeef "if a proc you": I think they want to pass the `==` operation as a proc
22:16:40FromDiscord<theangryepicbanana> I think you could do that by putting the operator in backticks
22:19:20FromDiscord<ElegantBeef> Nah some operators cannot be passed due to using compiler magic iirc
22:19:31FromDiscord<ElegantBeef> So yea for primitives you need to wrap them afaik
22:20:47FromDiscord<stu002> Thanks -- the backticks approach didn't work and I started to suspect that `==` was special somehow
22:23:04FromDiscord<stu002> Target function was `func is_equal(eq: proc (x: int, y: int): bool, a: int, b: int): bool = eq(a, b)`
22:23:36FromDiscord<stu002> And the call `is_equal(``==``, 12 ,42)`
22:23:47FromDiscord<stu002> Only with single backticks
22:25:04FromDiscord<stu002> But this did work: `is_equal((x: int, y: int) => x == y, 12, 42)`
22:37:14FromDiscord<jfmonty2> `when` is basically compile-time `if`, right? So in a macro or const assignment, can they be used interchangeably?
22:38:09FromDiscord<juan_carlos> when does not open a new scope, if does.
22:38:29FromDiscord<jfmonty2> ah
22:57:45*rockcavera quit (Remote host closed the connection)
23:25:29FromDiscord<dom96> Anyone familiar with VS Code know how to see what the extensions are running?
23:29:46FromDiscord<dom96> nvm
23:45:49FromDiscord<dom96> damn dimscord is really nice
23:46:07FromDiscord<dom96> well done @krisppurg and all contributors 🙂
23:55:47fn<Prestige99> yeah it's great