00:04:54 | FromDiscord | <mratsim> @fwsgonzo the plan is to move towards formal verification: https://nim-lang.org/docs/drnim.html |
00:05:37 | FromDiscord | <mratsim> Also see the destructors article and this RFC which has been implemented as of 1.4: https://github.com/nim-lang/RFCs/issues/178 |
00:05:38 | disbot | ➥ lent/var/openArray inside objects/containers |
00:15:51 | FromDiscord | <fwsgonzo> looks awesome 🙂 |
00:57:24 | * | lritter quit (Quit: Leaving) |
00:59:33 | * | Sembei quit (Quit: WeeChat 3.0) |
01:08:24 | * | apahl quit (Ping timeout: 240 seconds) |
01:09:28 | * | vesper11 joined #nim |
01:09:37 | * | apahl joined #nim |
01:17:35 | * | xace quit (Ping timeout: 265 seconds) |
01:19:20 | * | xace joined #nim |
01:19:43 | * | Tanger joined #nim |
01:20:20 | FromDiscord | <Rebel> Best way to do pipelining in Nim or distributed task scheduling? |
01:23:59 | FromDiscord | <Zachary Carter> Is disruptek ever coming back? |
01:26:08 | FromDiscord | <shadow.> no idea |
01:32:52 | FromDiscord | <Rebel> ¯\\_(ツ)\_/¯ |
01:33:04 | FromDiscord | <Rebel> All caused due to the great debate |
01:33:14 | FromDiscord | <Rebel> And the worse part is my code is still blocking asf |
01:33:53 | FromDiscord | <Zachary Carter> nah you didn't cause that, it was long overdue |
01:34:11 | FromDiscord | <Zachary Carter> they just need to block one another - but I guess due to the fact that one uses discord and the other uses IRC it's not possible |
01:47:45 | FromDiscord | <Zachary Carter> I don't know what you're trying to build so I can't really comment on your code blocking issues |
01:48:11 | FromDiscord | <Zachary Carter> if you're used to multithreaded programming in other languages - doing it in Nim shouldn't be too difficult |
01:48:44 | FromDiscord | <Zachary Carter> if you're not, you're probably better off learning the basics in another language that has more learning resources available and then coming back to your Nim issue |
01:50:23 | FromDiscord | <Zachary Carter> but again - not really sure what you're trying to build / where you're running into issues |
02:13:38 | * | abm quit (Quit: Leaving) |
02:14:09 | * | apahl_ joined #nim |
02:16:05 | FromDiscord | <Theodore> Nim equiv. of numpy? |
02:16:52 | FromDiscord | <flywind> !arraymancer |
02:16:56 | * | apahl quit (Ping timeout: 240 seconds) |
02:17:07 | FromDiscord | <flywind> (edit) "!arraymancer" => "!repo arraymancer" |
02:17:23 | FromDiscord | <Theodore> perfecto |
02:18:24 | FromDiscord | <flywind> and https://github.com/xflywind/awesome-nim#matrix |
02:25:54 | FromDiscord | <Quibono> I think you mean the python equivalent of arraymancer lol |
02:45:32 | FromDiscord | <Quibono> So I've got to write an API layer for a website in Nim. It's already got an official python sdk, do you think it would be faster to just port that to nim, or write from scratch> |
02:46:38 | FromDiscord | <flywind> which `sdk`? |
02:46:57 | FromDiscord | <Quibono> https://github.com/Kucoin/kucoin-python-sdk |
02:49:53 | FromDiscord | <flywind> If you only need small parts of it, I think you could write from scratch in Nim. |
02:50:14 | FromDiscord | <Quibono> Lol it's hard to decide how much I'll need. |
02:51:07 | FromDiscord | <flywind> You could port them first, then decide whether rewrite it in Nim. |
02:54:49 | FromDiscord | <emizzle> Is there a known way to download a resource in a sandbox (for the purposes of getting its byte header content type)? |
03:04:32 | FromDiscord | <Rebel> Is it possible to make a table a threadvar in Nim? running into some very weird errors... |
03:14:15 | FromDiscord | <Rebel> nvm was being smoothbrained |
03:39:54 | * | kiwi_83 joined #nim |
03:40:27 | kiwi_83 | the parentheses surrounding the ternary conditional expression in a one-liner is to initiate a new block rite |
03:44:05 | FromDiscord | <William_CTO> why is `!=` deprecated? |
03:44:28 | FromDiscord | <William_CTO> `if resp.status != Http200:`↵Warning: Deprecated since v1.2; use rawCode == $code instead; == is deprecated [Deprecated] |
03:47:59 | FromDiscord | <Rebel> yikes I use `!=` in a lot of places in my codebase... |
03:48:15 | FromDiscord | <Rebel> ok well actually just 14 places |
03:48:26 | FromDiscord | <William_CTO> wait |
03:48:29 | FromDiscord | <Rebel> Also Python's asyncio.Queue is == to x in Nim |
03:48:35 | FromDiscord | <Rebel> (edit) removed "is" |
03:48:41 | FromDiscord | <Rebel> (edit) removed "to" |
03:48:41 | FromDiscord | <William_CTO> I think that's a deprecation notice from httpclient |
03:48:43 | FromDiscord | <William_CTO> one moment |
03:49:04 | FromDiscord | <William_CTO> yep |
03:49:20 | FromDiscord | <William_CTO> I understand the message now |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:33 | * | supakeen joined #nim |
04:08:57 | * | nixfreak joined #nim |
04:09:18 | FromDiscord | <nikki> @William_CTO pretty cool tho right |
04:14:36 | FromDiscord | <William_CTO> hmm? |
04:18:47 | * | apahl_ quit (Ping timeout: 260 seconds) |
04:19:41 | * | apahl joined #nim |
04:27:17 | leorize[m]1 | @William_CTO use `resp.code == Http200` instead. `status` is the entire status line |
04:28:02 | FromDiscord | <William_CTO> 🤦♂️ |
04:28:47 | FromDiscord | <William_CTO> Thanks |
04:41:23 | * | a_chou joined #nim |
04:46:25 | * | narimiran joined #nim |
04:58:34 | * | a_chou quit (Remote host closed the connection) |
05:07:11 | FromDiscord | <Bahaa> Sorry what debate? |
05:07:35 | FromDiscord | <Bahaa> Gotta know what debate caused someone to quit the server 😅 |
05:16:15 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:19:43 | FromDiscord | <Rebel> Just do `from:Rebel#1782 job` in discord search and find the message at 11/26/2020 at 2:09 PM EST and read from there |
05:22:16 | * | thomasross quit (Ping timeout: 240 seconds) |
05:25:00 | FromDiscord | <Bahaa> So someone quit the server because they don't like async and apparently not everyone agrees? |
05:36:58 | FromDiscord | <Avatarfighter> wait who quit |
05:37:04 | FromDiscord | <Avatarfighter> this is some juicy nim drama |
05:37:08 | FromDiscord | <Avatarfighter> @Bahaa spill da beans |
05:42:20 | FromDiscord | <Rika> @Avatarfighter disruptek I believe |
05:42:42 | FromDiscord | <Avatarfighter> WHAT |
05:42:51 | FromDiscord | <Avatarfighter> has he come back too irc? |
05:43:09 | FromDiscord | <Rika> I don't know dude |
05:43:16 | FromDiscord | <Avatarfighter> wtf |
05:43:33 | FromDiscord | <Rebel> bruh just read from where I said if you want to get filled in lol |
05:43:47 | FromDiscord | <Rebel> Also realize I maybe should've just coroutines 😦 |
05:44:28 | FromDiscord | <Rebel> I did end up going the thread route as idk how to do this fully asynchronous without introducing threads into the mix. My while true loop is blocking and will not exit so big sad. |
05:46:23 | FromDiscord | <Idefau> hmm i like the second advent of code problem |
05:46:55 | FromDiscord | <Rebel> hmmm yeah might try and do it in one line |
05:47:11 | FromDiscord | <Rebel> Can easily do it in one line with Python but idk about Nim |
05:47:22 | FromDiscord | <Rebel> at least the first part lol idk about the second |
05:49:01 | kiwi_83 | `"abcdefg"[0 .. ^2]` what does ^ mean here |
05:49:26 | FromDiscord | <Idefau> "until the penultimate item" |
05:49:57 | FromDiscord | <Avatarfighter> https://nim-lang.org/docs/theindex.html#%60..%5E%60 |
05:50:08 | narimiran | kiwi_83: second from last |
05:50:20 | narimiran | kiwi_83: like `-2` in python |
05:54:59 | kiwi_83 | ohhh thanks! I kept thinking 'this can't be a power raised to 2 lmao' |
06:08:19 | leorize[m]1 | wait disruptek quit? what? |
06:12:09 | FromDiscord | <Idefau> yay i finished both parts |
06:12:59 | FromDiscord | <Idefau> how are scores calculated |
06:13:09 | FromDiscord | <Idefau> like how soon did you finish the exercise? |
06:16:25 | narimiran | scores: how fast you are compared to other on the leaderboard |
06:16:42 | narimiran | *others |
06:17:13 | narimiran | example: a leaderboard with 50 people. if you solve first: 50 points, second: 49 points, etc. |
06:17:25 | narimiran | a leaderboard with 120 people. if you solve first: 120 points, second: 119 points, etc. |
06:17:55 | narimiran | that's for each part, so per day you can win 2*(number of people) if you're first on both parts |
06:23:51 | FromDiscord | <Idefau> welp |
06:23:53 | FromDiscord | <Idefau> i got place 25 |
06:24:47 | FromDiscord | <ThatTrollzer> Nice |
06:25:31 | FromDiscord | <ThatTrollzer> ~~top place used kotlin~~ |
06:30:36 | * | vicfred quit (Remote host closed the connection) |
06:32:29 | * | vicfred joined #nim |
06:33:06 | * | vicfred quit (Max SendQ exceeded) |
06:34:34 | FromDiscord | <Idefau> brutal |
06:52:00 | * | habamax joined #nim |
06:56:04 | Zevv | disruptek got muted by araq, and doesn't want to return |
06:57:17 | Zevv | narimiran: https://raw.githubusercontent.com/zevv/aoc2020/master/02/main.nim |
06:57:25 | Zevv | you feel like me parole officer, I need to check in every day |
07:06:07 | narimiran | Zevv: nice! (eating your own dog food, huh?) |
07:07:20 | Zevv | it's the only food I eat |
07:09:18 | narimiran | Zevv: why CountTable tho? |
07:09:42 | Zevv | I started typing before reading the whole thing and expecter part2 to need that |
07:09:45 | Zevv | but it didn't |
07:20:07 | FromDiscord | <Rebel> Disruptek should return he is a 5head and a pretty jovial nihilistic cynical person |
07:21:35 | FromDiscord | <Rebel> Not should but needs to! It's a calling |
07:23:07 | FromDiscord | <Idefau> this |
07:32:26 | * | kiwi_83 quit (Quit: Connection closed) |
07:41:50 | * | nixfreak quit (Ping timeout: 265 seconds) |
08:07:47 | * | NimBot joined #nim |
08:13:20 | * | mbomba quit (Quit: WeeChat 3.0) |
08:15:29 | * | PMunch joined #nim |
08:27:11 | Zevv | narimiran: ok, counttable is out. now I need to do work. |
08:27:17 | narimiran | :) |
08:43:41 | PMunch | Zevv, didn't I unmute disruptek? |
08:45:49 | PMunch | Woops |
08:53:55 | supakeen | I believe they don't want to come back purely because they were muted at some point in time. |
08:54:17 | PMunch | Well I hope that's not the case.. |
08:57:24 | * | Tanger quit (Quit: Leaving) |
08:57:36 | FromDiscord | <lqdev> that'd be sad |
08:57:43 | FromDiscord | <lqdev> #nim without disruptek is just not the same |
09:00:07 | * | jrhawley[m] quit (Quit: Idle for 30+ days) |
09:03:28 | Zevv | PMunch: he chooses not to return because he was aksed to leave |
09:03:42 | Zevv | and he highly respects the one who asked him |
09:07:49 | PMunch | Well he wasn't really asked to leave, he was asked to take five |
09:08:42 | Zevv | that's not his interpretation |
09:09:06 | PMunch | That's unfortunate |
09:09:48 | PMunch | I don't think (at least I hope not) that Araq meant to ban him indefinitely.. |
09:09:51 | Zevv | he's a dirtmouth but I value him as part of the community. He regulary picks up newbies, has a lot of opinions and is prolific as hell |
09:10:05 | PMunch | Same! |
09:10:24 | Zevv | german and american humor also differ, I guess |
09:10:58 | PMunch | Yeah I guess |
09:11:00 | supakeen | I didn't find many of it particularly funny but it's up to people if they accept that behavior in return for contribution. |
09:11:15 | supakeen | Not so much the language but the hate on people who also build things was a bit much? |
09:11:32 | PMunch | Here in northern Norway people probably wouldn't even bat an eye about half the stuff people react to online though.. |
09:12:05 | PMunch | Did he hate an anybody? |
09:12:11 | supakeen | If he wants to offer blowjobs to people that's on him; but all the negativity around async, build times, other things they had a problem with. |
09:12:46 | PMunch | I mean the async implementation isn't perfect, I can see why he is frustrated with it |
09:13:21 | PMunch | Didn't catch his comments regarding build times, but those (almost) always seem good to me |
09:13:24 | supakeen | Yes, and that was clear. |
09:13:33 | PMunch | One of the things I really like about Nim is the fast build times |
09:13:42 | supakeen | But I didn't read things like "no one had to make a new version of async for themselves because you were too egotistical to accept patches" and such as ok. |
09:14:18 | Zevv | supakeen: he's never hateful ad hominem, he just bashes code he thinks is bad. |
09:14:20 | supakeen | Or, when people give help they get met with "ignore that chucklehead, you're practically done", etc. |
09:14:46 | Zevv | anyway, it's between A and D, so leave it to them to solve this |
09:14:52 | PMunch | Nah I agree that those comments might've crossed a line, but I still think shunning him from the community is waaay to harsh |
09:15:11 | PMunch | Fair enough, as long as he knows that we still like him .) |
09:15:24 | Zevv | go tell him then |
09:15:32 | Zevv | he didn't leave earth |
09:15:32 | PMunch | I have already |
09:16:38 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:18:26 | FromDiscord | <lqdev> tbh i didn't mind disruptek's "harsh" comments |
09:18:55 | FromDiscord | <lqdev> at least he was honest |
09:18:58 | supakeen | It's a community thing to figure out if you want or do not want it but you definitely don't want to special case it. |
09:21:09 | Zevv | I think the reason for this mute was one single word that was deemed inappropriate |
09:22:13 | FromDiscord | <Idefau> heck |
09:22:34 | PMunch | supakeen, well it's important to see everything in context |
09:22:45 | supakeen | And the context being 'oh its just disruptek'? |
09:22:58 | PMunch | Just straight up language bans for example are stupid |
09:23:51 | PMunch | No, the context is that we know he's actually a nice guy who can sometimes be a bit abrasive, especially when he's passionate about something or frustrated. |
09:24:08 | supakeen | Exactly, so the context is things that a lot of people don't know; like me. |
09:24:12 | PMunch | If he was just a straight up troll who did nothing but spew horrible things I would be all for a ban |
09:24:32 | supakeen | I just see him calling people names, making lewd comments, etc. |
09:24:47 | FromDiscord | <lqdev> like, i kinda get his behavior sometimes |
09:24:54 | FromDiscord | <i_right_i> Hey, All been away from the nim community for a while what cool project are being done in Nim these days? |
09:24:55 | FromDiscord | <lqdev> especially when people can't even use common sense |
09:25:02 | supakeen | But, I also don't really feel comfortable talking about people when they're not here to talk back to me. |
09:25:04 | PMunch | Hmm, I can see how that could be off-putting for some newcomers |
09:25:05 | supakeen | So I'll leave it at that! |
09:25:16 | PMunch | @i_right_i, what kind of projects are you looking for? |
09:25:44 | FromDiscord | <i_right_i> Game projects to start |
09:25:48 | FromDiscord | <lqdev> @i_right_i i've been working on a dynamic scripting language but i'm doing something else for december |
09:26:04 | FromDiscord | <lqdev> secret project. can't share |
09:26:09 | PMunch | Well there's the #nim-gamedev channel in case you haven't seen that as well :) |
09:26:21 | FromDiscord | <Idefau> i wanted to do a fantasy console in nim |
09:26:22 | PMunch | Enu was featured during NimConf 2020 which looks really cool |
09:26:33 | FromDiscord | <i_right_i> @lqdev anyone implementing ECS in Nim? |
09:26:37 | PMunch | @Idefau, fantasy console? |
09:26:56 | FromDiscord | <lqdev> iirc @planetis was implementing an ECS breakout clone |
09:26:57 | FromDiscord | <lqdev> also |
09:27:01 | FromDiscord | <Idefau> yeah like pico8 or tic, an emulator for a system that doesnt exist |
09:27:05 | FromDiscord | <lqdev> https://github.com/PixeyeHQ/pixecs |
09:27:23 | PMunch | Aaah right |
09:27:41 | FromDiscord | <Idefau> the thing is i want to make it have its own language but i have no idea how to write interpreters |
09:27:54 | FromDiscord | <Idefau> i was thinking of making it use assembly or something |
09:28:00 | FromDiscord | <Idefau> so its easier to implement |
09:28:40 | FromDiscord | <lqdev> tcc maybe? |
09:28:41 | FromDiscord | <i_right_i> @Idefau I was just looking into lexing and parsing |
09:28:45 | PMunch | Writing a simple opt-code based thing isn't all that hard |
09:28:57 | FromDiscord | <Idefau> yeah thats what i wanted to do |
09:29:04 | FromDiscord | <lqdev> @Idefau you can steal my lang's code when i publish it |
09:29:04 | FromDiscord | <Idefau> make an opt-code thing then make an assembler for it |
09:29:09 | FromDiscord | <Idefau> wow |
09:29:12 | PMunch | I created my calculator language thingy stacklang |
09:29:30 | FromDiscord | <i_right_i> There are some smart guys that know how to do it here |
09:29:44 | PMunch | RPN based calculator with programming capabilities so you can make simple scripts |
09:29:54 | FromDiscord | <Idefau> i did some rpn thing a while back |
09:30:57 | FromDiscord | <lqdev> what is opt-code btw |
09:30:59 | FromDiscord | <Idefau> yeah actually making an assembly language like TIS-100 has would be fun |
09:31:23 | FromDiscord | <Idefau> ah i meant opcode |
09:31:39 | FromDiscord | <lqdev> PMunch said that |
09:32:01 | FromDiscord | <i_right_i> @Idefau what you probably want to look into are Virtual Machines |
09:32:07 | FromDiscord | <Idefau> yes |
09:32:11 | FromDiscord | <Idefau> im already looking into vms |
09:32:30 | supakeen | Making a virtual machine and an assembler is a lot of fun! |
09:32:36 | FromDiscord | <Idefau> yup |
09:32:57 | supakeen | I think I found implementing `call` was the best part. |
09:32:59 | * | sunwukong joined #nim |
09:33:00 | FromDiscord | <Rika> Y’all making me tempted |
09:33:24 | FromDiscord | <Idefau> i still dont know on what platform should it run, js would make it more accessible and i could put it in my itch.io pages directly in case i do something with it, but js is cringe |
09:33:33 | FromDiscord | <Idefau> then i could do it with C and sdl |
09:33:36 | FromDiscord | <i_right_i> @Idefau https://www.youtube.com/watch?v=OjaAToVkoTw&t=1429s |
09:33:39 | supakeen | I made one for a challenge a while back which had stack-based overflows in it but *also* if you managed to execute arbitrary executions through that you could enable CPU flags which then let people break out of the VM. |
09:33:43 | supakeen | Super fun thing to make. |
09:33:47 | FromDiscord | <Idefau> thanks, i might take a look |
09:34:31 | supakeen | https://craftinginterpreters.com/ |
09:34:33 | FromDiscord | <i_right_i> @Idefau I just watched half of it the other night its not bad |
09:34:35 | supakeen | You might enjoy this too. |
09:34:41 | FromDiscord | <i_right_i> good starting point |
09:34:42 | supakeen | And do the implementation in Nim :) |
09:34:48 | FromDiscord | <Idefau> i already have craftinginterpreters in my bookmarks |
09:34:54 | FromDiscord | <Idefau> i didnt get to read much of it |
09:35:01 | supakeen | It's shaping up to be great. |
09:36:04 | FromDiscord | <Idefau> a fun thing would be to make the fantasy console with its asm, then make a compiler for the console |
09:36:21 | supakeen | Yea you can go wild with peripherals. |
09:36:40 | supakeen | In my 'vm' I had an opcode to open a secoket and opcodes to wait for a byte, send a byte, etc. |
09:36:50 | FromDiscord | <Idefau> interesting |
09:37:44 | supakeen | For the challenge it was described as a virtual machine with highly secure custom firmware to manage authentication ;) |
09:37:51 | supakeen | So password goes in over socket, answer comes back. |
09:37:59 | FromDiscord | <Idefau> sounds fun |
09:38:24 | FromDiscord | <i_right_i> @supakeen thanks for the link I have read his book on Programming Patterns |
09:38:27 | FromDiscord | <Idefau> i was thinking more of the opposite side, a "templeos" machine if you will, insecure but a programmers sandbox |
09:38:41 | FromDiscord | <lqdev> i gotta buy crafting interpreters when it's out |
09:38:45 | supakeen | Oh, this was quite insecure as well since the 'challenges' I write are for CTFs. |
09:38:54 | FromDiscord | <Idefau> i see |
09:38:56 | supakeen | But only insecure in very specific ways :) |
09:42:07 | FromDiscord | <i_right_i> @supakeen Like a backdoor 😉 😉 I gotchya |
09:42:31 | * | sunwukong left #nim ("ERC (IRC client for Emacs 27.1)") |
09:42:38 | supakeen | Kind of like that yes, my job is to write software for people to 'practice' their skills on or to be used to learn new things. |
09:42:53 | supakeen | Generally people are at the level that any mistakes you didn't want to make are also found and that's not the point. |
09:42:58 | supakeen | Kinda fun :) |
09:43:02 | FromDiscord | <i_right_i> oh your IRC there was a (; (; |
09:43:50 | supakeen | Ah! |
09:43:52 | Clonkk[m] | <FromDiscord "<Idefau> i was thinking more of "> So a JS VM inside a browser basically :D ? |
09:44:10 | FromDiscord | <Idefau> pretty much |
09:44:24 | FromDiscord | <Idefau> but written in nim |
09:47:31 | FromDiscord | <Idefau> to make it more fun(or just more painful), i would make it a stack machine and the assembler's most important opcodes would be `PUSH` and `POP` |
09:47:34 | FromDiscord | <Idefau> and a few registers |
09:48:51 | FromDiscord | <mratsim> a stack machine with registers is a register machine |
09:48:56 | FromDiscord | <Idefau> god damn |
09:48:58 | FromDiscord | <Idefau> you are right |
09:50:09 | FromDiscord | <i_right_i> another cool resource to look into is llvm's IR |
09:52:33 | FromDiscord | <i_right_i> it's like portable assembly |
09:53:01 | * | hmmmmm joined #nim |
09:53:08 | * | natrys joined #nim |
09:53:24 | * | Vladar joined #nim |
09:56:11 | FromDiscord | <Idefau> interesting, ill look into that too |
09:57:00 | FromDiscord | <mratsim> you can look into some of the resources I collected here as well: https://github.com/status-im/nimbus-eth1/wiki/Interpreter-optimization-resources |
09:57:54 | FromDiscord | <mratsim> it's not directly about stack vs registers but some of the papers do cover it. |
09:59:47 | FromDiscord | <lqdev> stack-based is much simpler to implement ime |
10:01:40 | FromDiscord | <Idefau> yeah |
10:03:00 | Clonkk[m] | <FromDiscord "<i_right_i> another cool resourc"> In that case, why not straight go with NLVM and WebAssembly ? |
10:04:10 | * | paul__ joined #nim |
10:04:40 | PMunch | !eval echo NimVersion |
10:04:43 | NimBot | 1.4.0 |
10:04:50 | * | zahary quit (Quit: Connection closed for inactivity) |
10:04:52 | PMunch | Hmm, it seems like my script is broken |
10:06:44 | * | paul__ is now known as spiderstew |
10:08:12 | FromDiscord | <i_right_i> @Clonkk not very familiar with either but I believe llvm has a webassembly backend |
10:09:13 | * | hmmmmm quit (Remote host closed the connection) |
10:18:03 | spiderstew | Hi, I'm new to Nim and trying to get a sense of what kind of memory safety Nim ensures. Is my assumption right that var parameters allow for use-after-free bugs like this: https://play.nim-lang.org/#ix=2GeZ And if so is there some mitigation Nim is doing? |
10:19:12 | * | mbomba joined #nim |
10:39:42 | Clonkk[m] | I think you are confusing seq with pointers. |
10:43:42 | supakeen | Woo, part one of my secret project passes its tests. |
10:43:46 | supakeen | This must mean my tests are not good enough. |
10:51:01 | * | clyybber joined #nim |
11:04:00 | spiderstew | Clonkk[m]: In my example I'm passing "xs[0]" as the var parameter "x", my understanding is that this is implemented by passing a pointer to the backing structure of the seq. When repeatedly appending to the seq the backing structure will run out of space and seq will reallocate it. So the pointer used for the var parameter "x" is now dangling right? |
11:04:22 | * | abm joined #nim |
11:07:27 | FromDiscord | <mratsim> you can't return a var seq/string/ref because that would be unsafe |
11:07:43 | FromDiscord | <mratsim> if you can that's a bug |
11:08:06 | FromDiscord | <mratsim> the message is likely to be "illegal capture T" or something in that genre though |
11:08:14 | * | superbia joined #nim |
11:08:15 | FromDiscord | <mratsim> which is true but might be unclear |
11:08:33 | dom96 | You sure? Pretty sure you can, otherwise `mget` for Table[string, string] wouldn't work |
11:09:12 | FromDiscord | <mratsim> mmmmmhhhh |
11:09:46 | FromDiscord | <mratsim> ah maybe the GC does point to the correct var then |
11:13:24 | dom96 | but yeah, then what spiderstew describes sounds like a bug. Not sure though, Araq? |
11:25:45 | FromGitter | <ynfle> What are the speed and memory trade offs for tuple versus objects? I like tuple unpacking but other than that |
11:26:03 | spiderstew | mratsim: I'm not sure how that applies to my example. You mean "xs[0]" would not return a var and therefore the parameter "x" in the procedure "mess" wouldn't point inside "xs"? |
11:26:46 | FromDiscord | <mratsim> @ynfle no tradeoff, in C both are plain structs |
11:27:01 | FromGitter | <ynfle> mrastim |
11:27:23 | FromGitter | <ynfle> Thanks |
11:28:31 | FromDiscord | <mratsim> @spiderstew, I meant the compiler should prevent that from compiling |
11:28:36 | Clonkk[m] | <spiderstew "Clonkk: In my example I'm passin"> |
11:28:44 | spiderstew | I'm pretty sure "x" does point into the backing structure of the "xs" seq, because if I mutate the "x" first the content of "xs[0]" also changes: https://play.nim-lang.org/#ix=2Gff |
11:28:45 | FromDiscord | <mratsim> you can raise that on Github |
11:28:58 | Clonkk[m] | https://play.nim-lang.org/#ix=2Gfd See the memory address |
11:29:23 | Clonkk[m] | After reallocating the seq, the memory is moved but the ``var int``parameters retains its original memory address |
11:31:39 | Clonkk[m] | * After reallocating the seq, the memory is copied but the `var int`parameters retains its original memory address |
11:32:05 | Clonkk[m] | * After reallocating the seq, the memory is copied but the `var int`parameters retains its original memory address. |
11:34:25 | Clonkk[m] | What I find strange, is that the variable is still accessible even after explicitly calling GC_fullCollect() after reallocating the seq ? |
11:38:59 | * | kiwi_83 joined #nim |
11:43:20 | spiderstew | mratsim: I see, thanks. I'll report it on Github. |
11:45:50 | kiwi_83 | nim compile to m1 mac arm? |
11:50:21 | supakeen | 0Did something change in regards to compiler messages, they seem super helpful nowadays :) |
11:50:35 | kiwi_83 | any examples? |
11:51:05 | supakeen | `Error: inheritance only works with non-final objects; for Context to be inheritable it must be 'object of RootObj' instead of 'object'` |
11:51:31 | kiwi_83 | oh wow, that is more detail than python's error messages! |
11:51:40 | kiwi_83 | it even provides suggestions! |
11:51:56 | supakeen | Or even. |
11:51:59 | supakeen | `Error: invalid indentation; an export marker '*' follows the declared identifier` |
11:52:15 | kiwi_83 | wait what code generated this ^ |
11:52:24 | supakeen | What code generated the first one? |
11:52:54 | supakeen | I had a `type Context* = object` and another `type IRCContext* = object of Context` |
11:53:17 | kiwi_83 | oh I meant the second one :) |
11:53:30 | supakeen | Ah for the second one I wrote `proc next()* =` :p |
11:53:51 | kiwi_83 | damn the compiler msgs are really helpful |
11:54:16 | kiwi_83 | at this rate we will probably have suggestions to fix the code in the message itself |
11:54:38 | supakeen | I like it a lot :) |
11:56:22 | kiwi_83 | indeed! is this new with the latest nim release? |
12:00:33 | FromDiscord | <Idefau> yeah nim has very nice errors |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:11:39 | supakeen | kiwi_83: I am on the latest yes. |
12:22:40 | * | kiwi_835 joined #nim |
12:26:36 | * | kiwi_83 quit (Ping timeout: 240 seconds) |
12:26:45 | * | hmmmmm joined #nim |
12:29:20 | * | hmmmmm quit (Remote host closed the connection) |
12:29:55 | ForumUpdaterBot | New thread by HJarausch: Converter - how to switch is off, see https://forum.nim-lang.org/t/7189 |
12:29:55 | Zoom[m] | @flywind see my PR for awesome-nim |
12:34:50 | PMunch | kiwi_835, you PMed me about a README typo? |
12:34:55 | PMunch | I was in a meeting at work |
12:36:07 | kiwi_835 | yes did you not get the message?? |
12:36:22 | kiwi_835 | i sent direct link :) |
12:39:05 | PMunch | I got a message saying one of my repos had a type in the readme :P |
12:39:11 | PMunch | But not which repo or what the typo was |
12:47:57 | * | mbomba quit (Quit: WeeChat 3.0) |
12:53:16 | * | vesper11 quit (Ping timeout: 240 seconds) |
12:58:41 | * | hmmm joined #nim |
13:03:14 | Zoom[m] | It's probably about notifishower |
13:03:47 | PMunch | Nah, it was protobuf |
13:04:07 | Zoom[m] | Or, as I've recently taken to calling it, "not iFish however" |
13:04:21 | PMunch | -_- |
13:04:52 | * | Q-Master joined #nim |
13:05:13 | Zoom[m] | You desperately need a cool fish for a mascot |
13:05:38 | PMunch | Do you have anything against my shower? |
13:05:40 | hmmm | no it is a fish shower |
13:05:53 | Zoom[m] | Cool and well-informed fish |
13:05:54 | hmmm | it might be the best software name ever |
13:06:08 | hmmm | will it work on windows munchie |
13:06:16 | Zoom[m] | Shower is a logo, fish is a mascot |
13:06:35 | * | Q-Master quit (Client Quit) |
13:07:07 | PMunch | hmmm, not at all |
13:07:27 | hmmm | meh, those linux users always building cool stuff for themselves |
13:07:34 | PMunch | It's built using X11 and imlib2, neither of which run on Windows :P |
13:07:53 | PMunch | Feel free to join the dark side :) |
13:07:55 | PMunch | It's free |
13:08:01 | Zoom[m] | Even with X-on-windows? |
13:08:17 | hmmm | well I'd like to get a linux laptop but I'm worried it won't be supported |
13:08:18 | PMunch | No idea, I haven't used Windows since Windows 7.. |
13:08:48 | PMunch | But if it runs X I guess it should work |
13:09:23 | Zoom[m] | What do you mean 'since', nothing came after. |
13:09:36 | PMunch | Haha :P |
13:09:45 | hmmm | dude please we have the adaware bundle w10 |
13:10:00 | hmmm | lots of colored icons of things you can buy for cheap |
13:10:00 | Zoom[m] | Please, guys, don't ruin it. |
13:10:51 | Zoom[m] | I chose the life of ignorance |
13:11:24 | * | Q-Master joined #nim |
13:13:29 | hmmm | honestly w10 is not half bad if you are not grossed out by the spy stuff and the advertising on your start menu |
13:14:17 | PMunch | That's a huuuuge if... |
13:14:35 | FromGitter | <HJarausch_gitlab> Tuple unpack : is there some simple ⏎ Given ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5fc7933b87cac84fcd036f9b] |
13:14:47 | hmmm | also is free as in actually russian botnet freedom |
13:14:48 | PMunch | Guantanamo isn't that bad if you don't mind the torture and being locked up without trial |
13:15:19 | hmmm | munchie :p |
13:15:48 | PMunch | @HJara, do you mean a generic macro that can take any tuple? |
13:16:02 | PMunch | Or just that one? |
13:16:15 | PMunch | Woops, the Gitter and Discord bots work a bit differently |
13:16:26 | PMunch | I of course meant to tag HJarausch_gitlab |
13:16:30 | narimiran | there is unpack library in nimble |
13:16:36 | PMunch | @HJarausch_gitlab |
13:18:52 | FromGitter | <HJarausch_gitlab> I'd like to write a simple one just for a tuple of two ints myself. ⏎ Any pointers? ⏎ Thanks |
13:20:02 | ForumUpdaterBot | New thread by Pietroppeter: How to import pathutils, see https://forum.nim-lang.org/t/7190 |
13:21:39 | hmmm | actually I was wondering, microsoft must have something like 10k devs working on windows. But W10 is pretty mature now, so...what are all those devs working on right now? |
13:21:55 | * | waleee-cl joined #nim |
13:22:06 | PMunch | More adware probably |
13:22:08 | hmmm | we might actually just steal a team or two and put them on working on nim and no one would know the difference |
13:22:11 | narimiran | hmmm: solitaire |
13:22:13 | FromGitter | <haxscramper> @HJarausch_gitlab if you need to single tuple into two function arguments you probably need to rewrite AST to something like `let (a, b) = refTuple(); echo getTuple(a, b)` |
13:23:23 | FromGitter | <haxscramper> So you could write `unpackCall` macro that would transform `echo unpackCall getTuple(unpack(retTuple()))` |
13:26:23 | * | spiderstew quit (Quit: spiderstew) |
13:26:36 | * | spiderstew joined #nim |
13:36:48 | * | abm quit (Quit: Leaving) |
13:39:55 | * | superbia quit (Quit: WeeChat 2.9) |
14:09:35 | FromDiscord | <fwsgonzo> is there a guide to use for porting to 32-bit RISC-V? |
14:11:34 | * | abm joined #nim |
14:15:16 | * | mfiano quit (Ping timeout: 265 seconds) |
14:15:36 | FromDiscord | <Clyybber> narimiran: Damn, that doc comment bug; not sure how it slipped my review sorry |
14:16:25 | FromDiscord | <shadow.> lol im just waiting for the rise of aoc-related questions |
14:16:41 | FromDiscord | <shadow.> im forecast regex questions today |
14:18:32 | FromDiscord | <shadow.> (edit) "forecast" => "forecasting" |
14:20:54 | PMunch | Today? |
14:21:06 | PMunch | Oh for parsing that format? |
14:21:21 | PMunch | I just went with a bunch of `split` |
14:21:55 | FromDiscord | <fwsgonzo> do I have to rebuild nim or something if I add a new platform? |
14:22:14 | PMunch | Depends on where you add it |
14:22:48 | supakeen | > The absence of a value is often represented by nil, but it is not always available, nor is it always a good solution. |
14:22:56 | supakeen | When is it not available or not a good option? :) |
14:23:22 | FromDiscord | <fwsgonzo> well, grepping nim reveals it contains "riscv" string, so maybe |
14:23:31 | * | xet7 quit (Quit: Leaving) |
14:24:42 | PMunch | Not available: when the value is not a pointer, eg. when it is an int. You probably don't want to represent the lack of a number as 0. |
14:25:23 | supakeen | Ah yes. |
14:25:26 | supakeen | nil has meaning there. |
14:25:55 | supakeen | But `Option[Event]` in my case makes less sense |
14:26:09 | PMunch | Why? |
14:27:17 | supakeen | Well, I could use `nil` instead. |
14:28:18 | FromDiscord | <shadow.> oh with split? thats smart haha |
14:28:36 | FromDiscord | <shadow.> for the second part since it was 1-indexed i just split on ":" since there was a space after so it worked itself out |
14:28:42 | FromDiscord | <shadow.> lol |
14:28:58 | PMunch | Haha, I didn't even think of that :P |
14:29:45 | FromDiscord | <shadow.> lol i finally got to use the xor operator for part two |
14:29:56 | FromDiscord | <shadow.> != prolly woulda worked too but xor looks smarter |
14:31:05 | * | lritter joined #nim |
14:31:09 | PMunch | Oh yeah, I used xor as well |
14:31:13 | FromDiscord | <shadow.> nice nice |
14:31:34 | FromDiscord | <shadow.> strutils came in handy as well lol |
14:31:37 | FromDiscord | <shadow.> parseInt and count |
14:31:56 | PMunch | http://ix.io/2GfG/ my solution, if you're curious |
14:32:35 | FromDiscord | <shadow.> internal server error hm |
14:32:37 | FromDiscord | <Idefau> same |
14:32:51 | PMunch | Yeah seems like ix.io is struggling |
14:32:51 | FromDiscord | <Idefau> i got internal server error too |
14:32:55 | FromDiscord | <Idefau> makes sense, its a server error |
14:33:02 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2GfH |
14:33:04 | FromDiscord | <shadow.> here's my part two |
14:33:18 | FromDiscord | <shadow.> `import re, strutils` |
14:33:21 | PMunch | Bade gateway |
14:33:23 | PMunch | Bad* |
14:33:34 | PMunch | The playground also uses ix |
14:33:36 | FromDiscord | <Idefau> https://play.nim-lang.org/#ix=2GfI here's mine that does both parts |
14:33:43 | FromDiscord | <shadow.> ohh ok |
14:33:43 | FromDiscord | <shadow.> hmm |
14:33:48 | FromDiscord | <shadow.> ill put mine on hastebin |
14:33:54 | FromDiscord | <shadow.> oh idf04's worked for me |
14:34:03 | FromDiscord | <shadow.> oh damn scanf thats smart |
14:34:21 | PMunch | I get: Unable to load ix paste, file too large, or download is too slow |
14:34:30 | FromDiscord | <shadow.> https://hatebin.com/alobwtqmvh |
14:34:35 | FromDiscord | <shadow.> here's my part two |
14:36:34 | FromDiscord | <shadow.> hatebin should work lol |
14:36:53 | FromDiscord | <shadow.> oh pmunch i can view your solution now |
14:37:00 | PMunch | Here's mine: https://hatebin.com/qlovnmqius |
14:37:00 | PMunch | Ah |
14:37:13 | FromDiscord | <shadow.> oh nice nic e |
14:37:14 | FromDiscord | <shadow.> (edit) "nic e" => "nice" |
14:37:18 | FromDiscord | <shadow.> lol i shoulda used a let block |
14:38:47 | PMunch | Blocks are nice |
14:40:13 | FromDiscord | <shadow.> haha yeah |
14:40:22 | FromDiscord | <shadow.> i completely forgot abt scanf |
14:40:50 | PMunch | Hmm, I could write this an an npeg pattern I think |
14:41:09 | FromDiscord | <shadow.> what was your day one solution? |
14:41:18 | FromDiscord | <Idefau> i already saw a solution using npeg i think |
14:41:41 | FromDiscord | <shadow.> oh nice nice |
14:41:45 | FromDiscord | <shadow.> https://hatebin.com/enaumbjoyi |
14:41:46 | FromDiscord | <shadow.> this was my part one |
14:41:49 | FromDiscord | <shadow.> of day one |
14:41:49 | FromDiscord | <shadow.> lol |
14:41:53 | PMunch | http://ix.io/2G8p |
14:42:11 | FromDiscord | <shadow.> ix is still goin crazy lol |
14:42:14 | FromDiscord | <Idefau> https://play.nim-lang.org/#ix=2GfK this monstrosity i wired up |
14:42:54 | FromDiscord | <shadow.> oh lord |
14:43:05 | FromDiscord | <shadow.> what is that |
14:43:06 | FromDiscord | <shadow.> O(n^3) |
14:43:07 | FromDiscord | <shadow.> haha |
14:43:14 | PMunch | I can't see it :( |
14:43:34 | FromDiscord | <Idefau> its better if you dont see it |
14:43:40 | FromDiscord | <shadow.> LOL |
14:43:41 | PMunch | Ah, similar to what I'm doing actually :P |
14:43:51 | PMunch | I've just thrown in a couple optimisations |
14:43:52 | FromDiscord | <shadow.> https://hatebin.com/uadkairdqq |
14:43:56 | FromDiscord | <shadow.> here's my part two |
14:44:00 | FromDiscord | <shadow.> i believe i did it in O(n^2) |
14:44:12 | FromDiscord | <shadow.> yeah only two nested loops haha |
14:44:37 | FromDiscord | <Idefau> hashset |
14:44:38 | FromDiscord | <Idefau> interesting |
14:44:53 | FromDiscord | <Idefau> i wanted to do something similar but i was tired so i said fuck it |
14:44:57 | FromDiscord | <Idefau> 3 nested loops should do it |
14:45:04 | FromDiscord | <shadow.> haha fair enough |
14:45:09 | FromDiscord | <shadow.> i think for this input set its fine anyways |
14:45:13 | FromDiscord | <shadow.> only 200 200 200 iterations |
14:45:15 | FromDiscord | <shadow.> if it were like |
14:45:24 | FromDiscord | <shadow.> 1000 |
14:45:27 | FromDiscord | <shadow.> then maybe not |
14:45:27 | FromDiscord | <shadow.> lol |
14:45:45 | FromDiscord | <Idefau> yeah |
14:45:50 | FromDiscord | <shadow.> but ye i just realized since you can calculate the complement you can just store all numbers as you loop and look for the compliment (part one) |
14:45:54 | FromDiscord | <shadow.> then on part two just do that for each num |
14:45:56 | FromDiscord | <Idefau> yeah |
14:46:06 | FromDiscord | <shadow.> ig since part one was o(n) that would make this o(n^2) ye |
14:46:13 | FromDiscord | <shadow.> idk this is what i get for grinding leetcode i suppose |
14:46:15 | FromDiscord | <shadow.> lmao |
14:46:44 | FromDiscord | <Idefau> i wonder what day 3 would be |
14:46:48 | FromDiscord | <Idefau> (edit) "would" => "will" |
14:46:48 | FromDiscord | <shadow.> hmm |
14:46:52 | FromDiscord | <shadow.> prolly a little harder |
14:47:07 | FromDiscord | <shadow.> what sucks is where i live it goes up at 12am |
14:47:15 | FromDiscord | <shadow.> so i cant really do them until about 7-8 hours later |
14:47:20 | FromDiscord | <shadow.> no chance of getting on lb lmao |
14:47:37 | FromDiscord | <Idefau> for me it gets at 7 am i think |
14:47:41 | FromDiscord | <Idefau> so if i wake up early i might do it |
14:47:53 | FromDiscord | <shadow.> oh nice nice |
14:48:01 | FromDiscord | <Idefau> there are two problems here tho, that i must wake up early and that my brain must function at that time |
14:48:08 | FromDiscord | <shadow.> lmao true |
14:48:15 | FromDiscord | <shadow.> if my brain isnt functioning enough ill just whip out the pypy |
14:48:16 | FromDiscord | <shadow.> lmfao |
14:48:35 | PMunch | Tried to run your code on my inputs shadow, my version beats it on performance for the 200 set |
14:48:44 | PMunch | We should have a larger data set to try against.. |
14:48:48 | FromDiscord | <shadow.> fr? |
14:48:52 | FromDiscord | <shadow.> dang |
14:48:53 | FromDiscord | <shadow.> hm |
14:49:01 | FromDiscord | <shadow.> for the 2sum or 3sum? |
14:49:07 | FromDiscord | <shadow.> i dont think i saw your code yet |
14:49:42 | PMunch | 1.15ms for your version 0.43ms for mine |
14:49:57 | PMunch | Oh, didn't the ix link load yet? |
14:50:06 | FromDiscord | <shadow.> lemme check |
14:50:11 | FromDiscord | <shadow.> oh it worked |
14:50:29 | FromDiscord | <shadow.> hmm |
14:50:33 | FromDiscord | <shadow.> lemme try adding an optimization haha |
14:51:10 | FromDiscord | <fwsgonzo> what does "reExeNotFound" mean when running tests? do I have to install some regex library? |
14:51:37 | PMunch | If you're using the built-in regex module, yes |
14:51:46 | PMunch | If you are using nre then no |
14:51:58 | FromDiscord | <shadow.> https://hatebin.com/aarbpbtseu |
14:51:59 | FromDiscord | <shadow.> try this pmunch |
14:52:00 | PMunch | Or whatever the pure Nim implementation is called |
14:52:33 | FromDiscord | <shadow.> yeah its nre |
14:52:49 | FromDiscord | <shadow.> gotta love `import nre except toSeq` lol |
14:53:38 | PMunch | That just ran slower |
14:53:42 | FromDiscord | <shadow.> hUH |
14:53:43 | FromDiscord | <shadow.> confusing |
14:53:45 | FromDiscord | <shadow.> hmm |
14:53:50 | FromDiscord | <shadow.> lemme try benchmarking |
14:53:51 | PMunch | Your optimisation just makes it worse because there are no numbers > 2020 |
14:54:01 | FromDiscord | <shadow.> oh fr? |
14:54:03 | FromDiscord | <shadow.> ah ok |
14:54:09 | FromDiscord | <shadow.> hn |
14:54:10 | FromDiscord | <shadow.> hm |
14:54:31 | FromDiscord | <shadow.> lemme run yours against mine and try optimizing it haha |
14:56:04 | FromDiscord | <shadow.> handy |
14:56:06 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GfN |
14:56:39 | FromDiscord | <Idefau> nice |
14:57:05 | narimiran | @Clyybber don't worry :) |
14:57:08 | * | hmmm quit () |
14:57:15 | PMunch | Oh I did 50 runs with perf :P |
14:57:28 | PMunch | and -d:release --gc:arc |
14:57:38 | FromDiscord | <shadow.> haha |
14:57:42 | FromDiscord | <shadow.> thanks |
14:57:46 | FromDiscord | <Idefau> try -d:danger |
14:57:49 | FromDiscord | <shadow.> lol |
14:57:53 | FromDiscord | <shadow.> and --passc:"-flto" |
14:58:09 | narimiran | pro tip: for integer set use IntSet |
14:58:43 | FromDiscord | <Idefau> nice tip |
14:58:52 | PMunch | Just about the same |
14:59:43 | PMunch | Oh well, I'm off |
14:59:44 | * | PMunch quit (Quit: Leaving) |
15:00:29 | FromDiscord | <shadow.> rip |
15:00:56 | FromDiscord | <kodkuce> huh nice there where no zilion loop for AoC |
15:01:00 | FromDiscord | <shadow.> hm you are correct |
15:01:02 | FromDiscord | <shadow.> yours was faster |
15:01:04 | FromDiscord | <shadow.> 96 times out of 100 |
15:01:05 | FromDiscord | <shadow.> lmao |
15:01:06 | FromDiscord | <shadow.> gg |
15:01:06 | Zevv | hey nice, countIt() |
15:02:44 | supakeen | https://bpa.st/K6CA |
15:02:50 | supakeen | Slowly starting to enjoy my API a tiny bit. |
15:07:08 | FromDiscord | <Idefau> i was very confused when i saw IRC stuff because i thought its an AoC solution |
15:07:39 | supakeen | not everyone does aoc :D |
15:09:36 | FromDiscord | <shadow.> haha fair enough |
15:10:10 | FromDiscord | <shadow.> any reason for the newline under ever `var` or `let`? |
15:10:12 | FromDiscord | <shadow.> just stylistic? |
15:10:15 | FromDiscord | <shadow.> (edit) "stylistic?" => "stylistic preference?" |
15:10:31 | FromDiscord | <Cloufish> a silly question, but how to install nimscript? Does it come with nim already? |
15:11:00 | FromDiscord | <shadow.> well |
15:11:19 | FromDiscord | <shadow.> nim is just the subset of nim thats comprehendible by the vm |
15:11:39 | FromDiscord | <shadow.> so im fairly certain it would "come with nim" |
15:11:43 | FromDiscord | <shadow.> dont take my word for it tho |
15:12:13 | FromDiscord | <Cloufish> thanks Karma |
15:12:20 | FromDiscord | <shadow.> ofc nemo |
15:12:24 | FromDiscord | <Cloufish> XD |
15:12:26 | FromDiscord | <shadow.> lol |
15:12:38 | supakeen | just stylistic for me :) |
15:13:02 | FromDiscord | <shadow.> oh haha fair enough |
15:14:28 | FromDiscord | <shadow.> lol im already itching for day 3 |
15:14:35 | FromDiscord | <shadow.> i wish leetcode had nim |
15:14:39 | FromDiscord | <shadow.> i would be grindingg rn lmao |
15:16:07 | FromDiscord | <Cloufish> you're on NoFap? |
15:16:59 | Zoom[m] | @shadow. CodeWars has Nim |
15:17:07 | FromDiscord | <haxscramper> If you want to run nimscript code from file you can do it using nim compiler `nim e code.nims` - note `.nims` extension |
15:17:31 | FromDiscord | <haxscramper> Otherwise, it is what runs when you use macros, `static:` blocks and so on |
15:18:28 | FromDiscord | <Cloufish> I have another question. What pros do I have from using nimscript instead of just using os module in normal nim? |
15:18:42 | FromDiscord | <Cloufish> I see that nimscript still has os module |
15:18:55 | FromDiscord | <Cloufish> but what If I were to use it on normal nim |
15:19:11 | FromDiscord | <shadow.> @Zoom oh damn thats wonderful news ty |
15:20:19 | FromDiscord | <haxscramper> Are you referring to https://nim-lang.org/docs/nimscript.html vs https://nim-lang.org/docs/os.html for regular nim code? Then use `std/os`. |
15:20:26 | * | vicfred joined #nim |
15:22:00 | FromDiscord | <haxscramper> `nimscript` module is a wrapper for `os` procs, which rely on low-level os-specific details (and based on C code AFAIK), so they had to be wrapped for use in VM. |
15:33:06 | * | nnn85 joined #nim |
15:36:39 | federico3 | https://nim-lang.org/docs/nimc.html should provide a list of supported architecture |
15:41:22 | * | nnn85 quit (Remote host closed the connection) |
15:44:01 | FromGitter | <HJarausch_gitlab> How to pass a slice? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Nim doesn't accept *varargs[HSlice]* - why and is there are work around? [https://gitter.im/nim-lang/Nim?at=5fc7b64032153f0d4440ae4c] |
15:45:19 | FromDiscord | <mratsim> what about varargs Slice[T]? |
15:46:15 | FromGitter | <haxscramper> @HJarausch_gitlab you forgot generic parameters for `HSLice` - https://nim-lang.org/docs/system.html#HSlice |
15:46:22 | FromGitter | <haxscramper> https://play.nim-lang.org/#ix=2Gg5 |
15:46:32 | FromDiscord | <mratsim> I think it's generics interacting with varargs that cause a semantic check issue |
15:47:15 | FromGitter | <haxscramper> Although error message is admittedly bad in this case, maybe because of what mratsim said |
15:47:46 | FromDiscord | <shadow.> hmm interesting question, i know its partially dependent on what type of program but what compiler flags typically speed up execution time |
15:48:11 | FromDiscord | <shadow.> i typically use `-d:danger --passc:"-flto"` and i was wondering if changing gc or `--opt:speed` would do anything lol |
15:50:06 | FromGitter | <HJarausch_gitlab> @haxscramper Many thanks! |
16:09:59 | kiwi_835 | when should i use variant types |
16:20:48 | kiwi_835 | https://forum.nim-lang.org/t/1151 |
16:20:48 | FromDiscord | <martinium> is there a decent nim tutorial on multithreading that can save me time learning best practices? |
16:20:50 | kiwi_835 | whoa |
16:21:00 | kiwi_835 | didn'tn know using top level variables etc would be this slow |
16:28:24 | narimiran | kiwi_835: did you try to run those examples from 2015 in 2020? |
16:28:43 | kiwi_835 | what |
16:28:49 | kiwi_835 | wrong tag? |
16:28:54 | FromDiscord | <lqdev> take a look at the date |
16:29:04 | narimiran | the thread you linked is from 2015 |
16:29:15 | FromDiscord | <martinium> it got bumped though |
16:29:16 | narimiran | and now somebody resurrected it |
16:29:17 | FromDiscord | <martinium> 😄 |
16:29:31 | FromDiscord | <martinium> I like how the forum visibly denotes 6 YEARS LATER |
16:29:34 | FromDiscord | <martinium> 😄 |
16:30:06 | kiwi_835 | oh lmao I just browse the forum homepage |
16:30:12 | kiwi_835 | blame the necroposter |
16:31:47 | leorize[m]1 | we should have old topic autolock at some point |
16:31:53 | leorize[m]1 | like 3mo after last post or smt |
16:32:32 | FromDiscord | <Rika> 3mo sounds too short |
16:32:36 | FromDiscord | <Rika> Maybe 9 |
16:40:35 | FromDiscord | <shadow.> how can i write lambdas with sugar? im still unsure lmao |
16:40:45 | FromDiscord | <shadow.> sent a code paste, see https://paste.rs/lYa |
16:40:48 | FromDiscord | <shadow.> for instance, how could that be made into a lambda |
16:40:53 | FromDiscord | <shadow.> (edit) "for instance, how could that be made into a ... lambda" added "sugar" |
16:41:54 | FromDiscord | <shadow.> nvm i got it |
16:41:57 | narimiran | `(a, b) => (if f(a) < f(b): -1 else: 1)` ? |
16:42:13 | FromDiscord | <shadow.> yeye just figured it out ty tho haha |
16:43:02 | * | hnOsmium0001 joined #nim |
16:47:53 | FromDiscord | <Cloufish> I'm too searching for this topic |
16:50:06 | FromDiscord | <Cloufish> there was a great presentation on NimConf2020 |
16:50:07 | FromDiscord | <Cloufish> https://www.youtube.com/watch?v=NOAI2wH9Cf0 |
16:50:46 | FromDiscord | <Cloufish> Though to me it is too complicated |
16:51:27 | FromDiscord | <Cloufish> It's more about great practices to me, rather than tutorial on Multithreading in Nim |
16:59:27 | FromDiscord | <martinium> yeah I'll take a look but def would like to see some well documented code that explains the whys and whats |
17:02:57 | reversem3 | Is anyone compiling nim code on the fly using neovim ? |
17:03:07 | reversem3 | I'm trying to get lazier |
17:03:34 | * | habamax quit (Ping timeout: 272 seconds) |
17:07:48 | reversem3 | !block |
17:07:57 | Clonkk[m] | Not really on the fly |
17:08:14 | Clonkk[m] | But ctrl+z -> nim c file -> fg do the trick |
17:08:51 | reversem3 | Yeah I'm trying to make neovim my IDE for everything |
17:08:52 | Clonkk[m] | Unless you mean as a plugin , in which case there is Nimlsp |
17:09:18 | reversem3 | question though , is it possible to use block with two different functions ? |
17:09:38 | reversem3 | I'll look up nimlsp thanks |
17:09:54 | Clonkk[m] | What do you mean ? |
17:10:16 | Clonkk[m] | Block with different function ? |
17:10:48 | reversem3 | I'll show you one moment |
17:14:31 | reversem3 | http://pastebin.ws/47ly4w |
17:15:07 | reversem3 | Ok so I want to connect to one box extract info , then move on another and so on. |
17:15:32 | reversem3 | I heard block might work for this but I'm not really sure how |
17:23:41 | FromDiscord | <shadow.> has anyone used the `comprehension` package? |
17:24:29 | FromDiscord | <shadow.> it seems to be giving me errors |
17:24:38 | FromDiscord | <shadow.> `C:\Users\shado\.nimble\pkgs\comprehension-0.1.0\comprehension.nim(29, 69) Error: index 3 not in 0 .. 2` |
17:26:32 | FromDiscord | <shadow.> nvm ill just make my own |
17:27:36 | Clonkk[m] | <reversem3 "I heard block might work for thi"> Do you mean a block statement or do you mean reading in a blocking operation for your async procedure ? |
17:28:43 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Ggo |
17:28:44 | FromDiscord | <shadow.> is this code incorrect? |
17:28:53 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2Ggo" => "https://paste.rs/E7l" |
17:29:12 | FromDiscord | <shadow.> or rather why is it raising an error haha |
17:32:10 | Clonkk[m] | Lines is an iterator |
17:32:31 | FromDiscord | <shadow.> am i misunderstanding how filterIt works |
17:33:52 | FromDiscord | <shadow.> lol i could really use a comprehension right abt now but i cant figure out `comprehension` |
17:33:57 | narimiran | use `readlines` instead of `lines` |
17:34:08 | FromDiscord | <shadow.> thanks |
17:34:32 | narimiran | but i think it still won't work :) |
17:34:47 | FromDiscord | <shadow.> lol doesnt work with comprehension at least |
17:34:49 | FromDiscord | <shadow.> lemme try filter |
17:35:07 | Clonkk[m] | What comprehension package are you talking about ? |
17:35:26 | FromDiscord | <shadow.> unofficial |
17:35:27 | narimiran | the easiest way is to not force FP in nim |
17:35:30 | FromDiscord | <shadow.> lemme find it lmao |
17:35:34 | FromDiscord | <shadow.> lmao fair enough |
17:35:38 | narimiran | it took me some time to realize that |
17:35:56 | FromDiscord | <shadow.> idk i find fp more fun to code with but it does get really obstructed and messy |
17:36:05 | FromDiscord | <shadow.> https://github.com/alehander92/comprehension |
17:36:07 | FromDiscord | <shadow.> this was the package |
17:37:38 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Ggs |
17:38:16 | FromDiscord | <shadow.> ig ill just do that |
17:38:16 | FromDiscord | <shadow.> lmao |
17:44:07 | reversem3 | I don't know , I thought you could use block to execute some code then break then go on to something else, but I don't think that will work with async |
17:47:46 | * | superbia joined #nim |
17:49:47 | * | lytedev[m] joined #nim |
18:16:22 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=2Ggy |
18:16:49 | FromDiscord | <Gabben> (edit) "https://paste.rs/mcr" => "https://play.nim-lang.org/#ix=2Ggz" |
18:19:13 | FromGitter | <matrixbot> `lytedev` Hey, all -- working on Advent of Code and was wanting to put each day's code in a different module and was hoping to use a macro/static to easily wrap some metaprogramming around it to simplify some things, but I can't get it working: http://0x0.st/i7Jw.txt |
18:22:01 | FromDiscord | <lqdev> ~matrix |
18:22:02 | disbot | matrix: 11Nim channels on Matrix can be found at +nim:asra.gr (https://matrix.to/#/+nim:asra.gr) |
18:22:29 | FromDiscord | <lqdev> that's not really how static works |
18:23:01 | FromDiscord | <lqdev> you need to wrap your code in a `macro` declaration and call that instead |
18:29:33 | * | habamax joined #nim |
18:34:15 | FromDiscord | <Esbeesy> Anyone done todays advent of code? Total nim noob and was looking to compare notes/code review |
18:34:38 | lytedev[m] | When I do that, I get an error that seems to indicate that the compiler cannot find the file for importing, while adding the same `from` statement works just fine |
18:41:02 | FromDiscord | <Vindaar> @Esbeesy check out the forum thread https://forum.nim-lang.org/t/7162 Has some links to AoC repositories. Also narimiran's repo here: https://github.com/narimiran/AdventOfCode2020 and my own here: https://github.com/Vindaar/AdventOfCode2020 |
18:41:34 | FromDiscord | <Esbeesy> Awesome |
18:49:56 | * | vicfred quit (Ping timeout: 240 seconds) |
18:51:26 | * | ryanhowe quit (Quit: ZNC 1.8.2 - https://znc.in) |
18:53:06 | FromDiscord | <lytedev> This is what I have now, still no luck =( http://0x0.st/i7Jk.txt |
18:54:08 | * | vicfred joined #nim |
18:55:06 | * | thomasross joined #nim |
18:55:14 | * | Vladar quit (Quit: Leaving) |
18:55:49 | Zevv | https://github.com/zevv/aoc2020/blob/master/02/main.nim |
18:57:17 | * | abm quit (Quit: Leaving) |
18:58:49 | FromDiscord | <Recruit_main707> vars are always initialised (unless they are marked with {.noInit.} right? |
18:59:11 | * | vicfred quit (Quit: Leaving) |
19:01:45 | * | kiwi_835 quit (Ping timeout: 240 seconds) |
19:07:42 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GgN |
19:07:45 | FromDiscord | <shadow.> im making a comprehension using macros |
19:07:50 | FromDiscord | <shadow.> would there be any way to automatically determine the type? |
19:07:59 | FromDiscord | <shadow.> so that i dont have to pass int to the end |
19:08:06 | FromDiscord | <shadow.> im guessing i could just evaluate the type of the expression once? |
19:08:46 | FromDiscord | <shadow.> (edit) "type?" => "type of seq to return?" |
19:08:55 | FromDiscord | <Vindaar> @shadow. yes, that's kind of what the templates in `sequtils` do. Works fine if you have something well defined |
19:09:12 | FromDiscord | <shadow.> hmm ok |
19:09:23 | FromDiscord | <shadow.> i think i would need to find what type the identifier is |
19:09:28 | FromDiscord | <shadow.> and then just auto-zero the identifier |
19:09:32 | FromDiscord | <shadow.> and run the expression on it? |
19:09:34 | FromDiscord | <shadow.> something like that |
19:09:46 | FromDiscord | <shadow.> or i guess i could just run the loop for one iteration |
19:10:21 | FromDiscord | <shadow.> nvm cant do that |
19:10:35 | FromDiscord | <shadow.> @Vindaar would you happen to know some source i could look at? |
19:12:40 | * | superbia quit (Quit: WeeChat 2.9) |
19:13:49 | FromDiscord | <Vindaar> "working with types in macros is difficult" is the thought that comes to mind always (ref https://github.com/nim-lang/RFCs/issues/44) |
19:13:49 | disbot | ➥ [RFC] Working with types in macro is difficult. |
19:15:04 | FromDiscord | <Vindaar> as I said here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sequtils.nim#L932↵and give me a sec |
19:16:50 | FromDiscord | <shadow.> alr ill take a look ty |
19:16:51 | FromDiscord | <Vindaar> aside from that you already saw @alehander42's comprehension package. Don't know how he deduces the types there |
19:17:01 | FromDiscord | <shadow.> yeah i tried looking at it but |
19:17:07 | FromDiscord | <shadow.> his variable names arent very |
19:17:08 | FromDiscord | <shadow.> meaningful |
19:17:21 | FromDiscord | <shadow.> hard to read |
19:19:59 | FromDiscord | <Vindaar> sent a long message, see https://paste.rs/utG |
19:20:16 | FromDiscord | <shadow.> haha fair enough |
19:20:24 | FromDiscord | <shadow.> hmm well my thoughts are |
19:20:32 | FromDiscord | <shadow.> 1. the expression will always return the type of the seq |
19:20:48 | FromDiscord | <shadow.> 2. the identifier that is used in the for loop is just the type of the iterable / container |
19:20:57 | FromDiscord | <shadow.> since auto-zeroing is easy |
19:21:00 | * | Vladar joined #nim |
19:21:04 | FromDiscord | <shadow.> i just need a way to get the type of a iterable lmao |
19:21:17 | FromDiscord | <shadow.> so i could technically just look it once and break but the issue is empty iterables |
19:25:28 | FromDiscord | <Vindaar> 1. yes, so the inner type of the result is not a problem↵2. getting the type of the container isn't a problem in principle either, cause it's handed to you. The problem then is writing the correct resulting code for each type, no? |
19:25:53 | FromDiscord | <shadow.> well im trying to go from |
19:25:56 | FromDiscord | <shadow.> to |
19:25:57 | FromDiscord | <shadow.> sent a code paste, see https://paste.rs/yMi |
19:26:05 | FromDiscord | <shadow.> sent a code paste, see https://paste.rs/pNn |
19:26:10 | FromDiscord | <shadow.> just making sure we're on the same page lol |
19:26:22 | * | vicfred joined #nim |
19:26:37 | FromDiscord | <Vindaar> yes we are haha |
19:26:42 | FromDiscord | <shadow.> ok haha |
19:26:45 | FromDiscord | <shadow.> so i needa find a way to get |
19:26:47 | FromDiscord | <shadow.> what kind of type |
19:26:50 | FromDiscord | <shadow.> 1..100 returns |
19:27:56 | FromDiscord | <shadow.> something like that? |
19:27:56 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GgT |
19:28:03 | FromDiscord | <shadow.> first line is prolly not correct |
19:28:07 | FromDiscord | <shadow.> i forget how to make a var hold a type |
19:28:17 | * | Jesin quit (Quit: Leaving) |
19:28:47 | * | Zoom[m] adds ESP32 library elcritch/nesper to awesome-nim |
19:29:08 | * | Zoom[m] finds out the board he has on hand is actually ESP8266, and not ESP32 |
19:29:14 | FromDiscord | <Vindaar> you didn't forget, cause you can't do that |
19:30:03 | * | habamax quit (Quit: Lost terminal) |
19:30:12 | FromDiscord | <Vindaar> well, in principle you can always do a `typeof(<what's after in>)`. The problem starts if you need to have more knowledge about the type in the context of generating the code. As long as you can just emit something that will then be compiled to something that works (what e.g. is done in `mapIt`), you're fine |
19:31:50 | FromDiscord | <shadow.> hmmm |
19:31:52 | FromDiscord | <shadow.> well |
19:32:43 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GgX |
19:33:31 | FromDiscord | <lqdev> sure can |
19:33:42 | FromDiscord | <lqdev> but typeof is preferred, so `newSeq[x.typeof]()` |
19:33:52 | FromDiscord | <lqdev> also `var s: seq[x.typeof]` just looks nicer doesn't it |
19:34:39 | FromDiscord | <shadow.> hmm |
19:34:47 | FromDiscord | <shadow.> well |
19:35:02 | FromDiscord | <shadow.> i am kinda used to declarations not being equal to definitions |
19:35:04 | FromDiscord | <shadow.> c/c++ |
19:35:05 | * | Jesin joined #nim |
19:35:11 | FromDiscord | <shadow.> so that kinda syntax sometimes |
19:35:13 | FromDiscord | <shadow.> worries me lol |
19:35:44 | FromDiscord | <shadow.> (edit) "not being equal to definitions" => "without values causing undefined behaviour" |
19:35:54 | FromDiscord | <shadow.> obvi ik it works but idk |
19:35:58 | FromDiscord | <shadow.> the newSeq[]() seems more natural to me |
19:44:33 | FromDiscord | <lytedev> anybody have any idea why this doesn't work? http://0x0.st/i7yb.txt |
19:45:59 | FromDiscord | <Recruit_main707> it is not finding day1.nim |
19:46:23 | FromDiscord | <Recruit_main707> yay, i think i got my first compiler crash :p |
19:47:03 | FromDiscord | <Recruit_main707> well, internal error, they are not the same are they? |
19:49:39 | FromDiscord | <lytedev> correct, it does seem that way - but if I pull the `from` statement out of the macro, it works perfectly fine |
19:49:49 | FromDiscord | <shadow.> @lytedev may i ask some questions lol |
19:49:54 | FromDiscord | <lytedev> please lol |
19:49:58 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gh4 |
19:49:58 | FromDiscord | <shadow.> purpose? |
19:50:03 | FromDiscord | <shadow.> and why use a format string |
19:50:26 | FromDiscord | <lytedev> ultimately, I just want to import days 1-25 without 25 lines of copy/paste |
19:50:53 | FromDiscord | <lytedev> sent a code paste, see https://play.nim-lang.org/#ix=2Gh5 |
19:50:59 | FromDiscord | <lytedev> so ignore it T_T |
19:54:15 | FromDiscord | <shadow.> ohh |
19:54:22 | FromDiscord | <shadow.> hm |
19:54:27 | FromDiscord | <shadow.> yeah that means it couldn't find day1 |
19:54:33 | FromDiscord | <shadow.> is it in the same directory? |
19:54:38 | FromDiscord | <shadow.> that you ran the compiler from |
19:54:42 | FromDiscord | <shadow.> or in a path |
19:54:44 | FromDiscord | <shadow.> (edit) removed "a" |
19:55:09 | FromDiscord | <lytedev> it's in `src`, while I run `nimble run` from the repo root |
19:55:34 | FromDiscord | <lytedev> does nimble add some magic to import, then? |
19:56:40 | FromDiscord | <lytedev> ooooof I'm dumb |
19:56:53 | FromDiscord | <lytedev> adding `switch("path", "src/")` to my `config.nims` worked |
19:56:56 | FromDiscord | <lytedev> thanks |
19:57:09 | FromDiscord | <lytedev> so nimble does do some magic I guess |
19:59:45 | * | fredrikhr3 joined #nim |
20:03:01 | * | fredrikhr quit (Ping timeout: 260 seconds) |
20:03:01 | * | fredrikhr3 is now known as fredrikhr |
20:03:35 | FromDiscord | <enthus1ast> does someone has used niv's websocket lately? |
20:03:50 | FromDiscord | <enthus1ast> I don't know exactly but it seems broken |
20:05:30 | FromDiscord | <enthus1ast> i receive just one FRAME not even data |
20:05:52 | FromDiscord | <enthus1ast> i'm a little bit puzzled |
20:06:34 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/GvJ |
20:08:02 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/XD5 |
20:08:23 | FromDiscord | <enthus1ast> can someone please try it on their machines :/ |
20:09:00 | * | kinkinkijduet joined #nim |
20:09:15 | kinkinkijduet | using nim on an arm based chromebook |
20:09:30 | kinkinkijduet | lets see if theres any significant unique bugs eh? |
20:09:36 | FromDiscord | <Avatarfighter> lmao |
20:09:37 | FromDiscord | <Avatarfighter> mood |
20:09:46 | FromDiscord | <Avatarfighter> does your chromebook have fans? |
20:09:50 | kinkinkijduet | nope |
20:09:54 | FromDiscord | <Avatarfighter> haaha |
20:09:55 | FromDiscord | <Avatarfighter> same |
20:10:02 | FromDiscord | <Avatarfighter> mine STRUGGLED to compile nim it was crazy |
20:10:02 | kinkinkijduet | it's a lenovo duet |
20:10:20 | kinkinkijduet | oh mine is probably the fastest arm chromebook on the market |
20:10:27 | kinkinkijduet | or one of |
20:10:34 | FromDiscord | <Avatarfighter> that's really nice |
20:10:40 | kinkinkijduet | it's genuinely one of the faster computers ive used |
20:10:41 | FromDiscord | <Avatarfighter> Mine has an intel m3 chip or something |
20:10:49 | FromDiscord | <Avatarfighter> really fast little chip when its cool |
20:10:59 | kinkinkijduet | only beat by my current x86_64 desktop |
20:11:04 | FromDiscord | <Rebel> Please tell me after I went to asleep at 3 am disruptek came back 😄 |
20:11:13 | FromDiscord | <Avatarfighter> @Rebel he has not 😦 |
20:11:19 | FromDiscord | <Rebel> Nooooooooooooooooooooooooooo |
20:11:32 | kinkinkijduet | did disruptek declare quit or something? |
20:13:14 | clyybber | Araq: time to unmute disruptek? :p |
20:15:34 | * | vesper11 joined #nim |
20:16:27 | reversem3 | How come I can't create two different procs for two different ssh connections? http://pastebin.ws/76bstk |
20:17:01 | reversem3 | If I understand waitFor correctly , its waiting till all actions are complete |
20:17:39 | FromDiscord | <enthus1ast> you can |
20:17:47 | FromDiscord | <enthus1ast> asyncCheck both |
20:17:55 | FromDiscord | <enthus1ast> when have one waitForever |
20:18:27 | FromDiscord | <enthus1ast> (edit) "when" => "then" |
20:18:46 | FromDiscord | <dom96> runForever 🙂 |
20:18:53 | FromDiscord | <enthus1ast> yeah |
20:19:34 | FromDiscord | <enthus1ast> i'm a little nervous now that my favourite websocket library seems broken 😉 |
20:19:52 | FromDiscord | <enthus1ast> (edit) "waitForever" => "runForever" |
20:19:53 | * | vesper joined #nim |
20:19:56 | * | vesper11 quit (Ping timeout: 240 seconds) |
20:20:33 | reversem3 | so asyncCheck then runForever ? |
20:20:37 | FromDiscord | <enthus1ast> yes |
20:21:23 | FromDiscord | <enthus1ast> but your example should still work, but in sequence |
20:21:24 | reversem3 | cool I'll try that thanks |
20:21:42 | reversem3 | I wish it did |
20:22:33 | reversem3 | it only connects to the first session |
20:25:03 | * | tane joined #nim |
20:26:43 | FromDiscord | <enthus1ast> can someone please confirm that niv's websocket still works and that it's something on my end? |
20:29:24 | FromDiscord | <dom96> @enthus1ast a version of it definitely works, I use it for Stardust |
20:30:15 | FromDiscord | <dom96> looks like I'm pinned on this https://github.com/dom96/websocket.nim/tree/fixes-client-connections |
20:34:58 | FromDiscord | <enthus1ast> thank you @dom96 i'll try this version (i use it in several projects, most of them are ancients already but still running) |
20:35:30 | FromDiscord | <enthus1ast> (edit) "ancients" => "ancient" |
20:38:14 | * | narimiran quit (Ping timeout: 260 seconds) |
20:45:57 | FromDiscord | <Rebel> Use that or https://github.com/treeform/ws 🤔 |
20:46:13 | reversem3 | Do I still have to make to procs? or can I add another ssh session to the same proc? |
20:50:16 | FromDiscord | <enthus1ast> the thing i did not like about treeforms ws is that i cannot create websockets beforehand |
20:50:35 | FromDiscord | <enthus1ast> but yeah maybe i can use this |
20:52:24 | * | kungtotte quit (Read error: Connection reset by peer) |
20:52:47 | * | kungtotte joined #nim |
20:56:06 | FromDiscord | <Rebel> hmmm please let me know which one you end up going with |
20:56:15 | FromDiscord | <Rebel> I plan to use websockets as well for a project |
20:56:24 | FromDiscord | <Rebel> Already have enough code to refactor 😅 |
20:57:54 | ForumUpdaterBot | New thread by Niminem: How to wrap a C object when field names are Nim keywords?, see https://forum.nim-lang.org/t/7191 |
21:00:32 | * | clyybber quit (Quit: WeeChat 3.0) |
21:02:09 | FromDiscord | <Recruit_main707> hmmm, how can this be fixed? |
21:05:52 | Zevv | https://www.buymeacoffee.com/disruptek |
21:06:35 | * | vesper quit (Ping timeout: 265 seconds) |
21:10:58 | FromDiscord | <Rebel> `py |
21:11:01 | FromDiscord | <Rebel> sent a long message, see https://paste.rs/Esd |
21:11:29 | FromDiscord | <Rebel> (edit) "`py" => "sent a code paste, see https://play.nim-lang.org/#ix=2Gho" |
21:11:30 | FromDiscord | <Rebel> in Nim == ? |
21:11:51 | FromDiscord | <Rebel> Guess I could just write one quickly from scratch |
21:14:18 | FromDiscord | <enthus1ast> i'll use the one that works for this project, i'll hack together a 'Virtual World' in the browser, to pep up a Zoom Christimas Party (fck Covid) |
21:14:54 | FromDiscord | <Rebel> https://media.discordapp.net/attachments/371759389889003532/783803401767092314/89b.png |
21:14:59 | reversem3 | WOW I'm an idiot , it wasn't the code it was the command I screwed up on the second session |
21:15:17 | reversem3 | 1 char off and I loose my mind |
21:15:36 | FromDiscord | <enthus1ast> but for my "long term projects" i use niv's ws, and for this i guess i have to fix it |
21:19:50 | FromDiscord | <lqdev> @Rebel there's a count table, hold on a sec |
21:20:03 | FromDiscord | <lqdev> https://nim-lang.org/docs/tables.html#CountTable |
21:23:33 | FromDiscord | <Rebel> hot |
21:23:45 | FromDiscord | <Rebel> realized I didn't need it 😛 but nice to know |
21:28:00 | FromDiscord | <shadow.> whats the difference between quote and quote do? |
21:29:53 | FromDiscord | <Esbeesy> Hey I was looking at your day 2, and noticed you used `block Part1:` and `block Part2:` - What's the reasoning behind the block part? |
21:30:00 | * | vesper11 joined #nim |
21:30:13 | FromDiscord | <Esbeesy> Why not just echo the results? |
21:32:56 | * | hmmm joined #nim |
21:34:46 | FromDiscord | <shadow.> sent a code paste, see https://paste.rs/WCo |
21:35:27 | FromDiscord | <lqdev> not using quote? |
21:35:36 | FromDiscord | <lqdev> hoisting the for loop out to a separate variable? |
21:35:43 | FromDiscord | <lqdev> using result? |
21:35:47 | FromDiscord | <lqdev> using if expressions? |
21:36:01 | FromDiscord | <lqdev> idk man so much you could to |
21:36:03 | FromDiscord | <lqdev> (edit) "to" => "do" |
21:44:02 | * | mfiano joined #nim |
21:56:46 | FromDiscord | <Vindaar> @Esbeesy No real reason. I like named blocks, because they give some more meaning to code. here of course it's just a simple way to highlight what's part 1 and 2 and allows me to reuse the same variable name 🙃 |
21:59:09 | FromDiscord | <Esbeesy> Ahh cool, I thought there was some hidden magic to Nim that I was missing there |
22:01:01 | * | Q-Master quit (Quit: Ушел) |
22:01:55 | Prestige | J |
22:02:02 | Prestige | woops |
22:02:28 | * | Q-Master joined #nim |
22:02:47 | FromDiscord | <fwsgonzo> `'str' is not accessible using discriminant 'kind' of type 'JsonNodeObj'`↵what does that mean? ^ |
22:02:56 | FromDiscord | <fwsgonzo> I |
22:03:17 | FromDiscord | <fwsgonzo> I'm calling `j.pretty()` on a `var j = % { ... }` |
22:03:30 | FromDiscord | <fwsgonzo> (edit) "I'm calling `j.pretty()` on a `var j = % { ... ..." added ""blah" =" |
22:03:40 | FromDiscord | <fwsgonzo> (edit) ""blah" =" => ""blah":" |
22:06:46 | * | Q-Master quit (Client Quit) |
22:06:57 | * | Q-Master joined #nim |
22:08:02 | FromDiscord | <fwsgonzo> (edit) sent a code paste, see https://paste.rs/Usx |
22:09:00 | * | kinkinkijduet quit (Ping timeout: 244 seconds) |
22:09:31 | * | kinkinkijduet joined #nim |
22:09:52 | * | mbomba joined #nim |
22:12:14 | * | mbomba quit (Client Quit) |
22:17:17 | FromDiscord | <lytedev> in a macro, how can I interpolate a string literally instead of having it wrapped in quotes when I use backticks? |
22:26:56 | FromDiscord | <fwsgonzo> it seems like it's very dangerous to use the cpp backend - my issues went away when going back to the C backend |
22:32:06 | reversem3 | I know its not the greatest idea , but I added some code to a library I downloaded from nimble. I want to import that library now , how do I compile so its the new version I edited ? |
22:32:25 | reversem3 | I'll do a pull request later , but I want to test it firest |
22:32:29 | reversem3 | * I'll do a pull request later , but I want to test it first |
22:36:19 | voltist | Could someone link me to an example or two about returning data from threads? |
22:37:17 | voltist | I'm surprised that I can't find any |
22:39:49 | * | Q-Master quit (Read error: Connection reset by peer) |
22:39:56 | * | Q-Master joined #nim |
22:44:08 | * | alexander92 joined #nim |
22:44:29 | * | natrys quit (Quit: natrys) |
22:45:13 | FromDiscord | <j-james> Is there a nice way to do something like `for number in parseInt(lines(input)):`? |
22:47:45 | * | Vladar quit (Quit: Leaving) |
22:48:13 | FromDiscord | <fwsgonzo> it seems like recent nim has broken --standalone with the nimErrorFlag addition, which looks like it could be supplied to --standalone if I |
22:48:18 | FromDiscord | <fwsgonzo> (edit) "I" => "I'm reading the code correctly" |
22:48:49 | * | alexander92 left #nim (#nim) |
22:48:50 | * | alexander92 joined #nim |
22:54:48 | Zoom[m] | nixfreak: If you modified the files directly, it should work automatically, where do you think the compiler takes the libraries from? ;) |
22:55:19 | FromDiscord | <Esbeesy> Not really, is this for the AoC Day 1? |
22:55:53 | FromDiscord | <Esbeesy> (edit) "really," => "really (as far as I know but I'm new to Nim)," |
22:56:13 | reversem3 | yeah I get it Zoom but its not working , is there a cache maybe ? |
22:57:13 | FromDiscord | <Esbeesy> sent a code paste, see https://play.nim-lang.org/#ix=2GhL |
22:57:39 | FromDiscord | <Esbeesy> sent a code paste, see https://play.nim-lang.org/#ix=2GhM |
22:57:44 | Zoom[m] | Not sure. Check out the cache for your project in ~/.cache/nim/ |
23:03:50 | reversem3 | lol yeah lots of instances in multiple files , ok I get it don't delete if you don't need to |
23:03:54 | FromDiscord | <j-james> @Esbeesy Yes it is 😃 |
23:05:07 | FromDiscord | <j-james> My reason for asking was that I iterated through the input three times, and had to wrap each occurance of `number` in a `parseInt` which was just a bit ugly |
23:05:56 | * | tane quit (Quit: Leaving) |
23:08:52 | FromDiscord | <Quibono> So for fast json parsing is packedjson the best? |
23:14:33 | * | abm joined #nim |
23:16:30 | FromDiscord | <Esbeesy> Yeah I just blasted every line into a big integer sequence as you can see in my first snippet there 😹 https://github.com/sambeckingham/advent-of-code-2020 (Disclaimer: I'm a Go/.NET dev by trade so my Nim is most likely not idiomatic Nim by any stretch) |
23:29:45 | * | nisstyre quit (Quit: WeeChat 2.8) |
23:30:14 | * | nisstyre joined #nim |
23:33:53 | * | lum quit (Read error: Connection reset by peer) |
23:33:58 | * | not_lum joined #nim |
23:39:14 | FromDiscord | <Quibono> Has anyone used JSMN? It seems like either that or Disruptek's jason is what I want. |
23:44:50 | * | Gustavo6046 quit (Ping timeout: 246 seconds) |
23:46:03 | * | mbomba joined #nim |
23:55:53 | * | lbart quit (Ping timeout: 260 seconds) |