<< 18-07-2015 >>

00:14:17*vendethiel quit (Ping timeout: 240 seconds)
00:36:58*vendethiel joined #nim
00:38:08*nande joined #nim
00:42:36*Hitman10666 joined #nim
00:42:45*Hitman10666 left #nim (#nim)
00:44:18*anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:44:24*jaco60 quit (Ping timeout: 246 seconds)
00:44:24*elbow quit (Read error: Connection reset by peer)
00:44:39*elbow joined #nim
00:47:13*quasinoxen joined #nim
00:49:35*quasinoxen left #nim (#nim)
00:58:54*vendethiel quit (Ping timeout: 250 seconds)
01:07:36*mtj_ quit (Ping timeout: 256 seconds)
01:11:28*anthgur joined #nim
01:22:27*mtj_ joined #nim
01:27:52*lokulin quit (Ping timeout: 265 seconds)
01:35:04*sparrk joined #nim
01:55:19*lokulin joined #nim
02:12:17*sparrk quit (Quit: Leaving)
02:18:53*arnetheduck joined #nim
02:55:19*ChrisMAN quit (Remote host closed the connection)
03:23:20*anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…)
03:39:08*gmpreussner|work quit (Read error: Connection reset by peer)
03:39:32*gmpreussner|work joined #nim
03:54:49*darkf joined #nim
04:22:06*darkf quit (Ping timeout: 248 seconds)
04:26:40*darkf joined #nim
04:32:24*nande quit (Ping timeout: 244 seconds)
04:32:45*nande joined #nim
04:37:01*vendethiel joined #nim
04:40:06*nande quit (Read error: Connection reset by peer)
04:41:23*nande joined #nim
04:55:31*EXetoC quit (Ping timeout: 256 seconds)
04:57:17*nande quit (Read error: Connection reset by peer)
04:58:32*nande joined #nim
05:01:47*nande quit (Remote host closed the connection)
05:44:12*strcmp1 quit (Ping timeout: 264 seconds)
05:47:55*onionhammer quit (Ping timeout: 246 seconds)
05:53:50*vendethiel quit (Ping timeout: 248 seconds)
05:54:24*dtscode quit (Ping timeout: 264 seconds)
05:56:59*vendethiel joined #nim
06:18:01*vendethiel quit (Ping timeout: 246 seconds)
06:18:49*dtscode joined #nim
06:28:30*dtscode quit (Ping timeout: 265 seconds)
06:32:51*dtscode joined #nim
06:36:20*vendethiel joined #nim
06:48:01*jszymanski joined #nim
06:59:40*vendethiel quit (Ping timeout: 246 seconds)
07:00:43*jszymanski quit (Ping timeout: 246 seconds)
07:13:47*EXetoC joined #nim
07:41:39*vendethiel joined #nim
07:49:45*filcuc joined #nim
08:10:55*jszymanski joined #nim
08:50:39*Matthias247 joined #nim
08:54:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:13:19*jaco60 joined #nim
09:14:28*johnsoft quit (Ping timeout: 264 seconds)
09:14:43*Trustable joined #nim
09:20:18*bjz joined #nim
09:31:58*EXetoC quit (Ping timeout: 250 seconds)
09:39:16*BitPuffin|osx quit (Ping timeout: 246 seconds)
09:51:59*vendethiel quit (Ping timeout: 265 seconds)
09:53:33*vendethiel joined #nim
10:05:45*unclechu joined #nim
10:08:09reactormonkAraq, from what I see, the docgen doesn't even know if an identifier is a type or not - how do I figure that out?
10:24:43*Sembei quit (Quit: WeeChat 1.2-dev)
10:40:33*Sembei joined #nim
10:50:42*boopisaway quit (Ping timeout: 260 seconds)
11:02:46Araqreactormonk: nim doc2 has the typechecked AST. if n.kind == nkSym and n.sym.kind == skType would be the check
11:29:44*xificurC quit (Read error: Connection reset by peer)
11:32:14*xificurC joined #nim
11:36:43*xificurC quit (Ping timeout: 256 seconds)
11:50:19reactormonkAraq, the code that generates the stuff is in docgen, so not doc2 - is it find the break nim doc?
11:53:41*bjz quit (Max SendQ exceeded)
11:54:12Araqcompiler/docgen.nim is used by both doc and doc2
11:54:28*bjz joined #nim
11:54:31reactormonkDoes doc have a typechecked AST?
11:54:51*[CBR]Unspoken quit (Ping timeout: 256 seconds)
11:57:33Araqwhether you have a typechecked AST or not is the 'n.kind == nkSym' check
11:58:15Araqfor doc2 it has a typechecked ast, for 'doc' it has not
11:58:32Araqso you need to check it at runtime because the same code is used for both
12:00:14reactormonkHm, sounds ugly, but eh. What do we still need doc2 for?
12:00:17reactormonkehh doc
12:01:15reactormonkAraq, btw, what do you think of using var/non-var overloading for in-place modification/copy?
12:09:58*[CBR]Unspoken joined #nim
12:11:16*jszymanski quit (Ping timeout: 244 seconds)
12:12:26*jszymanski joined #nim
12:19:19Araqreactormonk: it cannot really work
12:19:26Araqvar x = "foo"
12:19:34Araqchomp(x) # ok
12:19:53Araqecho chomp(x) # dammit, don't call the 'var' version that returns void
12:22:31*boopisaway joined #nim
12:31:21*xet7 quit (Ping timeout: 244 seconds)
12:42:20*boopisaway is now known as boop
12:43:19*johnsoft joined #nim
12:43:55boophmmmm, does nim automatically create a proc called [filename]Init()?
12:45:17boop:(
12:45:22boopis there any way to rename that proc?
12:51:21*MatrixBridge quit (Read error: Connection reset by peer)
12:51:29*MatrixBridge joined #nim
12:51:35Araqboop: create a bug report please
12:51:41Araqvery easy to fix
12:51:50bogenAraq: For the JS backend the reason callbacks to closure forming local functions is working is because the function definitions were generated in place (nested). Since JS fully supports closures, it all "just works" without support from the Nim JS codegen.
12:54:53*xet7 joined #nim
12:56:57boopAraq: done https://github.com/nim-lang/Nim/issues/3134
13:56:18*xificurC joined #nim
14:20:43*Matthias247 quit (Read error: Connection reset by peer)
14:58:30*unclechu quit (Remote host closed the connection)
15:09:47*lokulin quit (Ping timeout: 256 seconds)
15:15:50*BitPuffin|osx joined #nim
15:26:04*lokulin joined #nim
15:37:59*favalex joined #nim
15:45:49*_stowa quit (Remote host closed the connection)
15:48:42*_stowa joined #nim
15:56:25boopAraq: thanks! :)
16:15:00Learath2how does https://github.com/nim-lang/nimbot/blob/master/src/nimbot.nim#L92 work ?
16:15:23Learath2the callback is normaly expected to have 2 parameters but that seems to make it carry a third around
16:15:49*EXetoC joined #nim
16:17:58*filcuc quit (Quit: Konversation terminated!)
16:36:46Learath2apparently its called an anonymous procedure and i had to dig alot to find what it was :P
16:40:42federico3can the SDL2 load an opengl "model" from file?
16:40:48fowlLearath2 a closure
16:41:46fowlfederico3 theres no such thing as an opengl model, assimp is a library that can open just about anything
16:43:00fowlfederico3 it only loads the model data, theres an example of how to send it to opengl
16:48:39boophmmm - how should i handle GC in procs that are called by C?
16:49:08boopactually back up- http://hastebin.com/ecadoyecuf.rb
16:49:21boopwhat's this? i'm thinking i've run out of memory or something but i'm not sure
17:15:11boopthat's after 30 calls from outside nim, if i use markAndSweep GC it gets as far as 1360 before spitting out the same error
17:21:26boopand v2 gets to 27
17:21:27boophm hm
17:22:34reactormonkAraq, the var version could return as well
17:22:51*Trustable quit (Remote host closed the connection)
17:23:52federico3fowl: thanks
17:24:50reactormonkso we could do chaining as well, and have some macro that simply calls a copy constructor and creates a non-var version of the proc
17:27:42Araqreactormonk: no no no no.
17:28:58Araqboop: depends on what you're doing
17:29:03reactormonkHum, not sure how to do the types part... the non-functional design makes it hard to hook code in - just create lots of data along the side and merge them at the end?
17:29:23boopAraq: digging around...
17:29:44reactormonkaka n.sym == nkSym etc. and if true, add it to a list, then return that list at the end of genItem to create a global index?
17:29:58boopi have this type which is an ref to an object which is just contains a seq[string] and a StringTableRef
17:30:07boopand a proc that creates that from a string
17:30:19boopand i'm calling a proc from outside nim that calls this proc
17:30:31boopand.. that seems to be enough to mess it up, given enough iterations
17:30:58reactormonkah, the indexfile works via rst - hmm.
17:31:32Araqboop: did you read this http://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c ?
17:31:45reactormonkAraq, why the aversion on var overload?
17:32:15Araqreactormonk: var x = chomp(y) # modifies 'y'.
17:32:27reactormonkAraq, ... yup.
17:32:35Araqvar x = chomp("hello\n") # doesn't modify "hello\n"
17:32:58reactormonkthat's static eval anyway?
17:33:04reactormonkaka at compiletime
17:33:44Araqso the behaviour depends on the var-ness of the passed argument. that's just silly.
17:33:48boopAraq: huh nope, never seen that... i'm doing -app:lib and not using --noMain or --noLinking, would that make much of a difference?
17:33:51boopand not exporting a header file
17:34:25Araqboop: well if you don't setup Nim's GC properly from GC then don't expect things to work
17:34:32Araq*from C
17:34:38*boop nods
17:34:43reactormonkYup, and that sounds good to me. Maybe add a proc c[T](c: var T): T that creates a non-var version of a variable for chaning
17:34:47boopdoes that just entail calling NimMain()?
17:35:14Araqaccording to the docs yes. I'm not so sure
17:35:26Araqreactormonk: that's awful.
17:35:27boopi was reading the stuff here http://nim-lang.org/docs/manual.html#foreign-function-interface
17:35:30boopi'll give it a shot!
17:36:27reactormonkAraq, an ide can highlight you var vars and let vars correctly, so it should be easy to see
17:37:55Araqreactormonk: contrary to what you might believe, I don't start with a bullshit design and then use IDE technology to patch over it
17:38:06boopAraq: seems to work a treat! thanks :)
17:38:18boopmight be worth adding a note to that manual section, though.
17:40:45Araqvar x = "foo"
17:40:53Araqecho($x)
17:40:58Araqvar y = 90
17:41:14Araqecho($y) # overloading used to get the *same* behaviour.
17:41:20Araqvar x = "foo"
17:41:24Araqecho chomp(x)
17:41:32Araqlet y = "foo"
17:41:49Araqecho chomp(y) # overloading used to get ... something else
17:43:12reactormonkvar z = $x # same string?
17:43:17Araqboop: I recently re-discovered that piece of documentation
17:43:25Araq;-)
17:43:27boophehe
17:44:39reactormonkThe overloading on var/non-var is orthogonal to type overloading - the type overloading should adhere to the same behaviour (which we can set in stone via concepts if I ever get to them - I'll take a look at that instead of doc I think.)
17:45:06reactormonk... and with var/non-var overloading, it's a differen behavior, because it's a different kind of overload.
17:45:55Araqwhat is the problem anyway? you cannot accept chomp vs strip? aka different names for different things?
17:46:41reactormonkIt's more of a streamlining idea
17:46:59reactormonkOr we can just go for "chomp" and "chomped"
17:47:56reactormonkbut chomp/strip is just ugly, have fun finding the other in the docu
17:48:43Araqwe could add cross references in the docs
17:49:11Araqor we could simply accept the fact that a strutils with a chomp is not suddenly worse than a strutils without a chomp.
17:50:12Araqor maybe it is worse and we should reject the PR.
17:51:38reactormonkjust checking - none of the two procs have var arguments - so our argument can't really apply to that PR
17:51:50reactormonks/our argument/our discussion/
17:52:12AraqIMO chomp should take a var argument and there should be no non-var version.
18:03:22wuehlmausbtw: in perl there was chop which cuts away the last letter or a white space and chomp which only does the latter
18:05:21wuehlmausactually there still is both chop and chomp
18:06:32wuehlmauswhitecase is not correct, chomp deletes a newline
18:14:46*onionhammer joined #nim
18:16:33renesacstrip and striped would be the best I guess, but backwards incompatible
18:26:52wuehlmausfor me chop is better than chomp
18:27:50*darkf quit (Quit: Leaving)
18:37:07federico3renesac: adding a keyword to strip? chars="abc" removes any of those chars, str="foo" removes the exact string
18:55:39reactormonkfor compiler booting, any way to get a full stacktrace?
19:03:16*Jehan_ joined #nim
19:04:32reactormonkehh, why the fuck do I get lib/pure/collections/tables.nim(99, 45) Error: undeclared identifier: 'Option' after import options ?
19:05:44reactormonkcode: https://gist.github.com/0b438eed892944e62cd3
19:07:15Araqrecursive module dependency
19:08:23renesacfederico3: the distinction between strip and striped would be if it returns a new string or do it in-place
19:09:07renesacbut yeah, I just commented on the PR that maybe we can have a strip that accepts an string too
19:26:07reactormonkAraq, huh? options only goes for typetraits
19:32:11*Demos joined #nim
19:36:46*Demos quit (Ping timeout: 248 seconds)
20:06:16*Strikecarl joined #nim
20:06:40Strikecarltype mismatch: got (string)
20:06:40Strikecarlbut expected one of:
20:06:40Strikecarlstreams.newFileStream(f: File)streams.newFileStream(filename: string, mode: FileMode)
20:06:46StrikecarlWoops, welp, that's an error i get
20:06:46Strikecarli do
20:06:50StrikecarlSystem = getEnv("windir")
20:06:50Strikecarl HostsFile = System & "\\System32\\drivers\\etc\\hosts"
20:06:50Strikecarl HostsStream = newFileStream(HostsFile)
20:07:31StrikecarlAm i using newFileStream() wrong?
20:08:11reactormonkyup, gotta inject an open in between
20:08:41Strikecarlo pls
20:09:04StrikecarlInject an open, wtf is that supposed to mean, what lib is Open() in?
20:10:36Strikecarlo
20:10:40Strikecarli have another way to do this anyways kek
20:11:58reactormonkopen is string -> File, it's in os
20:12:50Strikecarlty
20:13:14Araqreactormonk: compiler/options vs stdlib's options
20:14:02reactormonkAraq, ah fuck me. a way to deal with that?
20:23:36*favalex quit (Quit: Leaving)
20:26:40*onionhammer quit (Read error: Connection reset by peer)
20:27:27*flaviu quit (Read error: Connection reset by peer)
20:28:02Araqreactormonk: yeah but why bother? tables won't use Option[T] :P
20:28:16StrikecarlAnyone mind helping me?
20:28:18StrikecarlSource:
20:28:18Strikecarlhttp://pastebin.com/raw.php?i=t5zN77bJ
20:28:39StrikecarlNo error on compile, error on run-time: http://i.imgur.com/TAGqUHG.png
20:30:22*onionhammer joined #nim
20:30:46reactormonkAraq, you can always rewrite it your way
20:31:49fowlStrikecarl, http://nim-lang.org/docs/system.html#writeFile,string,string
20:32:34Strikecarlo
20:32:38fowlStrikecarl, your parameters are mixed up and the variable names are confusing
20:32:41*onionhammer quit (Read error: Connection reset by peer)
20:33:08StrikecarlWelp
20:33:08*onionhammer joined #nim
20:33:18StrikecarlIdk why it says "cannot open: stuff here"
20:33:34fowlStrikecarl, because you're trying to open a line from a host file
20:33:45Strikecarlwat
20:33:49fowlHostsFile doesnt name a file, it is the getContents(...)
20:33:50StrikecarlIm trying to replace it
20:34:03Strikecarlo
20:34:51*flaviu joined #nim
20:35:09fowlHostsLocation is the file name, HostsFile is the contents of http://...
20:35:20StrikecarlYe
20:36:03*jaco60 quit (Ping timeout: 244 seconds)
20:36:32StrikecarlWhat's the problem tho.
20:36:59*jszymanski quit (Quit: computer sleeps...)
20:37:08StrikecarlIs it the extension?
20:37:10Strikecarlthing
20:37:18*jaco60 joined #nim
20:37:46fowlStrikecarl, you aren't using writefile correct
20:37:50fowlproc writeFile(filename, content: string)
20:37:56fowlyou are passing it content, filename
20:39:28Strikecarlooooooooo
20:39:36Strikecarl>.<
20:39:38StrikecarlWorks now!
20:39:39StrikecarlD:
20:56:53*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
21:17:55*filcuc joined #nim
21:23:45*Demos joined #nim
21:31:11*Jehan_ quit (Quit: Leaving)
21:33:12*Varriount quit (Read error: Connection reset by peer)
22:00:37reactormonkAraq, so double file in load path means you can't import the second one?
22:11:25*mrx1 joined #nim
22:14:40*renesac quit (Ping timeout: 252 seconds)
22:23:06*Demos quit (Remote host closed the connection)
22:23:41*Demos joined #nim
22:27:38*renesac joined #nim
22:27:44*Matthias247 joined #nim
22:27:58*Demos quit (Ping timeout: 248 seconds)
22:53:12*pregressive joined #nim
22:55:27*Demos joined #nim
23:08:26*Demos quit (Remote host closed the connection)
23:08:33*filcuc quit (Quit: Konversation terminated!)
23:13:59*pregressive quit (Remote host closed the connection)
23:16:23*boop is now known as boopisaway
23:21:31*brson joined #nim
23:28:43*pregressive joined #nim