<< 16-12-2022 >>

00:00:02*neceve quit (Quit: ZNC - https://znc.in)
00:03:06FromDiscord<demotomohiro> @! Nilts https://nim-lang.org/docs/macros.html#genSym%2CNimSymKind%2Cstring
00:03:39*neceve joined #nim
00:04:03*neceve quit (Remote host closed the connection)
00:08:32FromDiscord<demotomohiro> An idenfier is name of variable,types, procs or etc that can be not defined.↵A symbol is defined and symbol lookuped name of a thing.
00:10:38*neceve joined #nim
00:11:01*neceve quit (Remote host closed the connection)
00:18:42*neceve joined #nim
00:19:02*neceve quit (Remote host closed the connection)
00:25:38*neceve joined #nim
00:26:02*neceve quit (Remote host closed the connection)
00:29:39*neceve joined #nim
00:30:02*neceve quit (Remote host closed the connection)
00:33:18*jmdaemon joined #nim
00:33:48FromDiscord<ynfle> In reply to @not logged in "Like thats part of": Is the AST typed? if it is, you can see the type with `getType` or a proc like that
00:34:40*neceve joined #nim
00:35:01*neceve quit (Remote host closed the connection)
00:41:28FromDiscord<ambient> compiler says that i can't use deepCopy with -mm:arc, what should I use to clone objects/data?
00:41:58FromDiscord<Elegantbeef> You can do `--deepCopy:on`
00:45:10FromDiscord<ajusa> Since you're online beef, do you see any way for me to reduce duplication in https://github.com/ajusa/rowdy/blob/master/src/rowdy.nim#L29-L52? Planning on extending this to support more and more arguments, which requires I write it out by hand. Is there a varargs that supports multiple different types?
00:45:18FromDiscord<Elegantbeef> It's not clear if there will be a way to copy a graph, but no clue
00:45:37*neceve joined #nim
00:46:02*neceve quit (Remote host closed the connection)
00:47:01FromDiscord<Elegantbeef> `varargs[typed]` or `varargs[untyped]`
00:48:27FromDiscord<Elegantbeef> Really though you can do this better
00:51:18FromDiscord<! Nilts> In reply to @demotomohiro "An idenfier is name": example?
00:56:36*neceve joined #nim
00:57:02*neceve quit (Remote host closed the connection)
00:59:31FromDiscord<ajusa> In reply to @Elegantbeef "Really though you can": How can I do this better?
00:59:38*neceve joined #nim
00:59:49FromDiscord<ajusa> I assume you mean write a macro rather than doing this template trickery 😆
01:00:34FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iIi @ajusa
01:00:34FromDiscord<Elegantbeef> That makes life much much easier, though it's likely to explode
01:01:22FromDiscord<Elegantbeef> Correct
01:01:46FromDiscord<ajusa> I like methud to get around the keyword haha. Interesting, I'll see if I can work off of this. Thank you once again!
01:02:40FromDiscord<Elegantbeef> You obviously need some checks on `params` and the like but it's a start
01:02:48FromDiscord<Elegantbeef> Just count your blessings i didnt write it using micros 😄
01:10:12FromDiscord<ahungry> sent a code paste, see https://play.nim-lang.org/#ix=4iIo
01:12:03FromDiscord<! Nilts> In reply to @demotomohiro "An idenfier is name": I don't get it at all, can someone please explain or give a link to an explanation
01:12:41FromDiscord<huantian> In reply to @ahungry "I'm having bad luck": https://play.nim-lang.org/#ix=4iIp works for me
01:13:23FromDiscord<ahungry> Thanks, I must have screwed something up 🤔 I'll retrace my steps, I thought it was odd it was stopping me
01:14:56FromDiscord<ahungry> ahh, I think it was my proc params - I had it the clear out operation tucked under one, and I had `proc blub(m: Foo): void`, when it seems happy to have `proc blub(m: var Foo): void` instead
01:15:07FromDiscord<ahungry> ty for the assist
01:16:07FromDiscord<ahungry> if I know I plan to mutate things in that function that exist on `m` - is there a "by reference" annotation or something I should be giving, or is the var keyword enough?
01:18:40*xet7 joined #nim
01:23:19FromDiscord<auxym> In reply to @not logged in "I don't get it": an identifier is just a string (sort of). The nim compiler hasn't yet decided what it represents. In a later step, the compiler resolves "identifiers" by associating them with what they actually represent (a proc, a variable, a typedef...) at that point it becomes a "symbo:
01:23:21FromDiscord<auxym> symbol
01:24:21FromDiscord<auxym> You can introspect symbols to check if it's a proc, get the proc def, etc. but you can't do that with a plain identifier, the compiler doesn't know what it is yet, it's just a dumb string
01:28:02FromDiscord<! Nilts> In reply to @auxym "You can introspect symbols": How would i use symbols in macros? This seems to fix some of my problems
01:28:33FromDiscord<! Nilts> but not the one where i wan't an unnamed type
01:28:35FromDiscord<auxym> you use `typed` as the arg type
01:28:43FromDiscord<! Nilts> hmmm, ok
01:29:42FromDiscord<! Nilts> but what if i want the rest to be untyped, say i have an ident, how would i get the typing for it by transforming it into a symbol
01:30:52FromDiscord<auxym> you can't. typed and untyped macros actually get expanded at different times by the compiler. so is my understanding at least
01:31:07FromDiscord<auxym> have you seen https://dev.to/beef331/demystification-of-macros-in-nim-13n8 ? there's a typed macro example in there
01:33:17FromDiscord<huantian> In reply to @ahungry "if I know I": you can make the entire object by reference: `type Foo = ref object of RootObj`
01:33:22FromDiscord<! Nilts> ok, nvm
01:49:23FromDiscord<Elegantbeef> @ahungry\: worth noting `.setLen(0)` is better than `= @[]`
01:49:28FromDiscord<Elegantbeef> Unless you want to reallocate of course
01:55:31*pbsds quit (Quit: Ping timeout (120 seconds))
01:55:38FromDiscord<Gumbercules> In reply to @huantian "you can make the": this enables inheritance - if you simply want to declare a ref type you can omit the `of RootObj`
01:55:52*pbsds joined #nim
02:10:06*wallabra_ joined #nim
02:10:23*wallabra quit (Ping timeout: 260 seconds)
02:10:49*wallabra_ is now known as wallabra
02:23:46FromDiscord<Gumbercules> is there a way to assign a to a slice of a sequence instead of inserting elements at a certain index, without resorting to `copyMem`?
02:25:32FromDiscord<Elegantbeef> `a[a..b] = someArray`
02:26:55FromDiscord<Gumbercules> thank you
02:27:05FromDiscord<Gumbercules> probably should have tried that before asking 😅
02:27:39FromDiscord<Elegantbeef> Just remember if you have a sequence or array you want to slice and dont want to copy to assign you can do `toOpenArray` on the right side
02:27:54FromDiscord<Elegantbeef> That works on `ptr UncheckedArray[T]` `seq` and `array`
02:29:09FromDiscord<Elegantbeef> \I may or may not overly like openarrays
02:38:56FromDiscord<Gumbercules> haha I know the semantics around them have changed recently
02:38:59FromDiscord<Gumbercules> or at least semi-recently
02:39:04FromDiscord<Gumbercules> I need to read up on them again
03:00:02*neceve quit (Quit: ZNC - https://znc.in)
03:03:41*neceve joined #nim
03:04:01*neceve quit (Remote host closed the connection)
03:06:39*neceve joined #nim
03:07:01*neceve quit (Remote host closed the connection)
03:15:40*neceve joined #nim
03:16:01*neceve quit (Remote host closed the connection)
03:22:39*neceve joined #nim
03:23:01*neceve quit (Remote host closed the connection)
03:23:24*arkurious quit (Quit: Leaving)
03:26:40*neceve joined #nim
03:27:01*neceve quit (Remote host closed the connection)
03:36:39*neceve joined #nim
03:37:01*neceve quit (Remote host closed the connection)
03:47:25*pch__ joined #nim
03:47:25*pech quit (Read error: Connection reset by peer)
03:49:38*neceve joined #nim
03:50:02*neceve quit (Remote host closed the connection)
04:03:08*neceve joined #nim
04:43:46*wallabra quit (Ping timeout: 252 seconds)
04:45:17*wallabra joined #nim
04:47:48FromDiscord<theangryepicbanana> having a weird issue where using readAll on a FileStream (in this case, stdin) throws a false error https://media.discordapp.net/attachments/371759389889003532/1053171560392962148/image.png
04:49:23FromDiscord<theangryepicbanana> anyone know why this is happening?
04:49:36FromDiscord<theangryepicbanana> according to the code this shouldn't be possible
04:56:34FromDiscord<theangryepicbanana> ah, it appears I can't use stdin/out as the file in a FileStream
05:25:35*pch__ quit (Remote host closed the connection)
05:25:47*pch__ joined #nim
05:49:00FromDiscord<albassort> In reply to @treeform "I replied to your": Yeah I'm sorry I'll close it,. I realize my error before I went to sleep
06:00:02*neceve quit (Quit: ZNC - https://znc.in)
06:07:38*neceve joined #nim
06:08:01*neceve quit (Remote host closed the connection)
06:12:41*neceve joined #nim
06:13:01*neceve quit (Remote host closed the connection)
06:16:40*neceve joined #nim
06:17:01*neceve quit (Remote host closed the connection)
06:19:39*neceve joined #nim
06:20:03*neceve quit (Remote host closed the connection)
06:33:08FromDiscord<Gumbercules> the worst time to realize an error
06:33:41*neceve joined #nim
06:34:01*neceve quit (Remote host closed the connection)
06:40:39*neceve joined #nim
06:41:01*neceve quit (Remote host closed the connection)
06:49:39*neceve joined #nim
06:50:01*neceve quit (Remote host closed the connection)
06:57:41*neceve joined #nim
06:58:01*neceve quit (Remote host closed the connection)
07:01:11*neceve joined #nim
07:20:15*rockcavera quit (Remote host closed the connection)
07:50:52*pro joined #nim
07:51:10*pro left #nim (#nim)
08:17:44*pch__ quit (Read error: Connection reset by peer)
08:18:03*pch__ joined #nim
08:56:11*neceve quit (Quit: ZNC - https://znc.in)
08:57:33*neceve joined #nim
09:00:02*neceve quit (Client Quit)
09:04:40*neceve joined #nim
09:05:01*neceve quit (Remote host closed the connection)
09:05:38FromDiscord<albassort> \] https://media.discordapp.net/attachments/371759389889003532/1053236449165705246/image.png
09:05:46FromDiscord<albassort> what nim suggest do to a mf
09:12:10FromDiscord<ShalokShalom> mf?
09:12:44FromDiscord<Elegantbeef> mother fucker
09:14:09FromDiscord<albassort> perhaps if we wrote nimsuggest in C it would work better
09:15:23FromDiscord<Elegantbeef> I dont know how writing Nim in C makes it better
09:17:37*neceve joined #nim
09:18:02*neceve quit (Remote host closed the connection)
09:20:18FromDiscord<Elegantbeef> If unclear Nimsuggest is mostly just a modified compiler
09:22:39*neceve joined #nim
09:23:01*neceve quit (Remote host closed the connection)
09:25:38*neceve joined #nim
09:26:02*neceve quit (Remote host closed the connection)
09:29:40*neceve joined #nim
09:30:02*neceve quit (Remote host closed the connection)
09:36:39*neceve joined #nim
09:37:02*neceve quit (Remote host closed the connection)
09:50:04*genpaku quit (Read error: Connection reset by peer)
09:51:08FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4iJU
09:51:37*neceve joined #nim
09:52:02*neceve quit (Remote host closed the connection)
09:52:42*genpaku joined #nim
09:52:57FromDiscord<Rika> loooool
09:55:04FromDiscord<albassort> oh shit
09:55:27FromDiscord<albassort> we truly are innovators
09:58:57FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iJV
09:59:26FromDiscord<Elegantbeef> How about none
09:59:36FromDiscord<albassort> whats the 4th option
10:00:17FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/9tE
10:00:35*neceve joined #nim
10:00:51FromDiscord<albassort> thats worse
10:01:00FromDiscord<Elegantbeef> Much better
10:01:25FromDiscord<albassort>
10:16:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iJW
10:17:18FromDiscord<Phil> Basically the first option but split out over more lines to do less per line
10:17:35FromDiscord<albassort> that is the one I like the most, yes
10:18:18FromDiscord<Phil> I'd just split it over 2 lines because these are independant steps of one another in your thought process.↵Step 1: Transform data to use it later↵Step 2: iterate over transformed data
10:18:50FromDiscord<ShalokShalom> --nimcache:humanC is not really an option, no?
10:19:00FromDiscord<Phil> Depending on what you do in the loop you may just do it all in a single separate proc that you pass into the map call
10:19:17FromDiscord<ShalokShalom> @albassortthe third
10:19:36FromDiscord<Phil> (edit) "call" => "call.↵In case its just a data transformation that is more complicated than a one-liner of code."
10:20:33FromDiscord<Phil> Now that rationale would interest me why you'd want to use that over a clean map operator step
10:24:00FromDiscord<amadan> In reply to @ShalokShalom "--nimcache:humanC is not really": It is↵It specifies the output folder for cache (i.e. where generated c code is stored)↵So that switch is saying "Please leave the C code in the humanC/ directory thank you"
10:27:44FromDiscord<albassort> In reply to @Isofruit "Now that rationale would": because it makes more sense to how I thought about it, I was probably going to do it your way anyway
10:28:21FromDiscord<ShalokShalom> In reply to @amadan "It is It specifies": Ah, ok
10:28:28FromDiscord<ShalokShalom> I thought it makes the C output readable
10:28:32FromDiscord<ShalokShalom> I was already wondering
10:37:42om3gaHi there! https://play.nim-lang.org/#ix=4iJZ <-- what I'm doing wrong?
10:38:07om3gaabove C example works, and my nim analog not
10:39:42om3gayeah, it's "unsafe" operations with pointers, but then I should rewrite most parts of the lib, or find another way to store offset in riff chunk, etc..
10:41:15om3gathe function expects void **buffers ( void *channels )
10:46:28FromDiscord<amadan> https://play.nim-lang.org/#ix=4iK2 Is this like what you what? (Haven't done C in a bit so might have translated wrong)↵If the function expects then you can cast at the last moment to `array[8, pointer]` but if its always going to get an array of characters then you can make the bindings take that
10:53:47om3gaamadan, thanks, I will check this now
11:01:01FromDiscord<Phil> In reply to @albassort "because it makes more": Nah, I was asking Shalok ^^
11:01:24FromDiscord<Phil> Because the third option is imo the least nice
11:01:36FromDiscord<Phil> In reply to @ShalokShalom "<@217459674700578816>the third": Explain yourself! You made me curious!
11:06:37om3gaamadan, thank you! It works. fixed little bit, C expected void ptr, but nim compiler's type verification not allowed to feed it to function, so I changed to ptr array param type, and it now works
11:08:10FromDiscord<albassort> i wish 2.0 had more threading stuff
11:08:26FromDiscord<albassort> I don't like having slave threads to combat startup time
11:22:29FromDiscord<ShalokShalom> In reply to @Isofruit "Explain yourself! You made": Oh, vertical space?
11:23:17FromDiscord<ShalokShalom> One of the core reasons I have with Nim, is how (and that) you specify type declarations
11:23:35FromDiscord<ShalokShalom> Since that takes so much horizontal space
11:23:58FromDiscord<ShalokShalom> Short lines are key to my understanding 😄 👍🏻
11:25:06FromDiscord<ShalokShalom> Actually, I also like Beefs option
11:25:17FromDiscord<ShalokShalom> Since it seems relatively short in comparison overall
11:25:36FromDiscord<ShalokShalom> And is probably the most elegant and professional
11:26:04FromDiscord<ShalokShalom> Coming from him 😅
12:00:02*neceve quit (Quit: ZNC - https://znc.in)
12:05:37*neceve joined #nim
12:06:02*neceve quit (Remote host closed the connection)
12:14:41*neceve joined #nim
12:15:02*neceve quit (Remote host closed the connection)
12:24:42*neceve joined #nim
12:25:01*neceve quit (Remote host closed the connection)
12:27:40*neceve joined #nim
12:28:01*neceve quit (Remote host closed the connection)
12:38:05*pch__ quit (Remote host closed the connection)
12:38:18*pch__ joined #nim
12:41:25FromDiscord<Phil> In reply to @ShalokShalom "Oh, vertical space?": Is that an indirect way of saying you optimize for loc?
12:44:33FromDiscord<albassort> In reply to @ShalokShalom "And is probably the": professional.... writing an iterator for a single thing when i can just mutate it with a single line of code?
12:44:46FromDiscord<albassort> (edit) "code?" => "code, never to use it again?"
12:45:17FromDiscord<albassort> I generally only write function and iterators if it is necessary or is reused
12:45:21FromDiscord<Rika> Imagine the CPU cycles and the RAM capacitors you’re wasting!
12:45:34FromDiscord<albassort> probably none
12:45:59FromDiscord<albassort> isn't runtime code anyway
12:48:53FromDiscord<albassort> imagine reading someones code, seeing a custom iterator being used, scrolling up to look for it, seeing its like 3 lines
12:49:16FromDiscord<albassort> i don't like that stuff
12:49:49FromDiscord<albassort> how do you even name an iterator for that
12:55:41FromDiscord<amadan> Async style lol↵Name of the single proc it's being used in plus "Iter"
12:55:48FromDiscord<ShalokShalom> In reply to @Isofruit "Is that an indirect": It would be an indirect way to say to say I optimize for clarity
12:55:55FromDiscord<ShalokShalom> It actually leads to more loc
12:56:52FromDiscord<ShalokShalom> At least compared to the same language. Advanced languages are anyway much more compact than the traditional ones. F# is usually 3 to 4 times shorter
12:56:56FromDiscord<ShalokShalom> I assume Nim is the same
12:57:26FromDiscord<ShalokShalom> I am not so much concerned about loc, as about short, clear and to the point code.
12:57:56FromDiscord<albassort> In reply to @amadan "Async style lol Name": coroutine supremacy
12:58:02FromDiscord<albassort> gonna wrap libcoro.... eventually
12:58:30FromDiscord<albassort> (edit) "libcoro...." => "libaco...."
12:59:23FromDiscord<ShalokShalom> Did you know, that Discord has a new widget to display code?
12:59:30FromDiscord<ShalokShalom> I think, that works only when you upload a file.
12:59:43FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/1053295358773559336/pipexp.nim
13:00:01FromDiscord<ShalokShalom> You can change the syntax highlighting, even 🙂
13:00:12FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053295482409070602/jplang.nim
13:00:16FromDiscord<albassort> its no different
13:00:36*neceve joined #nim
13:00:44FromDiscord<ShalokShalom> No different to what?
13:00:50FromDiscord<albassort> what it was before
13:00:55FromDiscord<ShalokShalom> I didnt know that
13:01:03FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053295694712152164/image.png
13:01:05FromDiscord<albassort> this
13:01:22FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=4iKn
13:01:39FromDiscord<ShalokShalom> You did upload a file?
13:01:47FromDiscord<ShalokShalom> I never knew, that was a thing. 🙂
13:02:05FromDiscord<albassort> In reply to @albassort "": you can criticize anything here besides the lack of comments, i will document before release. code changes so fast rn
13:03:08FromDiscord<ShalokShalom> https://gist.github.com/zsup/9434452
13:03:09FromDiscord<ShalokShalom> 😛
13:03:42FromDiscord<albassort> im on like private alpha 0.8
13:04:31FromDiscord<ShalokShalom> and?
13:04:50FromDiscord<albassort> before i make my github public document stuff
13:05:02FromDiscord<albassort> (edit) "before i make my github public ... document" added "i'll"
13:34:01*oprypin_ quit (Quit: Bye)
13:34:19*oprypin joined #nim
14:49:34FromDiscord<albassort> why is my threaded code 53.2x faster than my serial code?
14:49:44FromDiscord<albassort> i only have 4 cores
14:52:41*rockcavera joined #nim
15:00:02*neceve quit (Quit: ZNC - https://znc.in)
15:07:40*neceve joined #nim
15:08:02*neceve quit (Remote host closed the connection)
15:12:14NimEventerNew thread by RodSteward: Closure dual use for objects?, see https://forum.nim-lang.org/t/9731
15:14:50*pch__ quit (Read error: Connection reset by peer)
15:15:15*disso_peach joined #nim
15:16:40*neceve joined #nim
15:17:02*neceve quit (Remote host closed the connection)
15:17:19FromDiscord<demotomohiro> @albassort Perhaps you are measuring time incorrectly.
15:18:08FromDiscord<albassort> In reply to @demotomohiro "<@217459674700578816> Perhaps you are": is cpuTime() not valid?
15:19:49*pech joined #nim
15:20:40FromDiscord<demotomohiro> I heard cpuTime can result in incorrect time in multithreaded code.↵Try monotime: https://nim-lang.org/docs/monotimes.html
15:20:59FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iL5
15:21:03*disso_peach quit (Ping timeout: 268 seconds)
15:22:34FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053331307779850260/image.png
15:22:39FromDiscord<albassort> much better
15:23:39*neceve joined #nim
15:24:01*neceve quit (Remote host closed the connection)
15:24:06FromDiscord<demotomohiro> Some related forum post: https://forum.nim-lang.org/t/9079#59185
15:24:50*pech quit (Ping timeout: 252 seconds)
15:24:59FromDiscord<albassort> now i feel better about how efficient my threadcode is without being concerned its 52x faster
15:25:30FromDiscord<juan_carlos> cpuTime is a time traveler.
15:26:01FromDiscord<juan_carlos> (edit) "cpuTime is a time traveler. ... " added "😝"
15:40:43*disso_peach joined #nim
15:42:38*neceve joined #nim
15:43:02*neceve quit (Remote host closed the connection)
15:46:40*neceve joined #nim
15:47:01*neceve quit (Remote host closed the connection)
15:49:38*neceve joined #nim
15:50:02*neceve quit (Remote host closed the connection)
15:57:16FromDiscord<Gumbercules> In reply to @albassort "now i feel better": Yeah going to be difficult to measure time with CPU time since you're code is now running on multiple CPUs
15:57:40*neceve joined #nim
15:57:51FromDiscord<Gumbercules> Hope you understand how and why this is the case if you are writing multi threaded code haha
15:58:01*neceve quit (Remote host closed the connection)
15:58:45*mistnim joined #nim
15:59:10FromDiscord<albassort> In reply to @Gumbercules "Yeah going to be": i figured cpuTime would account for that :(
15:59:13FromDiscord<albassort> i trusted
15:59:57FromDiscord<albassort> I assumed that cpuTime was thread local,
15:59:58FromDiscord<albassort> (edit) "local," => "local"
16:00:13mistnimhi, is it possible to quickly create a set of chars from a string?
16:00:22FromDiscord<albassort> @string
16:01:09*neceve joined #nim
16:02:15FromDiscord<albassort> In reply to @albassort "I assumed that cpuTime": oh wait.... if it was thread local....↵how the fuck does monotimes work
16:02:25mistnimalbassort doesnt' that create a seq?
16:02:35FromDiscord<albassort> oh shit sorry
16:02:40FromDiscord<albassort> toHashSet @"string"
16:02:50FromDiscord<albassort> i dont think there is a string to set proc
16:03:34mistnimHashSet to set?
16:04:02FromDiscord<albassort> aren't plain sets deprecated?
16:04:20FromDiscord<albassort> \ https://media.discordapp.net/attachments/371759389889003532/1053341817590005790/image.png
16:04:53FromDiscord<Rika> Plain sets are not deprecated
16:04:58FromDiscord<Rika> That function is misnamed
16:05:23FromDiscord<demotomohiro> @mistnim https://nim-lang.org/docs/setutils.html#toSet.t%2Cuntyped
16:05:43FromDiscord<demotomohiro> I think it is what you want
16:07:33mistnimthanks demotomohiro
16:12:56FromDiscord<albassort> sorry i could not be of more help?
16:13:00FromDiscord<albassort> (edit) "help?" => "help."
16:13:51FromDiscord<demotomohiro> `cpuTime` proc on posix calls `clock_gettime(CLOCK_THREAD_CPUTIME_ID, ts)`.↵`getMonoTime()` calls ↵`clock_gettime(CLOCK_MONOTONIC, ts)`.↵Here is difference: https://stackoverflow.com/questions/7506952/understanding-the-different-clocks-of-clock-gettime
16:13:52mistnimthanks albassort too
16:14:19FromDiscord<ShalokShalom> @albassort 4 cores could mean 8 threads
16:14:32FromDiscord<ShalokShalom> But this doesn't explain it
16:14:44FromDiscord<albassort> ok nerd i misspoke
16:14:50FromDiscord<ShalokShalom> Haha
16:14:50FromDiscord<albassort> i have 4 threads :)
16:14:56FromDiscord<ShalokShalom> I see 🙂
16:15:01FromDiscord<Gumbercules> @albassort CPU time sums across threada
16:15:07FromDiscord<albassort> im aware
16:15:09FromDiscord<Gumbercules> Threads
16:15:13FromDiscord<albassort> i thought about it
16:15:15FromDiscord<Gumbercules> Gotcha
16:15:27FromDiscord<albassort> now im confused on how monotimes works
16:15:33FromDiscord<albassort> sorry if that came off rude :)
16:15:40FromDiscord<Gumbercules> No it did not
16:15:50FromDiscord<Gumbercules> No worries 🙂
16:15:53FromDiscord<ShalokShalom> Well, if one process is blocking, and another process would accelerate the compilation...
16:16:01FromDiscord<ShalokShalom> Maybe because of optimisation?
16:16:12FromDiscord<ShalokShalom> I actually dont know, how this scales
16:16:31FromDiscord<albassort> what are you onabout
16:16:46*jmdaemon quit (Ping timeout: 252 seconds)
16:18:01FromDiscord<ShalokShalom> Idk, I just imagine a theoretical CPU architecture 😅
16:18:31*jmdaemon joined #nim
16:18:58FromDiscord<ShalokShalom> In which a process can accelerate the whole composition, in that it improves the effectiveness of further processing
16:19:14FromDiscord<ShalokShalom> Maybe some jump prediction, that becomes more accurate
16:19:20mistnimis it normal that conf.nim-lang.org displays the 2021 edition?
16:19:27FromDiscord<ShalokShalom> Idk, I am just making things up 😆
16:19:54FromDiscord<Gumbercules> https://github.com/nim-lang/Nim/issues/12301
16:20:10FromDiscord<ShalokShalom> @mistnim I put it in the #nimconf channel here on Discord
16:20:10FromDiscord<Gumbercules> @albassort
16:20:55*dza quit (Remote host closed the connection)
16:21:13FromDiscord<albassort> this happens with the times command in posix a well
16:21:39FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053346178454011985/image.png
16:21:46FromDiscord<albassort> time is greater than the sum
16:22:44*dza joined #nim
16:24:12*mistnim left #nim (ERC 5.4 (IRC client for GNU Emacs 28.2))
16:41:52FromDiscord<ShalokShalom> @mistnim https://nim-lang.org/nimconf2022/
16:46:20NimEventerNew Nimble package! integers - Ergonomic arbitrary precision integers wrapping GMP, see https://github.com/fsh/integers
16:58:25FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4iLp
16:58:34FromDiscord<Gumbercules> whatever function in Nim invokes those, is what you want to use
16:59:00FromDiscord<albassort> which one do you think is named best
16:59:17FromDiscord<Gumbercules> `mach` is MacOS's microkernel
16:59:40FromDiscord<albassort> windows is the worst, as per usual
16:59:47FromDiscord<albassort> think its
16:59:54FromDiscord<Gumbercules> eh, I actually like what Windows does ther
16:59:55FromDiscord<Gumbercules> (edit) "ther" => "there"
17:00:15FromDiscord<albassort> sent a long message, see http://ix.io/4iLq
17:00:25FromDiscord<Gumbercules> https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency
17:00:48FromDiscord<Gumbercules> https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter
17:01:25FromDiscord<Gumbercules> https://learn.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps?source=recommendations
17:01:40FromDiscord<Gumbercules> the Windows hate is real though haha
17:02:06FromDiscord<Gumbercules> besides the OS being a proprietary commercialized heap of ads at this point - they did at one point have some very talented programmers at Microsoft
17:02:27FromDiscord<Gumbercules> MS does an amazing job of documentation
17:02:54FromDiscord<Gumbercules> and they did know how to write really great operating systems at one point
17:03:03FromDiscord<albassort> do you feel anti-windows discrimination as an avid windows programmer
17:03:08FromDiscord<Gumbercules> it's not like that stuff has gone away - they've just piled shit on top
17:03:23FromDiscord<Gumbercules> no... I program on Windows because it's so much better for game development
17:03:33FromDiscord<Gumbercules> the tooling, the debuggers, the graphics API debuggers
17:03:44FromDiscord<albassort> yea.... game dev on linux is a bit.... welll
17:03:57FromDiscord<Gumbercules> plus that's the lion share of your audience if you're on PC so starting with anything else if you plan on earning a living off your work is short sighted
17:04:07FromDiscord<albassort> even if you get a good production method, how the fuck do you test it on pc
17:04:46*disso_peach quit (Ping timeout: 272 seconds)
17:04:50FromDiscord<albassort> it ends up being way to hard to setup building on windows machines
17:04:59FromDiscord<albassort> so you just ship over executable and hope they work
17:05:07FromDiscord<albassort> (edit) "to" => "too"
17:05:11FromDiscord<albassort> source:↵pain
17:05:31FromDiscord<albassort> i've done ss13 dev on linux :D
17:07:45FromDiscord<Gumbercules> why?
17:08:01FromDiscord<Gumbercules> why is setting u build machines on windows difficult?
17:08:11FromDiscord<Gumbercules> in comparison to any other OS? I don't understand
17:08:25FromDiscord<albassort> us unix people hate setting shit up for windows
17:08:26FromDiscord<Gumbercules> MacOS would be the most difficult by far considering you'd need Apple hardware
17:08:36FromDiscord<Gumbercules> because you don't know how the operating system works...
17:08:43FromDiscord<albassort> and when windows people dont support us we get pissy
17:09:00FromDiscord<Gumbercules> well Windows isn't trying to lose market share to Linux
17:09:08FromDiscord<albassort> i mean like, public space
17:09:11FromDiscord<Gumbercules> that would be bad for their business I imaginie
17:09:14FromDiscord<albassort> not microsoft devs
17:09:19FromDiscord<Gumbercules> MS has been a pretty amazing Linux advocate IMO
17:09:23FromDiscord<Gumbercules> with what they've done with WSL
17:09:33FromDiscord<albassort> WSL just makes windows better
17:09:39FromDiscord<Gumbercules> for web developers maybe
17:09:43FromDiscord<Gumbercules> I have no real use for it atm
17:09:53FromDiscord<albassort> when i used windows, its how i ran most things
17:10:02FromDiscord<Gumbercules> eh - it's a heavy dependency
17:10:03FromDiscord<albassort> its just so convenient
17:10:08*mistnim joined #nim
17:10:17FromDiscord<Gumbercules> if you're not doing much linux stuff it doesn't make a lot of sense to have running
17:10:31FromDiscord<Gumbercules> but regardless, stradding both operating systems isn't difficult
17:10:34FromDiscord<albassort> On a side now, DirectX api looks like the best one of its architecture
17:10:38FromDiscord<Gumbercules> I've built quite a bit of software on all three
17:10:48FromDiscord<Gumbercules> well I think Metal wins that debate but
17:10:50*mistnim quit (Client Quit)
17:10:58FromDiscord<albassort> I haven't worked in Metal
17:11:01FromDiscord<Gumbercules> DX12 is definitely a much more ergonomic API than Vulkan
17:11:13FromDiscord<albassort> I'd rather die than work in vulkan
17:11:16FromDiscord<Gumbercules> I found a nice project last night
17:11:21FromDiscord<Gumbercules> In reply to @albassort "I'd rather die than": that's extreme...
17:11:30FromDiscord<albassort> ok maybe its extreme
17:11:33FromDiscord<albassort> and i dont mean that
17:11:35FromDiscord<Gumbercules> https://github.com/SakuraEngine/SakuraEngine
17:11:36FromDiscord<albassort> but jesus
17:11:46FromDiscord<Gumbercules> has C APIs for most of its modules it seems, if not all
17:11:56FromDiscord<Gumbercules> be back in a bit, need to feed the baby
17:12:19FromDiscord<albassort> >named sakura↵>is chinese
17:12:45FromDiscord<albassort> @Gumbercules do you know chinese?
17:13:16*disso_peach joined #nim
17:20:15*disso_peach quit (Read error: Connection reset by peer)
17:35:13FromDiscord<ShalokShalom> In reply to @Gumbercules "`mach` is MacOS's microkernel": I think mach used to he the basis, they developed it further
17:35:27FromDiscord<ShalokShalom> And the whole system, including userland, is called Darwin
17:35:48FromDiscord<ShalokShalom> And they forked it like ages ago 🙂
18:00:03*neceve quit (Quit: ZNC - https://znc.in)
18:01:20FromDiscord<Gumbercules> it still is the basis for their Kernel
18:01:28FromDiscord<Gumbercules> which is why `mach` appears everywhere in their codebases
18:08:42*neceve joined #nim
18:09:02*neceve quit (Remote host closed the connection)
18:16:40*neceve joined #nim
18:17:01*neceve quit (Remote host closed the connection)
18:19:40*neceve joined #nim
18:20:02*neceve quit (Remote host closed the connection)
18:39:50*neceve joined #nim
18:40:02*neceve quit (Remote host closed the connection)
18:48:38*neceve joined #nim
18:49:01*neceve quit (Remote host closed the connection)
18:51:00FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4iLS
18:51:40*neceve joined #nim
18:51:44FromDiscord<Gumbercules> Sequences are homogeneous
18:52:01*neceve quit (Remote host closed the connection)
18:52:36FromDiscord<Gumbercules> And the compiler is right, Shader uniforms is not concrete unless the generic parameter is provided
18:52:59FromDiscord<sOkam!> But if I provide it I lock the seq to be homogeneous, like you said
18:53:13FromDiscord<sOkam!> Is there a type that can hold non-homogeneous data?
18:54:10FromDiscord<Gumbercules> No but you could make shader uniforms an object variant
18:54:36FromDiscord<Gumbercules> Or store the data as a byte array and serialize / deserialize which is what I do
18:55:16FromDiscord<Gumbercules> Well not for shader uniforms since I have reflection data for my shaders
18:55:45FromDiscord<Gumbercules> But for other things like storing my draw commands in a buffer
18:56:17FromDiscord<sOkam!> object variants sound more reasonable for this case, I believe 🤔
19:00:09*neceve joined #nim
19:22:10FromDiscord<ShalokShalom> In reply to @Gumbercules "it still is the": I dont think so
19:22:21FromDiscord<ShalokShalom> They forked and call it XNU today
19:22:23FromDiscord<ShalokShalom> https://en.m.wikipedia.org/wiki/Mach_(kernel)
19:22:40FromDiscord<Gumbercules> well yeah but I mean, it didn't stop being based on it
19:22:42FromDiscord<<She>Horizon</Her>> Is Nim suitable for being ran in 4MB of RAM?
19:22:50FromDiscord<Gumbercules> I'm not saying it is still the same as when they originalllyl forked it
19:23:09FromDiscord<Gumbercules> In reply to @Event Horizon "Is Nim suitable for": sure, why not?
19:23:41FromDiscord<<She>Horizon</Her>> Just wondering, since I'm gonna be working on a project using WASM limited to 4 MB of RAM
19:23:58FromDiscord<<She>Horizon</Her>> And i plan to try and minimise as much of the RAM consumption as possible
19:24:12FromDiscord<Gumbercules> Probably going to have to bring your own stdlib but
19:24:28FromDiscord<Gumbercules> it's most definitely doable - might want to ask for tips in #embedded
19:24:36FromDiscord<ShalokShalom> Doesn't this small stdlib that Alpine uses work?
19:24:58FromDiscord<ShalokShalom> How was its name?
19:25:00FromDiscord<Gumbercules> I'm talking Nim's stdlib
19:25:04FromDiscord<ShalokShalom> Ah
19:25:05FromDiscord<Gumbercules> probably not going to be able to use that - no seqs or strings
19:26:09FromDiscord<Gumbercules> but I don't know what your program is doing or what you plan to do with it so it's a bit hard to anticipate what issues you're going to run into
19:29:28FromDiscord<Gumbercules> if you're smart about allocations you can probably get away with using the stdlib but four million bytes is not that much memory
19:29:39FromDiscord<<She>Horizon</Her>> In reply to @Gumbercules "Probably going to have": Yeah that's fair enough
19:29:41FromDiscord<Gumbercules> at least not in the context of modern computers
19:29:44FromDiscord<<She>Horizon</Her>> In reply to @Gumbercules "it's most definitely doable": Thanks!
19:29:48FromDiscord<Gumbercules> sure thing
20:07:57Amun-Rawhat's Nim's way of except (ValueError, IOError) as e:?
20:30:13FromDiscord<juan_carlos> In reply to @Amun-Ra "what's Nim's way of": `try: discard 9 div 0 except AssertionDefect, OverflowDefect, DivByZeroDefect: echo getCurrentException().msg`
21:00:03*neceve quit (Quit: ZNC - https://znc.in)
21:03:40*neceve joined #nim
21:04:02*neceve quit (Remote host closed the connection)
21:08:40*neceve joined #nim
21:08:55*junaid_ joined #nim
21:09:01*neceve quit (Remote host closed the connection)
21:11:27FromDiscord<Yepoleb> How can i await an AsyncEvent?
21:13:32FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iMQ amun-ra
21:13:40FromDiscord<Elegantbeef> I dont know why juan carlos is showing defects
21:18:43*junaid_ quit (Quit: leaving)
21:31:31*junaid_ joined #nim
21:37:30*junaid_ quit (Quit: leaving)
21:37:50*junaid_ joined #nim
21:39:08*junaid_ quit (Remote host closed the connection)
21:40:01FromDiscord<daniellowrie (Daniel Lowrie)> Is there a way to use a string variable with newHttpHeaders()?
21:42:01FromDiscord<Elegantbeef> Of course it takes in an array of `(key, val)`
21:42:15FromDiscord<Elegantbeef> you can do `newHttpHeader({"MyKey": myVal})`
21:44:16FromDiscord<daniellowrie (Daniel Lowrie)> So if I create↵`let myVal = "foo"`↵how can I then do↵`client.headers = newHttpHeaders({ "MyKey" : myVal})`
21:44:48FromDiscord<Elegantbeef> That should work
21:45:57FromDiscord<daniellowrie (Daniel Lowrie)> Ok, so that looks like it "Worked", but I'm getting a 400 Bad Request error, and the header doesn't show up in the logs, just a blank space
21:47:20*disso_peach joined #nim
21:48:00*disso_peach quit (Client Quit)
21:49:10FromDiscord<daniellowrie (Daniel Lowrie)> Looks like the variable is adding a "\\n" char to the header. Any way I can easily strip that out?
21:50:35FromDiscord<Elegantbeef> No clue
21:58:36FromDiscord<daniellowrie (Daniel Lowrie)> Thanks, gonna see what I can do with stripLineEnd
22:19:00FromDiscord<Phil> Beef, do you actually unit-test or do you purely integration-test your code?
22:19:25FromDiscord<Elegantbeef> Am i supposed to know the difference?
22:25:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iNn
22:26:42FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4iNn" => "https://play.nim-lang.org/#ix=4iNp"
22:27:08FromDiscord<Elegantbeef> You can do mock testing in a variety of ways with Nim https://forum.nim-lang.org/t/9255
22:27:34FromDiscord<Elegantbeef> Personally I dont do mock testing, i just test the public facing API which i guess is integration testing
22:28:23FromDiscord<Phil> It's testing the intended public-facing API of the entire package vs. testing the public API of each individual module file I guess
22:30:44FromDiscord<Elegantbeef> Remember though Phil i dont write software that requires network or anything that cannot be ran at once 😄
22:32:35FromDiscord<Phil> While that's true, chances are you do write software where one of your own procs calls another of your own procs from another module, which calls another of your own procs from another module, and if you go deep enough with that kind of chain then sooner or later scenarios can become quite complicated, as can Integration testing
22:33:14FromDiscord<Elegantbeef> I generally only care that shit doesnt regress and that I can say "it works"
22:33:14FromDiscord<Phil> Araqs approach seems to be "Do Integration testing, write your code functional-style and if it's hard your data types are wrong"
22:33:48FromDiscord<Phil> Elcritch's approach using "patchFile" seems interesting
22:35:09FromDiscord<Elegantbeef> > chances are you do write software↵Doubt
22:41:49FromDiscord<Phil> Anyway, the approach seems kinda exhausting.↵You'd be setting up basically a set of "mock-modules" that contain multiple variations of each proc you have, and you then have various folders with config.nims files that each patch individual modules that your module-under-test imports, to use one of the "mock"-modules
22:44:00FromDiscord<Elegantbeef> alternatively you have a `-d:mock` and use that for pointer procedures for procedures you want to mock
22:45:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iNs
22:46:15FromDiscord<Elegantbeef> But this still makes you manually annotated ever procedure with `{.mock.}`
22:46:37FromDiscord<Phil> Which would also be incredibly inconvenient
22:48:33FromDiscord<Elegantbeef> Well you want to change procedures bodies at either runtime or compile time which means you need to have something that allows it
22:48:54FromDiscord<Elegantbeef> Ostensibly you want to change it for everything down the line
22:49:07FromDiscord<Elegantbeef> Which means you either need to do what vindaar does or what mock does
22:50:37FromDiscord<Phil> I pretty much glossed over it the second Vindaar wrote they didn't consider it a good idea to use
22:51:41FromDiscord<Elegantbeef> I think it's likely a fine idea assuming you remove the "dont know what i'm doing" 😄
22:55:38*ltriant quit (Ping timeout: 272 seconds)
23:05:29FromDiscord<vindaar> sent a long message, see http://ix.io/4iNv
23:05:51FromDiscord<Elegantbeef> It wont work in places the compiler inlines code
23:06:02FromDiscord<Elegantbeef> So if you compile with optimisation enabled it'll possibly fail
23:06:38FromDiscord<vindaar> ah, that's a good point. Need a function pointer at runtime after all
23:06:55FromDiscord<Phil> Do tests compile with that optimization?
23:06:56FromDiscord<vindaar> related to my pragma thing, it's still around in my code https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/private/geometry.nim#L489 😅
23:07:13FromDiscord<Elegantbeef> It depends on your code
23:18:52*qwestion joined #nim
23:48:23*ltriant joined #nim
23:54:07*ltriant quit (Ping timeout: 268 seconds)