00:07:07 | * | MJCaley quit (Quit: MJCaley) |
00:13:10 | * | sendell quit (Remote host closed the connection) |
00:20:39 | * | MJCaley joined #nim |
00:24:17 | * | dddddd quit (Remote host closed the connection) |
00:52:27 | * | skrylar joined #nim |
01:17:47 | * | koppeh is now known as copygirl |
01:20:27 | * | vlad1777d quit (Ping timeout: 250 seconds) |
01:30:42 | * | elrood quit (Quit: Leaving) |
01:43:07 | * | xkapastel quit (Quit: Connection closed for inactivity) |
01:56:25 | * | Tanger quit (Remote host closed the connection) |
01:57:12 | * | vivus quit (Quit: Leaving) |
01:59:59 | * | Serenit0r joined #nim |
02:00:48 | * | skrylar quit (Ping timeout: 268 seconds) |
02:01:27 | * | couven92 quit (Quit: Client Disconnecting) |
02:03:05 | * | Serenitor quit (Ping timeout: 240 seconds) |
02:13:24 | * | skrylar joined #nim |
02:29:27 | * | xkapastel joined #nim |
02:31:20 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:41:32 | * | MJCaley quit (Quit: MJCaley) |
02:45:02 | * | chemist69 joined #nim |
02:51:22 | * | mwbrown quit (Ping timeout: 268 seconds) |
02:53:07 | * | mwbrown joined #nim |
03:10:45 | * | JappleAck joined #nim |
03:14:01 | * | Tanger joined #nim |
03:15:05 | Tanger | Hey folks, how's it going? Quick question, is the Options module and it's get() proc the best ways to a property on a type for no value? |
03:16:47 | FromGitter | <superfunc> @Tanger option is a nice way to semantically represent "no value", yes |
03:17:29 | FromGitter | <superfunc> Note that you'll want to ensure it has a value before calling .get(), otherwise catch the exception thrown when it doesn't |
03:17:39 | * | endragor joined #nim |
03:17:39 | * | endragor quit (Remote host closed the connection) |
03:18:07 | * | endragor joined #nim |
03:20:09 | Tanger | Awesome superfunc, thanks for that! Was too used to just checking for nil/null |
03:21:06 | FromGitter | <superfunc> @Tanger np, I have a library which enforces checking on optional types, if you're looking for that sort of thing github.com/superfunc/maybe |
03:27:49 | FromGitter | <Varriount> @superfunc I think I like that more than the module in the stdlib |
03:32:39 | Tanger | Oh yeah, I like that much better @superfunc |
03:33:40 | * | dexterk joined #nim |
03:40:35 | FromGitter | <superfunc> Cool beans, glad you like it :) |
03:48:39 | * | marenz__ joined #nim |
03:52:01 | * | marenz quit (Ping timeout: 248 seconds) |
04:12:17 | FromGitter | <kayabaNerve> Where are built in operators defined, such as .. ? |
04:13:56 | FromGitter | <kayabaNerve> system.nim, right? |
04:33:05 | * | marenz__ quit (Ping timeout: 248 seconds) |
04:34:12 | FromGitter | <superfunc> @kayabaNerve yeah slice things are defined there |
04:36:14 | * | yglukhov joined #nim |
04:54:57 | * | jsgrant quit (Ping timeout: 240 seconds) |
04:56:51 | * | yglukhov quit (Remote host closed the connection) |
05:02:25 | * | jsgrant joined #nim |
05:10:03 | * | dexterk quit (Quit: Konversation terminated!) |
05:17:49 | * | yglukhov joined #nim |
05:22:09 | * | yglukhov quit (Ping timeout: 248 seconds) |
05:25:09 | * | NimBot joined #nim |
05:38:25 | * | yglukhov joined #nim |
05:42:35 | * | yglukhov quit (Ping timeout: 255 seconds) |
06:07:22 | FromGitter | <mratsim> Regarding options/maybe, @Araq is the future `opt` base type also part of newruntime? |
06:22:57 | * | miran joined #nim |
06:26:07 | * | nsf joined #nim |
06:40:19 | * | yglukhov joined #nim |
06:44:49 | * | yglukhov quit (Ping timeout: 248 seconds) |
06:58:43 | Tanger | Hey folks, not sure if this is the right place, but I'm trying to get a package off of nimble, but it appears that the .nimble file is old-style syntax |
06:59:15 | Tanger | So it just bombs as soon as I include it as a dependency because the first line of the nimble file is [Package] instead of #Package |
07:01:21 | * | jsgrant quit (Ping timeout: 248 seconds) |
07:01:22 | Tanger | But it bombs when it's parsing the .nimble file saved to /tmp/nimble_*** |
07:06:43 | * | jsgrant joined #nim |
07:18:00 | * | yglukhov joined #nim |
07:22:34 | FromGitter | <superfunc> Hey @Tanger, is this for my library we were discussing? |
07:25:16 | FromGitter | <superfunc> In case it is, you should be able to run `nimble install [email protected]` to get a change I just pushed which cleans up the nimble file |
07:27:35 | Tanger | Ah, awesome, thanks again @superfunc |
07:31:13 | FromGitter | <superfunc> No problemo |
07:32:32 | * | miran quit (Ping timeout: 260 seconds) |
07:46:49 | FromGitter | <mratsim> @Varriount @Araq, after tinkering for a few hours, I have definite proof that copy-on-write does not work cleanly for a neural net library so I will use reference semantics by default and require cloning for deep copies. ⏎ ⏎ 1) 1. increasing and decreasing the refcounter in tight loops seems quite costly, I didn’t benchmark properly on my full bench suite, but my incRef/decRef proc were taking 1-3% on a single |
07:46:49 | FromGitter | ... function that called exp and log all over the place ⏎ 2) 1bis. potential idea, instead of having a counter: just have a boolean “shared”, when doing assignment, changed shared to true, when doing `=sink`do not change it. —> when “shared is true, mutation copies”. This avoids keeping track of the refcounter. ⏎ 3) 2. Except ... [https://gitter.im/nim-lang/Nim?at=5a17ce69ffa3e37919b30d60] |
07:48:59 | Araq | show me this proof please :-) |
07:49:43 | Araq | but benchmark numbers don't really count, I would like to understand the problem |
07:54:34 | FromGitter | <mratsim> Here: https://github.com/mratsim/Arraymancer/blob/master/src/autograd/ag_data_structure.nim#L44-L50 ⏎ ⏎ “Variable” is the wrapper for Tensors in neural networks graph |
07:55:55 | FromGitter | <mratsim> so 1bis is not feasible, because as soon as you wrap a tensor it will be marked “shared" |
07:56:13 | * | Ven joined #nim |
07:56:37 | * | Ven is now known as Guest66176 |
07:57:33 | FromGitter | <mratsim> for 1. a variable is referred to in a “tape” —> sequence of operations during the forward pass that we rewind in the backward pass |
07:58:07 | FromGitter | <mratsim> so refcount is always >1 |
08:02:52 | FromGitter | <mratsim> I’ve also noted that context copying (by ref) triggers ref counting on the whole graph: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ So is that the famed factorial complexity? :P [https://gitter.im/nim-lang/Nim?at=5a17d22bffa3e37919b31e63] |
08:04:47 | * | Vladar joined #nim |
08:05:30 | Araq | I don't understand anything of this |
08:11:41 | * | Arrrr joined #nim |
08:11:41 | * | Arrrr quit (Changing host) |
08:11:42 | * | Arrrr joined #nim |
08:19:07 | FromGitter | <mratsim> Lol well just imagine a atomic ref counted object in a direct acyclic graph |
08:20:17 | FromGitter | <mratsim> The parents have a ref to their child, the children to their parents. |
08:21:02 | FromGitter | <mratsim> (children to their parents was because it was simpler at first will try without it in the future) |
08:21:37 | FromGitter | <mratsim> And I also keep a list of all the nodes existing in this graph |
08:24:42 | FromGitter | <mratsim> (A node is an operation like + - * /, it holds 2 Tensors the result of the operation, and the gradient tensor.) |
08:28:21 | Araq | backpointers mean you don't have an "acyclic" graph at all. |
08:28:23 | * | vlad1777d joined #nim |
08:28:41 | * | floppydh joined #nim |
08:31:14 | * | yglukhov_ joined #nim |
08:31:15 | * | yglukhov quit (Read error: Connection reset by peer) |
08:35:02 | * | sendell joined #nim |
08:35:14 | * | claudiuinberlin joined #nim |
08:36:16 | * | vlad1777d quit (Ping timeout: 248 seconds) |
08:37:16 | FromGitter | <mratsim> Yes, in it's usage it is, I traverse in one way for "normal" computation (*, -, +, convolution, loss function, etc) and then the other way for gradients. There is no sudden jump to the middle of the graph. |
08:39:05 | FromGitter | <mratsim> Anyway I have a graph + a seq with references of all Tensors involved so copy-on-write will always copy on mutation. |
08:40:30 | Araq | can't you ignore the reference and do COW with RC==2 ? |
08:40:41 | Araq | (or not count it at all) |
08:47:23 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
08:47:36 | * | claudiuinberlin joined #nim |
09:03:05 | * | yglukhov_ quit (Remote host closed the connection) |
09:09:39 | * | PMunch joined #nim |
09:23:07 | * | xkapastel quit (Quit: Connection closed for inactivity) |
09:44:37 | * | yglukhov joined #nim |
09:45:35 | FromGitter | <mratsim> I fear like this solution becomes more complex than the problem and that it won't scale in huge graph |
09:46:52 | FromGitter | <mratsim> 1) performance oriented users will have to jump through hoops to avoid COW (system.`=`(dst, src)) |
09:47:44 | FromGitter | <mratsim> +* |
09:49:28 | * | yglukhov quit (Ping timeout: 268 seconds) |
09:51:25 | * | dddddd joined #nim |
09:51:39 | FromGitter | <mratsim> I will try to find a way to not increase refcount when in a container to compare. |
09:57:48 | FromGitter | <mratsim> Alternatively, if it's possible in Nim I could have proc return a shallow copy by const value (so only assignable to let/const or used as non-mutable argument) |
09:59:46 | FromGitter | <mratsim> This way no refcount to keep or whatever to keep and everything is determined statically at compile-time. |
10:06:42 | FromGitter | <mratsim> I can open a feature request if you think it is worth it. It can probably use this syntax: `proc foo(bar: BigObject): BigObject{`let`,call} =` |
10:09:51 | * | arecaceae quit (Read error: Connection reset by peer) |
10:10:11 | * | arecaceae joined #nim |
10:12:47 | * | couven92 joined #nim |
10:13:03 | Araq | create a feature request so that I know what you're talking about :P |
10:14:26 | alexday | {.async.} what is meaning of this? |
10:14:32 | alexday | https://nim-lang.org/docs/asynchttpserver.html |
10:15:09 | couven92 | alexday, it's marking the proc as async, much like the `async` keyword in C# |
10:16:06 | alexday | I know async in javascript :P |
10:16:15 | alexday | but I get it |
10:18:03 | FromGitter | <mratsim> Will do after lunch. |
10:19:20 | FromGitter | <mratsim> Seems like an awesome way to approach documentation: https://www.divio.com/en/blog/documentation/ |
10:23:39 | FromGitter | <Varriount> @mratsim Did you find that link on reddit or hacker news? |
10:24:15 | FromGitter | <mratsim> Reddit r/programming |
10:24:47 | FromGitter | <Varriount> I can't seem to connect, so I wonder if it might be the hug of death |
10:44:09 | * | Guest66176 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:46:38 | * | Ven joined #nim |
10:47:03 | * | Ven is now known as Guest10002 |
10:52:22 | * | skrylar quit (Ping timeout: 268 seconds) |
11:02:29 | * | Guest10002 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:06:23 | * | Ven joined #nim |
11:06:47 | * | Ven is now known as Guest67205 |
11:10:42 | * | marenz__ joined #nim |
11:15:20 | * | Guest67205 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:27:46 | couven92 | if I write my own new proc for MyRefType, will it get precedence over nim stdlib new? |
11:27:58 | couven92 | (Is that how I should do it?) |
11:30:10 | crem | How does it allocate memory? Does it call system.new inside? |
11:30:33 | crem | Anyway, I heard that the usual approach is to have newMyRefType() function |
11:30:46 | couven92 | ah okay... thanks |
11:31:04 | crem | which usually starts with new(result) |
11:33:20 | FromGitter | <mratsim> @araq here you go: https://github.com/nim-lang/Nim/issues/6793 |
11:33:22 | FromGitter | <Varriount> @mratsim Wow, I'm bookmarking that. |
11:34:09 | FromGitter | <Varriount> I feel like Nim (the language) covers one, area, the technical documentation, fairly well. |
11:34:24 | FromGitter | <Varriount> The other areas need work |
11:37:00 | FromGitter | <mratsim> Yes completely agree, I wonder how the cookbook is doing. |
11:38:31 | crem | As for documentation, I don't like that that https://nim-lang.org/docs/lib.html page takes ~1-2 seconds before search works. Slows development down! |
11:39:36 | * | couven92 quit (Read error: Connection reset by peer) |
11:39:48 | Araq | IMO the technical aspects are underrated. we need 'executableExample' and code snippets that are tested by the CI |
11:40:06 | * | couven92 joined #nim |
11:40:33 | Araq | "just write better docs" is wrong, first the tooling needs a couple of more features |
11:40:52 | Araq | otherwise the documentation is always at the risk of becoming outdated |
11:41:42 | Araq | and since we control the docgen these things are rather easy to do |
11:42:39 | crem | Is there interactive nim-based REPL shell? Like python has. I remember seeing mention of something like that somewhere, but cannot find it now. |
11:43:35 | dom96 | Indeed, there are multiple doc gen improvements that I have been planning for a while now. |
11:43:52 | dom96 | crem: 'nim secret' but it doesn't support FFI |
11:44:55 | crem | That's good enough, just wanted to switch from python to nim for small tasks. Including calculator+like |
11:45:12 | alexday | I miss two things in nim. one is an ocaml/rust/elixir like match operator and the other is iterators nd generators like in js |
11:46:13 | Araq | match is in a nimble package |
11:46:23 | Araq | not sure what an 'nd generator' is |
11:46:45 | crem | I still haven't written much in nim, but the more I write, the less I miss. :) My experience with Go in the same timeframe was the opposite. |
11:47:55 | alexday | niceeeee. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators is this what`iterator` in nim does? |
11:49:56 | crem | Kind of, but as far as I remember, the only place where iterators can be used in nim are for loops. |
11:50:46 | Araq | you can use them and single step through them, but ... er ... don't do that :-) |
11:52:53 | crem | Ah yes, you can call them, and wierdly you have to pass the same parameters on every call. And what happens if you pass different parameters is a secret. |
11:55:06 | alexday | I am thinking of one use case, I have an http api endpoint which returns paginated result, and each result is an user profile object. so if someone wants to find by name, I can call use yield there, although I can write a function that accepts an offsets and makes request. and everytime the name doesn't match I call it. not sure |
11:57:02 | Araq | crem, I suppose it's really one of my worst designs ... :-) |
11:57:18 | Araq | the idea was to make it close to ordinary closures work |
11:57:25 | Araq | *to how |
12:00:51 | * | gangstacat joined #nim |
12:09:57 | couven92 | Do we have a NimScript-able quoteShell proc? |
12:11:13 | couven92 | The actual quoteShell is in osproc, which obviously cannot be imported in a nim script |
12:15:17 | * | chemist69 quit (Ping timeout: 258 seconds) |
12:16:38 | * | Ven joined #nim |
12:17:02 | * | Ven is now known as Guest48862 |
12:23:22 | Araq | quoteShell should be in ospaths |
12:23:33 | couven92 | Araq, shall I put it there? |
12:26:56 | couven92 | Is there a way to define a symbol? like #define MY_MAGIC_CONST in C? |
12:27:26 | couven92 | so that I can later use it in a `when defined(myMagicConst)` block? |
12:28:57 | * | chemist69 joined #nim |
12:30:02 | Araq | const myConst = 4 |
12:30:06 | Araq | when myConst == 4: |
12:30:18 | Araq | is typo safe. |
12:31:23 | couven92 | hmmm okay... I guess I rather do it like this: `when isMainModule or defined(debugComInterfaceMacro):` (it's just easier) and I like it that way, since I am doing a helper library, so isMainModule should usually be false |
12:32:04 | couven92 | Okay, back to quoteShell, Araq I will do a quick PR for that :) |
12:33:47 | Araq | ok, thanks |
12:34:11 | Araq | remember that osproc needs to export this symbol in order to not break code |
12:35:16 | couven92 | okay, so `from ospaths import quoteShell, quoteShellWindows, quoteShellPosix` and then `export quoteShell, quoteShellWindows, quoteShellPosix` ? |
12:38:04 | Araq | yeah |
12:38:31 | couven92 | what happens now, if someone imports both osproc and ospaths? |
12:38:45 | couven92 | do we get abiguity on quoteShell? |
12:39:03 | couven92 | s/abiguity/ambiguity/^ |
12:43:50 | Araq | yes |
12:44:02 | couven92 | anything to do about that? |
12:48:18 | Araq | there is no ambiguity if osproc exports the symbol |
12:48:23 | Araq | only if it reimplements it |
12:48:50 | couven92 | ah, okay that's great then :) |
12:52:48 | * | Arrrr quit (Read error: Connection reset by peer) |
12:53:53 | * | cspar quit (Ping timeout: 248 seconds) |
12:56:16 | * | dddddd quit (Remote host closed the connection) |
12:57:53 | * | alex__ joined #nim |
13:00:44 | * | gangstacat quit (Quit: Ĝis!) |
13:01:30 | FromGitter | <couven92> I cannot use a macro as pragma on a type declaration? :( |
13:02:25 | FromGitter | <couven92> E.g. type MyMagicType {.magicMacro.} = ... |
13:02:32 | * | ipjk joined #nim |
13:03:00 | FromGitter | <couven92> That only works for procs? |
13:13:04 | FromGitter | <mratsim> Vote for my feature request |
13:13:45 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/6696#issuecomment-341999785 |
13:29:42 | couven92 | Araq, quoteShell is moved, CI tests running green: https://github.com/nim-lang/Nim/pull/6794 |
13:43:11 | Araq | excellent work |
13:44:22 | * | Guest48862 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:46:54 | * | dexterk joined #nim |
13:50:27 | * | Ven joined #nim |
13:50:51 | * | Ven is now known as Guest20721 |
13:59:28 | * | Serenit0r quit (Ping timeout: 248 seconds) |
13:59:59 | Araq | nimble does not support genDepend :-( |
14:08:54 | * | dddddd joined #nim |
14:16:41 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:22:56 | * | endragor quit (Remote host closed the connection) |
14:24:52 | * | Guest20721 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:25:10 | * | Ven joined #nim |
14:25:33 | * | Ven is now known as Guest25826 |
14:26:53 | * | Guest25826 quit (Client Quit) |
14:36:57 | * | endragor joined #nim |
14:39:05 | * | Ven joined #nim |
14:39:29 | * | Ven is now known as Guest92717 |
14:41:20 | * | endragor quit (Ping timeout: 258 seconds) |
14:50:34 | * | Guest92717 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:53:20 | * | Ven joined #nim |
14:53:44 | * | Ven is now known as Guest9401 |
14:53:49 | * | claudiuinberlin joined #nim |
15:01:10 | * | Guest9401 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:05:31 | * | floppydh quit (Quit: WeeChat 1.9.1) |
15:09:17 | * | Ven_ joined #nim |
15:16:36 | * | nsf quit (Quit: WeeChat 1.9.1) |
15:18:56 | * | sz0 joined #nim |
15:19:03 | * | gangstacat joined #nim |
15:29:15 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:29:36 | FromGitter | <Jipok> https://github.com/nim-lang/Nim/pull/6552 ⏎ "Next release" tag means a 0.18 version? How long does this take? Is there a good replacement for TimeInfo now? The current realistion TimeInfo causes pain. |
15:34:56 | * | Ven_ joined #nim |
15:38:36 | Araq | Jipok: I'll merge this time improvement this weekend, I hope |
15:38:49 | Araq | 0.18 will be out this year |
15:47:21 | FromGitter | <Jipok> Also why Nim doesn't have something like do..while or repeat..until? Not that it was necessary at least once, just interesting. |
15:54:32 | * | Ven_ quit (Read error: Connection reset by peer) |
15:54:44 | * | Ven joined #nim |
15:55:08 | * | Ven is now known as Guest32335 |
15:56:04 | * | Arrrr joined #nim |
15:56:04 | * | Arrrr quit (Changing host) |
15:56:04 | * | Arrrr joined #nim |
15:56:38 | dom96 | Jipok: because they are rarely necessary |
15:56:40 | Araq | because I found no use for it, 'loop' as an alias for 'while true' would be more useful than repeat until |
15:59:40 | Arrrr | i have a template like that |
16:02:29 | * | yglukhov joined #nim |
16:03:24 | * | Guest32335 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:03:36 | FromGitter | <Jipok> Thank you. By the way, is there a way to link the Nim scripts with the compiled program? For example: use common variables or functions. I do not really like using lua for this. |
16:09:12 | * | miran joined #nim |
16:20:14 | * | PMunch quit (Quit: Leaving) |
16:28:54 | * | xkapastel joined #nim |
16:30:25 | * | alex__ quit (Ping timeout: 248 seconds) |
16:32:07 | * | dexterk quit (Quit: Konversation terminated!) |
16:33:11 | * | JappleAck quit (Quit: Leaving) |
16:43:07 | Araq | staticRead the nimscript? |
16:43:12 | Araq | not sure what you mean |
16:49:54 | * | yglukhov quit (Remote host closed the connection) |
17:01:47 | * | sendell quit (Remote host closed the connection) |
17:06:22 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:15:13 | * | SenasOzys quit (Ping timeout: 248 seconds) |
17:15:58 | * | SenasOzys joined #nim |
17:31:27 | * | yglukhov joined #nim |
17:35:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:45:33 | * | Trustable joined #nim |
17:50:12 | * | arecaceae quit (Remote host closed the connection) |
17:50:30 | * | arecaceae joined #nim |
17:57:29 | * | yglukhov joined #nim |
17:58:27 | * | claudiuinberlin joined #nim |
17:59:10 | * | cspar joined #nim |
17:59:11 | * | yglukhov quit (Client Quit) |
17:59:34 | * | yglukhov joined #nim |
17:59:38 | * | Jesin joined #nim |
18:00:03 | * | alex__ joined #nim |
18:04:29 | * | yglukhov quit (Remote host closed the connection) |
18:22:57 | * | Sentreen quit (Ping timeout: 240 seconds) |
18:25:12 | Arrrr | Would be nice to expose seq capacity for 1.0 |
18:28:54 | * | couven92 quit (Quit: Client disconnecting) |
18:31:41 | dom96 | That's not a breaking change, is it? |
18:31:49 | dom96 | It can be exposed at any point after 1.0 too |
18:32:34 | * | Trustable quit (Remote host closed the connection) |
18:33:05 | Arrrr | I mean, it would be useful. |
18:33:22 | * | yglukhov joined #nim |
18:35:59 | * | Sentreen joined #nim |
18:38:07 | * | yglukhov quit (Ping timeout: 260 seconds) |
18:47:53 | FromGitter | <razuit> how to enumerate files in a directory with nim? looking to merge some files with nim |
18:49:41 | FromGitter | <mratsim> Regarding loops, a construct I found useful is Rust “while let” in combo with their option type, especially for stack and queues. ⏎ ⏎ ```while let Some(foo) = bar_seq.pop()``` [https://gitter.im/nim-lang/Nim?at=5a1869c5ffa3e37919b6679c] |
18:50:13 | FromGitter | <mratsim> —> It assigns to foo as long as pop() returns something, and if it returns none it stops the loop |
18:56:44 | * | couven92 joined #nim |
19:03:12 | * | salewski joined #nim |
19:04:04 | salewski | Do we have something like Ruby's flatten() see https://ruby-doc.org/core-2.2.0/Array.html#method-i-flatten |
19:07:57 | * | jjido joined #nim |
19:09:00 | * | derka joined #nim |
19:09:30 | dom96 | razuit: os.walkFiles |
19:09:59 | dom96 | salewski: if it's not in sequtils then probably not |
19:11:05 | dom96 | Araq: From the changelog: "echo now works with strings that contain \0 (the binary zero is not shown) and nil strings are equal to empty strings." |
19:11:10 | dom96 | Shouldn't we show something? |
19:11:16 | dom96 | like a unicode box with a 0 in it? |
19:12:47 | FromGitter | <alehander42> @mratsim you can kinda do this with a macro here: I wrote now one for ⏎ ⏎ ```foroption b in a: ⏎ echo b``` ⏎ ⏎ (it's for sequences, but I guess it can be generalized) [https://gitter.im/nim-lang/Nim?at=5a186f2ee606d60e3404f134] |
19:13:07 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a186f43ba39a53f1ade9c46] |
19:13:56 | salewski | [[1,2], [3,4]] ==> [1,2,3,4] # no there seems to be nothing for that in sequtils. But I had the feeling that I saw it somewhere... |
19:15:01 | FromGitter | <superfunc> Seems like something that would be good to have in sequtils |
19:16:22 | salewski | Bye. |
19:16:25 | * | salewski quit (Quit: WeeChat 1.9.1) |
19:18:46 | FromGitter | <mratsim> @salewski I have a flat iterator that can iterate over any-depth nested sequences here: https://github.com/mratsim/Arraymancer/blob/master/src/private/nested_containers.nim |
19:19:31 | FromGitter | <mratsim> I can PR it to sequtils, I’m not sure of the name to give it though. Any suggestions? |
19:21:35 | FromGitter | <Varriount> @mratsim |
19:22:00 | FromGitter | <Varriount> Is it possible to "unpack" an arbitrary depth? |
19:22:47 | FromGitter | <mratsim> It works on [[[[],[],[] …. ]]]] if that's what you meant. |
19:23:25 | FromGitter | <mratsim> Also on mix of sequences of arrays of sequences |
19:23:47 | * | endragor joined #nim |
19:24:15 | FromGitter | <superfunc> @mratsim That sounds useful, I can do a PR for a flatten function, should it mutate the sequence or produce a new one? |
19:24:50 | FromGitter | <mratsim> I’m pretty sure you will get “Illegal capture” if you try to mutate an open array ;) |
19:25:19 | FromGitter | <superfunc> could be, I was just prototyping with seqs :) |
19:25:36 | FromGitter | <Varriount> And you can't flatten a sequence in place, due to static typing |
19:25:59 | FromGitter | <superfunc> oh, derp, holiday brains |
19:26:32 | FromGitter | <mratsim> Well if @dom96/@Araq can chime in on the name I can add a `flatItems` iterator and a `flatten` proc that will deep flatten any level of nested proc |
19:27:17 | * | salewski joined #nim |
19:27:34 | dom96 | those names sound good (unless there is some other popular name used by other PLs out there) |
19:27:46 | salewski | mratsim, that would be nice. |
19:28:03 | FromGitter | <Varriount> Why not `flattenItems`? |
19:28:09 | * | endragor quit (Ping timeout: 246 seconds) |
19:28:39 | Araq | dom96, well I delegate this to the C IO library |
19:28:49 | Araq | which ... does nothing with \0 |
19:29:41 | * | salewski quit (Client Quit) |
19:29:57 | * | jjido quit (Read error: No route to host) |
19:30:04 | dom96 | hrmm ok |
19:34:20 | * | derka quit (Quit: derka) |
19:35:15 | * | yglukhov joined #nim |
19:36:45 | alexday | https://nim-lang.org/docs/tut2.html what is the difference between object of RootObj vs only object type Vector = object vs type Vector = object of RootObj |
19:39:57 | * | yglukhov quit (Ping timeout: 260 seconds) |
19:43:25 | * | derka joined #nim |
19:44:26 | couven92 | Is there a way to define my own pragma that can take a value and can be applied to a type declaration, so that I later can see that pragma (with its value) through typedesc/getType*/type()? |
19:46:27 | couven92 | I can't see how I'd do that! I can't use the pragma-pragma, since that does not allow me any values, and it gets replaced by its pragma definition anyways, so I'd not be able to find it later. I cannot use macro-as-pragma either, since Type declarations cannot have macro-pragmas |
19:46:37 | couven92 | any ideas? |
19:52:37 | Araq | couven92, that feature is WIP |
19:52:43 | Araq | there is a PR for it |
19:55:16 | * | derka quit (Quit: derka) |
19:57:27 | * | jsgrant_ joined #nim |
19:59:28 | * | jsgrant quit (Ping timeout: 248 seconds) |
20:01:55 | * | jsgrant_ quit (Ping timeout: 250 seconds) |
20:11:03 | * | MJCaley joined #nim |
20:11:24 | * | nsf joined #nim |
20:14:41 | * | Trustable joined #nim |
20:20:41 | * | derka joined #nim |
20:24:54 | * | vlad1777d joined #nim |
20:39:33 | * | Arrrr quit (Read error: Connection reset by peer) |
20:48:43 | * | xkapastel quit (Quit: Connection closed for inactivity) |
20:53:14 | * | yglukhov joined #nim |
20:57:35 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:58:40 | * | Vladar quit (Quit: Leaving) |
21:14:06 | * | jsgrant joined #nim |
21:15:54 | * | lastjedi joined #nim |
21:19:21 | * | miran quit (Quit: Konversation terminated!) |
21:25:43 | * | derka quit (Quit: derka) |
21:40:02 | * | bodie_ quit (Ping timeout: 240 seconds) |
21:41:20 | * | lastjedi quit (Remote host closed the connection) |
21:48:47 | * | xkapastel joined #nim |
22:11:59 | * | skrylar joined #nim |
22:20:48 | * | jsgrant quit (Ping timeout: 248 seconds) |
22:34:57 | * | alex__ quit (Read error: Connection reset by peer) |
22:35:13 | * | skrylar quit (Ping timeout: 248 seconds) |
22:37:15 | dom96 | alexday: an object that can be inherited vs. one that can't |
22:37:42 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:38:07 | * | skrylar joined #nim |
22:51:17 | * | Trustable quit (Remote host closed the connection) |
22:59:45 | * | jsgrant joined #nim |
23:00:25 | * | MJCaley quit (Quit: MJCaley) |
23:08:47 | * | skrylar quit (Ping timeout: 260 seconds) |
23:15:05 | * | SenasOzys quit (Ping timeout: 240 seconds) |
23:18:48 | * | yglukhov joined #nim |
23:23:13 | * | yglukhov quit (Ping timeout: 248 seconds) |
23:26:56 | * | MJCaley joined #nim |
23:37:15 | * | MJCaley quit (Quit: MJCaley) |
23:45:27 | * | jsgrant quit (Ping timeout: 240 seconds) |
23:45:43 | * | MJCaley joined #nim |
23:49:39 | * | SenasOzys joined #nim |
23:50:19 | * | nsf quit (Quit: WeeChat 1.9.1) |
23:58:26 | * | MJCaley quit (Quit: MJCaley) |