<< 27-04-2021 >>

00:01:42FromDiscord<Anuke> I have a `type` composed of 4 `unit8`s, and I would like to to take up exactly 4 bytes in memory and be cast-able into an int32/float32. Questions:↵1. Is it guaranteed to take up exactly 4 bytes?↵2. Are the fields guaranteed to be in order, e.g. with offsets of 0/1/2/3 bytes? They are on my machine, but I need to be sure it still works that way on others.↵3. Do I need to use the `{.packed.}` pragma here at all?
00:01:49ForumUpdaterBotNew question by Alex Craft: How to avoid modifying function with macros pragma?, see https://stackoverflow.com/questions/67275225/how-to-avoid-modifying-function-with-macros-pragma
00:03:07FromDiscord<ElegantBeef> @Anuke you can do `type TypeName {.size:4.}` to make sure it takes up 4 bytes, which i imagine should disable alignment and similar optimizations
00:03:40FromDiscord<ElegantBeef> Alternatively you can do `type Typename = array[4, byte]` 😄
00:04:54FromDiscord<Anuke> Is the size pragma documented somewhere? I don't see it in the manual
00:06:10FromDiscord<ElegantBeef> Doesnt seem like it's explicitly documented, just used in enum examples
00:08:33FromDiscord<demotomohiro> In reply to @exelotl "yeah I'm working under": It seems defer can be used with --gc:none --os:standalone↵https://wandbox.org/permlink/wLUmfAWB7mUWfnKh
00:09:32FromDiscord<exelotl> oh! this changes everything 👀
00:10:09FromDiscord<exelotl> imma have to advocate for defer now (previously I didn't care about it) xD
00:24:53ForumUpdaterBotNew thread by Spip: [ANN] Nim0, a playground to learn compiler internals, see https://forum.nim-lang.org/t/7866
00:52:45*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:53:04*njoseph joined #nim
00:56:43*Tanger joined #nim
01:06:48*Tlangir joined #nim
01:09:25*Tanger quit (Ping timeout: 252 seconds)
01:11:57*abm quit (Read error: Connection reset by peer)
01:49:54*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
01:50:21*johnnynitwits joined #nim
01:53:29*johnnynitwits quit (Client Quit)
01:53:53*johnnynitwits joined #nim
02:00:49*MTRNord quit (Ping timeout: 245 seconds)
02:01:03*MTRNord joined #nim
02:18:14*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
02:18:49*johnnynitwits joined #nim
02:25:37*wasted_youth2 joined #nim
02:26:13*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
02:26:36*johnnynitwits joined #nim
02:30:30*teal joined #nim
02:32:02*teal quit (Client Quit)
02:35:52*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
02:36:16*johnnynitwits joined #nim
02:37:17*johnnynitwits quit (Client Quit)
02:38:15*johnnynitwits joined #nim
02:43:17*wasted_youth2 quit (Ping timeout: 250 seconds)
02:44:09*wasted_youth2 joined #nim
02:45:33*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
02:46:10*johnnynitwits joined #nim
02:46:18*johnnynitwits quit (Client Quit)
02:46:46*johnnynitwits joined #nim
02:46:54*Tlangir quit (Remote host closed the connection)
02:47:16*Tlangir joined #nim
02:49:47*D_ quit (Ping timeout: 250 seconds)
02:51:21*D_ joined #nim
02:55:53*thomasross quit (Ping timeout: 240 seconds)
03:18:59*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
03:19:22*johnnynitwits joined #nim
03:25:35*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
03:26:06*johnnynitwits joined #nim
03:53:30*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
03:53:54*spiderstew_ joined #nim
03:53:55*johnnynitwits joined #nim
03:54:59*spiderstew quit (Ping timeout: 245 seconds)
03:58:27*johnnynitwits quit (Client Quit)
03:58:52*johnnynitwits joined #nim
04:22:19*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
04:22:52*johnnynitwits joined #nim
04:22:55*johnnynitwits quit (Excess Flood)
04:23:06*johnnynitwits joined #nim
04:29:01*narimiran joined #nim
04:30:23*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
04:31:04*johnnynitwits joined #nim
04:38:24*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
04:38:51*johnnynitwits joined #nim
05:02:29*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
05:03:03*johnnynitwits joined #nim
05:15:55*rockcavera quit (Remote host closed the connection)
05:41:40FromDiscord<Varriount> @c-blake Could you merge these comments please? https://github.com/nim-lang/RFCs/issues/267#issuecomment-825584327
06:12:39ForumUpdaterBotNew Nimble package! nmark - fast markdown parser, see https://github.com/kyoheiu/nmark
06:17:09FromDiscord<ElegantBeef> Shame yet another pushed binary 😄
06:17:41FromDiscord<ElegantBeef> If i say kyoheiu 3 times it summons them and i can point out they pushed a binary right?
06:22:51*D_ quit (Remote host closed the connection)
06:23:46*D_ joined #nim
06:25:19*johannes_ joined #nim
06:26:44*arecaceae quit (Remote host closed the connection)
06:27:03*arecaceae joined #nim
07:15:23*grimler32 quit (Ping timeout: 265 seconds)
07:29:17*casaca quit (Ping timeout: 246 seconds)
07:30:07*casaca joined #nim
07:39:25euantoranoAraq: is your builds.sr.ht account a paid account or a free one? As of May 1st, it has to be paid to use builds: https://drewdevault.com/2021/04/26/Cryptocurrency-is-a-disaster.html
07:40:53euantoranoIf it’s free, I am happy to send you the money needed for a year’s paid access, just contact me. We need to decide if we are sticking with it or if it’s worth looking at self hosted CI for the BSDs or an alternative option altogether - BuildKite is self hosted and free for open source so might be worth checking out.
07:49:24*PMunch joined #nim
07:52:59Clonkk[m]Is there a way to forward varargs when you use the conversion syntax ?
08:14:45*sz0 joined #nim
08:40:46FromGitter<yglukhov> Hey guys. Can anyone explain how my 3 months old pr (#16695) haven't got into release yet?
08:43:15FromDiscord<flywind> you need to label it as backport: 1.4 to get it to release
08:43:41*Jesin quit (Ping timeout: 240 seconds)
08:44:17FromDiscord<flywind> it has been documented, see https://nim-lang.github.io/Nim/contributing.html#the-cmdgit-stuff-general-commit-rules
08:44:28giacois it possible to write testcases in separate files on procs without exporting them?
08:45:19FromDiscord<flywind> use devel then `import someUnexportModule {.all.}` + importutils module
08:45:28FromDiscord<flywind> use stable just use `include`
08:49:09giacocool! thanks
08:50:09FromGitter<yglukhov> flywind: I see, thanks. How do I backport an already merged commit then?
08:50:31giacoas I need to revert back from using import on all my tests, I now face the problem to detect which exports are actually unused outside the module. Can Nim help me on this task?
08:51:12FromDiscord<flywind> You can leave a comment and @narimiran
08:52:14narimiran@yglukhov there was no new major release since then
08:52:58FromGitter<yglukhov> narimiran: Right. I wanted it to get into 1.4 though.
08:53:13FromGitter<yglukhov> can you backport it please?
08:53:41narimiranok
08:53:53FromGitter<yglukhov> thanks!
08:55:19FromGitter<yglukhov> and #16696 too please. Both prs address kinda similar stuff.
08:58:17*jess joined #nim
09:01:17*vicfred quit (Quit: Leaving)
09:18:54giacoI've changed my "import" into "include" statements in my test*.nim files, and not it fails to compile with weird errors on "doAssert" like: Error: type mismatch: got <Payload, Payload>, but expected one of: proc `==`[T: tuple | object](x, y: T): bool, first type mismatch at position: 2, required type for y: T: tuple or object but expression 'Payload(<omissis>)' is of type: Payload. Payload is "type
09:18:56giacoPayload = object"
09:19:11giacos/not/now
09:20:18FromDiscord<flywind> what's your include statement like?
09:20:47giacoinclude libfoo, libbar
09:23:08giacoif I switch back to import it compiles and runs successfully
09:29:01*clyybber joined #nim
09:39:46giaco:-/
09:55:11giacowhat do you read from that error line? I see nonsense
10:00:37ForumUpdaterBotNew thread by Drkameleon: Generate JsObject for use in JavaScript, see https://forum.nim-lang.org/t/7868
10:03:32giacoI've switch back to import as include raises problem I don't understand
10:06:29*xace quit (Ping timeout: 265 seconds)
10:07:56*xace joined #nim
10:31:01FromDiscord<carpal> hello, when the nim's compiler is walking the ast to resolve all types does it also resolve references to functions?
10:32:21FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=3ffk
10:32:25FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=3ffk" => "https://paste.rs/7r0"
10:32:41FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=3ffn" => "https://paste.rs/A78"
10:32:51FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=3ffp" => "https://play.nim-lang.org/#ix=3ffm"
10:32:53FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=3ffm" => "https://paste.rs/ZWK"
10:33:18FromDiscord<carpal> or it is resolved nexlty?
10:33:21FromDiscord<carpal> (edit) "https://paste.rs/tkZ" => "https://paste.rs/24Y"
10:33:28FromDiscord<carpal> once the ast is typed
10:36:16FromDiscord<haxscramper> The compiler resolves all identifiers as it goes over AST, otherwise it would not be possible to type of `add`'s return value (if there were any)
10:36:48FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/2ff517462bf8609b30e6134c96658aa7912b628a/compiler/semcall.nim#L566
10:37:48FromDiscord<haxscramper> https://media.discordapp.net/attachments/371759389889003532/836551698540396544/unknown.png
10:38:20FromDiscord<haxscramper> All `sem` functions call each other, including overload call resolution
10:40:18*Jesin joined #nim
10:48:13FromDiscord<mlokis> sent a code paste, see https://paste.rs/Wp4
10:48:40FromDiscord<mlokis> its macro output btw
10:49:20FromDiscord<haxscramper> yes
10:49:34FromDiscord<haxscramper> Run with `expandMacros` to see after-semcheck AST
10:49:47FromDiscord<haxscramper> https://wandbox.org/permlink/RGS7aqpk96DBANEu
10:52:20FromDiscord<haxscramper> Though if you add runtime variable you need to wrap constant parts in `()` to fold constants
10:52:28FromDiscord<haxscramper> Otherwise it does not work that good
10:52:43FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3fik
10:53:33FromDiscord<mlokis> still better the nothing, i thought i qould have to optimize it manually
10:53:42FromDiscord<mlokis> (edit) "qould" => "would"
10:54:05FromDiscord<mlokis> (edit) "manually" => "myself"
10:55:13FromDiscord<flywind> it is high optimized by compiler(a preallocated string and append operations)
10:55:26FromDiscord<haxscramper> I would probably suggest to not rely on compiler optimizations and instead provide more optimal code
10:56:12FromDiscord<flywind> sent a code paste, see https://paste.rs/AfF
10:56:29FromDiscord<flywind> see `genStrConcat`
10:57:06FromDiscord<flywind> while `strformat` should optimize a bit more for int/float.
10:57:22FromDiscord<flywind> (edit) "optimize" => "have optimization"
10:57:34*FromDiscord quit (Remote host closed the connection)
10:57:50*FromDiscord joined #nim
10:58:48FromDiscord<haxscramper> so `'a' & 'b' & 'c'` might cause three function calls instead of `"abc"` being appended at once?
11:01:02ForumUpdaterBotNew Nimble package! hottext - Rapid serial text presenter, see https://git.sr.ht/~ehmry/hottext
11:02:16*teasea quit (Quit: teasea)
11:02:35FromDiscord<flywind> string literals should be optimized I guess
11:02:37*teasea joined #nim
11:02:58FromDiscord<mlokis> sent a code paste, see https://paste.rs/C79
11:03:01*sagax joined #nim
11:03:56FromDiscord<mlokis> macro took 120 lines of code
11:04:32FromDiscord<mlokis> it is messy as f
11:12:32FromDiscord<carpal> In reply to @haxscramper "The compiler resolves all": but function identifiers require types to be resolved, with function overloading add(int, int) if different from add(int, int8)
11:13:02FromDiscord<d4rckh> if i have a long if statement with a bunch of or's and and's how do i go about splitting it on a new line?
11:13:29FromDiscord<carpal> so to resolve the identifier add(1, 2) the compiler needs to kwow the types of 1 and 2, to do this the compiler needs to evaluate the expressions but at this point isn't a mess to mix all in the same phase?
11:14:20FromDiscord<carpal> In reply to @mlokis "anyway i just finished": cool
11:15:21FromDiscord<carpal> In reply to @carpal "so to resolve the": or maybe the compiler could resolve the identifier by replacing the identifier add with the overloads of add
11:15:59FromDiscord<carpal> and then in another phase the compiler will evaluate the parameter expressions to find the rightoverload
11:16:02FromDiscord<carpal> (edit) "rightoverload" => "right overload"
11:16:07FromDiscord<carpal> right?
11:21:08FromDiscord<haxscramper> In reply to @carpal "so to resolve the": It does not need to "evaluate" an expression, it must only resolve it's type
11:21:14FromDiscord<haxscramper> And that's exactly what compiler does
11:25:46FromDiscord<d4rckh> any reason i cant call replace here? https://media.discordapp.net/attachments/371759389889003532/836563767428120596/unknown.png
11:26:53FromDiscord<flywind> do you import `strutils`?
11:27:08FromDiscord<d4rckh> oh
11:27:18FromDiscord<d4rckh> looks like i forgot about it
11:27:19FromDiscord<d4rckh> thank you
11:27:29FromDiscord<flywind> np
11:31:43FromDiscord<carpal> In reply to @haxscramper "And that's exactly what": yes, my question was if it does resolve the expression's types during the type resolution
11:32:08FromDiscord<carpal> so in the same phase it also does semantic checks?
11:34:49FromDiscord<haxscramper> Expression type resolution itself is a semantic check if I'm not mistaken about terminology. So yes, it resolves types "in the same phase"
11:38:19*idxu quit (Quit: ZNC - https://znc.in)
11:38:36*idxu joined #nim
11:51:28FromDiscord<carpal> I mean↵`var x: string = 10`↵this is semantically wrong
11:54:14FromDiscord<carpal> so the compiler resolves the type string, checks if x is doubly declared and if the expression type and the context's type are the same?
11:54:26FromDiscord<carpal> all in the same phase?
11:56:45FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=3fsr
11:56:52FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=3fsr" => "https://play.nim-lang.org/#ix=3fss"
11:57:26FromDiscord<carpal> is because of all is done in a one phase that the compiler can't refer to forward declared type or functions?
11:58:33FromDiscord<carpal> (edit) "one" => "single"
12:00:00FromDiscord<Nisha's alt> Is there a tool to turn TS into Nim?
12:00:10FromDiscord<Nisha's alt> And how well does it work? :P
12:00:21FromDiscord<Recruit_main707> !search ts2nim
12:00:40FromDiscord<Recruit_main707> I thought we could use that command
12:00:46FromDiscord<Nisha's alt> The bot isn't here anu more
12:00:54FromDiscord<Recruit_main707> Ah xd
12:01:00FromDiscord<Nisha's alt> Disbot got kicked when Disruptek did :p
12:01:27FromDiscord<Nisha's alt> Someone should make a bot for it though, it honestly sucks not having disbot :p
12:02:12FromDiscord<Recruit_main707> https://github.com/bung87/ts2nim
12:05:12FromDiscord<Nisha's alt> Thanks! How would i make it translate deps into Nim too? Lol
12:12:16FromDiscord<haxscramper> In reply to @carpal "all in the same": Are you asking how it is done in nim compiler or how you would write it in your own language?
12:24:06*rockcavera joined #nim
12:26:29*johannes_ quit (Quit: leaving)
12:29:34*Vladar joined #nim
12:30:02FromDiscord<Unaimend> Any idea why this is not working, the error message is not really helpful ↵https://play.nim-lang.org/#ix=3fxy
12:32:22FromDiscord<exelotl> In reply to @Hitoshi Shinsou|💻⭐ "Someone should make a": Call it datbot :P
12:33:47FromDiscord<pointystick> Unaimend, my guess is the matrix is expecting ints but gets enum'd values. Putting '.ord' to turn the enum values into ints lets it compile, not sure if it's correct though
12:34:05FromDiscord<Unaimend> ahh thx
12:34:16FromDiscord<haxscramper> that is correct
12:34:33FromDiscord<haxscramper> Nim `enum` is not implicitly convertible to `int`
12:34:52FromDiscord<Unaimend> In reply to @haxscramper "Nim `enum` is not": 😢
12:36:05FromDiscord<Rika> a lot of things arent implicitly convertible in nim tho
12:38:48FromDiscord<carpal> In reply to @haxscramper "Are you asking how": how the nim compiler manages these operations
12:38:55FromDiscord<carpal> just to learn about it
12:39:54FromDiscord<mlokis> i feel like nim compiler builds on it self
12:46:34PMunchThis is a bad idea, right? https://github.com/dfdeshom/nimrdkafka/blob/master/example.nim#L50-L53
12:46:48PMunchThat string should probably pre-allocate those 512 bytes
12:49:04FromDiscord<whisperdev> how can I do something like this?
12:49:38FromDiscord<whisperdev> let bin = fmt""{bin_path}"" // prints: "C:\Program Files\bin\foo.exe" ?
12:50:43PMunchSomething like this probably `let bin = fmt"\"{bin_path}\""`
12:55:42FromDiscord<whisperdev> Does not work...
12:55:59PMunchDefine not working
13:00:38FromDiscord<konsumlamm> using `&` instead of `fmt` should work
13:00:53FromDiscord<konsumlamm> the latter is a raw string literal, so backslash isn't interpreted as escape
13:01:58FromDiscord<konsumlamm> alternatively, `fmt"""..."""` should also work (without backslash)
13:05:17PMunchOh right, I forgot that fmt was a raw string literal
13:13:27FromDiscord<d4rckh> how do i set it so it uses `-d:ssl` when i compile using `nimble build` automatically?
13:14:31FromDiscord<d4rckh> oh nvm i just pass it to the command directly
13:15:54PMunchYou can also add it in the module.nims file
13:15:57PMunchOr nim.cfg
13:16:08PMunchOr drop it in your nimble file I think
13:19:14FromDiscord<whisperdev> argggh none of it works
13:21:14FromDiscord<Rika> ? even `&"\"\'"`?
13:21:23FromDiscord<Rika> oops, `\"` not `\'`
13:22:32*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
13:23:41*ehmry joined #nim
13:29:19FromDiscord<d4rckh> does anyone have a github action template i can use to automatically compile my nim app and make a release for it?↵tried some from the forums but didnt work for me
13:45:03ForumUpdaterBotNew thread by Ginko: Variable set at compile time, see https://forum.nim-lang.org/t/7871
13:49:13*Vladar quit (Remote host closed the connection)
13:54:28*Vladar joined #nim
14:02:24*NimBot joined #nim
14:11:06ForumUpdaterBotNew thread by FabienPRI: Global var & thread, see https://forum.nim-lang.org/t/7872
14:41:17*grimler32 joined #nim
14:42:57grimler32Evil People Messed with my LIFE! Are there any universe editors here with access to the 4 bit 3 dimensional god code at the multiverse level??
14:44:08FromDiscord<Anuke> Anyone know of a C/nim library that can encode gifs with RGBA data as frames? I've found <https://github.com/lecram/gifenc>, but it's very basic and requires indexed data and a palette, which I don't have.↵I've tried writing each frame to disk as a PNG and running imagemagick on that, but as one might expect, that approach is incredibly slow.
14:45:53grimler32Evil People Messed with my LIFE! Are there any universe editors here with access to the 4 bit 3 dimensional god code at the multiverse level??
14:45:59*gangstacat quit (Ping timeout: 260 seconds)
14:47:49PMunch@Anuke, I think Gifs are pallette based, so some part of your chain need to convert it to palette/index anyways
14:48:08PMunchYou might want to look into animated PNGs, or just simply a video format
14:48:16PMunchAnd grimler32, please don't spam
14:48:47*gangstacat joined #nim
14:48:49FromDiscord<Rika> either spam or bot :thonk:
14:50:55FromDiscord<Anuke> I know palettes are required, but I was hoping of a library out there that automatically does the palette conversion for me.↵The issue with other formats is that, sadly, they aren't as widely supported - APNGs don't play in Discord, and videos can't be embedded in many places.
14:51:14PMunch@Rika, I mean he's on IRC so I could just ban him
14:51:50FromDiscord<haxscramper> !eval type Abyss = distinct void; echo sizeof(Abyss)
14:51:53NimBot0
14:53:12FromDiscord<exelotl> if you want to destroy the universe you won't get very far encoding 3 dimensions in 4 bits...
15:05:17ForumUpdaterBotNew thread by Alexeypetrushin: RPC in 10 and REST API in 5 lines of Nim, see https://forum.nim-lang.org/t/7873
15:07:27*PMunch quit (Quit: leaving)
15:18:48ForumUpdaterBotNew post on r/nim by h234sd: RPC in 10 and REST API in 5 lines of Nim, see https://reddit.com/r/nim/comments/mzqrd2/rpc_in_10_and_rest_api_in_5_lines_of_nim/
15:32:30FromDiscord<jtiai> Does nim has similar documentation mechanism as Python has Sphinx?
15:32:52FromDiscord<haxscramper> `nim doc`
15:33:10FromDiscord<haxscramper> https://nim-lang.org/docs/docgen.html
15:33:50FromDiscord<jtiai> that looks like reference documentation generator.
15:34:14FromDiscord<jtiai> But can you write docs like Python documentation or for example Django docs (all written in Sphinx) with docgen?
15:35:36FromDiscord<haxscramper> What features specifically are you talking about?
15:35:49FromDiscord<haxscramper> nim manual/tutorials etc. are created using `nim doc` too
15:36:29FromDiscord<jtiai> cross referensing pages, titles (different levels) index pages, search, adding images, arbitrary code and so on.
15:37:01FromDiscord<jtiai> <https://docs.djangoproject.com/en/3.2/> docs like that.
15:38:05FromDiscord<haxscramper> It can't do exactly like that, but nim doc also uses RST so you can have most of it's features
15:38:33FromDiscord<haxscramper> like images, titles, "arbitrary code" (whatever this means) and so on
15:38:37*MarderIII joined #nim
15:39:35FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=3g18
15:40:15FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement↵https://raw.githubusercontent.com/nim-lang/Nim/devel/doc/manual.rst
15:41:18FromDiscord<haxscramper> yes it can
15:43:51FromDiscord<jtiai> Looks like it's missing few niceties sphinx provides - like automatic hierarchy and links.
15:44:26FromDiscord<jtiai> Sphinx also has quite simple theming...
15:45:56FromDiscord<haxscramper> I'm also working on an alternative documentation generator, but it is currently heavily WIP
15:46:52*def- quit (Quit: -)
15:47:01FromDiscord<jtiai> Sphinx is pretty nice it mainly adds nice build system plus additional stuff helping for docs.
15:47:39*def- joined #nim
15:47:42FromDiscord<exelotl> ah this topic again... I really want a Sphinx Nim extension 😅
15:47:50FromDiscord<jtiai> That would be nice 😄
15:47:57FromDiscord<haxscramper> is it that good?
15:48:16FromDiscord<jtiai> Sphinx?
15:48:20FromDiscord<haxscramper> yes
15:48:23*tane joined #nim
15:48:33FromDiscord<jtiai> Must be because CPython uses it.
15:48:45FromDiscord<exelotl> just need a way to say "please embed the signature and description of this Nim symbol here" within my own written docs
15:48:48FromDiscord<jtiai> and there is site "readthedocs.org" which mainly builds sphinx docs...
15:49:06FromDiscord<exelotl> it would work so well because both Sphinx and Nim use RST
15:50:25FromDiscord<jtiai> sent a long message, see https://paste.rs/ZNm
15:51:30FromDiscord<haxscramper> sounds really interesting
15:51:42FromDiscord<haxscramper> I will look into it then, maybe adapt some features for haxdoc
15:52:59ForumUpdaterBotNew post on r/nim by miran1: NimConf 2021, see https://reddit.com/r/nim/comments/mzrjfc/nimconf_2021/
15:54:34FromDiscord<flywind> see rst.html
15:55:21FromDiscord<jtiai> In reply to @haxscramper "I will look into": This is my "book" which is generated using Sphinx. Uses quite many features of sphinx except code docs. https://becomingpygamer.book.tiainen.cc/en/latest/
15:55:25FromDiscord<flywind> https://nim-lang.github.io/Nim/rst.html
15:55:56reversem3Wish there was a asciidoctor lib for nim
15:56:17reversem3!help
15:56:38reversem3!package asciidoctor
15:56:42FromDiscord<flywind> what is asciidoctor?
15:57:01FromDiscord<jtiai> Some Java... crap 😄
15:57:08reversem3nope
15:57:20reversem3its actually written in ruby
15:57:51FromDiscord<haxscramper> the only lightweight markup language that I know of that actually has good tables
15:57:57FromDiscord<haxscramper> And not this ASCII-art madness
15:58:36reversem3@dom96 used it to write his book , I use it all the time for writing docs
15:58:36reversem3https://asciidoctor.org/
15:58:37reversem3lol no not ascii art
15:58:50FromDiscord<haxscramper> yeah
15:59:05FromDiscord<haxscramper> Maybe they actually tried writing two-line table cell or something
15:59:30reversem3its wonderful to use and I also use antora https://antora.org/
16:00:08reversem3Tables are a breeze with asciidoctor
16:00:12FromDiscord<flywind> Nim may embrace markdown completely in the future https://github.com/nim-lang/Nim/pull/17827#issuecomment-826686846
16:01:16reversem3https://asciidoctor.org/docs/asciidoc-writers-guide/#a-new-perspective-on-tables
16:02:56FromDiscord<haxscramper> The only complaint about asciidoctor I have really is that they went with "more character combinations" for tables instead of org-mode approach which is more keyword-heavy. So `#+table:`, `#+row` etc.
16:03:05FromDiscord<haxscramper> `#+caption:`
16:04:08reversem3I used to use org-mode back in the day but switched to JoplinApp cause I can run it anywhere and I can use encryption
16:04:45reversem3https://joplinapp.org/
16:05:20FromDiscord<haxscramper> org-mode is basically never used outside emacs, that is true.
16:05:35*blackpawn joined #nim
16:06:26FromDiscord<whisperdev> Does anyone know how can I make my app to ask for administrator's privileges on Windows?
16:06:34FromDiscord<whisperdev> You are supposed to compile it with some manifest or something.
16:09:36*Vladar quit (Quit: Leaving)
16:09:38reversem3I love using emacs but org-mode came a real pain in the ass to sync and keep track of versions , thats why I moved to Joplin
16:10:25*blackpawn quit (Ping timeout: 268 seconds)
16:10:55FromDiscord<flywind> In reply to @whisperdev "Does anyone know how": I don't know. but maybe you can check the program is ran by admin
16:10:58FromDiscord<flywind> https://github.com/nim-lang/RFCs/issues/343
16:12:35FromDiscord<whisperdev> let me try! thanks
16:13:27ForumUpdaterBotNew Nimble package! niml - html dsl, see https://github.com/jakubDoka/niml
16:13:45*blackpawn joined #nim
16:30:02reversem3niml looks pretty cool , you can even generate javascript using a proc
16:43:28*narimiran quit (Ping timeout: 252 seconds)
16:54:05FromDiscord<madman> `\develkinc\Shader-Kinc/Sources\@mexShader.nim.c:676: error: undefined reference to 'systemInit000'` has anyone seen this error before
16:54:31FromDiscord<madman> (building c generated nim on android studio)
16:57:03*liblq-devel joined #nim
16:57:53*liblq-devel quit (Client Quit)
17:00:57FromDiscord<dom96> In reply to @reversem3 "<@132595483838251008> used it to": it is very good, but definitely has its quirks.
17:02:50reversem3No MD is perfect but it is getting updated on a regular basis I believe
17:06:19FromDiscord<haxscramper> In reply to @haxscramper "There is a `#science`": @dom96 there was a nim job posting yesterday and I forgot to ping you, so maybe you could put it in announcements or something. Not sure if this is really necessary, but maybe it will help
17:12:54giacoI'm writing a proc with OR argument type. Inside the proc I'd like to if type A do this, if type B do that. How should I accomplish this? Should I use "case" or "is" or "type" or "typeof" or what?
17:14:36FromDiscord<haxscramper> `when arg is A:`
17:14:47FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
17:17:02giacothanks!
17:17:45*narimiran joined #nim
17:18:51giacoI'm quite confused by this topic. I got that "when" is kinda preprocessor on steroids, but also is and typeof operates at compile time, or not?
17:19:57FromDiscord<haxscramper> yes
17:20:03FromDiscord<haxscramper> `when` evaluates iot
17:20:11FromDiscord<haxscramper> its argument and conditionally compiles block of code
17:20:51FromDiscord<haxscramper> `is` is a type equality check it is evaluated at compile-time
17:21:24FromDiscord<haxscramper> all code that you put in `when` can be put in `if` condition too
17:24:44giacoadding when+is compiles and runs correctly, but replacing when with if doesn't compile anymore
17:25:48reversem3is https://github.com/nim-lang/iup dead ?
17:25:56giacoI think in my case "if" doesn't know that it is dealing with a OR kind of type argument, but "when" does
17:26:03FromDiscord<haxscramper> because `when` conditionally compiles block
17:26:12FromDiscord<haxscramper> `if` compiles both and runs code conditionally
17:29:40giacothis means that ORred arguments actually creates multiple separate procs at compile time, otherwise it wouldn't be able to accept "else" like it is doing now
17:29:54*xet7 quit (Remote host closed the connection)
17:30:13*fredrikhr joined #nim
17:30:34FromDiscord<haxscramper> yes, generics proc generates different implementation for each argument type
17:31:00FromDiscord<haxscramper> I don't think there is any way of doing it differently without going into dynamic typing
17:31:55giacooh no, I prefer them compiled, I'm disintossicating from dynamic typing
17:39:24giacoanother question. I have a template in module A that calls a function of module B, so A imports B. When I call that template from module C I have to import both A and B to compile, not just A. Should I think of templates as something like "include"?
17:44:46*idf quit (Ping timeout: 268 seconds)
17:46:59FromDiscord<haxscramper> I would advise to think of templates as they are described in manual - "A template is a simple form of a macro: It is a simple substitution mechanism that operates on Nim's abstract syntax trees."
17:47:09FromDiscord<haxscramper> Otherwise you could just confuse yourself
17:47:27FromDiscord<haxscramper> And yes, because it is an AST-based substitution you might have to export all necessary symbols
17:48:55FromDiscord<Nisha's alt> Does anyone know if `raylib_now` actually works with Raylib 3.7?
17:49:02FromDiscord<Nisha's alt> I can't test it myself rn
17:49:16FromDiscord<Nisha's alt> (edit) "3.7?" => "2/3.7? (Not sure which version it's on)"
17:52:10giacothanks for the description
18:01:14*vicfred joined #nim
18:03:43ForumUpdaterBotNew thread by DontForceMe: Why learn NIM, see https://forum.nim-lang.org/t/7874
18:10:30*xet7 joined #nim
18:12:14*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
18:12:30*kitech1 joined #nim
18:22:04*rockcavera quit (Remote host closed the connection)
18:25:10FromDiscord<mischa_u> In reply to @Hitoshi Shinsou|💻⭐ "I can't test it": it works with 3.5, it hasn't been updated yet for 3.7; but the convert script might just work with minimal modifications
18:28:25*neceve quit (Ping timeout: 276 seconds)
18:28:26*jaens[m] quit (Ping timeout: 276 seconds)
18:28:27*Benjamin[m]1 quit (Ping timeout: 276 seconds)
18:30:17*neceve joined #nim
18:35:14*jaens[m] joined #nim
18:35:14*Benjamin[m]1 joined #nim
18:35:34giacomath.round returns a float even when used without decimal places arguement, that would make an int. What use is that?
18:43:59FromDiscord<Nisha's alt> In reply to @mikeX "it works with 3.5,": Ah alright, thanks!
18:57:07FromDiscord<mlokis> How long is expected wait for my package to be added to the list?
19:06:50*rockcavera joined #nim
19:06:56*rockcavera quit (Remote host closed the connection)
19:12:31*rockcavera joined #nim
19:42:00FromDiscord<mlokis> do we have a macro that turns nim code into js string?
20:17:22giacoI'm stress testing my web app with 20K GET requests ready to submit as fast as possible (no, not a ddos, both are managed by me :P), so I've created a newAsyncHttpClient and I am looping await client.request and closing the AsyncHttpClient once at the end of the list. It works but is much slower than expected. Both client and server machines are < 5% used cpu and also bandwidth usage is ~30Kbps, so I
20:17:24giacodon't know where the bottleneck is. Any idea?
20:18:31FromDiscord<ElegantBeef> Did you build it as release?
20:18:36giacoyes
20:22:10FromDiscord<ElegantBeef> Well time to use a profiler
20:25:41FromDiscord<ajusa> If you do await client.request doesn't that mean that you're basically just doing all the requests in serial? Like you only send a request at a time?
20:26:44giacoajusa, yes
20:27:41FromDiscord<ajusa> Well what's the average time for a request then? My guess is that latency (assuming that you are running these on different machines) is the problem
20:27:55FromDiscord<ajusa> Otherwise it could be IO, like a database call
20:30:08giacoit makes sense. Let me turn it to parallel async requests
20:32:08giacowill asyncfutures.all make them parallel? (well, async parallel)
20:34:43FromDiscord<ajusa> I think so? You may run out of sockets though, depends on your OS settings
20:42:46FromDiscord<Anuke> Why does nim require --threads:on to use threads? Is there any reason it's not enabled by default on supported platforms?
20:46:52FromDiscord<ElegantBeef> I'll say to not have thread analysis on by default, but that's probably not the reason
20:47:18FromDiscord<ElegantBeef> Certainly not the reason 😄
20:49:34FromDiscord<Nisha's alt> Is there an alternative way to call Python code in Nim?-
20:49:40FromDiscord<Nisha's alt> That does use CFFI?
20:49:54FromDiscord<Nisha's alt> Doesn't↵FFI
20:51:34FromDiscord<Nisha's alt> Probably via RustPython or something
20:51:50FromDiscord<ElegantBeef> And how do you plan on talking to that rust interpreter
20:54:43giacowell, looking at wireshark it seems clear that is is useless to recycle an AsyncHttpClient sending multiple gets using "asyncfutures.all", as they would be serialized anyway
20:55:37giacoI should split the requests into multiple tcp sockets and maybe just serialize a subset of all the requests each
20:55:40*tane quit (Quit: Leaving)
21:12:46*MarderIII quit (Quit: Leaving)
21:17:05*narimiran quit (Ping timeout: 260 seconds)
21:23:24*thomasross joined #nim
21:46:26giacowhy my program exits even when an exception that's catched upper in the call stack is raised?
21:47:08giacoI have also a "catch all" around the main, but exceptions kills the program anyway
21:47:39giacoitsays "unhandled exception", but it really is: Error: unhandled exception: Bad file descriptor [OSError]
21:50:49*fredrikhr quit (Ping timeout: 245 seconds)
21:54:49FromDiscord<Nisha's alt> In reply to @ElegantBeef "And how do you": CFFI? :P
22:05:41FromDiscord<ElegantBeef> @Nisha's alt so yea pretty much either you get to make a Nim interpreter or use CFFI
22:06:44FromDiscord<Nisha's alt> Lol Nim Interpreter go brrrrrr
22:06:47FromDiscord<ElegantBeef> Well dynlib would also work but that's just CFFI in a trenchcoat imo 😄
22:06:53FromDiscord<Nisha's alt> Fair lol
22:25:29FromDiscord<ElegantBeef> Eh, my type inference passes CI!
22:31:28ForumUpdaterBotNew post on r/nim by MrCordigle: Is it possible to have a reference to a generic type/concept embedded in an object?, see https://reddit.com/r/nim/comments/n00ga7/is_it_possible_to_have_a_reference_to_a_generic/
22:41:42giacoI got my answer in asyncdispatch.nim
22:44:43giacowait, no, I haven't found my answer: the exceptions behave differently in release and debug
22:55:13*xet7 quit (Remote host closed the connection)
22:56:21*xet7 joined #nim
23:31:56FromDiscord<arun> py2many.py v0.1 is out: https://pypi.org/project/py2many/↵↵Can transpile python code to nim. 9 out of 16 tests passing. Please try it out and open issues on github.
23:33:46FromDiscord<ElegantBeef> This only works for typed python right?