00:04:25 | * | l1x quit (Quit: Connection closed for inactivity) |
00:23:24 | FromDiscord | <ajusa> what's the one package that has metaprogramming through interpolation? I remember seeing it somewhere here... |
00:24:29 | FromDiscord | <Elegantbeef> What? |
00:25:47 | FromDiscord | <Elegantbeef> https://github.com/geekrelief/genit perhaps? |
00:26:41 | * | jmdaemon quit (Ping timeout: 256 seconds) |
00:27:25 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Ou8 |
00:28:38 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Ou9 |
00:29:05 | FromDiscord | <Elegantbeef> A template wont be able to do this, a macro can |
00:29:05 | FromDiscord | <ajusa> can this be done with varargs[typed], as I expect everything to be strings? Or would it have to be varargs[untyped] and using a macro |
00:32:16 | FromDiscord | <Elegantbeef> Well the template cant do much with that ast |
00:32:41 | FromDiscord | <Elegantbeef> Remember templates dont have introspective capabillities they are 100% take this AST and paste it here |
00:33:24 | FromDiscord | <ajusa> right, I was hoping that they could iterate over the arguments that were passed in somehow |
00:33:38 | FromDiscord | <Elegantbeef> They are not that smart |
00:33:47 | FromDiscord | <Elegantbeef> They legitimately are just code subsitution |
00:35:46 | * | jmdaemon joined #nim |
00:36:06 | FromDiscord | <Elegantbeef> It's not that complicated |
00:36:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Oub |
00:36:16 | * | vicfred quit (Quit: Leaving) |
00:36:51 | * | noeontheend joined #nim |
00:42:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
01:03:45 | FromDiscord | <ajusa> thanks for the code sample! I'll build off of this 😄 |
01:04:20 | FromDiscord | <ajusa> also beef do you prefer old concepts or new concepts, I remember you had an opinion |
01:04:47 | FromDiscord | <Elegantbeef> Old concepts are more flexible but rely on "does compile" so are slower |
01:26:14 | * | krux02 quit (Remote host closed the connection) |
01:28:27 | * | jmdaemon quit (Ping timeout: 256 seconds) |
01:30:22 | * | jmdaemon joined #nim |
01:41:17 | * | jmdaemon quit (Ping timeout: 240 seconds) |
01:44:03 | * | jmdaemon joined #nim |
01:45:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:48:57 | * | jmdaemon quit (Ping timeout: 240 seconds) |
01:59:13 | * | jmdaemon joined #nim |
01:59:21 | * | noeontheend joined #nim |
02:07:17 | * | jmdaemon quit (Ping timeout: 240 seconds) |
02:21:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
02:41:02 | NimEventer | New Nimble package! tradingview - TradingView client, see https://github.com/juancarlospaco/tradingview |
02:48:14 | * | jmdaemon joined #nim |
03:06:29 | * | jmdaemon quit (Ping timeout: 256 seconds) |
03:08:06 | FromDiscord | <gcao> hi, if in my main thread, I call runForever(), and then I receive some message which trigger a callback. From my callback is there a grace way to end runForever()? |
03:10:57 | FromDiscord | <jsef5> ok, going to write a compression alg in nim |
03:19:20 | FromDiscord | <michaelb> In reply to @gcao "hi, if in my": are you using std/asyncdispatch or nim-chronos? |
03:20:54 | FromDiscord | <gcao> asyncdispatch |
03:26:49 | FromDiscord | <michaelb> I'm not sure if it works the same or as well with asyncdispatch vs. chronos, but you could have a threadvar or maybe a global atomic, and do `while foo: poll()` |
03:27:09 | FromDiscord | <michaelb> in chronos that works well, i.e. doesn't turn into a hot loop driving up cpu usage |
03:27:54 | FromDiscord | <michaelb> I did something like that here: https://github.com/status-im/nim-status/blob/master/examples/client.nim#L22-L23 |
03:27:59 | FromDiscord | <michaelb> (with chronos) |
03:29:59 | FromDiscord | <michaelb> eh, `poll` in asyncdispatch does seem to work differently, e.g. in the docs says `Raises ValueError if there are no pending operations` |
03:33:07 | FromDiscord | <evoalg> if I have a file "myfile.json" that contains `{"foo": [[1, 2, 3], [4, 5, 6]]}` I know how to read this in as a "dict" in python, ie I'd do `import json; d = json.loads(open("myfile.json").read())`, but in Nim to read it into a table, would I just use `parseJson` from std/json? |
03:33:40 | FromDiscord | <Elegantbeef> if you just want to use it as a table yes you would |
03:34:09 | FromDiscord | <evoalg> yea I don't want to do anything else with json at the moment ... thank you beefy! |
03:35:34 | FromDiscord | <gcao> In reply to @brainproxy "(with chronos)": Thank you. I'll take a look at your code and also see how runForever is implemented. maybe I can write a custom runForever which can exit on demand |
03:35:59 | FromDiscord | <ajusa> is there a way to distinguish between when a template/proc is called for assignment or for something else? Eg |
03:36:18 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3OuE |
03:41:04 | FromDiscord | <ajusa> you know the more I think about it the more I feel like replicating Karax using mostly templates is probably near impossible, the existing macro just does a lot for code gen |
03:43:10 | * | jmdaemon joined #nim |
03:44:47 | FromDiscord | <Elegantbeef> I mean you can do similar stuff i think |
03:45:03 | FromDiscord | <Elegantbeef> But nothing will be as nice as a macro i think |
03:46:54 | FromDiscord | <ajusa> can you expand a little on the similar stuff? just want to figure out how doable it would be before I decide what I want to do |
03:47:21 | FromDiscord | <Elegantbeef> Well what are you after the `call(a = b, = c)`? |
03:47:38 | FromDiscord | <Elegantbeef> `call({"a": "b", "c" : "d"}` could work |
03:47:45 | * | noeontheend joined #nim |
03:48:37 | FromDiscord | <ajusa> I'm asking about the assignment thing here -> can I run different code for when a proc is used and assigned to a variable vs when it isn't |
03:48:55 | FromDiscord | <ajusa> I was seeing how doable it would be to create an HTML DSL using something like https://github.com/treeform/fidget/blob/master/src/fidget.nim#L85-L133 |
03:50:35 | FromDiscord | <Elegantbeef> You dont know if you're in a proc or not |
03:50:41 | FromDiscord | <Elegantbeef> I mean in assignment or not |
03:51:57 | FromDiscord | <ajusa> yeah I thought maybe I could try and distinguish based on whether the proc is returning, like if it returns a string vs when it isn't returning a string. that doesn't work though, the Nim compiler warns about it |
03:52:18 | FromDiscord | <ajusa> really what I want to do is run one bit of code when the value I return is being discarded, and a different bit of code when it isn't |
03:52:22 | FromDiscord | <Elegantbeef> you could make an `asgnTemplateName(a, args)` |
03:53:33 | FromDiscord | <ajusa> In reply to @Elegantbeef "you could make an": oh, that's a pretty good idea actually |
03:59:22 | FromDiscord | <evoalg> Sorry I'm a bit confused ... so when I do `var t = parseJson(readFile("myfile.json"))` it's a "JsonNode" type, and I'm wondering how it'd get it into a table (eg Table[string, seq[seq[int], seq[int]]] ... or arrays instead of seqs)? |
03:59:41 | FromDiscord | <Elegantbeef> there is `to` you can give it a type |
04:00:59 | FromDiscord | <evoalg> thank you! - I've now found `to` is the docs |
04:03:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OuH |
04:06:23 | FromDiscord | <evoalg> ohhh lol thank you beefy \:D \:D |
04:08:32 | FromDiscord | <evoalg> gosh that's more simple and clean than I thought |
04:09:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OuI |
04:11:11 | FromDiscord | <evoalg> ahhh nice ... but `foo: seq[seq[int]]` \<\< it doesn't know that foo is "foo" does it?? |
04:12:40 | FromDiscord | <Elegantbeef> It knows it's `foo` |
04:13:14 | FromDiscord | <evoalg> even though the string might be "bar" it'll still grab mySeq? |
04:13:28 | FromDiscord | <Elegantbeef> well`"foo" -> foo` |
04:13:36 | FromDiscord | <Elegantbeef> It'll only grab it if the name is the same |
04:15:01 | FromDiscord | <evoalg> then I'm missing something with types ... I suppose I've been avoiding using them ... so the `foo` in `foo: seq[seq[int]]` really means `"foo"` ie a string ? |
04:16:00 | FromDiscord | <Elegantbeef> nah it's a field name |
04:16:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
04:16:22 | FromDiscord | <Elegantbeef> the json just uses field names on parse |
04:16:22 | FromDiscord | <Elegantbeef> the field name needs to match the json data or a hook is needed |
04:16:23 | FromDiscord | <evoalg> so that fieldname might have been called `bar` for a laugh and it'd still work? |
04:16:23 | FromDiscord | <Elegantbeef> Nope |
04:16:32 | FromDiscord | <Elegantbeef> Dont recall if it has custom name support |
04:17:25 | FromDiscord | <evoalg> ohhh so the field name has to match the json stringy thing? |
04:17:56 | FromDiscord | <evoalg> (it looks like a string, but it might be a json thing that looks like a string?) |
04:18:25 | FromDiscord | <Elegantbeef> It's a string |
04:18:35 | FromDiscord | <evoalg> ok |
04:18:43 | FromDiscord | <Elegantbeef> In this case yes the field needs to match the key in the json |
04:19:29 | FromDiscord | <evoalg> I know the field name so that will work ... I'll have a play ... thank you for teaching me so patiently beefy |
04:21:18 | FromDiscord | <Elegantbeef> No problem |
04:28:34 | * | arkurious quit (Quit: Leaving) |
04:34:19 | * | rockcavera quit (Ping timeout: 256 seconds) |
07:01:47 | FromDiscord | <mratsim> In reply to @keks "Is there a way": https://github.com/mratsim/constantine/blob/50717d8de6715647320fb69935bf8926b5769f95/helpers/static_for.nim#L22 |
07:04:15 | FromDiscord | <Elegantbeef> Guess that'd be a more general solution |
07:04:31 | FromDiscord | <Elegantbeef> Any reason you didnt use `range: static Slice[int]` |
07:05:18 | NimEventer | New Nimble package! sbttl - read & write subtitle files with sbttl, see https://github.com/hamidb80/sbttl |
07:22:32 | * | jjido joined #nim |
07:25:52 | * | oz quit (*.net *.split) |
07:25:52 | * | blackbeard420 quit (*.net *.split) |
07:25:52 | * | kayabaNerve quit (*.net *.split) |
07:25:52 | * | FromDiscord quit (*.net *.split) |
07:25:52 | * | mahlon quit (*.net *.split) |
07:25:52 | * | syl quit (*.net *.split) |
07:25:52 | * | drewr quit (*.net *.split) |
07:25:52 | * | [R] quit (*.net *.split) |
07:25:52 | * | def- quit (*.net *.split) |
07:25:52 | * | tinystoat quit (*.net *.split) |
07:25:52 | * | flynn quit (*.net *.split) |
07:26:31 | * | Gustavo6046 joined #nim |
07:28:06 | * | blackbeard420 joined #nim |
07:28:06 | * | kayabaNerve joined #nim |
07:28:06 | * | FromDiscord joined #nim |
07:28:06 | * | mahlon joined #nim |
07:28:06 | * | syl joined #nim |
07:28:06 | * | drewr joined #nim |
07:28:06 | * | [R] joined #nim |
07:28:06 | * | def- joined #nim |
07:28:06 | * | tinystoat joined #nim |
07:28:06 | * | flynn joined #nim |
07:28:06 | * | oz joined #nim |
07:41:02 | FromDiscord | <mratsim> In reply to @Elegantbeef "Any reason you didnt": range is a reserved keyword 😉 |
07:50:32 | FromDiscord | <Elegantbeef> sure but i more meant instead of two ints |
07:52:56 | nrds | <Prestige99> |
07:53:21 | FromDiscord | <Elegantbeef> I was thinking the same thing |
07:56:56 | FromDiscord | <mratsim> In reply to @Elegantbeef "sure but i more": because it's an internal proc and Slice introduces extra overhead on an already compile-time heavy library |
08:24:54 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:27:32 | * | Vladar joined #nim |
08:46:56 | FromDiscord | <Evrensel Kişilik> i received my 2K monitor |
08:47:00 | FromDiscord | <Evrensel Kişilik> yay |
08:47:01 | FromDiscord | <Evrensel Kişilik> buuuuuuuuut |
08:47:30 | FromDiscord | <Evrensel Kişilik> i can't use 144Hz and G-Sync with damn HDMI cable |
08:47:31 | FromDiscord | <Evrensel Kişilik> 😦 |
08:48:11 | FromDiscord | <Evrensel Kişilik> and my GPU is not good for playing games in 2K |
08:48:23 | FromDiscord | <Evrensel Kişilik> damn RTX 2060 is poor xD |
08:48:34 | FromDiscord | <enthus1ast> good more time for hacking \:) |
08:49:00 | FromDiscord | <Evrensel Kişilik> In reply to @enthus1ast "good more time for": let's hack the monitor |
08:50:29 | FromDiscord | <Phil> Okay, fresh day, I'm fresh attempt to think about my circular dependency problem and if I can solve it with an event system |
08:50:37 | FromDiscord | <Phil> (edit) removed "I'm" |
08:51:06 | FromDiscord | <enthus1ast> must work ;\_; |
08:51:14 | FromDiscord | <Elegantbeef> What's the circular dependency? |
08:51:26 | * | PMunch joined #nim |
08:51:28 | FromDiscord | <Phil> sent a long message, see http://ix.io/3Ovs |
08:51:45 | FromDiscord | <Phil> That is the entire reason I went on this verbal vomit last time I wrote |
08:51:50 | FromDiscord | <Elegantbeef> Could delay imports work? |
08:52:07 | FromDiscord | <Elegantbeef> Is the code hosted somewhere? |
08:52:24 | FromDiscord | <Phil> It is, but not in the simplified version I described here |
08:53:29 | FromDiscord | <Elegantbeef> Well you might be able to delay imports for this |
08:53:56 | FromDiscord | <Elegantbeef> Do any of the procs that signal calls from generic repository go back to signal? |
08:54:03 | FromDiscord | <Phil> One sec, hosted as in you wanted to take a look at it on github, not hosted as in there's some strange way to async import code over the internet |
08:54:13 | FromDiscord | <Phil> right? |
08:54:27 | FromDiscord | <Elegantbeef> Yes |
08:54:33 | FromDiscord | <Phil> Phew |
08:54:43 | FromDiscord | <Phil> Okay, and yes some of them do |
08:54:50 | FromDiscord | <Phil> Example, I have a search table and a creature table |
08:55:01 | * | jjido joined #nim |
08:55:06 | FromDiscord | <Phil> if you create a creature, that shall cause a follow up action of creating an entry in the search table |
08:55:41 | FromDiscord | <Phil> creating both of those entries uses the same `createEntry` proc |
08:56:13 | FromDiscord | <Elegantbeef> Give me the code and i'll give you the world |
08:56:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OvE |
08:56:52 | FromDiscord | <Phil> The general repo:↵https://github.com/PhilippMDoerner/NimStoryFont↵Give me a second and I'll get the link for the specific files |
08:57:35 | FromDiscord | <Elegantbeef> Just tell me how i get the circlular error |
08:58:16 | NimEventer | New thread by Drkameleon: Weird issue with ints in web (js) builds, see https://forum.nim-lang.org/t/8862 |
09:01:09 | FromDiscord | <Phil> sent a long message, see https://paste.rs/5wC |
09:01:36 | FromDiscord | <Phil> (edit) "https://paste.rs/fTE" => "http://ix.io/3OvG" |
09:02:59 | FromDiscord | <Phil> Didn't even write any code yet into searchSignals, just the import since that'll be needed |
09:03:46 | FromDiscord | <Phil> (edit) "needed" => "needed. Actually, searchSignals as well will have an import of genericArticleRepository as the procs in there need to write to a table in the database" |
09:05:45 | FromDiscord | <Elegantbeef> So basically if you remove the import of `genericAriticleRepository` you dont get the issue |
09:06:15 | FromDiscord | <Elegantbeef> line 1 of `campaignRepository` = `import ../core/databaseRead` |
09:07:16 | FromDiscord | <Phil> You can view databaseRead, databaseWrite and genericArticleRepository as one unit really. GenericArticleRepository is currently just a convenience module so you only have to import one thing instead of two |
09:07:30 | FromDiscord | <Phil> (edit) "one thing instead of two" => "that as opposed to databaseRead and databaseWrite" |
09:07:43 | FromDiscord | <Elegantbeef> > You can view databaseRead, databaseWrite and genericArticleRepository as one unit |
09:07:57 | FromDiscord | <Elegantbeef> If they're considered a single unit why are they seperated |
09:08:22 | FromDiscord | <Phil> That was one approach I tried out yesterday, because I believed I might only need read access |
09:08:50 | FromDiscord | <Elegantbeef> I mean eitherway, just dont use the `genericArticleRepository` in your project |
09:09:35 | FromDiscord | <Phil> You mean no central "one module defines all procs that access the database" approach? |
09:09:50 | FromDiscord | <Elegantbeef> I mean you can use that for others just not your internal stuff |
09:10:41 | FromDiscord | <Phil> But that means code duplication since I don't really need anything outside of what's in genericArticleRepository |
09:11:18 | FromDiscord | <Elegantbeef> I dont know what you mean |
09:12:19 | FromDiscord | <Elegantbeef> To solve your issue with `typetraits` add `bind genericParams` into `getRelatedFieldNameOn` |
09:13:22 | FromDiscord | <Phil> one sec, I restored the project to the way it was before I did the split. |
09:14:12 | FromDiscord | <Elegantbeef> I dont know it's hard to say what to fix with this stuff |
09:14:23 | * | krux02 joined #nim |
09:15:19 | FromDiscord | <Phil> In reply to @Elegantbeef "I mean you can": I think my main issue is that my procs that insert/update/create are coupled to my "signal" procs |
09:16:20 | FromDiscord | <Phil> Which starts what fundamentally is a "createEntry" --> "preCreateSignal" --> (possibly) "createEntry" call stuff |
09:16:32 | FromDiscord | <Phil> (edit) "Which starts what fundamentally is a "createEntry" --> "preCreateSignal" --> (possibly) "createEntry" ... call" added "--> "preCreateSignal"" |
09:17:11 | FromDiscord | <Phil> Where creating an entry triggers a signal proc that might be creating another entry which again triggers a signal proc that again might be creating/updating/deleting another entry etc. etc. |
09:18:08 | FromDiscord | <Phil> In a proper event system my insert/update/create procs (and the entire module) would have no knowledge of any of that, they'd just push events to a queue somewhere that is accessed from independent modules... I think that's how it works anyway |
09:18:21 | FromDiscord | <Phil> (edit) "In a proper event system my insert/update/create procs (and the entire module) would have no knowledge of any of that, they'd just push events to a ... queue" added "global" |
09:19:20 | FromDiscord | <Elegantbeef> I cannot say much aside from i can remove the recursive dependency easily |
09:20:10 | FromDiscord | <Phil> Yeah but then the signal procs I'll write in the future will need their on procs to insert stuff into the database when I already have procs that do that for me |
09:20:25 | FromDiscord | <Phil> (edit) "Yeah but then the signal procs I'll write in the future will need their on procs to insert stuff into the database when I already have procs that ... do" added "could" |
09:21:29 | FromDiscord | <Phil> (edit) "Yeah but then the signal procs I'll write in the future will need their on procs to insert stuff into the database when I already have procs that could do that for me ... " added "(in genericArticleRepository)" |
09:22:11 | FromDiscord | <enthus1ast> you could maybe add callbacks to the database procs |
09:22:11 | FromDiscord | <Elegantbeef> Give me some actual code that shows the issue, and i'll happily help try to make it work, afaict right now the issue is purely you wanting a specific file |
09:22:11 | FromDiscord | <Elegantbeef> Removing that intermediate file and fixing the other code means it presently imports like 5 modules and exports them |
09:22:47 | FromDiscord | <Elegantbeef> Ok here we go you plan on calling procedures inside of the generic article |
09:23:08 | FromDiscord | <Elegantbeef> Can you write some place holders and pipe them so i can actually see the problem and not the "problem" 😀 |
09:23:50 | FromDiscord | <Phil> Yeah, I think calling the procs inside of the generic article might be the bad idea that's killing me. |
09:24:02 | FromDiscord | <Phil> But on it, just give me a couple minutes to revert my prior bad attempts |
09:24:44 | FromDiscord | <Elegantbeef> Here is my diff if curious |
09:24:45 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OvJ |
09:25:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:26:13 | FromDiscord | <Phil> I think I really have to apologize for not having cleared up that entire mess that was the split of genericArticleRepository into databaseRead and databaseWrite |
09:26:21 | FromDiscord | <Phil> (edit) "I think I really have to apologize for not having cleared up that entire mess that was the split of genericArticleRepository into databaseRead and databaseWrite ... " added "before asking my question" |
09:26:39 | FromDiscord | <Elegantbeef> Eh more important is just an example of the actual code and not this inane issue 😀 |
09:27:25 | FromDiscord | <Elegantbeef> Like yes this causes a circ dep, but my fix works and the code still compiles so it's very difficult to give any suggestion |
09:27:45 | FromDiscord | <Elegantbeef> I say it compiles but there is a sqlite issue |
09:30:17 | FromDiscord | <Elegantbeef> Oh wait fixing those does present a proper circ issue it seems |
09:31:20 | FromDiscord | <Phil> I'm not that fast at writing the proper example XD |
09:34:43 | FromDiscord | <Elegantbeef> Which procedure would call a signal inside `dataBaseWrite`? |
09:38:35 | FromDiscord | <Phil> All procs call a signal inside database write. Effectively, the second you see a "when compiles", that's my hook for calling stuff |
09:38:53 | FromDiscord | <Phil> (edit) "stuff" => "a signal proc" |
09:39:53 | FromDiscord | <Elegantbeef> Ok so then this is a proper unsolvable circular dependancy without the abillity to use delayed imports to get around it |
09:40:40 | FromDiscord | <Phil> Okay, pushed the example |
09:40:49 | FromDiscord | <Phil> In the current version of the repo I rolled back around 3-4 commits |
09:41:04 | FromDiscord | <Phil> Because those were the ones where I split genericArticleRepository into databaseRead and databaseWrite |
09:41:09 | FromDiscord | <Phil> It's all just in genericArticleRepository now |
09:42:33 | FromDiscord | <Phil> The example goes:↵genericArticleRepository imports searchSignals (add a search entry after an article type model, e.g. Creature or Character, were created)↵searchSignals imports searchRepository (has the actual proc to enter a search entry into the search table)↵searchRepository imports genericArticleRepository (has the helper procs for the db interaction) |
09:43:11 | FromDiscord | <Clonkk> Is initializing a string with `collect(newSeq)` valid for non-orc gc ? |
09:44:57 | FromDiscord | <Elegantbeef> If it compiles it's valid 😀 |
09:45:31 | FromDiscord | <Clonkk> I thought so, but I get a weird segmentation faults without --gc\:orc that seems to be cause by a string allocation according to the stacktrace |
09:45:49 | FromDiscord | <Elegantbeef> Using `newSeq` is a bit weird, cant you use `newString`? |
09:46:11 | FromDiscord | <Clonkk> Not my code \:), there's some string interpolation shenanigans going on |
09:46:47 | FromDiscord | <Elegantbeef> This is proper recursive so yea i'll say you need to change how this works sadly |
09:47:53 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3NJg i was thinking the issue was more like this |
09:48:39 | FromDiscord | <Phil> It's a mystery to me on how on earth Django does it |
09:51:32 | FromDiscord | <Phil> Because in Django signals happen in sync, an HTTP call just does not get a response until the original "insert"-call has finished AND all of that signals that insert call triggers |
09:51:49 | FromDiscord | <Phil> (edit) "that" => "the" |
09:56:22 | FromDiscord | <Phil> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=3NJg i was thinking": I I think this way I might solve some of my issues |
09:56:37 | FromDiscord | <Phil> But only special cases, not all of them |
09:56:56 | FromDiscord | <Phil> (edit) "cases," => "cases where I actually have to circumvent the genericArticleRepository (e.g. when inserting into a view)," |
09:58:00 | FromDiscord | <Elegantbeef> Well the procedure you're calling from a module relies on the module calling it |
09:58:07 | FromDiscord | <Elegantbeef> That's just a no go in NIm |
09:58:22 | FromDiscord | <Elegantbeef> You either need to make the type in a different file, or change the logic |
09:59:27 | FromDiscord | <Elegantbeef> Atleast it seemed the imports were purely do to types, i could be wrong |
10:00:22 | FromDiscord | <Phil> Nah, the logic is the actual problem as you said |
10:00:45 | FromDiscord | <Phil> I can't have a createEntry proc call a signal proc that in turn calls the createEntry proc again, that's just circular dependency |
10:04:10 | FromDiscord | <Phil> I think an event system would be the solution simply because the way Django calls its crap (dispatcher, receiver etc.) is very much reminiscent of a pub-sub event thing.↵But how that solves this type of circular dependency I don't know |
10:05:21 | FromDiscord | <Elegantbeef> Well you subscribe events so there is no recursive you call an event which then calls the procedure you subscribed |
10:19:45 | * | jmdaemon quit (Ping timeout: 256 seconds) |
10:21:46 | FromDiscord | <yumi> hmmm how can I include some variables from a config file? |
10:21:49 | FromDiscord | <yumi> in a script |
10:23:45 | FromDiscord | <yumi> without compiling the file |
10:24:34 | FromDiscord | <yumi> lemme try parsecfg |
10:37:51 | FromDiscord | <Phil> Sidenote, PR is open |
10:41:41 | FromDiscord | <haolian9 (高浩亮)> hi all, is there a function equivalent to `sendfile(2)` in nim? i even tried to grep in source of nim, but no lucky |
10:44:40 | FromDiscord | <Clonkk> Not that I know of, but there is FileStream (https://nim-lang.org/docs/streams.html#openFileStream%2Cstring%2CFileMode%2Cint) that should make it to implement I guess |
10:48:45 | FromDiscord | <haolian9 (高浩亮)> thanks, the `stream` keyword inspired me, and then i found this project\: https://github.com/status-im/nim-faststreams |
11:24:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Owc |
11:26:00 | FromDiscord | <Phil> Is pp an on the fly defined proc signature that you then cast a proc pointer `pcb` to? |
11:29:46 | FromDiscord | <Rika> Yes then it calls that proc with ev |
11:30:10 | FromDiscord | <Phil> What is the {.nimcall.} pragma doing there? Is that for readability purposes or does that actually do something? |
11:31:13 | FromDiscord | <Rika> I don't recall what exactly it does but otherwise it would error |
11:32:13 | FromDiscord | <Phil> In the docs it just says:↵> is the default convention used for a Nim proc. It is the same as fastcall, but only for C compilers that support fastcall.↵But that look more like something for decorative purposes |
11:32:37 | FromDiscord | <Rika> No, calling conventions are important |
11:33:14 | FromDiscord | <Rika> I don't remember what it defaults to if the pragma was not there but I think it mismatches with the stored proc calling convention |
11:40:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Owg |
11:41:05 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3Owg" => "https://play.nim-lang.org/#ix=3Owh" |
11:41:53 | * | jjido joined #nim |
11:41:58 | FromDiscord | <Rika> Yeah |
12:08:14 | FromDiscord | <planetis> nimcall means it's not a closure |
12:08:23 | FromDiscord | <planetis> which is the default |
12:34:44 | * | Vladar quit (Remote host closed the connection) |
12:51:14 | NimEventer | New thread by Xigoi: Weird issue with Nimble installation, see https://forum.nim-lang.org/t/8864 |
12:55:53 | FromDiscord | <rishavs (Rishav Sharan)> sent a code paste, see https://play.nim-lang.org/#ix=3Owu |
12:55:54 | FromDiscord | <Rika> Oh yeah that's true I don't know why I thought it was a closure and dismissed the idea that it isn't ("since it is") |
12:56:19 | FromDiscord | <Rika> In reply to @rishavs (Rishav Sharan) "What is a simple": Do you really want it to be "nilable" or do you want option types |
12:56:39 | FromDiscord | <rishav> nilable is better. I don't want to use Options for this |
12:56:41 | FromDiscord | <Rika> There are option types in Nim that don't lead to segfaults like nil could |
12:57:02 | FromDiscord | <Rika> Why? Nonetheless if you want nil it has to be either a ref or a ptr type |
12:57:50 | FromDiscord | <rishav> Hmm... Essentially this is an object I will be using in a lot of functionas. I want to start with a nil value in the attgribute. and as I finish coding, change it all to duration type |
12:58:36 | FromDiscord | <Rika> Use options. There's no real reason to not from what I can see... |
12:59:36 | FromDiscord | <mratsim> In reply to @rishavs (Rishav Sharan) "What is a simple": Option |
13:00:19 | FromDiscord | <mratsim> In reply to @rishav "nilable is better. I": You can't nil a value type, they don't have pointer indirection |
13:11:34 | FromDiscord | <rishav> Thanks |
13:18:17 | * | rockcavera joined #nim |
13:18:17 | * | rockcavera quit (Changing host) |
13:18:17 | * | rockcavera joined #nim |
13:25:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OwE |
13:57:43 | FromDiscord | <eyecon> @KatrinaKitten is there a way in honeycomb to indicate "the parsing must end here"? I am currently checking if the tail is empty. |
14:13:44 | * | noeontheend joined #nim |
14:14:24 | FromDiscord | <Phil> Can you do sort of a compile time switch case? |
14:16:03 | PMunch | Yes |
14:23:26 | FromDiscord | <Phil> sent a long message, see http://ix.io/3OwU |
14:23:49 | FromDiscord | <Phil> I'd just like switch case because it forces you to cover all variations of an enum, it enforces "correctness" a bit better |
14:27:21 | FromDiscord | <hethir> What's the nim way to store a `void` for user data? Is there a "safe" way to do that? |
14:28:06 | FromDiscord | <enthus1ast> just pointer |
14:31:32 | Amun-Ra | Phil: when + if(s) + else |
14:32:47 | FromDiscord | <Phil> In reply to @Amun-Ra "<@180601887916163073>: when + if(s)": So the "when" way is the only way to to that sort of template? 😢 |
14:33:17 | FromDiscord | <Phil> Well, when + elif |
14:33:59 | FromDiscord | <Phil> (edit) "to" => "do" |
14:35:35 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:38:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
14:44:06 | * | arkurious joined #nim |
14:44:19 | PMunch | @hethir, store `void` for user data? |
14:44:24 | PMunch | What does that even mean |
14:45:26 | FromDiscord | <hethir> like glfw does with `glfwSetWindowUserPointer` and `glfwGetWindowUserPointer` |
14:46:49 | PMunch | I still have no idea what you're trying to do |
14:47:56 | Amun-Ra | the equivalent of (void *userdata) |
14:54:51 | PMunch | Ah `var userdata: pointer` |
14:54:55 | * | PMunch quit (Quit: Leaving) |
15:27:22 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Oxy |
16:02:11 | FromDiscord | <tandy> is there away to deal with type recursion in nim? |
16:02:32 | FromDiscord | <tandy> sent a long message, see http://ix.io/3OxL |
16:02:50 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3OxM |
16:04:28 | FromDiscord | <tandy> huh, changing `UnsignedData` to a ref object helped |
16:13:53 | FromDiscord | <konsumlamm> objects sre value types, they can't be recursive (since then their size would be infinite) |
16:14:14 | FromDiscord | <konsumlamm> do you need some indirection, which can be introduced by making a ref object |
16:58:47 | * | jjido joined #nim |
17:01:39 | FromDiscord | <Phil> I shall perform a minor celebration |
17:01:57 | FromDiscord | <Phil> For I've got the basics of that effing signal system down and can finally have a starting point for a refactor |
17:05:04 | FromDiscord | <KatrinaKitten> In reply to @eyecon "<@!204718116020682753> is there a": If you're guaranteed to be at the end of the input when you do that, you can use the built in parser `eof` which does essentially what you're doing now. |
17:05:16 | FromDiscord | <KatrinaKitten> Otherwise, not so easily. |
17:06:54 | FromDiscord | <eyecon> In reply to @KatrinaKitten "If you're guaranteed to": There's an `eof`? I missed that in the documentation, thanks! |
17:07:52 | FromDiscord | <eyecon> I don't know how I didn't see that |
17:08:34 | FromDiscord | <eyecon> It doesn't affect the parse result, right? |
17:16:09 | FromDiscord | <mratsim> In reply to @eyecon "There's an `eof`? I": https://nim-lang.org/docs/io.html#endOfFile%2CFile |
17:16:34 | FromDiscord | <mratsim> In general you have everything here: https://nim-lang.org/docs/theindex.html |
17:16:36 | FromDiscord | <eyecon> In reply to @mratsim "https://nim-lang.org/docs/io.html#endOfFile%2CFile": Not that, the honeycomb one: https://katrinakitten.github.io/honeycomb/honeycomb.html#eof |
17:16:39 | FromDiscord | <mratsim> ah |
17:16:56 | FromDiscord | <eyecon> But thanks anyway! |
17:26:34 | FromDiscord | <KatrinaKitten> In reply to @eyecon "It doesn't affect the": It will generate an empty string in the result, but you can use `skip` (the `<<` operator) to discard it. |
17:26:58 | FromDiscord | <KatrinaKitten> (edit) "it." => "it like any other parser." |
17:27:23 | FromDiscord | <KatrinaKitten> (edit) "In reply to @eyecon "It doesn't affect the": It will generate an empty string in the result, but you can use `skip` (the `<<` operator) ... to" added "instead of `&`" |
17:39:01 | FromDiscord | <eyecon> In reply to @KatrinaKitten "It will generate an": Thanks a lot! |
18:06:52 | FromDiscord | <Nycto> Is there a way to exclude some source files when calling ‘nim doc —project’ ? I’ve got some private APIs that consumers don’t need to worry about |
18:08:27 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:14:41 | * | haakon left #nim (#nim) |
18:58:38 | * | vicfred joined #nim |
19:29:17 | * | jjido joined #nim |
19:33:45 | * | tiorock joined #nim |
19:33:45 | * | tiorock quit (Changing host) |
19:33:45 | * | tiorock joined #nim |
19:33:45 | * | rockcavera is now known as Guest2347 |
19:33:45 | * | tiorock is now known as rockcavera |
19:36:37 | * | Guest2347 quit (Ping timeout: 240 seconds) |
19:37:17 | nrds | <testtor/freenode99> <wolfy1339> just like Trump said, we need to drain the swamp |
19:37:17 | nrds | <testtor/freenode99> <bin_bash> rasengan: so youre going to force people to move to annother irc network even if they like the modes and features in the current freenode with ircd-seven and atheme? |
19:37:20 | nrds | <testtor/freenode99> rasengan places a new sign in #freenode: THE SWAMP WILL BE DRAINED TODAY! |
19:37:23 | nrds | <testtor/freenode99> <rasengan> Decision has been made. |
19:37:26 | nrds | <testtor/freenode99> <rasengan> We have to drain this swamp. |
19:37:28 | nrds | <testtor/freenode99> * mlu disapproves |
19:37:30 | nrds | <testtor/freenode99> rasengan sets #freenode +m moderated |
19:37:33 | nrds | <testtor/freenode99> rasengan unsets #freenode -z |
19:37:36 | nrds | <testtor/freenode99> <rasengan> We are draining the swamp. |
19:37:38 | nrds | <testtor/freenode99> <Foxy> #MFGA |
19:37:40 | nrds | <testtor/freenode99> <rasengan> Classic tried to go on for the sake of the community, but the community has made it loud and clear - they want freenode classic to end, today! |
19:37:43 | nrds | <testtor/freenode99> <rasengan> #MFGA |
19:39:00 | FromDiscord | <leorize> uhmm, what is this spam from freenode? |
19:41:39 | FromDiscord | <Phil> I have no idea what all this <> prefixing stuff is even supposed to mean |
19:44:28 | nrds | <Prestige99> Someone from libera mad about freenode |
19:44:33 | nrds | <Prestige99> going around spamming |
19:45:34 | FromDiscord | <Phil> Okay is nrds essentially some sort of shared gateway for folks from IRC to post messages here? |
19:46:02 | FromDiscord | <Phil> so does <Prestige> mean the IRC user "Prestige" posted from an IRC client? |
19:46:26 | nrds | <Prestige99> yep |
19:47:19 | FromDiscord | <Phil> That makes so much more sense, I was so confused as to why somebody with the matrix client would go through the effort of manually typing <Prestige> all the time |
19:56:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OyW |
19:57:40 | FromDiscord | <Phil> That is particularly confusing as that issue does not pop up when there's no `parseEnum` call, only when ... wait a second |
19:58:44 | FromDiscord | <Phil> That's just my god damn parseEnum bug from last week again! |
20:05:46 | FromDiscord | <Phil> Different question |
20:16:00 | FromDiscord | <Phil> I have a bunch of proc-calls distributed over a bunch of modules that, on application startup, shall get called to set up a sort of event system. ↵Now what would be the least involved way to make sure these procs get called?↵Include all those proc files into one core module and import that at the root module from which everything gets compiled from? |
20:17:09 | FromDiscord | <rishav> how can I denote a slice till the end of the string?↵I want to do something like; `echo someString[5..last]` |
20:17:50 | FromDiscord | <Tetralux> In reply to @rishav "how can I denote": `5..^1` |
20:18:40 | FromDiscord | <rishav> In reply to @Tetralux "`5..^1`": Thanks! |
20:18:50 | FromDiscord | <Tetralux> In reply to @rishav "Thanks!": o7 |
20:19:13 | FromDiscord | <Tetralux> (edit) "In reply to @rishav "how can I denote": `5..^1` ... " added "(meaning `5..end-1`)" |
20:26:45 | * | rockcavera quit (Remote host closed the connection) |
20:28:03 | FromDiscord | <Phil> In reply to @Isofruit "I have a bunch": I guess to answer my own question: That would be a bad idea, if you accidentally imported the same thing twice you'd get the same proc thrown in multiple times into your HashSet |
20:37:12 | * | jkl quit (Quit: Gone.) |
20:38:34 | * | jkl joined #nim |
20:41:35 | * | jkl quit (Client Quit) |
20:43:01 | * | jkl joined #nim |
20:44:37 | FromDiscord | <ynfle> How do I get the number of elements in an enum? |
20:46:00 | FromDiscord | <Vindaar> for example: https://nim-lang.github.io/Nim/typetraits.html#enumLen.m%2Ctypedesc%5B%5D |
20:46:35 | FromDiscord | <ynfle> Ya just found that |
20:46:36 | FromDiscord | <ynfle> Thanks |
20:53:00 | * | rockcavera joined #nim |
20:53:00 | * | rockcavera quit (Changing host) |
20:53:00 | * | rockcavera joined #nim |
21:00:11 | FromDiscord | <Phil> We don't have a pragma or sth to suppress unused import warnings, do we? |
21:00:28 | FromDiscord | <Phil> (edit) "warnings," => "warnings from the compiler," |
21:02:38 | * | Guest86 joined #nim |
21:02:52 | * | Guest86 quit (Client Quit) |
21:06:53 | FromDiscord | <haxscramper> `--warning=UnusedImport:off` |
21:09:18 | FromDiscord | <ynfle> Or `{.used.}` I think |
21:12:52 | FromDiscord | <haxscramper> no, you can only add `{.all.}` to the imports |
21:13:12 | FromDiscord | <haxscramper> and this would defeat the whole purpose as you still need to edit the annoying imports |
21:24:44 | * | xet7 quit (Remote host closed the connection) |
21:25:51 | * | xet7 joined #nim |
21:35:57 | FromDiscord | <Phil> Thank! Slightly saddening there's no way to disable that warning for individual imports, but oh well |
21:37:03 | FromDiscord | <ynfle> In reply to @Isofruit "Thank! Slightly saddening there's": I wonder if you can use `push` & `pop` pragmas |
21:38:31 | FromDiscord | <Phil> In reply to @ynfle "I wonder if you": Haven't seen those yet, so no idea |
22:02:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Ozw |
22:03:15 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3Ozw" => "https://play.nim-lang.org/#ix=3Ozx" |
22:21:08 | * | systemdsucks joined #nim |
22:29:55 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:42:21 | rockcavera | os.createDir not working even at compile time? |
22:43:18 | rockcavera | on windows I have used this hack: discard staticExec("cmd /C mkdir DIR" |
22:47:21 | * | jjido joined #nim |
22:47:39 | * | jjido quit (Client Quit) |
23:08:12 | FromDiscord | <Elegantbeef> `mkDir` |
23:11:47 | FromDiscord | <ajusa> @Phil have you seen https://github.com/geekrelief/genit |
23:13:02 | FromDiscord | <Phil> In reply to @ajusa "<@!180601887916163073> have you seen": I have not! Let's see if that can help somehow |
23:13:48 | FromDiscord | <Phil> As a sidenote, I've externalized that entire signal crap so far into its own repository which, at its core if you code in how exactly `TableModelKind` and `TableModelVaraint` look like ahead of time, are shockingly little code |
23:14:25 | FromDiscord | <Phil> https://github.com/PhilippMDoerner/norm-signals/blob/master/src/tableModel.nim - For the table model↵https://github.com/PhilippMDoerner/norm-signals/blob/master/src/normSignals.nim - For the actual signal mechanism |
23:15:29 | FromDiscord | <Phil> Nowhere near finished in whatever form, it doesn't even compile atm due to a bug in parseEnum that xflywind fixed already, but it's a starting point from which to expand and finally has the core idea |
23:16:06 | FromDiscord | <Phil> Just need to figure out how to get all the stuff in tableModel generated for me at compile time ideally |
23:17:13 | FromDiscord | <ajusa> In reply to @Isofruit "Just need to figure": yup, I think genit would be able to help with that, though I haven't used it myself yet. It's a really cool macro/DSL for code manipulation that makes it so you don't need to learn Nim macros if you don't want to. |
23:18:19 | FromDiscord | <Phil> The only possible issue I see with this is, that similar to Django, I'd like my models to be in various files across the application |
23:18:37 | FromDiscord | <Phil> Though I guess an `include` could fix that one |
23:18:46 | FromDiscord | <Phil> (edit) "one" => "one, though that would still not be ideal" |