<< 20-10-2021 >>

00:29:45*xet7 joined #nim
00:53:59*Gustavo6046_ joined #nim
00:54:40*Gustavo6046 quit (Ping timeout: 252 seconds)
00:56:46*Gustavo6046_ is now known as Gustavo6046
01:05:56*Egeon quit (Ping timeout: 245 seconds)
01:07:25*Egeon joined #nim
01:16:25*Gustavo6046_ joined #nim
01:17:11*Gustavo6046 quit (Ping timeout: 245 seconds)
01:19:26*Gustavo6046_ is now known as Gustavo6046
01:39:46*Gustavo6046 quit (Ping timeout: 252 seconds)
01:40:41*Gustavo6046 joined #nim
02:14:22*Gustavo6046 quit (Read error: Connection reset by peer)
02:17:02*Gustavo6046 joined #nim
02:36:59*arkurious quit (Quit: Leaving)
02:57:51*Gustavo6046 quit (Read error: Connection reset by peer)
02:58:40*Gustavo6046 joined #nim
03:20:41FromDiscord<Rika> In reply to @exelotl "hmm I just noticed": sgn looks like a heaviside step that goes into the negative instead of 0
03:35:32FromDiscord<geekrelief> Anyone know how I can get the my custom pragma type? https://play.nim-lang.org/#ix=3Cgo
03:39:21*Gustavo6046 quit (Remote host closed the connection)
03:39:27FromDiscord<Elegantbeef> Copy the code and dont return a tuple
03:39:56*Gustavo6046 joined #nim
03:41:28FromDiscord<geekrelief> In reply to @Elegantbeef "Copy the code and": Sorry I don't follow. What code? What tuple?
03:42:12FromDiscord<Elegantbeef> in 1.6 this will work https://play.nim-lang.org/#ix=3Cgq
03:42:44FromDiscord<Elegantbeef> The `getCustomPragmaVal` gets a tuple of `(key: val)` weirdly
03:43:39FromDiscord<geekrelief> oh, ok, thx
03:44:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Cgr
03:45:37FromDiscord<Elegantbeef> Soo that `p.len == 2` should actualyl be `p.len == 2 or (p.len == 3 and ($(p[^1]).endsWith(":type")) ` or something more sane
03:46:15FromDiscord<geekrelief> I'm not familiar with this syntax `cp: typed{nkSym}` does that mean `cp` is a NimNode of kind `nnkSym` or something?
03:46:33FromDiscord<Elegantbeef> `cp` is typed but will only match if it's a symbol
03:46:46FromDiscord<Elegantbeef> It's apart of the experimental pattern matching for macros
03:46:57FromDiscord<Elegantbeef> Actually it might be more than just for macros
03:47:06FromDiscord<Elegantbeef> But it allows you to do specific operations in specific cases
03:47:30FromDiscord<geekrelief> is that covered in the docs?
03:47:37FromDiscord<Elegantbeef> Experimental yes
03:47:49FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-pattern-operators
03:48:37FromDiscord<Elegantbeef> term rewriting and pattern matching is quite powerful stuff 😀
03:49:14FromDiscord<Elegantbeef> But yea make an issue or PR for this issue for this
03:49:30FromDiscord<geekrelief> ok
03:49:32FromDiscord<geekrelief> thanks
03:50:02FromDiscord<Elegantbeef> No problem, the latter fix i mentioned is probably preferable, might be able to do `p[1].symKind == nskType` instead
03:51:53FromDiscord<Elegantbeef> yea the sym way might be better
03:51:59FromDiscord<Elegantbeef> Less error prone 😀
03:52:13FromDiscord<Elegantbeef> I guess i'm assuming you're making a PR and not just an issue 😛
03:53:29FromDiscord<Elegantbeef> Also you'll be happy to know i've actually started on writing tests for nimscripter, so bigrewrite is almost actually released 😀
03:54:56FromDiscord<geekrelief> In reply to @Elegantbeef "I guess i'm assuming": I just made an issue. I need to look at the code more closely. It's my first time using custom pragmas, and it's getting late for me.
03:56:41FromDiscord<Elegantbeef> Yea i've pretty much never used them
04:00:22FromDiscord<geekrelief> I'll create a PR tomorrow. Thanks beef! 😄
04:01:00FromDiscord<Elegantbeef> No problem, really like that `{.all.}` easy fixes, though still think if i see it in any actual code i'll cry
04:01:53FromDiscord<Elegantbeef> Also where's pmunch, we need 1.6 on playground!
04:03:26FromDiscord<geekrelief> In reply to @Elegantbeef "No problem, really like": That is nice.
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:12FromDiscord<impbox [ftsf]> {.all.} sounds dreamy for working around library issues
04:06:31*supakeen joined #nim
04:07:01FromDiscord<Elegantbeef> Yea, i'm using the privateaccess part for getting around private fields in nimscripter
04:07:06FromDiscord<Elegantbeef> Quite a bit of power with it
04:30:05FromDiscord<dilawar (Dilawar Singh)> Any `pathlib` (python) like library in nim? I looking for cross-platform way to handle filesystem paths.
04:31:00FromDiscord<Rika> `os`
04:31:10FromDiscord<Elegantbeef> `std/os` 😛
04:31:59FromDiscord<Rika> `beef you little piece of sh`
04:32:12FromDiscord<dilawar (Dilawar Singh)> Thanks. I wanted to make sure that std/os is good enough.
04:32:26FromDiscord<Elegantbeef> It does have the wonderful little `/` operator
04:32:40FromDiscord<dilawar (Dilawar Singh)> You never know if there is a better option in the wild \:)
04:33:14FromDiscord<Elegantbeef> The compiler does have typesafe path library, if that's your sort of tea
04:35:47FromDiscord<dilawar (Dilawar Singh)> I always prefer typesafe addon in my tea 😉. Thanks for info.
04:40:45FromDiscord<geekrelief> In reply to @Elegantbeef "I guess i'm assuming": created a PR thanks! https://github.com/nim-lang/Nim/pull/19021 Looking forward to the nimscripter update!
04:41:46FromDiscord<Elegantbeef> Speaking of nimscripter i'm still questioning the usage of `Option[Interpreter]` might move to an exception only version just for consistency across the board
04:43:06*Gustavo6046 quit (Read error: Connection reset by peer)
04:46:12*Gustavo6046 joined #nim
04:53:52FromDiscord<Rika> balls deep in result types, bet you wont
04:54:29FromDiscord<Elegantbeef> Lol
05:10:34NimEventerNew Nimble package! opencolor - Nim bindings for Open color, see https://github.com/Double-oxygeN/opencolor.nim
05:19:39NimEventerNew thread by Nnahito: Continuous use of parseJson causes software crash, see https://forum.nim-lang.org/t/8518
05:34:13*andinus joined #nim
06:52:43*PMunch joined #nim
06:54:07*|smlckz| joined #nim
06:59:24*Yardanico_ joined #nim
07:03:47*tiorock joined #nim
07:03:47*tiorock quit (Changing host)
07:03:47*tiorock joined #nim
07:03:47*rockcavera is now known as Guest3786
07:03:48*Guest3786 quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
07:03:48*tiorock is now known as rockcavera
07:09:50*happycorsair[m] quit (Ping timeout: 260 seconds)
07:09:50*Yardanico quit (Ping timeout: 260 seconds)
07:17:26*happycorsair[m] joined #nim
07:37:55*vicfred quit (Quit: Leaving)
07:54:48PMunch@Yardanico, tried out Sciter in Futhark yet?
07:55:14FromDiscord<Yardanico> Sorry, not yet, didn't really touch my PC at all in the last few days
07:55:42PMunchNo worries :) I'm just considering to write a small article on Futhark, and I wanted to know if it worked or not :)
07:56:00FromDiscord<Elegantbeef> Pmunch playground needs updated to 1.6 😛
07:56:28FromDiscord<Elegantbeef> Or does it do that automagically?
07:56:33PMunchHmm, that should've been done automatically..
07:56:55PMunchIt should, but it shouldn't take it more than about an hour I think..
07:57:45PMunchI mean I've been using Futhark myself for multiple projects already and it's working great! But Sciter is quite different from the things I've been wrapping
08:48:42PMunch@Elegantbeef, apparently the new Nim version fails to build: /build/Nim/lib/pure/random.nim(221, 11) Error: invalid argument for: high
08:53:34PMunchSeems like it was caused by using the old csources repo and not csources_v1
08:53:43PMunchAre the new csources backwards compatible?
08:54:54PMunchAh, and build.sh is gone..
08:55:02PMunchSo my script can't be backwards compatible any longer..
08:55:05PMunchWell that sucks..
08:55:28|smlckz|where did it go? ;P
08:57:20PMunchAh never mind, it was there I think, I was just cd-ing into the wrong directory
09:14:18FromDiscord<Hamid Bluri> hey, is there any examples of using `Lock` in Nim?
09:18:29FromDiscord<Hamid Bluri> In reply to @Rika "`beef you little piece": piece of `shell`
09:20:29NimEventerNew thread by Vsajip: Debugging a SIGSEGV, see https://forum.nim-lang.org/t/8519
09:23:36FromDiscord<Rika> Is there a reason many people don’t opt for using Status’ serialisation library?
09:24:43*Vladar joined #nim
09:27:36FromDiscord<Hamid Bluri> `status-im` ?
09:33:22FromDiscord<tandy> what does it mean when someone defines a proc like so? `proc search[T, U](x: T, needle: U): union(U | None) =`
09:33:37FromDiscord<tandy> the `[]` bit before taking parameters
09:33:43FromDiscord<Elegantbeef> a generic procedure
09:34:02FromDiscord<tandy> i see, so the types T, U are generic
09:34:13FromDiscord<Elegantbeef> Yes
09:34:21FromDiscord<Elegantbeef> Well generic params
09:34:26FromDiscord<Elegantbeef> The entire proc is generic
09:34:43FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#generics
09:41:28FromDiscord<Hamid Bluri> beef do you know how can i use locks in nim?
09:41:37FromDiscord<Hamid Bluri> any examples?
09:41:44FromDiscord<Hamid Bluri> or articles
09:41:49FromDiscord<Elegantbeef> Using thread locks?
09:41:55FromDiscord<Hamid Bluri> yes
09:42:50FromDiscord<Elegantbeef> Small example https://nim-lang.org/docs/threads.html#examples
09:43:22FromDiscord<Hamid Bluri> thank u
09:43:28FromDiscord<Elegantbeef> I can also give a small explanation that they're just for preventing threads from accessing resources at the same time so you jut lock/unlock them where an edge case could occur
09:43:42FromDiscord<Elegantbeef> Aside from that i cannot help much, especially as i'm about to go to sleep, sorry
09:44:30FromDiscord<Hamid Bluri> it's 13:14 here : D it was really helpful
09:44:47FromDiscord<Elegantbeef> It's almost 4 am
09:44:47FromDiscord<Elegantbeef> I'm a terrible human
10:25:01FromDiscord<impbox [ftsf]> But a great beef
10:47:07FromDiscord<dilawar (Dilawar Singh)> Is there a way to install a package to non-standard directory using`nimble`? Like `--prefix` option in `pip`?
10:49:12PMunch!eval echo NimVersion
10:49:14NimBot1.6.0
10:49:16PMunch@Elegantbeef ^
10:49:43PMunch@dilawar_(Dilawar_Singh), --nimbleDir probably
10:50:21FromDiscord<Yardanico> @PMunch it won't work if you use underscores, instead you can just use the part of a name IIRC
10:50:29FromDiscord<Yardanico> try just with @dilawar , I think it should work
10:50:39FromDiscord<Yardanico> ah, nvm, they're from matrix so even that wouldn't work
10:51:54PMunchOh right, I've set up my HexChat to extract the username from FromDiscord messages and replace FromDiscord with the nick. Since IRC names can't have spaces it replaces those with underscores
10:52:11PMunchSo to me you all look like IRC users again now :)
10:52:51PMunchExcept that I get a message like: "@Yardanico ([email protected]) has joined" the first time someone talks in the Discord room
10:53:05FromDiscord<Yardanico> interesting
10:55:23PMunchHaven't made it change the colour though, so it still uses the FromDiscord nick colour. But it's a start
11:06:09FromDiscord<geekrelief> In side of a macro, is there a way to get more information about a NimNode that is a typedesc? I have a macro that receives a proc with a custom pragma that takes a typedesc. I want to check if that typedesc is for a proc.
11:07:04FromDiscord<Rika> What?
11:07:57FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChH
11:08:16FromDiscord<geekrelief> I want to be sure `foo` is a proc and not an object
11:08:39FromDiscord<geekrelief> (edit) "https://play.nim-lang.org/#ix=3ChH" => "https://play.nim-lang.org/#ix=3ChI"
11:09:37FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChJ
11:10:06FromDiscord<geekrelief> This is for C interop where `foo` and `bar` are imported types.
11:10:51*ozzz quit (Remote host closed the connection)
11:16:33FromDiscord<haxscramper> you have a macro that does `macro zzz(a: proc(typedesc))`?
11:16:38FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChN
11:17:48FromDiscord<geekrelief> In reply to @haxscramper "you have a macro": more like `macro zzz(a: proc(){.customPragma.})`
11:18:06FromDiscord<geekrelief> (edit) "proc(){.customPragma.})`" => "proc(){.customPragma:typedesc.})`"
11:19:56FromDiscord<haxscramper> I don't think the `tm_type: tm_the_truth_create_types` part is going to be stored in typedesc information anywhere
11:20:01FromDiscord<haxscramper> certainly not in a type
11:20:19FromDiscord<haxscramper> you might have a chance if you accept `typed` node, symbol for the proc you defined
11:20:26FromDiscord<haxscramper> and then `getTypeInst/getTypeImpl/getType`
11:20:35FromDiscord<haxscramper> basically somehow original definition of the proc
11:21:00FromDiscord<haxscramper> But even with these `getTypeXXX` I don't really know how to do this
11:21:19FromDiscord<haxscramper> but with `typedecs[]` it is almost guaranteed to be impossible, since `tm_type: tm_the_truth_create_types` is not a part of the type
11:21:26FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChP
11:21:36FromDiscord<geekrelief> Basically the `nnkProcTy` part
11:22:10FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChQ
11:22:49FromDiscord<geekrelief> Yeah, I'm afraid I couldn't find anything in `std/macros` to get more info.
11:23:00NimEventerNew Nimble package! xidoc - A consistent markup language, see http://xidoc.nim.town/
11:36:56FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChX
11:37:07FromDiscord<geekrelief> (edit) "https://play.nim-lang.org/#ix=3ChX" => "https://play.nim-lang.org/#ix=3ChY"
11:37:18FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3ChZ
11:40:41FromDiscord<geekrelief> Yeah with that I can check the kind of the third child to see if it's a proc
11:41:05FromDiscord<lenis> Does anyone know the state of incremental compilation? Importing a large module in nim 1.6.0 still adds seconds to the compile time for every change
11:41:28FromDiscord<haxscramper> IC is delayed with no concrete release date
11:41:33FromDiscord<Yardanico> In reply to @lenis "Does anyone know the": there was some work done on it, but it's still not complete and not default
11:42:15FromDiscord<lenis> That's unfortunate 😦
11:48:02FromDiscord<haxscramper> I'm not sure what would be the aim of 1.8 release
11:48:18FromDiscord<haxscramper> 2021 was supposed to be the year of tooling, at least I remember talks about this
11:48:41FromDiscord<haxscramper> arc/orc is for 2.0 since they are not ABI compatible
11:48:53FromDiscord<haxscramper> https://forum.nim-lang.org/t/7983
11:49:35FromDiscord<haxscramper> probably some of the features that are currently experimental
11:49:55FromDiscord<haxscramper> like concepts, IC, lazy compilation, or something else
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:55*supakeen joined #nim
12:20:10FromDiscord<exelotl> it's nice to see that view types are a little more usable now, looking forward to them becoming stable
12:28:19FromDiscord<exelotl> I have really mixed feelings about custom numeric literals lol
12:28:34FromDiscord<Rika> Why
12:29:04FromDiscord<exelotl> `fp(1/32)` is way nicer than `1'fp/32`
12:29:26FromDiscord<haxscramper> but compare it to fp(1) vs 1'fp
12:29:42FromDiscord<Rika> You can use both anyway
12:29:52FromDiscord<haxscramper> you'know usual use case is `<lit>'<suffix>`
12:29:56FromDiscord<Rika> It’s not like you’re forced to use literals
12:30:26FromDiscord<haxscramper> also those are two distinct operations
12:30:32FromDiscord<haxscramper> divide 1'fp by 432
12:30:35FromDiscord<haxscramper> and turn 1/32 into fp
12:30:41FromDiscord<haxscramper> whatever fp is
12:31:06FromDiscord<exelotl> Fixed point number with 8 bits of precision
12:31:09FromDiscord<Rika> Probably fixed point
12:31:12FromDiscord<exelotl> Ye
12:31:22FromDiscord<impbox [ftsf]> floppy point
12:31:25FromDiscord<exelotl> It just feels weird mixing the two approaches just to save a single character where previously there was 1 uniform approach
12:31:32FromDiscord<Rika> Though that makes it ambiguous with “floating point” given they both start with f
12:31:56FromDiscord<impbox [ftsf]> 1.0'x for fiXed?
12:32:12FromDiscord<Rika> Also can be confused with hexadecimal
12:32:14FromDiscord<impbox [ftsf]> 1.0'8.8
12:32:20FromDiscord<impbox [ftsf]> For 8.8 fixed?
12:32:20FromDiscord<exelotl> Yeah x makes me think of hex lol
12:32:26FromDiscord<Rika> Just use “fix” IMO but whatever that’s besides the point
12:32:47FromDiscord<impbox [ftsf]> I guess you can't use numbers as the name
12:32:53FromDiscord<Rika> Custom number literals are useful for numbers that can’t be represented by any built in number types like for big integers
12:33:02FromDiscord<Yardanico> exactly
12:33:03FromDiscord<impbox [ftsf]> 1.0'fix8
12:36:40FromDiscord<lbart> hi!↵I was away from nim last months, but I miss Nim 🙂↵Have the tools evolved (I'm thinking about code coverage and static analysis. DrNim IIRC?)
12:38:53FromDiscord<haxscramper> no, not really. Current release was mostly focused on library and core language improvements, not so much on tooling
12:39:42PMunchOoh, fixed point literals would be super neat
12:40:33PMunchAnd cool, I was just able to use Futhark to wrap Gtk3 and WebKitGtk in order to have a Gtk application which loads a website
12:40:58FromDiscord<Rika> Cool
12:43:16PMunchAll the wrapping is being done fully automatically, I just tell it which header files I wanted to import, rewrote some sample code to use nil instead of NULL and removed some semicolons and bish bash bosh there's my application
12:46:08FromDiscord<konsumlamm> In reply to @exelotl "It just feels weird": the point is not to save characters, the point is to have nicer syntax for custom number literals (1/32 is no literal btw), so that you can for example have bigint literals (which would need strings otherwise, since the numbers can be arbitrarily large)
12:49:20FromDiscord<exelotl> oh yeah sorry, I don't mean in general, just in my own project where I was already using `fp()` everywhere 😅
12:55:48FromDiscord<Rika> as ive said
12:55:50FromDiscord<Rika> you dont need to use it
13:13:44*andinus quit (Remote host closed the connection)
13:14:57*arkurious joined #nim
13:37:52NimEventerNew post on r/nim by PMunch: Is Nim a Transpiler?, see https://reddit.com/r/nim/comments/qc11b8/is_nim_a_transpiler/
13:38:33FromDiscord<Yardanico> finally, an article
13:38:46PMunchFinally?
13:39:27FromDiscord<Yardanico> yes, about nim + "transpiler"
13:39:57PMunchAh yes, I wrote it yesterday after someone asked the question for the millionth time :P
13:40:09PMunchFigured we needed an article we could just link to
13:40:27FromDiscord<Yardanico> make a forum thread too
13:40:38FromDiscord<Yardanico> and post on HN :DD
13:42:55PMunchThat sounds like a nice way to get a really nice bikeshedding discussion going :P
13:43:27NimEventerNew thread by PMunch: Is Nim a Transpiler?, see https://forum.nim-lang.org/t/8520
13:43:48supakeenwell it's easy, you don't need to read the article
13:43:55supakeenany article with a question as a headline can be ansewred with 'no'
13:44:24FromDiscord<haxscramper> Is 1+1=2
13:44:24FromDiscord<haxscramper> Is 1+1=2?
13:44:36FromDiscord<tandy> lol
13:44:55FromDiscord<haxscramper> And also articles with "what/where/when/why" etc.
13:44:57FromDiscord<haxscramper> "why do X?"
13:45:05FromDiscord<haxscramper> and the answer is "no"
13:46:20FromDiscord<Rika> ??
13:46:21FromDiscord<Rika> "why use nim?" "no" what?
13:47:35FromDiscord<Yardanico> In reply to @haxscramper "And also articles with": so in your opinion "Why Nim is not a transpiler" is a better title than "Is Nim a transpiler?"
13:47:43FromDiscord<Yardanico> i still don't quite get your messages :D
13:48:22FromDiscord<haxscramper> Need to put this on hn to get the real pointless discussion started
13:52:34FromDiscord<Rika> please dont
13:52:41FromDiscord<Rika> im at my limit for today
13:52:44FromDiscord<Rika> tomorrow is fine
13:53:15FromDiscord<haxscramper> no, I won't do this of course, because that's the last think I really need
13:53:23PMunchToo late @Rika: https://news.ycombinator.com/item?id=28930684
13:53:53FromDiscord<Rika> man
13:54:18FromDiscord<Rika> its almost tomorrow, ill just not read it for now
13:54:25FromDiscord<Rika> no comments yet so yeah thatll be fun
13:57:30FromDiscord<Yardanico> 🍿
13:57:59FromDiscord<Rika> now im fucking nervous god this is gonna be a shitshow
13:58:17FromDiscord<Yardanico> why are you nervous
13:59:16FromDiscord<juan_carlos> I remember when someone said that Nim is a C preprocessor...
13:59:29FromDiscord<Rika> i mean
13:59:47*Vladar quit (Remote host closed the connection)
13:59:48FromDiscord<Rika> In reply to @Yardanico "why are you nervous": dunno, just am
14:00:05FromDiscord<Yardanico> just don't be nervous then :P
14:00:17*tk joined #nim
14:02:06*Vladar joined #nim
14:02:53FromDiscord<Rika> lol
14:03:54PMunch@juan_carlos, yeah it's not exactly obvious why it isn't at first glance :P
14:04:07PMunchBut I mean that's how C++ started out *shrugs*
14:04:59FromDiscord<Yardanico> don't tell anyone that C++ was a "transpiler" in the past
14:06:04FromDiscord<enthus1ast> "No this lang ist just a transpiler, it can't keep up with my magicx haxx0r skills"
14:06:39PMunchOh well, I've gotta go. Have fun with the HN post :P
14:06:40*PMunch quit (Quit: Leaving)
14:07:25FromDiscord<Yardanico> 9 points already
14:07:31FromDiscord<Yardanico> time to get my popcorn
14:08:04tkhttp://ix.io/3Cjc - is there any way to get the expected behaviour? The documentation claims that conversions between the base type and subrange will be implicit but not that conversions between subranges (even if they have the same range) will be implicit. Is there some way to get strict primitive type subtyping in nim?
14:10:07FromDiscord<enthus1ast> a = 6 ?
14:10:22FromDiscord<enthus1ast> is not in the range[0..5]
14:10:30tkIt's commented. That's not what the issue is.
14:10:50tkThe unexpected code is at the bottom. The last 4 lines.
14:10:53FromDiscord<enthus1ast> "# Does not compile as expected"
14:11:07FromDiscord<enthus1ast> oh man i must read \:D
14:11:07tkRight... It doesn't compile, which makes sense.
14:11:23FromDiscord<Rika> why would these not compile?
14:11:25FromDiscord<Rika> i mean
14:11:30FromDiscord<Rika> why would last four be unexpected
14:11:35FromDiscord<Rika> A and B are aliases
14:11:42FromDiscord<Rika> if you want them to be different use `distinct`
14:11:52tkAre they? Where does it say that a type defined the same is the same type?
14:12:22FromDiscord<Rika> one moment
14:12:26FromDiscord<Rika> internet slow
14:12:35tkOkay, I had not gotten so far as to reaching distinct. This does indeed solve my problem.
14:12:36FromDiscord<enthus1ast> yes that also hit me, once, did also not follow araqs explanation back then
14:13:12tkcool, thanks!
14:13:51tkAside from not having a standard and some other issues relating linking nim is basically the perfect C replacement so far.
14:15:22FromDiscord<geekrelief> In reply to @tk "Are they? Where does": https://nim-lang.github.io/Nim/manual.html#type-relations-type-equality
14:15:47tkokay, thanks
14:15:58FromDiscord<enthus1ast> this enables the tuple i guess?
14:16:09FromDiscord<geekrelief> yeah
14:16:10FromDiscord<enthus1ast> tuple behaviour
14:21:46*notchris quit (Ping timeout: 245 seconds)
14:22:35*LyndsySimon quit (Ping timeout: 264 seconds)
14:22:52FromDiscord<haxscramper> 9 comments 21 points
14:22:55FromDiscord<haxscramper> here we ggo
14:23:50*notchris joined #nim
14:24:21*LyndsySimon joined #nim
14:27:33FromDiscord<Rika> nooooo
14:28:46FromDiscord<Rika> this one by ivanbakel
14:28:47FromDiscord<Rika> i like it
15:02:43FromDiscord<dom96> Good point by k about gatekeeping
15:03:46FromDiscord<Rika> i like that too
15:04:02FromDiscord<Rika> also the reply from modernmech
15:04:11FromDiscord<dom96> also this https://news.ycombinator.com/item?id=28931264
15:04:27FromDiscord<Rika> `In actual usage, the main difference between a compiler and a transpiler is usually the speaker's affiliation with JS communities.`
15:04:29FromDiscord<Rika> lmfao
15:04:40FromDiscord<dom96> really the title of PMunch's blog post should be "The word transpiler is stupid"
15:06:57FromDiscord<dom96> some very interesting historical insight in there
15:10:37FromDiscord<Rika> yeah im not hating the responses as much as i thought i would
15:14:55FromDiscord<reilly> Can I echo the capacity of a cstring?
15:16:11FromDiscord<haxscramper> cstring does not have capacity
15:16:28FromDiscord<haxscramper> cstring is a C string for C backed, and Js string for Js backend
15:16:31FromDiscord<haxscramper> "common" string
15:30:28FromDiscord<reilly> sent a long message, see http://ix.io/3CjU
15:31:34FromDiscord<reilly> I also can't just pass in a string, because no matter the string's capacity (`newStringOfCap()`), entering a single character immediately crashes due to illegal storage access. It ends up implicitly converted to a cstring anyway.
15:33:11FromDiscord<Yardanico> In reply to @reilly "Okay, well, I'm using": hmm
15:34:04FromDiscord<Yardanico> @reilly I think the nim definition is a bit wrong in this case then
15:34:22FromDiscord<Yardanico> if igInputTextWithHint itself creates a string, you should probably pass pointer to a buffer to it
15:35:26FromDiscord<Yardanico> lemme try to do it myself
15:36:52FromDiscord<reilly> For the record, if I pass in `buf` as `""` and `buf_size` as some arbitrary number, it will still crash when typing a single character.
15:37:09FromDiscord<Rika> use string
15:37:46FromDiscord<Rika> then `str[0].addr.cstring` and `capacity` that you explicitly allocated with `newstringofcap` i guess?
15:38:01FromDiscord<Rika> maybe no need [0].addr
15:38:09FromDiscord<Rika> think `str.cstring` is right, i dont know
15:38:51FromDiscord<Yardanico> no that won't work
15:39:03FromDiscord<reilly> Nim implicity converts the string to a cstring anyway.
15:39:10FromDiscord<Yardanico> In reply to @reilly "Nim implicity converts the": that behaviour is deprecated
15:39:13FromDiscord<Rika> i dont think it does in the future
15:39:13FromDiscord<Rika> yes
15:39:17FromDiscord<Yardanico> In reply to @Yardanico "no that won't work": ah actually it will, yeah, if the bufSize is correct
15:39:23FromDiscord<Yardanico> @reilly
15:39:28FromDiscord<Yardanico> works for me
15:39:31FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3CjW
15:39:43FromDiscord<reilly> In reply to @Yardanico "that behaviour is deprecated": I know it's deprecated, that's why I'm trying to avoid it 😛
15:40:01FromDiscord<Rika> the implicit convert is deprecated, the explicit is not
15:40:08FromDiscord<Yardanico> exactly
15:40:34FromDiscord<Rika> my english a bit weird right now, probably because i just did some japanese stuff
15:41:31FromDiscord<reilly> I'm noticing that `sizeof(s)` always returns 8, which is not very helpful...
15:41:51FromDiscord<Yardanico> In reply to @reilly "I'm noticing that `sizeof(s)`": it returns the size of the reference to the string data which is 8 and is correct, yes
15:41:57FromDiscord<Yardanico> check `s.len`
15:42:05FromDiscord<Rika> careful with len for cstring
15:42:05FromDiscord<Yardanico> oh yeah, actually, that code is a bit wrong
15:42:17FromDiscord<Rika> len for cstring is not constant time
15:42:39FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3CjZ
15:42:46FromDiscord<Yardanico> with newString the string itself will _always_ be 128 chars so you'll have to strip
15:42:54FromDiscord<Yardanico> and you won't know if the spaces were done by the user or not
15:43:07FromDiscord<Rika> whats wrong with ofcap?
15:43:11FromDiscord<Yardanico> it doesn't work
15:43:13FromDiscord<Rika> does it just not work?
15:43:28FromDiscord<Rika> i need to test
15:43:33FromDiscord<Yardanico> well of course, because .len is 0
15:43:53FromDiscord<Rika> i see
15:44:04FromDiscord<Rika> the issue is because internal len is not updated i feel
15:44:07FromDiscord<Yardanico> one way is to do manual allocation I guess
15:44:11FromDiscord<Yardanico> @Rika yes, but that's not possible to do really
15:44:14FromDiscord<Rika> yes
15:44:15FromDiscord<Rika> i know
15:44:36FromDiscord<Rika> really think you need to do manual alloc/create
15:44:44FromDiscord<Rika> i recommend create tho
15:45:28FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Ck0
15:45:35FromDiscord<Yardanico> and len changes correctly
15:45:41FromDiscord<Yardanico> because all other bytes are null
15:45:47FromDiscord<Rika> because len is not internal
15:45:55FromDiscord<Rika> rather not internally stored
15:46:10FromDiscord<Rika> its recomputed every call so no need to update anything
15:46:43FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Ck1
15:46:47FromDiscord<Yardanico> and of course you can define a callback for the input change event in imgui
15:46:57FromDiscord<Rika> damn double cstring just to make sure
15:47:02FromDiscord<Yardanico> In reply to @Rika "damn double cstring just": ah yeah :D
15:47:12FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=3Ck1" => "https://play.nim-lang.org/#ix=3Ck2"
15:47:16FromDiscord<Rika> ah yes the cstring is made of cstring
15:54:14*Gustavo6046 quit (Remote host closed the connection)
15:54:15*Gustavo6046_ joined #nim
15:54:37FromDiscord<reilly> Cool, that does work. Not super intuitive, but I'll get over it.
15:56:36FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3Ck5
15:56:52*Gustavo6046_ is now known as Gustavo6046
16:01:30FromDiscord<Yardanico> because ImGuiInputTextFlags
16:01:40FromDiscord<Yardanico> that's not related to nim, it's imgui-specific stuff
16:01:46FromDiscord<Yardanico> e.g. for callback to fire on edits you have to use CallbackEdit
16:02:11FromDiscord<Yardanico> ` igInputTextWithHint("", "duration", data, 9, CallbackEdit, cb)`
16:02:14FromDiscord<Yardanico> for example
16:02:59FromDiscord<Yardanico> https://github.com/ocornut/imgui/blob/master/imgui.h#L989↵https://github.com/nimgl/imgui/blob/master/src/imgui.nim#L327
16:03:15FromDiscord<Yardanico> you'll have to read the original imgui sources plenty :P
16:08:05FromDiscord<reilly> You have to tell ImGui that you want to use your callback? That's wack.
16:09:02FromDiscord<IsaacPaul> That's because there are a ton of different reasons for a callback
16:09:18FromDiscord<Yardanico> exactly, so the default is None
16:09:28FromDiscord<IsaacPaul> granted, they should ask for a reason when setting up the callback
16:09:35FromDiscord<Yardanico> In reply to @IsaacPaul "granted, they should ask": they do
16:09:38FromDiscord<IsaacPaul> oh
16:09:48FromDiscord<Yardanico> ImGuiInputTextFlags
16:09:56FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/900415545239810068/unknown.png
16:10:06FromDiscord<Yardanico> this is both for setting up parameters of the input field and for callbacks
16:11:13FromDiscord<IsaacPaul> I see it now `..., flags: ImGuiInputTextFlags = 0.ImGuiInputTextFlags, ...`↵lol
16:11:49FromDiscord<reilly> In reply to @IsaacPaul "That's because there are": That makes enough sense, actually.
16:18:40FromDiscord<IsaacPaul> Using a literal to hold all the options is an interesting way of doing things... ↵I would at least use an abstraction over it..
16:20:03FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3Ckd
16:20:25FromDiscord<Yardanico> wait you don't need to do this
16:20:27FromDiscord<Yardanico> just do `or`
16:20:37FromDiscord<Yardanico> `CharsDecimal or CallbackEdit` for example
16:20:47FromDiscord<Yardanico> nim's `or` already works as bit or for integers
16:21:05FromDiscord<reilly> Then why have `bitor()`? 🤨
16:22:35FromDiscord<IsaacPaul> bitor is probably inferring the wrong type. Make it explicit?
16:24:41FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3Cke
16:24:49FromDiscord<Yardanico> what about `CharsDecimal or CallbackEdit`
16:27:25FromDiscord<Rika> In reply to @reilly "Then why have `bitor()`?": some people prefer it
16:27:29FromDiscord<Rika> its more explicit
16:28:09FromDiscord<Rika> it should work, odd that it doesnt
16:28:35FromDiscord<reilly> In reply to @Yardanico "what about `CharsDecimal or": `or` has no implementation for enums, so I have to include `ord()`. This still isn't enough though, as there's still a type mismatch between this expression (int literal) vs the argument type (`ImGuiInputTextFlags`).
16:28:57FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Ckl
16:28:59FromDiscord<Rika> enums are arguably not something to be `or`ed but thats another discussion
16:29:25FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Ckm
16:31:28FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3Ckp
16:31:56FromDiscord<Rika> oh
16:31:58FromDiscord<Rika> remove the generic then
16:32:25FromDiscord<Rika> AHHHH
16:32:28FromDiscord<Rika> I GET IT
16:32:31FromDiscord<reilly> But this is exactly what I was doing before...
16:32:44FromDiscord<reilly> w/o the generic, I mean.
16:32:47FromDiscord<Rika> i get it
16:32:57FromDiscord<IsaacPaul> maybe its passing a function pointer?
16:32:58FromDiscord<Rika> the or of the two enums is not itself a valid enum
16:33:13FromDiscord<reilly> But it's not supposed to be a valid enum.
16:33:19FromDiscord<Rika> the wrapper is simply wrong
16:33:36FromDiscord<Rika> In reply to @reilly "But it's not supposed": it has to be if you want to convert it to the type
16:34:11FromDiscord<Rika> the wrapper is wrong, there should be an `ImGuiInputTextFlag = enum ...` and an `ImGuiInputTextFlags = set[ImGuiInputTextFlag]` or so
16:34:33FromDiscord<IsaacPaul> ah makes sense
16:35:23FromDiscord<Rika> of course, this has some issues too in some case
16:35:24FromDiscord<Rika> (edit) "case" => "cases"
16:35:34FromDiscord<reilly> But just a few lines earlier, I'm doing the same thing with ImGuiWindowFlags. That expression evaluates to `8230`, but there's no valid enum for that... Unless the result just can't be greater than the maximum enum value?
16:36:17FromDiscord<Rika> ah
16:36:18FromDiscord<Rika> yes
16:36:21FromDiscord<Rika> thats perfect
16:36:26FromDiscord<Rika> yes thats the proper issue
16:36:34FromDiscord<Yardanico> In reply to @reilly "But just a few": the Nim definition is wrong, it can be bigger than the biggest enum value
16:36:56FromDiscord<Rika> then what is the issue?
16:36:57FromDiscord<Yardanico> i mean the arguments of the C function aren't exactly correct
16:37:58FromDiscord<Yardanico> ` igInputTextWithHint("", "duration", data, 9, ord(CharsDecimal) or ord(CallbackEdit), cb)` this works fine if you change the function definition to `proc igInputTextWithHint(label: cstring, hint: cstring, buf: cstring, buf_size: uint, flags: int = 0, callback: ImGuiInputTextCallback = nil, user_data: pointer = nil): bool {.importc: "igInputTextWithHint".}`
16:38:10FromDiscord<Yardanico> so it's an int and not ImGuiInputTextFlags
16:38:23FromDiscord<Yardanico> so as I said, it's yet another issue of the wrapper itself
16:39:34FromDiscord<reilly> But the arguments for creating a window do use ImGuiWindowFlags... `flags: ImGuiWindowFlags = 0.ImGuiWindowFlags`
16:39:41FromDiscord<reilly> So, what's the difference?
16:40:41FromDiscord<Yardanico> In reply to @reilly "So, what's the difference?": if it works, it works by an accident because the values aren't bigger than the biggest value in the enum
16:40:45FromDiscord<Yardanico> so nim allows it to compile
16:40:53FromDiscord<Yardanico> as I said, the wrapper definition for this function is wrong
16:40:58FromDiscord<Yardanico> and for all others that take Flags types too
16:47:48Mister_Magisterman i really gotta learn async
16:47:51Mister_Magisteridk how it works
16:47:54NimEventerNew thread by JPLRouge: Min 1.6 help --passc:-flto problème, see https://forum.nim-lang.org/t/8521
16:47:55Mister_Magisteri just do waitfor
16:48:01Mister_Magisteror await
16:50:41FromDiscord<Yardanico> waitFor is for global-level code, you mainly use it to start your async code
16:50:53FromDiscord<Yardanico> and you use `await` to wait for a completion of an async proc from another async proc
16:51:18Mister_Magisterye ye but i just gotta learn how to use async
16:52:56FromDiscord<Rika> you can almost think of `await` as "wait for this proc to finish, feel free to do some other stuff in the mean time
16:53:40Mister_Magisteri know whats await and waitfor lol
16:54:52FromDiscord<Rika> then whats the issue
17:01:58NimEventerNew thread by Sensanaty: Runtime Regex string replacing, see https://forum.nim-lang.org/t/8522
17:08:51Mister_Magisterwould someone be so kind as to remind me how do you type base in nim? like 0x10
17:10:46Mister_Magister0b
17:10:49Mister_Magister0x works too
17:11:50FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3CkF
17:11:53FromDiscord<reilly> (edit)
17:12:50Mister_Magisteri just love using $ its like being super lazy just slap $ and boom its a string
17:12:58FromDiscord<Rika> !eval echo 0o777
17:13:02NimBot511
17:13:35Mister_Magisterthank @reilly
17:18:44Mister_Magisterha, i made udp server/client to discover at which ip address is the server
17:20:15Mister_Magisterhttps://gist.github.com/Michal-Szczepaniak/6f7319c686aaaab1a6a0d273153e7936 feel free to judge me
17:21:43FromDiscord<dom96> Mister_Magister: what do you want to learn about async?
17:21:47Mister_Magisteralso, why can't i put - in file name
17:21:57FromDiscord<Yardanico> because - is not a valid character for a nim identifier
17:21:58Mister_Magister@dom96 how does it work, how to use it, how to make async stuff
17:22:04FromDiscord<Yardanico> and module names must be nim identifiers
17:22:07FromDiscord<Yardanico> (edit) "and module names must be ... nim" added "valid"
17:22:55Mister_Magisterlike, i want to have one program to have one TCP server for communication and one UDP server for discovering TCP server, and i assume i could make them both ASYNC and just do stuff when each of them receives some data
17:23:10Mister_Magisterotherwise i have to use threads
17:27:50FromDiscord<enthus1ast> then "UDP server for discovering TCP server" could mean that you want to do ip multicast?
17:28:24FromDiscord<enthus1ast> if yes, then you could have a look at\: https://github.com/enthus1ast/nimMulticast
17:28:42Mister_Magisternot multicast
17:28:59Mister_Magisteralso, i fail to find file name naming guidelines
17:29:38FromDiscord<enthus1ast> then idk what you mean \:)
17:34:43FromDiscord<dom96> yes, you should be able to have two servers using async
17:35:02FromDiscord<dom96> but why use UDP for discovery?
17:38:23FromDiscord<reilly> In reply to @Mister_Magister "also, i fail to": File names just have to be valid Nim identifiers. `file-name` is not a valid identifier because it would not be parsed as a single token, but as `file`, `-`, `name` ("file minus name").
17:38:40Mister_Magisteroh
17:38:43Mister_Magisterinteresting
17:38:53Mister_Magister@dom96 why not
17:39:25FromDiscord<reilly> `file_name` is valid, because the underscore character is not used for anything else and causes no ambiguity.
17:39:36Mister_Magistermhm
17:42:15FromDiscord<enthus1ast> if you do not use multi/broadcast udp is not needed imho "for discovery", but idk what you're doing, maybe it is.↵One think to keep in mind for udp is that the os cannot tell you if there was someone listening, but for tcp it can
17:43:12Mister_Magisterofc its broadcast
17:43:14FromDiscord<enthus1ast> so your application must respond with something
17:43:18Mister_Magisterhow would you want to discover it otherwise
17:43:23Mister_Magisterand for broadcast you need udp
17:43:47Mister_Magisteryou can't do tcp over broadcast
17:44:06FromDiscord<enthus1ast> i do not now what "it" is, but you can also do multicast for discovering, thats what i meant
17:45:01FromDiscord<enthus1ast> @dom96\: is 1.6 already installable via choosenim?
17:45:11FromDiscord<enthus1ast> latest version is see is 1.4.8
17:45:13NimEventerNew post on r/nim by al_earner: The virus issue, see https://reddit.com/r/nim/comments/qc6hsz/the_virus_issue/
17:45:38FromDiscord<reilly> In reply to @enthus1ast "<@132595483838251008>\: is 1.6 already": Should be, that's what I did.
17:46:03FromDiscord<reilly> Make sure you're also using the latest version of choosenim: `choosenim update self`
17:46:25FromDiscord<enthus1ast> a↵choosenim update stable ↵it is
17:46:43Mister_MagisterOne question, https://nim-lang.org/docs/asyncnet.html there is proc serve() {.async.} = but i fail to see why is it being executed? asynCheck just adds callback if it fails right?
17:47:15Mister_Magisteror is it because its calling that function it adds to "list of asyncs to process"
17:47:37FromDiscord<enthus1ast> this example could have use waitFor
17:47:54FromDiscord<enthus1ast> instead of asyncCheck and runForever
17:47:56Mister_Magisterye but i wanna keep it async
17:48:04Mister_MagisterwaitFor breaks asyncness
17:48:09FromDiscord<enthus1ast> it still is async
17:48:10FromDiscord<enthus1ast> no
17:48:12Mister_Magisteryhes
17:48:22FromDiscord<enthus1ast> not it does not
17:48:32FromDiscord<enthus1ast> you do not call waitFor INSIDE an async proc
17:48:53Mister_Magisteri mean this code sure but if you were to extend it then waitfor would break tihngs
17:48:56FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3CkJ
17:49:05Mister_Magisterfor example if you wanted to add second serve function
17:49:50Mister_Magisterbut ye it doesn't answer my question anyway
17:51:20FromDiscord<enthus1ast> asynCheck registers the proc to the global dispatcher
17:51:29FromDiscord<enthus1ast> and runForever runs the async loop
17:51:47Mister_Magisteryee thats what i thought
17:51:48Mister_Magisterthank
17:52:50FromDiscord<enthus1ast> and if you wanna do your own loop,↵just call poll() every so often
17:53:10Mister_Magisteranother question, doesn't infinite loop inside async function break its asyncness?
17:53:13FromDiscord<enthus1ast> could do this in a eg. gui callback or so
17:53:28FromDiscord<enthus1ast> you must have a await somewhere
17:53:37FromDiscord<enthus1ast> eg ↵await sleepAsync(1\_000)
17:53:43Mister_Magisterah
17:53:51Mister_Magisterawait will allow other futures to run
17:53:56FromDiscord<enthus1ast> yes
17:54:03Mister_Magisteri slowly begin to understand the async
17:54:15Mister_Magisterwill try to rewrite my discover example from before into async
18:09:17Mister_MagisterHA IT WORKS
18:09:20Mister_Magisteri love async now
18:09:23Mister_Magisteri finally get it
18:09:30Mister_Magisterthank you guys
18:10:15FromDiscord<Rika> In reply to @enthus1ast "asynCheck registers the proc": No, merely calling the async proc will register it afaik
18:10:56Mister_MagisterasyncCheck registers callback in case of exception
18:10:59Mister_Magisterthats what docs say
18:11:24FromDiscord<enthus1ast> yes you're right Rika
18:14:30*Gustavo6046 quit (Remote host closed the connection)
18:14:38*Gustavo6046_ joined #nim
18:16:19Mister_Magisterdang i wrote entire client code and it compiled and ran without issue
18:16:22Mister_Magisterholy shite
18:16:28Mister_Magisteryou love when that happens
18:17:40Mister_Magisterguys you can be proud of me i understood spirit of async https://gist.github.com/Michal-Szczepaniak/71593051595331bbcbae62a4ce19fb90
18:17:53*Gustavo6046_ is now known as Gustavo6046
18:18:01Mister_Magisternow i have tcp server and udp discovery server without threads
18:22:32Mister_Magisteris it okay to use nonasync methods inside async methods?
18:24:10FromDiscord<Yardanico> yes, but be aware that if they're CPU intensive they block the whole thread
18:24:18FromDiscord<Yardanico> so all other background async tasks won't run
18:25:13Mister_Magisteroki
18:28:09Mister_Magisterasync simplifies so many things for me
18:44:04FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Cl4
18:45:15FromDiscord<Yardanico> In reply to @jmgomez "hey guys, so Im": you should compile your nim app with --debugger:native
18:48:29FromDiscord<RattleyCooper> Anybody have a list of the 15 new stdlib modules that were added?
18:48:36FromDiscord<RattleyCooper> (edit) "added?" => "added for 1.6?"
18:48:52FromDiscord<Yardanico> In reply to @RattleyCooper "Anybody have a list": https://github.com/nim-lang/Nim/blob/version-1-6/changelogs/changelog_1_6_0.md#new-and-deprecated-modules
18:48:56FromDiscord<jmgomez> In reply to @Yardanico "you should compile your": Right, I was doing that
18:49:07FromDiscord<Yardanico> the blog article shows the link for the full changelog at the bottom
18:49:09FromDiscord<RattleyCooper> In reply to @Yardanico "https://github.com/nim-lang/Nim/blob/version-1-6/ch": thanks!
18:50:27FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Cl6
18:50:43FromDiscord<Yardanico> well, -d:debug does nothing and what do you mean "doesn't map symbols well"?
18:51:06FromDiscord<Yardanico> i mean, it wouldn't be perfect because both Nim and the C compiler optimize a lot of unused stuff away
18:51:11FromDiscord<jmgomez> https://media.discordapp.net/attachments/371759389889003532/900456129165930536/unknown.png
18:51:26FromDiscord<Yardanico> and what type is `people`?
18:51:30FromDiscord<Yardanico> for example
18:51:52FromDiscord<jmgomez> In reply to @Yardanico "well, -d:debug does nothing": Oh, I just found the cmd line in a repo example
18:52:02FromDiscord<Yardanico> also, are you sure that nim-gdb is loaded?
18:52:06FromDiscord<Yardanico> check the debug console
18:52:10FromDiscord<Yardanico> it should show "Loading Nim Runtime support"
18:53:36FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Cl8
18:53:40FromDiscord<Yardanico> and yeah, to be honest nim-gdb and nim native debugging isn't really well tested
18:54:03FromDiscord<Yardanico> In reply to @jmgomez "This is the whole": you need to point miDebuggerPath to nim-gdb
18:54:10FromDiscord<Yardanico> so full path to the script
18:54:45FromDiscord<jmgomez> it uses cwd isnt? It is able to pick the target from there without anything else
18:55:07FromDiscord<jmgomez> Are there any alternatives to debug that I can try out?
19:00:28FromDiscord<reilly> In reply to @Mister_Magister "async simplifies so many": I was looking at something unrelated and found the exact rules for what counts as an identifier in Nim:↵https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords
19:03:10FromDiscord<jmgomez> Magically now works, the strings arent displayed as hex anymore
19:04:06Mister_Magister@reilly i'm not sure why you pinging me
19:06:10FromDiscord<reilly> > also, why can't i put - in file name↵You asked about it earlier and I gave a half-answer, but I happened to find the actual specification in case you're interested.
19:06:35Mister_Magisterah yes
19:06:38Mister_Magisterthanks
19:07:03FromDiscord<rainbowasteroids> does anyone know how I should turn a seq of bytes/chars into a unicode string?
19:07:52FromDiscord<leorize> depends on the type of unicode you're looking for
19:08:06FromDiscord<leorize> if it's utf-8 then just use your byte stream as is
19:08:36FromDiscord<leorize> if you need utf-16 to deal with windows then winim has widestrings iirc
19:08:39FromDiscord<enthus1ast> you must know the source encoding, then you can encode it in any other encoding
19:09:56FromDiscord<Yardanico> In reply to @leorize "if you need utf-16": nim stdlib itself has that :)
19:10:07FromDiscord<rainbowasteroids> this is what the ID3 docs say\:> All Unicode strings use 16-bit unicode 2.0 (ISO/IEC 10646-1\:1993, UCS-2). Unicode strings must begin with the Unicode BOM ($FF FE or $FE FF) to identify the byte order.
19:10:07FromDiscord<Yardanico> https://nim-lang.org/docs/widestrs.html
19:10:11FromDiscord<Yardanico> not exactly well documented
19:10:48FromDiscord<Yardanico> In reply to @rainbowasteroids "this is what the": I think https://github.com/treeform/encode should work well enough for you
19:10:54FromDiscord<Yardanico> its simple enough]
19:10:55FromDiscord<Yardanico> (edit) "enough]" => "enough"
19:12:07FromDiscord<Yardanico> `fromUTF16LE` specifically
19:17:54FromDiscord<Yardanico> ah sorry just `fromUTF16` since it reads the byte marker by itself
19:57:06FromDiscord<treeform> byte order marker is so annoying, but my function will deal with it.
20:13:25FromDiscord<juan_carlos> BOM go Boom
20:35:50FromDiscord<deech> Can I use `genAst` to generate "parts" of a type so I can assemble however I want? eg. I'd like a `tuple[i:int, s:string, ...]` but I'd like to produce it in a macro which takes something like `@[("i","int"),("s","string"), ...]`. I realize this can be done with `newColonExpr` but this seems more convenient if it can be done.
21:06:55arkanoidI'm doing the "smallest statically linked hello world possible game", and I'm realizing that upx fails to compress musl statically linked binaries
21:07:29FromDiscord<Yardanico> upx doesn't compress really small files, yeah, I tried before ;)
21:07:40arkanoidoh, well, old bug https://github.com/upx/upx/issues/309
21:07:48FromDiscord<Yardanico> this one is fixed
21:08:01FromDiscord<Yardanico> and it's 30kb
21:08:10FromDiscord<Yardanico> a fully static nim musl hello world binary can be 5kb
21:08:17arkanoidis "nim --gc:arc -d:release --opt:size --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static -o:hello_static_musl c hello.nim" the best I can do?
21:08:39FromDiscord<Yardanico> what size do you get?
21:08:41FromDiscord<Yardanico> also -d:danger
21:08:46FromDiscord<Yardanico> also --panics:on
21:08:48FromDiscord<Yardanico> also -flto
21:09:00FromDiscord<Yardanico> read the blog post :P
21:09:14FromDiscord<Yardanico> and this repo https://github.com/ee7/binary-size
21:11:51arkanoidoh!
21:12:00arkanoidzigcc?
21:12:27FromDiscord<Yardanico> it's a wrapper script for `zig cc` since nim doesn't like compiler commands with space in the name
21:13:38arkanoidI'm getting much larger binaries
21:13:44arkanoidbut nim 1.6.0 here
21:14:30FromDiscord<Yardanico> with all the same configs?
21:14:40FromDiscord<Yardanico> are you sure you're executing the correct command for 4kb?
21:16:15FromDiscord<Yardanico> I just tested and I get a 4960 bytes binary after the last 4kb command + `strip -s file`
21:16:18arkanoidno as I'm not even near that. I've a script that tests both glibc and musl, and I'm getting 784K for statically compiled glibc and 26K for musl
21:16:44arkanoidand with strip -s at the end for both
21:16:51FromDiscord<Yardanico> well, as you can check in the repo, it uses a lot of additional arguments
21:17:06FromDiscord<Yardanico> e.g. -d:useMalloc makes nim use malloc instead of its own memory allocator
21:17:23FromDiscord<Yardanico> --panics:on turns all Defect exceptions into unrecoverable panics
21:17:26FromDiscord<Yardanico> and so on
21:20:43arkanoidthis is the script I'm using now: https://termbin.com/t5vb
21:21:15arkanoidaccording to that table, I should get glibc version 18KB
21:21:27FromDiscord<Yardanico> no
21:21:42FromDiscord<Yardanico> the 18kb is dynamically linked with glibc
21:22:03FromDiscord<Yardanico> the 18kb with static is with musl-clang
21:22:20FromDiscord<Yardanico> there are two 18kb entries in the table, look carefully :) one is glibc dynamically linked, the other is musl-clang statically linked
21:22:38FromDiscord<Yardanico> statically-linked glibc will be huge obviously
21:22:58arkanoidisn't --passL:-s for static?
21:23:12FromDiscord<Yardanico> that's stripping
21:23:14FromDiscord<Yardanico> static is -static
21:23:24arkanoidoh!
21:29:12arkanoidI should now be in the 22KB case but I'm geetting 26KB https://termbin.com/fjxw
21:29:44FromDiscord<Yardanico> well, "should" is a broad term
21:29:49FromDiscord<Yardanico> different compiler versions, musl versions, etc
21:30:31arkanoidalso copypasting that line is 26KB
21:30:42arkanoidwell, not a problem, very happy with this result
21:30:44FromDiscord<Yardanico> also try stripping still
21:30:47FromDiscord<Yardanico> `strip -s file`
21:30:53FromDiscord<Yardanico> `-s` option for gcc doesn't do all of the stripping
21:31:38arkanoidI've already tried but still 26KB
21:31:57FromDiscord<Yardanico> well, i can't help
21:32:08FromDiscord<Yardanico> complain to your nearest musl-gcc maintainer :P
21:32:39arkanoidwith devel upx --best down to 13KB
21:32:50arkanoidbtw really impressive
21:33:02arkanoidnow I can join the demoscene!
21:33:04arkanoidor maybe not
21:34:27FromDiscord<Yardanico> does demoscene allow for upx?
21:34:40FromDiscord<Yardanico> also see https://github.com/demotomohiro/nim-4k-intro-sample
21:36:33FromDiscord<enthus1ast> @Yardanico\: https://github.com/runestubbe/Crinkler
21:44:10FromDiscord<DMI-1407> is there already a git api for nim ?
21:44:18FromDiscord<IsaacPaul> so for c the compiler can remove dead code if you make it separate functions and data with `-ffunction-sections -fdata-sections` then use `--gc-section` to make the linker include only the sections that are (transitively) dependent on an explicitly included section
21:44:38FromDiscord<IsaacPaul> (edit) "compiler" => "linker"
21:44:47FromDiscord<Yardanico> but is that better than lto + strip?
21:44:59FromDiscord<IsaacPaul> No idea haha
21:47:10arkanoidI'll leave the task to the pro to find out
21:47:22arkanoidI'm already quite happy with that
21:47:45arkanoidare there out major knows issues with nim + musl?
21:50:20FromDiscord<Yardanico> don't think so
21:57:50*Vladar quit (Quit: Leaving)
22:02:11FromDiscord<leorize> https://github.com/disruptek/gittyup↵(@DMI-1407)
22:02:40FromDiscord<DMI-1407> ah nice 🤩
22:05:38FromDiscord<demotomohiro> sent a long message, see http://ix.io/3ClV
22:10:03arkanoidthanks!
22:20:00arkanoidthis thing that demoscene tends to work with windows has always puzzled me
22:20:53*koltrast_ quit (Quit: ZNC - http://znc.in)
22:21:15*koltrast joined #nim
22:22:54FromDiscord<Yardanico> @arkanoid maybe it has to do with the fact that windows has a lot of built-in APIs whereas in Linux libraries are separate from the kernel, so there could be a lot of arguing about "should GTK libraries be counted towards the size" or something similar
22:27:32arkanoidbut I bet most of the scenes are opengl based
22:29:22*mahlon quit (Ping timeout: 252 seconds)
22:29:56arkanoidglutCreateWindow is all you need, obviously stripping down everthing else ... I guess
22:32:39*mahlon joined #nim
22:38:38arkanoidYardanico: here it says SDL2 or GTK3 https://benjamin-computer.medium.com/my-first-demoscene-production-6d426764ad22
22:53:44Mister_MagisterGotta update nim in opensuse cause noone actively maintains it
22:53:52Mister_Magisterand i need newer version :P
22:54:09Mister_Magister"but why don't you just use choosenim" arm
22:54:40FromDiscord<Yardanico> seems like someone does maintain it
22:54:41FromDiscord<Yardanico> https://build.opensuse.org/package/show/home%3Atux93%3Aleap/nim
22:55:16Mister_Magisterits in some guys home repo
22:55:19Mister_Magisterso no, doesn't seem so
22:57:00FromDiscord<Yardanico> well you said "maintain", and it's maintained in his home repo :)
22:57:43Mister_Magisternot really no
22:58:00Mister_Magisteranyway i'll be updating it soon
22:58:19Mister_Magisteri'm already contributor :P
23:47:04Mister_Magisterhttps://build.opensuse.org/request/show/926630 now we waitin