00:00:32 | Varriount | Could we please not throw around insults? |
00:00:39 | Araq | swap(ref objectA, ref objectB); |
00:00:45 | SirCmpwn | in any case, I want to change the properties (is that what they're called) of the object, I don't necessarily want to change the object |
00:01:00 | SirCmpwn | but it says it cannot be assigned to |
00:01:18 | Varriount | SirCmpwn: Can you show us your code? |
00:01:50 | SirCmpwn | https://gist.github.com/SirCmpwn/69ca1c129c9c3be97679 |
00:02:16 | SirCmpwn | the relevant bit is at the end |
00:04:58 | Araq | public async void foo(ref string x) |
00:04:59 | Araq | { |
00:05:01 | Araq | x = "woo"; |
00:05:02 | Araq | } |
00:05:19 | Araq | --> Async methods cannot have 'ref' or 'out' parameters |
00:05:27 | SirCmpwn | Araq: the source of our disagreement is that I am asking questions about setting the values within an object, not the object itself |
00:05:45 | SirCmpwn | ref makes no difference in that case in C#. |
00:05:57 | Araq | there is no disagreement, I said "I wonder" and you felt obliged to answer |
00:06:08 | Varriount | SirCmpwn: The client object needs to be a ref |
00:06:09 | SirCmpwn | yeesh, just shut up already |
00:06:45 | SirCmpwn | Varriount: okay, but then calling `client.connect()` gives me an error |
00:07:13 | Varriount | Oh? What error do you get? |
00:07:25 | SirCmpwn | https://sr.ht/99324.txt |
00:07:42 | SirCmpwn | correction: this line is `asyncCheck client.connect()` |
00:08:12 | SirCmpwn | also, what are the implications of `asyncCheck`? Does it block? What happens if an error occurs later on? |
00:08:54 | Varriount | SirCmpwn: That's a question best answered by dom96. I think it blocks. |
00:09:02 | SirCmpwn | seems like an odd thing to do |
00:09:09 | SirCmpwn | is there a way to run an async proc, you know, async |
00:09:39 | Varriount | "Sets a callback on future which raises an exception if the future finished with an error." |
00:09:52 | SirCmpwn | oh, so the exception would be raised from the callback? |
00:09:56 | SirCmpwn | the callback being a closure, I guess? |
00:10:10 | SirCmpwn | and I guess runForever() can be pre-empted? |
00:12:48 | Varriount | SirCmpwn: https://gist.github.com/Varriount/43b7bca3bb8ed7624a32 |
00:13:38 | Varriount | SirCmpwn: An object type can be both on the stack or the heap, and can't be modified from a parameter without the parameter being a 'var' type. |
00:14:00 | Varriount | 'var' in that case means 'implicitly pass a pointer to' |
00:14:36 | SirCmpwn | got an error on the "new" line |
00:14:42 | * | SirCmpwn greps docs for new |
00:14:44 | Varriount | Since async procedures are turned into closure, they can't capture var types, otherwise they risk holding invalid references when the stack changes. |
00:14:58 | Varriount | SirCmpwn: Huh? It compiled for me. |
00:15:14 | SirCmpwn | https://sr.ht/8e16.txt |
00:15:45 | SirCmpwn | whoops, missed your change to line 23 |
00:15:46 | Varriount | SirCmpwn: Did you copy all the code I just pasted, or just a part of it? |
00:15:52 | SirCmpwn | works now, thanks |
00:16:19 | Varriount | SirCmpwn: 'ref' types are always on the heap, and always garbage collected, thus they can always be captured. |
00:16:23 | SirCmpwn | async/await in nim uses coprocs, right? They all run on the same thread? |
00:16:28 | Varriount | Yes. |
00:16:32 | Varriount | (For now) |
00:16:35 | SirCmpwn | good, makes things easier |
00:17:12 | SirCmpwn | is the use of {.inline.} encouraged or is that best left up to the compiler's optimizer? |
00:17:23 | SirCmpwn | I'm inclined to say the latter if it eventually goes through gcc |
00:17:42 | Varriount | SirCmpwn: Well, I wouldn't say 'discouraged', because the issue hasn't really come up. |
00:18:09 | Varriount | It's used occasionally within the standard library, however the tedium of writing it out is generally discouragement enough. |
00:18:17 | SirCmpwn | yeah, verbosity is bad |
00:18:27 | SirCmpwn | is there a way to export things you've imported? |
00:18:34 | SirCmpwn | so I can split up a module |
00:18:42 | Varriount | Yes. The export statement. |
00:18:43 | SirCmpwn | I tried `import *modulename` but that doesn't work |
00:19:08 | Varriount | SirCmpwn: You can also use the 'include' statement, which is similar to C and C++'s include. |
00:19:08 | SirCmpwn | works, thanks :) |
00:19:22 | SirCmpwn | isn't it an anti-pattern to include code into code? |
00:19:37 | Varriount | Howso? |
00:19:46 | * | perturbation joined #nim |
00:19:49 | SirCmpwn | well, in C if you #include "foobar.c" you'll get crucified |
00:20:00 | SirCmpwn | the preferred pattern is to create foobar.h and use that |
00:20:03 | Varriount | Generally the only code you include is code that you yourself have control over. |
00:20:20 | SirCmpwn | sure, but using a header also improves the usability of things like incremental compilation |
00:20:35 | Varriount | Nim doesn't have headers though. :3 |
00:20:49 | SirCmpwn | another question: is nim upstream aware of how verbose the compiler output is, which hides useful information |
00:21:08 | renesac | usually you use import, that is much better than any header solution using c |
00:21:22 | Varriount | 'Upstream'? You mean the development version? |
00:21:41 | SirCmpwn | I just mean are the maintainers of the language aware of it and do they plan on improving it |
00:21:44 | perturbation | SirCmpwn: you can set verbosity with the --verbosity:0 to 3 for most terse to most verbose |
00:21:51 | renesac | I already complained that I wanted a verbosity 0.5 or something like that |
00:22:03 | SirCmpwn | I feel like a successful compile, by default, should show no output |
00:22:09 | SirCmpwn | and hints/warnings from external code should not show at all |
00:22:13 | Varriount | SirCmpwn: Are you using the version of Nim available on the master branch, or on the devel branch? |
00:22:20 | SirCmpwn | I'm using `sudo pacman -S nim` |
00:22:20 | renesac | SirCmpwn: then use --verbosity:0 |
00:22:35 | SirCmpwn | renesac: that helps for sure, but I still see things from external code |
00:22:47 | renesac | right |
00:22:48 | SirCmpwn | kind of lame to add such a long argument to every invocation of the compiler, too |
00:22:57 | renesac | you can change it in your config file |
00:23:00 | Varriount | SirCmpwn: If you look in Nim/config, you'll see a 'nim.cfg' file. |
00:23:09 | SirCmpwn | aha, that'll help |
00:23:22 | renesac | I'm not sure if it will hide all hints, though |
00:23:29 | Varriount | It controls default arguments and such. |
00:23:39 | SirCmpwn | grepping for verbosity doesn't get me anywhere |
00:23:45 | SirCmpwn | do I just add `verbosity = 0`? |
00:23:53 | SirCmpwn | ah, I see how to do it |
00:24:27 | SirCmpwn | thanks for the tip, renesac |
00:24:58 | Varriount | SirCmpwn: If that doesn't work, it shouldn't be too hard to add it to the config parser. I'm not sure how aware of all the compiletime options it is, at last check. |
00:25:18 | SirCmpwn | just had to add `--verbosity: "0"` to the config |
00:25:22 | Araq | SirCmpwn: yeah we're aware and OnO is working on it |
00:25:33 | SirCmpwn | OnO is the BDFL around here? |
00:25:44 | Varriount | Uh.. no.. Araq is. |
00:25:49 | SirCmpwn | oh, alright |
00:26:36 | SirCmpwn | Varriount: I'm still not following how `new(...)` works there |
00:26:45 | * | yglukhov joined #nim |
00:26:47 | SirCmpwn | does it assume that you want the return type implicitly? |
00:26:55 | Varriount | SirCmpwn: new() allocates memory to a reference. |
00:27:19 | SirCmpwn | right, but wouldn't it have to know the type so it knows how much memory to allocate? and so the rest of the proc doesn't make the compiler throw up? |
00:27:23 | SirCmpwn | where does that type come from? |
00:27:37 | Varriount | In that instance, I am allocating memory to the 'result' variable, which is the implicit variable given to a procedures return value. |
00:27:55 | SirCmpwn | oh, I see |
00:27:59 | Varriount | It's type corresponds to the return type of the procedure. |
00:28:06 | SirCmpwn | can that be done explicitly instead? Something like `let result = new(Client)`? |
00:28:20 | SirCmpwn | or would you do `let result: Client` and `new(result)`? |
00:29:08 | Varriount | You can't re-declare the result variable, unfortunately. |
00:29:33 | SirCmpwn | well, give it another name, just an example |
00:29:41 | SirCmpwn | what I'm asking is how do I use new outside of what is effectively a constructor |
00:30:03 | Varriount | Same way. 'new(nameOfAVariablePreviouslyDeclared)' |
00:30:23 | SirCmpwn | `let c = new(Client)` just compiled without error, is it doing what I expect? |
00:30:34 | SirCmpwn | and I guess my old way was using the stack? |
00:31:13 | Varriount | SirCmpwn: Yes. Object types are allocated on the stack, unless they are part of a ref type or are in a container such as a sequence. |
00:31:18 | * | yglukhov quit (Ping timeout: 272 seconds) |
00:31:24 | perturbation | Araq: added an example to reproduce #3140 at https://gist.github.com/singularperturbation/de5d2b5239e9751ce1b0 |
00:31:56 | SirCmpwn | is there object unpacking like we have tuple unpacking? Would be useful |
00:31:59 | Varriount | SirCmpwn: Hm. I wasn't aware you could pass a type to `new`, that might be a recent development. |
00:32:35 | Varriount | SirCmpwn: You mean, breaking an object down into it's member values? No. |
00:32:36 | perturbation | tried using {.push overflowChecks: off.} pragma around the findIter iterator in nre.nim as a workaround, but still occurs if compiler built with them enabled |
00:32:54 | SirCmpwn | Varriount: more like result = { address: address, port: port, user: user } |
00:32:56 | * | vendethiel quit (Ping timeout: 265 seconds) |
00:33:05 | SirCmpwn | or better yet, { address, port, user } and use implicit names |
00:33:50 | Araq | Client(address: address, port: port, user: user) |
00:33:52 | Araq | works |
00:33:57 | SirCmpwn | not on the heap, though, right |
00:34:06 | SirCmpwn | or does it, hmm |
00:34:07 | Varriount | Araq: But that doesn't work for ref types, does it? |
00:34:14 | SirCmpwn | no, probably not |
00:34:25 | Araq | it does work |
00:34:29 | SirCmpwn | yeah, it does |
00:34:30 | SirCmpwn | neato |
00:34:47 | Araq | (ref Client)(field: field) # works too if Client is an object |
00:35:05 | Varriount | SirCmpwn: Could you show me? |
00:35:11 | * | X67r quit (Quit: leaving) |
00:35:22 | SirCmpwn | https://sr.ht/b9a5.txt |
00:35:45 | Araq | SirCmpwn: you don't need the new(result) then |
00:35:58 | SirCmpwn | indeed, very nice |
00:36:01 | Araq | and it allocates a superfluous object |
00:36:08 | Araq | when you use it |
00:36:11 | SirCmpwn | well |
00:36:15 | SirCmpwn | that can be fixed at the compiler level |
00:36:19 | Varriount | Now I feel embarassed. I'm supposed to know these things. |
00:36:21 | SirCmpwn | in the name of cleaner code, I will use this |
00:36:28 | SirCmpwn | and assume that later it'll be optimzied :) |
00:37:35 | Araq | Varriount: you're simply for too long into Nim ;-) and missed a few recent developments where 'recent' means ~2 years ago :P |
00:38:28 | SirCmpwn | anything good for a .gitignore, other than nimcache/ and the executable? |
00:38:34 | SirCmpwn | also, side note, would be nice if it were .nimcache |
00:39:14 | Varriount | Eugh. Not another dotfile. |
00:39:25 | SirCmpwn | what's wrong with dotfiles? |
00:39:33 | Varriount | SirCmpwn: I use Windows. |
00:39:37 | SirCmpwn | well that's your fault |
00:39:42 | Varriount | -_- |
00:39:52 | SirCmpwn | it could behave differently based on your platform, though |
00:40:00 | SirCmpwn | or through a config option |
00:40:33 | Araq | --nimcache |
00:40:42 | Varriount | Although, now that I think about it, making nimcache hidden on windows wouldn't do me any good either, since I have the 'view hidden files mode' on. |
00:41:15 | * | hauzer joined #nim |
00:41:17 | Araq | same here, I never got the concept of a "hidden file" |
00:41:36 | SirCmpwn | I do it one of the SDKs I've written |
00:41:46 | SirCmpwn | all of the files the SDK needs are in .knightos/ |
00:42:00 | SirCmpwn | keeps you from having to think about things that aren't related to _your_ codebase |
00:45:18 | Araq | I usually use beer for this |
00:46:45 | * | hauzer quit (Quit: Page closed) |
00:46:56 | SirCmpwn | also nice for keeping it from messing with your tab completion |
00:48:59 | * | Sahnvour quit (Quit: Leaving) |
00:49:07 | Varriount | SirCmpwn: You work on KnightOS? |
00:49:12 | SirCmpwn | I maintain it |
00:49:32 | SirCmpwn | I'm what Araq is to Nim, but for KnightOS |
00:49:40 | Varriount | Neat. I've seen posts of it on Reddit. |
00:50:01 | SirCmpwn | it's a fun project. |
00:54:12 | * | perturbation quit (Remote host closed the connection) |
00:58:05 | SirCmpwn | nim does GC for me, right |
00:58:16 | SirCmpwn | I don't have to think about getting rid of things? |
00:58:19 | Varriount | Yes. |
00:58:23 | SirCmpwn | cool. |
00:58:24 | SirCmpwn | loving it so far. |
00:59:07 | SirCmpwn | stupid question that I probably know the answer to already: can it compile to ANSI C? |
00:59:08 | Varriount | Although, I don't know how well the GC would do on small devices. You can turn it off though. |
00:59:36 | Varriount | SirCmpwn: I believe it's C99 compatible? At least, for most of the standard features. |
00:59:43 | Varriount | Or was it C98? |
00:59:43 | SirCmpwn | oh well |
00:59:47 | SirCmpwn | KnightOS has an ANSI C compiler |
01:00:03 | Araq | SirCmpwn: it compiles to "some C as implemented by all the big C compilers" |
01:00:23 | SirCmpwn | or to javascript, which is cool |
01:00:31 | SirCmpwn | does it run the C through emscripten or do you directly emit JS instead of C |
01:00:40 | Varriount | Directly emit JS |
01:00:43 | SirCmpwn | neato |
01:00:45 | Araq | cannot compile to Ansi C but Ansi C doesn't mean much since the standard is full of holes and inconsistencies |
01:01:04 | SirCmpwn | ANSI C isn't so unclear that it can't be targetted |
01:01:20 | SirCmpwn | but I don't expect nim to try |
01:03:26 | Araq | Varriount: btw I know why you never could get the fix for s.add(s.high) to work |
01:03:58 | Varriount | Oh? |
01:04:24 | Varriount | That was the one where the length was unexpected, right? |
01:04:30 | Araq | right |
01:04:58 | Araq | the fix really was as simple as I described it |
01:05:06 | * | perturbation joined #nim |
01:05:18 | Varriount | ... but I'm no good at fixing the compiler? |
01:05:29 | Araq | but you need to introduce proc incrSeqV2 in order to keep bootstrapping from working |
01:05:56 | Araq | otherwise the old compiler uses the wrong -- already updated -- version of proc incrSeq |
01:06:03 | Varriount | Ah. |
01:06:22 | Araq | er |
01:06:37 | Araq | "in order to keep bootstrapping working" lol |
01:06:57 | Araq | perturbation: cannot reproduce but I think I know why |
01:07:51 | perturbation | very strange... I've tested in OS X and Linux (but not windows), and both are 64-bit |
01:08:06 | Araq | yeah I'm on 32 bits |
01:08:14 | Araq | and then int.high means something different |
01:08:23 | Araq | but internally the compiler always uses int64 |
01:08:30 | Araq | so ... yep. now I can reproduce |
01:10:06 | * | vendethiel joined #nim |
01:10:28 | SirCmpwn | are you guys happy with the package manager? Sending a PR up to nim-lang/packages seems like it doesn't scale very far |
01:11:21 | Varriount | SirCmpwn: Well, it works well enough for now. |
01:11:35 | Araq | SirCmpwn: no, I think it is completely broken |
01:11:39 | SirCmpwn | well, I'm seeing it as a potential place where I could help with improvements |
01:11:52 | SirCmpwn | https://packages.knightos.org/ is mine, fwiw |
01:11:56 | perturbation | okay, that makes sense... I had tried to trace through to get better info as to the cause by reading through ccgexprs / semfold, but there was a bit too much magic going on in ccgexprs for me to follow '-.- |
01:12:26 | Araq | I consider Nimble hardly usable without it being able to make PRs automatically |
01:12:47 | SirCmpwn | how good/bad of an idea is it to write web services in nim right now? |
01:13:05 | Araq | talked with dom96 about it and it's hard to implement ... thanks to github -.- |
01:13:22 | SirCmpwn | I think that github is a poor choice of platform for this use-case |
01:14:40 | Araq | SirCmpwn: people already use it for web services but I would not call it "stable" |
01:14:44 | SirCmpwn | where is forum.nim-lang.org hosted? |
01:14:52 | SirCmpwn | and how happy are you with the code? |
01:15:26 | SirCmpwn | nevermind, after browsing it for a minute I can guess how happy you are with it |
01:17:25 | Araq | I don't even know what its code looks like now |
01:18:14 | SirCmpwn | considering the amount of work required upfront to develop a usable web development ecosystem |
01:18:26 | SirCmpwn | I would suggest that some other language be used for such things |
01:18:28 | SirCmpwn | (for now) |
01:18:43 | Araq | ha no way |
01:18:45 | Xe | web development is just stupid in general |
01:18:58 | Araq | we use Nim for everything, no matter if wise or not |
01:19:07 | SirCmpwn | alright, fair enough. |
01:19:31 | SirCmpwn | does nim have any sort of reflection capability |
01:19:34 | SirCmpwn | probably not |
01:19:44 | Xe | how about you read the documentation |
01:19:59 | Araq | ha, it has the most powerful macro system known to mankind |
01:20:21 | SirCmpwn | it'll take a while for me to grok the macro docs, Xe |
01:20:23 | Araq | which means you can reflect all you want, once you know how to do it |
01:20:42 | Araq | (or you use the limited typeinfo module) |
01:21:11 | dom96 | ohhh. |
01:21:22 | dom96 | Did you just imply that NimForum's code is bad? |
01:21:26 | Araq | I have to sleep now, but feel free to come up with a way to get rid of this "pull requests required for nimble" bullshit. (sorry dom96) |
01:21:36 | SirCmpwn | dom96: :< |
01:22:05 | SirCmpwn | Araq: the clear solution is to build a service around it instead of trying to shoehorn it on top of github services |
01:22:15 | SirCmpwn | which I might start prototyping if I have time |
01:23:09 | dom96 | Araq: Yeah, let me spend a couple of months working a website instead. |
01:23:30 | dom96 | I thought you were after "get it working asap instead of wasting time" |
01:23:42 | dom96 | *working on |
01:24:16 | Varriount | I think the forum works pretty well. |
01:24:29 | SirCmpwn | you're right |
01:24:48 | dom96 | I think it's a good show case of what Nim can do. |
01:24:54 | SirCmpwn | ehh |
01:25:01 | dom96 | But it's a PITA to maintain |
01:25:10 | SirCmpwn | ^ this statement invalidates the prior one |
01:25:21 | SirCmpwn | I wrote an IRC bot in brainfuck, doesn't mean it's a good showcase of brainfuck |
01:25:25 | dom96 | hrm? |
01:25:41 | dom96 | I'd say it does |
01:26:01 | SirCmpwn | maybe as a hack |
01:26:16 | SirCmpwn | not to demonstrate a language's ability to effectively fulfill a use-case |
01:27:14 | dom96 | It's a good test of the compiler and the standard library. |
01:27:18 | SirCmpwn | that's not to say that nim will never be able to fulfill that use-case effectively |
01:27:27 | SirCmpwn | but the tooling around it needs to be improved in that direction |
01:27:37 | SirCmpwn | s/tooling/modules/ |
01:28:15 | dom96 | I agree. |
01:29:16 | SirCmpwn | are nim modules always distributed in source form? |
01:29:26 | perturbation | say we replaced it with something standard like flask/sinatra/RoR/django/phpBB... we might get more "conversions" as far as people who decide to stick around because of the forum having a better UI |
01:29:40 | SirCmpwn | the ui isn't a problem, the ui is great, I love it |
01:29:57 | dom96 | I don't see what the web framework has to do with the UI. |
01:30:07 | perturbation | but we (meaning dom96) wouldn't be eating our own dog food and improving the stuff that needs to be improved for using nim as a web dev framework |
01:30:08 | perturbation | hmmm |
01:30:15 | Varriount | SirCmpwn: Well, it's theoretically possible to distribute using a DLL and a nim source file that declares/defines all the procedures/types. |
01:30:26 | SirCmpwn | there isn't really a web framework to speak of, perturbation |
01:30:31 | perturbation | what *are* the complaints for the forum then? Hard to maintain / difficult to add new features? Lack of auth? |
01:30:32 | dom96 | SirCmpwn: Nimble packages are |
01:30:38 | SirCmpwn | though I agree that the project should be driving the development of one |
01:30:41 | dom96 | perturbation: Lack of time |
01:30:44 | dom96 | lack of volunteers |
01:30:48 | SirCmpwn | perturbation: maintainability |
01:31:05 | SirCmpwn | perturbation: plus it's a big hack written without support of good web dev modules |
01:31:14 | dom96 | The only PITA really is that I don't have time to maintain it. |
01:31:24 | dom96 | SirCmpwn: That's not true. |
01:31:30 | dom96 | What makes you think that? |
01:31:43 | perturbation | SirCpmwn: I've used jester for some side projects and liked it okay... I don't do that much web stuff though |
01:31:49 | SirCmpwn | a large basis of experience with web frameworks for many other languages |
01:32:34 | SirCmpwn | I can point out the specific flaws if you like, but I'd rather not tear it apart in here |
01:33:32 | dom96 | I'm curious, write them in a gist and send me the link. |
01:33:44 | SirCmpwn | sure. |
01:35:10 | dom96 | But in regards to the real issue. I am the maintainer of like ... 6+ projects. |
01:35:24 | SirCmpwn | lol |
01:35:30 | SirCmpwn | visit my github account sometime |
01:35:32 | dom96 | If any of you guys are bored any help is appreciated. |
01:35:49 | * | Xe goes back to dicking with Go and Haskell |
01:38:10 | perturbation | dom96: This (https://github.com/nim-lang/nimforum) the repo for the forum? I have some time to burn, so I'll try to see what I can do with the open issues |
01:38:33 | perturbation | also might refactor the `||` template to use option types instead |
01:39:34 | dom96 | perturbation: sure, play around with it. It should be pretty easy to get up and running. |
01:39:58 | dom96 | If you don't understand something in the code base let me know and i'll do my best to help. |
01:40:03 | perturbation | I'll need to install postgres though... I think I'll set up a VM just so everything's tidy |
01:40:14 | dom96 | If I don't reply then you can also ask in the forum/ |
01:40:21 | dom96 | you don't need to |
01:40:26 | dom96 | it uses sqlite |
01:40:28 | perturbation | thanks - I'm sure I'll run into something sooner or later |
01:40:29 | perturbation | oh |
01:40:58 | perturbation | that should definitely let me get up and running more quickly |
01:41:23 | dom96 | One thing you can already improve: edit the readme to mention that |
01:50:33 | dom96 | good night |
02:15:41 | perturbation | nice - this is small enough that I can wrap my head around it... maybe some cleanup just with moving formBodies out of forum.nim and into their own files. |
02:15:58 | perturbation | anyway - getting late for me as well |
02:16:02 | perturbation | 'night all |
02:16:16 | * | perturbation quit () |
02:25:56 | * | vendethiel quit (Ping timeout: 272 seconds) |
03:20:17 | * | darkf joined #nim |
03:20:37 | * | Kingsquee quit (Read error: Connection reset by peer) |
03:20:49 | * | Kingsquee joined #nim |
05:05:55 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
05:21:46 | * | phira joined #nim |
05:28:29 | * | pregressive quit (Read error: Connection reset by peer) |
05:28:44 | * | pregressive joined #nim |
06:26:19 | * | elbow_jason quit (Ping timeout: 246 seconds) |
06:46:35 | Varriount | Hm. I wonder how a natural COM api could work in Nim. |
06:48:07 | * | jszymanski joined #nim |
06:59:31 | infinity0 | bogen: hm ok, but what i built "works" as in, it bootstraps itself fine, so i'm hoping i don't need to do extra tests? |
06:59:43 | infinity0 | actually yeah, how do i run the unit tests? |
07:07:29 | * | dgellow quit (Remote host closed the connection) |
07:12:45 | notfowl | Koch test iirc |
07:13:32 | * | Kingsquee quit (Read error: Connection reset by peer) |
07:13:48 | * | Kingsquee joined #nim |
07:22:35 | * | pregressive quit (Remote host closed the connection) |
07:24:48 | * | X67r joined #nim |
08:01:31 | * | wan quit (Ping timeout: 246 seconds) |
08:02:12 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
08:14:27 | * | wan joined #nim |
08:33:27 | * | Raimondi quit (Ping timeout: 252 seconds) |
08:48:43 | * | xcombelle joined #nim |
09:10:00 | * | wan quit (Ping timeout: 264 seconds) |
09:12:07 | * | jszymanski quit (Quit: computer sleeps...) |
09:22:39 | * | wan joined #nim |
09:24:29 | * | BitPuffin|osx joined #nim |
09:28:27 | * | dv- quit (Ping timeout: 255 seconds) |
09:29:45 | * | dv- joined #nim |
09:32:37 | * | dv- quit (Changing host) |
09:32:37 | * | dv- joined #nim |
09:44:36 | infinity0 | hmm, koch test fails, and it says "run with --parallelBuilds:1 to see the error message" but that still doesn't output the error message |
09:50:43 | infinity0 | ah ok i have to pass it to the cc command |
09:50:53 | infinity0 | $ nim cc --parallelBuild:1 --taintMode:on tests/testament/tester |
09:51:04 | infinity0 | tests/testament/tester.nim(15, 22) Error: cannot open 'compiler/nodejs' |
09:51:10 | infinity0 | and indeed nodejs is not compiled yet |
09:51:17 | infinity0 | why isn't it automatically done so? (this is 0.11.2) |
09:52:48 | infinity0 | oh wait, was using the system nim intstead of the built nim |
10:04:05 | * | drewsrem joined #nim |
10:23:33 | infinity0 | so i get a few red lines like: tmapper.nim [reOutputsDiffer] but the overall "koch test" process returns 0, is this still ok? |
10:23:48 | infinity0 | slightly confusing to have the red colour show up like that, if everything is ok (if it is an ignored test) |
10:27:40 | * | yglukhov joined #nim |
10:29:30 | * | vendethiel joined #nim |
10:38:17 | * | yglukhov quit (Remote host closed the connection) |
10:48:06 | * | dalarmmst quit (Ping timeout: 255 seconds) |
10:48:58 | * | Trustable joined #nim |
10:58:35 | dom96 | infinity0: Some tests always fail. |
10:58:45 | dom96 | the process returns 0 no matter what IIRC |
10:59:02 | infinity0 | oh |
10:59:05 | infinity0 | so what's the point? |
10:59:19 | infinity0 | if there are 5 failing tests, what action can i take about that as a user? |
11:01:08 | * | dalarmmst joined #nim |
11:01:13 | dom96 | fix them? I guess. |
11:01:20 | * | unclechu joined #nim |
11:02:15 | * | Sahnvour joined #nim |
11:05:16 | dom96 | you can get more details in the testresults.html file |
11:09:45 | * | wan quit (Quit: WeeChat 1.2) |
11:12:23 | infinity0 | hm ok |
11:12:59 | infinity0 | i guess i mean, why was the version i'm testing (0.11.2) released with failing tests... at least they have have been annotated as "expected to fail"? |
11:13:09 | infinity0 | as opposed to, i have no idea if the build messed up the bytecode logic or something like that |
11:13:14 | infinity0 | e.g. as may be the case on freebsd |
11:13:29 | infinity0 | at least they should have* |
11:17:07 | * | X67r_ joined #nim |
11:19:10 | * | X67r_ quit (Read error: Connection reset by peer) |
11:20:24 | * | X67r quit (Ping timeout: 244 seconds) |
11:22:05 | * | X67r joined #nim |
11:38:53 | * | yglukhov joined #nim |
11:41:13 | bogen | infinity0: nim cc --parallelBuild:1 --taintMode:on tests/testament/tester # does not return any errors for me |
11:41:48 | bogen | ./koch test shows failures though. (and some passes) |
11:43:19 | * | yglukhov quit (Ping timeout: 265 seconds) |
11:59:26 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:59:36 | * | Kingsquee joined #nim |
12:22:29 | * | Demon_Fox joined #nim |
12:24:43 | * | jszymanski joined #nim |
12:41:08 | * | Kingsquee quit (Read error: Connection reset by peer) |
12:41:22 | * | Kingsquee joined #nim |
12:43:05 | * | zielmicha quit (Remote host closed the connection) |
13:00:33 | * | Raimondi joined #nim |
13:03:33 | Sahnvour | could someone tell me what's wrong in the following short code : http://pastebin.com/dH9ERnBC , when trying to access an element of the `offset` array ? |
13:04:15 | * | gmpreussner|lapt joined #nim |
13:05:02 | * | yglukhov joined #nim |
13:08:18 | * | xcombelle quit (Remote host closed the connection) |
13:19:41 | dom96 | Sahnvour: That's not the syntax for array constructors. |
13:19:47 | dom96 | Get rid of the "Left: " |
13:19:54 | dom96 | "Right: " |
13:19:55 | dom96 | etc |
13:36:00 | * | drewsrem quit (Quit: Leaving) |
13:48:55 | Sahnvour | ok, i'm still having an error |
13:49:09 | Sahnvour | error: 'Position92004' has no member named 'Field0' |
13:49:12 | Sahnvour | error: 'Position92004' has no member named 'Field1' |
13:51:17 | * | devzerp quit (Remote host closed the connection) |
13:51:17 | * | no_name quit (Remote host closed the connection) |
13:54:54 | dom96 | interesting |
13:55:00 | dom96 | Sahnvour: it's a compiler bug, report it |
14:02:37 | * | dalarmmst quit (Ping timeout: 246 seconds) |
14:09:25 | * | gmpreussner|lapt quit (Ping timeout: 240 seconds) |
14:09:36 | * | gmpreussner|lapt joined #nim |
14:10:02 | Sahnvour | ok |
14:10:27 | * | strcmp1 joined #nim |
14:12:12 | dom96 | It looks like for some reason the compiler thinks that your type is a tuple. |
14:15:11 | Sahnvour | btw, what's the most convenient way to format/build strings in nim ? |
14:17:13 | * | xcombelle joined #nim |
14:17:30 | * | BitPuffin|osx quit (Remote host closed the connection) |
14:17:49 | * | BitPuffin|osx joined #nim |
14:18:34 | * | xcombelle_ joined #nim |
14:19:16 | * | dalarmmst joined #nim |
14:23:34 | dom96 | Sahnvour: appending via .add and strutils.`%`. |
14:23:47 | dom96 | depends what you're building though |
14:24:43 | Sahnvour | simple output with some variables in it. but i find strutils' % a bit of a hassle |
14:26:01 | * | xcombelle quit (Quit: Leaving) |
14:26:36 | * | xcombelle_ is now known as xcombelle |
14:27:09 | dom96 | Sahnvour: maybe you would like this package: https://github.com/bluenote10/nim-stringinterpolation/ |
14:27:37 | dom96 | I never used it though |
14:27:45 | dom96 | bbl |
14:35:59 | renesac | and there is strfmt if you like python format syntax |
14:36:08 | renesac | and you can simply use concatenation with & |
14:42:37 | Sahnvour | renesac: strfmt looks nice thanks |
14:47:12 | Sahnvour | dom96, i don't really know what the source problem is. indexing on enum apparently has no effect here, but initializing the array elements from a function or a type directly yields different error messages |
14:51:26 | dom96 | Sahnvour: you can s/object/tuple/ for now |
14:51:44 | dom96 | I'll look into it more later, for now gotta go! |
14:52:23 | Sahnvour | no problem |
14:52:25 | Sahnvour | thanks |
15:01:30 | * | X67r quit (Ping timeout: 272 seconds) |
15:02:05 | * | X67r joined #nim |
15:03:39 | * | Arrrr joined #nim |
15:14:02 | Arrrr | Could anyone explain this to me? http://pastebin.com/B0eyMEsL |
15:20:22 | * | gmpreussner|lapt quit (Quit: Leaving) |
15:20:47 | notfowl | Arrrr you wrote to the string so it made a new one to resize it |
15:21:12 | Arrrr | but i made a string of 16 len, and only wrote 1 byte |
15:23:08 | notfowl | Arrrr they arent the same string anymore |
15:23:21 | notfowl | They arent equivalent because you modified one kf them |
15:24:10 | notfowl | Newstringstream() does the copy |
15:24:35 | Arrrr | aah, i thought it was using the same |
15:24:38 | * | X67r_ joined #nim |
15:24:54 | Arrrr | I mean, the first assert passes |
15:26:12 | notfowl | == compare by value not identity |
15:26:33 | Arrrr | ujj |
15:26:41 | * | X67r quit (Ping timeout: 252 seconds) |
15:27:27 | Arrrr | So, if i want to avoid this, i have to reassign source to stream.data i suppose |
15:29:41 | notfowl | Maybe. I dunno what your goal is |
15:30:30 | Arrrr | Ok, thank you notfowl. |
15:33:03 | * | X67r_ quit (Ping timeout: 244 seconds) |
15:34:38 | * | X67r joined #nim |
15:38:08 | * | wb joined #nim |
15:53:12 | * | dalarmmst quit (Ping timeout: 264 seconds) |
16:03:07 | * | wb_ joined #nim |
16:05:12 | * | dalarmmst joined #nim |
16:06:44 | * | wb quit (Ping timeout: 265 seconds) |
16:11:19 | * | X67r quit (Remote host closed the connection) |
16:12:16 | * | X67r joined #nim |
16:14:54 | * | vendethiel quit (Ping timeout: 250 seconds) |
16:19:21 | * | X67r quit (Ping timeout: 250 seconds) |
16:19:56 | * | X67r joined #nim |
16:23:30 | * | wuehlmaus quit (Quit: Lost terminal) |
16:28:08 | * | perturbation joined #nim |
16:34:58 | * | vendethiel joined #nim |
16:42:46 | * | wuehlmaus joined #nim |
16:51:36 | * | darkf quit (Quit: Leaving) |
16:57:36 | onionhammer | @Varriount ooh, theres an idea |
17:08:34 | * | dalarmmst quit (Ping timeout: 246 seconds) |
17:14:43 | onionhammer | @Varriount sublime mousemap:) |
17:23:57 | * | jonathon joined #nim |
17:26:01 | * | dalarmmst joined #nim |
17:33:26 | * | X67r quit (Ping timeout: 244 seconds) |
17:34:19 | * | X67r joined #nim |
17:47:24 | reactormonk | Varriount, sup |
18:10:55 | * | NimBot joined #nim |
18:13:35 | perturbation | is there a way to convince the "not nil" checker that a reference type returned from new(TConcreteType) is not nil? Some sort of assertion after new? |
18:15:35 | * | NimBot joined #nim |
18:15:55 | Araq | compiler/sempass2.nim already deals with mNew in line 696 |
18:16:08 | perturbation | well, I can kind of cheat |
18:16:11 | Araq | I wonder why the 'not nil' checker isn't affected by this |
18:16:15 | Araq | !lag |
18:16:25 | Araq | Nimbot is back! :-) |
18:16:47 | perturbation | var shaky: ref TFooType = new(TFooType) # defined the not nil reference type as FooType elsewhere and then do: |
18:17:02 | Araq | fix |
18:17:04 | Araq | the |
18:17:06 | Araq | checker |
18:17:07 | Araq | instead! |
18:17:10 | perturbation | if not isNil(shaky) actual: FooType = shaky |
18:17:14 | perturbation | :) |
18:17:16 | perturbation | I'll give it a go |
18:18:15 | perturbation | but I'll probably get stuck somewhere |
18:18:20 | * | perturbation starts to read through sempass2.nim |
18:20:46 | Araq | sempass2 is actually rather simple if you studied compilers and control flow algorithms before ... |
18:21:24 | onionhammer | Varriount it'd be nice if you could help with the idetools thing; Im not enough of a python programmer to figure out why the damn thing hangs when nimsuggest crashes |
18:22:05 | Araq | nimsuggest crashes? that's crazy talk |
18:23:17 | perturbation | Araq: I haven't studied compilers, though I'd like to learn more... current skill level is maybe good enough to do a simple interpreter. Last time I tried I got too caught up in productions, left-factoring and other craziness to get anywhere |
18:23:53 | Araq | oh yeah all this parsing theory that nobody uses anyway |
18:24:47 | Araq | quick, is this still LALR(1) or already LR(1)? |
18:27:05 | perturbation | :( I read through some tutorials on recursive descent, and that looked understandable. But everyone says that shouldn't be used for 'serious' parsers, though I haven't figured out why... bad worst-case behavior? Pathological behavior? |
18:29:23 | SirCmpwn | so this does not work the way I had hoped: https://gist.github.com/SirCmpwn/41338a2c30d2464edef5 |
18:29:28 | SirCmpwn | is there something I can do to change that? |
18:29:52 | Araq | on the contrary, everybody uses recursive decent parsing, perhaps with some modifications for operator precedences etc |
18:30:19 | Araq | nobody uses the old LR(1) parsing stuff |
18:30:29 | notfowl | SirCmpwn depends on what you were hoping for and what it doesn't do |
18:30:35 | * | dalarmmst quit (Ping timeout: 256 seconds) |
18:30:50 | SirCmpwn | well, I didn't want to use a magic string with events.emit("magic string", ...) |
18:31:04 | SirCmpwn | so I was hoping to put it elsewhere, one source of truth for the value of that string |
18:31:11 | SirCmpwn | the enums seemed like it'd work for this, but apparently not |
18:31:18 | Araq | SirCmpwn: don't use the events module, it's nothing to do with async |
18:31:32 | SirCmpwn | async isn't important here |
18:31:38 | SirCmpwn | it's just a means to an end, this isn't a library |
18:31:43 | notfowl | The string value enum is the string representation for that enum value |
18:31:54 | notfowl | It doesnt mean the enum value is a string, its actually 0 |
18:32:03 | SirCmpwn | is there a way to get it? |
18:32:06 | Araq | you can use $ to turn an enum into its string representation |
18:32:08 | notfowl | Yes, $ |
18:32:17 | SirCmpwn | thanks :) |
18:42:32 | * | yglukhov quit (Remote host closed the connection) |
18:42:39 | * | dalarmmst joined #nim |
18:48:18 | onionhammer | Araq yrah i think it also doesnt priperly close the socket when it does too |
18:50:50 | * | jonathon quit (Ping timeout: 240 seconds) |
18:51:38 | * | NimBot joined #nim |
18:52:56 | SirCmpwn | echo("foo: %s" % "bar") |
18:53:01 | SirCmpwn | "cannot be called" |
18:53:03 | SirCmpwn | ? |
18:53:47 | SirCmpwn | no, that's now the problem |
18:54:59 | SirCmpwn | s/now/not/ |
18:56:19 | * | Sornaensis quit (*.net *.split) |
18:56:20 | * | rinukkusu quit (*.net *.split) |
18:56:20 | * | SirCmpwn quit (*.net *.split) |
18:56:20 | * | reactormonk quit (*.net *.split) |
18:56:20 | * | BitR quit (*.net *.split) |
18:56:33 | * | SirCmpwn joined #nim |
18:56:36 | * | reactormonk joined #nim |
18:56:39 | * | rinukkusu joined #nim |
18:57:18 | * | Sornaensis joined #nim |
18:59:16 | SirCmpwn | okay, this is the problem that's confusing me: https://gist.github.com/SirCmpwn/9cc13a5945e3d2f26c0f |
19:01:36 | * | BitR joined #nim |
19:02:02 | Araq | you use the 'do' notation wrong |
19:02:20 | SirCmpwn | :( |
19:02:41 | SirCmpwn | replacing it with proc yields the same result, though |
19:02:47 | SirCmpwn | like so: https://sr.ht/844e3.txt |
19:03:15 | * | NimBot joined #nim |
19:04:00 | Araq | is your clients.events mutable? |
19:04:21 | SirCmpwn | https://sr.ht/eb47.txt |
19:04:40 | SirCmpwn | am I mutating it by using .on? |
19:04:50 | * | wb_ quit (Quit: See y'all around) |
19:04:59 | SirCmpwn | I have another bit of code elsewhere that doesn't give the same error: https://sr.ht/00a3.txt |
19:05:27 | * | pregressive joined #nim |
19:09:19 | Araq | well at this point I need the full program, not snippets |
19:09:23 | SirCmpwn | sure |
19:09:24 | * | Arrrr quit (Quit: WeeChat 1.2) |
19:09:25 | SirCmpwn | one moment |
19:10:11 | SirCmpwn | https://github.com/SirCmpwn/nimworm/tree/demonstrate-nim-problem |
19:10:50 | * | gsingh93 quit (*.net *.split) |
19:10:50 | * | Rush quit (*.net *.split) |
19:10:50 | * | zama quit (*.net *.split) |
19:10:51 | * | jsjoberg quit (*.net *.split) |
19:10:51 | * | xxx quit (*.net *.split) |
19:10:51 | * | max1 quit (*.net *.split) |
19:10:52 | * | bw_ quit (*.net *.split) |
19:11:03 | * | bw_ joined #nim |
19:11:04 | * | jsjoberg joined #nim |
19:11:04 | * | max1 joined #nim |
19:11:10 | * | gsingh93 joined #nim |
19:11:13 | * | zama joined #nim |
19:11:22 | * | xxx joined #nim |
19:12:01 | * | RushPL joined #nim |
19:13:24 | Araq | ugh, 3 files, git clone here I come ... |
19:13:39 | SirCmpwn | sorry to burden you with a whole 3 files :P |
19:17:08 | Araq | er, how do you expect this to work? |
19:17:29 | * | Jesin quit (Quit: Leaving) |
19:17:38 | Araq | RawMessageEventArgs != EventArgs |
19:17:46 | Araq | and 'on' takes EventArgs |
19:17:54 | Araq | the error message could be better though :P |
19:18:47 | SirCmpwn | Araq: I assumed that I could subclass EventArgs so I could pass along additional information to event handlers? |
19:18:55 | SirCmpwn | RawMessageEventArgs is "of" EventArgs |
19:19:02 | SirCmpwn | perhaps I'm not understanding the type system yet |
19:19:26 | Araq | this is not how the subtyping relation works |
19:19:42 | SirCmpwn | can you explain how it does work for me? |
19:20:02 | * | Jesin joined #nim |
19:20:52 | Araq | A <: B doesn't imply F[A] <: F[B] |
19:21:03 | SirCmpwn | you've already lost me |
19:21:12 | SirCmpwn | what is <: supposed to be |
19:21:34 | Araq | the subtype relation |
19:22:01 | Araq | long story short |
19:22:21 | Araq | the parameter type needs to be EventArgs but you're free to use a type conversion in the proc's body |
19:22:41 | SirCmpwn | and declaring it as RawMessageEventArgs* = object of EventArgs |
19:22:44 | SirCmpwn | is correct? |
19:22:56 | Araq | which performs a runtime check cause what you wrote is not typesound |
19:23:13 | Araq | yeah I think so |
19:23:58 | SirCmpwn | this is what I ended up with https://sr.ht/e975.txt |
19:24:02 | SirCmpwn | but this fails to compile as well |
19:24:07 | SirCmpwn | external program failed |
19:24:17 | perturbation | dom96, Araq: incredibly small PR (https://github.com/nim-lang/Nim/pull/3175) for inline images in Forum with rstgen.nim. Took me a lot longer to find cause than I expected, but works now. Tested locally :) |
19:24:25 | SirCmpwn | https://sr.ht/1fce.txt |
19:26:21 | Araq | don't use cast but a type conversion |
19:26:40 | SirCmpwn | how does that work |
19:26:52 | Araq | but that's a nice codegen bug that you found |
19:27:10 | Araq | seriously |
19:27:15 | SirCmpwn | yw |
19:27:16 | Araq | don't use fucking events.nim |
19:27:24 | SirCmpwn | well what if I want events :( |
19:27:44 | SirCmpwn | multiple procs registering for a particular thing that happens |
19:27:50 | SirCmpwn | build it myself? |
19:28:08 | Araq | *shrug* I only use events in UIs when I have to |
19:28:21 | Araq | they fuck up control flow |
19:28:22 | SirCmpwn | for this use-case, it seems like a good design |
19:28:31 | SirCmpwn | this is an IRC client module |
19:28:42 | Araq | fucking up control flow is never a good design in my opinion |
19:28:46 | SirCmpwn | you create a client object, register for the things you care about (and there are lots of things you may not care about), and then hand over control |
19:28:55 | SirCmpwn | I don't think this fucks up control flow |
19:31:53 | Varriount | -_- |
19:32:08 | Varriount | Good morning! |
19:32:12 | SirCmpwn | morning |
19:35:04 | Araq | SirCmpwn: the trick is to not use inheritance but instead the closure's environment. and swoosh you get typesafety for free |
19:35:11 | SirCmpwn | hmm |
19:35:14 | SirCmpwn | that's not going to work |
19:35:27 | SirCmpwn | because the information is in the event emitter and needs to be given to the handler |
19:35:32 | SirCmpwn | they live in different scopes |
19:35:44 | Varriount | SirCmpwn: The events module is really old, so you might be better off making something of our own, or tweaking its source code. |
19:35:50 | SirCmpwn | yeah, I probably will |
19:35:57 | Araq | pretty sure there are mathematical proofs that disagree with you |
19:36:03 | Varriount | For example, it should probably support methods. |
19:36:14 | SirCmpwn | ... |
19:36:20 | Varriount | (runtime dispatch instead of static dispatch) |
19:36:34 | SirCmpwn | w/e, I'll mull this over later |
19:36:34 | Varriount | (for types) |
19:36:45 | SirCmpwn | friend I never get to hang out with is asking me to hang out, so I'm gonna do that |
19:37:07 | Varriount | Ah, well then, have a good hangout. :D |
19:38:26 | Araq | hrm I wonder if saturated arithmetic at compile time is allowed by the spec |
19:38:58 | Varriount | I'd love saturated arithmatic at runtime. |
19:39:14 | Varriount | *sigh* |
19:39:27 | Araq | compiler/saturate.nim ? |
19:39:39 | Araq | ## Saturated arithmetic routines. XXX Make part of the stdlib? |
19:40:29 | Varriount | Oh! Neat. |
19:40:55 | Varriount | Could probably be sped up by intrinsics though. I think I recall GCC having some. |
19:41:14 | Araq | for the stdlib, yeah |
19:41:19 | Araq | in the compiler it's meaningless |
19:41:39 | Varriount | Oh, interesting article: http://locklessinc.com/articles/sat_arithmetic/ |
19:41:47 | Varriount | Branch free saturated arithmatic |
19:41:55 | Araq | ah lockless |
19:42:01 | Araq | these guys know their shit |
19:42:15 | Varriount | Coming from you, that's high praise. :3 |
19:42:54 | * | xificurC quit (Read error: Connection reset by peer) |
19:43:08 | * | yglukhov joined #nim |
19:44:56 | Varriount | Hello yglukhov! |
19:47:30 | * | yglukhov quit (Ping timeout: 260 seconds) |
19:54:53 | perturbation | what's the best debugging solution right now? I was just using gdb with nim --debugger:native to track down this issue with RST and inline images and it works |
19:55:26 | perturbation | but there's a lot of stuff whenever you go into a proc for stack frames and gc that can make it difficult to tell what's going on |
19:55:53 | perturbation | (and using gdb to inspect variables is a bit clumsy unless it's a primitive) |
19:56:00 | Araq | --stackTrace:off --debugger:native ? |
19:56:39 | Araq | but iirc --debugger:native should imply stackTrace:off |
20:01:28 | perturbation | hmm... it does seem to help. Thanks Araq |
20:05:46 | * | xcombelle quit (Quit: Leaving) |
20:07:09 | * | jszymanski quit (Quit: computer sleeps...) |
20:09:46 | Araq | perturbation: I thought the forum disallows submitting images for spam prevention reasons? |
20:10:29 | perturbation | :( |
20:11:02 | perturbation | it's one of the open issues (https://github.com/nim-lang/nimforum/issues/41) and it's otherwise allowed in rstgen? |
20:11:33 | perturbation | but if that's the case, I think we should still fix it in rstgen and then disallow that directive in the forum code |
20:11:46 | Araq | yeah true |
20:17:24 | * | NimBot joined #nim |
20:18:11 | * | minus joined #nim |
20:22:29 | Araq | ping zahary1 |
20:32:43 | * | NimBot joined #nim |
20:40:36 | * | no_name joined #nim |
20:40:37 | * | devzerp joined #nim |
20:45:21 | dom96 | perturbation: nice |
20:45:50 | perturbation | :) |
20:55:07 | onionhammer | Varriount any thoughts? |
21:01:56 | * | jonathon joined #nim |
21:02:44 | jonathon | is there any easier way of converting a Unix timestamp to an RFC822 date (for RSS) than this: |
21:02:53 | jonathon | times.format(times.parse($fromSeconds(1438233545), "ddd MMM dd HH:mm:ss yyyy"), "ddd, dd MMM yyyy HH:mm:ss '+'zz'00'") |
21:03:07 | jonathon | that just seems obtuse |
21:05:24 | * | xificurC joined #nim |
21:06:54 | Araq | seems just right, it's unix. what do you expect? a useful API? |
21:07:29 | Araq | maybe you can pipe it to /usr/bin/tmcnvrt though |
21:07:31 | jonathon | GoLang equivalent: time.Unix(1438233545), 0).Format(time.RFC1123Z) |
21:07:35 | jonathon | :) |
21:08:00 | jonathon | I'm porting an RSS generator I wrote in Go to Nim to see how they compare |
21:08:30 | Araq | maybe you also compare the money that went into both systems :P |
21:08:31 | jonathon | most of the parts are far more concise in Nim, but 'times' is not a handy library |
21:08:34 | jonathon | :P |
21:08:46 | Araq | hint: for Nim this number is close to 0. |
21:09:11 | jonathon | I'm not complaining, it's just when I write something like that I think I'm doing something wrong... |
21:09:20 | jonathon | it just looks so inelegant |
21:10:02 | Araq | you can always PR times.nim |
21:10:23 | jonathon | I might make that a project |
21:10:36 | jonathon | ;) |
21:11:17 | * | NimBot joined #nim |
21:13:48 | jonathon | ah, getGMTime looks to work better: |
21:13:49 | jonathon | times.format(times.getGMTime(fromSeconds(1438233545)), "ddd, dd MMM yyyy HH:mm:ss zz'00'") |
21:14:05 | jonathon | relatively happy with that |
21:16:58 | jonathon | hmm... looks like another bug there too... with getLocalTime, ZZZ == BST, z == 0, which is wrong, should be +1. |
21:16:59 | Varriount | onionhammer: On the tooltip? As I said, I don't think there's a way we could display on mouseover. The best that could be done is on double-click. |
21:17:12 | onionhammer | Varriount no i meant about the crashing issue |
21:17:19 | onionhammer | I got it to work on ctrl+click |
21:17:35 | onionhammer | but I think nimsuggest crashing = sublime crashes |
21:17:47 | onionhammer | not sure how to fix it so i wondered if u could take a look.. if u can get it to work at all |
21:18:26 | Varriount | onionhammer: You know me 'fixing' it would probably mean rewriting it. |
21:18:53 | onionhammer | ha, knock yourself out... |
21:27:40 | * | mal`` quit (Ping timeout: 265 seconds) |
21:29:10 | dom96 | jonathon: const RFC1123Z = "ddd, dd MMM yyyy HH:mm:ss '+'zz'00'" |
21:29:34 | * | yglukhov joined #nim |
21:29:52 | Varriount | onionhammer: Your use of staticmethods is killing me. |
21:30:47 | * | NimBot joined #nim |
21:31:25 | dom96 | jonathon: getGMTime(fromSeconds(1438233545)).format("ddd, dd MMM yyyy HH:mm:ss zz'00'") |
21:31:40 | dom96 | hrm, nimbot seems to be reconnecting a lot |
21:33:09 | * | NimBot joined #nim |
21:33:31 | dom96 | interesting: https://gist.github.com/dom96/3a72afdcf43e6d1dbb04 |
21:34:05 | * | yglukhov quit (Ping timeout: 252 seconds) |
21:36:44 | jonathon | dom96: thanks :) |
21:36:56 | * | mal`` joined #nim |
21:41:20 | * | pregressive quit (Remote host closed the connection) |
22:13:14 | Sahnvour | dom96: about my earlier problem on const arrays. i made you a gist if you wanna look into it https://gist.github.com/Sahnvour/9fb9ef23acbe2b435d40 |
22:24:03 | * | Sahnvour quit (Quit: Leaving) |
22:31:40 | * | unclechu quit (Remote host closed the connection) |
22:45:27 | * | Trustable quit (Quit: Leaving) |
22:48:38 | * | jonathon left #nim (#nim) |
22:56:32 | * | Demos joined #nim |
22:58:06 | * | pregressive joined #nim |
23:22:55 | * | alpaca joined #nim |
23:24:51 | * | NimBot joined #nim |
23:33:33 | * | X67r quit (Quit: leaving) |
23:34:09 | alpaca | hi, everyone! I'm trying to find a way to make documentation for code, generated with macros by `nim doc2` |
23:36:08 | alpaca | i found usage of <CommentStmt>.comment property inside compiler/docgen, but i did not found any way to set this property inside my macro |
23:36:44 | Varriount | alpaca: Could you show us your macro's code? |
23:37:13 | alpaca | is there any documented/proper/tricky way to set it, so `nim doc2` will produce doc with proper comment text |
23:38:18 | Varriount | alpaca: Well, the proper way would be to add the appropriate node to the macro's output? |
23:38:24 | Varriount | er 'output.' |
23:39:41 | alpaca | https://gist.github.com/alpacagh/f3b6728d3b839fce01a8 gist |
23:41:01 | alpaca | it's a rewite of second tutorial's last example to use a single constant tuple instead of multiple constants |
23:46:00 | Varriount | alpaca: It looks like there isn't a way to modify doccomments yet, sorry, |
23:48:09 | alpaca | from compiler/docgen.nim:152 it looks like there is a `comment` property inside of a node (kind=nkCommentStmt) (i did not dig deep enough to find it's definition), but macros.nim::NimNodeObj has no such property |
23:48:12 | Araq | alpaca: yeah I think that part is not yet exposed |
23:48:14 | Araq | *however* |
23:48:23 | Araq | if you can generate the doc comment |
23:48:45 | Araq | you can also write the documentation in a way that doesn't treat me like an idiot ;-) |
23:49:07 | Araq | proc getFoo(): Foo |
23:49:15 | Araq | ## Gets the Foo. |
23:49:27 | Araq | seriously? ;-) |
23:49:55 | alpaca | Araq: well, it would be too simple and give me nothing in terms of nim-knowledge ) |
23:50:43 | Araq | so instead just do something like ## Trivial setters and getters are not documented. Perhaps -- as a Nim programmer -- you can actually read Nim's signatures. |
23:52:03 | alpaca | also, if i'll try to use class-helper macro from by-example tutorial, that could make impossible to doc-comment on class-type itself |
23:52:54 | Araq | yeah that's a very good point |
23:53:00 | Araq | so add this feature, it's not hard |
23:58:46 | * | vendethiel quit (Ping timeout: 246 seconds) |
23:59:11 | alpaca | Any hint where to find a NimNode definition? |