00:00:04 | FromDiscord | <hugogranstrom> Happy new year ๐๐๐ฅณ |
00:01:39 | FromDiscord | <lqdev> happy new year! |
00:02:01 | * | JustASlacker quit (Ping timeout: 264 seconds) |
00:02:11 | FromDiscord | <lqdev> though it's already 1 am where i live ยทโยท |
00:02:37 | FromDiscord | <hugogranstrom> Same, I'm juste late hehe |
00:03:21 | FromDiscord | <lqdev> 2021 oughtta be an exciting year for nim |
00:04:48 | * | hmmm quit (Quit: WeeChat 3.0) |
00:05:34 | * | lritter quit (Quit: Leaving) |
00:06:01 | * | vicfred quit (Quit: Leaving) |
00:06:13 | FromDiscord | <shadow.> yeah for sure |
00:11:13 | FromDiscord | <William_CTO> Merry 2021 |
00:11:15 | FromDiscord | <hugogranstrom> Absolutely, momentum is building up |
00:12:14 | FromDiscord | <bark> happy birthday to the people born on january the first! |
00:14:36 | FromDiscord | <arun> sent a long message, see http://ix.io/2Ksb |
00:16:26 | FromDiscord | <dom96> haha, what Araq said is now immortalised into a blog post |
00:18:45 | * | kenran quit (Quit: leaving) |
00:19:16 | * | vicfred joined #nim |
00:25:03 | * | NimBot joined #nim |
00:41:01 | * | tane quit (Quit: Leaving) |
01:07:04 | FromDiscord | <Vindaar> happy new year everyone ๐ฅณ |
01:08:02 | FromDiscord | <lqdev> ~~vindaar you're late~~ |
01:08:07 | FromDiscord | <lqdev> er |
01:08:10 | FromDiscord | <lqdev> happy new year! |
01:24:59 | * | smitop quit (Quit: Connection closed for inactivity) |
01:29:18 | FromDiscord | <juliuskiesian> is there a quick way to convert a set to a seq? |
01:29:34 | FromDiscord | <Recruit_main707> lets go, we made it into the "name is even shown in the graph" (top 21) in most used languages of AoC https://media.discordapp.net/attachments/371759389889003532/794376739153379328/unknown.png |
01:29:34 | FromDiscord | <ElegantBeef> Yes in devel |
01:30:12 | FromDiscord | <ElegantBeef> https://nim-lang.github.io/Nim/setutils.html#toSet.t%2Cuntyped |
01:30:17 | FromDiscord | <ElegantBeef> Courtesy of me ๐ |
01:38:20 | FromDiscord | <juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2Ksu |
01:38:36 | FromDiscord | <juliuskiesian> do i need latest devel? |
01:39:10 | * | Prestige quit (Quit: Prestige) |
01:39:59 | FromDiscord | <ElegantBeef> `std/setutils` |
01:40:12 | FromDiscord | <ElegantBeef> All new modules are forcing that `std` |
01:40:32 | * | Prestige joined #nim |
01:40:41 | FromDiscord | <ElegantBeef> It should be used regardless and i think should throw an error if not using `std` for any of the stdlib from your own project with a flag to disable that |
01:52:28 | Torro | happy new year |
01:52:36 | * | Torro quit (Quit: bye) |
01:54:03 | * | Prestige quit (Quit: Prestige) |
01:55:23 | * | Prestige joined #nim |
02:24:29 | * | disruptek throbs. |
02:43:46 | Prestige | disruptek: will you throb less in 2021? |
02:48:48 | disruptek | prestige: will you sponsor me? |
02:52:45 | Prestige | Like, AA? |
02:53:00 | Prestige | or like a commercial sponsor |
02:53:22 | disruptek | yes. |
02:53:35 | Prestige | Sure, if you bend to my will for a task |
02:53:45 | disruptek | i signed up for github sponsors to help support my drug habit. |
02:54:03 | disruptek | what's the task? |
02:54:26 | Prestige | multiple inheritance or concepts |
02:54:36 | disruptek | i fucking knew it. |
02:54:40 | FromDiscord | <ElegantBeef> Prestige i'm working on the `absImport` now, got the AST generated but it's a nice error generating macro |
02:54:59 | disruptek | what's concepts worth to you? |
02:55:19 | Prestige | in dollars? hmm |
02:55:44 | Prestige | oh beef, neat |
02:56:05 | disruptek | for a nim programmer, beef has very poor taste. |
02:56:11 | FromDiscord | <ElegantBeef> Truth |
02:56:22 | FromDiscord | <ElegantBeef> He's the one that suggested it so meh |
02:56:33 | FromDiscord | <ElegantBeef> What's the issue with my taste anywho? |
02:57:02 | disruptek | iirc, absImport is a bad idea. |
02:57:21 | FromDiscord | <ElegantBeef> Project root relative importing |
02:57:44 | FromDiscord | <ElegantBeef> Prestige suggested it so send the hate to him |
02:57:50 | Prestige | ye |
02:57:53 | disruptek | you say tomato, i say dogshit. |
02:58:16 | Prestige | eh I would like to have it |
02:58:35 | Prestige | anyway disruptek idk the current state of concepts |
02:58:50 | FromDiscord | <ElegantBeef> Nice error anywho, AST is identical to what a user would write but it's saying the file doesnt exist |
02:58:52 | FromDiscord | <ElegantBeef> So 10/10 |
02:59:13 | disruptek | the current state is that i refuse to test them until the old syntax is ported, and araq says that i'm an idiot as a result. |
02:59:27 | disruptek | actually, he probably has other reasons for calling me an idiot. |
02:59:53 | FromDiscord | <ElegantBeef> I'm surprised i havent been called an idiot by him yet ๐ |
03:00:21 | disruptek | but the fact is, i don't see how we can merge them without a migration. |
03:01:19 | disruptek | old concepts are not just slow, but very broken. |
03:01:29 | disruptek | and recently, they even broke jason. |
03:01:37 | disruptek | and my json serializer, also. |
03:02:28 | Prestige | that's a sad state of affairs |
03:02:36 | disruptek | it's not brilliant. |
03:16:35 | FromDiscord | <ElegantBeef> So prestige doesnt seem there is an overly pretty way of doing it |
03:16:49 | FromDiscord | <ElegantBeef> I've got a template call which works properly but then the import fails |
03:17:29 | FromDiscord | <ElegantBeef> It's pushed if interested in lookging |
03:18:53 | Prestige | Link? |
03:19:49 | FromDiscord | <ElegantBeef> https://github.com/beef331/import-utils |
03:25:48 | disruptek | Link? |
03:26:41 | disruptek | did you really make a repo with a fucking hyphen in it? |
03:27:05 | disruptek | what did i do to you? |
03:29:11 | Prestige | @ElegantBeef are you just getting the error in the tests that submod doesn't exist? |
03:29:23 | disruptek | i need to add a package section to my style doc. |
03:29:44 | FromDiscord | <ElegantBeef> Thought i made it with an underscore to be honest |
03:29:47 | FromDiscord | <ElegantBeef> atleast i intended to |
03:30:31 | Prestige | disruptek: How much for a proper multiple inheritance implementation? I know how it should be structured, but I'm not a nim wizard. And it would require compiler changes afaict |
03:31:18 | disruptek | you /do/ know how it should be structured? |
03:31:29 | Prestige | Yes |
03:31:39 | disruptek | !rfc inheritance |
03:31:39 | disbot | https://github.com/nim-lang/RFCs/issues/262 -- 3Support for Multiple Inheritence 7& 7 more... |
03:31:53 | Prestige | Damn that bot is handy |
03:32:18 | Prestige | I'd think the implementation shown here would suffice https://oberoncore.ru/_media/library/templ_a_systematic_approach_to_multiple_inheritance_implementation.pdf |
03:32:55 | Prestige | I just have one particular point that should be added, which is illustrated in my RFC. Might not be super clear |
03:33:14 | disruptek | "none of these arguments hold." -- so, it doesn't increase expressive power, either? |
03:33:34 | disruptek | which language is your MI experience with? |
03:33:36 | disruptek | java? |
03:33:40 | Prestige | Idk what he means by that |
03:33:56 | Prestige | eh java only has a half baked implementation of MI |
03:34:10 | disruptek | don't make me guess. |
03:34:12 | Prestige | It's just a subject I've thought about and have wanted |
03:34:13 | disruptek | python? |
03:34:15 | Prestige | nah |
03:34:24 | Prestige | I've not used it in other languages |
03:34:35 | Prestige | Just have wished I'd had it available |
03:34:46 | * | vicfred quit (Quit: Leaving) |
03:35:09 | Prestige | mainly in java and typescript (and nim, now) |
03:36:05 | disruptek | hmm. |
03:36:07 | Prestige | I've mainly wanted it for game development |
03:37:05 | disruptek | why do you think it needs compiler changes? |
03:37:14 | Prestige | Anyway this is my main point here https://github.com/nim-lang/RFCs/issues/262#issuecomment-713236634 |
03:37:15 | disbot | โฅ Support for Multiple Inheritence ; snippet at 12https://play.nim-lang.org/#ix=2Jbu |
03:37:16 | disruptek | i will read the oberon paper, but first i want to pick your brain. |
03:38:03 | disruptek | "Both arguments are false as will be shown below." |
03:38:16 | disruptek | so, yeah, it doesn't increase expressive power. |
03:38:16 | Prestige | Basically new procs (or methods?) need to be created for the sub-type, which may need to remove a procCall to a grandparent so that it is not invoked twice |
03:38:46 | disruptek | no big deal. |
03:39:03 | Prestige | I think it does, but I didn't understand why he said it wouldn't |
03:39:16 | disruptek | what would be perhaps more valuable would be a proper vtable impl. |
03:40:02 | disruptek | i'm a little sad that we gave up multi-methods; how complex could they be, right? |
03:40:07 | Prestige | I think he goes into that about a page or two in, for optimisations |
03:40:28 | disruptek | it matters to us because we do method dispatch using method /names/ at the moment. |
03:40:37 | Prestige | Ah, I see |
03:41:01 | disruptek | this hampers adoption of inheritance, which hampers interest and performance of MI. |
03:41:39 | Prestige | Yeah, I think we'd want vtables for this MI implementation as well, but you'd know better than I |
03:41:46 | Prestige | especially after reading the paper |
03:43:29 | Prestige | It's an interesting approach. I think I'll write up an actual MI use case for something I wanted to make |
03:43:56 | disruptek | that would be useful. |
03:44:23 | disruptek | what has discouraged you from building this? |
03:45:32 | Prestige | I'm not sure how it could be done outside of compiler chanegs, and I'm not sure where to look. It seems daunting, because my Nim knowledge is lacking |
03:46:53 | disruptek | in my limited experience, the compiler is the thorniest nim code you're likely to read. |
03:47:15 | disruptek | i'd much rather start from scratch. |
03:47:50 | Prestige | Hopefully it isn't too bad to deal with |
03:48:19 | disruptek | the description is three pages long. how hard could it be? |
03:49:20 | Prestige | ยฏ\_(ใ)_/ยฏ |
03:51:07 | disruptek | pick a syntax that we can impl, for starters. |
03:51:37 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:51:51 | Prestige | I was thinking of using what was in my RFC, using commas to separate the types. Like `Player = ref object of Locatable, Updatable` |
03:52:39 | disruptek | type Missile = ref object {.inherits: [Projectile, ParticleEmitter].} might work for the macro impl. |
03:53:10 | disruptek | i don't think it makes sense to wrap the whole type section, and you cannot pragma type sections iirc. |
03:53:11 | Prestige | That also works, I just thought the former was a bit easier on the eyes |
03:53:18 | Prestige | true |
03:53:23 | disruptek | this is just the prototype, chucklehead. |
03:53:38 | Prestige | Whatever floats your boat, I'm not too picky |
03:53:46 | * | muffindrake joined #nim |
03:57:40 | saem | I also find it hilarious of using multiple inheritance in an example which so clearly demonstrates why the games industry went towards things like ECS (composition). |
03:57:45 | disruptek | if we can use something better than multiple dispatch I'm all for it. My main goal is to enable the programmer to have the functionality/syntax as I've described in the post. |
03:58:12 | disruptek | what /is/ that functionality? |
03:58:12 | Prestige | https://play.nim-lang.org/#ix=2KsV disruptek something like this |
03:58:37 | disruptek | it's like you want the programmer to have to write code and then the MI scheme deletes it. |
03:58:48 | disruptek | isn't this is opposite of what everyone else wants? |
03:59:03 | Prestige | I need to add something actually |
03:59:07 | Prestige | And no, not really |
04:01:42 | disruptek | procCall Entity(this).update(deltaTime) |
04:01:47 | Prestige | Here we go: https://play.nim-lang.org/#ix=2KsZ |
04:01:49 | disruptek | is this really what you want to type? |
04:02:10 | disruptek | why not `this.entity.update deltaTime`? |
04:02:15 | saem | Engines are running away from exactly this type of code. |
04:02:42 | Prestige | disruptek: I didn't know you could do that (unless you mean the new implementation) |
04:03:26 | disruptek | your player can have a field that holds the Entity in it, of course. |
04:04:01 | Prestige | Yeah, in accordance to the implementation in the paper, that's what would happen pretty much |
04:04:07 | saem | But why bother decomposing a player into components if you're just going to statically (MI) inherit it again? |
04:04:13 | disruptek | that's my point. |
04:04:55 | Prestige | What do you mean? |
04:04:59 | saem | I've done enough ECS like things, heck anyone has if they've used a database without some over wrought ORM, and this is exactly in the wrong direction. |
04:05:25 | saem | `type Player = ref object {.inherits: [Animation, Locatable].}` <-- this line is static, it's not runtime, happens once. |
04:05:31 | Prestige | I have yet to see an ECS implementation that wasn't terrible to work with |
04:05:45 | disruptek | !repos ecs |
04:05:46 | disbot | https://github.com/yglukhov/ecs -- 9ecs: 11Entity Component System 15 21โญ 2๐ด |
04:05:46 | disbot | https://github.com/rlipsc/polymorph -- 9polymorph: 11Polymorph is a composable entity component system generator - create statically defined ECS architectures generated from your design. 15 12โญ 0๐ด |
04:05:46 | disbot | https://github.com/planetis-m/breakout -- 9breakout: 11Game implemented using strict ECS architecture. Used as a testbed. 15 8โญ 0๐ด 7& 5 more... |
04:06:12 | disruptek | you looked at the 8 hits for `ecs` in nim? |
04:06:31 | Prestige | Yeah, I've looked at a few at least |
04:06:55 | disruptek | and what do they get wrong? |
04:07:08 | disruptek | besides lack of MI. |
04:07:26 | Prestige | They seem cumbersome to work with, it's a pain to use |
04:07:31 | saem | The querying is often not great in ECS implementations and that's where the annoying ceremony comes in most often. |
04:08:10 | saem | I think spending some time on a query system would actually make ECS quite pleasant. FlatDB actually has a pretty nice example of how to make a small and pleasant DSL for querying. |
04:08:13 | saem | in Nim. |
04:08:24 | disruptek | !repo flatdb |
04:08:25 | disbot | https://github.com/enthus1ast/flatdb -- 9flatdb: 11small/tiny, flatfile, jsonl based, inprogress database for nim 15 29โญ 1๐ด |
04:10:01 | Prestige | basically I'd want to do something like `type Player = ref object Animation, Locatable`, idk how that differs from the inherits pragma |
04:10:35 | disruptek | it differs because .inherits can be impl as a macro, today, without compiler changes. |
04:10:43 | Prestige | ah |
04:11:02 | saem | I don't believe you do, but who knows. I think what you want is the animate system, and it should see all entities with animation and location components and you want a nice way to receive that as a parameter and then do your thing. |
04:11:15 | Prestige | Needing the contents of other methos seems difficult though, I'm not sure how you do that with a macro |
04:12:08 | Prestige | saem: if you can make an ecs system that isn't annoying to use I'm all for it. I just have yet to see one |
04:12:09 | disruptek | you do that part with term-rewriting, probably, but i'm less and less convinced this is even worth building. |
04:12:11 | saem | so proc animation(a: AnimationTypeWhichHidesTheBoilerPlate): void |
04:12:59 | saem | AnimationTypeWhichHidesTheBoilerPlate: is an entity with Animation and Locatable components. |
04:13:00 | Prestige | disruptek: what are you not convinced of? |
04:13:24 | disruptek | that this is even worth building, of course. |
04:13:34 | Prestige | I mean, why? |
04:13:43 | disruptek | because i read the paper. |
04:14:13 | Prestige | Can you elaborate why it convinced you it isn't worth building? |
04:14:21 | disruptek | the syntax looks poor, the speed is worse due to the compiler impl, and it doesn't buy you anything in terms of expressive power. |
04:14:35 | disruptek | what have i missed? |
04:14:47 | disruptek | it's a bunch of extra code that you don't need. |
04:14:55 | disruptek | it buys you nothing and can only limit you. |
04:15:15 | Prestige | It gives more power to the programmer to be able to use MI. MI wasn't implemented in several languages for no reason; it's useful |
04:15:28 | disruptek | uh, that's not what the paper says. |
04:15:38 | disruptek | do you wonder why it wasn't impl in nim? |
04:15:51 | Prestige | There are many things not implemented in Nim |
04:16:07 | FromDiscord | <Jarred Kenny> ๐ฟ |
04:17:57 | Prestige | The only way to implement the example architecture without MI (with many more objects and types) is to create an elaborate ECS system, that will generate much more code and will be cumbersome to use in comparison to multiple inheritance |
04:19:31 | disruptek | ask lqdev what he thinks. |
04:20:32 | Prestige | of what, a 3rd way to implement the architecture? |
04:21:01 | disruptek | no, go like, "lqdev: am i a knucklehead?" |
04:21:05 | disruptek | and see what he says. |
04:21:24 | saem | https://play.nim-lang.org/#ix=2Kt3 |
04:22:14 | Prestige | saem: yeah, I've seen ECS stuff before |
04:22:18 | saem | That's probably closer to what you want. The you can write proc on the type that is the query, so it looks like a type that's all once pretty object, but not all the rest of what MI entails which is layout of memory and all sorts of other bits. |
04:23:58 | saem | data oriented stuff is definitely weird because it's exactly not domain oriented. It's really annoying when all you want to do is reason about a player and things they do. Not worry about first decomposing that into all the systems, components, etc... |
04:25:45 | saem | I don't think MI helps there, unfortunately. But I do get your point about wanting a layer on top and not have to hand roll all that decomposition yourself and how it might seem like the MI approach might do that. |
04:26:08 | disruptek | i don't think it helps at all. |
04:26:38 | saem | Mechanically no, but I get why ones intuition might drive in that direction. |
04:26:56 | disruptek | too much drinking in college? |
04:26:59 | Prestige | It does all the composition in a simple way with almost 0 extra code, without an external framework, creating a bunch of systems etc |
04:27:21 | disruptek | there's plenty of extra code. |
04:27:25 | Prestige | I would like to use ECS, as I've been saying for like 8 months, but I just find all the implementations lacking |
04:27:27 | disruptek | good lucky optimizing around it. |
04:28:04 | Prestige | Nothing needs to be optimized. And no extra code for the one using MI |
04:28:09 | disruptek | polymorph seems to have a lot of... reasoning. |
04:29:00 | disruptek | did you try to build anything with it? |
04:29:01 | saem | The thing with ECS is that it's meant to give you benefits around memory layout and the ability to dynamically change behaviour by adding and removing components. MI ties your hands because it forces specific memory layouts. |
04:29:16 | Prestige | disruptek: with ecs? Yeah |
04:29:16 | disruptek | that's my point. |
04:29:31 | disruptek | with polymorph? |
04:29:39 | Prestige | saem: yes it does, but I don't care about that |
04:29:56 | Prestige | I'd rather just be able to write the code I want without micro optimising |
04:30:29 | disruptek | i think you would be better served by some templates. |
04:30:32 | Prestige | If I were writing a game engine for commercial games or something, I might want ECs |
04:31:16 | Prestige | disruptek: you mean making something with inheritance? I have, just not MI (because it doesn't exist) |
04:31:19 | saem | OK, so that's all statically determined, in which case can't you use concepts? |
04:31:29 | disruptek | i mean making something with polymorph. |
04:31:41 | disruptek | for the third time... |
04:32:02 | Prestige | Afaik concepts aren't working entirely, and they only serve part of the functionality that MI would |
04:32:34 | Prestige | disruptek: idk what you're asking. Is that a library or something? |
04:32:49 | * | disruptek ๐คฆ |
04:33:16 | disruptek | i want you to look at these two links: |
04:33:19 | disruptek | !repo pixecs |
04:33:20 | disbot | https://github.com/PixeyeHQ/pixecs -- 9pixecs: 11A pragmatic entity-component-system module for my gamedev needs 15 22โญ 0๐ด |
04:33:22 | disruptek | !repo polymorph |
04:33:23 | disbot | https://github.com/rlipsc/polymorph -- 9polymorph: 11Polymorph is a composable entity component system generator - create statically defined ECS architectures generated from your design. 15 12โญ 0๐ด 7& 1 more... |
04:34:40 | Prestige | I believe I looked at polymorph a few months ago |
04:35:05 | * | spiderstew joined #nim |
04:36:01 | * | spiderstew_ quit (Ping timeout: 246 seconds) |
04:38:01 | FromDiscord | <m0nsta> HNY Folks! |
04:38:16 | Prestige | Happy new year! |
04:39:37 | Prestige | well pixecs is out at least |
04:44:08 | Prestige | I think having a callback system with polymorph for object events would also be limited or not possible, because the object would be missing its type info... |
05:05:57 | * | vicfred joined #nim |
06:06:35 | FromGitter | <ornamentist> Can anyone point to a library with idiomatic examples of using Concepts? |
06:06:57 | disruptek | !repo jason |
06:06:58 | disbot | https://github.com/disruptek/jason -- 9jason: 11JSON done right ๐คฆ 15 38โญ 1๐ด |
06:07:58 | disruptek | concepts are being reimpl'd, though. improved. be prepared to change your syntax somewhat. |
06:08:02 | FromGitter | <ornamentist> Excellent thanks |
06:09:05 | FromGitter | <ornamentist> Are there any notes I can read on the latest thinking on Concepts? |
06:10:02 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:15:13 | FromDiscord | <Rika> prolly somewhere in the issues of the rfcs repo of nim |
06:15:23 | disruptek | !rfc concepts |
06:15:25 | disbot | https://github.com/nim-lang/RFCs/issues/168 -- 3Concepts and type-checking generics 7& 29 more... |
06:15:35 | FromDiscord | <Rika> oh you made an rfc command? nice |
06:15:49 | disruptek | it has always existed. |
06:15:59 | FromDiscord | <Rika> didnt know xd |
06:16:08 | disruptek | discord chumps. |
06:16:13 | FromDiscord | <Rika> lmao |
07:02:30 | * | Prestige quit (Quit: Prestige) |
07:03:48 | * | Prestige joined #nim |
07:09:07 | FromDiscord | <ElegantBeef> Lol forum doesnt do well with the new year all activity is now dec 2020 ๐ |
07:12:30 | * | Prestige quit (Quit: Prestige) |
07:14:12 | * | Prestige joined #nim |
07:28:46 | FromDiscord | <Rika> lmao |
07:33:11 | FromDiscord | <lantos> happy new year |
07:47:14 | * | narimiran joined #nim |
07:55:21 | * | habamax joined #nim |
08:06:13 | saem | Rolled around to my part of the world. |
08:10:40 | * | Prestige quit (Quit: Prestige) |
08:11:55 | * | Prestige joined #nim |
08:17:59 | FromGitter | <ornamentist> Is the convention in Nim projects to have a <dir>/<projectname> top-level directory for source files or <dir>/src? |
08:19:19 | FromDiscord | <ElegantBeef> the latter `nimble init` will set it up for you ๐ |
08:54:35 | FromDiscord | <treeform> Ornamentist, I set up this template to setup new projects: https://github.com/treeform/nimtemplate |
08:55:27 | * | actuallybatman joined #nim |
08:55:37 | * | actuallybatman quit (Quit: Lost terminal) |
08:56:31 | saem | impossible, can't be batman, saw them pop in. |
09:20:17 | * | gangstacat quit (Quit: ฤis!) |
09:31:13 | FromDiscord | <lantos> which nim vscode extention should we be using? |
09:35:05 | FromDiscord | <ElegantBeef> I'm trying saem's as he's improving it to be more stable/usable |
09:39:03 | FromDiscord | <flywind> I disabled `nimsuggest`, so I don't care which one to use ๐ |
09:39:22 | FromDiscord | <ElegantBeef> Well saem's doing some good work, goto defs now work on the compiler |
09:40:18 | FromDiscord | <flywind> Does it need `nimsuggest`? |
09:41:02 | FromDiscord | <ElegantBeef> Believe so |
09:41:50 | FromDiscord | <flywind> Then I would rather use `seacrh` instead. |
09:41:57 | FromDiscord | <ElegantBeef> Why? |
09:43:51 | saem | I mean, I might be able to get nimfind in there soon enough. |
09:44:19 | FromDiscord | <flywind> `nimsuggest` always uses huge memory and even I close the vscode, they still occupy nim.exe. |
09:44:48 | saem | This is primarily for the compiler code base? |
09:46:13 | saem | I had to rework the whole elrpc stuff a bunch, part of that was better process clean-up IIRC. |
09:47:12 | saem | As someone who was starting up the extension and killing it like 30+ times a day that got on my nerves fast. I've encountered it once since then -- not perfect. |
09:48:07 | * | superbia joined #nim |
09:52:34 | FromDiscord | <ElegantBeef> Yea i mean saem's resolving these issues that are caused by spawning them up so much |
09:52:48 | * | gangstacat joined #nim |
09:52:56 | FromDiscord | <flywind> I see |
09:53:25 | saem | I still need to fix the whole default is one nimsuggest per file, but I have a working config for the compiler for that -- just need to auto-detect it and make the spawning lazy. |
10:06:31 | Prestige | Interesting discussion on the Nim 2020 HN post about debugging with gdb |
10:06:43 | saem | Oh yeah? |
10:06:49 | Zevv | yeah |
10:07:05 | Prestige | https://news.ycombinator.com/item?id=25590962 |
10:07:10 | saem | thanks |
10:07:35 | Zevv | The last few months Nim HN posts did well, comment-wise |
10:08:19 | FromDiscord | <lantos> nim has a step through break point vscode plugin |
10:08:57 | Prestige | I think it's mentioned, but people said it would bug out sometimes |
10:08:58 | FromDiscord | <lantos> https://github.com/jasonprogrammer/nim-debug-example |
10:10:09 | saem | I stumbled upon that repo a while back but forgot about it |
10:10:25 | FromDiscord | <lantos> https://media.discordapp.net/attachments/371759389889003532/794507816123236363/unknown.png |
10:11:31 | saem | I just updated nim-gdb.py in the latest so it's a bit better, hopefully -- still plenty of gaps. |
10:11:56 | saem | choosenim ships with a broken nim-gdb and I haven't gotten around to submitting a PR to fix it. |
10:12:29 | FromDiscord | <lantos> could it be included in a vcode ext so that new people have it from get go |
10:12:49 | saem | That's a bit trickier than I would like, but yeah. |
10:13:40 | * | natrys joined #nim |
10:13:58 | saem | That's the intention but I'd like some more things cleaned up before hand. Otherwise it's a big time sink for a really mediocre version. |
10:26:32 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:33:54 | * | superbia left #nim ("WeeChat 3.0") |
10:37:57 | Prestige | I have a string I need to pass to a proc (c binding) which takes a Pcuchar - I've cast it, and it works fine. When I try to compile with orc, it says the expression cannot be cast to Pcuchar=cstring. Am I misunderstanding something? |
10:38:34 | * | MyMind quit (Quit: WeeChat 3.0) |
10:58:22 | FromDiscord | <Meowz> whats the name of nims code formatter again |
10:59:42 | FromDiscord | <Meowz> nimpretty, got it |
11:22:59 | Zevv | Prestige: got a code snippet? |
11:28:26 | * | JustASlacker joined #nim |
11:58:22 | FromDiscord | <juliuskiesian> is there a way to write something like `for x in 10 ..< 1`? |
11:59:38 | ForumUpdaterBot | New thread by Nobody: Arraymancer `<https://github.com/mratsim/Arraymancer>`, see https://forum.nim-lang.org/t/7318 |
12:00:22 | FromDiscord | <flywind> ! eval for i in countdown(3, 1): echo i |
12:00:29 | FromDiscord | <flywind> (edit) "! eval" => "!eval" |
12:00:53 | FromDiscord | <flywind> !eval for i in countdown(3, 1): echo i |
12:00:55 | NimBot | 3โต2โต1 |
12:01:28 | Zevv | clyybber here? |
12:01:40 | FromDiscord | <juliuskiesian> ideally, 1 shouldn't be included. @flywind |
12:02:29 | FromDiscord | <flywind> you could always use `(i + 10, i + 1)`. |
12:03:04 | FromDiscord | <flywind> or you could your own function |
12:05:29 | * | tane joined #nim |
12:07:04 | FromDiscord | <flywind> see https://github.com/Yardanico/nimpylib/blob/adec704b91a66669686bf3f251320ba1f5d9a6cd/src/pylib/xrange.nim#L14 |
12:22:40 | * | xet7 quit (Remote host closed the connection) |
12:26:39 | * | Arrrrrrrr joined #nim |
12:30:35 | Arrrrrrrr | Happy 2021, hope nim grows 2000% |
12:35:23 | FromDiscord | <Rika> Why not 2020% |
12:50:51 | Zevv | 2021%, right |
13:04:11 | FromDiscord | <Sorrow> Love it so far. Shame there's no music tagging lib like Mutagen. |
13:12:02 | * | Vladar joined #nim |
13:12:46 | FromDiscord | <juliuskiesian> is there a quick way to convert a `Tensor[float]` from arraymancer to a seq? |
13:14:16 | FromDiscord | <Clyybber> Zevv: here |
13:16:02 | * | habamax quit (Quit: leaving) |
13:16:17 | FromDiscord | <juliuskiesian> bit convoluted, but i found a way: `toOpenArray(xs.dataArray, 0, xs.size - 1).toSeq` |
13:16:58 | Zevv | oi; you know some stuff about repr, reprv2, reprjs and dollars, right? |
13:17:37 | FromDiscord | <Clyybber> Zevv: just saw your pr, yeah |
13:18:14 | Zevv | Why is it that $ and repr don't use the same underlying implementations? |
13:18:23 | FromDiscord | <Ben Boughton> Hello! Brand new to nim. Quick question. How do I get a variable value during compilation? |
13:18:38 | FromDiscord | <lqdev> you can't |
13:18:58 | FromDiscord | <lqdev> elaborate on what you're trying to do |
13:20:15 | FromDiscord | <Ben Boughton> C:\Apps\nim-1.4.2\lib\system\fatal.nim(49, 5) Error: unhandled exception: C:\Users\bboug\.nimble\pkgs\nimterop-0.6.13\nimterop\cimport.nim(12, 14) `(not fail)` File or directory not foundโตโตI want to echo the srcDir during compilation so I know exactly where it is looking |
13:21:06 | FromDiscord | <Clyybber> Zevv: In general or for sets? |
13:21:48 | Zevv | In general |
13:21:53 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2KuM |
13:22:07 | FromDiscord | <lqdev> but you need to make sure that `yourSrcDir` is either a const or a {.compileTime.} var or let |
13:23:26 | FromDiscord | <Clyybber> Zevv: repr is mainly for debugging so it mught include stuff that you wouldn't want in `$` like the address a seq's data points to and stuff like that |
13:23:43 | Zevv | hm fair enough |
13:23:56 | Zevv | ok, so I need to figure out how to get my js repr to work from this funny set representation |
13:24:01 | Zevv | thanks |
13:24:13 | FromDiscord | <Ben Boughton> Fantastic! That works |
13:24:55 | FromDiscord | <Ben Boughton> I appreciate your help. |
13:28:24 | FromDiscord | <lqdev> np |
13:45:33 | * | vsantana joined #nim |
13:45:48 | * | waleee-cl joined #nim |
13:50:16 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
13:51:23 | FromDiscord | <dom96> Zevv: repr is built to work on anything you throw at it, `$` needs to be defined for each type |
13:52:12 | * | superbia joined #nim |
13:57:54 | * | JustASlacker quit (Ping timeout: 256 seconds) |
13:58:19 | * | superbia quit (Quit: WeeChat 3.0) |
13:58:21 | * | hmmm joined #nim |
13:59:40 | Zevv | dom96: yeah, sure but for types where `$` is defined, repr could use `$` or the other way around. Now there are duplicate implementations. |
13:59:57 | ForumUpdaterBot | New thread by Alexeypetrushin: Seems like a bug? SIGSEGV: Illegal storage access., see https://forum.nim-lang.org/t/7319 |
14:00:41 | FromDiscord | <dom96> `repr` gives a much more useful representation of data structures though |
14:00:51 | FromDiscord | <dom96> I don't want a string representation of JSON for example |
14:00:57 | FromDiscord | <dom96> I want to see what the data structure looks like |
14:01:24 | FromDiscord | <dom96> The same applies to strings if I want to see the escaped character literals instead of the characters they represent |
14:01:42 | Zevv | fair enough. I was adding a special case for `set[char]` that uses `..` instead of dumping all the individual chars, but I need to put my implementation in 4 different places now, all slightly different |
14:08:13 | FromDiscord | <Clyybber> Zevv: Btw do you know more details on https://github.com/disruptek/cps/issues/47? |
14:08:14 | disbot | โฅ mutable params and the developers who love them |
14:08:37 | Zevv | I don't think its realistic |
14:09:15 | Zevv | When passing var args to a proc, you assum the proc will run as a whole before returing, so the callers original var arg is guarenteed to be always there during the execution of the function |
14:09:38 | Zevv | when something is suspendable, I don't think we can have that guarentee in any way, so imho we always copy or move the arg |
14:09:48 | Zevv | and just refuse to CPS procs with var args |
14:09:55 | Zevv | but of course mr stubborn thinks otherwise |
14:11:39 | Zevv | so you'd have to wait for him to wake from his slumbers to get more insight in his inner thoughts and feelings on this subject |
14:11:53 | Zevv | oi disruptek, wakey wakey |
14:11:55 | FromDiscord | <Clyybber> aight, disruptek |
14:11:57 | Zevv | that's enough |
14:12:02 | FromDiscord | <Clyybber> heh |
14:12:15 | Zevv | it's past nine over there |
14:13:46 | FromDiscord | <Clyybber> Zevv If we store the arg somewhere we can make it always be there for the duration of execution no? |
14:14:04 | Zevv | yeah but it's all about making it var |
14:14:12 | Zevv | so you should be able to mutate the callers original value |
14:14:15 | Zevv | which might not even exist anymore |
14:14:34 | Zevv | is a pointer that might point to nowhere |
14:15:01 | FromDiscord | <Clyybber> because it has been moved? |
14:15:17 | Zevv | or just because it went out of scope and no longer exists |
14:15:21 | FromDiscord | <Clyybber> I see |
14:15:41 | Zevv | you have proc a with a local i, which a calls proc b passing the local as a var arg. b suspends and a returns |
14:15:44 | Zevv | where does i go? |
14:15:47 | Zevv | *poof* gone |
14:16:09 | Zevv | so I say we just ignore this case for now. If you want to mutate something, use a ref |
14:16:52 | Zevv | I think the js backend smells funny |
14:22:49 | FromDiscord | <jseb> speaking of javascriptโฆ |
14:25:27 | FromDiscord | <jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Kv9 |
14:28:04 | * | Vladar quit (Quit: Leaving) |
14:30:25 | FromDiscord | <jseb> ah , looking at the generated javascript, i have the name hardcoded at generation. That's not what i wanted, but i understand (the macro system replaces immediately with the value of the AST name of filename variable) |
14:36:28 | FromDiscord | <flywind> you could use template to workaround this issue |
14:36:32 | FromDiscord | <flywind> (edit) "template" => "templates" |
14:38:15 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Kvg |
14:41:02 | FromDiscord | <flywind> Yeah, you could use `static string` |
14:41:14 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Kvh |
14:46:50 | FromDiscord | <jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Kvm |
14:48:15 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2Kvl |
14:48:44 | FromGitter | <offbeat-stuff> Hi |
14:48:46 | FromDiscord | <lqdev> (edit) "https://play.nim-lang.org/#ix=2Kvl" => "https://play.nim-lang.org/#ix=2Kvo" |
14:49:35 | FromDiscord | <lqdev> hi |
14:49:38 | FromGitter | <offbeat-stuff> How to autogen nim bindings for c++ wrappers |
14:49:40 | FromGitter | <offbeat-stuff> Like there are pkg-config --cflags and pkg-config --libs for the wrapper |
14:51:51 | FromDiscord | <haxscramper> I suppose you might run shell command at compile-time and do something with it, like filling values of `{.passl: "<some text>".}` |
14:51:55 | FromDiscord | <jseb> @lqdev : no, it stills resolves filename at the compilation time |
14:52:24 | FromDiscord | <lqdev> yeah but it will print the variable containing the filename |
14:52:39 | FromDiscord | <lqdev> why not just use `echo` or something instead of emitting a console.log? |
14:52:50 | FromDiscord | <Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2Kvp |
14:53:13 | FromDiscord | <lqdev> @Sorrow it's possible that the bodyStream contains less than 4194304 bytes. |
14:53:26 | FromDiscord | <Sorrow> The file's 1GB. |
14:53:41 | FromDiscord | <lqdev> how do you know it loads the whole file? |
14:53:50 | FromDiscord | <Sorrow> By monitoring it. |
14:54:01 | FromDiscord | <lqdev> monitoring what? `chunk`'s `len`? |
14:54:06 | FromDiscord | <jseb> yes you're right lqdev, `echo` is the way to go for this one. It was for testing `emit` macro |
14:54:10 | FromDiscord | <flywind> you could import `jsconsole` to use `console.log`. |
14:54:16 | FromDiscord | <Sorrow> Memory usage. It keeps increasing. |
14:54:31 | FromDiscord | <lqdev> the GC doesn't run immediately |
14:54:54 | FromDiscord | <lqdev> you can force a collection using `GC_fullCollect()` |
14:55:12 | FromDiscord | <lqdev> or use ARC or ORC which will free the data as soon as it's no longer in use |
14:55:57 | FromDiscord | <haxscramper> Or move `chunk` out of the loop and use it as buffer |
14:56:04 | FromDiscord | <haxscramper> WIth something like https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint |
14:56:11 | FromDiscord | <Sorrow> Thank you. I was thinking about using a buf instead. |
15:15:21 | FromDiscord | <bark> in nim, are ref objects required for dynamic dispatch? |
15:17:00 | FromDiscord | <haxscramper> IIRC yes |
15:21:02 | mipri | you can avoid ref objects, but you'll run into issues as soon as you want e.g. a seq[SuperClass] |
15:23:44 | mipri | https://play.nim-lang.org/#ix=2KvI this works f.e., but you can't ss.add those Shapes because they have different sizes |
15:24:01 | * | Vladar joined #nim |
15:24:30 | mipri | https://play.nim-lang.org/#ix=2KvJ fixing the warning |
15:26:06 | mipri | well size aside there's an ObjectAssignmentDefect |
15:28:13 | FromDiscord | <bark> https://play.nim-lang.org/#ix=2KvK has no ObjectAssignmentDefect |
15:28:43 | mipri | ss.add them instead of showId'ing them |
15:29:45 | FromDiscord | <bark> i guess its due to sizes |
15:30:01 | FromDiscord | <bark> i guess it's generally a good practice to make all inheritance chains ref |
15:30:06 | FromDiscord | <bark> or ptr |
15:30:09 | mipri | even when .sizeof is the same you get that error |
15:30:23 | FromDiscord | <bark> huh |
15:30:51 | FromDiscord | <Sorrow> How can I get the resp headers, status code etc before loading the file? Am using .get(). |
15:50:03 | FromDiscord | <For Your Health> This is probably a dumb question, but what type of floats should I be using by default? I see some libs using float32, some using float64, and some using float. |
15:52:54 | FromDiscord | <InventorMatt> If you use float it should then default to either float32 or float64 based on what OS you are using for you |
15:53:31 | FromDiscord | <juan_carlos> architecture, not OS, 32 for 32bit, 64 for 64bit. |
15:54:03 | FromDiscord | <For Your Health> So is float generally preferred to use? |
15:54:38 | FromDiscord | <Anuke> According to this tutorial, `float` is always float64: https://nim-lang.org/docs/tut1.html#basic-types-floats |
15:56:31 | * | narimiran quit (Remote host closed the connection) |
15:56:48 | Zevv | use float unless you have reasons not to |
15:57:01 | Zevv | it's a cdouble under the hood indeed |
15:58:24 | FromDiscord | <juan_carlos> "Everything floats down here" |
15:59:10 | FromDiscord | <For Your Health> Sounds good. Thanks for the help |
15:59:31 | FromDiscord | <flywind> How can I `hash` float/Number in `Javascript`? |
16:00:05 | FromDiscord | <flywind> Nim JS backend doesn't support hash float. |
16:00:41 | * | narimiran joined #nim |
16:02:27 | Zevv | well, it's not that it does not support it. it's broken. |
16:03:07 | FromDiscord | <flywind> The version before returns floats, I don't think that's right |
16:04:41 | FromDiscord | <flywind> `import hashes; echo hash(0.3456)` returns `0.3456` in Nim v1.2.6 in JS backend. |
16:10:33 | FromDiscord | <flywind> I would fix cast float to int first. |
16:19:25 | Zevv | how does one reliably run all CI locally? |
16:19:32 | Zevv | ./koch runCI? |
16:24:44 | FromDiscord | <flywind> run all tests? |
16:25:02 | Zevv | yeah seems I have nodejs versions issues |
16:25:06 | Zevv | so im good |
16:26:39 | FromDiscord | <flywind> https://nim-lang.org/docs/contributing.html#running-tests |
16:27:12 | Zevv | yeah, but that says "a good subset of" |
16:27:33 | FromDiscord | <Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2KvZ |
16:27:35 | Zevv | but I hate to fire github CI all the time, and I have a 28 core machine, so it makes sens to make sure i get it through clean before pushing |
16:29:00 | * | JustASlacker joined #nim |
16:29:36 | * | vivus joined #nim |
16:30:18 | FromDiscord | <Rika> sorrow, maybe use async |
16:30:27 | FromDiscord | <Rika> not sure if that would actually help though |
16:30:40 | FromDiscord | <Sorrow> I read about the progress callback thing. |
16:41:42 | * | NimBot joined #nim |
16:47:47 | * | pigmej joined #nim |
16:48:05 | pigmej | Hey guys, |
16:48:17 | pigmej | Anyone having experience using cligen/dents ? |
16:48:39 | pigmej | I'm in need of having recursed directory / file listing BUT I would like to filter some "expensive" directories before it starts to recurse there |
16:49:08 | pigmej | I know that there is preRec in cligen/dents BUT unless I'm mistaken I don't see a way to break / stop go to the directory |
16:49:58 | pigmej | I am aware of globs/walkDirRecFilter BUT there is a warning about `unstable API` |
16:56:33 | FromDiscord | <Clyybber> Zevv: Hmm, but actually we can just extend the lifetime of i ourselves, no?โตSince we are rewriting locals anyways |
16:56:57 | FromDiscord | <William_CTO> I'm using unittests and trying to run a test which has subtests, but the subtests aren't being ran with `nim c -r tests.nim "parent test"` |
17:01:36 | FromDiscord | <Rika> is it possible to make an object with a size of 0? |
17:01:57 | * | lritter joined #nim |
17:02:19 | FromDiscord | <lqdev> what for? |
17:02:25 | FromDiscord | <haxscramper> `distinct void`? |
17:02:48 | FromDiscord | <Rika> i want to store compile time data into another object without runtime cost (this is very fucky i know) |
17:02:53 | FromDiscord | <lqdev> !eval type O = object; echo O.sizeof |
17:02:55 | NimBot | 1 |
17:02:57 | FromDiscord | <Rika> 1 |
17:03:00 | FromDiscord | <Rika> its gonna be 1 |
17:03:01 | FromDiscord | <Rika> yeah |
17:03:16 | FromDiscord | <lqdev> eh mate it's only one byte |
17:03:20 | FromDiscord | <haxscramper> !eval type VOID = distinct void; echo VOID.sizeof |
17:03:20 | FromDiscord | <lqdev> it's nothing |
17:03:23 | NimBot | 0 |
17:03:28 | FromDiscord | <Rika> hm |
17:03:33 | FromDiscord | <Rika> lol nice |
17:03:48 | FromDiscord | <haxscramper> curios what it compiles to |
17:04:28 | Zevv | clyybber: the original var args might live in a non-cps proc that returns before the continuation is resumed |
17:04:49 | Zevv | it's perfectly possible I don't understand what disruptek is trying to say here, of course. I have that, sometimes |
17:05:39 | FromDiscord | <Clyybber> what you said makes sense, but im in the same boat as you, i dont understand the gh issue |
17:05:54 | Zevv | so, is it us, or is it disruptek, I wonder |
17:08:09 | FromDiscord | <Clyybber> i dont understand if its trying to tellme theres a bug I could fix |
17:08:19 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2Kwk |
17:08:20 | Zevv | I don't think so |
17:08:30 | Zevv | I think it's a CPS internal thing. Did he ping you on that one? |
17:08:53 | disruptek | what? |
17:09:01 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2Fbo |
17:09:12 | Zevv | does it hurt bad? |
17:09:31 | Zevv | clyybber was wondering about https://github.com/disruptek/cps/issues/47 |
17:09:31 | disbot | โฅ mutable params and the developers who love them |
17:09:39 | FromDiscord | <For Your Health> What would be a good way to organize the following: I have a trading bot that needs to interface with an exchange, and I have a simulated exchange that I'm writing. I want the bot to be able to use either the simulated exchange or the real exchange. |
17:09:40 | Zevv | I say it can't be done |
17:10:01 | FromDiscord | <For Your Health> I'm guessing I need dynamic dispatch and I haven't used that in Nim yet. |
17:10:16 | disruptek | it can be done. |
17:10:32 | Zevv | For Your Health: Emulate your exchange at the API level you are accessing it at in real life |
17:10:49 | Zevv | disruptek: who is calling foo(). A non-cps proc? |
17:11:03 | Zevv | that might have `c` on its stack. It might have returned before the continuations get resumed |
17:11:07 | Zevv | so `c` is dead & gone |
17:11:09 | Zevv | dust |
17:11:10 | disruptek | yes. |
17:11:28 | FromDiscord | <For Your Health> I'm more so meaning how do I interface with it from the bot's point of view? Does the bot hold a reference to an exchange object or something? |
17:11:37 | disruptek | probably. |
17:12:00 | disruptek | if it were me, i would mock the entire API. |
17:12:09 | disruptek | i presume you're using http, so just mock the server. |
17:12:36 | disruptek | then run it on a distant cloud, etc. |
17:13:20 | disruptek | zevv: and, so what? |
17:14:13 | FromDiscord | <William_CTO> How can I debug an iterator? I can't call repr on it and I'm getting `ObjectAssignmentDefect` when I try to iterate over it with `for k in` |
17:14:31 | disruptek | use debugEcho. |
17:14:36 | FromDiscord | <For Your Health> So should I have something like `Exchange = ref object of RootObj` and `SimulatedExchange = ref object of Exchange` ? |
17:14:56 | FromDiscord | <For Your Health> And then my bot holds a ref to Exchange and calls on that or something? |
17:14:57 | disruptek | no. |
17:15:18 | FromDiscord | <William_CTO> Error: attempting to call routine: 'keys'โตSame issue as trying to use repr and echo |
17:15:27 | disruptek | well, don't do that. |
17:16:17 | Zevv | disruptek: ok, nevermind, i must be stupid and you must be smart, so i give up |
17:16:23 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2Kwm |
17:16:38 | disruptek | zevv: i don't think i get the problem. |
17:17:40 | Zevv | what does c refer to if it was a local of the calling function, which returned before we *use* c |
17:18:01 | disruptek | probably a pointer. i don't know how else to impl it. |
17:18:15 | Zevv | right. and is this pointer still valid? |
17:18:20 | disruptek | nope. |
17:18:24 | Zevv | iright |
17:18:31 | Zevv | so why do we need to support this |
17:18:40 | disruptek | because people like mamy exist. |
17:19:01 | Zevv | if you want to do that kind of thing, use heap refs |
17:19:34 | Zevv | if mamy needs this, let him request it |
17:19:57 | Zevv | and show how this should actually work |
17:20:08 | disruptek | so the current blocker is kinda silly. |
17:20:19 | disruptek | we're not substituting all variables. |
17:20:44 | disruptek | the issue has something to do with scope. i haven't thought through where it has to be done. do you have an idea? |
17:20:50 | ForumUpdaterBot | New thread by NightRang3r: Executing command in hidden console, see https://forum.nim-lang.org/t/7320 |
17:21:03 | disruptek | where it's done now doesn't work. ๐ |
17:21:40 | disruptek | i think we're doing substitution on only a single statement instead of the remaining scope. |
17:21:47 | FromDiscord | <For Your Health> So should the simulated exchange and the real exchange be abstracted out to separate modules or something? I'm still confused on a good way to swap them out. |
17:22:04 | disruptek | the /right/ way to do it is to mock the entire server. |
17:22:09 | Prestige | Zevv: about my question about orc earlier, https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdowpkg/windowmanager.nim line 175. I get an error saying the cast is incorrect |
17:22:14 | Zevv | thats what I said |
17:22:23 | Prestige | But only when I use --gc:orc |
17:23:13 | disruptek | man, your use of whitespace is the stuff of nightmares. |
17:23:39 | disruptek | forget MI, i don't think you should be allowed access to the newline. |
17:23:56 | * | JustASlacker quit (Ping timeout: 240 seconds) |
17:24:11 | Prestige | Haha, I think it's much more readable to have params vertically aligned |
17:24:36 | FromDiscord | <Rika> y tho |
17:24:48 | FromDiscord | <For Your Health> I'm not sure what mock the entire server means. I'm working on the simulated exchange first and I am keeping it simple. So imagine you can ask the simulated exchange to put in a market order or whatever and it will simulate what that does to your capital and account for fees and stuff. |
17:24:50 | FromDiscord | <Rika> oh this style |
17:25:03 | FromDiscord | <Rika> i was thinking the one where the first param is not newlined |
17:25:08 | FromDiscord | <Rika> that kinda style is scarier |
17:25:14 | Prestige | Yeah for sure |
17:25:25 | FromDiscord | <Rika> true waste of space that one is |
17:26:14 | disruptek | health: how do you communicate with the real exchange? |
17:26:35 | Prestige | I also greatly dislike horizontal scrolling |
17:26:53 | FromDiscord | <For Your Health> I'm not communicating to it yet as far as putting real trades on it, I'm only reading prices off of it with WebSocket for backtesting |
17:27:39 | FromDiscord | <For Your Health> But where I get the prices from doesn't really make a difference at the moment. The simulated exchange is designed to just accept prices that you feed it |
17:27:46 | disruptek | so create your own websocket server. make it do the same shit the exchange does. to run your tests, you talk to this "mock" server instead of the real server, by simply altering the server address in your ws connection statement. |
17:27:49 | Zevv | ok, but what protocols, http? |
17:28:00 | Zevv | moch the same http api call in your fake server |
17:28:15 | Zevv | right, what he said ^^ |
17:29:30 | FromDiscord | <For Your Health> The web protocols aren't really what I'm asking about at the moment. Getting the prices from the exchange, putting buy orders on the exchange, etc isn't what I'm having problems with. I want to know how I can structure my bot's code in such a way that it doesn't matter whether or not I'm using a real exchange or a fake exchange. |
17:29:35 | * | Arrrrrrrr joined #nim |
17:29:45 | Zevv | ... |
17:29:45 | disruptek | and we just told you that. |
17:30:15 | Zevv | make it talk like a duck and walk like a duck |
17:30:54 | FromDiscord | <For Your Health> My question is more along the lines of how do you do that in Nim? Like in C++ or whatever I would do it with inheritance or something |
17:31:05 | FromDiscord | <For Your Health> So how do you duck type in nim I guess is what i'm asking? |
17:31:05 | disruptek | you're missing the point. |
17:31:29 | Zevv | yeah i see wha youre trying to do |
17:31:41 | Zevv | you want to mock at a different level |
17:31:51 | disruptek | the point is to write as little code as possible that varies between the two implementations. |
17:32:16 | Zevv | you can use generics or inheritence |
17:32:19 | disruptek | mocking the entire server achieves that because /only data/ changes, and /only one int32/ needs to be updated. |
17:32:23 | Zevv | generics is the 'nim way' |
17:32:24 | FromDiscord | <juan_carlos> If it talks like a duck and walks like a duck, is obviously a platypus. |
17:34:15 | FromDiscord | <For Your Health> So by mocking the entire server do you mean having a large module that handles both simulating an exchange and connecting to a real exchange, where you change some internal state to determine which one you are doing? |
17:34:29 | FromDiscord | <For Your Health> And my bot references that module? |
17:34:33 | disruptek | no. |
17:35:01 | FromDiscord | <For Your Health> I guess what I'm asking is, what does my bot call to place a buy order? |
17:35:07 | disruptek | i mean you go off and /write an exchange/ and then /run it somewhere else/ to mimic the actual reality. |
17:35:17 | disruptek | i give up. |
17:35:44 | disruptek | i have more stuff i want to get done in 2021. |
17:35:55 | FromDiscord | <For Your Health> I guess I'm not communicating my problem correctly, my apologies. |
17:36:08 | disruptek | you are. you aren't listening to the answer. |
17:42:14 | FromDiscord | <Rika> how would i go about making a macro that accepts a typedesc and gets the next smaller version of it? ex uint16 -> uint8 |
17:42:21 | Prestige | Health: Basically you just need to change the URL of the api endpoint. You can pass the url to the construction of your program/object/whatever |
17:43:12 | Prestige | Everything else should stay the same, except for that |
17:43:13 | disruptek | rika: fairly manually, i'm afraid. |
17:43:42 | FromDiscord | <Rika> it's a pain to get this to work with a generic parameter |
17:43:46 | FromDiscord | <Rika> (i do not know how) |
17:44:20 | FromDiscord | <For Your Health> Alright I went back and reread the suggestions. I think I get what everyone is saying now. You are saying to have my simulated exchange be a server that I connect to with websocket that is essentially indistinguishable from the bot's point of view to a real exchange? |
17:44:22 | disruptek | you can measure the type easily enough using one of the three getType impls. |
17:44:30 | disruptek | health: yep. |
17:44:54 | FromDiscord | <Rika> imma refresh on getType then thanks |
17:45:31 | disruptek | rika: once you have the nnk enum, you can just resolve it from one of two arrays -- signed and unsigned. something like that. |
17:46:02 | * | JustASlacker joined #nim |
17:47:13 | FromDiscord | <Rika> i still have no idea how it'd do with generic params though... it still sees `T` and not whatever it should resolve to... |
17:47:44 | disruptek | of course. |
17:48:01 | disruptek | your macro won't use generics. |
17:48:43 | FromDiscord | <Rika> i mean when i feed my macro a generic param, what can i do D: |
17:49:10 | disruptek | do you have a repro? |
17:50:21 | FromDiscord | <Rika> one moment |
17:50:27 | disruptek | health: it sounds like a lot of work but it ultimately is a much higher-quality solution that sidesteps inumerable flaws with the other approaches. |
17:50:49 | * | hmmm quit (Quit: rebootan) |
17:52:07 | disruptek | it's work that will help you understand your client better, too. |
17:55:20 | FromDiscord | <Rika> disruptek: https://play.nim-lang.org/#ix=2KwB |
17:56:44 | FromDiscord | <For Your Health> Shouldn't I still have a layer of indirection somewhere? Like say I want to connect to two different exchanges, they won't both have the same API. My bot shouldn't care what exchange it's connected to for the most part. |
17:57:01 | FromDiscord | <For Your Health> Two different real exchanges that is |
17:57:55 | saem | Health: I start with when isMainModule. In your case I would start in a prototype bot module to just pass basic things to it get a sketch of the core. |
17:58:17 | saem | You don't want indirection. |
17:59:02 | saem | They're not different, it should be the same thing. The bot only differentiates based on address. |
17:59:04 | FromDiscord | <William_CTO> I figured out my issue disruptek |
17:59:50 | FromDiscord | <For Your Health> I have a decent core of the bot itself already. I was simulating the entire exchange from within the bot to develop it. I'm moving on the the point where I want to simulate an exchange externally that has delays when you request market orders. |
18:00:14 | FromDiscord | <William_CTO> I'm using json's `to` proc to unmarshal json into an object. Some of my objects were object of AnotherBase which was causing the issue. |
18:01:43 | FromDiscord | <William_CTO> @For Your Health what is this bot of yours? |
18:01:45 | Prestige | I think you'd want indirection if the market APIs are different, for that you could use inheritance or concepts (if concepts are working) |
18:02:11 | Prestige | But if the APIs are the same there's no point in doing that |
18:02:28 | saem | Then write the exchange, it should be behind an http client, not an http client and a mock http client. If you really want to mock it, then you could use generics or a compiler define and have a mock vs non-mock implementation. Our if you actually want them swappable at runtime then you need indirection. |
18:03:04 | saem | Otherwise you want One Direction |
18:03:42 | saem | Yeah, what Prestige said |
18:03:58 | FromDiscord | <For Your Health> It's a crypto trading bot I'm toying around with. |
18:04:21 | saem | Whatever. |
18:04:32 | saem | Does it need runtime swapping? |
18:05:16 | FromDiscord | <For Your Health> It doesn't need runtime swapping really, I just want to be able to backtest the bot on recorded data, which could be done with a different program |
18:05:37 | FromDiscord | <For Your Health> I want to bot's code to be generic in that it doesn't care whether or not it is connected to an exchange or backtesting |
18:06:03 | FromDiscord | <For Your Health> Like you feed it price data sequentially and it tells you when to buy and sell and how much to buy and sell |
18:06:27 | disruptek | then do it the way the old guys told you to do it. |
18:06:28 | disruptek | rika: i have no bandwidth, but did you get my comment? |
18:06:43 | * | JustASlacker quit (Ping timeout: 268 seconds) |
18:08:46 | saem | Then use a compile time mechanism to do that, run it as a separate thing, build your internal architecture as a log (if LMax is to be believed this is the one true way), use inheritance and methods like you would if you want run time. But I'm not sure what the question is anymore, because it sounds like you know. |
18:09:12 | FromDiscord | <ITR> I've noticed that there's multiple garbage collectors in nim, but is there any way to change how memory allocation is done? |
18:09:30 | mipri | change what about it? |
18:10:05 | FromDiscord | <ITR> IE. make objects of the same type be located near each other in memory |
18:10:11 | FromDiscord | <ITR> (edit) "memory" => "memory, no matter when allocated" |
18:10:27 | FromDiscord | <ITR> (edit) "allocated" => "created" |
18:10:47 | FromDiscord | <haxscramper> You probably need to write custom allocator for that one and dive into low-level C details |
18:11:04 | FromDiscord | <haxscramper> IIRC default GC does not provide such features |
18:11:05 | FromDiscord | <ITR> sent a code paste, see https://paste.rs/Acw |
18:11:10 | * | hmmm joined #nim |
18:11:33 | FromDiscord | <ITR> I mean, I feel like that's separate from GC, IE, a garbage _collector_ could work independently from an allocation manager |
18:12:43 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/3158 |
18:12:48 | mipri | sure. --gc:arc has a -d:useMalloc option. something similar to that might get you a different allocator. but when people care about allocators like this they tend to want to pick the allocator for the object, not just pick an allocator for the entire program. |
18:12:48 | FromDiscord | <juan_carlos> GC wont alloc. |
18:13:10 | FromDiscord | <haxscramper> Maybe something from this tread would be useful, it seems like a question quite close to yours |
18:13:47 | saem | ITR of you use object and contiguous allocation structures like seq, does that not do what you want? |
18:14:18 | mipri | LeuGim's answer there is what I was thinking of as well, where use the allocator to get memory and then cast it to your object, but that requires explicit constructors |
18:15:14 | FromDiscord | <ITR> I'm looking into entity component systems (mostly gamedev related), use hashsets to store components for a specific object. |
18:15:23 | FromDiscord | <ITR> which use |
18:15:28 | FromDiscord | <Rika> disruptek, sorry, which comment do you refer to? |
18:15:35 | saem | I knew it. |
18:15:39 | disruptek | don't you want `auto` as your return-type? |
18:15:48 | FromDiscord | <Rika> Ah. |
18:15:51 | FromDiscord | <Jarred Kenny> Is it possible to get the position of a key in a table? |
18:15:55 | FromDiscord | <Rika> LOL |
18:16:02 | FromDiscord | <Rika> That is indeed a better idea |
18:16:04 | FromDiscord | <Rika> Thanks |
18:16:08 | disruptek | if you use an Ordered table, yes. |
18:16:34 | FromDiscord | <ITR> @Jarred Kenny what do you mean by position? |
18:16:51 | saem | ITR: look at the internals of a tables. It'll behave well enough for your case. |
18:17:01 | FromDiscord | <Jarred Kenny> Essentially the index from the order of insertion |
18:17:09 | FromDiscord | <haxscramper> IIRC jken was doing the same (also ECS, also need for continuous memory alignment) |
18:17:21 | FromDiscord | <Jarred Kenny> lol yes, still playing with this. |
18:17:37 | FromDiscord | <ITR> saem: even if they point to an object/ref type? |
18:17:59 | FromDiscord | <ITR> though I guess they don't technically have to be ref types in the table |
18:18:17 | saem | Why are you using a ref? That's basically exactly not what you want for a component |
18:18:28 | FromDiscord | <ITR> yeah, I just realized that |
18:18:54 | FromDiscord | <haxscramper> As suggested above you might want to look into implementation details for `OrderedTable`, but there is no default API to get this AFAIK |
18:19:41 | saem | You're _doing_ the larger scale memory layout, use object. |
18:20:16 | FromDiscord | <ITR> I was looking at cat-400 which was talking about ref object, and I felt like it did ecs wrong, so I looked at some opinions people had about other ecs implementations, but most other languages have ref type by default for objects which made me forget, lol |
18:20:21 | saem | Also, get used to not using any refs and indirecting based on IDs |
18:20:31 | FromDiscord | <ITR> It won't work for what he wants, I think |
18:21:03 | saem | Yeah, checkout the three other ECS implementations on nimble |
18:21:24 | FromDiscord | <ITR> @Jarred Kenny If you insert 5 objects, and remove the middle one, do you then want the "index" of each object to be 1, 2, 3, 4 in order of execution? |
18:21:50 | FromDiscord | <Jarred Kenny> The more I think about it, the more I feel there is a better approach. |
18:22:10 | FromDiscord | <ITR> order of insertion |
18:22:15 | FromDiscord | <ITR> @Jarred Kenny what do you want to use it for? |
18:23:32 | FromDiscord | <ITR> You _could_ have each contain an "id" which starts at 0 and always increases, then have a separate binary tree which keeps track of which ids are still in use, then get the index there, but that sounds very complex and probably isn't needed |
18:23:43 | saem | Also if your memory requirements are big and your specific component density is high, use a plain seq for entity and a same sized seq for the components. Then you ID is the same and it's even simpler. |
18:25:30 | FromDiscord | <ITR> hmm, I only see two others, akrsys and entoody |
18:25:50 | saem | You don't need to do that either, unless you have very specific indexing needs. Simply have a sequence for you component object. The sequence index is the component identifier. Then have a table which maps entity identifier to component identifier. |
18:27:35 | saem | !repo ecs |
18:27:36 | disbot | https://github.com/yglukhov/ecs -- 9ecs: 11Entity Component System 15 21โญ 2๐ด 7& 7 more... |
18:27:52 | FromDiscord | <ITR> o nice |
18:27:53 | disruptek | !repos ecs |
18:27:55 | disbot | query failed ๐ข |
18:27:57 | disruptek | !repos ecs |
18:27:59 | disbot | query failed ๐ข |
18:28:05 | FromDiscord | <ITR> !repo, not repos |
18:28:07 | disruptek | wtf github |
18:28:12 | disruptek | !repos ecs |
18:28:13 | disbot | query failed ๐ข |
18:28:35 | disruptek | i think they put new query limits in place. |
18:28:58 | saem | Butts |
18:29:35 | saem | I forgots the 's', now we can't have nice things. :( |
18:29:53 | disruptek | anyway, yuri's is a toy. you want polymorph or pixecs. |
18:30:00 | saem | Yeah |
18:30:25 | disruptek | `repo` delivers the top hit. `repos` delivers the top 3, or the top 30 if you /msg disbot directly. |
18:30:52 | FromDiscord | <ITR> neither polymorph nor pixecs returns any results on nimble.directory |
18:31:10 | saem | You and the dms, you sly dog |
18:31:28 | FromDiscord | <ITR> found on google tho |
18:31:36 | saem | The system works |
18:31:38 | disruptek | nimble.directory is meaningless. |
18:31:39 | Zevv | is disbot hotpluggable? |
18:32:03 | disruptek | no. |
18:32:07 | Zevv | lame. |
18:32:38 | saem | Ssshhh, future robot overlords can hear you. |
18:32:44 | FromDiscord | <haxscramper> There are almost 4k nim repos on github |
18:33:50 | saem | Yup, I have a search I revisit to see latest by activity. Shows some interesting of work. AoC basically DDoSed that for a bit. |
18:33:53 | FromDiscord | <ITR> why do all the ecs repos start with an argument for why you might want to use them |
18:34:04 | saem | Because it's ECS |
18:34:09 | saem | It's like crossfit |
18:34:10 | mipri | why do any repos fail to start with such a thing? |
18:34:20 | saem | You're not doing it unless others know you are |
18:34:43 | saem | Also, I'm paleo |
18:35:12 | saem | Seriously though, the why is good. Wish more things did that. |
18:36:22 | FromDiscord | <ITR> i'm very tempted to make a frankenstein like project with the cat-400 framework, but using rapid's opengl wrapper aglet, and polymorph for ecs |
18:36:58 | * | vivus quit (Ping timeout: 272 seconds) |
18:36:59 | saem | One of my favorite Nim repos is synthesis by mratsim. Great explanation, nice layout, code has lots of explanations. |
18:37:19 | saem | ITR that sounds fun |
18:38:59 | FromDiscord | <ITR> :โo synthesis has state machines? |
18:39:04 | Zevv | 19:38 < FromDiscord> <ITR> :โo synthesis has state machines? |
18:39:11 | Zevv | synthesis *is* state machines |
18:39:28 | FromDiscord | <ITR> that's literally the last thing i need, adding it to frankenstein |
18:39:29 | disruptek | you're blowing my mind right now. |
18:39:43 | Zevv | always will, mate |
18:39:54 | disruptek | why doesn't tzevv work? |
18:40:30 | reversem3 | Does anyone know of server modules for video streaming like nginx RTMP modules? |
18:40:35 | Zevv | disruptek: gimme a sec |
18:41:02 | Zevv | pull |
18:41:21 | Zevv | oh dang no |
18:41:26 | Zevv | sheit |
18:41:38 | disruptek | it compiles, at least. |
18:41:40 | FromDiscord | <ITR> strange, Polymorph isn't on nimble, but it has a .nimble file |
18:41:45 | Zevv | disruptek: yeah |
18:42:09 | Zevv | I got the first 2 or 3 up |
18:42:17 | Zevv | and the rest all fails on expPrims asserts |
18:42:44 | FromDiscord | <ITR> is there any way I can pass the github link to nimble? |
18:42:45 | saem | Nimble requires some hoops (not bonkers) to register your stuff and not everyone does it. I mean I still can't be arsed. |
18:43:38 | disruptek | zevv: did you have to fix cps? |
18:44:02 | saem | Yes, it's either install command with a flag or development. Check nimble --help |
18:44:02 | disruptek | i don't publish on nimble because the publish process is stupid and dom wouldn't accept my patch to fix it. |
18:44:21 | Zevv | disruptek: no i only changed the .cps. syntax and switched to testes |
18:44:37 | disruptek | i guess that's good. |
18:44:41 | Zevv | but the tests themselves fail so i think something is bonkers in the xfrm |
18:45:11 | Zevv | i planned to do some stuff today but i ended up doing set[char].repr in the nim libs |
18:45:14 | disruptek | "no generic params allowed for ref" from environment.nim. |
18:45:28 | Zevv | what does that even mean |
18:46:00 | Zevv | im on mobile now, cant take a loook sorry |
18:46:32 | disruptek | the bad line is from populateType, so it's due to assuming y is a constant in `var x = y`. |
18:47:06 | Zevv | 9 |
18:48:03 | disruptek | we don't use the `cps` prefix, do we? |
18:49:43 | Zevv | like i said, mentally im still stuck at 0.0.13 |
18:49:43 | disruptek | result = env_33554996(fn: t, result_33554995: result_33554995) |
18:49:46 | disruptek | glwt |
18:50:56 | disruptek | any problems with my testes? other than the fact that they don't work for you, i mean? |
18:51:19 | Zevv | oh i just need to figure out how it works i guess |
18:51:43 | disruptek | the transform is pretty weird. i dunno if it's your fault. |
18:51:51 | Zevv | 'compilation failed' is cool and all, but i think i would like it to just barf and stop at the first occurnce so i can fix it |
18:51:54 | disruptek | 60 proc C(continuation: env_33554996): C {.cpsLift.} = |
18:51:54 | disruptek | 61 env_33554996(continuation).result_33554995 |
18:52:23 | disruptek | you just run it with --define:release to make it barf. |
18:52:36 | Zevv | ah right you told me |
18:53:06 | disruptek | but maybe i can make that work somehow, too. |
18:53:51 | disruptek | i didn't expect that C() proc, either. |
18:53:53 | * | vivus joined #nim |
18:55:54 | Oddmonger | that must be the magic of the new year, but the manual seems clearer now :) |
18:58:27 | saem | Oddmonger: I've had a bunch of those moments myself recently. :D |
18:59:02 | ForumUpdaterBot | New thread by Neodim: Native GUI development for MacOS, see https://forum.nim-lang.org/t/7321 |
19:00:20 | FromDiscord | <Daniel> Happy New Year ๐ฅณ |
19:00:25 | FromDiscord | <Daniel> https://media.discordapp.net/attachments/371759389889003532/794641193287942144/2020.gif |
19:00:52 | disruptek | zevv: i dunno, tzevv code looks okay to me. |
19:01:05 | Zevv | i thought so as well |
19:01:22 | disruptek | and those transforms look pretty bogus. |
19:02:00 | disruptek | oh, i see it. |
19:02:12 | disruptek | t(): C {.cps: C.} should be t() {.cps: C.} |
19:02:44 | disruptek | i pushed. |
19:02:45 | Zevv | pfff |
19:03:10 | Zevv | silly, we should hide that stuff and just expose a few friendly macros instead |
19:03:34 | disruptek | we do hide it. |
19:03:48 | Zevv | so, now the first few run and the rest assert, right? |
19:03:50 | * | junland quit (Quit: %ZNC Disconnected%) |
19:03:51 | disruptek | your t() doesn't have a return type. |
19:03:55 | Zevv | because that's how far I got before |
19:04:10 | disruptek | ## 21 tests ๐ข8 ๐ด5 โ8 |
19:04:17 | * | superbia joined #nim |
19:04:45 | disruptek | we have a duplicate proc predeclaration, which is funny. |
19:04:53 | * | junland joined #nim |
19:05:01 | disruptek | i love having these bugs, though. |
19:05:09 | disruptek | so easy to fix one way or another. |
19:05:18 | disruptek | i really hate debugging the compiler. |
19:05:33 | Zevv | this is not the compiler being wrong |
19:05:35 | Zevv | its just cps |
19:05:44 | disruptek | i know, that's what i like about it. |
19:05:48 | Zevv | ah |
19:06:12 | disruptek | like, i know that if i put a couple hours in, i will pass more tests. |
19:06:15 | disruptek | that's a nice feeling. |
19:06:22 | Zevv | go for it |
19:07:33 | * | blueberrypie quit (Quit: leaving) |
19:08:16 | * | junland quit (Client Quit) |
19:09:57 | * | hnOsmium0001 joined #nim |
19:10:08 | * | junland joined #nim |
19:12:53 | * | superbia quit (Quit: WeeChat 3.0) |
19:20:54 | Zevv | so we can start dropping the :int parts soon, right? |
19:23:49 | * | himu joined #nim |
19:23:58 | disruptek | we already do. |
19:24:12 | Zevv | well look at that |
19:24:22 | FromDiscord | <Avatarfighter> Hello hello |
19:24:26 | FromDiscord | <Avatarfighter> what is CPS being used for? |
19:24:32 | Zevv | cmon dude |
19:24:51 | disruptek | i updated the README with a new typed tock. |
19:25:07 | Zevv | avatarfighter: nothing *yet** |
19:25:37 | Zevv | but the idea is to make it the lego bricks for building anything involving non-linear code flow |
19:26:14 | Zevv | like custom control flow, coroutines, async, lazy eval, efficient fp |
19:26:49 | leorize | I can build you a new async system or port the current one over when y'all are done with the cps stuff |
19:27:10 | disruptek | you may as well start now. |
19:27:50 | leorize | I heard there are still a bunch of bugs :P |
19:27:56 | disruptek | zevv: what do you make of my hiddenstdconv hack? |
19:28:11 | leorize | and I'm writing that process library again so will take awhile |
19:28:14 | Zevv | dont know what that is |
19:28:51 | disruptek | https://github.com/disruptek/cps/commit/ee4c7a8240c02c2c281fe67fb2e339b6f17a218d |
19:29:47 | FromDiscord | <Avatarfighter> leorize: new async piques my interest ๐ |
19:29:53 | * | vivus quit (Quit: Leaving) |
19:30:33 | Zevv | hiddenStdConv, new to me |
19:30:49 | * | vivus joined #nim |
19:32:07 | disruptek | i was thinking maybe we should do the transform at a lower level. |
19:34:38 | * | wekan joined #nim |
19:34:46 | * | wekan quit (Remote host closed the connection) |
19:36:33 | * | xet7 joined #nim |
19:38:15 | * | vivus quit (Quit: Leaving) |
19:39:40 | Zevv | hmm like lower how? |
19:41:21 | * | a_chou joined #nim |
19:41:49 | disruptek | like making getImplTransformed work. |
19:44:53 | disruptek | you feel me? |
19:46:11 | * | a_chou quit (Client Quit) |
19:49:15 | Zevv | that would be sweet indeed |
19:49:38 | Zevv | I was just wondering, is it solid enough? |
19:49:43 | Zevv | the docs say it's for inspection and debugging |
19:49:49 | Zevv | so are we supposed to actually /use/ that? |
19:50:31 | Zevv | Ah, this one, I remember now: "Error: implementation of 'exit_385877917' expected" |
19:50:45 | disruptek | just the duplicate predec. |
19:50:52 | Zevv | ah k |
19:52:10 | disruptek | getImplTransformed would let us support for loops. |
19:52:18 | Zevv | yes, that's why I looked into it |
19:52:27 | Zevv | but it works inside out |
19:52:30 | Zevv | it's funny |
19:53:36 | disruptek | inside out? |
19:53:48 | Zevv | you pass it a sym and it gives the implementation |
19:53:55 | Zevv | it's not like a macro that actually transforms your code |
19:53:56 | disruptek | yeah. |
19:54:14 | disruptek | but that's okay. we can maybe layer cps. |
19:56:06 | Zevv | I'm dropping testes. Everything is a green square. |
19:56:23 | disruptek | dude, my testes dropped along time ago. |
19:56:32 | disruptek | very long. |
19:57:07 | Zevv | can't see what its doing |
19:57:46 | disruptek | that's funny, because i wrote testes because i couldn't see what tzevv was doing. |
19:58:10 | * | himu quit (Quit: Konversation terminated!) |
20:00:01 | * | himu joined #nim |
20:01:07 | FromDiscord | <Deleted User 5bd78114> Imagine having two other people in your head who constantly give you ideas of what to code and point out common errors or logic errors that you've missed- |
20:01:10 | ForumUpdaterBot | New thread by Alexeypetrushin: Weird how visibility scope works if generic proc used. Possible bug?, see https://forum.nim-lang.org/t/7322 |
20:05:10 | ForumUpdaterBot | New thread by Domogled: How use custom event inherited from DOM Event in javascript?, see https://forum.nim-lang.org/t/7323 |
20:06:43 | disruptek | zevv: getImplTransformed /almost/ works. |
20:07:50 | saem | Hah, ran into a case where CPS would be handy (in JS land). |
20:11:09 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
20:13:15 | saem | It's similar to a threadlocal perhaps. I have a bunch of code that calls console.log for logging, of course. Assuming I wrap console.log, I can have it look up an "actionId" so I can correlate what logical user/program action something belongs to. In order to do that I need a threadlocal-ish thing and I believe a dispatcher could manage setting/unsetting it as necessary. |
20:13:49 | * | hmmm quit (Quit: WeeChat 3.0) |
20:13:59 | saem | This is also a fun test to see if I understand what/how dispatchers could be used. |
20:14:43 | disruptek | i don't get it. |
20:15:22 | disruptek | if you wrap the log call, why wouldn't you pass the source of the call right there? |
20:17:29 | saem | It's fair question,t he wrap was going to be nothing more than a static template to lookup a known var. |
20:18:04 | Zevv | disruptek: already |
20:18:25 | disruptek | the transform is broken, afaict. |
20:18:49 | disruptek | the compiler gives me `var i`; no type, no initialization value. |
20:19:01 | disruptek | other than that, i think it would work. |
20:19:49 | Zevv | is there a way to tell what matches if you look from the inside and from the getImplTransformed side? |
20:19:55 | Zevv | can the nimnodes be ==ed ? |
20:20:08 | Zevv | if we are brave, we might be able to merge both views |
20:20:12 | Zevv | but that'll be tricky and fragile |
20:20:15 | disruptek | lemme push this. yeah, we could rewrite the rewrite. |
20:20:32 | disruptek | it's in a branch called `almost`. |
20:20:57 | Zevv | well that was pretty trivial code |
20:21:09 | disruptek | i would rather have the compiler fix its output, though. |
20:21:20 | Zevv | yeah sure, this is way more usable |
20:21:23 | saem | Even if I do wrap it, I'd have to have change each proc to accept a logger and pass it along (this could be rather long chains) rather than drop in a console.log call (or something incredibly similar) where I need it. |
20:21:36 | Zevv | i always felt we needed to go into the compiler to be able to get for loops expanded |
20:21:45 | Zevv | but if this works, that would be pretty nice |
20:21:52 | Zevv | so, yes, clyybber, we have work to do :) |
20:22:07 | disruptek | splash some cold water on his face. |
20:22:25 | Prestige | What do you mean by expanding for loops? |
20:22:39 | Zevv | CPS rewrites nim code |
20:22:49 | Zevv | but we can't transform non-closure for loops, becuause we can't see "inside" |
20:23:08 | Prestige | ah |
20:23:09 | Zevv | but there'a hacky macros proc getImplTransformed() that allows you to view a proc post-transform |
20:26:20 | FromDiscord | <Jarred Kenny> @haxscramper If you are curious, this is what I've ended up with for storing components in my ECS https://play.nim-lang.org/#ix=2KxI |
20:27:34 | FromDiscord | <Jarred Kenny> There is some inheritence at play with AbstractComponentList, but the components are stored in contigious seqs. Some sorting will be required, |
20:28:22 | FromDiscord | <Jarred Kenny> important part is met, which is components are not ref types, i think! |
20:28:50 | * | himu quit (Quit: Konversation terminated!) |
20:29:28 | * | himu joined #nim |
20:29:52 | * | himu quit (Client Quit) |
20:30:10 | * | himu joined #nim |
20:30:53 | * | himu quit (Client Quit) |
20:40:12 | saem | Jarred any reason to have a list of all the lists of components and not an object with one field for each component sequence? |
20:42:51 | FromDiscord | <Jarred Kenny> seam, the idea behind is you can use any object as a component and register them dynamically |
20:43:11 | FromDiscord | <Jarred Kenny> rather than having all possible component types defined in the Universe object |
20:44:24 | * | tane quit (Quit: Leaving) |
20:49:09 | saem | Hmm, you mean dynamic in so far as a module somewhere else, but still in the project can add in component types or possibly across HCR? |
20:50:16 | jken | not sure what HCR is, the idea is that someone consuming my code as a module could use arbitrary objects as components in the ECS |
20:51:07 | saem | jken: hot code reloading. If they're consuming your module then a generic type would work, wouldn't it? |
20:51:58 | jken | How would that work? |
20:57:10 | saem | If you have a Universe[C], where C is Component, then for add/remove it's concepts or bunch of templates. Probably can also do it via inheritance of your abstractcomponentlist and implement some methods. |
20:57:26 | saem | C is Components (the list) |
21:11:58 | * | narimiran quit (Ping timeout: 256 seconds) |
21:12:42 | FromDiscord | <William_CTO> I'm looking for a way to create a macro to generate `Option[x] = none(x)` for use in procs eg: `proc foo(bar: myMacro(string)`. I've never used macros before. Can someone point me in the right direction? |
21:12:49 | FromDiscord | <William_CTO> I've tried this so far (doesn't work) |
21:12:55 | FromDiscord | <William_CTO> sent a long message, see http://ix.io/2KxS |
21:13:08 | FromDiscord | <William_CTO> (edit) "long message," => "code paste," | "http://ix.io/2KxS" => "https://play.nim-lang.org/#ix=2KxT" |
21:14:16 | * | narimiran joined #nim |
21:16:33 | * | opal quit (Remote host closed the connection) |
21:17:05 | * | opal joined #nim |
21:19:15 | Zevv | disruptek: could it be that the underlying AST is ok but repr is not up to the task of properly displaying it? |
21:19:30 | disruptek | no. |
21:20:08 | jken | saem, concepts are still foreign to me. |
21:20:16 | jken | Can I bother you for an example? |
21:20:34 | Zevv | disruptek: how can you tell |
21:20:44 | disruptek | because my code sees all. |
21:20:46 | Zevv | because "var i" is just not legal AST, probably |
21:21:09 | Zevv | what does that look like in a treerepr? |
21:21:18 | disruptek | var (i, nil nil) |
21:21:25 | Zevv | :( |
21:21:27 | disruptek | yes. |
21:21:44 | FromDiscord | <William_CTO> dis can you suggest an approach if its even possible? |
21:21:57 | Zevv | yeah, well, that was my point: the docs say it's for inspection and debugging, not for real use for real things by grown ups |
21:22:20 | saem | jken: you've already read this: https://nim-lang.org/docs/manual_experimental.html#concepts |
21:22:27 | disruptek | william: what? |
21:22:52 | disruptek | i always compose ast "manually". |
21:24:30 | jken | saem, yeah I mean as they relate to the ecs |
21:27:41 | disruptek | william: you can, like, dumpAst or something to see how to compose it yourself. i just read the macros doc to see the structure and then recreate it. |
21:28:08 | saem | jken: https://github.com/disruptek/jason/blob/master/jason.nim#L4 shows anything that conforms to the predicate jason is and also covers arrays, so long as you can iterate over them and their elements are jasonable. You'd do the same for your component interface testing for add/remove procs |
21:33:40 | disruptek | gah who wrote that dogshit. |
21:33:55 | disruptek | oh wait. |
21:43:47 | Zevv | man git-dogshit |
21:44:11 | disruptek | No manual entry for git-dogshit |
21:44:45 | Zevv | oh, wait, "blame" it's called, I remember now |
21:45:43 | * | narimiran quit (Ping timeout: 246 seconds) |
21:45:48 | Zevv | Zzz. some caching up to do. |
21:46:00 | disruptek | aight, gn zevv |
21:50:38 | FromDiscord | <Clyybber> damn, just when zevv goes |
21:50:54 | FromDiscord | <Clyybber> disruptek this is what https://github.com/disruptek/cps/issues/48 is about? |
21:51:04 | disbot | โฅ for loops could be supported with a compiler fix ; snippet at 12https://play.nim-lang.org/#ix=2Ky0 |
21:51:20 | disruptek | i dunno what `this` refers to. |
21:51:29 | disruptek | oh, yes, is the answer. |
21:51:34 | FromDiscord | <Clyybber> he |
21:51:53 | FromDiscord | <Clyybber> does i have its .typ set? |
21:51:58 | disruptek | no. |
21:52:06 | FromDiscord | <Clyybber> Huh |
21:52:32 | disruptek | well, it's ast w/o a :type and i'm assuming if it has typ, it's an easy fix. |
21:52:53 | disruptek | i haven't tried to rewrite it myself in the macro. |
21:52:59 | FromDiscord | <Clyybber> yeah, should be relatively easy (probably) |
21:53:08 | disruptek | i agree. |
21:53:20 | disruptek | we could just lift it, but i think the compiler should do it for us. |
21:53:25 | FromDiscord | <Clyybber> I'll get to it in a bit |
21:54:20 | disruptek | cool, thanks. |
22:02:16 | disruptek | looks like ic is about to be merged. |
22:09:11 | FromDiscord | <Clyybber> neat |
22:10:19 | * | Vladar quit (Quit: Leaving) |
22:13:18 | * | xet7 quit (Remote host closed the connection) |
22:23:10 | disruptek | nimph rebuilds in 11s on ic and 17s w/o ic. |
22:23:45 | disruptek | oh wait, 10s w/o ic. hmm. |
22:25:10 | disruptek | yeah, no change in speed i guess. |
22:25:13 | * | PMunch joined #nim |
22:25:16 | * | natrys quit (Ping timeout: 246 seconds) |
22:27:59 | disruptek | testes is 0.10s to 0.15s slower under ic. changing a line and recompiling is 2x slower with ic than without. |
22:28:41 | FromDiscord | <Avatarfighter> It would be nice to see how IC affects much bigger projects |
22:28:59 | disruptek | much bigger than 550,000 lines? |
22:29:16 | FromDiscord | <Avatarfighter> well, I meant more other big projects |
22:29:30 | FromDiscord | <Avatarfighter> just to see if there is a change in compilation speeds |
22:29:35 | FromDiscord | <Avatarfighter> (edit) "just to see if there is a ... change" added "net" |
22:30:03 | FromDiscord | <Avatarfighter> Though its a bit concerning if there isn't an increase in compilation speeds on your projects disruptek, they are quite large usually |
22:30:22 | disruptek | testes is 70k lines, nimph is 553k. |
22:30:27 | FromDiscord | <Avatarfighter> yeah |
22:31:05 | disruptek | testes is ~0.55s w/o ic, with gc:arc and danger. 0.65-70s with ic, gc:arc, danger. |
22:31:30 | FromDiscord | <Avatarfighter> that's the bit that is concerning to me lol your projects are already large and if IC doesn't seem to have an effect on them then I wonder if IC will benefit projects of similar size |
22:33:07 | * | Gustavo6046 quit (Ping timeout: 268 seconds) |
22:33:35 | disruptek | nimp's c output is 46mb, the object files total 19mb, the rod (ic) totals 218mb. |
22:33:41 | disruptek | nimph, too. |
22:37:16 | disruptek | okay, i got it to go faster. |
22:37:51 | disruptek | i did a compile with the old compiler to blow away the cache -- 38s. and then again with ic to re-use the rod files -- 13s. |
22:38:06 | * | natrys joined #nim |
22:38:55 | disruptek | ic uses ~10% more memory, but it's clearly faster for some scenarios. the memory usage will improve, as will the speed. |
22:41:04 | FromDiscord | <Avatarfighter> Oh that's good I kind of feared IC was slower overall than before ngl |
22:41:05 | disruptek | compression would help. 218mb->17mb with gz. |
22:41:49 | * | natrys quit (Client Quit) |
22:43:07 | disruptek | the compiler builds faster without it, too. so far, i'm not impressed. |
23:06:51 | PMunch | How's everyone doing so far in 2021? |
23:08:16 | FromDiscord | <ElegantBeef> It's a new year so there has to be a new rampant disease to take over right? |
23:10:01 | PMunch | Well I mean we have the new strains going around |
23:10:04 | PMunch | Those seem fun |
23:10:21 | PMunch | But disease is so passรฉ, we need something new for 2021 |
23:10:55 | FromDiscord | <fwsgonzo> is it possible to call a varargs C function? |
23:11:03 | FromDiscord | <ElegantBeef> `{.varargs.}` |
23:11:33 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma |
23:12:04 | * | Juno[m] joined #nim |
23:12:47 | PMunch | By the way, anyone else than me who have submitted a talk folk the virtual FOSDEM this year? |
23:13:50 | FromDiscord | <ElegantBeef> Jeez you butchered that sentence, and that's coming from me |
23:14:02 | FromDiscord | <fwsgonzo> thanks |
23:14:13 | PMunch | Give me a break, I'm recovering from Christmas/New years :P |
23:14:22 | FromDiscord | <lqdev> disruptek: is IC ready for some initial testing? i could try it on my projects |
23:14:31 | PMunch | And I haven't really spoken/written english for weeks at this poit |
23:14:40 | FromDiscord | <fwsgonzo> I think I give up - the best way to continue is to send and receive a serialized blob instead |
23:15:21 | PMunch | @fwsgonzo, what are you trying to do? |
23:15:23 | disruptek | lqdev: yes, try the araq/araq-ic5 branch. |
23:15:35 | disruptek | to use it, pass --incremental:on. |
23:15:37 | FromDiscord | <fwsgonzo> what I really want is to take a function as an argument, then enforce that the following arguments match the arguments that would go to this function, and then forward the arguments (after function) to a C function |
23:16:11 | PMunch | Hmm, not quite sure I understand |
23:16:28 | FromDiscord | <lqdev> disruptek: on latest devel? |
23:16:40 | disruptek | no, the araq/araq-ic5 branch. |
23:16:43 | FromDiscord | <ElegantBeef> Disruptek told you which branch |
23:16:46 | FromDiscord | <lqdev> kay |
23:16:50 | FromDiscord | <lqdev> will try tommorow |
23:17:05 | disruptek | and don't blame me for the performance. araq threw out most of my code. |
23:17:06 | FromDiscord | <lqdev> @ElegantBeef ah didn't see it |
23:17:08 | FromDiscord | <fwsgonzo> does the frozen serialization thing work on any object? |
23:17:13 | disruptek | yes. |
23:17:24 | FromDiscord | <fwsgonzo> can I serialize to stack? |
23:17:27 | disruptek | yes. |
23:17:39 | FromDiscord | <fwsgonzo> alright, thatll do it |
23:18:00 | disruptek | we don't yet raise if you try to serialize something stupid. |
23:18:31 | disruptek | i will probably add that for v1.0 when i reorder the api arguments for better `with` support. |
23:18:33 | FromDiscord | <dom96> ouch, if IC turns out to be slower than non-IC then that will be quite a let down |
23:19:16 | disruptek | i'm so glad i don't care. |
23:19:40 | disruptek | it would be really sad to put a ton of work into something that actually mattered and then have it be so marginal. |
23:23:00 | FromDiscord | <fwsgonzo> nimble install frosty? |
23:23:27 | disruptek | maybe? |
23:23:34 | disruptek | do you have access to the README.md? |
23:23:58 | FromDiscord | <fwsgonzo> yes checked the .nimble too, and `nimble search frosty` shows nothing |
23:24:09 | disruptek | what does the README say about Installation? |
23:24:24 | FromDiscord | <fwsgonzo> right, a github repo link |
23:24:30 | disruptek | ah, neat. |
23:24:32 | FromDiscord | <ElegantBeef> Disruptek doesnt use the nimble repository since he's too cool for it |
23:24:45 | disruptek | nimble is for fools. |
23:24:48 | FromDiscord | <ElegantBeef> Like so cool he made frosty |
23:24:52 | FromDiscord | <ElegantBeef> The registry isnt |
23:26:22 | disruptek | scramper just pointed out that github has 3500 more nim repos than nimble. |
23:26:34 | FromDiscord | <fwsgonzo> how common is import os? |
23:26:47 | FromDiscord | <ElegantBeef> well it should be `std/os` but fairly common ๐ |
23:27:09 | FromDiscord | <fwsgonzo> guess im pretending its linux ๐ |
23:27:10 | FromDiscord | <ElegantBeef> I dont see how that is a good argument for not adding to a central repository |
23:27:24 | disruptek | i already explained my reasons once this year. |
23:28:17 | FromDiscord | <ElegantBeef> What was your suggested fix? |
23:28:18 | disruptek | if it helps you, feel free to add frosty to any registry you want. |
23:28:49 | disruptek | https://github.com/nim-lang/nimble/pull/728 |
23:28:51 | disbot | โฅ useful git commit messages during publish ; snippet at 12https://play.nim-lang.org/#ix=2fCa |
23:32:13 | FromDiscord | <ElegantBeef> This is sincerely your only issue with the registry? |
23:32:57 | disruptek | no, it's a stupid idea for other reasons. |
23:33:44 | disruptek | i don't tend to support software that sucks. if that makes me a bad person, well, i don't think this surprises anyone here. |
23:33:49 | FromDiscord | <ElegantBeef> Having easy access to published packages for quick development without having to search N number of git hosting services, seems like a pretty compelling case to me |
23:33:59 | disruptek | by N do you mean, 1? |
23:34:12 | disruptek | this is you reason for supporting shitty software? |
23:34:25 | FromDiscord | <ElegantBeef> Github, gitlab, src.ht, i've seen repos on nimble link to all of them |
23:34:30 | disruptek | it's literally garbage. |
23:34:33 | FromDiscord | <ElegantBeef> It doesnt matter your view on Nimble the software |
23:34:35 | disruptek | URLs work fine. |
23:34:42 | FromDiscord | <ElegantBeef> What's wrong with the god damn repository |
23:34:47 | disruptek | what's wrong with you? |
23:34:52 | disruptek | why do you care so much? |
23:35:11 | FromDiscord | <ElegantBeef> Cause i'm interested in why you avoid the repository with the excuse "software bad" |
23:35:31 | disruptek | i already explained it. |
23:36:04 | disruptek | if you want a deeper explanation, i wrote 8,000 lines of logic to explain how i feel open packaging should work in nim: |
23:36:07 | disruptek | !repo nimph |
23:36:08 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future ๐ง 15 91โญ 5๐ด 7& 1 more... |
23:36:24 | disruptek | if that's not enough for you... |
23:36:29 | disruptek | shit man, i don't know what to tell you. |
23:36:35 | FromDiscord | <ElegantBeef> Again i dont care about the package manager |
23:36:41 | disruptek | cool, bro. |
23:36:45 | FromDiscord | <ElegantBeef> A central repository is all we're talking about |
23:36:55 | disruptek | yeah, it's dumb. |
23:37:12 | FromDiscord | <ElegantBeef> You make such a compelling argument i've converted |
23:37:16 | disruptek | good. |
23:38:15 | FromDiscord | <haxscramper> I think someone just needs to add these ten lines of json diff to registry |
23:38:31 | FromDiscord | <haxscramper> Just for people to start annoying disruptek |
23:38:50 | disruptek | that started long ago. |
23:39:10 | disruptek | i was born annoyed and it just went downhill from there. |
23:41:34 | disruptek | my dist repo is the same idea implemented in a better way. |
23:41:38 | disruptek | !repo disruptek/dist |
23:41:39 | disbot | https://github.com/disruptek/dist -- 9dist: 11a nim distribution ๐ 15 6โญ 0๐ด |
23:43:24 | planetis[m] | if you need a unique string/id each time an app is run, what would you use guys? |
23:43:37 | FromDiscord | <fwsgonzo> UUID perhaps? |
23:43:43 | planetis[m] | oids? |
23:43:44 | disruptek | std/monotimes |
23:52:15 | planetis[m] | thanks |