00:01:12 | * | relax quit (Ping timeout: 240 seconds) |
00:01:34 | * | vivus joined #nim |
00:22:39 | FromGitter | <zacharycarter> yeah this is working nicely |
00:22:53 | FromGitter | <FridgeSeal> your node + nim solution? |
00:23:08 | FromGitter | <zacharycarter> yeah it's not as ideal as pure Nim with c backend but it works |
00:23:37 | FromGitter | <zacharycarter> I can orchestrate the entire thing with a single Nim file and it basically just means an extra binary |
00:24:34 | Demos[m] | so I got nim code capturing and saving images from Ethernet at 4 gbps |
00:24:59 | Demos[m] | needs some more debugging, but it was a pleasure to work with |
00:25:31 | Demos[m] | my coworkers are still skeptical |
00:26:30 | FromGitter | <zacharycarter> wow awesome! |
00:28:29 | Demos[m] | I'm tempted to just low key rewrite our calibration code in nim as well. Right now it's C with a hand rolled makefile |
00:28:36 | Demos[m] | which is super annoying |
00:29:48 | FromGitter | <zacharycarter> hire me and I'll help push the nim agenda! |
00:29:49 | FromGitter | <zacharycarter> :P |
00:33:25 | Demos[m] | idk if we're hiring engineers right now? |
00:33:28 | FromGitter | <zacharycarter> nimscript config files always screw me up |
00:33:49 | FromGitter | <zacharycarter> meh I have a job I'm fine with, but I would like to end up somewhere where I can use nim daily |
00:35:17 | FromGitter | <zacharycarter> okay I'm clueless as to how to get nimble to recognize a nimscript file |
00:40:00 | Demos[m] | I'm thinking about trying to build a set of nim macros to generate classes that are ABI compatible with C++ |
00:40:16 | Demos[m] | supporting MSVC will be "fun" |
00:40:39 | Demos[m] | huh maybe clang provides a cxxabi for them |
00:41:50 | FromGitter | <zacharycarter> can anyone shine some light as to where I need to place a nimscript file / how I need to name it for nimble to recognize it? |
00:41:53 | FromGitter | <zacharycarter> here's my directory layout |
00:42:37 | FromGitter | <zacharycarter> http://imgur.com/a/OkxzR |
00:42:42 | FromGitter | <zacharycarter> nimble tasks produces nothing |
00:42:59 | Demos[m] | you can write tasks directly in the nimble file |
00:43:10 | Demos[m] | the compiler also has a tasks feature which I think is seperate |
00:43:15 | FromGitter | <zacharycarter> ah okay |
00:43:19 | Demos[m] | and I forget how to invoke |
00:46:07 | FromGitter | <zacharycarter> me too apparently |
01:06:57 | FromGitter | <zacharycarter> how do you chain tasks with Nimscript |
01:08:07 | FromGitter | <zacharycarter> nm found it |
01:19:28 | * | relax joined #nim |
01:21:08 | Elronnd | the webpage advertises that "Produces dependency-free binaries". I don't see this as a positive. Is it possible to compile nim's stdlib as a shared lib? |
01:31:05 | FromGitter | <zacharycarter> trying to do something like this |
01:31:22 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a766eaba0f0f6e38fec4fd] |
01:31:54 | FromGitter | <zacharycarter> obviously this won't work but something similar is what I"m after |
01:41:01 | * | relax quit (Ping timeout: 240 seconds) |
01:43:04 | * | dddddd quit (Remote host closed the connection) |
02:01:29 | * | ipjk_ joined #nim |
02:02:13 | * | def-pri-pub joined #nim |
02:02:31 | * | yglukhov joined #nim |
02:05:03 | * | ipjk quit (Ping timeout: 252 seconds) |
02:06:57 | * | yglukhov quit (Ping timeout: 248 seconds) |
02:09:01 | Demos[m] | Elronnd: you can use nimrtl to compile some of the more ABI dependent things as a shared lib |
02:20:21 | * | mahmudov quit (Ping timeout: 240 seconds) |
02:20:42 | * | mahsav2 quit (Ping timeout: 240 seconds) |
02:22:05 | * | Nobabs27 joined #nim |
02:32:00 | * | def-pri-pub quit (Quit: leaving) |
03:04:31 | * | endragor joined #nim |
03:21:45 | FromGitter | <zacharycarter> heh |
03:21:55 | FromGitter | <zacharycarter> lil over 500 http requests in 17 seconds |
03:27:56 | FromGitter | <zacharycarter> def overloading the http server |
03:28:11 | FromGitter | <zacharycarter> but it's fast! |
03:35:57 | * | Serenit0r joined #nim |
03:37:48 | * | Crawldragon joined #nim |
03:39:12 | * | Serenitor quit (Ping timeout: 240 seconds) |
03:40:40 | Crawldragon | Can anyone help me with the irc module? |
03:46:40 | * | mahmudov joined #nim |
03:46:46 | * | vivus quit (Quit: Leaving) |
03:52:02 | FromGitter | <zacharycarter> q: what am I supposed to do with bodyStream? |
03:55:07 | * | BigEpsilon joined #nim |
03:55:21 | FromGitter | <Varriount> Crawldungeon: What do you need help with, specifically? |
04:11:22 | * | Crawldragon left #nim (#nim) |
04:15:45 | * | francisl joined #nim |
04:19:37 | * | Nobabs27 quit (Quit: Leaving) |
04:20:03 | FromGitter | <zacharycarter> I feel like I'm close here... |
04:20:17 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a78e80210ac26920dcab3d] |
04:20:49 | FromGitter | <zacharycarter> I get this compile error: |
04:21:21 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a78ec166c1c7c477fc97d5] |
04:27:46 | FromGitter | <zacharycarter> nm I got something else working |
04:28:24 | * | Ven`` joined #nim |
04:47:20 | * | pilne quit (Quit: Quitting!) |
05:04:40 | * | francisl quit (Quit: francisl) |
05:20:29 | * | vlad1777d joined #nim |
05:26:54 | * | livcd quit (Changing host) |
05:26:54 | * | livcd joined #nim |
05:50:36 | * | Pisuke joined #nim |
05:55:48 | * | vlad1777d quit (Remote host closed the connection) |
05:57:18 | * | tdc joined #nim |
06:01:30 | * | BigEpsilon quit (Remote host closed the connection) |
06:01:39 | * | BigEpsilon joined #nim |
06:19:02 | * | tdc quit (Read error: Connection reset by peer) |
06:19:46 | * | tdc joined #nim |
06:21:35 | * | Arrrr joined #nim |
06:21:35 | * | Arrrr quit (Changing host) |
06:21:35 | * | Arrrr joined #nim |
06:33:35 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
06:43:40 | * | Lord_Nightmare joined #nim |
06:44:32 | * | nsf joined #nim |
06:48:34 | * | mahmudov quit (Remote host closed the connection) |
06:56:37 | * | Vladar joined #nim |
06:59:33 | * | cspar_ joined #nim |
07:00:42 | * | cspar quit (Ping timeout: 240 seconds) |
07:06:02 | * | yglukhov joined #nim |
07:14:45 | * | Yardanico joined #nim |
07:21:18 | * | Sentreen quit (Ping timeout: 252 seconds) |
07:34:08 | * | Sentreen joined #nim |
07:39:47 | * | PMunch joined #nim |
07:40:13 | * | nattefrost joined #nim |
07:43:50 | * | claudiuinberlin joined #nim |
07:45:48 | Yardanico | how can I check if it's the end of utf8 string? |
07:45:55 | Yardanico | I'm porting editDistance from strutils to unicode version |
07:46:15 | Yardanico | it's pretty easy, but I don't know how to check if it's the last character in string |
07:47:03 | Yardanico | oh wait |
07:47:06 | Yardanico | it seems I did it |
07:48:14 | Yardanico | https://gist.github.com/Yardanico/2dd5d44197ed8c1266f4371025d56de9 is this implementation optimized or not ? :) I think it's not that well optimized, because I create 2 sequences of runes |
07:48:25 | Yardanico | but it works for unicode |
07:48:29 | Yardanico | lemme check the performance |
07:50:07 | Yardanico | oh |
07:50:27 | Yardanico | strutils distance - ~11ns per iteration, unicode distance - ~190ns per iteration |
07:52:12 | Yardanico | Araq, is this good enough for unicode module? https://gist.github.com/Yardanico/2dd5d44197ed8c1266f4371025d56de9 or if I want to add similar procedure to "unicode" module - I need to implement it more efficiently? |
07:53:13 | Yardanico | It's ~20 times slower than strutils version |
07:53:51 | Araq | meh, not good enough |
07:54:17 | Yardanico | Well I don't know how this works, I just changed a couple of lines to make it work for unicode |
07:59:15 | Araq | you don't need to know, len --> runeLen, s[i] becomes s.runeAt(i) |
07:59:51 | Yardanico | ah, yes, I firsly made it using runeAt |
08:04:18 | * | chemist69 joined #nim |
08:05:54 | * | BitPuffin|osx joined #nim |
08:08:58 | Yardanico | this doesn't work for some reason - https://gist.github.com/Yardanico/98ee4930d0a9de70ba4c9fff931ce05f |
08:09:05 | Yardanico | Should echo "1", echoes "2" instead |
08:09:16 | * | salewski joined #nim |
08:10:15 | Yardanico | hmm, probably I'm doing the wrong check " len1 != s" |
08:11:20 | salewski | Araq, I have the feeling that the reason for my "Error: ambiguous identifier" from forum post is |
08:11:36 | salewski | that I have in my connect macro code like |
08:11:44 | salewski | let wt = getType(widget) |
08:11:53 | salewski | let at = getTypeInst(arg) |
08:12:08 | FromGitter | <GULPF> @Yardanico isn't that usage of runeAt wrong? it takes a byte offset as argument, not a rune offset |
08:12:11 | salewski | let wts = ($(wt[1].toStrLit)).replace(":ObjectType") |
08:12:14 | Yardanico | ah, yes |
08:12:25 | salewski | let ats = $at.toStrLit |
08:12:31 | Yardanico | but then |
08:12:42 | Yardanico | "runeAtPos" documentation says "Beware: This can lead to unoptimized code and slow execution! Most problems are solve more efficient by using an iterator or conversion to a seq of Rune." |
08:12:47 | salewski | All that gave me strings, which I use for type cast. |
08:12:52 | Araq | these inc(s) are also wrong |
08:13:04 | salewski | But all the strings have no mudule name prefix. |
08:13:06 | Araq | you need to increment by the current rune length |
08:13:12 | Yardanico | ah |
08:13:24 | salewski | And from macros module I can see no way go get a module name prefix. |
08:13:27 | * | yeeve__ quit (Quit: Leaving) |
08:13:57 | Araq | and yeah, don't use runeAtPos |
08:14:28 | Araq | salewski: what do you then do with 'ats'? |
08:15:03 | salewski | It is used for type safe casting. |
08:15:48 | salewski | Gobject callbacks works with plain pointers, but I try to get type safety at compile time. |
08:18:15 | salewski | All that is visible in https://github.com/StefanSalewski/gintro/blob/master/gintro/gimpl.nim#L30 |
08:18:46 | salewski | I think it is easy for me to reproduce the problem in a small stand alone code, |
08:19:09 | salewski | but from that code it will be not really clear WHY I need that. |
08:22:57 | salewski | I guess it may help to introduce an intermediate type like "type temp = type(wiget)" |
08:23:36 | salewski | I think I tried something like that some months ago... |
08:27:40 | Araq | building the ASTs by string concats is bad, please use the AST API |
08:28:59 | salewski | OK, but I think using AST API is much more difficult and much more work. |
08:29:15 | Araq | you can think that, but it's wrong |
08:29:35 | PMunch | It's a bit more work when you've never done it before |
08:29:45 | PMunch | Since you have to learn something new |
08:30:32 | Araq | if ahl.find(";") > 0: |
08:30:32 | Araq | ahl = "(self: " & wts & ";" & ahl.split(";", 1)[1] |
08:30:50 | Araq | that's much more difficult code because it works on the wrong level of abstraction |
08:31:07 | PMunch | Have a look at dumpAstGen salewski, it might help with generating code :) |
08:31:20 | Yardanico | or quote do :) |
08:31:21 | Araq | PMunch: was that merged? |
08:31:22 | salewski | OK, I will try AST API... |
08:31:34 | PMunch | I think so |
08:32:26 | PMunch | Yup: https://github.com/nim-lang/Nim/blob/devel/lib/core/macros.nim#L738 |
08:33:17 | PMunch | Apparently it was even you who merged it |
08:34:58 | FromGitter | <Grabli66> Hi. I have: ⏎ type MyInt = distinct int ⏎ What code i need to write, to make this code valid? ⏎ let d : MyInt = 30 [https://gitter.im/nim-lang/Nim?at=59a7ca32614889d475a6552b] |
08:35:16 | salewski | Yes, dumpAstGen may make learning easier, I will try... |
08:35:20 | salewski | Bye. |
08:35:31 | FromGitter | <Yardanico> @Grabli66 let d = MyInt(30) |
08:35:36 | FromGitter | <Yardanico> or let d = 30.MyInt |
08:36:26 | FromGitter | <Grabli66> Yes. But i want ⏎ let d : MyInt = 30 ⏎ Is it possible? |
08:36:31 | FromGitter | <Yardanico> converters |
08:36:41 | Yardanico | it is possible, but not very recommended |
08:36:54 | FromGitter | <Grabli66> How? |
08:37:28 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7cac8162adb6d2e5199d6] |
08:39:23 | FromGitter | <Grabli66> Cool. Thanks. I did not see converters in documentation |
08:40:03 | Araq | that code is backwards, use let d = MyInt(30) |
08:40:46 | Yardanico | well yeah, it's really better to use normal type conversion |
08:41:18 | FromGitter | <Grabli66> It will be deprecated? |
08:42:12 | Araq | no, but if you want let d: MyInt = 30 then don't use a 'distinct' type |
08:43:15 | Araq | you cannot have it both ways, "I'm hiding the fact that MyInt is an int" and "MyInt is compatible with ints" |
08:43:16 | FromGitter | <Grabli66> But I want borrow some proc from int |
08:47:02 | * | salewski quit (Quit: WeeChat 1.4) |
08:47:40 | FromGitter | <Grabli66> I want type that has some procedures from int, and can be assigned from int, float, etc. But not int. It has no practical use right now. I just want see possibilities of nim |
08:47:59 | Yardanico | well you can borrow procedures as usual |
08:49:54 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:53:22 | * | nsfw_ joined #nim |
08:53:32 | nsfw_ | good morning |
08:55:33 | FromGitter | <Grabli66> Another noob question. Can i use async proc in thread? Every thread has it's own mainloop? |
08:56:30 | * | claudiuinberlin joined #nim |
08:58:38 | * | Matthias247 joined #nim |
09:02:10 | Yardanico | yes you can |
09:02:17 | Yardanico | but your async procedures need to be gcsafe |
09:02:27 | Yardanico | so no global variables (only raw pointers and channels) |
09:07:58 | * | dom96|w joined #nim |
09:10:17 | nsfw_ | hey how can I add flags to gcc when I compile with nim ? (for example -g) |
09:10:32 | Yardanico | nsfw_, --passC:"flags to compiler" --passL:"flags to linker" |
09:10:35 | Yardanico | e.g. |
09:10:49 | Yardanico | nim c --passC:"-fopenmp" --passL:"-fopenmp" file.nim |
09:10:57 | nsfw_ | thanks! |
09:11:24 | Yardanico | you can also put these flags into nim.cfg |
09:11:28 | Yardanico | of your project |
09:12:09 | * | gangstacat joined #nim |
09:15:32 | * | Ven`` quit (Ping timeout: 260 seconds) |
09:16:12 | * | Ven`` joined #nim |
09:19:10 | Yardanico | how can I create a macro, which will generate "case" statement, to use it like that? let data = genCaseStmt() |
09:21:05 | * | crem quit (Ping timeout: 246 seconds) |
09:22:42 | * | crem joined #nim |
09:27:20 | FromGitter | <Grabli66> Question about javascript target. Can nim compiler generate map file for debuging in browser? Because javascript code that produced nim is not readable, i think. |
09:27:53 | Yardanico | I don't think so |
09:28:00 | Yardanico | but I've never really used JS target |
09:28:03 | Yardanico | so maybe it does |
09:32:07 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:36:31 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
09:37:28 | * | claudiuinberlin joined #nim |
09:38:26 | Yardanico | Does nimsuggest have some memory leaks? |
09:40:35 | Araq | it most certainly has but I don't know where |
09:41:06 | Yardanico | because it took up all my RAM a few times |
09:41:10 | Araq | grabli66: you get Nim specific lineinfo in the stack traces |
09:51:56 | Yardanico | what can I do to solve "error expression ... has to be discarded" if I want to store result of case statement in let variable? |
09:52:53 | Yardanico | so my case statement checks if string equals to some of strings, and then makes a call to the procedure (in case statement) |
09:53:01 | Yardanico | and I want to store result of this call in let variable |
09:54:52 | flyx | Yardanico: make the case statement a case expression. |
09:54:59 | Yardanico | flyx, oh |
09:55:15 | Yardanico | how? |
09:55:19 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:55:21 | flyx | let foo = case bla\n of "hurr": "durr"\n of "etc": … |
09:55:28 | Yardanico | there's only nnkCaseStmt kind |
09:55:30 | Yardanico | no nnkCaseExpr |
09:55:42 | flyx | https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression |
09:56:04 | Yardanico | yeah if I do this manually - it works |
09:56:08 | Yardanico | but it doesn't work if I do it with a macro |
09:57:53 | Araq | Yardanico: bug report? |
09:58:24 | * | claudiuinberlin joined #nim |
09:58:27 | Yardanico | Araq, well I'll try to make small snippet, most probably I'm doing something wrong |
10:00:22 | FromGitter | <ephja> Yardanico: https://gist.github.com/ephja/70375009b9b6de00e3e115e3d7682ec2 |
10:00:58 | Yardanico | lol |
10:01:51 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
10:03:49 | Yardanico | what is wrong here? https://gist.github.com/Yardanico/bffc661fd9e777c783c561a71d949199 this is what I'm trying to do |
10:06:17 | * | dom96|w joined #nim |
10:07:21 | Yardanico | oh wait! |
10:07:23 | Yardanico | I fixed it |
10:07:44 | Yardanico | It was generating "else: discard" |
10:07:54 | Yardanico | if I change it to else: "someString" it works |
10:16:13 | Yardanico | well error message was a bit dissapointing but it was my fault nonetheless :) |
10:26:04 | * | ShalokShalom_ joined #nim |
10:28:26 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:28:42 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
10:30:56 | * | ShalokShalom_ is now known as ShalokShalom |
10:48:10 | * | Serenit0r quit (Quit: Leaving) |
10:51:39 | * | couven92 joined #nim |
10:52:14 | * | yglukhov quit (Remote host closed the connection) |
10:53:09 | * | yglukhov joined #nim |
10:56:57 | couven92 | Araq? leftAlign... you said to make it support unicode? No problem, but why? Many of the other related procs in strutils aren't in unicode either? |
10:57:52 | Araq | which ones? these should all move to unicode.nim |
10:58:24 | couven92 | i was kinda afraid you'd say that :P |
10:59:03 | couven92 | should I make a major "we're moving to unicode" PR? |
10:59:13 | * | yglukhov quit (Ping timeout: 248 seconds) |
11:00:40 | Araq | I know you'll enjoy it, so yeah |
11:00:47 | couven92 | :D |
11:01:07 | couven92 | Should we keep the strutils procs? |
11:01:27 | Yardanico | well yeah |
11:01:32 | Yardanico | for another 1-2 years of deprecation :) |
11:01:49 | couven92 | right, else it would break everyone's code, sorry wasn't thinking |
11:05:03 | FromGitter | <BigEpsilon> @Araq, Hi ! I have made a PR to add the support for integer template parameter to c2nim : https://github.com/nim-lang/c2nim/pull/95 . ⏎ Now there is another feature that I want to add but I don't know if it is interesting for you also (so I integrate it to c2nim) or if I make an external tool. ⏎ The feature is to regroup all type definition in one typeSection at the start of the module in order to avoid the |
11:05:03 | FromGitter | ... problems that arise form the absence of forward declaration for type when translation from c/c++ to nim. ⏎ So do I try to add it to c2nim or I make an external tool (the easiest being a macro) ? [https://gitter.im/nim-lang/Nim?at=59a7ed5fc101bc4e3a764117] |
11:12:39 | Araq | c2nim feature please |
11:13:29 | FromGitter | <BigEpsilon> ok |
11:15:52 | * | Snircle joined #nim |
11:16:17 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:22:14 | * | mahsav joined #nim |
11:43:09 | * | dom96|w joined #nim |
11:44:38 | * | claudiuinberlin joined #nim |
11:44:48 | * | BitPuffin|osx joined #nim |
11:49:13 | FromGitter | <zacharycarter> hrm exception handling with async / await with multiple futures seems tircky |
11:50:43 | * | xet7 quit (Quit: Leaving) |
11:50:49 | Yardanico | store all futures in a sequence, "yield" all futures and iterate over all futures checking if they failed? |
11:51:00 | Yardanico | hmmm no |
11:51:11 | Yardanico | probably you wouldn't have concurrent requests with this approach |
11:51:30 | FromGitter | <zacharycarter> this is what I have right now |
11:51:48 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7f854ba0f0f6e38011d59] |
11:52:09 | FromGitter | <zacharycarter> if any of the getDealerProfile calls fail, the exceptions go uncaught |
11:52:49 | FromGitter | <Yardanico> you can check for errors in s[i] callback |
11:53:27 | FromGitter | <zacharycarter> thanks |
11:53:48 | FromGitter | <zacharycarter> how exactly? |
11:54:05 | FromGitter | <zacharycarter> oh I see |
11:54:17 | FromGitter | <Yardanico> in callback something like "if s[i].failed: do stuff" |
11:54:37 | FromGitter | <Yardanico> but if you want to get full traceback - you need to reraise exception in callback and capture getCurrentExceptionMsg of it |
11:55:08 | FromGitter | <zacharycarter> gotcha thanks Daniil |
11:55:36 | FromGitter | <zacharycarter> btw I'm constantly impressed by how fast you picked up Nim and became an expert :P |
11:56:22 | Yardanico | well I'm far from being an expert :D |
11:56:44 | Yardanico | I just use async stuff a lot (my bot for a social network is async) |
11:57:21 | Yardanico | I use nim mostly like a high-level language |
11:57:28 | Yardanico | like Python or Java |
11:57:31 | FromGitter | <zacharycarter> right |
12:00:22 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:03:33 | FromGitter | <zacharycarter> hrm that worked when I had no connection to the host name |
12:03:41 | * | claudiuinberlin joined #nim |
12:03:48 | FromGitter | <zacharycarter> but now 404 errors are being thrown and somehow blowing up my excepion handling code |
12:05:44 | dom96|w | why are you implementing your own `all`? |
12:05:49 | dom96|w | Don't we have that in asyncdispatch? |
12:06:25 | FromGitter | <zacharycarter> I don't know |
12:06:28 | FromGitter | <zacharycarter> I got this example from the forum |
12:06:45 | dom96|w | I see :) |
12:06:58 | dom96|w | I also only see you handling the errors thrown by `to` |
12:07:32 | FromGitter | <zacharycarter> hrm okay I found all ;) |
12:07:35 | FromGitter | <zacharycarter> thanks for the protip |
12:10:00 | Yardanico | also - future "all" from asyncdispatch will fail if at least one of other futures failed to complet |
12:10:03 | Yardanico | complete |
12:10:49 | FromGitter | <zacharycarter> so am I forced to iterate over yields? |
12:10:58 | FromGitter | <zacharycarter> err iterate over my futures and yield? |
12:11:22 | Yardanico | well do you want to handle all errors separately? |
12:11:53 | FromGitter | <zacharycarter> nope |
12:12:34 | dom96|w | just need to yield the future that `all` returns |
12:12:38 | dom96|w | then check it for errors |
12:12:45 | FromGitter | <zacharycarter> gotcha |
12:13:07 | Yardanico | hmm, Is it bad or good if I'm echoing GC_getStatistics() and number of stack scans and stack cells is raising? |
12:13:26 | Yardanico | does it mean I have something like memory leak? |
12:13:32 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:13:49 | Yardanico | dumpNumberOfInstances doesn't show names for many "ref" instances |
12:14:11 | FromGitter | <zacharycarter> oh so all is an all or nothing thing |
12:14:25 | FromGitter | <zacharycarter> I didn't get what you meant yardanico but I do now |
12:14:55 | Yardanico | well it's a question about GC, I've just asked, maybe someone here can give me an advice about it :) |
12:15:06 | Yardanico | not you exactly |
12:15:21 | FromGitter | <zacharycarter> err I meant in reference to the asyncdispatch.all thing |
12:15:26 | Yardanico | ah |
12:16:31 | Yardanico | so imagine you have 10 futures, and 2 of them failed to execute. there still would be only one error in future what you've got from all() call |
12:16:43 | * | claudiuinberlin joined #nim |
12:17:41 | FromGitter | <zacharycarter> yeah |
12:17:49 | FromGitter | <zacharycarter> but can I still retrieve the results of the other futures? |
12:17:56 | Yardanico | yes |
12:18:00 | FromGitter | <zacharycarter> oh okay cool |
12:20:07 | FromGitter | <zacharycarter> how do I do that exactly |
12:20:23 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a7ff07bc46472974dfe3d7] |
12:20:51 | FromGitter | <Yardanico> they all will be in "rest" sequence |
12:20:58 | livcd | Ahh i am thinking about buying the nim book from Manning |
12:21:02 | livcd | though the price is steep |
12:21:14 | FromGitter | <zacharycarter> that's what I figured but they all say they're unfinished |
12:21:21 | FromGitter | <zacharycarter> and aren't returning string values when I dump them |
12:21:54 | FromGitter | <Yardanico> ah sorry |
12:22:01 | FromGitter | <Yardanico> ---If the awaited futures are not ``Future[void]``, the returned future--- ⏎ ⏎ ## will hold the values of all awaited futures in a sequence. |
12:22:44 | FromGitter | <Yardanico> so you can "echo fut.read()" and it would echo values of all awaited futures |
12:22:50 | FromGitter | <Yardanico> but I'm not 100% sure |
12:23:23 | FromGitter | <zacharycarter> gotcha |
12:29:47 | Yardanico | hmm, I saw on the forum post about choosing GC for your application (benefits of each GC in Nim) |
12:29:52 | Yardanico | can't find it now :P |
12:31:11 | FromGitter | <ephja> how much metaprogramming is too much? :-) |
12:31:23 | Yardanico | hmm, I don't know really :) |
12:32:00 | livcd | ask in #lisp |
12:35:35 | Yardanico | Araq, what is better in terms of RAM usage? default GC or mark & sweep GC? |
12:35:49 | Araq | default |
12:36:37 | couven92 | do we have contains for openarray? |
12:37:11 | Yardanico | couven92, yes |
12:49:20 | * | dddddd joined #nim |
12:52:37 | * | ShalokShalom quit (Remote host closed the connection) |
12:58:22 | PMunch | ephja, I've actually given that some thought. I feel like metaprogramming that introduce a DSL is fine, but if you pass something that looks like Nim code the macro should just execute it as Nim code. I think it's Jester which actually replaces return statements with something else, which is super confusing as it means it doesn't work with templates :S |
12:59:21 | Araq | PMunch: but by design everything "looks like Nim code" |
12:59:39 | Araq | we do not let you introduce new tokens, for example |
13:00:05 | PMunch | That's true |
13:00:06 | * | nsf quit (Quit: WeeChat 1.9) |
13:00:26 | Yardanico | Araq, I'd say nim syntax is VERY flexible: https://github.com/Yardanico/nimpylib/blob/master/examples/example2.nim |
13:00:34 | PMunch | But genui for example doesn't look like Nim code. Or at least not anything with program flow in it |
13:00:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:01:38 | Yardanico | I'll (ab)use generics to remove the need for creating objects manually |
13:01:50 | Yardanico | *object types |
13:02:46 | Araq | PMunch: jester might be bad, never used it too much to have an opinion on it |
13:03:15 | PMunch | It's pretty neat, but the fact that it messes with control flow had me a bit bummed |
13:03:33 | Araq | meta programming is bad when you use it to "patch" Nim to look like your favourite language, like nimpylib |
13:04:06 | Araq | or for example to define '+' for strings; Nim uses & instead, accept it, it's done for good reasons. |
13:04:24 | PMunch | I actually thought about making a PR changing it to wrapping all the routes in a route block and instead of doing return one should use "break route", and then the route can do the other stuff outside the route instead of replacing return statements. |
13:04:26 | Araq | and it's bad when the transformations are not clearly documented. |
13:04:39 | PMunch | Yeah |
13:05:19 | PMunch | That's why I tried to keep genui as 1:1 transformation as possible. To make it really obvious how it converts your code into it's output |
13:05:44 | Yardanico | Araq, well python isn't my favourite language, I'm doing nimpylib "for fun" |
13:05:56 | Araq | oh, don't get me wrong |
13:06:16 | Araq | it's a super cool fun project, just not something I would use in production |
13:06:22 | Yardanico | well yeah :) |
13:07:05 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:07:28 | Araq | PMunch: what I did for karax and I encourage in general is at the end of the macro: |
13:07:39 | Araq | when defined(debugKaraxDsl): echo repr result |
13:07:49 | Araq | with project specific defines of course |
13:08:09 | Araq | in fact, I'd probably make this mandatory in large projects |
13:08:29 | Araq | is so nice to produce code listings after specific transformations |
13:08:35 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:08:40 | Araq | all the magic disappears ;-) |
13:09:53 | PMunch | Oh yeah, I was thinking about doing that for genui as well. Currently it just has a commented out piece of code serving the same purpose :P |
13:10:36 | PMunch | Does Nim have a way to get the most expanded Nim code before it goes off to the C transformation part? |
13:11:23 | Araq | no and it's not clear how that feature should work |
13:11:55 | Araq | I can make the compiler split out 60_000 lines of Nim code that actually hit the codegen |
13:12:03 | Araq | but that seems stupid |
13:12:50 | PMunch | Hmm, where does all the "extra" lines come from? |
13:13:12 | Araq | well the compiler is larger than 60K lines |
13:13:31 | Araq | I just picked some random largish number |
13:14:48 | PMunch | So let's say I create a small "hello, world" program. In it i include a macro that let's say changes the echo to myEcho, a dummy wrapper function for the regular echo. Would that generate a lot of lines? |
13:15:57 | Araq | I don't know how it should work. it could output system.nim after the transformations... see the problem? |
13:16:39 | * | rosshadden joined #nim |
13:16:57 | PMunch | Hmm, yeah it would produce a lot of output. But it might still be useful. After all you can just search for your procedure name in the file |
13:17:31 | PMunch | It's not meant for everyday use, just that one of thing where you really can't figure out what the compiler is doing that makes it fail. |
13:20:58 | * | dom96|w joined #nim |
13:22:46 | Araq | actually, we already have macros.expandMacros |
13:23:39 | Araq | annotate your code with that to see the results |
13:24:02 | * | vlad1777d joined #nim |
13:25:55 | PMunch | Huh, that's nifty |
13:30:43 | couven92 | How do I get the length of a single Rune without creating a temporary string with the rune in it? |
13:36:54 | PMunch | couven92, https://nim-lang.org/docs/unicode.html#runeLenAt,string,Natural |
13:36:59 | PMunch | Doesn't that work? |
13:37:10 | couven92 | Nope, need a string for that one |
13:37:15 | couven92 | I have a single Rune value |
13:37:37 | couven92 | I'm conjuring a runeLen overload into existance right now |
13:50:55 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:53:16 | * | relax joined #nim |
13:56:04 | * | nsfw_ quit (Quit: Leaving.) |
14:01:33 | Araq | couven92: there is some runeAt thingie that returns the Rune as well as its length iirc |
14:03:13 | couven92 | Araq, not as far as I can see... Well, I created one now and moved the runeLenAt implementation to a new `proc runeLen(r: Rune): int` instead |
14:04:14 | Araq | er actually there is runeAt and runeLenAt |
14:04:32 | Araq | no need to patch unicode.nim |
14:07:03 | couven92 | Araq, but none of those give me the byte length for a single Rune value, they only work when you have a rune in a string |
14:08:37 | Araq | and that's what you have? |
14:08:44 | Araq | a rune in a string. |
14:09:01 | Araq | or are you not working on editDistance anymore? |
14:09:36 | couven92 | Ah, no... I am porting split, rsplit and strip to unicode |
14:10:12 | couven92 | I can't do editDistance, I don't understand the maths of it, and I have no idea whats going on there :P |
14:19:10 | * | claudiuinberlin joined #nim |
14:19:46 | PMunch | Ooh, editDistance |
14:19:48 | PMunch | Interesting |
14:20:22 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
14:20:39 | couven92 | PMunch, yeah, Araq wants me to implement unicode support for that... I have no idea how, what about you? |
14:21:05 | PMunch | Hmm |
14:21:33 | PMunch | Shouldn't be too hard |
14:22:58 | * | claudiuinberlin quit (Read error: Connection reset by peer) |
14:23:43 | Araq | couven92: you do not have to understand it, it's a mechanical transformation |
14:24:21 | Araq | split, rsplit and strip are all Unicode ready, maybe strip is not |
14:25:12 | couven92 | Araq, let's see how PMunch fares... I am finishing strip right now... After that I might go back to editDistance :) |
14:25:29 | PMunch | Well I'm still at work atm |
14:25:33 | couven92 | :D |
14:26:23 | Yardanico | couven92, I've ported editDistance, but in a very inefficient way |
14:26:31 | PMunch | But yeah, with the version already implemented for ASCII it should just be a simple matter of converting it to use Runes instead of characters |
14:26:53 | Yardanico | well if you want speed you should still use byte indexes |
14:28:08 | * | Jesin quit (Quit: Leaving) |
14:28:43 | couven92 | Yeah, I'll pick it up... I familiarized myself with unicode.nim now... should probably be able to do it now |
14:30:12 | PMunch | Yardanico, Yeah with couven92's new runeLen it should be a simple matter of a loop that reads out a runes and jumps that far into the sequence |
14:30:26 | Yardanico | PMunch, well I've ported, by my version was ~20 times slower |
14:30:41 | PMunch | Wowzer, that's not good |
14:30:56 | Yardanico | PMunch, this version - https://gist.github.com/Yardanico/2dd5d44197ed8c1266f4371025d56de9 |
14:31:08 | Yardanico | it's slow because I take sequence of runes in two strings to a variable |
14:32:07 | FromGitter | <ephja> wouldn't it be better if it took two rune sequences? |
14:32:45 | PMunch | Depends, if the user has those lying around sure |
14:32:48 | FromGitter | <ephja> or iterators, but I dunno if that's feasible atm |
14:34:28 | PMunch | Yardanico, what data did you test with? |
14:34:42 | FromGitter | <ephja> it depends on whether or not it's even worth having two versions |
14:34:50 | Yardanico | PMunch, two ascii strings with 6 characters and two unicode strings with 6 unicode characters |
14:35:10 | * | crem quit (Ping timeout: 264 seconds) |
14:35:32 | * | crem joined #nim |
14:35:43 | PMunch | Well, I'm off now. Be home in not too long |
14:35:46 | * | PMunch quit (Quit: Leaving) |
14:36:00 | FromGitter | <ephja> in any case, I'm sure it's possible to reduce repetition for creating both ascii and unicode variations |
14:37:24 | * | vlad1777d quit (Remote host closed the connection) |
14:49:34 | * | nsf joined #nim |
14:55:41 | Yardanico | btw, why not remove stale branches? |
14:55:45 | Yardanico | or they're still useful? |
14:56:20 | * | miran joined #nim |
14:56:43 | * | nattefrost quit (Remote host closed the connection) |
14:57:38 | Yardanico | this has no new commits comparing to devel for example - https://github.com/nim-lang/Nim/tree/more_concurrency |
14:58:06 | Yardanico | or this - https://github.com/nim-lang/Nim/tree/fix-5383 |
14:58:17 | Yardanico | https://github.com/nim-lang/Nim/tree/feature/async-streams |
15:07:33 | Araq | I can't remember git's syntax for removing (remote) branches and so they are not touched |
15:10:32 | * | Matthias247 joined #nim |
15:11:23 | FromGitter | <BigEpsilon> @Araq, I have a question, I want to implement the feature that I talked about in c2nim, which is an option to regroup all type declarations at the beginning of the file to avoid errors due to forward declaration. However I want to be sure about one point |
15:11:47 | FromGitter | <BigEpsilon> My idea is to take only the type declarations at the top level |
15:12:06 | FromGitter | <BigEpsilon> ie direct children of the statement list |
15:12:25 | FromGitter | <BigEpsilon> and not recurse to lower levels |
15:13:01 | FromGitter | <BigEpsilon> (ie type declaration nested in when conditions and such) |
15:13:56 | FromGitter | <BigEpsilon> is it the right thing to do or do you think I should take ALL type definitions, even the ones not at the top level ? |
15:14:35 | * | EastByte quit (Quit: WeeChat 1.9) |
15:14:55 | Araq | only the top level is the right thing and in fact Nim's upcoming {.reorder: on.} pass does the same |
15:15:20 | FromGitter | <BigEpsilon> ok thanks then I'll do that |
15:15:37 | * | EastByte joined #nim |
15:16:32 | * | solitude joined #nim |
15:17:21 | FromGitter | <BigEpsilon> didn't know about the reorder pragma |
15:17:37 | Araq | it is new |
15:21:19 | FromGitter | <BigEpsilon> hmmm I does it still make sense to implement that feature then ? maybe not |
15:23:36 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:24:32 | * | dom96|w joined #nim |
15:24:40 | FromGitter | <ephja> ```template t: typedesc = ⏎ static: ⏎ if true: int8 else: int16 ⏎ var x: t()``` ⏎ ⏎ this doesn't work with `if`, `case` etc; only with `when`. how could I fix that? [https://gitter.im/nim-lang/Nim?at=59a82a3766c1c7c477ff7097] |
15:28:16 | Araq | BigEpsilon: well you need make reorder work with type sections properly then |
15:28:23 | FromGitter | <ephja> well, of course it doesn't work with 'static'. it's just something I tried, but it doesn't work without it either |
15:28:25 | Araq | currently it's not fully implemented |
15:28:52 | Araq | ephja: It can only work with 'when', types have no runtime representation |
15:30:13 | couven92 | Araq, here it comes: https://github.com/nim-lang/Nim/pull/6301 |
15:32:14 | Yardanico | well I think in the future we'll need to create all strutils procedures for unicode :) |
15:32:19 | Yardanico | even things like "isNumeric" |
15:33:16 | couven92 | Yardanico, well some of the strutils procs are unicode compatible because they don't deal with length of indivisdual characters |
15:33:23 | Yardanico | couven92, yeah I know |
15:33:29 | Yardanico | but we at least should mark them as such |
15:33:53 | Araq | not 'some', most :P |
15:34:02 | couven92 | ah, yeah, a unicodeCompatible pragma would be nice! :) |
15:34:14 | Yardanico | well it would strange to have separate modules |
15:35:07 | couven92 | well that's live! At least unicode only has stuff that deals with unicode! So you will probably always still need thing from strutils |
15:35:07 | * | solitude quit (Remote host closed the connection) |
15:35:19 | couven92 | s/live/life |
15:35:47 | Yardanico | well all unicode procedures can accept usual ascii characters |
15:35:54 | Yardanico | expect maybe they'll have less performance |
15:37:36 | couven92 | Yardanico, not really... You'll need a rune value for the unicode procs... Yes, they'll deal fine with ASCII-only strings, but you still get Runes out of that |
15:38:02 | Yardanico | couven92, well string is convertible to seq[Rune] |
15:38:05 | Yardanico | and seq[Rune] to string |
15:38:23 | couven92 | but still with `$`, right? |
15:38:47 | Yardanico | well this can be done using templates or wrapper procs :) |
15:39:03 | couven92 | Wll, you still have to conciously do it |
15:39:06 | Yardanico | current unicode procedures accept strings |
15:39:11 | Yardanico | for example isTitle |
15:39:34 | Yardanico | and there's isUpper both for string and rune |
15:39:51 | Araq | couven92: ugh, I don't remember telling you to rewrite unicode.nim |
15:39:54 | Yardanico | and they use runeCheck template |
15:40:36 | Yardanico | so we can probably reuse runeCheck for other things too |
15:40:47 | couven92 | Araq: :D sorry, I didn't actually... I just converted the int arrays to Rune arrays... That makes more sense, right? |
15:41:09 | Yardanico | maybe this has less performance? but IDK really |
15:41:31 | couven92 | Yardanico, no it doesn't because of `type Rune = distinct int32` |
15:43:37 | Yardanico | hmmm, would it be possible to implement things like isNumeric without including whole unicode characters DB into nim stdlib? |
15:43:39 | FromGitter | <ephja> Araq: it would be like 'when' but for 'case' for exhaustive checks |
15:44:21 | Araq | couven92: the conversions are ok but the rest seems a bit messy |
15:45:28 | couven92 | Araq, like what? I have more or less copied code from strutils and made slight changes where needed |
15:47:03 | * | BitPuffin|osx joined #nim |
15:47:47 | Araq | like the fact you choose openArray[Rune] for what used to be a set |
15:48:25 | couven92 | well... since Rune is a int32, you cannot use `set[Rune]` can you? |
15:50:19 | FromGitter | <ephja> should the semantic pass preserve nkStmtListType nodes? |
15:50:36 | * | Trustable joined #nim |
15:50:37 | couven92 | and being able to pass in more than one character/Rune is certainly useful and what you'd expect from similar procs and APIs in other languages |
15:51:30 | Araq | probably we want openArray[(Rune, Rune)] to support ranges? |
15:51:50 | couven92 | Hmm... might be a nice addition |
15:52:21 | couven92 | anyways... I gotta catch the bus, but I'll stay online on Gitter |
15:52:29 | Araq | I think we should have an abstract RuneSet with a macro that construct these for us |
15:52:41 | couven92 | that WOULD be cool! |
15:54:05 | * | couven92 quit (Quit: Client disconnecting) |
15:54:24 | Araq | or we do type RuneSet = proc (r: Rune): bool {.nimcall.} and hope for clang/gcc to inline indirect function calls |
15:54:39 | Yardanico | Araq, if I want to implement something like isNumeric for unicode module - I'll need to add whole range of numeric values as an array? |
15:54:59 | Araq | Yardanico: that's what we're discussing |
15:55:08 | Yardanico | Araq, ah :) |
15:55:33 | Araq | bbl |
15:56:17 | * | PMunch joined #nim |
15:58:13 | FromGitter | <couven92> What about an @ macro that transforms a set expression to an array (or seq maybe) of Rune? |
15:58:30 | Yardanico | oh |
15:58:30 | Yardanico | https://hg.python.org/cpython/file/99f5a0475ead/Objects/unicodetype_db.h |
15:58:56 | Yardanico | we careful - 3.5k lines |
15:58:59 | Yardanico | *be |
15:59:15 | FromGitter | <couven92> Like @{'0'..'9'} |
15:59:37 | Yardanico | It seems that python toNumeric has (!!) 1300 lines of case statements |
15:59:55 | Yardanico | to return numeric value of unicode character |
16:00:00 | FromGitter | <couven92> Not gonna do that! |
16:00:22 | Yardanico | well I think it's not easy to represent them as ranges |
16:00:34 | FromGitter | <couven92> Why not? |
16:02:14 | Yardanico | ah, yeah, it would be possible, but still will be huge :) |
16:02:49 | Yardanico | Oh my god, there's so many unicode characters representing digits |
16:04:17 | * | Sentreen quit (Ping timeout: 248 seconds) |
16:04:48 | FromGitter | <couven92> Yup |
16:05:14 | FromGitter | <couven92> But range do make that easier to handle |
16:05:21 | * | Ven`` quit (Ping timeout: 248 seconds) |
16:05:36 | FromGitter | <couven92> What do you think about my @ idea? |
16:05:41 | * | Ven`` joined #nim |
16:05:51 | Yardanico | well it's nice |
16:06:37 | Yardanico | but we'll need to make sure it works fast, because Nim would execute this macro on every "unicode" module compilation :) |
16:08:01 | Yardanico | or |
16:08:05 | Yardanico | we can write it once |
16:08:10 | Yardanico | and then copy-paste resulting Nim code :D |
16:09:24 | FromGitter | <couven92> Like Python? :P |
16:09:39 | Yardanico | who knows, maybe they've written this BY HAND? :D |
16:11:41 | FromGitter | <couven92> Actually, no that I'm thinking about it: having a set to seq converter macro would be nice to have anyways, right? |
16:11:49 | Yardanico | yeah |
16:12:38 | * | endragor quit (Remote host closed the connection) |
16:13:25 | FromGitter | <couven92> Set to int would actually also be useful for c ffi bitflags |
16:15:03 | * | solitude joined #nim |
16:17:09 | * | Arrrr quit (Quit: Leaving.) |
16:17:18 | Yardanico | I'm currently changing python-like class macro to automatically produce generic ref objects (without specifying types manually) :D |
16:18:17 | * | endragor joined #nim |
16:18:24 | * | Sentreen joined #nim |
16:22:22 | Yardanico | like described here: https://github.com/Yardanico/nimpylib/issues/3 |
16:23:07 | * | endragor quit (Ping timeout: 260 seconds) |
16:23:48 | Yardanico | BTW, tomorrow new school year begins in Russia (my last year in school) |
16:24:41 | * | arnetheduck quit (Ping timeout: 240 seconds) |
16:28:01 | * | tdc quit (Read error: Connection reset by peer) |
16:28:36 | * | tdc joined #nim |
16:35:21 | * | vendethiel- joined #nim |
16:36:48 | * | Ven`` quit (Ping timeout: 252 seconds) |
16:39:38 | * | Vladar quit (Quit: Leaving) |
16:39:40 | * | nsfw_ joined #nim |
16:39:59 | nsfw_ | re-hello |
16:40:03 | * | tdc quit (Read error: Connection reset by peer) |
16:40:12 | Yardanico | nsfw_, re-hi |
16:43:10 | nsfw_ | how are u Yardanico ? am I right as a beginner if I assume that any async proc is in fact relying on another async proc that is 'deeper' (by the use of await) - that I'd say that a given proc is only async because of the call to a deeper async proc that is itself async for the same reasons until one reach the lowest-level |
16:43:15 | Araq | ha, " Oh my god, there's so many unicode characters representing digits", noticed something? Unicode is out of control |
16:45:00 | Araq | every programming language needs to implement logic for dead natural languages because it's in the spec, it's worse than disabled parking spaces |
16:48:24 | FromGitter | <ephja> what is it that you want? simply smaller ranges? |
16:48:31 | FromGitter | <ephja> fewer* |
16:49:43 | Araq | digits are 0 to 9, I can use ord(x) - ord('0') to get from a digit to its value |
16:50:26 | Araq | everything more than that is decadent |
16:54:13 | Yardanico | nsfw_, well yeah, and if you want to start this chain, you need to use either asyncCheck + runForever or waitFor |
16:55:17 | Yardanico | well, nim async implementation is just a macro (ab) using iterators :) |
16:55:29 | Yardanico | nim compiler itself doesn't know about async AFAIK |
16:55:37 | Araq | yup |
16:56:18 | FromGitter | <couven92> Araq, what do you think about my idea about the set literal to seq operator? What about using @ for that? |
16:56:46 | Araq | that's even worse than openArray ;-) |
16:57:13 | FromGitter | <couven92> ? |
16:57:17 | FromGitter | <couven92> Why? |
16:57:26 | Araq | cause it's slower |
16:57:36 | FromGitter | <couven92> Wasn't that your suggestion? |
16:57:48 | Araq | no, it wasn't |
16:58:04 | Araq | I proposed openArray of (a, b) range tuples |
16:58:14 | Araq | or else a "predicate" approach |
16:58:31 | FromGitter | <couven92> And why would a macro be slower? |
16:58:46 | Araq | not the macro, the 'seq' |
16:59:13 | FromGitter | <couven92> Okay, set literal so inline array then |
17:00:13 | FromGitter | <couven92> Hmm... but then using @ for that suddenly doesn't make so much sense anymore |
17:00:29 | Araq | I'd look at the generated asm for the predicate solution |
17:01:59 | FromGitter | <couven92> Okay... what exactly do you mean by predicates? |
17:06:25 | nsfw_ | thanks Yar |
17:06:30 | nsfw_ | Yardanico* |
17:08:25 | FromGitter | <zacharycarter> I'm trying to print json to stdout and I'm getting lots of newlines etc - is there any way to remove these? |
17:08:27 | FromGitter | <zacharycarter> [\n {\n \"distance\": 14.89956390866927,\n \"compCode\": \"00GY3DC001\"\n } |
17:08:34 | FromGitter | <zacharycarter> ideally I just want parseable json |
17:10:46 | FromGitter | <BigEpsilon> @Araq, I'll implement the feature in c2nim first then look at reorder pragma. I think things are more complicated with the pragma. |
17:11:26 | Araq | BigEpsilon: you would reimplement the reorder pragma |
17:11:35 | Araq | but sure if you think it's easier |
17:11:59 | Araq | compiler/reorder.nim |
17:12:52 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:13:03 | FromGitter | <BigEpsilon> ok I'll look at it first (the pragma). There may be subtleties that I still don't see. |
17:14:17 | FromGitter | <BigEpsilon> alot of variable in c/c++ start or end with and underscore "_". What do you think is the best way to rename them ? I can add that two to c2nim |
17:14:38 | Yardanico | AFAIK there's already a way |
17:14:55 | Yardanico | maybe this - https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#mangle-directive |
17:15:07 | Yardanico | and https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#prefix-and-suffix-directives |
17:15:55 | FromGitter | <BigEpsilon> ah ok ! how did I not see it :/ |
17:16:48 | FromGitter | <BigEpsilon> thanks Yardanico |
17:17:12 | Yardanico | but I've never used c2nim for big stuff :) |
17:19:18 | FromGitter | <BigEpsilon> I'm trying to use it to make a wrapper for opencv |
17:19:19 | FromGitter | <ephja> that would save the most amount of time |
17:19:23 | Yardanico | ohhh |
17:19:24 | Yardanico | opencv |
17:19:27 | Yardanico | great! |
17:19:59 | FromGitter | <ephja> the smaller the code the more relative overhead c2nim incurs :p |
17:20:03 | FromGitter | <BigEpsilon> but without using the c api, which make it not very easy |
17:21:40 | Yardanico | I thought c2nim almost doesn't have overhead |
17:21:45 | Yardanico | because Nim is compiled to C/C++ itself |
17:22:10 | * | solitude quit (Quit: Leaving) |
17:23:30 | FromGitter | <ephja> I mean with regards to the time spent generating the bindings |
17:23:59 | * | Sembei joined #nim |
17:24:06 | * | endragor joined #nim |
17:24:13 | FromGitter | <BigEpsilon> My intent is not to provide a wrapper, but a wrapper generator |
17:24:36 | FromGitter | <BigEpsilon> so I'm trying to combine c2nim with the python wrapper generator |
17:25:04 | FromGitter | <BigEpsilon> Yes I have to commit to C++ in order to use opencv this way |
17:25:45 | * | Pisuke quit (Ping timeout: 252 seconds) |
17:28:30 | * | endragor quit (Ping timeout: 252 seconds) |
17:34:53 | * | vivus joined #nim |
17:36:57 | * | nsf quit (Quit: WeeChat 1.9) |
17:44:54 | * | nsfw_ quit (Quit: Leaving.) |
17:48:17 | * | mahsav quit (Ping timeout: 260 seconds) |
18:03:53 | * | Serenitor joined #nim |
18:05:30 | Yardanico | can I use genSym for generating generic params? |
18:05:32 | Yardanico | in type section |
18:06:20 | Yardanico | ah, nvm |
18:06:22 | Yardanico | nskType |
18:08:04 | Yardanico | yay it works |
18:08:15 | * | mahsav joined #nim |
18:08:33 | Yardanico | https://gist.github.com/Yardanico/f9e8219d3fdce5b6d2240718dd58fb3a :) |
18:08:43 | Yardanico | (macro for creating type with all params being generic) |
18:11:05 | * | rosshadden quit (Quit: WeeChat 1.9) |
18:11:55 | * | rosshadden joined #nim |
18:19:37 | * | ludocode quit (Remote host closed the connection) |
18:23:54 | * | ludocode joined #nim |
18:25:50 | * | vlad1777d joined #nim |
18:26:27 | * | Jesin joined #nim |
18:26:52 | FromGitter | <ephja> is inheritance without 'ref' on the stack? |
18:28:02 | Yardanico | ephja: I don't know, but "Ref objects should be used whenever inheritance is used. It isn't strictly necessary, but with non-ref objects assignments such as let person: Person = Student(id: 123) will truncate subclass fields." |
18:28:55 | * | claudiuinberlin joined #nim |
18:42:41 | * | Sentreen quit (Ping timeout: 240 seconds) |
18:43:20 | * | francisl joined #nim |
18:43:23 | FromGitter | <ephja> yeah I just want to define common fields once. it should be possible to have object constants with non-ref inheritance |
18:43:55 | * | dom96|w joined #nim |
18:51:32 | * | vlad1777d quit (Remote host closed the connection) |
18:51:52 | * | francisl quit (Quit: francisl) |
18:53:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:55:31 | * | Sentreen joined #nim |
18:56:17 | * | claudiuinberlin joined #nim |
19:03:37 | * | solitude joined #nim |
19:04:55 | FromGitter | <Grabli66> Is there some module to watch directory changes in nim for windows? |
19:08:49 | * | Ven joined #nim |
19:09:08 | * | dom96|w quit (Quit: Textual IRC Client: www.textualapp.com) |
19:09:12 | * | Ven is now known as Guest78495 |
19:11:33 | * | solitude quit (Quit: Leaving) |
19:11:53 | * | solitudesf joined #nim |
19:15:21 | * | Guest78495 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:15:50 | * | vlad1777d joined #nim |
19:29:38 | * | solitudesf quit (Remote host closed the connection) |
19:30:06 | Araq | Grabli66: I'm afraid not, but there is a nimble package with good COM support |
19:31:41 | FromGitter | <Grabli66> Ok. I'am trying to use winapi in nim for watch dir changes :) |
19:31:43 | FromGitter | <ephja> were any changes made to 'inject'? |
19:38:10 | Araq | ephja: no |
19:44:07 | FromGitter | <ephja> nevermind. the problem is that this template https://github.com/ephja/nim-glfw/blob/master/src/glfw.nim#L675 breaks (undeclared identifier: handle), if I introduce a generic argument to the function that it resides in 樂 |
19:51:46 | * | Trustable quit (Remote host closed the connection) |
19:58:55 | * | vlad1777d quit (Ping timeout: 248 seconds) |
19:59:25 | * | rosshadden quit (Quit: WeeChat 1.9) |
20:06:53 | * | nsfw_ joined #nim |
20:07:00 | nsfw_ | re |
20:07:04 | * | nsf joined #nim |
20:09:41 | * | Sentreen quit (Ping timeout: 240 seconds) |
20:12:50 | * | vlad1777d joined #nim |
20:22:36 | * | Sentreen joined #nim |
20:25:34 | * | BigEpsilon quit (Ping timeout: 264 seconds) |
20:27:13 | * | miran quit (Ping timeout: 248 seconds) |
20:27:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:28:15 | * | claudiuinberlin joined #nim |
20:29:31 | * | claudiuinberlin quit (Client Quit) |
20:29:51 | * | vlad1777d quit (Ping timeout: 248 seconds) |
20:30:40 | * | claudiuinberlin joined #nim |
20:32:07 | * | PMunch quit (Quit: leaving) |
20:45:08 | * | couven92 joined #nim |
20:46:20 | * | vlad1777d joined #nim |
20:47:01 | * | Yardanico quit (Remote host closed the connection) |
21:06:53 | FromGitter | <zacharycarter> got my ETL solution deployed today, and it works! |
21:06:57 | FromGitter | <zacharycarter> thank goodness for docker |
21:09:07 | * | couven92 quit (Quit: Client Disconnecting) |
21:14:24 | FromGitter | <zacharycarter> @dom96: any idea why I'm getting this error - Error: unhandled exception: Unable to query remote tags for https://github.com/unicredit/csvtools. Git returned: fatal: Not a git repository: ../.git/modules/sell-my-car-batch |
21:14:39 | FromGitter | <zacharycarter> I have a project included inside another as a submodule |
21:16:40 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:17:45 | dom96 | zacharycarter: not sure, report it |
21:20:49 | FromGitter | <zacharycarter> alright |
21:21:15 | FromGitter | <zacharycarter> thx |
21:29:05 | * | relax quit (Ping timeout: 248 seconds) |
21:34:30 | * | MyMind joined #nim |
21:36:33 | * | Sembei quit (Ping timeout: 252 seconds) |
21:43:13 | * | gangstacat quit (Quit: Leaving) |
21:43:41 | * | vlad1777d quit (Ping timeout: 240 seconds) |
21:47:35 | * | vlad1777d joined #nim |
21:51:50 | * | Sentreen quit (Ping timeout: 240 seconds) |
21:55:01 | * | yglukhov joined #nim |
21:58:22 | * | Jesin quit (Quit: Leaving) |
21:59:11 | * | yglukhov quit (Ping timeout: 240 seconds) |
22:02:19 | * | Jesin joined #nim |
22:02:51 | FromGitter | <zacharycarter> well I don't have nim in prod yet but I ahve it in alpha! |
22:06:59 | * | xet7 joined #nim |
22:16:20 | * | SusWombat quit (Read error: Connection reset by peer) |
22:20:03 | * | nsf quit (Quit: WeeChat 1.9) |
22:22:45 | * | vendethiel- quit (Ping timeout: 252 seconds) |
22:23:52 | * | couven92 joined #nim |
22:25:19 | * | couven92 quit (Client Quit) |
22:25:36 | * | Ven`` joined #nim |
22:28:17 | * | MyMind quit (Ping timeout: 260 seconds) |
22:39:11 | * | ShalokShalom joined #nim |
22:40:01 | * | relax joined #nim |
22:44:36 | * | mahmudov joined #nim |
23:05:47 | FromGitter | <adamrezich> this might be a really dumb question but, is there any way to get a reference to an item in a seq? |
23:06:34 | FromGitter | <adamrezich> because if there is, that'd mean the pointer to the item would move on seq resize, right? |
23:06:41 | * | relax quit (Ping timeout: 240 seconds) |
23:11:41 | * | mahmudov quit (Ping timeout: 240 seconds) |
23:23:56 | * | mahmudov joined #nim |
23:26:28 | * | nsfw_ quit (Quit: Leaving.) |
23:29:02 | * | dddddd quit (Quit: Hasta otra..) |
23:33:53 | * | Ven`` quit (Ping timeout: 248 seconds) |
23:41:29 | * | loc8_ joined #nim |
23:44:04 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:44:21 | * | loc8 quit (Ping timeout: 240 seconds) |