00:01:16 | FromDiscord | <shadow.> yeah exactly |
00:01:26 | FromDiscord | <shadow.> low verbosity compared to other compiled languages |
00:03:41 | FromDiscord | <ElegantBeef> Shadow's taunting me with the use of scanf 😄 |
00:04:17 | FromDiscord | <ElegantBeef> I just rewrote my `whenScanf` to `scanTuple`, to avoid predeclaring variables with scanf, then i come here and see scanf 😛 |
00:05:50 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Hul Atleast i think it'll be nice |
00:07:59 | FromDiscord | <Quibono> Does anyone use Alpaca as a broker? I'm trying to write a Nim SDK |
00:09:20 | FromDiscord | <shadow.> ooh that's sexy |
00:09:23 | FromDiscord | <shadow.> what's that a part of? |
00:10:51 | FromDiscord | <ElegantBeef> Hopefully if my pr goes through `strscans` 😄 |
00:10:54 | FromDiscord | <shadow.> ohhh |
00:10:55 | FromDiscord | <shadow.> good idea |
00:11:01 | FromDiscord | <shadow.> i'd love to see that go through |
00:12:02 | FromDiscord | <shadow.> i wonder what i could pr |
00:15:22 | FromDiscord | <shadow.> @ElegantBeef would it just return `default` for the rest of the values if success is false? |
00:15:31 | FromDiscord | <ElegantBeef> Yes |
00:15:35 | FromDiscord | <shadow.> fair fair |
00:15:51 | FromDiscord | <ElegantBeef> You should check the success before accessing the other values |
00:15:56 | FromDiscord | <shadow.> ye ofc |
00:16:03 | * | opal quit (Ping timeout: 240 seconds) |
00:16:14 | FromDiscord | <shadow.> well in this example you need to assign the tuple instead of declaring the vars lol |
00:16:21 | FromDiscord | <shadow.> but usually thats shorter than declaring all the vars still |
00:16:46 | FromDiscord | <Quibono> sent a code paste, see https://play.nim-lang.org/#ix=2Hun |
00:16:50 | FromDiscord | <ElegantBeef> `type` |
00:16:54 | FromDiscord | <ElegantBeef> shit |
00:16:56 | FromDiscord | <shadow.> lol |
00:16:57 | FromDiscord | <Quibono> lol |
00:16:58 | FromDiscord | <ElegantBeef> backticks before and after |
00:17:00 | FromDiscord | <shadow.> \`type\` |
00:17:04 | FromDiscord | <Quibono> Cool |
00:17:21 | FromDiscord | <Quibono> I thought that was it, but I wasn't sure. |
00:17:41 | FromDiscord | <ElegantBeef> Yea shadow you dont have to write them twice, but have to pay the price with tuple unpacking which is afaik is relatively slow afaik |
00:17:53 | FromDiscord | <ElegantBeef> god damn i'm dumb today |
00:18:06 | FromDiscord | <shadow.> lol |
00:18:18 | FromDiscord | <shadow.> i'm tryna contribute to nim too but i can't figure out how to rotate a deque |
00:18:20 | FromDiscord | <shadow.> i'm close tho |
00:18:39 | FromDiscord | <ElegantBeef> rotate meaning? |
00:19:00 | FromDiscord | <shadow.> `deq.addLast deq.popFirst` |
00:19:04 | FromDiscord | <shadow.> but that's inefficient |
00:19:13 | FromDiscord | <shadow.> so i need to do it just with like indexing and switching head / tail |
00:19:26 | FromDiscord | <shadow.> (edit) "`deq.addLast deq.popFirst`" => "`deq.addLast(deq.popFirst)`" |
00:20:03 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#swap%2CT%2CT↵then pop? |
00:20:20 | FromDiscord | <shadow.> no |
00:20:20 | FromDiscord | <shadow.> like |
00:20:29 | FromDiscord | <shadow.> `[1, 2, 3, 4, 5]` turns to `[2, 3, 4, 5, 1]` |
00:20:30 | FromDiscord | <shadow.> ye? |
00:20:56 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Huo |
00:22:42 | FromDiscord | <ElegantBeef> so you're moving all elements down n wrapped? |
00:22:48 | FromDiscord | <shadow.> nah |
00:22:50 | FromDiscord | <shadow.> the data is like |
00:22:57 | FromDiscord | <ElegantBeef> your example is literally doing that |
00:23:04 | FromDiscord | <shadow.> wait |
00:23:06 | FromDiscord | <shadow.> wdym? |
00:23:09 | FromDiscord | <shadow.> OHH |
00:23:10 | FromDiscord | <shadow.> yeah |
00:23:25 | FromDiscord | <shadow.> `[1, 2, 3, 4, 5, 0, 0, 0]`↵goes to ↵`[0, 2, 3, 4, 5, 0, 0, 1]` or something at least that's how i have to do it |
00:23:31 | FromDiscord | <shadow.> nvm |
00:23:32 | FromDiscord | <ElegantBeef> for each element the new index is `(index - n + len) mod len` |
00:23:44 | FromDiscord | <shadow.> in which part? |
00:23:48 | FromDiscord | <ElegantBeef> The first example |
00:24:01 | FromDiscord | <shadow.> oh shoot |
00:24:04 | FromDiscord | <shadow.> alright thanks |
00:24:20 | FromDiscord | <shadow.> wouldn't that require reindexing every element? |
00:24:40 | * | opal joined #nim |
00:24:58 | FromDiscord | <ElegantBeef> How else do you move elements around? 😄 |
00:25:19 | FromDiscord | <shadow.> well in a deque you have head, tail, and mask so ideally you could do it in one change is the idea? |
00:25:30 | FromDiscord | <shadow.> im not sure |
00:25:36 | FromDiscord | <ElegantBeef> Well in your first example you move all elements down an index |
00:25:49 | FromDiscord | <shadow.> well yes in the seq repr |
00:25:51 | FromDiscord | <shadow.> but internally no |
00:26:36 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Huu |
00:26:42 | FromDiscord | <shadow.> that's repr vs internal |
00:27:04 | FromDiscord | <shadow.> but that isnt scalable so |
00:27:09 | FromDiscord | <shadow.> i needa figure it out lol |
00:31:42 | FromDiscord | <Rika> why are you using a seq for this again |
00:32:23 | FromDiscord | <shadow.> wdym? |
00:32:24 | FromDiscord | <shadow.> i'm not? |
00:32:30 | FromDiscord | <shadow.> the deques internal data is a seq |
00:32:34 | FromDiscord | <shadow.> i'm just echoing it |
00:38:13 | FromDiscord | <shadow.> cls |
00:38:17 | FromDiscord | <shadow.> whoops |
00:38:55 | voltist | Does anyone know of a Nim implementation of cartpole? |
00:40:33 | FromDiscord | <InventorMatt> I don't think there is. I started creating a rough one in opengl a while back but it is not particularly close to being finished |
00:41:39 | * | Tanger joined #nim |
00:42:17 | FromDiscord | <shadow.> WAIT I MIGHTA GOT IT |
00:42:40 | FromDiscord | <shadow.> YES I THINK I GOT IT |
00:43:44 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HuA |
00:43:45 | FromDiscord | <shadow.> at least that works and is fast |
00:45:05 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2HuA" => "https://play.nim-lang.org/#ix=2HuB" |
00:46:17 | FromDiscord | <shadow.> disruptek art thou heree |
00:50:44 | * | Jesin quit (Quit: Leaving) |
00:55:00 | * | Jesin joined #nim |
00:55:43 | FromDiscord | <shadow.> YES |
00:55:44 | FromDiscord | <shadow.> i got it working |
00:56:20 | FromDiscord | <shadow.> should i check w ppl here if it's good enough before sending a pr? |
00:56:59 | FromDiscord | <ElegantBeef> I havent been 😄 |
00:57:34 | FromDiscord | <shadow.> havent been what? |
00:57:41 | FromDiscord | <ElegantBeef> Checking here |
00:57:43 | FromDiscord | <shadow.> oh |
00:57:45 | FromDiscord | <shadow.> ohh ok |
00:58:03 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2HuF |
00:58:06 | FromDiscord | <shadow.> that's my solution |
00:58:12 | FromDiscord | <ElegantBeef> Although one of my PRs is needed and my other one is the scanTuple |
00:58:18 | FromDiscord | <shadow.> fair |
01:02:03 | FromDiscord | <ElegantBeef> You'll want `runnableExamples:` probably |
01:02:07 | FromDiscord | <shadow.> fair |
01:02:13 | FromDiscord | <shadow.> those go above code right? |
01:02:18 | FromDiscord | <ElegantBeef> Yea |
01:02:43 | FromDiscord | <shadow.> i also needa change to 2-space indent |
01:03:08 | FromDiscord | <Rika> ye |
01:03:09 | FromDiscord | <Rika> s |
01:03:10 | FromDiscord | <Rika> finally |
01:03:21 | FromDiscord | <shadow.> what |
01:03:29 | FromDiscord | <shadow.> the 2 space indent or me solving deque rotation? |
01:04:18 | FromDiscord | <Rika> former duh |
01:05:52 | FromDiscord | <shadow.> lmfao |
01:07:37 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HuJ |
01:07:37 | FromDiscord | <shadow.> @ElegantBeef does this work? |
01:08:33 | * | hmmm quit () |
01:08:40 | FromDiscord | <shadow.> i tried to model after their thing |
01:09:03 | FromDiscord | <shadow.> alr ima send a pr through then? |
01:12:12 | FromDiscord | <shadow.> yeye ima do it lol |
01:54:30 | FromDiscord | <shadow.> fingers crossed 🤞 https://media.discordapp.net/attachments/371759389889003532/786772866023817236/unknown.png |
01:54:43 | FromDiscord | <shadow.> @ElegantBeef im actually surprised that tuple thing hasnt been added yet, seems much more concise lmao |
01:54:57 | FromDiscord | <ElegantBeef> I mean the original version was different |
01:55:00 | FromDiscord | <shadow.> i see |
01:55:01 | FromDiscord | <shadow.> im guessing that needs a fat chunk of metaprogramming? |
01:55:08 | FromDiscord | <ElegantBeef> Only a few lines |
01:55:11 | FromDiscord | <shadow.> oh wow nice |
01:55:21 | FromDiscord | <shadow.> template or macro |
01:55:22 | FromDiscord | <ElegantBeef> ~40 lines of macro |
01:55:22 | disbot | no footnotes for `40`. 🙁 |
01:55:26 | FromDiscord | <shadow.> ah i see lol |
01:55:40 | FromDiscord | <ElegantBeef> Well it has to be a macro to emit all that info from the scanf |
01:55:59 | FromDiscord | <ElegantBeef> I didnt reimplement scanf i'm still emitting a body that is a blocked scope scanf |
01:56:20 | FromDiscord | <shadow.> ah true |
01:57:36 | FromDiscord | <shadow.> how does nim handle all the pr's? im sure they get a shit ton every day lmao |
01:57:53 | FromDiscord | <shadow.> oh nvm like one a day |
01:57:53 | FromDiscord | <ElegantBeef> People review them then merge them if accepted 😄 |
01:58:12 | FromDiscord | <shadow.> ahh right multiple people have edit perms |
01:58:20 | FromDiscord | <ElegantBeef> Yea look at this pr for instance https://github.com/nim-lang/Nim/pull/16276 |
01:58:21 | disbot | ➥ Adds toSet to create sets from iterables |
01:58:27 | FromDiscord | <shadow.> well i know how git works lol i just meant i didn't know how they handled the quantity |
01:58:44 | FromDiscord | <ElegantBeef> My final code is nowhere near what i started with |
01:58:53 | FromDiscord | <shadow.> fair fair |
01:59:05 | FromDiscord | <ElegantBeef> it started with a `proc toSet[T: Settypes}` and now we've got a `template toSet` 😄 |
01:59:35 | FromGitter | <iffy> I'm running into a problem where a `styledEcho` within `std/unittest` is failing with various errors. Right now (with my debugging code inserted) it's "Error: errno: 9 `Bad file descriptor`". Originally I think the error code was a 2. What do I do to debug this? |
01:59:35 | FromDiscord | <shadow.> lmao fair enough haha |
01:59:44 | FromDiscord | <shadow.> hmm |
01:59:59 | FromDiscord | <shadow.> have you ever looked at disruptek's testes? |
02:00:04 | FromDiscord | <shadow.> they're quite pretty |
02:00:24 | FromGitter | <iffy> I'm spawning several subprocesses in my tests |
02:01:06 | FromDiscord | <shadow.> ah i see |
02:01:32 | FromDiscord | <shadow.> i don't have experience with that lib so i can't help, sorry |
02:03:35 | FromGitter | <iffy> I'm not sure it's the lib's fault -- it just happens to be where the echo is that fails, I think. |
02:04:49 | FromGitter | <iffy> Somehow stdout is getting closed is my guess (`stdout.endOfFile() == true` when the error happens). But I'm not closing it explicitly within my tests. |
02:06:45 | FromDiscord | <shadow.> all checks passed lets go |
02:06:54 | FromDiscord | <shadow.> now lets just see if they think its a worthy addition lol |
02:16:05 | FromGitter | <iffy> This reliably fails with a bad descriptor error for me (macOS, Nim 1.4.0): https://gist.github.com/iffy/276527a6a9d14214896747fcf7f9c2ec I'm going crazy |
02:21:29 | FromGitter | <iffy> Reduced further: https://play.nim-lang.org/#ix=2HuZ Does this fail for anyone else? |
02:25:27 | * | sagax quit (Ping timeout: 260 seconds) |
02:30:30 | FromDiscord | <Quibono> Works on my iPhone |
02:30:35 | * | rockcavera quit (Remote host closed the connection) |
02:32:39 | FromDiscord | <Rika> god damn how in the hell did you run it on your iphone |
02:33:13 | FromDiscord | <Quibono> In the browser. :p But that'd be cool otherwise. |
02:33:50 | pixtum[m] | what nim extension do you guys recommend for vscode? |
02:34:13 | FromDiscord | <ElegantBeef> I've been using the `nimlsp` one as of late |
02:35:09 | mipri | iffy: ungetc()'s returning -1 |
02:35:26 | mipri | compile with -d:danger and ltrace it to see that |
02:38:06 | mipri | and a C program that does the same thing gets the same result. |
02:38:21 | mipri | conclusion: as expected, it doesn't make any sense to check if stdout has hit EOF |
02:40:01 | mipri | hm. |
02:40:13 | mipri | https://github.com/bminor/musl/blob/master/src/stdio/ungetc.c#L5 |
02:42:59 | mipri | or rather, io.endOfFile could avoid setting errno by only conditionally calling ungetc |
02:45:58 | FromGitter | <iffy> I was able to cause the error by calling `endOfFile` but I'm not certain that's the original issue (which was error 2, not error 9). I'll see if I can learn how to trace on a mac and find the culprit |
02:46:07 | FromGitter | <iffy> @mipri shall I file an issue? |
02:47:16 | mipri | *shrug*, I'm not sure it's really a problem. If you're getting a different error, it might be related to your problem as well. |
02:56:05 | disruptek | i replaced unittest in part because it swallows output like that. |
02:58:16 | disruptek | shadow.: if you pr it, i will thumb it. |
02:58:28 | disruptek | i mean, i think i basically asked for it, so... |
02:58:52 | FromDiscord | <shadow.> if i pr what |
02:59:43 | disruptek | deque rotate |
03:00:09 | disruptek | oh i see it. |
03:00:18 | FromDiscord | <shadow.> yes |
03:00:21 | FromDiscord | <shadow.> i pred it lol |
03:00:24 | FromDiscord | <shadow.> passed all checks |
03:00:28 | disruptek | is there rotateRight? |
03:00:35 | FromDiscord | <shadow.> using negatives |
03:00:39 | FromDiscord | <shadow.> in algorithm there's only rotate left |
03:00:40 | disruptek | meh. |
03:00:41 | FromDiscord | <shadow.> just with negatives |
03:00:43 | FromDiscord | <shadow.> so i modeled after that |
03:00:50 | FromDiscord | <shadow.> if you'd like me to change it, i can |
03:01:06 | disruptek | eh, template it i guess. |
03:01:21 | FromDiscord | <shadow.> so rotateRight is just a template for rotateLeft with a negative? |
03:01:22 | disruptek | just my opinion. |
03:01:30 | disruptek | yeah. |
03:02:06 | FromDiscord | <shadow.> ? |
03:02:08 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hv8 |
03:02:16 | disruptek | i don't have the bandwidth to load github right now. that's how pathetic it is here. |
03:02:29 | FromDiscord | <shadow.> does that template look fair to you? |
03:03:07 | mipri | it's useful to support negatives to the same call for code that wants to rotate by a mix of positive and negative values, but it's also useful to not stand down(-1) from this chair and walk away from(-1) the kitchen to empty(-1) my glass so I can dehydrate(-1) a bit. |
03:03:17 | FromDiscord | <shadow.> fair |
03:03:22 | FromDiscord | <shadow.> alr ill make the template |
03:03:32 | FromDiscord | <Quibono> I just spent an unreasonable amount of time trying to replicate httpclient.request() because I didn't know it was a thing |
03:03:38 | FromDiscord | <shadow.> i can do `Deque` as type in a template, right? |
03:03:44 | FromDiscord | <Quibono> _is going to go read the stdlib as punishment._ |
03:03:50 | disruptek | yes. |
03:03:57 | FromDiscord | <shadow.> cool |
03:04:25 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hvd |
03:04:38 | FromDiscord | <shadow.> ah right do i have to make it var Deque or nah |
03:04:54 | disruptek | don't waste our time with 3-line pastes, please. just c+p them here. |
03:05:10 | mipri | probably the bot that's doing that |
03:05:16 | FromDiscord | <shadow.> yeah the bot does that |
03:05:20 | disruptek | it should be the same signature as the Left. |
03:05:29 | FromDiscord | <shadow.> wdym? |
03:05:29 | disruptek | i know. don't fence it and it won't happen. |
03:05:37 | FromDiscord | <shadow.> ah ok |
03:06:03 | disruptek | it will need to be a var in order to match correctly. |
03:06:32 | disruptek | nice job adding something that's actually useful. |
03:06:33 | FromDiscord | <shadow.> should i switch it from `Make n negative for right rotation.` to something else now that there's rotateRight |
03:06:36 | FromDiscord | <shadow.> thanks |
03:06:51 | disruptek | i don't care. i will let other people demand changes. |
03:06:54 | FromDiscord | <shadow.> kk |
03:07:04 | disruptek | too much time is wasted on bullshit. |
03:07:25 | FromDiscord | <shadow.> how do i do the "also see this proc" thing again |
03:07:27 | FromDiscord | <shadow.> where it quotes |
03:07:33 | FromDiscord | <shadow.> nnvm i think i got it |
03:07:37 | FromDiscord | <acek7> guys im way too drunk |
03:07:44 | disruptek | not like there aren't other examples... |
03:08:02 | FromDiscord | <acek7> WHOOPS wrong chat |
03:08:08 | FromDiscord | <acek7> anyways |
03:08:12 | FromDiscord | <acek7> hows you guys |
03:08:27 | disruptek | not drunk enough. |
03:08:35 | FromDiscord | <shadow.> ## \`rotateRight proc <@rotateRight, var Deque[T], T>\`_ |
03:08:37 | FromDiscord | <shadow.> is that how i do that? |
03:08:46 | FromDiscord | <shadow.> ah shit i forgot asterisks fuck up on your end |
03:08:50 | disruptek | don't know, don't care. |
03:08:51 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/786791580672852028/unknown.png |
03:09:01 | disruptek | worse than a paste; no, thank you. |
03:09:05 | FromDiscord | <shadow.> rip |
03:09:44 | FromDiscord | <acek7> lets get married diruptek |
03:09:54 | disruptek | just, y'know, make sure it's obvious which side the rotation moves objects to. |
03:10:03 | FromDiscord | <shadow.> yeah |
03:10:21 | disruptek | acek7: zevv wouldn't like that. |
03:10:31 | disruptek | but we can fool around on the side, if you want. |
03:10:44 | FromDiscord | <acek7> sounds like a plan |
03:10:59 | FromDiscord | <acek7> i kinda took a programming break |
03:11:11 | FromDiscord | <acek7> i got all sad and felt defeated and didnt know how to make what i wanted |
03:11:23 | FromDiscord | <acek7> so here i am just a lousy designer not knowing how to program |
03:11:24 | FromDiscord | <shadow.> i can put runnableExamples in a template right- |
03:11:37 | FromDiscord | <shadow.> im going to assume yes |
03:11:54 | FromDiscord | <shadow.> sent a long message, see https://paste.rs/EZ7 |
03:11:55 | FromDiscord | <shadow.> alright that's what i did |
03:12:00 | FromDiscord | <shadow.> cool if i commit? |
03:12:37 | FromDiscord | <shadow.> i commited |
03:13:48 | FromDiscord | <shadow.> tests are failing rip- |
03:14:19 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:14:22 | FromDiscord | <shadow.> ah wait |
03:14:28 | FromDiscord | <shadow.> does star go before [T] |
03:14:33 | FromDiscord | <shadow.> yes, yes it does |
03:15:02 | FromDiscord | <shadow.> thanks for the comment of approval disruptek |
03:15:52 | * | muffindrake joined #nim |
03:26:08 | * | Tanger quit (Read error: Connection reset by peer) |
03:26:23 | * | abm quit (Read error: Connection reset by peer) |
03:27:49 | disruptek | acek7: what kind of design? |
03:28:11 | FromDiscord | <acek7> graphic and web and im trying to figure out some app designs |
03:28:11 | * | Tanger joined #nim |
03:28:23 | FromDiscord | <acek7> i mainly just make some dope ass logos sometimes |
03:28:33 | FromDiscord | <acek7> idk i can do like anything |
03:28:40 | disruptek | well, nim needs some web-design work done. |
03:33:29 | disruptek | hmu if you're interested. |
03:34:54 | disruptek | and not drunk. |
03:35:25 | FromDiscord | <acek7> Oh damn for real |
03:35:53 | FromDiscord | <acek7> wheres a good place to reach you through IRC or discord |
03:37:18 | FromDiscord | <acek7> you know when you are coming down off of being drunk when the words turn from 4 words into like 2 and a half |
03:40:19 | disruptek | which half? |
03:40:43 | disruptek | just send to github at andy.nim.fan or something. |
03:44:38 | FromDiscord | <acek7> okie doke |
03:50:01 | * | jjido quit (Quit: Connection closed for inactivity) |
03:54:46 | * | mika_ joined #nim |
03:59:24 | * | mika_ quit (Ping timeout: 256 seconds) |
04:03:14 | FromDiscord | <shadow.> disruptek is there anything else useful that needs to be added because school does not assign nearly enough hw and my grades are not nearly low enough for me to spendtime doing anything other than programming |
04:03:38 | disruptek | which project? |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:36 | * | supakeen joined #nim |
04:07:13 | FromDiscord | <Rika> Shadow |
04:07:34 | FromDiscord | <Rika> Can't you just do "-n" instead of n -1 |
04:11:46 | FromDiscord | <shadow.> oh right- |
04:11:57 | FromDiscord | <shadow.> time to update lol |
04:12:23 | disruptek | you have a cold drink and a room-temperature drink. do you mix them to have a single cool drink, do you quickly drink the room-temp beverage, or do you drink the cool drink first? |
04:12:59 | disruptek | it needs a changelog entry and a .since notation, most likely. i cannot load github. |
04:13:01 | FromDiscord | <Rika> Depends on how thirsty I am |
04:13:39 | * | cgfuh quit (Quit: WeeChat 2.9) |
04:13:47 | disruptek | rika: can you help me with an error message? |
04:14:11 | disruptek | what does this mean: |
04:14:14 | disruptek | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
04:14:26 | FromDiscord | <shadow.> oh lord |
04:14:26 | FromDiscord | <Rika> Lol |
04:14:50 | FromDiscord | <shadow.> i think it's what happens when a programmer tries to recite their friends |
04:15:43 | disruptek | it says that on my paycheck. |
04:16:38 | FromDiscord | <shadow.> what does since notation do again |
04:16:48 | disruptek | same thing it did last time. |
04:17:37 | FromDiscord | <shadow.> smart |
04:18:41 | * | NimBot joined #nim |
04:19:09 | disruptek | while you're editing the changelog, you can lookup a similar addition to the stdlib to see how to use it. |
04:19:22 | FromDiscord | <shadow.> fair enough |
04:19:34 | FromDiscord | <shadow.> i might do that tmr, not at my pc rn |
04:19:45 | FromDiscord | <shadow.> github on a phone is not a smart idea |
04:19:45 | disruptek | you said that yesterday. |
04:20:14 | FromDiscord | <shadow.> at the same time, yes |
04:20:23 | FromDiscord | <shadow.> im just a while loop internally |
04:20:29 | disruptek | weird. |
04:21:06 | disruptek | i really do need to write that what: else: loop. |
04:21:24 | FromDiscord | <shadow.> occasionally i stray off discord to watch animated 2d boys hit a volleyball in which case i `continue` that day, but otherwise i'm a straight while loop without fail |
04:21:57 | FromDiscord | <shadow.> disruptek: sounds like a job for future me? |
04:22:14 | disruptek | could be. |
04:22:33 | disruptek | it requires adding a new hook to cps. |
04:23:09 | disruptek | another weird thing cps allows you to do: named continue |
04:23:20 | disruptek | and continue: blocks. |
04:24:00 | FromDiscord | <shadow.> considering i've never used cps that might not be a good idea for me to develop |
04:24:11 | FromDiscord | <shadow.> deques at least i've used |
04:24:14 | disruptek | eh, it's pretty simple. |
04:24:32 | FromDiscord | <shadow.> what's it do |
04:24:48 | disruptek | named continue is pretty obvious. |
04:25:03 | disruptek | continue: echo "restarting the loop... now!" |
04:25:10 | FromDiscord | <shadow.> i meant what else |
04:25:22 | disruptek | it's while/else but with a cute name. |
04:25:23 | FromDiscord | <shadow.> sorry what: else: loop |
04:25:27 | FromDiscord | <shadow.> ohh |
04:25:36 | FromDiscord | <shadow.> else being if unbroken? |
04:25:49 | disruptek | yes, like python. |
04:25:55 | FromDiscord | <shadow.> i see |
04:26:18 | FromDiscord | <shadow.> how would you put else under what without nesting it since that'd raise invalid syntax, no? |
04:27:14 | disruptek | with a macro. |
04:32:37 | * | thomasross quit (Ping timeout: 264 seconds) |
04:33:10 | * | narimiran joined #nim |
04:45:01 | FromDiscord | <Varriount> Anything major being worked on at the moment? |
04:52:14 | disruptek | araq is working on isolate. |
04:55:24 | FromDiscord | <squid> I am trying to get the second cookie in a response from httpclient |
04:55:37 | FromDiscord | <squid> `response.headers["set-cookie"]` |
04:55:43 | FromDiscord | <squid> That gives me the first cookie |
04:55:53 | disruptek | you need to iterate over the table. |
04:55:59 | FromDiscord | <squid> How? |
04:56:09 | FromDiscord | <squid> Do I need to iterate? |
04:56:17 | disruptek | the table can have duplicate keys with multiple values. |
04:56:20 | FromDiscord | <squid> or could I just get the second "cookie" |
04:56:30 | disruptek | no, you must iterate. |
04:56:37 | FromDiscord | <squid> Okay |
04:56:47 | FromDiscord | <squid> How? |
04:57:16 | disruptek | for key, value in headers.pairs: if key == "set-cookie": echo value |
04:57:36 | FromDiscord | <squid> Thank you 🙂 |
04:58:09 | disruptek | it's a deprecated quirk of nim tables that contrasts with the exception in http rfc for cookie headers. unfortunately. |
05:00:07 | FromDiscord | <squid> Whats the way of doing and in a if statement? |
05:00:15 | disruptek | and |
05:00:19 | FromDiscord | <squid> Oh. |
05:00:23 | disruptek | ~manual |
05:00:24 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
05:00:24 | disbot | manual: 11just good to Ctrl+F in cases like this |
05:03:32 | * | Tanger quit (Remote host closed the connection) |
05:03:52 | * | Tanger joined #nim |
05:04:44 | * | Cthalupa quit (Ping timeout: 256 seconds) |
05:05:09 | * | Cthalupa joined #nim |
05:08:36 | FromDiscord | <hesman> Anyone can help me how to split a line separare by many whitespace |
05:08:46 | disruptek | see strutils module. |
05:09:00 | FromDiscord | <hesman> ex: line = " abc -> xyz <- uft" |
05:11:04 | FromDiscord | <hesman> I dont know how to define many Whitespace continuously |
05:11:31 | FromDiscord | <sealmove> is there a proc in `streams` that reads a null-terminated string? |
05:27:26 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:27:33 | * | njoseph joined #nim |
05:29:16 | * | xet7 joined #nim |
05:33:02 | * | sagax joined #nim |
05:34:37 | * | hpyc9 quit (Quit: 420) |
05:35:47 | FromDiscord | <squid> `splitted_phpsessid.removePrefix("PHPSESSID=")` |
05:35:59 | FromDiscord | <squid> `expression 'removePrefix(splitted_phpsessid, "PHPSESSID=")' has no type (or is ambiguous)` |
05:36:14 | FromDiscord | <squid> I am getting this error and I don't know what is wrong |
05:36:41 | mipri | removePrefix probably returns void, but you are attempting to use its return value |
05:37:04 | FromDiscord | <squid> oh. |
05:37:08 | FromDiscord | <squid> You're right |
05:37:47 | mipri | hesman, use a regex for that |
05:39:03 | FromDiscord | <squid> Can't he just split it with white space then join it without whitespace? |
05:39:38 | * | hpyc9 joined #nim |
05:39:56 | mipri | !eval import re; echo ("a b c".findAll(re"\S+"), "a b c".split(re"\s+")) |
05:40:00 | NimBot | (@["a", "b", "c"], @["a", "b", "c"]) |
05:46:11 | FromDiscord | <squid> @hesman https://play.nim-lang.org/#ix=2HvL |
05:46:14 | FromDiscord | <squid> That could also work |
05:47:05 | mipri | it doesn't |
05:47:16 | mipri | https://play.nim-lang.org/#ix=2HvM |
06:01:10 | FromDiscord | <squid> How do you set a variable to null? |
06:01:35 | mipri | provided it's a ref type, v = nil |
06:01:53 | FromDiscord | <hesman> oh thank, a_line = line.split(re"\s+") -> work |
06:02:36 | mipri | or a ptr type of course. |
06:04:06 | FromDiscord | <ElegantBeef> Otherwise you'd use an option to get that extra 1 option to the type |
06:10:49 | FromDiscord | <squid> It is a pointer type so it works, thank you |
06:12:01 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:36:27 | * | habamax joined #nim |
06:42:37 | voltist | @Vindaar Ping |
06:43:16 | * | Kaivo quit (Ping timeout: 240 seconds) |
06:45:15 | * | Kaivo joined #nim |
06:57:46 | FromDiscord | <sealmove> guys, is there a standard way to generate warnings from your code? or just print to yellow to stderr? |
07:05:09 | * | kungtotte quit (Read error: Connection reset by peer) |
07:05:58 | * | kungtotte joined #nim |
07:08:17 | Prestige | maybe the logging module? |
07:09:27 | Prestige | https://nim-lang.org/docs/logging.html @sealmove |
07:10:47 | FromDiscord | <sealmove> aha |
07:17:38 | * | def- quit (Remote host closed the connection) |
07:20:10 | * | def- joined #nim |
07:52:07 | * | PMunch joined #nim |
07:58:20 | * | tane joined #nim |
08:26:09 | ForumUpdaterBot | New thread by Pietroppeter: Let vs var for a sequence inside a proc, see https://forum.nim-lang.org/t/7241 |
09:00:03 | FromDiscord | <Vindaar> @voltist: Hey! I'm around now |
09:04:54 | * | Tanger quit (Quit: Leaving) |
09:09:36 | * | JustASlacker joined #nim |
09:19:29 | * | habamax quit (Read error: Connection reset by peer) |
09:19:49 | * | habamax joined #nim |
09:26:11 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:29:18 | * | habamax quit (Quit: leaving) |
09:29:34 | * | habamax joined #nim |
09:29:39 | * | Cthalupa quit (Ping timeout: 260 seconds) |
09:29:40 | Araq | it's 2020. my hard disk is full. what am I doing wrong? |
09:30:01 | * | Cthalupa joined #nim |
09:31:12 | FromDiscord | <Vindaar> you're not buying more hard drives fast enough, I'd say |
09:31:20 | mipri | prebuilt disk sizes are pretty skimpy, they're getting faster instead of larger. But you can supplement that with a cheap 8TB USB external drive these days, or just build a NAS |
09:32:15 | FromDiscord | <hugogranstrom> Life hack: instead of buying new storage, just remember it in your head instead. much cheaper 😛 |
09:33:17 | FromDiscord | <lqdev> Araq: just how big is your drive? |
09:34:21 | * | hmmmmm joined #nim |
09:34:28 | hmmmmm | yo |
09:35:10 | * | spiderstew joined #nim |
09:45:57 | * | kenran joined #nim |
09:46:20 | * | spiderstew quit (Quit: Konversation terminated!) |
09:47:29 | * | Tanger joined #nim |
09:47:31 | PMunch | I should really set up a massive NAS.. I keep running out of space all the time |
09:47:53 | dom96 | I did just that |
09:48:18 | dom96 | Transferring Steam games over to it is too slow sadly |
09:49:09 | PMunch | My problem is that I have a bunch of drives |
09:49:16 | PMunch | Not really that I'm running out of space |
09:49:28 | PMunch | But I have my OS on one SSD, and my /home on another |
09:49:36 | PMunch | And the /home SSD keeps running full |
09:49:39 | * | spiderstew_ joined #nim |
09:49:48 | PMunch | So I must move stuff to the HDD and symlink it back |
09:49:50 | PMunch | Which is a mess |
09:50:30 | PMunch | Maybe I should just make a CRON-job that moves every file that hasn't been written to in the past week to the hard-drive :P |
09:51:15 | PMunch | And then enable the access flag on the HDD so that files that are read from a lot can be put back on the SSD and blacklisted from moving |
09:51:24 | FromDiscord | <Rika> how massive are we talking about regards the nas youre interested in |
09:52:07 | FromDiscord | <scott> PMunch why not just mount the HDD at `/home` |
09:52:57 | FromDiscord | <scott> I have my "home folder" mounted on another physical machine, shared it via NFS to my "compute" box, then mounted like `/home/scott/Videos`, `/home/scott/Music`, etc in /etc/fstab |
09:53:42 | FromDiscord | <scott> you could also just use the HDD and set up the SSD as a ZFS L2 (persistent) ARC cache |
09:55:05 | FromDiscord | <sealmove> @PMunch I did some work on alignment. Would you let me know what you think? |
09:55:26 | FromDiscord | <scott> sent a code paste, see https://play.nim-lang.org/#ix=2HwV |
09:55:59 | FromDiscord | <scott> (edit) "https://play.nim-lang.org/#ix=2HwV" => "https://play.nim-lang.org/#ix=2HwW" |
09:56:12 | FromDiscord | <sealmove> scott why didn't you quote pname? |
09:56:40 | PMunch | That's not quite how quote works |
09:57:03 | FromDiscord | <sealmove> hum, pname is both a for index and proc name? |
09:57:32 | PMunch | You probably want something like this: https://play.nim-lang.org/#ix=2HwX |
09:57:35 | FromDiscord | <sealmove> scott check https://nim-lang.org/docs/macros.html#NimSymKind |
09:57:43 | FromDiscord | <scott> @sealmove because I don't know what I'm doing and I'm just blindly guessing and couldn't find anything about it in hte docs |
09:57:51 | PMunch | Ah wait, you need to turn those strings into idents as well before quote do |
09:57:51 | FromDiscord | <scott> looking at links |
09:57:52 | FromDiscord | <sealmove> each symbol must have the correct type |
09:58:22 | PMunch | Something like this: https://play.nim-lang.org/#ix=2HwY |
09:58:42 | PMunch | @scott, interesting |
09:58:47 | FromDiscord | <scott> sealmove, I'm not sure what NimSymKind has to do with this |
09:58:52 | PMunch | But then I'd have to change my filesystem to ZFS? |
09:59:17 | FromDiscord | <scott> @PMunch thanks I think that's what I'm looking for |
09:59:46 | FromDiscord | <sealmove> scott nvm, was just trying to tell you can't use same symbol for a for index and a proc name at the same time |
10:00:04 | FromDiscord | <scott> yes if you wanted to go with the latter option you'd have to reformat both disks. not ideal for migrating to but I recently learned that exists and think it's the bees knees |
10:00:10 | FromDiscord | <scott> sealmove yeah sorry I just need a name |
10:00:50 | PMunch | @scott, crap didn't even think of that.. I would need somewhere to put my files in the meantime.. |
10:01:25 | FromDiscord | <sealmove> peter is this good? https://github.com/sealmove/binaryparse#alignment |
10:01:50 | PMunch | I wish there was some way of formatting drives that would create a partition of the empty space, format that to a filesystem, then move files over to fill it, repartition, etc. Would be horribly inefficient, and terribly unsafe, but pretty neat |
10:02:25 | PMunch | @sealmove, yikes |
10:02:43 | FromDiscord | <sealmove> no good? :3 |
10:02:54 | PMunch | "When reading a non-integer type, the bitstream will always be aligned to byte, which means some bits might be skipped" <- is this the current behaviour? |
10:03:24 | FromDiscord | <sealmove> Well, I think you hadn't considered this senario |
10:03:41 | FromDiscord | <sealmove> So current behavior is undefined really |
10:03:46 | PMunch | Is it? |
10:04:21 | FromDiscord | <sealmove> not 100% sure |
10:04:50 | FromDiscord | <sealmove> I could make it work, but who would ever want to read unaligned floats? |
10:05:16 | PMunch | Who knows, but who are we to stop them |
10:05:29 | PMunch | There are some really weird binary formats out there |
10:05:38 | FromDiscord | <sealmove> okay okay :> I can fix this |
10:05:41 | FromDiscord | <sealmove> thx |
10:09:54 | PMunch | Aah |
10:09:58 | PMunch | Currently it doesn't work |
10:10:06 | PMunch | Complains about shifting a float32 |
10:10:37 | FromDiscord | <sealmove> yeah I expected so, but I can easily make it work. What do you want to do with strings? Align automatically or generate exception? |
10:11:20 | PMunch | Doesn't your bitstream library handle all of this already? |
10:11:57 | PMunch | I mean optimally strings should also be shifted.. |
10:12:00 | * | spiderstew_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
10:12:39 | PMunch | Aha, strings currently throw an exception |
10:12:45 | FromDiscord | <scott> damn it I'm still stumbling around 😦 https://play.nim-lang.org/#ix=2HwY |
10:13:03 | PMunch | I mean you can just keep the current behaviour (maybe throw an exception for floats though) |
10:13:08 | FromDiscord | <sealmove> It handles integers and there is a `readBits` proc which can be used for floats too (just casting after). I don't have anything for strings currently. |
10:13:26 | PMunch | I don't think alignment is the way to go here, people can easily enough add their own padding fields without a name |
10:13:34 | * | spiderstew joined #nim |
10:13:36 | FromDiscord | <sealmove> true that |
10:13:58 | FromDiscord | <sealmove> so I should remove the whole option about alignment right |
10:14:19 | PMunch | Typically a binary format will be aligned and this shouldn't be an issue, and for those rare occasions that it's not I think having it explicitly shown by padding is better |
10:14:36 | FromDiscord | <sealmove> ok sounds good |
10:15:02 | PMunch | @scott, what's the issue there? |
10:15:25 | FromDiscord | <scott> Error: type mismatch: got <NimNode> |
10:15:55 | FromDiscord | <scott> newIdentNode is expecting a string but the string is a NimNode inside the macro |
10:16:45 | PMunch | https://play.nim-lang.org/#ix=2Hx7 |
10:16:50 | PMunch | Seems to work fine for me |
10:17:03 | PMunch | (Just made Prompt an int to avoid it throwing an error) |
10:17:24 | JustASlacker | Im trying to get a regex that matches everything inside quotes (") |
10:17:26 | JustASlacker | let regex = re(r"\"(.*)\"") |
10:17:45 | JustASlacker | compiler doesnt like that for some reason |
10:18:08 | FromDiscord | <myphs> Sorry for this nooby question, but I wonder why I can't call `listFiles(path)` at compile time. Isn't there a way to make compile time listings of directories? I want to create automatic bindings of modules from one directory at compile time |
10:18:39 | FromDiscord | <scott> PMunch, I'm trying to pass the strings as arguments though https://play.nim-lang.org/#ix=2Hx7 |
10:19:38 | FromDiscord | <scott> I don't need to pass them as strings it just seemed like that would work |
10:19:57 | PMunch | JustASlacker, that's because you're using it as a raw string, which doesn't have \ to escape |
10:20:06 | PMunch | If you remove the r it works |
10:20:25 | JustASlacker | PMunch: thx |
10:20:52 | PMunch | Or if you just double the quotes instead: https://play.nim-lang.org/#ix=2Hx9 |
10:21:35 | PMunch | @scott, did you just copy my paste there? |
10:21:48 | PMunch | If you pass it as an argument you probably want static string and not just string |
10:22:22 | FromDiscord | <scott> that still doesn't work https://play.nim-lang.org/#ix=2Hx7 |
10:26:05 | narimiran | PMunch: are you still involved in parsetoml? |
10:27:54 | FromDiscord | <scott> ahh so close.... https://play.nim-lang.org/#ix=2HwX |
10:30:07 | FromGitter | <gogolxdong> https://github.com/gogolxdong/2DeFi |
10:32:22 | JustASlacker | So, if I may ask once more, why dont I get a match for users:(("ssh",pid=2908,fd=5))? https://pastebin.com/MFWCGGVV |
10:37:15 | FromDiscord | <sealmove> @PMunch I fixed it already 😄 |
10:37:35 | FromDiscord | <sealmove> unaligned floats work now, not strings though. |
10:38:22 | FromDiscord | <sealmove> the alignment is checked at runtime though |
10:39:36 | FromDiscord | <sealmove> is this bothering? |
10:41:31 | FromDiscord | <scott> Got it! |
10:47:07 | mipri | JustASlacker: re.match has an implicit anchor at the beginning of its rege |
10:47:08 | mipri | x |
10:47:45 | mipri | archeologists believe that this madness was a product of wanting people to use regexes without understanding them. |
10:48:07 | mipri | s/match/contains/ and your code works as you expected. |
10:49:23 | JustASlacker | ah, ok |
10:49:45 | JustASlacker | thx |
10:50:45 | JustASlacker | noice |
10:50:52 | JustASlacker | think Im done now |
10:51:12 | JustASlacker | always nice to have nim projects |
10:51:31 | JustASlacker | and regex kinda suck in any language |
10:52:27 | mipri | there are always lots of little caveats with them, true. |
10:52:55 | Zevv | dont re kids, it's baad for you mkaaay |
10:53:39 | JustASlacker | ahh, spoke too soon, got a bug |
10:53:57 | mipri | I just really hate this one. It's not a nim thing, it's part of pcre, and I first encountered it in Java. The "oh did you write a regex? well, uh, we added something to it for you :)" |
10:54:11 | JustASlacker | think python does the same |
10:54:25 | mipri | yeah it does as well |
10:54:49 | JustASlacker | thats why I usually use http://www.pyregex.com/ to check my python regex code |
10:56:13 | * | literal_ is now known as literal |
10:58:37 | JustASlacker | gah, that regex breaks if there are more than one quoted strings |
10:58:40 | * | JustASlacker shakes fist |
10:59:00 | mipri | yes, .* works from right-to-left |
10:59:16 | mipri | Mastering Regular Expressions is a good book for understanding that in detail. |
10:59:38 | mipri | what I generally do is match something like "[^"]+" |
10:59:48 | Zevv | mubmle mumble npeg mumble |
11:00:55 | mipri | I can't recommend the excellent Nim workbook "Mastering PEG with Nim" though :| |
11:01:41 | Zevv | hehe |
11:02:06 | JustASlacker | are there nim books? I know there is Nim in Action |
11:02:22 | mipri | no, it's because it doesn't exist that I can't recommend it |
11:02:27 | JustASlacker | yeah |
11:02:52 | JustASlacker | "[^"]+" looks good, thanks. |
11:02:55 | mipri | https://nim-lang.org/learn.html has a Community resources that's growing some good links though |
11:12:01 | * | opal quit (Remote host closed the connection) |
11:12:50 | * | opal joined #nim |
11:16:57 | * | fredrikhr joined #nim |
11:19:27 | * | Gustavo6046 quit (Ping timeout: 272 seconds) |
11:34:22 | * | Torro joined #nim |
11:37:49 | * | T0rr0 joined #nim |
11:40:02 | * | Torro quit (Ping timeout: 256 seconds) |
11:41:33 | * | T0rr0 is now known as Torro |
11:43:04 | * | hdgoubdo joined #nim |
11:43:46 | hdgoubdo | would it work if newStringStream in streams used a sink string instead of a string for its argument? i mean, it might not have to copy there |
11:47:29 | * | hdgoubdo quit (Remote host closed the connection) |
11:54:30 | Zevv | did you verify it actually *does* copy then |
12:00:35 | * | sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in) |
12:00:55 | hmmmmm | who is pietroppeter |
12:01:05 | hmmmmm | he is making some awesome aoc blogs |
12:01:25 | hmmmmm | I want to send him my <3 <3 |
12:04:23 | FromDiscord | <mratsim> I would appreciate if people can relate their dev tooling in Nim, especially the new timers. https://github.com/nim-lang/RFCs/issues/300 cc @dom96 . |
12:04:23 | disbot | ➥ Developer tooling |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:35 | * | supakeen joined #nim |
12:09:01 | * | kenran quit (Ping timeout: 256 seconds) |
12:10:36 | * | kenran joined #nim |
12:12:01 | FromDiscord | <haxscramper> @mratsim you want to discuss only (mostly) nimsuggest-related things in this RFC or just anything that can be put under "developer tooling"? I don't have particularly strong opinions on nimsuggest (because I don't use it since ever), but I can put some opinions on error messages and things like that |
12:12:35 | FromDiscord | <haxscramper> IDE & nimsuggest-related |
12:13:29 | FromDiscord | <mratsim> yes IDE, Code editor and nimsuggest |
12:13:48 | FromDiscord | <mratsim> Error message stacktraces, etc should go on another RFC I think |
12:15:24 | FromDiscord | <pietroppeter> @hmmmm thanks! Love received and appreciated! 🙇♂️ |
12:15:35 | hmmmmm | piet! |
12:15:41 | hmmmmm | your stuff is awesome <3 |
12:15:53 | hmmmmm | and even the platform is cute I will try it when I have time! |
12:16:26 | Zevv | I think I am really conservative and I have very low standards regarding tooling. I am *very* happy with nimsuggest and leorizes nvim plugin. |
12:16:47 | Zevv | that's 100% better then support of any other language I program. For the rest I only use editors. |
12:16:58 | Zevv | and cscope |
12:17:30 | narimiran | yeah, leorize[m]1 did some great magic there! |
12:18:18 | FromDiscord | <John Smith> Oh, code with two space indent is really hard to read. |
12:19:47 | FromDiscord | <John Smith> Can I write nim code with tab or 4 spaces ? https://media.discordapp.net/attachments/371759389889003532/786930224499523624/unknown.png |
12:20:38 | FromDiscord | <John Smith> (edit) Oh, code with two spaces indent is really hard to read. |
12:20:39 | Zevv | No tabs allowed, to avoid confusion between different rendering of tabs |
12:20:48 | Zevv | but you're free to indent spaces as deep as you want |
12:20:53 | * | rockcavera joined #nim |
12:21:13 | FromDiscord | <kenran> I'm trying to do something with OpenGL using GLFW. With SDL2 everything worked fine. Now I tried using `nimgl/[glfw, opengl]`, and I'm getting a SIGSEGV. I also tried `staticglfw` which produces the same error when I omit the call to `loadExtensions()`. But I can't find an equivalent call in `nimgl`. Can you help me? |
12:21:31 | PMunch | narimiran, yes |
12:21:44 | mipri | and, try reformatting that code to use 4 spaces before thinking that the spaces are why it's a lot to take i |
12:21:47 | mipri | n |
12:21:49 | FromDiscord | <kenran> (Also, feedback on whether I should prefer static or dynamic linking is very welcome. I could just keep using `staticglfw` if that's the "solution"). |
12:22:03 | * | opal quit (Ping timeout: 240 seconds) |
12:22:04 | PMunch | @sealmove, what do you mean by the alignment is fixed at runtime? |
12:22:10 | PMunch | s/fixed/checked |
12:22:24 | FromDiscord | <pietroppeter> Thanks again and also thanks for nimib, first feedback I am receiving! To try it is probably better to wait until I release 0.1, I plan to do it by end of month, currently it is a bit messy... |
12:23:05 | * | opal joined #nim |
12:23:15 | narimiran | PMunch: could you maybe address these comments: https://github.com/NimParsers/parsetoml/commit/668491edaff1abd5ec31c3f294e1a918d179f13f ? nobody responded in two weeks |
12:23:58 | PMunch | Ah right, sorry about that |
12:24:18 | PMunch | I was hoping you would create a PR out of your suggested fix :P |
12:28:38 | narimiran | PMunch: ok, i'll do it |
12:29:08 | FromDiscord | <sealmove> PMunch does it make sense to support other sizes for floats? |
12:29:18 | PMunch | narimiran, too late! https://github.com/NimParsers/parsetoml/commit/7126677392aa0c4cc9d16bd79d312ed57f15f8f1 |
12:29:25 | narimiran | :) |
12:29:35 | FromDiscord | <sealmove> For example `f18` |
12:29:55 | PMunch | @sealmove, well I mean if you want to implement weird floating point formats I'm not going to stop you :P |
12:30:15 | PMunch | But then we should support arbitrary sized mantissa and such |
12:30:54 | FromDiscord | <sealmove> Hmm currently i am reading bits into an uint64 and then its just a matter of casting |
12:31:07 | FromDiscord | <sealmove> So `f18` can easily work already |
12:32:16 | PMunch | Not exactly :P |
12:32:17 | FromDiscord | <sealmove> Or am I missing something? Yeah floats don't work like this eh? |
12:32:55 | FromDiscord | <sealmove> Ok ok nvm then :p |
12:33:10 | PMunch | https://en.wikipedia.org/wiki/IEEE_754 |
12:33:23 | PMunch | Scroll down to the table of "Basic and interchange formats, you kinda get the idea |
12:33:49 | PMunch | Or the "Internal representation" table here: https://en.wikipedia.org/wiki/Floating-point_arithmetic |
12:33:57 | FromDiscord | <sealmove> Yes I see, that was stupid of me |
12:35:15 | FromDiscord | <sealmove> I think I the PR will be ready to merge in a couple of days. Parsing already works, working on serialization now. |
12:35:21 | PMunch | I mean you can do it, in a way |
12:36:29 | FromDiscord | <sealmove> What do you have in mind? Shifting the bits appropriately to adhear toIEEE 754 before casting? |
12:37:07 | PMunch | Like 'f3,14' could mean floating point number with 1 bit sign, 3 bit exponent, and 14 bits fraction for a total of 18 bits |
12:37:13 | PMunch | Yeah |
12:37:36 | FromDiscord | <sealmove> Interesting. Maybe a future feature :p |
12:37:48 | PMunch | Find the smallest of float32 and float64 that can accommodate the sizes and mask out and shift things into the correct place before casting |
12:38:12 | PMunch | TBH I've never seen a floating point number expressed like that |
12:38:15 | FromDiscord | <sealmove> Yes it can work |
12:38:24 | PMunch | But who knows |
12:39:41 | FromDiscord | <mratsim> @John Smith use indent rainbow maybe |
12:40:37 | FromDiscord | <Rika> Or add empty lines |
12:40:40 | FromDiscord | <Vindaar> AoC day 11 fun 😅 warning flashing colors 🙃 https://media.discordapp.net/attachments/371759389889003532/786935479354130452/SPOILER_grid_evolution_part1.gif |
12:41:51 | PMunch | @John Smith, some of us will secretly judge you however if you use more than two spaces :P |
12:42:19 | PMunch | @Vindaar, now I'm really curious about todays AoC :P |
12:42:45 | PMunch | And hmmmmm/@pietroppeter where can I find this AoC blog? |
12:47:32 | FromDiscord | <hugogranstrom> @Vindaar have you made it in ggplotnim? 😮 It looks great |
12:48:03 | FromDiscord | <Vindaar> sure! except the conversion to a gif I did with imagemagick. will upload the code in 5 min |
12:49:11 | FromDiscord | <hugogranstrom> Cool 🙂 |
12:54:06 | FromDiscord | <trippleA> For the linux version of nim, is there a minimal required version of linux or dependencies on a distro to be able to run run? |
12:55:08 | FromDiscord | <trippleA> (edit) "run?" => "nim?" |
12:55:09 | PMunch | Nim the compiler, or programs compiled with Nim? |
12:55:34 | FromDiscord | <trippleA> Nim the compiler. I want to know if I were to use an older version of linux everything would still work. |
12:56:10 | PMunch | I think there is a minimal version because of the linked C libraries, but it is probably very low |
12:56:27 | PMunch | So low that you shouldn't run a Linux version that old out of security concerns |
12:56:35 | FromDiscord | <Vindaar> @hugogranstrom solution is up: https://github.com/Vindaar/AdventOfCode2020/tree/master/day11 but the gifs look a bit broken in thar README |
12:56:37 | FromDiscord | <Vindaar> bbl |
12:56:42 | hmmmmm | munchie: https://pietroppeter.github.io/adventofnim/index.html |
12:56:44 | mipri | various issues can crop up. Nim can generate code that gcc is too old to understand. The nim binary might require a newer glibc than is available. Even when nim works you can have issues with openssl that interfere with nimble. |
12:56:47 | PMunch | How old do you plan on running? |
12:58:13 | mipri | centos6 had all those problems and Nim could still be made to work, it's just a little bit effort instead of no effort. Again speaking of the compiler. |
12:58:28 | FromDiscord | <trippleA> I'm planning on using godot on linux with nim and was thinking about using ubuntu 14.02 or something around that age to make sure it works on all modern distros because exported godot projects for linux only work with something that's either as old as the distro was or newer. |
12:58:36 | mipri | and that's now a past EOL distro |
13:00:11 | mipri | 14.02 seems like it's about as old as CentOS 6, speaking of. |
13:01:37 | FromDiscord | <kenran> I got my glfw/opengl thing up and running with both dynamically linking glfw and statically linking it. Which should I prefer? |
13:01:40 | FromDiscord | <trippleA> sent a long message, see http://ix.io/2HxU |
13:01:41 | mipri | so you might have similar problems. It canbe made to work. |
13:02:46 | FromDiscord | <kenran> I'm kinda surprised though that the `nimgl` example doesn't just work for me. I had to switch out `nimgl/opengl` to just `opengl`, and call its `loadExtensions()`, which `nimgl/opengl` doesn't seem to have/need |
13:03:12 | FromDiscord | <trippleA> What exactly is the minimal required version of gcc and glibc anyways for nim to work properly? |
13:04:31 | mipri | you have binary compatibility issues with glibc, so nim (compiler) doesn't care about that as much. |
13:05:21 | FromDiscord | <trippleA> Is 16.04 new enough to work with nim? |
13:05:47 | PMunch | damn pietroppeter, what a list of hints for day10 :) |
13:05:51 | mipri | I said that even 14.02 can be made to work, right? It's with ancient EOL versions that you start running into issues like this. |
13:05:54 | FromDiscord | <Recruit_main707> yes, nim uses an older version by default |
13:05:58 | FromDiscord | <Recruit_main707> iirc |
13:06:06 | hmmmmm | piet is a gem :3 |
13:06:23 | * | hmmmmm quit (Quit: brb) |
13:06:52 | mipri | in the time that we've talked about this you could, if you have a 16.04 available, install choosenim and install Nim. Give it a try. use nimble to install something useful like cligen. |
13:07:19 | PMunch | Gotta say though, narimirans solution for day 10 was a bit mind-blowing |
13:07:21 | mipri | absent an actual problem, all this discussion about potential problems will feel a bit wasted. |
13:07:22 | FromDiscord | <trippleA> I'll boot up virtualbox and give 16.04 a spin. |
13:07:29 | PMunch | Took me a while to understand what was going on there |
13:07:53 | mipri | I really wish Eric had given any hint at all about the nature of that one. |
13:08:13 | PMunch | Eric? |
13:08:22 | mipri | Eric Wastl of Advent of Code |
13:08:23 | PMunch | Oh, the guy who makes AoC right? |
13:08:26 | PMunch | Yeah |
13:08:36 | PMunch | I was so stuck on that one.. |
13:09:00 | FromDiscord | <pietroppeter> I was hoping for you to run into it yesterday... 😛 anyway realized later that they follow too much my approach and there are much better solutions around. But when I got to 25 hints I could not avoid releasing it... |
13:09:06 | PMunch | I'm firmly in the other camp of pietroppeter |
13:09:45 | PMunch | https://github.com/PMunch/aoc2020/blob/master/day10/part2.nim |
13:09:55 | PMunch | That's what I ended up with ^ |
13:10:11 | PMunch | After having peeked at narimirans version >_< |
13:11:27 | FromDiscord | <pietroppeter> Yeah that’s one example of much better solutions! I will add a disclaimer and more discussion when I have more time. |
13:13:46 | narimiran | PMunch: cheater :P |
13:14:00 | PMunch | Ey, I said I would blame you if I couldn't solve it :P |
13:14:43 | narimiran | PMunch: btw, yesterday it was both painful to watch you struggle, and also i felt relieved i'm not the only one who had some problems there |
13:14:50 | FromDiscord | <trippleA> If I compiled nim rather than use the precompiled binaries, there would be far less issues yes? |
13:14:51 | PMunch | I'm just really bad at the math ones. I might've converged at a solution if I had spent my evening on drinking coffee and trying to solve it instead of drinking prossecco and playing games with my friends :P |
13:15:17 | narimiran | but tbh, i immediately recognized DP, but forgot i need memoization for that to work in reasonable time |
13:15:25 | mipri | Nim is written in Nim, so. There are options there, but just try it first. |
13:15:43 | narimiran | @trippleA wait what? |
13:16:31 | FromDiscord | <trippleA> I'm talking about downloading the source tarball rather than the precompiled binaries. |
13:16:48 | mipri | I understood you. |
13:16:57 | narimiran | why would be there *far less* issues? |
13:17:24 | FromDiscord | <trippleA> Because I'm under the assumption it would optimize it for an older version of glibc rather than expect a newer one? |
13:18:16 | mipri | $ ldd ~/.choosenim/toolchains/nim-1.4.2/bin/nim not a dynamic executable |
13:18:48 | FromDiscord | <trippleA> sh build.sh↵bin/nim c koch↵./koch boot -d:release↵./koch tools |
13:18:56 | FromDiscord | <trippleA> That's the order the website says to build from source tarball |
13:19:01 | mipri | yep. |
13:19:45 | FromDiscord | <pietroppeter> Narimiran: DP? |
13:20:03 | mipri | dynamic programming. |
13:20:07 | narimiran | ^ |
13:20:28 | narimiran | @pietroppeter day10 could be solved via recursion+memoization |
13:20:30 | FromDiscord | <trippleA> I'm going try this in both 14.04 and 16.04 to compare the differences. |
13:21:14 | FromDiscord | <pietroppeter> yeah, that’s what I did essentially |
13:21:31 | narimiran | haven't looked at yours yet, trying to optimize my day11 :) |
13:22:47 | FromDiscord | <pietroppeter> Well, I am not too much into optimizations... have fun 🙂 This year for me is about developing this nimib thing to publish my solution |
13:23:01 | mipri | biggest optimiation I've seen is from not copying the 2d array, and instead doing passes over it, first to fudge seats to show that they'll be changed later, and then to actually change them, with tests treating fudged and unfudged seats as the same |
13:23:26 | FromDiscord | <pietroppeter> (I do enjoy them actually, not my current priority) |
13:23:34 | mipri | well, biggest in terms of the speed increase. |
13:23:52 | mipri | if you want to talk about ratios of speedup / effort, just using --expandArc a few times had the biggest benefit |
13:24:19 | mipri | because it found some unnecessary copies in an inner loop |
13:28:10 | * | hmmm joined #nim |
13:31:10 | FromDiscord | <trippleA> Did a hello world in 14.04 with zero problems. |
13:32:00 | mipri | now do a nimble install cligen, or like |
13:33:38 | FromDiscord | <trippleA> cligen installed successfully. I was using 14.0.6 if that makes a difference. |
13:33:54 | mipri | then AFAIK you're golden. |
13:34:41 | * | Torro quit (Remote host closed the connection) |
13:34:51 | FromDiscord | <trippleA> Thanks man for the help. I know that even something as old as 14.04.6 can still run modern versions of nim and that's awesome. |
13:45:19 | FromDiscord | <squid> Can a non-async function run async functions? |
13:45:25 | PMunch | narimiran, I could feel there was something I was missing, but especially with an audience it's hard to try to map problems into a mental model |
13:45:48 | PMunch | narimiran, DP? |
13:45:50 | FromDiscord | <squid> Or wait. I might be thinking wrong here. I probably need to implement async for everything in my case |
13:46:02 | narimiran | PMunch: i can just imagine the pressure. i couldn't do it. |
13:46:12 | * | spiderstew quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
13:46:15 | PMunch | squid, it can, in a way |
13:46:18 | narimiran | PMunch: dynamic programming |
13:46:25 | * | spiderstew joined #nim |
13:46:37 | FromDiscord | <squid> PMunch, What do you mean? |
13:46:59 | FromDiscord | <squid> Also. When threading can the different threads access the same data? |
13:47:45 | PMunch | Well you can to run asynchronous methods from a non-async procedure, but that requires you to wait for the result, or pass the async procedure back (essentially making your procedure async) |
13:48:09 | PMunch | @squid, yeah they can, but you need to take care |
13:49:18 | * | spiderstew quit (Client Quit) |
13:49:49 | * | rockcavera quit (Remote host closed the connection) |
13:50:55 | PMunch | narimiran, ah I see |
13:52:09 | FromDiscord | <shadow.> you need stuff like locks but yeah |
13:52:13 | FromDiscord | <shadow.> just think to yourself like |
13:52:29 | FromDiscord | <shadow.> "is there a possibility that two threads using my variable at the same time could pose issues" |
13:52:44 | FromDiscord | <shadow.> and then that will probably tell you if you need a lock lol |
13:52:48 | PMunch | When I was looking at your example trying to figure out what was going on it dawned on me that you're essentially splitting it down into sub-problems and expanding from there |
13:52:57 | PMunch | Definitely was an aha moment |
13:53:24 | PMunch | @shadow. with the caveat that the GC will also be looking at your tasty tasty data |
13:53:35 | * | rockcavera joined #nim |
13:54:10 | PMunch | I'm thinking of streaming today as well by the way, but a bit later than I have been streaming |
13:54:36 | PMunch | Probably closer to around 5 UTC |
13:54:41 | PMunch | 5PM UTC* |
13:55:18 | narimiran | if i have `seq[seq[int]]` of known lengths, is there an easy way to reset all values to zero (while keeping lengths)? |
13:56:09 | PMunch | mySeq.mapIt(newSeq(it.len)) |
13:56:16 | PMunch | Perhaps the easiest |
13:57:39 | PMunch | Or mySeq.mapIt(it[0].unsafeaddr.zeromem(it.len*sizeof(int)) |
13:57:42 | Zevv | PMunch: so, you spend the whole day solving your aoc on a anonymous shadow acount. Then you optimize and clean your solution. And then you start your streaming session acting as if you see it for the first time, and you're able to type it in one go, run it and get your star |
13:57:47 | Zevv | that is *pretty smart* |
13:57:48 | Zevv | actuall |
13:57:58 | PMunch | Haha I wish :P |
13:58:10 | PMunch | I think yesterdays stream painfully demonstrated that's not quite how I do it |
13:58:53 | PMunch | I actually started working on a little program I called presenttyper a while back |
13:59:19 | PMunch | Basically trying to mock live coding by having the program pre-saved and typed out one character for each keypress, no matter what it was :P |
13:59:49 | Zevv | yeah I do that |
13:59:53 | PMunch | So that you could spit in the face of the demo-gods and nail your presentation live coding sessions |
13:59:54 | Zevv | it impresses people alot |
13:59:58 | Zevv | especially my WPM is |
14:00:02 | PMunch | Wait you do? |
14:00:08 | Zevv | don't we all? |
14:00:12 | PMunch | I mean my WPM is already pretty high :P |
14:00:13 | Zevv | I thought everybody does that? |
14:00:33 | FromDiscord | <shadow.> when making a pr, i edit changelog.md right? |
14:00:42 | FromDiscord | <shadow.> (to the nim repo) |
14:00:45 | PMunch | I was helping my sister with some programming things and she couldn't keep up with the code I was typing because I was typing it out too fast :P |
14:00:56 | PMunch | @shadow. yes |
14:01:00 | FromDiscord | <shadow.> i already edited the file in question but disruptek said i should do since notation and the changelog |
14:01:01 | FromDiscord | <shadow.> kk thanks |
14:01:09 | PMunch | At least if you add something people should be aware of |
14:01:20 | FromDiscord | <shadow.> rotateLeft to Deques |
14:01:26 | PMunch | Zevv, what do you use to do it? |
14:01:26 | FromDiscord | <shadow.> i would say that's something people should be aware of |
14:01:27 | FromDiscord | <shadow.> right? |
14:01:36 | FromDiscord | <shadow.> do i add to bottom or top of the lib list |
14:01:39 | PMunch | @shadow. added a new proc? Yeah that should go in the changelog |
14:01:44 | FromDiscord | <shadow.> kk |
14:01:45 | * | spiderstew joined #nim |
14:01:46 | FromDiscord | <shadow.> top or bottom lol |
14:01:49 | narimiran | PMunch: "mySeq.mapIt(newSeq(it.len))" - wouldn't this be slower (and more expensive?) than just double for loop and setting each member to 0? |
14:01:52 | PMunch | Bottom I think |
14:01:54 | FromDiscord | <shadow.> thx |
14:02:18 | PMunch | narimiran, it would probably be faster until the GC kicks in :P |
14:02:43 | PMunch | But the zeromem version would probably be faster than both |
14:02:47 | narimiran | Zevv: do you maybe have an idea? (if i have `seq[seq[int]]` of known lengths, is there an easy way to reset all values to zero (while keeping lengths)?) |
14:03:00 | FromDiscord | <shadow.> and disruptek said to also do since notation? i'm not familiar with the term could i get a quick explanation? |
14:03:23 | Zevv | narimiran: hm iterate + memset |
14:03:42 | PMunch | Zevv, I already told him, but he won't listen to me :P |
14:04:01 | * | waleee-cl joined #nim |
14:04:05 | Zevv | haha |
14:04:06 | narimiran | PMunch: why would i trust a guy who struggles with aoc day10??? |
14:04:11 | FromDiscord | <shadow.> DAMNN |
14:04:14 | Zevv | good point, good point |
14:04:15 | Zevv | buuurn |
14:04:16 | PMunch | Ooooooh |
14:04:23 | narimiran | (as you can see, i don't trust myself, either) |
14:04:25 | FromDiscord | <WalrusNoj> ooh snap u gonna take that show??? |
14:04:31 | FromDiscord | <shadow.> who me? i already did it smh |
14:04:32 | PMunch | Haha :P |
14:04:33 | Zevv | I didn't need like, two hours, or so |
14:04:34 | FromDiscord | <shadow.> hes talking to pmunch |
14:04:35 | * | lritter joined #nim |
14:04:35 | mipri | https://play.nim-lang.org/#ix=2Hyk |
14:04:36 | Zevv | no I didn't sir |
14:04:37 | FromDiscord | <shadow.> LMAO |
14:04:39 | FromDiscord | <shadow.> i took 2.5 dont worry |
14:04:53 | FromDiscord | <WalrusNoj> i took 20 hours on day 4 |
14:05:12 | FromDiscord | <shadow.> programming in your sleep |
14:05:15 | FromDiscord | <shadow.> dreams of using npeg |
14:05:16 | FromDiscord | <shadow.> over regex |
14:05:17 | FromDiscord | <shadow.> lol |
14:05:18 | PMunch | I spent an hour on stream, and then 15 minutes stealing from narimiran :P |
14:05:23 | FromDiscord | <shadow.> lmaoo |
14:05:38 | narimiran | thanks mipri! |
14:05:56 | FromDiscord | <shadow.> i spent an hour trying to use recursion, another half hour trying dynamic programming, another half hour doing research on probability, and then the final half hour implementing the math lol |
14:06:15 | FromDiscord | <shadow.> wound up with a pretty solution at least |
14:06:29 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hym |
14:06:42 | Zevv | I first started coding, going recursive |
14:06:48 | Zevv | then realizing that the space was too big |
14:06:53 | FromDiscord | <shadow.> lmao yeah |
14:06:55 | Zevv | then I drew a little tree of the example |
14:06:57 | Zevv | and *poof* there it was |
14:07:02 | FromDiscord | <shadow.> haha same |
14:07:16 | FromDiscord | <speckledlemon> Is <https://github.com/jiro4989/setup-nim-action> the officially sanctions GitHub action? |
14:07:42 | mipri | I spent three hours looking for a polynomial solution, with not even the faintest suspicion that f(n) and f(n-1) might be related. |
14:07:50 | FromDiscord | <shadow.> lmfao |
14:07:54 | FromDiscord | <shadow.> rip |
14:08:02 | mipri | yeah I'm still mad. |
14:08:15 | FromDiscord | <shadow.> eh same kinda |
14:08:30 | FromDiscord | <shadow.> i shoulda realized it was just ap stat under the clothes of programming |
14:08:43 | FromDiscord | <shadow.> definitely not taking that class after that ordeal |
14:08:44 | FromDiscord | <shadow.> lmao |
14:09:19 | * | Q-Master quit (Read error: Connection reset by peer) |
14:09:32 | mipri | I did all kinds of programming, technically speaking. I saw that runs of 1 were interesting. I was looking for all possible combinations of removing x[i-1] when x[i]-2==x[i-2], all kinds of completely hopeless dead ends. |
14:09:34 | PMunch | @shadow. should've used a CountTable ,) |
14:09:57 | FromDiscord | <shadow.> oh damn true |
14:10:11 | * | Q-Master joined #nim |
14:10:23 | mipri | "maybe if I sum the factorials of the length of the runs" |
14:10:42 | PMunch | mipri, I was doing something similar :P |
14:10:53 | FromDiscord | <shadow.> i should get started on day 11 lol |
14:11:13 | PMunch | Trying to figure out if there was any rule of "length of consecutive numbers" -> combinations |
14:12:14 | FromDiscord | <kenran> I just tried building a project on macOS catalina with nim 1.4.2 (installed via `nix-env`). Now building a package with `nimble build` works as long as it has no other dependencies. If I need, say, `opengl`, I can accept to download a `package.json`, but then I get `SIGBUS: Illegal storage access. (Attempt to read from nil?)`. Any ideas? |
14:12:51 | mipri | you're getting that error from nimble? |
14:13:09 | FromDiscord | <kenran> Yeah, from `nimble build` |
14:13:32 | FromDiscord | <kenran> It says `Downloading official package list` just before crashing |
14:13:55 | FromDiscord | <Vindaar> narimiran: damn, your solution to yesterdays problem really is, wow. I spent like 3 hours trying to figure out a smart mathy way without programming required essentially. Ended up with a mix of brute force + a phase space reduction to make that feasible |
14:13:57 | mipri | ok, it's a bug. If I can make a 20% educated guess, I'd say it's an incompatibility with openssl. |
14:14:38 | mipri | that is, the library is loading and nimble is trying to use it, but the API's changed incompatibly or the like. |
14:14:49 | PMunch | @Vindaar, yeah the CountTable way really is a thing of beauty |
14:14:54 | narimiran | @Vindaar to me, more fascinating is that in my small group of friends (~10 of us), we had 4 solutions that calculated combinations!! |
14:15:01 | FromDiscord | <kenran> I can try installing `choosenim`, because there seems to have been something with `openssl` there that should be fixed by now I hope |
14:15:14 | FromDiscord | <Vindaar> "small group of friends" "10 of us" eh? |
14:15:15 | mipri | because it looked like a problem of combinations. |
14:15:15 | FromDiscord | <Vindaar> haha |
14:15:29 | FromDiscord | <Vindaar> damn, you have a smart bunch of people around you, huh? |
14:15:51 | mipri | I mean the obvious brute force of part1 is to just nextPermutation until you find a good one, right? |
14:15:55 | narimiran | they never heard about DP, they don't like recursions, so they decided to solve it by counting all the possible ways on the paper |
14:16:11 | FromDiscord | <Vindaar> DP? |
14:16:19 | narimiran | *all possible ways for N adapters with diff=1 |
14:16:26 | mipri | you're already doing combinations. The part2 is infeasible because there are too many combinations. You're looking for combinations of ways to mutate a string. The whole thrust of the text of the problem points you down a dead end. |
14:16:26 | FromDiscord | <Vindaar> oh |
14:16:46 | PMunch | mipri, of part 1? |
14:16:49 | PMunch | I just did this: https://github.com/PMunch/aoc2020/blob/master/day10/part1.nim |
14:17:10 | FromDiscord | <Ricky Spanish> can i build my nim programs for musl? not sure iv seen any documentation for it |
14:17:11 | mipri | the brute force of it is to do that. |
14:17:31 | PMunch | @Ricky, I think so |
14:17:38 | PMunch | Seem to recall someone doing it |
14:17:44 | mipri | yes. the easiest way is to use musl-gcc, just requires some --gcc.exe and --gcc.linkerexe options |
14:17:58 | mipri | https://scripter.co/nim-deploying-static-binaries/ |
14:18:19 | FromDiscord | <Ricky Spanish> ah decent thanks i just wanted to know generally if it was conceivably possible before i started thanks guys |
14:21:10 | FromDiscord | <kenran> mipri, it works with `choosenim` though. I'm not using macOS as my main system, so that's probably fine. I bet it's something `nix`y that's wrong |
14:21:39 | FromDiscord | <Ricky Spanish> also does anyone know if theres a way to exec with osproc or another way and return a id to the process it has createdso you can keep track of any long running child processes by polling the os? |
14:21:52 | FromDiscord | <kenran> Plus, I'm surprised: I can immediately build the project, and it runs oO I've never had that, much less with something using OpenGL/GLFW |
14:22:32 | FromDiscord | <Ricky Spanish> or do i just poll the os for processes with my nim program as the parent process? |
14:22:46 | mipri | https://nim-lang.org/docs/osproc.html 's startProcess |
14:23:44 | mipri | you can poll with peekExitCode, or do a lot of other things. It's normal systems programming |
14:23:56 | PMunch | @kenran, yeah Nim is pretty magical in how easy it is to get stuff to run |
14:25:28 | FromDiscord | <Ricky Spanish> ah nice thanks @mipri |
14:25:34 | FromDiscord | <kenran> I was so surprised. I'm allocating a PTY, talking to it (though I maybe shouldn't be surprised as macOS should be posix-compatible there), and initializing graphics. blew my mind |
14:28:19 | Araq | libc static linking has its own downsides which is why it's not the default on Linux |
14:40:21 | FromDiscord | <shadow.> hmm |
14:40:29 | FromDiscord | <shadow.> could i have a quick lookover of my day 11 part one logic? |
14:40:33 | FromDiscord | <shadow.> im getting answer too low |
14:40:34 | * | PMunch quit (Quit: Leaving) |
14:40:41 | FromDiscord | <shadow.> just wanna make sure im understanding the problem correctly |
14:40:51 | mipri | show it. |
14:41:02 | FromDiscord | <shadow.> thanks |
14:41:14 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2HyA |
14:43:33 | mipri | you're modifying the grid while testing it |
14:43:40 | FromDiscord | <shadow.> yeah |
14:43:46 | FromDiscord | <shadow.> am i not suppose to? |
14:43:54 | FromDiscord | <shadow.> i thought i seat the people every time i go through? |
14:44:00 | mipri | no, you're supposed to move from one snapshot of the grid to the next |
14:44:06 | FromDiscord | <shadow.> ahh i see |
14:44:18 | FromDiscord | <shadow.> do i seat first then remove? or no |
14:44:22 | mipri | the next state of each seat depends on the previous snapshot's environment |
14:44:40 | mipri | no, the order of removal vs. seating doesn't matter. those rules could be performed entirely in parallel |
14:44:51 | FromDiscord | <shadow.> i see ok |
14:44:53 | FromDiscord | <shadow.> hm |
14:44:58 | FromDiscord | <shadow.> thanks |
14:45:40 | mipri | >The following rules are applied to every seat simultaneously: |
14:46:07 | mipri | what you're doing is non-simultaneous |
14:47:37 | * | hmmm quit () |
14:47:45 | FromDiscord | <shadow.> thanks, got it this time |
14:48:52 | * | habamax quit (Ping timeout: 246 seconds) |
14:49:40 | Araq | yay another lockdown coming |
14:49:48 | FromDiscord | <shadow.> rip |
14:50:45 | FromDiscord | <shadow.> my pr failed like this on checks. what would i have changed that could've caused this? https://media.discordapp.net/attachments/371759389889003532/786968216361762877/unknown.png |
14:51:00 | FromDiscord | <shadow.> i just added a rotateLeft and rotateRight proc to deques.nim and updated changelog |
14:51:24 | FromDiscord | <shadow.> doesn't seem like i would have touched that file |
14:51:40 | Araq | that test is fragile |
14:51:46 | Araq | nothing to do with your PR |
14:52:35 | FromDiscord | <shadow.> ahh ok cool |
14:54:13 | FromDiscord | <shadow.> so now i just have to add a .since notation? |
14:54:19 | FromDiscord | <shadow.> disruptek said that but im not familiar with the term |
14:56:36 | mipri | grep -r since: lib/ # from Nim repo |
14:56:58 | FromDiscord | <shadow.> not sure i understand |
14:57:19 | FromDiscord | <Rika> execute that command in the local git directory |
14:57:26 | FromDiscord | <shadow.> ohh ok |
14:57:28 | mipri | you'll get output such as https://play.nim-lang.org/#ix=2HyH |
14:59:25 | * | Vladar joined #nim |
15:00:27 | FromDiscord | <shadow.> im on windows lmao |
15:00:30 | FromDiscord | <shadow.> lemme try my ubuntu subsys |
15:00:41 | FromDiscord | <shadow.> worked |
15:00:51 | FromDiscord | <shadow.> just lib/ ? or the actual path to the file |
15:00:55 | mipri | the only point of the command was to see what you can see already in that paste |
15:01:08 | FromDiscord | <shadow.> OH |
15:01:14 | FromDiscord | <shadow.> i see |
15:01:32 | FromDiscord | <shadow.> since is just the version it was added in or the version it works in |
15:01:35 | FromDiscord | <shadow.> im guessing former? |
15:01:51 | FromDiscord | <Rika> why would it not work when it was added |
15:01:56 | FromDiscord | <Rika> thats just stupid |
15:02:00 | FromDiscord | <shadow.> well yeah but it might work earlier to when it was added |
15:02:01 | FromDiscord | <shadow.> lmao |
15:02:07 | FromDiscord | <shadow.> but kk ill add one |
15:02:14 | FromDiscord | <Rika> that doesnt apply to your case though |
15:02:22 | FromDiscord | <shadow.> so just `{.since: (1, 6).}` ? |
15:02:28 | FromDiscord | <shadow.> devel is on 1.6 right lmao |
15:03:16 | mipri | the next non-devel version is 1.6 |
15:03:29 | mipri | all the since's that I see have odd numbers. they're introduced in devel versions |
15:04:15 | FromDiscord | <shadow.> ohh |
15:04:38 | * | abm joined #nim |
15:04:44 | FromDiscord | <shadow.> then devel is 1.5 currently |
15:06:06 | FromDiscord | <shadow.> alright i added `{.since: (1, 5).}` to both procs |
15:06:11 | FromDiscord | <shadow.> that's correct? |
15:08:54 | FromDiscord | <shadow.> ah wait i think its 1.5.1 |
15:09:09 | FromDiscord | <shadow.> how do i check current version of devel? |
15:11:03 | FromDiscord | <shadow.> nvm got it |
15:11:38 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2HyN |
15:12:18 | FromDiscord | <tomck> (edit) "https://play.nim-lang.org/#ix=2HyN" => "https://play.nim-lang.org/#ix=2HyO" |
15:12:57 | * | hmmmmm joined #nim |
15:14:06 | FromDiscord | <Vindaar> I think you have to generate a full type section. Calling a macro within a type section is problematic |
15:14:41 | * | gangstacat quit (Quit: Ĝis!) |
15:17:06 | FromDiscord | <tomck> sent a long message, see http://ix.io/2HyP |
15:17:34 | FromDiscord | <shadow.> `Error: cannot attach a custom pragma to 'rotateRight'` |
15:17:34 | FromDiscord | <shadow.> hmm |
15:17:49 | FromDiscord | <tomck> Is there a way to forward declare types? |
15:21:50 | * | Gustavo6046 joined #nim |
15:23:36 | * | gangstacat joined #nim |
15:24:32 | FromDiscord | <shadow.> ahh i can't attach a pragma to a template? |
15:25:04 | FromDiscord | <shadow.> that wouldnt make sense |
15:25:11 | Araq | hardly, the template gets expanded rather quickly |
15:25:45 | FromDiscord | <shadow.> nvm fixed |
15:25:57 | FromDiscord | <shadow.> it was because i replaced return type of untyped with the .since notation |
15:26:01 | FromDiscord | <shadow.> didn't notice it lol |
15:26:20 | hmmmmm | hey nimions dumb question if I forward declare a proc can I call it with parameters before I define it |
15:26:28 | FromDiscord | <shadow.> failde again what |
15:26:31 | FromDiscord | <shadow.> failed |
15:26:52 | FromDiscord | <shadow.> isn't that the whole point of forward declarations? |
15:27:10 | FromDiscord | <Rika> yes |
15:27:13 | FromDiscord | <Rika> thats the point |
15:27:15 | hmmmmm | naisu |
15:27:16 | hmmmmm | but |
15:27:17 | FromDiscord | <shadow.> lol |
15:27:24 | hmmmmm | can't make the test work |
15:27:27 | hmmmmm | halp |
15:27:36 | hmmmmm | https://play.nim-lang.org/#ix=2HyT |
15:27:43 | FromDiscord | <shadow.> araq, how do i do since notation on a template? |
15:28:05 | FromDiscord | <shadow.> `template rotateRight(deq: var Deque, n = 1): untyped {.since: (1, 5, 1).} =` |
15:28:07 | FromDiscord | <shadow.> this is failing |
15:28:17 | FromDiscord | <tomck> hmmmmm: works for me |
15:28:21 | hmmmmm | :O |
15:28:28 | hmmmmm | it's showing nothing to me |
15:28:37 | FromDiscord | <tomck> you're not echoing anything |
15:28:41 | FromDiscord | <tomck> stick an `echo res` at the bottom |
15:28:43 | hmmmmm | OH SHI |
15:28:45 | hmmmmm | D: |
15:29:01 | hmmmmm | IT WORKS |
15:29:04 | hmmmmm | thx <3 |
15:32:49 | FromDiscord | <shadow.> ah wait idk if i interpreted the earlier message correctly. can you put since notation on a template, or does it get expanded too quickly for that |
15:36:12 | FromDiscord | <shadow.> yeah did some tests, seems like you cant |
15:36:13 | FromDiscord | <shadow.> fixed pr |
15:43:44 | FromDiscord | <Esbeesy> kin'ell Day 11 is something innit |
15:43:56 | * | narimiran quit (Quit: leaving) |
15:44:23 | FromDiscord | <Esbeesy> Apologise in advance for the state of this 😂 ↵https://github.com/sambeckingham/advent-of-code-2020/blob/main/day11/day11.nim |
15:46:42 | FromDiscord | <Esbeesy> is there some kind of sugar around the `low(seq) .. high(seq)` if you want to check an index is in bounds? I know you can do `0 ..< seq.len` also but something like `rangeOf(seq)` would be nice |
15:47:18 | FromDiscord | <Rika> can always make the proc |
15:47:24 | FromDiscord | <Rika> or template if you want |
15:47:52 | FromDiscord | <Esbeesy> Aye I know I just wondered if it was common enough to have warranted being in the core lib |
15:48:00 | FromDiscord | <Rika> i dont think so |
15:58:06 | FromDiscord | <shadow.> time to add 🏃♀️ |
15:58:07 | FromDiscord | <shadow.> nah jk |
15:58:31 | FromDiscord | <shadow.> @Esbeesy i usually just do `if i in 0..a.high` |
15:58:54 | FromDiscord | <Esbeesy> yeah dunno why I used low(seq), like arrays don't start at 0 |
15:59:41 | FromDiscord | <shadow.> lol |
16:00:21 | FromDiscord | <shadow.> hmm |
16:00:24 | FromDiscord | <shadow.> my part two is infinitely cycling |
16:00:26 | FromDiscord | <shadow.> thats odd |
16:02:40 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hz7 |
16:02:45 | FromDiscord | <shadow.> is there an issue with this logic? |
16:05:43 | FromDiscord | <shadow.> @Esbeesy they only difference between parts one and two is the condition in which seated people leave, right? |
16:05:49 | mipri | too much is visible. you should stop when you hit a seat |
16:05:59 | FromDiscord | <shadow.> wdym |
16:06:55 | mipri | >The leftmost empty seat below would only see one empty seat, but cannot see any of the occupied ones |
16:07:09 | FromDiscord | <shadow.> yeah |
16:07:10 | FromDiscord | <shadow.> i have a break in plcae |
16:07:12 | FromDiscord | <shadow.> place |
16:07:26 | FromDiscord | <shadow.> if grid[y][x] != '.':↵ yield grid[y][x]↵ break |
16:07:38 | FromDiscord | <shadow.> which skips to the next direction, right? |
16:07:53 | mipri | yeah that looks fine then |
16:08:01 | FromDiscord | <shadow.> i wonder why it's cycling then |
16:08:26 | Araq | uh oh I now have a face |
16:08:34 | FromDiscord | <shadow.> hm? |
16:08:55 | FromDiscord | <shadow.> i wonder what's wrong then hmm |
16:09:13 | mipri | something elsewhere, probably |
16:09:35 | FromDiscord | <shadow.> well they both use the same function, i just pass the function that has the exit seat condition |
16:09:46 | mipri | that doesn't mean that your earlier code still works for part2 |
16:09:57 | FromDiscord | <shadow.> hmm |
16:09:58 | FromDiscord | <shadow.> ok |
16:10:13 | FromDiscord | <shadow.> when they look for a seat to go in, that's still adjacent right? |
16:10:15 | FromDiscord | <shadow.> or is that also visible |
16:10:45 | mipri | it's a completely separate check, but with steps -- oh |
16:10:48 | mipri | you need to reset steps |
16:10:57 | FromDiscord | <shadow.> wdym? |
16:11:00 | FromDiscord | <shadow.> not sure i follow |
16:11:09 | mipri | ok, let's say you look right, and see a chair |
16:11:12 | FromDiscord | <shadow.> mhm |
16:11:15 | mipri | you yield the chair, and then you break |
16:11:22 | mipri | and then you look in another direction -- farther |
16:11:35 | FromDiscord | <shadow.> hmm |
16:11:44 | FromDiscord | <shadow.> well yes, right? |
16:11:48 | mipri | by the time you get to the last direction you can't see anything nearer than 8 squares away |
16:11:54 | FromDiscord | <shadow.> oh shoot |
16:12:14 | FromDiscord | <shadow.> wait why would that be? |
16:12:17 | FromDiscord | <shadow.> steps is reassigned for each delta |
16:12:27 | mipri | oh yeah, once again it's fine. |
16:12:31 | FromDiscord | <shadow.> weird |
16:12:34 | FromDiscord | <shadow.> hmm |
16:12:40 | FromDiscord | <shadow.> and this certainly works |
16:12:41 | mipri | I'm sleepy and you're asking me about good code instead of broken code. |
16:12:41 | FromDiscord | <shadow.> sent a long message, see http://ix.io/2Hzd |
16:12:49 | FromDiscord | <shadow.> well somehow it's broken |
16:12:53 | FromDiscord | <shadow.> because it's looping |
16:12:56 | FromDiscord | <shadow.> lol |
16:13:24 | * | ^Q-Master^ joined #nim |
16:13:25 | mipri | since you don't understand the problem, you shouldn't put too much faith your ability to isolate the problem |
16:13:39 | FromDiscord | <shadow.> well |
16:13:42 | FromDiscord | <shadow.> i understood part one as that worked |
16:13:51 | FromDiscord | <shadow.> and as far as i can tell the only difference is the exit condition |
16:14:02 | FromDiscord | <shadow.> so that means my exit condition code for part two is the only thing wrong, correct? |
16:14:05 | mipri | there's no difference in the exit condition |
16:14:11 | FromDiscord | <shadow.> exit condition as in |
16:14:14 | FromDiscord | <shadow.> when someone exits a seat |
16:14:15 | FromDiscord | <shadow.> sorry |
16:14:24 | mipri | yeah's just +1 |
16:14:26 | * | Q-Master quit (Read error: Connection reset by peer) |
16:14:26 | FromDiscord | <shadow.> in part one its 4 adjacent occupied, in part two its 5 visible occupied |
16:14:35 | FromDiscord | <shadow.> yeah? |
16:14:36 | mipri | there's nothing tricky there. |
16:14:50 | FromDiscord | <shadow.> well doesnt it switch to visible over occupied for the seat exit cond? |
16:15:03 | mipri | yeah, you're doing that |
16:15:08 | FromDiscord | <shadow.> hm |
16:15:40 | FromDiscord | <shadow.> does the visibility rule apply to sitting down as well? |
16:15:46 | FromDiscord | <shadow.> open seats in all directions visible? |
16:15:50 | FromDiscord | <shadow.> or is it still just adjacent |
16:16:04 | FromDiscord | <shadow.> bc if it applies to sitting down as well then that's my issue |
16:16:07 | mipri | >The leftmost empty seat below would only see one empty seat, but cannot see any of the occupied ones: |
16:16:21 | mipri | of just "L.L.#.#.#.#." |
16:16:25 | FromDiscord | <lqdev> @shadow. offtopic but gotta say you have some serious dedication right there o.O you've been trying to solve AoC the whole day, i would've just quit for good |
16:16:32 | FromDiscord | <shadow.> well im in school |
16:16:38 | FromDiscord | <shadow.> so im just doing it in intervals |
16:16:40 | FromDiscord | <shadow.> when i get the chance |
16:16:41 | FromDiscord | <shadow.> lol |
16:16:44 | FromDiscord | <lqdev> ah kay |
16:16:51 | FromDiscord | <shadow.> ccertainly havent been straight coding for 2:20 hours |
16:16:52 | FromDiscord | <shadow.> lol |
16:16:55 | FromDiscord | <shadow.> tho yesterday i did that- |
16:17:02 | FromDiscord | <shadow.> hmm |
16:17:15 | FromDiscord | <shadow.> yeah i think ik the issue |
16:17:29 | mipri | what is it? |
16:18:42 | FromDiscord | <shadow.> when going to sit, im only checking adjacent open seats, not visible open seats |
16:18:48 | FromDiscord | <shadow.> i just fixed that and it still doesn't work |
16:18:54 | FromDiscord | <shadow.> alr that means there's a flaw somewhere else |
16:21:42 | FromDiscord | <shadow.> found something |
16:21:47 | FromDiscord | <shadow.> visible is only yielding "#" lol |
16:23:36 | FromDiscord | <shadow.> no loop |
16:23:40 | FromDiscord | <shadow.> lets see if its right |
16:23:45 | FromDiscord | <shadow.> YUP |
16:23:45 | FromDiscord | <shadow.> gottem |
16:24:07 | FromDiscord | <shadow.> issue was i never switched count function to use new seating condition function that was passed |
16:24:16 | FromDiscord | <shadow.> it was still hardcoded to use part one's |
16:25:24 | FromDiscord | <shadow.> does nim have anonymous iterators? |
16:26:20 | mipri | you mean first class iterators? yes, with closure iterators. |
16:27:16 | FromDiscord | <shadow.> kk |
16:27:25 | FromDiscord | <shadow.> and can i annotate that using sugar or no |
16:27:35 | FromDiscord | <shadow.> or rather the sugar module |
16:27:38 | * | habamax joined #nim |
16:30:25 | * | PMunch joined #nim |
16:34:33 | PMunch | Who's ready for some AoC streaming? https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=YTJZMkV1ZKg |
16:35:49 | PMunch | @shadow. narimiran ^ |
16:36:00 | Araq | I'm ready |
16:40:25 | FromDiscord | <martinium> I have a question about the current default Nim GC. Does it force a collection at a specified interval? Golang forces one every 2 mins no matter what and can cause latency spikes on certain apps. Does Nim have something similar with it's default GC? |
16:41:24 | Araq | no |
16:42:48 | FromDiscord | <martinium> That is very good to know |
16:43:08 | FromDiscord | <martinium> similar app may be able to avoid certain issues like those latency spikes if written in Nim |
16:44:04 | FromDiscord | <Quibono> Well I believe ARC also removes/reduces those spikes (not that I’m an authority on that.) |
16:45:07 | FromDiscord | <lqdev> it removes the GC completely |
16:45:10 | FromDiscord | <lqdev> ARC is no GC™ |
16:45:18 | FromDiscord | <lqdev> it's reference counting |
16:46:46 | FromDiscord | <mratsim> @martinium the GC is inlined in some function calls that allocates or deallocates a GC-managed type |
16:47:13 | FromDiscord | <mratsim> if you don't use a GC-managed type (seq, ref or string) in a function or don't allocate/deallocate them there will be no GC calls. |
16:48:20 | FromDiscord | <mratsim> also you can compile with a tuning parameter to set a max pause https://nim-lang.org/docs/gc.html |
16:52:56 | * | Kaivo quit (Ping timeout: 240 seconds) |
16:55:46 | Araq | it's a complex topic. They are all "GCs" but the underlying algorithms are very different. it's a bit like comparing bubblesort with quicksort. |
17:04:11 | FromDiscord | <pietroppeter> @PMunch : isn't that a seating[yy][xx] in the template? |
17:07:26 | * | hmmmm joined #nim |
17:08:52 | * | hmmmmm quit (Ping timeout: 246 seconds) |
17:19:10 | * | Tanger quit (Remote host closed the connection) |
17:21:31 | * | JustASlacker quit (Quit: Leaving) |
17:24:09 | * | Q-Master joined #nim |
17:24:23 | * | ^Q-Master^ quit (Read error: Connection reset by peer) |
17:40:09 | FromDiscord | <shadow.> how do i consume rest of string in npeg? |
17:40:21 | FromDiscord | <shadow.> for instance you can do 25 to consume 25 chars, how would i do an arbitrary amount? |
17:40:48 | FromDiscord | <shadow.> i mean i guess `{'\0'..\255'}` works? |
17:46:59 | FromDiscord | <Quibono> Have you tried the last example? |
17:55:52 | FromDiscord | <shadow.> lemme see |
17:58:39 | PMunch | *\1 should work |
17:59:00 | PMunch | Oh soryr just *1 |
17:59:28 | PMunch | @shadow. ^ |
17:59:59 | FromDiscord | <shadow.> thanks |
18:02:23 | Zevv | shadow.: you good? |
18:04:09 | FromDiscord | <shadow.> yeye |
18:04:34 | Zevv | nice |
18:08:34 | * | tefter joined #nim |
18:19:58 | * | hnOsmium0001 joined #nim |
18:27:40 | * | hmmmm quit (Remote host closed the connection) |
18:30:36 | ForumUpdaterBot | New thread by Snej: Best IDE-like Nim experience?, see https://forum.nim-lang.org/t/7242 |
18:32:50 | FromDiscord | <m0nsta> yo Zevv: i read your memory management article the other way |
18:32:54 | FromDiscord | <m0nsta> good stuff |
18:33:00 | * | mbomba joined #nim |
18:33:02 | FromDiscord | <m0nsta> other day |
18:33:52 | Zevv | ta |
18:34:07 | FromDiscord | <m0nsta> there was a list at bottom of the thing. the topics did looked interesting if you ever get around to writing those |
18:34:12 | * | JustASlacker joined #nim |
18:34:14 | Zevv | yeah if ever :/ |
18:34:16 | FromDiscord | <m0nsta> lmk |
18:34:21 | Zevv | it's not about time - I got tons of that |
18:34:27 | Zevv | but motivation, man, motivation |
18:34:34 | FromDiscord | <m0nsta> i feel ya |
18:34:37 | JustASlacker | is there something like the python set in nim? |
18:34:50 | FromDiscord | <m0nsta> does me asking help ? |
18:34:51 | JustASlacker | i hate motivation |
18:35:05 | FromDiscord | <shadow.> sorry i'm not sure i know what that word is |
18:35:07 | FromDiscord | <shadow.> that last one you just used |
18:35:08 | Zevv | I was just getting started writing a npeg tutorial to complete the manual |
18:35:16 | Zevv | then I remembered I didn't finish Hollow Knight yet |
18:35:21 | FromDiscord | <shadow.> and yes there is a set |
18:35:25 | FromDiscord | <shadow.> there's the builtin sets for ordinals |
18:35:28 | FromDiscord | <shadow.> hash sets for any types |
18:35:39 | FromDiscord | <shadow.> and intsets, tho idk how they compare to normal sets tbh |
18:36:09 | JustASlacker | duh |
18:36:12 | FromDiscord | <m0nsta> why is everyone so low on motivation lol |
18:36:22 | JustASlacker | because Im low on pizza |
18:36:23 | FromDiscord | <m0nsta> i have to contain it |
18:36:34 | FromDiscord | <m0nsta> i dont like pizza |
18:36:38 | FromDiscord | <m0nsta> thats it |
18:36:44 | FromDiscord | <m0nsta> has to be it |
18:36:48 | JustASlacker | shadow. thx, dunnow how I missed that |
18:36:53 | FromDiscord | <shadow.> np |
18:36:59 | FromDiscord | <shadow.> what type do you need it for? |
18:38:05 | JustASlacker | well right I check if an element is inside a sequence before I add it |
18:38:08 | * | narimiran joined #nim |
18:38:09 | JustASlacker | right now |
18:39:05 | JustASlacker | I like it more with a set and without the if statement |
18:39:32 | JustASlacker | ¯\_(ツ)_/¯ |
18:42:52 | FromDiscord | <shadow.> ohh |
18:42:59 | FromDiscord | <shadow.> what type is the element? |
18:43:10 | FromDiscord | <shadow.> sry that's what i meant originally lmao |
18:44:06 | JustASlacker | a tcp port. so, an int |
18:44:16 | Zevv | no, and uint16 |
18:44:22 | Zevv | which fits in a normal set[uint16] |
18:44:25 | FromDiscord | <shadow.> yeah |
18:44:38 | JustASlacker | yeah, well, MAYBE I USED A STRING |
18:44:38 | FromDiscord | <shadow.> set[uint16] or IntSet will both work |
18:44:49 | FromDiscord | <shadow.> then a hash set would be needed |
18:45:47 | Zevv | performance & size wize, set[uint16] > Intset > HashSet[int] |
18:49:18 | JustASlacker | the documentation is kinda unclear |
18:49:35 | JustASlacker | "Hash sets are different from the built in set type. Sets allow you to store any value that can be hashed and they don't contain duplicate entries." |
18:49:51 | JustASlacker | does that mean the builtin set type does allow duplicate entries? |
18:50:30 | JustASlacker | sets with duplicate entries kinda pointless |
18:51:06 | JustASlacker | I hate it when pizza is taking long |
18:56:55 | * | thomasross joined #nim |
19:01:11 | FromDiscord | <mratsim> are Intset that good? |
19:01:32 | FromDiscord | <mratsim> I think their array[33, Int] waste a lot of space. |
19:03:45 | FromDiscord | <shadow.> fair |
19:03:48 | FromDiscord | <shadow.> i'm not sure |
19:03:51 | FromDiscord | <shadow.> they're sparse bitsets |
19:03:53 | FromDiscord | <shadow.> and no, slacker |
19:04:00 | FromDiscord | <shadow.> the builtin sets are bitsets |
19:04:07 | FromDiscord | <shadow.> meaning you can't have duplicates |
19:04:45 | Zoom[m] | Had no problem with yesterday's AOC task, actually, it was the 2nd fastest one for me to solve. Just had to take pen and paper for part2 and check what's going on. |
19:04:58 | Zoom[m] | But I hated today, doing 2d indexing by hand... |
19:05:10 | FromDiscord | <shadow.> yeah fair |
19:05:18 | FromDiscord | <shadow.> can you not make a default set with `int`? |
19:06:53 | FromDiscord | <shadow.> bc my main complaint with the builtin sets for integers is that most of my ints are `int` and afaik you need to specify `int16` or `uint16` for integers of that size or something |
19:07:11 | FromGitter | <bung87> https://github.com/status-im/nim-chronos/issues/143 can help with this? |
19:07:12 | disbot | ➥ provide api readLineInto similar with asyncdispatch's recvInto |
19:16:25 | * | JustASlacker quit (Ping timeout: 240 seconds) |
19:23:43 | cmc[m] | Hey there is anyone working on some kind of video decoder bindings for Nim? I'm trying to evaluate how hard that would be for VLC's "dav1d" decoder for AV1 |
19:29:21 | * | JustASlacker joined #nim |
19:31:24 | FromDiscord | <shadow.> can i cross compile for linux on a windows machine? |
19:31:30 | FromDiscord | <shadow.> if not ill just use my ubuntu subsys |
19:33:39 | FromDiscord | <shadow.> nvm |
19:34:00 | FromDiscord | <shadow.> disruptek, you here? |
19:35:10 | FromDiscord | <Esbeesy> Yeah you can |
19:35:24 | FromDiscord | <Esbeesy> the compiler page in the docs has guides for the various scenarios |
19:36:45 | FromDiscord | <shadow.> oh awesome |
19:42:47 | * | Torro joined #nim |
19:45:32 | * | JustASlacker quit (Read error: Connection reset by peer) |
19:50:28 | * | hmmm joined #nim |
19:50:47 | ForumUpdaterBot | New thread by Timothee: How to disable (deprecated) appveyor CI from running (and failing) in your nim fork?, see https://forum.nim-lang.org/t/7243 |
19:53:22 | * | habamax quit (Ping timeout: 246 seconds) |
19:53:49 | * | tefter quit (Ping timeout: 260 seconds) |
19:55:05 | hmmm | hey why I never see timmy on irc |
19:55:19 | hmmm | the people want to hear from the timmy |
19:55:33 | hmmm | :invoking: disruptek |
19:59:08 | FromDiscord | <mratsim> @cmc mantielero had a vapoursynth wrapper iirc |
19:59:20 | FromDiscord | <mratsim> so it could use FFMpegSource |
19:59:30 | FromDiscord | <mratsim> also pretty sure there is a nim-ffmpeg out there |
20:01:54 | hmmm | wow people still use notepad++ in 2020 |
20:02:04 | hmmm | mratsim I'm looking at your link |
20:02:18 | hmmm | 30% is an insane stat |
20:07:02 | * | tefter joined #nim |
20:07:23 | FromDiscord | <acek7> disruptek im not drunk |
20:11:08 | FromDiscord | <kenran> I'm trying to communicate with a PTY that I've allocated and started a shell "in". Now using (via `execvp`) either `dash`, `bash`, `sh` or `fish` everything seems to go well. But when I start `zsh` in there (which happens to be the shell I actually use), I get an error when trying the first `read` on the pty's FD, with an `errno == 5`. Any idea how I can debug this? |
20:22:47 | FromDiscord | <lqdev> trying to cast between closure types, to no avail because the codegen is wrong |
20:23:09 | * | Q-Master quit (Ping timeout: 256 seconds) |
20:23:58 | FromDiscord | <lqdev> https://github.com/nim-lang/Nim/issues/5785 |
20:24:00 | disbot | ➥ Bad codegen on casting closure proc types ; snippet at 12https://play.nim-lang.org/#ix=2HBA |
20:24:29 | FromDiscord | <shadow.> idk if disruptek is here lol |
20:24:34 | FromDiscord | <lqdev> guess i'm gonna have to use inheritance |
20:25:29 | * | tefter quit (Quit: WeeChat 2.9) |
20:33:31 | FromDiscord | <Esbeesy> Nim 1.5.1 huh, that the develop branch? What's new in 1.5 |
20:36:20 | FromDiscord | <lqdev> @Esbeesy https://github.com/nim-lang/Nim/blob/devel/changelog.md |
20:36:29 | FromDiscord | <Esbeesy> Ohhhhh shi, nice one |
20:36:41 | FromDiscord | <Esbeesy> Wait 1.6.x |
20:37:08 | FromDiscord | <lqdev> it lists all the changes on devel |
20:37:14 | FromDiscord | <lqdev> 1.5.1 is the current development version |
20:37:17 | FromDiscord | <lqdev> which is what i'm on |
20:39:59 | leorize[m]1 | I'm waiting for IC :P |
20:40:15 | FromDiscord | <Esbeesy> Insane Clown: Posse? |
20:40:24 | * | leorize[m]1 is now known as leorize[m] |
20:40:53 | FromDiscord | <lqdev> incremental compilation |
20:40:57 | FromDiscord | <lqdev> @leorize yeah me too |
20:42:20 | leorize[m] | looks like there is a new developer tooling rfc |
20:43:43 | FromDiscord | <lqdev> yeah |
20:43:50 | FromDiscord | <lqdev> a round 300 |
20:44:32 | leorize[m] | I find it kinda surprising that no one talks about the terrible debugging experience atm |
20:44:34 | * | narimiran quit (Ping timeout: 260 seconds) |
20:45:10 | FromDiscord | <Esbeesy> What's wrong with inserting 20 echo statements... 😂 |
20:45:41 | FromDiscord | <lqdev> idk echo-debugging has been working out fine for me |
20:45:57 | FromDiscord | <lqdev> i almost never use the debugger |
20:46:27 | leorize[m] | debugger is useful when you're unsure of how the code flows |
20:47:08 | FromDiscord | <lqdev> maybe |
20:47:14 | FromDiscord | <lqdev> i never had to analyze code flow :p |
20:47:20 | FromDiscord | <lqdev> well, i did |
20:47:25 | FromDiscord | <lqdev> but just echo-debugged |
20:47:29 | Zevv | :) |
20:47:48 | Zevv | debuggers is for tracing segfaults only |
20:48:12 | leorize[m] | hmm, looks like many don't understand how nimsuggest actually functions |
20:48:17 | FromDiscord | <lqdev> Zevv: my man |
20:48:21 | Zevv | let's marry |
20:48:35 | FromDiscord | <lqdev> leorize wdym |
20:51:50 | leorize[m] | you can't really "remove" error checking from nimsuggest is what I meant :P |
20:52:38 | leorize[m] | well but you can't improve nimsuggest as it is atm |
20:52:39 | Zevv | you say :) |
20:53:03 | leorize[m] | caching is near non-existence in nimsuggest |
20:53:26 | leorize[m] | so basically every command that concerns a changed file requires re-evaluation of all macros |
20:54:02 | leorize[m] | which is the main cause for the 100% cpu usage |
20:54:52 | FromDiscord | <lqdev> so THAT's why IC is gonna fix it! |
20:54:57 | leorize[m] | when ic arrives macro caching will actually be possible and should solve that pain point |
20:55:12 | FromDiscord | <lqdev> now you made me even more hyped up |
20:55:46 | leorize[m] | after ic arrives we're probably gonna deprecate the current architecture of nimsuggest |
20:56:44 | FromDiscord | <lqdev> TIL https://play.nim-lang.org/#ix=2HBL |
20:56:50 | FromDiscord | <lqdev> how is this type conversion even legal |
20:57:06 | FromDiscord | <lqdev> nim surprises me on every step |
20:57:15 | FromDiscord | <lqdev> even though i'm quite experienced |
20:57:26 | leorize[m] | the ic cache is very fast and can be queried directly |
20:57:30 | * | Q-Master joined #nim |
20:58:08 | leorize[m] | the future might be that nimsuggest not need to be a daemon |
20:58:10 | FromDiscord | <lqdev> maybe i'll wait with creating my nimsuggest plugin until this is done 🤔 |
20:58:24 | FromDiscord | <lqdev> damn that would be so rad |
20:58:47 | FromDiscord | <lqdev> just a simple `nimsuggest complete file.nim dirtyfile.nim 1 12` and boom! |
20:59:04 | FromDiscord | <lqdev> no IPC needed! |
20:59:09 | FromDiscord | <lqdev> vanilla Lua-friendly! |
21:00:58 | FromDiscord | <exelotl> that proc type conversion does seem pretty sus |
21:01:50 | leorize[m] | just make it now :P |
21:01:52 | leorize[m] | the change won't happen overnight |
21:02:52 | * | Q-Master quit (Ping timeout: 272 seconds) |
21:03:12 | leorize[m] | I wonder if LSP will be what the new nimsuggest use |
21:03:34 | leorize[m] | LSP is cool and all but it's also complex |
21:03:34 | leorize[m] | not gonna be an issue for big editors |
21:03:39 | FromDiscord | <lqdev> @leorize i know, but right now i have more important things to focus on than writing a nimsuggest client |
21:04:12 | FromDiscord | <lqdev> yeah hopefully LSP isn't gonna be too much of a pain to implement |
21:04:20 | FromDiscord | <lqdev> at least at a small scale (completion + refactoring) |
21:07:45 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2HBS |
21:07:46 | FromDiscord | <lqdev> noooooooooooooooo |
21:07:49 | FromDiscord | <lqdev> not the codegen |
21:09:57 | FromDiscord | <lqdev> somebody doesn't like my closures |
21:13:19 | FromDiscord | <lqdev> @exelotl well guess wat |
21:13:24 | FromDiscord | <lqdev> it is sus af |
21:13:31 | FromDiscord | <lqdev> https://play.nim-lang.org/#ix=2HBV |
21:14:05 | FromDiscord | <exelotl> lol epic |
21:17:01 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
21:19:38 | FromDiscord | <Esbeesy> Hey speaking of LSP I was trying to implement it in a VS Code extension yesterday |
21:20:36 | * | Gustavo6046 joined #nim |
21:26:23 | FromDiscord | <kenran> I need an `UncheckedArray[cstring]` for interop with C. The manpage mentions that the array must be terminated by a null pointer that has to be cast `(char )NULL`. How can I do this in nim? |
21:26:29 | FromDiscord | <kenran> maybe the second part is obsolete? |
21:28:52 | FromDiscord | <lqdev> first of all, you probably want `ptr UncheckedArray[cstring]` |
21:28:57 | FromDiscord | <lqdev> second of all |
21:29:04 | FromDiscord | <lqdev> you just set the last element to `nil` and it should work |
21:31:22 | FromDiscord | <lqdev> alright, codegen issue reported. https://github.com/nim-lang/Nim/issues/16325 |
21:31:25 | disbot | ➥ Suspicious type conversion between procs accepting two different types ; snippet at 12https://play.nim-lang.org/#ix=2HC6 |
21:32:07 | FromDiscord | <haxscramper> Why adding `var` to the argument causes type mismatch error in this code: https://play.nim-lang.org/#ix=2HC5 ? |
21:32:37 | FromDiscord | <kenran> @lqdev thanks! also I found `allocCStringArray` which seems to append a `NULL` cstring at the end |
21:33:59 | FromDiscord | <lqdev> @haxscramper `var`, `ref`, and inheritance don't play together nicely. you can use an explicit type conversion but since `ref`s are always mutable anyways you can just omit the `var` altogether |
21:34:15 | FromDiscord | <Esbeesy> Uh oh https://media.discordapp.net/attachments/371759389889003532/787069761812168704/unknown.png |
21:35:02 | voltist | @Vindaar Sorry, wasn't keeping track of chat. I'm having an issue with ggplotnim that I think you ought to see: https://github.com/dizzyliam/randomImgs/blob/master/broken.png?raw=true |
21:35:21 | FromDiscord | <kenran> I used to use `execvp("dash", nil)` to start a dash as a child process, and everything worked (as well as for `bash`, `fish` and others), but not for `zsh`. The only thing that I found that I did differently to `st` there except for the PTY handling was that I passed `nil` instead of a `cstringArray` that contained as first argument the executable name again. And behold: that was the reason it didn't work for `zhs`. Very weird that it's |
21:35:50 | FromDiscord | <kenran> (edit) "`zhs`." => "`zsh`." |
21:36:01 | * | Torro left #nim ("bye") |
21:36:36 | FromDiscord | <kenran> Now doing `execvp("zsh", @["zsh", nil])` (pseudocode, does not actually typecheck this way) it works fine. |
21:37:11 | FromDiscord | <kenran> Interacting with these low-level functions is just so weird |
21:38:35 | FromDiscord | <lqdev> welcome to C. |
21:41:35 | FromDiscord | <kenran> seeing this I simultaneously wonder about why anything even works as well as it does, but also find it somehow "elegant". some functions at least |
21:42:20 | FromDiscord | <lqdev> things work so well because they've been tested over many, many years. |
21:42:26 | FromDiscord | <lqdev> which means most bugs are ironed out. |
21:42:33 | FromDiscord | <kenran> yeah |
21:42:55 | FromDiscord | <kenran> which kinda brings me back to a question that went unanswered yesterday: how do I test such low-level code in nim? |
21:43:19 | FromDiscord | <lqdev> hard to tell |
21:43:22 | FromDiscord | <lqdev> just… run it |
21:43:34 | FromDiscord | <lqdev> low-level docs are sometimes quite lacking or ambiguous |
21:43:38 | FromDiscord | <kenran> I did some C# some years ago, and there I'd have created some interfaces and mocked the low-level stuff out for tests |
21:43:53 | FromDiscord | <lqdev> and sometimes there's no examples which is even more infuriating |
21:43:59 | FromDiscord | <lqdev> as you have to guess what a function does |
21:44:51 | FromDiscord | <kenran> nowadays I only do FP, where things are on a way higher level. it's sometimes hard to test stuff there as well, but in both cases (C#, Haskell) you usually write code in a way s.t. it's easier to test. |
21:45:17 | FromDiscord | <kenran> but doing so at such a low level and without losing any performance, if that should matter, seems hard to impossible for me |
21:47:09 | FromDiscord | <kenran> I don't hold anything against integration or end-to-end tests, but even those would be a challenge for me to write when interacting with the OS in such a way. it would also not cover any edge cases as I cannot simply "make a call fail" on a whim |
21:48:36 | * | Q-Master joined #nim |
21:51:41 | FromDiscord | <Rebel> When you were doing C# did you play around with dnpatch, dnlib, or mono.cecil? 😛 |
21:53:04 | FromDiscord | <kenran> Nope, just boring business stuff 😦 |
21:56:13 | * | krux02 joined #nim |
21:57:39 | FromDiscord | <WilliamDraco> sent a long message, see http://ix.io/2HCi |
22:03:56 | * | tribly left #nim ("WeeChat 2.9") |
22:06:34 | FromDiscord | <dom96> @WilliamDraco try poEvalCommand |
22:07:23 | FromDiscord | <zetashift> Say I have a `Cell` type and have a contructor/initialization func, is it more idiomatic to call that func `Cell()` or `cell()` or `newCell`? |
22:07:35 | FromDiscord | <zetashift> kinda bikeshedding but I've seen all 3 in the wild |
22:08:26 | FromDiscord | <zetashift> I think NEP-1 suggests init/new based on the type |
22:10:41 | FromDiscord | <kenran> Looking at https://nim-lang.org/docs/posix.html#signal%2Ccint%2CSighandler, what's `Sighandler`? How can I write one? |
22:11:30 | FromDiscord | <kenran> ah, it's only in the source |
22:12:53 | FromDiscord | <lqdev> @zetashift you can't call the func `Cell()` because `Cell` is already a symbol |
22:13:12 | FromDiscord | <lqdev> so go with `cell` or `initCell`/`newCell` depending on how expensive the operation is |
22:13:24 | FromDiscord | <lqdev> for refs it's always `newT` |
22:13:46 | FromDiscord | <lqdev> for everything else `initT` is idiomatic but quickly gets old when you have lots of ctors nested in each other |
22:14:22 | FromDiscord | <lqdev> so i personally use the type name with the first letter lowercased for small objects holding data that don't need complex initialization logic |
22:16:30 | FromDiscord | <WilliamDraco> @dom96 `poEvalCommand` results in the same behaviour |
22:17:19 | FromDiscord | <lqdev> `poUsePath`? |
22:17:26 | FromDiscord | <lqdev> though it's on by default on windows |
22:17:44 | FromDiscord | <WilliamDraco> tried it anyway, no change |
22:21:22 | FromDiscord | <zetashift> @lqdev thanks! Ill go with newT |
22:21:29 | FromDiscord | <zetashift> Don't have many cities |
22:21:37 | FromDiscord | <zetashift> Constructors |
22:23:01 | FromDiscord | <Esbeesy> ~Alright creating a VSCode language server client isn't as easy as I thought it was gonna be 😂 ~ |
22:23:01 | disbot | no footnotes for `Alright`. 🙁 |
22:23:16 | * | Q-Master quit (Ping timeout: 240 seconds) |
22:23:17 | FromDiscord | <Esbeesy> Oh my god it's working |
22:24:37 | FromDiscord | <Esbeesy> Does nimlsp provide syntax highlighting or does it rely on the textmate theme in the editor? |
22:26:03 | FromDiscord | <ElegantBeef> Pmunch said it doesnt support syntax highlighting afaik |
22:26:07 | FromDiscord | <Esbeesy> Shweet |
22:26:52 | FromDiscord | <Esbeesy> Okay so I've hooked it up and.. yeah |
22:29:31 | PMunch | Yeah, it doesn't support syntax highlighting, yet.. |
22:31:32 | FromDiscord | <Esbeesy> That's cool, the textmate thing works fine in Code anyway |
22:31:49 | FromDiscord | <Esbeesy> Are you actively working on nimlsp? |
22:35:21 | PMunch | Define actively |
22:35:27 | PMunch | I'm not working on it right now |
22:35:38 | FromDiscord | <Esbeesy> RIGHT THIS SECOND |
22:35:51 | PMunch | But I am maintaining it, and I will probably end up adding some more features to it at some point |
22:35:55 | PMunch | Right now I'm soldering :P |
22:36:24 | FromDiscord | <Esbeesy> Oo anything interesting? |
22:36:39 | FromDiscord | <Esbeesy> And yeah I just meant like it's not abandonware |
22:38:08 | PMunch | Definitely not |
22:38:17 | FromDiscord | <scott> in the example for asynchttpserver it shows using the proc `processClient`... where is that proc defined and what does it do? |
22:38:22 | PMunch | I'm soldering switches on a keyboard |
22:38:29 | FromDiscord | <scott> nice |
22:38:35 | FromDiscord | <scott> what a pain in the ass though |
22:38:37 | FromDiscord | <Esbeesy> Which switcheesssss |
22:38:47 | PMunch | Kailh low-profile brown |
22:38:55 | FromDiscord | <Esbeesy> And yeah same, I want to do it myself but sod soldering 100+ teeny switches |
22:39:07 | PMunch | This one only has 70 |
22:39:14 | PMunch | Luckily |
22:39:21 | FromDiscord | <scott> also they're not that small |
22:39:23 | PMunch | But I am considering LEDs.. |
22:39:34 | PMunch | @scott well the tiny diodes are.. |
22:39:40 | PMunch | And I got the kind without legs |
22:39:45 | FromDiscord | <scott> not like you're trying to place a bunch of....SMD LEDs...or diodes...yeah ouch |
22:39:47 | PMunch | And I don't have a PCB.. |
22:39:56 | FromDiscord | <Esbeesy> Wait what are you soldier them to |
22:39:57 | FromDiscord | <scott> wtf are you soldering them to then? |
22:40:02 | FromDiscord | <Esbeesy> (edit) "soldier" => "soldering" |
22:40:02 | PMunch | Each other |
22:40:06 | PMunch | Just a sec |
22:40:07 | FromDiscord | <Esbeesy> wat |
22:40:24 | FromDiscord | <Esbeesy> Like an everlasting gobstopper? |
22:40:47 | FromDiscord | <scott> ☝️ though... |
22:42:10 | FromDiscord | <kenran> without a pcb? are you building some manuform keyboard? |
22:42:23 | PMunch | https://photos.app.goo.gl/Rwdr5Wt1mYDRokrc6 |
22:42:55 | PMunch | On the second half I*m doing the rows first though, so it looks a lot neater |
22:42:58 | FromDiscord | <Esbeesy> Yeah where IS that processClient coming from 🤔 |
22:43:11 | FromDiscord | <scott> like every time I manage to do something in Nim, I LOVE how it turns out, but getting there is so hard because the docs are just not adequate... |
22:43:53 | FromDiscord | <Esbeesy> Doesn't appear to be in the library std lib at all |
22:44:26 | FromDiscord | <Esbeesy> PMunch is that going to be an ortholinear? |
22:44:38 | PMunch | Yup |
22:44:43 | PMunch | Split ortholinear |
22:44:43 | FromDiscord | <Esbeesy> Dope |
22:45:00 | PMunch | @scott, you get used to it after a while.. |
22:45:04 | PMunch | Then it's just bliss |
22:45:37 | FromDiscord | <scott> yeah I know which is why I keep coming back but I hate spinning out on stuff like this |
22:45:54 | FromDiscord | <kenran> say I have to register a callback via a function that takes a `proc: (a: cint)`, but I need the actual callback to be a closure around another argument. how can I do that? I'll try to write what I mean: |
22:45:56 | PMunch | @scrott processClient doesn't come from anywhere AFAIK |
22:46:07 | PMunch | It's used in an example in the asyncnet module |
22:46:18 | leorize[m] | PMunch: you been following nim-lang/rfcs#300? |
22:46:33 | FromDiscord | <scott> yeah I saw that, do you think the example is referencing that? lol |
22:46:35 | PMunch | leorize[m], don't think so, link? |
22:46:47 | PMunch | @scott, well it's defined in the example |
22:46:51 | PMunch | As a proc |
22:47:10 | FromDiscord | <scott> in the other example on another module? |
22:47:32 | FromDiscord | <scott> idk that just seems like a leap to expect people to figure that out |
22:47:48 | leorize[m] | !rfcs developer tools |
22:47:49 | disbot | https://github.com/nim-lang/RFCs/issues/300 -- 3Developer tooling |
22:47:49 | disbot | https://github.com/nim-lang/RFCs/issues/179 -- 3Nim source packages |
22:47:49 | disbot | https://github.com/nim-lang/RFCs/issues/58 -- 3RFC: change `dynlib` handling on linux to use standard dynamic linking instead of runtime loading via `dlopen` 7& 6 more... |
22:48:13 | FromDiscord | <scott> also `processClient` doesn't accept the same arity of arguments in asyncnet as in asynchttpserver |
22:48:56 | leorize[m] | @scott feel free to ask around here. In the future a nim book would be nice but I don't think there's any active collaborative effort on one atm |
22:49:46 | FromDiscord | <kenran> sent a code paste, see https://play.nim-lang.org/#ix=2HCD |
22:49:52 | FromDiscord | <kenran> (edit) |
22:49:58 | PMunch | @scott, literally further up in the same example.. |
22:50:36 | PMunch | leorize[m], what do you mean, there already is a Nim book.. |
22:51:00 | FromDiscord | <kenran> How can I register `foo` with the fixed `x` as a handler that only takes one `cint`? |
22:51:18 | FromDiscord | <scott> leorize, sorry, I feel a bit defensive about asking questions here...I've been told to RTFM in cases where I just wasn't looking in the right place |
22:51:42 | FromDiscord | <scott> PMunch, what? |
22:51:47 | FromDiscord | <Esbeesy> I think he means like The Rust Book |
22:52:02 | FromDiscord | <Esbeesy> Which is a middle ground between docs and Nim In Action |
22:52:45 | FromDiscord | <scott> I'm unemployed and wouldn't be opposed to trying to start something like that but I also am still a bit of a novice at Nim |
22:53:18 | FromDiscord | <Esbeesy> I'm employed and currently planning to do it as I change jobs,was going to use it as an excuse to write a markdown book generator in nim. In fact |
22:53:27 | FromDiscord | <Esbeesy> Might do some on that now |
22:53:40 | PMunch | @scott, we just added that tag :P We're usually pretty accommodating :P |
22:53:57 | PMunch | I'm looking in the asyncnet module and the processClient is defined there |
22:53:58 | FromDiscord | <scott> what is a tag? |
22:54:01 | PMunch | Where are you looking |
22:54:06 | PMunch | ~rtfm |
22:54:07 | disbot | rtfm: 11read the fucking manual -- PMunch |
22:54:07 | disbot | rtfm: 11https://nim-lang.org/documentation.html |
22:54:10 | PMunch | This thing |
22:54:13 | FromDiscord | <scott> lol |
22:54:16 | PMunch | Well, they're not called tags |
22:54:22 | PMunch | Notes? |
22:54:27 | PMunch | ~scott |
22:54:27 | disbot | no footnotes for `scott`. 🙁 |
22:54:39 | PMunch | ~scott is someone on Discord |
22:54:39 | * | Q-Master joined #nim |
22:54:39 | disbot | scott: 11someone on Discord |
22:54:50 | PMunch | You can add whatever you want :P |
22:54:57 | FromDiscord | <scott> I didn't mean that I was literally told that, just got told that my question was easily found in the docs |
22:55:09 | PMunch | Oh right |
22:55:13 | PMunch | That's not very helpful.. |
22:56:11 | FromDiscord | <Esbeesy> ~Esbeesy needs a sandwich |
22:56:12 | disbot | no matching footnotes for `Esbeesy` with regexps `needs, a, sandwich`. 🙁 |
22:56:21 | leorize[m] | usually I would be around to help but it's exam season here |
22:56:24 | FromDiscord | <scott> anyway under `asyncnet`, `proc processClient` has arity/type `proc processClient(client: AsyncSocket)`, but in `asynchttpserver`, it's called with 5 arguments |
22:57:04 | PMunch | @Esbeesy, you need to say "is" |
22:57:23 | FromDiscord | <scott> no worries, leorize, I don't mean to be impatient by any means, just don't feel in the mood to be hollered at by Disruptek for asking a stupid question 😂 |
22:57:45 | PMunch | Ah I see |
22:58:01 | PMunch | Oh yeah, he should come with a disclaimer :P |
22:58:09 | leorize[m] | ~disruptek |
22:58:10 | disbot | disruptek: 11unsafe at any speed. |
22:58:10 | disbot | disruptek: 11:disruptek: |
22:58:10 | disbot | disruptek: 11an unsafe nil deref |
22:58:30 | FromDiscord | <scott> yeah I've said it before, it took me like 10 minutes here to realize he was the local grump |
22:58:31 | FromDiscord | <scott> lol |
22:58:40 | PMunch | ~dispruptek is comes with a disclaimer |
22:58:41 | disbot | dispruptek: 11comes with a disclaimer |
22:58:54 | PMunch | Anyways |
22:58:58 | PMunch | The processClient |
22:59:09 | * | lritter quit (Quit: Leaving) |
22:59:12 | PMunch | I think it's just meant as an example |
22:59:49 | PMunch | Oh wait, it's actually an internal procedure in the asynchttpserver module <_< |
22:59:50 | PMunch | https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/asynchttpserver.nim#L293 |
23:00:15 | FromDiscord | <scott> yeah, but what is it meant to do? This came up because I was looking at the docs for `proc respond(Request)` which explicitly says that it doesn't close the client connection |
23:00:49 | FromDiscord | <scott> I want my server to close the client connection after responding in my case. |
23:01:51 | leorize[m] | @Esbeesy If you are going to start a collaborative effort on a nim book then please reach out on the forum. I think if it goes well we can adopt and fund your project to be the official Nim book :) |
23:01:59 | * | Vladar quit (Quit: Leaving) |
23:02:50 | PMunch | There already is a book! |
23:03:00 | PMunch | ~Nim in action |
23:03:01 | disbot | no footnotes for `Nim`. 🙁 |
23:03:09 | PMunch | ~niminaction |
23:03:09 | disbot | no footnotes for `niminaction`. 🙁 |
23:03:46 | PMunch | ~niminaction is a book about Nim written by dom96 - https://www.manning.com/books/nim-in-action |
23:03:46 | disbot | niminaction: 11a book about Nim written by dom96 - https://www.manning.com/books/nim-in-action |
23:03:49 | leorize[m] | nim in action is nowhere near the rust book for example |
23:03:58 | leorize[m] | and it's certainly isn't a collaborative project |
23:04:11 | PMunch | Well of course not, Nim in action is on my shelf, and the rust book is nowhere close! |
23:04:36 | PMunch | Why do you specifically want it collaborative? |
23:06:01 | hmmm | actually the rust book is very well written |
23:06:15 | hmmm | free as in beer and has a very enthusiastic vibe |
23:06:41 | hmmm | if I had the skillz I would write such a book for nim :3 |
23:06:43 | leorize[m] | PMunch: how are you gonna add new pages when you add new features to the language? :P |
23:07:23 | leorize[m] | I want it to be an official book that's free so that everyone can easily pick up nim |
23:07:37 | leorize[m] | the rust book have practically everything on how to use the language |
23:07:42 | hmmm | leorize you have the skillz! I help with the vibe :3 |
23:08:26 | * | kenran quit (Quit: leaving) |
23:08:33 | PMunch | leorize[m], just print them out and stick them in the back :P |
23:08:44 | PMunch | Aaah right |
23:08:55 | PMunch | Maybe I should check this Rust book out |
23:09:12 | hmmm | when you read rust book the first thing you notice is that is written from someone that cares and loves the lang, and second thing, it's extremely detailed but in a simple way |
23:09:18 | FromDiscord | <Vindaar> @voltist: no worries. That's indeed a bit "broken". This can happen under certain circumstances, but in most code paths points outside the range are handled correctly (it can break for things like ridgeline plots). A bit bizarre to see it broken on a normal line plot. What version of ggplotnim are you on and can you share the code to reproduce? possibly report it as an issue on the repo? |
23:09:27 | * | krux02 quit (Remote host closed the connection) |
23:10:10 | * | tane quit (Quit: Leaving) |
23:12:36 | FromDiscord | <Quibono> I’d help with a free Nim book if I could. |
23:13:13 | * | NimBot joined #nim |
23:14:59 | FromDiscord | <scott> it's the same with the Crystal book. I read it front-to-back and felt like I could write whatever I wanted in the language after that. Nim documentation feels splintered and targeted at people who've read the source code |
23:15:14 | FromDiscord | <scott> (re: the rust book) |
23:15:53 | hmmm | I'd love to try crystal but they hate windows plebs |
23:16:04 | FromDiscord | <scott> TBF windows sucks |
23:16:15 | hmmm | >:| |
23:16:26 | FromDiscord | <scott> hehehe |
23:16:43 | hmmm | but yea we need a good "the book" |
23:16:47 | hmmm | you write it scott |
23:17:36 | PMunch | I mean I've got enough mammothean projects, why not throw a book on the pile |
23:17:52 | hmmm | that's the spirit munchie! |
23:18:09 | FromDiscord | <scott> Like I said I could but I'm pretty novice at nim. would be glad to work together with @Esbeesy and anyone else on it |
23:18:47 | hmmm | dude I bet that if we make a RFC something "we writing the book" plenty of people would sign up to help |
23:18:54 | FromDiscord | <Esbeesy> Yup |
23:19:01 | FromDiscord | <scott> heh that's a good idea. BRB |
23:19:41 | FromDiscord | <Esbeesy> I was going to do it to 1. Create a nim version of mdBook 2. Document my learnings |
23:21:23 | hmmm | also who wrote the turorials? there are a few funny gems in there as the "poor guy, who stole your tongue" that were exactly the tone the nim book should have |
23:25:58 | PMunch | It's written by a bunch of different people over the years |
23:26:28 | PMunch | But there are plenty of good blog posts and stuff about Nim |
23:26:46 | * | Beckingham joined #nim |
23:26:49 | hmmm | yea I've seen nari stuff, pretty good |
23:26:54 | Beckingham | Awwww lawdy |
23:28:38 | FromDiscord | <Beckingham> Friendship ended with discord, IRC is new best friend |
23:28:54 | PMunch | One of us, one of us |
23:28:55 | Beckingham | :) |
23:29:05 | hmmm | good boy, stallman said it: "discord is bad for ur freedom" |
23:29:06 | Beckingham | 🦀 |
23:29:18 | Beckingham | Shit wrong community emoji |
23:29:21 | Beckingham | 👑 |
23:29:25 | hmmm | https://stallman.org/discord.html |
23:29:45 | PMunch | You came from the crab community? |
23:29:50 | Beckingham | Everytime I think the css hasn't loaded on that site |
23:29:59 | PMunch | hmmm, pretty sure he woul've said something about Windows as well.. |
23:30:12 | hmmm | munchie! |
23:30:14 | hmmm | :| |
23:37:32 | Beckingham | Is there a "standard" config format with nim? |
23:37:50 | Beckingham | You know how Rust has TOML and C# has a different format with every version |
23:38:37 | FromDiscord | <ElegantBeef> Nim's config format is typically just nimscript inside nimble |
23:38:54 | FromDiscord | <ElegantBeef> Unless you mean for files outside of the build system |
23:41:21 | Beckingham | Huh I guess thats one way of approaching it |
23:44:33 | FromDiscord | <scott> re: discord is bad for your freedom yes but matrix is not and is better than IRC |
23:44:58 | FromDiscord | <ElegantBeef> well matrix voip solutions are pretty much non existant |
23:46:23 | FromDiscord | <ElegantBeef> For instance element, the client made by the people that made the matrix protocol uses jitsi for group voice, that's a conference call style voip, it's not great imo |
23:58:16 | FromDiscord | <Gibson> how can I allocate a string on the shared heap? |
23:58:42 | FromDiscord | <Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2HCV |
23:59:12 | FromDiscord | <Gibson> nor `deepCopy(s[], blah)` |