<< 24-01-2016 >>

00:04:15*yglukhov joined #nim
00:15:53*yglukhov quit (Remote host closed the connection)
00:19:06*kniteli joined #nim
00:34:56*xet7 joined #nim
00:46:06*Trustable quit (Remote host closed the connection)
01:19:54*jaco60 quit (Ping timeout: 250 seconds)
01:21:25*Demon_Fox quit (Ping timeout: 260 seconds)
01:22:48*Demon_Fox joined #nim
01:55:29*newboy joined #nim
02:02:48*Matthias247 quit (Read error: Connection reset by peer)
02:19:08*newboy quit (Quit: Page closed)
02:36:26*ephja quit (Ping timeout: 240 seconds)
02:42:40ldleworkDoes anyone know of any examples of the events module?
02:43:54*BitPuffin|osx quit (Ping timeout: 250 seconds)
03:03:35ldleworkDoes Nim, or will it, ever support variable number of generic parameters?
03:39:48*gunn quit (Quit: Textual IRC Client: www.textualapp.com)
04:02:27*lompik quit (Quit: WeeChat 1.3)
04:19:44*lompik joined #nim
04:36:59*xdminsy joined #nim
04:37:48*xdminsy left #nim (#nim)
05:43:06*arnetheduck joined #nim
05:43:26*saml_ quit (Ping timeout: 240 seconds)
05:57:55*lompik quit (Ping timeout: 260 seconds)
06:03:21*darkf joined #nim
06:15:34*xtagon joined #nim
06:33:58bozaloshtshsomething like proc a[T](varargs[T])?
07:20:45ldleworkbozaloshtsh: no like proc a[varargs[typedesc]]
07:20:53ldleworksomething crazy like that
07:21:00ldleworkdunno how that'd work exactly
07:21:24bozaloshtshcan't think of a situation where I'd need that
07:21:26ldleworkhttps://en.wikipedia.org/wiki/Variadic_template
07:21:51ldleworkbozaloshtsh: something like fowl's signal's library
07:22:01ldleworkwhere it can currently only be passed a single type
07:24:24ldleworkI also kind of wish there was a middle-ground between templates and macros
07:24:42ldleworklike templates but where you can use for-loops and so on in the template to generate blocks and so on
07:24:50ldleworkI hate to say it, but something like PHP
07:25:28ldleworkFor complicated productions it is very tedious to use the AST api
07:26:04ldleworkbut I think it can be solved with abstractions over the AST rather than something horrible like I just described ^_^
07:26:29bozaloshtshldlework: yeah, I was going to say you could wrap the AST api to make some things nicer
07:34:59ldleworkbozaloshtsh: its a lot of work
07:39:57ldleworknim has a ton of syntax
07:40:13ldleworkI'm currently working to give my abstractions for building types at least
07:47:34ldleworkbozaloshtsh: you wouldn't have any interest in that?
07:48:38bozaloshtshI try to stay away from macros, so not really actually
07:49:01bozaloshtshI've noticed that the cooler the feature I try to use, the more vague the error message I get when I screw up
07:53:05ldleworkha you wouldn't like what I'm doing then
08:10:19*dashed quit (Quit: Connection closed for inactivity)
08:13:53*vqrs quit (Ping timeout: 265 seconds)
08:17:21*vqrs joined #nim
08:43:19*xtagon quit (Quit: Connection closed for inactivity)
08:44:14M-maxI love the pegs library, but does anyone know why the maximum match length is set at language compile time to be (a number as low as) 20?
08:52:51M-maxvs using a seq or allowing the user to pass in an array of their chosen maximum match length
08:58:57*desophos quit (Read error: Connection reset by peer)
09:00:22*yglukhov joined #nim
09:17:48*kniteli quit (Ping timeout: 250 seconds)
09:25:40*Demon_Fox quit (Quit: Leaving)
09:31:17*kniteli joined #nim
09:53:26ldleworkM-max: does the pegs library work at runtime?
09:59:06M-maxYes, works great, so long as you don't try to capture more than 20 things
10:00:26M-maxOnly major feature request would be to start matching from something other than the first synbol
10:00:57M-maxSo you could define a whole grammar as one peg and reuse it multiple times depending on what construct you expect next
10:03:13*yglukhov_ joined #nim
10:03:14*yglukhov quit (Read error: Connection reset by peer)
10:05:28*yglukhov_ quit (Read error: Connection reset by peer)
10:08:32*yglukhov joined #nim
10:12:35M-maxI likewise had issues with using const pegs, but it's not a dealbreaker
10:24:48*yglukhov quit (Read error: Connection reset by peer)
10:25:04*yglukhov joined #nim
10:58:46*kniteli quit (Ping timeout: 240 seconds)
11:05:17*ephja joined #nim
11:08:29*Matthias247 joined #nim
11:12:26*jaco60 joined #nim
11:59:41*junw joined #nim
12:02:11*BitPuffin|osx joined #nim
13:02:36*yglukhov quit (Read error: Connection reset by peer)
13:03:55*yglukhov joined #nim
13:55:59*BitPuffin|osx quit (Ping timeout: 264 seconds)
14:02:05*yglukhov quit (Read error: Connection reset by peer)
14:03:38*yglukhov joined #nim
14:10:24*yglukhov quit (Read error: Connection reset by peer)
14:14:27*arnetheduck quit (Ping timeout: 265 seconds)
14:14:43*lompik joined #nim
14:16:18*yglukhov joined #nim
14:18:44*arnetheduck joined #nim
14:22:00*zepolen joined #nim
14:33:27federico3anybody here going to FOSDEM?
14:35:15dom96yeah, but to the Belfast one heh
14:41:23dom96federico3: You should post this question on the forum, more likely you will find somebody who is going there.
14:42:49federico3is there one in belfast?!
14:42:49*yglukhov quit (Read error: Connection reset by peer)
14:43:52*zepolen quit ()
14:45:33*yglukhov joined #nim
14:54:00flyxwhy can strutils.parseInt() raise an OverflowError, but strutils.parseBiggestInt() cannot?
14:54:10flyxthe integer may still be too large
14:55:15*yglukhov quit (Read error: Connection reset by peer)
14:57:47flyxalso, when i use {.raises:[...].} for my proc and there's an error, the compiler complains like this: „can raise an unlisted exception: ValueError“
14:58:10flyxfor parseBiggestInt, it goes like this: „can raise an unlisted exception: ref ValueError“
14:58:18flyxwhat does the ref mean?
14:59:18flyxI mean, does it make a difference?
14:59:30flyxI can still write „except ValueError“
15:01:49*yglukhov joined #nim
15:15:12*yglukhov quit (Read error: Connection reset by peer)
15:15:32dom96federico3: It's not really a proper one, just a single-day one organised by QUB
15:16:28*yglukhov joined #nim
15:16:57dom96flyx: The fact that parseBiggestInt cannot raise OverflowError may be a bug, please report it on Github.
15:17:15dom96flyx: newException(ValueError, "msg") create a 'ref ValueError'
15:17:18dom96*creats
15:17:20dom96*creates
15:17:32dom96the raise statement needs a ref
15:17:36dom96it cannot raise value types
15:17:55dom96but somehow you can still catch the value type, that is a bit odd
15:18:13dom96All exception will become refs soon anyway
15:18:18dom96*exceptions
15:18:21*dom96 can't type today
15:18:33flyxdom96: yes, but in the documentation it looks like {.raises: [ValueError].} just like in my code
15:19:02flyxso I wondered why I'm getting the message without "ref" for my code
15:23:48*flyx created an issue for the parseBiggestInt thing
15:26:27federico3interesting, this doc build step is failing with a bunch of errors starting with Error: Coroutines require -d:nimCoroutines
15:26:37federico3nim doc2 --hint[Conf]:off --hint[Path]:off --hint[Processing]:off --putenv:nimversion=0.13.0 --docSeeSrcUrl:https://github.com/nim-lang/Nim/tree/v0.13.0/lib/pure -o:web/upload/coro.html --index:on lib/pure/coro.nim
15:37:37*yglukhov quit (Remote host closed the connection)
15:45:22*urb joined #nim
15:46:30urbHow do I combine '$' char with string format? "$#, $" % @["string"]
15:48:41dom96urb: two $: "$#, $$" % @["string"]
15:48:55urbAh, thanks!
15:54:50flyxwhen an iterator raises an exception, it does get propagated to where the iterator is called, and not to where it is instantiated, right?
15:55:01flyxI got some inconsistent compiler output: so I had some fun with raises and iterators: https://github.com/nim-lang/Nim/issues/3772
16:12:04*Trustable joined #nim
16:14:51*urb quit (Quit: Page closed)
16:34:50*arnetheduck quit (Ping timeout: 276 seconds)
16:38:04*yglukhov joined #nim
16:42:24*yglukhov quit (Ping timeout: 250 seconds)
16:44:12*gokr joined #nim
16:52:48*gokr left #nim (#nim)
17:07:33Araq_flyx: good job. now fix the compiler. :-)
17:08:35flyxAraq_: some time, I will find the time to actually dig into Nim's compiler code
17:08:42flyxbut, unfortunately, not today
17:16:49*junw quit (Read error: Connection reset by peer)
17:32:16Araq_M-max: since PEGs are not parser generators (yet), I couldn't imagine a use case where one would have more than 20 matches and so I 'optimized' it instead
17:34:07Araq_what do you do that you need more? we can remove this restriction
18:10:49flyxin nimscript, how do I get the output of a command I execute with exec?
18:33:57bozaloshtshflyx: would something like this work: http://www.rosettacode.org/wiki/Execute_a_system_command#Nim? I'm not familiar with the restrictions of nimscript though
18:34:29flyxbozaloshtsh: osproc is not available in nimscript
18:34:58flyxanyway, I found a workaround by putting the output I wanted in the command that needs it with ``
18:39:37*yglukhov joined #nim
18:39:44Araq_flyx: hrm, pretty sure there is a way to do that
18:40:15*Salewski joined #nim
18:43:27SalewskiAraq: In the last days I typed a few times "var s = newSeq(KK)" instead of the correct term "var s = newSeq[KK]()". Generally I would like the first one, but we can or should not allow that?
18:45:02*yglukhov quit (Ping timeout: 250 seconds)
18:49:44M-maxAraq: I'm writing a docopt command line parser (to go with a port of argparse I've written) as a way of learning nim (and potential service to the community). Anyway, to my surprise, parsing one fairly reasonable line of usage examples requires more than 20 tokens
18:50:39Araq_Salewski: overload newSeq to take a typedesc. we could add it to system.nim
18:50:46*zama quit (Ping timeout: 240 seconds)
18:50:48M-maxSo it's a DSL parser rather than a fully fledged programming language, but coding it has been a joy relative to my previous attempts at similar things using regexes
18:51:07reactormonkM-max, https://github.com/docopt/docopt.nim if you wanna compare
18:51:10M-max(Admittedly when I was a lot younger)
18:52:19Araq_M-max: instead we need a proc that takes a PEG and returns a parse tree. would be much more useful.
18:52:38M-maxI saw that, but it didn't compile for me. I actually wrote my argparse clone first, then wrote a docopt parser to see if it could be a way of specifying an argparse parser, then realised how fundamentally different it was (i.e. You can do things with docopt that you can't with argparse), so now I have two parsers!
18:53:02M-maxAraq: well, that was going to be my next feature request :)
18:53:21M-maxThat and starting at any point in the grammar (which amounts to the same thing)
18:53:44Araq_ah hrm ... never considered that
18:53:48Araq_interesting idea
18:54:08*zama joined #nim
18:54:10M-maxProblem is, as soon as you ask for a parse tree, you'll be asking for a way of writing error messages and that's way beyond my powers...
18:54:51Araq_well the parse tree type needs to be generic
18:54:56M-maxAraq: it's a poor man's version of a full parse tree and I imagine much easier to implement
18:57:08SalewskiThanks Araq, bye...
18:57:13*Salewski quit ()
18:58:45*gokr joined #nim
19:00:28Araq_M-max: Nim need to have a macro parse(grammar, NodeType) that inspects the NodeType to generate a parser to one's liking
19:01:16M-maxA pony! Can I have one?
19:01:22Araq_and having some experience with IDE tooling, the tree needs to contain the errors as nodes
19:01:43M-maxThe tree or grammar?
19:01:50M-max(On a flight, will lose you soon)
19:01:54Araq_the resulting tree
19:17:04*junw joined #nim
19:18:38*junw_ joined #nim
19:21:30*junw quit (Ping timeout: 250 seconds)
19:25:51*quark1 joined #nim
19:28:56*junw_ quit (Ping timeout: 272 seconds)
19:42:35*yglukhov joined #nim
19:47:00*yglukhov quit (Ping timeout: 250 seconds)
20:00:05flyxis it possible to get a reference counter or something from a ref object?
20:02:17*yglukhov joined #nim
20:13:47reactormonkflyx, use case?
20:14:48flyxreactormonk: YAML serialization. it can be a hint for whether I need to create an anchor for a serialized object so that I can reference it later if it occurs again somewhere else in the data structure
20:15:52*gokr quit (Quit: Leaving.)
20:30:02Araq_flyx: the m&s GC has no reference counts
20:30:16Araq_and the refcounting's RCs are not reliable either
20:31:05*darkf quit (Quit: Leaving)
20:32:40*Jesin quit (Quit: Leaving)
20:33:45flyxwell I can do without it
20:35:19flyxmy code here: "e.type.name" yields this error: "Error: identifier expected, but found 'type e.name'"
20:35:23flyxshouldn't this work?
20:36:46Araq_has been reported and there seems to be a fix for it which I haven't reviewed yet.
20:36:58Araq_well I did review it, but I need to see it on my own.
20:49:05*quark1 quit (Read error: Connection reset by peer)
20:49:07ldleworkHow should you go about using .format with strings that containt format specifiers (that shouldn't be interpolated)
20:49:10*junw_ joined #nim
20:49:46*junw_ quit (Read error: Connection reset by peer)
20:49:51yglukhovAraq: is this lookup not easy to fix?
20:50:08yglukhovas all other bugs ;)
20:56:15*def- quit (Ping timeout: 260 seconds)
20:58:12*yglukhov_ joined #nim
20:58:13*yglukhov quit (Read error: Connection reset by peer)
20:58:36ldleworkanyone got a tip?
21:02:14*def- joined #nim
21:03:57Araq_ldlework: write $$ for a single $ ? not sure what you mean
21:04:18Araq_yglukhov_: what if you don't annotate the parameter with a type? should that really influence lookup rules?
21:05:24ldleworklet string_to_interpolate_later = "This string will later be $1 to say $1".format("interpolated")
21:05:28ldlework^ stupid example
21:05:38ldleworkBut I want the second $1 to actually be in the string.
21:05:46ldleworkI have resolved to doing things like
21:05:55ldleworklet string_to_interpolate_later = "This string will later be $1 to say $2".format("interpolated", "$1)
21:05:57ldleworklol
21:07:00Araq_"This string will later be $1 to say $$1".format("interpolated")
21:07:29Araq_yglukhov_: there is a different mechanism in the compiler that is supposed to deal with the case you describe
21:07:50ldleworkdamn it, I think I even knew that
21:08:00Araq_which is that visibility is extended to consider the generic definition context
21:08:13Araq_not sure why it doesn't work for your case
21:08:27Araq_but since it doesn't I don't think it's easy to solve
21:09:12yglukhov_Araq: oh cool! vesibility extension is a nice term for the behavior i want
21:09:21yglukhov_but not cool it doesnt work =)
21:11:01yglukhov_however, i'm not sure if visibility should be extended for typed params. maybe typed should always be resolved as if they were in place of template call?
21:12:14yglukhov_and then untyped params will be subject to "visibility extension"?..
21:12:49Araq_extended visibility has nothing to do with typed vs untyped parameters, it's always performed
21:13:14Araq_(except in your case where it doesn't work, but I dunno why yet)
21:13:33yglukhov_so why not call it a critical bug then? :P
21:14:03Araq_because usually the compiler knows better than me about these things
21:17:41yglukhov_ok
21:18:12Araq_I can make it a showstopper
21:18:40Araq_a low priority showstopper bug
21:18:58yglukhov_=)
21:19:30Araq_but actually ... since I wanted to improve stack traces for template expansions
21:19:40yglukhov_dont want any more showstoppers...
21:20:02Araq_ok ok, it should be easy to fix.
21:20:04Araq_:P
21:20:12Araq_if I do the planned refactoring
21:20:51yglukhov_pity irc cant tell how happy i am =)
21:20:58*Demon_Fox joined #nim
21:26:06*Trustable quit (Remote host closed the connection)
21:31:26*raimo joined #nim
21:31:51Araq_yglukhov_: is that actually blocking you in some way? the example you gave was easy enough to do with a proc
21:44:13*raimo quit (Quit: Lost terminal)
21:55:56*yglukhov_ quit (Remote host closed the connection)
22:10:59*ephja quit (Ping timeout: 264 seconds)
22:18:35*Jesin joined #nim
22:28:20*gokr joined #nim
22:55:47*yglukhov joined #nim
22:59:04*Matthias247 quit (Read error: Connection reset by peer)
23:00:16*yglukhov quit (Ping timeout: 250 seconds)
23:00:39*Matthias247 joined #nim
23:01:12*Matthias247 quit (Read error: Connection reset by peer)
23:09:32*desophos joined #nim
23:45:16*vendethiel quit (Ping timeout: 265 seconds)
23:48:29*nsf quit (Quit: WeeChat 1.3)