00:02:17*king3vbo left #nim ("Leaving")
00:05:59*jakob0094 quit (Remote host closed the connection)
00:12:34*seni quit (Quit: Leaving)
00:25:12*NimBot joined #nim
01:06:13*theelous3_ quit (Ping timeout: 246 seconds)
01:10:28*lritter quit (Ping timeout: 245 seconds)
01:11:12*lritter joined #nim
01:22:19*dddddd quit (Remote host closed the connection)
01:26:24*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:50:06*zachk quit (Quit: Leaving)
02:29:53*deech joined #nim
02:30:10*abm quit (Ping timeout: 268 seconds)
02:31:10deechIs there a way to see the results of a compile time evaluation in the code? Sort of like macroexpansion ...
02:32:20*shpx joined #nim
02:43:57FromGitter<zetashift> @Vindaar you still there by any chance?
02:48:43FromGitter<m4d3bug> any idea about how to send a csv with the tab page?
02:48:50FromGitter<m4d3bug> in Nim
02:49:56FromGitter<m4d3bug> I want to send a string to write in the csv with the tab page.
02:51:29FromGitter<zetashift> nvm I looked at narimiran solution and scanf will help parse the input instead of going through regexp fun
02:55:23*masquino joined #nim
02:56:15masquinohello everyone! quick question.. does nim have the concept of static methods on a type? like type Something = object of RootObj ... Something.doStuff
02:59:31FromGitter<zetashift> @masquino aren't static methods methods that can be used without instantiating a class? Are you looking for something like this: https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax
02:59:45masquinooh.. doStuff(t: typedesc) shuld do it right?
03:00:35FromGitter<zetashift> yeah replace `typedesc` with the the type of the object and you're set
03:02:06masquinowait, but the link shows the syntax for instance methods
03:02:54masquinoI mean, I don't care about passing the receiver as an argument or as the receiver.. but I can the first argument to be a type, not an instance of a type
03:03:22masquinoI kinda achieved that with typedesc, but I'm not sure if thats the way to go about this
03:07:43*banc quit (Quit: ZNC - http://znc.in)
03:09:35FromGitter<zetashift> You could just do `proc doStuff(x: Foo) =` and call it the procedure like `doStuff(x: Foo)` no?
03:14:56masquinomm can I? I'm either not getting something or not being clear about what I need.. doStuff in that case takes an instance of Foo as an argument
03:16:05masquinoI don't want an instance of Foo, or T, or an instance of anything.. I just want the argument to be a type as a type itself, not an instance of a type
03:16:28masquinoI dont want Foo().doStuff .. just Foo.doStuff (no parens, no instantiation)
03:18:22*deech quit (Ping timeout: 250 seconds)
03:22:43*lritter quit (Ping timeout: 246 seconds)
03:23:32*banc joined #nim
03:26:27shashlickdeech: check out https://nim-lang.org/docs/system.html#repr%2CT
03:26:30FromGitter<zetashift> ah yeah I get what you mean, I don't know how this works in Nim since I haven't encountered it yet
03:40:54*masquino quit (Ping timeout: 250 seconds)
04:27:10*ftsf joined #nim
04:36:08*narimiran joined #nim
04:44:27*endragor joined #nim
04:44:52*nsf joined #nim
04:47:24*endragor_ joined #nim
04:49:32*endragor quit (Ping timeout: 268 seconds)
04:57:30FromGitter<Vindaar> @zetashift sorry, was asleep :)
04:57:37narimirangood morning :)
04:57:45FromGitter<Vindaar> morning! :)
05:42:05*xet7 joined #nim
06:06:35FromDiscord_<technicallyagd> @citycide Thank you! and yeah... `[let a, b] <- someSeq` causes syntax error.
06:07:56FromDiscord_<technicallyagd> @deech do you mean [expandMacros](https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped)?
06:08:29FromDiscord_<technicallyagd> @deech do you mean expandMacros?. https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
06:08:42FromDiscord_<technicallyagd> @deech do you mean expandMacros? https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
06:10:02FromDiscord_<technicallyagd> It's pretty awesome, you just need `nim check file.nim` to see the result of the expansion
06:23:32*cyraxjoe quit (Read error: Connection reset by peer)
06:24:03*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:24:40*cyraxjoe joined #nim
07:06:09*narimiran quit (Remote host closed the connection)
07:06:25*krux02 joined #nim
07:10:27*Jesin quit (Ping timeout: 246 seconds)
07:28:44FromGitter<alehander42> @citycide , hey, so basically you can use let inside your if conditions : this is very important for gara because of unification and guards
07:28:58FromGitter<alehander42> I am not sure if you can do it directly in your code tho
07:29:31FromGitter<alehander42> the point is that e.g. for `@[@x, @x]` you need to generate
07:30:11FromGitter<alehander42> `a.len == 2 and (let x = a[0]; true) and x == a[1]:`
07:30:19FromGitter<alehander42> or something like that, not totally sure
07:31:43FromGitter<alehander42> about the rust thing: not quite sure why their `match` as expr can return: our lib can be reworked to do this, but it would be not too pleasant, and it does clash with the behavior of `if` `case` as expression
07:32:47NandrajDoes anybody developed android app with nimx or any other nim package?
07:51:38AraqNandraj, yglukhov[m] did
07:52:17NandrajIs it on playstore?
08:01:52Araqit used to be, I don't know the current state of the project
08:03:10livcdkinda sad that that's the only example there is
08:05:57*stefanos82 joined #nim
08:06:46FromGitter<m4d3bug> any idea to write down a csv with one more sheet?
08:12:42Tangerm4d3bug: Try this - https://github.com/khchen/winim
08:14:15TangerA sheet is specific to excel-ish processors, a csv is just delimiter separated file of values, so overhead, no byte reading or anything
08:18:21*anamok joined #nim
08:18:47anamokHow can I remove the last element of a seq? In Python it's `list.pop()` .
08:21:01FromGitter<narimiran> anamok: sequtils.pop
08:21:50FromGitter<narimiran> nope, not in sequtils, just `yourList.pop()`, don't forget to `discard` if you don't need the value popped
08:22:23FromGitter<narimiran> (i think i know why you need it :))
08:22:46anamokSorry, my bad. I tried it with an array, forgot the `@` sign. Thanks!
08:23:01anamoknarimiran[m], ehh :)
08:23:19anamokI'm improving my working solution.
08:27:44*ftsf quit (Read error: Connection reset by peer)
08:29:19FromDiscord_<technicallyagd> I failed so spectacularly for that task today lol
08:30:38anamokgeez, it became ultra fast
08:34:30FromDiscord_<technicallyagd> wow, you are right.
08:36:06FromDiscord_<technicallyagd> so does `str = str[0..^2]` copies the entire string?
08:36:58anamoktechnicallyagd: I tried that too and it was slower than calling `replace()`
08:37:31FromDiscord_<technicallyagd> That was my solution in the first attempt
08:37:38FromDiscord_<technicallyagd> before seeing your message just now
08:38:00FromDiscord_<technicallyagd> I would not finish if I don't turn on `-d:release`
08:38:03*Ven`` joined #nim
08:38:12anamoktechnicallyagd: actually what I tried was `text[i .. j] = ""`, and it was slower than replacing that part to an empty string
08:40:12FromDiscord_<technicallyagd> @anamok wait, so you just work with the input inplace?
08:40:18FromDiscord_<technicallyagd> oh ok bye
08:40:25anamokstill here
08:40:57anamokYes, if a string is declared with `var`, it can be modified unlike in Python.
08:41:28anamokbut since this string is big, changing in place was slow
08:41:42*Jesin joined #nim
08:41:43FromDiscord_<technicallyagd> yeah,
08:42:08FromDiscord_<technicallyagd> I guess the correct way is to use pop then
08:42:25FromDiscord_<technicallyagd> I also tried to just keep count
08:42:41anamokChoosing the right data structure is crucial, I saw it today :)
08:43:00FromDiscord_<technicallyagd> since all you need for both tasks are the character count
08:43:08FromDiscord_<technicallyagd> indeed.
08:43:43anamokbut you need the character count only at the end, when the text was processed
08:44:29anamokI need to go now. Bye.
08:44:34FromDiscord_<technicallyagd> bye
08:44:36*anamok quit (Remote host closed the connection)
09:02:13*rockcavera quit (Ping timeout: 246 seconds)
09:02:48*rockcavera joined #nim
09:06:18*floppydh joined #nim
09:06:39*stefanos82 quit (Remote host closed the connection)
09:41:14*dom96_w joined #nim
09:43:37*kapil____ quit (Quit: Connection closed for inactivity)
09:45:16*ftsf joined #nim
09:57:50Araqhi yglukhov[m], your LL is inconsistent with nkFuncDef vs nkProcDef
09:58:24*PMunch joined #nim
09:58:38FromGitter<yglukhov> Araq: not sure what you mean. LL is yours, not mine :)
09:59:05Araqyou rewrote it, no?
09:59:56FromGitter<yglukhov> i wouldn't say so. maybe only patched slightly...
10:00:12Araqwell I don't know the correct variant
10:00:19Araqeither 'func' is wrong or 'proc'
10:00:40FromGitter<yglukhov> Can you elaborate on the problem? I still don't follow.
10:01:33Araqfor 'nkProcDef' it takes the 'discard' variant
10:01:40Araqwhich I think is the correct one
10:02:08Araqand likely nkIteratorDef should go to there too
10:02:24*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:02:30FromGitter<yglukhov> hm. feels wrong indeed.
10:03:30*dom96_w joined #nim
10:06:12Araqwell nkFuncDef is just nkProcDef + .noSideEffect so it's objectively wrong
10:10:25FromGitter<yglukhov> Araq: maybe it's just a typo. nkFuncDef is there since you first introduced it: https://github.com/nim-lang/Nim/commit/1a61c4d46d
10:11:31FromGitter<yglukhov> but nkIteratorDef is interesting...
10:13:32*Vladar joined #nim
10:26:20Araqwell that's an anon iterator
10:26:43Araqchanging it doesn't seem to break anything
10:27:52*stefanos82 joined #nim
10:34:10*Ven`` quit (Ping timeout: 268 seconds)
10:41:38*Ven`` joined #nim
10:46:00*dddddd joined #nim
10:48:10*Ven`` quit (Ping timeout: 250 seconds)
10:57:04*Ven`` joined #nim
10:57:46*PMunch quit (Remote host closed the connection)
10:58:05*PMunch joined #nim
10:59:44*abm joined #nim
11:25:54*kapil____ joined #nim
11:53:23*banc quit (Read error: Connection reset by peer)
11:56:04*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:01:26*banc joined #nim
12:03:56*vlad1777d joined #nim
12:25:30*stefanos82 quit (Ping timeout: 252 seconds)
12:26:54*stefanos82 joined #nim
12:27:36*rockcavera quit (Read error: Connection reset by peer)
12:35:00*Ven`` quit (Read error: Connection reset by peer)
12:42:46*platoff joined #nim
12:47:24*jakob0094 joined #nim
12:49:21*Ven`` joined #nim
12:57:22*dom96_w joined #nim
13:06:18PMunchHmm, interesting. Trying to do "window.onLoad = proc(event: Event) {.exportc.} = <body>" and compiling for the js target causes Nim to create JS code with a syntax error
13:09:37*banc quit (Read error: Connection reset by peer)
13:10:18*krux02 quit (Ping timeout: 250 seconds)
13:17:52*banc joined #nim
13:24:21FromGitter<alehander42> what would exportc do here o.O
13:24:37PMunchCreate a JS valid name for it
13:25:13FromGitter<alehander42> the only think I know about exportc
13:25:21FromGitter<alehander42> is that it exports the nim name by default
13:25:25FromGitter<alehander42> but this proc is anon
13:25:46FromGitter<alehander42> are you saying, this should be a compile time error?
13:28:54*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:31:21*rockcavera joined #nim
13:43:34*masquino joined #nim
13:54:21*Ven`` joined #nim
14:06:07FromGitter<alehander42> is there a valid usecases where somebody would want to do ⏎ `a = a[0 .. ^2]` ?
14:07:50FromGitter<Varriount> @alehander42 Shortening a string?
14:07:56FromGitter<mratsim> that or a[0 ..^ 2]
14:08:35FromGitter<alehander42> yes, but my point is
14:08:53FromGitter<alehander42> compared to `.setLen(a.len - 1)` (or a better way to pop)
14:09:28FromGitter<alehander42> b = a[0 .. ^2] makes sense: you might want to be sure that b doesnt get changed by a's changes, so it's a copy
14:09:34FromGitter<mratsim> you don’t pop in tensors
14:09:53FromGitter<alehander42> i am talking about strings/seqs
14:10:18FromGitter<mratsim> ideally if I need that, I’d like an openarray
14:10:33FromGitter<alehander42> I still don't see what does this have to do with seq/string :D
14:10:41FromGitter<mratsim> when a slice a seq
14:10:48FromGitter<mratsim> I usually want an openarray
14:11:08FromGitter<alehander42> but people very often do need a seq
14:12:06*endragor_ quit (Remote host closed the connection)
14:13:00FromGitter<alehander42> ah this is the issue i was trying to find https://github.com/nim-lang/Nim/issues/5753
14:16:32FromGitter<alehander42> anyway, I was just wondering if `a = a[slice]` to be cgenned as a pointer/len change instead of a copy would be a safe optimization
14:16:44FromGitter<alehander42> but views would be more general indeed
14:20:00FromGitter<mratsim> views, slices, spans, ranges … :P there are like 3 related RFCs
14:22:16FromGitter<alehander42> yeah haha
14:24:12FromGitter<mratsim> I think the latest discussion which linked to all the other is this one: https://github.com/nim-lang/Nim/issues/7337#issuecomment-373453594, it’s a bit hard to follow because there is the string vs seq[byte] interleaved.
14:25:54*endragor joined #nim
14:30:28*endragor quit (Ping timeout: 250 seconds)
14:57:29*ng0 joined #nim
15:01:42*shpx joined #nim
15:04:40FromGitter<citycide> @alehander42 right on. `repr` does not include the parentheses around the `let` condition which is what makes it look invalid
15:08:32FromGitter<citycide> regardless I still need to figure out why bounds checking works for seqs but not arrays. seems like they both generate the same conditions
15:09:07FromGitter<alehander42> can you give me an example of a pattern that should work?
15:24:12FromGitter<citycide> @alehander42 something like this: https://ptpb.pw/Mrb-/nim
15:24:30FromGitter<citycide> but I only have local changes for array support right now
15:25:02FromGitter<citycide> by extracting the logic for seqs. but the bounds checking doesn't work so the first condition causes an out of range error to be raised
15:30:26*nsf quit (Quit: WeeChat 2.3)
15:30:32FromGitter<alehander42> well, it's basically ⏎ ⏎ ```let minTest = quote do: `input`.len >= `min` ⏎ test = quote do: `minTest` and `t```` [https://gitter.im/nim-lang/Nim?at=5c07ef178336e22a7de6446d]
15:31:07FromGitter<alehander42> I think this should be exactly the same as in the other case
15:31:48FromGitter<alehander42> min is `+= 1 or += elementMin`
15:32:10FromGitter<alehander42> in the loop through subpatterns
15:33:13FromGitter<alehander42> elementMin is for `*`
15:36:35*ghost64 quit (Quit: See you!)
15:38:39*ftsf quit (Ping timeout: 246 seconds)
15:39:01*narimiran joined #nim
15:41:39*ghost64 joined #nim
15:56:41*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:19:42*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:20:32*vlad1777d quit (Ping timeout: 250 seconds)
16:28:12*Trustable joined #nim
16:33:25*PMunch quit (Remote host closed the connection)
16:48:02*rockcavera quit (Read error: Connection reset by peer)
16:48:28*krux02 joined #nim
16:49:09*rockcavera joined #nim
16:49:09*rockcavera quit (Changing host)
16:49:09*rockcavera joined #nim
16:50:36*floppydh quit (Quit: WeeChat 2.3)
16:54:53*Trustable quit (Remote host closed the connection)
17:01:45*platoff joined #nim
17:10:19*wildlander joined #nim
17:20:12*freddy92 quit (Quit: Client disconnecting)
17:35:58*zakora joined #nim
17:49:29*Valac joined #nim
17:49:33*Valac left #nim (#nim)
18:12:01FromGitter<zacharycarter> https://compileandrun.com/struggles-with-rust.html
18:22:31*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:28:00*nsf joined #nim
18:38:24*leorize quit (Quit: WeeChat 2.2)
18:44:09*leorize joined #nim
18:49:31*theelous3_ joined #nim
19:07:43*lritter joined #nim
19:12:03*shpx quit (Ping timeout: 252 seconds)
19:23:35FromGitter<mratsim> > Note: at this point I have no idea when to_string() or to_owned() are used. My usually strategy is to try as_str(), to_str(), as_string(), to_string(), and to_owned(), until the compiler stops complaining. ⏎ ⏎ I had the same issues, also iter() and into_iter(), and borrow(), borrow_mut()
19:24:23FromGitter<mratsim> But I think after developing in Nim at low-level I’m much more familiar with aliasing, ownership and memory safety so I would be a much better Rust dev
19:31:30*rockcavera quit (Remote host closed the connection)
19:35:12*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
19:45:25*nsf quit (Quit: WeeChat 2.3)
19:54:59*narimiran quit (Remote host closed the connection)
19:58:00*rockcavera joined #nim
20:03:32*nolanv joined #nim
20:06:33*nolanv quit (Client Quit)
20:10:50FromGitter<arnetheduck> https://twitter.com/jcksie/status/1070409974365519872
20:13:26FromGitter<arnetheduck> my experience with rust is generally that it's very similar to what *good* c++ looks like - a lot of the same concepts, but enforced by the compiler (ie use unique_ptr but not raw pointers, etc).. if you're unfamiliar with those concepts, or if you just want to hack together a quick script, you have a learning curve to real with or you're simply in the wrong language for the task at hand..
20:27:06FromGitter<StefanSalewski> masquino, for your unanswered question your may see https://forum.nim-lang.org/t/4433#27746
20:43:50masquino:ok_hand: thanks!!
20:50:49*zakora quit (Quit: WeeChat 2.2)
21:04:25*wildlander quit (Quit: Konversation terminated!)
21:10:35*nolanv joined #nim
21:11:54*nolanv quit (Client Quit)
21:14:00*nolanv joined #nim
21:46:15*stefanos82 quit (Remote host closed the connection)
22:22:17*ng0 quit (Quit: Alexa, when is the end of world?)
22:31:52*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:00:52*Vladar quit (Remote host closed the connection)
23:07:48FromGitter<zetashift> Is day 5 of Advent of Code not just one hella big foldRight call?
23:08:16FromGitter<zetashift> I solved it in Scala with foldl, reverse and pattern matching on a list
23:08:30FromGitter<zetashift> with the Nim one I'm having more problem solving this recursively
23:10:45abeaumontno need to use recursion to solve it
23:12:08*xace quit (Ping timeout: 268 seconds)
23:12:26*xace joined #nim
23:12:37FromGitter<zetashift> oh!?
23:24:11*vlad1777d joined #nim
23:27:08*theelous3_ quit (Ping timeout: 245 seconds)
23:27:33*ftsf joined #nim
23:44:26*krux02 quit (Remote host closed the connection)
23:45:07*krux02 joined #nim
23:46:25*krux02 quit (Remote host closed the connection)