<< 05-06-2020 >>

00:05:45*skrylar[m] quit (Ping timeout: 246 seconds)
00:06:01*skrylar[m] joined #nim
00:06:27*dzamo[m] quit (Ping timeout: 246 seconds)
00:06:31*khanate[m]0 quit (Ping timeout: 252 seconds)
00:06:31*GitterIntegratio quit (Ping timeout: 252 seconds)
00:08:46*dzamo[m] joined #nim
00:08:51*thomasross quit (Remote host closed the connection)
00:09:13*thomasross joined #nim
00:11:21*anti[m] quit (Ping timeout: 246 seconds)
00:11:28*BitPuffin quit (Ping timeout: 246 seconds)
00:12:22*khanate[m]0 joined #nim
00:12:48*anti[m] joined #nim
00:19:02*BitPuffin joined #nim
00:22:08*nekits quit (Quit: The Lounge - https://thelounge.chat)
00:23:06*nekits joined #nim
00:25:49*waleee-cl quit (Quit: Connection closed for inactivity)
00:27:59PrestigeI'm wrapping a c function with variadic args, how would I go about doing this since the type is not known?
00:30:28YardanicoPrestige: https://forum.nim-lang.org/t/373
00:30:35Yardanicovarargs pragma basically
00:30:59Yardanicohttps://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma
00:32:17PrestigeThanks Yardanico
00:33:10PrestigeConverting this function: https://0x0.st/iO6P.txt
00:33:22PrestigeNot sure how to handle the macro at the end. Not familiar with C at all, really
00:35:09*bung quit (Ping timeout: 246 seconds)
00:39:13YardanicoPrestige: _X_SENTINEL just checks at compile-time that a parameter at index passed to _X_SENTINEL is null
00:39:40FromDiscord<Zachary Carter> does it? I just googled and saw - `# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))`
00:39:44FromDiscord<Zachary Carter> although I don't know what that attribute does
00:39:47Yardanicoit does what I said
00:39:53Yardanico"This function attribute ensures that a parameter in a function call is an explicit NULL. The attribute is only valid on variadic functions. By default, the sentinel is located at position zero, the last parameter of the function call. If an optional integer position argument P is supplied to the attribute, the sentinel must be located at position P counting backwards from the end of the argument list."
00:39:53PrestigeYardanico: so to wrap the function do I need to do anything?
00:39:59FromDiscord<Zachary Carter> but you could add that attribute to the proc with `codegenDecl`
00:40:10FromDiscord<Zachary Carter> gotcha
00:40:14YardanicoPrestige: yeah, just add varargs and you're good to go
00:40:21Yardanicoand call that function with first argument as nil
00:40:22Prestigeah cool, thanks
00:48:58*bung joined #nim
00:50:12*planetis[m] quit (Ping timeout: 246 seconds)
00:50:54*anti[m] quit (Ping timeout: 246 seconds)
00:51:13*planetis[m] joined #nim
00:51:37*anti[m] joined #nim
01:11:03*chemist69 quit (Ping timeout: 252 seconds)
01:12:58*chemist69 joined #nim
01:15:13*arecaceae quit (Remote host closed the connection)
01:16:07*arecaceae joined #nim
01:18:58*konvertex quit (Ping timeout: 272 seconds)
01:31:58*zacharycarter quit (Ping timeout: 256 seconds)
01:48:29*Jesin joined #nim
01:52:45*rockcavera quit (Remote host closed the connection)
01:53:16*rockcavera joined #nim
02:20:18*muffindrake quit (Ping timeout: 260 seconds)
02:20:37*theelous3 quit (Read error: Connection reset by peer)
02:22:18*muffindrake joined #nim
02:43:18*tiorock joined #nim
02:43:18*tiorock quit (Changing host)
02:43:18*tiorock joined #nim
02:43:18*rockcavera quit (Killed (niven.freenode.net (Nickname regained by services)))
02:43:18*tiorock is now known as rockcavera
02:47:49FromDiscord<Technisha Circuit> Are there any options to speed up the time it takes to compile a file using the C backend?
02:48:32disruptekccache?
02:48:58FromDiscord<Technisha Circuit> After the code has been changed :p
02:49:10FromDiscord<Technisha Circuit> Or is that a no?
02:55:43disrupteksometimes an option like -pipe can speed up c compilation. maybe upgrade your compiler or switch clang/gcc?
02:56:08disruptekit's basically out of our hands after we hand it off to the c compiler.
02:56:55disruptekwhat kinda time are we talking, here, anyway?
03:06:14*rockcavera quit (Remote host closed the connection)
03:09:43*rockcavera joined #nim
03:12:18*chemist69 quit (Ping timeout: 246 seconds)
03:13:19*chemist69 joined #nim
03:23:17FromDiscord<Technisha Circuit> Thanks :p
03:23:51FromDiscord<Technisha Circuit> It's quite quick but I'm compiling on my android :/
03:24:04FromDiscord<Technisha Circuit> Because I don't have access to any other device i could code on
03:24:11FromDiscord<Technisha Circuit> (Also mobile coding ftw)
03:37:17FromDiscord<treeform> You can try using tcc, its very fast at compiling but it does not produce optimal code.
03:37:46FromDiscord<treeform> Its also pretty limit and might only work for toy programs.
03:40:08FromDiscord<treeform> Oh I don't think tcc supports Android
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:30voltistSo did that idea for an official Nim youtube/streaming thing ever come to fruition?
04:06:41*supakeen joined #nim
04:07:50shashlickHey @voltist you figured out those issues?
04:07:59voltistNo still having them
04:08:03voltistDetails on the gitter
04:21:31*rockcavera quit (Remote host closed the connection)
04:32:29voltistI'm skeptical of nim's zlib library
04:33:06voltistInflating should never reduce 10+ byte data to a single byte
04:33:22voltistRight?
04:38:58FromDiscord<treeform> well no, if your data is already random zlib can actually make it bigger.
04:39:24FromDiscord<treeform> so like zipping jpgs, pngs, mpegs only would make them bigger
04:39:39FromDiscord<treeform> zlib works great for text, as text is usually not very random
04:40:08FromDiscord<treeform> also zlib algorithm is like 20 years old, I highly recommend speedy instead if you control both sides.
04:40:57FromDiscord<treeform> sorry I meant snappy not speedy... https://github.com/status-im/nim-snappy
04:41:56voltist@treeform I'm writing a png decoder so I need to use zlib unfortunately
04:46:46shashlickSee the zlib wrapper in nimterop tests
04:47:13voltistAce thanks
04:47:55voltistshashlick: I'll try not to juggle between the two projects too much ;)
04:52:14*dddddd quit (Ping timeout: 240 seconds)
04:53:03shashlickThere's a zlib wrapper in nimarchive as well but it doesn't actually wrap the api
04:53:10shashlickYou might need a combo of both
04:55:47*D_ quit (Ping timeout: 240 seconds)
04:56:04*D_ joined #nim
05:03:26FromDiscord<Zed> with arraymancer, is all array manipulation automatically done on the gpu? or do i have to initialise it to run on the gpu?
05:03:39*lritter joined #nim
05:04:32Yardanicoread the readme
05:04:32leorize[m]you usually will have to do some initialization
05:04:35Yardanicoalso "-d:cuda: Build with Cuda support"
05:05:07leorize[m]well try not to make all operations run on the gpu :P
05:05:12leorize[m]offloading is not really all that fast
05:05:23FromDiscord<Zed> yeah i just saw them after posting, i dont know why i couldn't see them before 😛
05:08:54FromDiscord<Elegant Beef> So leorize im currently at the point of cloning my x11 windoow
05:08:56FromDiscord<Elegant Beef> (edit) 'windoow' => 'window'
05:09:08FromDiscord<Elegant Beef> Im so great at this terminal bodging thing
05:09:43leorize[m]so you figured out how to use pt?
05:10:15FromDiscord<Elegant Beef> Nope
05:11:09FromDiscord<Elegant Beef> I learned how to get weird behaviour
05:11:16leorize[m]lol
05:11:48FromDiscord<Elegant Beef> Also was it you getting xorg memory leaks?
05:12:56leorize[m]yea
05:13:07FromDiscord<Elegant Beef> Ah im in that club now
05:13:26leorize[m]lol
05:16:36leorize[m]so what's your current issue with pt?
05:19:29FromDiscord<Elegant Beef> At the moment reading from master and not cloning the process
05:20:47FromDiscord<Elegant Beef> Thi is my current process
05:20:54FromDiscord<Elegant Beef> And doing this makes two processes
05:21:07FromDiscord<Elegant Beef> Rather duplicates my window
05:21:16FromDiscord<Elegant Beef> https://hatebin.com/sjbhyubbfr
05:22:19Yardanicowell you need to detect if you're in a fork and don't run any WM code in the fork then
05:22:23Yardanicoalso why do you need to run PTY in the WM?
05:22:36Yardanicoi mean not as a separate program like a terminal emulator, but built-in into the WM
05:22:54FromDiscord<Elegant Beef> in the WM?
05:22:56FromDiscord<Elegant Beef> What WM?
05:22:59Yardanico?
05:23:05Yardanicoyou want a terminal emulator in nim?
05:23:11FromDiscord<Elegant Beef> yes
05:23:45Yardanicoand why do you need to fork?
05:24:31FromDiscord<Elegant Beef> Cause i'm making a termina emulator, and forking seems to be what im see to do
05:24:37FromDiscord<Elegant Beef> I know absoulutely nothing here
05:24:38Yardanicoi found some nim terminal emulator and it uses threads for that
05:24:44FromDiscord<Elegant Beef> Im just eading things like edunim and it forks
05:24:47FromDiscord<Elegant Beef> reading
05:24:53FromDiscord<Elegant Beef> eduterm*
05:25:10Yardanicoalso see https://github.com/treeform/vt100terminal
05:25:13leorize[m]Yardanico: uhmm you need to fork so you can launch the process that use the created pseudoterm?
05:25:36Yardanicohmm
05:25:46Yardanicoalso ignore my vt100terminal link
05:26:18leorize[m]that one can still be useful to implement the actual emulating part of the terminal emulator :P
05:26:42Yardanicoalso https://linux.die.net/man/4/ptmx
05:27:00FromDiscord<Elegant Beef> Yea i've read the man pages
05:27:05Yardanicothis one is about ptmx
05:27:07leorize[m]also you're using execle wrong
05:27:54FromDiscord<Elegant Beef> How
05:28:18Yardanicowhy do you pass /bin/bash as the argument?
05:28:32FromDiscord<Elegant Beef> Cause im mostly reading eduterm and copying it
05:28:34YardanicoI think you just need to pass "bash"
05:28:38leorize[m]it needs a nil parameter at the end
05:28:39leorize[m]Yardanico: argv0
05:28:51FromDiscord<Elegant Beef> execle in posix only has two strings
05:29:03FromDiscord<Elegant Beef> > proc execle*(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>", sideEffect.}
05:29:06leorize[m]also execle don't search the PATH
05:29:15leorize[m]{.varargs.}
05:29:15Yardanicoleorize[m]: I meant the second argument, not the first
05:29:33Yardanico@Elegant look at the man page for execle :)
05:29:33leorize[m]still argv0 :P
05:29:45Yardanicoleorize[m]: ?
05:29:54Yardanicodefinition for execle is
05:29:54Yardanicoint execle(const char *path, const char *arg, ..., char * const envp[]);
05:30:07leorize[m]I mean that it doesn't matter if it's /bin/bash or bash :P
05:30:35Yardanicomaybe it matters to some programs?
05:31:02leorize[m]nope
05:31:02leorize[m]POSIX have no regulation on argv[0]
05:31:29leorize[m]well some program do use argv[0] as a mean to determine what version of itself should be launched
05:31:30leorize[m]but bash is not one of them
05:32:13FromDiscord<treeform> voltist, have you seen https://github.com/jangko/nimPNG
05:32:32FromDiscord<treeform> I think he made his own zlib decoder.
05:33:07Yardanicooh yeah, https://github.com/jangko/nimPNG/blob/master/nimPNG/nimz.nim
05:33:14Yardaniconice never knew this existed
05:34:12voltistYeah it's a good start but "pixels are stored as raw bytes using Nim's string as container"
05:34:20Yardanicoso?
05:34:27voltistI may as well wrap a c library that can read/write all sorts of image formats
05:34:30Yardanico???
05:34:34voltistWhich is what I will do
05:34:49*narimiran joined #nim
05:35:36leorize[m]!package stb_image
05:35:39disbothttps://gitlab.com/define-private-public/stb_image-Nim -- 9stb_image: 11A wrapper for stb_image and stb_image_write.
05:35:42Yardanicothere's really no difference between seq[char] and string at the end of the day (I mean data structure-wise)
05:36:12Yardanicoboth are same len, cap, data
05:36:34leorize[m]you can shorten it to: you can cast between the two and it wouldn't be wrong :P
05:36:43Yardanicooh right, that too
05:37:28voltistI'm going for something more like python's pillow thats all
05:37:29leorize[m]you also have `toOpenArrayByte()` which can slice any string into an openArray[byte]
05:37:29voltistWith lazy high-level stuff
05:38:01voltistSo I may as well wrap something myself rather than wrapping a wrapper, if you get what I mean?
05:38:04Yardanicohttps://github.com/SolitudeSF/imageman ?
05:38:13Yardanicocan use stb_image
05:38:18leorize[m]!repo flippy
05:38:19disbothttps://github.com/treeform/flippy -- 9flippy: 11Flippy is a simple 2d image and drawing library. 15 35⭐ 6🍴
05:38:25Yardanicoor that
05:38:30Yardanicohonestly never tried any of them so don't know the difference
05:39:11leorize[m]I've only ever used gdk-pixbuf in Nim :P
05:39:54voltistI have tried to use them, which is why I'm making something else :)
05:39:57voltistNot that they are bad
05:40:04voltistJust not what I would want to use
05:40:16FromDiscord<Elegant Beef> So with that code i linked is it expected to have an duplicate application launch?
05:40:45leorize[m]nope
05:40:51Yardanicolemme see eduterm
05:40:52FromDiscord<Elegant Beef> Cause this is what happens https://media.discordapp.net/attachments/371759389889003532/718338525245866054/unknown.png
05:41:00FromDiscord<Elegant Beef> https://www.uninformativ.de/git/eduterm/file/eduterm.c.html
05:41:01leorize[m]you likely messed up since you missed the `nil` part at the end
05:41:30FromDiscord<Elegant Beef> Even with nil it does the same thing
05:41:32voltistOh gee something is well stuffed with my system
05:41:35voltistfatal error: cstdio: No such file or directory
05:41:53Yardanicocstdio is from C++
05:42:04YardanicoC*
05:42:16voltistOh huh
05:42:17Yardanicofsck
05:42:18Yardanicoit's from C++
05:42:21leorize[m]@Beef I will need to see the full code for that
05:42:22Yardanicobut stdio.h is for C
05:42:24voltistThat'd by why
05:42:26Yardanicoleorize[m]: https://www.uninformativ.de/git/eduterm/file/eduterm.c.html
05:42:34Yardanicoah right
05:42:36Yardanicoyou mean his tool
05:42:46leorize[m]I'm talking about the Nim version he wrote :P
05:43:37FromDiscord<Elegant Beef> https://github.com/beef331/cluiconsole/blob/refactor/src/cluiconsole.nim
05:43:43leorize[m]oh this code is like old old
05:43:43leorize[m]it uses select()
05:44:03FromDiscord<Elegant Beef> It's all greek to me
05:44:13Yardanicoleorize[m]: it's not old, but author used the old style I guess :P
05:44:18Yardanicoa person created it in 2018
05:44:26Yardanicohttps://www.uninformativ.de/git/eduterm/commit/94cbafa06db99c5deb7d13b046b06d2604a454a1.html
05:45:45leorize[m]@Beef without seeing the Nim code I can't really say much about the issue
05:45:51Yardanicohe linked nim code
05:45:53FromDiscord<Elegant Beef> I literally linked it
05:45:55FromDiscord<Elegant Beef> 😄
05:46:06leorize[m]oh do you know that execve() can actually fail? :)
05:46:27YardanicoI think your issue is due to the fact that you're using glfw or something
05:46:32*kenran joined #nim
05:46:34FromDiscord<Elegant Beef> Ah
05:46:37Yardaniconot sure exactly
05:47:01Yardanico"The child process is an exact duplicate of the parent process except for the following points"
05:47:21Yardanicoso maybe the child process then continues to run glfw too or something
05:47:30leorize[m]shouldn't be a problem
05:47:31Yardanicoisn't there another way instead of forking for that?
05:47:51leorize[m]execve replaces the process
05:47:54FromDiscord<Elegant Beef> Look at my initpty proc and look at this output https://media.discordapp.net/attachments/371759389889003532/718340296282472528/unknown.png
05:48:05FromDiscord<Elegant Beef> I call initialize pty once
05:48:20FromDiscord<Elegant Beef> yet it goes through it twice
05:48:20leorize[m]@Beef also execle requires one more param: the environment variable list
05:49:06Yardanicoyeah @Beef see https://www.uninformativ.de/git/eduterm/file/eduterm.c.html#l291
05:49:11Yardanicowhere env is char *env[] = { "TERM=dumb", NULL };
05:49:31leorize[m]@Beef and uh, the output looks correct?
05:49:50leorize[m]fork... well fork your process into two
05:50:14FromDiscord<Elegant Beef> Ah that makes sense
05:50:32FromDiscord<Elegant Beef> Same state, so the one will get 1 whilst other gets 0
05:51:13leorize[m]one will get the child pid
05:51:13leorize[m]the other gets 0
05:54:27FromDiscord<Elegant Beef> How should i do this then?
06:04:08*silvernode joined #nim
06:12:52*xet7 quit (Remote host closed the connection)
06:20:55silvernodePrestige, I got it working the way I wanted https://play.nim-lang.org/#ix=2okD
06:20:56*PMunch joined #nim
06:21:35FromDiscord<Elegant Beef> Did you see my rendition of it?
06:21:44silvernodeI did not
06:23:40FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2okF
06:25:40silvernodeWow, that's more of what I was looking for. Really nicely done.
06:26:02silvernodeNow I have to dissect it
06:26:57silvernodeI like the use of a type with the event property
06:27:21skrylar[m]so i tried to write a little mud server with async+arc and.. broke the compiler entirely ._.
06:27:32silvernodeThis is more like what an adventure game would be written
06:27:58silvernodeLogging into discord as mollusk
06:29:08silvernodeskrylar[m], that's a bummer
06:30:15FromDiscord<mollusk> Logged into discord so I can reply to people here properly
06:30:26FromDiscord<Elegant Beef> Well ti's the same thing to me 😄
06:30:33FromDiscord<Elegant Beef> (edit) 'ti's' => 'it's'
06:32:04FromDiscord<mollusk> @Elegant Beef same thing?
06:32:23FromDiscord<Elegant Beef> yea
06:32:27FromDiscord<Elegant Beef> You can at from irc
06:32:42FromDiscord<Elegant Beef> Yards bot is super smart
06:32:45FromDiscord<Elegant Beef> atleast 2 iq
06:33:36skrylar[m]silvernode: yea it crashes all the way to the 'run koch to debug' stage. and if i remove some of the macros and do echos, it looks like it still posts events in my mailbox system but the strings have the correct length and all zeroes forcontent oddly enough
06:34:35FromDiscord<mollusk> @Elegant Beef I was wondering if that was possible from ric
06:35:07FromDiscord<mollusk> no auto complete doing @ on IRC though
06:35:15FromDiscord<Elegant Beef> true
06:35:19FromDiscord<Elegant Beef> anywho
06:35:42FromDiscord<Elegant Beef> You can make your entire menu system in json or toml if you so wished
06:36:02silvernode@skrylar[m], a mud server would be an awesome thing to write in Nim though.
06:36:26FromDiscord<Elegant Beef> A gpu based terminal emulator would be too, but seems im overly daft 😄
06:36:26skrylar[m]silvernode: eh. trying to figure out how to package this code up for a bug report
06:36:53silvernode@Elegamt_Beef does this work?
06:37:03FromDiscord<Elegant Beef> Helps if you put the proper characters
06:37:29silvernodeThe name is different on discord vs irc
06:37:38FromDiscord<Elegant Beef> You put an m in
06:38:10silvernodeNot sure I follow
06:38:26FromDiscord<Elegant Beef> You wrote "Elegamt_Beef" i do not have an m in my name
06:38:52skrylar[m]FromDiscord: but most of that is just going to be boring old vt100 shit
06:38:53silvernodeoops
06:39:04FromDiscord<Elegant Beef> Well not true
06:39:13silvernodeSmall font, bad eyes I suppose
06:39:14FromDiscord<Elegant Beef> I planned on having fancy stuff
06:39:20skrylar[m]getting the terminal cells to the gpu is just a bunch of quads :f
06:39:38silvernode@Elegant_Beef how about this?
06:39:42FromDiscord<Elegant Beef> Oh i know that, but using a gpu instead of pure text gives you abillity to do more things
06:39:48FromDiscord<Elegant Beef> Think the underscore is an issue
06:39:52FromDiscord<Elegant Beef> as my name doesnt have one
06:40:03FromDiscord<Elegant Beef> With a space or ElegantBeef might
06:40:26silvernodeI put that there since I figured it would substitute for the space on irc or something
06:40:34silvernode@Elegant Beef how about this?
06:40:38FromDiscord<Elegant Beef> There you go
06:40:52silvernodehmm, I really thought the space would screw it up
06:41:01silvernodeused to terminals
06:41:02FromDiscord<Elegant Beef> Well comically yard replaces only the first word
06:41:21FromDiscord<Elegant Beef> so it shows up as `@my name` beef
06:43:11silvernode@Elegant Beef anyway I really like that code for the menu. I should learn how to parse files like json though. In all these years programming, I still have not found an intuitive way for me to understand how to parse files, even with "easy" libraries
06:43:55FromDiscord<Elegant Beef> I believe there is a json library with pragmas you can mark fields with so you can go `jsonParse(node,type)`
06:43:59FromDiscord<Elegant Beef> And it'll automagically parse it
06:44:45FromDiscord<Elegant Beef> I mean it's rather simple to parse files since you dont have to manually write string to object part
06:44:52FromDiscord<Elegant Beef> (edit) 'I mean it's rather simple to parse files since you dont have to manually write ... string' => 'I mean it's rather simple to parse files since you dont have to manually writethe'
06:45:38silvernodesounds like something fun to play with. Not sure I would need to put the menu contents in a file though
06:45:47FromDiscord<Elegant Beef> Nah probably dont
06:49:23silvernodeTime to go clock into work. Thanks for the conversation, I'll be back around this time tomorrow before work starts. I try to get in a little code every day. cheers!
06:54:11*silvernode quit (Ping timeout: 246 seconds)
07:07:38*Trustable joined #nim
07:34:23*opal quit (Ping timeout: 240 seconds)
07:49:31*opal joined #nim
08:16:45*Tlanger joined #nim
08:18:54*Tongir quit (Ping timeout: 240 seconds)
08:22:40endragorDoes having an object with (virtual) methods produce cyclic references? I have an empty object that gets collect only in mark and sweep phase. But it's inherited from another one and has virtual methods.
08:23:00FromDiscord<Rika> Virtual methods?
08:23:03endragorThat is on old version of Nim, so things might be different on latest.
08:23:06FromDiscord<Rika> As in methods?
08:23:22FromDiscord<Rika> Is there a reason you're on such an old version
08:23:30endragoryes, methods, in Nim terminology. decided to clarify so that people don't confuse it with procedures
08:23:42endragorRika: yes, there is
08:24:16FromDiscord<Rika> I'd like to know
08:25:17Araqendragor, for object with enabled inheritance we assume it's cyclic
08:25:33Araqsince we don't know the inherited fields
08:25:57Araqbut if at runtime it's acyclic, the refcount'ing GC should collect it anyway
08:27:02endragorAraq: thanks for clarifying! Will see how it works on latest, maybe there is a fix I should cherry-pick
08:29:49*Senketsu joined #nim
08:35:11Araqthere were fixes for --gc:boehm but I don't remember fixes for the default GC
08:46:37PMunchendragor, how old of a version are you using?
08:48:50*zacharycarter joined #nim
08:49:28*neceve_ joined #nim
08:49:36endragorPMunch: 0.18.1. This issue doesn't appear on an isolated test case though, so something else seems to be involved. dumpNumberOfInstances reports only count of single type growing, which looks as if it references itself, but it's empty. Still investigating.
08:50:16*Vladar joined #nim
08:57:55FromDiscord<dayl1ght> I'm trying to use valgrind with nim
08:58:12FromDiscord<dayl1ght> I have code that manually does allocations using `alloc0` but valgrind isn't detecting anything
08:58:34Araqcompile with -d:useMalloc --gc:arc
08:58:59FromDiscord<dayl1ght> is --gc:arc needed for valgrind to detect leaks?
09:00:27Araqno, -d:useMalloc is
09:00:37Araqbut it works much better with --gc:arc
09:01:57FromDiscord<dayl1ght> hmm, isn't this supposed to leak? https://play.nim-lang.org/#ix=2okY
09:02:05FromDiscord<dayl1ght> I'm getting 0 bytes leaked with -d:useMalloc and --gc:arc
09:02:42Araqyup, leaks.
09:03:01FromDiscord<dayl1ght> but if I change test() to test()[], it says 16 bytes leaked
09:03:06FromDiscord<dayl1ght> weird
09:03:36Araqsounds like a valgrind issue
09:04:34FromDiscord<dayl1ght> 😦 i'll try some alternatives
09:04:44FromDiscord<dayl1ght> thanks for the help
09:05:17Araqupdate it
09:06:18FromDiscord<dayl1ght> I'm running the latest version from git head 😄
09:06:37Araqlatest valgrind version?
09:06:41FromDiscord<dayl1ght> but it's a macos fork https://github.com/LouisBrunner/valgrind-macos
09:06:47FromDiscord<dayl1ght> yep
09:07:11Araqwell it sounds like a regression, my osx valgrind is fine
09:07:29FromDiscord<dayl1ght> does it detect the leak on the code I sent above?
09:09:58FromDiscord<dayl1ght> it seems very flakey
09:10:20FromDiscord<dayl1ght> e.g. if I use proc main() = instead of when isMainModule, the leaks are shown
09:11:06Araqbecause then the memory isn't bound to a global
09:11:21FromDiscord<dayl1ght> and even with proc main(), leaks are only detected with --gc:arc
09:11:42AraqI think valgrind tries to only report "real" leaks aka non-reachable memory
09:12:02Araqif you assign it to a global, it remains reachable
09:13:52Araqvalgrind --leak-check=full --show-leak-kinds=all
09:13:57Araqdoes detect it
09:14:05Araqon my machine
09:14:18Araqit's reliable
09:17:32FromDiscord<dayl1ght> yeah, seems to work for me too
09:17:35FromDiscord<dayl1ght> but only with --gc:arc
09:18:03FromDiscord<dayl1ght> thank you 🙂
09:18:07Araqso what. --gc:arc is what you should use for new developments
09:19:53FromDiscord<dayl1ght> well, it doesn't work with cycles
09:20:19FromDiscord<mratsim> use --:orc
09:20:31FromDiscord<mratsim> They don't have cycles but they have axes
09:20:47Zevvwait, couldn't we build something in arc to detect cycles, and then offload to orc when it does?!
09:21:28AraqZevv, yeah, kind of.
09:21:43Zevvdude I was trolling, and now you're taking me serious here?!
09:21:55Araqwe can default to --gc:orc and strip out the unused tracing procs in a pre-linking step
09:22:19FromDiscord<mratsim> that sounds good
09:22:27FromDiscord<mratsim> isn't that type bound anyway
09:22:41Araqit is
09:22:49FromDiscord<mratsim> we know on type declaration which types can introduce cycles or not
09:23:03FromDiscord<mratsim> so gc:ord should have no overhead for types that can't have cycles
09:23:03Zevvah right
09:23:32Araqthat's true today already but iirc the tracing procs are not optimized out
09:23:45Araqand the C compiler has a hard time to strip them out
09:24:07FromDiscord<mratsim> when canHaveCycles(T): insertTracingProc()
09:24:47Araqyes, it's hard to do with today's compiler. but easy as a postprocessing step
09:41:07*tribly quit (Quit: WeeChat 2.8)
09:48:49*zacharycarter quit (Ping timeout: 272 seconds)
09:48:56*Vladar quit (Quit: Leaving)
09:49:49*zacharycarter joined #nim
09:55:30*tribly joined #nim
09:56:38*oculuxe joined #nim
09:58:49*oculux quit (Ping timeout: 256 seconds)
10:01:26*zacharycarter quit (Ping timeout: 260 seconds)
10:02:15*konvertex joined #nim
10:13:56skrylar[m]slightly amused at how lambdamoo is basically the nodejs of 1995
10:15:44*letto quit (Quit: Konversation terminated!)
10:16:30*letto joined #nim
10:22:08*dddddd joined #nim
10:35:03*Senketsu quit (Ping timeout: 246 seconds)
10:42:16*alehander92 is now known as alexander92
10:42:24*alexander92 is now known as alehander92
10:42:41alehander92morning!
10:44:09FromDiscord<willyboar> hello alehander92
10:45:11alehander92hello brother
10:46:22FromDiscord<willyboar> best hour of the day
10:54:07*Vladar joined #nim
10:54:45PMunchHmm, is there a way to detect from a template if you're the last thing in the scope?
10:55:19PMunchI have a template in an iterator and I want it to not call `yield` if it is the last thing, because otherwise the iterator won't be considered finished and called again just to do nothing.
11:00:38PMunchOr a way for an iterator whose last statement is a yield to consider itself done, that would also work
11:04:41Araqinside a macro you can analyse for that, PMunch
11:05:16FromDiscord<Zed> Does nim have any libraries for accessing device specs? ram, cpu etc..
11:05:49FromDiscord<Zed> I cant seem to find anything that does it
11:07:00PMunchAraq, how? Only thing I can think of is instantiationInfo and reading the file manually, but that is super ugly..
11:07:01Araqthere is cpuinfo
11:07:11*Guest42240 quit (Ping timeout: 265 seconds)
11:07:19*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:07:22AraqPMunch, my bad
11:08:04*dadada joined #nim
11:08:29*dadada is now known as Guest86599
11:09:19FromDiscord<Zed> Araq: How well do you know nim as the creator?
11:09:20PMunch@Zed, there's this: https://nimble.directory/pkg/psutil
11:09:30*krux02 joined #nim
11:09:44PMunch@Araq, what do you mean "my bad"?
11:09:54AraqPMunch, I misread your question
11:10:02alehander92did sublime invent commandP
11:10:10FromDiscord<Zed> thanks PMunch!
11:11:23*pbb joined #nim
11:12:26PMunchAraq, ah, so it's not possible then?
11:12:55AraqZed: good question, 90% ?
11:13:15AraqPMunch, yeah, doesn't look possible
11:14:20PMunchAnd no way to make iterators that yields as their last action to be considered finished either I assume?
11:15:53FromGitter<bung87> !repo ps_utils
11:15:56disbothttps://github.com/Stephanevg/PSClassUtils -- 9PSClassUtils: 11A set of utilities to work with Powershell Classes 15 49⭐ 15🍴 7& 29 more...
11:16:06FromGitter<bung87> wrong again
11:16:33AraqPMunch, there is system.finished
11:16:48PMunchYeah, to check if it is finished
11:17:18FromGitter<bung87> https://github.com/johnscillieri/psutil-nim
11:18:04FromGitter<bung87> @Zed does it fit your needs ?
11:18:56PMunchAraq: https://play.nim-lang.org/#ix=2oli <- This is my issue
11:19:22PMunchBasically having a `yield` as the last thing requires you to call the iterator once more before it is considered done
11:21:52FromDiscord<Zed> bung87: current build is failing on osx, seeing if it's a simple fix other wise ill stick it on the back burner
11:22:24FromGitter<bung87> oh , yeah maintained in another repo , I forgot that
11:23:30FromGitter<bung87> https://github.com/juancarlospaco/psutil-nim I patched the OS X version
11:24:07FromDiscord<Zed> Thanks! ill test it out now
11:32:49FromDiscord<Zed> hmm still getting the same error on build
11:33:36FromGitter<bung87> um hold on, let me check
11:36:25*monokrom joined #nim
11:42:06FromGitter<bung87> I got `error: unable to open output file '/Users/bung/.cache/nim/psutil_macosx_d/stdlib_strutils.nim.c.o': 'Operation not permitted'`
11:43:21FromDiscord<Zed> are you building from source or installing with nimble?
11:43:40FromGitter<bung87> building from source
11:44:56FromGitter<bung87> installation is just fine
11:45:37AraqPMunch, that's a known problem and I consider it un-fixable
11:45:49Araqas we only know the iterator is over one step after the fact
11:45:55FromDiscord<Zed> im installing with nimble, when building the project im getting↵`Error: cannot export: net_if_stats`
11:46:29FromDiscord<Zed> and an int to int32 error whch i fixed
11:46:53FromGitter<bung87> no net_if_stats proc_connections for macos
11:47:31FromGitter<bung87> see the source comment, I really tried but it didn't work out...
11:47:41FromDiscord<Zed> i wonder why it's throwing up errors then?
11:50:40*Tlanger quit (Quit: Leaving)
11:55:24FromGitter<bung87> you have Xcode or developer tools installed ?
11:58:49PMunchAraq, hmm okay. Guess my fibers will be stuck with an extra iteration then
11:59:15Araqasync does it the same way, it's fine
12:00:33*PMunch quit (Quit: leaving)
12:05:35*rockcavera joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:37*supakeen joined #nim
12:10:13*bjornroberg joined #nim
12:10:55FromDiscord<Kiloneie> Here we go, the first video on my new video series(after the intro one), please tell me your thoughts on this format etc...↵https://youtu.be/WugYWc_IEWs
12:10:58FromGitter<bung87> @Zed check mine patch https://github.com/bung87/psutil-nim
12:11:04*fredrikhr joined #nim
12:11:13AraqKiloneie: do you show strscans?
12:12:50FromDiscord<Kiloneie> i've glossed over it a few times, and yes i know you requsted it about half a year ago as well as this morning, i will make it soon, i just need to cover templates beforehand and maybe some on macros some simple stuff so i can do the video
12:13:10Araqok :-)
12:13:38FromDiscord<Zed> thanks bung87, ill check it out!
12:14:37FromDiscord<Kiloneie> soon also SDL series, i really wanna play with that
12:15:18FromGitter<bung87> guess you maybe the second person runs it on macOS
12:17:13FromDiscord<Kiloneie> does anyone know if it's possible to install macOS on any non mac sold computer ? I wanna do a nim for beginner's intro video but for mac and linux one of these days, i've heard some difficulties about mac not playing nicely smthing smthing...
12:17:24FromDiscord<Zed> hackintsoh
12:17:30FromDiscord<Zed> *hackintosh
12:17:56FromDiscord<Zed> not all parts work with mac os which is a problem
12:18:08FromDiscord<Kiloneie> What do you mean ?
12:18:38FromDiscord<willyboar> it is not worth it
12:18:43FromGitter<bung87> have you tried https://github.com/sickcodes/Docker-OSX
12:19:56FromDiscord<Kiloneie> will that be identical for recording like it would be on a mac ?
12:20:13FromDiscord<Kiloneie> i just need it for a single video
12:20:27FromDiscord<Kiloneie> i have no inclination to use a macOS
12:20:29FromDiscord<Zed> maybe borrow a mac from a friend?
12:20:55FromDiscord<Kiloneie> noone has one... only iphones...
12:21:15FromDiscord<Kiloneie> windows ftw xD..
12:21:39FromDiscord<Rika> ~~buy one~~
12:21:45FromDiscord<Rika> i am joking for obvious reasons
12:21:58FromGitter<bung87> hackintosh maybe the easy solution.
12:22:06FromDiscord<Kiloneie> xD.... thats like buying a PC preassemled from a large computer store
12:22:15FromDiscord<Kiloneie> aka bloody 2x price ripoffs
12:22:17FromDiscord<Kiloneie> literally
12:22:42FromDiscord<Rika> buy it, use it for a day, then sell it back
12:23:04FromDiscord<Kiloneie> xD no thanks
12:23:19FromDiscord<Zed> you could buy a cheap mac mini
12:23:26FromDiscord<Zed> after your usage setup as a server
12:24:08FromDiscord<Kiloneie> idk i will try hackitosh i guess one day, linux sooner as it's the easiest thing to install ever
12:24:22FromDiscord<Kiloneie> although what linux distro should i even use for the video...
12:24:33FromDiscord<Kiloneie> Ubuntu ? what...
12:24:33FromDiscord<Zed> ubuntu
12:24:38FromDiscord<Zed> the most popular one
12:24:55FromDiscord<Kiloneie> does Visual Studio Code work there ?
12:25:00FromDiscord<Rika> why wouldnt it
12:25:03FromDiscord<Zed> yes
12:25:25FromGitter<bung87> its ubuntu and vscode
12:25:36FromDiscord<Kiloneie> okay thanks, i mean i kinda knew it should, but it's not always that open source stuff works everywhere
12:26:18FromGitter<bung87> believe microsoft.
12:26:56FromDiscord<Kiloneie> Microsoft is awesome, but also not, them moneys swing around fast
12:27:23alehander92yeah, a lot of stuff works on ubuntu
12:27:42alehander92i use it
12:27:57FromDiscord<Kiloneie> since microsoft did a 180 on their hate of open source lol
12:28:03FromGitter<bung87> free open source IDE what else you need....
12:28:05alehander92i don't know, windows is paid
12:28:14alehander92i don't really need it so much, so i prefer not to pay
12:28:28alehander92and linux seems to work fine, also its easier to understand/tweak
12:28:29FromDiscord<Kiloneie> who said you should pay for it 😛 ?
12:28:38alehander92well, dude, i didn't , but piracy sucks
12:28:57FromDiscord<Kiloneie> guess i am evil D:
12:29:04alehander92it's not like i still dont do it with movies , so guilty as charged
12:29:18FromDiscord<Kiloneie> probably owing them millions xD
12:29:19alehander92but i wish if i could not pirate software where possible
12:29:28FromDiscord<Kiloneie> i try that as well
12:29:41FromDiscord<Kiloneie> but not windows... it's embeded into my brainz xD
12:29:46alehander92of course, windows is hard to replace for many tasks sadly
12:29:51FromGitter<bung87> without windows how you play computer games
12:29:56alehander92but i'd say, try linux
12:30:09alehander92i dont feel the need to run windows in probably an year
12:30:28FromDiscord<Kiloneie> exactly... as a gamer yeah... i mean linux is getting better support for games... but even games made for windows don't always work if they are even just a few years old
12:30:41FromDiscord<Kiloneie> especially those in pre 2004 smthing
12:30:43alehander92well, i guess i'd prefer a console
12:30:57alehander92but i am not really this kind of gamer
12:31:10alehander92but even in this case one can use windows for games and linux for the other stuff
12:31:19FromDiscord<Kiloneie> that is true
12:31:22alehander92like, usually i need a browser/terminal/all kinds of dev stuff
12:31:27FromDiscord<Kiloneie> easiest dual boot ever
12:31:30alehander92and usually those work great in most systems
12:31:39FromGitter<bung87> I have three computers
12:31:44alehander92and a lot of dev stuff is easier to install/setup on linux
12:31:59alehander92except usually windows-specific stuff, but even nowadays .net might be easier, dont know
12:32:22alehander92i guess osx is also a valid choice, but i almost never used it
12:33:00FromGitter<bung87> if you dont do design things then linux is just fine
12:37:55FromDiscord<Kiloneie> You know piracy isn't that bad really, a lot of companies think all of that is lost profit when it really isn't, and most games don't even have demons and if they do they are really poor. So a lot of people pirate, then some actually buy the game, i bought 3 games this way, to show support, i didn't actually play them much after.
12:39:46FromDiscord<mratsim> windows game don't work on WIndows for me but work on Linux 😛
12:41:44FromDiscord<flywind> I will use ubuntu instead of windows if my major is not electronic engineering. I need many specific software which is not working in linux.
12:42:58FromDiscord<Kiloneie> I do wonder since most of you are not beginners here, what kind of videos would YOU want to watch about Nim ?
12:43:06livcdKilonie: piracy is bad.Period.
12:43:19FromDiscord<Kiloneie> I beg to differ 😛
12:43:26FromDiscord<Rika> #offtopic
12:43:36FromDiscord<Rika> for the piracy thing
12:43:49FromDiscord<Rika> i just want nim exposure vids lmao
12:43:53FromDiscord<exelotl> But we're talking about music in offtopic :(
12:44:18*NimBot joined #nim
12:45:05FromDiscord<exelotl> (OK in fairness nobody spoke for half an hour)
12:45:22FromDiscord<Kiloneie> Would you watch how to make a game using SDL ? Let's say not pacman... mario clone ?
12:51:33FromGitter<bung87> Id like to learn using nimly,arraymancer
12:52:45*Kaivo quit (Quit: WeeChat 2.8)
12:55:39*Kaivo joined #nim
12:56:38FromDiscord<willyboar> @Kiloneie it depends on your target group
12:57:11FromDiscord<willyboar> sure arraymancer usage would be a great video for nim users
12:58:00FromDiscord<willyboar> but let's be honest, if you want views a mario clone is probably a better path
13:09:47FromDiscord<mratsim> If I can make Arraymancer play pong tht would be OK
13:10:27FromDiscord<mratsim> I tried by the way here: https://github.com/numforge/agent-smith/blob/master/examples/ex02_00_pong_cem.nim but I had perf issues
13:10:44FromDiscord<willyboar> hehe probably
13:11:08FromDiscord<mratsim> and also I tried a technique that only has a single (Tetris) paper but no reference code
13:11:14FromDiscord<mratsim> I hate papers without code :/
13:11:34FromDiscord<mratsim> you never know if you are wrong because of an implementation "details" or if you just misimplemented
13:12:20*FromDiscord quit (Remote host closed the connection)
13:12:35*FromDiscord joined #nim
13:12:35FromDiscord<Zachary Carter> I don't want to watch videos
13:12:39FromDiscord<Zachary Carter> textual tutorials are better
13:12:57FromDiscord<Rika> some people prefer videos too
13:13:03FromDiscord<Rika> but its preference
13:13:30FromDiscord<Zachary Carter> I only find videos helpful when the visuals will actually add value to the subject
13:13:52FromDiscord<Zachary Carter> like if I need to repair something on my car - it helps to know what a tool or part looks like
13:13:56FromDiscord<Zachary Carter> or where something is located
13:14:24FromDiscord<Zachary Carter> for programming, it just drags the learning out - I have to jump around in the video and deal with the author's speech cadence
13:14:32FromDiscord<Zachary Carter> but yes - I know - different strokes for different folks
13:16:42*zacharycarter joined #nim
13:17:15alehander92i think streaming / twitch-ing seems fun
13:17:23alehander92because there is more interaction
13:17:40alehander92but yeah, some people like videos, some not so much
13:17:50alehander92its too subjective
13:19:04FromDiscord<Zachary Carter> I do like watching streams but when I'm watching them it's generally not a concentrated effort to try and learn something
13:33:29FromGitter<tim-st> hi, when I have a variant object that has a case that takes a `test: array[5, byte]` without increasing the byte size (sizeof) of the object vairant, shouldn't it also be possible to take a `uint32` instead without increasing the byte size?
13:33:50Araqmaybe not because of alignment
13:34:09FromGitter<tim-st> thanks, uint16 down't work too, only uint8
13:34:33FromGitter<tim-st> I tried `{.packed.}` but it seems not working there
13:34:52Araquint16 is aligned too
13:35:08FromGitter<tim-st> ok, thanks, I will used the byte array then, and cast it
13:43:12FromGitter<tim-st> I just saw that pragma `{.packed.}` works when written at the type definition instead of the field, it works as expected now :)
13:43:56Araqthat's a bug, please report it
13:44:12Araq(I thought we made one syntax a warning in 1.0 ?)
13:45:07FromGitter<tim-st> I think the syntax didn't work at the field level, so it didn't compile
14:00:05alehander92Araq
14:00:31alehander92btw can we make a warning
14:00:41alehander92about module names shadowing names defined in them
14:00:57alehander92a friend hit that yesterday and it totally confused him
14:01:44Araqwe can, but the lack of a spec bites us. we might as well make it work when we understand what "work" means
14:01:47alehander92i guess shadowing names imported from other modules also seems important tho: e.g. import a, b # b also defines a
14:02:39alehander92so only `.` is valid for a namespace, i guess
14:03:16alehander92the problem is `a.b` can be `b` int name in `a` module or `bf` int field in `a`
14:03:31alehander92`b` int field in `a` *
14:09:04*tane joined #nim
14:14:45*solitudesf joined #nim
14:29:47*silvernode joined #nim
14:31:16*narimiran quit (Ping timeout: 272 seconds)
14:36:34FromGitter<bung87> if you have a proc named same as module name , when you import this module, same thing.
14:42:41*theelous3 joined #nim
14:47:22*clemens3 quit (Quit: WeeChat 2.7)
14:49:17*kenran quit (Ping timeout: 272 seconds)
14:54:41FromDiscord<exelotl> oh yeah I remember @djazz battling with this issue on stream once x)
14:54:57FromDiscord<djazz> oh ye
15:12:17Yardanico@mratsim btw, found https://github.com/browserdotsys/vecchio (seems to be a new repo)
15:12:28Yardanicoray tracing in one weekend in rust, seems to use https://github.com/rayon-rs/rayon for parallelism
15:13:24FromDiscord<mratsim> Most of the Rust are using rayon for parallelism but rayon only supports a limited form of parallel_for
15:13:35FromDiscord<mratsim> via "par_iter"
15:13:58Yardanicothey also seem to have more lower-level things like "join" and "sync"
15:14:12Yardanicojoin and scope*
15:14:38*clemens3 joined #nim
15:14:40FromDiscord<mratsim> limited as in they are in the middle of the following image https://media.discordapp.net/attachments/371759389889003532/718482930434834493/2020-05-22_18-33.png
15:14:50Yardanicooh lol
15:15:02FromDiscord<mratsim> OpenMP static is the left
15:15:13Yardanicothey said work stealing so I assumed it was pretty good :P
15:15:25FromDiscord<mratsim> work-stealing is good, you can go far with that
15:15:50bungif I test algorithm performance what gc should I use?
15:16:05Yardanicodefault and arc (assuming your algo doesn't use cycles)
15:16:13FromDiscord<mratsim> but when you split loops into work chunk, 99% of the runtime work-stealing or not are doing eager split, they create the work based on heuristics before entering the loop
15:16:28bungresults randomly
15:16:37bungwith default
15:16:41FromDiscord<mratsim> Weave is doing lazy splitting, it's split on demand
15:16:54FromDiscord<mratsim> so it adapts to hardware and load realities
15:16:57Yardanicobung: well default GC isn't 100% deterministic :P
15:17:02Yardanicoalso there's the OS and stuff
15:17:10Yardanicotake a sample of at least 50 runs for reliable results
15:17:24Yardanicoby using cputime and stat module for example
15:17:26FromDiscord<mratsim> when you test algorithm performance, the most important thing to do is `killall nimsuggest`
15:17:46Yardanicoi don't have to do that since I use bung's vscode extension which uses nimlsp :P
15:18:26bungok 50 runs , I'll try that first
15:18:39FromDiscord<mratsim> well, Weave is make nimsuggest use 100% of one CPU core and somehow this means that it has single-threaded performance because when a thread "yields" Nimsuggests then hogs the CPU time
15:19:02FromDiscord<mratsim> also don't use cpuTime() when testing multithreaded application, use getMonotime()
15:19:04bungepochTime does not correct?
15:19:23FromDiscord<mratsim> epochTime is OK but subject to time changes
15:19:31FromDiscord<Shucks> What data type should i use for memory addresses? Im running into overflowerror's if im using uint
15:19:33FromDiscord<mratsim> like if you adjust time in the middle of the bench
15:19:46FromDiscord<mratsim> cast[ByteAddress]
15:19:59FromDiscord<Shucks> Thank you
15:20:22FromDiscord<mratsim> and for memory offset computation use +% and -% operator
15:20:24bungok , then cputime better as it for machine
15:20:40Yardanicomonotimes is even better but it has relatively big overhead over cputime :P
15:20:50Yardanicobut it only matters if your algo runs millions of times a second
15:21:00FromDiscord<mratsim> there is no overhead
15:21:10FromDiscord<mratsim> @Shucks example pointer arithmetic: https://github.com/mratsim/trace-of-radiance/blob/99f7d85dec857f0efa0c9b0eafd339871599c0e1/trace_of_radiance/io/h264.nim#L54-L55
15:21:13Yardanicosome person told me there's high overhead for monitimes, hmm
15:21:20YardanicoI measured it myself, and it was pretty small
15:23:32*clemens3 quit (Quit: WeeChat 2.7)
15:23:54*clemens3 joined #nim
15:24:57bungI got expected results :P
15:25:03bungalgorithm lib Costs(seconds):0.032328
15:25:05bungtimSortlib Costs(seconds):0.008038
15:25:12Yardanicoalso try with arc
15:25:20Yardanicoif you're on latest devel or 1.2.2 beta
15:26:42bungError: system module needs: nimDestroyAndDispose how to solve this when use arc
15:26:52Yardanicowhat nim version you're on?
15:27:03bung1.2.0
15:27:11Yardanicowell it doesn't have quite a lot of arc fixes
15:27:14Yardanicotry devel or 1.2.2 beta pls :P
15:28:36bungI hope nim c sources has mirror on nim-lang.org, very slow download from github
15:29:18*waleee-cl joined #nim
15:29:23bung32kb/s like am dial telephone
15:29:43Yardaniconim csources are 0.20.0
15:29:49Yardanicothey're frozen
15:30:14bunghmm choosenim always download it..
15:31:17shashlickLatest should download only once
15:32:21bungok let me update it self
15:37:56*solitudesf- joined #nim
15:40:15*solitudesf quit (Ping timeout: 246 seconds)
15:47:19bungstill same , it's compile flag?
15:48:26Yardaniconot sure, maybe the code
15:52:01bunghmm I thought only need add gc:arc to .cfg
15:54:21*konvertex quit (Remote host closed the connection)
15:54:22*endragor quit (Ping timeout: 260 seconds)
15:54:31*Senketsu joined #nim
15:54:32bunggc:orc also throw this
15:54:52Yardanicobung: well ORC doesn't differ from arch *that* much
15:55:10Yardanicoit's either some issue with your stdlib paths and stuff, or your code or the modules you import use some stuff not compatible with arc
15:56:55bungall I used times,algorithm,sugar,random and the lib its self.
15:57:43bungthe lib only use sequtils
15:57:53Yardanicocan you give the code in a playground?
15:59:02bunghmm sequtils not used , let me clean code first
15:59:34*konvertex joined #nim
16:01:24bunghttps://github.com/bung87/tim_sort
16:01:49bunghttps://github.com/bung87/tim_sort/blob/master/tests/test_performance.nim
16:02:31Yardanicobung: also for the future - put code in the main proc
16:02:35FromDiscord<Rika> nice
16:03:00Yardanicoand yeah it works for me with arc just fine on latest devel
16:03:11Yardanicomaybe it's some issue with choosenim or your stdlib paths or something
16:03:42Yardanicoalso I didn't literally mean to capture time of _all_ 50 times :P
16:03:47YardanicoI mean capture time for each iteration
16:06:29bungoh found it only happend when add gc flag to .cfg
16:07:13*filcuc joined #nim
16:09:25Yardanicobung: something like https://play.nim-lang.org/#ix=2omh
16:09:28bungthen how can I compare
16:10:09Yardanicocheck "mean"
16:10:22Yardanicoalso wait
16:10:28Yardanicoyou have incorrect code
16:10:33Yardanicoyou're sorting the same list over and over
16:10:37YardanicoI mean you're sorting the already sorted list
16:11:06Yardanicohttps://play.nim-lang.org/#ix=2omi fixed version
16:11:06*Senketsu quit (Ping timeout: 256 seconds)
16:11:08bungI know that but it still do process right?
16:11:17Yardanicotimsort is actually slower :P
16:11:46Yardanicoon 5000 iterations I get 506 mean for Algorithm and 541 mean for TimSort
16:12:20Yardanicobung: it does process stuff, but it doesn't represent the real performance of all iterations
16:12:30Yardanicosince subsequent iterations sort an already sorted sequence
16:12:46bungok, let me check
16:12:54Yardanicostd deviation in tim_sort is really high though
16:13:01Yardanicomin 518 max 1270
16:13:23Yardanicotimsort deviates a lot
16:13:33Yardanicoalso "500" means 500 microseconds
16:14:03*xet7 joined #nim
16:14:43*filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
16:15:02bungstd deviation what this means
16:15:09Yardanicohttps://en.wikipedia.org/wiki/Standard_deviation
16:15:15Yardanicohow much variation you have in results
16:15:24Yardanicoa high value means that the timing is pretty unstable
16:15:39Yardanicoso it can take as low as 530 microseconds or as high as 1500 microseconds
16:15:42Yardanico3x difference
16:16:42bungi checked tim sort faster
16:16:48Yardanicosort in nim algorithm is not dumb either
16:16:51Yardanicoit's a variant of merge sort
16:16:57Yardanicobung: for me algorithm is faster by "mean" :P
16:17:12Yardanicoaround 50 microsecond difference in total but it is faster
16:17:42bungon my machine only std deviation higher
16:17:43Yardanicosee implementation of algorithm sort - https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/algorithm.nim#L337 and https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/algorithm.nim#L376
16:18:21Yardanicobung: https://gist.github.com/Yardanico/e01a388a4efa50e5a55000121f1d8297
16:18:39Yardanicosometimes timsort std deviation is fine, some times it blows out of proportion
16:22:01bungwith gc arc all better than algorithm
16:22:20Yardanicobut both are slower than without arc :P
16:22:36*chemist69 quit (Ping timeout: 246 seconds)
16:22:37bunghttps://pastebin.com/xKCdUkYq
16:22:59*chemist69 joined #nim
16:23:14Yardanicobung: yeah i checked too
16:23:18Yardanicowhy do you have such a huge mean?
16:23:20Yardanicocan you show your code?
16:23:29Yardanicoor maybe you modified tim_sort or something
16:23:42bungand refc https://pastebin.com/WvK4vQSz
16:23:58Yardanicoyes as I said timsort is faster than algorithm for me with arc, but they're both slower than without arc
16:26:11bungyeah, right. I think I finished this project now , thanks for your help , I copy your test code directly
16:29:35*silvernode_ joined #nim
16:29:58bungI port from python, maybe port from cpp version has better performance.
16:31:41*silvernode quit (Ping timeout: 246 seconds)
16:33:26*xet7 quit (Quit: Leaving)
16:33:47Yardanicobung: you can just optimize nim code you have further :P
16:34:44FromDiscord<djazz> Havent coded with Nim for two months, anything interesting since March?
16:36:12Yardanicoscroll through the forum https://forum.nim-lang.org/
16:36:17Yardanicocheck new issues/PRs opened in two months :P
16:38:06lbartdo you know some projects which export c libraries and header (and use the .so in c app)?
16:38:42disruptek!repo gittyup
16:38:43disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 2⭐ 1🍴
16:39:07Yardanicolbart: I made a simple example myself a while ago
16:39:07Yardanicohttps://github.com/Yardanico/nim-snippets/tree/master/clib
16:39:26Yardanicoif I understood you correctly
16:39:40Yardanicoin the nim side it's really simple
16:39:55Yardanicojust add {.exportc, dynlib.} to every proc you need in the .so or use push pragma
16:41:23bungYardanico ok, I'll check it later.
16:44:33lbartthanks. Yes, it's this kind of snippets which I'm searching. For now, I generate some header and create a .so with nim. I can build a new C app. Just wondering if there is some other (big) example. BTW, since I'm still learning nim, wondering if the NimMain is required.
16:45:17YardanicoI think nim makes NimMain to be run on library initialization when building with --app:lib
16:46:00*zedeus quit (Ping timeout: 265 seconds)
16:46:14Yardanicofor linux it makes a "N_LIB_PRIVATE void NIM_POSIX_INIT NimMainInit(void)" function
16:46:16Yardanicowhich calls NimMain
16:46:24Yardanicoso you don't need to worry about it in your C code
16:46:35Yardanicoassuming you compile with arc of course :) there might be more problems with refc
16:47:16lbart"arc" not found ;)
16:47:24Yardanicoit's available in nim 1.2.0+
16:47:36Yardanicobut for best experience use devel or at least beta 1.2.2
16:47:53Yardanicobeta from here https://github.com/nim-lang/nightlies/releases/tag/2020-05-20-version-1-2-7800fa3
16:48:05*zedeus joined #nim
16:48:19Yardanicoor https://github.com/nim-lang/nightlies/releases/tag/2020-06-01-version-1-2-5702a60
16:50:14FromGitter<matrixbot> `Integrated 555` Hi, I want to ask if anyone knows the difference between rust and nim when we talk about security
16:50:16Yardanicofor more info read https://forum.nim-lang.org/t/5734 forum thread (the starting post is a bit outdated, scroll for newer info :P)
16:51:39lbartThanks Yardanico
16:54:22FromGitter<matrixbot> `Integrated 555` thanks
16:54:40Yardanico@Integrated well it depends on what you mean by "security", but really make a forum post for better discussion
16:55:00Yardanicoand by the message with 5734 forum thread I didn't reply to you :P
16:55:26FromGitter<matrixbot> `Integrated 555` haha
16:55:27FromGitter<matrixbot> `Integrated 555` okk
17:02:39planetis[m]`Integrated 555`: join #freenode_#nim:matrix.org , you will avoid an extra indirection :)
17:14:44bungYardanico std deviation prior than mean ?
17:16:40FromGitter<ynfle> what is `getImpl` supposed to do ?
17:19:35bunghard to decide min merge number
17:20:04*tiorock joined #nim
17:20:04*tiorock quit (Changing host)
17:20:04*tiorock joined #nim
17:20:04*rockcavera quit (Killed (adams.freenode.net (Nickname regained by services)))
17:20:04*tiorock is now known as rockcavera
17:21:07*clemens3 quit (Quit: WeeChat 2.7)
17:26:16*hvn joined #nim
17:29:43hvnhello, I'm trying to setup a nimforum, used 2.0.0 did not support send email via TLS, which is available in 2.0.1, so I try to build the binary using nim 1.2.0 but it keeps failing. https://pastebin.com/QumBnDA8 What am I missing here? Thanks
17:35:45*bung quit (Ping timeout: 246 seconds)
17:43:12*hvn quit (Quit: leaving)
17:44:26*couven92 joined #nim
17:44:29*fredrikhr quit (Ping timeout: 265 seconds)
17:55:40*Vladar quit (Quit: Leaving)
18:15:23*lritter quit (Quit: Leaving)
18:18:59*kenran joined #nim
18:21:37*Vladar joined #nim
18:27:49*clemens3 joined #nim
18:28:14*clemens3 quit (Client Quit)
18:28:41*clemens3 joined #nim
18:42:28disruptekhvn: you'd be lucky enough to get support as a visitor to the official nim forum; support for the forum software itself is practically non-existent.
18:43:10disruptekssl/tls is a complete clusterfuck no matter where it's used.
18:43:25disruptekbut especially in nim software.
18:44:00disruptekyou get all of the problems of c software plus dl bullshit, old versions, and incomplete wrappers.
18:47:18*gangstacat quit (Remote host closed the connection)
18:50:58*Jjp137 quit (Quit: Leaving)
19:04:10krux02disruptek, are you streaming again?
19:04:38disruptekonly vitriol.
19:05:39disrupteka rat always knows when he's in with weasels.
19:09:55*tane quit (Ping timeout: 260 seconds)
19:11:37supakeenWhat was the name of the 'more advanced' stdlib again, fusion?
19:11:51Araqyeah but it's in early stages of development
19:11:54supakeenAh yes.
19:12:00supakeenYea but I liked the idea behind it.
19:27:38FromDiscord<dom96> hvn: that's a Nimble bug, you need to install that dependency manually `nimble install karax@#5f21dcd` then re-do the NimForum command
19:28:43krux02disruptek, I only know Vitriol from Dungeons of Dredmor
19:28:58krux02so what do you mean?
19:30:40*gangstacat joined #nim
19:35:05disrupteka "stream of vitriol" is, like, a series of personal and vindictive attacks. bitter, abusive, and generally superlative.
19:35:24disruptekverbal invective. not physical.
19:43:02*silvernode_ quit (Ping timeout: 256 seconds)
19:52:56*Senketsu joined #nim
20:01:07FromDiscord<Shucks> Sorry for that newcomer question: https://play.nim-lang.org/#ix=2ong
20:01:42*kenran quit (Ping timeout: 246 seconds)
20:02:27AraqShucks: you cannot bitand a float
20:04:15*aeverr joined #nim
20:04:33FromDiscord<Shucks> oh
20:05:43*monokrom quit (Read error: Connection reset by peer)
20:15:23Zevvone can alwys try
20:29:12*bung joined #nim
20:29:52FromDiscord<Kiloneie> Does anyone where to find some good operator overload examples ? I have never done this before and im failing at my first one xD...
20:30:42FromGitter<ynfle> What are you trying to do?
20:33:32*bung quit (Ping timeout: 246 seconds)
20:35:27FromDiscord<Kiloneie> im just trying to overload += to work with strings for my video and it won't work... idk D:
20:37:17FromDiscord<Generic> don't give the wrong people this knowledge 🙂
20:38:08FromDiscord<Kiloneie> yeah i know people might want to customize Nim to their previous language...
20:38:21FromDiscord<Generic> https://play.nim-lang.org/#ix=2ont
20:39:12FromGitter<ynfle> https://play.nim-lang.org/#ix=2onv
20:39:14FromDiscord<Kiloneie> what... okay i guess i was being stupid, i did a real dumb contentation in mine xD
20:39:29FromGitter<kaushalmodi> Kiloneie: https://nim-lang.github.io/Nim/manual#procedures
20:39:34FromGitter<ynfle> use `&=` instead
20:39:58FromDiscord<Kiloneie> yeah i used a = a & b ... guess that doesn't work
20:40:18FromGitter<ynfle> var a `var string`?
20:40:46FromGitter<kaushalmodi> Kiloneie: You might need to distinguish between a unary and binary operator proc signature
20:40:56FromDiscord<Generic> though I suggest showing something else instead, like overriding the [] operator for a container
20:40:57FromDiscord<Kiloneie> i did this: https://play.nim-lang.org/#ix=2onz
20:41:06FromDiscord<Kiloneie> okay
20:41:30FromDiscord<Rika> you hafve a return value but never use it
20:41:33FromDiscord<Rika> thats why it doesnt work
20:41:45FromDiscord<Rika> remove the : string at the end of the function then you're good to go, afai
20:41:46FromDiscord<Rika> k*
20:42:16FromDiscord<Kiloneie> okay, imma put a bag of shame on my head now D:
20:43:04FromDiscord<Rika> 😛
20:43:10FromDiscord<Rika> the name of your proc has no issue
20:43:12FromDiscord<Rika> but dont do that please
20:43:15FromDiscord<Rika> XD
20:43:44FromDiscord<Kiloneie> i will finish this video tomorrow... really wanted to pump another one out, oh well D:
20:45:27*zedeus quit (Ping timeout: 246 seconds)
20:47:14*couven92 is now known as fredrikhr
20:49:00disruptekError: type mismatch: got <string> but expected 'bool'
20:49:06disruptekgreat, but FUCKING WHERE?
20:49:40*zedeus joined #nim
20:57:29*inv2004 joined #nim
20:57:45inv2004If no replies in telegram - I goes here :)
20:58:04Araqdisruptek, the compiler outputs line information
20:58:17inv2004Is it possible to create the k and v getters automatically for Table[T1] ? T1 = object with k and v fields. https://play.nim-lang.org/#ix=2onA
21:00:48FromDiscord<Rika> inv2004: i have no clue what you're trying to do
21:00:54FromGitter<ynfle> What does it mean if a node is a symbol?
21:01:21FromDiscord<Recruit_main707> @Kiloneie have you considered showing operator overloading with arrays?
21:01:21FromGitter<ynfle> ie., what's the difference between nnkSym, nnkIdent
21:01:34FromDiscord<Rika> sym is bound, ident is not afaik
21:01:35inv2004Rika, I am trying to autogenerate `k` and `v` for Table[T1] - because T1 has k and v fields
21:01:50FromDiscord<Recruit_main707> thats somewhat useful and usable, (and you also teach about arrays if you havent)
21:01:55*haxscramper joined #nim
21:02:00FromDiscord<Rika> maybe look into the `fields` and `fieldpairs` iterators in `iterators`?
21:02:12FromDiscord<Rika> https://nim-lang.org/docs/iterators.html#fields.i%2CT?
21:03:01FromGitter<ynfle> @Rika, what does bound mean?
21:03:31FromDiscord<Rika> uh :blobsweats:
21:04:05*haxscramper left #nim (#nim)
21:04:10*haxscramper joined #nim
21:04:12FromGitter<ynfle> Has semantic meaning?
21:04:27FromGitter<ynfle> Not nnkLit?
21:05:45inv2004Rika, I do not have value, just a type
21:06:21inv2004but the question is not how to extract fields - I did it, but how to create getters from the fields
21:08:08FromGitter<ynfle> Fields are getters
21:09:21inv2004ynfle, not for Table[T1] !
21:09:24*Vladar quit (Quit: Leaving)
21:12:04FromDiscord<Rika> you make a macro that takes in the Table[T1], see what T1's fields are (maybe using the fields iterator, dunno if thatll work though), then in the macro you append procs that are 1:1 with the fields of T1
21:12:14FromDiscord<Rika> im not sure honestly
21:15:32inv2004Rika, is it possible to autogenerate it somehow without doing separate macro call in root?
21:15:33*sacredfrog quit (Quit: ZNC 1.8.0 - https://znc.in)
21:16:03FromDiscord<Rika> you make the macro and use it as a pragma
21:16:04krux02disruptek, sorry to hear that. I wonder who would want to do that though.
21:16:08*haxscramper quit (Remote host closed the connection)
21:18:33FromDiscord<Rika> i wish i could make a block statement that i could only break if the break's accompanied with the label
21:18:45FromDiscord<Rika> but that makes no sense haha
21:19:15disruptekAraq: the compiler only points to a macro.
21:19:35inv2004Rike, was trying to do it without calling pragma. I have constructor newTable, which extract fields with macro - is it possible to apply something to root where?
21:19:37inv2004there
21:23:53*Trustable quit (Remote host closed the connection)
21:29:54*solitudesf- quit (Ping timeout: 246 seconds)
21:31:21*Trustable joined #nim
21:31:29*tane joined #nim
21:36:34FromDiscord<Rika> dont think so
21:42:30zedeusimplementing zero copy request proxying for nitter only required two stdlib modifications and reimplementing part of httpclient, but it works and memory usage is now very low
21:42:35rockcaveraguys, i need help to finish this PR. I do not know what else to do. I believe it is beyond my current understanding of Nim. https://github.com/nim-lang/Nim/pull/14237
21:42:37disbotadd a second asyncnet.recvFrom
21:45:46*inv2004 quit (Quit: Leaving)
21:45:58*xet7 joined #nim
21:48:40*krux02 quit (Remote host closed the connection)
22:00:15*zedeus quit (Ping timeout: 260 seconds)
22:02:45Araqdisruptek, try --expandMacro:...
22:03:00*zedeus joined #nim
22:03:04disruptekthe macro is expanding fine, seemingly.
22:03:31disruptekthis is a simple compile-time json renderer.
22:03:43Araqrockcavera, I'll ping dom96 once again
22:03:57disrupteki gotta go ice my balls, this is ridonk.
22:08:35rockcaveraAraq, thanks.
22:08:36*Trustable quit (Remote host closed the connection)
22:09:56dom96Why ping me?
22:10:04dom96Did you not see my comment?
22:10:45rockcaveradom96, I saw it, but honestly I don't know how to solve it.
22:15:14*NimBot joined #nim
22:33:22disrupteki seem to have hit the fieldPairs() impl bug.
22:35:43*neceve_ quit (Ping timeout: 260 seconds)
22:41:04disruptekah, you have to name your gensyms.
22:44:16disruptekgah, how the hell was i supposed to figure that out.
22:44:58*tane quit (Quit: Leaving)
23:03:29*bung joined #nim
23:05:23voltistIs there a way to pass arguments to the compiler from inside a Nim file?
23:05:38voltistC compiler that is, not the Nim compiler
23:05:57aeverr--passC i think? no clue
23:06:51voltistYeah I just don't know how to do it from Nim code
23:10:30FromDiscord<Rika> {.emit: "c code".}
23:10:32FromDiscord<Rika> ?
23:10:41FromDiscord<Rika> ah
23:10:42FromDiscord<Rika> arguments
23:10:43FromDiscord<Rika> no clue on that
23:10:44FromDiscord<Rika> 😛
23:12:09voltistIve got passc but that doesn't seem to be much help
23:13:24voltistI'm trying to get something compiling with glib2, so `{.passc: staticExec("pkg-config --cflags --libs glib-2.0").}` should work right?
23:13:36voltistGiven that `pkg-config --cflags --libs glib-2.0` works
23:17:54voltistIt looks as if including `{.passc: "-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0".}` doesn't actually make it use those flags
23:20:12voltistSame with --passC
23:23:12*zedeus quit (Ping timeout: 260 seconds)
23:23:40*zedeus joined #nim
23:25:21FromDiscord<Rika> i'm wondering whether i should use `Option` for errors or `exceptions`
23:33:55FromDiscord<Kiloneie> @Recruit_main707 No i did not
23:54:18*zedeus quit (Ping timeout: 272 seconds)
23:54:39*zedeus joined #nim
23:59:00*zedeus quit (Ping timeout: 246 seconds)
23:59:29*zedeus joined #nim