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:40 | ldlework | Does anyone know of any examples of the events module? |
02:43:54 | * | BitPuffin|osx quit (Ping timeout: 250 seconds) |
03:03:35 | ldlework | Does 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:58 | bozaloshtsh | something like proc a[T](varargs[T])? |
07:20:45 | ldlework | bozaloshtsh: no like proc a[varargs[typedesc]] |
07:20:53 | ldlework | something crazy like that |
07:21:00 | ldlework | dunno how that'd work exactly |
07:21:24 | bozaloshtsh | can't think of a situation where I'd need that |
07:21:26 | ldlework | https://en.wikipedia.org/wiki/Variadic_template |
07:21:51 | ldlework | bozaloshtsh: something like fowl's signal's library |
07:22:01 | ldlework | where it can currently only be passed a single type |
07:24:24 | ldlework | I also kind of wish there was a middle-ground between templates and macros |
07:24:42 | ldlework | like templates but where you can use for-loops and so on in the template to generate blocks and so on |
07:24:50 | ldlework | I hate to say it, but something like PHP |
07:25:28 | ldlework | For complicated productions it is very tedious to use the AST api |
07:26:04 | ldlework | but I think it can be solved with abstractions over the AST rather than something horrible like I just described ^_^ |
07:26:29 | bozaloshtsh | ldlework: yeah, I was going to say you could wrap the AST api to make some things nicer |
07:34:59 | ldlework | bozaloshtsh: its a lot of work |
07:39:57 | ldlework | nim has a ton of syntax |
07:40:13 | ldlework | I'm currently working to give my abstractions for building types at least |
07:47:34 | ldlework | bozaloshtsh: you wouldn't have any interest in that? |
07:48:38 | bozaloshtsh | I try to stay away from macros, so not really actually |
07:49:01 | bozaloshtsh | I'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:05 | ldlework | ha 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:14 | M-max | I 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:51 | M-max | vs 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:26 | ldlework | M-max: does the pegs library work at runtime? |
09:59:06 | M-max | Yes, works great, so long as you don't try to capture more than 20 things |
10:00:26 | M-max | Only major feature request would be to start matching from something other than the first synbol |
10:00:57 | M-max | So 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:35 | M-max | I 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:27 | federico3 | anybody here going to FOSDEM? |
14:35:15 | dom96 | yeah, but to the Belfast one heh |
14:41:23 | dom96 | federico3: You should post this question on the forum, more likely you will find somebody who is going there. |
14:42:49 | federico3 | is 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:00 | flyx | why can strutils.parseInt() raise an OverflowError, but strutils.parseBiggestInt() cannot? |
14:54:10 | flyx | the integer may still be too large |
14:55:15 | * | yglukhov quit (Read error: Connection reset by peer) |
14:57:47 | flyx | also, 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:10 | flyx | for parseBiggestInt, it goes like this: „can raise an unlisted exception: ref ValueError“ |
14:58:18 | flyx | what does the ref mean? |
14:59:18 | flyx | I mean, does it make a difference? |
14:59:30 | flyx | I can still write „except ValueError“ |
15:01:49 | * | yglukhov joined #nim |
15:15:12 | * | yglukhov quit (Read error: Connection reset by peer) |
15:15:32 | dom96 | federico3: It's not really a proper one, just a single-day one organised by QUB |
15:16:28 | * | yglukhov joined #nim |
15:16:57 | dom96 | flyx: The fact that parseBiggestInt cannot raise OverflowError may be a bug, please report it on Github. |
15:17:15 | dom96 | flyx: newException(ValueError, "msg") create a 'ref ValueError' |
15:17:18 | dom96 | *creats |
15:17:20 | dom96 | *creates |
15:17:32 | dom96 | the raise statement needs a ref |
15:17:36 | dom96 | it cannot raise value types |
15:17:55 | dom96 | but somehow you can still catch the value type, that is a bit odd |
15:18:13 | dom96 | All exception will become refs soon anyway |
15:18:18 | dom96 | *exceptions |
15:18:21 | * | dom96 can't type today |
15:18:33 | flyx | dom96: yes, but in the documentation it looks like {.raises: [ValueError].} just like in my code |
15:19:02 | flyx | so 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:27 | federico3 | interesting, this doc build step is failing with a bunch of errors starting with Error: Coroutines require -d:nimCoroutines |
15:26:37 | federico3 | nim 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:30 | urb | How do I combine '$' char with string format? "$#, $" % @["string"] |
15:48:41 | dom96 | urb: two $: "$#, $$" % @["string"] |
15:48:55 | urb | Ah, thanks! |
15:54:50 | flyx | when 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:01 | flyx | I 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:33 | Araq_ | flyx: good job. now fix the compiler. :-) |
17:08:35 | flyx | Araq_: some time, I will find the time to actually dig into Nim's compiler code |
17:08:42 | flyx | but, unfortunately, not today |
17:16:49 | * | junw quit (Read error: Connection reset by peer) |
17:32:16 | Araq_ | 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:07 | Araq_ | what do you do that you need more? we can remove this restriction |
18:10:49 | flyx | in nimscript, how do I get the output of a command I execute with exec? |
18:33:57 | bozaloshtsh | flyx: 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:29 | flyx | bozaloshtsh: osproc is not available in nimscript |
18:34:58 | flyx | anyway, 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:44 | Araq_ | flyx: hrm, pretty sure there is a way to do that |
18:40:15 | * | Salewski joined #nim |
18:43:27 | Salewski | Araq: 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:44 | M-max | Araq: 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:39 | Araq_ | 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:48 | M-max | So 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:07 | reactormonk | M-max, https://github.com/docopt/docopt.nim if you wanna compare |
18:51:10 | M-max | (Admittedly when I was a lot younger) |
18:52:19 | Araq_ | M-max: instead we need a proc that takes a PEG and returns a parse tree. would be much more useful. |
18:52:38 | M-max | I 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:02 | M-max | Araq: well, that was going to be my next feature request :) |
18:53:21 | M-max | That and starting at any point in the grammar (which amounts to the same thing) |
18:53:44 | Araq_ | ah hrm ... never considered that |
18:53:48 | Araq_ | interesting idea |
18:54:08 | * | zama joined #nim |
18:54:10 | M-max | Problem 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:51 | Araq_ | well the parse tree type needs to be generic |
18:54:56 | M-max | Araq: it's a poor man's version of a full parse tree and I imagine much easier to implement |
18:57:08 | Salewski | Thanks Araq, bye... |
18:57:13 | * | Salewski quit () |
18:58:45 | * | gokr joined #nim |
19:00:28 | Araq_ | 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:16 | M-max | A pony! Can I have one? |
19:01:22 | Araq_ | and having some experience with IDE tooling, the tree needs to contain the errors as nodes |
19:01:43 | M-max | The tree or grammar? |
19:01:50 | M-max | (On a flight, will lose you soon) |
19:01:54 | Araq_ | 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:05 | flyx | is it possible to get a reference counter or something from a ref object? |
20:02:17 | * | yglukhov joined #nim |
20:13:47 | reactormonk | flyx, use case? |
20:14:48 | flyx | reactormonk: 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:02 | Araq_ | flyx: the m&s GC has no reference counts |
20:30:16 | Araq_ | 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:45 | flyx | well I can do without it |
20:35:19 | flyx | my code here: "e.type.name" yields this error: "Error: identifier expected, but found 'type e.name'" |
20:35:23 | flyx | shouldn't this work? |
20:36:46 | Araq_ | has been reported and there seems to be a fix for it which I haven't reviewed yet. |
20:36:58 | Araq_ | 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:07 | ldlework | How 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:51 | yglukhov | Araq: is this lookup not easy to fix? |
20:50:08 | yglukhov | as 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:36 | ldlework | anyone got a tip? |
21:02:14 | * | def- joined #nim |
21:03:57 | Araq_ | ldlework: write $$ for a single $ ? not sure what you mean |
21:04:18 | Araq_ | yglukhov_: what if you don't annotate the parameter with a type? should that really influence lookup rules? |
21:05:24 | ldlework | let string_to_interpolate_later = "This string will later be $1 to say $1".format("interpolated") |
21:05:28 | ldlework | ^ stupid example |
21:05:38 | ldlework | But I want the second $1 to actually be in the string. |
21:05:46 | ldlework | I have resolved to doing things like |
21:05:55 | ldlework | let string_to_interpolate_later = "This string will later be $1 to say $2".format("interpolated", "$1) |
21:05:57 | ldlework | lol |
21:07:00 | Araq_ | "This string will later be $1 to say $$1".format("interpolated") |
21:07:29 | Araq_ | yglukhov_: there is a different mechanism in the compiler that is supposed to deal with the case you describe |
21:07:50 | ldlework | damn it, I think I even knew that |
21:08:00 | Araq_ | which is that visibility is extended to consider the generic definition context |
21:08:13 | Araq_ | not sure why it doesn't work for your case |
21:08:27 | Araq_ | but since it doesn't I don't think it's easy to solve |
21:09:12 | yglukhov_ | Araq: oh cool! vesibility extension is a nice term for the behavior i want |
21:09:21 | yglukhov_ | but not cool it doesnt work =) |
21:11:01 | yglukhov_ | 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:14 | yglukhov_ | and then untyped params will be subject to "visibility extension"?.. |
21:12:49 | Araq_ | extended visibility has nothing to do with typed vs untyped parameters, it's always performed |
21:13:14 | Araq_ | (except in your case where it doesn't work, but I dunno why yet) |
21:13:33 | yglukhov_ | so why not call it a critical bug then? :P |
21:14:03 | Araq_ | because usually the compiler knows better than me about these things |
21:17:41 | yglukhov_ | ok |
21:18:12 | Araq_ | I can make it a showstopper |
21:18:40 | Araq_ | a low priority showstopper bug |
21:18:58 | yglukhov_ | =) |
21:19:30 | Araq_ | but actually ... since I wanted to improve stack traces for template expansions |
21:19:40 | yglukhov_ | dont want any more showstoppers... |
21:20:02 | Araq_ | ok ok, it should be easy to fix. |
21:20:04 | Araq_ | :P |
21:20:12 | Araq_ | if I do the planned refactoring |
21:20:51 | yglukhov_ | 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:51 | Araq_ | 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) |