<< 09-07-2021 >>

00:12:26FromDiscord<Bung> @ElegantBeef hmm it cant marshal jsonnode..
00:13:13FromDiscord<ElegantBeef> Yea that makes sense dont have variant support
00:13:21FromDiscord<ElegantBeef> I do wonder if i can just use frosty in place of my marshalling
00:13:33FromDiscord<ElegantBeef> Ok time for big ol'd rewrtie
00:14:40FromDiscord<Bung> 😆 finally
00:16:31*rockcavera quit (Remote host closed the connection)
00:18:37FromDiscord<ElegantBeef> But why are you marshalling a jsonnode just send the string
00:20:56FromDiscord<Bung> hmm that will make the nims proc only accept arg1:string arg2:string ..
00:24:58*rockcavera joined #nim
00:24:58*rockcavera quit (Changing host)
00:24:58*rockcavera joined #nim
00:32:21FromDiscord<ElegantBeef> Well serialization is hard for the NimVM so i'm all for trying to make it better
00:32:40FromDiscord<ElegantBeef> Afterall the way this presently works is nimscript calls nim to convert the data into a string
00:38:58FromDiscord<Bung> so this will not get quick fixed ?
00:39:26FromDiscord<ElegantBeef> Well the serializer needs to handle case objects
00:39:53FromDiscord<ElegantBeef> I'm first going to rewrite the macros since they're more concerning to me, then go to the serializer since i want try to put more thought into it
00:40:16FromDiscord<ElegantBeef> A big issue is that the VM cannot use frosty/flatty directly due to using low level operations
00:45:30FromDiscord<Bung> ok, maybe I need find another solution, after dll and nimscripter.
00:45:47FromDiscord<ElegantBeef> What was the issue with the dll, GC'd memory?
00:47:31FromDiscord<Bung> depends how program compiled , some case returns nil when dll proc returns ref T, some case get nil access in dll proc's loop
00:48:21FromDiscord<ElegantBeef> Well you're using refs across program barriers that's bound to cause issues if you dont care for it
00:50:55FromDiscord<Bung> so the easy solution maybe still use dll gen way, using a pragma transform return type to object T
00:51:40FromDiscord<ElegantBeef> Probably
00:58:10FromDiscord<Bung> okay, I create the second PR to nimscripter.
01:17:37fn<ForumUpdaterBot99> New thread by Scotpip: Help with object serialization please!, see https://forum.nim-lang.org/t/8214
01:30:18*cyraxjoe quit (Quit: I'm out!)
01:32:16*cyraxjoe joined #nim
01:34:31FromDiscord<aleclarson> is there a pragma that tells the compiler "this proc always raises an exception"
01:41:49FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3slB
01:57:32FromDiscord<Rika> In reply to @aleclarson "is there a pragma": not really, theres a `{.raises: [].}` pragma that tells what the proc CAN raise
02:03:21FromDiscord<aleclarson> anyone know why `if foo == nil: raise` doesn't prove `foo` is non-nil after the `if` statement? https://play.nim-lang.org/#ix=3slM
02:09:11FromDiscord<aleclarson> found a related thread: https://forum.nim-lang.org/t/6301#38854
02:10:53FromDiscord<ElegantBeef> You may want the `devel` `strictNotNil`
02:12:24FromDiscord<ElegantBeef> Ah probably doesnt change anything
02:13:09FromDiscord<aleclarson> i guess i'll just fork this library i'm using and remove the `notnil` usage
02:13:42FromDiscord<aleclarson> or is there a way to tell the compiler to ignore a specific error?
02:15:40FromDiscord<ElegantBeef> Warnings can be turned into errors but not vice versaa
02:25:07FromDiscord<aleclarson> In reply to @Rika "not really, theres a": Are you aware of `{.noreturn.}`?
02:27:12FromDiscord<aleclarson> Is there ever a reason to use `{.inline.}` instead of a `template`?
02:29:12FromDiscord<shadow.> In reply to @aleclarson "Is there ever a": templated arent typed are they?
02:29:30FromDiscord<shadow.> (edit) "templated" => "templates"
02:29:37FromDiscord<shadow.> or can they be typed? it's been too long lol
02:29:40FromDiscord<ElegantBeef> They can be typed
02:31:43FromDiscord<ElegantBeef> templates are guaranteed to by inlined but have some semantics you may not want for a call
02:31:56FromDiscord<ElegantBeef> like `fmt` will not work as intended
02:46:26FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3slW
02:50:58FromDiscord<Rika> In reply to @aleclarson "Are you aware of": I don't see how it relates to exception raising
02:52:12FromDiscord<Rika> In reply to @aleclarson "anyone know why `if": Because there's not much of a prover
02:53:04FromDiscord<Rika> In reply to @Rika "I don't see how": It can mean the proc raises or that the proc quits the application I believe
02:59:39*arkurious quit (Quit: Leaving)
03:01:24FromDiscord<ajusa> In reply to @ajusa "Managed to get a": jk lol nothing works and I have no idea how dynamic dispatch works in Nim
03:13:44FromDiscord<ajusa> Can someone explain why https://play.nim-lang.org/#ix=3smb doesn't work? I would expect the method for VNString to be called here rather than the base method, but for some reason that isn't the case...
03:14:33FromDiscord<@bracketmaster-5a708063d73408ce4> right now, the nim marshal saves to json... what if nim marshall simply save to a nim file
03:14:33FromDiscord<@bracketmaster-5a708063d73408ce4> then you could later import that nim file
03:14:33FromDiscord<@bracketmaster-5a708063d73408ce4> at compiletime, not runtime
03:16:10FromDiscord<ElegantBeef> > /usercode/in.nim(24, 1) Warning: generic methods are deprecated [Deprecated]
03:18:01FromDiscord<ajusa> In reply to @ElegantBeef "> /usercode/in.nim(24, 1) Warning:": Sure but it doesn't work even if I remove the generic methods.
03:18:53FromDiscord<ElegantBeef> I dont even get how the constructors are not erroring so i'm missing something
03:20:05FromDiscord<Rika> probably something to do with multiple dispatch
03:20:14FromDiscord<ajusa> In reply to @ElegantBeef "I dont even get": what do you mean? Also simpler example here: https://play.nim-lang.org/#ix=3smf
03:20:35FromDiscord<ElegantBeef> you're doing `VNString(a + b)`
03:20:39FromDiscord<ElegantBeef> that's not valid Nim
03:20:51FromDiscord<ElegantBeef> Oh nvm
03:20:55FromDiscord<ajusa> that's a cast
03:20:55FromDiscord<ElegantBeef> I'm dumb that's converting
03:21:06FromDiscord<ElegantBeef> I was reading it as a constructor since i dont touch the OOP much
03:21:29FromDiscord<Rika> xd
03:22:55FromDiscord<ElegantBeef> Oh the reason this happens is you're causing it to convert to the base type
03:23:20FromDiscord<Rika> the first issue is that ↵`method(VNType, VNType): VNType`↵only matches other methods with ↵`method(VNSubType, VNType): VNType`
03:23:26FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3smg
03:23:30FromDiscord<Rika> aka the other parameters + the return type must be the same
03:24:00FromDiscord<ajusa> In reply to @Rika "the first issue is": Wait only the first parameter can be a subtype? Not the second?
03:24:02FromDiscord<Rika> @ElegantBeef `/usercode/in.nim(19, 8) Warning: use {.base.} for base methods; baseless methods are deprecated [UseBase]`
03:24:20FromDiscord<Rika> In reply to @ajusa "Wait only the first": the second type must be the same as the second on the base method
03:25:28FromDiscord<ElegantBeef> Just like in most other OOP languages you cannot override a method with a more specific override
03:25:28FromDiscord<ajusa> In reply to @Rika "the second type must": ah... is there any way around that?
03:25:49FromDiscord<Rika> make a base method with each other type?
03:25:50FromDiscord<Rika> idk
03:25:53FromDiscord<Rika> i dont oop
03:25:55FromDiscord<ElegantBeef> You dont need to get around that
03:26:18FromDiscord<Rika> https://nim-lang.org/docs/manual.html#methods-multiminusmethods
03:26:23FromDiscord<Rika> this is "deprecated"
03:26:37FromDiscord<ajusa> In reply to @ElegantBeef "You dont need to": Well the issue is that these types will eventually be stored in a Table[string, VNType] so it'll all get converted to a VNType in the end
03:26:49FromDiscord<ElegantBeef> Sure but you can just handle that in your addition logic
03:28:24FromDiscord<ajusa> In reply to @Rika "this is "deprecated"": This also doesn't seem to change the output of my code 😢 probably because it is deprecated
03:28:51FromDiscord<ajusa> In reply to @ElegantBeef "Sure but you can": What do you mean? Not sure I follow
03:29:01FromDiscord<ElegantBeef> Giving an example now
03:31:00FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3smr
03:32:10FromDiscord<ajusa> Ah got it, that's a pretty decent option actually. Thanks for all the help!
03:32:21FromDiscord<ElegantBeef> But still dont get why you're using oop here
03:32:31FromDiscord<ElegantBeef> Unless you want users to be able to add types
03:32:41FromDiscord<ajusa> because I have to type too much with variant objects
03:32:57FromDiscord<ElegantBeef> It's about the same
03:33:14FromDiscord<ajusa> (edit) "because I have to type too much ... with" added "(explicitly generate every single interaction)"
03:33:49FromDiscord<ajusa> well I'm trying both to compare them lol, and variant objects are definitely more work since you can't really do generic procs with them.
03:35:25FromDiscord<Rika> methods have larger runtime costs than variants
03:52:56FromDiscord<ajusa> Well after spending another 20 minutes wrestling with multimethods, I'm now more inclined towards the variant option. Guess I'll write templates to avoid duplicating logic 🙂
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:41*supakeen joined #nim
05:00:05fn<ForumUpdaterBot99> New thread by Stu002: Order of concept implementations and functions is significant?, see https://forum.nim-lang.org/t/8216
06:22:54*ozzz quit (Ping timeout: 265 seconds)
06:35:18FromDiscord<Varriount> @dom96 Is there a way to download an archive of all #nim's IRC logs? Other than manually crawling the website?
06:51:47FromDiscord<haxscramper> In reply to @Yardanico "updated sqlite db of": @Varriount yardanico has a sqlite db with all messages, but it is not frequently updated
06:53:19FromDiscord<haxscramper> In reply to @ajusa "I asked something similar": You can write a macro that would do all the lifting for your - you would only need to write a mapping
06:55:23FromDiscord<haxscramper> I think you don't even need to have a DSL, just accept `static[openarray[tuple[inPair: (BoxKind, BoxKind), outRes: BoxKind]]` and write `liftImpl({(kindInt, kindInt): kindInt})`
06:56:04FromDiscord<haxscramper> At least I think you can do static openarray, otherwise `@{ ... }` will give you static tuple
06:56:53FromDiscord<haxscramper> I'd you don't want to hardcode all kind -> field mappings in the implementation you can also accept `static[array[BoxKind, string]]` mapping
06:58:00FromDiscord<haxscramper> So for variant types it is mostly correct approach, but it does add some boilerplate, so having lift macro would be important
06:58:56FromDiscord<haxscramper> Actually you can lift any n-ary procedure if you use `seq[BoxKind]` and unpack fields
06:59:12FromDiscord<haxscramper> Not just operators
07:00:29FromDiscord<Stuffe> Is there a way to define global scope constants that can be used to compile different versions, like: when defined(release)
07:00:57FromDiscord<haxscramper> `const test = true`
07:01:25FromDiscord<haxscramper> Or `const test {.booldefine.} = true` to override from command line
07:01:34*PMunch joined #nim
07:02:06FromDiscord<Stuffe> Oh I see. My bad for not trying that
07:08:39FromDiscord<ElegantBeef> Well so far the nimscripter rewrite is nice, though my sanity will soon flee with supporting descriminant objects 😄
07:20:47*rockcavera quit (Remote host closed the connection)
07:25:22PMunchYou're re-writing NimScripter?
07:26:11FromDiscord<ElegantBeef> Well some parts making it have less edge cases
07:26:59FromDiscord<ElegantBeef> Ever since understanding the macro cache it's something i've wanted to use to clean it up which it does a bit
07:27:42PMunchMacro cache?
07:28:24FromDiscord<ElegantBeef> It's a module for storing AST across module boundaries
07:28:41FromDiscord<ElegantBeef> And the ast can be typed which is what's important here
07:29:14FromDiscord<stanleyvessel> the x86_64 button at download page is broken, i tried to click the button and it says "this website cant be reached".
07:29:26*Vladar joined #nim
07:38:07*max22- joined #nim
07:38:24*max22- quit (Remote host closed the connection)
07:38:47*max22- joined #nim
07:40:44PMunch@stanleyvessel, which one? Seems to work fine for me
07:57:45FromDiscord<Bung> I fails on dll gen way, I get nil access stil.
08:06:52FromDiscord<stanleyvessel> this https://media.discordapp.net/attachments/371759389889003532/862968031037620264/df.PNG
08:08:28FromDiscord<stanleyvessel> and just turn out like this https://media.discordapp.net/attachments/371759389889003532/862968432807247882/sf.PNG
08:08:53FromDiscord<stanleyvessel> the x86 button works fine when i clicked.
08:14:54FromDiscord<ElegantBeef> Tested here and it works
08:15:09PMunchYeah works fine here as well
08:15:18PMunchSome sort of AV scan interference?
08:17:47FromDiscord<stanleyvessel> nvm i use sha256
08:18:11FromDiscord<stanleyvessel> thx for help
08:57:33*max22- quit (Remote host closed the connection)
08:59:51*max22- joined #nim
09:09:10*max22- quit (Remote host closed the connection)
09:10:02*max22- joined #nim
09:19:45FromDiscord<talaing> Hey, how can I access the "target" field?
09:19:55FromDiscord<talaing> https://media.discordapp.net/attachments/371759389889003532/862986411682693130/2HNswvP5.png
09:20:22FromDiscord<talaing> sent a code paste, see https://play.nim-lang.org/#ix=3spF
09:42:10*neceve joined #nim
09:42:42FromDiscord<talaing> I figured it out 👍
10:45:40FromDiscord<planetis> does Option[var T] work?
10:46:04FromDiscord<dom96> In reply to @Varriount "<@132595483838251008> Is there a": There isn’t. But yeah, yardanico’s db is the best source right now.
10:50:29FromDiscord<konsumlamm> In reply to @planetis "does Option[var T] work?": iirc it doesn't currently
11:11:51*xet7 quit (Remote host closed the connection)
11:13:08*xet7 joined #nim
11:21:43FromDiscord<planetis> well sheep
11:47:17*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
12:01:17*max22- quit (Ping timeout: 252 seconds)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:17:44FromDiscord<talaing> What is equivalent of Java's `DataOutputStream` in Nim?↵I want to write bytes to socket.
12:20:49FromDiscord<talaing> sent a code paste, see https://play.nim-lang.org/#ix=3sr4
12:49:15*max22- joined #nim
13:02:05FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srj
13:03:28FromDiscord<willyboar> I think you are missing a parenthesis
13:04:33FromDiscord<willyboar> Nope my bad
13:09:19FromDiscord<ajusa> yeah it's a fusion/matching thing, says redefinition of `it`.
13:16:00FromDiscord<haxscramper> Can you show the full code
13:16:55FromDiscord<haxscramper> In reply to @haxscramper "Number of git commits": A little more cleaned up version with nim release dates https://media.discordapp.net/attachments/371759389889003532/863046056232222730/res2.png
13:17:48FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srr
13:18:08FromDiscord<haxscramper> with imports etc.
13:18:39FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srt
13:20:57FromDiscord<ajusa> https://play.nim-lang.org/#ix=3sru has everything along with the compile error. What I'm basically trying to do here is have the pattern matching fill in `val1` and `val2` based on the kind field.
13:21:40FromDiscord<haxscramper> It works for my installation but not in playground
13:21:51FromDiscord<haxscramper> Consider updating to newer fusion
13:22:00FromDiscord<haxscramper> I did some fixes recently, so it might be the reason
13:22:11FromDiscord<haxscramper> Works for my fusion version
13:22:11FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srv
13:22:39FromDiscord<ajusa> Huh okay I'll try updating it then directly from git?
13:23:24FromDiscord<haxscramper> I suppose you need can do `nimble install fusion`, but @timotheecour should know better how you are supposed to update fusion
13:24:10FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srw
13:24:22*max22- quit (Remote host closed the connection)
13:24:24*redj quit (Quit: No Ping reply in 180 seconds.)
13:25:21FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srx
13:25:56*redj joined #nim
13:27:36FromDiscord<ajusa> Got it working, thanks!
13:28:16*blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in)
13:28:26*blackbeard420 joined #nim
13:30:04FromDiscord<haxscramper> In reply to @ajusa "Well I tried doing": But that's not exactly what I meant
13:30:54FromDiscord<haxscramper> What I suggested is probably closre to multiple dispatch tree
13:31:11FromDiscord<haxscramper> that you generate at compile-time
13:31:30FromDiscord<ajusa> yeah I'm still not entirely sure what you were recommending lol. A bunch of if statements generated at compile time?
13:32:39FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3sry
13:32:40FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srz
13:32:40FromDiscord<haxscramper> or construct sequence of kinds
13:32:40FromDiscord<haxscramper> and compare it like `kindSeq == [tkInt, tkInt]: <rebox things>`
13:33:45*arkurious joined #nim
13:57:58fn<ForumUpdaterBot99> New thread by LemongrabThree: Is There a Guard Pragma for Procs or Something That Would Work Like That?, see https://forum.nim-lang.org/t/8217
14:03:20FromDiscord<haxscramper> @ajusa https://wandbox.org/permlink/kjUlIRg0aDbY3gs6
14:03:34FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srL
14:03:43FromDiscord<haxscramper> It is not the fastest solution, but it works for n-ary types
14:04:05FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srM
14:04:07FromDiscord<haxscramper> To lift `-` operator
14:04:42FromDiscord<haxscramper> Since arguments are `static` you can save common operator parameters in const
14:05:32FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srN
14:06:10FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srO
14:06:54FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srP
14:07:21FromDiscord<haxscramper> and so on
14:07:23FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srQ
14:08:06FromDiscord<haxscramper> In reply to @haxscramper "It is not **the**": It does allocate `seq[TypeKind]`
14:08:10FromDiscord<haxscramper> hmm
14:09:06FromDiscord<haxscramper> https://wandbox.org/permlink/mrJNEa4bBDSJho1w
14:09:30FromDiscord<haxscramper> that one does't use it
14:10:29*beshr quit (Remote host closed the connection)
14:12:44FromDiscord<System64 ~ Flandre Scarlet> Is that normal? https://media.discordapp.net/attachments/371759389889003532/863060104248164392/unknown.png
14:13:30FromDiscord<haxscramper> Not it isn't, but I don't know how to fix it exactly
14:14:20FromDiscord<System64 ~ Flandre Scarlet> ah, thanks anyways
14:19:20FromDiscord<haxscramper> In reply to @haxscramper "https://wandbox.org/permlink/mrJNEa4bBDSJho1w": I think I've seem something similar somewhere
14:21:07FromDiscord<haxscramper> And it it linear in the number of combinations, while case implementation only slows down based on number of argument
14:25:10*PMunch quit (Quit: leaving)
14:25:32FromDiscord<ajusa> Hm, okay. I'll try out some of these suggestions. Thank you so much for taking the time to figure this out, I really appreciate it @haxscramper
14:28:14*rockcavera joined #nim
14:49:36*def- quit (Quit: -)
14:49:55*def- joined #nim
15:03:43federico3developer meeting starting now at https://meet.jit.si/NimDevMeet
15:13:50FromDiscord<System64 ~ Flandre Scarlet> does someone else knows how I can fix that please?
15:15:24FromDiscord<pointystick> hg is associated with Mercurial (a version control system, like git is), so I guess you might be able to install Mercurial on whatever OS you're using
15:16:26FromDiscord<vindaar> I think the `hg` error also appears in some circumstances if the url isn't correct anymore or something
15:16:37FromDiscord<pointystick> having said that, BitBucket dropped support for Mercurial ages ago and the following link suggests anything left there isn't accessible now:↵https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket
15:16:44FromDiscord<pointystick> "[Update July 1, 2020] Today, mercurial repositories, snippets, and wikis will turn to read-only mode. After July 8th, 2020 they will no longer be accessible."
15:17:01FromDiscord<vindaar> indeed the link it tries to download from\: https://bitbucket.org/BitPuffin/nim-portaudio is broken
15:17:09FromDiscord<vindaar> the error message just sucks
15:22:09FromDiscord<aleclarson> where does the `{.header: "foo.h".}` pragma look for the header?
15:22:21FromDiscord<aleclarson> (edit) ""foo.h".}`" => ""<foo.h>".}`"
15:23:59FromDiscord<dom96> In reply to @haxscramper "A little more cleaned": That pre-1.0 spike. Interesting
15:24:30*kots left #nim (#nim)
15:30:12FromDiscord<aleclarson> In reply to @aleclarson "where does the `{.header:": found a clue by searching Nim's repo. it uses `dlopen` from `<dlfcn.h>`
15:37:07FromDiscord<aleclarson> no wait, that's not right. `dlopen` isn't for headers \:)
15:37:17FromDiscord<haxscramper> In reply to @dom96 "That pre-1.0 spike. Interesting": I get it - people were fixing things for new version
15:37:29FromDiscord<haxscramper> I just was confused by this
15:55:17FromDiscord<chancyk (Chancy Kennedy)> Could anyone make a suggestion as to how to perform a non-blocking read from stdio in Nim?
16:02:05FromDiscord<dom96> stdio being what?
16:04:14FromDiscord<chancyk (Chancy Kennedy)> Oops, stdin I mean, typo.
16:06:56FromDiscord<dom96> Most portable: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39
16:11:09Amun-Rahmm, I found a bug in 1.4.2, I'll file a pr in a day or so
16:12:13FromDiscord<pointystick> The latest stable is 1.4.8 so it might be a good idea to see if the issue is fixed in there
16:13:00Amun-Rahmm
16:14:03Amun-Rahmm, it's 1.4.8
16:16:22Amun-RaI'll try to reduce test size to the minimum, https://dpaste.com/9RQTU7YBN
16:17:42Amun-Rawhat's funny: I have an array of objects and adding discard thetable[0] produces that error
16:19:08FromDiscord<gogolxdong (liuxiaodong)> How come tauri is more popular than nimx , even if nimx had already officially support so many platform?
16:20:26FromDiscord<gogolxdong (liuxiaodong)> https://github.com/tauri-apps/tauri
16:20:29fn<R2D299> itHub: 7"Build smaller, faster, and more secure desktop applications with a web frontend."
16:28:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @pointystick "hg is associated with": So how can I install PortAudio?
16:32:34fn<ForumUpdaterBot99> New thread by Christianschoe: Misleading error message from startProcess(), see https://forum.nim-lang.org/t/8218
16:44:21FromDiscord<vindaar> @System64 ~ Flandre Scarlet\: you probably can't unless you manually find that nim library somewhere else
16:44:50FromDiscord<System64 ~ Flandre Scarlet> ah I'm in trouble then :/
16:45:41FromDiscord<vindaar> maybe use this one? https://github.com/Psirus/nordaudio
16:45:43fn<R2D299> itHub: 7"A wrapper around PortAudio"
16:46:00FromDiscord<System64 ~ Flandre Scarlet> Oh nice! Is it stable?
16:46:13FromDiscord<vindaar> no idea, literally just found it on google 😅
16:46:20FromDiscord<whyy cant i install choosenim> you dont have much option it seems
16:46:46FromDiscord<vindaar> but Psirus seems to be active, so you can probably raise an issue if you have problems
16:46:55FromDiscord<System64 ~ Flandre Scarlet> yeah I can try
16:58:04*stkrdknmibalz joined #nim
17:14:32FromDiscord<chancyk (Chancy Kennedy)> @dom96 Got it working, thanks!
17:18:05FromDiscord<treeform> In reply to @ElegantBeef "Well the serializer needs": jsony/flatty serializers both handle case objects.
17:20:33FromDiscord<treeform> In reply to @ElegantBeef "A big issue is": jsony is tested in the VM, it uses `when vm` to run special code for vm or js case.
17:21:13FromDiscord<treeform> Let me know if you have issues using jsony/flatty in the vm or js, or with case objects. I'll fix it.
17:25:20*pro joined #nim
17:27:09FromDiscord<System64 ~ Flandre Scarlet> WTF gcc yells on me https://media.discordapp.net/attachments/371759389889003532/863109028741644318/unknown.png
17:28:37FromDiscord<System64 ~ Flandre Scarlet> I guess I need to provide the header but where???
17:29:38FromDiscord<whyy cant i install choosenim> probably install libportaudio?
17:29:41FromDiscord<whyy cant i install choosenim> smg like that?
17:30:07FromDiscord<System64 ~ Flandre Scarlet> I need to install the C lib?
17:31:16FromDiscord<whyy cant i install choosenim> pulseaudio-dev
17:31:19FromDiscord<whyy cant i install choosenim> as in alpine
17:31:31FromDiscord<whyy cant i install choosenim> windoze?
17:32:26FromDiscord<whyy cant i install choosenim> (edit) "pulseaudio-dev" => "portaudio-dev"
17:33:31FromDiscord<whyy cant i install choosenim> there are no paxkages called portaudio in windose
17:33:59FromDiscord<System64 ~ Flandre Scarlet> Windows?
17:34:16FromDiscord<whyy cant i install choosenim> time to compile
17:34:24FromDiscord<whyy cant i install choosenim> <https://github.com/PortAudio/portaudio>
17:35:03FromDiscord<whyy cant i install choosenim> why is a heloworld application umusing portaudio btw🧐
17:35:18FromDiscord<System64 ~ Flandre Scarlet> I called it that
17:35:22FromDiscord<whyy cant i install choosenim> (edit) "umusing" => "using"
17:36:03FromDiscord<System64 ~ Flandre Scarlet> That's my code https://media.discordapp.net/attachments/371759389889003532/863111273210183680/message.nim
17:36:41FromDiscord<vindaar> @System64 ~ Flandre Scarlet\: what do you actually need?
17:37:24FromDiscord<System64 ~ Flandre Scarlet> I need to output audio
17:37:50FromDiscord<System64 ~ Flandre Scarlet> but ``discard gmePlay(cast[ptr MusicEmu](userdata), 1024.cint,cast[ptr cshort](outputBuffer)) `` fills a buffer
17:49:02FromDiscord<System64 ~ Flandre Scarlet> What should I do?
17:53:16FromDiscord<vindaar> I'm not an audio person. There's probably easy ways to play audio that are available on windows. But I'm no help here \:/
17:57:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @vindaar "maybe use this one?": And the weird thing is it seems it doesn't interact with a dll
17:58:28FromDiscord<System64 ~ Flandre Scarlet> but maybe I got wrong
18:22:52FromDiscord<System64 ~ Flandre Scarlet> Where does it search the lib? https://media.discordapp.net/attachments/371759389889003532/863123048584183838/unknown.png
18:29:35*pro quit (Ping timeout: 252 seconds)
18:32:33*supakeen quit (Remote host closed the connection)
18:32:56*supakeen joined #nim
18:32:57FromDiscord<RattleyCooper> Have you checked out https://github.com/treeform/slappy and https://github.com/treeform/openal ?
18:33:00fn<R2D299> itHub: 7"3d sound api for nim."
18:34:42*al1ranger joined #nim
18:36:59*pro joined #nim
18:41:16FromDiscord<System64 ~ Flandre Scarlet> They're audio lib ?
18:57:03FromDiscord<RattleyCooper> I haven't used them before but it looks like it. Not sure if it exposes low level api but it says they're there to play audio
19:01:12FromDiscord<System64 ~ Flandre Scarlet> I'll check that
19:05:54*al1ranger quit (Quit: Leaving)
19:10:14FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stG
19:11:32FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stH
19:15:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @RattleyCooper "Have you checked out": seems they doesn't support callbacks
19:19:05*cyraxjoe quit (Ping timeout: 255 seconds)
19:19:26*MightyJoe joined #nim
19:23:06FromDiscord<@bracketmaster-5a708063d73408ce4> How can I inspect the current address of an object a variable points to?
19:23:07FromDiscord<@bracketmaster-5a708063d73408ce4> and then perhaps echo that address?
19:44:35FromDiscord<System64 ~ Flandre Scarlet> Does it search a dll? https://media.discordapp.net/attachments/371759389889003532/863143616141590548/unknown.png
20:02:08FromDiscord<haxscramper> sent a code paste, see https://paste.rs/liu
20:02:40FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stY
20:03:47FromDiscord<haxscramper> you actually need `echo cast[int](addr tmp)`
20:06:13*rockcavera quit (Remote host closed the connection)
20:13:25*MightyJoe quit (Read error: Connection reset by peer)
20:17:14*cyraxjoe joined #nim
20:22:06FromDiscord<System64 ~ Flandre Scarlet> SIGSEGV: Illegal storage access. (Attempt to read from nil?)SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵↵Same thing as NilAccessDefect exception?
20:33:39FromDiscord<haxscramper> Yes
20:33:58FromDiscord<RattleyCooper> Is there a list of special operators like ``[]=``?
20:34:07*pro quit (Quit: WeeChat 3.2)
20:34:12FromDiscord<haxscramper> `{}`, `[]`, `[]=`, `{}=`
20:34:21FromDiscord<haxscramper> The list if fixed
20:34:27FromDiscord<RattleyCooper> Ok cool, thank you 😄
20:35:19FromDiscord<RattleyCooper> Do you know what the syntax is for `[]` operator when creating custom operator?
20:35:26FromDiscord<RattleyCooper> Like the `proc` arguments?
20:35:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3su3
20:35:48FromDiscord<RattleyCooper> Oh wow, easy enough, thanks!
20:35:53FromDiscord<haxscramper> Second and all subsequent arguments go to `[]`
20:36:04FromDiscord<haxscramper> With `[]=` last argument goes to `= <last argument>`
20:36:35FromDiscord<haxscramper> Under what circumstances `{.deprecated: "XXXX".}` might not work? I'm running compilation as `nim c --skipUserCfg --skipProjCfg --skipParentCfg '--warning[Deprecated]:on' make_wrap.nim` and it does not output expected deprecation warnings.
20:38:54FromDiscord<haxscramper> I have no `{.warning[Deprecated]: off.}` anywhere
20:39:39FromDiscord<haxscramper> And I also added explicit `{.warning[Deprecated]:on.}` in the code
20:41:48FromDiscord<haxscramper> Alright, I had to put `{.warning[Deprecated]:on.}` literally on top of the function I've deprecated and now it works
20:42:14FromDiscord<haxscramper> Is there any way to debug things like this? Like what warnings are turned on/off and where
20:47:25*pro joined #nim
20:47:36FromDiscord<haxscramper> No, now I need to enable it per-module
20:52:44*cyraxjoe quit (Ping timeout: 268 seconds)
21:02:48FromDiscord<System64 ~ Flandre Scarlet> is it possible to have the classic for loop in Nim?
21:03:08FromDiscord<System64 ~ Flandre Scarlet> the C-style for
21:03:44FromDiscord<ElegantBeef> i mean `for x in 0..y` is the "classic"
21:03:55FromDiscord<ElegantBeef> alternatively `countUp` and `countDown`
21:04:01fn<ForumUpdaterBot99> New thread by Sixte: New concepts, visibility and mount points , see https://forum.nim-lang.org/t/8219
21:04:05FromDiscord<ElegantBeef> Otherwise a while loop works
21:13:22FromDiscord<ElegantBeef> @treeform yea i'll give flatty a try though it's a pretty large api i need to get in nimscript so going to be tedious
21:17:31*Vladar quit (Remote host closed the connection)
21:19:12FromDiscord<System64 ~ Flandre Scarlet> ``int sample_nr = user_data;`` in C, supposing user_data is a pointer↵That's the same thing as ``var sample_nr = cast[ptr cint](userdata)`` in Nim right?
21:19:30FromDiscord<ElegantBeef> `userdata.addr`
21:19:55FromDiscord<System64 ~ Flandre Scarlet> ah thanks
21:20:30FromDiscord<System64 ~ Flandre Scarlet> it says expression has no address
21:23:33FromDiscord<treeform> In reply to @ElegantBeef "<@!107140179025735680> yea i'll give": Not sure what you mean, don't you just import a file?
21:24:11FromDiscord<treeform> I though when you said nim script you meant some thing like `static data: string = foo.toFlatty()`
21:24:18FromDiscord<ElegantBeef> Nope
21:24:32FromDiscord<treeform> that runs flatty in "nimscript"
21:24:35FromDiscord<treeform> during the compiler phase
21:24:39FromDiscord<ElegantBeef> Yea i know
21:24:55FromDiscord<treeform> I though that is what you meant
21:25:10FromDiscord<ElegantBeef> Nope i'm running a nim vm from a nim program, and communicating between the two
21:25:24FromDiscord<ElegantBeef> If it works in the nim vm it might be as simple as getting people to include flatty in their nimscript stdlib
21:25:25FromDiscord<treeform> Yeah I have not done that. So flatty is not tested there.
21:25:34FromDiscord<ElegantBeef> Well it's still the NimVm
21:25:44FromDiscord<treeform> yeah in theory it should just import and work
21:28:22FromDiscord<treeform> you might combine flatty.nim and objvar.nim into a single file to make it easier include in the vm
21:28:42FromDiscord<treeform> I feel like objvar.nim should be part of std/typetraits or some thing...
21:32:11FromDiscord<ElegantBeef> Oh yay `Error: internal error: environment misses: a`
21:33:02FromDiscord<haxscramper> @ElegantBeef have you considered converting objects from nim side to PNode in the nimscript? It is used internally for object representation, so it might be the fastest
21:33:17FromDiscord<haxscramper> Since any other deserialization would have to be converted to PNode anyway
21:33:33FromDiscord<ElegantBeef> Dont quite follow what you mean
21:34:55FromDiscord<haxscramper> sent a code paste, see https://paste.rs/rgM
21:34:55FromDiscord<haxscramper> It is a tree repr of the VM data
21:35:11FromDiscord<haxscramper> I have an example for this, if I could find it
21:35:26FromDiscord<ElegantBeef> Doesnt that require so much more serialization logiic
21:36:00FromDiscord<haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test3.nim
21:36:27FromDiscord<haxscramper> In reply to @ElegantBeef "Doesnt that require so": Yes, and? Any other way the VM would have to do it in the end
21:36:56FromDiscord<haxscramper> So if you are passing sequence of ints for example, with flatty you would encode it, then decode in the VM, and then VM would construct an object
21:37:03FromDiscord<haxscramper> That would be represented as PNode
21:37:25FromDiscord<haxscramper> In reply to @haxscramper "https://github.com/haxscramper/hack/blob/master/tes": You can dump different things, like enums etc
21:37:32FromDiscord<haxscramper> To see what is going on
21:38:49FromDiscord<haxscramper> hnimast is needed for treeDump of the PNode, otherwise you can use astalgo/dump
21:39:03FromDiscord<Bung> cant see how it works from your link
21:39:27FromDiscord<Bung> you feed static code data
21:40:18FromDiscord<ElegantBeef> So in this case i'd override the vm procedures with the parsing of pnodes?
21:40:59FromDiscord<haxscramper> No. You should somehow just pass PNode and directly cast inside of a VM, or somehow trick compiler into thinking
21:41:17FromDiscord<haxscramper> So you create VM data manually
21:41:26FromDiscord<haxscramper> And then convince it is the real deal
21:41:28FromDiscord<ElegantBeef> then how does nimscript call Nim code
21:41:46FromDiscord<haxscramper> We are talking about passing data?
21:41:56FromDiscord<ElegantBeef> Well it's both
21:42:02FromDiscord<haxscramper> And optimizing it
21:42:25FromDiscord<ElegantBeef> I'm trying to understand how your suggestion would work
21:44:15FromDiscord<haxscramper> I think I need to make an example, probably not going to explain it good enough
21:44:48FromDiscord<Bung> it looks to me it need give a PNode for data structure and the data in memory , then use them deserialize ?
21:44:51FromDiscord<haxscramper> Certainly not now, with 30% brainpower remaining
21:44:51FromDiscord<ElegantBeef> Well i understand you get the pnodes directly then convert to/from, but i dont see how the interop is going to happen them
21:45:03FromDiscord<ElegantBeef> (edit) "them" => "then"
21:45:34FromDiscord<haxscramper> Maybe I'm missing something, I will make an example tomorrow
21:47:12FromDiscord<ElegantBeef> Well flatty doesnt work in the nimVm it lacks `copyMem`
21:59:35*pro quit (Ping timeout: 252 seconds)
22:01:07*cyraxjoe joined #nim
22:01:08*cyraxjoe quit (Client Quit)
22:02:55*cyraxjoe joined #nim
22:04:20*cyraxjoe quit (Client Quit)
22:06:01*cyraxjoe joined #nim
22:40:54FromDiscord<garett> I'm trying to figure out how to use `hasCustomPragma`, and it is not working as I expect it to↵Here is what I'm trying: https://play.nim-lang.org/#ix=3suy
22:41:33FromDiscord<garett> I want my `test` macro to be able to find the `{.swizzle.}` custom pragma attached to the `proc r`
22:43:20FromDiscord<garett> Anyone here familiar with using `hasCustomPragma` in a macro?
22:48:22FromDiscord<garett> sent a code paste, see https://play.nim-lang.org/#ix=3suC
22:52:23FromDiscord<Bung> https://github.com/bung87/scorper/blob/devel/src/scorper/http/routermacros.nim
22:52:43FromDiscord<Bung> I have this one
22:54:23FromDiscord<Bung> well, you check on proc call, it should check on proc def
22:55:28FromDiscord<garett> When you say def, is that accessible by `getType`, `getTypeInst`, or `getTypeImpl`?
22:56:03FromDiscord<Bung> am not familar with getType family apis.
22:56:06FromDiscord<garett> I see you're doing this in a template, I wonder whether it cannot be done in a macro?
22:56:36FromDiscord<Bung> maybe you try procSym.getTypeImpl.hasCustomPragma
22:58:52FromDiscord<garett> I tried it and discovered that `hasCustomPragma` can only operate on `{nnkSym, nnkBracketExpr, nnkDotExpr, nnkCheckedFieldExpr, nnkTypeOfExpr}`
23:00:05*jkl quit (Quit: ZNC 1.8.2 - https://znc.in)
23:01:32FromDiscord<Bung> weird, not including procTy
23:02:46FromDiscord<garett> looks like you can check `hasCustomPragma` only at runtime, not at compile time
23:02:52FromDiscord<garett> This is pretty disappointing 🙂
23:25:02FromDiscord<treeform> In reply to @System64 "seems they doesn't support": What kind of callbacks do you need?
23:32:30*aeverr joined #nim
23:35:18*aeverr_ quit (Ping timeout: 265 seconds)