<< 23-02-2019 >>

00:00:35*smitop joined #nim
00:03:38*noeontheend quit (Ping timeout: 255 seconds)
00:16:23FromGitter<Varriount> @iffy I'm curious - what are you trying to achieve?
00:35:25*noeontheend joined #nim
00:37:52*abm joined #nim
00:50:04smitophow do i convert a `seq[byte]` to a pointer to a carray?
00:51:24*oculux quit (Ping timeout: 250 seconds)
00:55:26*aguspiza quit (Ping timeout: 272 seconds)
00:58:32*rockcavera quit (Remote host closed the connection)
01:07:08*rockcavera joined #nim
01:08:37FromDiscord<demotomohiro> @smitop, var s = @[1]; addr s[0]
01:08:40*oculux joined #nim
01:13:08*oculux quit (Ping timeout: 246 seconds)
01:14:44*noeontheend quit (Ping timeout: 255 seconds)
01:18:37FromDiscord<demotomohiro> vccexe is a program to Nim can call cl.exe even if it is not running on Visual Studio Command Prompt.
01:18:37FromDiscord<demotomohiro> But it doesn't support msvc 2017.
01:22:45*oculux joined #nim
01:30:38*oculux quit (Ping timeout: 246 seconds)
01:32:30*oculux joined #nim
02:04:16*oculuxe joined #nim
02:04:35*oculux quit (Ping timeout: 246 seconds)
02:16:09*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:30:00*rnrwashere quit (Remote host closed the connection)
02:30:41*rnrwashere joined #nim
02:31:42*rnrwashere quit (Remote host closed the connection)
02:40:14*abm quit (Ping timeout: 255 seconds)
02:52:11*vlad1777d quit (Ping timeout: 246 seconds)
02:55:33*noeontheend joined #nim
03:02:33*banc quit (Quit: Bye)
03:09:47*rnrwashere joined #nim
03:10:52*zachk quit (Quit: have a good evening)
03:23:27*banc joined #nim
03:52:58*rockcavera quit (Ping timeout: 245 seconds)
04:04:17*rockcavera joined #nim
04:15:20*rnrwashere quit (Remote host closed the connection)
04:22:09*rnrwashere joined #nim
04:29:14*smitop quit (Quit: Connection closed for inactivity)
04:35:26*rnrwashere quit (Remote host closed the connection)
04:38:06*rnrwashere joined #nim
05:09:23*noeontheend quit (Ping timeout: 246 seconds)
05:49:16*Marumto joined #nim
05:51:56*Marumoto quit (Ping timeout: 255 seconds)
06:21:32*narimiran_ joined #nim
06:27:18*rnrwashere quit (Remote host closed the connection)
07:19:44*Vladar joined #nim
07:23:55*nsf joined #nim
07:26:42*Marumoto joined #nim
07:27:35*miran__ joined #nim
07:28:24*nif_ joined #nim
07:30:19*stratact_ joined #nim
07:31:00*kali_ joined #nim
07:34:59*miran__ is now known as narimiran
07:40:36*Vladar quit (Excess Flood)
07:40:36*nif quit (Quit: ...)
07:40:37*stratact quit (Quit: No Ping reply in 180 seconds.)
07:40:37*cornfeedhobo quit (Quit: ZNC - https://znc.in)
07:40:37*Marumto quit (Remote host closed the connection)
07:40:40*narimiran_ quit (Remote host closed the connection)
07:40:40*kaliy quit (Remote host closed the connection)
07:41:05*Vladar joined #nim
07:47:51*dddddd joined #nim
07:53:50*cornfeedhobo joined #nim
07:56:36*federico3 quit (Ping timeout: 272 seconds)
07:56:47*federico3 joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:03:26*MyMind quit (Ping timeout: 250 seconds)
08:03:30*Pisuke joined #nim
08:04:50*gmpreussner joined #nim
08:25:57*Arlenx joined #nim
08:51:28*vlad1777d joined #nim
08:59:41*vlad1777d quit (Ping timeout: 246 seconds)
09:04:22*vlad1777d joined #nim
09:05:44*aguspiza joined #nim
09:11:22*Trustable joined #nim
09:20:56*vlad1777d quit (Ping timeout: 244 seconds)
09:49:54*krux02 joined #nim
09:52:31*dddddd quit (Remote host closed the connection)
10:04:21*neceve joined #nim
10:09:22krux02dom96, are you there?
10:14:00*vlad1777d joined #nim
10:18:39*stratact_ left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
10:24:18bashbjorndumb question of the day: how do I get a seq[int] from a range?
10:24:33bashbjorn`cast[seq[int]](0..10) doesn't seem to work
10:25:23narimiranbashbjorn: import sequtils; toSeq(0..10)
10:27:52bashbjornthanks 🍰
10:28:42*NimBot joined #nim
10:56:14*hoijui joined #nim
10:56:44*hoijui quit (Remote host closed the connection)
11:20:23*Sembei joined #nim
11:21:10*Pisuke quit (Ping timeout: 272 seconds)
11:27:45*aguspiza quit (Ping timeout: 246 seconds)
11:40:13dom96krux02: I am now
11:40:26krux02ok
11:40:47krux02do wrote most of nimble didn't you?
11:41:01krux02I was hoping you might be able to help me with my problem with nimble
11:41:17dom96I did yes
11:43:30dom96Related to #615?
11:43:56dom96I do need to go in a second, but I will be back later on
11:59:23krux02dom96, des exactly that issue
12:01:25dom96krux02: tried with `--debug` switch?
12:01:38dom96`nimble install fancygl --debug`
12:01:41dom96bbs
12:01:52krux02nono that is not what I mean with debug
12:02:10krux02I mean to run nimble with debug information
12:02:33krux02bin/nim c -o:bin/nimble --noNimblePath --nilseqs:on --debugger:native dist/nimble/src/nimble.nim
12:02:40krux02that is what I mean
12:02:50krux02so that I can run nimble under gdb
12:02:54krux02I just did
12:03:00krux02it crashes in parseVersionRange
12:05:51krux02result.ver = parseVersionRange(req[i .. req.len-1])
12:06:09krux02"nim", ' ' <repeats 18 times>, ">= 0.19.9 "
12:15:38krux02"nim >= 0.19.9 "
12:15:57krux02that <repeats 18 times> is gdb logic
12:23:15*Snircle joined #nim
12:39:38*lritter joined #nim
12:43:29*sz0 joined #nim
13:02:47Araqdom96: please review https://github.com/nim-lang/Nim/pull/10715
13:05:32dom96krux02: is dist/nimble/ Nimble HEAD?
13:06:55krux02dom96, yes it is
13:12:48dom96I believe the crash happens thanks to the wonderful breaking change that means s[s.len] fails with an exception instead of returning '\0'
13:13:18dom96https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/version.nim#L193
13:14:12dom96and in release mode that behaviour remains :/
13:22:13Araqthat was a year ago and something and you could have tested your version parser by now
13:22:53Araqi < s.len should be i+1 < s.len
13:23:37Zevvhehe, that one bit me more then once :)
13:24:03Araqwith Zevv's help we can check array indexing at compile-time
13:24:08Zevvyeah sure
13:24:30Zevvfunny how a double positive can make a negative :)
13:25:08ZevvI'll get back to you as soon as I find out how to prove unbounded loops
13:25:54Araqyou wrapped Z3 for Nim
13:26:54Zevvthat's like saying "you built a bike" and assuming I'm winning the tour the france
13:27:28AraqI can make the compiler output the formulas that Z3 needs to prove for us
13:28:00Zevvwell, drop me an example snippet if you find some time, that'd be interesting
13:28:00Araqbut you need to tell me the output format
13:28:19AraqI can give you:
13:28:26Araqprecondition: i >= 0
13:28:36Araqprecondition: i <= len(a)
13:29:03Araqplease prove: i <= len(a) + 4
13:29:09Zevvone sec
13:30:19dom96Araq: Seems my test suite just didn't catch this
13:30:32*ng0 quit (Quit: Alexa, when is the end of world?)
13:30:49*dddddd joined #nim
13:30:51ZevvAraq: that one is easy
13:30:52dom96I don't really want to spend time looking at my old indexing code closely
13:32:21*nsf quit (Quit: WeeChat 2.3)
13:32:57AraqZevv: take your time, I gotta go anyway.
13:32:59Araqsee you later.
13:33:32ZevvAraq: ok, cool. This one is trivial with Z3, so if you have anything more concrete, let me know
13:33:48Araqhuh? more concrete?
13:33:55AraqI'm asking about the Z3 syntax
13:34:08Zevvhttp://paste.debian.net/1069827/
13:34:16ZevvIt's just Nim syntax
13:34:20Araqthe only thing that will change in production is that I will give the tool many more preconditions
13:35:03Araqaoh!!!
13:35:10Zevvthis snippet uses uint32 for i and len(a), and I'm assuming I can't know what a is
13:35:42Araqsweet, just 'import z3'
13:36:28ZevvI was trying to implement a {.prove.} pragma the other day, this will just convert the AST from a Nim function into Z3 ast
13:36:46Zevvthe problem is that I do not know how to "generate" the questions I should ask Z3 about the generated statements
13:36:59Araq s.assert i <= len_a + 4
13:36:59Araq s.check_model
13:37:09Araq^ this is a bit bad
13:37:22Araqis this the only way? one assert is unlike the others
13:37:37Araqsince it is the sentence we need to prove
13:37:38ZevvNo its not the only way, it is just a close mapping to the Z3 nomenclature
13:37:51ZevvPythin uses the 'add()' method on a solver instead, which feels nicer
13:38:00Araqnot my point
13:38:06Zevvsorry, again
13:38:14*aguspiza joined #nim
13:38:31AraqI prefer something like s.check(i <= len_a + 4)
13:38:52Araqbut it shouldn't matter really.
13:39:18Zevvyeah, so it *is* the naming you mean. Basically, you feed a solver a bunch of 'assertions', and in the end you ask "will this hold"
13:39:38Zevvthe respons being, "Yes, under these constraints:", and a set of values which make all statements true
13:39:43Zevvor "no can do"
13:39:51Araqhmm
13:40:06Araq"under these constraints" should be 'true'
13:40:13ZevvIt is true
13:40:28Zevvbut it also tells you *which values make* it true
13:40:41Araqyeah, don't care about that
13:40:48Araqarray indexing is very simple
13:40:51Zevvthen the answer is simply "yes" or "no"
13:41:02Zevvand you throw away the rest of the info
13:41:28Araqit also supports separation logic, right?
13:42:04ZevvI'd have to look into that, sorry
14:01:27*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:04:33krux02dom96, and there is already a pull request to fix that bug: https://github.com/nim-lang/nimble/pull/613/files
14:04:38krux02last change
14:10:43ZevvAraq: if you find some time, drop me a real snippet together with the things youd like to see proved, syntax does not matter, but would be nice if it was a practical example with "real" types and context
14:10:48*Zevv afk
14:11:28krux02dom96: I also reported that issue 4 months ago: https://github.com/nim-lang/nimble/issues/563
14:12:57*neceve quit (Ping timeout: 246 seconds)
14:13:43Araqlol
14:14:10*vlad1777d quit (Remote host closed the connection)
14:15:14*vlad1777d joined #nim
14:16:30*neceve joined #nim
14:18:52*vlad1777d quit (Remote host closed the connection)
14:20:55*vlad1777d joined #nim
14:30:51dom96Yeah... if only I got a separate PR for each of those issues, most of them would be fixed already :/
14:39:50*volkov joined #nim
14:45:08krux02if you ask me, you can just merge the pr
14:45:35dom96Sure, I can. But I don't want some of these changes
14:45:41krux02better than keeping it around unmerged
14:46:09krux02Then merge it manually.
14:46:40dom96That's as much, if not more effort than just fixing the issues myself
14:47:11krux02then fix the issues
14:49:56*volkov quit (Quit: volkov)
14:52:21*xace_ quit (Read error: Connection reset by peer)
14:52:43*xace joined #nim
14:55:53*krux02 quit (Remote host closed the connection)
15:02:37*noeontheend joined #nim
15:11:56ZevvAraq: z3 might support speration logic, but after reading some papers I decided that I don't - it hurts my brain
15:12:41Zevvit feels like reading "GΓΆdel Escher Bach", which took me over a decade I think
15:29:25*dom96_w joined #nim
15:35:36narimiranfinally! tuple unpacking in for loops is here: https://github.com/nim-lang/Nim/pull/10152
15:37:56*dom96_w quit (Ping timeout: 257 seconds)
15:48:24*Cthalupa quit (Ping timeout: 250 seconds)
15:49:32*arecaceae quit (Read error: Connection reset by peer)
15:49:50*arecaceae joined #nim
15:50:41*Cthalupa joined #nim
16:02:58*vlad1777d quit (Ping timeout: 245 seconds)
16:04:42*leorize quit (Ping timeout: 264 seconds)
16:09:53*stefanos82 joined #nim
16:15:16*noeontheend quit (Ping timeout: 250 seconds)
16:18:40*abm joined #nim
16:23:30*banc quit (Ping timeout: 250 seconds)
16:29:20*rockcavera quit (Remote host closed the connection)
16:30:56*banc joined #nim
16:35:10*noeontheend joined #nim
16:48:53*nsf joined #nim
16:54:47*Arlenx quit (Ping timeout: 255 seconds)
17:02:30*Cthalupa quit (Ping timeout: 250 seconds)
17:04:49*Cthalupa joined #nim
17:16:07federico3for (a, b, c) in s: echo a, b, c \o/
17:30:21*Cthalupa quit (Ping timeout: 246 seconds)
17:31:24*Cthalupa joined #nim
17:42:23*nsf quit (Quit: WeeChat 2.3)
17:45:04FromGitter<deech> @Araq: why does it warn when more than 3 identifiers are assigned to a `let`/`var` with a tuple constructor (https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L499), for example in this case: ⏎ ⏎ ```let a,b,c,d = (1,2,3)``` ⏎ ⏎ Is there something special about going over 3? [https://gitter.im/nim-lang/Nim?at=5c7186a01f146304210b3647]
17:45:55*vlad1777d joined #nim
17:49:14*Marumto joined #nim
17:51:42*Marumoto quit (Ping timeout: 245 seconds)
18:00:24FromGitter<deech> Also is there a runtime memory allocation cost to doing `let (x,y,z) = (1,"hello world",@[])` vs doing it individually like: ⏎ ⏎ ```let x = 1 ⏎ let y = "hello world" ⏎ let z = @[]``` [https://gitter.im/nim-lang/Nim?at=5c718a38e5eeec0d9bb446f1]
18:10:27*nc-x joined #nim
18:11:41nc-xno runtime cost iirc
18:11:41nc-xthe compiler unpacks the tuple and the code is generated as normal variable assignments
18:18:55*nc-x quit (Ping timeout: 256 seconds)
18:20:45*nc-x joined #nim
18:21:41nc-xAnd regarding the first question, the warning is given for `let a, b = (1,2)` as well. I assume the warning may be so that people do not mistakenly consider it to be doing tuple unpacking.
18:21:55nc-x@deech ^^^
18:23:26FromGitter<deech> @nc-x Thanks!
18:23:31nc-xBTW if the warning is for the reason I said, then the warning message isn't really great IMO and should be improved
18:23:32*nsf joined #nim
18:23:53FromGitter<deech> I'm working on that bit of the compiler now and suggestions are welcome.
18:23:53nc-x@Araq ^^^
18:24:22nc-xwhat exactly are you working on?
18:25:06FromGitter<deech> Making https://github.com/nim-lang/Nim/pull/10642 less hacky.
18:36:59nc-xAraq's comment `evaluate the value of the sym later after we evaluated its pragmas?` doesn't seem much different to me than your patch. That would also prettify one part of the code and uglify some other part.
18:37:34nc-x(unless I am missing something, bcos I only gave the code a very brief look)
18:40:24FromGitter<dandevelo> How can I use a template parameter inside of a string?
18:40:45FromGitter<dandevelo> Escaping it with backtick doesn't seem to work
18:41:18*nc-x quit (Quit: Page closed)
18:46:11FromGitter<deech> @nc-x: The PR itself while, working on a subset of cases falls over when doing something like: ⏎ ⏎ ```let (x {.compileTime.}, y) = (1,2) ⏎ static: ⏎ echo x``` [https://gitter.im/nim-lang/Nim?at=5c7194f3a378ef11f62aa532]
18:47:54FromGitter<deech> In the medium term the `compileTime` pragma really needs to go away as it can always be replaced by `static` AFAICT.
18:49:19FromGitter<deech> In fact if the plan is to phase out `compileTime` I don't see much reason to continue working on the PR as the problem doesn't happen if `static` blocks are used instead.
18:52:12*Arlenx joined #nim
18:55:21FromGitter<greenfork> @dandevelo you mean like this? ⏎ ⏎ ```template n(r: string): string = ⏎ "my string: " & r & ";" ⏎ ⏎ echo n("hello")``` [https://gitter.im/nim-lang/Nim?at=5c719719a378ef11f62ab2b5]
18:57:10*zachk joined #nim
18:58:07*zachk quit (Read error: Connection reset by peer)
18:58:32*zachk joined #nim
18:58:45FromGitter<dandevelo> @greenfork I need r to be untyped as I am using it to generate a proc name
18:59:12*zachk quit (Changing host)
18:59:12*zachk joined #nim
19:00:02FromGitter<greenfork> @dandevelo this still works with `r: untyped`
19:04:38FromGitter<dandevelo> @greenfork How would you use r for a proc name in that template?
19:07:22FromGitter<greenfork> @dandevelo I don't know this, maybe someone else could answer
19:08:10*noeontheend quit (Ping timeout: 250 seconds)
19:19:54*junk[m] joined #nim
19:24:27*abm quit (Ping timeout: 246 seconds)
19:34:42Araqnc-x: you are right about the warning's purpose
19:51:12*rnrwashere joined #nim
19:55:27*rnrwashere quit (Ping timeout: 250 seconds)
20:06:21*lritter quit (Quit: Leaving)
20:08:05*rnrwashere joined #nim
20:20:38*noeontheend joined #nim
20:22:00FromGitter<alehander42> @Zevv @Araq
20:22:31FromGitter<alehander42> @zah was also very interested in ysing something like z3 for Nim guarantees
20:22:42FromGitter<alehander42> Have you exchanged ideas
20:22:59ryukopostingvideo 2 is out http://ryuk.ooo/videos.html
20:25:03ryukopostingI was able to get the text to look a lot nicer than in the last one, first vid had some weird artifacting around the text since OBS had to scale it to 1080p. Was able to fix that for video 2. Still working on general production quality stuff, and I'm not 100% happy with this video, but I think it's overall an improvement over video 1
20:25:21Araqalehander42, no, we only talked about memory safety without a GC (SOLVED! maybe)
20:34:44*nsf quit (Quit: WeeChat 2.3)
20:35:35Zevvalehander42: no, not me
20:38:54ldleworkryukoposting: what editor are you using in that video?
20:39:43ZevvFAQ :)
20:40:04Zevv2019/02/14 00:44 #nim: < ryukoposting> that's Kat
20:40:10ZevvKate, sorry :)
20:41:02ryukopostinghuh
20:41:10ldleworkgotcha
20:41:13ryukopostingsorry, yeah it's kate
20:41:57AraqI use Sawyer
20:43:30Zevv?
20:44:00AraqKate, Sawyer, Jack, ... got it?
20:44:05Zevvoooh
20:44:18ryukopostingbadump-tss
20:45:14ZevvI had to look that up :/
20:46:32*vlad1777d quit (Ping timeout: 255 seconds)
20:52:35ryukopostingshould I make an FAQ for that kind of thing
20:53:11Zevv$ grep -ir ryukoposting irc/2019/ | grep -i editor | grep -i what | wc -l
20:53:11Zevv3
20:53:17ZevvIf '3' is 'frequently', then yes
20:55:08FromGitter<Clyybber> @nc-x I'm getting "Error: illformed AST: (p) =" when trying to use tuple for vars
20:57:56FromGitter<Clyybber> I'll try to extract a test case
21:04:30*Arlenx quit (Read error: Connection reset by peer)
21:06:56*abm joined #nim
21:17:54*Vladar quit (Remote host closed the connection)
21:41:15*Trustable quit (Remote host closed the connection)
22:19:45*ng0 joined #nim
22:23:00FromGitter<Clyybber> ```func test[n: static int](s: seq[(int, int)]) = ⏎ for (a, b) in s: ⏎ discard``` ⏎ ⏎ This is the most minimal I could come up with [https://gitter.im/nim-lang/Nim?at=5c71c7c3ddaa310c89dd87e9]
22:23:19FromGitter<Clyybber> Removing the static parameter fixes the error
22:36:57FromGitter<Clyybber> nc-x: Opened issue #10727 for the above issue.
22:53:35*smitop joined #nim
22:53:58smitopIs there a difference between `uint(x)`and `cast[uint](x)`?
22:57:53FromGitter<Clyybber> I think uint(x) will error for a negative x, while `castuint (x)` will just reinterpret the bytes as a uint (so if x was negative, the result is probably gonna be a big number)
23:14:48*bobby joined #nim
23:47:13*stefanos82 quit (Remote host closed the connection)