<< 16-06-2018 >>

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:29FromGitter<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:54carterza[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:45jhorwitz_Morning all
02:26:55jhorwitz_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:45FromDiscord<pudarida> hello there
02:48:05FromDiscord<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:42FromGitter<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:58FromGitter<Varriount> Pudarida: Hi
03:29:22FromGitter<Varriount> @codenoid It's quiet right now, most of the main people are asleep.
03:29:49FromDiscord<pudarida> Hmm, what's the difference between .nims and .cfg?
03:33:34FromGitter<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:46FromGitter<Varriount> `.cfg` is older. `.nims` is newer.
03:34:30FromDiscord<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:16jhorwitz_Just have to say, nim forum experience is incredibly smooth, very nice site.
03:50:27*abm quit (Ping timeout: 240 seconds)
03:52:09FromDiscord<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:41FromGitter<Varriount> emekoi: You passed that exact symbol, "useRealtimeGC"?
04:09:11FromGitter<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:29FromGitter<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:40FromGitter<zacharycarter> ugh my internet connection is so bad
04:36:43FromGitter<zacharycarter> VM is not built with 'gorge' support - any ideas?
05:21:50*miran joined #nim
05:29:30Araqzacharycarter: -d:nimcore in your build
05:49:13FromGitter<zacharycarter> thanks
05:50:33FromGitter<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:29FromGitter<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:07FromGitter<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:28FromGitter<rokups> `lib/system.nim(3591, 33)` line uses int index though
07:54:18FromGitter<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:35FromGitter<Vindaar> I haven't used converters so I'm not entirely sure how they work and what they imply
07:54:50FromGitter<rokups> given this situation it seems that if converter exists then compiler tries to apply it regardless. that does not make sense
07:55:09FromGitter<Vindaar> Yeah, that is indeed weird
08:04:19FromGitter<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:32FromGitter<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:26FromGitter<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:34FromGitter<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:25FromGitter<Vindaar> ahh, that makes sense. :)
08:56:48FromGitter<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:12FromGitter<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:06FromGitter<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:55FromGitter<codenoid> this example just do nothing https://nim-by-example.github.io/types/objects/
09:38:42FromGitter<codenoid> not that
09:38:49*dddddd quit (Remote host closed the connection)
09:38:51FromGitter<codenoid> this https://nim-by-example.github.io/
09:39:09FromGitter<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:54dom96codenoid: You need to type stuff into the terminal
10:21:57*clyybber joined #nim
10:21:57FromGitter<7sDream> does play.nim-lang.org has a place to add the compiler arguments?
10:22:11FromGitter<7sDream> I need `--threads:on`
10:22:22dom96doesn't look like it :/
10:23:49FromGitter<7sDream> 😐
10:25:04dom96Need to ask zacharycarter to give us that feature :)
10:25:37dom96rokups: regression perhaps? Make an issue
10:25:57FromGitter<codenoid> i do
10:26:15FromGitter<codenoid> but it's keep does nothing
10:26:31dom96codenoid: press Ctrl+D
10:27:14FromGitter<codenoid> result on exit ?
10:27:35dom96not sure what you mean?
10:28:02FromGitter<7sDream> but glot has an old version of Nim, 0.17.2, I can't use strformat in it... :/
10:29:27dom96codenoid: Ctrl+D sends EOF (end of file)
10:31:07dom96I 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:16FromGitter<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:38dom96So it seems that the next community survey is due in a week's time
11:36:15*anamok joined #nim
11:36:17anamokhi
11:36:31dom96hello anamok
11:37:03anamokHow to join the elements of a sequence with a separator? In Python: ", ".join(["aa", "bb"]) -> "aa,bb"
11:38:18dom96!eval import strutils; echo(join(["asd", "foobar"], ","))
11:38:20NimBotasd,foobar
11:39:31anamokThanks! Started nim yesterday, love it so far.
11:40:10dom96No problem. Glad you're loving Nim :)
11:43:53FromGitter<Vindaar> @anamok just FYI, thanks to Nim having uniform function call syntax, you can also do:
11:43:58FromGitter<Vindaar> !eval import strutils; echo(["asd", "foobar"].join(","))
11:44:01NimBotasd,foobar
11:47:21anamokInteresting to see how flexible this language is. I would have never expected that from a compiled language.
11:49:35bevo@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:08dom96One of the mods has to notice that you've created a post
11:52:19Yardanicoanamok, you might be interested in reading https://narimiran.github.io/nim-basics/ to understand nim's basics
11:52:29dom96bevo: I just changed your status
11:52:39dom96s/status/rank/
11:52:45Yardanico(of course there are other resources but this tutorial this might be the best if you're new to nim)
11:53:09Yardanicos/this tutorial this/this tutorial
11:53:11bevocheers dom
11:54:36bevoI 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:41dom96oh :(
11:56:48anamokYardanico: that's what I'm working on since yesterday :)
11:57:02bevoYeah, it was all a lost cause after my activation email got sent to spam, no coming back from that :)
11:57:24dom96gmail has serious trust issues :)
11:57:35anamokYardanico: excellent intro to the language
11:58:14anamokHow stable is Nim? On github I saw there are about 1,300 issues reported.
11:58:18dom96bevo: I'm not even sure whether the forum has a way to resend an activation email
11:59:11Yardanicoanamok, well, there's a lot of open issues in every language's repository :)
11:59:31Yardanicobut it's very stable, maybe there may be bugs if you'll use advanced Nim features
11:59:31dom96anamok: If you stay away from new features (concepts, static[T], destructors, things like that) then it's very stable
12:00:32federico3anamok: https://nim-lang.org/faq.html
12:01:32dom96bevo: In any case, apologies. I created an issue for this: https://github.com/nim-lang/nimforum/issues/154
12:01:46dom96Hopefully soon I'll have some time to get these little issues sorted (or someone else will :))
12:02:14bevoAll good now Dom, cheers.
12:03:57bevoHey 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:22dom96haven't tested this so... it's risky :)
12:04:38bevohah that's why I haven't tried
12:04:40dom96Give it a shot though
12:04:54dom96I don't think there is any way it can break your account
12:05:00dom96(Famous last words)
12:05:31anamokfederico3: read it, thanks
12:06:13dom96bevo: It should send another activation email
12:06:34dom96so actually, you probably could have changed your email in your original account to something random
12:06:39dom96then back to your original as a little hack :)
12:07:11bevoalright if you're sure :)
12:07:32dom96go for it
12:10:44bevogahh I'm back to Rank EmailUnconfirmed
12:10:57Yardanicowell, you should confirm your new email
12:11:00bevono email in the spam folder or otherwise
12:11:04Yardanicostrange
12:11:08dom96hm
12:11:22dom96well don't worry, I can change your rank
12:11:26dom96but let me check logs first
12:15:04dom96I can see the activation URL in the logs so it should have sent the email
12:15:26bevoahh it's sent it to my old email instead
12:16:02Yardanicobevo, that's probably how it should be
12:16:23Yardanicoimagine someone else guessed your account password and wanted to change email to his own
12:16:46bevolets try this then
12:16:56dom96nah, that's a bug
12:17:05Yardanicodom96, are you sure?
12:17:30dom96yeah, if somebody guessed your password then sorry, but you're compromised
12:17:54anamokthanks and bye
12:18:12*anamok quit (Quit: Leaving)
12:18:26dom96Another issue :)
12:19:06*jhorwitz_ joined #nim
12:19:56bevoOk my email is good now, but I'm back to rank:moderated
12:20:17dom96yeah, just changed it for you
12:21:01bevoahh beautiful, all done! Cheers again Dom, sorry to be a pain
12:21:46dom96Not a pain at all. The forum should have worked :)
12:23:49federico3dom96: 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:05dom96Why is that a problem?
12:25:37dom96It's easy to forget if you registered, so getting that feedback is useful when resetting a password
12:25:50bevoHey Dom just to note, that activation email went to my spam folder on the other gmail account also
12:26:16Yardanicobevo, gmail is very picky when it comes to custom smtp servers
12:26:37bevonot a go thing then :)
12:26:42federico3for 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:49bevo*golang envy
12:26:59Yardanicodom96, did you try to use https://support.google.com/mail/answer/81126 ?
12:27:03Yardanicopostmaster tools
12:27:10dom96Yes
12:27:20dom96Data doesn't show up until you're sending 100 emails per day
12:29:10*cspar joined #nim
12:36:14dom96https://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:17captainblandHi, 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:11captainbland*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:53dom96captainbland: try getTypeImpl and getTypeInst
14:18:04dom96might help
14:18:27dom96although I guess it will still give just one type
14:19:04dom96so 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:35FromGitter<mratsim> @captainbland, you can complain here: https://github.com/nim-lang/Nim/issues/7719
14:36:14FromGitter<mratsim> your issue is probably related to this: https://github.com/nim-lang/Nim/issues/7737
14:40:31captainblandThanks 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:34captainblandnot calls to proc calls, just proc calls. I can't type today.
14:43:21captainblandanyway, 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:28FromGitter<mratsim> maybe if you check the symbol and getImpl you can get a list of OpenSymChoice, one for each overload?
14:59:35captainblandI'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:29captainblandI'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:32captainblandoops 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:05captainblandYeah 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:58dom96awesome
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:42FromGitter<mratsim> I use this hack to test if something returns void as well >_>
16:40:02FromGitter<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:35FromGitter<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:07PerkolHello. 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:45PerkolHow do I create untyped buffer for streams.readData ?
19:48:16*hcorion joined #nim
19:48:25hcorionwoah, when did nim get a debugger
19:58:27Yardanicohcorion, ?
20:03:48hcorionnim c --debugger:on actually works, last I checked it didn't really do anything
20:16:12dom96Perkol: 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:48PerkolBut im reading binary file
20:49:19dom96Perkol: strings can hold binary data
20:51:24YardanicoPerkol, string is just a sequence of bytes, does that make sense for you? :)
20:51:47Yardanicobut yeah, use streams for reading binary stuff
20:53:43*SunDwarf is now known as Eyes
20:56:59YardanicoBy the way, from https://forum.nim-lang.org/t/3932 - why -d:nodejs implicitly chooses JS backend? IMO it's wrong
20:57:35dom96does it?
20:57:49dom96It's really not that important though
20:57:57dom96-d:nodejs is only there for testing
20:58:18Yardanicowell, I'm sorry, it doesn't, but it prints "Error: system module needs: process.exit" if I run "nim c -d:nodejs"
21:00:47dom96feel 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:06PerkolGot error: https://bpaste.net/show/dfcd714619cf
21:11:43PerkolIsn't newFileStream supposed to return Stream
21:12:33FromGitter<ephja> does it matter?
21:12:46*Trustable quit (Remote host closed the connection)
21:15:29FromGitter<ephja> it should work if you convert it to a Stream
21:22:31PerkolBut newFileStream works with readLine, why it wont wont with readStr
21:22:32Perkol?
21:23:24dom96Perkol: The problem isn't FileStream vs. Stream
21:23:33dom96It's that you're passing a string and a buffer size
21:23:37dom96readStr returns a string
21:27:43PerkolBut i need to pass length of the string im reading? https://nim-lang.org/docs/streams.html#readStr
21:28:12FromGitter<ephja> oh oops
21:29:04dom96Perkol: readStr takes an int and returns a string
21:29:09dom96it does not return a bool
21:29:48PerkolYeah, i see, sorry
21:31:00PerkolThanks 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:12Notkeahello, I'm having some troubles using the pcre wrapper on nixos: the compiled program seems unable to find libpcre.so(.3|.1|)
21:51:14NotkeaI tried setting rpath with --passL and using patchelf, with no success
21:53:22Notkeais 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:35FromGitter<Varriount> Notkea: What do you mean by a custom path?
22:00:07FromGitter<Varriount> Is the pcre dll in your library path?
22:01:21dom96Notkea: Do you have a libpcre.so on your system?
22:01:25dom96and in your PATH?
22:02:21NotkeaI indeed have /nix/store/i75nslvdx1sk1p7rk0944x48spwdz3r0-pcre-8.41/lib/libpcre.so.1
22:03:05NotkeaI tried to put it in rpath
22:03:13*Electrux joined #nim
22:06:15Notkea`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:52FromGitter<ephja> tuple assignment can be overloaded?
22:11:38FromGitter<ephja> I dunno if it's an internal thing. I'll have to check
22:12:10*Electrux joined #nim
22:12:33dom96Notkea: Try adding that to your LD_LIBRARY_PATH
22:12:45dom96(the directory that contains it)
22:13:04dom96Ordinarily this would be in /usr/share/lib or something
22:13:15dom96NixOS 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:49FromGitter<mratsim> ugh, use readData to read binary stuff, don’t subvert string >_>
22:23:53FromGitter<mratsim> @Perkol here is an example of using readData - https://github.com/mratsim/Arraymancer/blob/master/src/datasets/mnist.nim#L84
22:24:12FromGitter<mratsim> the binary format is explained a couple of lines before
22:25:15FromGitter<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:13dom96So the solution to reading binary data is to use an untyped pointer?
22:26:27*Electrux quit (Ping timeout: 240 seconds)
22:26:41dom96What's wrong with using a string?
22:29:48FromGitter<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:31FromGitter<mratsim> had*
22:31:42dom96Yes, I am aware. But using readData is far worse, it's not memory safe.
22:32:46FromGitter<mratsim> I think this PR should address that: https://github.com/nim-lang/Nim/pull/7481
22:34:41Notkeastill no luck with LD_LIBRARY_PATH
22:35:16*xet7 quit (Quit: Leaving)
22:35:16dom96We 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:47FromGitter<ephja> Notkea: did you add just the directory? if so then maybe it's not compatible or something
22:35:48Notkea-d:nimDebugDlOpen shows "libpcre.so.{,1,3}: cannot open shared object file: No such file or directory"
22:35:56dom96But the fact is that right now there is no way to get a seq[byte] out of a Stream.
22:35:58FromGitter<mratsim> as long as cast isn’t suddenly called “transmute” I’m fine with that :P
22:35:59Notkeayep I added it
22:36:36FromGitter<mratsim> but yead read bytes would be nice
22:36:39FromGitter<mratsim> yeah*
22:37:04*rockcavera quit (Remote host closed the connection)
22:37:21Notkeaoh it might be the wrong one, trying again
22:38:48*jhorwitz_ joined #nim
22:47:06FromGitter<ephja> if Nim doesn't use the same loading mechanism then maybe the shared library won't be listed as a dependency
22:48:14dom96Nim uses dlsym to load these libraries AFAIK
22:50:22FromGitter<ephja> I guess you need to add metadata for it to be listed by ldd
22:51:20Notkeasorry for the delay, it's still unable to find libpcre.so even with LD_LIBRARY_PATH
22:51:43NotkeaI've put pcre in the environment manually too
22:52:11Notkeabecause 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:31FromGitter<ephja> I don't think -l is passed to GCC when the dynlib pragma is used
23:01:34FromGitter<ephja> so it's not going to be listed if I'm not mistaken
23:02:21Notkealet's try with --dynlibOverride then
23:03:14FromGitter<data-man> @Perkol ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b25973232618e705ec0852d]
23:05:44FromGitter<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:24Notkea`--dynlibOverride` gives a lot of "undefined reference" weirdly :/
23:08:26*hcorion quit (Quit: Konversation terminated!)
23:08:29FromGitter<ephja> do other libs work?
23:09:12*nsf quit (Quit: WeeChat 2.1)
23:09:13dom96Notkea: Maybe you could ask #nixos or whatever the appropriate IRC is?
23:09:25Notkealibm, librt, libdl, libc do work, and are listed through ldd and patchelf
23:10:22NotkeaI'll ask them too
23:10:30FromGitter<ephja> have you passed them to 'file' etc?
23:10:35FromGitter<ephja> and compared
23:11:38Notkeawhat do you mean by passing them to file and comparing?
23:12:16*elrood quit (Quit: Leaving)
23:14:23dom96ldd won't show this .so
23:14:30dom96It's loaded at runtime
23:17:55FromGitter<ephja> isn't metadata added with -l?
23:22:36NotkeaI'm trying with `-l`
23:22:49Notkeawhat 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:29Notkeasimply adding `-l:"-lpcre"` works
23:46:45Notkeaadding that flag allows patchelf to see the dependency over libpcre
23:48:07*krux02 joined #nim