00:00:11 | skrylar[m] | lol |
00:06:07 | FromDiscord | <dom96> > hmmm, @dom96 i'm working on writing a test case for the PR i put up and i'm curious as to why the test site for nimble is setup to run the binary and interpolate the behavior/output rather than attaching tests to the interfaces directly |
00:06:08 | FromDiscord | <dom96> @queersorceress there are tests that run functions directly too in some files. |
00:07:46 | FromDiscord | <queersorceress> mmm, i noticed that. i was just curious if there was a technical reason why some parts aren't done that way -- as the part i'm attempting to write a test for isn't as easy to do |
00:08:17 | skrylar[m] | https://gist.github.com/Skrylar/7b91149530800117300a54ac59df9b60 dunno if this is how chronicles did it, but neat. |
00:10:06 | * | krux02_ quit (Remote host closed the connection) |
00:12:54 | * | lritter quit (Ping timeout: 256 seconds) |
00:16:51 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
00:35:08 | FromDiscord | <Rika> why could i mutate `self` here but not in the other? |
00:35:08 | FromDiscord | <Rika> can: `proc aProc*[T: X or Y or Z](self: var T)`, cannot: `proc aProc*(self: var X or var Y or var Z)` |
00:38:49 | FromDiscord | <exelotl> hmm maybe its a bug / missing feature? |
00:39:21 | FromDiscord | <Rika> undocumented* feature |
00:40:02 | FromDiscord | <exelotl> feels like the compiler should be able to do some static analysis to know that all possibilities are mutable in the second example |
00:40:28 | FromDiscord | <queersorceress> @dom96 okay, pushed up the test and remaining minor change, PR #800 is ready for final review. |
00:40:56 | skrylar[m] | i thought the syntax was [T: X|Y|Z] |
00:41:14 | FromDiscord | <Auriel> what about |
00:41:20 | FromDiscord | <Rika> `|` and `or` is interchangeable |
00:41:30 | FromDiscord | <Auriel> ```nim |
00:41:30 | FromDiscord | <Auriel> |
00:41:30 | FromDiscord | <Auriel> type |
00:41:30 | FromDiscord | <Auriel> A = object |
00:41:30 | FromDiscord | <Auriel> B = object |
00:41:30 | FromDiscord | <Auriel> C = A or B |
00:41:31 | FromDiscord | <Auriel> |
00:41:31 | FromDiscord | <Auriel> proc test(t: var C) = discard |
00:41:32 | FromDiscord | <Auriel> ``` |
00:41:49 | skrylar[m] | if you paste in to discord, the irc and matrix users will lynch you |
00:41:50 | FromDiscord | <Auriel> oh sorry forgot to put on pastebin |
00:41:55 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2lcy here |
00:41:56 | FromDiscord | <exelotl> Oh yeah that's a nice solution |
00:41:57 | FromDiscord | <Auriel> 3am here |
00:42:17 | FromDiscord | <Rika> i still prefer generics |
00:42:30 | FromDiscord | <Rika> that other one's indirect here |
00:42:54 | FromDiscord | <exelotl> It's too late auriel, the velociraptors have already been released |
00:43:40 | FromDiscord | <Rika> the helicopters have been dispatched |
00:46:13 | FromDiscord | <Auriel> maybe try var A or B looks like its compiles successfully on playground |
00:46:59 | FromDiscord | <Rika> definitely successful to me |
00:46:59 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/708117710223179786/unknown.png |
00:47:09 | FromDiscord | <Auriel> nope |
00:47:15 | FromDiscord | <Auriel> var X or Y |
00:47:34 | FromDiscord | <Rika> mmmmmm |
00:47:34 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/708117861117329428/unknown.png |
00:47:46 | FromDiscord | <treeform> @mratsim more from just use threads camp: https://news.ycombinator.com/item?id=23107945 |
00:58:29 | * | ptdel joined #nim |
01:01:21 | Yardanico | btw guys os any is awesome |
01:01:28 | Yardanico | nim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe"=test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl" --passL:"-target x86_64-linux-musl" -r hello.nim |
01:01:32 | Yardanico | the binary after stripping is 20kb |
01:01:35 | Yardanico | (hello world) |
01:01:51 | Yardanico | with no some panicoverride tricks |
01:02:53 | Yardanico | btw is it intended that nim doesn't allow for --clang.exe to contain spaces? |
01:03:11 | Yardanico | it runs the command as 'zig cc' command |
01:03:17 | Yardanico | notice the quotes |
01:07:54 | skrylar[m] | it looks like you have an equals sign transposed in that |
01:08:07 | skrylar[m] | --clang.exe"=test.sh" |
01:11:17 | * | ertp07 quit (Read error: Connection reset by peer) |
01:12:24 | * | ertp07 joined #nim |
01:12:24 | * | dadada quit (Ping timeout: 256 seconds) |
01:17:06 | FromDiscord | <Yardanico> Well yeah that's not the problem here though :) |
01:17:38 | FromDiscord | <Yardanico> I mean if you have --clang.exe="zig cc" it won't work |
01:28:04 | * | fredrikhr quit (Ping timeout: 246 seconds) |
01:33:23 | FromGitter | <deech> Has the Nim compiler gotten noticeably slower for anyone else? I'm compiling from HEAD. |
01:37:19 | FromDiscord | <Varriount> @deech might be due to https://github.com/nim-lang/Nim/issues/14179 |
01:39:27 | FromDiscord | <Varriount> Deech: What flags did you compile the compiler with? |
01:39:43 | Yardanico | yeah the nim compiler itself (the nim compilation step) is pretty fast usually |
01:40:04 | Yardanico | it takes ~4-4.5s for me to do the nim compilation step for the compiler |
01:42:39 | Yardanico | oh actually with LTO the binary gets to 16kb |
01:42:40 | * | ertp07 quit (Read error: Connection reset by peer) |
01:42:44 | Yardanico | that's without any panicoverride stuff :) |
01:42:50 | Yardanico | nim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe="test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-ta |
01:42:50 | Yardanico | rget x86_64-linux-musl -flto" -r hello.nim |
01:42:53 | * | ertp07 joined #nim |
01:42:58 | Yardanico | test.sh is just calling "zig cc" |
01:43:05 | Yardanico | and we get a fully static 16kb binary |
01:44:07 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:45:58 | * | chemist69 joined #nim |
01:46:16 | FromGitter | <deech> Varriount: just the default `nim c ...`, granted I'm doing a bunch of compile time stuff in the VM but the same code has become noticeably. |
01:47:56 | FromGitter | <deech> Compiler was built with `./koch boot -d:release`. |
01:48:28 | Yardanico | is there a way I can make nim insert my compiler flags after nim's own compiler flags? |
01:48:40 | Yardanico | for c |
01:48:42 | Yardanico | compiler |
01:59:15 | zacharycarter | just blame disruptek for any slowdowns in compiliation times |
01:59:30 | zacharycarter | ic actually means incrementally slower compliation |
02:04:54 | FromDiscord | <Rika> ic means inhibited compilation |
02:06:38 | skrylar[m] | hey writing compilers sucks :^ |
02:07:04 | Yardanico | so I can't go any lower than 16kb I guess, can't think of any other tricks |
02:07:12 | Yardanico | without changing the nim source code or using --os:standalone ;) |
02:07:19 | FromDiscord | <Rika> there's even a whole branch of science for compilers! |
02:07:26 | Yardanico | nim c --gc:arc -f --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --clang.exe="test.sh" —clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim |
02:07:30 | Yardanico | that's the current command |
02:08:29 | FromDiscord | <Rika> what does the posix define do? |
02:08:44 | Yardanico | so that osalloc.nim uses posix's page allocation APIs |
02:09:04 | Yardanico | nim allocator doesn't use malloc, it uses page allocation by the OS directly (unless you pass -d:useMalloc) |
02:09:55 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/lib/system/osalloc.nim#L194 |
02:10:05 | Yardanico | posix define also does other things in other places |
02:14:25 | Yardanico | wait what is going on, when I use same compiler flags in nim.cfg the binary is bigger |
02:14:25 | Yardanico | wat |
02:15:40 | * | dddddd quit (Ping timeout: 246 seconds) |
02:17:38 | skrylar[m] | wellsee you made it do more work by having to read another file :^ |
02:18:02 | Yardanico | skrylar[m]: I think the issue is that when I pass options directly they're the top priority (?) and otherwise nim reads config files first or something |
02:18:07 | Yardanico | C command seems to be the same |
02:18:14 | Yardanico | I mean c compiler invocation |
02:18:23 | skrylar[m] | it does read other config files (theres a config hint for that) |
02:18:29 | Yardanico | yeah i know |
02:18:40 | Yardanico | but the binary size becomes 48kb instead of 24kb (before stripping) |
02:18:46 | Yardanico | with literally same arguments in cmdline/nim.cfg |
02:19:09 | skrylar[m] | is it actually using the cfg file from there? |
02:19:12 | Yardanico | yes |
02:19:18 | skrylar[m] | oh. |
02:19:32 | Yardanico | with direct options: CC: stdlib_io.nim: test.sh -c -w -target x86_64-linux-musl -flto -Os -I/home/dian/.nim/lib -I/home/dian/Projects/data -o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c.o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c |
02:19:38 | Yardanico | with cfg: CC: stdlib_io.nim: test.sh -c -w -target x86_64-linux-musl -flto -Os -I/home/dian/.nim/lib -I/home/dian/Projects/data -o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c.o /home/dian/.cache/nim/hello_r/stdlib_io.nim.c |
02:19:43 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:20:19 | Yardanico | seems like in this case it doesn't apply -d:danger for some reason |
02:21:52 | * | muffindrake joined #nim |
02:22:00 | Yardanico | if I put all switches for disabling checks which are defined for danger to nim.cfg it has the same size |
02:23:10 | skrylar[m] | sounds like a bug |
02:27:16 | Yardanico | skrylar[m]: It's also rather easy to replicate |
02:27:36 | Yardanico | try to do "nim c -d:danger yourfile.nim" and then "nim c yourfile.nim" when you have -d:danger in your nim.cfg |
02:27:54 | Yardanico | and compare binary sizes :) |
02:30:38 | skrylar[m] | https://pastebin.com/ZAvu0Lis |
02:30:46 | Yardanico | :DD |
02:30:49 | Yardanico | really weird |
02:31:08 | Yardanico | guess -d:danger doesn't define -d:release if it's in a config so files which use defined(release) don't get it? |
02:31:10 | Yardanico | or something like that |
02:32:45 | Yardanico | https://github.com/nim-lang/Nim/issues/14272 |
02:34:18 | Yardanico | seems like -d:danger doesn't define -d:release when put in a config file lol |
02:36:07 | Yardanico | https://forum.nim-lang.org/t/5878 is related |
02:36:11 | Yardanico | I thought it was fixed since then lol |
02:37:03 | Yardanico | my life is a lie now if I ever compiled apps with -d:danger in config files /s |
02:37:15 | zedeus | hm I got hello world down to 12kb |
02:37:21 | Yardanico | zedeus: with what? |
02:37:29 | Yardanico | do you link statically? |
02:37:38 | Yardanico | In my case 16kb was static linking with musl |
02:37:48 | zedeus | ah no that was dynamic |
02:38:03 | zedeus | 28kb static |
02:38:09 | skrylar[m] | taped on the replication script |
02:38:30 | Yardanico | skrylar[m]: you forgot main.nim :D |
02:38:42 | Yardanico | and what is test-line |
02:38:48 | Yardanico | ah I see main.nim sorry |
02:38:57 | Yardanico | ah sorryI'm stupid |
02:38:59 | Yardanico | I can't read bash |
02:39:27 | skrylar[m] | bash may have been invented by satan's toilet paper, but if i put a fish script up there nobody will know what to do with it |
02:39:40 | * | theelous3 quit (Ping timeout: 256 seconds) |
02:39:50 | Yardanico | hey I use fish |
02:40:10 | Yardanico | updated the title again btw |
02:40:12 | skrylar[m] | then you are doing it right ><^> |
02:41:02 | skrylar[m] | mu looks like an average vm with a couple type hints bolted on |
02:41:20 | Yardanico | well nim vm isn't exactly bad either :P |
02:41:24 | Yardanico | it's register based |
02:41:29 | skrylar[m] | which i guess is nice since some of those hints are for gc trace points; wasm is like .. hey we know this is to be used with a gc language but whats a gc |
02:42:20 | zedeus | with your command I get 14464 bytes without zig |
02:42:28 | Yardanico | zedeus: with clang or ? |
02:42:37 | Yardanico | I mean I didn't count the bytes |
02:42:45 | zedeus | same command but I removed the test.sh args |
02:42:50 | zedeus | 16kb |
02:42:54 | Yardanico | static? |
02:42:57 | Yardanico | with -static or how? |
02:43:17 | zedeus | nim c --gc:arc --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim |
02:43:21 | Yardanico | it's actually 13312 for me |
02:43:24 | Yardanico | with zig |
02:44:12 | Yardanico | sorry, after stripping |
02:44:21 | Yardanico | (strip -s) |
02:44:30 | Yardanico | before that it's 20768 |
02:44:50 | Yardanico | ah I know how to reduce it even further |
02:45:11 | Yardanico | -d:noSignalHandler |
02:45:20 | Yardanico | after stripping I get 11832 |
02:46:45 | Yardanico | "strings" gives almost no strings |
02:47:17 | zedeus | hmm that doesn't seem to do anything for me |
02:47:17 | Yardanico | I only see elf section names, c compiler/linker versions, hello world itself, "out of memory" and "/dev/null" |
02:47:23 | Yardanico | weird |
02:47:36 | Yardanico | it's supposed to remove default signal handlers |
02:48:31 | Yardanico | I'm using nim c --gc:arc -f --os:any -d:posix -d:danger --opt:size --cc:clang --panics:on -d:noSignalHandler --clang.exe="test.sh" --clang.linkerexe="test.sh" --passC:"-target x86_64-linux-musl -flto" --passL:"-target x86_64-linux-musl -flto" -r hello.nim |
02:49:52 | * | zacharycarter quit (Ping timeout: 256 seconds) |
02:50:42 | zedeus | hmm it goes from 14464 to 14360, so it's doing something |
02:50:50 | Yardanico | maybe different compiler options and stuff :0 |
02:50:55 | * | jds_dizzy_ joined #nim |
02:50:56 | Yardanico | also zig embeds clang/lld 10 |
02:51:38 | Yardanico | I wonder if you can even know the binary was made in nim at this point :D |
02:51:45 | Yardanico | literally nothing in the binary points to it |
02:52:45 | jds_dizzy_ | Any resources on asyncnet other than documentation. Struggling |
02:52:48 | zedeus | got 12664 now |
02:53:05 | zedeus | using --cc:zig (behind devel by a few commits so it's still there) |
02:53:14 | Yardanico | zedeus: you can get around ~150 bytes smaller but it'll change source code |
02:53:15 | FromGitter | <sealmove> Guys, do you know any bitstream implementation? |
02:53:17 | skrylar[m] | didn't there used to be part of the manual about custom arenas on pointers |
02:53:22 | Yardanico | proc start {.exportc: "main"} = echo "Hello world" |
02:53:27 | Yardanico | and add --noMain |
02:53:37 | skrylar[m] | @sealmove a bit too vague |
02:54:08 | zedeus | woah |
02:54:13 | zedeus | 5840 |
02:54:40 | Yardanico | wat |
02:54:42 | Yardanico | bruh |
02:54:46 | Yardanico | how even? |
02:54:57 | FromGitter | <sealmove> I need procs for read/writing arbitary number of bits. It should be initializable from an `seq[byte]`. |
02:56:24 | skrylar[m] | ah no i don't know of one |
02:58:03 | FromGitter | <sealmove> Trying to implement one gave me headache |
03:00:36 | skrylar[m] | lidgren has one (C#) and its uh, a bit counter and a little buffer int |
03:00:36 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
03:01:39 | FromGitter | <sealmove> Yeah, I want something like this, can you link it? |
03:02:21 | skrylar[m] | https://github.com/lidgren/lidgren-network-gen3/blob/master/Lidgren.Network/NetBuffer.Write.cs |
03:03:12 | FromGitter | <sealmove> thanks |
03:08:46 | FromGitter | <sealmove> So should I inherit stdlib's `Streams`? |
03:09:32 | FromGitter | <sealmove> Docs say something about *overriding* proc fields: https://nim-lang.org/docs/streams.html#StreamObj |
03:09:50 | FromGitter | <sealmove> How does this work in Nim? |
03:10:01 | FromGitter | <ynfle> (https://files.gitter.im/nim-lang/Nim/3gQA/Screen-Shot-2020-05-07-at-10.40.27-PM.png) |
03:10:10 | FromGitter | <ynfle> Can anyone help me with this? |
03:10:16 | * | Condor quit (Ping timeout: 256 seconds) |
03:10:18 | Yardanico | show the error |
03:10:25 | Yardanico | ah I see |
03:10:29 | FromGitter | <ynfle> I'm getting `Error: undeclared identifier: 'JsonTestResult'` |
03:10:30 | Yardanico | ah no |
03:10:42 | Yardanico | @ynfle you declared it as JsonTestReslt |
03:10:46 | Yardanico | the ide even highlights that for you |
03:11:37 | FromGitter | <ynfle> @Yardanico 45 minutes of debugging at least |
03:11:39 | FromGitter | <ynfle> Thx |
03:11:42 | Yardanico | wat |
03:11:53 | skrylar[m] | @sealmove think its more that you need to store a bit offset and if its 8 you can just copy to the output stream, if its not 8 you have to sit and bit twiddle |
03:13:41 | * | Tlongir quit (Remote host closed the connection) |
03:14:07 | FromDiscord | <Rika> sealmove: overriding here means that there's a default implementation stored in the object, and you can change that in the initialization of the object, so its more like "changing the function the actual flush procs use" |
03:14:30 | FromDiscord | <Rika> its not static overriding but its what we got |
03:22:01 | jds_dizzy_ | Any resources on asyncnet other than doc |
03:22:55 | Yardanico | what do you exactly want to know? |
03:24:55 | jds_dizzy_ | Get a better understanding of how the asynchronous-ness works so I can control it, rn I’m trying to set up a basic client server app and can’t seem to get the data to back to the client |
03:25:10 | FromDiscord | <Rika> yardanico the bot died i assume |
03:25:26 | Yardanico | it restarts itself |
03:25:31 | FromDiscord | <Rika> i know |
03:25:45 | FromDiscord | <Rika> its a notification so you can check what triggered the crash |
03:26:32 | FromGitter | <sealmove> Rika: But what's an example? How do I make a custom stream that uses the interface? I have never used interfaces in Nim. |
03:26:47 | Yardanico | @sealmove inherit your stream type from Stream |
03:27:04 | Yardanico | and assign procs to your implementations on your stream object creation (e.g. in newStreamType() proc) |
03:27:16 | Yardanico | you can always check src of the stdlib |
03:27:17 | Yardanico | it's not hard |
03:27:29 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L1188 |
03:27:34 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/streams.nim#L1255 |
03:28:19 | FromGitter | <sealmove> oh nice! thanks |
03:31:47 | skrylar[m] | humm was thinking about state changes in gl and probably need an object to hold target state and do comparisons .. then realized probably should just have it store the hash instead .. bleh. should finish the xxhash port i guess |
03:31:49 | FromGitter | <sealmove> So I guess I should implement these procs *and* also add new ones for working with bits |
03:38:16 | * | ptdel joined #nim |
03:39:15 | * | zacharycarter joined #nim |
03:42:22 | * | rockcavera quit (Remote host closed the connection) |
03:43:32 | * | zacharycarter quit (Ping timeout: 246 seconds) |
03:50:37 | FromDiscord | <codic> What's `long` in nim? |
03:50:44 | FromDiscord | <codic> c_long? |
03:52:20 | FromGitter | <bung87> clong |
03:52:55 | * | jwm224 quit (Quit: WeeChat 2.9-dev) |
03:53:44 | FromDiscord | <codic> seems so |
03:53:50 | FromDiscord | <codic> how do I initialize a clong? |
03:53:51 | Yardanico | @bung86 c_long == clong :P |
03:54:02 | Yardanico | !eval var test: clong = 5; echo test |
03:54:05 | NimBot | 5 |
03:54:06 | FromGitter | <bung87> how to write proc param : TypeA or Typeb in Nim? |
03:54:07 | Yardanico | voila |
03:54:15 | Yardanico | bung87 typeB |
03:54:18 | FromGitter | <bung87> Yardanico ok I use to using clong |
03:54:21 | Yardanico | or wait |
03:54:24 | Yardanico | I don't understand you |
03:54:26 | Yardanico | you mean return type? |
03:54:40 | FromGitter | <bung87> params type (A|B) |
03:54:52 | * | jwm224 joined #nim |
03:54:53 | Yardanico | can you post full proc definition |
03:54:54 | * | thomasross quit (Ping timeout: 240 seconds) |
03:54:55 | zedeus | proc foo(bar: TypeA | TypeB) |
03:55:05 | * | jds_dizzy_ quit (Ping timeout: 246 seconds) |
03:55:05 | FromDiscord | <codic> i did `var a:clong = 10295019204912 |
03:55:05 | FromDiscord | <codic> ` |
03:55:16 | FromDiscord | <codic> and got `stdin(12, 15) Error: type mismatch: got <int64> but expected 'clong = int' |
03:55:16 | FromDiscord | <codic> ` |
03:55:19 | FromGitter | <bung87> @zedeus it's supported? |
03:55:23 | FromDiscord | <codic> clonglong maybe |
03:55:24 | zedeus | yes |
03:55:54 | FromGitter | <bung87> I havnt try before, let me try this |
03:56:06 | Yardanico | @codic var a = clong(10295019204912) |
03:56:21 | zedeus | https://nim-lang.github.io/Nim/manual.html#generics-type-classes |
03:56:50 | FromDiscord | <codic> I got it with clonglong |
03:56:51 | FromDiscord | <codic> but new problem |
03:56:53 | FromDiscord | <codic> 41241241241241241241243 |
03:56:56 | FromDiscord | <codic> doesnt fit in clonglong |
03:56:57 | FromDiscord | <codic> XD |
03:57:03 | Yardanico | what's your use case? |
03:57:07 | FromDiscord | <codic> I wouldnt suppose y'all have a clonglong? |
03:57:13 | FromDiscord | <codic> Make that three longs |
03:57:18 | Yardanico | you can use https://github.com/status-im/nim-stint |
03:57:21 | FromDiscord | <codic> my use case is `41241241241241241241243 ^ 10295019204912` |
03:57:27 | Yardanico | ehm |
03:57:36 | FromDiscord | <Rika> thats humongous |
03:57:43 | FromDiscord | <Rika> ^ == **? or `or? |
03:57:47 | FromDiscord | <Rika> *`or` |
03:57:47 | Yardanico | that's +inf |
03:57:51 | Yardanico | no need to compute |
03:57:53 | Yardanico | it's just +inf |
03:58:06 | Yardanico | unless you spend days and use bignums :) |
03:58:28 | FromDiscord | <codic> :| |
03:58:48 | FromGitter | <bung87> @ zedeus ok I get it , it should be write in generic part |
03:59:12 | FromDiscord | <codic> according to someone c can have `long long long long long long` (as many longs as ya want) |
03:59:18 | FromDiscord | <codic> any equivalent in nim? |
03:59:31 | Yardanico | @codic no |
03:59:32 | Yardanico | that won't work |
04:00:06 | Yardanico | and you don't know how many longs you'll need |
04:00:08 | Yardanico | and you'll need A LOT |
04:00:31 | FromDiscord | <codic> won't even work in c? |
04:00:55 | FromDiscord | <codic> dammmn |
04:00:56 | Yardanico | you understand that expression needs ~1.3396525e+14 digits? |
04:01:01 | Yardanico | that's 1.3 * 10 ^ 14 |
04:01:05 | FromDiscord | <codic> Yeah |
04:01:11 | FromDiscord | <codic> I was just trying to push the limits of nim |
04:01:14 | Yardanico | that is MANY longs |
04:01:17 | Yardanico | like realllllllllyyyyyyyyyyyyyyyyyyyyy a lot |
04:01:19 | FromDiscord | <codic> See how long it takes to calculate |
04:01:20 | Yardanico | you can't do it in C either |
04:01:27 | Yardanico | unless you do you own types |
04:01:37 | Yardanico | try to use gmp |
04:02:01 | FromDiscord | <codic> A friend has challenged himself to try it in c lol |
04:02:01 | FromDiscord | <codic> isn't that the gnu something? |
04:02:13 | Yardanico | it is, so? |
04:02:16 | FromDiscord | <codic> Gnu multi precision |
04:02:17 | Yardanico | https://gmplib.org/ |
04:02:19 | FromDiscord | <codic> Yeah, was just curious |
04:02:33 | Yardanico | "arbitrary precision arithmetic" that's what you need |
04:02:36 | Yardanico | gmp is the fastest out there really |
04:02:41 | FromDiscord | <Rika> you're probably gonna need a certain amount of powerr, perhaps a low end super computer to calc that |
04:02:41 | Yardanico | it's hand optimized |
04:02:48 | Yardanico | yeah |
04:02:50 | nisstyre | I'm getting this error with Nim 1.0.99 https://gist.github.com/weskerfoot/bd452f04e88ac8be4e3fcc536d664443 |
04:02:52 | Yardanico | you also might want to parallelize |
04:02:58 | Yardanico | nisstyre: what is that nim version? |
04:03:03 | Yardanico | you should either use 1.0.6 or 1.2.0 |
04:03:07 | Yardanico | 1.2.0 is much preferred |
04:03:10 | Yardanico | 1.0.99 is not stable |
04:03:20 | nisstyre | Yardanico: ah, ok, maybe that's why |
04:03:27 | FromDiscord | <codic> |
04:03:27 | FromDiscord | <codic> https://cdn.discordapp.com/attachments/371759389889003532/708167154150932621/unknown.png |
04:03:33 | FromDiscord | <codic> can irc view images? |
04:03:37 | Yardanico | yes |
04:03:42 | Yardanico | but he's wrong anyway |
04:03:52 | Yardanico | it won't "just work", there's no c compiler which supports that |
04:04:01 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
04:04:09 | nisstyre | Yardanico: yep I had nim-git installed for some reason |
04:04:11 | nisstyre | can't remember why |
04:04:44 | Yardanico | and unsigned long long int var is MUCH smaller than what you need |
04:05:29 | FromDiscord | <Rika> any calculator would output `infinity` for that number |
04:05:34 | FromDiscord | <Rika> any regular calculator, rather |
04:05:50 | FromDiscord | <Rika> where did you source that number anyway |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:28 | FromDiscord | <codic> smashing my keyboard |
04:06:30 | FromDiscord | <codic> :p |
04:06:42 | * | supakeen joined #nim |
04:06:45 | nisstyre | Yardanico: still getting it with nim 1.2.0 installed though |
04:06:47 | FromDiscord | <codic> anyways if ruby counts as a calulator `=> Infinity` |
04:06:53 | Yardanico | nisstyre: have a code to reproduce? |
04:06:54 | FromDiscord | <codic> if python counts as a calculator, it just hangs |
04:07:03 | Yardanico | @codic because python has bignum support builtin |
04:07:05 | Yardanico | it doesn't hang |
04:07:08 | Yardanico | it actually starts to calculate that |
04:07:11 | nisstyre | Yardanico: yes, I do, one second |
04:07:30 | FromDiscord | <codic> oh |
04:07:34 | FromDiscord | <codic> well |
04:07:50 | FromDiscord | <codic> I ctrl c out of it anyways |
04:07:53 | FromDiscord | <codic> ol |
04:07:55 | FromDiscord | <codic> *lol |
04:08:15 | nisstyre | Yardanico: sorry I don't have a smaller test case, https://github.com/weskerfoot/Nimwin but it was this commit that's causing issues https://github.com/weskerfoot/Nimwin/commit/82fd585396327c1c3f4afa512f13a8b9e0e2d555 |
04:08:58 | nisstyre | I can try to come up with a smaller test case later I suppose |
04:10:19 | Yardanico | yeah I can reproduce it |
04:10:58 | Yardanico | it's from /home/dian/Projects/data/Nimwin/src/nimwin.nim line 95-97 just as expected |
04:11:20 | Yardanico | as a fix you can do if anyIt(toSeq(getProperties(display, win.win)), it in ignored): intead |
04:11:23 | Yardanico | instead* |
04:11:25 | Yardanico | I'll try to reproduce it |
04:11:32 | Yardanico | with a shorter example |
04:11:33 | nisstyre | Yardanico: I'll try that, thanks |
04:11:36 | Prestige | Woo I just made a lot of progress on my wm |
04:11:46 | FromGitter | <bung87> `Node | null` == `Node | jsNull` ? or should I using nil? |
04:12:15 | FromGitter | <bung87> when transpile ts 2 nim |
04:12:28 | Yardanico | you didn't understand something though |
04:12:33 | Yardanico | nim's generics are compile-time |
04:12:35 | Yardanico | not runtime |
04:12:44 | Yardanico | what does "Node | null" mean in ts? |
04:13:01 | FromGitter | <bung87> variable a could be Node or null |
04:13:11 | zedeus | null is not a type |
04:13:37 | Yardanico | @bung87 in Nim you'll be able to just pass Node as nil if it's a ref object |
04:13:38 | Yardanico | or a pointer |
04:14:53 | FromGitter | <bung87> ok then I declare it as ref Node seems fit the use case |
04:15:08 | Yardanico | you can have it as "Node = ref object" |
04:17:32 | FromGitter | <bung87> that's make more complicated, I should manage whole project Node param, choose between Node or ref Node |
04:17:39 | Yardanico | no? |
04:17:44 | Yardanico | Just use ref object everywhere then I guess |
04:18:14 | Yardanico | anyway TS doesn't have user-definable value types right |
04:18:24 | Yardanico | so you'll probably have to use "Node = ref object" everywhere |
04:20:49 | FromGitter | <bung87> you mean declare it as variable? not `type` ? |
04:20:55 | Yardanico | no? |
04:20:59 | Yardanico | "type Node = ref object" |
04:21:47 | FromGitter | <bung87> ok let me check the Node used in ts |
04:21:59 | Yardanico | I doubt ts has real value types (which can be defined by users) |
04:22:02 | Yardanico | so it's always references |
04:23:20 | FromGitter | <bung87> https://github.com/google/incremental-dom/blob/master/src/core.ts |
04:23:49 | Yardanico | "let currentNode: Node | null = null;" for nim you'll have your "Node" type as " ref object" |
04:23:54 | FromGitter | <bung87> it's also everywhere in this module, `type Node = ref object` seems fine |
04:24:03 | Yardanico | and initially declare it as var currentNode: Node = nil |
04:24:30 | FromDiscord | <Rika> @codic just for fun, i started pypy up and made it calculate the number you gave |
04:24:43 | Yardanico | I doubt pypy will have much benefit in this, but ok |
04:24:44 | FromDiscord | <Rika> it's probably going to take literal days or weeks |
04:24:46 | Yardanico | try with julia |
04:24:54 | FromDiscord | <Rika> ill spin that up too then |
04:25:03 | FromGitter | <bung87> ok that's simple now, no generic required , I can using simple tranpile logic. |
04:25:29 | FromDiscord | <Rika> damn it openblas and blas are conflicting, is openblas a drop in replacement? |
04:25:33 | Yardanico | ah nvm |
04:25:37 | Yardanico | big"41241241241241241241243" ^ big"10295019204912" |
04:25:43 | Yardanico | gmp: overflow in mpz type |
04:25:49 | Yardanico | so even gmp gives up |
04:26:03 | FromDiscord | <Rika> dude, where the hell did this number even come from |
04:26:17 | Yardanico | lemme calculate how many bits you need to store it |
04:26:50 | FromDiscord | <KingDarBoja> Did anyone said Julia? 😄 |
04:27:38 | Yardanico | so if my calculation are right |
04:27:47 | Yardanico | you'll need ~3.592342911249377062174420113931943895280048793985194139447965374298833127476692e+39133899436317 bits to store that number |
04:27:54 | Yardanico | 3.6 * 10 ^ 39133899436317 basically |
04:28:02 | FromDiscord | <Rika> I CANT EVEN SIGTERM PYPY |
04:28:53 | FromDiscord | <Rika> accidentally sigkill'ed yakuake... LMAO |
04:34:59 | * | nsf joined #nim |
04:37:12 | * | Senketsu joined #nim |
04:49:47 | Yardanico | nisstyre: I reproduced it to minimal example, I'll also run git bisect (because it seems to work on 0.19.6 and broke in 0.20.0) and submit the issue, thanks |
04:50:14 | leorize | I got some basic code coverage stuff working for Nim |
04:50:20 | nisstyre | Yardanico: sounds good, thanks for the help |
04:55:07 | * | ertp07 quit (Ping timeout: 244 seconds) |
04:55:25 | * | ertp07 joined #nim |
04:56:44 | Yardanico | nisstyre: I didn't bisect it yet but https://github.com/nim-lang/Nim/issues/14273 |
04:56:47 | disbot | ➥ C compiler error with sequtils.any with an iterator ; snippet at 12https://play.nim-lang.org/#ix=2leg |
05:03:17 | * | terps joined #nim |
05:10:12 | * | ptdel quit (Remote host closed the connection) |
05:22:25 | * | exelotl quit (Ping timeout: 264 seconds) |
05:38:14 | * | letto quit (Quit: Konversation terminated!) |
05:40:44 | * | terps quit (Quit: WeeChat 2.6) |
05:41:27 | * | silvernode joined #nim |
05:42:23 | * | narimiran joined #nim |
05:50:24 | * | letto joined #nim |
05:51:58 | * | silvernode quit (Ping timeout: 246 seconds) |
05:54:58 | voltist | Would people be interested in a markdown based static website generator written in Nim? I'm thinking of open sourcing mine, but idk if it's worth putting much effort into documentation/presentation |
05:56:06 | FromDiscord | <Rika> you can open source it w/o all of that |
05:56:56 | voltist | True |
06:01:40 | Prestige | That sounds pretty cool. How does it work with css etc? |
06:05:33 | voltist | Basically there is an html template (I'll add support for multiple later), and it substitutes in values from a config file and the target markdown file. Any css in or linked to by the template will apply to the content |
06:06:58 | voltist | There is html generation with nim-markdown |
06:08:24 | voltist | !repo nim-markdown |
06:08:25 | disbot | https://github.com/soasme/nim-markdown -- 9nim-markdown: 11A Beautiful Markdown Parser in the Nim World. 15 48⭐ 4🍴 7& 3 more... |
06:12:32 | Yardanico | oh nice I finally got same binary size as zedeu_ did |
06:12:41 | Yardanico | 5968 hello world binary with _no_ code changes in nim |
06:12:45 | Yardanico | just compiler switch magic |
06:13:03 | Yardanico | and it's all 100% static :P |
06:19:51 | Zevv | Ive been lowe |
06:19:53 | Zevv | r |
06:20:10 | Zevv | but it's pretty sweet, right?! |
06:20:19 | Yardanico | zedeus: ye :P |
06:20:23 | Yardanico | Zevv: ye :P |
06:20:29 | Zevv | what, static even? |
06:20:30 | Yardanico | although I didn't do any source changes |
06:20:34 | Yardanico | Zevv: yes |
06:20:35 | Yardanico | lol |
06:20:38 | Yardanico | musl statically linked |
06:20:42 | Zevv | nice |
06:20:54 | Yardanico | https://file.io/JXrFqxwO binary |
06:21:11 | Yardanico | also it won't really be possible to figure out it was written in Nim :P |
06:21:19 | Yardanico | and you can save around ~150 bytes by explicitly having your own main proc |
06:21:23 | Yardanico | exportc I mean |
06:21:31 | Yardanico | but I did what I could without modifying the source |
06:22:44 | Yardanico | Zevv: binary which uses npeg with your first example (and dynamic input from stdin.readLine) is 50kb |
06:23:00 | Yardanico | with this config |
06:24:36 | Zevv | mwoah not even *that* bad |
06:24:54 | * | solitudesf joined #nim |
06:24:58 | Zevv | that pulls in a lot of stuff already |
06:25:38 | Yardanico | using --noMain and exportc for main proc saves 1.5kb lol |
06:25:47 | Yardanico | it's 48504 bytes |
06:26:05 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:27:07 | Zevv | what are your flags? |
06:27:33 | Yardanico | Zevv: https://ix.io/2lff |
06:27:40 | * | dadada joined #nim |
06:27:42 | Yardanico | test.sh just calls "zig cc $@" because it was removed from compiler |
06:27:52 | Yardanico | and nim rn doesn't support spaces in compiler exe paths |
06:28:01 | Yardanico | ah wiat |
06:28:04 | * | dadada is now known as Guest45865 |
06:28:04 | Yardanico | it was --gc:arc sorry |
06:28:06 | Yardanico | not --gc:none |
06:28:28 | Yardanico | with that I get 48504 bytes |
06:28:34 | Zevv | none is sooo 2019 |
06:28:48 | Yardanico | for this https://gist.github.com/Yardanico/d292d3565f3e27a5580f52f1584ffc85 |
06:29:06 | Yardanico | upx does 2x compression on the binary as well but that's cheating :P |
06:29:12 | Zevv | yaah |
06:29:36 | Yardanico | lemme see if I can make the compiler not care about errors at all |
06:30:04 | skrylar[m] | speaking of gc:none i could have sworn memory regions used to be a thing |
06:30:12 | Yardanico | --gc:regions ? |
06:30:14 | Zevv | thats sooo 2018 |
06:30:19 | Yardanico | --gc:v2 gang |
06:30:22 | Yardanico | XD |
06:30:55 | skrylar[m] | eh it was in the docs where you had pointer[foo] or something |
06:31:29 | Zevv | araq has this funny new dogma: arc is for libs and orc is for apps. but how should that work anyway, i can't compile part of the code with arc and other parts with orc, right? |
06:32:06 | Yardanico | got down to 48104 with a custom stack trace proc override |
06:32:07 | skrylar[m] | i guess its for libs that are to be used outside the nim ecosystem, like a VST |
06:32:21 | Yardanico | Zevv: arc cares a lot about dll interop |
06:32:24 | Yardanico | so that you can mix dlls and stuff |
06:32:27 | Yardanico | and it *just works* :P |
06:33:11 | skrylar[m] | i am so confused as to what we're supposed to be doing these days. one day it was Nim: Oxidized Edition (newruntime), then its arc, now orks are involved. |
06:33:25 | skrylar[m] | now elfs are being compiled with orks and my damn system has turned in to an unruly kingdom |
06:34:31 | Zevv | ah right of cours, arc would finnaly allow portble lib development with nim, never thought of that |
06:34:36 | Yardanico | we need goblins |
06:34:41 | Zevv | so I should make a C api on npeg! |
06:34:45 | Yardanico | Zevv: also don't forget it's shared heap ^_^ |
06:35:24 | Yardanico | I mean I can create a C API for my smol mathexpr lib easily since it's not a lot to do |
06:35:32 | Yardanico | it's much tinier than tinyexpr |
06:35:35 | Yardanico | but much easier to read imo |
06:36:36 | Yardanico | time to dig nim stdlib and compiler for useful compiler defines |
06:37:24 | skrylar[m] | people making all these big fancy libs and i'm just here dealing with hashes and low level game engines :f |
06:37:45 | Yardanico | --gc:generational |
06:37:54 | Yardanico | skrylar[m]: your stuff is much more impressive than mine :) |
06:38:18 | FromDiscord | <Rika> ._. rest in peace me |
06:39:06 | skrylar[m] | one thing that seemed weird with Mu is that i guess its stack based, but it doesn't really say much about data other than "it goes in variables and stuff." its like its just meant to be IR for a jit or somesth |
06:39:25 | skrylar[m] | but unlike wasm it does let you deal with traced or untraced pointers, so |
06:42:47 | Yardanico | nim be like |
06:42:50 | Yardanico | elif doslikeFileSystem or defined(atari): "$1.dll" |
06:42:54 | Yardanico | elif defined(MorphOS): "$1.prc" |
06:42:59 | Yardanico | elif defined(PalmOS): "$1.prc" # platform has lib$1.so |
06:43:22 | skrylar[m] | aren't those all dead platforms |
06:44:23 | FromDiscord | <Rika> why not support them? |
06:44:39 | * | PMunch joined #nim |
06:45:01 | skrylar[m] | [[because i'm not paid to]] |
06:45:07 | * | ertp07 quit (Ping timeout: 260 seconds) |
06:45:25 | Yardanico | we have a define androidNDK in io.nim btw |
06:45:36 | Yardanico | to redirect echo to logcat on android |
06:46:01 | skrylar[m] | Hm. someone's running android stuff? |
06:46:07 | Yardanico | yes, some people aree? |
06:46:18 | Yardanico | kwin |
06:46:18 | Yardanico | what |
06:46:20 | Yardanico | kwin define |
06:46:21 | skrylar[m] | hashlink and mu look awfully similar tho |
06:47:01 | PMunch | skrylar[m], I have run Nim on Android before. But that was many moons ago |
06:47:12 | Yardanico | PMunch: nim is in termux packages now |
06:47:14 | Yardanico | officially |
06:47:18 | Yardanico | lmao it's actually for kwin's JS API |
06:47:19 | PMunch | Oh really? |
06:47:21 | PMunch | Cool! |
06:47:29 | Yardanico | jssys.nim line 354 |
06:47:35 | Yardanico | a version of rawEcho for kwin :D |
06:47:42 | PMunch | I kinda want to write my own launcher though, now that ZLauncher seems to have been completely dropped |
06:48:03 | Yardanico | @rika btw |
06:48:26 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L46 |
06:48:30 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L74 |
06:50:37 | Yardanico | Zevv: with -d:useMalloc the binary is 44584 bytes |
06:50:48 | Yardanico | but -d:useMalloc is worse for performance (but I guess if you really care about size you can use it) |
06:51:06 | Yardanico | and with that I can remove -d:posix |
06:51:10 | FromDiscord | <Rika> DAMN thats a lot |
06:51:54 | Yardanico | that file was mostly untouched for 6 years tho |
06:52:00 | Yardanico | https://github.com/nim-lang/Nim/commit/c7664e7025cb63adb29f44bda8a8d41d4f65a967 |
06:53:56 | * | idf joined #nim |
07:05:51 | skrylar[m] | Yardanico: is all of this just curiosity or are you trying to hit a size limit |
07:09:59 | * | tane joined #nim |
07:11:54 | FromDiscord | <Yardanico> It's curiosity since https://hookrace.net/blog/nim-binary-size/ is already there |
07:12:49 | FromDiscord | <Yardanico> But I have 6kb *with* memory handing |
07:13:42 | FromDiscord | <Rika> `(1 byte smaller than in Rust)` LMAOOO |
07:13:51 | FromDiscord | <Rika> damn! one byte! |
07:15:22 | FromDiscord | <Yardanico> On the scale of 150 it really matters |
07:15:30 | FromDiscord | <Yardanico> And you have to understand that ELF itself has overhead |
07:17:05 | PMunch | Hmm, I'm looking at the hash table implementation, specifically the OrderedTable. (by the way, have anyone benchmarked the Table implementation?) I realise that if they had `prev` as well as `next` you would be able to reorder things |
07:17:20 | FromDiscord | <Yardanico> ELF header is 64 bytes on x64 |
07:17:38 | * | konvertex joined #nim |
07:18:09 | FromDiscord | <Rika> i mean, this is almost to the level of pixel peeping wrt. video encoding |
07:18:18 | FromDiscord | <Rika> this is awfully intensely optimized |
07:22:36 | * | Jjp137 quit (Ping timeout: 272 seconds) |
07:23:37 | * | exelotl joined #nim |
07:25:23 | * | terps joined #nim |
07:25:29 | * | ertp07 joined #nim |
07:33:08 | * | konvertex quit (Ping timeout: 256 seconds) |
07:34:14 | * | terps quit (Quit: WeeChat 2.6) |
07:34:57 | * | terps joined #nim |
07:35:27 | * | terps quit (Client Quit) |
07:43:27 | FromGitter | <sealmove> hey, I think I lost my nimble token |
07:43:35 | FromGitter | <sealmove> what happens if I use a new one? |
07:49:43 | * | Guest45865 is now known as dadada |
07:52:57 | PMunch | Nimble token? |
07:53:32 | FromDiscord | <Yardanico> That's a GitHub token and it's only really used for publishing packages with nimble publish |
07:54:59 | * | Vladar joined #nim |
07:57:12 | FromGitter | <sealmove> yes, what happens if I change it? nothing right? |
08:13:33 | FromDiscord | <Yardanico> Nothing of course |
08:16:37 | * | avatarfighter quit (Ping timeout: 244 seconds) |
08:17:33 | * | Jjp137 joined #nim |
08:21:06 | dadada | what do I import to use when linux? |
08:21:30 | FromDiscord | <Yardanico> Nothing |
08:21:38 | dadada | undeclared identifier: 'linux' |
08:21:40 | FromDiscord | <Yardanico> when defined(linux): |
08:21:57 | dadada | ah, copied some wrong code from somewhere then :-) |
08:27:12 | * | terps joined #nim |
08:27:16 | * | terps quit (Client Quit) |
08:27:26 | FromDiscord | <Yardanico> By the way are there any guidelines of what might be allowed to be added to Fusion and what is not? |
08:29:50 | * | NimBot joined #nim |
09:16:03 | FromDiscord | <mratsim> @codic for 41241241241241241241243 ^ 10295019204912, it's not modular? |
09:25:11 | dadada | is something missing from Nim's stdlib to port this? https://play.nim-lang.org/#ix=2lfB |
09:25:30 | * | ertp07 quit (Read error: Connection reset by peer) |
09:26:32 | * | exelotl quit (Ping timeout: 256 seconds) |
09:27:40 | * | ertp07 joined #nim |
09:27:47 | FromDiscord | <Rika> not that i know of |
09:27:50 | PMunch | @Araq, @cooldome, am I missing something obvious here? https://github.com/nim-lang/Nim/pull/14258 Or should this check me moved to later in the chain so that sfImportc is available? Sorry, not very well versed in the compiler internals.. |
09:27:51 | disbot | ➥ Allow let to not have value when using importc |
09:30:36 | * | Trustable joined #nim |
09:35:01 | * | ertp07 quit (Ping timeout: 264 seconds) |
09:36:20 | skrylar[m] | @Yardanico nimble publish: where it inevitably butchers the push and dom makes you fix it manually |
09:37:00 | * | ertp07 joined #nim |
09:37:13 | skrylar[m] | i wonder if the matrix people missed some opportunities by marketing to dead irc cultures instead of marketing to corpodoods who were looking to replace their chat engines :ponder: |
09:40:48 | PMunch | What do you mean by "dead IRC cultures"? |
09:41:33 | * | Senketsu quit (Quit: WeeChat 2.8) |
09:41:35 | skrylar[m] | ircs not a lively place to market an irc clone to |
09:41:58 | PMunch | Haha, true |
09:42:25 | skrylar[m] | outside of some foss hardliners everyones ditched to discord tbh |
09:42:56 | skrylar[m] | corporate users still want stuff they can host and they prolly could have marketed to those, but i just pulled some threads of people saying yeah we tried matrix but synapse sucks |
09:43:20 | skrylar[m] | oh well. |
09:43:25 | PMunch | Synapse? |
09:44:15 | skrylar[m] | the reference server for matrix is a slog of a python app. i think rocket is that too. mattermost is just a go binary you plop and run. zulip you have to dedicate a server to because its a stack (message queue, web server, ..., though everyone says its worth it) |
09:45:49 | skrylar[m] | altho with everyone complaining about the web apps being bad... wonder how to get away with writing android apps without java xD |
09:48:53 | skrylar[m] | it would admittedly be interesting to be able to use nim to write phone apps o.O although i have no idea how clean adding backends is |
09:49:50 | PMunch | I did try some simple game stuff in Android |
09:49:57 | PMunch | Worked fairly well |
09:50:04 | skrylar[m] | games are mostly going to run on NDK |
09:50:12 | PMunch | But that was without using any of the Java libraries |
09:50:29 | PMunch | Yeah, it was basically a Java shell to just set up the app and then pass everything over to the NDK |
09:50:31 | skrylar[m] | android doesn't like if you try to use ndk to drive the native apis... which are sadly necessary for non-games |
09:50:41 | skrylar[m] | haxe can transpile to java i think |
09:52:11 | PMunch | Really? |
09:59:05 | skrylar[m] | well 2/3rds of xxhash stuff ported, kindof |
09:59:35 | skrylar[m] | probably won't do any more after this. blake, spooky and xx are more than enough |
10:01:28 | * | konvertex joined #nim |
10:04:30 | FromDiscord | <clyybber> https://github.com/yglukhov/jnim |
10:05:11 | Yardanico | so guys from IRC does https://media.discordapp.net/attachments/456504845642235914/708257345205174282/2020-05-08-12-57-50_grim.png open for you without discord authorization? |
10:05:14 | skrylar[m] | eh no, thats JNI |
10:05:45 | skrylar[m] | Yardanico: discord images aren't private afaik |
10:05:52 | Yardanico | skrylar[m]: well pls click the url :P |
10:06:02 | skrylar[m] | i did but i also have cookies |
10:06:05 | Yardanico | uh |
10:06:15 | skrylar[m] | works in private windows too, so. |
10:06:21 | Yardanico | well I guess it should work ow that I'm using proxy_url instead of just url |
10:11:33 | * | theelous3 joined #nim |
10:11:52 | * | Trustable quit (Remote host closed the connection) |
10:19:02 | * | dddddd joined #nim |
10:25:14 | * | dadada quit (Ping timeout: 260 seconds) |
10:25:42 | * | abm joined #nim |
10:31:39 | dom96 | Haxe "transpiles" to everything lol |
10:32:57 | FromDiscord | <Recruit_main707> https://tenor.com/view/pewdiepie-can-you-do-this-but-can-you-do-this-gif-14948439 |
10:33:01 | FromDiscord | <Recruit_main707> `macro` |
10:34:17 | FromGitter | <alehander92> it seems haxe has macros |
10:34:43 | FromGitter | <alehander92> compile time execution/macros is really coming to mainstream these days |
10:35:59 | FromGitter | <alehander92> even c# added `Source Generators`(even if limited) |
10:42:42 | * | fredrikhr joined #nim |
10:48:57 | * | exelotl joined #nim |
10:56:28 | * | couven92 joined #nim |
10:56:40 | * | fredrikhr quit (Ping timeout: 272 seconds) |
10:56:48 | * | couven92 is now known as fredrikhr |
10:58:20 | * | ertp07 quit (Ping timeout: 256 seconds) |
10:58:34 | FromDiscord | <RaycatWhoDat> Correct. Haxe transpiles to both Java sourcecode and JVM bytecode. It also has macros. |
11:00:07 | * | ertp07 joined #nim |
11:00:13 | FromDiscord | <RaycatWhoDat> Also, hello again. Recently hopped the fence from Haxe to Nim. |
11:00:19 | FromDiscord | <Recruit_main707> nice |
11:00:47 | FromDiscord | <RaycatWhoDat> Eh. It causes more grief than you'd expect. |
11:00:50 | * | krux02 joined #nim |
11:01:16 | FromDiscord | <Recruit_main707> i meant the fact of you coming to nim :P |
11:01:30 | FromDiscord | <RaycatWhoDat> Ah. Right, right. |
11:03:23 | FromDiscord | <Rika> so what do you miss from haxe? |
11:04:04 | Yardanico | most people coming from languages with (at least some) duck typing miss it in typed languages at first :P |
11:04:32 | Yardanico | I mean https://haxe.org/manual/types-dynamic.html ,although I don't really know how much it's used in real haxe code |
11:04:53 | FromDiscord | <RaycatWhoDat> Nah, people avoid Dynamic like the plague |
11:04:57 | FromDiscord | <Recruit_main707> whats duck typing? |
11:04:58 | Yardanico | then it's ok |
11:05:08 | Yardanico | @Recruit_main707 https://en.wikipedia.org/wiki/Duck_typing |
11:05:34 | supakeen | @Recruit_main707: Basically, if you get an object you just try to use it in a certain way and see if it works. |
11:05:39 | Yardanico | ye :D |
11:05:39 | supakeen | If it fails you get an error anyways. |
11:05:42 | FromDiscord | <RaycatWhoDat> @Rika The Lua target is a big one but I can manage. After that, metadata annotations and the cross-platform guarantee |
11:05:47 | Yardanico | you don't know if it will work tho xd |
11:06:02 | supakeen | It's part of the look before you leap vs easier to ask for forgiveness idiom. |
11:06:15 | Yardanico | @RaycatWhoDat wdym by metadata annotations? |
11:06:20 | FromDiscord | <Rika> was gonna ask |
11:06:25 | Yardanico | and cross-platform guarantee -> nim is pretty cross-platform |
11:06:35 | Yardanico | most of the stdlib works on all major OSes and even on less known ones |
11:06:40 | Yardanico | like there are PRs for Haiku and Genode |
11:06:40 | FromDiscord | <Rika> you know what's interesting to me? structural typing |
11:06:53 | FromDiscord | <RaycatWhoDat> Right |
11:07:04 | FromDiscord | <Rika> its like some half compromise between duck and static or something |
11:07:05 | FromDiscord | <RaycatWhoDat> What's the pattern matching like here? |
11:07:19 | Yardanico | we have case statements, we have macros so you can do stuff like https://github.com/alehander92/gara |
11:07:21 | FromDiscord | <Rika> pattern matching? dont think we have that at all w/o a package |
11:07:28 | Yardanico | and https://github.com/andreaferretti/patty |
11:07:45 | Yardanico | idk if macros in haxe can do what nim macros can :D |
11:08:07 | FromDiscord | <RaycatWhoDat> The macros are full-on macros |
11:08:13 | * | ertp07 quit (Ping timeout: 260 seconds) |
11:08:19 | FromDiscord | <RaycatWhoDat> Probably comparable. |
11:08:32 | Yardanico | well you know nim macros have a lot of interesting stuff in them as well :) |
11:08:57 | Yardanico | for stuff like https://code.haxe.org/category/macros/add-git-commit-hash-in-build.html for example you don't need to use macros in nim at all |
11:09:10 | Yardanico | because nim has compile-time execution |
11:09:42 | leorize | gara should be updated to use case statement macros imo |
11:09:51 | * | ertp07 joined #nim |
11:10:09 | Yardanico | also lol |
11:10:18 | Yardanico | yeah sorry but haxe macros aren't as powerful as nim ones -> |
11:10:19 | Yardanico | "While the former requires a known type in order to determine used functions, macros execute before typing on plain syntax." |
11:10:41 | FromDiscord | <Rika> nim has both typed and untyped |
11:10:57 | Yardanico | yeah |
11:11:07 | Yardanico | macros can be run after the compiler checked all types |
11:11:15 | Yardanico | something like that |
11:11:33 | FromDiscord | <RaycatWhoDat> Re: metadata annotations, in Haxe, you can do this: |
11:11:34 | FromDiscord | <RaycatWhoDat> ```haxe |
11:11:34 | FromDiscord | <RaycatWhoDat> package; |
11:11:34 | FromDiscord | <RaycatWhoDat> |
11:11:34 | FromDiscord | <RaycatWhoDat> @author('Me') |
11:11:34 | FromDiscord | <RaycatWhoDat> class A { |
11:11:35 | FromDiscord | <RaycatWhoDat> trace(haxe.Rtti.get('author')) // 'Me' |
11:11:36 | FromDiscord | <RaycatWhoDat> } |
11:11:37 | FromDiscord | <RaycatWhoDat> ``` |
11:11:41 | Yardanico | you have pragmas in nim |
11:11:43 | Yardanico | which do the same thing |
11:11:47 | PMunch | Please don't paste code into Discord.. |
11:11:52 | Yardanico | PMunch: for now :P |
11:11:54 | FromDiscord | <Rika> rest in peace irc |
11:11:59 | PMunch | Haha, for now yeah |
11:12:01 | FromGitter | <alehander92> ok |
11:12:03 | FromDiscord | <RaycatWhoDat> Oh, right |
11:12:04 | Yardanico | pragmas can be used for types/fields/procs/variables/etc |
11:12:06 | FromDiscord | <Rika> what is Rtti? |
11:12:07 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:12:09 | FromGitter | <alehander92> my nim process fails without an error |
11:12:12 | Yardanico | runtime type information basically |
11:12:22 | FromDiscord | <RaycatWhoDat> Runtime Type Information, I'd imagine |
11:12:24 | FromDiscord | <Rika> i mean i want to know the meaning of the abbr. |
11:12:26 | FromDiscord | <RaycatWhoDat> yeah |
11:12:27 | FromDiscord | <Rika> i see |
11:12:37 | PMunch | alehander92, sure it just didn't run to completion? :P |
11:12:38 | Yardanico | nim has that but with ARC it's mostly getting removed |
11:12:41 | PMunch | Yardanico, when do you think the new bot is ready? |
11:13:00 | Yardanico | PMunch: I think right now it's almost ready, most features are there and it's already quite stable (and can restart easily on crash :P) |
11:13:12 | Yardanico | at most around one week I guess, just need to run it for some time to see how stable it is |
11:13:20 | leorize | have you fixed the pinging issue? |
11:13:34 | Yardanico | leorize: of course |
11:13:45 | Yardanico | ah right I need to change contains to startsWith |
11:13:47 | Yardanico | thanks for reminding |
11:14:01 | Yardanico | so "@human" doesn't match for "@somehuman" |
11:14:23 | PMunch | Haha |
11:14:24 | Yardanico | also you don't need to auth to view discord images rn I think |
11:14:29 | Yardanico | because I use proxy_url instead of just url |
11:14:35 | FromGitter | <alehander92> PMunch i mean |
11:14:36 | FromGitter | <alehander92> :P |
11:14:36 | PMunch | But you want @Yard to match Yardanico? |
11:14:38 | leorize | yea, I can view that image you sent |
11:14:38 | FromGitter | <alehander92> it returns status 1 |
11:14:42 | Yardanico | PMunch: that's the problem |
11:14:43 | FromGitter | <alehander92> but it doesnt show any error |
11:14:45 | Yardanico | I don't know |
11:14:47 | FromGitter | <alehander92> which is confusing |
11:14:49 | Yardanico | probably no? |
11:14:58 | leorize | Yardanico: can't you just match the name until the `#`? |
11:14:58 | FromGitter | <alehander92> its like the mixed signals meme :) |
11:15:03 | FromDiscord | <clyybber> alehander92: I closed this arc issue, I think backtraces with line information are a bit complicated so definitely deserving of their own issue |
11:15:08 | Yardanico | leorize: # ? |
11:15:14 | PMunch | alehander92, is it running with debug? Or in release? |
11:15:29 | Yardanico | hmm I think I can definitely get full username, just need to restructure some code |
11:15:32 | leorize | Yardanico: isn't discord names are like: Nick#some_id_thingy? |
11:15:33 | FromGitter | <alehander92> ok, sorry, then a new issue is needed ! even a line info for the last node affected is good |
11:15:38 | FromGitter | <alehander92> clyybber |
11:15:44 | Yardanico | leorize: I don't send the discriminator anyway |
11:15:50 | Yardanico | and it's not needed for mentions |
11:15:50 | FromGitter | <alehander92> PMunch danger :D |
11:15:55 | FromDiscord | <Rika> usernames are not unique in discord though |
11:15:58 | Yardanico | yes |
11:16:02 | FromGitter | <alehander92> i am rebuilding a debug one |
11:16:03 | Yardanico | but imagine typing a discriminator |
11:16:06 | Yardanico | maybe I can make it optional |
11:16:10 | FromDiscord | <clyybber> alehander92: Yeah, I can only imagine that it gets a bit tricky when you have lets say the nodes after injectdestructors |
11:16:17 | FromGitter | <alehander92> but i still expect some kind of a system error |
11:16:19 | PMunch | Haha, there's your issue alehander :P |
11:16:25 | FromGitter | <alehander92> clyybber hm, why |
11:16:36 | FromGitter | <alehander92> well still shouldn't happen :P |
11:16:45 | PMunch | There are some cases that just ends up quitting |
11:16:51 | PMunch | I don't know what, but I've seen it before |
11:17:00 | leorize | Yardanico: why do you need startsWith then? |
11:17:10 | Yardanico | leorize: so "@human" doesn't match "@somehuman" |
11:17:12 | * | pbb joined #nim |
11:17:17 | Yardanico | I use "in" rn :D |
11:17:18 | FromDiscord | <clyybber> alehander92: Because we insert new nodes. And its potentially non-trivial to associate them with the code that caused a certain transformation |
11:17:24 | leorize | Yardanico: I mean why do you even need it? |
11:17:24 | FromDiscord | <clyybber> especially for passes like transf.nim |
11:17:42 | leorize | couldn't you do direct match? |
11:17:48 | Yardanico | not with discord api I believe |
11:17:54 | * | konvertex quit (Read error: Connection reset by peer) |
11:18:12 | FromGitter | <alehander92> clyybber hm, but how do you preserve debug info |
11:18:13 | PMunch | How about highlight == name[0..highlight.high] |
11:18:17 | leorize | Yardanico: I'm still confused, what are you using to compare the nicks with? |
11:18:30 | PMunch | That way you could use both with and without discriminators |
11:18:33 | Yardanico | I cache last 5 users who wrote a message on discord so I don't have to fetch full user list for the channel each time someone mentions someone |
11:18:56 | Yardanico | and iterate over these ones and check if usernames match, if they do - send the id thingie to discord |
11:19:05 | Yardanico | discord needs ID of the user |
11:19:08 | Yardanico | not username |
11:19:23 | leorize | then you can do an equal match instead of startsWith? |
11:19:38 | Yardanico | leorize: well yeah I think I can, just need to make it handle spaces somehow |
11:19:39 | FromDiscord | <clyybber> alehander92: Yeah, we should use the same mechanism, my point was more that it doesn't necessarily help the user |
11:19:44 | FromDiscord | <RaycatWhoDat> @Rika To finish answering your question, the documentation fragmentation, the necessity of classes, and the way JSX is handled steered me away. |
11:19:44 | Yardanico | discord usernames can contain space |
11:19:46 | Yardanico | or any utf8 characters |
11:19:49 | Yardanico | (almost) |
11:19:53 | FromDiscord | <clyybber> Because it doesn't tell you *how* to work around it |
11:20:02 | leorize | Yardanico: use a custom matcher :P |
11:20:15 | Yardanico | so I don't think mentioning with spaces will be good for IRC |
11:20:19 | PMunch | Aha, spaces as well.. |
11:21:10 | leorize | stores the position of `@` from the irc message, then just scan from there for each of the nicks? |
11:21:36 | FromGitter | <alehander92> PMunch i found it |
11:21:45 | FromGitter | <alehander92> its a vm assert but it seems |
11:21:49 | PMunch | Aah |
11:21:50 | FromGitter | <alehander92> instantiationInfo is empty |
11:21:54 | PMunch | Huh |
11:21:59 | Yardanico | leorize: the issue is that we have 879 people in nim discord |
11:22:07 | FromGitter | <alehander92> and thats why i see no error maybe |
11:22:07 | PMunch | So VM asserts are also affected by danger? |
11:22:11 | Yardanico | and what if someone wants to ping someone who didn't write a message in last few minutes? |
11:22:17 | FromGitter | <alehander92> no i still get the assert indebug |
11:22:30 | FromGitter | <alehander92> but it only shows a stacktrace the message itself might be empty? |
11:22:32 | PMunch | Yardanico, build a Trie? |
11:22:32 | Yardanico | well I think I might've found a way to solve it |
11:22:39 | * | konvertex joined #nim |
11:22:43 | FromGitter | <alehander92> oh wait this doesnt make sense |
11:22:54 | FromDiscord | <Rika> @RaycatWhoDat i dont think the docs are much better here, but the code sure is easier to read (for me, at least) |
11:23:08 | Yardanico | let's see how discord.py does it |
11:23:17 | FromGitter | <alehander92> clyybber but the debug info |
11:23:19 | Yardanico | they have a function named get_member_named |
11:23:38 | FromGitter | <alehander92> should usually makes sense anyway, otherwise this means that the generated code can't be debugged as well |
11:23:57 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:24:04 | FromDiscord | <clyybber> alehander92: Sure, I just don't see the value for users generally |
11:24:16 | FromDiscord | <clyybber> For compiler dev it's certainly handy |
11:24:23 | FromDiscord | <clyybber> Or for minimizing testcases |
11:24:42 | * | pbb joined #nim |
11:25:29 | FromGitter | <alehander92> it's huge value |
11:25:37 | FromGitter | <alehander92> right now i am doing exactly this as a user |
11:25:49 | FromGitter | <alehander92> i just hit a vm assert and i have no idea to which node is it related to |
11:25:55 | FromGitter | <alehander92> to at least workaround it in my own code |
11:26:05 | FromGitter | <alehander92> and it happens with other ice-s as well |
11:26:21 | FromDiscord | <RaycatWhoDat> @Rika That's a fair stance. |
11:26:22 | FromGitter | <alehander92> yeah, i add debug statements to the compiler and rebuild, but this is very slow |
11:27:43 | * | couven92 joined #nim |
11:28:09 | FromGitter | <alehander92> i am sorry, i realize its a bit niche, but i can add it to the compiler if its accepted |
11:28:19 | * | couven92 quit (Client Quit) |
11:28:38 | * | couven92 joined #nim |
11:29:10 | * | fredrikhr quit (Disconnected by services) |
11:29:15 | * | couven92 is now known as fredrikhr |
11:29:35 | * | couven92 joined #nim |
11:29:43 | FromDiscord | <clyybber> no, I agree. It certainly has value |
11:30:00 | planetis[m] | hi , i was experimenting with archtypes and needed a way to implement a dynamic programming AnyMap type, but this won't compile https://play.nim-lang.org/#ix=2lgb Can it be fixed somehow? |
11:30:57 | FromDiscord | <clyybber> alehander92: I just feared the implementation a bit, but maybe its possible to implement it without changing all the node transformation parts in the compiler |
11:31:09 | FromDiscord | <clyybber> .s/changing/touching |
11:31:44 | FromGitter | <alehander92> clyybber if its useful for better debugging locations somehow, thats even better |
11:32:06 | FromGitter | <alehander92> can you give a short example of line which would require such a transf |
11:33:11 | planetis[m] | basically ArchPayload1, ArchPayload2 need to go but how can i access the members without them? |
11:35:09 | FromDiscord | <clyybber> alehander92: I thought you wanted to debug where the nodes came from themselves, not only the LOC info |
11:35:24 | FromDiscord | <clyybber> alehander92: I think we retain the debug/loc info across transformations |
11:35:32 | FromDiscord | <clyybber> So yeah, it probably won't be an issue |
11:35:49 | FromDiscord | <clyybber> are you gonna make a PR? |
11:35:51 | FromGitter | <alehander92> alehander92: ah ok, otherwise yeah where they come from would be also useful |
11:36:00 | FromGitter | <alehander92> i misunderstood, sorry |
11:36:20 | FromDiscord | <clyybber> it was me who misunderstood :D |
11:36:27 | FromGitter | <alehander92> in my case i just saw its in strformat, but still wasnt enough |
11:37:14 | FromGitter | <alehander92> so , nodes do carry some kind of links to their instantiation contexts, right |
11:37:24 | FromGitter | <alehander92> (or is that the comesFrom thing i saw) |
11:37:56 | FromGitter | <alehander92> otherwise i just changed the assert to a warning echo |
11:38:02 | FromGitter | <alehander92> and my code seems to just work, strange |
11:38:26 | FromDiscord | <clyybber> alehander92: not sure which comesFrom you are referring to as there are many :p |
11:38:35 | FromGitter | <alehander92> ok |
11:39:07 | FromGitter | <sheerluck> planetis[m] https://github.com/nim-lang/Nim/issues/9636 |
11:39:11 | disbot | ➥ illegal usages of UncheckedArray are not caught. ; snippet at 12https://play.nim-lang.org/#ix=2lgf |
11:39:38 | FromDiscord | <clyybber> there is a field in the VM thats called comesFrom, and its attached to the VM stackframe |
11:40:00 | FromGitter | <alehander92> ok, now i get a different one which is about yield not lowered |
11:40:05 | FromGitter | <alehander92> iirc there were many cases |
11:40:13 | FromGitter | <alehander92> or at least 1 which could be changed there |
11:40:35 | planetis[m] | sheerluck: yes I need to get the pointers to the start of each array by hand |
11:40:45 | planetis[m] | i'm trying to write a template |
11:41:17 | planetis[m] | but still unsure how that can be generalised for other types |
11:41:37 | * | couven92 quit (Ping timeout: 246 seconds) |
11:42:39 | * | dadada joined #nim |
11:43:01 | * | dadada is now known as Guest94017 |
11:45:21 | FromGitter | <sheerluck> I don't think you should use 2 or more UncheckedArray in one object. That inevitably leads to " flexible array member not at end of struct" |
11:46:38 | PMunch | Can you even do that? |
11:46:43 | PMunch | I thought they had to be at the end |
11:49:48 | * | couven92 joined #nim |
11:49:53 | planetis[m] | no you can't but i'm doing is pointer arithmetic by hand |
11:52:59 | planetis[m] | this seems to work: https://play.nim-lang.org/#ix=2lgi |
11:54:02 | planetis[m] | but its entirely possible i'm still doing it wrong... |
12:00:56 | * | liblq-dev joined #nim |
12:01:58 | * | solitudesf- joined #nim |
12:02:17 | * | fredrikhr quit (Quit: Disconnecting) |
12:02:32 | * | couven92 is now known as fredrikhr |
12:04:43 | * | solitudesf quit (Ping timeout: 246 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:45 | * | supakeen joined #nim |
12:07:04 | liblq-dev | anyone familiar enough with generics and concepts that could help explain a weird issue? |
12:07:24 | liblq-dev | I asked yesterday but noone responded, so here I go again |
12:07:31 | liblq-dev | I have this concept defined https://github.com/liquid600pgm/aglet/blob/master/src/aglet/target.nim#L12 |
12:07:48 | liblq-dev | and appropriate implementations of the concept *in other modules* |
12:08:09 | liblq-dev | when compiling, however, I get an error on this line https://github.com/liquid600pgm/aglet/blob/master/src/aglet/target.nim#L33 |
12:08:14 | liblq-dev | stating that the proc is undeclared |
12:08:45 | liblq-dev | this is the entire error http://ix.io/2lgp |
12:09:49 | liblq-dev | this is my call to that generic proc: https://github.com/liquid600pgm/aglet/blob/master/tests/ttriangle.nim#L50 |
12:10:57 | Yardanico | liblq-dev: did you try https://nim-lang.org/docs/manual_experimental.html#concepts-concept-diagnostics ? |
12:11:53 | liblq-dev | Yardanico: yes, but it doesn't really help with anything… |
12:12:01 | liblq-dev | you can see {.explain.} in the concept declaration |
12:12:10 | Yardanico | and what about the callsite? |
12:13:45 | liblq-dev | doesn't yield anything useful either http://ix.io/2lgr |
12:13:49 | PMunch | Why does your Drawable concept have a T generic? |
12:14:02 | liblq-dev | that's what I saw in the manual |
12:14:12 | Yardanico | ? |
12:14:18 | Yardanico | you need that only if you check the type |
12:14:20 | PMunch | Well yes, but it was using the T in the concept definition |
12:14:32 | liblq-dev | removing the generic doesn't help anything |
12:14:36 | PMunch | You only need them if you want to make a generic concept |
12:14:39 | FromGitter | <alehander92> i think you dont need it usually |
12:14:43 | FromGitter | <alehander92> i mean yeah |
12:14:43 | PMunch | Didn't think it would.. |
12:14:45 | PMunch | :P |
12:14:49 | FromGitter | <alehander92> but often you can do concept a, type T |
12:14:53 | FromGitter | <alehander92> and do stuff with T |
12:15:02 | FromGitter | <alehander92> but now .. i am not sure where the difference is |
12:15:06 | FromGitter | <alehander92> as concepts are generic always |
12:16:04 | liblq-dev | making `source` into a type yields another different error http://ix.io/2lgs |
12:16:22 | liblq-dev | I changed the decl to `Drawable* = concept type S` |
12:16:27 | liblq-dev | but it's not really what I want |
12:16:44 | FromGitter | <alehander92> but what do you want |
12:16:47 | PMunch | And `draw` doesn't return anything? |
12:16:53 | liblq-dev | nope, it's `void` |
12:17:02 | PMunch | void? |
12:17:08 | liblq-dev | doesn't return anything. |
12:17:20 | PMunch | Okay, so it doesn't actually have something called void in Nim .P |
12:17:37 | * | dv^_^ quit (Ping timeout: 256 seconds) |
12:17:39 | FromGitter | <alehander92> so the problem is that Mesh doesnt match Drawable? |
12:17:41 | liblq-dev | oh void *is* actually a feature |
12:17:47 | liblq-dev | @alehander92 yeah pretty much |
12:17:52 | * | dv^_^ joined #nim |
12:18:15 | liblq-dev | I mean it matched, but later there was this error http://ix.io/2lgp |
12:19:00 | PMunch | Uhm, that error is really weird.. |
12:19:19 | FromDiscord | <clyybber> Does it work if you put everything in one module? |
12:19:41 | liblq-dev | dear god please no |
12:19:47 | PMunch | It doesn't show why it didn't match for the draw procedure that takes a two argument.. |
12:20:10 | liblq-dev | it would likely work because it seems like the target.nim module doesn't see the other draw procs |
12:20:31 | PMunch | Exactly |
12:20:45 | PMunch | Super weird error though.. |
12:20:49 | PMunch | Try to make a minimal example |
12:20:55 | * | rockcavera joined #nim |
12:21:04 | PMunch | To check that is in fact the problem |
12:21:27 | * | Vladar quit (Quit: Leaving) |
12:22:17 | FromDiscord | <clyybber> liblq-dev: You are calling source with the type OpenGL |
12:22:19 | FromDiscord | <clyybber> thats wrong |
12:22:34 | FromDiscord | <clyybber> *draw |
12:22:44 | FromDiscord | <clyybber> there is no draw that accepts a typedesc as a second param |
12:24:27 | PMunch | clyybber, no he isn't? |
12:24:42 | PMunch | He's calling it with target.gl |
12:24:52 | PMunch | The concept is defined as taking the type OpenGL |
12:25:05 | PMunch | Which should be right (although I haven't used concepts much) |
12:29:03 | FromDiscord | <clyybber> ah, right |
12:31:38 | liblq-dev | that's what I read in the documentation, it's a shorthand for declaring another concept variable and adding `x is T` |
12:33:10 | FromDiscord | <clyybber> yeah, does it work when you do it manually? |
12:33:39 | PMunch | Hmm, this seems to work: http://ix.io/2lgy |
12:35:24 | * | s4mu3lbk joined #nim |
12:35:30 | liblq-dev | @clyybber: no http://ix.io/2lgz |
12:40:43 | liblq-dev | think I managed to reproduce it |
12:41:52 | * | samuelb_ joined #nim |
12:41:59 | * | s4mu3lbk quit (Read error: Connection reset by peer) |
12:43:01 | FromGitter | <alehander92> ops |
12:43:06 | FromGitter | <alehander92> `await a(await expandValue())` is broken |
12:43:12 | liblq-dev | http://ix.io/2lgE/nim |
12:43:13 | FromGitter | <alehander92> by my PR |
12:43:22 | FromGitter | <alehander92> huge ops |
12:44:50 | Yardanico | Zevv: if I apply some of def- tricks (like using syscalls directly) but still include the C library and stuff (so arc and --os:any works) it's 39kb |
12:45:29 | Yardanico | actually 44kb sorry, need to have a syscall for read :D |
12:55:04 | Zevv | haha |
12:56:29 | FromGitter | <alehander92> hm, how can i solve it |
12:56:35 | FromGitter | <alehander92> this is a big bug |
13:04:25 | * | zacharycarter joined #nim |
13:09:01 | * | Guest94017 is now known as dadada |
13:10:14 | dadada | quick hint: if you're using vscode, install the file-icons extension, cause it makes nim file icons look very cool, this alone makes it worth it |
13:10:35 | dadada | it becomes easier to discern files in the explorer |
13:10:37 | PMunch | What do they look likE? |
13:10:40 | PMunch | The crown? |
13:10:44 | dadada | yep |
13:10:47 | PMunch | Neat |
13:11:03 | dadada | you can choose if you want colors or not |
13:11:09 | PMunch | That reminds me, we were talking about making Nim paper crowns for next years FOSDEM |
13:11:30 | FromDiscord | <clyybber> lqdev: You don't have a correct exec defined |
13:11:44 | FromDiscord | <clyybber> Your exec is unary |
13:11:53 | FromDiscord | <clyybber> The non generic one I mean |
13:12:25 | PMunch | Hmm, I wonder if sheets of yellow craft paper could be laser-cut and coloured along the edges to make the processing easier |
13:13:09 | PMunch | s/processing/manufacture |
13:13:42 | FromDiscord | <clyybber> liblq-dev: See above, pinged your old name |
13:15:17 | dadada | wrong thinking there, Steve said you should think big, or was that IBM?, anywho, real crowns it must be, the royal ones are the only ones that really count, (the insane asylum just called, I'm not allowed to write more) |
13:15:56 | dadada | gold + diamonds > paper + scissors |
13:16:43 | FromDiscord | <clyybber> I'm sure there are more scissors and paper than there is gold and diamonds :p |
13:17:10 | dadada | quantity vs quality |
13:17:51 | PMunch | gold.value + diamonds.value > paper.value + scissors.value |
13:18:10 | dadada | just imagine the looks on the faces of the other FOSDEM participants, when all Nim people walk around in gold + diamonds + real royal crowns from top to bottom |
13:18:13 | FromGitter | <codenoid> i want you to stay |
13:18:17 | PMunch | Haha :P |
13:18:22 | dadada | they'll wanna join us, trust me |
13:18:23 | FromGitter | <codenoid> stay safe nim folks <3 |
13:18:25 | PMunch | The Nim crown is pretty understated though.. |
13:18:48 | PMunch | I think just a solid gold crown would work fine |
13:18:54 | * | fredrikhr quit (Ping timeout: 240 seconds) |
13:18:59 | FromGitter | <alehander92> oh man this is a bad bug |
13:20:47 | dadada | then it's settled, all Nim people will appear in solid gold crowns, gold can be made one atom thick by the way, so this would be a slick way for producing solid-gold-crowns that are still in the payable range |
13:20:58 | PMunch | Hmm, is the Nim crown 8 or 6 pronged? |
13:21:35 | PMunch | dadada, gold is unfortunately not very solid. So a one atom thick layer would just crumble away.. |
13:22:01 | FromDiscord | <clyybber> PMunch: 6 afaict |
13:22:25 | leorize[m] | https://codecov.io/gh/alaviss/Nim/tree/9d46a5741dd5ceac2b5f4dd5a7424228d73ce6fb |
13:22:35 | leorize[m] | looks like the compiler is pretty covered by the test suite |
13:22:52 | leorize[m] | (you will need to login to view the files) |
13:23:00 | PMunch | The old one definitely has 8 |
13:23:22 | PMunch | https://en.wikipedia.org/wiki/Nim_(programming_language)#/media/File:Nim-logo.png |
13:24:41 | FromDiscord | <clyybber> yeah, the one on the website has 6 |
13:25:10 | dadada | PMunch: I think gold is not even toxic in low amounts, I want to see Nim developers first appear with solid gold crowns wobble 1-atom-thick on their heads giving talks, and then later just casually eating their crowns (like it's totally normal to do) while in personal talks with other FOSDEM people, this could make Nim developers famous for being more insane than Richard Marcs Stallman, a guy who is known for |
13:25:16 | dadada | having sex with plants |
13:25:20 | dadada | and this isn't even a joke :D |
13:26:28 | PMunch | Haha :P |
13:26:38 | PMunch | Not sure if that is the "image" we're going for :P |
13:26:42 | dadada | to be fair he's also known for the GPL, emacs, gcc and some other cool stuff |
13:27:38 | FromDiscord | <Generic> to match mr stallman we have a long way to go |
13:27:46 | dadada | trze |
13:27:46 | FromDiscord | <Generic> we don't even have a song https://www.youtube.com/watch?v=9sJUDx7iEJw |
13:27:47 | dadada | true |
13:28:31 | dadada | Generic is challenging us |
13:29:02 | dadada | I have a song by the way |
13:29:12 | FromDiscord | <Recruit_main707> 👀 |
13:30:17 | dadada | https://www.youtube.com/watch?v=lNYcviXK4rg |
13:34:43 | FromGitter | <alehander92> dadada fun talks are better than bizarre eating paper people! |
13:34:46 | * | fredrikhr joined #nim |
13:35:44 | FromGitter | <bung87> @alehander92 https://github.com/bung87/ts2nim have you looked at this? |
13:37:43 | dadada | alexander92: and can you imagine the fun talks that follow when people saw something bizarre, sometimes I view life as an art project |
13:37:46 | PMunch | Can't the meme-makers auto-tune together some of the Nim talks into a song? :P |
13:39:17 | * | fredrikhr quit (Ping timeout: 252 seconds) |
13:43:23 | * | fredrikhr joined #nim |
13:50:32 | * | wgetch quit (Ping timeout: 256 seconds) |
13:50:57 | * | wgetch joined #nim |
13:51:30 | * | fredrikhr quit (Ping timeout: 260 seconds) |
13:54:04 | * | fredrikhr joined #nim |
13:54:13 | disruptek | +1 for moving pathutils into stdlib. |
13:56:46 | liblq-dev | well, I need another idea |
13:56:58 | liblq-dev | if concepts aren't gonna work, then what *is* gonna work? |
13:58:04 | liblq-dev | I can't just create a "tuple interface" because the Drawable implementer may be generic (like Mesh[V] is) |
13:59:17 | * | Romanson joined #nim |
14:01:13 | * | lritter joined #nim |
14:02:42 | dom96 | You can always just forget about concepts and use non-specific generics |
14:04:18 | liblq-dev | not really |
14:05:56 | liblq-dev | because then I get the same issue as with concepts |
14:06:17 | liblq-dev | where target.nim needs to import mesh.nim to have access to its draw procs |
14:06:43 | * | sagax joined #nim |
14:07:47 | * | fredrikhr quit (Quit: Client Disconnecting) |
14:20:13 | liblq-dev | so, I managed to reproduce that issue I had at the beginning: http://ix.io/2lh4/nim |
14:20:32 | liblq-dev | any ideas for workarounds? |
14:20:53 | * | gangstacat quit (Ping timeout: 272 seconds) |
14:23:46 | liblq-dev | wait what |
14:24:00 | liblq-dev | I just added `mixin draw` into my generic proc and huh |
14:24:04 | liblq-dev | it suddenly started working |
14:24:13 | liblq-dev | generics are confusing. |
14:25:08 | FromGitter | <alehander92> @bung87 yes |
14:25:13 | FromGitter | <alehander92> no |
14:25:21 | FromGitter | <bung87> ok |
14:26:26 | * | Vladar joined #nim |
14:27:09 | FromGitter | <alehander92> @bung87 sounds good! w |
14:27:23 | FromGitter | <alehander92> take a look at https://github.com/mcclure/dts2nim/ |
14:27:26 | FromGitter | <alehander92> and please |
14:27:31 | FromGitter | <alehander92> keep in mind, maybe you dont need this at all |
14:27:41 | * | mal`` quit (Ping timeout: 256 seconds) |
14:27:50 | FromGitter | <alehander92> i think we mostly need to transpile type definitions |
14:27:55 | * | mal`` joined #nim |
14:28:06 | FromGitter | <alehander92> because then we can just use the existing typescript code with updates and stuff |
14:28:22 | FromGitter | <alehander92> but of course translating more is interesting |
14:29:05 | FromGitter | <alehander92> but whatever is fun! |
14:30:28 | PMunch | http://ix.io/2lh7 <- Parametric Nim crown in OpenSCAD |
14:32:57 | PMunch | https://uploads.peterme.net/crown.png <- Render |
14:34:14 | FromGitter | <bung87> I checked it , 4 years ago , it generate bindings how it import js code? |
14:35:44 | FromGitter | <alehander92> no no |
14:35:48 | FromGitter | <alehander92> it generated bindings |
14:35:56 | FromGitter | <alehander92> but you just import those types |
14:35:58 | FromGitter | <bung87> binding cant easy check internal implementations |
14:36:03 | * | gangstacat joined #nim |
14:36:06 | FromGitter | <alehander92> but you dont want that |
14:36:18 | FromGitter | <alehander92> at least in my experience almost all the time |
14:36:28 | FromGitter | <alehander92> you just want to use the existing javascript libs |
14:36:31 | disruptek | ~stream |
14:36:32 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:36:32 | FromGitter | <bung87> yeah , translating is better I think |
14:36:33 | FromGitter | <alehander92> and if possible types for them |
14:36:50 | FromGitter | <alehander92> so , no, my point is that just translating the types is better i think |
14:36:56 | FromGitter | <alehander92> because transpilation is *much* harder |
14:37:07 | FromGitter | <alehander92> and then you need to transpile every update or dependencies etc |
14:37:09 | FromGitter | <alehander92> its much harder |
14:37:21 | FromGitter | <bung87> I get your point , it's hard |
14:37:29 | FromGitter | <alehander92> and the other thing is almost easy |
14:37:44 | FromGitter | <alehander92> and its what actual typescript users do anyway iirc |
14:37:58 | FromGitter | <alehander92> import the lib in the normal way, and use the types (and if you need, jsffi/cast) |
14:38:36 | FromGitter | <alehander92> again, if you find it fun, transpiling is great: i tried to do it for ruby/python etc, but just trying to let you know its mostly for fun, real world usage requires a looot of work |
14:38:46 | FromGitter | <alehander92> btw https://github.com/nim-lang/Nim/issues/14279 : broken |
14:38:48 | disbot | ➥ Nested await expressions regression: `await a(await expandValue())` doesnt compile ; snippet at 12https://play.nim-lang.org/#ix=2lhc |
14:39:04 | * | liblq-dev quit (Quit: WeeChat 2.8) |
14:39:14 | * | liblq-dev joined #nim |
14:39:28 | FromGitter | <alehander92> disruptek hey, i used discard asyncCall() several times these days |
14:39:30 | FromGitter | <alehander92> how times change |
14:40:17 | FromGitter | <bung87> yeah, I checked your project translate ruby to js, not success, seems opal is very closer |
14:40:33 | FromGitter | <alehander92> our project was about ruby to nim |
14:40:43 | * | krux02 quit (Remote host closed the connection) |
14:40:47 | opal | yo |
14:40:51 | FromGitter | <alehander92> opal is indeed working for ruby to js, but that's similar to what nim already does |
14:40:55 | FromGitter | <alehander92> oh .. hey .. opal |
14:40:56 | FromGitter | <alehander92> :D |
14:41:15 | opal | :p |
14:41:24 | FromGitter | <alehander92> you know about opal? :D |
14:41:35 | FromGitter | <bung87> opal ,not easy to handle the ruby regex to js |
14:41:59 | FromGitter | <alehander92> yeah but opal for ruby is basically nim for nim: nim already has a javascript backend |
14:42:28 | FromGitter | <alehander92> the regex languages that they use: i am not sure about that |
14:43:49 | FromGitter | <bung87> the js regex has no named group and ascii mode... |
14:43:59 | PMunch | Hmm, someone should register the user nim and just have it autojoin various programming channels and log highlights |
14:44:21 | disruptek | alehander92: you discarded a future?! |
14:44:33 | PMunch | dadada, if you can get enough gold you can now mould the crown: http://ix.io/2lh7 https://uploads.peterme.net/crown.png |
14:46:12 | * | PMunch quit (Quit: leaving) |
14:50:24 | * | nsf quit (Quit: WeeChat 2.8) |
14:52:59 | opal | "you know about opal?" yeah ive come across it |
14:53:13 | opal | i dont do ruby or js dev though so havent really looked into it deeply |
14:53:16 | zacharycarter | shashlick: where can I find the generated files that nimterop produces? |
14:53:29 | zacharycarter | is there like a default cache dir? |
14:54:45 | FromGitter | <kaushalmodi> I add this to the beginning of the nimterop based wrapper: ⏎ ⏎ ```static: ⏎ cDebug()``` ⏎ ⏎ and pipe the compilation output to a foo_wrapper.nim [https://gitter.im/nim-lang/Nim?at=5eb572b5f0377f1631762a8f] |
14:55:07 | FromGitter | <kaushalmodi> shashlick: Is this still the best way? |
14:55:22 | zacharycarter | ah thanks kaushalmodi |
14:55:28 | zacharycarter | that should work |
14:56:00 | FromGitter | <kaushalmodi> related feature request: https://github.com/nimterop/nimterop/issues/127 |
14:56:00 | disbot | ➥ [Feature] Option to dump debug in a file |
14:57:21 | zacharycarter | that worked perfectly - should have thought of that |
15:00:23 | FromGitter | <kaushalmodi> cool |
15:04:42 | Amun_Ra | do I get it right? I don't have to call NimMain() if I got GC turned off |
15:05:24 | leorize | nope you still have to call it |
15:05:35 | leorize | setting up the gc isn't the only thing that proc does |
15:06:22 | Amun_Ra | I see, thanks |
15:07:38 | FromDiscord | <codic> @Rika Let's see if it can finish in the next 5 days |
15:07:39 | FromDiscord | <codic> @mratsim I don't know if it's modular, it's competely random |
15:07:47 | FromDiscord | <codic> *completely |
15:08:18 | FromDiscord | <Rika> i doubt it will |
15:08:38 | FromDiscord | <mratsim> modular exponentiation is easy, otherwise you'll likely run out of memory with the number you try to exponentiate |
15:19:33 | dadada | does Nim have an iterator that allows to iterate over two items of a simple list (ie seq[string]) at a time |
15:19:47 | leorize | no we don't |
15:19:48 | dadada | for first, second doubleIter(mylist) ???? |
15:19:58 | leorize | not that hard to write one fwiw |
15:20:04 | dadada | yeah, I know |
15:20:18 | dadada | and will, just don't like to do things only because I don't know something exists |
15:21:00 | leorize | random fun fact: md5.getMD5(string) have side effects |
15:21:18 | FromDiscord | <Rika> why |
15:21:20 | leorize | I'm rather curious why an md5 hashing proc have side effects... |
15:22:02 | FromDiscord | <Rika> it doesnt look like it would have |
15:23:01 | leorize | !eval import md5; func m(); echo m(); func m() = getMD5("foo") |
15:23:03 | NimBot | Compile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <void> |
15:23:09 | leorize | !eval import md5; func m(); echo m(); func m(): string = getMD5("foo") |
15:23:11 | NimBot | Compile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <void> |
15:23:16 | leorize | !eval import md5; func m(): string; echo m(); func m(): string = getMD5("foo") |
15:23:18 | NimBot | Compile failed: /usercode/in.nim(1, 46) Error: 'm' can have side effects |
15:23:36 | leorize | it have side effects, and I have no idea why |
15:23:54 | leorize | faulty side effects evaluation? |
15:26:34 | * | waleee-cl joined #nim |
15:30:45 | FromGitter | <alehander92> disruptek yeah figure |
15:31:21 | FromGitter | <alehander92> :D |
15:32:08 | * | monokrom joined #nim |
15:40:24 | * | ptdel joined #nim |
15:40:58 | * | Vladar quit (Quit: Leaving) |
15:49:53 | FromDiscord | <dom96> alehander92: are you responding to disruptek on stream? |
15:53:34 | * | exelotl quit (Ping timeout: 240 seconds) |
15:59:36 | * | someunknownuser joined #nim |
16:00:36 | FromGitter | <alehander92> nope |
16:00:44 | FromGitter | <alehander92> to an old comment |
16:06:55 | FromDiscord | <clyybber> ~stream |
16:06:55 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
16:06:55 | disbot | stream: 11on btw |
16:07:14 | FromDiscord | <clyybber> alehander92: Really interesting programming going on here ^ ^ |
16:16:50 | FromGitter | <alehander92> i want my normal white background editors back!!! |
16:20:55 | FromDiscord | <Rika> how do i perform pointer arithmetic in nim lol |
16:21:03 | Yardanico | just do it 4HEad |
16:23:33 | FromDiscord | <Rika> ayy lmao segv |
16:23:36 | leorize | Rika: cast it to inv |
16:23:38 | leorize | int* |
16:23:47 | FromDiscord | <Rika> am doing so now |
16:28:11 | FromDiscord | <Rika> how do i read a cstring if i also have a length? the cstring has nulls in it |
16:28:36 | FromGitter | <alehander92> well .. thats not a good cstring |
16:28:42 | FromGitter | <alehander92> where do you get it from |
16:28:51 | FromDiscord | <Rika> lzma |
16:29:28 | FromGitter | <bung87> read it as string |
16:29:47 | FromGitter | <alehander92> or as a seq of bytes maybe |
16:30:34 | FromDiscord | <Rika> how would i read it as a string? |
16:31:10 | FromGitter | <bung87> show the code you get the cstring |
16:31:52 | FromDiscord | <Rika> wait |
16:31:54 | FromDiscord | <Rika> idea popped up |
16:32:02 | FromGitter | <bung87> you may simply declare the type to string ,avoiding using cstring type |
16:33:38 | FromGitter | <bung87> if the proc get the cstring that from c just declare the binding proc type to string |
16:34:24 | FromDiscord | <Rika> fixed it |
16:34:35 | FromDiscord | <Rika> yeah thats what i did |
16:35:37 | FromGitter | <bung87> this problem will occurs when you dealing with compress data or image things |
16:43:02 | * | abm quit (Ping timeout: 258 seconds) |
16:52:59 | * | screens_ joined #nim |
17:03:49 | * | abm joined #nim |
17:16:52 | * | Trustable joined #nim |
17:32:19 | * | Trustable quit (Remote host closed the connection) |
17:34:18 | * | Trustable joined #nim |
17:49:43 | * | exelotl joined #nim |
17:51:44 | * | someunknownuser quit (Quit: someunknownuser) |
18:00:53 | * | samuelb_ quit (Quit: Leaving) |
18:02:12 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:06:54 | * | dadada quit (Ping timeout: 256 seconds) |
18:08:53 | * | dadada joined #nim |
18:09:14 | * | ertp07 quit (Ping timeout: 240 seconds) |
18:09:16 | * | dadada is now known as Guest18755 |
18:10:45 | * | ertp07 joined #nim |
18:12:00 | FromDiscord | <Gary M> I'm doing |
18:12:00 | FromDiscord | <Gary M> ```nim |
18:12:00 | FromDiscord | <Gary M> extensionNames.setLen(extensionCount) |
18:12:00 | FromDiscord | <Gary M> var extNames = extensionNames.allocCStringArray() |
18:12:01 | FromDiscord | <Gary M> ``` |
18:12:01 | FromDiscord | <Gary M> but when I try to deallocCStringArray() afterwards I get `virtualFree failing` Error in the stack trace |
18:14:55 | * | ertp07 quit (Read error: Connection reset by peer) |
18:20:34 | leorize | Gary M: can I see the code? |
18:21:06 | leorize | Rika: newString() can take a length, then you can use that buffer directly |
18:22:21 | FromDiscord | <Avatarfighter> ^ when i learned you could do that it was game changing |
18:22:58 | * | avatarfighter joined #nim |
18:25:33 | FromDiscord | <clyybber> @Gary M I think you have to call vkCreateInstance before freeing it |
18:25:51 | FromDiscord | <clyybber> Same for vkCreateDevice |
18:26:57 | FromDiscord | <clyybber> And it could be that vulkan takes ownership of the cstringarray until you call vkDestroyInstance |
18:36:18 | * | ertp07 joined #nim |
18:39:29 | * | ertp07 quit (Read error: Connection reset by peer) |
18:42:43 | * | ertp07 joined #nim |
18:42:56 | FromDiscord | <Gary M> even trying to deallocate it after vkDestroyInstance isn't working @clyybber |
18:43:09 | FromDiscord | <clyybber> hmm |
18:43:12 | FromDiscord | <clyybber> weird |
18:43:24 | FromDiscord | <clyybber> I never encountered that issue because I never freed it :D |
18:43:38 | FromDiscord | <Gary M> lol |
18:47:30 | * | terps joined #nim |
18:49:15 | FromDiscord | <Rika> Leorize: I already know |
18:49:31 | FromDiscord | <Rika> I apparently made a string via that but coerced it into a carding |
18:49:35 | FromDiscord | <Rika> Cstring |
18:49:53 | FromDiscord | <Rika> Anyway good bye |
18:51:19 | Zevv | Is there an easier shortcut to create nim to a shared library, instead of collecing the C sources and passing it to gcc manually? |
18:51:47 | shashlick | --app:lib |
18:52:01 | Zevv | \o/ |
18:53:05 | FromGitter | <alehander92> clyybber i did repor that error that you linked to |
18:53:11 | FromGitter | <alehander92> and had a fix for one case of it |
18:53:20 | FromGitter | <alehander92> but i think the underlying problem is that |
18:53:28 | FromGitter | <alehander92> we need to somehow tmp-ize the |
18:53:30 | FromGitter | <alehander92> awaits |
18:56:44 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:58:10 | Zevv | Well that was easy, with arc using NPeg from C or C++ is pretty trivial. Never thought of that, yay! |
18:59:28 | leorize[m] | I tried to get coverage data of the entire stdlib |
18:59:49 | leorize[m] | and... looks like there isn't enough RAM to process that lol |
19:00:09 | leorize[m] | https://github.com/alaviss/Nim/runs/656825742?check_suite_focus=true#step:9:16088 |
19:05:20 | * | ptdel joined #nim |
19:12:32 | FromGitter | <alehander92> :O |
19:14:45 | FromDiscord | <clyybber> alehander92: AFAIK yglukhov looked into it, but I haven't heard from him since |
19:20:27 | FromGitter | <awr1> `@Gary M` you doing vulkan? |
19:20:58 | * | terps quit (Ping timeout: 256 seconds) |
19:21:10 | FromGitter | <awr1> for extensions/layers, etc. you just make a seq of cstrings and get addr to first element and cast to cstringArray |
19:23:23 | FromGitter | <alehander92> clyybber i think my comments describe what happens |
19:23:32 | FromGitter | <awr1> if you're trying to *query* extensions and layers, fairly easy, just get extension count, make a new seq, and tell vulkan to fill the seq in with `vkEnumerateInstanceLayerProperties` or whatever it is |
19:23:35 | FromGitter | <alehander92> i just didnt know if we need to handle all similar cases |
19:24:07 | FromGitter | <awr1> you shouldn't really be needing to use the cstring allocation stuff |
19:24:14 | FromGitter | <alehander92> but yeah in yglukhov surely has a more general/deep knowledge about it |
19:24:16 | FromGitter | <alehander92> sorry |
19:26:02 | FromGitter | <awr1> and even if you were, that's technically "long-lived data" so really leaks shouldn't matter that much for that. |
19:26:54 | federico3 | https://github.com/doctorn/micro-mitten have you seen this? |
19:27:06 | FromGitter | <awr1> the necessity of manual frees (or resets) in vulkan is more important when you're messing around with command buffers, etc. |
19:29:25 | FromGitter | <alehander92> i just saw it today |
19:29:28 | FromGitter | <alehander92> looks interesting |
19:30:55 | * | exelotl quit (Ping timeout: 260 seconds) |
19:34:47 | FromGitter | <sealmove> guys, do you know how to get seq `len` in gdb? |
19:35:10 | FromGitter | <sealmove> `print mySeq.len` outputs "There is no member named len." |
19:35:26 | FromGitter | <awr1> try calling `len(mySeq)` |
19:36:14 | FromGitter | <sealmove> doesn't work :| |
19:36:46 | FromGitter | <awr1> you may need to tab-complete len and myseq |
19:36:57 | FromGitter | <awr1> b/c they will probably be mangled |
19:38:53 | FromGitter | <alehander92> yeah |
19:38:56 | FromGitter | <alehander92> or you can |
19:39:00 | FromGitter | <alehander92> mySeq->SuP |
19:39:08 | FromGitter | <alehander92> and look at len / cap or something like that |
19:39:13 | FromGitter | <awr1> actually you may be able to get `len` via the dot |
19:39:26 | FromGitter | <awr1> but just remember `mySeq` will probably be mangled |
19:40:26 | FromDiscord | <Recruit_main707> this is almost the the finished version of the nim flatbuffers, it would be cool if you had a look at it, i can send it as playfround urls if you want, there are only 2 files |
19:40:26 | FromDiscord | <Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/708402953416998942/flatbuffers-nim.zip |
19:40:47 | FromGitter | <awr1> internal memory layout of seqs is like `struct SeqUnit { NI len, cap; Unit** d; };` |
19:41:55 | FromGitter | <sealmove> the variable names don't seem to be mangled |
19:42:00 | FromGitter | <awr1> yeah they aren't |
19:42:06 | FromGitter | <awr1> oh |
19:42:20 | FromGitter | <awr1> i mean that the internal fields aren't mangled |
19:42:46 | FromGitter | <sealmove> i can query the variables normally |
19:43:01 | FromGitter | <sealmove> it was surprising to me also because I read in an article they are mangled |
19:43:12 | FromGitter | <alehander92> nope |
19:43:19 | FromGitter | <alehander92> only on top level iirc |
19:44:00 | FromGitter | <sealmove> ah i see |
19:50:13 | * | ptdel quit (Remote host closed the connection) |
19:51:29 | * | ptdel joined #nim |
19:52:38 | * | avatarfighter quit (Ping timeout: 260 seconds) |
20:13:01 | * | avatarfighter joined #nim |
20:15:47 | * | NimBot joined #nim |
20:15:55 | FromGitter | <alehander92> i want to run a lot of random code |
20:16:11 | FromGitter | <alehander92> so i am ok with just separating my data structures for each call |
20:16:57 | FromGitter | <alehander92> and just join in the end, copying some stuff |
20:17:14 | FromGitter | <alehander92> can i somehow `#openmp` |
20:17:17 | FromGitter | <alehander92> i guess with emit i can |
20:17:37 | FromDiscord | <clyybber> alehander92: I would use weave |
20:17:43 | FromDiscord | <clyybber> It makes it really simple to do that |
20:19:21 | FromGitter | <alehander92> no |
20:19:26 | FromGitter | <alehander92> i really want to run random code |
20:19:42 | FromGitter | <alehander92> i feel like weave and builtin parallel blocks all require very specific |
20:19:50 | FromGitter | <alehander92> notions of code inside, right? |
20:20:05 | FromGitter | <alehander92> i literally want to run the nim parser as a lib |
20:20:08 | FromGitter | <alehander92> paralelly |
20:31:35 | * | exelotl joined #nim |
20:32:33 | * | solitudesf- quit (Remote host closed the connection) |
20:32:56 | * | solitudesf- joined #nim |
20:34:14 | FromDiscord | <clyybber> alehander92: Use threads and spawn |
20:34:30 | FromDiscord | <clyybber> And its probably best to use arc too |
20:36:26 | FromGitter | <alehander92> hm, but i dont want to |
20:36:29 | FromGitter | <alehander92> i mean, i want to |
20:36:38 | FromGitter | <alehander92> but i explicitly want to enforce running on n cores |
20:36:44 | FromGitter | <alehander92> can i do that without openmp? |
20:37:07 | FromGitter | <alehander92> its cpu bound |
20:37:14 | FromGitter | <alehander92> so i dont want just threads |
20:37:39 | FromGitter | <alehander92> about arc: i can try, good note! does it run the compiler well |
20:38:14 | FromGitter | <alehander92> i mean, i run part of the compiler itself(the parser etc) |
20:39:53 | * | narimiran quit (Quit: leaving) |
20:45:23 | FromDiscord | <clyybber> oh |
20:45:28 | FromDiscord | <clyybber> eh I don't think so |
20:45:33 | FromDiscord | <clyybber> best to not use it then I guess |
20:47:18 | FromGitter | <alehander92> hmm |
20:47:23 | FromGitter | <alehander92> otherwise weave might work |
20:47:26 | FromGitter | <alehander92> maybe i misjudged it |
20:47:38 | FromGitter | <alehander92> but i want to just try |
20:47:42 | FromGitter | <alehander92> with openmp directly first |
21:01:38 | leorize | isn't weave supposed to be faster than openmp? |
21:01:58 | * | idf quit (Ping timeout: 246 seconds) |
21:02:05 | FromDiscord | <clyybber> it is |
21:03:03 | FromGitter | <alehander92> i can find both eventually |
21:03:14 | FromGitter | <alehander92> i am mostly experiemting |
21:03:34 | FromGitter | <alehander92> with writing a small parallel toy compiler for beginning |
21:04:24 | FromGitter | <alehander92> later maybe making it bigger or generalizing it |
21:04:55 | FromGitter | <alehander92> but .. for now just figuring out uni 2nd year basics :D |
21:04:58 | FromGitter | <alehander92> probably |
21:08:28 | * | solitudesf- quit (Ping timeout: 272 seconds) |
21:09:05 | FromGitter | <Bennyelg> Alloah |
21:09:29 | FromGitter | <Bennyelg> How I can patch procedure for testing purposes ? |
21:17:58 | FromGitter | <Bennyelg> 1) What is the right hierarchy for tests? dedicated folder or next to the module itself ? |
21:19:07 | * | terps joined #nim |
21:19:13 | FromGitter | <kaushalmodi> @Bennyelg For more modules, there are `t*.nim` files |
21:24:33 | FromGitter | <kaushalmodi> e.g. `<nim repo>/tests/collections/ttables.nim` |
21:27:39 | * | Trustable quit (Remote host closed the connection) |
21:28:23 | * | ptdel quit (Remote host closed the connection) |
21:31:35 | * | idf joined #nim |
21:32:57 | * | liblq-dev quit (Ping timeout: 260 seconds) |
21:34:07 | * | avatarfighter quit (Ping timeout: 260 seconds) |
21:34:55 | * | liblq-dev joined #nim |
21:39:18 | * | krux02 joined #nim |
21:44:14 | * | terps quit (Ping timeout: 240 seconds) |
21:45:53 | * | thomasross joined #nim |
21:48:54 | * | idf quit (Ping timeout: 260 seconds) |
21:49:22 | * | ertp07 quit (Ping timeout: 260 seconds) |
21:49:53 | * | idf joined #nim |
21:59:54 | * | avatarfighter joined #nim |
22:14:18 | * | idf quit (Ping timeout: 256 seconds) |
22:46:05 | FromGitter | <matrixbot> `TheManiac™` Hi folks, Quick question... If I have successfully run `if f of Foo`, how do I call `Foo` methods on `f``? Should I use `cast`, or is there some other way? |
22:46:35 | FromGitter | <matrixbot> `TheManiac™` * Hi folks, Quick question... If I have successfully run `if f of Foo`, how do I call `Foo` methods on `f`? Should I use `cast`, or is there some other way? |
22:48:39 | * | tane quit (Quit: Leaving) |
22:52:12 | krux02 | you can just to conversion |
22:52:37 | krux02 | Foo(f).method(arg1,arg2) |
22:52:58 | FromGitter | <matrixbot> `TheManiac™` Aha. Thank you! |
22:53:32 | leorize | also, you can join us on IRC at #freenode_#nim:matrix.org |
22:53:56 | leorize | I'm pretty sure we got this linked on our homepage :/ |
23:00:41 | Prestige | Can I somehow retrieve an element of an OrderedSet by index? |
23:00:45 | Prestige | other than iteration |
23:02:17 | * | liblq-dev quit (Quit: WeeChat 2.8) |
23:18:32 | krux02 | no |
23:18:40 | krux02 | maybe this should be documented |
23:19:10 | krux02 | this ist not the first time somebody asks |
23:22:44 | * | Guest18755 quit (Ping timeout: 272 seconds) |
23:22:45 | * | avatarfighter quit (Ping timeout: 240 seconds) |
23:23:13 | Prestige | I'm wanting to get the element from a set after a currently matched element - trying to not produce more code than necessary to do so |
23:24:26 | krux02 | so you get an element fron an ordered set and then you want to get the next element that would come afterwards |
23:24:35 | krux02 | from the order that the set defines |
23:24:39 | Prestige | Right, essentially |
23:25:42 | Prestige | https://play.nim-lang.org/#ix=2lkn <- small example |
23:26:23 | Prestige | I could try caching the previous element and iterate in reverse, or maybe set a flag to grab the element on the next iteration, I suppose |
23:29:10 | krux02 | I looked at the implementation, and it looks like the implementation could provide such a functionality, but it doesn't provide it. |
23:29:35 | Prestige | Yeah I was thinking the same. Wish I can access to "data" |
23:30:38 | Prestige | Maybe I could submit a PR for a proc to get by index |
23:31:13 | krux02 | no don't do by index |
23:31:36 | krux02 | hash sets do not have an index. |
23:31:41 | * | dadada joined #nim |
23:32:04 | * | dadada is now known as Guest15243 |
23:32:07 | * | TheManiac[m] joined #nim |
23:32:20 | krux02 | The order of items in hash sets and maps is conceptually random. |
23:32:49 | krux02 | (in the language Go it is actually random) |
23:33:35 | krux02 | that means that you should not do such a thing such as index. Especially not, when the index doesn't math the position that you get with the `items*` iterator. |
23:34:05 | Prestige | in OrderedSet the data is backed by a seq to maintain insertion order though |
23:34:26 | krux02 | But something like ``proc next[T](s: OrderedSet[T], key: T): T`` i would approve |
23:34:39 | krux02 | no |
23:34:41 | krux02 | it is not |
23:35:02 | krux02 | the insersion order is preserved by a linking the items like a linked list |
23:36:19 | Prestige | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/sets.nim#L76 It looks like it's backed by a seq to me |
23:36:34 | krux02 | it is backed by a seq |
23:36:54 | krux02 | but the seq does not provide the insertion order |
23:37:07 | krux02 | look at `forAllOrderedPairs` template |
23:37:20 | krux02 | (which is used in the items iterator) |
23:37:33 | Prestige | Ah interesting |
23:37:37 | Prestige | Yeah that could work then |
23:37:54 | krux02 | the template is not exported |
23:38:04 | krux02 | it is an implementation detail |
23:38:15 | * | konvertex quit (Ping timeout: 260 seconds) |
23:38:26 | Prestige | That would be nice to have for my particular use case, at least |
23:46:44 | * | avatarfighter joined #nim |
23:47:43 | krux02 | well, as long as you don't have access to change the stdlib source code, you can still copy paset it to a file in your own project and use it there instead. |
23:48:16 | krux02 | then you can just export everything you need. |
23:55:26 | * | Guest15243 quit (Ping timeout: 258 seconds) |
23:56:26 | * | pbb quit (Ping timeout: 244 seconds) |
23:56:50 | * | pbb joined #nim |
23:58:27 | * | krux02 quit (Remote host closed the connection) |