| 00:02:17 | * | Electrux joined #nim |
| 00:06:59 | * | Electrux quit (Ping timeout: 268 seconds) |
| 00:10:47 | * | deech joined #nim |
| 00:10:48 | * | Electrux joined #nim |
| 00:12:29 | FromGitter | <deech> Question about the PEG parsers in the standard library: would the C comment parser in this example still work if the comment was spread out over multiple lines? https://nim-lang.org/docs/pegs.html#peg-syntax-and-semantics-examples |
| 00:15:21 | * | Electrux quit (Ping timeout: 256 seconds) |
| 00:15:27 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 00:19:06 | * | Electrux joined #nim |
| 00:21:31 | * | dddddd quit (Remote host closed the connection) |
| 00:26:46 | * | Electrux quit (Ping timeout: 264 seconds) |
| 00:33:12 | * | Electrux joined #nim |
| 00:38:01 | * | Electrux quit (Ping timeout: 256 seconds) |
| 00:42:17 | * | Electrux joined #nim |
| 00:46:58 | * | Electrux quit (Ping timeout: 256 seconds) |
| 00:48:30 | * | Electrux joined #nim |
| 00:52:11 | * | deech quit (Ping timeout: 256 seconds) |
| 00:56:09 | * | Electrux quit (Ping timeout: 264 seconds) |
| 01:02:16 | * | Electrux joined #nim |
| 01:06:57 | * | Electrux quit (Ping timeout: 264 seconds) |
| 01:12:17 | * | Electrux joined #nim |
| 01:16:35 | * | Electrux quit (Ping timeout: 240 seconds) |
| 01:20:42 | * | Electrux joined #nim |
| 01:24:57 | * | Electrux quit (Ping timeout: 240 seconds) |
| 01:32:14 | * | Electrux joined #nim |
| 01:37:05 | * | Electrux quit (Ping timeout: 248 seconds) |
| 01:42:12 | * | Electrux joined #nim |
| 01:47:43 | * | Electrux quit (Ping timeout: 256 seconds) |
| 01:47:54 | carterza[m] | o/ |
| 01:52:16 | * | Electrux joined #nim |
| 01:54:46 | * | find0x90 joined #nim |
| 01:55:53 | * | yglukhov[i] quit (Remote host closed the connection) |
| 01:56:57 | * | Electrux quit (Ping timeout: 240 seconds) |
| 02:02:14 | * | Electrux joined #nim |
| 02:09:05 | * | Electrux quit (Ping timeout: 240 seconds) |
| 02:12:14 | * | Electrux joined #nim |
| 02:17:05 | * | Electrux quit (Ping timeout: 248 seconds) |
| 02:17:07 | * | jhorwitz_ joined #nim |
| 02:17:17 | * | jhorwitz_ quit (Client Quit) |
| 02:22:15 | * | Electrux joined #nim |
| 02:26:39 | * | jhorwitz_ joined #nim |
| 02:26:45 | jhorwitz_ | Morning all |
| 02:26:55 | jhorwitz_ | Correction, evening lol |
| 02:31:58 | * | jhorwitz_ quit (Quit: WeeChat 2.1) |
| 02:34:35 | * | jhorwitz_ joined #nim |
| 02:35:59 | * | jhorwitz_ quit (Client Quit) |
| 02:47:45 | FromDiscord | <pudarida> hello there |
| 02:48:05 | FromDiscord | <pudarida> learned of Nim last night, decided to give it a spin |
| 02:50:25 | * | abm joined #nim |
| 02:55:26 | * | find0x90 quit (Quit: find0x90) |
| 03:03:42 | FromGitter | <codenoid> hi @FromIRC |
| 03:14:17 | * | jhorwitz_ joined #nim |
| 03:17:14 | * | xkapastel quit (Quit: Connection closed for inactivity) |
| 03:18:34 | * | jhorwitz_ quit (Client Quit) |
| 03:19:36 | * | jhorwitz_ joined #nim |
| 03:22:47 | * | jhorwitz_ quit (Client Quit) |
| 03:28:58 | FromGitter | <Varriount> Pudarida: Hi |
| 03:29:22 | FromGitter | <Varriount> @codenoid It's quiet right now, most of the main people are asleep. |
| 03:29:49 | FromDiscord | <pudarida> Hmm, what's the difference between .nims and .cfg? |
| 03:33:34 | FromGitter | <Varriount> pudarida: `.nims` is essentially a Nim file that is run by the compiler to determine settings (using the compiler's VM). A .cfg is also used to detect settings, but it is merely a file format. |
| 03:33:46 | FromGitter | <Varriount> `.cfg` is older. `.nims` is newer. |
| 03:34:30 | FromDiscord | <pudarida> Varriount: I see, thanks |
| 03:34:40 | * | jhorwitz_ joined #nim |
| 03:41:30 | * | onionhammer quit (Quit: WeeChat 1.9.1) |
| 03:42:01 | * | onionhammer joined #nim |
| 03:43:16 | jhorwitz_ | Just have to say, nim forum experience is incredibly smooth, very nice site. |
| 03:50:27 | * | abm quit (Ping timeout: 240 seconds) |
| 03:52:09 | FromDiscord | <emekoi> is `GC_step` still supported? i passed -d:useRealtimeGC to nim but it gives me the error `Error: undeclared identifier: 'GC_step'` |
| 03:56:26 | * | yglukhov[i] joined #nim |
| 03:57:21 | * | jhorwitz_ quit (Ping timeout: 248 seconds) |
| 04:01:19 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
| 04:07:41 | FromGitter | <Varriount> emekoi: You passed that exact symbol, "useRealtimeGC"? |
| 04:09:11 | FromGitter | <Varriount> Looking at https://github.com/nim-lang/Nim/blob/devel/lib/system/gc.nim#L849 and https://github.com/nim-lang/Nim/blob/devel/lib/system/gc2.nim#L28 |
| 04:09:29 | FromGitter | <Varriount> it appears that GC Step should be activated when that symbol is defined. |
| 04:12:10 | * | Electrux quit (Quit: WeeChat 2.1) |
| 04:12:33 | * | Electrux joined #nim |
| 04:35:05 | * | cspar joined #nim |
| 04:36:40 | FromGitter | <zacharycarter> ugh my internet connection is so bad |
| 04:36:43 | FromGitter | <zacharycarter> VM is not built with 'gorge' support - any ideas? |
| 05:21:50 | * | miran joined #nim |
| 05:29:30 | Araq | zacharycarter: -d:nimcore in your build |
| 05:49:13 | FromGitter | <zacharycarter> thanks |
| 05:50:33 | FromGitter | <zacharycarter> also - can we rename choosenim to nimwich and can we also have it install c2nim? |
| 05:57:05 | * | jhorwitz_ joined #nim |
| 05:57:49 | * | Vladar joined #nim |
| 05:58:06 | * | dddddd joined #nim |
| 06:01:28 | * | jhorwitz_ quit (Ping timeout: 256 seconds) |
| 06:14:26 | * | endragor joined #nim |
| 06:20:57 | * | Sembei joined #nim |
| 06:21:27 | * | Pisuke quit (Ping timeout: 260 seconds) |
| 06:24:32 | * | nsf joined #nim |
| 06:47:42 | * | endragor quit (Remote host closed the connection) |
| 07:04:50 | * | nsf quit (Quit: WeeChat 2.1) |
| 07:40:07 | * | yglukhov[i] joined #nim |
| 07:44:29 | FromGitter | <rokups> any idea why https://ideone.com/eZAWgx used to work with 0.16.0 but not any more? tested on devel. having converter there produces `lib/system.nim(3591, 33) Error: type mismatch: got <ustring> but expected 'char = Char'` error |
| 07:52:07 | FromGitter | <Vindaar> @rokups Hm, I'm a little surprised it used to work in the past. The `ustring` is defined as a distinct string. And you only define the `[]` for an index `i`, but not for a slice |
| 07:53:28 | FromGitter | <rokups> `lib/system.nim(3591, 33)` line uses int index though |
| 07:54:18 | FromGitter | <rokups> im surprised why it isnt working now. said line in system module is working with a string. so why is converted used then? |
| 07:54:35 | FromGitter | <Vindaar> I haven't used converters so I'm not entirely sure how they work and what they imply |
| 07:54:50 | FromGitter | <rokups> given this situation it seems that if converter exists then compiler tries to apply it regardless. that does not make sense |
| 07:55:09 | FromGitter | <Vindaar> Yeah, that is indeed weird |
| 08:04:19 | FromGitter | <Vindaar> My question right now though: what would be the point of having a distinct type, if one introduces a converter for that to its base type? Aren't converters sort of the opposite of distinct? |
| 08:04:54 | * | gmpreuss- quit (Ping timeout: 268 seconds) |
| 08:05:27 | * | gmpreussner joined #nim |
| 08:07:29 | * | xkapastel joined #nim |
| 08:09:12 | * | yglukhov[i] quit (Remote host closed the connection) |
| 08:14:32 | * | rokups joined #nim |
| 08:19:20 | * | jjido joined #nim |
| 08:26:32 | FromGitter | <Vindaar> ok, looking at system.nim again: While I don't know when the converter is being used, it seems what happened was that the `s[i + a]` did actually call your defined ```proc `[]`*(s: ustring, i: int): ustring = s```. And since that actually ignores the index and returns the whole string, the assignment to the `result` string fails, because that expects a single char |
| 08:27:26 | FromGitter | <Vindaar> So replacing that proc by ```proc `[]`*(s: ustring, i: int): char = string(s)[i]``` makes it work as expected (I assume) |
| 08:37:35 | * | miran quit (Ping timeout: 268 seconds) |
| 08:39:24 | * | jhorwitz_ joined #nim |
| 08:44:09 | * | jhorwitz_ quit (Ping timeout: 264 seconds) |
| 08:45:04 | * | yglukhov[i] joined #nim |
| 08:50:34 | FromGitter | <rokups> neh :) this operator must return `ustring`. this code is part of utf8 string lib and one character in utf-8 doesnt fit into `char` |
| 08:51:57 | * | Electrux quit (Ping timeout: 264 seconds) |
| 08:53:15 | * | Electrux joined #nim |
| 08:56:25 | FromGitter | <Vindaar> ahh, that makes sense. :) |
| 08:56:48 | FromGitter | <Vindaar> but then to make it work, I assume you need to define `[]=` as well for ustring |
| 08:57:27 | * | Electrux quit (Ping timeout: 240 seconds) |
| 09:03:16 | * | Electrux joined #nim |
| 09:07:48 | * | Electrux quit (Ping timeout: 268 seconds) |
| 09:09:03 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 09:13:00 | * | endragor joined #nim |
| 09:13:12 | FromGitter | <Varriount> @Vindaar It could be to make a sort of one-way type equivalence. The distinct type can be implicitly converted to it's parent, but not the other way around. |
| 09:16:06 | FromGitter | <Vindaar> @Varriount Oh, that's a very good point! |
| 09:17:50 | * | Trustable joined #nim |
| 09:23:11 | * | Electrux joined #nim |
| 09:24:50 | * | endragor quit (Remote host closed the connection) |
| 09:27:57 | * | Electrux quit (Ping timeout: 264 seconds) |
| 09:31:33 | * | xet7 quit (Remote host closed the connection) |
| 09:35:55 | FromGitter | <codenoid> this example just do nothing https://nim-by-example.github.io/types/objects/ |
| 09:38:42 | FromGitter | <codenoid> not that |
| 09:38:49 | * | dddddd quit (Remote host closed the connection) |
| 09:38:51 | FromGitter | <codenoid> this https://nim-by-example.github.io/ |
| 09:39:09 | FromGitter | <codenoid> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b24dabd6b24803e845d0923] |
| 09:42:15 | * | yglukhov[i] quit (Remote host closed the connection) |
| 09:43:12 | * | Electrux joined #nim |
| 09:46:06 | * | arecaceae quit (Remote host closed the connection) |
| 09:46:31 | * | arecaceae joined #nim |
| 09:47:41 | * | Electrux quit (Ping timeout: 256 seconds) |
| 09:53:10 | * | Electrux joined #nim |
| 09:57:57 | * | Electrux quit (Ping timeout: 264 seconds) |
| 10:00:57 | * | Electrux joined #nim |
| 10:19:54 | dom96 | codenoid: You need to type stuff into the terminal |
| 10:21:57 | * | clyybber joined #nim |
| 10:21:57 | FromGitter | <7sDream> does play.nim-lang.org has a place to add the compiler arguments? |
| 10:22:11 | FromGitter | <7sDream> I need `--threads:on` |
| 10:22:22 | dom96 | doesn't look like it :/ |
| 10:23:49 | FromGitter | <7sDream> 😐 |
| 10:25:04 | dom96 | Need to ask zacharycarter to give us that feature :) |
| 10:25:37 | dom96 | rokups: regression perhaps? Make an issue |
| 10:25:57 | FromGitter | <codenoid> i do |
| 10:26:15 | FromGitter | <codenoid> but it's keep does nothing |
| 10:26:31 | dom96 | codenoid: press Ctrl+D |
| 10:27:14 | FromGitter | <codenoid> result on exit ? |
| 10:27:35 | dom96 | not sure what you mean? |
| 10:28:02 | FromGitter | <7sDream> but glot has an old version of Nim, 0.17.2, I can't use strformat in it... :/ |
| 10:29:27 | dom96 | codenoid: Ctrl+D sends EOF (end of file) |
| 10:31:07 | dom96 | I created a PR for this https://github.com/flaviut/nim-by-example/pull/66 |
| 10:38:57 | * | cspar quit (Ping timeout: 245 seconds) |
| 10:51:16 | FromGitter | <codenoid> ✨ |
| 10:53:54 | * | rokups quit (Quit: Connection closed for inactivity) |
| 10:58:22 | * | elrood joined #nim |
| 10:59:38 | * | yglukhov[i] joined #nim |
| 11:04:23 | * | mwbrown quit (Ping timeout: 276 seconds) |
| 11:06:11 | * | xkapastel quit (Quit: Connection closed for inactivity) |
| 11:21:37 | * | rauss quit (Ping timeout: 248 seconds) |
| 11:22:54 | * | yglukhov[i] quit (Remote host closed the connection) |
| 11:31:25 | * | nsf joined #nim |
| 11:33:38 | dom96 | So it seems that the next community survey is due in a week's time |
| 11:36:15 | * | anamok joined #nim |
| 11:36:17 | anamok | hi |
| 11:36:31 | dom96 | hello anamok |
| 11:37:03 | anamok | How to join the elements of a sequence with a separator? In Python: ", ".join(["aa", "bb"]) -> "aa,bb" |
| 11:38:18 | dom96 | !eval import strutils; echo(join(["asd", "foobar"], ",")) |
| 11:38:20 | NimBot | asd,foobar |
| 11:39:31 | anamok | Thanks! Started nim yesterday, love it so far. |
| 11:40:10 | dom96 | No problem. Glad you're loving Nim :) |
| 11:43:53 | FromGitter | <Vindaar> @anamok just FYI, thanks to Nim having uniform function call syntax, you can also do: |
| 11:43:58 | FromGitter | <Vindaar> !eval import strutils; echo(["asd", "foobar"].join(",")) |
| 11:44:01 | NimBot | asd,foobar |
| 11:47:21 | anamok | Interesting to see how flexible this language is. I would have never expected that from a compiled language. |
| 11:49:35 | bevo | @dom96 How long before a new user can post on the forum? I'm still stuck in rank:moderated limbo, my posts don't show... |
| 11:52:08 | dom96 | One of the mods has to notice that you've created a post |
| 11:52:19 | Yardanico | anamok, you might be interested in reading https://narimiran.github.io/nim-basics/ to understand nim's basics |
| 11:52:29 | dom96 | bevo: I just changed your status |
| 11:52:39 | dom96 | s/status/rank/ |
| 11:52:45 | Yardanico | (of course there are other resources but this tutorial this might be the best if you're new to nim) |
| 11:53:09 | Yardanico | s/this tutorial this/this tutorial |
| 11:53:11 | bevo | cheers dom |
| 11:54:36 | bevo | I actually joined 3 weeks ago but gmail flagged my activation email as spam. Tried to activate it once I discovered this (expired), then tried to get another one sent (unknown error), I posted here without reply (think the bridge might have been down then)...ended up deleting that account, but then my gmail address/username was flagged and wouldn't let me rejoin, so I then had to create a new email addy and modified username, which finall |
| 11:56:41 | dom96 | oh :( |
| 11:56:48 | anamok | Yardanico: that's what I'm working on since yesterday :) |
| 11:57:02 | bevo | Yeah, it was all a lost cause after my activation email got sent to spam, no coming back from that :) |
| 11:57:24 | dom96 | gmail has serious trust issues :) |
| 11:57:35 | anamok | Yardanico: excellent intro to the language |
| 11:58:14 | anamok | How stable is Nim? On github I saw there are about 1,300 issues reported. |
| 11:58:18 | dom96 | bevo: I'm not even sure whether the forum has a way to resend an activation email |
| 11:59:11 | Yardanico | anamok, well, there's a lot of open issues in every language's repository :) |
| 11:59:31 | Yardanico | but it's very stable, maybe there may be bugs if you'll use advanced Nim features |
| 11:59:31 | dom96 | anamok: If you stay away from new features (concepts, static[T], destructors, things like that) then it's very stable |
| 12:00:32 | federico3 | anamok: https://nim-lang.org/faq.html |
| 12:01:32 | dom96 | bevo: In any case, apologies. I created an issue for this: https://github.com/nim-lang/nimforum/issues/154 |
| 12:01:46 | dom96 | Hopefully soon I'll have some time to get these little issues sorted (or someone else will :)) |
| 12:02:14 | bevo | All good now Dom, cheers. |
| 12:03:57 | bevo | Hey Dom, would I be able to change my email back to my main one in my profile, or will that break my account as it's associated with a deleted account? |
| 12:04:22 | dom96 | haven't tested this so... it's risky :) |
| 12:04:38 | bevo | hah that's why I haven't tried |
| 12:04:40 | dom96 | Give it a shot though |
| 12:04:54 | dom96 | I don't think there is any way it can break your account |
| 12:05:00 | dom96 | (Famous last words) |
| 12:05:31 | anamok | federico3: read it, thanks |
| 12:06:13 | dom96 | bevo: It should send another activation email |
| 12:06:34 | dom96 | so actually, you probably could have changed your email in your original account to something random |
| 12:06:39 | dom96 | then back to your original as a little hack :) |
| 12:07:11 | bevo | alright if you're sure :) |
| 12:07:32 | dom96 | go for it |
| 12:10:44 | bevo | gahh I'm back to Rank EmailUnconfirmed |
| 12:10:57 | Yardanico | well, you should confirm your new email |
| 12:11:00 | bevo | no email in the spam folder or otherwise |
| 12:11:04 | Yardanico | strange |
| 12:11:08 | dom96 | hm |
| 12:11:22 | dom96 | well don't worry, I can change your rank |
| 12:11:26 | dom96 | but let me check logs first |
| 12:15:04 | dom96 | I can see the activation URL in the logs so it should have sent the email |
| 12:15:26 | bevo | ahh it's sent it to my old email instead |
| 12:16:02 | Yardanico | bevo, that's probably how it should be |
| 12:16:23 | Yardanico | imagine someone else guessed your account password and wanted to change email to his own |
| 12:16:46 | bevo | lets try this then |
| 12:16:56 | dom96 | nah, that's a bug |
| 12:17:05 | Yardanico | dom96, are you sure? |
| 12:17:30 | dom96 | yeah, if somebody guessed your password then sorry, but you're compromised |
| 12:17:54 | anamok | thanks and bye |
| 12:18:12 | * | anamok quit (Quit: Leaving) |
| 12:18:26 | dom96 | Another issue :) |
| 12:19:06 | * | jhorwitz_ joined #nim |
| 12:19:56 | bevo | Ok my email is good now, but I'm back to rank:moderated |
| 12:20:17 | dom96 | yeah, just changed it for you |
| 12:21:01 | bevo | ahh beautiful, all done! Cheers again Dom, sorry to be a pain |
| 12:21:46 | dom96 | Not a pain at all. The forum should have worked :) |
| 12:23:49 | federico3 | dom96: the "Reset your password" feature leaks if an email address is found or not |
| 12:23:50 | * | jhorwitz_ quit (Ping timeout: 260 seconds) |
| 12:25:05 | dom96 | Why is that a problem? |
| 12:25:37 | dom96 | It's easy to forget if you registered, so getting that feedback is useful when resetting a password |
| 12:25:50 | bevo | Hey Dom just to note, that activation email went to my spam folder on the other gmail account also |
| 12:26:16 | Yardanico | bevo, gmail is very picky when it comes to custom smtp servers |
| 12:26:37 | bevo | not a go thing then :) |
| 12:26:42 | federico3 | for the Nim forum is not going to be a real issue, but in general you don't want to allow an attacker to scan an email address against a list of known websites and find where there are accounts |
| 12:26:49 | bevo | *golang envy |
| 12:26:59 | Yardanico | dom96, did you try to use https://support.google.com/mail/answer/81126 ? |
| 12:27:03 | Yardanico | postmaster tools |
| 12:27:10 | dom96 | Yes |
| 12:27:20 | dom96 | Data doesn't show up until you're sending 100 emails per day |
| 12:29:10 | * | cspar joined #nim |
| 12:36:14 | dom96 | https://forum.nim-lang.org/t/3930 |
| 12:39:35 | * | jhorwitz_ joined #nim |
| 12:44:17 | * | jhorwitz_ quit (Ping timeout: 260 seconds) |
| 12:52:22 | * | Vladar quit (Quit: Leaving) |
| 12:54:46 | * | find0x90 joined #nim |
| 13:00:33 | * | jhorwitz_ joined #nim |
| 13:05:07 | * | jhorwitz_ quit (Ping timeout: 260 seconds) |
| 13:18:11 | * | data-man joined #nim |
| 13:20:51 | * | GustavoLapasta joined #nim |
| 13:24:51 | * | miran joined #nim |
| 13:28:43 | * | find0x90_ joined #nim |
| 13:29:05 | * | find0x90 quit (Ping timeout: 240 seconds) |
| 13:41:33 | * | jhorwitz_ joined #nim |
| 13:41:43 | * | mzigora joined #nim |
| 13:46:05 | * | jhorwitz_ quit (Ping timeout: 260 seconds) |
| 13:46:20 | * | captainbland joined #nim |
| 13:48:17 | captainbland | Hi, question: if you're using getType for an overloaded proc (for instance), it always seems to give you the type for whichever instance was declared first. Is there a way to get the types for all of the overloads? |
| 13:49:11 | captainbland | *whichever proc was declared first, sorry |
| 13:53:53 | * | find0x90_ quit (Quit: find0x90_) |
| 13:59:23 | * | gangstacat quit (Quit: Ĝis!) |
| 14:04:38 | * | revere joined #nim |
| 14:14:14 | * | dddddd joined #nim |
| 14:17:53 | dom96 | captainbland: try getTypeImpl and getTypeInst |
| 14:18:04 | dom96 | might help |
| 14:18:27 | dom96 | although I guess it will still give just one type |
| 14:19:04 | dom96 | so this might not be possible currently |
| 14:20:18 | * | jhorwitz_ joined #nim |
| 14:20:23 | * | mwbrown joined #nim |
| 14:22:31 | * | mjanssen joined #nim |
| 14:25:23 | * | jhorwitz_ quit (Ping timeout: 268 seconds) |
| 14:35:35 | FromGitter | <mratsim> @captainbland, you can complain here: https://github.com/nim-lang/Nim/issues/7719 |
| 14:36:14 | FromGitter | <mratsim> your issue is probably related to this: https://github.com/nim-lang/Nim/issues/7737 |
| 14:40:31 | captainbland | Thanks for getting back. Yeah getTypeImpl/Inst both don't seem to work for this use case. Basically I just want to only compile in calls to proc calls with a particular parameter/return type. |
| 14:41:18 | * | jhorwitz_ joined #nim |
| 14:41:19 | * | yglukhov[i] joined #nim |
| 14:41:34 | captainbland | not calls to proc calls, just proc calls. I can't type today. |
| 14:43:21 | captainbland | anyway, I'll abandon this approach for now and try something else. Thanks |
| 14:45:49 | * | yglukhov[i] quit (Ping timeout: 265 seconds) |
| 14:45:57 | * | jhorwitz_ quit (Ping timeout: 264 seconds) |
| 14:47:28 | FromGitter | <mratsim> maybe if you check the symbol and getImpl you can get a list of OpenSymChoice, one for each overload? |
| 14:59:35 | captainbland | I've tried that, although I think maybe I don't understand fully what I'm doing... For now I'm going to try something taking advantage of when and compiles like this: https://gist.github.com/captainbland/bbdca077f95fcf85c63bcb5e3bd5a561 |
| 15:03:29 | * | GustavoLapasta quit (Quit: Leaving) |
| 15:07:34 | * | mzigora quit (Ping timeout: 264 seconds) |
| 15:09:25 | * | Sembei quit (Ping timeout: 245 seconds) |
| 15:09:32 | * | MyMind joined #nim |
| 15:11:52 | * | xet7 joined #nim |
| 15:12:29 | captainbland | I've tried that, although I think maybe I don't understand fully what I'm doing... For now I'm going to try something taking advantage of when and compiles like this: https://gist.github.com/captainbland/bbdca077f95fcf85c63bcb5e3bd5a561 |
| 15:12:32 | captainbland | oops sorry |
| 15:29:10 | * | Electrux quit (Ping timeout: 264 seconds) |
| 15:33:13 | * | Electrux joined #nim |
| 15:37:38 | * | Electrux quit (Ping timeout: 256 seconds) |
| 15:53:06 | * | jhorwitz_ joined #nim |
| 15:53:12 | * | Electrux joined #nim |
| 15:57:19 | * | zahary joined #nim |
| 15:57:43 | * | Electrux quit (Ping timeout: 256 seconds) |
| 15:58:35 | * | jhorwitz_ quit (Ping timeout: 240 seconds) |
| 15:59:05 | captainbland | Yeah the when(compiles(the thing I'm about to do)) thing seems to work pretty well for my use case it turns out. |
| 16:03:36 | * | abm joined #nim |
| 16:05:48 | * | abm quit (Client Quit) |
| 16:10:58 | dom96 | awesome |
| 16:11:27 | * | yglukhov[i] joined #nim |
| 16:13:03 | * | breakfast1 joined #nim |
| 16:15:31 | * | breakfast1 quit (Client Quit) |
| 16:15:33 | * | breakfast1_ joined #nim |
| 16:15:36 | * | breakfast1_ quit (Remote host closed the connection) |
| 16:15:50 | * | breakfast1 joined #nim |
| 16:16:30 | * | breakfast1 quit (Client Quit) |
| 16:16:37 | * | breakfast1 joined #nim |
| 16:17:17 | * | breakfast1 quit (Client Quit) |
| 16:17:25 | * | breakfast1 joined #nim |
| 16:18:49 | * | breakfast1 quit (Client Quit) |
| 16:19:07 | * | breakfast1 joined #nim |
| 16:20:13 | * | nsf quit (Quit: WeeChat 2.1) |
| 16:23:22 | * | Electrux joined #nim |
| 16:27:48 | * | Electrux quit (Ping timeout: 265 seconds) |
| 16:35:46 | * | rauss joined #nim |
| 16:39:42 | FromGitter | <mratsim> I use this hack to test if something returns void as well >_> |
| 16:40:02 | FromGitter | <mratsim> because type void doesn’t work in many cases |
| 16:42:52 | * | krux02 joined #nim |
| 16:43:12 | * | Electrux joined #nim |
| 16:48:02 | * | Electrux quit (Ping timeout: 256 seconds) |
| 16:50:56 | * | Vladar joined #nim |
| 16:55:52 | * | breakfast1 quit (Quit: Leaving) |
| 16:59:10 | * | zahary quit (Read error: Connection reset by peer) |
| 16:59:22 | * | zahary joined #nim |
| 16:59:44 | * | xkapastel joined #nim |
| 17:01:53 | * | yglukhov[i] quit (Remote host closed the connection) |
| 17:06:43 | * | yglukhov[i] joined #nim |
| 17:19:31 | * | PMunch joined #nim |
| 17:42:14 | * | Electrux joined #nim |
| 17:46:27 | * | Electrux quit (Ping timeout: 245 seconds) |
| 17:56:05 | * | clyybber quit (Ping timeout: 245 seconds) |
| 17:57:20 | * | miran quit (Ping timeout: 245 seconds) |
| 18:08:41 | * | Electrux joined #nim |
| 18:18:36 | * | breakfast1 joined #nim |
| 18:32:38 | * | nsf joined #nim |
| 18:57:23 | * | yglukhov[i] quit (Remote host closed the connection) |
| 19:04:35 | FromGitter | <ephja> it's always fun to try to make sense of the sigmatch compiler module |
| 19:08:24 | * | Vladar quit (Quit: Leaving) |
| 19:29:20 | * | nsf quit (Quit: WeeChat 2.1) |
| 19:29:28 | * | Perkol joined #nim |
| 19:31:07 | Perkol | Hello. Does anyone have example of copy file function which reads\writes in chunks? |
| 19:31:10 | * | zahary quit (Quit: Leaving.) |
| 19:33:36 | * | yglukhov[i] joined #nim |
| 19:33:40 | * | yglukhov[i] quit (Remote host closed the connection) |
| 19:33:54 | * | yglukhov[i] joined #nim |
| 19:38:41 | * | cspar quit (Ping timeout: 248 seconds) |
| 19:43:45 | Perkol | How do I create untyped buffer for streams.readData ? |
| 19:48:16 | * | hcorion joined #nim |
| 19:48:25 | hcorion | woah, when did nim get a debugger |
| 19:58:27 | Yardanico | hcorion, ? |
| 20:03:48 | hcorion | nim c --debugger:on actually works, last I checked it didn't really do anything |
| 20:16:12 | dom96 | Perkol: You're likely better off using `streams.readStr` |
| 20:18:13 | * | zahary joined #nim |
| 20:24:42 | * | breakfast1 quit (Quit: Leaving) |
| 20:30:22 | * | zahary quit (Quit: Leaving.) |
| 20:47:43 | * | Electrux quit (Ping timeout: 268 seconds) |
| 20:47:48 | Perkol | But im reading binary file |
| 20:49:19 | dom96 | Perkol: strings can hold binary data |
| 20:51:24 | Yardanico | Perkol, string is just a sequence of bytes, does that make sense for you? :) |
| 20:51:47 | Yardanico | but yeah, use streams for reading binary stuff |
| 20:53:43 | * | SunDwarf is now known as Eyes |
| 20:56:59 | Yardanico | By the way, from https://forum.nim-lang.org/t/3932 - why -d:nodejs implicitly chooses JS backend? IMO it's wrong |
| 20:57:35 | dom96 | does it? |
| 20:57:49 | dom96 | It's really not that important though |
| 20:57:57 | dom96 | -d:nodejs is only there for testing |
| 20:58:18 | Yardanico | well, I'm sorry, it doesn't, but it prints "Error: system module needs: process.exit" if I run "nim c -d:nodejs" |
| 21:00:47 | dom96 | feel free to add an {.error: "-d:nodejs only available for JS backend".} somewhere |
| 21:03:15 | * | Electrux joined #nim |
| 21:04:57 | * | nsf joined #nim |
| 21:07:27 | * | Electrux quit (Ping timeout: 240 seconds) |
| 21:11:06 | Perkol | Got error: https://bpaste.net/show/dfcd714619cf |
| 21:11:43 | Perkol | Isn't newFileStream supposed to return Stream |
| 21:12:33 | FromGitter | <ephja> does it matter? |
| 21:12:46 | * | Trustable quit (Remote host closed the connection) |
| 21:15:29 | FromGitter | <ephja> it should work if you convert it to a Stream |
| 21:22:31 | Perkol | But newFileStream works with readLine, why it wont wont with readStr |
| 21:22:32 | Perkol | ? |
| 21:23:24 | dom96 | Perkol: The problem isn't FileStream vs. Stream |
| 21:23:33 | dom96 | It's that you're passing a string and a buffer size |
| 21:23:37 | dom96 | readStr returns a string |
| 21:27:43 | Perkol | But i need to pass length of the string im reading? https://nim-lang.org/docs/streams.html#readStr |
| 21:28:12 | FromGitter | <ephja> oh oops |
| 21:29:04 | dom96 | Perkol: readStr takes an int and returns a string |
| 21:29:09 | dom96 | it does not return a bool |
| 21:29:48 | Perkol | Yeah, i see, sorry |
| 21:31:00 | Perkol | Thanks for help |
| 21:32:55 | * | Perkol quit (Quit: Leaving) |
| 21:35:40 | * | yglukhov[i] quit (Remote host closed the connection) |
| 21:38:44 | * | data-man quit (Quit: Konversation terminated!) |
| 21:41:50 | * | smt` joined #nim |
| 21:45:37 | * | smt quit (Ping timeout: 248 seconds) |
| 21:50:12 | Notkea | hello, I'm having some troubles using the pcre wrapper on nixos: the compiled program seems unable to find libpcre.so(.3|.1|) |
| 21:51:14 | Notkea | I tried setting rpath with --passL and using patchelf, with no success |
| 21:53:22 | Notkea | is there any way to give a custom path to the linker? beside PCRE, all other dynamically loaded libraries seem to be found without any effort |
| 21:53:52 | * | Electrux joined #nim |
| 21:58:33 | * | Electrux quit (Ping timeout: 264 seconds) |
| 21:58:35 | FromGitter | <Varriount> Notkea: What do you mean by a custom path? |
| 22:00:07 | FromGitter | <Varriount> Is the pcre dll in your library path? |
| 22:01:21 | dom96 | Notkea: Do you have a libpcre.so on your system? |
| 22:01:25 | dom96 | and in your PATH? |
| 22:02:21 | Notkea | I indeed have /nix/store/i75nslvdx1sk1p7rk0944x48spwdz3r0-pcre-8.41/lib/libpcre.so.1 |
| 22:03:05 | Notkea | I tried to put it in rpath |
| 22:03:13 | * | Electrux joined #nim |
| 22:06:15 | Notkea | `ldd my-binary` does list libc.so and other .so (with their correct respective paths) but not libpcre.so |
| 22:08:04 | * | Electrux quit (Ping timeout: 265 seconds) |
| 22:08:52 | FromGitter | <ephja> tuple assignment can be overloaded? |
| 22:11:38 | FromGitter | <ephja> I dunno if it's an internal thing. I'll have to check |
| 22:12:10 | * | Electrux joined #nim |
| 22:12:33 | dom96 | Notkea: Try adding that to your LD_LIBRARY_PATH |
| 22:12:45 | dom96 | (the directory that contains it) |
| 22:13:04 | dom96 | Ordinarily this would be in /usr/share/lib or something |
| 22:13:15 | dom96 | NixOS must have some custom way of handling this |
| 22:17:05 | * | Electrux quit (Ping timeout: 260 seconds) |
| 22:22:14 | * | Electrux joined #nim |
| 22:22:49 | FromGitter | <mratsim> ugh, use readData to read binary stuff, don’t subvert string >_> |
| 22:23:53 | FromGitter | <mratsim> @Perkol here is an example of using readData - https://github.com/mratsim/Arraymancer/blob/master/src/datasets/mnist.nim#L84 |
| 22:24:12 | FromGitter | <mratsim> the binary format is explained a couple of lines before |
| 22:25:15 | FromGitter | <mratsim> and here is another example of a more complicated format (Numpy) - https://github.com/mratsim/Arraymancer/blob/master/src/io/io_npy.nim#L85 |
| 22:26:13 | dom96 | So the solution to reading binary data is to use an untyped pointer? |
| 22:26:27 | * | Electrux quit (Ping timeout: 240 seconds) |
| 22:26:41 | dom96 | What's wrong with using a string? |
| 22:29:48 | FromGitter | <mratsim> stringsare for printable chars, binary blobs should be handled in a separate type. This is the discussion we hade here - https://github.com/nim-lang/Nim/issues/7337#issuecomment-374648282 |
| 22:30:31 | FromGitter | <mratsim> had* |
| 22:31:42 | dom96 | Yes, I am aware. But using readData is far worse, it's not memory safe. |
| 22:32:46 | FromGitter | <mratsim> I think this PR should address that: https://github.com/nim-lang/Nim/pull/7481 |
| 22:34:41 | Notkea | still no luck with LD_LIBRARY_PATH |
| 22:35:16 | * | xet7 quit (Quit: Leaving) |
| 22:35:16 | dom96 | We need something to address it, and IMO we need to hide every public procedure that uses `pointer` behind a "unsafe" section to discourage its use |
| 22:35:47 | FromGitter | <ephja> Notkea: did you add just the directory? if so then maybe it's not compatible or something |
| 22:35:48 | Notkea | -d:nimDebugDlOpen shows "libpcre.so.{,1,3}: cannot open shared object file: No such file or directory" |
| 22:35:56 | dom96 | But the fact is that right now there is no way to get a seq[byte] out of a Stream. |
| 22:35:58 | FromGitter | <mratsim> as long as cast isn’t suddenly called “transmute” I’m fine with that :P |
| 22:35:59 | Notkea | yep I added it |
| 22:36:36 | FromGitter | <mratsim> but yead read bytes would be nice |
| 22:36:39 | FromGitter | <mratsim> yeah* |
| 22:37:04 | * | rockcavera quit (Remote host closed the connection) |
| 22:37:21 | Notkea | oh it might be the wrong one, trying again |
| 22:38:48 | * | jhorwitz_ joined #nim |
| 22:47:06 | FromGitter | <ephja> if Nim doesn't use the same loading mechanism then maybe the shared library won't be listed as a dependency |
| 22:48:14 | dom96 | Nim uses dlsym to load these libraries AFAIK |
| 22:50:22 | FromGitter | <ephja> I guess you need to add metadata for it to be listed by ldd |
| 22:51:20 | Notkea | sorry for the delay, it's still unable to find libpcre.so even with LD_LIBRARY_PATH |
| 22:51:43 | Notkea | I've put pcre in the environment manually too |
| 22:52:11 | Notkea | because it's not detected by either `ldd` or `patchelf --print-needed` |
| 22:54:22 | * | Electrux joined #nim |
| 22:55:27 | * | jhorwitz_ quit (Ping timeout: 240 seconds) |
| 22:58:32 | * | Electrux quit (Ping timeout: 245 seconds) |
| 23:00:31 | FromGitter | <ephja> I don't think -l is passed to GCC when the dynlib pragma is used |
| 23:01:34 | FromGitter | <ephja> so it's not going to be listed if I'm not mistaken |
| 23:02:21 | Notkea | let's try with --dynlibOverride then |
| 23:03:14 | FromGitter | <data-man> @Perkol ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b25973232618e705ec0852d] |
| 23:05:44 | FromGitter | <ephja> Notkea: ok but if it's not added to the header then that means it's not necessary, though it does makes it harder to diagnose these issues |
| 23:06:24 | Notkea | `--dynlibOverride` gives a lot of "undefined reference" weirdly :/ |
| 23:08:26 | * | hcorion quit (Quit: Konversation terminated!) |
| 23:08:29 | FromGitter | <ephja> do other libs work? |
| 23:09:12 | * | nsf quit (Quit: WeeChat 2.1) |
| 23:09:13 | dom96 | Notkea: Maybe you could ask #nixos or whatever the appropriate IRC is? |
| 23:09:25 | Notkea | libm, librt, libdl, libc do work, and are listed through ldd and patchelf |
| 23:10:22 | Notkea | I'll ask them too |
| 23:10:30 | FromGitter | <ephja> have you passed them to 'file' etc? |
| 23:10:35 | FromGitter | <ephja> and compared |
| 23:11:38 | Notkea | what do you mean by passing them to file and comparing? |
| 23:12:16 | * | elrood quit (Quit: Leaving) |
| 23:14:23 | dom96 | ldd won't show this .so |
| 23:14:30 | dom96 | It's loaded at runtime |
| 23:17:55 | FromGitter | <ephja> isn't metadata added with -l? |
| 23:22:36 | Notkea | I'm trying with `-l` |
| 23:22:49 | Notkea | what surprises me is that patching RPATH has no effect |
| 23:36:14 | * | yglukhov[i] joined #nim |
| 23:41:09 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
| 23:41:56 | * | krux02 quit (Remote host closed the connection) |
| 23:42:29 | Notkea | simply adding `-l:"-lpcre"` works |
| 23:46:45 | Notkea | adding that flag allows patchelf to see the dependency over libpcre |
| 23:48:07 | * | krux02 joined #nim |