<< 10-05-2020 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:01:51*dadada joined #nim
00:02:14*dadada is now known as Guest62079
00:03:41*junland joined #nim
00:05:38nisstyreoh the null byte is always there in string, ok
00:18:50*Guest76944 quit (Ping timeout: 260 seconds)
00:25:50*Guest62079 quit (Ping timeout: 260 seconds)
00:31:49*dadada__ joined #nim
00:39:30*exelotl joined #nim
00:51:24skrylar[m]pushed the docs for the xxhash update
00:54:59*Hideki joined #nim
00:55:22*Hideki is now known as Guest38843
00:56:02*dadada__ quit (Ping timeout: 272 seconds)
01:00:40*Guest38843 quit (Remote host closed the connection)
01:01:47*dadada joined #nim
01:02:10*dadada is now known as Guest56553
01:03:04*konvertex quit (Ping timeout: 256 seconds)
01:15:45skrylar[m]i don't know that its worth it, but i figured it might be better to just store hashes of parameter blocks and then when changing 'brushes' it just checks if the gl brush is the same as what is already used... maybe cuts a pile of glget tests
01:16:12skrylar[m]altho dunno yet if glget 'counts' as a gpu call
01:25:57*Guest56553 quit (Ping timeout: 260 seconds)
01:31:43*dadada__ joined #nim
01:39:53FromDiscord<Yardanico> So guys can you share your thoughts in https://github.com/nim-lang/Nim/issues/14272 ?
01:39:55disbotsymbols defined in nim.cfg file aren't visible in user code? ; snippet at 12https://play.nim-lang.org/#ix=2leZ
01:41:22*chemist69 quit (Ping timeout: 256 seconds)
01:43:36*chemist69 joined #nim
01:48:46skrylar[m]@Yardanico it should be fixed but at least its not hard to work around
01:49:50FromDiscord<Yardanico> Yeah I know
01:50:12*NimBot joined #nim
01:50:15FromDiscord<Yardanico> It's just that it's not documented anywhere except the NimScript manual where it's just a note
01:50:31*Hideki is now known as Guest39366
01:50:34FromDiscord<Yardanico> And it's not really related to nim.cfg
01:52:30FromDiscord<Yardanico> (I mean that note in NimScript)
01:52:31skrylar[m]i don't suppose theres an undefine flag you could shove in the cfg
01:54:56*Guest39366 quit (Ping timeout: 272 seconds)
01:55:50*dadada__ quit (Ping timeout: 256 seconds)
01:56:22FromDiscord<Yardanico> It's not about that really
01:56:33FromDiscord<Yardanico> It's about the order of evaluation of configs
01:57:22FromDiscord<Yardanico> User config gets evaluated the last, so the switches under @if release in main nim config don't get enabled
01:57:46FromDiscord<Yardanico> And nim compiler switches (passed in command line) are always there before any configs
01:58:13skrylar[m]imho there isn't anything wrong with that, but with using the general define syntax to denote a release build
01:59:03skrylar[m]it should be fine for system configs to include stuff like -d:corporateoverlordflag
02:01:47*dadada joined #nim
02:02:12*dadada is now known as Guest35672
02:06:45skrylar[m]re-reading the ticket. i dunno. i don't think -d:release should be special. if its going to be special it should be --release, things shouldn't use generic syntax like `-d:` if they are not going to behave generically
02:07:51skrylar[m]other than that the order of execution seems okay, esp. if there is an undefine statement somewhere
02:11:17*monok joined #nim
02:13:58*mono quit (Ping timeout: 256 seconds)
02:14:03skrylar[m]i think the part about game engines i didn't grok until now is you were never supposed to rely on libs as external things but to tear them apart and graft them on to the engine. people don't worry about the deps going stale because they just fuse the deps to the engine and never update them anyway
02:17:26*muffindrake quit (Ping timeout: 244 seconds)
02:19:31*muffindrake joined #nim
02:25:58*Guest35672 quit (Ping timeout: 272 seconds)
02:31:50*dadada__ joined #nim
02:32:51skrylar[m]hrmm. i kind of expected this to work `with foo: a = 1; b = 2` but it seems you are intended not to use with as a block, and also it does not work with field assignments
02:47:53skrylar[m]dumb question; what are we using for weak references these days
02:55:22*dadada__ quit (Ping timeout: 246 seconds)
02:55:23disruptekcursor
02:55:26disruptek!memory
02:55:27disbot total: 360 Megabytes; free: 95 Megabytes; owned: 250 Megabytes; max: 360 Megabytes
02:56:20disruptekskrylar[m]: that was to you, btw. {.cursor.}
03:01:50*dadada joined #nim
03:02:13*dadada is now known as Guest870
03:05:07skrylar[m]i don't see a cursor in the language manual or the index o.o
03:07:42disruptekarc weak refs.
03:08:00disruptekvar foo {.cursor.} = someRef
03:09:35disrupteki guess they aren't in doc/destructors.rst for some reason.
03:11:22disruptekthere are no cursors for closures, though.
03:14:20*Senketsu joined #nim
03:14:39skrylar[m]yea they aren't referenced anywhere that i can find
03:24:34disruptek~cursor is ```let foo {.cursor.} = anyRef # with --gc:arc```
03:24:35disbotcursor: 11```let foo {.cursor.} = anyRef # with --gc:arc```
03:24:53disruptek~cursor is let foo {.cursor.} = anyRef # with --gc:arc
03:24:53disbotcursor: 11let foo {.cursor.} = anyRef # with --gc:arc
03:24:58disruptekbetter.
03:25:53disruptek~bentley lyybb
03:25:54disbotno matching footnotes for `bentley` with regexps `lyybb`. 🙁
03:26:01*Guest870 quit (Ping timeout: 264 seconds)
03:31:58*dadada__ joined #nim
03:55:20*dadada__ quit (Ping timeout: 256 seconds)
04:01:49*dadada joined #nim
04:02:12*dadada is now known as Guest21835
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:44*supakeen joined #nim
04:26:01*Guest21835 quit (Ping timeout: 264 seconds)
04:31:53*dadada__ joined #nim
04:55:24*dadada__ quit (Ping timeout: 256 seconds)
05:00:43*dadada joined #nim
05:01:13*dadada is now known as Guest63444
05:02:38skrylar[m]contemplating a design pattern in nim
05:03:23*Hideki joined #nim
05:03:47*Hideki is now known as Guest29324
05:09:18skrylar[m]pfft you're actually allowed to use typeof when defining parameter types
05:11:46skrylar[m]anyway the idea is for a type that has to have an up to date hash/dirty field if instead of saying "make sure to run 'update' when you are done" if you have a macro that just sets write mode and so it like stuffs all the mutation in a sub-block with a defer to do it. so it reads `change sometexture: sometexture.magfilter = ...`
05:18:27skrylar[m]https://gist.github.com/Skrylar/8c42061559e03894fb009210d0d25857 hm
05:20:47*Guest29324 quit (Remote host closed the connection)
05:31:05*solitudesf joined #nim
05:46:10*Guest63444 quit (Ping timeout: 246 seconds)
05:48:37*exelotl quit (Ping timeout: 246 seconds)
05:54:57*Hideki joined #nim
05:55:21*Hideki is now known as Guest85298
06:08:54*Guest85298 quit (Ping timeout: 272 seconds)
06:25:34*Senketsu quit (Quit: WeeChat 2.8)
06:53:08*rockcavera quit (Remote host closed the connection)
07:38:09*dadada joined #nim
07:38:34*dadada is now known as Guest65412
07:43:31FromDiscord<Yardanico> Good morning I guess
07:45:20Prestigeo/
07:45:20FromGitter<bung87> good afternoon
07:45:25PrestigeSup @Yardanico
07:51:59PrestigeIf I assign a new variable to someOption.get(), it won't copy the variable right?
07:53:34FromDiscord<Yardanico> Not sure
07:54:04FromDiscord<Yardanico> !eval import options; let a = some("hi"); echo a.get(), a.get()
07:54:07NimBothihi
07:55:26Prestige!eval import options; let a = some("hi"); let b = a.get(); echo a.get(), b
07:55:28NimBothihi
07:55:55PrestigeWonder if b is a copy of the value in a, like if we were using objects
07:56:33FromDiscord<Yardanico> !eval import options; var a = some("hi"); let b= a.get(); a = some("lo"); echo a.get(), b.get()
07:56:36NimBotCompile failed: /usercode/in.nim(1, 85) Error: type mismatch: got <string>
07:57:36FromDiscord<Yardanico> I guess with arc if you annotate get proc as "lent" it won't make a copy in most cases but I don't know if that's correct
07:58:52PrestigeHm okay, interesting. I'd hope it would just return the same object with Options
07:59:08Yardanicowell let's see
07:59:44skrylar[m]@Yardanico mornin'
08:00:24YardanicoPrestige:
08:00:27Yardanico!eval import options; var a = some("abc");var b = a.get();a = some("def");echo a.get(), b
08:00:31NimBotdefabc
08:00:42Yardanicoa.get() changed but not b
08:00:53PrestigeWouldn't that only change a?
08:01:16Yardanicowell if it didn't copy b would change too
08:01:31Yardanicoah actually .get() returns var T hmm
08:03:33Yardanicowith ref objects it'll be the same as expected
08:03:54PrestigeI was attempting an example: https://play.nim-lang.org/#ix=2lvg
08:03:58Yardanico!import options; var da = new(string); da[] = "abc"; var a = some(da);var b = a.get(); da[]="def"; a = some(da);echo (a.get()[], repr b)
08:04:00Prestigebut it looks like I cannot assign to y.s here
08:04:10Yardanicobecause you did "let y"
08:04:13Yardanicoand it's an "object"
08:04:13Prestigewoops
08:04:14Yardaniconot "ref object"
08:04:25Yardanico"object" is a value type
08:04:49Yardanico"An object is a value type, which means that when an object is assigned to a new variable all its components are copied as well."
08:04:52Yardanicohttps://nim-lang.org/docs/tut1.html#advanced-types-objects
08:05:58PrestigeYeah, just not entirely clear on how ref objects work I suppose
08:06:09Yardanicoref objects are managed pointers to objects
08:06:17Yardanico"ref" is a managed (by the GC or other MM) pointer
08:06:32Yardanicoso you copy the pointer
08:06:36Yardanicobut it still points to the same place
08:06:39skrylar[m]yup. and ptr is unmanaged, and pointer is untyped
08:06:43skrylar[m](and unmanaged)
08:06:48Yardanicopointer is void* in C yeah
08:06:49Prestigeah so like https://play.nim-lang.org/#ix=2lvj
08:06:59YardanicoPrestige: yep
08:07:03PrestigePerhaps that's what I want for my project
08:07:07PrestigeThanks Yardanico
08:07:32Yardanicoto copy ref objects recursively we have deepCopy
08:07:37Yardanicoalthough it doesn't work with arc (yet)
08:10:09*konvertex joined #nim
08:13:56*chemist69 quit (Ping timeout: 244 seconds)
08:14:20*chemist69 joined #nim
08:15:13*dddddd joined #nim
08:21:15*exelotl joined #nim
08:30:18Yardaniconice seems like https://github.com/def-/nimes/pull/6 will be merged :P
08:30:19disbotUse streams-like interfaces instead of methods
08:30:49Yardanicoso we have 1 more easy example to show people how to use streams-like interfaces :P
08:32:03Yardaniconow isObj is only used once in the entire C source code and only for checking exception type
08:32:11Yardanicoif (isObj(nimBorrowCurrentException()->Sup.m_type, "|ValueError|CatchableError|Exception|RootObj|")) {
08:32:31Yardanico(with arc)
08:38:37Yardanicoyay it got mergefd
08:48:17Yardanicolol seems like changing from methods to interfaces made it use ~5% less cpu (from 25% to 20%)
08:48:23Yardanicoand with LTO + PGO it uses ~15%
08:48:40YardanicoI mean one core of course
08:48:43Yardanicoone cpu thread*
08:54:12*ertp07 quit (Ping timeout: 272 seconds)
08:55:04*ertp07 joined #nim
08:57:04*ertp07 quit (Read error: Connection reset by peer)
08:57:22*ertp07 joined #nim
09:01:28*letto quit (Quit: Konversation terminated!)
09:02:13*letto joined #nim
09:06:25*ftsf joined #nim
09:07:29*ertp07 quit (Read error: Connection reset by peer)
09:10:37*ertp07 joined #nim
09:11:25YardanicoI managed to compile it with emscripten (well it was already done by def- but I did it with arc and latest nim)
09:11:37def-Yardanico: cool
09:11:42Yardanicodef-: oh you're here :P
09:11:42skrylar[m]we have interfaces now?
09:11:53Yardanicoskrylar[m]: object with proc pointers
09:11:59Yardanicohttps://forum.my-toolbox.xyz/out/hello.html
09:12:04skrylar[m]oh.
09:12:07Yardanicoah wait forgot to modify html file
09:12:31Yardanicohttps://forum.my-toolbox.xyz/out/hello.html works now
09:12:57skrylar[m]methods are uh, binary dispatch trees on a type code if i recall. used to have a springer paper that talked about how they're pretty nice
09:13:08Yardanicoskrylar[m]: well with arc methods use string comparisons :P
09:13:20skrylar[m]absolute trash
09:13:20Yardanicomethods can be implemented differently, you know
09:13:56skrylar[m]the bindispatch technique is nice if you don't want a full fat pointer
09:14:04skrylar[m]guess i wouldn't be surprised fat pointers were faster tho
09:15:17*ertp07 quit (Ping timeout: 258 seconds)
09:16:02*ertp07 joined #nim
09:17:11skrylar[m]don't closures allocate heap stuff so an object ful of closures is actually a heap alloc per method
09:17:26Yardanicowell you can always do {.cdecl.} as krux recommended me to do
09:17:31Yardanicoso these function pointers won't be closures
09:24:56*Senketsu joined #nim
09:25:21*Senketsu quit (Client Quit)
09:30:06Yardanicohah, I managed to use gmail smtp for nimforum, nice, now you can register on https://forum.my-toolbox.xyz/ :P
09:30:09Yardanicoand email activation works
09:30:35Yardanicoliterally 1-line change (added await client.startTls() because google smtp works with TLS only)
09:32:08Yardaniconow I need to learn how to remove moderated status lol
09:32:47*krux02 joined #nim
09:33:04Yardanicoah I found out
09:33:14Yardanico"You can modify anyone's rank. Remember: with great power comes great responsibility."
09:33:33Yardaniconimforum backend is surprisingly lightweight
09:35:53planetis[m]Yardanico: you didn't have to change the `[]` procs to idx, just the proc fields and then keep the base "methods" which just call the fields
09:36:55planetis[m]oh there templates now cool
09:37:38planetis[m]i have a macro for that btw: https://github.com/b3liever/protocoled
09:37:54planetis[m]but hadn't got any usage yet
09:37:56Yardanicoyeah I figured out there'd be a macro for that, niec :)
09:38:19Yardanicoreally cool
09:38:38Yardanicoi'll add it to https://github.com/nim-lang/Nim/wiki/Curated-Packages so it doesn't get lost
09:38:57planetis[m]thanks!
09:39:39Yardanicoadded under Language -> Metaprogramming
09:39:44Yardanicosorry under Language -> Object orientation
09:40:24planetis[m]you are fast lol
09:40:33planetis[m]didn't expect to see it there
09:41:50planetis[m]there is also https://nimble.directory/pkg/interfaced and another one similar
09:42:09planetis[m]https://github.com/bluenote10/oop_utils
09:50:11*krux02 quit (Remote host closed the connection)
09:52:03*Guest65412 quit (Ping timeout: 260 seconds)
09:58:39*Vladar joined #nim
10:06:20*Senketsu joined #nim
10:25:26federico3https://github.com/mukul-rathi/bolt <- more fine-grained concurrency than Rust
10:28:45*Trustable joined #nim
10:29:15*krux02 joined #nim
10:29:16*PMunch joined #nim
10:32:30*liblq-dev joined #nim
10:32:42FromDiscord<wiremoons> I have not been using Nim very long - but have written a few blog posts about some of the things I have learnt so far: https://www.wiremoons.com/
10:33:20FromDiscord<wiremoons> Probably of limit use to more experienced users 🙂
10:34:56Yardanico@wiremoons about https://www.wiremoons.com/development/debugging/nim/2020/04/18/Nim-Debugging-Approaches.html
10:35:14Yardanicothere's a very useful proc in the system module https://nim-lang.org/docs/system.html#instantiationInfo
10:35:23dom96wiremoons: nice! Thanks for writing these up! :)
10:35:26Yardanicowith it you can show on which lines of code you printed your debug statements
10:35:30Yardanicobut yeah, nice posts :)
10:35:36FromDiscord<Recruit_main707> @wiremoons ^
10:36:43PMunch@wiremoons yeah these are actually pretty nice
10:36:46FromDiscord<wiremoons> Thanks for the link @Yardanico - I will have a look
10:37:52federico3https://github.com/mukul-rathi/bolt-dissertation/blob/master/dissertation.pdf
10:38:57FromDiscord<wiremoons> @Recruit_main707 🙂
10:39:07Yardanico@wiremoons something like https://play.nim-lang.org/#ix=2lww
10:39:36Yardanicoyou can also get full paths with instantiationInfo(true)
10:39:42Yardanicoah sorry
10:39:49YardanicoinstantiationInfo(fullPaths = true)
10:40:12Yardanicothen it'll show absolute paths to your code so if your editor supports that you can directly use Ctrl+Click to go to that line of code
10:40:16Yardanico(vscode supports that for example)
10:41:43PMunchBy the way @wiremoons, looking at the latest post: {.strdefine.} is a way to tell Nim to extract a parameter given by the compiler: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas what is new in that Nimble version is that it passes it as a flag to the Nim compiler (as you can see if you do `nimble build --debug`, looks something like this: ` -d:NimblePkgVersion=0.1.0`)
10:41:51FromDiscord<wiremoons> @Yardanico - I have a module I use for adding debugging now, so I can add your suggested extra bit if code to it!
10:42:25Yardanicoyeah, and in more complex programs you can wire up all sorts of cool things like sending these debug logs to your server or something
10:42:43Yardanicoalso astToStr (shown in instantiationInfo) is cool
10:44:24FromDiscord<wiremoons> Thanks @PMunch - I hadn't got around to looking for that info yet, so thanks for the link
10:45:22PMunchfederico3, baller page "ii" in that dissertation :P
10:45:27Yardanicosomething like https://play.nim-lang.org/#ix=2lwB
10:45:37PMunch"Special Difficulties - None."
10:46:01PMunchThat's my problem with writing things on my site
10:46:23PMunchI tend to delve deep into things and try to understand every nook and cranny of it so I can explain it properly
10:46:28PMunchTakes forever to write stuff
10:47:07PMunchAnd more than once have I ended up with an article on hold while I'm waiting for a PR to merge to fix a bug I encountered :P
10:47:28PMunchStill waiting on this for example for my C interop article: https://github.com/nim-lang/Nim/pull/14258
10:47:29disbotAllow let to not have value when using importc
10:50:24*ertp07 left #nim ("Leaving")
11:01:46Yardanicolol
11:01:47Yardanicohttps://github.com/nim-lang/Nim/issues/12382#issuecomment-626308745
11:01:50disbotOSError: Bad file descriptor in asyncnet server ; snippet at 12https://play.nim-lang.org/#ix=2lwQ
11:02:00Yardanicoreplacing code with same code did the trick :P
11:02:36FromDiscord<Recruit_main707> classic
11:02:54Yardanicoand here I am, know nothing about web dev and trying to add ability to remove categories in nim forum lol
11:03:18Yardanicowell at least it's karax so it's all in nim code
11:09:41*fredrikhr joined #nim
11:10:43*ertp07 joined #nim
11:14:54*ertp07 quit (Ping timeout: 240 seconds)
11:21:52*ertp07 joined #nim
11:24:42FromDiscord<KrispPurg> thats life hacks
11:28:28PMunchIs there a way to define a macro that has an optional untyped argument with the default just being something like `discard`?
11:29:54FromDiscord<Rika> overload it?
11:32:21krux02PMunch, do default values for untyped not work?
11:33:40krux02you can also do ``args: varargs[untyped]`` and check the length of `args`
11:33:48PMunchkrux02, I can't just do `default: untyped = discard`
11:34:11PMunchThat's quite a misleading signature though..
11:35:22*Trustable quit (Remote host closed the connection)
11:35:23krux02I don't think so.
11:35:44krux02I think it would fit the default argument model pretty well.
11:36:01PMunchWith `default: varargs[untyped]`?
11:36:05krux02but it doesn't work, so you have to work around it. And I guess overloads are the solution to go here.
11:36:20PMunchYeah, that's what I'm thinking as well
11:36:29krux02yes default varargs[untyped] is a misleading signature
11:36:34krux02but it would work
11:36:44PMunchTried to do it with `default: untyped = nnkDiscard.newTree(newEmptyNode())` but that didn't work either
11:36:50PMunchProduced a rather odd error message
11:38:21*Hideki_ joined #nim
11:42:03PMunchIs there no way to return an anonymous procedure from a macro?
11:42:16PMunchSo you do something like `let myProc = generateProcMacro()`
11:42:27PMunchAnd can then call `myProc(someargument)`
11:43:20Yardanicohmmmm
11:43:24FromDiscord<mratsim> yes you can
11:43:42FromDiscord<mratsim> one of the macro in sugar does this, pretty sure it was the list comprehension macro
11:43:58FromDiscord<mratsim> it used nnkLambda.newTree
11:44:08PMunchAah right
11:45:07Yardanicoyeah https://play.nim-lang.org/#ix=2lx0
11:45:14liblq-devdoes nim have a shell expansion thingy in the stdlib? eg. "(a|b|c)def" would get expanded to @["adef", "bdef", "cdef"]
11:45:27Yardanicowell that syntax is used for .so files
11:45:31Yardanicohmm
11:45:39liblq-devI know there's one in dynlib.nim, it's called libCandidates
11:45:48liblq-devbut using it feels... off
11:45:58Yardanicoapart from it I don't know any
11:46:21Yardanicoand I've never heard of shell expansion like that
11:48:12liblq-devwell bash and fish have {}
11:48:20liblq-deveg. {a,b,c}dawd
11:48:29liblq-devand they can nest
11:48:44liblq-devlibCandidates doesn't support nesting
11:48:53Yardanicodo it yourself then :P
11:49:08liblq-devtoo much work
11:49:22liblq-devI'll just list all possibilities manually, I guess
11:52:15Yardanicoplanetis[m]: btw your protocoled package is invalid
11:52:21Yardanicoyou specify "srcDir = src" but you don't have that
11:52:26Yardanicoso you can't use the package if you install it from nimble
11:55:08Yardanicobtw it's the first time I see 3-space indent used in the wild :P
11:59:28*Senketsu quit (Quit: WeeChat 2.8)
12:02:47*krux02 quit (Remote host closed the connection)
12:04:09*krux02 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:43*supakeen joined #nim
12:07:58*Hideki_ quit (Remote host closed the connection)
12:08:49*Hideki_ joined #nim
12:09:49*ertp07 quit (Ping timeout: 264 seconds)
12:12:44*ertp07 joined #nim
12:13:26*Hideki_ quit (Ping timeout: 256 seconds)
12:26:14*ertp07 quit (Ping timeout: 256 seconds)
12:27:04*Hideki_ joined #nim
12:27:10PMunchHmm, is there a way to inject a block label in a macro?
12:27:51*ertp07 joined #nim
12:28:22PMunchLike I have a macro that generates an infinite loop (event handler) but I want the user to be able to catch an event and break the loop (e.g. for exiting the program). I was thinking creating a `block eventLoop` around the whole thing would be a good way of doing it, and then have the user call `break eventLoop`
12:31:56YardanicoPMunch: https://nim-lang.org/docs/macros.html#statements-block-statement ?
12:32:42FromDiscord<mratsim> block statement first param is the block name
12:33:12Yardanicohttps://play.nim-lang.org/#ix=2lxl
12:34:38PMunchHuh
12:34:49PMunchThat's pretty much exactly what I tried..
12:34:55PMunchI mean I did it like this: https://play.nim-lang.org/#ix=2lxm
12:35:00PMunchBut that also works..
12:35:06Yardanicoheh
12:35:14PMunchAah
12:35:17*ertp07 quit (Read error: Connection reset by peer)
12:35:39PMunchHmm, no that wasn't it..
12:35:55PMunchOh wait..
12:36:06PMunchHmm
12:36:49Yardanicoprotocoled is quite elegant ngl, although a bit of boilerplate but still cool :)
12:36:55Yardanicohttps://play.nim-lang.org/#ix=2lxn
12:37:12Yardanicostripped and adapted mathexpr to do parsing instead of evaluation :P
12:37:43*Hideki_ quit (Ping timeout: 260 seconds)
12:39:22Yardanicoof course that will be slower than my mathexpr (because i don't construct any AST and immediately evaluate everything) but still cool
12:39:41Yardanicoaround 2x slower for 2+2*2-4^2+-1
12:40:07Yardanico6m vs 2.5m iterations/sec :P
12:40:49Yardanicofunny fact: seems like clang optimizes mathexpr more than this protocol version
12:40:55PMunchHmm, yeah my issue was that I pass the break statement into a macro that creates a pragma out of the body..
12:41:06Yardanicoso mathexpr is faster with clang, but protocol is faster with gcc (I mean relatively to clang)
12:41:18Yardanicomaybe gcc recognizes that pattern and does some more smart optimizations
12:41:25PMunchs/pragma/lambda
12:42:26PMunchWhich is a bit weird as I create the lambda inside the block..
12:43:08PMunchYeah, this fails: https://play.nim-lang.org/#ix=2lxo
12:45:09PMunchAh, so block labels aren't captured in lambdas at all: https://play.nim-lang.org/#ix=2lxp
12:45:21PMunchIs that intended?
12:50:38YardanicoPMunch: I think that's not possible in Nim at all
12:50:45Yardanicoyou might have to use a global variable for that or something
12:50:58PMunchFound a workaround that works for my application
12:50:58Yardanicohttps://play.nim-lang.org/#ix=2lxu
12:53:29Yardanicobtw it's the first time I saw the "Error: invalid control flow: test" error
12:53:52FromDiscord<clyybber> I think you get that when the VM can't find the break label
12:53:59Yardanicoand see https://play.nim-lang.org/#ix=2lxu
12:54:05FromDiscord<clyybber> .s/VM/compiler
12:54:08Yardanicoyeah
12:54:26*sirn joined #nim
12:55:17Yardanicoalso seems like my mathexpr is actually faster than https://github.com/codeplea/tinyexpr (well because i don't do AST at all)
12:55:26Yardaniconim-mathexpr initially was a wrapper to tinyexpr :P
12:55:44Yardanicohttps://github.com/Yardanico/nim-mathexpr/commit/039f5f07714b675ca51a1ce5d0bf9928c8b9b77d
12:55:48Yardanicohttps://github.com/Yardanico/nim-mathexpr/commit/64348b534edecb390c0035416217199358a3397f
13:01:02*zacharycarter joined #nim
13:03:56*solitudesf quit (Ping timeout: 256 seconds)
13:06:22*Hideki_ joined #nim
13:06:50shashlickNimterop 0.5.0 is almost ready to be tagged, if anyone wants their wrapper tested before release, please get in touch
13:09:16zacharycartershashlick: I'm wrapping cimgui with nimterop and I think I have an issue - not sure if it will be addressed with 0.5.0 or not
13:09:37zacharycarterbut essentially there are serveral types that are predeclared and then declared again later
13:10:08zacharycarternimterop skips the initial type defs since they're just empty structs but then doesn't define them when they're actually fully defined
13:11:09krux02zacharycarter, and it is not a forward def?
13:11:27zacharycarterhere's an example
13:11:43zacharycarterhttps://github.com/cimgui/cimgui/blob/master/cimgui.h#L53
13:12:10zacharycarterit's fully defined later in the header but Nimterop just skips this all together
13:12:20Yardanico#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
13:12:22Yardanicois that defined?
13:12:24zacharycarteryes
13:12:49*dddddd quit (Ping timeout: 264 seconds)
13:13:07krux02so tha alias is declared first, before the struct is declared.
13:13:17zacharycarteryes
13:13:18krux02That is interesting, I didn't know that this is valid C code.
13:13:35krux02I thought you had to have the struct definition first.
13:14:32krux02But the ``typedef struct Typename Typename;`` is a very common pattern. No reason not to support it in nimterop.
13:16:10zacharycarterwell it just forces me to manually override all of these for now and then using nimterop in the first place becomes questionable
13:16:40krux02what if you comment them out?
13:16:53krux02is it feasible to invert the declaration order)
13:16:56krux02?
13:17:55krux02oh no it's not really, it really is a lot of API
13:18:46krux02zacharycarter: Did you see this: This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
13:19:58*leorize joined #nim
13:20:16krux02maybe it is feasible to extend generate.lua so that it generates Nim bindings.
13:20:23zacharycartermaybe
13:20:43zacharycarterI could probably also just use c2nim
13:20:47zacharycarterand automate that
13:21:49*Hideki_ quit (Remote host closed the connection)
13:22:07*Hideki_ joined #nim
13:22:41PMunchhttps://github.com/PMunch/xevloop
13:23:11*sz0 quit (Quit: Connection closed for inactivity)
13:28:02PMunchhttps://github.com/nim-lang/packages/pull/1466
13:28:02disbotAdd xevloop package
13:31:28Yardanicobtw for nim forum frontend (the JS file) google closure compiler makes the file 3x smaller (well it's minimization but also advanced optimization)
13:31:34Yardanicoand says "0 error(s), 266 warning(s), 66.1% typed" which is pretty good I guess
13:31:59FromDiscord<Rika> thats a lot of warnings
13:32:04Yardanicothat JS code is beyond obfuscation though, it's completely undreadable
13:32:38Yardanico@Rika redeclared variables/unreachable code/condition always false/some other stuff
13:33:10FromDiscord<Rika> o i see
13:33:13Yardanicohttps://i.imgur.com/YOdCOXB.png
13:33:13*filcuc joined #nim
13:33:22FromDiscord<Rika> that bg tho 😮
13:33:46Yardanicofound it in https://www.youtube.com/watch?v=6WQjgHuUDWU
13:35:05YardanicoI wonder what difference does -d:release vs -d:danger make
13:35:08Yardanicofor nim forum frontend
13:35:27Yardanicowith -d:release - 696kb, with -d:danger - 660kb
13:36:00Yardanicoalso 70% typed now
13:36:19Yardanicoand output from closure compiler is 204kb
13:36:47Yardanicoand that code is really interpreter and JIT friendly
13:36:59Yardanicobecause interpreters are happier then you don't have any whitespace ;)
13:37:04Yardanicoif the language isn't whitespace-significant
13:37:10Yardanico*when
13:38:02Yardanicohttps://i.imgur.com/MQak4rF.png
13:38:25FromDiscord<Rika> interpreted languages really benefit from non-whitespace-significant languages
13:40:43*zacharycarter quit (Ping timeout: 260 seconds)
13:41:58Yardanicotfw js "compressors" make the size bigger
13:42:52FromDiscord<Rika> lmao
13:49:33*Vladar quit (Quit: Leaving)
13:52:11*tane joined #nim
13:58:25FromDiscord<Doongjohn> ```nim
13:58:26FromDiscord<Doongjohn> block:
13:58:26FromDiscord<Doongjohn> let textPath = "./sometext.txt"
13:58:26FromDiscord<Doongjohn> let textFile = open(textPath, FileMode.fmReadWrite)
13:58:26FromDiscord<Doongjohn> defer: close textFile
13:58:27FromDiscord<Doongjohn>
13:58:27FromDiscord<Doongjohn> write textFile:
13:58:28FromDiscord<Doongjohn> """Lorem ipsum dolor sit amet,
13:58:30FromDiscord<Doongjohn> consectetur adipiscing elit.
13:58:32FromDiscord<Doongjohn> Morbi lorem eros, sagittis sed laoreet vel,
13:58:33FromDiscord<Doongjohn> bibendum vitae dui."""
13:58:35FromDiscord<Doongjohn> textFile.flushFile()
13:58:36FromDiscord<Doongjohn>
13:58:38FromDiscord<Doongjohn> echo textPath.readFile() # prints properly.
13:58:40FromDiscord<Doongjohn> echo textFile.readAll() # prints nothing? What am I doing wrong?
13:58:41FromDiscord<Doongjohn> ```
13:58:42FromDiscord<Rika> oof
13:58:44FromDiscord<Rika> rest in peace irc
13:58:55FromDiscord<Rika> @Doongjohn you arent seeking back to the end of the file
13:58:58PMunchDoongjohn, please don't paste code into Discord..
13:59:10*lritter joined #nim
13:59:14FromDiscord<Rika> before the echo, do `textFile.setPosition 0`
13:59:25FromDiscord<Doongjohn> oh ok thanks
13:59:40PMunchYardanico, bot, when?
13:59:42FromDiscord<Rika> or was it setFilePos...
13:59:56FromDiscord<Rika> i dont remember, check the `io` module if you must
14:02:11FromDiscord<Doongjohn> should I use forum instead for pasting the code?
14:02:39FromDiscord<Rika> no, use a paste service
14:02:46FromDiscord<Rika> pastebin if you want
14:03:03FromDiscord<Doongjohn> ok sry
14:03:04leorizeor the playground
14:07:06PMunchOr ix.io
14:07:29FromDiscord<Yardanico> @PMunch I can do it today just to see how things will go xdd
14:07:39PMunchHooray!
14:07:52FromDiscord<Yardanico> The bot has two days uptime which is pretty good
14:07:53PMunchFinally the days of telling people to stop pasting code might come to an end!
14:08:04PMunchYeah it seems solid in offtopic
14:08:28Yardanicoyeah and I can always swap the older version easily
14:08:47PMunchAs long as you're around :P
14:08:55PMunchDon't swap the bots and then go on holiday or something
14:08:57Yardanicowell dom has access to that VPS as well :)
14:09:07*ertp07 joined #nim
14:09:07Yardanicomattebridge runs on the same droplet as NimBot
14:09:12PMunch(Not that I know where you would go on holiday..)
14:09:16Yardanicoxd
14:09:46Yardanicowell let's try to do it
14:10:48Yardanicoit'll bridge 5 channels at the same time :P
14:10:55Yardanicoah sorry 4
14:11:16shashlick@zacharycarter - nimterop supports forward declarations
14:11:35shashlickBut you need to use ast2
14:13:51PMunchIs there a limit to how many arguments a program can take?
14:14:18Yardanicoyeah
14:14:34Yardanicohttps://serverfault.com/questions/163371/linux-command-line-character-limit
14:15:00shashlick@zacharycarter https://github.com/nimterop/nimterop/issues/148
14:15:01disbotDoesn't properly handle forward declarations
14:15:54leorizeon windows the limit is < 32800 ansi or unicode chars
14:15:56*Hideki_ quit (Ping timeout: 272 seconds)
14:16:15PMunchleorize, this is for a window manager, so Windows isn't an issue
14:16:26PMunchOr, well, Windows is an issue, but not for this
14:16:48PMunchOkay so that might be enough..
14:16:50Yardanicoso first I'll try to start the bridge for all channels except #nim on the nim vps
14:16:56Yardanicoand then I uncomment #nim and restart :P
14:17:22PMunchGood idea
14:17:23Yardaniconim vps is really pretty old though
14:17:50*Hideki_ joined #nim
14:17:53Yardanicoubuntu 16.04
14:19:35PMunchHmm, good idea or bad idea: Have a program called the "configurator" for my WM. It can be written in anything (reference implementation in Nim) and it reads a configuration file and converts it to calling programs with command line arguments. This way you can write programs that interface with the WM, but which doesn't care about the configuration language
14:20:09PMunchI guess it could also pass them along by environment variables..
14:21:13*filcuc quit (Ping timeout: 264 seconds)
14:22:11PMunchProblem though is for the program that is meant to handle keyboard shortcut stuff. Currently it can only send a custom XEvent so it just takes an atom name and a shortcut, something like `--toggleExpand "Mod4+e"`
14:22:55PMunchBut what happens if I want to allow e.g. scripting I can't have an argument `--"exec something" "Mod4+e"`
14:23:25PMunchMaybe multiple `--bind "Mod4+e:exec something" or something like that..
14:24:04*dadada joined #nim
14:24:07*Hideki__ joined #nim
14:24:27*dadada is now known as Guest39393
14:24:50*PMunch quit (Quit: leaving)
14:27:45*Hideki_ quit (Ping timeout: 256 seconds)
14:39:12*filcuc joined #nim
14:42:20Yardanico~restarting the bridge~
14:42:21disbotno footnotes for `restarting`. 🙁
14:42:27*FromDiscord quit (Remote host closed the connection)
14:43:47*FromDiscord joined #nim
14:44:02*Guest39393 quit (Ping timeout: 260 seconds)
14:44:06FromDiscord<Yardanico> 123
14:44:08Yardanico123
14:44:27FromDiscord<Yardanico> ```nim↵echo "Hello world"↵echo "yes finally"↵```
14:44:38FromDiscord<Yardanico> asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdas
14:44:51FromDiscord<Yardanico> sent a long message, see http://ix.io/2gcc
14:45:27FromDiscord<Rika> interesting
14:45:33FromDiscord<Rika> testing in production 😛
14:45:39*Hideki_ joined #nim
14:45:55Yardanicowait I'll restart it to enable screen logging
14:45:58*FromDiscord quit (Remote host closed the connection)
14:46:24Yardanicohmm
14:46:25*FromDiscord joined #nim
14:47:03Yardanicoah sorry need to do it again
14:47:09*FromDiscord quit (Remote host closed the connection)
14:47:21*rockcavera joined #nim
14:47:29*FromDiscord joined #nim
14:47:55Yardanicowell let's see how it works out
14:48:23Yardanicoif something's bad I can always get the old bridges back up :P
14:48:42*Hideki__ quit (Ping timeout: 256 seconds)
14:48:45Yardanico!status
14:48:45FromDiscordUptime - 1 minute, 28 seconds, 815 milliseconds, 148 microseconds, and 119 nanoseconds
14:49:45Yardanico@KrispPurg btw I used the latest devel is it stable? :P
14:49:47Yardanicoand yes pinging works
14:49:57Yardanicoor it doesn't hmm
14:49:59Yardanico@Rika 123
14:50:01Yardanicohmm
14:50:16Yardanico@KrispPurg ^
14:50:17Yardanicowat
14:50:45FromDiscord<exelotl> holy shit I've been waiting so long for this moment
14:50:50Yardanico@exelotl lmao
14:51:34Yardanicoah I see why
14:51:38Yardanicolemme do a hotfix (TM)
14:52:39*FromDiscord quit (Remote host closed the connection)
14:52:54*FromDiscord joined #nim
14:52:57Yardanico@KrispPurg ping
14:53:01Yardanicook im stupid
14:55:09FromDiscord<Rika> LMAO
14:55:54*FromDiscord quit (Remote host closed the connection)
14:56:09*FromDiscord joined #nim
14:57:13*dadada__ joined #nim
14:57:47*FromDiscord quit (Remote host closed the connection)
14:58:02*FromDiscord joined #nim
14:58:07*FromDiscord quit (Remote host closed the connection)
14:58:23*FromDiscord joined #nim
14:58:24*FromDiscord quit (Remote host closed the connection)
14:59:28*FromDiscord joined #nim
15:00:51*FromDiscord quit (Remote host closed the connection)
15:01:07*FromDiscord joined #nim
15:01:17FromGitter<sealmove> Guys how do nimble package tags work? Can one choose from a certain set of tags? Or he can put any string as tag? When I try publihs using arbitary tags it fails.
15:01:46*exelotl quit (Ping timeout: 260 seconds)
15:02:36leorizeask dom96 lol
15:02:59FromGitter<sealmove> @dom96 ping :P
15:03:08Yardanicoidk why that didn't work honestly
15:04:20*FromDiscord quit (Remote host closed the connection)
15:04:33*FromDiscord joined #nim
15:05:01*FromDiscord quit (Remote host closed the connection)
15:05:16*FromDiscord joined #nim
15:09:13*FromDiscord quit (Remote host closed the connection)
15:09:28*FromDiscord joined #nim
15:17:01*FromDiscord quit (Remote host closed the connection)
15:17:18*FromDiscord joined #nim
15:19:44*FromDiscord quit (Remote host closed the connection)
15:20:01*FromDiscord joined #nim
15:21:39*FromDiscord quit (Remote host closed the connection)
15:21:54*FromDiscord joined #nim
15:22:37*poohman_1 joined #nim
15:25:11*FromDiscord quit (Remote host closed the connection)
15:25:28*FromDiscord joined #nim
15:28:40*FromDiscord quit (Remote host closed the connection)
15:28:56*FromDiscord joined #nim
15:29:57*FromDiscord quit (Remote host closed the connection)
15:30:16*FromDiscord joined #nim
15:31:12*ftsf quit (Ping timeout: 256 seconds)
15:31:36*FromDiscord quit (Remote host closed the connection)
15:33:13*Romanson joined #nim
15:34:01*FromDiscord joined #nim
15:34:29*FromDiscord quit (Remote host closed the connection)
15:35:59*FromDiscord joined #nim
15:37:11*FromDiscord quit (Remote host closed the connection)
15:37:19*FromDiscord joined #nim
15:38:20*FromDiscord quit (Remote host closed the connection)
15:38:28*FromDiscord joined #nim
15:39:45*Hideki_ quit (Remote host closed the connection)
15:41:32FromDiscord<Recruit_main707> ircord in general??
15:42:52*filcuc quit (Ping timeout: 260 seconds)
15:43:06FromDiscord<Rika> yes
15:43:12Yardanicoill revert for now
15:43:16Yardanicocoz the stupid thing doesn't get member list
15:43:17*FromDiscord quit (Remote host closed the connection)
15:43:34*FromDiscord joined #nim
15:43:34FromDiscord<Rika> try re-enabling the intent lol
15:43:34FromDiscord<Yardanico> I TRIED
15:43:34FromDiscord<Rika> in the discord dev settings
15:43:35FromDiscord<Rika> really
15:43:37FromDiscord<Yardanico> yes
15:43:37FromDiscord<Yardanico> really
15:43:38FromDiscord<Rika> mmmmmmmmmm
15:43:44FromDiscord<Rika> weird
15:43:46FromDiscord<Yardanico> I even created a new bot and enabled same intent
15:43:48FromDiscord<Rika> discord dumb
15:44:04FromDiscord<Rika> i declare discord dumn
15:44:06FromDiscord<Rika> dumb
15:44:08Yardanicoi'll test on my pc for now to find why it doesn't work
15:44:10Yardanico#nim-test
15:44:11Yardanico#test
15:44:34*exelotl joined #nim
15:47:49*dadada__ quit (Ping timeout: 246 seconds)
15:52:48FromDiscord<exelotl> i cri
15:54:22*Hideki_ joined #nim
15:54:24*Hideki_ quit (Remote host closed the connection)
15:55:01*Hideki_ joined #nim
16:01:28*Hideki_ quit (Ping timeout: 246 seconds)
16:03:49*filcuc joined #nim
16:04:34*dddddd joined #nim
16:08:54FromDiscord<Rika> does nim have a "sanitize filename" proc that strips invalid chars from filenames
16:09:49leorizeI don't think so
16:10:01leorizeinvalid chars differs from os to os anyway
16:10:23FromDiscord<Rika> same thing with dir.sep.s, yet we have `os`
16:10:44FromDiscord<Rika> nonetheless, that's fine
16:10:58FromDiscord<Rika> was just wondering if i could replace a handmade proc with a stdlib one
16:11:09leorizeand invalid chars is context-dependent
16:11:18leorizewe do have one to verify for invalid names iirc
16:11:30leorizenone to strip them though, since that sounds, uh, terrible?
16:12:09shashlickSeeing different makefile behavior when shell = bash vs sh - any insights?
16:12:18shashlickPaths don't work in bash mode
16:12:25FromDiscord<Rika> ooh, if we have a verify one, that works for me i guess
16:13:02leorizehttps://nim-lang.org/docs/os.html#isValidFilename%2Cstring
16:24:13*ertp07 quit (Ping timeout: 246 seconds)
16:26:14FromGitter<Willyboar> !stream
16:28:34*ertp07 joined #nim
16:29:08rockcaveraLook at this example: https://play.nim-lang.org/#ix=2lyR Is there any way to know which type `a.edata` is storing?
16:29:26leorizeWillyboar: it's ~stream
16:29:52FromGitter<Willyboar> ~stream
16:29:53disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat)
16:30:19FromGitter<Willyboar> thank you @leorize
16:30:24leorizerockcavera: use the `of` operator
16:30:38leorizeie. `a.edata` of `EDataString`
16:31:06rockcaveraleorize case?
16:31:30leorize`if a.edata of EDataString` <- it's an operator
16:31:33*Hideki_ joined #nim
16:31:54rockcaverahummm
16:32:22rockcaveraleorize Thanks, I didn't know that operator.
16:32:24rockcavera:D
16:33:15rockcaverathe best way to access is by casting?
16:33:17leorizeyea, people don't frequently use it, so it doesn't have too much exposure
16:33:24leorizeuse conversion
16:33:33leorize`EDataString(a.edata)`
16:33:48rockcaverathanks
16:33:49rockcavera;)
16:33:51leorize^ that's a typed conversion, if the type doesn't match, it will error out
16:34:18Yardanico~bridge down for a bit, trying to fix that issue so I can start ircord~
16:34:19disbotno footnotes for `bridge`. 🙁
16:34:22*FromDiscord quit (Remote host closed the connection)
16:34:24rockcaverayou saved me. I was racking my brain about this.
16:34:38*FromDiscord joined #nim
16:34:46*Vladar joined #nim
16:34:55Yardanico@yardanico 123123123
16:35:02Yardanico@KrispPurg 123123213
16:35:03*ptdel joined #nim
16:35:06Yardanicook good enuf
16:36:07*dadada joined #nim
16:36:31*dadada is now known as Guest62821
16:37:06FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/709081590784983180/2020-05-10-16-37-48_grim.png
16:37:12Yardanicook that works as well
16:37:12*couven92 joined #nim
16:39:30FromGitter<bung87> which software using mumble:// protocol?
16:39:36YardanicoMumble
16:39:53YardanicoIt's an open source VOIP app
16:39:58Yardanicofor all major platforms
16:40:06*FromDiscord quit (Remote host closed the connection)
16:40:10Yardanicowat
16:40:17FromGitter<bung87> ah like skype?
16:40:20*FromDiscord joined #nim
16:40:22Yardaniconot really
16:40:26leorizelike teamspeak
16:40:58*fredrikhr quit (Ping timeout: 272 seconds)
16:41:03*FromDiscord quit (Remote host closed the connection)
16:41:05FromGitter<bung87> thanks , I will give a try :)
16:41:19*FromDiscord joined #nim
16:42:25FromDiscord<Rika> this is so funky
16:42:33FromDiscord<Rika> now all your messages arent condensed as fuck
16:42:52Yardanicodon't worry I started the old bridge again since this one is a bit unstable because of some code changes
16:43:14*filcuc quit (Ping timeout: 256 seconds)
16:43:37leorizehow come your bridge broke the moment it goes in production? :P
16:43:53Yardanicoleorize: because apparently discord decided to stop sending full member list to it
16:43:54YardanicoI mean it works
16:44:02Yardanicobut the mention functionality wouldn't really work
16:49:58leorizegg discord
16:50:06Yardanicowell it can be solved
16:50:09Yardaniconot that hard
16:50:15Yardanicobtw arc is magic
16:50:53*couven92 is now known as fredrikhr
16:51:18YardanicoI'm not sure if I'm doing this right but https://play.nim-lang.org/#ix=2lz0
16:51:28Yardanicoidk how it manages to access textArea from another thread btw :D
16:51:53Yardanicorun with arc/orc and then go to localhost:8080
16:52:05Yardanicothat's a really good way to make GUIs for async apps and stuff
16:52:21Yardanicono need to limit your async loop in any way
16:52:45Yardanicoand idk if the global dispatcher part is needed, but I added it just to be safe
16:52:53Yardanicoto create the global dispatcher in the thread where async runs
16:53:41leorizeyea, the default dispatcher can do threads but not well tested iirc
16:54:22leorizeI guess it can access textArea because the underlying object is usually thread-safe (inherited from the native ui toolkit)
16:54:32Yardanicohmm I guess
16:54:54*poohman_1 quit (Ping timeout: 272 seconds)
16:54:59Yardanicootherwise we can just have two threads and use channels
16:55:05Yardanicoto send stuff
16:55:13Yardanicoah right it wouldn't be that simple
16:55:18dom96anyone here used random.sample with the CDF set?
16:56:47leorizeI thought the point of arc is to let us safely share memory between threads?
16:57:00dom96oh, I think I get it. You create a list of weights and then you call cumsum on them
16:57:01leorizeand now it seems like that you gotta move the graph to another thread
16:57:08Yardanicowell that too but if it's memory from a native UI toolkit which is not threadsafe all funny things would happen leorize
16:57:31Yardanicoleorize: btw GTK doesn't seem to be threadsafe
16:57:31Yardanicolol
16:57:38leorizeI was just ranting about how arc doesn't do much :/
16:57:42Yardanicoah no it is
16:57:44Yardanico"GLib is completely thread safe (all global data is automatically locked), but individual data structure instances are not automatically locked for performance reasons. So e.g. you must coordinate accesses to the same GHashTable from multiple threads."
16:57:47Yardanicoleorize: it does
16:57:50Yardanicomuch better interop
16:58:00Yardanicoohh
16:58:05Yardanico"GTK+, however, is not thread safe. You should only use GTK+ and GDK from the thread gtk_init() and gtk_main() were called on. This is usually referred to as the “main thread”."
16:58:26leorizethe heap is thread-safe
16:58:33leorizethe objects are not, obviously
16:58:42*Guest62821 quit (Ping timeout: 256 seconds)
16:58:48leorizesince you're controlling gtk from one thread only, you're fine
16:58:58*waleee-cl joined #nim
16:59:46Yardanicowell nigui is a good lib :)
16:59:53Yardanicowithout it I wouldn't have found a big bug in arc
17:00:23Yardaniconeed to do some arc bug hunting again
17:00:30leorizeI'm not sure how better does arc help with our multi threading story
17:00:48leorizeat least now we can move memory around, but we still can't safely share them?
17:03:58livcdleorize you are alwasy so pessimistic :D
17:04:44*poohman_1 joined #nim
17:05:29leorize[m]:P
17:06:05leorize[m]anyhow, for anyone interested, here's the full coverage map of Nim: https://codecov.io/gh/alaviss/Nim/tree/8f63aa0ef01e14f795d5afd8d368f4999addf103
17:06:19leorize[m]this is probably not going to become a part of the CI anytime soon
17:06:28Yardanicoleorize: I saw your branch, but I didn't figoure out how to do it myself without a lot of commits
17:06:37Yardanicocan you explain it with bash commands/nim compiler arguments? :D
17:06:50Yardanicoor if I want to do it for other nim programs
17:07:06leorize[m]look at `config/nim.cfg`
17:07:12YardanicoI did
17:07:16leorize[m]the `@if coverage` section
17:07:21Yardanicobut for me lcov failed and generated empty nim.info
17:07:47Yardanicolemme try for my lib
17:07:52leorize[m]well you also need to control where your objects are gonna be generated too
17:08:27leorize[m]use `--nimcache` to relocate the nimcache to somewhere deterministic
17:09:57Yardanicook what do I do after that to generate cool html thing like you did? :P
17:10:07leorize[m]the coverage system is usable, but I'd say that it's not that good yet
17:10:22leorize[m]the cool html thingy? you need a codecov account lol
17:10:30leorize[m]for now use lcov genhtml
17:10:33leorize[m]it's not pretty but it works
17:11:56leorize[m]s
17:11:57leorize[m]so after you ran your program against a bunch of inputs to get the coverage data, run:
17:13:00leorize[m]`lcov -c --exclude '*generated_not_to_break_here' --exclude '\?\?\?' --rc 'lcov_branch_coverage=1' -b /where/you/run/nim/c --no-external --no-compat-libtool -d /the/nimcache/location -o project.info`
17:13:29leorize[m]`lcov -z -d /nimcache/location` can be used to wipe out all prior data
17:13:41leorize[m]use that when you recompile your program
17:14:23leorize[m]for best coverage data, you'd need to generate two `info` files: one for the raw source-only data, one for the data generated at runtime
17:14:46FromDiscord<dom96> This is pretty cool actually: https://gist.github.com/dom96/370e3f82a4b818cbd20c183220028748
17:15:03Yardanico>cumsummed :P
17:15:10Yardanicocumulative summed I assume
17:15:40*Jesin quit (Ping timeout: 246 seconds)
17:15:56leorize[m]`lcov -c --initial --exclude '*generated_not_to_break_here' --exclude '\?\?\?' -b /where/you/run/nim/c --no-external -d /the/nimcache/location -o project-initial.info`
17:16:44Yardanicoleorize: and I again get an empty .info file :(
17:16:51Yardanicowith tons of
17:16:52Yardanicogeninfo: WARNING: cannot find an entry for indexerrors.nim##10b59710a9ebf1c8521c41778e6f416a.gcov in .gcno file, skipping file!
17:17:15Yardanicowith nimcache folder, excessiveStackTrace, linedir, and --coverage options for gcc (basically same as in nim.cfg in your branch)
17:17:38leorize[m]is your program available somewhere? I give it a go
17:17:42leorize[m]I can*
17:17:55Yardanicohttps://github.com/Yardanico/nim-mathexpr/ just run tests/tests.nim :P
17:18:45leorizewhy is your LICENSE and README.md executable btw :P
17:18:46Yardanicomaybe I'm doing something wrong, idk
17:18:53Yardanicoleorize: lol idk :D
17:18:54leorizeeven your .gitignore is executable
17:19:09Yardanicoi don't know when I changed that
17:27:16FromDiscord<codic> Some places I've noticed large numbers writetn as `10_100_100` for example, is that for readability? Can I till usse `10100100`/
17:27:26Yardanicoyes
17:27:28Yardanicofor readability
17:27:37Yardanicoleorize: ahhhhh
17:27:38Yardanicohttps://github.com/linux-test-project/lcov/issues/58
17:27:41disbotlcov incompatible with GCC 9.x coverage data ; snippet at 12https://play.nim-lang.org/#ix=2lzc
17:27:42Yardanicomight be due to this
17:27:44YardanicoI have GCC 9.3
17:27:52leorizeI have gcc 10
17:27:55Yardanicolol
17:27:58leorizeand I just made it work lol
17:28:09Yardanicowhat was the issue?
17:28:18FromDiscord<codic> ah
17:28:23FromDiscord<codic> also, how do I create a pragma?
17:28:33Yardanicodepends on what you mean by that
17:28:38FromDiscord<codic> for example if I had
17:28:55FromDiscord<codic> proc test(){.xyz.}=echo "O"
17:29:03Yardanicohttps://nim-lang.org/docs/manual.html#userminusdefined-pragmas
17:29:11FromDiscord<codic> it'd do something from xyz before the execution
17:29:12FromDiscord<codic> ah
17:29:13FromDiscord<codic> thanks
17:29:17FromDiscord<Rika> userrminusdefined lmao
17:29:37Yardanicowell it's just replacing - with minus
17:29:41FromDiscord<codic> wait what `They cannot be imported from a module.`
17:29:45FromDiscord<codic> welp
17:29:47FromDiscord<Rika> yeah, its just funny
17:29:51Yardanico@codic the pragma pragmas can't
17:30:04Yardanicocustom pragmas (with macro or template) can
17:30:04FromDiscord<clyybber> Will be "fixed"
17:30:05FromDiscord<codic> oof :\
17:30:19Yardanicoyou can create a macro pragma which does your pragma pragma
17:30:20Yardanicobig brain
17:30:21FromDiscord<codic> with a `template thing() {.pragma.}`?
17:30:34FromDiscord<Rika> "pragmas made with the pragma pragma" is such a confusing sentence
17:30:39FromDiscord<Rika> no need to add pragma there
17:30:44Yardaniconot really
17:30:47*ertp07 quit (Ping timeout: 260 seconds)
17:32:00FromDiscord<codic> argh I just want it so I can do from another file `import library; proc thing(){.x.}=echo "a"` and something from the pragma `x` can be executed before and after thing()
17:32:23*krux02 quit (Remote host closed the connection)
17:32:24Yardaniconot hard
17:32:40FromDiscord<codic> how would it work though/
17:32:45Yardanicojust okay
17:32:57FromDiscord<codic> considering that you can't import pragmas
17:33:01leorize[m]Yardanico: here's your mathexpr.info: http://ix.io/2lze
17:33:02Yardanico???????????????????
17:33:06FromDiscord<Rika> it'd rewrite the function to be (before stuff); function stuff; (after stuff)
17:33:07Yardanico@codic you can
17:33:09Yardanicojust not pragma pragmas
17:33:50FromDiscord<Rika> `{.pragma ---.}` pragmas are not importable; `macro pragmaname()` are
17:34:00FromDiscord<codic> Ohhhh
17:34:04FromDiscord<codic> hold on, testing something
17:34:05Yardanicotry to import it from another file https://play.nim-lang.org/#ix=2lzg
17:34:12Yardanicoleorize: so what was the problem?
17:34:17leorize[m]Yardanico: and here's the diff that do the magic: http://ix.io/2lzf
17:34:25leorize[m]nothing really :P
17:34:27leorize[m]it just works
17:34:44*solitudesf joined #nim
17:34:51FromDiscord<Rika> i'm thinking of rewriting memo into something more readable (maybe) for no reason
17:35:27Yardanicostill doesn't work for me XDD leorize[m]
17:35:32Yardanicosomething wrong with my compiler or lcov
17:35:43Yardanicolcov: LCOV version 1.0
17:35:45leorizelol what version of gcov are you using?
17:35:49Yardanicoah gcov?
17:35:52*Hideki_ quit (Ping timeout: 256 seconds)
17:36:00leorizeI'm on lcov 1.14
17:36:07Yardanicolol
17:36:08leorizewhat oddly outdated distro are you on?
17:36:13FromDiscord<codic> Wait what, nim play lang says `/usercode/in.nim(2, 13) Error: undeclared identifier: 'stmt'`
17:36:22Yardanicobecause that's from like 2015
17:36:30FromDiscord<clyybber> use typed and untyped
17:36:30Yardanicostmt/expr were before typed/untyped
17:36:31FromDiscord<clyybber> instead
17:36:39FromDiscord<codic> alright
17:36:40Yardanicoleorize: not sure either
17:36:56FromDiscord<clyybber> Yardanico: I think we could get rid of the pragma pragma completely
17:36:57FromDiscord<codic> but if I have a t of type untyped, how can I call it from within a macro
17:37:07Yardanico@codic ??????
17:37:10Yardanicomacros are not templates
17:37:14Yardanicomacros operate on AST and output AST
17:37:27FromDiscord<codic> Oh lol
17:37:37FromDiscord<codic> Ohhhhhhhhhhhhh
17:37:40FromDiscord<codic> That makes much more sense
17:38:02FromDiscord<codic> or not
17:38:06FromDiscord<codic> https://play.nim-lang.org/#ix=2lzh
17:38:20FromDiscord<codic> that throws an error for some reason
17:38:23Yardanicoreturn untyped
17:38:35Yardanicoah wait
17:38:37YardanicoI see
17:38:37FromDiscord<clyybber> No
17:38:42FromDiscord<clyybber> Simply don't call t
17:38:44FromDiscord<clyybber> t is code
17:38:45Yardanico@codic you're trying to call t
17:38:53FromDiscord<codic> but then where will it be called if I don't call it?
17:38:59Yardanicoyou don't "call" code
17:39:00FromDiscord<clyybber> yeah
17:39:01FromDiscord<Rika> t == `echo("hi")`
17:39:04Yardanicocode just get inserted
17:39:05FromDiscord<clyybber> because you call it inside t
17:39:14FromDiscord<clyybber> t itself is just a list of statements
17:39:15*ertp07 joined #nim
17:39:16FromDiscord<Rika> t() == `echo("hi")()`
17:39:22Yardanicoeyp
17:39:22Yardanicoyep
17:40:05FromDiscord<codic> alright so assume i remove that. then I just get the output
17:40:08FromDiscord<codic> before
17:40:08FromDiscord<codic> after
17:40:08Yardanico@codic I'd suggest you to read manual a bit :P
17:40:18FromDiscord<codic> there's no hi in the output :(
17:40:18FromDiscord<codic> true
17:40:20Yardanicono you also get "hi"
17:40:30FromDiscord<codic> nope
17:40:32Yardanicoyes
17:40:33FromDiscord<codic> https://play.nim-lang.org/#ix=2lzj
17:40:35Yardanicohttps://play.nim-lang.org/#ix=2lzk
17:40:41Yardanico@codic because you REMOVED t
17:40:42Yardanicot is CODE
17:40:49Yardanicoif you don't insert code, it's not gonna be executed
17:40:52Yardanicotemplates are code substitution
17:40:56FromDiscord<codic> Ohhhhhhhhhhhhhhh I call it as `t` not `t()`
17:41:00Yardanicoyou don't call it
17:41:02FromDiscord<clyybber> its not called
17:41:03Yardanicoyou simply insert the code body
17:41:05FromDiscord<clyybber> its getting inserted
17:41:07FromDiscord<codic> It's inserted
17:41:09FromDiscord<clyybber> yeah
17:41:13FromDiscord<codic> Yeah
17:41:13FromDiscord<codic> it serves my purpose still :P
17:41:17FromDiscord<clyybber> :)
17:42:22FromDiscord<codic> i was hoping that would somehow double up as a pragma as well. but `proc thing() {.Lol.} = echo "O"` doesnt have the `O`. Oh well /shrug
17:42:32FromDiscord<codic> *reads the manual*
17:42:39Yardanicobecause you'll insert the proc itself
17:42:45FromDiscord<clyybber> because it inserts "proc thing() = echo "0"
17:43:05FromDiscord<codic> and never calls thing()
17:43:08FromDiscord<codic> i see
17:43:10FromDiscord<clyybber> yeah
17:43:25FromDiscord<clyybber> if you want to make that work, you have to do t() I think
17:43:30Yardanicoleorize[m]: I'm still confused a lot, I install lcov as 1.14 but it shows version 1.0
17:43:31Yardanicogcov is 9.3
17:43:41leorizewhich lcov
17:43:49FromDiscord<codic> @clyybber nope didn't work :\
17:43:54FromDiscord<clyybber> let me try
17:44:00FromDiscord<codic> https://play.nim-lang.org/#ix=2lzm that's mine
17:44:05YardanicoI tried https://aur.archlinux.org/packages/lcov/ and https://github.com/void-linux/void-packages/blob/master/srcpkgs/lcov/template
17:44:14Yardanico(i'm on bedrock linux with void linux as main strata and arch additional)
17:44:16*krux02 joined #nim
17:44:25FromDiscord<codic> nooooo bedrock instability time
17:44:30Yardanicowat
17:44:46FromDiscord<Rika> wat
17:44:50FromDiscord<codic> having multiple package systems on one
17:44:56FromDiscord<codic> just... stop it :p
17:44:56Yardanicoit works nice
17:45:06FromDiscord<codic> ~~until it breaks~~
17:45:10Yardanicoexcept it doesn't
17:45:17FromDiscord<codic> ¯\_(ツ)_/¯
17:45:21FromDiscord<codic> maybe for you
17:45:21leorizeit's breaking afaict :P
17:45:28leorizewhich lcov <- run that
17:45:36Yardanico/usr/bin/lcov
17:45:37leorizesee what lcov is the primary
17:45:48leorizemaybe do a readlink on it too
17:45:50Yardanicothat's from void
17:45:53FromDiscord<codic> What is lcov?
17:46:05Yardanicoreadlink /usr/bin/lcov doesn't show anything
17:46:32*Trustable joined #nim
17:46:33FromDiscord<clyybber> @codic Oh, yeah, sorry that won't work. You need a macro here
17:46:58FromDiscord<codic> ah. trying that
17:47:03leorizeYardanico: well maybe try to disable void one?
17:47:09YardanicoI tried
17:47:18Yardanicolemme try building from github
17:47:29FromDiscord<codic> didn't exactly work
17:47:31FromDiscord<codic> https://play.nim-lang.org/#ix=2lzo
17:47:39Yardanicothats
17:47:39Yardaniconot
17:47:41Yardanicohow you use
17:47:42Yardanicomacros
17:47:42FromDiscord<codic> Yardanico: why not use the aur one? since you have arch access anyways
17:47:49Yardanico@codic it doesn't work
17:47:49FromDiscord<codic> :|
17:47:51FromDiscord<codic> oh
17:47:52Yardanicothe one from github worked
17:47:54Yardanicodirectly
17:47:56FromDiscord<codic> strange
17:48:18FromDiscord<codic> aur gets the release version from github anyways
17:48:19FromDiscord<codic> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lcov
17:48:25Yardanicostill
17:48:32Yardanicoand I didn't do latest release
17:48:34FromDiscord<codic> Aaaanyways why is that not how you use macros?
17:48:34FromDiscord<codic> oh
17:48:43Yardanico@codic because they operate on AST
17:48:46FromDiscord<clyybber> @codic There you go: https://play.nim-lang.org/#ix=2lzp
17:49:32*luis_ joined #nim
17:49:40FromDiscord<codic> Ohhhhhh
17:49:40FromDiscord<codic> the backticks make sense but why t[0]? is t a seq?
17:49:48FromDiscord<clyybber> its a NimNode
17:49:50Yardanicoread the macros docs really
17:49:58Yardanicoi'm sorry but explaining every single thing is really not okay
17:50:05FromDiscord<clyybber> and the first child of a proc NimNode is its name
17:50:05Yardanicoread manual and macros docs a bit
17:50:07Yardanicoread tut3
17:50:16Yardanico(https://nim-lang.org/docs/tut3.html)
17:50:37FromDiscord<codic> alright thank you!
17:51:31*aeverr joined #nim
17:51:32*aeverr is now known as aEverr
17:51:41Yardanicoip leaked
17:51:54leorizebedrock is a weird distro
17:51:56aEverrhello, i closed discord because discord's very cpu intensive
17:52:05FromDiscord<codic> "ip leaked" wait whattt
17:52:07Yardanicoleorize: I don't think it's related to bedrock really
17:52:09aEverr(i'm Rika if you still don't know)
17:52:15Yardanicoi do
17:52:21leorizeaEverr: you can use the name Rika here too
17:52:22FromDiscord<codic> is it?
17:52:27FromDiscord<codic> lemme see how much cpu it's taking for me
17:52:29leorizeor does someone already take it lol
17:52:33aEverri'm signed in already
17:52:50leorize /nick Rika
17:52:51leorizelol
17:52:54aEverralso "ip leaked"????
17:53:02FromDiscord<codic>
17:53:02FromDiscord<codic> https://cdn.discordapp.com/attachments/371759389889003532/709100699098677309/unknown.png
17:53:11YardanicoaEverr: yes of course
17:53:14Yardanicoeveryone can see your IP
17:53:19Yardanicoif you're connected directly
17:53:20leorizeit's not like leaking your ip is a problem anyway
17:53:24Yardanicoyeah ik
17:53:34*poohman_1 quit (Ping timeout: 240 seconds)
17:53:40aEverri was questioning why you exclaimed that
17:53:47Yardanicoleorize: made it work finally :D
17:53:59luis_Hi everyone, where do I set --arc on a nimble file?
17:54:03aEverrhm, what clients do you use, i dont like kde's default client
17:54:09Yardanicoluis_: can you show your .nimble file?
17:54:11aEverr--gc:arc
17:54:11YardanicoaEverr: Quassel
17:54:14leorizeI use weechat
17:54:17FromDiscord<codic> polari
17:54:21Yardanicoquassel is not an IRC client really
17:54:29FromDiscord<codic> Or usually a matrix client :P
17:54:38Yardanicothe client is quassel client, the server is irc client and quassel server at the same time
17:54:40FromDiscord<codic> since it interfaces with irc
17:54:40FromDiscord<codic> but when i use irc directly https://wiki.gnome.org/Apps/Polari
17:54:55FromDiscord<codic> i like kde's default but it's too cluttered
17:55:05FromDiscord<codic> so i remove it on all my installs (which are all kde)
17:55:14luis_https://i.imgur.com/McnjWXv.png
17:55:15leorizeweechat is my matrix and irc client :P
17:55:20luis_here is my nimble file
17:55:30leorizeluis_: you don't set it in nimble
17:55:52aEverrweechat aint gui so eeeehhhh
17:56:10leorizeluis_: make a file src/allocator.nim.cfg
17:56:17FromDiscord<codic> weechat has matrix?
17:56:18luis_amazing
17:56:20luis_thanks
17:56:22leorizeadd gc:arc there
17:56:32FromDiscord<codic> eh polari rules
17:56:41leorizecodic: yea, as a python plugin
17:56:49FromDiscord<codic> or gnome fractal (matrix and irc)
17:56:50FromDiscord<codic> Oh nice
17:57:01leorizeit's more featureful than most other matrix clients btw
17:57:13leorizethe only client to have stable E2E support that's not riot.im
17:57:17aEverri dont see how konversation is cluttered
17:57:29aEverri'll stay here in konversation
17:57:37liblq-devaEverr: have you tried polari?
17:57:42FromDiscord<codic> idk, last i tried it was honestly the kde 4 days
17:57:53FromDiscord<codic> like the really late ones when plasma next was about to be released
17:57:59*PMunch joined #nim
17:58:06FromDiscord<codic> redownloading it
17:58:15FromDiscord<codic> alot of kde was cluttered in those days
17:58:15aEverrits gnome, i dont want to try i
17:58:28liblq-devoh no not the K desktop environment
17:58:29FromDiscord<codic> honestly for some apps gnome does it better than kde
17:58:30FromDiscord<codic> just some apps
17:58:49Yardanicoleorize: thanks a lot, coverage is really cool stuff :)
17:58:50liblq-devand for visual design and layout it's just 10000000x better
17:58:57liblq-devKDE is so damn cluttered
17:59:00FromDiscord<codic> No u
17:59:03FromDiscord<codic> It's opinionated
17:59:05liblq-devit makes my brain hurt
17:59:06Yardanicowe have #nim-offtopic FYI
17:59:15aEverrclutter is what i like i think
17:59:17FromDiscord<codic> gnome makes my brain hurt
17:59:18Yardanicoand its bridged to discord too
17:59:27FromDiscord<codic> for how complex it is to tweak the simplest thing
17:59:31aEverri just dont like gnome's ui
17:59:40aEverralso yeah kde has p. good customization
17:59:46FromDiscord<codic> ^
17:59:56liblq-devand that's about all it has :)
18:00:06liblq-dev"pretty good" is not good enough imo
18:00:21liblq-devbut whatever it's opinionated as codic said
18:00:28FromDiscord<codic> > "pretty good" is not good enough imo
18:00:31liblq-devjust use what you like
18:00:35FromDiscord<codic> but you are kinda implying that gnome has better customization
18:00:40liblq-devnope
18:00:42aEverri dont see how its cluttered really, but yeah w/e
18:01:00FromDiscord<codic> that's the beauty of linux
18:01:00liblq-devI only said that GNOME has better HIG
18:01:10FromDiscord<codic> to each their own
18:01:10FromDiscord<codic> I partially agree
18:01:14Yardanicoguys really
18:01:17Yardanico#nim-offtopic
18:01:27FromDiscord<codic> why isn't that mentioned in discord #offtopic btw?
18:01:30aEverrhey i didnt start it :P
18:01:48leorizewell it doesn't really matter, we can move there :P
18:02:01aEverrim not interested in participating in that anymore
18:02:43FromDiscord<codic> ¯\_(ツ)_/¯
18:02:45leorizeYardanico: it's cool until it starts showing you all sorts of false negative :P
18:02:54FromDiscord<codic> Connecting from konversation to see if it's decent
18:03:03*codic^ joined #nim
18:03:07leorizego terminal master race
18:03:11codic^this actually
18:03:13codic^is pretty nice
18:03:24aEverrwhat the heck are yall moving to offtopic or not
18:03:30codic^sure
18:03:43codic^noow how do I join a channel after connection in konversation
18:03:53leorize /join
18:03:54aEverrsame way you do it in any client
18:04:00codic^o
18:04:13codic^"[11:04] [Channel] Cannot join channel (+r) - you need to be identified with services - see https://freenode.net/kb/answer/registration"
18:04:17codic^How come that's r+ but this isn't
18:04:28codic^anyways lemme connect to my irc acc
18:04:35aEverrmaybe spam? dunno\
18:04:42leorizeyea, was added due to spam
18:04:46codic^Oof
18:05:03leorizethis one have to stay -r since beginners join here
18:05:12codic^:\
18:05:30Yardanicoleorize: well just to get a general idea it works pretty well https://i.imgur.com/jEfIw02.png
18:05:35Yardanicofrom nimes :D
18:05:45leorizenice :D
18:05:48Yardanicomappers thing is true because I only played 1 rom which obviously has only one mapper
18:06:08aEverr? wrong channel?
18:06:16codic^yay I'm in
18:06:21leorizeaEverr: ?
18:06:26Yardanicobut yeah due to inlining and stuff sometimes lines are red
18:06:27codic^In #nim-offtopic
18:06:30Yardanicoeven though they were probably called
18:06:43Yardanicoi wonder how does it work that fast
18:06:45Yardanicowith coverage
18:06:45aEverrleorize: "mappers thing..." where'd this come from
18:06:47FromDiscord<codic> argh this is gonna take forever
18:06:51YardanicoaEverr: nimes
18:06:52FromDiscord<codic> to customize all the colors to dark ones
18:06:53YardanicoNES mappers
18:06:56aEverrOH
18:07:00Yardanicohttps://wiki.nesdev.com/w/index.php/Mapper
18:07:04leorizewe are talking code coverage lol
18:07:07aEverrsorry, i lost context i think
18:07:15FromDiscord<codic> lol
18:07:19leorizeYardanico: lines are red because of hidden conditionals
18:07:34Yardanicoyeah I'm probably stupid for compiling with -d:danger, lemme try without it
18:07:51FromDiscord<codic> d:danger ftw!
18:07:52*codic_ joined #nim
18:07:56codic_Test.
18:07:59codic_nice
18:08:03leorizethe compiler preserve line info well enough that inlining is not even remotely an issue
18:08:08Yardanicooh okay
18:09:01leorizefor this kind of coverage, the better the debug info is, the more precise the coverage data
18:09:04Yardanicoit's amazing how fast it is
18:09:14YardanicoI mean with -d:danger there are no slowdowns
18:09:42leorizewell I do it with the compiler and it only have a 1 min overhead
18:09:48Yardanicoeqdestroy be like https://i.imgur.com/9Ce7usD.png
18:09:52leorizethe largest overhead is in lcov :)
18:10:11YardanicoI guess it can't understand if functions are being called by function pointers
18:10:26leorizefunctions are always called by function pointers
18:10:30Yardanicoah wait it can
18:10:36Yardanicoi was looking at the wrong file
18:11:06Yardanicoyeah https://i.imgur.com/Jb5LIB4.png
18:11:28Yardanicocool to find out " 15 0 : of 0x8000..0xBFFF: result = m.cartridge.prg[m.prgBank1*0x4000 + int(adr - 0x8000)]" is never reached :P
18:11:31Yardanicofor super mario bros
18:11:46Yardanicoah nvm it is
18:11:50Yardanicoline info is a bit off
18:11:50*codic_ quit (Client Quit)
18:11:54*codic^ quit (Quit: Konversation terminated!)
18:11:58Yardanicothere weren't any exceptions
18:12:17*Romanson quit (Quit: Connection closed for inactivity)
18:13:16krux02Yardanico, yea line info is always a bit off.
18:13:53aEverrdoes nim have a convention for documenting arguments and returns?
18:13:57leorizewe should consider changing Nim's name mangling scheme
18:14:13leorizeaEverr: name them correctly and you avoided 70% of the docs
18:14:28leorizeand no, we don't have a convention for this
18:14:43krux02aEverr, nope
18:14:50aEverri see, i dont have the issue currently and was just asking
18:15:08krux02I prefer to mention them in a full sentence in double backticks
18:15:12Yardanicome too
18:15:29leorizesame here
18:15:59leorizeis there any reason why Nim use context-dependant name mangling?
18:16:16leorizedebugging tooling would be easier if it was a bit deterministic...
18:16:17krux02leorize, not a technical one
18:16:18PMunchWhat do you ean?
18:16:53krux02nim does not have name mangeling, it hash signature hashing
18:16:57leorizeproc foo() -> foo_<md5 of the environment around the symbol>
18:17:15krux02the difference is, name mangeling is revertable, signature hashing is not.
18:17:53krux02leorize, the environment is probably because of hygienic templates.
18:18:32leorizetrue, traditional mangling scheme wouldn't work here
18:18:38krux02a proc is module a should not name clash with the same proc in module b
18:19:26leorizepascal have name mangling and modules and this has never been an issue
18:19:31leorizesame goes for rust
18:20:30leorizeI guess only Araq can answer this one
18:20:40leorizeprobably because it's complicated to implement
18:21:32*ertp07 quit (Ping timeout: 260 seconds)
18:22:48*ertp07 joined #nim
18:22:52leorizewell to revert nim signature hashes we currently have to read .ndi, then parse .nim to get the full signature
18:22:59leorizenot a flow that's tooling friendly
18:25:05*chemist69 quit (Ping timeout: 252 seconds)
18:26:11*chemist69 joined #nim
18:33:29*ertp07 quit (Quit: Quit)
18:43:02*krux02 quit (Remote host closed the connection)
18:43:07*exelotl quit (Ping timeout: 260 seconds)
18:50:10*luis_ quit (Ping timeout: 272 seconds)
18:58:30*poohman_1 joined #nim
19:00:03*Vladar quit (Quit: Leaving)
19:02:55*NimBot joined #nim
19:12:46*Jesin joined #nim
19:17:35*luis_ joined #nim
19:19:43*luis_ quit (Client Quit)
19:20:25FromGitter<awr1> nim having a canonical form of name mangling seems like something that would be worthy of consideration as nim edges closer to having a specification as opposed to being impl defined
19:26:33disruptekmangling will be changing.
19:27:19disruptekit will be a function of past compilation state per the cache.
19:28:02disruptekbut, generally speaking, it will be as succinct as possible. first, just foo_2, foo_3, and foo. next, scope-based foo_N and foo.
19:29:33FromGitter<awr1> hm
19:30:15FromGitter<awr1> when nim functions are exported in a DLL via `exportc` without a specified name, what is the behavior of that? are they mangled?
19:30:21*iws quit (Quit: Lost terminal)
19:30:41FromDiscord<Yardanico> They have the same name as in Nim
19:30:52FromDiscord<Yardanico> I mean in the code itself
19:31:20FromGitter<awr1> so you can't have overloads on DLL exports because there is no mangling?
19:31:33FromGitter<awr1> (without changing exportc to have specific names)
19:32:38FromGitter<awr1> (or well, if the backend was C++, you could use its mangling i suppose)
19:33:16*Hideki_ joined #nim
19:34:24*aEverr quit (Quit: Konversation terminated!)
19:34:37*luis_ joined #nim
19:37:25*Hideki_ quit (Ping timeout: 246 seconds)
19:44:10*exelotl joined #nim
19:44:23*Jesin quit (Ping timeout: 260 seconds)
19:44:25*luis_ quit (Quit: luis_)
19:48:26*waleee-cl quit (Quit: Connection closed for inactivity)
19:50:12*dadada joined #nim
19:50:36*dadada is now known as Guest80851
19:55:16*zacharycarter joined #nim
19:58:36*waleee-cl joined #nim
20:06:02*abm joined #nim
20:09:01zacharycarterwell if https://github.com/nim-lang/Nim/issues/14260 - is the case - maybe just remove discardable?
20:09:05disbot{.discardable.} on object fields causes compile error ; snippet at 12https://play.nim-lang.org/#ix=2lAd
20:12:42zacharycarterseems pretty half baked if I can't use it in a type definition for a function pointer
20:12:43*poohman_1 quit (Ping timeout: 260 seconds)
20:12:51FromDiscord<Rika> maybe he likes it enough to keep it but not change it? dunno, esp. that clyy fixed it on his side...
20:14:03zacharycarterI think I like discardable better than littering the codebase with `discard`
20:14:43zacharycarterbut if I can't use it in a type definition then it's really not working for me and I just need to put discard everywhere
20:17:24disruptekuse a template.
20:17:45zacharycarterthat's not the point
20:18:00disruptekwell, i don't agree that it should be extended.
20:18:09zacharycarterif I have a bunch of function pointers in a type and I want to discard their result
20:18:30zacharycarterthe typer checker will complain whether I implement the function with discardable or not
20:18:31disrupteknothing is preventing you from doing this.
20:18:37zacharycarterfrom doing what?
20:18:44disruptekdiscarding proc results.
20:19:01FromGitter<Willyboar> dis we missed you
20:19:03zacharycarterI know nothing is - the point is I wanted to avoid writing `discard` everywhere
20:19:10disruptekuse a template.
20:19:19zacharycarterI agree nothing is preventing me, I'm being forced to
20:19:27zacharycartermeh
20:19:35disruptekyou're being forced to be more explicit.
20:19:37zacharycarterjumping through mroe hoops
20:19:57zacharycarterI figured the discardable pragma was explicit enough
20:20:00disruptekwillyboar: it's mothers day.
20:20:03zacharycarterbut I guess not
20:20:33disruptekit's comfort for ffi, and a dubious one at that.
20:20:53zacharycartermeh
20:20:53FromGitter<Willyboar> dis yes i know, my kids allday drawing things for my wife
20:20:58disruptekie. there's more to debate wrt including it at all, versus including it everywhere.
20:22:05disruptekmothers day is very important to me; i always double up on hookers and add a hefty tip.
20:22:10disruptekmoms gotta work too, y'know.
20:22:58disruptekdoes tsoding's stream have something to teach us?
20:26:00*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
20:27:42solitudesfno
20:28:40disrupteksux.
20:29:37disruptekmaybe we need more graphics.
20:42:07*exelotl quit (Ping timeout: 260 seconds)
20:44:27disruptekanyone have any xp with io_uring?
20:46:23*Jesin joined #nim
20:47:57*Jjp137 quit (Ping timeout: 260 seconds)
20:48:13*Jjp137 joined #nim
20:49:29FromDiscord<Rika> how experimental are the for loop macros?
20:54:23FromGitter<sealmove> are arrays initialized to 0's?
20:54:28FromGitter<sealmove> I know seqs are
20:55:04FromDiscord<Rika> yes
20:59:02FromGitter<sealmove> :O nice
21:03:37disruptekah, bad docs.
21:04:05liblq-devcan I `|` a proc type with a concept type?
21:04:29liblq-devmy intuition tells me it *should* be possible
21:04:48disruptekhere are three pipes: |||
21:04:54disruptektry it and if you need more, lemme know.
21:05:39FromGitter<sealmove> liblq-dev why do you want to try something like this? :D
21:06:06liblq-dev@sealmove it's… complicated
21:06:45liblq-devI want to provide the flexibility of being able to use a generator-style callback or an object iterable with pairs() as a GL uniform source
21:14:06FromDiscord<Rika> is there a better less technical explanation for what bindSym does?
21:17:29liblq-devit binds the symbol from the scope it's called in instead of the scope the macro is called in
21:20:47*exelotl joined #nim
21:24:51*Trustable quit (Remote host closed the connection)
21:25:44*solitudesf quit (Remote host closed the connection)
21:31:41*krux02 joined #nim
21:41:36*tane quit (Quit: Leaving)
21:43:37*arecaceae quit (Remote host closed the connection)
21:44:00*arecaceae joined #nim
21:49:37*liblq-dev quit (Quit: WeeChat 2.8)
21:55:05FromDiscord<Rika> can i check if a `NimNode` i constructed is valid?
22:01:34FromGitter<timotheecour> can anyone please merge https://github.com/nim-lang/Nim/pull/14293 to unblock nim CI ?
22:01:35disbotdiable nimx (CI failure)
22:15:24krux02Rika: what do you mean with "is valid"?
22:15:38krux02you mean valid syntax?
22:16:09krux02I would say, return it from a macro and the compiler will tell you if it's valild.
22:16:42FromDiscord<Rika> basically something like compiles() i guess?
22:17:00FromDiscord<Rika> so i can make an if else for a case i'm thinking of
22:17:05disruptekif you can get some goats in there somehow, that'll help.
22:17:20krux02Rika: no there is not.
22:17:39krux02you have to construct a valid ast.
22:17:57krux02`compiles` is already bad enough and should be avoided.
22:19:19krux02The reason is, you never know why something does not compile in `compiles`. Sometimes it is because a symbol isn't found. Sometimes it is because some obscure compiler bug, and sometimes it works even though it should not because of an unexpected compiler behavior.
22:19:49krux02if an ast is valid also depends heavily on the context.
22:20:19FromDiscord<Rika> i see, then i'm gonna need to think of another solutionm
22:30:44*Guest80851 is now known as dadada
22:30:55dadadahey my peeps
22:30:59FromDiscord<Rika> hi
22:31:04dadadahi Rika
22:31:10krux02hi
22:31:55dadadais there something eval like for nim macros? I want to get the type that is returned by a call for example, when I have something like var.field.call() ... getType doesn't work for this
22:32:27krux02dadada, there is a pattern that you can use, but it is a bit complicated.
22:33:38krux02you have to write two macros, an outer untyped frontend macro that eventually generats the calls like `var.field.call()` as an argument to an inner typed macro.
22:33:54krux02the inner typed macro will then be able to call getTypeInst.
22:34:12FromDiscord<Rika> how do i check if a proc can be used with a var as its sole argument? let's say, len(someVarWithSomeType) or something, how do i see if that'd work?
22:34:22FromDiscord<Rika> i'm stuck T_T
22:34:38dadadakrux02: I'll do so :D thanks mate
22:34:42krux02btw getTypeInst/getTypeImpl is the substitution for `getType` which should have been declared as deprecated when `getTypeInst` and `getTypeImpl` were introduced.
22:34:53krux02np
22:36:36krux02Rika: I think you can call getTypeInst on the proc symbol and see if the signature matches. But I honestly don't think you should go that route. It is error prone and there is probably a better solution to you problem.
22:36:41krux02I don't know your problem though.
22:38:11FromDiscord<Rika> my problem is actually the example i gave, i'm trying to see if i can get the length of a variable, if any
22:38:21FromDiscord<Rika> if none, i'd default to something
22:39:16krux02well I would have a solution to that, but it doesn't work for `len` because of an implementation detail in system.nim
22:39:28FromDiscord<Rika> w-what
22:39:44FromDiscord<Rika> do you mind elaborating? or is it gonna fly over my head if you tried?
22:39:45krux02The solution that I already tried was this:
22:40:32krux02I declared ``template len(arg: untyped): int = -1``
22:40:56krux02now you have a length for everything and -1 is the fallback if no precise overload exists.
22:41:10krux02now calling `len` on anything will work, no exception.
22:41:12krux02The problem:
22:41:18FromDiscord<Rika> cant be used in macros?
22:41:43FromDiscord<Rika> or rather code generated in macros? 🤔
22:42:03skrylar[m]oh yeah. i saw the lineinfo stuff earlier lastnight. should probably use it with my logstuff
22:42:43krux02This is the declaration that breaks this: proc len*(x: (type array)|array): int {.magic: "LengthArray", noSideEffect.}
22:43:01FromDiscord<Rika> why would it break?
22:43:47krux02because the argument are two typeclasses combined, overload resolution will pick len(arg: untyped) over len(x: (type array)|array)
22:44:16krux02and therefor `len(myarray)` will return -1
22:44:36krux02The only fix is to change system.nim
22:44:48krux02you see, the solution isn't perfect.
22:44:48skrylar[m](also earlier, re: gtk) y'know its weird, BeOS is the only OS i've seen where the GUI is fully multithreaded
22:45:15FromDiscord<Rika> minor noob question, what would (type array) resolve to? xd
22:46:44krux02(type array) is an alternative syntax (that I do not approve) for typedesc[array]
22:47:14FromDiscord<Rika> thats funky and confusing...
22:47:27krux02yea
22:47:39FromDiscord<Rika> why would two typeclasses be less "precise" than `untyped` itself?
22:47:47FromDiscord<Rika> i thought untyped was the least precise one can be
22:47:51krux02If you care about it. I am currently working on a compiler branch that tries to unify this mess.
22:48:07krux02A compiler that only accepts typedesc[array] and not (type array).
22:48:26krux02and yes, I thought the same about typedesc.
22:48:31leorize@timotheecour: with packages CI moved away from the main pipeline, we don't have to care about making sure it's always green when it's not our fault anymore
22:48:36krux02I mean I thought the same about untyped
22:49:32krux02that is in my opinion incorrect overload resolution.
22:49:37FromDiscord<Rika> are there proposals to change it?
22:49:46krux02no
22:50:58krux02you first have to convince Ar4q though that there is an issue, though.
22:51:10krux02twice though
22:51:40krux02then you can start on a proposal to fix it.
22:52:03leorizeyou can just write an RFC saying how you want things to be improved
22:52:30krux02or do that.
22:53:16FromDiscord<Rika> but i wonder if this is objectively wrong though... no idea
22:54:17krux02it is objectively annoying, if you want to make the `templat fallback(arg: untyped)` a real pattern of the language.
22:55:27FromDiscord<Rika> is there a case where it's *useful* though
22:55:37krux02and combined type classes are less specific than `untyped` witch doesn't even need to be a valid expression.
22:55:53*PMunch quit (Quit: leaving)
22:56:00krux02Rika: the pattern?
22:56:15krux02Yes the pattern would be useful for many things.
22:56:17FromDiscord<Rika> i mean, type classes being less precise
22:56:39krux02It could replace many use cases of `when compiles(foo(x)): foo(x)`
22:56:59krux02or better said, it could replace all use cases of that.
22:57:11krux02but only if it works.
22:59:00FromDiscord<Rika> is the change to system.nim easy?
22:59:14FromDiscord<Rika> easy to perform i mean
22:59:15leorizetouching system.nim is never easy
22:59:34leorizewell it's easy to change things in there, but getting them approved is an another story
22:59:38*zacharycarter quit (Quit: Lost terminal)
22:59:46leorizethough usually you just need to make sure that all tests passes
22:59:59krux02splitting the proc up into two different procs is trivial.
23:00:15krux02and it would solve this very specific problem with len.
23:00:22krux02But it does't fix the general problem.
23:04:55FromGitter<timotheecour> @leorize that defeats (to some extent) the purpose of important_packages which is to ensure a PR doesn’t break nim packages; if it’s always broken, it makes it harder to tell whether your PR broke it or whether it was already broken.
23:05:55FromGitter<timotheecour> The flakyness of important_packages are largely fixable and I have a patch in the pipeline to address its main problem, but until it’s submitted, https://github.com/nim-lang/Nim/pull/14293 un-breaks it
23:05:57disbotdiable nimx (CI failure)
23:06:00leorizeyes, but it's not urgent anymore
23:06:31leorizewe are disabling a lot of packages and the majority of them don't get re-enabled
23:06:36FromGitter<timotheecour> sure, urgent is subjective.
23:07:06leorizeat this rate disabling just seem to be "making the result look good" and less "improve ci quality"
23:07:37FromGitter<timotheecour> (disabled packages means a PR could genuinely break it but we won’t know until it’s re-enabled)
23:07:55leorizedo we ever re enable things?
23:08:01FromGitter<timotheecour> oh ya, all the time
23:08:06FromGitter<timotheecour> i do, and others too
23:08:08FromDiscord<Varriount> timotheecour: I really liked your issue detailing the bugs/problems with the findExe & getAppFilename procedures.
23:09:33krux02timotheecour: I think that important packages should not automatically update
23:10:04FromGitter<timotheecour> what do you mean by update?
23:10:07krux02if they stay at a fixed version, their maintainers can't break randomly
23:10:27krux02important packages are always on the latest commit.
23:10:43krux02that is a problem because the latest commit does not always work.
23:10:57krux02and with 100 packages, the propability that something breaks is very high.
23:11:08leorizewe also have the problem that people don't tag releases
23:11:11FromGitter<timotheecour> I’m aware, that’s exactly what https://github.com/timotheecour/Nim/issues/167 is about
23:11:14disbotimportant_packages keep breaking because tests run on HEAD but `nimble install` installs latest release ; snippet at 12https://play.nim-lang.org/#ix=2lAI
23:11:33FromGitter<timotheecour> (and that’s what I’m fixing in my branch)
23:15:55*Hideki_ joined #nim
23:17:36FromGitter<timotheecour> @Varriount ya, it’s been bugging me for a while; I’ll submit a `which` RFC/PR so you can chime in there too
23:19:12FromDiscord<Rika> new issue, how do i check if the node isnt an iterator...
23:20:54FromDiscord<Varriount> Rika: Get the type implementation?
23:21:26FromGitter<timotheecour> `n.typekind == nnkIteratorTy` or similar
23:24:05FromDiscord<Rika> @Varriount `ForLoopStmt`s seem to be untyped :/
23:25:13skrylar[m]leorize: have been entertaining the idea that this is a good use for branches tho
23:27:24FromGitter<deech> Is there a compile time conditional that checks for `nimscript`? `when nimvm: ...` doesn't seem to work.
23:28:23leorize[m]when nimvm works, but it's special
23:28:23leorize[m]read the docs
23:28:37leorize[m]it's a weird quirk of nim
23:28:53FromGitter<timotheecour> `when defined(nimscript)`
23:29:18FromGitter<timotheecour> `when nimvm:` is always true inside nimscript
23:30:02FromGitter<timotheecour> but also inside VM for non nimscript code
23:30:53*abm quit (Read error: Connection reset by peer)
23:31:23FromGitter<deech> Ah `when defined(nimscript):...` is what I need!
23:39:47*Jesin quit (Quit: Leaving)
23:42:34*Jesin joined #nim
23:48:46skrylar[m]i'm probably the only one with this problem, but eh. https://github.com/nim-lang/Nim/issues/14295
23:48:49disbot[1.2.0] --genDeps:on implicitly turns off compilation ; snippet at 12https://play.nim-lang.org/#ix=2lAO
23:58:14*ftsf joined #nim