<< 31-03-2018 >>

00:06:20*jrbrt quit (Quit: Oíche mhaith)
00:08:47FromGitter<AjBreidenbach> I'm still getting illegal capture
00:11:09*vlad1777d quit (Ping timeout: 264 seconds)
00:20:50*gokr quit (Quit: Leaving.)
00:32:34*Sentreen quit (Ping timeout: 256 seconds)
00:33:36*Sentreen joined #nim
00:39:21*endragor joined #nim
00:43:45*endragor quit (Ping timeout: 248 seconds)
01:16:55*S1tiSchu joined #nim
01:20:22FromGitter<Varriount> @AjBreidenbach Are you interfacing with C code that expects a function pointer?
01:20:29*SitiSchu quit (Ping timeout: 256 seconds)
01:23:19*endragor joined #nim
01:28:08*endragor quit (Ping timeout: 260 seconds)
01:35:58FromGitter<AjBreidenbach> trying to i guess
01:37:07FromGitter<AjBreidenbach> the procs I am passing get passed without problems but I'm trying to call other functions inside of them which it does not like
01:51:34*endragor joined #nim
01:56:08*endragor quit (Ping timeout: 260 seconds)
02:11:08*brainproxy quit (Quit: WeeChat 2.0.1)
02:22:49*rockcavera quit (Ping timeout: 256 seconds)
03:21:06*rockcavera joined #nim
04:03:06*yglukhov joined #nim
04:07:27*yglukhov quit (Ping timeout: 256 seconds)
04:48:16*athenot_ joined #nim
04:48:26*athenot quit (Ping timeout: 276 seconds)
04:56:20*endragor joined #nim
05:00:57*Lord_Nightmare quit (Ping timeout: 240 seconds)
05:08:45*Lord_Nightmare joined #nim
05:11:32*icebattle quit (Remote host closed the connection)
05:41:45*SenasOzys joined #nim
05:50:59*vlad1777d joined #nim
05:58:27*vlad1777d quit (Ping timeout: 240 seconds)
06:53:00*yglukhov joined #nim
06:57:54*Lord_Nightmare quit (Ping timeout: 256 seconds)
06:58:54*Lord_Nightmare joined #nim
07:03:25*yglukhov quit (Read error: Connection reset by peer)
07:04:02*yglukhov joined #nim
07:06:44*jaco60 quit (Ping timeout: 255 seconds)
07:09:26*r3d9u11 joined #nim
07:10:27*Lord_Nightmare quit (Ping timeout: 240 seconds)
07:13:57*Lord_Nightmare joined #nim
07:35:39*r3d9u11 quit (Remote host closed the connection)
07:41:41*rokups joined #nim
08:03:03FromGitter<Varriount> @AjBreidenbach Could you post a link to your code?
08:23:03*Senketsu_ joined #nim
08:49:01FromGitter<mratsim> If people are in interpreter, VMs, emulators: I’ve implemented my own with examples of pong, tetris and space invaders: https://github.com/mratsim/chirp8 the code should be pretty easy to follow. You can display but not play though because I didn’t add user input yet.
08:53:05*kunev_ quit (Quit: е те!)
08:57:43*kunev joined #nim
09:01:23*Trustable joined #nim
09:08:30FromGitter<Vindaar> @mratsim Wow, the speed at which you implemented that is really impressive. Are you planning to implement key input at all?
09:11:45*nsf joined #nim
09:17:05FromGitter<mratsim> dunno, maybe :P.
09:18:14FromGitter<Vindaar> Haha, just saying if you don't I might take a stab at it. Sounds like a fun project to learn something :)
09:18:57FromGitter<mratsim> feel free, I’ll give you access to the repo
09:26:48FromGitter<Vindaar> Oooh, nice. I feel honored, thanks!
09:30:49*timotheecour quit (Remote host closed the connection)
09:32:33*gokr joined #nim
09:34:27FromGitter<mratsim> Here is an overview of the work I feel is needed: https://github.com/mratsim/chirp8/issues/1
09:51:18FromGitter<mratsim> i think we can copy-paste this except the documentation part: https://rskupnik.github.io/I-learned-rust-and-I-think-Im-in-love
09:51:52*Senketsu_ quit (Ping timeout: 256 seconds)
09:59:14*gokr quit (Ping timeout: 256 seconds)
10:01:28FromGitter<Vindaar> Cool, I take a look at it later today!
10:02:40*clyybber joined #nim
10:07:11*clyybber quit (Ping timeout: 255 seconds)
10:09:27*clyybber joined #nim
10:09:43clyybberGood day!
10:16:50*nsf quit (Quit: WeeChat 2.0.1)
10:20:11*Arrrr joined #nim
10:24:53*Senketsu_ joined #nim
10:45:57*Vladar joined #nim
10:52:51*ofelas joined #nim
10:59:41*endragor quit (Remote host closed the connection)
11:05:25FromGitter<mratsim> hello clyybber
11:05:43clyybberhello
11:18:04Arrrrtype Foo[A, B] = array[A, B]
11:18:04Arrrrconst BAR: Foo[3, int] = [1, 2, 3]
11:18:04ArrrrThis doesn't compile, it is a bug?
11:18:41ArrrrThe compiler error log is not very clear
11:35:23*Senketsu_ quit (Ping timeout: 260 seconds)
11:36:24FromGitter<mratsim> A: static[int] should work
11:36:59FromGitter<mratsim> I’m not sure but a generics doesn’t match a static parameter
11:53:11*vlad1777d joined #nim
11:57:21*Arrrr quit (Ping timeout: 264 seconds)
11:58:36*gokr joined #nim
12:03:25*Arrrr joined #nim
12:03:25*Arrrr quit (Changing host)
12:03:25*Arrrr joined #nim
12:03:55ArrrrThanks mratsim, it works
12:09:49ArrrrMmm, so a proc can be a const, but not an object with a proc. Is because const objects cannot contain pointers?
12:10:02*dddddd joined #nim
12:10:47*athenot_ quit (Remote host closed the connection)
12:11:02FromGitter<mratsim> You can have static[string] or static[seq[int]] but internally it seems like they are transformed in arrays (in macros at least)
12:13:01*NimBot joined #nim
12:13:25FromGitter<mratsim> but yeah it makes sense, since you never know at compile-time which addreses are valid, you cannot store a pointer to a non-existing address at compile-time
12:13:44FromGitter<mratsim> but maybe try a static[proc] :?
12:14:30FromGitter<mratsim> I’m pretty sure you will crash the compiler and open a bug soon :P
12:14:37ArrrrMmm
12:15:25federico3anybody using distcc with Nim?
12:27:13*Senketsu_ joined #nim
12:27:38*Senketsu_ quit (Remote host closed the connection)
12:44:17*SenasOzys quit (Ping timeout: 248 seconds)
12:51:22*SenasOzys joined #nim
12:53:06*SenasOzys quit (Read error: Connection reset by peer)
12:53:28*SenasOzys joined #nim
13:19:35FromGitter<krux02> what is distcc
13:20:44FromGitter<krux02> a static proc? what should that be?
13:20:56*user1101 joined #nim
13:21:05FromGitter<krux02> wouldn't it bu just easier to ask for a function symbol and then emit code with it?
13:50:31*PMunch joined #nim
14:15:09Yardanicokrux02: distcc is a compiler wrapper
14:15:19Yardanicoso you can distribute compilation over multiple machines/servers
14:15:34Yardanico"Distcc is a program to distribute builds of C, C++, Objective C or Objective C++ code across several machines on a network to speed up building. It should always generate the same results as a local build, is simple to install and use, and is usually much faster than a local compile. Further, one can use it together with native Arch build tools such as makepkg. "
14:16:21FromGitter<krux02> thanks for the info
14:16:31FromGitter<krux02> I think I use icecc
14:17:17FromGitter<krux02> I didn't like it since only a true project rebuild could be improved in performance
14:17:32FromGitter<krux02> incremental builds were at the same speed at the best case
14:18:48FromGitter<krux02> and the worst part about it was the thinking "compilation time is horrible, throw more processors on it, since it is now fast we don't need to care about compilation time anymore, lets make it even more horrible"
14:19:36FromGitter<krux02> when I had to build the project at home where I had no "icecc" compilation took 2 hours for the project and my computer was is swap because of memory consumption.
14:20:01FromGitter<krux02> my computer was shit, yea, but still the compilation alone made my computer swapping.
14:21:48*endragor joined #nim
14:25:58*endragor quit (Ping timeout: 240 seconds)
14:26:25PMunchHmm, got a strange issue in my macro. Nim crashes with a "SIGSEGV: Illegal storage access. (Attempt to read from nil?)"
14:26:43PMunchBut it does the very last step of the macro which is to print out the result with toStrLit
14:26:58PMunchAnd it happens even if I remove that line
14:27:30FromGitter<krux02> well can you simply show the macro so I can run it?
14:27:38PMunchIf I put a result = newStmtList() after that line it works fine (but obviously doesn't do much)
14:27:57PMunchkrux02[m], sure if you want to 1200 line behemoth that it is :P
14:28:29FromGitter<krux02> well if it has only one file it's fine
14:28:36FromGitter<krux02> 1200 lines is not a behemoth
14:28:46FromGitter<krux02> 120000 lines is a behemoth
14:30:09PMunchhttps://github.com/PMunch/protobuf-nim/tree/options
14:30:21PMunchIt's split over multiple files as well :P
14:30:37PMunchBut most of the fun happens in the src/protobuf.nim file
14:31:03PMunchIf you look at the last commit there you can see the diff that started these issues
14:31:24PMunchAnd the test.nim file in the base directory can be used to trigger it
14:32:15PMunchLine 805 is where the echo statement is, so you can look backwards from there to see what happens
14:33:11PMunchAh wait...
14:33:22PMunchIt's a botched copy-paste :P
14:33:34PMunchOn line 736
14:33:55PMunchWhere it gets the field from the definition to access the arguments
14:34:26PMunch(and yes, I know those should probably be variables and not just three/four level deep indices)
14:35:21FromGitter<krux02> cannot open combparser
14:36:36FromGitter<krux02> you should not do echo toStrLit
14:36:56FromGitter<krux02> toStrLit creates a string literal, so it creates a nim node
14:37:01FromGitter<krux02> a nim node should not be printed
14:37:23FromGitter<krux02> do echo result.repr
14:38:47FromGitter<krux02> just from my experience I would put a lot of `expectKind` statements on `impls` members.
14:39:16FromGitter<krux02> The generated/parsed AST from Nim has already changed a few times, and it might change again.
14:39:43FromGitter<krux02> so just to make your code fail properly if that happens. sprinkle `expectKind` everywhere
14:40:00PMunchHmm, that might be a good idea
14:40:12PMunchAnd yeah, that should really be using repr
14:42:05FromGitter<krux02> it doesn't solve your probem though
14:42:06PMunchWhich is?
14:42:07PMunchI already solved my original issue as I said above
14:42:14FromGitter<krux02> oh :P
14:51:35PMunchHmm, the options module always return an immutable value.. That's a bit inconvenient
15:06:07*nsf joined #nim
15:06:16dom96Functional Programming isn't a fan of mutability
15:07:28PMunchI know :)
15:07:33PMunchThat's what so great about it
15:08:03PMunchBut mixing imperative and functional means you have data types that aren't really intended for the functional paradigm
15:08:24PMunchIt's immutable, but still not as inefficient as just making copies of everything
15:13:09*Vladar quit (Remote host closed the connection)
15:14:53*Vladar joined #nim
15:29:55*vlad1777d quit (Ping timeout: 256 seconds)
15:57:38*internode joined #nim
16:00:39dom96internode: Nope. But we do have a termbox wrapper. Btw webchat is muted in this channel right now (I can only see your messages). Join via Gitter if you can.
16:04:00*SitiSchu joined #nim
16:05:55*internode quit (Ping timeout: 260 seconds)
16:06:21*S1tiSchu quit (Ping timeout: 264 seconds)
16:13:53*r3d9u11 joined #nim
16:15:59*durandu joined #nim
16:35:27*natrys joined #nim
16:37:20*endragor joined #nim
16:41:23FromGitter<alehander42> @mratsim very cool chirp8 :D
16:41:51*endragor quit (Ping timeout: 255 seconds)
16:50:52*max3 joined #nim
16:54:28FromGitter<mratsim> Thanks :)
16:54:35*arnetheduck quit (Ping timeout: 240 seconds)
17:06:58dom96Interesting: https://twitter.com/b0rk/status/979794100689006593
17:10:47*Arrrr quit (Ping timeout: 256 seconds)
17:13:56*Arrrr joined #nim
17:13:57*Arrrr quit (Changing host)
17:13:57*Arrrr joined #nim
17:16:34FromGitter<mrwonko> didn't I see something like that recently?
17:16:45FromGitter<mrwonko> ah, yes: https://blogs.msdn.microsoft.com/windbg/2017/09/25/time-travel-debugging-in-windbg-preview/
17:17:10FromGitter<mrwonko> I suppose those complement each other nicely since one is more for the linux crowd and the other for Windows
17:20:57*Vladar quit (Quit: Leaving)
17:21:25*endragor joined #nim
17:26:09*endragor quit (Ping timeout: 264 seconds)
17:26:37*nsf quit (Quit: WeeChat 2.0.1)
17:30:16*SenasOzys quit (Remote host closed the connection)
17:34:12*Vladar joined #nim
17:39:29FromGitter<mrwonko> Maybe I'm blind, but it seems like nowhere in the Nimble docs does it mention whether `nimble init` works on the current working directory or creates a subdirectory for the project...
17:40:03*SenasOzys joined #nim
17:41:39FromGitter<alehander42> yes, rr is very cool! the windbg time travel tool also seems promising but I haven't tried it
17:41:52FromGitter<alehander42> I have to start using windows again from time to time to keep up
17:43:34FromGitter<mrwonko> I couldn't try it because it's distributed using the Windows Store, which is broken for me and won't open and apparently the only "solution" is a complete wipe of Windows, which is not something I want to do right now
17:43:50FromGitter<alehander42> :D too bad
17:48:27*PMunch quit (Ping timeout: 276 seconds)
17:52:09*SenasOzys quit (Remote host closed the connection)
17:52:35*SenasOzys joined #nim
17:53:02*PMunch joined #nim
17:58:38dom96mrwonko: You're not blind. If you could create a PR to improve the docs that'd be very much appreciated :)
17:58:43*vlad1777d joined #nim
18:01:15FromGitter<mrwonko> sure thing, just let me recover from this spilled drink first, I think my mouse died
18:04:07*SenasOzys quit (Read error: Connection reset by peer)
18:04:32*SenasOzys joined #nim
18:05:05PMunchHmm, trying to create my own mutable option type.
18:05:19PMunchIt seems to work well, but I can't quite get regular assignment to work
18:05:28FromGitter<mrwonko> embrace immutability!
18:05:44PMunchie. var x: MyOption[int] = 100 would create a some(100)
18:05:58PMunchmrwonko, oh trust me I really like imutability
18:06:17PMunchBut without persistent data types it's not really fit for what I'm doing
18:06:39PMunchAnd while I could use my implementation of persistent vectors, it would make this interface a bit more clumsy..
18:07:41FromGitter<krux02> PMunch I think in Nim it works best to have mutable data structures for initialization
18:09:01FromGitter<krux02> the best example is the `result` value
18:09:18FromGitter<krux02> much more useful that I initially thought. And I came from Scala.
18:10:09FromGitter<krux02> @mrwonko yea wipe windows and install Linux for sanity.
18:13:39PMunchYeah the result variable is great :)
18:14:34FromGitter<mrwonko> Okay, here's the pull request: https://github.com/nim-lang/nimble/pull/471
18:14:34FromGitter<krux02> In c++ I adopted this, too
18:14:55FromGitter<krux02> I just create a variable `result` by convention.
18:25:39FromGitter<mratsim> For expression would help a lot regarding that.
18:27:23FromGitter<mratsim> instead of an `let foo = initMyArrayType()` that initialize it with default values and loop on a `result`variable inside, you could just use `let foo = [for i in 0..10: i*2]`
18:29:45*byte512 quit (Ping timeout: 264 seconds)
18:31:15*byte512 joined #nim
18:33:35FromGitter<mrwonko> When should my concepts have generic parameters? I guess if I only want generic types to be able to fulfill it? E.g. because I need to refer to different instantiations of it like in the Functor example in the manual.
18:35:22FromGitter<mratsim> I’m pretty sure @andreaferretti has a Functor thing somewhere. I don’t remember where, but this is the library that uses the most concepts I think: https://github.com/unicredit/emmy
18:35:29Araqgood question
18:36:48*SenasOzys quit (Remote host closed the connection)
18:37:14*SenasOzys joined #nim
18:42:30FromGitter<mrwonko> Inside a concept, would there be a difference between `expr is bool`, `let c: bool = expr` and `if expr: discard`?
18:43:10FromGitter<mrwonko> the last one best expresses what I want, but I'm not sure whether if conditions need to be bools or just implicitly convertible to them
18:43:17FromGitter<mratsim> I just stumbled on this, very cool: https://github.com/stisa/nwasm
18:43:42FromGitter<mrwonko> actually I think they just need to be convertible to bool, I remember this one example in the manual about defining implicit conversions that used an if
18:43:56FromGitter<mratsim> inside concepts only types and “existing” works
18:44:27FromGitter<mratsim> so “expr is bool"
18:45:12FromGitter<mratsim> I don’t think you can do `compile(bool(x))`
18:45:31FromGitter<mrwonko> but will `expr is bool` also work for types that are implicitly convertible to bool? I guess I can just try it :D
18:52:00FromGitter<mrwonko> No, it looks like I can use both `if expr: discard`and `expr is bool` in a concept and they have different semantics. https://gist.github.com/mrwonko/315f3cf6c6c6357193998cdefc14396f
18:54:20FromGitter<mrwonko> Fun fact: when I only have the `x is bool` version, I actually get a warning about `toBool` being unused. Sweet.
19:05:58*SenasOzys quit (Ping timeout: 240 seconds)
19:09:36*rokups quit (Quit: Connection closed for inactivity)
19:11:35FromGitter<mrwonko> I get lots of XDeclaredButNotUsed warnings in my concepts even though the identifiers in question are used in the concept body...
19:15:39*SenasOzys joined #nim
19:18:28*user1101 quit (Ping timeout: 240 seconds)
19:20:50*user1101 joined #nim
19:25:18*vlad1777d quit (Ping timeout: 276 seconds)
19:32:56Araqmronko known issue
19:33:25*jjido joined #nim
19:36:56*endragor joined #nim
19:37:49FromGitter<mrwonko> It feels very weird that `let it = myIterator` does some magic instantiation, but then doing `let it2 = it` is a shallow copy. I can apparently use `deepCopy(it2, it)` but I'm left wondering if that's a good idea - if the iterator performs some kind of IO that's bound to explode, right?
19:39:35*askatasuna joined #nim
19:40:50Araqno idea, I don't copy iterators
19:41:45*endragor quit (Ping timeout: 264 seconds)
19:42:23FromGitter<mrwonko> for a backtracking parser I could use an iterator with multi-pass guarantee, and I was wondering if the builtin iterators were a sane choice for that, but it doesn't feel like it
19:43:47Araqiterators for parsers are usually a bad idea.
19:44:38Araqif you want a backtracking parser, copy c2nim's approach. it's simple and works good enough to parse most of C++
19:44:47FromGitter<mrwonko> The builtin iterators or the concept of iterators generally? boost.Spirit uses (C++) iterators for its input, which feels like the right choice there.
19:44:52FromGitter<mrwonko> I'll take a look at c2nim, thank
19:46:03*natrys quit (Ping timeout: 256 seconds)
19:46:19Araqif you don't care about an efficient buffering scheme or code bloat or a messy API, C++ iterators might do the job
19:46:22*askatasuna left #nim ("WeeChat 2.0.1")
19:46:49*natrys joined #nim
19:49:56PMunchHmm, I'm trying to create some easier semantics for a custom Options type. I've already implemented setters that automatically call "some(x)" if you try to set an Option to a value of the right kind. But getters are proving more difficult. I've tried to use converters, but it doesn't work well with nested types..
19:54:16*PMunch quit (Quit: Leaving)
20:14:39*Arrrr quit (Read error: Connection reset by peer)
20:32:57*rockcavera quit (Remote host closed the connection)
20:39:35FromGitter<wu-lee> newbie question: I have two refs, how do I test whether they are pointing to the same object?
20:44:09dom96`==`
20:45:47*natrys quit (Quit: natrys)
20:46:45*vegax87 quit (Changing host)
20:46:45*vegax87 joined #nim
20:46:45*vegax87 quit (Changing host)
20:46:46*vegax87 joined #nim
20:47:32FromGitter<wu-lee> thanks. (I did actually go and check the manual, tutorial, etc, and still wasn't totally sure about this.)
20:50:37FromGitter<shashliick_twitter> so is karyo_ten == mratsim?
20:54:37*durandu quit (Ping timeout: 256 seconds)
20:54:47FromGitter<shashliick_twitter> wow, logging into gitter using twitter gives you a second rate experience
20:55:21*durandu joined #nim
20:56:18*jaco60 joined #nim
20:56:19Yardanicoshashliick_twitter: yes
20:56:26Yardanico(i'm about karyo_ten)
20:58:12*Senketsu_ joined #nim
21:06:21*r3d9u11 quit (Remote host closed the connection)
21:07:35*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:10:17*gokr quit (Ping timeout: 256 seconds)
21:11:02*jaco60 quit (Ping timeout: 260 seconds)
21:11:55*gokr joined #nim
21:15:35*Senketsu_ quit (Remote host closed the connection)
21:17:17FromGitter<mratsim> yes it’s me
21:20:02FromGitter<mratsim> ugh, I hate dealing with Fortran. What the hell with those function names: “dgelsd” —> “double (float64) general matrix least square solver via divide and conquer singular value decomposition"
21:22:38FromGitter<kinkinkijkin> are you not able to implicitly add an index to a seq?
21:23:11FromGitter<mratsim> like enumerate? use `for idx, value in yours:`
21:23:21FromGitter<mratsim> yourseq*
21:23:33FromGitter<mratsim> that will call `pairs` implicitly
21:24:10FromGitter<kinkinkijkin> I need to order lines of an arbitrary number and initial order, and I'm running into an issue at `result[chaint].add(newline)`
21:24:54FromGitter<kinkinkijkin> I have a number of lines in groups but the ordering of the groups' lines is random and set by the programmer
21:25:01FromGitter<kinkinkijkin> like ```
21:25:03FromGitter<kinkinkijkin> oops
21:25:44FromGitter<kinkinkijkin> like ``` ⏎ c1 something ⏎ c2 something ⏎ c5 something ⏎ c3 something ... [https://gitter.im/nim-lang/Nim?at=5abffcd727c509a774c4412f]
21:26:15FromGitter<kinkinkijkin> and I need to put all of the lines of each group in order in their own separate entries to a seq
21:27:48FromGitter<kinkinkijkin> but I can't know how any groups there are in the file beforehand without requiring explicit definition of channel count from the programmer, or manually counting the number of groups before sorting them (which would be very slow and go against the idea of using little memory)
21:33:21*PMunch joined #nim
21:33:53FromGitter<AjBreidenbach> `-d:release` seems to cause the `header` pragma to not work properly
21:35:16FromGitter<AjBreidenbach> at least it does not include the header
21:35:35FromGitter<AjBreidenbach> also is there a way to emit something at the end out the output c code
21:36:43dom96Hrm, that seems unlikely: a lot of code uses the `header` pragma
21:37:07FromGitter<AjBreidenbach> do i need to use nodecl?
21:37:31dom96have you got `importc`?
21:37:36FromGitter<AjBreidenbach> nope
21:37:50dom96you need that
21:37:52FromGitter<AjBreidenbach> i can compile it that way and see how it goes
21:37:58FromGitter<AjBreidenbach> k
21:40:06FromGitter<AjBreidenbach> didn't include it
21:40:51FromGitter<AjBreidenbach> i can just emit /*INCLUDESECTION*/
21:44:15*nsf joined #nim
21:44:52dom96yeah, but that really shouldn't be necessary
21:45:03dom96Show us the code
21:48:18FromGitter<zah> it's a bit late, but I would appreciate your thoughts: ⏎ https://github.com/nim-lang/Nim/issues/7457
21:48:35FromGitter<zah> RFC: Procs for searching in sets and tables by "compatible" key
21:49:01FromGitter<AjBreidenbach> doesn't work without line 323 https://github.com/AjBreidenbach/napibindings/blob/master/napi.nim?utf8=%E2%9C%93#L323
21:49:20FromGitter<AjBreidenbach> i'm happy now that it works though so i don't really care
21:49:32FromGitter<AjBreidenbach> it's emitting the right code
21:49:54dom96hrm, maybe some weird macro bug?
21:50:30dom96if you get a chance submit a bug report with a repro
21:52:19FromGitter<AjBreidenbach> yeah it really tripped me up because it only happens with the release flag
21:52:50FromGitter<kinkinkijkin> what can I do for when I need to add to a position in a seq which doesn't exist yet, and I don't know how far out it is from existing or if previous items in it exist or will exist?
21:53:34FromGitter<kinkinkijkin> also the proc doesn't know if it's going to be writing more data at that position or not, or whether it's writing to a position which already exists
21:53:56FromGitter<mratsim> Try the local fortuneteller? :P
21:54:16FromGitter<AjBreidenbach> lol
21:54:34FromGitter<mratsim> Only way is a buffer I guess
21:54:44FromGitter<kinkinkijkin> like the simplest answer is "preparse and tell the proc these infos" but I'd honestly rather not
21:55:50FromGitter<mratsim> more like, how did people before you solve this problem?
21:55:57FromGitter<kinkinkijkin> idk
21:56:08FromGitter<kinkinkijkin> I'm not good enough at googling to find out
21:57:09FromGitter<Vindaar> I don't quite understand your use case, but maybe a `seq` is not the appropriate container? Maybe an OrderedTable is better suited?
21:57:29*durandu quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
21:58:35FromGitter<kinkinkijkin> I'm taking an arbitrary number of groups of code, and putting each line from the group (which can be arbitrarily-placed as long as they're on their own line) in its own position in a seq, then returning the seq
21:58:57FromGitter<kinkinkijkin> I'm trying to use the option that is both fast and uses little memory
21:59:19FromGitter<mratsim> how do you determine the position?
22:00:33FromGitter<kinkinkijkin> each line starts with either c(int) for an execution group or a name for an expansion group, to indicate which group it's a part of
22:00:57FromGitter<kinkinkijkin> expansion groups can only have one line each but execution groups can contain as many lines as will fit in memory at compile time
22:01:17FromGitter<kinkinkijkin> and can contain references to expansion groups, but that's irrelevant to my current problem
22:02:12FromGitter<mratsim> Once stored, how will you use the data? what access patterns is critical
22:03:20dom96Why can't you just place each group of code into the position that is the next position in your seq?
22:03:25dom96i.e. just `add` it?
22:04:15FromGitter<mratsim> I think he will have random insertions.
22:04:53FromGitter<kinkinkijkin> I will use the data by executing the groups in the renderer, lines must be in order within their groups and groups must be rendered in order for the case where the programmer uses a particular function that requires a previous channel's data being existent and complete
22:05:28FromGitter<mratsim> Look into trees data structure (self balancing trees maybe)
22:06:02FromGitter<mratsim> or a “SortedTable” which sorts on your keys
22:06:26FromGitter<abijahm> guys does anyone an example using the jsonparser from stdlib
22:06:31FromGitter<kinkinkijkin> currently what I'm doing is trying to add the lines at the position in the seq corresponding to the execution group number but that's obviously failing because I don't know how many groups there are beforehand
22:07:32FromGitter<kinkinkijkin> (also tangentially-related, I am a woman, I realize ari isn't a commonly-known name so I'm just making you aware)
22:07:44FromGitter<kinkinkijkin> ((please don't respond to that))
22:07:59FromGitter<abijahm> the event based one
22:08:56FromGitter<Vindaar> So use a table, insert everything and then extract the information from the sorted table afterwards? Or do you need to optimize so much that you can't afford that?
22:09:31FromGitter<mratsim> @kinkinkijkin @Vindaar Nim OrderedTable is ordered by insertion time not by keys: https://forum.nim-lang.org/t/3671
22:10:03FromGitter<mratsim> There is no Key ordered table in Nim so the best way is to wrap one from C or C++
22:10:09FromGitter<kinkinkijkin> yeah and I have programmer-definable group degrouping
22:10:20FromGitter<mratsim> or look there: https://github.com/brianshannan/nim-trees
22:11:04FromGitter<kinkinkijkin> also I have a really, really big issue with importing non-standard libraries or boofing code from others' projects
22:12:21FromGitter<Vindaar> @mratsim Yes, I'm aware. But if performance wasn't critical, one could of course build a normal table, create an OrderedTable by sorting the keys and then extract by insertion order of the OrderedTable. But I guess that's not a solution here :)
22:12:52*Vladar quit (Quit: Leaving)
22:14:00FromGitter<data-man> https://github.com/genotrance/nimrax - Nim wrapper for the rax library
22:18:50FromGitter<abijahm> am trying to figure out how it works for example how do i know a event is the json key
22:19:14dom96abijahm: This might help? https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L1929
22:34:26FromGitter<AjBreidenbach> @dom96 I figured it out, it was my fault
22:35:07dom96AjBreidenbach: What was the problem?
22:36:01FromGitter<AjBreidenbach> i have a template for assertions and it was discarding stuff on release mode
22:36:20FromGitter<AjBreidenbach> I imported most stuff inside of other procs so it was hard to notice
22:37:05FromGitter<AjBreidenbach> well not discarding but the template ended up being empty
22:44:25*user1101 quit (Quit: user1101)
22:46:09dom96ahh
22:48:27*nsf quit (Quit: WeeChat 2.0.1)
23:15:19*PMunch quit (Quit: Leaving)
23:36:21*shmup joined #nim
23:36:57shmupcloned/built nim, then koch. cool. cloned nimble, `koch nimble`, fails when linking, "No such file or directory"
23:41:05dom96which instructions are you following?
23:41:10*gokr quit (Quit: Leaving.)
23:41:19shmuphttps://github.com/nim-lang/nimble#installation
23:41:31shmupthe ./koch nimble technique, i haven't tried just using `nim c`
23:42:13shmupthese instructions as well, previously: https://github.com/nim-lang/nimble#installation
23:42:19shmuper: https://github.com/nim-lang/Nim#compiling
23:42:40dom96try './koch tools'
23:44:07shmupthere's a bit of confusion in the docs for some readers i assume, regarding "Finally, once you have finished the build steps (on Windows, Mac or Linux) you should add the bin directory to your PATH. Assuming that you added Nim's bin directory to your PATH, you may execute the tests using ./koch tests. "
23:44:31shmupbecause koch isn't build in bin, you have to put it in there if you want it in your path. anyways, just built tools
23:44:36shmups/build/built
23:45:28shmuptools built fine, btw.
23:45:53dom96I thought `koch tools` just called `koch nimble`
23:46:08dom96So I don't know what happened there
23:46:15dom96but you shouldn't have cloned Nimble yourself
23:47:05shmupdoh.. ok. so i `koch nimble` from Nim repo, and all is well, my fault.
23:47:19shmup> nimble is Nim's package manager and it can be acquired from the nim-lang/nimble repository. Assuming that you added Nim's bin directory to your PATH, you may install Nimble from source by running koch nimble within the root of the cloned repository.
23:47:29*max3 quit (Quit: Connection closed for inactivity)
23:47:31dom96I'm going to modify these instructions a bit
23:47:33shmupthat sentence made me think, since it's in the README for Nim, that I had to "acquire" the nimble repo, from the URL
23:47:38shmup(that was specified)
23:47:44shmuphah, cool
23:49:30*rockcavera joined #nim
23:51:52dom96There. Hopefully that's a bit better.
23:52:33shmupit's indeed better, it gets the job done almost certainly, which is important
23:53:08dom96You may also be interested in using 'choosenim'
23:53:13*rockcavera quit (Remote host closed the connection)