<< 01-01-2021 >>

00:00:04FromDiscord<hugogranstrom> Happy new year ๐ŸŽ‡๐ŸŽ†๐Ÿฅณ
00:01:39FromDiscord<lqdev> happy new year!
00:02:01*JustASlacker quit (Ping timeout: 264 seconds)
00:02:11FromDiscord<lqdev> though it's already 1 am where i live ยทโ€“ยท
00:02:37FromDiscord<hugogranstrom> Same, I'm juste late hehe
00:03:21FromDiscord<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:13FromDiscord<shadow.> yeah for sure
00:11:13FromDiscord<William_CTO> Merry 2021
00:11:15FromDiscord<hugogranstrom> Absolutely, momentum is building up
00:12:14FromDiscord<bark> happy birthday to the people born on january the first!
00:14:36FromDiscord<arun> sent a long message, see http://ix.io/2Ksb
00:16:26FromDiscord<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:04FromDiscord<Vindaar> happy new year everyone ๐Ÿฅณ
01:08:02FromDiscord<lqdev> ~~vindaar you're late~~
01:08:07FromDiscord<lqdev> er
01:08:10FromDiscord<lqdev> happy new year!
01:24:59*smitop quit (Quit: Connection closed for inactivity)
01:29:18FromDiscord<juliuskiesian> is there a quick way to convert a set to a seq?
01:29:34FromDiscord<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:34FromDiscord<ElegantBeef> Yes in devel
01:30:12FromDiscord<ElegantBeef> https://nim-lang.github.io/Nim/setutils.html#toSet.t%2Cuntyped
01:30:17FromDiscord<ElegantBeef> Courtesy of me ๐Ÿ˜›
01:38:20FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2Ksu
01:38:36FromDiscord<juliuskiesian> do i need latest devel?
01:39:10*Prestige quit (Quit: Prestige)
01:39:59FromDiscord<ElegantBeef> `std/setutils`
01:40:12FromDiscord<ElegantBeef> All new modules are forcing that `std`
01:40:32*Prestige joined #nim
01:40:41FromDiscord<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:28Torrohappy 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:46Prestigedisruptek: will you throb less in 2021?
02:48:48disruptekprestige: will you sponsor me?
02:52:45PrestigeLike, AA?
02:53:00Prestigeor like a commercial sponsor
02:53:22disruptekyes.
02:53:35PrestigeSure, if you bend to my will for a task
02:53:45disrupteki signed up for github sponsors to help support my drug habit.
02:54:03disruptekwhat's the task?
02:54:26Prestigemultiple inheritance or concepts
02:54:36disrupteki fucking knew it.
02:54:40FromDiscord<ElegantBeef> Prestige i'm working on the `absImport` now, got the AST generated but it's a nice error generating macro
02:54:59disruptekwhat's concepts worth to you?
02:55:19Prestigein dollars? hmm
02:55:44Prestigeoh beef, neat
02:56:05disruptekfor a nim programmer, beef has very poor taste.
02:56:11FromDiscord<ElegantBeef> Truth
02:56:22FromDiscord<ElegantBeef> He's the one that suggested it so meh
02:56:33FromDiscord<ElegantBeef> What's the issue with my taste anywho?
02:57:02disruptekiirc, absImport is a bad idea.
02:57:21FromDiscord<ElegantBeef> Project root relative importing
02:57:44FromDiscord<ElegantBeef> Prestige suggested it so send the hate to him
02:57:50Prestigeye
02:57:53disruptekyou say tomato, i say dogshit.
02:58:16Prestigeeh I would like to have it
02:58:35Prestigeanyway disruptek idk the current state of concepts
02:58:50FromDiscord<ElegantBeef> Nice error anywho, AST is identical to what a user would write but it's saying the file doesnt exist
02:58:52FromDiscord<ElegantBeef> So 10/10
02:59:13disruptekthe 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:27disruptekactually, he probably has other reasons for calling me an idiot.
02:59:53FromDiscord<ElegantBeef> I'm surprised i havent been called an idiot by him yet ๐Ÿ˜›
03:00:21disruptekbut the fact is, i don't see how we can merge them without a migration.
03:01:19disruptekold concepts are not just slow, but very broken.
03:01:29disruptekand recently, they even broke jason.
03:01:37disruptekand my json serializer, also.
03:02:28Prestigethat's a sad state of affairs
03:02:36disruptekit's not brilliant.
03:16:35FromDiscord<ElegantBeef> So prestige doesnt seem there is an overly pretty way of doing it
03:16:49FromDiscord<ElegantBeef> I've got a template call which works properly but then the import fails
03:17:29FromDiscord<ElegantBeef> It's pushed if interested in lookging
03:18:53PrestigeLink?
03:19:49FromDiscord<ElegantBeef> https://github.com/beef331/import-utils
03:25:48disruptekLink?
03:26:41disruptekdid you really make a repo with a fucking hyphen in it?
03:27:05disruptekwhat did i do to you?
03:29:11Prestige@ElegantBeef are you just getting the error in the tests that submod doesn't exist?
03:29:23disrupteki need to add a package section to my style doc.
03:29:44FromDiscord<ElegantBeef> Thought i made it with an underscore to be honest
03:29:47FromDiscord<ElegantBeef> atleast i intended to
03:30:31Prestigedisruptek: 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:18disruptekyou /do/ know how it should be structured?
03:31:29PrestigeYes
03:31:39disruptek!rfc inheritance
03:31:39disbothttps://github.com/nim-lang/RFCs/issues/262 -- 3Support for Multiple Inheritence 7& 7 more...
03:31:53PrestigeDamn that bot is handy
03:32:18PrestigeI'd think the implementation shown here would suffice https://oberoncore.ru/_media/library/templ_a_systematic_approach_to_multiple_inheritance_implementation.pdf
03:32:55PrestigeI just have one particular point that should be added, which is illustrated in my RFC. Might not be super clear
03:33:14disruptek"none of these arguments hold." -- so, it doesn't increase expressive power, either?
03:33:34disruptekwhich language is your MI experience with?
03:33:36disruptekjava?
03:33:40PrestigeIdk what he means by that
03:33:56Prestigeeh java only has a half baked implementation of MI
03:34:10disruptekdon't make me guess.
03:34:12PrestigeIt's just a subject I've thought about and have wanted
03:34:13disruptekpython?
03:34:15Prestigenah
03:34:24PrestigeI've not used it in other languages
03:34:35PrestigeJust have wished I'd had it available
03:34:46*vicfred quit (Quit: Leaving)
03:35:09Prestigemainly in java and typescript (and nim, now)
03:36:05disruptekhmm.
03:36:07PrestigeI've mainly wanted it for game development
03:37:05disruptekwhy do you think it needs compiler changes?
03:37:14PrestigeAnyway this is my main point here https://github.com/nim-lang/RFCs/issues/262#issuecomment-713236634
03:37:15disbotโžฅ Support for Multiple Inheritence ; snippet at 12https://play.nim-lang.org/#ix=2Jbu
03:37:16disrupteki will read the oberon paper, but first i want to pick your brain.
03:38:03disruptek"Both arguments are false as will be shown below."
03:38:16disruptekso, yeah, it doesn't increase expressive power.
03:38:16PrestigeBasically 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:46disruptekno big deal.
03:39:03PrestigeI think it does, but I didn't understand why he said it wouldn't
03:39:16disruptekwhat would be perhaps more valuable would be a proper vtable impl.
03:40:02disrupteki'm a little sad that we gave up multi-methods; how complex could they be, right?
03:40:07PrestigeI think he goes into that about a page or two in, for optimisations
03:40:28disruptekit matters to us because we do method dispatch using method /names/ at the moment.
03:40:37PrestigeAh, I see
03:41:01disruptekthis hampers adoption of inheritance, which hampers interest and performance of MI.
03:41:39PrestigeYeah, I think we'd want vtables for this MI implementation as well, but you'd know better than I
03:41:46Prestigeespecially after reading the paper
03:43:29PrestigeIt's an interesting approach. I think I'll write up an actual MI use case for something I wanted to make
03:43:56disruptekthat would be useful.
03:44:23disruptekwhat has discouraged you from building this?
03:45:32PrestigeI'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:53disruptekin my limited experience, the compiler is the thorniest nim code you're likely to read.
03:47:15disrupteki'd much rather start from scratch.
03:47:50PrestigeHopefully it isn't too bad to deal with
03:48:19disruptekthe description is three pages long. how hard could it be?
03:49:20Prestigeยฏ\_(ใƒ„)_/ยฏ
03:51:07disruptekpick a syntax that we can impl, for starters.
03:51:37*muffindrake quit (Ping timeout: 260 seconds)
03:51:51PrestigeI was thinking of using what was in my RFC, using commas to separate the types. Like `Player = ref object of Locatable, Updatable`
03:52:39disruptektype Missile = ref object {.inherits: [Projectile, ParticleEmitter].} might work for the macro impl.
03:53:10disrupteki don't think it makes sense to wrap the whole type section, and you cannot pragma type sections iirc.
03:53:11PrestigeThat also works, I just thought the former was a bit easier on the eyes
03:53:18Prestigetrue
03:53:23disruptekthis is just the prototype, chucklehead.
03:53:38PrestigeWhatever floats your boat, I'm not too picky
03:53:46*muffindrake joined #nim
03:57:40saemI 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:45disruptekif 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:12disruptekwhat /is/ that functionality?
03:58:12Prestigehttps://play.nim-lang.org/#ix=2KsV disruptek something like this
03:58:37disruptekit's like you want the programmer to have to write code and then the MI scheme deletes it.
03:58:48disruptekisn't this is opposite of what everyone else wants?
03:59:03PrestigeI need to add something actually
03:59:07PrestigeAnd no, not really
04:01:42disruptek procCall Entity(this).update(deltaTime)
04:01:47PrestigeHere we go: https://play.nim-lang.org/#ix=2KsZ
04:01:49disruptekis this really what you want to type?
04:02:10disruptekwhy not `this.entity.update deltaTime`?
04:02:15saemEngines are running away from exactly this type of code.
04:02:42Prestigedisruptek: I didn't know you could do that (unless you mean the new implementation)
04:03:26disruptekyour player can have a field that holds the Entity in it, of course.
04:04:01PrestigeYeah, in accordance to the implementation in the paper, that's what would happen pretty much
04:04:07saemBut why bother decomposing a player into components if you're just going to statically (MI) inherit it again?
04:04:13disruptekthat's my point.
04:04:55PrestigeWhat do you mean?
04:04:59saemI'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:25saem`type Player = ref object {.inherits: [Animation, Locatable].}` <-- this line is static, it's not runtime, happens once.
04:05:31PrestigeI have yet to see an ECS implementation that wasn't terrible to work with
04:05:45disruptek!repos ecs
04:05:46disbothttps://github.com/yglukhov/ecs -- 9ecs: 11Entity Component System 15 21โญ 2๐Ÿด
04:05:46disbothttps://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:46disbothttps://github.com/planetis-m/breakout -- 9breakout: 11Game implemented using strict ECS architecture. Used as a testbed. 15 8โญ 0๐Ÿด 7& 5 more...
04:06:12disruptekyou looked at the 8 hits for `ecs` in nim?
04:06:31PrestigeYeah, I've looked at a few at least
04:06:55disruptekand what do they get wrong?
04:07:08disruptekbesides lack of MI.
04:07:26PrestigeThey seem cumbersome to work with, it's a pain to use
04:07:31saemThe querying is often not great in ECS implementations and that's where the annoying ceremony comes in most often.
04:08:10saemI 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:13saemin Nim.
04:08:24disruptek!repo flatdb
04:08:25disbothttps://github.com/enthus1ast/flatdb -- 9flatdb: 11small/tiny, flatfile, jsonl based, inprogress database for nim 15 29โญ 1๐Ÿด
04:10:01Prestigebasically I'd want to do something like `type Player = ref object Animation, Locatable`, idk how that differs from the inherits pragma
04:10:35disruptekit differs because .inherits can be impl as a macro, today, without compiler changes.
04:10:43Prestigeah
04:11:02saemI 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:15PrestigeNeeding the contents of other methos seems difficult though, I'm not sure how you do that with a macro
04:12:08Prestigesaem: 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:09disruptekyou do that part with term-rewriting, probably, but i'm less and less convinced this is even worth building.
04:12:11saemso proc animation(a: AnimationTypeWhichHidesTheBoilerPlate): void
04:12:59saemAnimationTypeWhichHidesTheBoilerPlate: is an entity with Animation and Locatable components.
04:13:00Prestigedisruptek: what are you not convinced of?
04:13:24disruptekthat this is even worth building, of course.
04:13:34PrestigeI mean, why?
04:13:43disruptekbecause i read the paper.
04:14:13PrestigeCan you elaborate why it convinced you it isn't worth building?
04:14:21disruptekthe 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:35disruptekwhat have i missed?
04:14:47disruptekit's a bunch of extra code that you don't need.
04:14:55disruptekit buys you nothing and can only limit you.
04:15:15PrestigeIt 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:28disruptekuh, that's not what the paper says.
04:15:38disruptekdo you wonder why it wasn't impl in nim?
04:15:51PrestigeThere are many things not implemented in Nim
04:16:07FromDiscord<Jarred Kenny> ๐Ÿฟ
04:17:57PrestigeThe 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:31disruptekask lqdev what he thinks.
04:20:32Prestigeof what, a 3rd way to implement the architecture?
04:21:01disruptekno, go like, "lqdev: am i a knucklehead?"
04:21:05disruptekand see what he says.
04:21:24saemhttps://play.nim-lang.org/#ix=2Kt3
04:22:14Prestigesaem: yeah, I've seen ECS stuff before
04:22:18saemThat'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:58saemdata 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:45saemI 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:08disrupteki don't think it helps at all.
04:26:38saemMechanically no, but I get why ones intuition might drive in that direction.
04:26:56disruptektoo much drinking in college?
04:26:59PrestigeIt 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:21disruptekthere's plenty of extra code.
04:27:25PrestigeI would like to use ECS, as I've been saying for like 8 months, but I just find all the implementations lacking
04:27:27disruptekgood lucky optimizing around it.
04:28:04PrestigeNothing needs to be optimized. And no extra code for the one using MI
04:28:09disruptekpolymorph seems to have a lot of... reasoning.
04:29:00disruptekdid you try to build anything with it?
04:29:01saemThe 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:16Prestigedisruptek: with ecs? Yeah
04:29:16disruptekthat's my point.
04:29:31disruptekwith polymorph?
04:29:39Prestigesaem: yes it does, but I don't care about that
04:29:56PrestigeI'd rather just be able to write the code I want without micro optimising
04:30:29disrupteki think you would be better served by some templates.
04:30:32PrestigeIf I were writing a game engine for commercial games or something, I might want ECs
04:31:16Prestigedisruptek: you mean making something with inheritance? I have, just not MI (because it doesn't exist)
04:31:19saemOK, so that's all statically determined, in which case can't you use concepts?
04:31:29disrupteki mean making something with polymorph.
04:31:41disruptekfor the third time...
04:32:02PrestigeAfaik concepts aren't working entirely, and they only serve part of the functionality that MI would
04:32:34Prestigedisruptek: idk what you're asking. Is that a library or something?
04:32:49*disruptek ๐Ÿคฆ
04:33:16disrupteki want you to look at these two links:
04:33:19disruptek!repo pixecs
04:33:20disbothttps://github.com/PixeyeHQ/pixecs -- 9pixecs: 11A pragmatic entity-component-system module for my gamedev needs 15 22โญ 0๐Ÿด
04:33:22disruptek!repo polymorph
04:33:23disbothttps://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:40PrestigeI 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:01FromDiscord<m0nsta> HNY Folks!
04:38:16PrestigeHappy new year!
04:39:37Prestigewell pixecs is out at least
04:44:08PrestigeI 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:35FromGitter<ornamentist> Can anyone point to a library with idiomatic examples of using Concepts?
06:06:57disruptek!repo jason
06:06:58disbothttps://github.com/disruptek/jason -- 9jason: 11JSON done right ๐Ÿคฆ 15 38โญ 1๐Ÿด
06:07:58disruptekconcepts are being reimpl'd, though. improved. be prepared to change your syntax somewhat.
06:08:02FromGitter<ornamentist> Excellent thanks
06:09:05FromGitter<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:13FromDiscord<Rika> prolly somewhere in the issues of the rfcs repo of nim
06:15:23disruptek!rfc concepts
06:15:25disbothttps://github.com/nim-lang/RFCs/issues/168 -- 3Concepts and type-checking generics 7& 29 more...
06:15:35FromDiscord<Rika> oh you made an rfc command? nice
06:15:49disruptekit has always existed.
06:15:59FromDiscord<Rika> didnt know xd
06:16:08disruptekdiscord chumps.
06:16:13FromDiscord<Rika> lmao
07:02:30*Prestige quit (Quit: Prestige)
07:03:48*Prestige joined #nim
07:09:07FromDiscord<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:46FromDiscord<Rika> lmao
07:33:11FromDiscord<lantos> happy new year
07:47:14*narimiran joined #nim
07:55:21*habamax joined #nim
08:06:13saemRolled around to my part of the world.
08:10:40*Prestige quit (Quit: Prestige)
08:11:55*Prestige joined #nim
08:17:59FromGitter<ornamentist> Is the convention in Nim projects to have a <dir>/<projectname> top-level directory for source files or <dir>/src?
08:19:19FromDiscord<ElegantBeef> the latter `nimble init` will set it up for you ๐Ÿ˜„
08:54:35FromDiscord<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:31saemimpossible, can't be batman, saw them pop in.
09:20:17*gangstacat quit (Quit: ฤœis!)
09:31:13FromDiscord<lantos> which nim vscode extention should we be using?
09:35:05FromDiscord<ElegantBeef> I'm trying saem's as he's improving it to be more stable/usable
09:39:03FromDiscord<flywind> I disabled `nimsuggest`, so I don't care which one to use ๐Ÿ˜œ
09:39:22FromDiscord<ElegantBeef> Well saem's doing some good work, goto defs now work on the compiler
09:40:18FromDiscord<flywind> Does it need `nimsuggest`?
09:41:02FromDiscord<ElegantBeef> Believe so
09:41:50FromDiscord<flywind> Then I would rather use `seacrh` instead.
09:41:57FromDiscord<ElegantBeef> Why?
09:43:51saemI mean, I might be able to get nimfind in there soon enough.
09:44:19FromDiscord<flywind> `nimsuggest` always uses huge memory and even I close the vscode, they still occupy nim.exe.
09:44:48saemThis is primarily for the compiler code base?
09:46:13saemI had to rework the whole elrpc stuff a bunch, part of that was better process clean-up IIRC.
09:47:12saemAs 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:34FromDiscord<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:56FromDiscord<flywind> I see
09:53:25saemI 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:31PrestigeInteresting discussion on the Nim 2020 HN post about debugging with gdb
10:06:43saemOh yeah?
10:06:49Zevvyeah
10:07:05Prestigehttps://news.ycombinator.com/item?id=25590962
10:07:10saemthanks
10:07:35ZevvThe last few months Nim HN posts did well, comment-wise
10:08:19FromDiscord<lantos> nim has a step through break point vscode plugin
10:08:57PrestigeI think it's mentioned, but people said it would bug out sometimes
10:08:58FromDiscord<lantos> https://github.com/jasonprogrammer/nim-debug-example
10:10:09saemI stumbled upon that repo a while back but forgot about it
10:10:25FromDiscord<lantos> https://media.discordapp.net/attachments/371759389889003532/794507816123236363/unknown.png
10:11:31saemI just updated nim-gdb.py in the latest so it's a bit better, hopefully -- still plenty of gaps.
10:11:56saemchoosenim ships with a broken nim-gdb and I haven't gotten around to submitting a PR to fix it.
10:12:29FromDiscord<lantos> could it be included in a vcode ext so that new people have it from get go
10:12:49saemThat's a bit trickier than I would like, but yeah.
10:13:40*natrys joined #nim
10:13:58saemThat'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:57PrestigeI 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:22FromDiscord<Meowz> whats the name of nims code formatter again
10:59:42FromDiscord<Meowz> nimpretty, got it
11:22:59ZevvPrestige: got a code snippet?
11:28:26*JustASlacker joined #nim
11:58:22FromDiscord<juliuskiesian> is there a way to write something like `for x in 10 ..< 1`?
11:59:38ForumUpdaterBotNew thread by Nobody: Arraymancer `<https://github.com/mratsim/Arraymancer>`, see https://forum.nim-lang.org/t/7318
12:00:22FromDiscord<flywind> ! eval for i in countdown(3, 1): echo i
12:00:29FromDiscord<flywind> (edit) "! eval" => "!eval"
12:00:53FromDiscord<flywind> !eval for i in countdown(3, 1): echo i
12:00:55NimBot3โ†ต2โ†ต1
12:01:28Zevvclyybber here?
12:01:40FromDiscord<juliuskiesian> ideally, 1 shouldn't be included. @flywind
12:02:29FromDiscord<flywind> you could always use `(i + 10, i + 1)`.
12:03:04FromDiscord<flywind> or you could your own function
12:05:29*tane joined #nim
12:07:04FromDiscord<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:35ArrrrrrrrHappy 2021, hope nim grows 2000%
12:35:23FromDiscord<Rika> Why not 2020%
12:50:51Zevv2021%, right
13:04:11FromDiscord<Sorrow> Love it so far. Shame there's no music tagging lib like Mutagen.
13:12:02*Vladar joined #nim
13:12:46FromDiscord<juliuskiesian> is there a quick way to convert a `Tensor[float]` from arraymancer to a seq?
13:14:16FromDiscord<Clyybber> Zevv: here
13:16:02*habamax quit (Quit: leaving)
13:16:17FromDiscord<juliuskiesian> bit convoluted, but i found a way: `toOpenArray(xs.dataArray, 0, xs.size - 1).toSeq`
13:16:58Zevvoi; you know some stuff about repr, reprv2, reprjs and dollars, right?
13:17:37FromDiscord<Clyybber> Zevv: just saw your pr, yeah
13:18:14ZevvWhy is it that $ and repr don't use the same underlying implementations?
13:18:23FromDiscord<Ben Boughton> Hello! Brand new to nim. Quick question. How do I get a variable value during compilation?
13:18:38FromDiscord<lqdev> you can't
13:18:58FromDiscord<lqdev> elaborate on what you're trying to do
13:20:15FromDiscord<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:06FromDiscord<Clyybber> Zevv: In general or for sets?
13:21:48ZevvIn general
13:21:53FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2KuM
13:22:07FromDiscord<lqdev> but you need to make sure that `yourSrcDir` is either a const or a {.compileTime.} var or let
13:23:26FromDiscord<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:43Zevvhm fair enough
13:23:56Zevvok, so I need to figure out how to get my js repr to work from this funny set representation
13:24:01Zevvthanks
13:24:13FromDiscord<Ben Boughton> Fantastic! That works
13:24:55FromDiscord<Ben Boughton> I appreciate your help.
13:28:24FromDiscord<lqdev> np
13:45:33*vsantana joined #nim
13:45:48*waleee-cl joined #nim
13:50:16*Arrrrrrrr quit (Quit: Arrrrrrrr)
13:51:23FromDiscord<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:40Zevvdom96: yeah, sure but for types where `$` is defined, repr could use `$` or the other way around. Now there are duplicate implementations.
13:59:57ForumUpdaterBotNew thread by Alexeypetrushin: Seems like a bug? SIGSEGV: Illegal storage access., see https://forum.nim-lang.org/t/7319
14:00:41FromDiscord<dom96> `repr` gives a much more useful representation of data structures though
14:00:51FromDiscord<dom96> I don't want a string representation of JSON for example
14:00:57FromDiscord<dom96> I want to see what the data structure looks like
14:01:24FromDiscord<dom96> The same applies to strings if I want to see the escaped character literals instead of the characters they represent
14:01:42Zevvfair 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:13FromDiscord<Clyybber> Zevv: Btw do you know more details on https://github.com/disruptek/cps/issues/47?
14:08:14disbotโžฅ mutable params and the developers who love them
14:08:37ZevvI don't think its realistic
14:09:15ZevvWhen 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:38Zevvwhen 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:48Zevvand just refuse to CPS procs with var args
14:09:55Zevvbut of course mr stubborn thinks otherwise
14:11:39Zevvso 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:53Zevvoi disruptek, wakey wakey
14:11:55FromDiscord<Clyybber> aight, disruptek
14:11:57Zevvthat's enough
14:12:02FromDiscord<Clyybber> heh
14:12:15Zevvit's past nine over there
14:13:46FromDiscord<Clyybber> Zevv If we store the arg somewhere we can make it always be there for the duration of execution no?
14:14:04Zevvyeah but it's all about making it var
14:14:12Zevvso you should be able to mutate the callers original value
14:14:15Zevvwhich might not even exist anymore
14:14:34Zevvis a pointer that might point to nowhere
14:15:01FromDiscord<Clyybber> because it has been moved?
14:15:17Zevvor just because it went out of scope and no longer exists
14:15:21FromDiscord<Clyybber> I see
14:15:41Zevvyou 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:44Zevvwhere does i go?
14:15:47Zevv*poof* gone
14:16:09Zevvso I say we just ignore this case for now. If you want to mutate something, use a ref
14:16:52ZevvI think the js backend smells funny
14:22:49FromDiscord<jseb> speaking of javascriptโ€ฆ
14:25:27FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Kv9
14:28:04*Vladar quit (Quit: Leaving)
14:30:25FromDiscord<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:28FromDiscord<flywind> you could use template to workaround this issue
14:36:32FromDiscord<flywind> (edit) "template" => "templates"
14:38:15FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Kvg
14:41:02FromDiscord<flywind> Yeah, you could use `static string`
14:41:14FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Kvh
14:46:50FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=2Kvm
14:48:15FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2Kvl
14:48:44FromGitter<offbeat-stuff> Hi
14:48:46FromDiscord<lqdev> (edit) "https://play.nim-lang.org/#ix=2Kvl" => "https://play.nim-lang.org/#ix=2Kvo"
14:49:35FromDiscord<lqdev> hi
14:49:38FromGitter<offbeat-stuff> How to autogen nim bindings for c++ wrappers
14:49:40FromGitter<offbeat-stuff> Like there are pkg-config --cflags and pkg-config --libs for the wrapper
14:51:51FromDiscord<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:55FromDiscord<jseb> @lqdev : no, it stills resolves filename at the compilation time
14:52:24FromDiscord<lqdev> yeah but it will print the variable containing the filename
14:52:39FromDiscord<lqdev> why not just use `echo` or something instead of emitting a console.log?
14:52:50FromDiscord<Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2Kvp
14:53:13FromDiscord<lqdev> @Sorrow it's possible that the bodyStream contains less than 4194304 bytes.
14:53:26FromDiscord<Sorrow> The file's 1GB.
14:53:41FromDiscord<lqdev> how do you know it loads the whole file?
14:53:50FromDiscord<Sorrow> By monitoring it.
14:54:01FromDiscord<lqdev> monitoring what? `chunk`'s `len`?
14:54:06FromDiscord<jseb> yes you're right lqdev, `echo` is the way to go for this one. It was for testing `emit` macro
14:54:10FromDiscord<flywind> you could import `jsconsole` to use `console.log`.
14:54:16FromDiscord<Sorrow> Memory usage. It keeps increasing.
14:54:31FromDiscord<lqdev> the GC doesn't run immediately
14:54:54FromDiscord<lqdev> you can force a collection using `GC_fullCollect()`
14:55:12FromDiscord<lqdev> or use ARC or ORC which will free the data as soon as it's no longer in use
14:55:57FromDiscord<haxscramper> Or move `chunk` out of the loop and use it as buffer
14:56:04FromDiscord<haxscramper> WIth something like https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint
14:56:11FromDiscord<Sorrow> Thank you. I was thinking about using a buf instead.
15:15:21FromDiscord<bark> in nim, are ref objects required for dynamic dispatch?
15:17:00FromDiscord<haxscramper> IIRC yes
15:21:02mipriyou can avoid ref objects, but you'll run into issues as soon as you want e.g. a seq[SuperClass]
15:23:44miprihttps://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:30miprihttps://play.nim-lang.org/#ix=2KvJ fixing the warning
15:26:06mipriwell size aside there's an ObjectAssignmentDefect
15:28:13FromDiscord<bark> https://play.nim-lang.org/#ix=2KvK has no ObjectAssignmentDefect
15:28:43mipriss.add them instead of showId'ing them
15:29:45FromDiscord<bark> i guess its due to sizes
15:30:01FromDiscord<bark> i guess it's generally a good practice to make all inheritance chains ref
15:30:06FromDiscord<bark> or ptr
15:30:09miprieven when .sizeof is the same you get that error
15:30:23FromDiscord<bark> huh
15:30:51FromDiscord<Sorrow> How can I get the resp headers, status code etc before loading the file? Am using .get().
15:50:03FromDiscord<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:54FromDiscord<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:31FromDiscord<juan_carlos> architecture, not OS, 32 for 32bit, 64 for 64bit.
15:54:03FromDiscord<For Your Health> So is float generally preferred to use?
15:54:38FromDiscord<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:48Zevvuse float unless you have reasons not to
15:57:01Zevvit's a cdouble under the hood indeed
15:58:24FromDiscord<juan_carlos> "Everything floats down here"
15:59:10FromDiscord<For Your Health> Sounds good. Thanks for the help
15:59:31FromDiscord<flywind> How can I `hash` float/Number in `Javascript`?
16:00:05FromDiscord<flywind> Nim JS backend doesn't support hash float.
16:00:41*narimiran joined #nim
16:02:27Zevvwell, it's not that it does not support it. it's broken.
16:03:07FromDiscord<flywind> The version before returns floats, I don't think that's right
16:04:41FromDiscord<flywind> `import hashes; echo hash(0.3456)` returns `0.3456` in Nim v1.2.6 in JS backend.
16:10:33FromDiscord<flywind> I would fix cast float to int first.
16:19:25Zevvhow does one reliably run all CI locally?
16:19:32Zevv./koch runCI?
16:24:44FromDiscord<flywind> run all tests?
16:25:02Zevvyeah seems I have nodejs versions issues
16:25:06Zevvso im good
16:26:39FromDiscord<flywind> https://nim-lang.org/docs/contributing.html#running-tests
16:27:12Zevvyeah, but that says "a good subset of"
16:27:33FromDiscord<Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2KvZ
16:27:35Zevvbut 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:18FromDiscord<Rika> sorrow, maybe use async
16:30:27FromDiscord<Rika> not sure if that would actually help though
16:30:40FromDiscord<Sorrow> I read about the progress callback thing.
16:41:42*NimBot joined #nim
16:47:47*pigmej joined #nim
16:48:05pigmejHey guys,
16:48:17pigmejAnyone having experience using cligen/dents ?
16:48:39pigmejI'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:08pigmejI 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:58pigmejI am aware of globs/walkDirRecFilter BUT there is a warning about `unstable API`
16:56:33FromDiscord<Clyybber> Zevv: Hmm, but actually we can just extend the lifetime of i ourselves, no?โ†ตSince we are rewriting locals anyways
16:56:57FromDiscord<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:36FromDiscord<Rika> is it possible to make an object with a size of 0?
17:01:57*lritter joined #nim
17:02:19FromDiscord<lqdev> what for?
17:02:25FromDiscord<haxscramper> `distinct void`?
17:02:48FromDiscord<Rika> i want to store compile time data into another object without runtime cost (this is very fucky i know)
17:02:53FromDiscord<lqdev> !eval type O = object; echo O.sizeof
17:02:55NimBot1
17:02:57FromDiscord<Rika> 1
17:03:00FromDiscord<Rika> its gonna be 1
17:03:01FromDiscord<Rika> yeah
17:03:16FromDiscord<lqdev> eh mate it's only one byte
17:03:20FromDiscord<haxscramper> !eval type VOID = distinct void; echo VOID.sizeof
17:03:20FromDiscord<lqdev> it's nothing
17:03:23NimBot0
17:03:28FromDiscord<Rika> hm
17:03:33FromDiscord<Rika> lol nice
17:03:48FromDiscord<haxscramper> curios what it compiles to
17:04:28Zevvclyybber: the original var args might live in a non-cps proc that returns before the continuation is resumed
17:04:49Zevvit's perfectly possible I don't understand what disruptek is trying to say here, of course. I have that, sometimes
17:05:39FromDiscord<Clyybber> what you said makes sense, but im in the same boat as you, i dont understand the gh issue
17:05:54Zevvso, is it us, or is it disruptek, I wonder
17:08:09FromDiscord<Clyybber> i dont understand if its trying to tellme theres a bug I could fix
17:08:19FromDiscord<William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2Kwk
17:08:20ZevvI don't think so
17:08:30ZevvI think it's a CPS internal thing. Did he ping you on that one?
17:08:53disruptekwhat?
17:09:01FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Fbo
17:09:12Zevvdoes it hurt bad?
17:09:31Zevvclyybber was wondering about https://github.com/disruptek/cps/issues/47
17:09:31disbotโžฅ mutable params and the developers who love them
17:09:39FromDiscord<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:40ZevvI say it can't be done
17:10:01FromDiscord<For Your Health> I'm guessing I need dynamic dispatch and I haven't used that in Nim yet.
17:10:16disruptekit can be done.
17:10:32ZevvFor Your Health: Emulate your exchange at the API level you are accessing it at in real life
17:10:49Zevvdisruptek: who is calling foo(). A non-cps proc?
17:11:03Zevvthat might have `c` on its stack. It might have returned before the continuations get resumed
17:11:07Zevvso `c` is dead & gone
17:11:09Zevvdust
17:11:10disruptekyes.
17:11:28FromDiscord<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:37disruptekprobably.
17:12:00disruptekif it were me, i would mock the entire API.
17:12:09disrupteki presume you're using http, so just mock the server.
17:12:36disruptekthen run it on a distant cloud, etc.
17:13:20disruptekzevv: and, so what?
17:14:13FromDiscord<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:31disruptekuse debugEcho.
17:14:36FromDiscord<For Your Health> So should I have something like `Exchange = ref object of RootObj` and `SimulatedExchange = ref object of Exchange` ?
17:14:56FromDiscord<For Your Health> And then my bot holds a ref to Exchange and calls on that or something?
17:14:57disruptekno.
17:15:18FromDiscord<William_CTO> Error: attempting to call routine: 'keys'โ†ตSame issue as trying to use repr and echo
17:15:27disruptekwell, don't do that.
17:16:17Zevvdisruptek: ok, nevermind, i must be stupid and you must be smart, so i give up
17:16:23FromDiscord<William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2Kwm
17:16:38disruptekzevv: i don't think i get the problem.
17:17:40Zevvwhat does c refer to if it was a local of the calling function, which returned before we *use* c
17:18:01disruptekprobably a pointer. i don't know how else to impl it.
17:18:15Zevvright. and is this pointer still valid?
17:18:20disrupteknope.
17:18:24Zevviright
17:18:31Zevvso why do we need to support this
17:18:40disruptekbecause people like mamy exist.
17:19:01Zevvif you want to do that kind of thing, use heap refs
17:19:34Zevvif mamy needs this, let him request it
17:19:57Zevvand show how this should actually work
17:20:08disruptekso the current blocker is kinda silly.
17:20:19disruptekwe're not substituting all variables.
17:20:44disruptekthe 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:50ForumUpdaterBotNew thread by NightRang3r: Executing command in hidden console, see https://forum.nim-lang.org/t/7320
17:21:03disruptekwhere it's done now doesn't work. ๐Ÿ˜‰
17:21:40disrupteki think we're doing substitution on only a single statement instead of the remaining scope.
17:21:47FromDiscord<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:04disruptekthe /right/ way to do it is to mock the entire server.
17:22:09PrestigeZevv: 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:14Zevv thats what I said
17:22:23PrestigeBut only when I use --gc:orc
17:23:13disruptekman, your use of whitespace is the stuff of nightmares.
17:23:39disruptekforget MI, i don't think you should be allowed access to the newline.
17:23:56*JustASlacker quit (Ping timeout: 240 seconds)
17:24:11PrestigeHaha, I think it's much more readable to have params vertically aligned
17:24:36FromDiscord<Rika> y tho
17:24:48FromDiscord<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:50FromDiscord<Rika> oh this style
17:25:03FromDiscord<Rika> i was thinking the one where the first param is not newlined
17:25:08FromDiscord<Rika> that kinda style is scarier
17:25:14PrestigeYeah for sure
17:25:25FromDiscord<Rika> true waste of space that one is
17:26:14disruptekhealth: how do you communicate with the real exchange?
17:26:35PrestigeI also greatly dislike horizontal scrolling
17:26:53FromDiscord<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:39FromDiscord<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:46disruptekso 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:49Zevvok, but what protocols, http?
17:28:00Zevvmoch the same http api call in your fake server
17:28:15Zevvright, what he said ^^
17:29:30FromDiscord<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:45Zevv...
17:29:45disruptekand we just told you that.
17:30:15Zevvmake it talk like a duck and walk like a duck
17:30:54FromDiscord<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:05FromDiscord<For Your Health> So how do you duck type in nim I guess is what i'm asking?
17:31:05disruptekyou're missing the point.
17:31:29Zevvyeah i see wha youre trying to do
17:31:41Zevvyou want to mock at a different level
17:31:51disruptekthe point is to write as little code as possible that varies between the two implementations.
17:32:16Zevvyou can use generics or inheritence
17:32:19disruptekmocking the entire server achieves that because /only data/ changes, and /only one int32/ needs to be updated.
17:32:23Zevvgenerics is the 'nim way'
17:32:24FromDiscord<juan_carlos> If it talks like a duck and walks like a duck, is obviously a platypus.
17:34:15FromDiscord<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:29FromDiscord<For Your Health> And my bot references that module?
17:34:33disruptekno.
17:35:01FromDiscord<For Your Health> I guess what I'm asking is, what does my bot call to place a buy order?
17:35:07disrupteki mean you go off and /write an exchange/ and then /run it somewhere else/ to mimic the actual reality.
17:35:17disrupteki give up.
17:35:44disrupteki have more stuff i want to get done in 2021.
17:35:55FromDiscord<For Your Health> I guess I'm not communicating my problem correctly, my apologies.
17:36:08disruptekyou are. you aren't listening to the answer.
17:42:14FromDiscord<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:21PrestigeHealth: 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:12PrestigeEverything else should stay the same, except for that
17:43:13disruptekrika: fairly manually, i'm afraid.
17:43:42FromDiscord<Rika> it's a pain to get this to work with a generic parameter
17:43:46FromDiscord<Rika> (i do not know how)
17:44:20FromDiscord<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:22disruptekyou can measure the type easily enough using one of the three getType impls.
17:44:30disruptekhealth: yep.
17:44:54FromDiscord<Rika> imma refresh on getType then thanks
17:45:31disruptekrika: 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:13FromDiscord<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:44disruptekof course.
17:48:01disruptekyour macro won't use generics.
17:48:43FromDiscord<Rika> i mean when i feed my macro a generic param, what can i do D:
17:49:10disruptekdo you have a repro?
17:50:21FromDiscord<Rika> one moment
17:50:27disruptekhealth: 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:07disruptekit's work that will help you understand your client better, too.
17:55:20FromDiscord<Rika> disruptek: https://play.nim-lang.org/#ix=2KwB
17:56:44FromDiscord<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:01FromDiscord<For Your Health> Two different real exchanges that is
17:57:55saemHealth: 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:17saemYou don't want indirection.
17:59:02saemThey're not different, it should be the same thing. The bot only differentiates based on address.
17:59:04FromDiscord<William_CTO> I figured out my issue disruptek
17:59:50FromDiscord<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:14FromDiscord<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:43FromDiscord<William_CTO> @For Your Health what is this bot of yours?
18:01:45PrestigeI 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:11PrestigeBut if the APIs are the same there's no point in doing that
18:02:28saemThen 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:04saemOtherwise you want One Direction
18:03:42saemYeah, what Prestige said
18:03:58FromDiscord<For Your Health> It's a crypto trading bot I'm toying around with.
18:04:21saemWhatever.
18:04:32saemDoes it need runtime swapping?
18:05:16FromDiscord<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:37FromDiscord<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:03FromDiscord<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:27disruptekthen do it the way the old guys told you to do it.
18:06:28disruptekrika: i have no bandwidth, but did you get my comment?
18:06:43*JustASlacker quit (Ping timeout: 268 seconds)
18:08:46saemThen 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:12FromDiscord<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:30miprichange what about it?
18:10:05FromDiscord<ITR> IE. make objects of the same type be located near each other in memory
18:10:11FromDiscord<ITR> (edit) "memory" => "memory, no matter when allocated"
18:10:27FromDiscord<ITR> (edit) "allocated" => "created"
18:10:47FromDiscord<haxscramper> You probably need to write custom allocator for that one and dive into low-level C details
18:11:04FromDiscord<haxscramper> IIRC default GC does not provide such features
18:11:05FromDiscord<ITR> sent a code paste, see https://paste.rs/Acw
18:11:10*hmmm joined #nim
18:11:33FromDiscord<ITR> I mean, I feel like that's separate from GC, IE, a garbage _collector_ could work independently from an allocation manager
18:12:43FromDiscord<haxscramper> https://forum.nim-lang.org/t/3158
18:12:48miprisure. --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:48FromDiscord<juan_carlos> GC wont alloc.
18:13:10FromDiscord<haxscramper> Maybe something from this tread would be useful, it seems like a question quite close to yours
18:13:47saemITR of you use object and contiguous allocation structures like seq, does that not do what you want?
18:14:18mipriLeuGim'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:14FromDiscord<ITR> I'm looking into entity component systems (mostly gamedev related), use hashsets to store components for a specific object.
18:15:23FromDiscord<ITR> which use
18:15:28FromDiscord<Rika> disruptek, sorry, which comment do you refer to?
18:15:35saemI knew it.
18:15:39disruptekdon't you want `auto` as your return-type?
18:15:48FromDiscord<Rika> Ah.
18:15:51FromDiscord<Jarred Kenny> Is it possible to get the position of a key in a table?
18:15:55FromDiscord<Rika> LOL
18:16:02FromDiscord<Rika> That is indeed a better idea
18:16:04FromDiscord<Rika> Thanks
18:16:08disruptekif you use an Ordered table, yes.
18:16:34FromDiscord<ITR> @Jarred Kenny what do you mean by position?
18:16:51saemITR: look at the internals of a tables. It'll behave well enough for your case.
18:17:01FromDiscord<Jarred Kenny> Essentially the index from the order of insertion
18:17:09FromDiscord<haxscramper> IIRC jken was doing the same (also ECS, also need for continuous memory alignment)
18:17:21FromDiscord<Jarred Kenny> lol yes, still playing with this.
18:17:37FromDiscord<ITR> saem: even if they point to an object/ref type?
18:17:59FromDiscord<ITR> though I guess they don't technically have to be ref types in the table
18:18:17saemWhy are you using a ref? That's basically exactly not what you want for a component
18:18:28FromDiscord<ITR> yeah, I just realized that
18:18:54FromDiscord<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:41saemYou're _doing_ the larger scale memory layout, use object.
18:20:16FromDiscord<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:21saemAlso, get used to not using any refs and indirecting based on IDs
18:20:31FromDiscord<ITR> It won't work for what he wants, I think
18:21:03saemYeah, checkout the three other ECS implementations on nimble
18:21:24FromDiscord<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:50FromDiscord<Jarred Kenny> The more I think about it, the more I feel there is a better approach.
18:22:10FromDiscord<ITR> order of insertion
18:22:15FromDiscord<ITR> @Jarred Kenny what do you want to use it for?
18:23:32FromDiscord<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:43saemAlso 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:30FromDiscord<ITR> hmm, I only see two others, akrsys and entoody
18:25:50saemYou 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:35saem!repo ecs
18:27:36disbothttps://github.com/yglukhov/ecs -- 9ecs: 11Entity Component System 15 21โญ 2๐Ÿด 7& 7 more...
18:27:52FromDiscord<ITR> o nice
18:27:53disruptek!repos ecs
18:27:55disbotquery failed ๐Ÿ˜ข
18:27:57disruptek!repos ecs
18:27:59disbotquery failed ๐Ÿ˜ข
18:28:05FromDiscord<ITR> !repo, not repos
18:28:07disruptekwtf github
18:28:12disruptek!repos ecs
18:28:13disbotquery failed ๐Ÿ˜ข
18:28:35disrupteki think they put new query limits in place.
18:28:58saemButts
18:29:35saemI forgots the 's', now we can't have nice things. :(
18:29:53disruptekanyway, yuri's is a toy. you want polymorph or pixecs.
18:30:00saemYeah
18:30:25disruptek`repo` delivers the top hit. `repos` delivers the top 3, or the top 30 if you /msg disbot directly.
18:30:52FromDiscord<ITR> neither polymorph nor pixecs returns any results on nimble.directory
18:31:10saemYou and the dms, you sly dog
18:31:28FromDiscord<ITR> found on google tho
18:31:36saemThe system works
18:31:38disrupteknimble.directory is meaningless.
18:31:39Zevvis disbot hotpluggable?
18:32:03disruptekno.
18:32:07Zevvlame.
18:32:38saemSsshhh, future robot overlords can hear you.
18:32:44FromDiscord<haxscramper> There are almost 4k nim repos on github
18:33:50saemYup, 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:53FromDiscord<ITR> why do all the ecs repos start with an argument for why you might want to use them
18:34:04saemBecause it's ECS
18:34:09saemIt's like crossfit
18:34:10mipriwhy do any repos fail to start with such a thing?
18:34:20saemYou're not doing it unless others know you are
18:34:43saemAlso, I'm paleo
18:35:12saemSeriously though, the why is good. Wish more things did that.
18:36:22FromDiscord<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:59saemOne of my favorite Nim repos is synthesis by mratsim. Great explanation, nice layout, code has lots of explanations.
18:37:19saemITR that sounds fun
18:38:59FromDiscord<ITR> :โ€‹o synthesis has state machines?
18:39:04Zevv19:38 < FromDiscord> <ITR> :โ€‹o synthesis has state machines?
18:39:11Zevvsynthesis *is* state machines
18:39:28FromDiscord<ITR> that's literally the last thing i need, adding it to frankenstein
18:39:29disruptekyou're blowing my mind right now.
18:39:43Zevvalways will, mate
18:39:54disruptekwhy doesn't tzevv work?
18:40:30reversem3Does anyone know of server modules for video streaming like nginx RTMP modules?
18:40:35Zevvdisruptek: gimme a sec
18:41:02Zevvpull
18:41:21Zevvoh dang no
18:41:26Zevvsheit
18:41:38disruptekit compiles, at least.
18:41:40FromDiscord<ITR> strange, Polymorph isn't on nimble, but it has a .nimble file
18:41:45Zevvdisruptek: yeah
18:42:09ZevvI got the first 2 or 3 up
18:42:17Zevvand the rest all fails on expPrims asserts
18:42:44FromDiscord<ITR> is there any way I can pass the github link to nimble?
18:42:45saemNimble requires some hoops (not bonkers) to register your stuff and not everyone does it. I mean I still can't be arsed.
18:43:38disruptekzevv: did you have to fix cps?
18:44:02saemYes, it's either install command with a flag or development. Check nimble --help
18:44:02disrupteki don't publish on nimble because the publish process is stupid and dom wouldn't accept my patch to fix it.
18:44:21Zevvdisruptek: no i only changed the .cps. syntax and switched to testes
18:44:37disrupteki guess that's good.
18:44:41Zevvbut the tests themselves fail so i think something is bonkers in the xfrm
18:45:11Zevvi planned to do some stuff today but i ended up doing set[char].repr in the nim libs
18:45:14disruptek"no generic params allowed for ref" from environment.nim.
18:45:28Zevvwhat does that even mean
18:46:00Zevvim on mobile now, cant take a loook sorry
18:46:32disruptekthe bad line is from populateType, so it's due to assuming y is a constant in `var x = y`.
18:47:06Zevv9
18:48:03disruptekwe don't use the `cps` prefix, do we?
18:49:43Zevvlike i said, mentally im still stuck at 0.0.13
18:49:43disruptekresult = env_33554996(fn: t, result_33554995: result_33554995)
18:49:46disruptekglwt
18:50:56disruptekany problems with my testes? other than the fact that they don't work for you, i mean?
18:51:19Zevvoh i just need to figure out how it works i guess
18:51:43disruptekthe transform is pretty weird. i dunno if it's your fault.
18:51:51Zevv'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:54disruptek 60 proc C(continuation: env_33554996): C {.cpsLift.} =
18:51:54disruptek 61 env_33554996(continuation).result_33554995
18:52:23disruptekyou just run it with --define:release to make it barf.
18:52:36Zevvah right you told me
18:53:06disruptekbut maybe i can make that work somehow, too.
18:53:51disrupteki didn't expect that C() proc, either.
18:53:53*vivus joined #nim
18:55:54Oddmongerthat must be the magic of the new year, but the manual seems clearer now :)
18:58:27saemOddmonger: I've had a bunch of those moments myself recently. :D
18:59:02ForumUpdaterBotNew thread by Neodim: Native GUI development for MacOS, see https://forum.nim-lang.org/t/7321
19:00:20FromDiscord<Daniel> Happy New Year ๐Ÿฅณ
19:00:25FromDiscord<Daniel> https://media.discordapp.net/attachments/371759389889003532/794641193287942144/2020.gif
19:00:52disruptekzevv: i dunno, tzevv code looks okay to me.
19:01:05Zevvi thought so as well
19:01:22disruptekand those transforms look pretty bogus.
19:02:00disruptekoh, i see it.
19:02:12disruptekt(): C {.cps: C.} should be t() {.cps: C.}
19:02:44disrupteki pushed.
19:02:45Zevvpfff
19:03:10Zevvsilly, we should hide that stuff and just expose a few friendly macros instead
19:03:34disruptekwe do hide it.
19:03:48Zevvso, now the first few run and the rest assert, right?
19:03:50*junland quit (Quit: %ZNC Disconnected%)
19:03:51disruptekyour t() doesn't have a return type.
19:03:55Zevvbecause that's how far I got before
19:04:10disruptek## 21 tests ๐ŸŸข8 ๐Ÿ”ด5 โ›”8
19:04:17*superbia joined #nim
19:04:45disruptekwe have a duplicate proc predeclaration, which is funny.
19:04:53*junland joined #nim
19:05:01disrupteki love having these bugs, though.
19:05:09disruptekso easy to fix one way or another.
19:05:18disrupteki really hate debugging the compiler.
19:05:33Zevvthis is not the compiler being wrong
19:05:35Zevvits just cps
19:05:44disrupteki know, that's what i like about it.
19:05:48Zevvah
19:06:12disrupteklike, i know that if i put a couple hours in, i will pass more tests.
19:06:15disruptekthat's a nice feeling.
19:06:22Zevvgo 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:54Zevvso we can start dropping the :int parts soon, right?
19:23:49*himu joined #nim
19:23:58disruptekwe already do.
19:24:12Zevvwell look at that
19:24:22FromDiscord<Avatarfighter> Hello hello
19:24:26FromDiscord<Avatarfighter> what is CPS being used for?
19:24:32Zevvcmon dude
19:24:51disrupteki updated the README with a new typed tock.
19:25:07Zevvavatarfighter: nothing *yet**
19:25:37Zevvbut the idea is to make it the lego bricks for building anything involving non-linear code flow
19:26:14Zevvlike custom control flow, coroutines, async, lazy eval, efficient fp
19:26:49leorizeI can build you a new async system or port the current one over when y'all are done with the cps stuff
19:27:10disruptekyou may as well start now.
19:27:50leorizeI heard there are still a bunch of bugs :P
19:27:56disruptekzevv: what do you make of my hiddenstdconv hack?
19:28:11leorizeand I'm writing that process library again so will take awhile
19:28:14Zevvdont know what that is
19:28:51disruptekhttps://github.com/disruptek/cps/commit/ee4c7a8240c02c2c281fe67fb2e339b6f17a218d
19:29:47FromDiscord<Avatarfighter> leorize: new async piques my interest ๐Ÿ˜›
19:29:53*vivus quit (Quit: Leaving)
19:30:33ZevvhiddenStdConv, new to me
19:30:49*vivus joined #nim
19:32:07disrupteki 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:40Zevvhmm like lower how?
19:41:21*a_chou joined #nim
19:41:49disrupteklike making getImplTransformed work.
19:44:53disruptekyou feel me?
19:46:11*a_chou quit (Client Quit)
19:49:15Zevvthat would be sweet indeed
19:49:38ZevvI was just wondering, is it solid enough?
19:49:43Zevvthe docs say it's for inspection and debugging
19:49:49Zevvso are we supposed to actually /use/ that?
19:50:31ZevvAh, this one, I remember now: "Error: implementation of 'exit_385877917' expected"
19:50:45disruptekjust the duplicate predec.
19:50:52Zevvah k
19:52:10disruptekgetImplTransformed would let us support for loops.
19:52:18Zevvyes, that's why I looked into it
19:52:27Zevvbut it works inside out
19:52:30Zevvit's funny
19:53:36disruptekinside out?
19:53:48Zevvyou pass it a sym and it gives the implementation
19:53:55Zevvit's not like a macro that actually transforms your code
19:53:56disruptekyeah.
19:54:14disruptekbut that's okay. we can maybe layer cps.
19:56:06ZevvI'm dropping testes. Everything is a green square.
19:56:23disruptekdude, my testes dropped along time ago.
19:56:32disruptekvery long.
19:57:07Zevvcan't see what its doing
19:57:46disruptekthat'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:07FromDiscord<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:10ForumUpdaterBotNew thread by Alexeypetrushin: Weird how visibility scope works if generic proc used. Possible bug?, see https://forum.nim-lang.org/t/7322
20:05:10ForumUpdaterBotNew thread by Domogled: How use custom event inherited from DOM Event in javascript?, see https://forum.nim-lang.org/t/7323
20:06:43disruptekzevv: getImplTransformed /almost/ works.
20:07:50saemHah, ran into a case where CPS would be handy (in JS land).
20:11:09*Arrrrrrrr quit (Quit: Arrrrrrrr)
20:13:15saemIt'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:59saemThis is also a fun test to see if I understand what/how dispatchers could be used.
20:14:43disrupteki don't get it.
20:15:22disruptekif you wrap the log call, why wouldn't you pass the source of the call right there?
20:17:29saemIt's fair question,t he wrap was going to be nothing more than a static template to lookup a known var.
20:18:04Zevvdisruptek: already
20:18:25disruptekthe transform is broken, afaict.
20:18:49disruptekthe compiler gives me `var i`; no type, no initialization value.
20:19:01disruptekother than that, i think it would work.
20:19:49Zevvis there a way to tell what matches if you look from the inside and from the getImplTransformed side?
20:19:55Zevvcan the nimnodes be ==ed ?
20:20:08Zevvif we are brave, we might be able to merge both views
20:20:12Zevvbut that'll be tricky and fragile
20:20:15disrupteklemme push this. yeah, we could rewrite the rewrite.
20:20:32disruptekit's in a branch called `almost`.
20:20:57Zevvwell that was pretty trivial code
20:21:09disrupteki would rather have the compiler fix its output, though.
20:21:20Zevvyeah sure, this is way more usable
20:21:23saemEven 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:36Zevvi always felt we needed to go into the compiler to be able to get for loops expanded
20:21:45Zevvbut if this works, that would be pretty nice
20:21:52Zevvso, yes, clyybber, we have work to do :)
20:22:07disrupteksplash some cold water on his face.
20:22:25PrestigeWhat do you mean by expanding for loops?
20:22:39ZevvCPS rewrites nim code
20:22:49Zevvbut we can't transform non-closure for loops, becuause we can't see "inside"
20:23:08Prestigeah
20:23:09Zevvbut there'a hacky macros proc getImplTransformed() that allows you to view a proc post-transform
20:26:20FromDiscord<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:34FromDiscord<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:22FromDiscord<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:12saemJarred 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:51FromDiscord<Jarred Kenny> seam, the idea behind is you can use any object as a component and register them dynamically
20:43:11FromDiscord<Jarred Kenny> rather than having all possible component types defined in the Universe object
20:44:24*tane quit (Quit: Leaving)
20:49:09saemHmm, 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:16jkennot 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:07saemjken: hot code reloading. If they're consuming your module then a generic type would work, wouldn't it?
20:51:58jkenHow would that work?
20:57:10saemIf 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:26saemC is Components (the list)
21:11:58*narimiran quit (Ping timeout: 256 seconds)
21:12:42FromDiscord<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:49FromDiscord<William_CTO> I've tried this so far (doesn't work)
21:12:55FromDiscord<William_CTO> sent a long message, see http://ix.io/2KxS
21:13:08FromDiscord<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:15Zevvdisruptek: could it be that the underlying AST is ok but repr is not up to the task of properly displaying it?
21:19:30disruptekno.
21:20:08jkensaem, concepts are still foreign to me.
21:20:16jkenCan I bother you for an example?
21:20:34Zevvdisruptek: how can you tell
21:20:44disruptekbecause my code sees all.
21:20:46Zevvbecause "var i" is just not legal AST, probably
21:21:09Zevvwhat does that look like in a treerepr?
21:21:18disruptekvar (i, nil nil)
21:21:25Zevv:(
21:21:27disruptekyes.
21:21:44FromDiscord<William_CTO> dis can you suggest an approach if its even possible?
21:21:57Zevvyeah, 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:20saemjken: you've already read this: https://nim-lang.org/docs/manual_experimental.html#concepts
21:22:27disruptekwilliam: what?
21:22:52disrupteki always compose ast "manually".
21:24:30jkensaem, yeah I mean as they relate to the ecs
21:27:41disruptekwilliam: 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:08saemjken: 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:40disruptekgah who wrote that dogshit.
21:33:55disruptekoh wait.
21:43:47Zevvman git-dogshit
21:44:11disruptekNo manual entry for git-dogshit
21:44:45Zevvoh, wait, "blame" it's called, I remember now
21:45:43*narimiran quit (Ping timeout: 246 seconds)
21:45:48ZevvZzz. some caching up to do.
21:46:00disruptekaight, gn zevv
21:50:38FromDiscord<Clyybber> damn, just when zevv goes
21:50:54FromDiscord<Clyybber> disruptek this is what https://github.com/disruptek/cps/issues/48 is about?
21:51:04disbotโžฅ for loops could be supported with a compiler fix ; snippet at 12https://play.nim-lang.org/#ix=2Ky0
21:51:20disrupteki dunno what `this` refers to.
21:51:29disruptekoh, yes, is the answer.
21:51:34FromDiscord<Clyybber> he
21:51:53FromDiscord<Clyybber> does i have its .typ set?
21:51:58disruptekno.
21:52:06FromDiscord<Clyybber> Huh
21:52:32disruptekwell, it's ast w/o a :type and i'm assuming if it has typ, it's an easy fix.
21:52:53disrupteki haven't tried to rewrite it myself in the macro.
21:52:59FromDiscord<Clyybber> yeah, should be relatively easy (probably)
21:53:08disrupteki agree.
21:53:20disruptekwe could just lift it, but i think the compiler should do it for us.
21:53:25FromDiscord<Clyybber> I'll get to it in a bit
21:54:20disruptekcool, thanks.
22:02:16disrupteklooks like ic is about to be merged.
22:09:11FromDiscord<Clyybber> neat
22:10:19*Vladar quit (Quit: Leaving)
22:13:18*xet7 quit (Remote host closed the connection)
22:23:10disrupteknimph rebuilds in 11s on ic and 17s w/o ic.
22:23:45disruptekoh wait, 10s w/o ic. hmm.
22:25:10disruptekyeah, no change in speed i guess.
22:25:13*PMunch joined #nim
22:25:16*natrys quit (Ping timeout: 246 seconds)
22:27:59disruptektestes is 0.10s to 0.15s slower under ic. changing a line and recompiling is 2x slower with ic than without.
22:28:41FromDiscord<Avatarfighter> It would be nice to see how IC affects much bigger projects
22:28:59disruptekmuch bigger than 550,000 lines?
22:29:16FromDiscord<Avatarfighter> well, I meant more other big projects
22:29:30FromDiscord<Avatarfighter> just to see if there is a change in compilation speeds
22:29:35FromDiscord<Avatarfighter> (edit) "just to see if there is a ... change" added "net"
22:30:03FromDiscord<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:22disruptektestes is 70k lines, nimph is 553k.
22:30:27FromDiscord<Avatarfighter> yeah
22:31:05disruptektestes is ~0.55s w/o ic, with gc:arc and danger. 0.65-70s with ic, gc:arc, danger.
22:31:30FromDiscord<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:35disrupteknimp's c output is 46mb, the object files total 19mb, the rod (ic) totals 218mb.
22:33:41disrupteknimph, too.
22:37:16disruptekokay, i got it to go faster.
22:37:51disrupteki 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:55disruptekic uses ~10% more memory, but it's clearly faster for some scenarios. the memory usage will improve, as will the speed.
22:41:04FromDiscord<Avatarfighter> Oh that's good I kind of feared IC was slower overall than before ngl
22:41:05disruptekcompression would help. 218mb->17mb with gz.
22:41:49*natrys quit (Client Quit)
22:43:07disruptekthe compiler builds faster without it, too. so far, i'm not impressed.
23:06:51PMunchHow's everyone doing so far in 2021?
23:08:16FromDiscord<ElegantBeef> It's a new year so there has to be a new rampant disease to take over right?
23:10:01PMunchWell I mean we have the new strains going around
23:10:04PMunchThose seem fun
23:10:21PMunchBut disease is so passรฉ, we need something new for 2021
23:10:55FromDiscord<fwsgonzo> is it possible to call a varargs C function?
23:11:03FromDiscord<ElegantBeef> `{.varargs.}`
23:11:33FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma
23:12:04*Juno[m] joined #nim
23:12:47PMunchBy the way, anyone else than me who have submitted a talk folk the virtual FOSDEM this year?
23:13:50FromDiscord<ElegantBeef> Jeez you butchered that sentence, and that's coming from me
23:14:02FromDiscord<fwsgonzo> thanks
23:14:13PMunchGive me a break, I'm recovering from Christmas/New years :P
23:14:22FromDiscord<lqdev> disruptek: is IC ready for some initial testing? i could try it on my projects
23:14:31PMunchAnd I haven't really spoken/written english for weeks at this poit
23:14:40FromDiscord<fwsgonzo> I think I give up - the best way to continue is to send and receive a serialized blob instead
23:15:21PMunch@fwsgonzo, what are you trying to do?
23:15:23disrupteklqdev: yes, try the araq/araq-ic5 branch.
23:15:35disruptekto use it, pass --incremental:on.
23:15:37FromDiscord<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:11PMunchHmm, not quite sure I understand
23:16:28FromDiscord<lqdev> disruptek: on latest devel?
23:16:40disruptekno, the araq/araq-ic5 branch.
23:16:43FromDiscord<ElegantBeef> Disruptek told you which branch
23:16:46FromDiscord<lqdev> kay
23:16:50FromDiscord<lqdev> will try tommorow
23:17:05disruptekand don't blame me for the performance. araq threw out most of my code.
23:17:06FromDiscord<lqdev> @ElegantBeef ah didn't see it
23:17:08FromDiscord<fwsgonzo> does the frozen serialization thing work on any object?
23:17:13disruptekyes.
23:17:24FromDiscord<fwsgonzo> can I serialize to stack?
23:17:27disruptekyes.
23:17:39FromDiscord<fwsgonzo> alright, thatll do it
23:18:00disruptekwe don't yet raise if you try to serialize something stupid.
23:18:31disrupteki will probably add that for v1.0 when i reorder the api arguments for better `with` support.
23:18:33FromDiscord<dom96> ouch, if IC turns out to be slower than non-IC then that will be quite a let down
23:19:16disrupteki'm so glad i don't care.
23:19:40disruptekit would be really sad to put a ton of work into something that actually mattered and then have it be so marginal.
23:23:00FromDiscord<fwsgonzo> nimble install frosty?
23:23:27disruptekmaybe?
23:23:34disruptekdo you have access to the README.md?
23:23:58FromDiscord<fwsgonzo> yes checked the .nimble too, and `nimble search frosty` shows nothing
23:24:09disruptekwhat does the README say about Installation?
23:24:24FromDiscord<fwsgonzo> right, a github repo link
23:24:30disruptekah, neat.
23:24:32FromDiscord<ElegantBeef> Disruptek doesnt use the nimble repository since he's too cool for it
23:24:45disrupteknimble is for fools.
23:24:48FromDiscord<ElegantBeef> Like so cool he made frosty
23:24:52FromDiscord<ElegantBeef> The registry isnt
23:26:22disruptekscramper just pointed out that github has 3500 more nim repos than nimble.
23:26:34FromDiscord<fwsgonzo> how common is import os?
23:26:47FromDiscord<ElegantBeef> well it should be `std/os` but fairly common ๐Ÿ˜„
23:27:09FromDiscord<fwsgonzo> guess im pretending its linux ๐Ÿ™‚
23:27:10FromDiscord<ElegantBeef> I dont see how that is a good argument for not adding to a central repository
23:27:24disrupteki already explained my reasons once this year.
23:28:17FromDiscord<ElegantBeef> What was your suggested fix?
23:28:18disruptekif it helps you, feel free to add frosty to any registry you want.
23:28:49disruptekhttps://github.com/nim-lang/nimble/pull/728
23:28:51disbotโžฅ useful git commit messages during publish ; snippet at 12https://play.nim-lang.org/#ix=2fCa
23:32:13FromDiscord<ElegantBeef> This is sincerely your only issue with the registry?
23:32:57disruptekno, it's a stupid idea for other reasons.
23:33:44disrupteki 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:49FromDiscord<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:59disruptekby N do you mean, 1?
23:34:12disruptekthis is you reason for supporting shitty software?
23:34:25FromDiscord<ElegantBeef> Github, gitlab, src.ht, i've seen repos on nimble link to all of them
23:34:30disruptekit's literally garbage.
23:34:33FromDiscord<ElegantBeef> It doesnt matter your view on Nimble the software
23:34:35disruptekURLs work fine.
23:34:42FromDiscord<ElegantBeef> What's wrong with the god damn repository
23:34:47disruptekwhat's wrong with you?
23:34:52disruptekwhy do you care so much?
23:35:11FromDiscord<ElegantBeef> Cause i'm interested in why you avoid the repository with the excuse "software bad"
23:35:31disrupteki already explained it.
23:36:04disruptekif 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:07disruptek!repo nimph
23:36:08disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future ๐Ÿงš 15 91โญ 5๐Ÿด 7& 1 more...
23:36:24disruptekif that's not enough for you...
23:36:29disruptekshit man, i don't know what to tell you.
23:36:35FromDiscord<ElegantBeef> Again i dont care about the package manager
23:36:41disruptekcool, bro.
23:36:45FromDiscord<ElegantBeef> A central repository is all we're talking about
23:36:55disruptekyeah, it's dumb.
23:37:12FromDiscord<ElegantBeef> You make such a compelling argument i've converted
23:37:16disruptekgood.
23:38:15FromDiscord<haxscramper> I think someone just needs to add these ten lines of json diff to registry
23:38:31FromDiscord<haxscramper> Just for people to start annoying disruptek
23:38:50disruptekthat started long ago.
23:39:10disrupteki was born annoyed and it just went downhill from there.
23:41:34disruptekmy dist repo is the same idea implemented in a better way.
23:41:38disruptek!repo disruptek/dist
23:41:39disbothttps://github.com/disruptek/dist -- 9dist: 11a nim distribution ๐Ÿ‘‘ 15 6โญ 0๐Ÿด
23:43:24planetis[m]if you need a unique string/id each time an app is run, what would you use guys?
23:43:37FromDiscord<fwsgonzo> UUID perhaps?
23:43:43planetis[m]oids?
23:43:44disruptekstd/monotimes
23:52:15planetis[m]thanks