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:38 | nisstyre | oh 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:24 | skrylar[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:45 | skrylar[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:12 | skrylar[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:53 | FromDiscord | <Yardanico> So guys can you share your thoughts in https://github.com/nim-lang/Nim/issues/14272 ? |
01:39:55 | disbot | ➥ symbols 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:46 | skrylar[m] | @Yardanico it should be fixed but at least its not hard to work around |
01:49:50 | FromDiscord | <Yardanico> Yeah I know |
01:50:12 | * | NimBot joined #nim |
01:50:15 | FromDiscord | <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:34 | FromDiscord | <Yardanico> And it's not really related to nim.cfg |
01:52:30 | FromDiscord | <Yardanico> (I mean that note in NimScript) |
01:52:31 | skrylar[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:22 | FromDiscord | <Yardanico> It's not about that really |
01:56:33 | FromDiscord | <Yardanico> It's about the order of evaluation of configs |
01:57:22 | FromDiscord | <Yardanico> User config gets evaluated the last, so the switches under @if release in main nim config don't get enabled |
01:57:46 | FromDiscord | <Yardanico> And nim compiler switches (passed in command line) are always there before any configs |
01:58:13 | skrylar[m] | imho there isn't anything wrong with that, but with using the general define syntax to denote a release build |
01:59:03 | skrylar[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:45 | skrylar[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:51 | skrylar[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:03 | skrylar[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:51 | skrylar[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:53 | skrylar[m] | dumb question; what are we using for weak references these days |
02:55:22 | * | dadada__ quit (Ping timeout: 246 seconds) |
02:55:23 | disruptek | cursor |
02:55:26 | disruptek | !memory |
02:55:27 | disbot | total: 360 Megabytes; free: 95 Megabytes; owned: 250 Megabytes; max: 360 Megabytes |
02:56:20 | disruptek | skrylar[m]: that was to you, btw. {.cursor.} |
03:01:50 | * | dadada joined #nim |
03:02:13 | * | dadada is now known as Guest870 |
03:05:07 | skrylar[m] | i don't see a cursor in the language manual or the index o.o |
03:07:42 | disruptek | arc weak refs. |
03:08:00 | disruptek | var foo {.cursor.} = someRef |
03:09:35 | disruptek | i guess they aren't in doc/destructors.rst for some reason. |
03:11:22 | disruptek | there are no cursors for closures, though. |
03:14:20 | * | Senketsu joined #nim |
03:14:39 | skrylar[m] | yea they aren't referenced anywhere that i can find |
03:24:34 | disruptek | ~cursor is ```let foo {.cursor.} = anyRef # with --gc:arc``` |
03:24:35 | disbot | cursor: 11```let foo {.cursor.} = anyRef # with --gc:arc``` |
03:24:53 | disruptek | ~cursor is let foo {.cursor.} = anyRef # with --gc:arc |
03:24:53 | disbot | cursor: 11let foo {.cursor.} = anyRef # with --gc:arc |
03:24:58 | disruptek | better. |
03:25:53 | disruptek | ~bentley lyybb |
03:25:54 | disbot | no 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:38 | skrylar[m] | contemplating a design pattern in nim |
05:03:23 | * | Hideki joined #nim |
05:03:47 | * | Hideki is now known as Guest29324 |
05:09:18 | skrylar[m] | pfft you're actually allowed to use typeof when defining parameter types |
05:11:46 | skrylar[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:27 | skrylar[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:31 | FromDiscord | <Yardanico> Good morning I guess |
07:45:20 | Prestige | o/ |
07:45:20 | FromGitter | <bung87> good afternoon |
07:45:25 | Prestige | Sup @Yardanico |
07:51:59 | Prestige | If I assign a new variable to someOption.get(), it won't copy the variable right? |
07:53:34 | FromDiscord | <Yardanico> Not sure |
07:54:04 | FromDiscord | <Yardanico> !eval import options; let a = some("hi"); echo a.get(), a.get() |
07:54:07 | NimBot | hihi |
07:55:26 | Prestige | !eval import options; let a = some("hi"); let b = a.get(); echo a.get(), b |
07:55:28 | NimBot | hihi |
07:55:55 | Prestige | Wonder if b is a copy of the value in a, like if we were using objects |
07:56:33 | FromDiscord | <Yardanico> !eval import options; var a = some("hi"); let b= a.get(); a = some("lo"); echo a.get(), b.get() |
07:56:36 | NimBot | Compile failed: /usercode/in.nim(1, 85) Error: type mismatch: got <string> |
07:57:36 | FromDiscord | <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:52 | Prestige | Hm okay, interesting. I'd hope it would just return the same object with Options |
07:59:08 | Yardanico | well let's see |
07:59:44 | skrylar[m] | @Yardanico mornin' |
08:00:24 | Yardanico | Prestige: |
08:00:27 | Yardanico | !eval import options; var a = some("abc");var b = a.get();a = some("def");echo a.get(), b |
08:00:31 | NimBot | defabc |
08:00:42 | Yardanico | a.get() changed but not b |
08:00:53 | Prestige | Wouldn't that only change a? |
08:01:16 | Yardanico | well if it didn't copy b would change too |
08:01:31 | Yardanico | ah actually .get() returns var T hmm |
08:03:33 | Yardanico | with ref objects it'll be the same as expected |
08:03:54 | Prestige | I was attempting an example: https://play.nim-lang.org/#ix=2lvg |
08:03:58 | Yardanico | !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:00 | Prestige | but it looks like I cannot assign to y.s here |
08:04:10 | Yardanico | because you did "let y" |
08:04:13 | Yardanico | and it's an "object" |
08:04:13 | Prestige | woops |
08:04:14 | Yardanico | not "ref object" |
08:04:25 | Yardanico | "object" is a value type |
08:04:49 | Yardanico | "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:52 | Yardanico | https://nim-lang.org/docs/tut1.html#advanced-types-objects |
08:05:58 | Prestige | Yeah, just not entirely clear on how ref objects work I suppose |
08:06:09 | Yardanico | ref objects are managed pointers to objects |
08:06:17 | Yardanico | "ref" is a managed (by the GC or other MM) pointer |
08:06:32 | Yardanico | so you copy the pointer |
08:06:36 | Yardanico | but it still points to the same place |
08:06:39 | skrylar[m] | yup. and ptr is unmanaged, and pointer is untyped |
08:06:43 | skrylar[m] | (and unmanaged) |
08:06:48 | Yardanico | pointer is void* in C yeah |
08:06:49 | Prestige | ah so like https://play.nim-lang.org/#ix=2lvj |
08:06:59 | Yardanico | Prestige: yep |
08:07:03 | Prestige | Perhaps that's what I want for my project |
08:07:07 | Prestige | Thanks Yardanico |
08:07:32 | Yardanico | to copy ref objects recursively we have deepCopy |
08:07:37 | Yardanico | although 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:18 | Yardanico | nice seems like https://github.com/def-/nimes/pull/6 will be merged :P |
08:30:19 | disbot | ➥ Use streams-like interfaces instead of methods |
08:30:49 | Yardanico | so we have 1 more easy example to show people how to use streams-like interfaces :P |
08:32:03 | Yardanico | now isObj is only used once in the entire C source code and only for checking exception type |
08:32:11 | Yardanico | if (isObj(nimBorrowCurrentException()->Sup.m_type, "|ValueError|CatchableError|Exception|RootObj|")) { |
08:32:31 | Yardanico | (with arc) |
08:38:37 | Yardanico | yay it got mergefd |
08:48:17 | Yardanico | lol seems like changing from methods to interfaces made it use ~5% less cpu (from 25% to 20%) |
08:48:23 | Yardanico | and with LTO + PGO it uses ~15% |
08:48:40 | Yardanico | I mean one core of course |
08:48:43 | Yardanico | one 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:25 | Yardanico | I managed to compile it with emscripten (well it was already done by def- but I did it with arc and latest nim) |
09:11:37 | def- | Yardanico: cool |
09:11:42 | Yardanico | def-: oh you're here :P |
09:11:42 | skrylar[m] | we have interfaces now? |
09:11:53 | Yardanico | skrylar[m]: object with proc pointers |
09:11:59 | Yardanico | https://forum.my-toolbox.xyz/out/hello.html |
09:12:04 | skrylar[m] | oh. |
09:12:07 | Yardanico | ah wait forgot to modify html file |
09:12:31 | Yardanico | https://forum.my-toolbox.xyz/out/hello.html works now |
09:12:57 | skrylar[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:08 | Yardanico | skrylar[m]: well with arc methods use string comparisons :P |
09:13:20 | skrylar[m] | absolute trash |
09:13:20 | Yardanico | methods can be implemented differently, you know |
09:13:56 | skrylar[m] | the bindispatch technique is nice if you don't want a full fat pointer |
09:14:04 | skrylar[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:11 | skrylar[m] | don't closures allocate heap stuff so an object ful of closures is actually a heap alloc per method |
09:17:26 | Yardanico | well you can always do {.cdecl.} as krux recommended me to do |
09:17:31 | Yardanico | so these function pointers won't be closures |
09:24:56 | * | Senketsu joined #nim |
09:25:21 | * | Senketsu quit (Client Quit) |
09:30:06 | Yardanico | hah, I managed to use gmail smtp for nimforum, nice, now you can register on https://forum.my-toolbox.xyz/ :P |
09:30:09 | Yardanico | and email activation works |
09:30:35 | Yardanico | literally 1-line change (added await client.startTls() because google smtp works with TLS only) |
09:32:08 | Yardanico | now I need to learn how to remove moderated status lol |
09:32:47 | * | krux02 joined #nim |
09:33:04 | Yardanico | ah I found out |
09:33:14 | Yardanico | "You can modify anyone's rank. Remember: with great power comes great responsibility." |
09:33:33 | Yardanico | nimforum backend is surprisingly lightweight |
09:35:53 | planetis[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:55 | planetis[m] | oh there templates now cool |
09:37:38 | planetis[m] | i have a macro for that btw: https://github.com/b3liever/protocoled |
09:37:54 | planetis[m] | but hadn't got any usage yet |
09:37:56 | Yardanico | yeah I figured out there'd be a macro for that, niec :) |
09:38:19 | Yardanico | really cool |
09:38:38 | Yardanico | i'll add it to https://github.com/nim-lang/Nim/wiki/Curated-Packages so it doesn't get lost |
09:38:57 | planetis[m] | thanks! |
09:39:39 | Yardanico | added under Language -> Metaprogramming |
09:39:44 | Yardanico | sorry under Language -> Object orientation |
09:40:24 | planetis[m] | you are fast lol |
09:40:33 | planetis[m] | didn't expect to see it there |
09:41:50 | planetis[m] | there is also https://nimble.directory/pkg/interfaced and another one similar |
09:42:09 | planetis[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:26 | federico3 | https://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:42 | FromDiscord | <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:20 | FromDiscord | <wiremoons> Probably of limit use to more experienced users 🙂 |
10:34:56 | Yardanico | @wiremoons about https://www.wiremoons.com/development/debugging/nim/2020/04/18/Nim-Debugging-Approaches.html |
10:35:14 | Yardanico | there's a very useful proc in the system module https://nim-lang.org/docs/system.html#instantiationInfo |
10:35:23 | dom96 | wiremoons: nice! Thanks for writing these up! :) |
10:35:26 | Yardanico | with it you can show on which lines of code you printed your debug statements |
10:35:30 | Yardanico | but yeah, nice posts :) |
10:35:36 | FromDiscord | <Recruit_main707> @wiremoons ^ |
10:36:43 | PMunch | @wiremoons yeah these are actually pretty nice |
10:36:46 | FromDiscord | <wiremoons> Thanks for the link @Yardanico - I will have a look |
10:37:52 | federico3 | https://github.com/mukul-rathi/bolt-dissertation/blob/master/dissertation.pdf |
10:38:57 | FromDiscord | <wiremoons> @Recruit_main707 🙂 |
10:39:07 | Yardanico | @wiremoons something like https://play.nim-lang.org/#ix=2lww |
10:39:36 | Yardanico | you can also get full paths with instantiationInfo(true) |
10:39:42 | Yardanico | ah sorry |
10:39:49 | Yardanico | instantiationInfo(fullPaths = true) |
10:40:12 | Yardanico | then 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:16 | Yardanico | (vscode supports that for example) |
10:41:43 | PMunch | By 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:51 | FromDiscord | <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:25 | Yardanico | yeah, 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:43 | Yardanico | also astToStr (shown in instantiationInfo) is cool |
10:44:24 | FromDiscord | <wiremoons> Thanks @PMunch - I hadn't got around to looking for that info yet, so thanks for the link |
10:45:22 | PMunch | federico3, baller page "ii" in that dissertation :P |
10:45:27 | Yardanico | something like https://play.nim-lang.org/#ix=2lwB |
10:45:37 | PMunch | "Special Difficulties - None." |
10:46:01 | PMunch | That's my problem with writing things on my site |
10:46:23 | PMunch | I tend to delve deep into things and try to understand every nook and cranny of it so I can explain it properly |
10:46:28 | PMunch | Takes forever to write stuff |
10:47:07 | PMunch | And 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:28 | PMunch | Still waiting on this for example for my C interop article: https://github.com/nim-lang/Nim/pull/14258 |
10:47:29 | disbot | ➥ Allow let to not have value when using importc |
10:50:24 | * | ertp07 left #nim ("Leaving") |
11:01:46 | Yardanico | lol |
11:01:47 | Yardanico | https://github.com/nim-lang/Nim/issues/12382#issuecomment-626308745 |
11:01:50 | disbot | ➥ OSError: Bad file descriptor in asyncnet server ; snippet at 12https://play.nim-lang.org/#ix=2lwQ |
11:02:00 | Yardanico | replacing code with same code did the trick :P |
11:02:36 | FromDiscord | <Recruit_main707> classic |
11:02:54 | Yardanico | and here I am, know nothing about web dev and trying to add ability to remove categories in nim forum lol |
11:03:18 | Yardanico | well 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:42 | FromDiscord | <KrispPurg> thats life hacks |
11:28:28 | PMunch | Is there a way to define a macro that has an optional untyped argument with the default just being something like `discard`? |
11:29:54 | FromDiscord | <Rika> overload it? |
11:32:21 | krux02 | PMunch, do default values for untyped not work? |
11:33:40 | krux02 | you can also do ``args: varargs[untyped]`` and check the length of `args` |
11:33:48 | PMunch | krux02, I can't just do `default: untyped = discard` |
11:34:11 | PMunch | That's quite a misleading signature though.. |
11:35:22 | * | Trustable quit (Remote host closed the connection) |
11:35:23 | krux02 | I don't think so. |
11:35:44 | krux02 | I think it would fit the default argument model pretty well. |
11:36:01 | PMunch | With `default: varargs[untyped]`? |
11:36:05 | krux02 | but it doesn't work, so you have to work around it. And I guess overloads are the solution to go here. |
11:36:20 | PMunch | Yeah, that's what I'm thinking as well |
11:36:29 | krux02 | yes default varargs[untyped] is a misleading signature |
11:36:34 | krux02 | but it would work |
11:36:44 | PMunch | Tried to do it with `default: untyped = nnkDiscard.newTree(newEmptyNode())` but that didn't work either |
11:36:50 | PMunch | Produced a rather odd error message |
11:38:21 | * | Hideki_ joined #nim |
11:42:03 | PMunch | Is there no way to return an anonymous procedure from a macro? |
11:42:16 | PMunch | So you do something like `let myProc = generateProcMacro()` |
11:42:27 | PMunch | And can then call `myProc(someargument)` |
11:43:20 | Yardanico | hmmmm |
11:43:24 | FromDiscord | <mratsim> yes you can |
11:43:42 | FromDiscord | <mratsim> one of the macro in sugar does this, pretty sure it was the list comprehension macro |
11:43:58 | FromDiscord | <mratsim> it used nnkLambda.newTree |
11:44:08 | PMunch | Aah right |
11:45:07 | Yardanico | yeah https://play.nim-lang.org/#ix=2lx0 |
11:45:14 | liblq-dev | does nim have a shell expansion thingy in the stdlib? eg. "(a|b|c)def" would get expanded to @["adef", "bdef", "cdef"] |
11:45:27 | Yardanico | well that syntax is used for .so files |
11:45:31 | Yardanico | hmm |
11:45:39 | liblq-dev | I know there's one in dynlib.nim, it's called libCandidates |
11:45:48 | liblq-dev | but using it feels... off |
11:45:58 | Yardanico | apart from it I don't know any |
11:46:21 | Yardanico | and I've never heard of shell expansion like that |
11:48:12 | liblq-dev | well bash and fish have {} |
11:48:20 | liblq-dev | eg. {a,b,c}dawd |
11:48:29 | liblq-dev | and they can nest |
11:48:44 | liblq-dev | libCandidates doesn't support nesting |
11:48:53 | Yardanico | do it yourself then :P |
11:49:08 | liblq-dev | too much work |
11:49:22 | liblq-dev | I'll just list all possibilities manually, I guess |
11:52:15 | Yardanico | planetis[m]: btw your protocoled package is invalid |
11:52:21 | Yardanico | you specify "srcDir = src" but you don't have that |
11:52:26 | Yardanico | so you can't use the package if you install it from nimble |
11:55:08 | Yardanico | btw 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:10 | PMunch | Hmm, is there a way to inject a block label in a macro? |
12:27:51 | * | ertp07 joined #nim |
12:28:22 | PMunch | Like 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:56 | Yardanico | PMunch: https://nim-lang.org/docs/macros.html#statements-block-statement ? |
12:32:42 | FromDiscord | <mratsim> block statement first param is the block name |
12:33:12 | Yardanico | https://play.nim-lang.org/#ix=2lxl |
12:34:38 | PMunch | Huh |
12:34:49 | PMunch | That's pretty much exactly what I tried.. |
12:34:55 | PMunch | I mean I did it like this: https://play.nim-lang.org/#ix=2lxm |
12:35:00 | PMunch | But that also works.. |
12:35:06 | Yardanico | heh |
12:35:14 | PMunch | Aah |
12:35:17 | * | ertp07 quit (Read error: Connection reset by peer) |
12:35:39 | PMunch | Hmm, no that wasn't it.. |
12:35:55 | PMunch | Oh wait.. |
12:36:06 | PMunch | Hmm |
12:36:49 | Yardanico | protocoled is quite elegant ngl, although a bit of boilerplate but still cool :) |
12:36:55 | Yardanico | https://play.nim-lang.org/#ix=2lxn |
12:37:12 | Yardanico | stripped and adapted mathexpr to do parsing instead of evaluation :P |
12:37:43 | * | Hideki_ quit (Ping timeout: 260 seconds) |
12:39:22 | Yardanico | of course that will be slower than my mathexpr (because i don't construct any AST and immediately evaluate everything) but still cool |
12:39:41 | Yardanico | around 2x slower for 2+2*2-4^2+-1 |
12:40:07 | Yardanico | 6m vs 2.5m iterations/sec :P |
12:40:49 | Yardanico | funny fact: seems like clang optimizes mathexpr more than this protocol version |
12:40:55 | PMunch | Hmm, yeah my issue was that I pass the break statement into a macro that creates a pragma out of the body.. |
12:41:06 | Yardanico | so mathexpr is faster with clang, but protocol is faster with gcc (I mean relatively to clang) |
12:41:18 | Yardanico | maybe gcc recognizes that pattern and does some more smart optimizations |
12:41:25 | PMunch | s/pragma/lambda |
12:42:26 | PMunch | Which is a bit weird as I create the lambda inside the block.. |
12:43:08 | PMunch | Yeah, this fails: https://play.nim-lang.org/#ix=2lxo |
12:45:09 | PMunch | Ah, so block labels aren't captured in lambdas at all: https://play.nim-lang.org/#ix=2lxp |
12:45:21 | PMunch | Is that intended? |
12:50:38 | Yardanico | PMunch: I think that's not possible in Nim at all |
12:50:45 | Yardanico | you might have to use a global variable for that or something |
12:50:58 | PMunch | Found a workaround that works for my application |
12:50:58 | Yardanico | https://play.nim-lang.org/#ix=2lxu |
12:53:29 | Yardanico | btw it's the first time I saw the "Error: invalid control flow: test" error |
12:53:52 | FromDiscord | <clyybber> I think you get that when the VM can't find the break label |
12:53:59 | Yardanico | and see https://play.nim-lang.org/#ix=2lxu |
12:54:05 | FromDiscord | <clyybber> .s/VM/compiler |
12:54:08 | Yardanico | yeah |
12:54:26 | * | sirn joined #nim |
12:55:17 | Yardanico | also seems like my mathexpr is actually faster than https://github.com/codeplea/tinyexpr (well because i don't do AST at all) |
12:55:26 | Yardanico | nim-mathexpr initially was a wrapper to tinyexpr :P |
12:55:44 | Yardanico | https://github.com/Yardanico/nim-mathexpr/commit/039f5f07714b675ca51a1ce5d0bf9928c8b9b77d |
12:55:48 | Yardanico | https://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:50 | shashlick | Nimterop 0.5.0 is almost ready to be tagged, if anyone wants their wrapper tested before release, please get in touch |
13:09:16 | zacharycarter | shashlick: 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:37 | zacharycarter | but essentially there are serveral types that are predeclared and then declared again later |
13:10:08 | zacharycarter | nimterop 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:09 | krux02 | zacharycarter, and it is not a forward def? |
13:11:27 | zacharycarter | here's an example |
13:11:43 | zacharycarter | https://github.com/cimgui/cimgui/blob/master/cimgui.h#L53 |
13:12:10 | zacharycarter | it's fully defined later in the header but Nimterop just skips this all together |
13:12:20 | Yardanico | #ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS |
13:12:22 | Yardanico | is that defined? |
13:12:24 | zacharycarter | yes |
13:12:49 | * | dddddd quit (Ping timeout: 264 seconds) |
13:13:07 | krux02 | so tha alias is declared first, before the struct is declared. |
13:13:17 | zacharycarter | yes |
13:13:18 | krux02 | That is interesting, I didn't know that this is valid C code. |
13:13:35 | krux02 | I thought you had to have the struct definition first. |
13:14:32 | krux02 | But the ``typedef struct Typename Typename;`` is a very common pattern. No reason not to support it in nimterop. |
13:16:10 | zacharycarter | well it just forces me to manually override all of these for now and then using nimterop in the first place becomes questionable |
13:16:40 | krux02 | what if you comment them out? |
13:16:53 | krux02 | is it feasible to invert the declaration order) |
13:16:56 | krux02 | ? |
13:17:55 | krux02 | oh no it's not really, it really is a lot of API |
13:18:46 | krux02 | zacharycarter: 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:16 | krux02 | maybe it is feasible to extend generate.lua so that it generates Nim bindings. |
13:20:23 | zacharycarter | maybe |
13:20:43 | zacharycarter | I could probably also just use c2nim |
13:20:47 | zacharycarter | and automate that |
13:21:49 | * | Hideki_ quit (Remote host closed the connection) |
13:22:07 | * | Hideki_ joined #nim |
13:22:41 | PMunch | https://github.com/PMunch/xevloop |
13:23:11 | * | sz0 quit (Quit: Connection closed for inactivity) |
13:28:02 | PMunch | https://github.com/nim-lang/packages/pull/1466 |
13:28:02 | disbot | ➥ Add xevloop package |
13:31:28 | Yardanico | btw 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:34 | Yardanico | and says "0 error(s), 266 warning(s), 66.1% typed" which is pretty good I guess |
13:31:59 | FromDiscord | <Rika> thats a lot of warnings |
13:32:04 | Yardanico | that JS code is beyond obfuscation though, it's completely undreadable |
13:32:38 | Yardanico | @Rika redeclared variables/unreachable code/condition always false/some other stuff |
13:33:10 | FromDiscord | <Rika> o i see |
13:33:13 | Yardanico | https://i.imgur.com/YOdCOXB.png |
13:33:13 | * | filcuc joined #nim |
13:33:22 | FromDiscord | <Rika> that bg tho 😮 |
13:33:46 | Yardanico | found it in https://www.youtube.com/watch?v=6WQjgHuUDWU |
13:35:05 | Yardanico | I wonder what difference does -d:release vs -d:danger make |
13:35:08 | Yardanico | for nim forum frontend |
13:35:27 | Yardanico | with -d:release - 696kb, with -d:danger - 660kb |
13:36:00 | Yardanico | also 70% typed now |
13:36:19 | Yardanico | and output from closure compiler is 204kb |
13:36:47 | Yardanico | and that code is really interpreter and JIT friendly |
13:36:59 | Yardanico | because interpreters are happier then you don't have any whitespace ;) |
13:37:04 | Yardanico | if the language isn't whitespace-significant |
13:37:10 | Yardanico | *when |
13:38:02 | Yardanico | https://i.imgur.com/MQak4rF.png |
13:38:25 | FromDiscord | <Rika> interpreted languages really benefit from non-whitespace-significant languages |
13:40:43 | * | zacharycarter quit (Ping timeout: 260 seconds) |
13:41:58 | Yardanico | tfw js "compressors" make the size bigger |
13:42:52 | FromDiscord | <Rika> lmao |
13:49:33 | * | Vladar quit (Quit: Leaving) |
13:52:11 | * | tane joined #nim |
13:58:25 | FromDiscord | <Doongjohn> ```nim |
13:58:26 | FromDiscord | <Doongjohn> block: |
13:58:26 | FromDiscord | <Doongjohn> let textPath = "./sometext.txt" |
13:58:26 | FromDiscord | <Doongjohn> let textFile = open(textPath, FileMode.fmReadWrite) |
13:58:26 | FromDiscord | <Doongjohn> defer: close textFile |
13:58:27 | FromDiscord | <Doongjohn> |
13:58:27 | FromDiscord | <Doongjohn> write textFile: |
13:58:28 | FromDiscord | <Doongjohn> """Lorem ipsum dolor sit amet, |
13:58:30 | FromDiscord | <Doongjohn> consectetur adipiscing elit. |
13:58:32 | FromDiscord | <Doongjohn> Morbi lorem eros, sagittis sed laoreet vel, |
13:58:33 | FromDiscord | <Doongjohn> bibendum vitae dui.""" |
13:58:35 | FromDiscord | <Doongjohn> textFile.flushFile() |
13:58:36 | FromDiscord | <Doongjohn> |
13:58:38 | FromDiscord | <Doongjohn> echo textPath.readFile() # prints properly. |
13:58:40 | FromDiscord | <Doongjohn> echo textFile.readAll() # prints nothing? What am I doing wrong? |
13:58:41 | FromDiscord | <Doongjohn> ``` |
13:58:42 | FromDiscord | <Rika> oof |
13:58:44 | FromDiscord | <Rika> rest in peace irc |
13:58:55 | FromDiscord | <Rika> @Doongjohn you arent seeking back to the end of the file |
13:58:58 | PMunch | Doongjohn, please don't paste code into Discord.. |
13:59:10 | * | lritter joined #nim |
13:59:14 | FromDiscord | <Rika> before the echo, do `textFile.setPosition 0` |
13:59:25 | FromDiscord | <Doongjohn> oh ok thanks |
13:59:40 | PMunch | Yardanico, bot, when? |
13:59:42 | FromDiscord | <Rika> or was it setFilePos... |
13:59:56 | FromDiscord | <Rika> i dont remember, check the `io` module if you must |
14:02:11 | FromDiscord | <Doongjohn> should I use forum instead for pasting the code? |
14:02:39 | FromDiscord | <Rika> no, use a paste service |
14:02:46 | FromDiscord | <Rika> pastebin if you want |
14:03:03 | FromDiscord | <Doongjohn> ok sry |
14:03:04 | leorize | or the playground |
14:07:06 | PMunch | Or ix.io |
14:07:29 | FromDiscord | <Yardanico> @PMunch I can do it today just to see how things will go xdd |
14:07:39 | PMunch | Hooray! |
14:07:52 | FromDiscord | <Yardanico> The bot has two days uptime which is pretty good |
14:07:53 | PMunch | Finally the days of telling people to stop pasting code might come to an end! |
14:08:04 | PMunch | Yeah it seems solid in offtopic |
14:08:28 | Yardanico | yeah and I can always swap the older version easily |
14:08:47 | PMunch | As long as you're around :P |
14:08:55 | PMunch | Don't swap the bots and then go on holiday or something |
14:08:57 | Yardanico | well dom has access to that VPS as well :) |
14:09:07 | * | ertp07 joined #nim |
14:09:07 | Yardanico | mattebridge runs on the same droplet as NimBot |
14:09:12 | PMunch | (Not that I know where you would go on holiday..) |
14:09:16 | Yardanico | xd |
14:09:46 | Yardanico | well let's try to do it |
14:10:48 | Yardanico | it'll bridge 5 channels at the same time :P |
14:10:55 | Yardanico | ah sorry 4 |
14:11:16 | shashlick | @zacharycarter - nimterop supports forward declarations |
14:11:35 | shashlick | But you need to use ast2 |
14:13:51 | PMunch | Is there a limit to how many arguments a program can take? |
14:14:18 | Yardanico | yeah |
14:14:34 | Yardanico | https://serverfault.com/questions/163371/linux-command-line-character-limit |
14:15:00 | shashlick | @zacharycarter https://github.com/nimterop/nimterop/issues/148 |
14:15:01 | disbot | ➥ Doesn't properly handle forward declarations |
14:15:54 | leorize | on windows the limit is < 32800 ansi or unicode chars |
14:15:56 | * | Hideki_ quit (Ping timeout: 272 seconds) |
14:16:15 | PMunch | leorize, this is for a window manager, so Windows isn't an issue |
14:16:26 | PMunch | Or, well, Windows is an issue, but not for this |
14:16:48 | PMunch | Okay so that might be enough.. |
14:16:50 | Yardanico | so first I'll try to start the bridge for all channels except #nim on the nim vps |
14:16:56 | Yardanico | and then I uncomment #nim and restart :P |
14:17:22 | PMunch | Good idea |
14:17:23 | Yardanico | nim vps is really pretty old though |
14:17:50 | * | Hideki_ joined #nim |
14:17:53 | Yardanico | ubuntu 16.04 |
14:19:35 | PMunch | Hmm, 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:09 | PMunch | I guess it could also pass them along by environment variables.. |
14:21:13 | * | filcuc quit (Ping timeout: 264 seconds) |
14:22:11 | PMunch | Problem 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:55 | PMunch | But what happens if I want to allow e.g. scripting I can't have an argument `--"exec something" "Mod4+e"` |
14:23:25 | PMunch | Maybe 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:20 | Yardanico | ~restarting the bridge~ |
14:42:21 | disbot | no 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:06 | FromDiscord | <Yardanico> 123 |
14:44:08 | Yardanico | 123 |
14:44:27 | FromDiscord | <Yardanico> ```nim↵echo "Hello world"↵echo "yes finally"↵``` |
14:44:38 | FromDiscord | <Yardanico> asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasf↵asdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdasfasdasdas |
14:44:51 | FromDiscord | <Yardanico> sent a long message, see http://ix.io/2gcc |
14:45:27 | FromDiscord | <Rika> interesting |
14:45:33 | FromDiscord | <Rika> testing in production 😛 |
14:45:39 | * | Hideki_ joined #nim |
14:45:55 | Yardanico | wait I'll restart it to enable screen logging |
14:45:58 | * | FromDiscord quit (Remote host closed the connection) |
14:46:24 | Yardanico | hmm |
14:46:25 | * | FromDiscord joined #nim |
14:47:03 | Yardanico | ah 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:55 | Yardanico | well let's see how it works out |
14:48:23 | Yardanico | if something's bad I can always get the old bridges back up :P |
14:48:42 | * | Hideki__ quit (Ping timeout: 256 seconds) |
14:48:45 | Yardanico | !status |
14:48:45 | FromDiscord | Uptime - 1 minute, 28 seconds, 815 milliseconds, 148 microseconds, and 119 nanoseconds |
14:49:45 | Yardanico | @KrispPurg btw I used the latest devel is it stable? :P |
14:49:47 | Yardanico | and yes pinging works |
14:49:57 | Yardanico | or it doesn't hmm |
14:49:59 | Yardanico | @Rika 123 |
14:50:01 | Yardanico | hmm |
14:50:16 | Yardanico | @KrispPurg ^ |
14:50:17 | Yardanico | wat |
14:50:45 | FromDiscord | <exelotl> holy shit I've been waiting so long for this moment |
14:50:50 | Yardanico | @exelotl lmao |
14:51:34 | Yardanico | ah I see why |
14:51:38 | Yardanico | lemme do a hotfix (TM) |
14:52:39 | * | FromDiscord quit (Remote host closed the connection) |
14:52:54 | * | FromDiscord joined #nim |
14:52:57 | Yardanico | @KrispPurg ping |
14:53:01 | Yardanico | ok im stupid |
14:55:09 | FromDiscord | <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:17 | FromGitter | <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:36 | leorize | ask dom96 lol |
15:02:59 | FromGitter | <sealmove> @dom96 ping :P |
15:03:08 | Yardanico | idk 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:32 | FromDiscord | <Recruit_main707> ircord in general?? |
15:42:52 | * | filcuc quit (Ping timeout: 260 seconds) |
15:43:06 | FromDiscord | <Rika> yes |
15:43:12 | Yardanico | ill revert for now |
15:43:16 | Yardanico | coz 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:34 | FromDiscord | <Rika> try re-enabling the intent lol |
15:43:34 | FromDiscord | <Yardanico> I TRIED |
15:43:34 | FromDiscord | <Rika> in the discord dev settings |
15:43:35 | FromDiscord | <Rika> really |
15:43:37 | FromDiscord | <Yardanico> yes |
15:43:37 | FromDiscord | <Yardanico> really |
15:43:38 | FromDiscord | <Rika> mmmmmmmmmm |
15:43:44 | FromDiscord | <Rika> weird |
15:43:46 | FromDiscord | <Yardanico> I even created a new bot and enabled same intent |
15:43:48 | FromDiscord | <Rika> discord dumb |
15:44:04 | FromDiscord | <Rika> i declare discord dumn |
15:44:06 | FromDiscord | <Rika> dumb |
15:44:08 | Yardanico | i'll test on my pc for now to find why it doesn't work |
15:44:10 | Yardanico | #nim-test |
15:44:11 | Yardanico | #test |
15:44:34 | * | exelotl joined #nim |
15:47:49 | * | dadada__ quit (Ping timeout: 246 seconds) |
15:52:48 | FromDiscord | <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:54 | FromDiscord | <Rika> does nim have a "sanitize filename" proc that strips invalid chars from filenames |
16:09:49 | leorize | I don't think so |
16:10:01 | leorize | invalid chars differs from os to os anyway |
16:10:23 | FromDiscord | <Rika> same thing with dir.sep.s, yet we have `os` |
16:10:44 | FromDiscord | <Rika> nonetheless, that's fine |
16:10:58 | FromDiscord | <Rika> was just wondering if i could replace a handmade proc with a stdlib one |
16:11:09 | leorize | and invalid chars is context-dependent |
16:11:18 | leorize | we do have one to verify for invalid names iirc |
16:11:30 | leorize | none to strip them though, since that sounds, uh, terrible? |
16:12:09 | shashlick | Seeing different makefile behavior when shell = bash vs sh - any insights? |
16:12:18 | shashlick | Paths don't work in bash mode |
16:12:25 | FromDiscord | <Rika> ooh, if we have a verify one, that works for me i guess |
16:13:02 | leorize | https://nim-lang.org/docs/os.html#isValidFilename%2Cstring |
16:24:13 | * | ertp07 quit (Ping timeout: 246 seconds) |
16:26:14 | FromGitter | <Willyboar> !stream |
16:28:34 | * | ertp07 joined #nim |
16:29:08 | rockcavera | Look at this example: https://play.nim-lang.org/#ix=2lyR Is there any way to know which type `a.edata` is storing? |
16:29:26 | leorize | Willyboar: it's ~stream |
16:29:52 | FromGitter | <Willyboar> ~stream |
16:29:53 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
16:30:19 | FromGitter | <Willyboar> thank you @leorize |
16:30:24 | leorize | rockcavera: use the `of` operator |
16:30:38 | leorize | ie. `a.edata` of `EDataString` |
16:31:06 | rockcavera | leorize case? |
16:31:30 | leorize | `if a.edata of EDataString` <- it's an operator |
16:31:33 | * | Hideki_ joined #nim |
16:31:54 | rockcavera | hummm |
16:32:22 | rockcavera | leorize Thanks, I didn't know that operator. |
16:32:24 | rockcavera | :D |
16:33:15 | rockcavera | the best way to access is by casting? |
16:33:17 | leorize | yea, people don't frequently use it, so it doesn't have too much exposure |
16:33:24 | leorize | use conversion |
16:33:33 | leorize | `EDataString(a.edata)` |
16:33:48 | rockcavera | thanks |
16:33:49 | rockcavera | ;) |
16:33:51 | leorize | ^ that's a typed conversion, if the type doesn't match, it will error out |
16:34:18 | Yardanico | ~bridge down for a bit, trying to fix that issue so I can start ircord~ |
16:34:19 | disbot | no footnotes for `bridge`. 🙁 |
16:34:22 | * | FromDiscord quit (Remote host closed the connection) |
16:34:24 | rockcavera | you saved me. I was racking my brain about this. |
16:34:38 | * | FromDiscord joined #nim |
16:34:46 | * | Vladar joined #nim |
16:34:55 | Yardanico | @yardanico 123123123 |
16:35:02 | Yardanico | @KrispPurg 123123213 |
16:35:03 | * | ptdel joined #nim |
16:35:06 | Yardanico | ok good enuf |
16:36:07 | * | dadada joined #nim |
16:36:31 | * | dadada is now known as Guest62821 |
16:37:06 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/709081590784983180/2020-05-10-16-37-48_grim.png |
16:37:12 | Yardanico | ok that works as well |
16:37:12 | * | couven92 joined #nim |
16:39:30 | FromGitter | <bung87> which software using mumble:// protocol? |
16:39:36 | Yardanico | Mumble |
16:39:53 | Yardanico | It's an open source VOIP app |
16:39:58 | Yardanico | for all major platforms |
16:40:06 | * | FromDiscord quit (Remote host closed the connection) |
16:40:10 | Yardanico | wat |
16:40:17 | FromGitter | <bung87> ah like skype? |
16:40:20 | * | FromDiscord joined #nim |
16:40:22 | Yardanico | not really |
16:40:26 | leorize | like teamspeak |
16:40:58 | * | fredrikhr quit (Ping timeout: 272 seconds) |
16:41:03 | * | FromDiscord quit (Remote host closed the connection) |
16:41:05 | FromGitter | <bung87> thanks , I will give a try :) |
16:41:19 | * | FromDiscord joined #nim |
16:42:25 | FromDiscord | <Rika> this is so funky |
16:42:33 | FromDiscord | <Rika> now all your messages arent condensed as fuck |
16:42:52 | Yardanico | don'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:37 | leorize | how come your bridge broke the moment it goes in production? :P |
16:43:53 | Yardanico | leorize: because apparently discord decided to stop sending full member list to it |
16:43:54 | Yardanico | I mean it works |
16:44:02 | Yardanico | but the mention functionality wouldn't really work |
16:49:58 | leorize | gg discord |
16:50:06 | Yardanico | well it can be solved |
16:50:09 | Yardanico | not that hard |
16:50:15 | Yardanico | btw arc is magic |
16:50:53 | * | couven92 is now known as fredrikhr |
16:51:18 | Yardanico | I'm not sure if I'm doing this right but https://play.nim-lang.org/#ix=2lz0 |
16:51:28 | Yardanico | idk how it manages to access textArea from another thread btw :D |
16:51:53 | Yardanico | run with arc/orc and then go to localhost:8080 |
16:52:05 | Yardanico | that's a really good way to make GUIs for async apps and stuff |
16:52:21 | Yardanico | no need to limit your async loop in any way |
16:52:45 | Yardanico | and idk if the global dispatcher part is needed, but I added it just to be safe |
16:52:53 | Yardanico | to create the global dispatcher in the thread where async runs |
16:53:41 | leorize | yea, the default dispatcher can do threads but not well tested iirc |
16:54:22 | leorize | I guess it can access textArea because the underlying object is usually thread-safe (inherited from the native ui toolkit) |
16:54:32 | Yardanico | hmm I guess |
16:54:54 | * | poohman_1 quit (Ping timeout: 272 seconds) |
16:54:59 | Yardanico | otherwise we can just have two threads and use channels |
16:55:05 | Yardanico | to send stuff |
16:55:13 | Yardanico | ah right it wouldn't be that simple |
16:55:18 | dom96 | anyone here used random.sample with the CDF set? |
16:56:47 | leorize | I thought the point of arc is to let us safely share memory between threads? |
16:57:00 | dom96 | oh, I think I get it. You create a list of weights and then you call cumsum on them |
16:57:01 | leorize | and now it seems like that you gotta move the graph to another thread |
16:57:08 | Yardanico | well that too but if it's memory from a native UI toolkit which is not threadsafe all funny things would happen leorize |
16:57:31 | Yardanico | leorize: btw GTK doesn't seem to be threadsafe |
16:57:31 | Yardanico | lol |
16:57:38 | leorize | I was just ranting about how arc doesn't do much :/ |
16:57:42 | Yardanico | ah no it is |
16:57:44 | Yardanico | "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:47 | Yardanico | leorize: it does |
16:57:50 | Yardanico | much better interop |
16:58:00 | Yardanico | ohh |
16:58:05 | Yardanico | "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:26 | leorize | the heap is thread-safe |
16:58:33 | leorize | the objects are not, obviously |
16:58:42 | * | Guest62821 quit (Ping timeout: 256 seconds) |
16:58:48 | leorize | since you're controlling gtk from one thread only, you're fine |
16:58:58 | * | waleee-cl joined #nim |
16:59:46 | Yardanico | well nigui is a good lib :) |
16:59:53 | Yardanico | without it I wouldn't have found a big bug in arc |
17:00:23 | Yardanico | need to do some arc bug hunting again |
17:00:30 | leorize | I'm not sure how better does arc help with our multi threading story |
17:00:48 | leorize | at least now we can move memory around, but we still can't safely share them? |
17:03:58 | livcd | leorize you are alwasy so pessimistic :D |
17:04:44 | * | poohman_1 joined #nim |
17:05:29 | leorize[m] | :P |
17:06:05 | leorize[m] | anyhow, for anyone interested, here's the full coverage map of Nim: https://codecov.io/gh/alaviss/Nim/tree/8f63aa0ef01e14f795d5afd8d368f4999addf103 |
17:06:19 | leorize[m] | this is probably not going to become a part of the CI anytime soon |
17:06:28 | Yardanico | leorize: I saw your branch, but I didn't figoure out how to do it myself without a lot of commits |
17:06:37 | Yardanico | can you explain it with bash commands/nim compiler arguments? :D |
17:06:50 | Yardanico | or if I want to do it for other nim programs |
17:07:06 | leorize[m] | look at `config/nim.cfg` |
17:07:12 | Yardanico | I did |
17:07:16 | leorize[m] | the `@if coverage` section |
17:07:21 | Yardanico | but for me lcov failed and generated empty nim.info |
17:07:47 | Yardanico | lemme try for my lib |
17:07:52 | leorize[m] | well you also need to control where your objects are gonna be generated too |
17:08:27 | leorize[m] | use `--nimcache` to relocate the nimcache to somewhere deterministic |
17:09:57 | Yardanico | ok what do I do after that to generate cool html thing like you did? :P |
17:10:07 | leorize[m] | the coverage system is usable, but I'd say that it's not that good yet |
17:10:22 | leorize[m] | the cool html thingy? you need a codecov account lol |
17:10:30 | leorize[m] | for now use lcov genhtml |
17:10:33 | leorize[m] | it's not pretty but it works |
17:11:56 | leorize[m] | s |
17:11:57 | leorize[m] | so after you ran your program against a bunch of inputs to get the coverage data, run: |
17:13:00 | leorize[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:29 | leorize[m] | `lcov -z -d /nimcache/location` can be used to wipe out all prior data |
17:13:41 | leorize[m] | use that when you recompile your program |
17:14:23 | leorize[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:46 | FromDiscord | <dom96> This is pretty cool actually: https://gist.github.com/dom96/370e3f82a4b818cbd20c183220028748 |
17:15:03 | Yardanico | >cumsummed :P |
17:15:10 | Yardanico | cumulative summed I assume |
17:15:40 | * | Jesin quit (Ping timeout: 246 seconds) |
17:15:56 | leorize[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:44 | Yardanico | leorize: and I again get an empty .info file :( |
17:16:51 | Yardanico | with tons of |
17:16:52 | Yardanico | geninfo: WARNING: cannot find an entry for indexerrors.nim##10b59710a9ebf1c8521c41778e6f416a.gcov in .gcno file, skipping file! |
17:17:15 | Yardanico | with nimcache folder, excessiveStackTrace, linedir, and --coverage options for gcc (basically same as in nim.cfg in your branch) |
17:17:38 | leorize[m] | is your program available somewhere? I give it a go |
17:17:42 | leorize[m] | I can* |
17:17:55 | Yardanico | https://github.com/Yardanico/nim-mathexpr/ just run tests/tests.nim :P |
17:18:45 | leorize | why is your LICENSE and README.md executable btw :P |
17:18:46 | Yardanico | maybe I'm doing something wrong, idk |
17:18:53 | Yardanico | leorize: lol idk :D |
17:18:54 | leorize | even your .gitignore is executable |
17:19:09 | Yardanico | i don't know when I changed that |
17:27:16 | FromDiscord | <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:26 | Yardanico | yes |
17:27:28 | Yardanico | for readability |
17:27:37 | Yardanico | leorize: ahhhhh |
17:27:38 | Yardanico | https://github.com/linux-test-project/lcov/issues/58 |
17:27:41 | disbot | ➥ lcov incompatible with GCC 9.x coverage data ; snippet at 12https://play.nim-lang.org/#ix=2lzc |
17:27:42 | Yardanico | might be due to this |
17:27:44 | Yardanico | I have GCC 9.3 |
17:27:52 | leorize | I have gcc 10 |
17:27:55 | Yardanico | lol |
17:27:58 | leorize | and I just made it work lol |
17:28:09 | Yardanico | what was the issue? |
17:28:18 | FromDiscord | <codic> ah |
17:28:23 | FromDiscord | <codic> also, how do I create a pragma? |
17:28:33 | Yardanico | depends on what you mean by that |
17:28:38 | FromDiscord | <codic> for example if I had |
17:28:55 | FromDiscord | <codic> proc test(){.xyz.}=echo "O" |
17:29:03 | Yardanico | https://nim-lang.org/docs/manual.html#userminusdefined-pragmas |
17:29:11 | FromDiscord | <codic> it'd do something from xyz before the execution |
17:29:12 | FromDiscord | <codic> ah |
17:29:13 | FromDiscord | <codic> thanks |
17:29:17 | FromDiscord | <Rika> userrminusdefined lmao |
17:29:37 | Yardanico | well it's just replacing - with minus |
17:29:41 | FromDiscord | <codic> wait what `They cannot be imported from a module.` |
17:29:45 | FromDiscord | <codic> welp |
17:29:47 | FromDiscord | <Rika> yeah, its just funny |
17:29:51 | Yardanico | @codic the pragma pragmas can't |
17:30:04 | Yardanico | custom pragmas (with macro or template) can |
17:30:04 | FromDiscord | <clyybber> Will be "fixed" |
17:30:05 | FromDiscord | <codic> oof :\ |
17:30:19 | Yardanico | you can create a macro pragma which does your pragma pragma |
17:30:20 | Yardanico | big brain |
17:30:21 | FromDiscord | <codic> with a `template thing() {.pragma.}`? |
17:30:34 | FromDiscord | <Rika> "pragmas made with the pragma pragma" is such a confusing sentence |
17:30:39 | FromDiscord | <Rika> no need to add pragma there |
17:30:44 | Yardanico | not really |
17:30:47 | * | ertp07 quit (Ping timeout: 260 seconds) |
17:32:00 | FromDiscord | <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:24 | Yardanico | not hard |
17:32:40 | FromDiscord | <codic> how would it work though/ |
17:32:45 | Yardanico | just okay |
17:32:57 | FromDiscord | <codic> considering that you can't import pragmas |
17:33:01 | leorize[m] | Yardanico: here's your mathexpr.info: http://ix.io/2lze |
17:33:02 | Yardanico | ??????????????????? |
17:33:06 | FromDiscord | <Rika> it'd rewrite the function to be (before stuff); function stuff; (after stuff) |
17:33:07 | Yardanico | @codic you can |
17:33:09 | Yardanico | just not pragma pragmas |
17:33:50 | FromDiscord | <Rika> `{.pragma ---.}` pragmas are not importable; `macro pragmaname()` are |
17:34:00 | FromDiscord | <codic> Ohhhh |
17:34:04 | FromDiscord | <codic> hold on, testing something |
17:34:05 | Yardanico | try to import it from another file https://play.nim-lang.org/#ix=2lzg |
17:34:12 | Yardanico | leorize: so what was the problem? |
17:34:17 | leorize[m] | Yardanico: and here's the diff that do the magic: http://ix.io/2lzf |
17:34:25 | leorize[m] | nothing really :P |
17:34:27 | leorize[m] | it just works |
17:34:44 | * | solitudesf joined #nim |
17:34:51 | FromDiscord | <Rika> i'm thinking of rewriting memo into something more readable (maybe) for no reason |
17:35:27 | Yardanico | still doesn't work for me XDD leorize[m] |
17:35:32 | Yardanico | something wrong with my compiler or lcov |
17:35:43 | Yardanico | lcov: LCOV version 1.0 |
17:35:45 | leorize | lol what version of gcov are you using? |
17:35:49 | Yardanico | ah gcov? |
17:35:52 | * | Hideki_ quit (Ping timeout: 256 seconds) |
17:36:00 | leorize | I'm on lcov 1.14 |
17:36:07 | Yardanico | lol |
17:36:08 | leorize | what oddly outdated distro are you on? |
17:36:13 | FromDiscord | <codic> Wait what, nim play lang says `/usercode/in.nim(2, 13) Error: undeclared identifier: 'stmt'` |
17:36:22 | Yardanico | because that's from like 2015 |
17:36:30 | FromDiscord | <clyybber> use typed and untyped |
17:36:30 | Yardanico | stmt/expr were before typed/untyped |
17:36:31 | FromDiscord | <clyybber> instead |
17:36:39 | FromDiscord | <codic> alright |
17:36:40 | Yardanico | leorize: not sure either |
17:36:56 | FromDiscord | <clyybber> Yardanico: I think we could get rid of the pragma pragma completely |
17:36:57 | FromDiscord | <codic> but if I have a t of type untyped, how can I call it from within a macro |
17:37:07 | Yardanico | @codic ?????? |
17:37:10 | Yardanico | macros are not templates |
17:37:14 | Yardanico | macros operate on AST and output AST |
17:37:27 | FromDiscord | <codic> Oh lol |
17:37:37 | FromDiscord | <codic> Ohhhhhhhhhhhhh |
17:37:40 | FromDiscord | <codic> That makes much more sense |
17:38:02 | FromDiscord | <codic> or not |
17:38:06 | FromDiscord | <codic> https://play.nim-lang.org/#ix=2lzh |
17:38:20 | FromDiscord | <codic> that throws an error for some reason |
17:38:23 | Yardanico | return untyped |
17:38:35 | Yardanico | ah wait |
17:38:37 | Yardanico | I see |
17:38:37 | FromDiscord | <clyybber> No |
17:38:42 | FromDiscord | <clyybber> Simply don't call t |
17:38:44 | FromDiscord | <clyybber> t is code |
17:38:45 | Yardanico | @codic you're trying to call t |
17:38:53 | FromDiscord | <codic> but then where will it be called if I don't call it? |
17:38:59 | Yardanico | you don't "call" code |
17:39:00 | FromDiscord | <clyybber> yeah |
17:39:01 | FromDiscord | <Rika> t == `echo("hi")` |
17:39:04 | Yardanico | code just get inserted |
17:39:05 | FromDiscord | <clyybber> because you call it inside t |
17:39:14 | FromDiscord | <clyybber> t itself is just a list of statements |
17:39:15 | * | ertp07 joined #nim |
17:39:16 | FromDiscord | <Rika> t() == `echo("hi")()` |
17:39:22 | Yardanico | eyp |
17:39:22 | Yardanico | yep |
17:40:05 | FromDiscord | <codic> alright so assume i remove that. then I just get the output |
17:40:08 | FromDiscord | <codic> before |
17:40:08 | FromDiscord | <codic> after |
17:40:08 | Yardanico | @codic I'd suggest you to read manual a bit :P |
17:40:18 | FromDiscord | <codic> there's no hi in the output :( |
17:40:18 | FromDiscord | <codic> true |
17:40:20 | Yardanico | no you also get "hi" |
17:40:30 | FromDiscord | <codic> nope |
17:40:32 | Yardanico | yes |
17:40:33 | FromDiscord | <codic> https://play.nim-lang.org/#ix=2lzj |
17:40:35 | Yardanico | https://play.nim-lang.org/#ix=2lzk |
17:40:41 | Yardanico | @codic because you REMOVED t |
17:40:42 | Yardanico | t is CODE |
17:40:49 | Yardanico | if you don't insert code, it's not gonna be executed |
17:40:52 | Yardanico | templates are code substitution |
17:40:56 | FromDiscord | <codic> Ohhhhhhhhhhhhhhh I call it as `t` not `t()` |
17:41:00 | Yardanico | you don't call it |
17:41:02 | FromDiscord | <clyybber> its not called |
17:41:03 | Yardanico | you simply insert the code body |
17:41:05 | FromDiscord | <clyybber> its getting inserted |
17:41:07 | FromDiscord | <codic> It's inserted |
17:41:09 | FromDiscord | <clyybber> yeah |
17:41:13 | FromDiscord | <codic> Yeah |
17:41:13 | FromDiscord | <codic> it serves my purpose still :P |
17:41:17 | FromDiscord | <clyybber> :) |
17:42:22 | FromDiscord | <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:32 | FromDiscord | <codic> *reads the manual* |
17:42:39 | Yardanico | because you'll insert the proc itself |
17:42:45 | FromDiscord | <clyybber> because it inserts "proc thing() = echo "0" |
17:43:05 | FromDiscord | <codic> and never calls thing() |
17:43:08 | FromDiscord | <codic> i see |
17:43:10 | FromDiscord | <clyybber> yeah |
17:43:25 | FromDiscord | <clyybber> if you want to make that work, you have to do t() I think |
17:43:30 | Yardanico | leorize[m]: I'm still confused a lot, I install lcov as 1.14 but it shows version 1.0 |
17:43:31 | Yardanico | gcov is 9.3 |
17:43:41 | leorize | which lcov |
17:43:49 | FromDiscord | <codic> @clyybber nope didn't work :\ |
17:43:54 | FromDiscord | <clyybber> let me try |
17:44:00 | FromDiscord | <codic> https://play.nim-lang.org/#ix=2lzm that's mine |
17:44:05 | Yardanico | I tried https://aur.archlinux.org/packages/lcov/ and https://github.com/void-linux/void-packages/blob/master/srcpkgs/lcov/template |
17:44:14 | Yardanico | (i'm on bedrock linux with void linux as main strata and arch additional) |
17:44:16 | * | krux02 joined #nim |
17:44:25 | FromDiscord | <codic> nooooo bedrock instability time |
17:44:30 | Yardanico | wat |
17:44:46 | FromDiscord | <Rika> wat |
17:44:50 | FromDiscord | <codic> having multiple package systems on one |
17:44:56 | FromDiscord | <codic> just... stop it :p |
17:44:56 | Yardanico | it works nice |
17:45:06 | FromDiscord | <codic> ~~until it breaks~~ |
17:45:10 | Yardanico | except it doesn't |
17:45:17 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
17:45:21 | FromDiscord | <codic> maybe for you |
17:45:21 | leorize | it's breaking afaict :P |
17:45:28 | leorize | which lcov <- run that |
17:45:36 | Yardanico | /usr/bin/lcov |
17:45:37 | leorize | see what lcov is the primary |
17:45:48 | leorize | maybe do a readlink on it too |
17:45:50 | Yardanico | that's from void |
17:45:53 | FromDiscord | <codic> What is lcov? |
17:46:05 | Yardanico | readlink /usr/bin/lcov doesn't show anything |
17:46:32 | * | Trustable joined #nim |
17:46:33 | FromDiscord | <clyybber> @codic Oh, yeah, sorry that won't work. You need a macro here |
17:46:58 | FromDiscord | <codic> ah. trying that |
17:47:03 | leorize | Yardanico: well maybe try to disable void one? |
17:47:09 | Yardanico | I tried |
17:47:18 | Yardanico | lemme try building from github |
17:47:29 | FromDiscord | <codic> didn't exactly work |
17:47:31 | FromDiscord | <codic> https://play.nim-lang.org/#ix=2lzo |
17:47:39 | Yardanico | thats |
17:47:39 | Yardanico | not |
17:47:41 | Yardanico | how you use |
17:47:42 | Yardanico | macros |
17:47:42 | FromDiscord | <codic> Yardanico: why not use the aur one? since you have arch access anyways |
17:47:49 | Yardanico | @codic it doesn't work |
17:47:49 | FromDiscord | <codic> :| |
17:47:51 | FromDiscord | <codic> oh |
17:47:52 | Yardanico | the one from github worked |
17:47:54 | Yardanico | directly |
17:47:56 | FromDiscord | <codic> strange |
17:48:18 | FromDiscord | <codic> aur gets the release version from github anyways |
17:48:19 | FromDiscord | <codic> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lcov |
17:48:25 | Yardanico | still |
17:48:32 | Yardanico | and I didn't do latest release |
17:48:34 | FromDiscord | <codic> Aaaanyways why is that not how you use macros? |
17:48:34 | FromDiscord | <codic> oh |
17:48:43 | Yardanico | @codic because they operate on AST |
17:48:46 | FromDiscord | <clyybber> @codic There you go: https://play.nim-lang.org/#ix=2lzp |
17:49:32 | * | luis_ joined #nim |
17:49:40 | FromDiscord | <codic> Ohhhhhh |
17:49:40 | FromDiscord | <codic> the backticks make sense but why t[0]? is t a seq? |
17:49:48 | FromDiscord | <clyybber> its a NimNode |
17:49:50 | Yardanico | read the macros docs really |
17:49:58 | Yardanico | i'm sorry but explaining every single thing is really not okay |
17:50:05 | FromDiscord | <clyybber> and the first child of a proc NimNode is its name |
17:50:05 | Yardanico | read manual and macros docs a bit |
17:50:07 | Yardanico | read tut3 |
17:50:16 | Yardanico | (https://nim-lang.org/docs/tut3.html) |
17:50:37 | FromDiscord | <codic> alright thank you! |
17:51:31 | * | aeverr joined #nim |
17:51:32 | * | aeverr is now known as aEverr |
17:51:41 | Yardanico | ip leaked |
17:51:54 | leorize | bedrock is a weird distro |
17:51:56 | aEverr | hello, i closed discord because discord's very cpu intensive |
17:52:05 | FromDiscord | <codic> "ip leaked" wait whattt |
17:52:07 | Yardanico | leorize: I don't think it's related to bedrock really |
17:52:09 | aEverr | (i'm Rika if you still don't know) |
17:52:15 | Yardanico | i do |
17:52:21 | leorize | aEverr: you can use the name Rika here too |
17:52:22 | FromDiscord | <codic> is it? |
17:52:27 | FromDiscord | <codic> lemme see how much cpu it's taking for me |
17:52:29 | leorize | or does someone already take it lol |
17:52:33 | aEverr | i'm signed in already |
17:52:50 | leorize | /nick Rika |
17:52:51 | leorize | lol |
17:52:54 | aEverr | also "ip leaked"???? |
17:53:02 | FromDiscord | <codic> |
17:53:02 | FromDiscord | <codic> https://cdn.discordapp.com/attachments/371759389889003532/709100699098677309/unknown.png |
17:53:11 | Yardanico | aEverr: yes of course |
17:53:14 | Yardanico | everyone can see your IP |
17:53:19 | Yardanico | if you're connected directly |
17:53:20 | leorize | it's not like leaking your ip is a problem anyway |
17:53:24 | Yardanico | yeah ik |
17:53:34 | * | poohman_1 quit (Ping timeout: 240 seconds) |
17:53:40 | aEverr | i was questioning why you exclaimed that |
17:53:47 | Yardanico | leorize: made it work finally :D |
17:53:59 | luis_ | Hi everyone, where do I set --arc on a nimble file? |
17:54:03 | aEverr | hm, what clients do you use, i dont like kde's default client |
17:54:09 | Yardanico | luis_: can you show your .nimble file? |
17:54:11 | aEverr | --gc:arc |
17:54:11 | Yardanico | aEverr: Quassel |
17:54:14 | leorize | I use weechat |
17:54:17 | FromDiscord | <codic> polari |
17:54:21 | Yardanico | quassel is not an IRC client really |
17:54:29 | FromDiscord | <codic> Or usually a matrix client :P |
17:54:38 | Yardanico | the client is quassel client, the server is irc client and quassel server at the same time |
17:54:40 | FromDiscord | <codic> since it interfaces with irc |
17:54:40 | FromDiscord | <codic> but when i use irc directly https://wiki.gnome.org/Apps/Polari |
17:54:55 | FromDiscord | <codic> i like kde's default but it's too cluttered |
17:55:05 | FromDiscord | <codic> so i remove it on all my installs (which are all kde) |
17:55:14 | luis_ | https://i.imgur.com/McnjWXv.png |
17:55:15 | leorize | weechat is my matrix and irc client :P |
17:55:20 | luis_ | here is my nimble file |
17:55:30 | leorize | luis_: you don't set it in nimble |
17:55:52 | aEverr | weechat aint gui so eeeehhhh |
17:56:10 | leorize | luis_: make a file src/allocator.nim.cfg |
17:56:17 | FromDiscord | <codic> weechat has matrix? |
17:56:18 | luis_ | amazing |
17:56:20 | luis_ | thanks |
17:56:22 | leorize | add gc:arc there |
17:56:32 | FromDiscord | <codic> eh polari rules |
17:56:41 | leorize | codic: yea, as a python plugin |
17:56:49 | FromDiscord | <codic> or gnome fractal (matrix and irc) |
17:56:50 | FromDiscord | <codic> Oh nice |
17:57:01 | leorize | it's more featureful than most other matrix clients btw |
17:57:13 | leorize | the only client to have stable E2E support that's not riot.im |
17:57:17 | aEverr | i dont see how konversation is cluttered |
17:57:29 | aEverr | i'll stay here in konversation |
17:57:37 | liblq-dev | aEverr: have you tried polari? |
17:57:42 | FromDiscord | <codic> idk, last i tried it was honestly the kde 4 days |
17:57:53 | FromDiscord | <codic> like the really late ones when plasma next was about to be released |
17:57:59 | * | PMunch joined #nim |
17:58:06 | FromDiscord | <codic> redownloading it |
17:58:15 | FromDiscord | <codic> alot of kde was cluttered in those days |
17:58:15 | aEverr | its gnome, i dont want to try i |
17:58:28 | liblq-dev | oh no not the K desktop environment |
17:58:29 | FromDiscord | <codic> honestly for some apps gnome does it better than kde |
17:58:30 | FromDiscord | <codic> just some apps |
17:58:49 | Yardanico | leorize: thanks a lot, coverage is really cool stuff :) |
17:58:50 | liblq-dev | and for visual design and layout it's just 10000000x better |
17:58:57 | liblq-dev | KDE is so damn cluttered |
17:59:00 | FromDiscord | <codic> No u |
17:59:03 | FromDiscord | <codic> It's opinionated |
17:59:05 | liblq-dev | it makes my brain hurt |
17:59:06 | Yardanico | we have #nim-offtopic FYI |
17:59:15 | aEverr | clutter is what i like i think |
17:59:17 | FromDiscord | <codic> gnome makes my brain hurt |
17:59:18 | Yardanico | and its bridged to discord too |
17:59:27 | FromDiscord | <codic> for how complex it is to tweak the simplest thing |
17:59:31 | aEverr | i just dont like gnome's ui |
17:59:40 | aEverr | also yeah kde has p. good customization |
17:59:46 | FromDiscord | <codic> ^ |
17:59:56 | liblq-dev | and that's about all it has :) |
18:00:06 | liblq-dev | "pretty good" is not good enough imo |
18:00:21 | liblq-dev | but whatever it's opinionated as codic said |
18:00:28 | FromDiscord | <codic> > "pretty good" is not good enough imo |
18:00:31 | liblq-dev | just use what you like |
18:00:35 | FromDiscord | <codic> but you are kinda implying that gnome has better customization |
18:00:40 | liblq-dev | nope |
18:00:42 | aEverr | i dont see how its cluttered really, but yeah w/e |
18:01:00 | FromDiscord | <codic> that's the beauty of linux |
18:01:00 | liblq-dev | I only said that GNOME has better HIG |
18:01:10 | FromDiscord | <codic> to each their own |
18:01:10 | FromDiscord | <codic> I partially agree |
18:01:14 | Yardanico | guys really |
18:01:17 | Yardanico | #nim-offtopic |
18:01:27 | FromDiscord | <codic> why isn't that mentioned in discord #offtopic btw? |
18:01:30 | aEverr | hey i didnt start it :P |
18:01:48 | leorize | well it doesn't really matter, we can move there :P |
18:02:01 | aEverr | im not interested in participating in that anymore |
18:02:43 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
18:02:45 | leorize | Yardanico: it's cool until it starts showing you all sorts of false negative :P |
18:02:54 | FromDiscord | <codic> Connecting from konversation to see if it's decent |
18:03:03 | * | codic^ joined #nim |
18:03:07 | leorize | go terminal master race |
18:03:11 | codic^ | this actually |
18:03:13 | codic^ | is pretty nice |
18:03:24 | aEverr | what the heck are yall moving to offtopic or not |
18:03:30 | codic^ | sure |
18:03:43 | codic^ | noow how do I join a channel after connection in konversation |
18:03:53 | leorize | /join |
18:03:54 | aEverr | same way you do it in any client |
18:04:00 | codic^ | o |
18:04:13 | codic^ | "[11:04] [Channel] Cannot join channel (+r) - you need to be identified with services - see https://freenode.net/kb/answer/registration" |
18:04:17 | codic^ | How come that's r+ but this isn't |
18:04:28 | codic^ | anyways lemme connect to my irc acc |
18:04:35 | aEverr | maybe spam? dunno\ |
18:04:42 | leorize | yea, was added due to spam |
18:04:46 | codic^ | Oof |
18:05:03 | leorize | this one have to stay -r since beginners join here |
18:05:12 | codic^ | :\ |
18:05:30 | Yardanico | leorize: well just to get a general idea it works pretty well https://i.imgur.com/jEfIw02.png |
18:05:35 | Yardanico | from nimes :D |
18:05:45 | leorize | nice :D |
18:05:48 | Yardanico | mappers thing is true because I only played 1 rom which obviously has only one mapper |
18:06:08 | aEverr | ? wrong channel? |
18:06:16 | codic^ | yay I'm in |
18:06:21 | leorize | aEverr: ? |
18:06:26 | Yardanico | but yeah due to inlining and stuff sometimes lines are red |
18:06:27 | codic^ | In #nim-offtopic |
18:06:30 | Yardanico | even though they were probably called |
18:06:43 | Yardanico | i wonder how does it work that fast |
18:06:45 | Yardanico | with coverage |
18:06:45 | aEverr | leorize: "mappers thing..." where'd this come from |
18:06:47 | FromDiscord | <codic> argh this is gonna take forever |
18:06:51 | Yardanico | aEverr: nimes |
18:06:52 | FromDiscord | <codic> to customize all the colors to dark ones |
18:06:53 | Yardanico | NES mappers |
18:06:56 | aEverr | OH |
18:07:00 | Yardanico | https://wiki.nesdev.com/w/index.php/Mapper |
18:07:04 | leorize | we are talking code coverage lol |
18:07:07 | aEverr | sorry, i lost context i think |
18:07:15 | FromDiscord | <codic> lol |
18:07:19 | leorize | Yardanico: lines are red because of hidden conditionals |
18:07:34 | Yardanico | yeah I'm probably stupid for compiling with -d:danger, lemme try without it |
18:07:51 | FromDiscord | <codic> d:danger ftw! |
18:07:52 | * | codic_ joined #nim |
18:07:56 | codic_ | Test. |
18:07:59 | codic_ | nice |
18:08:03 | leorize | the compiler preserve line info well enough that inlining is not even remotely an issue |
18:08:08 | Yardanico | oh okay |
18:09:01 | leorize | for this kind of coverage, the better the debug info is, the more precise the coverage data |
18:09:04 | Yardanico | it's amazing how fast it is |
18:09:14 | Yardanico | I mean with -d:danger there are no slowdowns |
18:09:42 | leorize | well I do it with the compiler and it only have a 1 min overhead |
18:09:48 | Yardanico | eqdestroy be like https://i.imgur.com/9Ce7usD.png |
18:09:52 | leorize | the largest overhead is in lcov :) |
18:10:11 | Yardanico | I guess it can't understand if functions are being called by function pointers |
18:10:26 | leorize | functions are always called by function pointers |
18:10:30 | Yardanico | ah wait it can |
18:10:36 | Yardanico | i was looking at the wrong file |
18:11:06 | Yardanico | yeah https://i.imgur.com/Jb5LIB4.png |
18:11:28 | Yardanico | cool to find out " 15 0 : of 0x8000..0xBFFF: result = m.cartridge.prg[m.prgBank1*0x4000 + int(adr - 0x8000)]" is never reached :P |
18:11:31 | Yardanico | for super mario bros |
18:11:46 | Yardanico | ah nvm it is |
18:11:50 | Yardanico | line info is a bit off |
18:11:50 | * | codic_ quit (Client Quit) |
18:11:54 | * | codic^ quit (Quit: Konversation terminated!) |
18:11:58 | Yardanico | there weren't any exceptions |
18:12:17 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:13:16 | krux02 | Yardanico, yea line info is always a bit off. |
18:13:53 | aEverr | does nim have a convention for documenting arguments and returns? |
18:13:57 | leorize | we should consider changing Nim's name mangling scheme |
18:14:13 | leorize | aEverr: name them correctly and you avoided 70% of the docs |
18:14:28 | leorize | and no, we don't have a convention for this |
18:14:43 | krux02 | aEverr, nope |
18:14:50 | aEverr | i see, i dont have the issue currently and was just asking |
18:15:08 | krux02 | I prefer to mention them in a full sentence in double backticks |
18:15:12 | Yardanico | me too |
18:15:29 | leorize | same here |
18:15:59 | leorize | is there any reason why Nim use context-dependant name mangling? |
18:16:16 | leorize | debugging tooling would be easier if it was a bit deterministic... |
18:16:17 | krux02 | leorize, not a technical one |
18:16:18 | PMunch | What do you ean? |
18:16:53 | krux02 | nim does not have name mangeling, it hash signature hashing |
18:16:57 | leorize | proc foo() -> foo_<md5 of the environment around the symbol> |
18:17:15 | krux02 | the difference is, name mangeling is revertable, signature hashing is not. |
18:17:53 | krux02 | leorize, the environment is probably because of hygienic templates. |
18:18:32 | leorize | true, traditional mangling scheme wouldn't work here |
18:18:38 | krux02 | a proc is module a should not name clash with the same proc in module b |
18:19:26 | leorize | pascal have name mangling and modules and this has never been an issue |
18:19:31 | leorize | same goes for rust |
18:20:30 | leorize | I guess only Araq can answer this one |
18:20:40 | leorize | probably because it's complicated to implement |
18:21:32 | * | ertp07 quit (Ping timeout: 260 seconds) |
18:22:48 | * | ertp07 joined #nim |
18:22:52 | leorize | well to revert nim signature hashes we currently have to read .ndi, then parse .nim to get the full signature |
18:22:59 | leorize | not 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:25 | FromGitter | <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:33 | disruptek | mangling will be changing. |
19:27:19 | disruptek | it will be a function of past compilation state per the cache. |
19:28:02 | disruptek | but, 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:33 | FromGitter | <awr1> hm |
19:30:15 | FromGitter | <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:41 | FromDiscord | <Yardanico> They have the same name as in Nim |
19:30:52 | FromDiscord | <Yardanico> I mean in the code itself |
19:31:20 | FromGitter | <awr1> so you can't have overloads on DLL exports because there is no mangling? |
19:31:33 | FromGitter | <awr1> (without changing exportc to have specific names) |
19:32:38 | FromGitter | <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:01 | zacharycarter | well if https://github.com/nim-lang/Nim/issues/14260 - is the case - maybe just remove discardable? |
20:09:05 | disbot | ➥ {.discardable.} on object fields causes compile error ; snippet at 12https://play.nim-lang.org/#ix=2lAd |
20:12:42 | zacharycarter | seems 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:51 | FromDiscord | <Rika> maybe he likes it enough to keep it but not change it? dunno, esp. that clyy fixed it on his side... |
20:14:03 | zacharycarter | I think I like discardable better than littering the codebase with `discard` |
20:14:43 | zacharycarter | but 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:24 | disruptek | use a template. |
20:17:45 | zacharycarter | that's not the point |
20:18:00 | disruptek | well, i don't agree that it should be extended. |
20:18:09 | zacharycarter | if I have a bunch of function pointers in a type and I want to discard their result |
20:18:30 | zacharycarter | the typer checker will complain whether I implement the function with discardable or not |
20:18:31 | disruptek | nothing is preventing you from doing this. |
20:18:37 | zacharycarter | from doing what? |
20:18:44 | disruptek | discarding proc results. |
20:19:01 | FromGitter | <Willyboar> dis we missed you |
20:19:03 | zacharycarter | I know nothing is - the point is I wanted to avoid writing `discard` everywhere |
20:19:10 | disruptek | use a template. |
20:19:19 | zacharycarter | I agree nothing is preventing me, I'm being forced to |
20:19:27 | zacharycarter | meh |
20:19:35 | disruptek | you're being forced to be more explicit. |
20:19:37 | zacharycarter | jumping through mroe hoops |
20:19:57 | zacharycarter | I figured the discardable pragma was explicit enough |
20:20:00 | disruptek | willyboar: it's mothers day. |
20:20:03 | zacharycarter | but I guess not |
20:20:33 | disruptek | it's comfort for ffi, and a dubious one at that. |
20:20:53 | zacharycarter | meh |
20:20:53 | FromGitter | <Willyboar> dis yes i know, my kids allday drawing things for my wife |
20:20:58 | disruptek | ie. there's more to debate wrt including it at all, versus including it everywhere. |
20:22:05 | disruptek | mothers day is very important to me; i always double up on hookers and add a hefty tip. |
20:22:10 | disruptek | moms gotta work too, y'know. |
20:22:58 | disruptek | does tsoding's stream have something to teach us? |
20:26:00 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:27:42 | solitudesf | no |
20:28:40 | disruptek | sux. |
20:29:37 | disruptek | maybe we need more graphics. |
20:42:07 | * | exelotl quit (Ping timeout: 260 seconds) |
20:44:27 | disruptek | anyone 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:29 | FromDiscord | <Rika> how experimental are the for loop macros? |
20:54:23 | FromGitter | <sealmove> are arrays initialized to 0's? |
20:54:28 | FromGitter | <sealmove> I know seqs are |
20:55:04 | FromDiscord | <Rika> yes |
20:59:02 | FromGitter | <sealmove> :O nice |
21:03:37 | disruptek | ah, bad docs. |
21:04:05 | liblq-dev | can I `|` a proc type with a concept type? |
21:04:29 | liblq-dev | my intuition tells me it *should* be possible |
21:04:48 | disruptek | here are three pipes: ||| |
21:04:54 | disruptek | try it and if you need more, lemme know. |
21:05:39 | FromGitter | <sealmove> liblq-dev why do you want to try something like this? :D |
21:06:06 | liblq-dev | @sealmove it's… complicated |
21:06:45 | liblq-dev | I 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:06 | FromDiscord | <Rika> is there a better less technical explanation for what bindSym does? |
21:17:29 | liblq-dev | it 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:05 | FromDiscord | <Rika> can i check if a `NimNode` i constructed is valid? |
22:01:34 | FromGitter | <timotheecour> can anyone please merge https://github.com/nim-lang/Nim/pull/14293 to unblock nim CI ? |
22:01:35 | disbot | ➥ diable nimx (CI failure) |
22:15:24 | krux02 | Rika: what do you mean with "is valid"? |
22:15:38 | krux02 | you mean valid syntax? |
22:16:09 | krux02 | I would say, return it from a macro and the compiler will tell you if it's valild. |
22:16:42 | FromDiscord | <Rika> basically something like compiles() i guess? |
22:17:00 | FromDiscord | <Rika> so i can make an if else for a case i'm thinking of |
22:17:05 | disruptek | if you can get some goats in there somehow, that'll help. |
22:17:20 | krux02 | Rika: no there is not. |
22:17:39 | krux02 | you have to construct a valid ast. |
22:17:57 | krux02 | `compiles` is already bad enough and should be avoided. |
22:19:19 | krux02 | The 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:49 | krux02 | if an ast is valid also depends heavily on the context. |
22:20:19 | FromDiscord | <Rika> i see, then i'm gonna need to think of another solutionm |
22:30:44 | * | Guest80851 is now known as dadada |
22:30:55 | dadada | hey my peeps |
22:30:59 | FromDiscord | <Rika> hi |
22:31:04 | dadada | hi Rika |
22:31:10 | krux02 | hi |
22:31:55 | dadada | is 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:27 | krux02 | dadada, there is a pattern that you can use, but it is a bit complicated. |
22:33:38 | krux02 | you 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:54 | krux02 | the inner typed macro will then be able to call getTypeInst. |
22:34:12 | FromDiscord | <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:22 | FromDiscord | <Rika> i'm stuck T_T |
22:34:38 | dadada | krux02: I'll do so :D thanks mate |
22:34:42 | krux02 | btw getTypeInst/getTypeImpl is the substitution for `getType` which should have been declared as deprecated when `getTypeInst` and `getTypeImpl` were introduced. |
22:34:53 | krux02 | np |
22:36:36 | krux02 | Rika: 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:41 | krux02 | I don't know your problem though. |
22:38:11 | FromDiscord | <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:21 | FromDiscord | <Rika> if none, i'd default to something |
22:39:16 | krux02 | well I would have a solution to that, but it doesn't work for `len` because of an implementation detail in system.nim |
22:39:28 | FromDiscord | <Rika> w-what |
22:39:44 | FromDiscord | <Rika> do you mind elaborating? or is it gonna fly over my head if you tried? |
22:39:45 | krux02 | The solution that I already tried was this: |
22:40:32 | krux02 | I declared ``template len(arg: untyped): int = -1`` |
22:40:56 | krux02 | now you have a length for everything and -1 is the fallback if no precise overload exists. |
22:41:10 | krux02 | now calling `len` on anything will work, no exception. |
22:41:12 | krux02 | The problem: |
22:41:18 | FromDiscord | <Rika> cant be used in macros? |
22:41:43 | FromDiscord | <Rika> or rather code generated in macros? 🤔 |
22:42:03 | skrylar[m] | oh yeah. i saw the lineinfo stuff earlier lastnight. should probably use it with my logstuff |
22:42:43 | krux02 | This is the declaration that breaks this: proc len*(x: (type array)|array): int {.magic: "LengthArray", noSideEffect.} |
22:43:01 | FromDiscord | <Rika> why would it break? |
22:43:47 | krux02 | because the argument are two typeclasses combined, overload resolution will pick len(arg: untyped) over len(x: (type array)|array) |
22:44:16 | krux02 | and therefor `len(myarray)` will return -1 |
22:44:36 | krux02 | The only fix is to change system.nim |
22:44:48 | krux02 | you see, the solution isn't perfect. |
22:44:48 | skrylar[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:15 | FromDiscord | <Rika> minor noob question, what would (type array) resolve to? xd |
22:46:44 | krux02 | (type array) is an alternative syntax (that I do not approve) for typedesc[array] |
22:47:14 | FromDiscord | <Rika> thats funky and confusing... |
22:47:27 | krux02 | yea |
22:47:39 | FromDiscord | <Rika> why would two typeclasses be less "precise" than `untyped` itself? |
22:47:47 | FromDiscord | <Rika> i thought untyped was the least precise one can be |
22:47:51 | krux02 | If you care about it. I am currently working on a compiler branch that tries to unify this mess. |
22:48:07 | krux02 | A compiler that only accepts typedesc[array] and not (type array). |
22:48:26 | krux02 | and yes, I thought the same about typedesc. |
22:48:31 | leorize | @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:36 | krux02 | I mean I thought the same about untyped |
22:49:32 | krux02 | that is in my opinion incorrect overload resolution. |
22:49:37 | FromDiscord | <Rika> are there proposals to change it? |
22:49:46 | krux02 | no |
22:50:58 | krux02 | you first have to convince Ar4q though that there is an issue, though. |
22:51:10 | krux02 | twice though |
22:51:40 | krux02 | then you can start on a proposal to fix it. |
22:52:03 | leorize | you can just write an RFC saying how you want things to be improved |
22:52:30 | krux02 | or do that. |
22:53:16 | FromDiscord | <Rika> but i wonder if this is objectively wrong though... no idea |
22:54:17 | krux02 | it is objectively annoying, if you want to make the `templat fallback(arg: untyped)` a real pattern of the language. |
22:55:27 | FromDiscord | <Rika> is there a case where it's *useful* though |
22:55:37 | krux02 | and 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:00 | krux02 | Rika: the pattern? |
22:56:15 | krux02 | Yes the pattern would be useful for many things. |
22:56:17 | FromDiscord | <Rika> i mean, type classes being less precise |
22:56:39 | krux02 | It could replace many use cases of `when compiles(foo(x)): foo(x)` |
22:56:59 | krux02 | or better said, it could replace all use cases of that. |
22:57:11 | krux02 | but only if it works. |
22:59:00 | FromDiscord | <Rika> is the change to system.nim easy? |
22:59:14 | FromDiscord | <Rika> easy to perform i mean |
22:59:15 | leorize | touching system.nim is never easy |
22:59:34 | leorize | well 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:46 | leorize | though usually you just need to make sure that all tests passes |
22:59:59 | krux02 | splitting the proc up into two different procs is trivial. |
23:00:15 | krux02 | and it would solve this very specific problem with len. |
23:00:22 | krux02 | But it does't fix the general problem. |
23:04:55 | FromGitter | <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:55 | FromGitter | <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:57 | disbot | ➥ diable nimx (CI failure) |
23:06:00 | leorize | yes, but it's not urgent anymore |
23:06:31 | leorize | we are disabling a lot of packages and the majority of them don't get re-enabled |
23:06:36 | FromGitter | <timotheecour> sure, urgent is subjective. |
23:07:06 | leorize | at this rate disabling just seem to be "making the result look good" and less "improve ci quality" |
23:07:37 | FromGitter | <timotheecour> (disabled packages means a PR could genuinely break it but we won’t know until it’s re-enabled) |
23:07:55 | leorize | do we ever re enable things? |
23:08:01 | FromGitter | <timotheecour> oh ya, all the time |
23:08:06 | FromGitter | <timotheecour> i do, and others too |
23:08:08 | FromDiscord | <Varriount> timotheecour: I really liked your issue detailing the bugs/problems with the findExe & getAppFilename procedures. |
23:09:33 | krux02 | timotheecour: I think that important packages should not automatically update |
23:10:04 | FromGitter | <timotheecour> what do you mean by update? |
23:10:07 | krux02 | if they stay at a fixed version, their maintainers can't break randomly |
23:10:27 | krux02 | important packages are always on the latest commit. |
23:10:43 | krux02 | that is a problem because the latest commit does not always work. |
23:10:57 | krux02 | and with 100 packages, the propability that something breaks is very high. |
23:11:08 | leorize | we also have the problem that people don't tag releases |
23:11:11 | FromGitter | <timotheecour> I’m aware, that’s exactly what https://github.com/timotheecour/Nim/issues/167 is about |
23:11:14 | disbot | ➥ important_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:33 | FromGitter | <timotheecour> (and that’s what I’m fixing in my branch) |
23:15:55 | * | Hideki_ joined #nim |
23:17:36 | FromGitter | <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:12 | FromDiscord | <Rika> new issue, how do i check if the node isnt an iterator... |
23:20:54 | FromDiscord | <Varriount> Rika: Get the type implementation? |
23:21:26 | FromGitter | <timotheecour> `n.typekind == nnkIteratorTy` or similar |
23:24:05 | FromDiscord | <Rika> @Varriount `ForLoopStmt`s seem to be untyped :/ |
23:25:13 | skrylar[m] | leorize: have been entertaining the idea that this is a good use for branches tho |
23:27:24 | FromGitter | <deech> Is there a compile time conditional that checks for `nimscript`? `when nimvm: ...` doesn't seem to work. |
23:28:23 | leorize[m] | when nimvm works, but it's special |
23:28:23 | leorize[m] | read the docs |
23:28:37 | leorize[m] | it's a weird quirk of nim |
23:28:53 | FromGitter | <timotheecour> `when defined(nimscript)` |
23:29:18 | FromGitter | <timotheecour> `when nimvm:` is always true inside nimscript |
23:30:02 | FromGitter | <timotheecour> but also inside VM for non nimscript code |
23:30:53 | * | abm quit (Read error: Connection reset by peer) |
23:31:23 | FromGitter | <deech> Ah `when defined(nimscript):...` is what I need! |
23:39:47 | * | Jesin quit (Quit: Leaving) |
23:42:34 | * | Jesin joined #nim |
23:48:46 | skrylar[m] | i'm probably the only one with this problem, but eh. https://github.com/nim-lang/Nim/issues/14295 |
23:48:49 | disbot | ➥ [1.2.0] --genDeps:on implicitly turns off compilation ; snippet at 12https://play.nim-lang.org/#ix=2lAO |
23:58:14 | * | ftsf joined #nim |