<< 17-01-2016 >>

00:00:51Araq_apotheon: LLVM iirc has something like memset_s which you can wrap in 1 line to gain access to it.
00:01:14Araq_and please don't use the term "memory safety" for that, it has not much to do with memory safety
00:05:08*kas_ quit (Remote host closed the connection)
00:10:04Araq_interesting, protecting a shared table by a lock means even read accesses need to take it by 'var'
00:11:25*askatasuna joined #nim
00:29:22*yglukhov joined #nim
00:31:38*jakesyl joined #nim
00:33:38*yglukhov quit (Ping timeout: 246 seconds)
00:34:38*jaco60 quit (Ping timeout: 250 seconds)
00:49:24*kniteli quit (Ping timeout: 256 seconds)
00:50:14*kniteli joined #nim
00:52:21*awsteele joined #nim
00:56:44*jakesyl quit (Ping timeout: 250 seconds)
00:58:47*awsteele quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:33:13*nchambers joined #nim
01:35:34apotheonAraq_: Thanks.
01:35:50apotheonAraq_: . . . and yeah, "memory safety" was definitely a poor choice of phrasing.
01:36:29apotheonAraq_: I blame it on the fact I'm sick right now, and my sinuses are full of sludge that threatens to crowd my brain out of my head.
01:50:18*vendethiel quit (Ping timeout: 272 seconds)
02:01:26*Trustable quit (Remote host closed the connection)
02:09:12*vendethiel joined #nim
02:09:26*kniteli quit (Ping timeout: 240 seconds)
02:26:59*bjz joined #nim
02:29:05*JX7P left #nim ("Leaving")
02:29:05*bjz_ quit (Ping timeout: 255 seconds)
02:32:06*vendethiel quit (Ping timeout: 272 seconds)
02:36:17*NimBot joined #nim
02:45:27*vendethiel joined #nim
03:08:12*vendethiel quit (Ping timeout: 272 seconds)
03:33:04*Jesin joined #nim
03:59:19*OderWat quit (Quit: Textual IRC Client: www.textualapp.com)
04:40:18*cyraxjoe joined #nim
04:41:30*cyraxjoe_ quit (Ping timeout: 272 seconds)
04:58:15*lankanmon joined #nim
05:14:18*yon0 joined #nim
05:14:31*yon0 left #nim ("++")
05:20:14*vendethiel joined #nim
05:34:36*yglukhov joined #nim
05:38:50*yglukhov quit (Ping timeout: 246 seconds)
05:44:38*vendethiel quit (Ping timeout: 272 seconds)
06:12:23*darkf joined #nim
07:22:53*Trustable joined #nim
07:35:55*yglukhov joined #nim
07:40:58*yglukhov quit (Ping timeout: 276 seconds)
07:44:35*desophos quit (Read error: Connection reset by peer)
07:56:58*Trustable quit (Remote host closed the connection)
08:05:50*yglukhov joined #nim
08:18:08*vikaton quit (Quit: Connection closed for inactivity)
09:23:50*nchambers quit (Remote host closed the connection)
10:04:15*Matthias247 joined #nim
10:06:58*yglukhov quit (Remote host closed the connection)
10:10:19*vendethiel joined #nim
10:32:48*vendethiel quit (Ping timeout: 272 seconds)
10:39:02*vendethiel joined #nim
10:44:46*zama quit (Ping timeout: 250 seconds)
11:07:27*yglukhov joined #nim
11:11:41*yglukhov quit (Ping timeout: 246 seconds)
11:31:49*jaco60 joined #nim
11:37:52*yglukhov joined #nim
11:50:13*Demon_Fox quit (Quit: Leaving)
11:53:51*yglukhov_ joined #nim
11:53:52*yglukhov quit (Read error: Connection reset by peer)
11:55:59*yglukhov_ quit (Read error: Connection reset by peer)
12:02:10*yglukhov joined #nim
12:03:52*joelmo quit (Quit: Connection closed for inactivity)
12:22:16*yglukhov quit (Remote host closed the connection)
12:43:33*yglukhov joined #nim
13:03:16*yglukhov quit (Remote host closed the connection)
13:21:55dom96Anybody wanna implement Nim in Minecraft? https://www.youtube.com/watch?v=t4e7PjRygt0
13:27:12*yglukhov joined #nim
13:28:16*yglukhov quit (Remote host closed the connection)
15:00:29*Sornaensis quit (Excess Flood)
15:00:57*Sornaensis joined #nim
15:10:33*derka joined #nim
15:17:12reactormonkdom96, basic interpreter in minecraft?
15:58:40*Trustable joined #nim
16:09:17*Salewski joined #nim
16:13:04*BitPuffin|osx quit (Ping timeout: 256 seconds)
16:13:22Salewskifor d in items(if color == White: PawnDirsWhite else: PawnDirsBlack) # with PawnDirs is array of int as [0,1,2]. I had the feeling that this syntax may work, but intentionally not?
16:14:24reactormonk... as in, it's an interpreter written using minecraft blocks, or just an addition so you can use basic in minecraft?
16:15:46*derka quit (Quit: derka)
16:17:00dom96reactormonk: the former
16:17:05dom96it's in vanilla minecraft
16:18:06reactormonkWe could write a nim compiler that targets minecraft and then use that to compile the compiler into minecraft. Might be dead slow.
16:18:21SalewskiOK, works, I forgott the : at end of line. Sorry.
16:20:45SalewskiAnd even this syntax seems to work: for d in if color == White: PawnDirsWhite else: PawnDirsBlack:
16:21:05*Salewski quit ()
16:35:19*derka joined #nim
16:37:56*Salewski joined #nim
16:39:11SalewskiC1 = 0; C2 = 1; C3 = 2; C4 = 3; C5 = 4; C6 = 5; C7 = 6; C8 = 7 # is invalid in const section? So we need 8 lines for this?
16:41:22Araq_Yeah. Or you try to use an enum.
16:42:20*onionhammer quit (Quit: WeeChat 1.0.1)
16:45:13SalewskiOK. Yes enum may be an alternative. But I was surprised, code expressions can exist on the same line when separated by ; but that is not valid for constants.
16:46:23*vikaton joined #nim
16:47:01derkaHi Guys, i just discovered Nim yesterday night, I usually code in Python and C, and I think I already love Nim
16:47:05derkaI got a quick question
16:47:22derkahow can i dynamically generate methods at compile time
16:48:09derkaby that i mean how can i have code that generate code at compile time
16:50:54Salewskiconst yy = 7; const zz = 66 # that seems to work!
16:54:45Araq_derka: with templates and macros or perhaps generics.
16:55:20derkaok Thanks Araq will go through this
16:55:23Araq_Nim has the most advanced compile-time features afaict
16:55:55Araq_Salewski: yeah why wouldn't it. ; is a statement separator, not a "within const section" separator
16:59:03SalewskiAraq: Not really a problem for me. But I assume some people may really like to have many constants in one line, for instance in numerical mathematics. Maybe I am wrong. I was surprised, other beginner may be surprised too.
17:02:58derkaThanks Araq_ just found out a good example of what i need with macro “Generating source code”
17:04:48dom96Araq_: I just tried 'const a, b, c = (0, 1, 2)' which doesn't work, but works for 'var' and 'let'. Is there a reason for this?
17:19:10*zama joined #nim
17:28:08*xyz___ joined #nim
17:28:16xyz___Hi
17:28:32xyz___how do I return an array from a proc?
17:35:55dom96proc foo(): array[2, int] = return [1,2]
17:40:40*xyz___ quit (Quit: Page closed)
17:41:08*xyz___ joined #nim
17:41:57xyz___dom96: and if I don't know the size?
17:42:05xyz___is that possible?
17:42:51xyz___dom96: for example proc readBytesFromDevice* (deviceHandle: File, memoryAddress: byte, length: Natural): openArray[byte] =
17:43:01dom96then use a sequence
17:43:11dom96'openarray' is only appropriate in proc parameters
17:43:18xyz___ok
17:43:23xyz___I will try that
17:43:24dom96a sequence is a dynamic array
17:50:56*yuta joined #nim
17:51:56*xyz___ quit (Quit: Page closed)
17:54:00*desophos joined #nim
17:54:43yutahi
17:55:19dom96hello yuta
17:56:11yutaI have question about multiple comment to implement highlight feature for emacs
17:56:42yutaWhat happen if user typed "###["?
17:57:29yutasingle doc comment or multi line doc comment?
18:01:29dom96Araq_: ^
18:02:56*irrequietus joined #nim
18:04:22*onionhammer joined #nim
18:09:49Araq_yuta: single line comment
18:10:08yutaOh, thanks Araq
18:10:21Araq_and note that I'm reworking them right now
18:13:41yutaI see. I'll wait official information.
18:17:38*xet7 quit (Ping timeout: 246 seconds)
18:22:28yutaI saw "if {| (let..." in nim manual, but I couldn't compile it
18:23:36yutaIs that {|...|} style still supported? (if statement section)
18:27:14Araq_these brackets only denote scoping
18:27:19Araq_they are not valid Nim code.
18:27:32Araq_and I'm pretty sure the manual explains that :P
18:27:52dom96indeed "For visualization purposes the scopes have been enclosed in {| |} in the following example"
18:33:14yutaoops, sorry I didn't check well
18:36:34*yuta quit (Quit: ERC (IRC client for Emacs 25.1.50.1))
19:17:27*Nikopol_ joined #nim
19:27:31*yglukhov joined #nim
19:36:27*yglukhov quit (Remote host closed the connection)
19:40:26ldleworkIt kinda seems like `$` should take a lower precedence than `.`
19:41:59*yglukhov joined #nim
19:45:53Araq_echo $that.is.crazy.talk
19:46:59*yglukhov quit (Ping timeout: 264 seconds)
19:49:01*a_ joined #nim
19:49:24*a_ quit (Client Quit)
19:49:54ldleworkAraq_: you mean
19:49:59ldleworkecho $(that.is.crazy.talk)
19:50:26Araq_that's how it is parsed, yes
19:50:45Araq_and that's much more useful than ($that).is.crazy.talk
19:56:58ldleworkAraq_: I'm seeing it the other way
19:57:06ldleworkI said $ should have lower precedence
19:57:10ldleworknot higher.
19:57:50Araq_lower than '.'? well that's what is done already
20:15:03*pregressive joined #nim
20:24:55*Nikopol_ quit (Quit: Textual IRC Client: www.textualapp.com)
20:29:26ldleworkAraq_: I think I have a ~370 standalone reproduction
20:29:33ldleworkline*
20:29:57Araq_cool.
20:30:26ldleworkAraq_: how do you want it
20:30:45Araq_report it as a bug.
20:31:09Araq_with a bit of luck I don't have to read your code. :-)
20:32:21*xet7 joined #nim
20:35:43ldleworkyeah hopefully
20:35:50*pregressive quit (Remote host closed the connection)
20:47:12ldleworkwtf, github.com wont let me attach a nim file?
20:47:18ldleworkUnfortunately, we don’t support that file type. Choose Files Try again with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP.
20:48:12dom96attach? Why don't you just paste it in?
20:50:22ldleworkIts like 370 lines?
20:51:29*irrequietus quit ()
20:52:08ldleworkhttps://github.com/nim-lang/Nim/issues/3729
21:04:37*pregressive joined #nim
21:15:19*Sornaensis quit (Excess Flood)
21:17:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:23:13*derka quit (Quit: derka)
21:29:41*Jesin quit (*.net *.split)
21:29:42*mlitwiniuk quit (*.net *.split)
21:34:03*Sornaensis joined #nim
21:35:09*Ppppppp joined #nim
21:36:32PppppppThis is probably something really simple, but I can't tell why this is throwing an exception: http://paste.scratchbook.ch/view/f32c1221#L10
21:36:46PppppppIt looks fine to me based on the example here: http://nim-lang.org/docs/htmlparser.html
21:37:36*darkf quit (Quit: Leaving)
21:38:32def-Ppppppp: in line 10: let val = "value" in inputTag.attrs
21:38:58def-oh, actually: let val = inputTag.attrs.hasKey("value")
21:46:42PppppppYeah, that did it. Thanks. If there is no value, and I wanted to substitute it with "", what would I use? getOrDefault?
21:46:59def-Ppppppp: right
21:48:22PppppppAnd what would that be? let val = inputTag.attrs.getOrDefault("value")?
21:48:33PppppppI'm still getting a KeyError with that.
21:48:34def-getOrDefault("value", "")
21:48:53PppppppOh, figures it would be something really simple like that.
21:48:54def-sorry, no
21:49:05def-I should look at the module before answering
21:49:56Ppppppp% useEmpty?
21:51:34def-Ppppppp: are you sure you get the exception with getOrDefault? I think it's in another line
21:51:53def-so you might want to replace the other attrs[] accesses with attrs.getOrDefault("foo")
21:55:10PppppppYeah, it looks like that was it. I had changed attrs["value"] to attrs.getOrDefault("value"), but it doesn't look like I changed attrs["name"] to attrs.getOrDefault("name")
21:55:29PppppppSo really simple/stupid mistakes on my part.
21:56:07PppppppThanks for the help, much appreciated.
22:01:50def-you're welcome
22:02:21ldleworkI can't seem to trick the VM into not SIGSEV'ing for this line :>
22:02:46*pregressive quit (Remote host closed the connection)
22:03:58*pregressive joined #nim
22:06:30*mlitwiniuk joined #nim
22:24:42*Ppppppp quit (Ping timeout: 252 seconds)
22:27:39*askatasuna quit (Ping timeout: 245 seconds)
22:27:48*Salewski quit ()
22:29:22*pregressive quit (Remote host closed the connection)
22:35:57dom96Araq_: openarray is still an illegal capture inside a closure (/iterator)? :(
22:36:26Araq_why wouldn't it?
22:38:36*vendethiel quit (Ping timeout: 272 seconds)
22:39:20dom96why is it an illegal capture?
22:41:18Araq_because openarray lives on the stack. always (kind of)
22:42:58dom96It means that async procs can't support openarray
22:50:11*nim-buildbot quit (Ping timeout: 250 seconds)
22:50:26Araq_yes. they cannot.
22:50:41Araq_all we can do is to convert it to a 'seq' under the hood
22:51:05Araq_and that's a cool solution until the dom96 from the future complains about async's poor performance
22:51:28dom96heh sure
22:51:57ldleworkfor value in r.c.mvalues(): # sigsev
22:51:59ldleworkvar c = r.c; for value in c.mvalues(): # no sigsev
22:52:05ldleworkhehe found a workaround.
22:53:27*onionhammer quit (*.net *.split)
22:53:27*jaco60 quit (*.net *.split)
22:53:28*jck quit (*.net *.split)
22:53:28*clone1018 quit (*.net *.split)
22:53:28*DecoPerson quit (*.net *.split)
22:53:28*NhanH quit (*.net *.split)
22:53:28*CARAM__ quit (*.net *.split)
22:53:28*zxtx quit (*.net *.split)
22:53:29*flyx quit (*.net *.split)
22:53:29*Guest34835 quit (*.net *.split)
22:53:29*\u quit (*.net *.split)
22:54:55*CARAM__ joined #nim
22:55:39Araq_ldlework: raping my VM again? ;-)
22:55:48*nim-buildbot quit (Ping timeout: 250 seconds)
22:56:01ldleworkhehe this is the same issue in mentioned in the github issue
22:56:11ldleworkbut I couldn't figure out a way to get it to not sigsev for a couple hours
22:56:22ldleworkthought I was gonna be blocked, phew
22:57:14*zama quit (Ping timeout: 245 seconds)
22:57:14ldleworkI should probably put comments to all these "rewordings" so I can go back and write them more naturally later
22:57:45*onionhammer joined #nim
22:57:46*jaco60 joined #nim
22:57:46*jck joined #nim
22:57:46*clone1018 joined #nim
22:57:46*DecoPerson joined #nim
22:57:46*NhanH joined #nim
22:57:46*zxtx joined #nim
22:57:46*flyx joined #nim
22:57:46*Guest34835 joined #nim
22:57:46*\u joined #nim
22:59:23*zama joined #nim
23:18:12*Demon_Fox joined #nim
23:32:53*vendethiel joined #nim
23:55:55*Trustable quit (Remote host closed the connection)