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:59 | Prestige | I'm wrapping a c function with variadic args, how would I go about doing this since the type is not known? |
00:30:28 | Yardanico | Prestige: https://forum.nim-lang.org/t/373 |
00:30:35 | Yardanico | varargs pragma basically |
00:30:59 | Yardanico | https://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma |
00:32:17 | Prestige | Thanks Yardanico |
00:33:10 | Prestige | Converting this function: https://0x0.st/iO6P.txt |
00:33:22 | Prestige | Not 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:13 | Yardanico | Prestige: _X_SENTINEL just checks at compile-time that a parameter at index passed to _X_SENTINEL is null |
00:39:40 | FromDiscord | <Zachary Carter> does it? I just googled and saw - `# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))` |
00:39:44 | FromDiscord | <Zachary Carter> although I don't know what that attribute does |
00:39:47 | Yardanico | it does what I said |
00:39:53 | Yardanico | "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:53 | Prestige | Yardanico: so to wrap the function do I need to do anything? |
00:39:59 | FromDiscord | <Zachary Carter> but you could add that attribute to the proc with `codegenDecl` |
00:40:10 | FromDiscord | <Zachary Carter> gotcha |
00:40:14 | Yardanico | Prestige: yeah, just add varargs and you're good to go |
00:40:21 | Yardanico | and call that function with first argument as nil |
00:40:22 | Prestige | ah 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:49 | FromDiscord | <Technisha Circuit> Are there any options to speed up the time it takes to compile a file using the C backend? |
02:48:32 | disruptek | ccache? |
02:48:58 | FromDiscord | <Technisha Circuit> After the code has been changed :p |
02:49:10 | FromDiscord | <Technisha Circuit> Or is that a no? |
02:55:43 | disruptek | sometimes an option like -pipe can speed up c compilation. maybe upgrade your compiler or switch clang/gcc? |
02:56:08 | disruptek | it's basically out of our hands after we hand it off to the c compiler. |
02:56:55 | disruptek | what 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:17 | FromDiscord | <Technisha Circuit> Thanks :p |
03:23:51 | FromDiscord | <Technisha Circuit> It's quite quick but I'm compiling on my android :/ |
03:24:04 | FromDiscord | <Technisha Circuit> Because I don't have access to any other device i could code on |
03:24:11 | FromDiscord | <Technisha Circuit> (Also mobile coding ftw) |
03:37:17 | FromDiscord | <treeform> You can try using tcc, its very fast at compiling but it does not produce optimal code. |
03:37:46 | FromDiscord | <treeform> Its also pretty limit and might only work for toy programs. |
03:40:08 | FromDiscord | <treeform> Oh I don't think tcc supports Android |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:30 | voltist | So did that idea for an official Nim youtube/streaming thing ever come to fruition? |
04:06:41 | * | supakeen joined #nim |
04:07:50 | shashlick | Hey @voltist you figured out those issues? |
04:07:59 | voltist | No still having them |
04:08:03 | voltist | Details on the gitter |
04:21:31 | * | rockcavera quit (Remote host closed the connection) |
04:32:29 | voltist | I'm skeptical of nim's zlib library |
04:33:06 | voltist | Inflating should never reduce 10+ byte data to a single byte |
04:33:22 | voltist | Right? |
04:38:58 | FromDiscord | <treeform> well no, if your data is already random zlib can actually make it bigger. |
04:39:24 | FromDiscord | <treeform> so like zipping jpgs, pngs, mpegs only would make them bigger |
04:39:39 | FromDiscord | <treeform> zlib works great for text, as text is usually not very random |
04:40:08 | FromDiscord | <treeform> also zlib algorithm is like 20 years old, I highly recommend speedy instead if you control both sides. |
04:40:57 | FromDiscord | <treeform> sorry I meant snappy not speedy... https://github.com/status-im/nim-snappy |
04:41:56 | voltist | @treeform I'm writing a png decoder so I need to use zlib unfortunately |
04:46:46 | shashlick | See the zlib wrapper in nimterop tests |
04:47:13 | voltist | Ace thanks |
04:47:55 | voltist | shashlick: I'll try not to juggle between the two projects too much ;) |
04:52:14 | * | dddddd quit (Ping timeout: 240 seconds) |
04:53:03 | shashlick | There's a zlib wrapper in nimarchive as well but it doesn't actually wrap the api |
04:53:10 | shashlick | You might need a combo of both |
04:55:47 | * | D_ quit (Ping timeout: 240 seconds) |
04:56:04 | * | D_ joined #nim |
05:03:26 | FromDiscord | <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:32 | Yardanico | read the readme |
05:04:32 | leorize[m] | you usually will have to do some initialization |
05:04:35 | Yardanico | also "-d:cuda: Build with Cuda support" |
05:05:07 | leorize[m] | well try not to make all operations run on the gpu :P |
05:05:12 | leorize[m] | offloading is not really all that fast |
05:05:23 | FromDiscord | <Zed> yeah i just saw them after posting, i dont know why i couldn't see them before 😛 |
05:08:54 | FromDiscord | <Elegant Beef> So leorize im currently at the point of cloning my x11 windoow |
05:08:56 | FromDiscord | <Elegant Beef> (edit) 'windoow' => 'window' |
05:09:08 | FromDiscord | <Elegant Beef> Im so great at this terminal bodging thing |
05:09:43 | leorize[m] | so you figured out how to use pt? |
05:10:15 | FromDiscord | <Elegant Beef> Nope |
05:11:09 | FromDiscord | <Elegant Beef> I learned how to get weird behaviour |
05:11:16 | leorize[m] | lol |
05:11:48 | FromDiscord | <Elegant Beef> Also was it you getting xorg memory leaks? |
05:12:56 | leorize[m] | yea |
05:13:07 | FromDiscord | <Elegant Beef> Ah im in that club now |
05:13:26 | leorize[m] | lol |
05:16:36 | leorize[m] | so what's your current issue with pt? |
05:19:29 | FromDiscord | <Elegant Beef> At the moment reading from master and not cloning the process |
05:20:47 | FromDiscord | <Elegant Beef> Thi is my current process |
05:20:54 | FromDiscord | <Elegant Beef> And doing this makes two processes |
05:21:07 | FromDiscord | <Elegant Beef> Rather duplicates my window |
05:21:16 | FromDiscord | <Elegant Beef> https://hatebin.com/sjbhyubbfr |
05:22:19 | Yardanico | well you need to detect if you're in a fork and don't run any WM code in the fork then |
05:22:23 | Yardanico | also why do you need to run PTY in the WM? |
05:22:36 | Yardanico | i mean not as a separate program like a terminal emulator, but built-in into the WM |
05:22:54 | FromDiscord | <Elegant Beef> in the WM? |
05:22:56 | FromDiscord | <Elegant Beef> What WM? |
05:22:59 | Yardanico | ? |
05:23:05 | Yardanico | you want a terminal emulator in nim? |
05:23:11 | FromDiscord | <Elegant Beef> yes |
05:23:45 | Yardanico | and why do you need to fork? |
05:24:31 | FromDiscord | <Elegant Beef> Cause i'm making a termina emulator, and forking seems to be what im see to do |
05:24:37 | FromDiscord | <Elegant Beef> I know absoulutely nothing here |
05:24:38 | Yardanico | i found some nim terminal emulator and it uses threads for that |
05:24:44 | FromDiscord | <Elegant Beef> Im just eading things like edunim and it forks |
05:24:47 | FromDiscord | <Elegant Beef> reading |
05:24:53 | FromDiscord | <Elegant Beef> eduterm* |
05:25:10 | Yardanico | also see https://github.com/treeform/vt100terminal |
05:25:13 | leorize[m] | Yardanico: uhmm you need to fork so you can launch the process that use the created pseudoterm? |
05:25:36 | Yardanico | hmm |
05:25:46 | Yardanico | also ignore my vt100terminal link |
05:26:18 | leorize[m] | that one can still be useful to implement the actual emulating part of the terminal emulator :P |
05:26:42 | Yardanico | also https://linux.die.net/man/4/ptmx |
05:27:00 | FromDiscord | <Elegant Beef> Yea i've read the man pages |
05:27:05 | Yardanico | this one is about ptmx |
05:27:07 | leorize[m] | also you're using execle wrong |
05:27:54 | FromDiscord | <Elegant Beef> How |
05:28:18 | Yardanico | why do you pass /bin/bash as the argument? |
05:28:32 | FromDiscord | <Elegant Beef> Cause im mostly reading eduterm and copying it |
05:28:34 | Yardanico | I think you just need to pass "bash" |
05:28:38 | leorize[m] | it needs a nil parameter at the end |
05:28:39 | leorize[m] | Yardanico: argv0 |
05:28:51 | FromDiscord | <Elegant Beef> execle in posix only has two strings |
05:29:03 | FromDiscord | <Elegant Beef> > proc execle*(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>", sideEffect.} |
05:29:06 | leorize[m] | also execle don't search the PATH |
05:29:15 | leorize[m] | {.varargs.} |
05:29:15 | Yardanico | leorize[m]: I meant the second argument, not the first |
05:29:33 | Yardanico | @Elegant look at the man page for execle :) |
05:29:33 | leorize[m] | still argv0 :P |
05:29:45 | Yardanico | leorize[m]: ? |
05:29:54 | Yardanico | definition for execle is |
05:29:54 | Yardanico | int execle(const char *path, const char *arg, ..., char * const envp[]); |
05:30:07 | leorize[m] | I mean that it doesn't matter if it's /bin/bash or bash :P |
05:30:35 | Yardanico | maybe it matters to some programs? |
05:31:02 | leorize[m] | nope |
05:31:02 | leorize[m] | POSIX have no regulation on argv[0] |
05:31:29 | leorize[m] | well some program do use argv[0] as a mean to determine what version of itself should be launched |
05:31:30 | leorize[m] | but bash is not one of them |
05:32:13 | FromDiscord | <treeform> voltist, have you seen https://github.com/jangko/nimPNG |
05:32:32 | FromDiscord | <treeform> I think he made his own zlib decoder. |
05:33:07 | Yardanico | oh yeah, https://github.com/jangko/nimPNG/blob/master/nimPNG/nimz.nim |
05:33:14 | Yardanico | nice never knew this existed |
05:34:12 | voltist | Yeah it's a good start but "pixels are stored as raw bytes using Nim's string as container" |
05:34:20 | Yardanico | so? |
05:34:27 | voltist | I may as well wrap a c library that can read/write all sorts of image formats |
05:34:30 | Yardanico | ??? |
05:34:34 | voltist | Which is what I will do |
05:34:49 | * | narimiran joined #nim |
05:35:36 | leorize[m] | !package stb_image |
05:35:39 | disbot | https://gitlab.com/define-private-public/stb_image-Nim -- 9stb_image: 11A wrapper for stb_image and stb_image_write. |
05:35:42 | Yardanico | there's really no difference between seq[char] and string at the end of the day (I mean data structure-wise) |
05:36:12 | Yardanico | both are same len, cap, data |
05:36:34 | leorize[m] | you can shorten it to: you can cast between the two and it wouldn't be wrong :P |
05:36:43 | Yardanico | oh right, that too |
05:37:28 | voltist | I'm going for something more like python's pillow thats all |
05:37:29 | leorize[m] | you also have `toOpenArrayByte()` which can slice any string into an openArray[byte] |
05:37:29 | voltist | With lazy high-level stuff |
05:38:01 | voltist | So I may as well wrap something myself rather than wrapping a wrapper, if you get what I mean? |
05:38:04 | Yardanico | https://github.com/SolitudeSF/imageman ? |
05:38:13 | Yardanico | can use stb_image |
05:38:18 | leorize[m] | !repo flippy |
05:38:19 | disbot | https://github.com/treeform/flippy -- 9flippy: 11Flippy is a simple 2d image and drawing library. 15 35⭐ 6🍴 |
05:38:25 | Yardanico | or that |
05:38:30 | Yardanico | honestly never tried any of them so don't know the difference |
05:39:11 | leorize[m] | I've only ever used gdk-pixbuf in Nim :P |
05:39:54 | voltist | I have tried to use them, which is why I'm making something else :) |
05:39:57 | voltist | Not that they are bad |
05:40:04 | voltist | Just not what I would want to use |
05:40:16 | FromDiscord | <Elegant Beef> So with that code i linked is it expected to have an duplicate application launch? |
05:40:45 | leorize[m] | nope |
05:40:51 | Yardanico | lemme see eduterm |
05:40:52 | FromDiscord | <Elegant Beef> Cause this is what happens https://media.discordapp.net/attachments/371759389889003532/718338525245866054/unknown.png |
05:41:00 | FromDiscord | <Elegant Beef> https://www.uninformativ.de/git/eduterm/file/eduterm.c.html |
05:41:01 | leorize[m] | you likely messed up since you missed the `nil` part at the end |
05:41:30 | FromDiscord | <Elegant Beef> Even with nil it does the same thing |
05:41:32 | voltist | Oh gee something is well stuffed with my system |
05:41:35 | voltist | fatal error: cstdio: No such file or directory |
05:41:53 | Yardanico | cstdio is from C++ |
05:42:04 | Yardanico | C* |
05:42:16 | voltist | Oh huh |
05:42:17 | Yardanico | fsck |
05:42:18 | Yardanico | it's from C++ |
05:42:21 | leorize[m] | @Beef I will need to see the full code for that |
05:42:22 | Yardanico | but stdio.h is for C |
05:42:24 | voltist | That'd by why |
05:42:26 | Yardanico | leorize[m]: https://www.uninformativ.de/git/eduterm/file/eduterm.c.html |
05:42:34 | Yardanico | ah right |
05:42:36 | Yardanico | you mean his tool |
05:42:46 | leorize[m] | I'm talking about the Nim version he wrote :P |
05:43:37 | FromDiscord | <Elegant Beef> https://github.com/beef331/cluiconsole/blob/refactor/src/cluiconsole.nim |
05:43:43 | leorize[m] | oh this code is like old old |
05:43:43 | leorize[m] | it uses select() |
05:44:03 | FromDiscord | <Elegant Beef> It's all greek to me |
05:44:13 | Yardanico | leorize[m]: it's not old, but author used the old style I guess :P |
05:44:18 | Yardanico | a person created it in 2018 |
05:44:26 | Yardanico | https://www.uninformativ.de/git/eduterm/commit/94cbafa06db99c5deb7d13b046b06d2604a454a1.html |
05:45:45 | leorize[m] | @Beef without seeing the Nim code I can't really say much about the issue |
05:45:51 | Yardanico | he linked nim code |
05:45:53 | FromDiscord | <Elegant Beef> I literally linked it |
05:45:55 | FromDiscord | <Elegant Beef> 😄 |
05:46:06 | leorize[m] | oh do you know that execve() can actually fail? :) |
05:46:27 | Yardanico | I think your issue is due to the fact that you're using glfw or something |
05:46:32 | * | kenran joined #nim |
05:46:34 | FromDiscord | <Elegant Beef> Ah |
05:46:37 | Yardanico | not sure exactly |
05:47:01 | Yardanico | "The child process is an exact duplicate of the parent process except for the following points" |
05:47:21 | Yardanico | so maybe the child process then continues to run glfw too or something |
05:47:30 | leorize[m] | shouldn't be a problem |
05:47:31 | Yardanico | isn't there another way instead of forking for that? |
05:47:51 | leorize[m] | execve replaces the process |
05:47:54 | FromDiscord | <Elegant Beef> Look at my initpty proc and look at this output https://media.discordapp.net/attachments/371759389889003532/718340296282472528/unknown.png |
05:48:05 | FromDiscord | <Elegant Beef> I call initialize pty once |
05:48:20 | FromDiscord | <Elegant Beef> yet it goes through it twice |
05:48:20 | leorize[m] | @Beef also execle requires one more param: the environment variable list |
05:49:06 | Yardanico | yeah @Beef see https://www.uninformativ.de/git/eduterm/file/eduterm.c.html#l291 |
05:49:11 | Yardanico | where env is char *env[] = { "TERM=dumb", NULL }; |
05:49:31 | leorize[m] | @Beef and uh, the output looks correct? |
05:49:50 | leorize[m] | fork... well fork your process into two |
05:50:14 | FromDiscord | <Elegant Beef> Ah that makes sense |
05:50:32 | FromDiscord | <Elegant Beef> Same state, so the one will get 1 whilst other gets 0 |
05:51:13 | leorize[m] | one will get the child pid |
05:51:13 | leorize[m] | the other gets 0 |
05:54:27 | FromDiscord | <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:55 | silvernode | Prestige, I got it working the way I wanted https://play.nim-lang.org/#ix=2okD |
06:20:56 | * | PMunch joined #nim |
06:21:35 | FromDiscord | <Elegant Beef> Did you see my rendition of it? |
06:21:44 | silvernode | I did not |
06:23:40 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2okF |
06:25:40 | silvernode | Wow, that's more of what I was looking for. Really nicely done. |
06:26:02 | silvernode | Now I have to dissect it |
06:26:57 | silvernode | I like the use of a type with the event property |
06:27:21 | skrylar[m] | so i tried to write a little mud server with async+arc and.. broke the compiler entirely ._. |
06:27:32 | silvernode | This is more like what an adventure game would be written |
06:27:58 | silvernode | Logging into discord as mollusk |
06:29:08 | silvernode | skrylar[m], that's a bummer |
06:30:15 | FromDiscord | <mollusk> Logged into discord so I can reply to people here properly |
06:30:26 | FromDiscord | <Elegant Beef> Well ti's the same thing to me 😄 |
06:30:33 | FromDiscord | <Elegant Beef> (edit) 'ti's' => 'it's' |
06:32:04 | FromDiscord | <mollusk> @Elegant Beef same thing? |
06:32:23 | FromDiscord | <Elegant Beef> yea |
06:32:27 | FromDiscord | <Elegant Beef> You can at from irc |
06:32:42 | FromDiscord | <Elegant Beef> Yards bot is super smart |
06:32:45 | FromDiscord | <Elegant Beef> atleast 2 iq |
06:33:36 | skrylar[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:35 | FromDiscord | <mollusk> @Elegant Beef I was wondering if that was possible from ric |
06:35:07 | FromDiscord | <mollusk> no auto complete doing @ on IRC though |
06:35:15 | FromDiscord | <Elegant Beef> true |
06:35:19 | FromDiscord | <Elegant Beef> anywho |
06:35:42 | FromDiscord | <Elegant Beef> You can make your entire menu system in json or toml if you so wished |
06:36:02 | silvernode | @skrylar[m], a mud server would be an awesome thing to write in Nim though. |
06:36:26 | FromDiscord | <Elegant Beef> A gpu based terminal emulator would be too, but seems im overly daft 😄 |
06:36:26 | skrylar[m] | silvernode: eh. trying to figure out how to package this code up for a bug report |
06:36:53 | silvernode | @Elegamt_Beef does this work? |
06:37:03 | FromDiscord | <Elegant Beef> Helps if you put the proper characters |
06:37:29 | silvernode | The name is different on discord vs irc |
06:37:38 | FromDiscord | <Elegant Beef> You put an m in |
06:38:10 | silvernode | Not sure I follow |
06:38:26 | FromDiscord | <Elegant Beef> You wrote "Elegamt_Beef" i do not have an m in my name |
06:38:52 | skrylar[m] | FromDiscord: but most of that is just going to be boring old vt100 shit |
06:38:53 | silvernode | oops |
06:39:04 | FromDiscord | <Elegant Beef> Well not true |
06:39:13 | silvernode | Small font, bad eyes I suppose |
06:39:14 | FromDiscord | <Elegant Beef> I planned on having fancy stuff |
06:39:20 | skrylar[m] | getting the terminal cells to the gpu is just a bunch of quads :f |
06:39:38 | silvernode | @Elegant_Beef how about this? |
06:39:42 | FromDiscord | <Elegant Beef> Oh i know that, but using a gpu instead of pure text gives you abillity to do more things |
06:39:48 | FromDiscord | <Elegant Beef> Think the underscore is an issue |
06:39:52 | FromDiscord | <Elegant Beef> as my name doesnt have one |
06:40:03 | FromDiscord | <Elegant Beef> With a space or ElegantBeef might |
06:40:26 | silvernode | I put that there since I figured it would substitute for the space on irc or something |
06:40:34 | silvernode | @Elegant Beef how about this? |
06:40:38 | FromDiscord | <Elegant Beef> There you go |
06:40:52 | silvernode | hmm, I really thought the space would screw it up |
06:41:01 | silvernode | used to terminals |
06:41:02 | FromDiscord | <Elegant Beef> Well comically yard replaces only the first word |
06:41:21 | FromDiscord | <Elegant Beef> so it shows up as `@my name` beef |
06:43:11 | silvernode | @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:55 | FromDiscord | <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:59 | FromDiscord | <Elegant Beef> And it'll automagically parse it |
06:44:45 | FromDiscord | <Elegant Beef> I mean it's rather simple to parse files since you dont have to manually write string to object part |
06:44:52 | FromDiscord | <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:38 | silvernode | sounds like something fun to play with. Not sure I would need to put the menu contents in a file though |
06:45:47 | FromDiscord | <Elegant Beef> Nah probably dont |
06:49:23 | silvernode | Time 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:40 | endragor | Does 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:00 | FromDiscord | <Rika> Virtual methods? |
08:23:03 | endragor | That is on old version of Nim, so things might be different on latest. |
08:23:06 | FromDiscord | <Rika> As in methods? |
08:23:22 | FromDiscord | <Rika> Is there a reason you're on such an old version |
08:23:30 | endragor | yes, methods, in Nim terminology. decided to clarify so that people don't confuse it with procedures |
08:23:42 | endragor | Rika: yes, there is |
08:24:16 | FromDiscord | <Rika> I'd like to know |
08:25:17 | Araq | endragor, for object with enabled inheritance we assume it's cyclic |
08:25:33 | Araq | since we don't know the inherited fields |
08:25:57 | Araq | but if at runtime it's acyclic, the refcount'ing GC should collect it anyway |
08:27:02 | endragor | Araq: 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:11 | Araq | there were fixes for --gc:boehm but I don't remember fixes for the default GC |
08:46:37 | PMunch | endragor, how old of a version are you using? |
08:48:50 | * | zacharycarter joined #nim |
08:49:28 | * | neceve_ joined #nim |
08:49:36 | endragor | PMunch: 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:55 | FromDiscord | <dayl1ght> I'm trying to use valgrind with nim |
08:58:12 | FromDiscord | <dayl1ght> I have code that manually does allocations using `alloc0` but valgrind isn't detecting anything |
08:58:34 | Araq | compile with -d:useMalloc --gc:arc |
08:58:59 | FromDiscord | <dayl1ght> is --gc:arc needed for valgrind to detect leaks? |
09:00:27 | Araq | no, -d:useMalloc is |
09:00:37 | Araq | but it works much better with --gc:arc |
09:01:57 | FromDiscord | <dayl1ght> hmm, isn't this supposed to leak? https://play.nim-lang.org/#ix=2okY |
09:02:05 | FromDiscord | <dayl1ght> I'm getting 0 bytes leaked with -d:useMalloc and --gc:arc |
09:02:42 | Araq | yup, leaks. |
09:03:01 | FromDiscord | <dayl1ght> but if I change test() to test()[], it says 16 bytes leaked |
09:03:06 | FromDiscord | <dayl1ght> weird |
09:03:36 | Araq | sounds like a valgrind issue |
09:04:34 | FromDiscord | <dayl1ght> 😦 i'll try some alternatives |
09:04:44 | FromDiscord | <dayl1ght> thanks for the help |
09:05:17 | Araq | update it |
09:06:18 | FromDiscord | <dayl1ght> I'm running the latest version from git head 😄 |
09:06:37 | Araq | latest valgrind version? |
09:06:41 | FromDiscord | <dayl1ght> but it's a macos fork https://github.com/LouisBrunner/valgrind-macos |
09:06:47 | FromDiscord | <dayl1ght> yep |
09:07:11 | Araq | well it sounds like a regression, my osx valgrind is fine |
09:07:29 | FromDiscord | <dayl1ght> does it detect the leak on the code I sent above? |
09:09:58 | FromDiscord | <dayl1ght> it seems very flakey |
09:10:20 | FromDiscord | <dayl1ght> e.g. if I use proc main() = instead of when isMainModule, the leaks are shown |
09:11:06 | Araq | because then the memory isn't bound to a global |
09:11:21 | FromDiscord | <dayl1ght> and even with proc main(), leaks are only detected with --gc:arc |
09:11:42 | Araq | I think valgrind tries to only report "real" leaks aka non-reachable memory |
09:12:02 | Araq | if you assign it to a global, it remains reachable |
09:13:52 | Araq | valgrind --leak-check=full --show-leak-kinds=all |
09:13:57 | Araq | does detect it |
09:14:05 | Araq | on my machine |
09:14:18 | Araq | it's reliable |
09:17:32 | FromDiscord | <dayl1ght> yeah, seems to work for me too |
09:17:35 | FromDiscord | <dayl1ght> but only with --gc:arc |
09:18:03 | FromDiscord | <dayl1ght> thank you 🙂 |
09:18:07 | Araq | so what. --gc:arc is what you should use for new developments |
09:19:53 | FromDiscord | <dayl1ght> well, it doesn't work with cycles |
09:20:19 | FromDiscord | <mratsim> use --:orc |
09:20:31 | FromDiscord | <mratsim> They don't have cycles but they have axes |
09:20:47 | Zevv | wait, couldn't we build something in arc to detect cycles, and then offload to orc when it does?! |
09:21:28 | Araq | Zevv, yeah, kind of. |
09:21:43 | Zevv | dude I was trolling, and now you're taking me serious here?! |
09:21:55 | Araq | we can default to --gc:orc and strip out the unused tracing procs in a pre-linking step |
09:22:19 | FromDiscord | <mratsim> that sounds good |
09:22:27 | FromDiscord | <mratsim> isn't that type bound anyway |
09:22:41 | Araq | it is |
09:22:49 | FromDiscord | <mratsim> we know on type declaration which types can introduce cycles or not |
09:23:03 | FromDiscord | <mratsim> so gc:ord should have no overhead for types that can't have cycles |
09:23:03 | Zevv | ah right |
09:23:32 | Araq | that's true today already but iirc the tracing procs are not optimized out |
09:23:45 | Araq | and the C compiler has a hard time to strip them out |
09:24:07 | FromDiscord | <mratsim> when canHaveCycles(T): insertTracingProc() |
09:24:47 | Araq | yes, 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:56 | skrylar[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:41 | alehander92 | morning! |
10:44:09 | FromDiscord | <willyboar> hello alehander92 |
10:45:11 | alehander92 | hello brother |
10:46:22 | FromDiscord | <willyboar> best hour of the day |
10:54:07 | * | Vladar joined #nim |
10:54:45 | PMunch | Hmm, is there a way to detect from a template if you're the last thing in the scope? |
10:55:19 | PMunch | I 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:38 | PMunch | Or a way for an iterator whose last statement is a yield to consider itself done, that would also work |
11:04:41 | Araq | inside a macro you can analyse for that, PMunch |
11:05:16 | FromDiscord | <Zed> Does nim have any libraries for accessing device specs? ram, cpu etc.. |
11:05:49 | FromDiscord | <Zed> I cant seem to find anything that does it |
11:07:00 | PMunch | Araq, how? Only thing I can think of is instantiationInfo and reading the file manually, but that is super ugly.. |
11:07:01 | Araq | there 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:22 | Araq | PMunch, my bad |
11:08:04 | * | dadada joined #nim |
11:08:29 | * | dadada is now known as Guest86599 |
11:09:19 | FromDiscord | <Zed> Araq: How well do you know nim as the creator? |
11:09:20 | PMunch | @Zed, there's this: https://nimble.directory/pkg/psutil |
11:09:30 | * | krux02 joined #nim |
11:09:44 | PMunch | @Araq, what do you mean "my bad"? |
11:09:54 | Araq | PMunch, I misread your question |
11:10:02 | alehander92 | did sublime invent commandP |
11:10:10 | FromDiscord | <Zed> thanks PMunch! |
11:11:23 | * | pbb joined #nim |
11:12:26 | PMunch | Araq, ah, so it's not possible then? |
11:12:55 | Araq | Zed: good question, 90% ? |
11:13:15 | Araq | PMunch, yeah, doesn't look possible |
11:14:20 | PMunch | And no way to make iterators that yields as their last action to be considered finished either I assume? |
11:15:53 | FromGitter | <bung87> !repo ps_utils |
11:15:56 | disbot | https://github.com/Stephanevg/PSClassUtils -- 9PSClassUtils: 11A set of utilities to work with Powershell Classes 15 49⭐ 15🍴 7& 29 more... |
11:16:06 | FromGitter | <bung87> wrong again |
11:16:33 | Araq | PMunch, there is system.finished |
11:16:48 | PMunch | Yeah, to check if it is finished |
11:17:18 | FromGitter | <bung87> https://github.com/johnscillieri/psutil-nim |
11:18:04 | FromGitter | <bung87> @Zed does it fit your needs ? |
11:18:56 | PMunch | Araq: https://play.nim-lang.org/#ix=2oli <- This is my issue |
11:19:22 | PMunch | Basically having a `yield` as the last thing requires you to call the iterator once more before it is considered done |
11:21:52 | FromDiscord | <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:24 | FromGitter | <bung87> oh , yeah maintained in another repo , I forgot that |
11:23:30 | FromGitter | <bung87> https://github.com/juancarlospaco/psutil-nim I patched the OS X version |
11:24:07 | FromDiscord | <Zed> Thanks! ill test it out now |
11:32:49 | FromDiscord | <Zed> hmm still getting the same error on build |
11:33:36 | FromGitter | <bung87> um hold on, let me check |
11:36:25 | * | monokrom joined #nim |
11:42:06 | FromGitter | <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:21 | FromDiscord | <Zed> are you building from source or installing with nimble? |
11:43:40 | FromGitter | <bung87> building from source |
11:44:56 | FromGitter | <bung87> installation is just fine |
11:45:37 | Araq | PMunch, that's a known problem and I consider it un-fixable |
11:45:49 | Araq | as we only know the iterator is over one step after the fact |
11:45:55 | FromDiscord | <Zed> im installing with nimble, when building the project im getting↵`Error: cannot export: net_if_stats` |
11:46:29 | FromDiscord | <Zed> and an int to int32 error whch i fixed |
11:46:53 | FromGitter | <bung87> no net_if_stats proc_connections for macos |
11:47:31 | FromGitter | <bung87> see the source comment, I really tried but it didn't work out... |
11:47:41 | FromDiscord | <Zed> i wonder why it's throwing up errors then? |
11:50:40 | * | Tlanger quit (Quit: Leaving) |
11:55:24 | FromGitter | <bung87> you have Xcode or developer tools installed ? |
11:58:49 | PMunch | Araq, hmm okay. Guess my fibers will be stuck with an extra iteration then |
11:59:15 | Araq | async 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:55 | FromDiscord | <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:58 | FromGitter | <bung87> @Zed check mine patch https://github.com/bung87/psutil-nim |
12:11:04 | * | fredrikhr joined #nim |
12:11:13 | Araq | Kiloneie: do you show strscans? |
12:12:50 | FromDiscord | <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:10 | Araq | ok :-) |
12:13:38 | FromDiscord | <Zed> thanks bung87, ill check it out! |
12:14:37 | FromDiscord | <Kiloneie> soon also SDL series, i really wanna play with that |
12:15:18 | FromGitter | <bung87> guess you maybe the second person runs it on macOS |
12:17:13 | FromDiscord | <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:24 | FromDiscord | <Zed> hackintsoh |
12:17:30 | FromDiscord | <Zed> *hackintosh |
12:17:56 | FromDiscord | <Zed> not all parts work with mac os which is a problem |
12:18:08 | FromDiscord | <Kiloneie> What do you mean ? |
12:18:38 | FromDiscord | <willyboar> it is not worth it |
12:18:43 | FromGitter | <bung87> have you tried https://github.com/sickcodes/Docker-OSX |
12:19:56 | FromDiscord | <Kiloneie> will that be identical for recording like it would be on a mac ? |
12:20:13 | FromDiscord | <Kiloneie> i just need it for a single video |
12:20:27 | FromDiscord | <Kiloneie> i have no inclination to use a macOS |
12:20:29 | FromDiscord | <Zed> maybe borrow a mac from a friend? |
12:20:55 | FromDiscord | <Kiloneie> noone has one... only iphones... |
12:21:15 | FromDiscord | <Kiloneie> windows ftw xD.. |
12:21:39 | FromDiscord | <Rika> ~~buy one~~ |
12:21:45 | FromDiscord | <Rika> i am joking for obvious reasons |
12:21:58 | FromGitter | <bung87> hackintosh maybe the easy solution. |
12:22:06 | FromDiscord | <Kiloneie> xD.... thats like buying a PC preassemled from a large computer store |
12:22:15 | FromDiscord | <Kiloneie> aka bloody 2x price ripoffs |
12:22:17 | FromDiscord | <Kiloneie> literally |
12:22:42 | FromDiscord | <Rika> buy it, use it for a day, then sell it back |
12:23:04 | FromDiscord | <Kiloneie> xD no thanks |
12:23:19 | FromDiscord | <Zed> you could buy a cheap mac mini |
12:23:26 | FromDiscord | <Zed> after your usage setup as a server |
12:24:08 | FromDiscord | <Kiloneie> idk i will try hackitosh i guess one day, linux sooner as it's the easiest thing to install ever |
12:24:22 | FromDiscord | <Kiloneie> although what linux distro should i even use for the video... |
12:24:33 | FromDiscord | <Kiloneie> Ubuntu ? what... |
12:24:33 | FromDiscord | <Zed> ubuntu |
12:24:38 | FromDiscord | <Zed> the most popular one |
12:24:55 | FromDiscord | <Kiloneie> does Visual Studio Code work there ? |
12:25:00 | FromDiscord | <Rika> why wouldnt it |
12:25:03 | FromDiscord | <Zed> yes |
12:25:25 | FromGitter | <bung87> its ubuntu and vscode |
12:25:36 | FromDiscord | <Kiloneie> okay thanks, i mean i kinda knew it should, but it's not always that open source stuff works everywhere |
12:26:18 | FromGitter | <bung87> believe microsoft. |
12:26:56 | FromDiscord | <Kiloneie> Microsoft is awesome, but also not, them moneys swing around fast |
12:27:23 | alehander92 | yeah, a lot of stuff works on ubuntu |
12:27:42 | alehander92 | i use it |
12:27:57 | FromDiscord | <Kiloneie> since microsoft did a 180 on their hate of open source lol |
12:28:03 | FromGitter | <bung87> free open source IDE what else you need.... |
12:28:05 | alehander92 | i don't know, windows is paid |
12:28:14 | alehander92 | i don't really need it so much, so i prefer not to pay |
12:28:28 | alehander92 | and linux seems to work fine, also its easier to understand/tweak |
12:28:29 | FromDiscord | <Kiloneie> who said you should pay for it 😛 ? |
12:28:38 | alehander92 | well, dude, i didn't , but piracy sucks |
12:28:57 | FromDiscord | <Kiloneie> guess i am evil D: |
12:29:04 | alehander92 | it's not like i still dont do it with movies , so guilty as charged |
12:29:18 | FromDiscord | <Kiloneie> probably owing them millions xD |
12:29:19 | alehander92 | but i wish if i could not pirate software where possible |
12:29:28 | FromDiscord | <Kiloneie> i try that as well |
12:29:41 | FromDiscord | <Kiloneie> but not windows... it's embeded into my brainz xD |
12:29:46 | alehander92 | of course, windows is hard to replace for many tasks sadly |
12:29:51 | FromGitter | <bung87> without windows how you play computer games |
12:29:56 | alehander92 | but i'd say, try linux |
12:30:09 | alehander92 | i dont feel the need to run windows in probably an year |
12:30:28 | FromDiscord | <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:41 | FromDiscord | <Kiloneie> especially those in pre 2004 smthing |
12:30:43 | alehander92 | well, i guess i'd prefer a console |
12:30:57 | alehander92 | but i am not really this kind of gamer |
12:31:10 | alehander92 | but even in this case one can use windows for games and linux for the other stuff |
12:31:19 | FromDiscord | <Kiloneie> that is true |
12:31:22 | alehander92 | like, usually i need a browser/terminal/all kinds of dev stuff |
12:31:27 | FromDiscord | <Kiloneie> easiest dual boot ever |
12:31:30 | alehander92 | and usually those work great in most systems |
12:31:39 | FromGitter | <bung87> I have three computers |
12:31:44 | alehander92 | and a lot of dev stuff is easier to install/setup on linux |
12:31:59 | alehander92 | except usually windows-specific stuff, but even nowadays .net might be easier, dont know |
12:32:22 | alehander92 | i guess osx is also a valid choice, but i almost never used it |
12:33:00 | FromGitter | <bung87> if you dont do design things then linux is just fine |
12:37:55 | FromDiscord | <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:46 | FromDiscord | <mratsim> windows game don't work on WIndows for me but work on Linux 😛 |
12:41:44 | FromDiscord | <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:58 | FromDiscord | <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:06 | livcd | Kilonie: piracy is bad.Period. |
12:43:19 | FromDiscord | <Kiloneie> I beg to differ 😛 |
12:43:26 | FromDiscord | <Rika> #offtopic |
12:43:36 | FromDiscord | <Rika> for the piracy thing |
12:43:49 | FromDiscord | <Rika> i just want nim exposure vids lmao |
12:43:53 | FromDiscord | <exelotl> But we're talking about music in offtopic :( |
12:44:18 | * | NimBot joined #nim |
12:45:05 | FromDiscord | <exelotl> (OK in fairness nobody spoke for half an hour) |
12:45:22 | FromDiscord | <Kiloneie> Would you watch how to make a game using SDL ? Let's say not pacman... mario clone ? |
12:51:33 | FromGitter | <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:38 | FromDiscord | <willyboar> @Kiloneie it depends on your target group |
12:57:11 | FromDiscord | <willyboar> sure arraymancer usage would be a great video for nim users |
12:58:00 | FromDiscord | <willyboar> but let's be honest, if you want views a mario clone is probably a better path |
13:09:47 | FromDiscord | <mratsim> If I can make Arraymancer play pong tht would be OK |
13:10:27 | FromDiscord | <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:44 | FromDiscord | <willyboar> hehe probably |
13:11:08 | FromDiscord | <mratsim> and also I tried a technique that only has a single (Tetris) paper but no reference code |
13:11:14 | FromDiscord | <mratsim> I hate papers without code :/ |
13:11:34 | FromDiscord | <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:35 | FromDiscord | <Zachary Carter> I don't want to watch videos |
13:12:39 | FromDiscord | <Zachary Carter> textual tutorials are better |
13:12:57 | FromDiscord | <Rika> some people prefer videos too |
13:13:03 | FromDiscord | <Rika> but its preference |
13:13:30 | FromDiscord | <Zachary Carter> I only find videos helpful when the visuals will actually add value to the subject |
13:13:52 | FromDiscord | <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:56 | FromDiscord | <Zachary Carter> or where something is located |
13:14:24 | FromDiscord | <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:32 | FromDiscord | <Zachary Carter> but yes - I know - different strokes for different folks |
13:16:42 | * | zacharycarter joined #nim |
13:17:15 | alehander92 | i think streaming / twitch-ing seems fun |
13:17:23 | alehander92 | because there is more interaction |
13:17:40 | alehander92 | but yeah, some people like videos, some not so much |
13:17:50 | alehander92 | its too subjective |
13:19:04 | FromDiscord | <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:29 | FromGitter | <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:50 | Araq | maybe not because of alignment |
13:34:09 | FromGitter | <tim-st> thanks, uint16 down't work too, only uint8 |
13:34:33 | FromGitter | <tim-st> I tried `{.packed.}` but it seems not working there |
13:34:52 | Araq | uint16 is aligned too |
13:35:08 | FromGitter | <tim-st> ok, thanks, I will used the byte array then, and cast it |
13:43:12 | FromGitter | <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:56 | Araq | that's a bug, please report it |
13:44:12 | Araq | (I thought we made one syntax a warning in 1.0 ?) |
13:45:07 | FromGitter | <tim-st> I think the syntax didn't work at the field level, so it didn't compile |
14:00:05 | alehander92 | Araq |
14:00:31 | alehander92 | btw can we make a warning |
14:00:41 | alehander92 | about module names shadowing names defined in them |
14:00:57 | alehander92 | a friend hit that yesterday and it totally confused him |
14:01:44 | Araq | we can, but the lack of a spec bites us. we might as well make it work when we understand what "work" means |
14:01:47 | alehander92 | i guess shadowing names imported from other modules also seems important tho: e.g. import a, b # b also defines a |
14:02:39 | alehander92 | so only `.` is valid for a namespace, i guess |
14:03:16 | alehander92 | the problem is `a.b` can be `b` int name in `a` module or `bf` int field in `a` |
14:03:31 | alehander92 | `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:34 | FromGitter | <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:41 | FromDiscord | <exelotl> oh yeah I remember @djazz battling with this issue on stream once x) |
14:54:57 | FromDiscord | <djazz> oh ye |
15:12:17 | Yardanico | @mratsim btw, found https://github.com/browserdotsys/vecchio (seems to be a new repo) |
15:12:28 | Yardanico | ray tracing in one weekend in rust, seems to use https://github.com/rayon-rs/rayon for parallelism |
15:13:24 | FromDiscord | <mratsim> Most of the Rust are using rayon for parallelism but rayon only supports a limited form of parallel_for |
15:13:35 | FromDiscord | <mratsim> via "par_iter" |
15:13:58 | Yardanico | they also seem to have more lower-level things like "join" and "sync" |
15:14:12 | Yardanico | join and scope* |
15:14:38 | * | clemens3 joined #nim |
15:14:40 | FromDiscord | <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:50 | Yardanico | oh lol |
15:15:02 | FromDiscord | <mratsim> OpenMP static is the left |
15:15:13 | Yardanico | they said work stealing so I assumed it was pretty good :P |
15:15:25 | FromDiscord | <mratsim> work-stealing is good, you can go far with that |
15:15:50 | bung | if I test algorithm performance what gc should I use? |
15:16:05 | Yardanico | default and arc (assuming your algo doesn't use cycles) |
15:16:13 | FromDiscord | <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:28 | bung | results randomly |
15:16:37 | bung | with default |
15:16:41 | FromDiscord | <mratsim> Weave is doing lazy splitting, it's split on demand |
15:16:54 | FromDiscord | <mratsim> so it adapts to hardware and load realities |
15:16:57 | Yardanico | bung: well default GC isn't 100% deterministic :P |
15:17:02 | Yardanico | also there's the OS and stuff |
15:17:10 | Yardanico | take a sample of at least 50 runs for reliable results |
15:17:24 | Yardanico | by using cputime and stat module for example |
15:17:26 | FromDiscord | <mratsim> when you test algorithm performance, the most important thing to do is `killall nimsuggest` |
15:17:46 | Yardanico | i don't have to do that since I use bung's vscode extension which uses nimlsp :P |
15:18:26 | bung | ok 50 runs , I'll try that first |
15:18:39 | FromDiscord | <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:02 | FromDiscord | <mratsim> also don't use cpuTime() when testing multithreaded application, use getMonotime() |
15:19:04 | bung | epochTime does not correct? |
15:19:23 | FromDiscord | <mratsim> epochTime is OK but subject to time changes |
15:19:31 | FromDiscord | <Shucks> What data type should i use for memory addresses? Im running into overflowerror's if im using uint |
15:19:33 | FromDiscord | <mratsim> like if you adjust time in the middle of the bench |
15:19:46 | FromDiscord | <mratsim> cast[ByteAddress] |
15:19:59 | FromDiscord | <Shucks> Thank you |
15:20:22 | FromDiscord | <mratsim> and for memory offset computation use +% and -% operator |
15:20:24 | bung | ok , then cputime better as it for machine |
15:20:40 | Yardanico | monotimes is even better but it has relatively big overhead over cputime :P |
15:20:50 | Yardanico | but it only matters if your algo runs millions of times a second |
15:21:00 | FromDiscord | <mratsim> there is no overhead |
15:21:10 | FromDiscord | <mratsim> @Shucks example pointer arithmetic: https://github.com/mratsim/trace-of-radiance/blob/99f7d85dec857f0efa0c9b0eafd339871599c0e1/trace_of_radiance/io/h264.nim#L54-L55 |
15:21:13 | Yardanico | some person told me there's high overhead for monitimes, hmm |
15:21:20 | Yardanico | I 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:57 | bung | I got expected results :P |
15:25:03 | bung | algorithm lib Costs(seconds):0.032328 |
15:25:05 | bung | timSortlib Costs(seconds):0.008038 |
15:25:12 | Yardanico | also try with arc |
15:25:20 | Yardanico | if you're on latest devel or 1.2.2 beta |
15:26:42 | bung | Error: system module needs: nimDestroyAndDispose how to solve this when use arc |
15:26:52 | Yardanico | what nim version you're on? |
15:27:03 | bung | 1.2.0 |
15:27:11 | Yardanico | well it doesn't have quite a lot of arc fixes |
15:27:14 | Yardanico | try devel or 1.2.2 beta pls :P |
15:28:36 | bung | I hope nim c sources has mirror on nim-lang.org, very slow download from github |
15:29:18 | * | waleee-cl joined #nim |
15:29:23 | bung | 32kb/s like am dial telephone |
15:29:43 | Yardanico | nim csources are 0.20.0 |
15:29:49 | Yardanico | they're frozen |
15:30:14 | bung | hmm choosenim always download it.. |
15:31:17 | shashlick | Latest should download only once |
15:32:21 | bung | ok let me update it self |
15:37:56 | * | solitudesf- joined #nim |
15:40:15 | * | solitudesf quit (Ping timeout: 246 seconds) |
15:47:19 | bung | still same , it's compile flag? |
15:48:26 | Yardanico | not sure, maybe the code |
15:52:01 | bung | hmm 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:32 | bung | gc:orc also throw this |
15:54:52 | Yardanico | bung: well ORC doesn't differ from arch *that* much |
15:55:10 | Yardanico | it'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:55 | bung | all I used times,algorithm,sugar,random and the lib its self. |
15:57:43 | bung | the lib only use sequtils |
15:57:53 | Yardanico | can you give the code in a playground? |
15:59:02 | bung | hmm sequtils not used , let me clean code first |
15:59:34 | * | konvertex joined #nim |
16:01:24 | bung | https://github.com/bung87/tim_sort |
16:01:49 | bung | https://github.com/bung87/tim_sort/blob/master/tests/test_performance.nim |
16:02:31 | Yardanico | bung: also for the future - put code in the main proc |
16:02:35 | FromDiscord | <Rika> nice |
16:03:00 | Yardanico | and yeah it works for me with arc just fine on latest devel |
16:03:11 | Yardanico | maybe it's some issue with choosenim or your stdlib paths or something |
16:03:42 | Yardanico | also I didn't literally mean to capture time of _all_ 50 times :P |
16:03:47 | Yardanico | I mean capture time for each iteration |
16:06:29 | bung | oh found it only happend when add gc flag to .cfg |
16:07:13 | * | filcuc joined #nim |
16:09:25 | Yardanico | bung: something like https://play.nim-lang.org/#ix=2omh |
16:09:28 | bung | then how can I compare |
16:10:09 | Yardanico | check "mean" |
16:10:22 | Yardanico | also wait |
16:10:28 | Yardanico | you have incorrect code |
16:10:33 | Yardanico | you're sorting the same list over and over |
16:10:37 | Yardanico | I mean you're sorting the already sorted list |
16:11:06 | Yardanico | https://play.nim-lang.org/#ix=2omi fixed version |
16:11:06 | * | Senketsu quit (Ping timeout: 256 seconds) |
16:11:08 | bung | I know that but it still do process right? |
16:11:17 | Yardanico | timsort is actually slower :P |
16:11:46 | Yardanico | on 5000 iterations I get 506 mean for Algorithm and 541 mean for TimSort |
16:12:20 | Yardanico | bung: it does process stuff, but it doesn't represent the real performance of all iterations |
16:12:30 | Yardanico | since subsequent iterations sort an already sorted sequence |
16:12:46 | bung | ok, let me check |
16:12:54 | Yardanico | std deviation in tim_sort is really high though |
16:13:01 | Yardanico | min 518 max 1270 |
16:13:23 | Yardanico | timsort deviates a lot |
16:13:33 | Yardanico | also "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:02 | bung | std deviation what this means |
16:15:09 | Yardanico | https://en.wikipedia.org/wiki/Standard_deviation |
16:15:15 | Yardanico | how much variation you have in results |
16:15:24 | Yardanico | a high value means that the timing is pretty unstable |
16:15:39 | Yardanico | so it can take as low as 530 microseconds or as high as 1500 microseconds |
16:15:42 | Yardanico | 3x difference |
16:16:42 | bung | i checked tim sort faster |
16:16:48 | Yardanico | sort in nim algorithm is not dumb either |
16:16:51 | Yardanico | it's a variant of merge sort |
16:16:57 | Yardanico | bung: for me algorithm is faster by "mean" :P |
16:17:12 | Yardanico | around 50 microsecond difference in total but it is faster |
16:17:42 | bung | on my machine only std deviation higher |
16:17:43 | Yardanico | see 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:21 | Yardanico | bung: https://gist.github.com/Yardanico/e01a388a4efa50e5a55000121f1d8297 |
16:18:39 | Yardanico | sometimes timsort std deviation is fine, some times it blows out of proportion |
16:22:01 | bung | with gc arc all better than algorithm |
16:22:20 | Yardanico | but both are slower than without arc :P |
16:22:36 | * | chemist69 quit (Ping timeout: 246 seconds) |
16:22:37 | bung | https://pastebin.com/xKCdUkYq |
16:22:59 | * | chemist69 joined #nim |
16:23:14 | Yardanico | bung: yeah i checked too |
16:23:18 | Yardanico | why do you have such a huge mean? |
16:23:20 | Yardanico | can you show your code? |
16:23:29 | Yardanico | or maybe you modified tim_sort or something |
16:23:42 | bung | and refc https://pastebin.com/WvK4vQSz |
16:23:58 | Yardanico | yes as I said timsort is faster than algorithm for me with arc, but they're both slower than without arc |
16:26:11 | bung | yeah, 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:58 | bung | I 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:47 | Yardanico | bung: you can just optimize nim code you have further :P |
16:34:44 | FromDiscord | <djazz> Havent coded with Nim for two months, anything interesting since March? |
16:36:12 | Yardanico | scroll through the forum https://forum.nim-lang.org/ |
16:36:17 | Yardanico | check new issues/PRs opened in two months :P |
16:38:06 | lbart | do you know some projects which export c libraries and header (and use the .so in c app)? |
16:38:42 | disruptek | !repo gittyup |
16:38:43 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 2⭐ 1🍴 |
16:39:07 | Yardanico | lbart: I made a simple example myself a while ago |
16:39:07 | Yardanico | https://github.com/Yardanico/nim-snippets/tree/master/clib |
16:39:26 | Yardanico | if I understood you correctly |
16:39:40 | Yardanico | in the nim side it's really simple |
16:39:55 | Yardanico | just add {.exportc, dynlib.} to every proc you need in the .so or use push pragma |
16:41:23 | bung | Yardanico ok, I'll check it later. |
16:44:33 | lbart | thanks. 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:17 | Yardanico | I 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:14 | Yardanico | for linux it makes a "N_LIB_PRIVATE void NIM_POSIX_INIT NimMainInit(void)" function |
16:46:16 | Yardanico | which calls NimMain |
16:46:24 | Yardanico | so you don't need to worry about it in your C code |
16:46:35 | Yardanico | assuming you compile with arc of course :) there might be more problems with refc |
16:47:16 | lbart | "arc" not found ;) |
16:47:24 | Yardanico | it's available in nim 1.2.0+ |
16:47:36 | Yardanico | but for best experience use devel or at least beta 1.2.2 |
16:47:53 | Yardanico | beta 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:19 | Yardanico | or https://github.com/nim-lang/nightlies/releases/tag/2020-06-01-version-1-2-5702a60 |
16:50:14 | FromGitter | <matrixbot> `Integrated 555` Hi, I want to ask if anyone knows the difference between rust and nim when we talk about security |
16:50:16 | Yardanico | for 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:39 | lbart | Thanks Yardanico |
16:54:22 | FromGitter | <matrixbot> `Integrated 555` thanks |
16:54:40 | Yardanico | @Integrated well it depends on what you mean by "security", but really make a forum post for better discussion |
16:55:00 | Yardanico | and by the message with 5734 forum thread I didn't reply to you :P |
16:55:26 | FromGitter | <matrixbot> `Integrated 555` haha |
16:55:27 | FromGitter | <matrixbot> `Integrated 555` okk |
17:02:39 | planetis[m] | `Integrated 555`: join #freenode_#nim:matrix.org , you will avoid an extra indirection :) |
17:14:44 | bung | Yardanico std deviation prior than mean ? |
17:16:40 | FromGitter | <ynfle> what is `getImpl` supposed to do ? |
17:19:35 | bung | hard 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:43 | hvn | hello, 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:28 | disruptek | hvn: 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:10 | disruptek | ssl/tls is a complete clusterfuck no matter where it's used. |
18:43:25 | disruptek | but especially in nim software. |
18:44:00 | disruptek | you 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:10 | krux02 | disruptek, are you streaming again? |
19:04:38 | disruptek | only vitriol. |
19:05:39 | disruptek | a rat always knows when he's in with weasels. |
19:09:55 | * | tane quit (Ping timeout: 260 seconds) |
19:11:37 | supakeen | What was the name of the 'more advanced' stdlib again, fusion? |
19:11:51 | Araq | yeah but it's in early stages of development |
19:11:54 | supakeen | Ah yes. |
19:12:00 | supakeen | Yea but I liked the idea behind it. |
19:27:38 | FromDiscord | <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:43 | krux02 | disruptek, I only know Vitriol from Dungeons of Dredmor |
19:28:58 | krux02 | so what do you mean? |
19:30:40 | * | gangstacat joined #nim |
19:35:05 | disruptek | a "stream of vitriol" is, like, a series of personal and vindictive attacks. bitter, abusive, and generally superlative. |
19:35:24 | disruptek | verbal invective. not physical. |
19:43:02 | * | silvernode_ quit (Ping timeout: 256 seconds) |
19:52:56 | * | Senketsu joined #nim |
20:01:07 | FromDiscord | <Shucks> Sorry for that newcomer question: https://play.nim-lang.org/#ix=2ong |
20:01:42 | * | kenran quit (Ping timeout: 246 seconds) |
20:02:27 | Araq | Shucks: you cannot bitand a float |
20:04:15 | * | aeverr joined #nim |
20:04:33 | FromDiscord | <Shucks> oh |
20:05:43 | * | monokrom quit (Read error: Connection reset by peer) |
20:15:23 | Zevv | one can alwys try |
20:29:12 | * | bung joined #nim |
20:29:52 | FromDiscord | <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:42 | FromGitter | <ynfle> What are you trying to do? |
20:33:32 | * | bung quit (Ping timeout: 246 seconds) |
20:35:27 | FromDiscord | <Kiloneie> im just trying to overload += to work with strings for my video and it won't work... idk D: |
20:37:17 | FromDiscord | <Generic> don't give the wrong people this knowledge 🙂 |
20:38:08 | FromDiscord | <Kiloneie> yeah i know people might want to customize Nim to their previous language... |
20:38:21 | FromDiscord | <Generic> https://play.nim-lang.org/#ix=2ont |
20:39:12 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2onv |
20:39:14 | FromDiscord | <Kiloneie> what... okay i guess i was being stupid, i did a real dumb contentation in mine xD |
20:39:29 | FromGitter | <kaushalmodi> Kiloneie: https://nim-lang.github.io/Nim/manual#procedures |
20:39:34 | FromGitter | <ynfle> use `&=` instead |
20:39:58 | FromDiscord | <Kiloneie> yeah i used a = a & b ... guess that doesn't work |
20:40:18 | FromGitter | <ynfle> var a `var string`? |
20:40:46 | FromGitter | <kaushalmodi> Kiloneie: You might need to distinguish between a unary and binary operator proc signature |
20:40:56 | FromDiscord | <Generic> though I suggest showing something else instead, like overriding the [] operator for a container |
20:40:57 | FromDiscord | <Kiloneie> i did this: https://play.nim-lang.org/#ix=2onz |
20:41:06 | FromDiscord | <Kiloneie> okay |
20:41:30 | FromDiscord | <Rika> you hafve a return value but never use it |
20:41:33 | FromDiscord | <Rika> thats why it doesnt work |
20:41:45 | FromDiscord | <Rika> remove the : string at the end of the function then you're good to go, afai |
20:41:46 | FromDiscord | <Rika> k* |
20:42:16 | FromDiscord | <Kiloneie> okay, imma put a bag of shame on my head now D: |
20:43:04 | FromDiscord | <Rika> 😛 |
20:43:10 | FromDiscord | <Rika> the name of your proc has no issue |
20:43:12 | FromDiscord | <Rika> but dont do that please |
20:43:15 | FromDiscord | <Rika> XD |
20:43:44 | FromDiscord | <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:00 | disruptek | Error: type mismatch: got <string> but expected 'bool' |
20:49:06 | disruptek | great, but FUCKING WHERE? |
20:49:40 | * | zedeus joined #nim |
20:57:29 | * | inv2004 joined #nim |
20:57:45 | inv2004 | If no replies in telegram - I goes here :) |
20:58:04 | Araq | disruptek, the compiler outputs line information |
20:58:17 | inv2004 | Is 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:48 | FromDiscord | <Rika> inv2004: i have no clue what you're trying to do |
21:00:54 | FromGitter | <ynfle> What does it mean if a node is a symbol? |
21:01:21 | FromDiscord | <Recruit_main707> @Kiloneie have you considered showing operator overloading with arrays? |
21:01:21 | FromGitter | <ynfle> ie., what's the difference between nnkSym, nnkIdent |
21:01:34 | FromDiscord | <Rika> sym is bound, ident is not afaik |
21:01:35 | inv2004 | Rika, I am trying to autogenerate `k` and `v` for Table[T1] - because T1 has k and v fields |
21:01:50 | FromDiscord | <Recruit_main707> thats somewhat useful and usable, (and you also teach about arrays if you havent) |
21:01:55 | * | haxscramper joined #nim |
21:02:00 | FromDiscord | <Rika> maybe look into the `fields` and `fieldpairs` iterators in `iterators`? |
21:02:12 | FromDiscord | <Rika> https://nim-lang.org/docs/iterators.html#fields.i%2CT? |
21:03:01 | FromGitter | <ynfle> @Rika, what does bound mean? |
21:03:31 | FromDiscord | <Rika> uh :blobsweats: |
21:04:05 | * | haxscramper left #nim (#nim) |
21:04:10 | * | haxscramper joined #nim |
21:04:12 | FromGitter | <ynfle> Has semantic meaning? |
21:04:27 | FromGitter | <ynfle> Not nnkLit? |
21:05:45 | inv2004 | Rika, I do not have value, just a type |
21:06:21 | inv2004 | but the question is not how to extract fields - I did it, but how to create getters from the fields |
21:08:08 | FromGitter | <ynfle> Fields are getters |
21:09:21 | inv2004 | ynfle, not for Table[T1] ! |
21:09:24 | * | Vladar quit (Quit: Leaving) |
21:12:04 | FromDiscord | <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:14 | FromDiscord | <Rika> im not sure honestly |
21:15:32 | inv2004 | Rika, 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:03 | FromDiscord | <Rika> you make the macro and use it as a pragma |
21:16:04 | krux02 | disruptek, 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:33 | FromDiscord | <Rika> i wish i could make a block statement that i could only break if the break's accompanied with the label |
21:18:45 | FromDiscord | <Rika> but that makes no sense haha |
21:19:15 | disruptek | Araq: the compiler only points to a macro. |
21:19:35 | inv2004 | Rike, 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:37 | inv2004 | there |
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:34 | FromDiscord | <Rika> dont think so |
21:42:30 | zedeus | implementing 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:35 | rockcavera | guys, 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:37 | disbot | ➥ add 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:45 | Araq | disruptek, try --expandMacro:... |
22:03:00 | * | zedeus joined #nim |
22:03:04 | disruptek | the macro is expanding fine, seemingly. |
22:03:31 | disruptek | this is a simple compile-time json renderer. |
22:03:43 | Araq | rockcavera, I'll ping dom96 once again |
22:03:57 | disruptek | i gotta go ice my balls, this is ridonk. |
22:08:35 | rockcavera | Araq, thanks. |
22:08:36 | * | Trustable quit (Remote host closed the connection) |
22:09:56 | dom96 | Why ping me? |
22:10:04 | dom96 | Did you not see my comment? |
22:10:45 | rockcavera | dom96, I saw it, but honestly I don't know how to solve it. |
22:15:14 | * | NimBot joined #nim |
22:33:22 | disruptek | i seem to have hit the fieldPairs() impl bug. |
22:35:43 | * | neceve_ quit (Ping timeout: 260 seconds) |
22:41:04 | disruptek | ah, you have to name your gensyms. |
22:44:16 | disruptek | gah, 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:23 | voltist | Is there a way to pass arguments to the compiler from inside a Nim file? |
23:05:38 | voltist | C compiler that is, not the Nim compiler |
23:05:57 | aeverr | --passC i think? no clue |
23:06:51 | voltist | Yeah I just don't know how to do it from Nim code |
23:10:30 | FromDiscord | <Rika> {.emit: "c code".} |
23:10:32 | FromDiscord | <Rika> ? |
23:10:41 | FromDiscord | <Rika> ah |
23:10:42 | FromDiscord | <Rika> arguments |
23:10:43 | FromDiscord | <Rika> no clue on that |
23:10:44 | FromDiscord | <Rika> 😛 |
23:12:09 | voltist | Ive got passc but that doesn't seem to be much help |
23:13:24 | voltist | I'm trying to get something compiling with glib2, so `{.passc: staticExec("pkg-config --cflags --libs glib-2.0").}` should work right? |
23:13:36 | voltist | Given that `pkg-config --cflags --libs glib-2.0` works |
23:17:54 | voltist | It 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:12 | voltist | Same with --passC |
23:23:12 | * | zedeus quit (Ping timeout: 260 seconds) |
23:23:40 | * | zedeus joined #nim |
23:25:21 | FromDiscord | <Rika> i'm wondering whether i should use `Option` for errors or `exceptions` |
23:33:55 | FromDiscord | <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 |