<< 05-09-2021 >>

00:03:41*auxym_ quit (Ping timeout: 252 seconds)
00:37:14FromDiscord<fae> So many features in Nim lol. Was trying to get way too fancy with the macrocache module, and now I have just figured out there’s a compileTime pragma lol
00:40:07FromDiscord<Elegantbeef> Well depending on what you're doing, but macrocache will be better as it will work with the IC
00:46:14FromDiscord<fae> Good to know
00:47:04FromDiscord<fae> Does it persist to some db or something
00:48:28FromDiscord<Elegantbeef> I think it's just easier to handle serialization for the cache as such is what is prefered
00:48:42FromDiscord<Elegantbeef> Since it stores AST instead of arbitrary types
00:49:56FromDiscord<Elegantbeef> But yes it's stored in/with the rod files(name of the IC files)
01:04:13*bkay joined #nim
01:04:44*beshr quit (Ping timeout: 252 seconds)
01:12:24*neurocyte8 joined #nim
01:12:24*neurocyte8 quit (Changing host)
01:12:24*neurocyte8 joined #nim
01:13:50*audiophile_ joined #nim
01:16:17*neurocyte quit (Ping timeout: 252 seconds)
01:16:17*neurocyte8 is now known as neurocyte
01:25:53*Gustavo6046 quit (Remote host closed the connection)
01:34:19*Gustavo6046 joined #nim
01:58:07*audiophile_ quit (Quit: Default Quit Message)
02:20:23*flynn quit (Read error: Connection reset by peer)
02:21:29*flynn joined #nim
02:45:01*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
02:47:31*arkurious quit (Quit: Leaving)
02:53:38*bkay quit (Ping timeout: 252 seconds)
02:57:12*Gustavo6046 joined #nim
03:02:26*audiophile_ joined #nim
03:05:19*audiophile joined #nim
03:08:29*audiophile_ quit (Ping timeout: 252 seconds)
03:08:30*audiophile is now known as audiophile_
03:17:40*Gustavo6046 quit (Ping timeout: 240 seconds)
03:32:37*audiophile_ quit (Quit: Default Quit Message)
04:06:01*supakeen quit (Quit: WeeChat 3.2)
04:06:30*supakeen joined #nim
04:10:52FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xXW
04:11:05FromDiscord<Elegantbeef> You can with macros 😛
04:11:13FromDiscord<impbox [ftsf]> >_>
04:11:49FromDiscord<Elegantbeef> No you cannot easily do it though
04:13:17FromDiscord<Elegantbeef> https://github.com/beef331/constructor/blob/master/tests/timplements.nim example of what new concepts + a macro can do
04:13:57FromDiscord<Elegantbeef> Dont recall how that works presently
04:13:58FromDiscord<impbox [ftsf]> nice
04:47:12*flynn quit (Ping timeout: 256 seconds)
04:48:31*flynn joined #nim
06:43:30*jjido joined #nim
06:50:04NimEventerNew thread by Stefan_Salewski: JSON serialization of objects containing tuples, see https://forum.nim-lang.org/t/8399
07:20:43*beshr joined #nim
07:55:27*max22- joined #nim
08:40:27*supakeen quit (Remote host closed the connection)
08:40:52*supakeen joined #nim
09:06:34*flynn quit (Read error: Connection reset by peer)
09:07:44*flynn joined #nim
09:27:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:11:08*flynn quit (Read error: Connection reset by peer)
10:12:15*flynn joined #nim
10:17:10*audiophile_ joined #nim
10:18:41*audiophile_ quit (Client Quit)
10:27:05FromDiscord<ynfle (ynfle)> Is there a way to not have `json` escape strings?
10:28:05FromDiscord<ynfle (ynfle)> With out rewriting `toUgly` or `pretty`
10:28:15FromDiscord<enthus1ast> then its not valid json; what do you want to archive?
10:31:47FromDiscord<ynfle (ynfle)> Not archive anything. Using it as a communication tool
10:32:59FromDiscord<enthus1ast> sorry, the proper english word is\: achieve
10:33:02FromDiscord<enthus1ast> \:)
10:33:28*auxym_ joined #nim
10:34:30FromDiscord<ynfle (ynfle)> OH haha
10:34:49FromDiscord<ynfle (ynfle)> Communicate with service that doesn't want escaped json for proper display
10:36:06FromDiscord<haxscramper> so it expects `{field: value}` instead of `{"field": "value"}`?
10:39:21FromDiscord<ynfle (ynfle)> No. Just no espacing newlines for wehere I want a new line displayed
10:39:34FromDiscord<ynfle (ynfle)> meaning the semantice difference between `\n` & `\\n`
10:39:41FromDiscord<enthus1ast> json must encode \\n
10:39:48FromDiscord<ynfle (ynfle)> y?
10:39:53FromDiscord<enthus1ast> yeah
10:39:59FromDiscord<ynfle (ynfle)> ?
10:40:09*jjido joined #nim
10:40:17FromDiscord<enthus1ast> inside a json string the newline must be encoded
10:40:28FromDiscord<ynfle (ynfle)> Y?
10:40:36FromDiscord<ynfle (ynfle)> Is that the spec?
10:44:31FromDiscord<enthus1ast> https://datatracker.ietf.org/doc/html/rfc7159#section-7 "...except for the characters that must be escaped\:↵ quotation mark, reverse solidus, and the control characters (U+0000↵ through U+001F)...."
10:44:44FromDiscord<enthus1ast> "U+000A"
10:45:06FromDiscord<enthus1ast> but INSIDE a json string
10:45:32*auxym_ quit (Read error: No route to host)
10:45:52*auxym_ joined #nim
10:46:25FromDiscord<enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/884026255530409995): "U+000A" == \<End of Line\> (EOL, LF, NL)
10:48:07FromDiscord<enthus1ast> ?
10:48:10FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3xYR
10:48:50FromDiscord<enthus1ast> if yes then it's a strange service \:D
10:49:03FromDiscord<ynfle (ynfle)> No
10:49:31FromDiscord<ynfle (ynfle)> `{"foo": "baa\nzaa\ngaa"}`
10:49:41FromDiscord<ynfle (ynfle)> So I guess yes
10:50:00*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:50:48FromDiscord<enthus1ast> no this would be correct
10:51:54FromDiscord<ynfle (ynfle)> Which?
10:51:57FromDiscord<ynfle (ynfle)> I'm confused
10:52:04*auxym_ quit (Ping timeout: 252 seconds)
10:52:06FromDiscord<enthus1ast> this one is correct sjon
10:53:38*xet7 quit (Quit: Leaving)
10:56:17FromDiscord<Rika> What are you seeing that is unexpected then?
11:05:25*auxym_ joined #nim
11:06:08FromDiscord<ynfle (ynfle)> So I'm confused
11:06:22*max22- quit (Ping timeout: 245 seconds)
11:14:58FromDiscord<cabboose> yo am i to understand the selector module kind of gives a threadsafe Qt signal like architecture?
11:15:02FromDiscord<cabboose> not like signals
11:15:04*auxym_ quit (Read error: No route to host)
11:15:04FromDiscord<cabboose> but at the same time
11:15:07FromDiscord<cabboose> like signals
11:15:26*auxym_ joined #nim
11:15:28FromDiscord<cabboose> 👀
11:16:57FromDiscord<cabboose> I mean I was going to use channels to pass around jobs but if selectors has a api for that kind of thing then great
11:23:58*auxym_ quit (Ping timeout: 252 seconds)
11:30:10*auxym_ joined #nim
11:38:33*PMunch joined #nim
12:02:41*jjido joined #nim
12:06:02*supakeen quit (Quit: WeeChat 3.2.1)
12:06:31*supakeen joined #nim
12:09:40*auxym_ quit (Ping timeout: 250 seconds)
12:10:55*auxym_ joined #nim
12:18:07FromDiscord<ynfle (ynfle)> I thought you said that `\n` has to be escaped?
12:18:56FromDiscord<enthus1ast> no, the literal newline must be converted to "\\n" when in json string
12:23:32FromDiscord<enthus1ast> this means that a literal newline is not allowed in json string
12:24:24FromDiscord<enthus1ast> can you describe your issue? Maybe it's something else completely
12:24:24*auxym_ quit (Ping timeout: 250 seconds)
12:27:32*auxym_ joined #nim
12:35:24FromDiscord<fae> is compiling to cpp generally fine if you are intending to use the src on ios/android? or is generated c code much easier to use on those platforms
12:38:24FromDiscord<fae> And that may be more of an XY problem question. Basically I'm trying to static link https://github.com/facebook/yoga in, but since it's a c++ lib I need to compile with `nim cpp`, and just wondering if that will create portability problems down the line. It seems like `nim c` is generally favored.
12:38:27nrds<R2D299> itHub: 7"Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates."
12:45:02*arkurious joined #nim
12:46:58*flynn quit (Read error: Connection reset by peer)
12:48:05*flynn joined #nim
12:52:15FromDiscord<dom96> on iOS you may need to compile to Obj C
12:52:22FromDiscord<dom96> something to keep in mind
12:52:26FromDiscord<dom96> for android C++ should be fine
12:55:00FromDiscord<fae> I suppose that also means if I try to turn it into a nimble package that any project relying on it would need to be compiled as cpp
12:56:27FromDiscord<dom96> yep
13:12:56FromDiscord<cabboose> I am struggling to make even a simple example of chronos callbacks work
13:13:07FromDiscord<cabboose> I thought I would be able to easily access the futures data within the callback
13:13:25FromDiscord<cabboose> but if it's outside the scope of the cb it complains about accessing GC data
13:14:03FromDiscord<cabboose> using the udata thing seems tedious to have to cast the pointer to the correct data type especially if it's nested
13:14:14FromDiscord<cabboose> is there any examples out there in the wild to hazard a look at?
13:20:59NimEventerNew post on r/nim by iapetus-11: First 100,000 numbers in Recaman's sequence graphed, with colors (in Nim)!, see https://reddit.com/r/nim/comments/picyn5/first_100000_numbers_in_recamans_sequence_graphed/
13:29:03*max22- joined #nim
13:49:08*Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
13:49:47*Amun-Ra joined #nim
13:59:35FromDiscord<kodkuce> does nim have a debuger like c# where i can see values live and move true code
14:00:43PMunchYou can use GDB
14:02:31FromDiscord<kodkuce> hmm i think it just shoot me to brain its compiled to C or C++ so hmm yep, but guessing then it will move true generated C code not my nim files right
14:02:56Zevvno it does debugging at the nim source level
14:03:35Zevvfor even more fun use the `nim-gdb` wrapper
14:03:57Zevvthat has some additional improvements for demangingling and the like, iirc
14:15:53FromDiscord<kodkuce> nice i tough i am doomed to looking at C gen stuff
14:32:00*auxym_ quit (Quit: Konversation terminated!)
14:32:12*auxym_ joined #nim
14:38:07*beshr quit (Ping timeout: 252 seconds)
14:50:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:54:46*auxym_ quit (Ping timeout: 250 seconds)
15:16:37*auxym_ joined #nim
15:26:13*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
15:44:40*auxym_ quit (Ping timeout: 240 seconds)
15:52:41*Vladar joined #nim
16:09:11*beshr joined #nim
16:14:46*Gustavo6046 joined #nim
17:53:08*jjido joined #nim
18:09:45*auxym_ joined #nim
18:24:54*max22- quit (Ping timeout: 256 seconds)
18:28:50*PMunch quit (Quit: leaving)
18:31:53*Vladar quit (Read error: Connection reset by peer)
18:54:26*max22- joined #nim
19:09:55*max22- quit (Quit: Leaving)
19:10:13FromDiscord<chicken mcnuggets> hey im trying to use the stew/endian2 module
19:10:33FromDiscord<chicken mcnuggets> when i try to convert a uint16 to a SomeEndianInt it always just outputs as a uin16
19:11:10*auxym_ quit (Ping timeout: 240 seconds)
19:11:21FromDiscord<chicken mcnuggets> sent a code paste, see https://play.nim-lang.org/#ix=3y1p
19:17:19Zevvexcellent question
19:24:45FromDiscord<chicken mcnuggets> any ideas?
19:25:56FromDiscord<kamy> Im trying to make a seq of a type, when I do type(object) it returns wStaticBitmap correctly, but seq[wStaticBitmap] fails when I try to .add(object) to it.
19:26:48FromDiscord<kamy> says type mismatch: got <seq[wStaticBitmap], wStaticBitmap>
19:30:20FromDiscord<kamy> sent a code paste, see https://play.nim-lang.org/#ix=3y1r
19:31:58FromDiscord<kamy> (edit) "https://play.nim-lang.org/#ix=3y1r" => "https://play.nim-lang.org/#ix=3y1t"
19:31:59FromDiscord<haxscramper> You can't add type
19:32:12FromDiscord<haxscramper> Type does not exist at runtime
19:32:33FromDiscord<haxscramper> You can only have sequence of type instances/objects
19:32:40FromDiscord<haxscramper> And this is almost always an XY problem
19:32:44FromDiscord<haxscramper> What are you trying to do?
19:33:46FromDiscord<kamy> I need a way of storing a bunch of wStaticBitmap because I need to hold them to change later. The amount is variable.
19:34:36FromDiscord<haxscramper> What is `wStaticBitmap`? Can you show the whole error, I don't think your description matches the code you provided. `sBM` is an object, you are not trying to add type
19:34:52FromDiscord<haxscramper> ah
19:34:53FromDiscord<haxscramper> ofc
19:34:57FromDiscord<haxscramper> `let imgSeq`
19:34:59FromDiscord<haxscramper> it is immutable
19:35:09FromDiscord<haxscramper> `var imgSeq`
19:35:24FromDiscord<kamy> omg what a stupid mistake
19:35:58FromDiscord<kamy> its working. thanks so much
19:36:00*Gustavo6046 quit (Ping timeout: 250 seconds)
19:37:10*Gustavo6046 joined #nim
19:40:33FromDiscord<chicken mcnuggets> anyone able to help me with my issue?
19:41:23Zevvit's a typeclass
19:41:28Zevvand I never understood these
19:41:39ZevvI'd expect your code to fail or to fit your const into any of the underlying uint types
19:41:53ZevvI'm probably just not smart enough to understand the docs
19:53:33*max22- joined #nim
20:02:30*auxym_ joined #nim
20:12:59FromDiscord<x0tic> These are real bots?
20:14:28FromDiscord<InventorMatt> bots have achieved sentience
20:28:35FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=3y3u
20:30:42FromDiscord<tandy> can you have an async `block`?
20:34:17*flynn quit (Read error: Connection reset by peer)
20:34:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3y3x
20:35:09*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:35:23*flynn joined #nim
20:35:40FromDiscord<Elegantbeef> Otherwise you'd want a macro
20:37:16FromDiscord<auxym> Possibly, thanks. good option for a 1-liner. But my original solution allows setting multiple fields with a single template call, which is also important for my use case. I might actually define both.
20:38:00FromDiscord<Elegantbeef> have you considered the `with` macro?
20:38:13FromDiscord<auxym> Might look into a macro, but I have to admit I haven't entirely wrapped my head around them yet. Probably unecessary just to have the convenience of a 1 liner, too.
20:38:29FromDiscord<auxym> Did not know `with`, I'll have a look
20:38:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3y3y
20:40:21FromDiscord<Elegantbeef> Think there is a more usable version on nimble but idk i've never usued either
20:43:10*auxym_ quit (Ping timeout: 256 seconds)
20:45:50*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
20:50:53*jjido joined #nim
20:51:11*neurocyte joined #nim
20:51:11*neurocyte quit (Changing host)
20:51:11*neurocyte joined #nim
20:55:05*jjido quit (Client Quit)
21:40:03*auxym_ joined #nim
21:50:25*auxym_ quit (Ping timeout: 252 seconds)
21:59:32*max22- quit (Quit: Leaving)
22:43:50*auxym_ joined #nim
23:15:11FromDiscord<aleclarson> how do i `import` just one thing?
23:15:58FromDiscord<aleclarson> oh nvm i found it
23:16:42FromDiscord<Elegantbeef> `from X import Y` for any lurkers 😀
23:20:10FromDiscord<techno3d> sent a code paste, see https://play.nim-lang.org/#ix=3y3Z
23:20:41FromDiscord<Elegantbeef> It's not overly idiomatic but nim doesnt care if you do or not
23:20:46FromDiscord<Elegantbeef> it's useful for things like
23:20:55FromDiscord<Elegantbeef> !eval var a = 100; echo a
23:20:57NimBot100
23:29:57*flynn quit (Remote host closed the connection)
23:31:05*flynn joined #nim
23:34:28FromDiscord<techno3d> Oh nice↵↵I don't have to give up semicolans
23:47:44FromDiscord<Yardanico> but bear in mind that having semicolons in usual nim code is a pretty strong code smell :)
23:47:56FromDiscord<Yardanico> quite a lot of "modern" languages don't require semicolons anymore
23:52:23FromDiscord<Elegantbeef> Indeed semicolon insertion is lovely
23:54:19FromDiscord<Iapetus11> sent a code paste, see https://play.nim-lang.org/#ix=3y43
23:54:52FromDiscord<Iapetus11> (edit) "https://play.nim-lang.org/#ix=3y43" => "https://play.nim-lang.org/#ix=3y44"
23:54:55FromDiscord<Elegantbeef> Well if this is a library certainly no, secondly it should be `std/random`
23:55:32FromDiscord<Iapetus11> (edit) "https://play.nim-lang.org/#ix=3y44" => "https://play.nim-lang.org/#ix=3y45"
23:55:43FromDiscord<Iapetus11> 👍
23:55:45FromDiscord<aleclarson> what could be the cause of `template/generic instantiation of "some" from here` when using `some` from `options`?
23:55:55FromDiscord<Yardanico> In reply to @aleclarson "what could be the": that's not the full error message
23:55:59FromDiscord<Yardanico> show the full error message that the compiler shows
23:56:14FromDiscord<Elegantbeef> The issue with using `randomize` there is you've now overwritten the state so if someone had seeded it you've fucked them over
23:56:27FromDiscord<aleclarson> In reply to @Yardanico "that's not the full": it's the full message that VS Code shows, unless there's somewhere else i can look
23:56:27FromDiscord<Yardanico> yeah it only makes sense to call randomize() in apps
23:56:33FromDiscord<Yardanico> In reply to @aleclarson "it's the full message": check the compiler output as I said
23:56:40FromDiscord<Yardanico> compile the nim file and show the compiler output
23:56:50FromDiscord<Elegantbeef> The compiler is the best way to see issues
23:57:08FromDiscord<Yardanico> in libraries you don't want to call randomize() as that should be left for the application that's using the library
23:57:14FromDiscord<Yardanico> at most you can have a local random state
23:57:21FromDiscord<auxym> @ElegantBeef Is it a new recommendation to prefix stdlib imports with `std/`? I've been seeing it recently but I don't recall hearing about it before
23:57:32FromDiscord<Yardanico> In reply to @auxym "<@!145405730571288577> Is it a": yes, it is
23:57:37FromDiscord<aleclarson> In reply to @Yardanico "check the compiler output": oh very nice
23:57:42FromDiscord<Yardanico> new modules are only created in std/ prefix
23:57:53FromDiscord<aleclarson> > Cannot prove that 'result' is initialized. This will become a compile time error in the future.
23:57:55FromDiscord<Yardanico> so it's much better to import all stdlib modules with the std/ prefix
23:58:01FromDiscord<Elegantbeef> You also may want to expose procs that take a `Rand` object
23:58:19FromDiscord<auxym> I see. Any further reading? A blog post or changelog or something?
23:58:19FromDiscord<Yardanico> if you want to import multiple, it's possible the same way as before on a single line - `import std/[strutils, strscans, strformat]`
23:58:33FromDiscord<Yardanico> In reply to @auxym "I see. Any further": can't think of anything like that, it's not like this change requires some deep reading
23:58:38FromDiscord<Elegantbeef> The 1.6 docs go so far to put `std/modulename` in the title
23:58:41FromDiscord<aleclarson> In reply to @aleclarson "> Cannot prove that": so using a `not nil` variable with `options` is discouraged, i guess
23:58:45FromDiscord<Yardanico> In reply to @Elegantbeef "The 1.6 docs": yeah, that too
23:59:00FromDiscord<Yardanico> std prefix is there so that user modules (or modules from nimble) don't clash with stdlib ones
23:59:10FromDiscord<Yardanico> btw, for nimble packages you can use the `pkg` import prefix
23:59:22FromDiscord<auxym> Well, yeah, just wondering why everyone started doing that
23:59:25FromDiscord<Yardanico> `import pkg/[regex, mathexpr]`
23:59:34FromDiscord<Elegantbeef> Makes it harder to clash with modules accidently
23:59:35FromDiscord<Yardanico> In reply to @auxym "Well, yeah, just wondering": as I said, so that it doesn't clash with user modules
23:59:44FromDiscord<Elegantbeef> unless you're daft enough to make a folder named `std` \:P
23:59:44FromDiscord<auxym> I see.
23:59:53FromDiscord<auxym> try me 😉