00:00:51 | Araq_ | apotheon: LLVM iirc has something like memset_s which you can wrap in 1 line to gain access to it. |
00:01:14 | Araq_ | 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:04 | Araq_ | 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:34 | apotheon | Araq_: Thanks. |
01:35:50 | apotheon | Araq_: . . . and yeah, "memory safety" was definitely a poor choice of phrasing. |
01:36:29 | apotheon | Araq_: 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:55 | dom96 | Anybody 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:12 | reactormonk | dom96, 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:22 | Salewski | for 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:24 | reactormonk | ... 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:00 | dom96 | reactormonk: the former |
16:17:05 | dom96 | it's in vanilla minecraft |
16:18:06 | reactormonk | We could write a nim compiler that targets minecraft and then use that to compile the compiler into minecraft. Might be dead slow. |
16:18:21 | Salewski | OK, works, I forgott the : at end of line. Sorry. |
16:20:45 | Salewski | And 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:11 | Salewski | C1 = 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:22 | Araq_ | Yeah. Or you try to use an enum. |
16:42:20 | * | onionhammer quit (Quit: WeeChat 1.0.1) |
16:45:13 | Salewski | OK. 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:01 | derka | Hi Guys, i just discovered Nim yesterday night, I usually code in Python and C, and I think I already love Nim |
16:47:05 | derka | I got a quick question |
16:47:22 | derka | how can i dynamically generate methods at compile time |
16:48:09 | derka | by that i mean how can i have code that generate code at compile time |
16:50:54 | Salewski | const yy = 7; const zz = 66 # that seems to work! |
16:54:45 | Araq_ | derka: with templates and macros or perhaps generics. |
16:55:20 | derka | ok Thanks Araq will go through this |
16:55:23 | Araq_ | Nim has the most advanced compile-time features afaict |
16:55:55 | Araq_ | Salewski: yeah why wouldn't it. ; is a statement separator, not a "within const section" separator |
16:59:03 | Salewski | Araq: 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:58 | derka | Thanks Araq_ just found out a good example of what i need with macro “Generating source code” |
17:04:48 | dom96 | Araq_: 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:16 | xyz___ | Hi |
17:28:32 | xyz___ | how do I return an array from a proc? |
17:35:55 | dom96 | proc foo(): array[2, int] = return [1,2] |
17:40:40 | * | xyz___ quit (Quit: Page closed) |
17:41:08 | * | xyz___ joined #nim |
17:41:57 | xyz___ | dom96: and if I don't know the size? |
17:42:05 | xyz___ | is that possible? |
17:42:51 | xyz___ | dom96: for example proc readBytesFromDevice* (deviceHandle: File, memoryAddress: byte, length: Natural): openArray[byte] = |
17:43:01 | dom96 | then use a sequence |
17:43:11 | dom96 | 'openarray' is only appropriate in proc parameters |
17:43:18 | xyz___ | ok |
17:43:23 | xyz___ | I will try that |
17:43:24 | dom96 | a 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:43 | yuta | hi |
17:55:19 | dom96 | hello yuta |
17:56:11 | yuta | I have question about multiple comment to implement highlight feature for emacs |
17:56:42 | yuta | What happen if user typed "###["? |
17:57:29 | yuta | single doc comment or multi line doc comment? |
18:01:29 | dom96 | Araq_: ^ |
18:02:56 | * | irrequietus joined #nim |
18:04:22 | * | onionhammer joined #nim |
18:09:49 | Araq_ | yuta: single line comment |
18:10:08 | yuta | Oh, thanks Araq |
18:10:21 | Araq_ | and note that I'm reworking them right now |
18:13:41 | yuta | I see. I'll wait official information. |
18:17:38 | * | xet7 quit (Ping timeout: 246 seconds) |
18:22:28 | yuta | I saw "if {| (let..." in nim manual, but I couldn't compile it |
18:23:36 | yuta | Is that {|...|} style still supported? (if statement section) |
18:27:14 | Araq_ | these brackets only denote scoping |
18:27:19 | Araq_ | they are not valid Nim code. |
18:27:32 | Araq_ | and I'm pretty sure the manual explains that :P |
18:27:52 | dom96 | indeed "For visualization purposes the scopes have been enclosed in {| |} in the following example" |
18:33:14 | yuta | oops, 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:26 | ldlework | It kinda seems like `$` should take a lower precedence than `.` |
19:41:59 | * | yglukhov joined #nim |
19:45:53 | Araq_ | 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:54 | ldlework | Araq_: you mean |
19:49:59 | ldlework | echo $(that.is.crazy.talk) |
19:50:26 | Araq_ | that's how it is parsed, yes |
19:50:45 | Araq_ | and that's much more useful than ($that).is.crazy.talk |
19:56:58 | ldlework | Araq_: I'm seeing it the other way |
19:57:06 | ldlework | I said $ should have lower precedence |
19:57:10 | ldlework | not higher. |
19:57:50 | Araq_ | 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:26 | ldlework | Araq_: I think I have a ~370 standalone reproduction |
20:29:33 | ldlework | line* |
20:29:57 | Araq_ | cool. |
20:30:26 | ldlework | Araq_: how do you want it |
20:30:45 | Araq_ | report it as a bug. |
20:31:09 | Araq_ | with a bit of luck I don't have to read your code. :-) |
20:32:21 | * | xet7 joined #nim |
20:35:43 | ldlework | yeah hopefully |
20:35:50 | * | pregressive quit (Remote host closed the connection) |
20:47:12 | ldlework | wtf, github.com wont let me attach a nim file? |
20:47:18 | ldlework | Unfortunately, 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:12 | dom96 | attach? Why don't you just paste it in? |
20:50:22 | ldlework | Its like 370 lines? |
20:51:29 | * | irrequietus quit () |
20:52:08 | ldlework | https://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:32 | Ppppppp | This 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:46 | Ppppppp | It 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:32 | def- | Ppppppp: in line 10: let val = "value" in inputTag.attrs |
21:38:58 | def- | oh, actually: let val = inputTag.attrs.hasKey("value") |
21:46:42 | Ppppppp | Yeah, that did it. Thanks. If there is no value, and I wanted to substitute it with "", what would I use? getOrDefault? |
21:46:59 | def- | Ppppppp: right |
21:48:22 | Ppppppp | And what would that be? let val = inputTag.attrs.getOrDefault("value")? |
21:48:33 | Ppppppp | I'm still getting a KeyError with that. |
21:48:34 | def- | getOrDefault("value", "") |
21:48:53 | Ppppppp | Oh, figures it would be something really simple like that. |
21:48:54 | def- | sorry, no |
21:49:05 | def- | I should look at the module before answering |
21:49:56 | Ppppppp | % useEmpty? |
21:51:34 | def- | Ppppppp: are you sure you get the exception with getOrDefault? I think it's in another line |
21:51:53 | def- | so you might want to replace the other attrs[] accesses with attrs.getOrDefault("foo") |
21:55:10 | Ppppppp | Yeah, 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:29 | Ppppppp | So really simple/stupid mistakes on my part. |
21:56:07 | Ppppppp | Thanks for the help, much appreciated. |
22:01:50 | def- | you're welcome |
22:02:21 | ldlework | I 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:57 | dom96 | Araq_: openarray is still an illegal capture inside a closure (/iterator)? :( |
22:36:26 | Araq_ | why wouldn't it? |
22:38:36 | * | vendethiel quit (Ping timeout: 272 seconds) |
22:39:20 | dom96 | why is it an illegal capture? |
22:41:18 | Araq_ | because openarray lives on the stack. always (kind of) |
22:42:58 | dom96 | It means that async procs can't support openarray |
22:50:11 | * | nim-buildbot quit (Ping timeout: 250 seconds) |
22:50:26 | Araq_ | yes. they cannot. |
22:50:41 | Araq_ | all we can do is to convert it to a 'seq' under the hood |
22:51:05 | Araq_ | and that's a cool solution until the dom96 from the future complains about async's poor performance |
22:51:28 | dom96 | heh sure |
22:51:57 | ldlework | for value in r.c.mvalues(): # sigsev |
22:51:59 | ldlework | var c = r.c; for value in c.mvalues(): # no sigsev |
22:52:05 | ldlework | hehe 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:39 | Araq_ | ldlework: raping my VM again? ;-) |
22:55:48 | * | nim-buildbot quit (Ping timeout: 250 seconds) |
22:56:01 | ldlework | hehe this is the same issue in mentioned in the github issue |
22:56:11 | ldlework | but I couldn't figure out a way to get it to not sigsev for a couple hours |
22:56:22 | ldlework | thought I was gonna be blocked, phew |
22:57:14 | * | zama quit (Ping timeout: 245 seconds) |
22:57:14 | ldlework | I 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) |