<< 10-07-2021 >>

00:21:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "What kind of callbacks": filling a buffer
00:21:50FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3suR
00:25:14FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3suT
00:26:05*jkl joined #nim
00:49:33*jkl quit (Quit: ZNC 1.8.2 - https://znc.in)
00:50:24*jkl joined #nim
00:54:59*jkl quit (Remote host closed the connection)
00:56:53*jkl joined #nim
01:06:02*neceve quit (Ping timeout: 255 seconds)
01:46:42*cyraxjoe quit (Ping timeout: 272 seconds)
02:09:21FromDiscord<vishnumad> What's the best way to do wrapping arithmetic in Nim? Looking for the Nim equivalent to Rust's `wrapping_add` or Wrapping↵https://doc.rust-lang.org/std/num/struct.Wrapping.html
02:10:08FromDiscord<ElegantBeef> !eval echo 0u32 - 1u32
02:10:11NimBot4294967295
02:10:45FromDiscord<ElegantBeef> Atleast if i understand the question properly
02:10:59FromDiscord<ElegantBeef> Nim's unsigned doesnt have overflow protections so just work that way
02:11:23FromDiscord<vishnumad> Thanks! That works
02:12:47FromDiscord<vishnumad> I was using `byte`, but changing it to `uint8` makes the compiler happy
02:13:08*cyraxjoe joined #nim
02:13:18FromDiscord<ElegantBeef> It's an alias so that shouldnt matter
02:14:22FromDiscord<vishnumad> It's erroring out if I try to do `let a: uint8 = 0` and then later try to do `a += 256` 🤔
02:14:44FromDiscord<ElegantBeef> `256u8`
02:14:49FromDiscord<ElegantBeef> (edit) "`256u8`" => "`255u8`"
02:14:58FromDiscord<ElegantBeef> bytes only can have 0..255 😄
02:15:04FromDiscord<ElegantBeef> also `var a`
02:15:11FromDiscord<vishnumad> Yeah, I'm trying to make it overflow
02:16:26FromDiscord<ElegantBeef> with that the issue is `+=` uses `SomeInteger`
02:16:31FromDiscord<ElegantBeef> (edit) "`SomeInteger`" => "`T: SomeInteger`"
02:18:20FromDiscord<ElegantBeef> !eval var a = 255u8; a += 3; echo a
02:18:22NimBot2
02:20:02FromDiscord<vishnumad> Yup that works, thanks for the help!
02:20:35FromDiscord<ElegantBeef> the value has to be in the valid range or this gets really odd 😄
02:21:19FromDiscord<vishnumad> Something like `wrapping_add` would be convenient. I supposed I can do the math manually.
02:26:24FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3svj something like this?
02:26:34FromDiscord<ElegantBeef> Excuse the bad maths 😄
02:29:20FromDiscord<ElegantBeef> There is `+%` and `-%` but they only work for homogeneous signed types
02:30:00FromDiscord<vishnumad> I just went back to Rust's `wrapping_add` and it works the exact same way as Nim's add for unsigned ints so I was misremembering.
02:30:23FromDiscord<ElegantBeef> You cannot use `255u8 + 256`?
02:31:19FromDiscord<vishnumad> Don't believe so. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=160157b9c207f8835f8e91c461d67d63
02:31:56FromDiscord<ElegantBeef> Ah nice
02:32:15FromDiscord<ElegantBeef> Though some do have their views against Nim's default lack of overflow protection on uints 😄
02:33:43FromDiscord<vishnumad> I prefer opting into overflow as well, but at least I can do what I need to 😄
02:38:33*cyraxjoe quit (Ping timeout: 252 seconds)
02:40:33FromDiscord<ElegantBeef> Hey atleast it's relatively simple to override(though not certain if this is right) https://play.nim-lang.org/#ix=3svn
02:46:44*cyraxjoe joined #nim
02:46:44*cyraxjoe quit (Client Quit)
02:54:28*cyraxjoe joined #nim
03:00:40*MightyJoe joined #nim
03:03:20*cyraxjoe quit (Ping timeout: 272 seconds)
03:06:21*arkurious quit (Quit: Leaving)
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:37*supakeen joined #nim
04:13:20FromDiscord<Bung> @ElegantBeef am wondering cant the json data part serialize using json module directly?
04:17:21FromDiscord<ElegantBeef> json is slow, vastly slower than my marshal method
04:17:58FromDiscord<Bung> that's the only reason ?
04:18:06FromDiscord<ElegantBeef> yes
04:18:17FromDiscord<ElegantBeef> I originally used json for the communication, and it was stupid slow
04:18:37FromDiscord<Bung> oh, no , use it make your lib complete right ?
04:19:16FromDiscord<Bung> json module is safe to use
04:20:31FromDiscord<Bung> if performance is concerns have you tried packedjson
04:21:54FromDiscord<ElegantBeef> I had not, i went straight into this method of binary stream communication
04:22:18FromDiscord<ElegantBeef> I can rather easily add a flag for using json in the new rewrite
04:22:28FromDiscord<ElegantBeef> The code is much cleaner so easier to append to
04:24:15FromDiscord<Bung> ok, atleast I know that's the only reason, I can also try it in my fork.
04:24:17FromDiscord<ElegantBeef> https://github.com/beef331/nimscripter/blob/bigrewrite/src/nimscripter/macros.nim for reference
04:24:57FromDiscord<ElegantBeef> Well the macro in the old version is a mess to maintain, so highly suggest forking the rewrite 😄
04:25:54FromDiscord<ElegantBeef> It works slightly different you now do `exportToScript: someName` then you do `const yourProcs = implNimscriptModule(someName)` and pass that to `loadScript`
04:26:30FromDiscord<Bung> guess I just need write few lines in marshalns.nim
04:26:46FromDiscord<ElegantBeef> You can just delete the marshalns mostly
04:27:07FromDiscord<ElegantBeef> Just make the parameters send as a string and be recieved as a string
04:27:17FromDiscord<Bung> why is that , your big rewrite no need it now ?
04:27:38FromDiscord<ElegantBeef> so if you have 5 parameters just do `%(a, b, c, d, e, f)`
04:28:04FromDiscord<ElegantBeef> Nah it's just with json you're only needing the string logic which the vm gives you automagically
04:29:44FromDiscord<ElegantBeef> If you want to give me a few minutes i can make a json switch on the rewrite branch 😄
04:32:58FromDiscord<Bung> have a json switch much better
04:33:48FromDiscord<Bung> In reply to @ElegantBeef "You can just delete": I was thinking this, it will need wraps marcos to my procs.
04:52:19FromDiscord<Hi02Hi> how do i deep copy on arc since system.deepCopy is not an option?
04:56:06FromDiscord<ElegantBeef> @Bung well generics + sym's are not playing nice so this sucks 😄
04:56:31FromDiscord<xflywind> In reply to @Hi02Hi "how do i deep": --deepcopy:on|off enable 'system.deepCopy' for ``--gc:arc|orc``
05:05:09FromDiscord<Bung> @ElegantBeef am waiting your json switch.
05:05:30FromDiscord<ElegantBeef> I'm working on it, tuples are annoying
05:17:30FromDiscord<ElegantBeef> Well hit an issue that needs to be fixed now, cannot use a devel version of the compiler which is needed to fix an issue with `std` imports
05:20:25*pro joined #nim
05:29:36FromDiscord<Hi02Hi> In reply to @flywind "--deepcopy:on|off ": it errors with invalid cmdline option, i think im on too old nim
05:29:40FromDiscord<Bung> well , use compiler package also will face compatibility issue
05:29:50FromDiscord<ElegantBeef> I dont know what you mean
05:30:31FromDiscord<ElegantBeef> There was an issue with the `std/import` with the embedded nimscript that i resolved, which is needed to use json now, but i cannot compile the most recent compiler
05:30:42FromDiscord<ElegantBeef> So i can only push my changes and make an issue since i cannot see how to resolve this issue
05:31:11FromDiscord<Bung> compiler package relys something from nim , that may changes when you switch nim version
05:31:52FromDiscord<ElegantBeef> I'm using nightly nim and the most recent compiler package, so idk seems like a regression to me
05:32:19FromDiscord<ElegantBeef> Hax you around? You capable of building with compiler 1.5.1?
05:32:53*MightyJoe quit (Quit: I'm out!)
05:33:13FromDiscord<ElegantBeef> Ok so now it's working 😄
05:33:19FromDiscord<ElegantBeef> Odd behaviour here folks
05:33:35FromDiscord<ElegantBeef> I spent a good 10 minutes trying to find where the regression happened
05:33:38FromDiscord<xflywind> well add your package to importantant-packages, if you have tests.
05:33:44FromDiscord<xflywind> (edit) "importantant-packages," => "important-packages,"
05:34:25*cyraxjoe joined #nim
05:37:49FromDiscord<xflywind> Especially when you called compiler procs.
05:40:26*cyraxjoe quit (Quit: I'm out!)
05:40:52FromDiscord<gogolxdong (liuxiaodong)> Why there are so many libraries about GUI instead of a popular one?
05:45:34FromDiscord<j-james> Because GUI is hard and libraries are competing to be the least bad, and because there aren't an awful lot of Nim programs that make extensive use of GUI
05:45:49FromDiscord<j-james> I think Rust's in a similar place
05:47:59FromDiscord<ElegantBeef> Ugh everywhere i go there is an issue 😄
05:48:19FromDiscord<ElegantBeef> Excuse me whilst i just nuke nimscripter so i dont fee like i have any need to continue this 😛
05:55:54FromDiscord<Bung> where is nimscripted.nim?
05:56:03FromDiscord<ElegantBeef> In the rewrite?
05:56:20FromDiscord<Bung> yes
05:56:36FromDiscord<ElegantBeef> Nuked to hell and back, it's present dumb name is `macros`
05:57:03FromDiscord<Bung> better your macros file have a prefix
05:57:41FromDiscord<ElegantBeef> Like i said it's dumbly named i just started writting and named it macros, will change the name before a proper release
06:07:10FromDiscord<ElegantBeef> There i've cleaned up a bit, but stdlib json is the main meanie now due to not supporting tuple serializationg
06:09:53FromDiscord<ElegantBeef> Do hope that this is easier to work with since the last was a fucking monster 😛
06:13:04FromDiscord<Bung> `Error: invalid pragma: exportToScript`
06:13:16FromDiscord<Bung> tests/exportedprocs
06:13:47FromDiscord<ElegantBeef> I just tested and it worked, so might be on old commit?
06:18:15FromDiscord<ElegantBeef> But i'm taking a break for now, hopefully hax can show what they meant and i can implement it
06:18:51FromDiscord<Bung> oh you changed tests file
06:24:38*mst quit (*.net *.split)
06:24:39*redj quit (*.net *.split)
06:24:39*fn quit (*.net *.split)
06:24:39*nisstyre quit (*.net *.split)
06:24:39*pjz quit (*.net *.split)
06:24:40*federico3 quit (*.net *.split)
06:24:58*redj joined #nim
06:24:58*fn joined #nim
06:24:58*nisstyre joined #nim
06:24:58*pjz joined #nim
06:24:58*mst joined #nim
06:24:58*federico3 joined #nim
06:30:38FromDiscord<haxscramper> Alright, I'm back, now going to build an example for what I was talking earlier @ElegantBeef
06:30:39FromDiscord<Bung> `Error: cannot instantiate: 'getFromBuffer[int]'`
06:31:20FromDiscord<ElegantBeef> Uhh
06:31:38FromDiscord<Bung> https://github.com/bung87/nimscripter/tree/slim
06:32:03FromDiscord<garett> I was looking in std/macros today, and it appears to me that pragmas should appear in the last node of a ProcTy, but I always get nnkEmpty even when I have a custom pragma on my proc
06:32:26FromDiscord<garett> (edit) "I always get" => "dumpTree shows"
06:33:53FromDiscord<ElegantBeef> You have an older marshalns no?
06:34:12FromDiscord<garett> https://play.nim-lang.org/#ix=3suy
06:35:54FromDiscord<garett> Maybe I need to try an older version of Nim to check whether this ever worked
06:36:46FromDiscord<garett> The Nim manual suggests that macros can check for custom pragmas, but maybe it never worked for procs?
06:36:53FromDiscord<Bung> oh yes, thats one
06:37:51FromDiscord<ElegantBeef> @garett pst https://play.nim-lang.org/#ix=3swd
06:38:41FromDiscord<ElegantBeef> notice the output of `getImpl.treeRepr` does have them
06:41:40FromDiscord<garett> Thanks, beef!
06:42:07FromDiscord<garett> Looks like hasCustomPragma has a bug or is incomplete
06:44:35FromDiscord<garett> Now I can easily use a pragma to control how I rewrite Nim vector swizzle procs in HLSL
06:46:49FromDiscord<garett> Ideally, I would like to express many of the rewrite rules with pragmas. Currently I have a lookup table to map Vec4f to float4, etc
06:48:48FromDiscord<Bung> @ElegantBeef hmm, where you handle json? I only see you import json module ..
06:50:36FromDiscord<ElegantBeef> It's not implemented 100% yet
06:50:40FromDiscord<ElegantBeef> Due to stdlib issues
06:54:01FromDiscord<Bung> 😩
06:54:15FromDiscord<ElegantBeef> Yea hoping hax has something nice
07:15:45*Vladar joined #nim
07:17:58FromDiscord<haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test10/test10.nim#L28 alright, so my claim is basically - this is the fastest way to pass data around, because all other methods would force VM to do the same internally
07:18:28FromDiscord<haxscramper> `dump` on object inside of a VM looks like this https://media.discordapp.net/attachments/371759389889003532/863318236627075082/unknown.png
07:19:34FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3swq
07:19:43FromDiscord<haxscramper> Also constructs list of nkExprColonExpr nodes
07:20:27FromDiscord<haxscramper> In reply to @haxscramper "https://github.com/haxscramper/hack/blob/master/tes": I used `hnimast` and my other libraries because I don't want to reimplement get-list-of-fields-from-type-in-macro for 100th time
07:21:11FromDiscord<haxscramper> https://haxscramper.github.io/hnimast/src/hnimast/object_decl.html#ObjectField `for field in iterateFields(impl)` iterates over this objects
07:23:42FromDiscord<haxscramper> God, I absolutely HATE this horrible error messages in invalid kind for variant
07:23:44FromDiscord<haxscramper> `Error: unhandled exception: 'node' is not accessible using discriminant 'kind' of type 'TFullReg'`
07:23:56FromDiscord<haxscramper> using discriminant `'kind'`
07:24:09FromDiscord<haxscramper> which god damn value you found and what the hell did you expect?
07:24:12FromDiscord<haxscramper> nope, just "error"
07:28:07FromDiscord<haxscramper> https://github.com/nim-lang/Nim/pull/11955 at least shows current value
07:36:40FromDiscord<Bung> that should be `foo.f2` is not ...
07:38:18FromDiscord<haxscramper> I want to have just something
07:38:33FromDiscord<haxscramper> concrete word placement can be fixed later
07:42:12FromDiscord<Bung> get merged always after years..
07:42:43FromDiscord<haxscramper> `> Aug 15, 2019`
07:44:39FromDiscord<ElegantBeef> Hmm still have to figure out a way to do the communication with this Pnode
07:45:04FromDiscord<ElegantBeef> Guess i could instead of a mangled proc have a tuple or similar to hold args/ret which is then accessed
07:46:00FromDiscord<haxscramper> What do you mean "figure out a way to do the communication"? You accept `PNode` and convert it to object, or create `PNode` and `setResult` to return data to VM
07:47:09FromDiscord<ElegantBeef> I havent looked at it much, just cursory look
07:58:49*max22- joined #nim
07:59:07*max22- quit (Remote host closed the connection)
07:59:30*max22- joined #nim
08:06:33*neceve joined #nim
08:59:41*pro quit (Ping timeout: 252 seconds)
09:04:32*xet7 quit (Remote host closed the connection)
09:46:42*max22- quit (Remote host closed the connection)
09:53:26*max22- joined #nim
10:04:54*Tejas joined #nim
10:05:05Tejashi
10:08:04FromDiscord<whyy cant i install choosenim> https://nohello.net
10:08:13FromDiscord<whyy cant i install choosenim> (edit) "https://nohello.net" => "https://nohello.com"
10:08:35FromDiscord<whyy cant i install choosenim> https:/nohello.net
10:08:40FromDiscord<whyy cant i install choosenim> (edit) "https:/nohello.net" => "https://nohello.net"
10:08:43FromDiscord<whyy cant i install choosenim> whyy
10:09:02FromDiscord<whyy cant i install choosenim> https://nohello.net/
10:09:17FromDiscord<whyy cant i install choosenim> https://nohello.net/
10:10:24FromDiscord<Rika> Hello, what’s up?
10:13:05*Tejas is now known as TejasAgarwal
10:20:41FromDiscord<PsychoClay> is there a way to get more info on an illformed ast error?
10:23:08*TejasAgarwal quit (Quit: Client closed)
10:24:51FromDiscord<haxscramper> No, it is used like `assert` in compiler
10:24:57FromDiscord<konsumlamm> posting the code here maybe
10:24:58FromDiscord<haxscramper> So not a lot of additional information available
10:25:15FromDiscord<haxscramper> You can do `dumpTree` and compare expected structure vs what you got
10:26:21FromDiscord<PsychoClay> i tried dumptree but i dont really know what a correct ast looks like
10:27:05FromDiscord<vindaar> feel free to paste the tree. maybe we can help
10:30:30FromDiscord<PsychoClay> https://pastebin.com/f6jLtkAf
10:31:53FromDiscord<dom96> In reply to @richard stallmen(crazy GNU guy) "https://nohello.net/": This only applies to PMs or pings.
10:33:04FromDiscord<Rika> In reply to @dom96 "This only applies to": I think it applies in general, I just do not like the way he put it
10:34:39FromDiscord<haxscramper> people sometimes starts with two consecutive messages here
10:34:41FromDiscord<haxscramper> hi
10:34:42FromDiscord<haxscramper> <question>
10:34:47FromDiscord<dom96> It’s okay to join a chat channel and say hello. Not everybody has questions to ask
10:34:59FromDiscord<dom96> Maybe they just want to say hello? 🙂
10:36:42FromDiscord<vindaar> @PsychoClay\: that AST looks fine, no? The tree is just the output of that `dumpTree` call
10:36:51FromDiscord<PsychoClay> yea
10:37:02FromDiscord<vindaar> so where is your problem
10:37:03FromDiscord<vindaar> ?
10:37:36FromDiscord<PsychoClay> https://media.discordapp.net/attachments/371759389889003532/863368350427774976/unknown.png
10:38:04FromDiscord<vindaar> how is that code generated though?
10:38:31FromDiscord<PsychoClay> with a template, its in the pastebin at the bottom
10:39:40FromDiscord<vindaar> not sure, but injecting a local variable with the same name as the template into the calling scope seems fishy to me
10:40:23FromDiscord<haxscramper> I'm not sure but `--hint[MsgOrigin]:on` might show which compiler check is reponsible for the message
10:45:37FromDiscord<PsychoClay> In reply to @vindaar "not sure, but injecting": renaming the templates doesnt seem to change anything
10:50:32FromDiscord<vindaar> I honestly don't really understand how the template is supposed to work. Why do these templates need to be nested in this way? Can't you define them individually?
10:51:03FromDiscord<PsychoClay> i could but then the varibles in the outer template would be unavailble in the inner ones
10:51:59FromDiscord<vindaar> ah you mean those `headerData` and friends variables
10:52:02FromDiscord<PsychoClay> yea
10:52:15FromDiscord<PsychoClay> maybe i should just redesign the whole thing
10:54:16FromDiscord<vindaar> without being able to compile this locally I don't really see the issue (aside from being confused, haha)
11:01:25fn<enthus1ast[web]99> what is the preferred way to test if a value is valid enum data?
11:02:04fn<enthus1ast[web]99> before i build a macro that generates a case i was wondering if there is something like this already
11:02:46*Amun-Ra quit (Ping timeout: 272 seconds)
11:02:53fn<enthus1ast[web]99> i could do a parseEnum[MyEnum](myEnum)
11:03:01fn<enthus1ast[web]99> i could do a parseEnum[MyEnum]($myEnum)
11:03:44*xet7 joined #nim
11:03:51FromDiscord<PsychoClay> In reply to @vindaar "without being able to": https://github.com/PsychoClay/aberrant
11:03:52fn<R2D299> itHub: 7"some webscraper in nim"
11:10:45FromDiscord<haxscramper> In reply to @fn "<enthus1ast[web]> what is the": Your enum has holes or not?
11:11:15FromDiscord<haxscramper> If it doesn't have holes you can simply check for `ord() in ord(low(E)) .. ord(high(E))`
11:11:23FromDiscord<haxscramper> (edit) "`ord()" => "`value"
11:12:42fn<enthus1ast[web]99> it hast holes
11:12:44fn<enthus1ast[web]99> has
11:17:52FromDiscord<haxscramper> `devel` has `std/enumutils.items` that can iterate over enum with holes https://github.com/nim-lang/Nim/blob/devel/lib/std/enumutils.nim#L79
11:18:19*Amun-Ra joined #nim
11:18:23FromDiscord<haxscramper> Otherwise you need to write custom macro or something simila
11:23:48fn<enthus1ast[web]99> ah nice, thank you  haxscramper i'll have a look at this
11:26:37fn<enthus1ast[web]99> i wonder why testing if an enum has correct values is not yet in the stdlib
11:26:58fn<enthus1ast[web]99> looks like a common job to me :)
11:27:09FromDiscord<Rika> prolly was neglected
11:27:37FromDiscord<Rika> we're a pretty small community, its relatively difficult for things to be worked on (i think)
11:51:13*max22- quit (Ping timeout: 268 seconds)
12:06:01*supakeen quit (Quit: WeeChat 3.2)
12:06:36*supakeen joined #nim
12:07:13fn<ForumUpdaterBot99> New post on r/nim by thelolrus: Nim livestream | Jambone template language | Episode 2, see https://reddit.com/r/nim/comments/ohhi29/nim_livestream_jambone_template_language_episode_2/
12:17:14FromDiscord<Hastur> I am investigating how to call Nim from C.↵According to the "Nim Backend Integration", `NimMain` is required for garbage collection, but is it necessary to call `NimMain` even if `--gc:arc` is specified?
12:28:52FromDiscord<offbeat-stuff (offbeat-stuff)> Hi how can i get .79 to become 0.79 in nim. I tried dot operator but only `.`79 works with macros
12:29:01FromDiscord<offbeat-stuff (offbeat-stuff)> \`.\`79
12:30:01FromDiscord<System64 ~ Flandre Scarlet> I have to put NimMain for garbage collection?
12:42:32*max22- joined #nim
12:45:26FromDiscord<haxscramper> This is not supported, but can hack it with `.` operator, but I don't know why you would want this
12:45:27FromDiscord<haxscramper> You want to write `echo .79` instead of `echo 0.79`?
12:51:09FromDiscord<Hastur> sent a long message, see http://ix.io/3sxJ
12:51:43FromDiscord<Hastur> sent a long message, see http://ix.io/3sxK
12:58:52*beshr joined #nim
13:02:56FromDiscord<Kingherring> Livestream of some Nim programming begins in 1hr!!!! (10am EST). https://www.youtube.com/watch?v=rJzUanZ35c8 or https://www.twitch.tv/kingherring↵YouTube
13:03:24FromDiscord<Kingherring> oh I see the reddit post was posted above. 🙂
13:12:23*pro joined #nim
13:14:20*max22- quit (Ping timeout: 252 seconds)
13:32:18FromDiscord<dom96> In reply to @Hastur "I am investigating how": probably is yeah, NimMain also runs initialisation procs for each module (so if you have top-level code in a module it gets run)
13:34:11*arkurious joined #nim
14:07:34FromDiscord<Hastur> In reply to @dom96 "probably is yeah, NimMain": Thanks you!↵It is true that the top level code was not executed without calling `NimMain`.
14:44:17FromDiscord<Bung> @haxscramper how you get type string representation put into parsePNodeStr ?
14:45:01FromDiscord<haxscramper> I don't understand the question. `parsePNodeStr` accepts string and returns node
14:45:40FromDiscord<haxscramper> If you need to convert `PNode` to string use `compiler/renderer.$`
14:46:22FromDiscord<Bung> well, your example show's the type string representation is static string
14:47:16FromDiscord<haxscramper> what is "type string" and which example you are talking about
14:47:23*cyraxjoe joined #nim
14:48:42FromDiscord<Bung> let node = """↵type Type = object↵ hello: float↵""".parsePNodeStr()
14:51:20FromDiscord<haxscramper> https://haxscramper.github.io/hnimast/src/hnimast/obj_field_macros.html#parseObject%2CN%2Cbool%2Cseq%5BN%5D
14:52:12FromDiscord<haxscramper> Also `enum_decl` has `parseEnum`
14:52:50FromDiscord<Bung> so I can put a type name not just string representation
14:54:39FromDiscord<haxscramper> `parse_object` accepts `PNode or NimNode` and returns you a structured object that at unparsed from the noed
14:54:57FromDiscord<haxscramper> as good as it managed to do this\
14:55:27FromDiscord<haxscramper> Due to some ugly quirks in typed AST it requires additional hacks, like passing constant values separately
14:56:20FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3syg
14:57:42FromDiscord<Bung> then how to restore instance by using parse_object returns?
14:58:25FromDiscord<haxscramper> `.toNNode()`
14:58:50FromDiscord<haxscramper> The round-trip conversion does loose some information, and in general it was designed to do only one-way conversion
14:59:03FromDiscord<haxscramper> Either generate object declarations, or process existing ondes
15:02:53FromDiscord<Bung> oh, it works as that does it means I actually have dynamic type?
15:03:58FromDiscord<haxscramper> no, it does not have any dynamic type or anything related. It is just an IR for object structure
15:05:01FromDiscord<Bung> but I can put any type declartion string into parsePNodeStr ?
15:05:49FromDiscord<haxscramper> yes, you can put any syntactically valid nim code in here
15:09:39FromDiscord<Bung> wait , toNNode just get type structure, dont event put data into it
15:10:33FromDiscord<haxscramper> yes, because there is no object to put data into
15:10:49FromDiscord<haxscramper> `ObjectDecl` describe structure of the object declaration
15:11:22FromDiscord<haxscramper> `ObjectField` has `value: Option[N]`, but it is not
15:11:26FromDiscord<haxscramper> Used by `toNNode()`
15:11:33FromDiscord<haxscramper> Since it would generate invalid AST
15:11:50FromDiscord<haxscramper> So I can parse object with `field: type = default`, but won't render it back again
15:12:30FromDiscord<Bung> I thought it works like protobuf, like you get type structure and data, restore back to a instance
15:12:56FromDiscord<haxscramper> No, it has nothing to do with data and everything to do with declaration
15:13:05FromDiscord<haxscramper> If you want to use it fo
15:13:06FromDiscord<haxscramper> hmm
15:13:16FromDiscord<haxscramper> Example for nimscript interop I showed earlier used `getObjectStructure()`
15:13:30FromDiscord<haxscramper> It internally calls `parseObject()` and I used it in macro to unpack fields
15:13:42FromDiscord<Bung> so how could it be used in nimscript
15:14:05FromDiscord<haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test10/test10.nim#L33
15:15:13FromDiscord<haxscramper> Let's put the question differently - what are you trying to do?
15:16:59FromDiscord<Bung> am trying to use nimscript but it has problem with marshal things
15:18:08FromDiscord<haxscramper> Have you looked at my example?
15:20:00*beshr quit (Remote host closed the connection)
15:20:27FromDiscord<Bung> yes, vmNode: untyped is what
15:21:29FromDiscord<haxscramper> `PNode`
15:22:07FromDiscord<haxscramper> Well, it all based on my assumption that cheapest way to interface with VM is to directly operate on `PNode`s
15:22:20FromDiscord<haxscramper> So in deserializes PNode to type
15:22:24FromDiscord<haxscramper> And serializes type to PNode
15:22:50FromDiscord<haxscramper> Identical to json serialization, except all conversion happen on the caller side
15:23:02FromDiscord<haxscramper> In onther words - compiled nim code
15:23:09FromDiscord<haxscramper> And no conversion are performed in the VM
15:23:31FromDiscord<haxscramper> While all other ideas - json/flatty rely on code runnin in VM as well
15:23:40*max22- joined #nim
15:29:33FromDiscord<Bung> it I call vm proc I do toVm on args then fromVm get results ?
15:31:22FromDiscord<haxscramper> `fromVm` is used to convert data that came from vm to your nim code. `toVm` is used to send data to vm
15:31:34FromDiscord<haxscramper> So `args.setResult toVM(<some nim runtime data>)`
15:32:15FromDiscord<haxscramper> Or `let passedFromVm = fromVm(<some concrete type>, args.getNode(0))`
15:32:57FromDiscord<haxscramper> A little more involved than this, but core ide stays the same, regardless of the number of `case` checks
15:33:32FromDiscord<Bung> looks like it will works in this use case I'll try it
15:39:54FromDiscord<EMPTY> Hi
15:45:49FromDiscord<whyy cant i install choosenim> there we go again
15:46:52FromDiscord<shadow.> what's the easiest way for me to create a string with a certain len
15:46:53FromDiscord<shadow.> (edit) "len" => "len?"
15:47:08FromDiscord<vindaar> `newString(<myLen>)`
15:47:35FromDiscord<shadow.> where is that defined?
15:47:38FromDiscord<shadow.> i didnt see it in strutils
15:47:44FromDiscord<vindaar> it's in system
15:47:56FromDiscord<vindaar> https://nim-lang.github.io/Nim/system.html#newString%2CNatural
15:48:19FromDiscord<shadow.> ah okay
15:48:20FromDiscord<shadow.> thanks
15:49:29FromDiscord<EMPTY> Do anyone have a good tutorial on a simple chat app?
15:52:49FromDiscord<zetashift> The Nim in Action book has a great one, it's paid tho, there is also this https://xmonader.github.io/nimdays/day19_witai.html
15:53:26FromDiscord<dom96> you can access the example from the book freely though https://github.com/dom96/nim-in-action-code/tree/v1.2.6/Chapter3/ChatApp
15:53:47FromDiscord<EMPTY> Thanks guys, imma check those out
15:55:54*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
16:07:52FromDiscord<EMPTY> Sorry to annoy you guys but I just want to create a little server and client that can just send strings between them, how is it possible?
16:31:21FromDiscord<EMPTY> No thanks, I got something working that I base on a reverse-shell
16:32:43FromDiscord<EMPTY> sent a long message, see https://paste.rs/g6L
16:33:42FromDiscord<EMPTY> sent a code paste, see https://paste.rs/JuK
16:40:02*beshr joined #nim
16:40:02*beshr quit (Changing host)
16:40:02*beshr joined #nim
16:40:04FromDiscord<dom96> You can literally just copy the example I gave, it's fairly simple and has plenty of comments
16:43:09FromDiscord<EMPTY> Yes but it's more than what I need, I said I wanted a chat app just to get something that can send basic strings between 2 software, yours iw yes simple but uses more things that I wanted so I would have to remove like 80% of the code, mine is as simplest as it could be.↵↵But when I need something to chat I'll try yours
16:48:54*SebastianM joined #nim
16:51:21FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3szb
16:51:23FromDiscord<haxscramper> This code does not give any errors
16:52:13FromDiscord<haxscramper> No generics, nothing
16:52:14FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3szc
16:52:44FromDiscord<haxscramper> Changing `func`/`proc` does not affect it in any way of course
17:00:44*pro quit (Ping timeout: 252 seconds)
17:24:53FromDiscord<hamidb80> why do i get this ? ↵note: the code compiles successfully https://media.discordapp.net/attachments/371759389889003532/863470845593780233/unknown.png
17:25:20FromDiscord<hamidb80> example from here: https://github.com/karaxnim/karax#event-model
17:25:21fn<R2D299> itHub: 7"Karax. Single page applications for Nim."
17:33:14FromDiscord<hugogranstrom> I think it's a false positive (read it in one of the tutorials on Karax sometime ago)↵(@hamidb80)
17:45:48FromDiscord<aleclarson> What is "Undefined symbols for architecture" saying when I know the symbols exist in a header included with `header` pragma?
17:46:49FromDiscord<aleclarson> What's weird is that symbols in `/usr/local/include/node/node_api.h` are found by the linker, but not symbols in `/usr/local/include/node/js_native_api.h` (even though `node_api.h` includes that header)
17:47:00FromDiscord<Hi02Hi> closure iterator bug: https://play.nim-lang.org/#ix=3szz
17:47:32FromDiscord<hamidb80> In reply to @Hi02Hi "closure iterator bug: https://play.nim-lang.org/#ix": whaaaat
17:47:40FromDiscord<aleclarson> (edit) "header)" => "header)↵Maybe this is better suited for stackoverflow"
17:47:45FromDiscord<Hi02Hi> i only goes through 1 iteration
17:47:51FromDiscord<Hi02Hi> (edit) "i" => "`i`"
17:48:13FromDiscord<hamidb80> open an issue for it
17:49:10FromDiscord<hamidb80> In reply to @hugogranstrom "I think it's a": should i care about it? is there any solution ,.. ?
17:49:15FromDiscord<hamidb80> (edit) "solution" => "solutions"
17:51:06FromDiscord<hugogranstrom> The message I got from reading it was that I just shouldn't care or hope someone fixes it. Not sure how though↵(@hamidb80)
17:53:57FromDiscord<hugogranstrom> @hamidb80 here's the link to it: https://moigagoo.svbtle.com/exploring-karax
17:54:07FromDiscord<hugogranstrom> Seems to be a nimsuggest bug
17:54:56FromDiscord<hamidb80> oh, thank u
17:56:31*Vladar quit (Remote host closed the connection)
17:58:41FromDiscord<Hi02Hi> https://github.com/nim-lang/Nim/issues/18474
18:00:52FromDiscord<EMPTY> Yeah this kind of jug appears a lot, I mean my IDE frics a lot sometime but the program runs and compiles correctly↵(@hamidb80)
18:16:22*SebastianM quit (Quit: Bye)
18:29:56FromDiscord<aleclarson> How do i find what version of `clang` nim uses? Is it the system-wide clang?
18:33:07FromDiscord<aleclarson> only 469 #nim-lang questions on stackoverflow 🤯
18:33:24fn<ForumUpdaterBot99> New question by aleclarson: Clang linker finding some symbols but not others, see https://stackoverflow.com/questions/68330584/clang-linker-finding-some-symbols-but-not-others
18:50:28*beshr quit (Remote host closed the connection)
19:21:33*supakeen quit (Remote host closed the connection)
19:21:57*supakeen joined #nim
20:29:18FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3sAn
20:29:50FromDiscord<Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=3sAn" => "https://play.nim-lang.org/#ix=3sAo"
20:29:58*emery quit (Ping timeout: 246 seconds)
20:30:01FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3sAp
20:30:03FromDiscord<ElegantBeef> Soon atleast
20:31:42FromDiscord<Ayy Lmao> In reply to @ElegantBeef "Well it's going to": You mean that is going to be possible even with name conflicts soon?
20:31:53FromDiscord<ElegantBeef> Well whenever this PR gets finished yes
20:31:59FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/pull/18470
20:32:01FromDiscord<Ayy Lmao> That will be awesome
20:33:19FromDiscord<Ayy Lmao> I've always found it verbose to fully qualify pure enums, but hated the idea of not using pure enums
20:34:19FromDiscord<ElegantBeef> Join the club
20:36:24FromDiscord<Ayy Lmao> I wonder if it will work when passing to proc arguments that expect an enum field as well
20:37:10FromDiscord<ElegantBeef> Based off the test he's written i dont know if it's supposed to error or supposed to work 😄
20:37:23FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3sAt
20:39:32FromDiscord<Ayy Lmao> Hopefully it's meant to work.
20:44:57*emery joined #nim
21:11:50FromDiscord<exelotl> mannn I'm trying to build a simple program with wNim but it takes so long to build every time
21:12:04FromDiscord<exelotl> very much looking forward to IC
21:12:28FromDiscord<ElegantBeef> Are you using the dsl?
21:15:00FromDiscord<exelotl> yes but it's not the bottleneck
21:15:45FromDiscord<exelotl> just the sheer number of modules (and probably the amount of macros being used in those modules) x)
21:18:05FromDiscord<ElegantBeef> Just use devel with `--ic:on` and hope nothing explodes 😛
21:21:44FromDiscord<dom96> anybody with experience grabbing crypto price data, what's the best API (preferably free) for this?
21:38:23FromDiscord<Ayy Lmao> @dom96 I was messing around with making a crypto bot a while ago, I was using the binance API. Binance is pretty much the authority on what the price should be of most cryptos
21:43:49FromDiscord<dom96> cool, looks like they provide some nice websocket streams
21:48:51FromDiscord<Ayy Lmao> Yeah you can do websocket for realtime price data and http requests for past market data
22:07:50FromDiscord<glasso> sent a code paste, see https://play.nim-lang.org/#ix=3sAO
22:08:17FromDiscord<Elegantbeef> annotated the procedure with `{.cdecl.}`
22:08:28FromDiscord<glasso> (edit) "https://play.nim-lang.org/#ix=3sAO" => "https://play.nim-lang.org/#ix=3sAP"
22:08:47FromDiscord<ElegantBeef> Nim has calling conventions which if they dont match causes mismatches
22:09:16FromDiscord<glasso> In reply to @Elegantbeef "annotated the procedure with": It worked ^^↵↵I am new to Nim, I dont understand how pragma works...
22:09:20FromDiscord<glasso> Thanks
22:09:35FromDiscord<ElegantBeef> In this case these pragmas just change how the undelying code is written
22:09:53FromDiscord<glasso> In reply to @ElegantBeef "In this case these": I don't like this :9
22:09:53FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#types-procedural-type it's explained here
22:09:55FromDiscord<glasso> 😦
22:10:12FromDiscord<ElegantBeef> There's a reason it exists and as such it's useful
22:10:45FromDiscord<ElegantBeef> Nim devel has a change in the error messages from procedure pragma mismatches which makes this less of a "What's the issue?!"
22:11:24FromDiscord<ElegantBeef> `tproc_mismatch.nim(69, 9) Error: type mismatch: got <proc (a: int): int{.nimcall.}> but expected 'proc (a: int): int{.cdecl.}'↵ Calling convention mismatch: got '{.nimcall.}', but expected '{.cdecl.}'.↵`
22:11:37FromDiscord<ElegantBeef> Notice the mention of calling convention mismatch
22:12:12FromDiscord<glasso> I think this makes easier for newcomers
22:12:17FromDiscord<ElegantBeef> It also shows pragma mismatches so if you try to pass a non `gcSafe` to a `gcSafe` proc
22:12:33FromDiscord<ElegantBeef> Well it's also just more readable which is why i did it 😛
22:12:56FromDiscord<ElegantBeef> There are a few more PRs that aid to increase readability presently being worked on
22:25:52FromDiscord<exelotl> hmmm does anyone know how I can start a process and then terminate my program without killing the process?
22:26:31*beshr joined #nim
22:26:31*beshr quit (Changing host)
22:26:31*beshr joined #nim
22:33:13FromDiscord<exelotl> ah startProcess seems to work
23:12:41fn<ForumUpdaterBot99> New post on r/nim by richardd08: Does nim have context managers, tuple unpacking or abstract base classes?, see https://reddit.com/r/nim/comments/oht2s0/does_nim_have_context_managers_tuple_unpacking_or/
23:20:33*max22- quit (Remote host closed the connection)