00:06:20 | * | jrbrt quit (Quit: Oíche mhaith) |
00:08:47 | FromGitter | <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:22 | FromGitter | <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:58 | FromGitter | <AjBreidenbach> trying to i guess |
01:37:07 | FromGitter | <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:03 | FromGitter | <Varriount> @AjBreidenbach Could you post a link to your code? |
08:23:03 | * | Senketsu_ joined #nim |
08:49:01 | FromGitter | <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:30 | FromGitter | <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:05 | FromGitter | <mratsim> dunno, maybe :P. |
09:18:14 | FromGitter | <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:57 | FromGitter | <mratsim> feel free, I’ll give you access to the repo |
09:26:48 | FromGitter | <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:27 | FromGitter | <mratsim> Here is an overview of the work I feel is needed: https://github.com/mratsim/chirp8/issues/1 |
09:51:18 | FromGitter | <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:28 | FromGitter | <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:43 | clyybber | Good 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:25 | FromGitter | <mratsim> hello clyybber |
11:05:43 | clyybber | hello |
11:18:04 | Arrrr | type Foo[A, B] = array[A, B] |
11:18:04 | Arrrr | const BAR: Foo[3, int] = [1, 2, 3] |
11:18:04 | Arrrr | This doesn't compile, it is a bug? |
11:18:41 | Arrrr | The compiler error log is not very clear |
11:35:23 | * | Senketsu_ quit (Ping timeout: 260 seconds) |
11:36:24 | FromGitter | <mratsim> A: static[int] should work |
11:36:59 | FromGitter | <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:55 | Arrrr | Thanks mratsim, it works |
12:09:49 | Arrrr | Mmm, 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:02 | FromGitter | <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:25 | FromGitter | <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:44 | FromGitter | <mratsim> but maybe try a static[proc] :? |
12:14:30 | FromGitter | <mratsim> I’m pretty sure you will crash the compiler and open a bug soon :P |
12:14:37 | Arrrr | Mmm |
12:15:25 | federico3 | anybody 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:35 | FromGitter | <krux02> what is distcc |
13:20:44 | FromGitter | <krux02> a static proc? what should that be? |
13:20:56 | * | user1101 joined #nim |
13:21:05 | FromGitter | <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:09 | Yardanico | krux02: distcc is a compiler wrapper |
14:15:19 | Yardanico | so you can distribute compilation over multiple machines/servers |
14:15:34 | Yardanico | "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:21 | FromGitter | <krux02> thanks for the info |
14:16:31 | FromGitter | <krux02> I think I use icecc |
14:17:17 | FromGitter | <krux02> I didn't like it since only a true project rebuild could be improved in performance |
14:17:32 | FromGitter | <krux02> incremental builds were at the same speed at the best case |
14:18:48 | FromGitter | <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:36 | FromGitter | <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:01 | FromGitter | <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:25 | PMunch | Hmm, got a strange issue in my macro. Nim crashes with a "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" |
14:26:43 | PMunch | But it does the very last step of the macro which is to print out the result with toStrLit |
14:26:58 | PMunch | And it happens even if I remove that line |
14:27:30 | FromGitter | <krux02> well can you simply show the macro so I can run it? |
14:27:38 | PMunch | If I put a result = newStmtList() after that line it works fine (but obviously doesn't do much) |
14:27:57 | PMunch | krux02[m], sure if you want to 1200 line behemoth that it is :P |
14:28:29 | FromGitter | <krux02> well if it has only one file it's fine |
14:28:36 | FromGitter | <krux02> 1200 lines is not a behemoth |
14:28:46 | FromGitter | <krux02> 120000 lines is a behemoth |
14:30:09 | PMunch | https://github.com/PMunch/protobuf-nim/tree/options |
14:30:21 | PMunch | It's split over multiple files as well :P |
14:30:37 | PMunch | But most of the fun happens in the src/protobuf.nim file |
14:31:03 | PMunch | If you look at the last commit there you can see the diff that started these issues |
14:31:24 | PMunch | And the test.nim file in the base directory can be used to trigger it |
14:32:15 | PMunch | Line 805 is where the echo statement is, so you can look backwards from there to see what happens |
14:33:11 | PMunch | Ah wait... |
14:33:22 | PMunch | It's a botched copy-paste :P |
14:33:34 | PMunch | On line 736 |
14:33:55 | PMunch | Where it gets the field from the definition to access the arguments |
14:34:26 | PMunch | (and yes, I know those should probably be variables and not just three/four level deep indices) |
14:35:21 | FromGitter | <krux02> cannot open combparser |
14:36:36 | FromGitter | <krux02> you should not do echo toStrLit |
14:36:56 | FromGitter | <krux02> toStrLit creates a string literal, so it creates a nim node |
14:37:01 | FromGitter | <krux02> a nim node should not be printed |
14:37:23 | FromGitter | <krux02> do echo result.repr |
14:38:47 | FromGitter | <krux02> just from my experience I would put a lot of `expectKind` statements on `impls` members. |
14:39:16 | FromGitter | <krux02> The generated/parsed AST from Nim has already changed a few times, and it might change again. |
14:39:43 | FromGitter | <krux02> so just to make your code fail properly if that happens. sprinkle `expectKind` everywhere |
14:40:00 | PMunch | Hmm, that might be a good idea |
14:40:12 | PMunch | And yeah, that should really be using repr |
14:42:05 | FromGitter | <krux02> it doesn't solve your probem though |
14:42:06 | PMunch | Which is? |
14:42:07 | PMunch | I already solved my original issue as I said above |
14:42:14 | FromGitter | <krux02> oh :P |
14:51:35 | PMunch | Hmm, the options module always return an immutable value.. That's a bit inconvenient |
15:06:07 | * | nsf joined #nim |
15:06:16 | dom96 | Functional Programming isn't a fan of mutability |
15:07:28 | PMunch | I know :) |
15:07:33 | PMunch | That's what so great about it |
15:08:03 | PMunch | But mixing imperative and functional means you have data types that aren't really intended for the functional paradigm |
15:08:24 | PMunch | It'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:39 | dom96 | internode: 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:23 | FromGitter | <alehander42> @mratsim very cool chirp8 :D |
16:41:51 | * | endragor quit (Ping timeout: 255 seconds) |
16:50:52 | * | max3 joined #nim |
16:54:28 | FromGitter | <mratsim> Thanks :) |
16:54:35 | * | arnetheduck quit (Ping timeout: 240 seconds) |
17:06:58 | dom96 | Interesting: 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:34 | FromGitter | <mrwonko> didn't I see something like that recently? |
17:16:45 | FromGitter | <mrwonko> ah, yes: https://blogs.msdn.microsoft.com/windbg/2017/09/25/time-travel-debugging-in-windbg-preview/ |
17:17:10 | FromGitter | <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:29 | FromGitter | <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:39 | FromGitter | <alehander42> yes, rr is very cool! the windbg time travel tool also seems promising but I haven't tried it |
17:41:52 | FromGitter | <alehander42> I have to start using windows again from time to time to keep up |
17:43:34 | FromGitter | <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:50 | FromGitter | <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:38 | dom96 | mrwonko: 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:15 | FromGitter | <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:05 | PMunch | Hmm, trying to create my own mutable option type. |
18:05:19 | PMunch | It seems to work well, but I can't quite get regular assignment to work |
18:05:28 | FromGitter | <mrwonko> embrace immutability! |
18:05:44 | PMunch | ie. var x: MyOption[int] = 100 would create a some(100) |
18:05:58 | PMunch | mrwonko, oh trust me I really like imutability |
18:06:17 | PMunch | But without persistent data types it's not really fit for what I'm doing |
18:06:39 | PMunch | And while I could use my implementation of persistent vectors, it would make this interface a bit more clumsy.. |
18:07:41 | FromGitter | <krux02> PMunch I think in Nim it works best to have mutable data structures for initialization |
18:09:01 | FromGitter | <krux02> the best example is the `result` value |
18:09:18 | FromGitter | <krux02> much more useful that I initially thought. And I came from Scala. |
18:10:09 | FromGitter | <krux02> @mrwonko yea wipe windows and install Linux for sanity. |
18:13:39 | PMunch | Yeah the result variable is great :) |
18:14:34 | FromGitter | <mrwonko> Okay, here's the pull request: https://github.com/nim-lang/nimble/pull/471 |
18:14:34 | FromGitter | <krux02> In c++ I adopted this, too |
18:14:55 | FromGitter | <krux02> I just create a variable `result` by convention. |
18:25:39 | FromGitter | <mratsim> For expression would help a lot regarding that. |
18:27:23 | FromGitter | <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:35 | FromGitter | <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:22 | FromGitter | <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:29 | Araq | good question |
18:36:48 | * | SenasOzys quit (Remote host closed the connection) |
18:37:14 | * | SenasOzys joined #nim |
18:42:30 | FromGitter | <mrwonko> Inside a concept, would there be a difference between `expr is bool`, `let c: bool = expr` and `if expr: discard`? |
18:43:10 | FromGitter | <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:17 | FromGitter | <mratsim> I just stumbled on this, very cool: https://github.com/stisa/nwasm |
18:43:42 | FromGitter | <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:56 | FromGitter | <mratsim> inside concepts only types and “existing” works |
18:44:27 | FromGitter | <mratsim> so “expr is bool" |
18:45:12 | FromGitter | <mratsim> I don’t think you can do `compile(bool(x))` |
18:45:31 | FromGitter | <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:00 | FromGitter | <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:20 | FromGitter | <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:35 | FromGitter | <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:56 | Araq | mronko known issue |
19:33:25 | * | jjido joined #nim |
19:36:56 | * | endragor joined #nim |
19:37:49 | FromGitter | <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:50 | Araq | no idea, I don't copy iterators |
19:41:45 | * | endragor quit (Ping timeout: 264 seconds) |
19:42:23 | FromGitter | <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:47 | Araq | iterators for parsers are usually a bad idea. |
19:44:38 | Araq | if you want a backtracking parser, copy c2nim's approach. it's simple and works good enough to parse most of C++ |
19:44:47 | FromGitter | <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:52 | FromGitter | <mrwonko> I'll take a look at c2nim, thank |
19:46:03 | * | natrys quit (Ping timeout: 256 seconds) |
19:46:19 | Araq | if 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:56 | PMunch | Hmm, 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:35 | FromGitter | <wu-lee> newbie question: I have two refs, how do I test whether they are pointing to the same object? |
20:44:09 | dom96 | `==` |
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:32 | FromGitter | <wu-lee> thanks. (I did actually go and check the manual, tutorial, etc, and still wasn't totally sure about this.) |
20:50:37 | FromGitter | <shashliick_twitter> so is karyo_ten == mratsim? |
20:54:37 | * | durandu quit (Ping timeout: 256 seconds) |
20:54:47 | FromGitter | <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:19 | Yardanico | shashliick_twitter: yes |
20:56:26 | Yardanico | (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:17 | FromGitter | <mratsim> yes it’s me |
21:20:02 | FromGitter | <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:38 | FromGitter | <kinkinkijkin> are you not able to implicitly add an index to a seq? |
21:23:11 | FromGitter | <mratsim> like enumerate? use `for idx, value in yours:` |
21:23:21 | FromGitter | <mratsim> yourseq* |
21:23:33 | FromGitter | <mratsim> that will call `pairs` implicitly |
21:24:10 | FromGitter | <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:54 | FromGitter | <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:01 | FromGitter | <kinkinkijkin> like ``` |
21:25:03 | FromGitter | <kinkinkijkin> oops |
21:25:44 | FromGitter | <kinkinkijkin> like ``` ⏎ c1 something ⏎ c2 something ⏎ c5 something ⏎ c3 something ... [https://gitter.im/nim-lang/Nim?at=5abffcd727c509a774c4412f] |
21:26:15 | FromGitter | <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:48 | FromGitter | <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:53 | FromGitter | <AjBreidenbach> `-d:release` seems to cause the `header` pragma to not work properly |
21:35:16 | FromGitter | <AjBreidenbach> at least it does not include the header |
21:35:35 | FromGitter | <AjBreidenbach> also is there a way to emit something at the end out the output c code |
21:36:43 | dom96 | Hrm, that seems unlikely: a lot of code uses the `header` pragma |
21:37:07 | FromGitter | <AjBreidenbach> do i need to use nodecl? |
21:37:31 | dom96 | have you got `importc`? |
21:37:36 | FromGitter | <AjBreidenbach> nope |
21:37:50 | dom96 | you need that |
21:37:52 | FromGitter | <AjBreidenbach> i can compile it that way and see how it goes |
21:37:58 | FromGitter | <AjBreidenbach> k |
21:40:06 | FromGitter | <AjBreidenbach> didn't include it |
21:40:51 | FromGitter | <AjBreidenbach> i can just emit /*INCLUDESECTION*/ |
21:44:15 | * | nsf joined #nim |
21:44:52 | dom96 | yeah, but that really shouldn't be necessary |
21:45:03 | dom96 | Show us the code |
21:48:18 | FromGitter | <zah> it's a bit late, but I would appreciate your thoughts: ⏎ https://github.com/nim-lang/Nim/issues/7457 |
21:48:35 | FromGitter | <zah> RFC: Procs for searching in sets and tables by "compatible" key |
21:49:01 | FromGitter | <AjBreidenbach> doesn't work without line 323 https://github.com/AjBreidenbach/napibindings/blob/master/napi.nim?utf8=%E2%9C%93#L323 |
21:49:20 | FromGitter | <AjBreidenbach> i'm happy now that it works though so i don't really care |
21:49:32 | FromGitter | <AjBreidenbach> it's emitting the right code |
21:49:54 | dom96 | hrm, maybe some weird macro bug? |
21:50:30 | dom96 | if you get a chance submit a bug report with a repro |
21:52:19 | FromGitter | <AjBreidenbach> yeah it really tripped me up because it only happens with the release flag |
21:52:50 | FromGitter | <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:34 | FromGitter | <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:56 | FromGitter | <mratsim> Try the local fortuneteller? :P |
21:54:16 | FromGitter | <AjBreidenbach> lol |
21:54:34 | FromGitter | <mratsim> Only way is a buffer I guess |
21:54:44 | FromGitter | <kinkinkijkin> like the simplest answer is "preparse and tell the proc these infos" but I'd honestly rather not |
21:55:50 | FromGitter | <mratsim> more like, how did people before you solve this problem? |
21:55:57 | FromGitter | <kinkinkijkin> idk |
21:56:08 | FromGitter | <kinkinkijkin> I'm not good enough at googling to find out |
21:57:09 | FromGitter | <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:35 | FromGitter | <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:57 | FromGitter | <kinkinkijkin> I'm trying to use the option that is both fast and uses little memory |
21:59:19 | FromGitter | <mratsim> how do you determine the position? |
22:00:33 | FromGitter | <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:57 | FromGitter | <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:17 | FromGitter | <kinkinkijkin> and can contain references to expansion groups, but that's irrelevant to my current problem |
22:02:12 | FromGitter | <mratsim> Once stored, how will you use the data? what access patterns is critical |
22:03:20 | dom96 | Why can't you just place each group of code into the position that is the next position in your seq? |
22:03:25 | dom96 | i.e. just `add` it? |
22:04:15 | FromGitter | <mratsim> I think he will have random insertions. |
22:04:53 | FromGitter | <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:28 | FromGitter | <mratsim> Look into trees data structure (self balancing trees maybe) |
22:06:02 | FromGitter | <mratsim> or a “SortedTable” which sorts on your keys |
22:06:26 | FromGitter | <abijahm> guys does anyone an example using the jsonparser from stdlib |
22:06:31 | FromGitter | <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:32 | FromGitter | <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:44 | FromGitter | <kinkinkijkin> ((please don't respond to that)) |
22:07:59 | FromGitter | <abijahm> the event based one |
22:08:56 | FromGitter | <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:31 | FromGitter | <mratsim> @kinkinkijkin @Vindaar Nim OrderedTable is ordered by insertion time not by keys: https://forum.nim-lang.org/t/3671 |
22:10:03 | FromGitter | <mratsim> There is no Key ordered table in Nim so the best way is to wrap one from C or C++ |
22:10:09 | FromGitter | <kinkinkijkin> yeah and I have programmer-definable group degrouping |
22:10:20 | FromGitter | <mratsim> or look there: https://github.com/brianshannan/nim-trees |
22:11:04 | FromGitter | <kinkinkijkin> also I have a really, really big issue with importing non-standard libraries or boofing code from others' projects |
22:12:21 | FromGitter | <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:00 | FromGitter | <data-man> https://github.com/genotrance/nimrax - Nim wrapper for the rax library |
22:18:50 | FromGitter | <abijahm> am trying to figure out how it works for example how do i know a event is the json key |
22:19:14 | dom96 | abijahm: This might help? https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L1929 |
22:34:26 | FromGitter | <AjBreidenbach> @dom96 I figured it out, it was my fault |
22:35:07 | dom96 | AjBreidenbach: What was the problem? |
22:36:01 | FromGitter | <AjBreidenbach> i have a template for assertions and it was discarding stuff on release mode |
22:36:20 | FromGitter | <AjBreidenbach> I imported most stuff inside of other procs so it was hard to notice |
22:37:05 | FromGitter | <AjBreidenbach> well not discarding but the template ended up being empty |
22:44:25 | * | user1101 quit (Quit: user1101) |
22:46:09 | dom96 | ahh |
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:57 | shmup | cloned/built nim, then koch. cool. cloned nimble, `koch nimble`, fails when linking, "No such file or directory" |
23:41:05 | dom96 | which instructions are you following? |
23:41:10 | * | gokr quit (Quit: Leaving.) |
23:41:19 | shmup | https://github.com/nim-lang/nimble#installation |
23:41:31 | shmup | the ./koch nimble technique, i haven't tried just using `nim c` |
23:42:13 | shmup | these instructions as well, previously: https://github.com/nim-lang/nimble#installation |
23:42:19 | shmup | er: https://github.com/nim-lang/Nim#compiling |
23:42:40 | dom96 | try './koch tools' |
23:44:07 | shmup | there'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:31 | shmup | because 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:36 | shmup | s/build/built |
23:45:28 | shmup | tools built fine, btw. |
23:45:53 | dom96 | I thought `koch tools` just called `koch nimble` |
23:46:08 | dom96 | So I don't know what happened there |
23:46:15 | dom96 | but you shouldn't have cloned Nimble yourself |
23:47:05 | shmup | doh.. ok. so i `koch nimble` from Nim repo, and all is well, my fault. |
23:47:19 | shmup | > 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:31 | dom96 | I'm going to modify these instructions a bit |
23:47:33 | shmup | that 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:38 | shmup | (that was specified) |
23:47:44 | shmup | hah, cool |
23:49:30 | * | rockcavera joined #nim |
23:51:52 | dom96 | There. Hopefully that's a bit better. |
23:52:33 | shmup | it's indeed better, it gets the job done almost certainly, which is important |
23:53:08 | dom96 | You may also be interested in using 'choosenim' |
23:53:13 | * | rockcavera quit (Remote host closed the connection) |