<< 03-02-2022 >>

00:04:25*l1x quit (Quit: Connection closed for inactivity)
00:23:24FromDiscord<ajusa> what's the one package that has metaprogramming through interpolation? I remember seeing it somewhere here...
00:24:29FromDiscord<Elegantbeef> What?
00:25:47FromDiscord<Elegantbeef> https://github.com/geekrelief/genit perhaps?
00:26:41*jmdaemon quit (Ping timeout: 256 seconds)
00:27:25FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Ou8
00:28:38FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Ou9
00:29:05FromDiscord<Elegantbeef> A template wont be able to do this, a macro can
00:29:05FromDiscord<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:16FromDiscord<Elegantbeef> Well the template cant do much with that ast
00:32:41FromDiscord<Elegantbeef> Remember templates dont have introspective capabillities they are 100% take this AST and paste it here
00:33:24FromDiscord<ajusa> right, I was hoping that they could iterate over the arguments that were passed in somehow
00:33:38FromDiscord<Elegantbeef> They are not that smart
00:33:47FromDiscord<Elegantbeef> They legitimately are just code subsitution
00:35:46*jmdaemon joined #nim
00:36:06FromDiscord<Elegantbeef> It's not that complicated
00:36:07FromDiscord<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:45FromDiscord<ajusa> thanks for the code sample! I'll build off of this 😄
01:04:20FromDiscord<ajusa> also beef do you prefer old concepts or new concepts, I remember you had an opinion
01:04:47FromDiscord<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:02NimEventerNew 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:06FromDiscord<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:57FromDiscord<jsef5> ok, going to write a compression alg in nim
03:19:20FromDiscord<michaelb> In reply to @gcao "hi, if in my": are you using std/asyncdispatch or nim-chronos?
03:20:54FromDiscord<gcao> asyncdispatch
03:26:49FromDiscord<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:09FromDiscord<michaelb> in chronos that works well, i.e. doesn't turn into a hot loop driving up cpu usage
03:27:54FromDiscord<michaelb> I did something like that here: https://github.com/status-im/nim-status/blob/master/examples/client.nim#L22-L23
03:27:59FromDiscord<michaelb> (with chronos)
03:29:59FromDiscord<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:07FromDiscord<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:40FromDiscord<Elegantbeef> if you just want to use it as a table yes you would
03:34:09FromDiscord<evoalg> yea I don't want to do anything else with json at the moment ... thank you beefy!
03:35:34FromDiscord<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:59FromDiscord<ajusa> is there a way to distinguish between when a template/proc is called for assignment or for something else? Eg
03:36:18FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3OuE
03:41:04FromDiscord<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:47FromDiscord<Elegantbeef> I mean you can do similar stuff i think
03:45:03FromDiscord<Elegantbeef> But nothing will be as nice as a macro i think
03:46:54FromDiscord<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:21FromDiscord<Elegantbeef> Well what are you after the `call(a = b, = c)`?
03:47:38FromDiscord<Elegantbeef> `call({"a": "b", "c" : "d"}` could work
03:47:45*noeontheend joined #nim
03:48:37FromDiscord<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:55FromDiscord<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:35FromDiscord<Elegantbeef> You dont know if you're in a proc or not
03:50:41FromDiscord<Elegantbeef> I mean in assignment or not
03:51:57FromDiscord<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:18FromDiscord<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:22FromDiscord<Elegantbeef> you could make an `asgnTemplateName(a, args)`
03:53:33FromDiscord<ajusa> In reply to @Elegantbeef "you could make an": oh, that's a pretty good idea actually
03:59:22FromDiscord<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:41FromDiscord<Elegantbeef> there is `to` you can give it a type
04:00:59FromDiscord<evoalg> thank you! - I've now found `to` is the docs
04:03:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OuH
04:06:23FromDiscord<evoalg> ohhh lol thank you beefy \:D \:D
04:08:32FromDiscord<evoalg> gosh that's more simple and clean than I thought
04:09:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OuI
04:11:11FromDiscord<evoalg> ahhh nice ... but `foo: seq[seq[int]]` \<\< it doesn't know that foo is "foo" does it??
04:12:40FromDiscord<Elegantbeef> It knows it's `foo`
04:13:14FromDiscord<evoalg> even though the string might be "bar" it'll still grab mySeq?
04:13:28FromDiscord<Elegantbeef> well`"foo" -> foo`
04:13:36FromDiscord<Elegantbeef> It'll only grab it if the name is the same
04:15:01FromDiscord<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:00FromDiscord<Elegantbeef> nah it's a field name
04:16:17*noeontheend quit (Ping timeout: 240 seconds)
04:16:22FromDiscord<Elegantbeef> the json just uses field names on parse
04:16:22FromDiscord<Elegantbeef> the field name needs to match the json data or a hook is needed
04:16:23FromDiscord<evoalg> so that fieldname might have been called `bar` for a laugh and it'd still work?
04:16:23FromDiscord<Elegantbeef> Nope
04:16:32FromDiscord<Elegantbeef> Dont recall if it has custom name support
04:17:25FromDiscord<evoalg> ohhh so the field name has to match the json stringy thing?
04:17:56FromDiscord<evoalg> (it looks like a string, but it might be a json thing that looks like a string?)
04:18:25FromDiscord<Elegantbeef> It's a string
04:18:35FromDiscord<evoalg> ok
04:18:43FromDiscord<Elegantbeef> In this case yes the field needs to match the key in the json
04:19:29FromDiscord<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:18FromDiscord<Elegantbeef> No problem
04:28:34*arkurious quit (Quit: Leaving)
04:34:19*rockcavera quit (Ping timeout: 256 seconds)
07:01:47FromDiscord<mratsim> In reply to @keks "Is there a way": https://github.com/mratsim/constantine/blob/50717d8de6715647320fb69935bf8926b5769f95/helpers/static_for.nim#L22
07:04:15FromDiscord<Elegantbeef> Guess that'd be a more general solution
07:04:31FromDiscord<Elegantbeef> Any reason you didnt use `range: static Slice[int]`
07:05:18NimEventerNew 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:02FromDiscord<mratsim> In reply to @Elegantbeef "Any reason you didnt": range is a reserved keyword 😉
07:50:32FromDiscord<Elegantbeef> sure but i more meant instead of two ints
07:52:56nrds<Prestige99>
07:53:21FromDiscord<Elegantbeef> I was thinking the same thing
07:56:56FromDiscord<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:56FromDiscord<Evrensel Kişilik> i received my 2K monitor
08:47:00FromDiscord<Evrensel Kişilik> yay
08:47:01FromDiscord<Evrensel Kişilik> buuuuuuuuut
08:47:30FromDiscord<Evrensel Kişilik> i can't use 144Hz and G-Sync with damn HDMI cable
08:47:31FromDiscord<Evrensel Kişilik> 😦
08:48:11FromDiscord<Evrensel Kişilik> and my GPU is not good for playing games in 2K
08:48:23FromDiscord<Evrensel Kişilik> damn RTX 2060 is poor xD
08:48:34FromDiscord<enthus1ast> good more time for hacking \:)
08:49:00FromDiscord<Evrensel Kişilik> In reply to @enthus1ast "good more time for": let's hack the monitor
08:50:29FromDiscord<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:37FromDiscord<Phil> (edit) removed "I'm"
08:51:06FromDiscord<enthus1ast> must work ;\_;
08:51:14FromDiscord<Elegantbeef> What's the circular dependency?
08:51:26*PMunch joined #nim
08:51:28FromDiscord<Phil> sent a long message, see http://ix.io/3Ovs
08:51:45FromDiscord<Phil> That is the entire reason I went on this verbal vomit last time I wrote
08:51:50FromDiscord<Elegantbeef> Could delay imports work?
08:52:07FromDiscord<Elegantbeef> Is the code hosted somewhere?
08:52:24FromDiscord<Phil> It is, but not in the simplified version I described here
08:53:29FromDiscord<Elegantbeef> Well you might be able to delay imports for this
08:53:56FromDiscord<Elegantbeef> Do any of the procs that signal calls from generic repository go back to signal?
08:54:03FromDiscord<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:13FromDiscord<Phil> right?
08:54:27FromDiscord<Elegantbeef> Yes
08:54:33FromDiscord<Phil> Phew
08:54:43FromDiscord<Phil> Okay, and yes some of them do
08:54:50FromDiscord<Phil> Example, I have a search table and a creature table
08:55:01*jjido joined #nim
08:55:06FromDiscord<Phil> if you create a creature, that shall cause a follow up action of creating an entry in the search table
08:55:41FromDiscord<Phil> creating both of those entries uses the same `createEntry` proc
08:56:13FromDiscord<Elegantbeef> Give me the code and i'll give you the world
08:56:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OvE
08:56:52FromDiscord<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:35FromDiscord<Elegantbeef> Just tell me how i get the circlular error
08:58:16NimEventerNew thread by Drkameleon: Weird issue with ints in web (js) builds, see https://forum.nim-lang.org/t/8862
09:01:09FromDiscord<Phil> sent a long message, see https://paste.rs/5wC
09:01:36FromDiscord<Phil> (edit) "https://paste.rs/fTE" => "http://ix.io/3OvG"
09:02:59FromDiscord<Phil> Didn't even write any code yet into searchSignals, just the import since that'll be needed
09:03:46FromDiscord<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:45FromDiscord<Elegantbeef> So basically if you remove the import of `genericAriticleRepository` you dont get the issue
09:06:15FromDiscord<Elegantbeef> line 1 of `campaignRepository` = `import ../core/databaseRead`
09:07:16FromDiscord<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:30FromDiscord<Phil> (edit) "one thing instead of two" => "that as opposed to databaseRead and databaseWrite"
09:07:43FromDiscord<Elegantbeef> > You can view databaseRead, databaseWrite and genericArticleRepository as one unit
09:07:57FromDiscord<Elegantbeef> If they're considered a single unit why are they seperated
09:08:22FromDiscord<Phil> That was one approach I tried out yesterday, because I believed I might only need read access
09:08:50FromDiscord<Elegantbeef> I mean eitherway, just dont use the `genericArticleRepository` in your project
09:09:35FromDiscord<Phil> You mean no central "one module defines all procs that access the database" approach?
09:09:50FromDiscord<Elegantbeef> I mean you can use that for others just not your internal stuff
09:10:41FromDiscord<Phil> But that means code duplication since I don't really need anything outside of what's in genericArticleRepository
09:11:18FromDiscord<Elegantbeef> I dont know what you mean
09:12:19FromDiscord<Elegantbeef> To solve your issue with `typetraits` add `bind genericParams` into `getRelatedFieldNameOn`
09:13:22FromDiscord<Phil> one sec, I restored the project to the way it was before I did the split.
09:14:12FromDiscord<Elegantbeef> I dont know it's hard to say what to fix with this stuff
09:14:23*krux02 joined #nim
09:15:19FromDiscord<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:20FromDiscord<Phil> Which starts what fundamentally is a "createEntry" --> "preCreateSignal" --> (possibly) "createEntry" call stuff
09:16:32FromDiscord<Phil> (edit) "Which starts what fundamentally is a "createEntry" --> "preCreateSignal" --> (possibly) "createEntry" ... call" added "--> "preCreateSignal""
09:17:11FromDiscord<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:08FromDiscord<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:21FromDiscord<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:20FromDiscord<Elegantbeef> I cannot say much aside from i can remove the recursive dependency easily
09:20:10FromDiscord<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:25FromDiscord<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:29FromDiscord<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:11FromDiscord<enthus1ast> you could maybe add callbacks to the database procs
09:22:11FromDiscord<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:11FromDiscord<Elegantbeef> Removing that intermediate file and fixing the other code means it presently imports like 5 modules and exports them
09:22:47FromDiscord<Elegantbeef> Ok here we go you plan on calling procedures inside of the generic article
09:23:08FromDiscord<Elegantbeef> Can you write some place holders and pipe them so i can actually see the problem and not the "problem" 😀
09:23:50FromDiscord<Phil> Yeah, I think calling the procs inside of the generic article might be the bad idea that's killing me.
09:24:02FromDiscord<Phil> But on it, just give me a couple minutes to revert my prior bad attempts
09:24:44FromDiscord<Elegantbeef> Here is my diff if curious
09:24:45FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3OvJ
09:25:22*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:26:13FromDiscord<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:21FromDiscord<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:39FromDiscord<Elegantbeef> Eh more important is just an example of the actual code and not this inane issue 😀
09:27:25FromDiscord<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:45FromDiscord<Elegantbeef> I say it compiles but there is a sqlite issue
09:30:17FromDiscord<Elegantbeef> Oh wait fixing those does present a proper circ issue it seems
09:31:20FromDiscord<Phil> I'm not that fast at writing the proper example XD
09:34:43FromDiscord<Elegantbeef> Which procedure would call a signal inside `dataBaseWrite`?
09:38:35FromDiscord<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:53FromDiscord<Phil> (edit) "stuff" => "a signal proc"
09:39:53FromDiscord<Elegantbeef> Ok so then this is a proper unsolvable circular dependancy without the abillity to use delayed imports to get around it
09:40:40FromDiscord<Phil> Okay, pushed the example
09:40:49FromDiscord<Phil> In the current version of the repo I rolled back around 3-4 commits
09:41:04FromDiscord<Phil> Because those were the ones where I split genericArticleRepository into databaseRead and databaseWrite
09:41:09FromDiscord<Phil> It's all just in genericArticleRepository now
09:42:33FromDiscord<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:11FromDiscord<Clonkk> Is initializing a string with `collect(newSeq)` valid for non-orc gc ?
09:44:57FromDiscord<Elegantbeef> If it compiles it's valid 😀
09:45:31FromDiscord<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:49FromDiscord<Elegantbeef> Using `newSeq` is a bit weird, cant you use `newString`?
09:46:11FromDiscord<Clonkk> Not my code \:), there's some string interpolation shenanigans going on
09:46:47FromDiscord<Elegantbeef> This is proper recursive so yea i'll say you need to change how this works sadly
09:47:53FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3NJg i was thinking the issue was more like this
09:48:39FromDiscord<Phil> It's a mystery to me on how on earth Django does it
09:51:32FromDiscord<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:49FromDiscord<Phil> (edit) "that" => "the"
09:56:22FromDiscord<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:37FromDiscord<Phil> But only special cases, not all of them
09:56:56FromDiscord<Phil> (edit) "cases," => "cases where I actually have to circumvent the genericArticleRepository (e.g. when inserting into a view),"
09:58:00FromDiscord<Elegantbeef> Well the procedure you're calling from a module relies on the module calling it
09:58:07FromDiscord<Elegantbeef> That's just a no go in NIm
09:58:22FromDiscord<Elegantbeef> You either need to make the type in a different file, or change the logic
09:59:27FromDiscord<Elegantbeef> Atleast it seemed the imports were purely do to types, i could be wrong
10:00:22FromDiscord<Phil> Nah, the logic is the actual problem as you said
10:00:45FromDiscord<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:10FromDiscord<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:21FromDiscord<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:46FromDiscord<yumi> hmmm how can I include some variables from a config file?
10:21:49FromDiscord<yumi> in a script
10:23:45FromDiscord<yumi> without compiling the file
10:24:34FromDiscord<yumi> lemme try parsecfg
10:37:51FromDiscord<Phil> Sidenote, PR is open
10:41:41FromDiscord<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:40FromDiscord<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:45FromDiscord<haolian9 (高浩亮)> thanks, the `stream` keyword inspired me, and then i found this project\: https://github.com/status-im/nim-faststreams
11:24:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Owc
11:26:00FromDiscord<Phil> Is pp an on the fly defined proc signature that you then cast a proc pointer `pcb` to?
11:29:46FromDiscord<Rika> Yes then it calls that proc with ev
11:30:10FromDiscord<Phil> What is the {.nimcall.} pragma doing there? Is that for readability purposes or does that actually do something?
11:31:13FromDiscord<Rika> I don't recall what exactly it does but otherwise it would error
11:32:13FromDiscord<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:37FromDiscord<Rika> No, calling conventions are important
11:33:14FromDiscord<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:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Owg
11:41:05FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3Owg" => "https://play.nim-lang.org/#ix=3Owh"
11:41:53*jjido joined #nim
11:41:58FromDiscord<Rika> Yeah
12:08:14FromDiscord<planetis> nimcall means it's not a closure
12:08:23FromDiscord<planetis> which is the default
12:34:44*Vladar quit (Remote host closed the connection)
12:51:14NimEventerNew thread by Xigoi: Weird issue with Nimble installation, see https://forum.nim-lang.org/t/8864
12:55:53FromDiscord<rishavs (Rishav Sharan)> sent a code paste, see https://play.nim-lang.org/#ix=3Owu
12:55:54FromDiscord<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:19FromDiscord<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:39FromDiscord<rishav> nilable is better. I don't want to use Options for this
12:56:41FromDiscord<Rika> There are option types in Nim that don't lead to segfaults like nil could
12:57:02FromDiscord<Rika> Why? Nonetheless if you want nil it has to be either a ref or a ptr type
12:57:50FromDiscord<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:36FromDiscord<Rika> Use options. There's no real reason to not from what I can see...
12:59:36FromDiscord<mratsim> In reply to @rishavs (Rishav Sharan) "What is a simple": Option
13:00:19FromDiscord<mratsim> In reply to @rishav "nilable is better. I": You can't nil a value type, they don't have pointer indirection
13:11:34FromDiscord<rishav> Thanks
13:18:17*rockcavera joined #nim
13:18:17*rockcavera quit (Changing host)
13:18:17*rockcavera joined #nim
13:25:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OwE
13:57:43FromDiscord<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:24FromDiscord<Phil> Can you do sort of a compile time switch case?
14:16:03PMunchYes
14:23:26FromDiscord<Phil> sent a long message, see http://ix.io/3OwU
14:23:49FromDiscord<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:21FromDiscord<hethir> What's the nim way to store a `void` for user data? Is there a "safe" way to do that?
14:28:06FromDiscord<enthus1ast> just pointer
14:31:32Amun-RaPhil: when + if(s) + else
14:32:47FromDiscord<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:17FromDiscord<Phil> Well, when + elif
14:33:59FromDiscord<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:19PMunch@hethir, store `void` for user data?
14:44:24PMunchWhat does that even mean
14:45:26FromDiscord<hethir> like glfw does with `glfwSetWindowUserPointer` and `glfwGetWindowUserPointer`
14:46:49PMunchI still have no idea what you're trying to do
14:47:56Amun-Rathe equivalent of (void *userdata)
14:54:51PMunchAh `var userdata: pointer`
14:54:55*PMunch quit (Quit: Leaving)
15:27:22FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Oxy
16:02:11FromDiscord<tandy> is there away to deal with type recursion in nim?
16:02:32FromDiscord<tandy> sent a long message, see http://ix.io/3OxL
16:02:50FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3OxM
16:04:28FromDiscord<tandy> huh, changing `UnsignedData` to a ref object helped
16:13:53FromDiscord<konsumlamm> objects sre value types, they can't be recursive (since then their size would be infinite)
16:14:14FromDiscord<konsumlamm> do you need some indirection, which can be introduced by making a ref object
16:58:47*jjido joined #nim
17:01:39FromDiscord<Phil> I shall perform a minor celebration
17:01:57FromDiscord<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:04FromDiscord<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:16FromDiscord<KatrinaKitten> Otherwise, not so easily.
17:06:54FromDiscord<eyecon> In reply to @KatrinaKitten "If you're guaranteed to": There's an `eof`? I missed that in the documentation, thanks!
17:07:52FromDiscord<eyecon> I don't know how I didn't see that
17:08:34FromDiscord<eyecon> It doesn't affect the parse result, right?
17:16:09FromDiscord<mratsim> In reply to @eyecon "There's an `eof`? I": https://nim-lang.org/docs/io.html#endOfFile%2CFile
17:16:34FromDiscord<mratsim> In general you have everything here: https://nim-lang.org/docs/theindex.html
17:16:36FromDiscord<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:39FromDiscord<mratsim> ah
17:16:56FromDiscord<eyecon> But thanks anyway!
17:26:34FromDiscord<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:58FromDiscord<KatrinaKitten> (edit) "it." => "it like any other parser."
17:27:23FromDiscord<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:01FromDiscord<eyecon> In reply to @KatrinaKitten "It will generate an": Thanks a lot!
18:06:52FromDiscord<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:17nrds<testtor/freenode99> <wolfy1339> just like Trump said, we need to drain the swamp
19:37:17nrds<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:20nrds<testtor/freenode99> rasengan places a new sign in #freenode: THE SWAMP WILL BE DRAINED TODAY!
19:37:23nrds<testtor/freenode99> <rasengan> Decision has been made.
19:37:26nrds<testtor/freenode99> <rasengan> We have to drain this swamp.
19:37:28nrds<testtor/freenode99> * mlu disapproves
19:37:30nrds<testtor/freenode99> rasengan sets #freenode +m moderated
19:37:33nrds<testtor/freenode99> rasengan unsets #freenode -z
19:37:36nrds<testtor/freenode99> <rasengan> We are draining the swamp.
19:37:38nrds<testtor/freenode99> <Foxy> #MFGA
19:37:40nrds<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:43nrds<testtor/freenode99> <rasengan> #MFGA
19:39:00FromDiscord<leorize> uhmm, what is this spam from freenode?
19:41:39FromDiscord<Phil> I have no idea what all this <> prefixing stuff is even supposed to mean
19:44:28nrds<Prestige99> Someone from libera mad about freenode
19:44:33nrds<Prestige99> going around spamming
19:45:34FromDiscord<Phil> Okay is nrds essentially some sort of shared gateway for folks from IRC to post messages here?
19:46:02FromDiscord<Phil> so does <Prestige> mean the IRC user "Prestige" posted from an IRC client?
19:46:26nrds<Prestige99> yep
19:47:19FromDiscord<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:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OyW
19:57:40FromDiscord<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:44FromDiscord<Phil> That's just my god damn parseEnum bug from last week again!
20:05:46FromDiscord<Phil> Different question
20:16:00FromDiscord<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:09FromDiscord<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:50FromDiscord<Tetralux> In reply to @rishav "how can I denote": `5..^1`
20:18:40FromDiscord<rishav> In reply to @Tetralux "`5..^1`": Thanks!
20:18:50FromDiscord<Tetralux> In reply to @rishav "Thanks!": o7
20:19:13FromDiscord<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:03FromDiscord<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:37FromDiscord<ynfle> How do I get the number of elements in an enum?
20:46:00FromDiscord<Vindaar> for example: https://nim-lang.github.io/Nim/typetraits.html#enumLen.m%2Ctypedesc%5B%5D
20:46:35FromDiscord<ynfle> Ya just found that
20:46:36FromDiscord<ynfle> Thanks
20:53:00*rockcavera joined #nim
20:53:00*rockcavera quit (Changing host)
20:53:00*rockcavera joined #nim
21:00:11FromDiscord<Phil> We don't have a pragma or sth to suppress unused import warnings, do we?
21:00:28FromDiscord<Phil> (edit) "warnings," => "warnings from the compiler,"
21:02:38*Guest86 joined #nim
21:02:52*Guest86 quit (Client Quit)
21:06:53FromDiscord<haxscramper> `--warning=UnusedImport:off`
21:09:18FromDiscord<ynfle> Or `{.used.}` I think
21:12:52FromDiscord<haxscramper> no, you can only add `{.all.}` to the imports
21:13:12FromDiscord<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:57FromDiscord<Phil> Thank! Slightly saddening there's no way to disable that warning for individual imports, but oh well
21:37:03FromDiscord<ynfle> In reply to @Isofruit "Thank! Slightly saddening there's": I wonder if you can use `push` & `pop` pragmas
21:38:31FromDiscord<Phil> In reply to @ynfle "I wonder if you": Haven't seen those yet, so no idea
22:02:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Ozw
22:03:15FromDiscord<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:21rockcaveraos.createDir not working even at compile time?
22:43:18rockcaveraon 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:12FromDiscord<Elegantbeef> `mkDir`
23:11:47FromDiscord<ajusa> @Phil have you seen https://github.com/geekrelief/genit
23:13:02FromDiscord<Phil> In reply to @ajusa "<@!180601887916163073> have you seen": I have not! Let's see if that can help somehow
23:13:48FromDiscord<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:25FromDiscord<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:29FromDiscord<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:06FromDiscord<Phil> Just need to figure out how to get all the stuff in tableModel generated for me at compile time ideally
23:17:13FromDiscord<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:19FromDiscord<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:37FromDiscord<Phil> Though I guess an `include` could fix that one
23:18:46FromDiscord<Phil> (edit) "one" => "one, though that would still not be ideal"