<< 18-05-2021 >>

00:00:25FromDiscord<gavr> Cant understand whats wrong here https://media.discordapp.net/attachments/371759389889003532/844001440468566026/unknown.png
00:00:57FromDiscord<gavr> If I create var in global space then get error, if in some proc then all okey
00:02:37FromDiscord<ElegantBeef> What does `newCarousel` do?
00:02:55FromDiscord<gavr> https://media.discordapp.net/attachments/371759389889003532/844002067507839046/unknown.png
00:03:12FromDiscord<gavr> 818 is the first line here
00:03:38FromDiscord<gavr> and adw_carousel_new from C https://media.discordapp.net/attachments/371759389889003532/844002249675767828/unknown.png
00:04:45FromDiscord<gavr> https://github.com/gavr123456789/Katana/blob/master/src/view/MainWindow.nim#L10
00:05:22FromDiscord<gavr> All works if carousel not global, hmm
00:09:24FromDiscord<gavr> here all works without errors https://media.discordapp.net/attachments/371759389889003532/844003703874387988/unknown.png
00:14:28FromDiscord<evader`> which of the available vulkan nim bindings are sanest to use?
00:15:10FromDiscord<evader`> i see 3 but only 2 updated recently, nimgl and clyybber
00:28:01FromDiscord<ElegantBeef> I think the general reception is they're both good
00:28:47FromDiscord<ElegantBeef> Yea i'm uncertain why, if there isnt an issue already probably shoul make one
00:44:38*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:45:03*njoseph joined #nim
00:49:05FromDiscord<garett> Hello folks. Is it possible to forward-declare an object type?
00:50:41FromDiscord<garett> For me it would be useful because I want to `include` some platform-specific code that will define the members of the object type, and I want to provide a pointer to it as the public API
00:53:46*arkurious joined #nim
00:53:57*arkurious quit (Quit: Leaving)
00:55:41*nphg joined #nim
00:57:13*nphg1 quit (Ping timeout: 260 seconds)
00:58:17FromDiscord<ElegantBeef> I dont think the can, you can do this though, or use inheritance, but aside from that idk how you'd do that https://play.nim-lang.org/#ix=3naR
01:05:47*termer joined #nim
01:10:04*Tlangir joined #nim
01:15:00*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
01:15:22*Gustavo6046 joined #nim
01:29:30*krux02 quit (Remote host closed the connection)
01:45:41FromDiscord<garett> Thanks Beef
01:59:46*Tlanger joined #nim
02:02:36*Tlangir quit (Ping timeout: 268 seconds)
02:05:40FromDiscord<timotheecour> see https://nim-lang.github.io/Nim/manual_experimental.html#package-level-objects but I'm not sure it'll stay in the language, and I also don't like it, there should be better wayys
02:05:42FromDiscord<timotheecour> (edit) "wayys" => "ways"
02:06:13FromDiscord<ElegantBeef> Oh interesting, is that newly added?
02:06:17FromDiscord<timotheecour> (edit) "see https://nim-lang.github.io/Nim/manual_experimental.html#package-level-objects but I'm not sure it'll stay in the language, and I also don't like it, there should be better ways ... " added "(it's an obscure feature which I doubt people actually use, and for good reasons)"
02:06:34FromDiscord<timotheecour> nope, experimental, check git log
02:09:22FromDiscord<ElegantBeef> Ah i've missed it all these times apparently, a 2017 feature 😄
02:13:28FromDiscord<ElegantBeef> Well excuse me i need to print the entire manual, and tutorials out so i can read them wiht a magnifying glass 😄
02:13:46FromDiscord<Rika> you need to print every single revision
02:22:33*thomasross quit (Ping timeout: 240 seconds)
03:09:13FromDiscord<Gabben> In reply to @Hi02Hi "if you want that": Above, I showed examples that work with var. I can't understand why in one case it works, in the other it doesn't, even though the same thing is being done.↵I don't want to use ref in such a simple case, ref is more expensive than var
03:24:13FromDiscord<Rika> In reply to @Gabben "Above, I showed examples": the first example returns a copy that is mutable
03:24:21FromDiscord<Rika> ...i believe
03:24:45FromDiscord<Rika> so s is a copy of j
03:27:33FromDiscord<Rika> hm
03:27:37FromDiscord<Rika> i saw the second example
03:31:51FromDiscord<Rika> i dont know, the details of var returns are still weird
03:33:25*spiderstew_ joined #nim
03:34:34*spiderstew quit (Ping timeout: 245 seconds)
03:35:47FromDiscord<ElegantBeef> yea the object in two is right but it gets copied on return, i dont know why maybe cause only one owner of a `var` can be had at a time and it already exists with the `one.j`
03:36:04FromDiscord<Rika> it doesnt get copied on return
03:36:09FromDiscord<Rika> it gets copied on assignment to a var
03:36:33FromDiscord<Rika> thats strange
03:36:55FromDiscord<ElegantBeef> That's what i meant but yea
03:37:14FromDiscord<Rika> ah that makes sense i didnt understand what you said
03:38:47FromDiscord<ElegantBeef> It's not overly ideal but you can always use decls https://play.nim-lang.org/#ix=3nbl
03:42:24FromDiscord<ElegantBeef> Rika got any ideas i should implement for my heterogeneous seq library?
03:42:38FromDiscord<ElegantBeef> https://github.com/beef331/hseq
03:42:47FromDiscord<ElegantBeef> Context if you care to actually suggest things
03:49:56FromDiscord<Rika> not now
04:30:07FromDiscord<ElegantBeef> Ugh, the forloop macro not passing the parameter as typed is really causing trouble since i need to bindsym to look it up
04:30:24FromDiscord<ElegantBeef> So as soon as i moved the test to another file, it exploded
04:31:26*rockcavera quit (Remote host closed the connection)
04:33:30FromDiscord<ElegantBeef> Well if anyone has an idea around that, which doesnt involve a new `foreach` macro, i'm all ears 😄
04:40:38*narimiran joined #nim
04:48:10*Gustavo6046 quit (Ping timeout: 240 seconds)
05:07:10FromDiscord<timotheecour> either of these would solve your problem IIUC:↵ https://github.com/nim-lang/Nim/pull/11754↵ https://github.com/nim-lang/RFCs/issues/345
05:13:00FromDiscord<ElegantBeef> Ah yea seems they would, for now either `include` or a custom `foreach` needs to be made i guess
05:21:33*narimiran quit (Ping timeout: 265 seconds)
05:48:46*a_chou joined #nim
06:07:12*a_chou quit (Quit: a_chou)
06:43:20*Vladar joined #nim
06:53:29*tane_ joined #nim
06:55:50*narimiran joined #nim
07:21:14ForumUpdaterBotNew thread by Viralpoetry: Pkcs11 implementation, see https://forum.nim-lang.org/t/7996
08:36:26*PMunch joined #nim
08:42:16*Tlanger quit (Remote host closed the connection)
08:45:43*pbb quit (Ping timeout: 260 seconds)
08:46:42*krux02 joined #nim
09:00:18*blaumetallic[m] quit (Quit: Idle for 30+ days)
09:10:53*pbb joined #nim
09:11:54*mindhunt1r0x is now known as mindhunter0x
09:16:39*Vladar quit (Remote host closed the connection)
09:20:11*Vladar joined #nim
09:36:27*clyybber joined #nim
09:42:07*grobe0ba quit (Ping timeout: 252 seconds)
09:42:39*grobe0ba joined #nim
09:59:05*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
10:13:39FromDiscord<mlokis> @madman i cannot really send you direct messages any more
10:22:43FromDiscord<madman> why
10:23:10FromDiscord<madman> @mlokis
10:25:19FromDiscord<madman> send me a friend request, i cannot send you one
10:31:36*arkurious joined #nim
11:23:21*clyybber quit (Quit: WeeChat 3.1)
11:25:04*clyybber joined #nim
11:26:38*Kaivo left #nim ("WeeChat 3.0.1")
11:28:38FromDiscord<FireWire> sent a code paste, see https://play.nim-lang.org/#ix=3ndd
11:29:22FromDiscord<FireWire> i know its something along the lines of `nimble install [email protected]` but that doesnt seem to work and just redirects to the borked path
11:32:34FromDiscord<FireWire> sorry if it seems trivial, still a bit new to nim and still trying to figure stuff out
11:35:47FromDiscord<Rika> There's a stray extra # in the url
11:36:19FromDiscord<Rika> Basically the nimble file of that package is malformed
11:36:42FromDiscord<amadan> hey, takes my package!↵for some reason when I had it has dimscord@#d3a127d it wasn't getting the right commit
11:37:12FromDiscord<amadan> I'll double check my nimble file then
11:38:37FromDiscord<amadan> (edit) "I'll double check my nimble file then ... " added "(don't know how it worked with the ## now so sorry about that)"
11:40:00FromDiscord<amadan> @FireWire could you try and install it again
11:40:29FromDiscord<FireWire> woo it works now
11:40:31FromDiscord<FireWire> thx!!
11:41:11FromDiscord<amadan> huzzah! you can also ping me if you have any more errors with it
11:41:21FromDiscord<FireWire> will do!
11:42:14*xet7 quit (Remote host closed the connection)
11:43:27*xet7 joined #nim
11:49:28*clyybber quit (Quit: WeeChat 3.1)
11:50:30*clyybber joined #nim
11:56:20FromDiscord<OffenseTeacher> Hey guys, I have been trying to find how to implement Linker options as in C/C++ (ex: ↵#pragma comment(linker,"/export:SystemFunction006=cryptsp_orig.SystemFunction006,41@"))↵↵I have tried to surround it using the emit pragma and it does seem to appear in the generated c code. However it makes no difference in the end. Is there a better way to do it with Nim ?
11:56:34FromDiscord<OffenseTeacher> (edit) "(ex:" => "Ex:" | "comment(linker,"/export:SystemFunction006=cryptsp_orig.SystemFunction006,41@"))↵↵I" => "comment(linker,"/export:SystemFunction006=cryptsp_orig.SystemFunction006,41@")↵↵I"
11:59:42FromDiscord<haxscramper> Have you tried `{.passl: "<linker options go here>".}`?
12:00:25FromDiscord<OffenseTeacher> absolutely not ! Will go read on that
12:00:31FromDiscord<haxscramper> Assuming `#pragma ...linker` has something related to linker though
12:01:00FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passl-pragma
12:01:26FromDiscord<OffenseTeacher> I am trying in fact to do dll proxying: https://itm4n.github.io/dll-proxying/
12:03:37*hyiltiz quit (Ping timeout: 260 seconds)
12:04:23FromDiscord<OffenseTeacher> It allows to redirect a program that try to load your dll for a specific function to the legitimate dll's function address. In the example I provided in C/C++, it create a redirection for any call to the SystemFunction006 function -> to the SystemFunction006 function of cryptsp_orig.dll
12:05:39FromDiscord<haxscramper> From https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=msvc-160#linker I would assume `{.passl:` is fully equivalent
12:06:14FromDiscord<haxscramper> So in your case it would be `{.passl: "/export:SystemFunction006=cryptsp_orig.SystemFunction006,41@".}`
12:07:12FromDiscord<haxscramper> When nim compiles it generates `.json` file with compilation commands in the cache directory (can set it explicitly with `--nimcache`) - you can check if linked options were passed correctly
12:07:37FromDiscord<OffenseTeacher> wow! Thanks I will try it right away. Thanks alot 🙂
12:13:31FromDiscord<OffenseTeacher> I would guess it works a bit differently.. I have tried including the cryptsp_orig.dll in the same folder without success↵x86_64-w64-mingw32-g++: error: /export:SystemFunction006=cryptsp_orig.SystemFunction006,41@: No such file or directory
12:14:04*hyiltiz joined #nim
12:14:04*hyiltiz quit (Changing host)
12:14:04*hyiltiz joined #nim
12:17:44FromDiscord<haxscramper> for `g++` you need to pass command line options, maybe `-export:...` will work
12:18:13FromDiscord<haxscramper> But I don't know exactly it translates from windows to unix-style CLI options
12:23:19FromDiscord<Ashii> @swogginimm
12:23:58ForumUpdaterBotNew post on r/nim by GaiaPagan: Nim?, see https://reddit.com/r/nim/comments/nf9aqs/nim/
12:27:12*rockcavera joined #nim
12:31:18FromDiscord<OffenseTeacher> sent a long message, see http://ix.io/3ndu
12:32:22PMunchThat looks like some escaping/file naming issue
13:02:57Zoom[m]Hm. It seems you can't create an immutable array relying on automatic initialization, since `let` requires the explicit init. It's annoying as there's no `initWith` for arrays. Do you think this qualifies as a bug?
13:07:54FromDiscord<haxscramper> I suppose you can create array with let and them `move` it
13:08:15FromDiscord<haxscramper> `let arr = (var arr: array[255, int]; move(arr))`
13:08:48Zoom[m]huh, clever
13:08:50FromDiscord<haxscramper> I'm not sure if you need to `move` there though
13:09:02FromDiscord<haxscramper> Maybe just `arr;` will be sufficient
13:09:08*Edoardo[m]1 joined #nim
13:09:29FromDiscord<haxscramper> But then I don't quite follow what is the use case for this array ... it will always contain identical immutable elements
13:09:50*Edoardo[m]1 left #nim (#nim)
13:10:12*Edoardo[m]1 joined #nim
13:12:48Zoom[m]It's going to be appended (moved perhaps) to another container, so the mutability doesn't really matter, I just default to `let` and noticed I can't :D
13:14:46*narimiran quit (Ping timeout: 240 seconds)
13:22:10FromDiscord<Vindaar> @ElegantBeef Just had a look at the `hSeq` repo. Shouldn't `filter` do the opposite of what it does? I.e. keep the argument and drop everything else? `filter` should be `drop` instead and `filter` keeps every type given
13:23:08*alri[m] quit (Ping timeout: 276 seconds)
13:23:41*dithpri[m] quit (Ping timeout: 245 seconds)
13:23:41*Benjamin[m]1 quit (Ping timeout: 245 seconds)
13:24:06*ronny quit (Ping timeout: 245 seconds)
13:24:06*cheer[m] quit (Ping timeout: 245 seconds)
13:25:57FromDiscord<Vindaar> also regarding the `foreach`: An alternative for more friendly syntax might be what @mratsim did in loop fusion or nowadays in laser (and now arraymancer). See the `forEach` macro here:↵https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/strided_iteration/foreach.nim#L240-L246↵↵But of course, this is all WIP and I don't want to distract you too much, haha
13:27:08*alri[m] joined #nim
13:29:21*Benjamin[m]1 joined #nim
13:29:40*dithpri[m] joined #nim
13:30:17Clonkk[m]Is it possible to order walkDir alphabetically ?
13:30:38*cheer[m] joined #nim
13:32:33*surma quit (Ping timeout: 246 seconds)
13:32:45FromDiscord<Vindaar> I suppose no, because it's probably yields by inode number or something like this. I guess you will have to store the files in a temp seq and sort that instead
13:33:53*omnigoat quit (Ping timeout: 250 seconds)
13:34:15*ronny joined #nim
13:34:27*r4vi quit (Read error: Connection reset by peer)
13:35:51*r4vi joined #nim
13:38:12*surma joined #nim
13:38:46*omnigoat joined #nim
14:00:43*teiresia1 joined #nim
14:00:50*hyiltiz quit (Quit: No Ping reply in 180 seconds.)
14:01:30*Jesin quit (Ping timeout: 240 seconds)
14:01:30*teiresias quit (Remote host closed the connection)
14:01:30*ForumUpdaterBot quit (Remote host closed the connection)
14:01:59*ForumUpdaterBot joined #nim
14:02:08*hyiltiz joined #nim
14:02:09*hyiltiz quit (Changing host)
14:02:09*hyiltiz joined #nim
14:04:11*FromGitter quit (Ping timeout: 240 seconds)
14:04:31*casaca quit (Ping timeout: 265 seconds)
14:04:33*FromGitter joined #nim
14:09:00FromDiscord<mratsim> In reply to @Vindaar "<@!145405730571288577> Just had a": There is my forZip macro as well: https://github.com/numforge/loop-fusion
14:43:53*pbb joined #nim
14:52:59*narimiran joined #nim
15:26:18*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
15:26:46*sz0 quit (Quit: Connection closed for inactivity)
15:27:14*pbb joined #nim
15:37:54*teiresia1 quit (Changing host)
15:37:54*teiresia1 joined #nim
15:38:13*teiresia1 is now known as teiresias
15:41:27*PMunch quit (Quit: leaving)
15:44:19*MarderIII joined #nim
15:47:33*Gustavo6046 joined #nim
15:50:02ForumUpdaterBotNew thread by Mantielero: JS FFI - getting started, see https://forum.nim-lang.org/t/7997
15:58:06*Jesin joined #nim
16:02:24*a_chou joined #nim
16:03:54*casaca joined #nim
16:12:23*ablive joined #nim
16:18:12*ablive quit (Quit: ChatZilla 0.9.96 [SeaMonkey 2.53.7.1/20210410163459])
16:21:02FromDiscord<TurtleP> any ideas why this would kill my app? <https://github.com/TurtleP/nestlink/blob/master/client/main.nim#L35> Here's the relevant file that I created the function in <https://github.com/TurtleP/nestlink/blob/master/client/message.nim>
16:21:58*hendursa1 joined #nim
16:23:08*SebastianM joined #nim
16:24:00*SebastianM quit (Quit: ChatZilla 0.9.96 [SeaMonkey 2.53.7.1/20210410163459])
16:32:08*a_chou quit (Quit: a_chou)
16:39:55FromDiscord<kraken> hello, i think there are some issues with the forum registration
16:40:38FromDiscord<kraken> i've tried registering and it says too many emails have been sent to the address but i see no email, or eventually when i click the button to register it says internal error
16:40:41FromDiscord<Chem> @krakenAre you `kunitoki` by chance?
16:40:48FromDiscord<kraken> yes i am
16:41:19FromDiscord<Chem> Oh hey = D I love your work on `popsicle`, I am `GavinRay` from issue comments
16:41:28FromDiscord<kraken> hey there ! nice to see you
16:41:32FromDiscord<kraken> thank you
16:41:49FromDiscord<kraken> i'm actually working on popsicle for nim 😄
16:41:56FromDiscord<kraken> but i'm new to the language
16:42:01FromDiscord<Chem> You're doing JUCE -> Nim?!
16:42:04FromDiscord<kraken> so it will take some time
16:42:09FromDiscord<kraken> yes it's in progress
16:42:16FromDiscord<Chem> I have also been experimenting with this, that's amazing!
16:42:18FromDiscord<Chem> 😅
16:42:19FromDiscord<kraken> i need a compiled version
16:42:30FromDiscord<kraken> great, we could maybe joint the effort
16:42:33FromDiscord<kraken> (edit) "joint" => "join"
16:42:38FromDiscord<Chem> yeah, let's do it = D
16:42:49FromDiscord<kraken> oh, need to run now. see you later
16:42:53FromDiscord<Chem> o7
16:42:57FromDiscord<kraken> bad luck of family timing
16:43:00FromDiscord<kraken> cheers
16:50:19FromDiscord<Chem> sent a code paste, see https://play.nim-lang.org/#ix=3ney
16:50:49FromDiscord<Chem> I assume you could template the class names as strings but actually enforcing from a type-safety point that the methods/interfaces are satisfied might not be possible 🤔
16:54:09*letto quit (Read error: Connection reset by peer)
16:56:25*letto joined #nim
16:58:43FromDiscord<timotheecour> In reply to @Clonkk "Is it possible to": once https://github.com/nim-lang/fusion/pull/32 will be merged (hopefully in stdlib instead of fusion), you'll be able to efficiently recursively list files/dirs in order (without having to store all results in memory at any point, only at most (N) where N = max entries per dir)
17:12:13FromDiscord<Chem> Multiple inheritance boils down to a vtable with a predefined number of methods right?↵So in theory if Nim emits a struct/class that has an identical number of function pointers in it's vtable in the right order, from a compiler's point of view are they equivalent?↵↵If that is the case, could you do a compile-time check using some kind of macro `mixin`/`extends` syntax that verifies all the member functions are present + have the right
17:12:46FromDiscord<Chem> (I dunno much about compilers or low level stuff)
17:16:44*willyboar joined #nim
17:23:20FromDiscord<timotheecour> sent a long message, see http://ix.io/3neP
17:23:25*hendursa1 quit (Quit: hendursa1)
17:23:59FromDiscord<Chem> sent a code paste, see https://play.nim-lang.org/#ix=3neQ
17:24:32FromDiscord<Chem> (edit) "https://play.nim-lang.org/#ix=3neQ" => "https://play.nim-lang.org/#ix=3neR"
17:25:02FromDiscord<Chem> (edit) "https://play.nim-lang.org/#ix=3neR" => "https://play.nim-lang.org/#ix=3neS"
17:25:51*hendursaga joined #nim
17:25:55FromDiscord<Chem> In reply to @timotheecour "> Is it possible": Ahh, that makes sense. So in theory should be possible at compile-time with some work, just not at runtime because of those limitations?
17:28:48hendursagaHello! I'm new to Nim, I had a quick question: given that Nim targets C, how possible/easy is it to create bindings for that C target for, say, Python or Ruby or whatnot?
17:29:05*beshr joined #nim
17:29:55hendursagaIs there some tool or scripts or other that could ease said creation?
17:31:37FromDiscord<timotheecour> > Is there some tool or scripts or other that could ease said creation?↵search c2nim, nimterop, nimpy
17:32:38FromDiscord<hugogranstrom.nim> Yes Nimpy and even Nimporter may be of interest (https://github.com/Pebaz/Nimporter)
17:32:50FromDiscord<hugogranstrom.nim> https://github.com/yglukhov/nimpy
17:36:40hendursagaHow "different" is C-from-Nim from "idiomatic" C? Would a C programmer with no Nim experience have much trouble linking and whatnot?
17:37:50FromDiscord<Chem> Do you mean calling OTHER C code from Nim, or instead stopping Nim from compiling the C code and compiling it yourself
17:38:40hendursagaThe latter.
17:38:56hendursagaSorry if I wasn't clearer.
17:39:55FromDiscord<Chem> A bit of an odd usecase but you can emit the C files or obj files to a local directory and then you need to link the RTL in some cases I think↵Other folks will know better
17:40:07FromDiscord<Chem> It's semi-readable in `-danger` mode
17:40:51hendursagaAh. I just would need the API/ABI to be predictable.
17:41:12FromDiscord<Chem> Oh, you control that directly
17:41:23FromDiscord<timotheecour> > So in theory should be possible at compile-time with some work, just not at runtime because of those limitations?↵that's my understanding; see also https://forum.dlang.org/thread/[email protected]?page=1 but not sure it maps well to nim.
17:42:12FromDiscord<Chem> In reply to @timotheecour "> So in theory": I think we're on the same page 😅 , I was experimenting with this, embedding the "extended" class fields inside
17:42:33FromDiscord<Chem> without actually "inheriting" anything -- then trying to interop from C++ with `dynamic_cast<T>` and seeing if it works
17:42:45FromDiscord<Chem> thank you, I will keep digging more on this = )
17:43:52FromDiscord<timotheecour> > Ah. I just would need the API/ABI to be predictable.↵ya, it's no problem, see also `nim --app:lib|staticlib`, or just compile with `nim --hint:cc --hint:link --listcmd` to see the compilation + link commands ; note that the emitted C is not C-idiomatic but indeed readable (as mentioned eariler, even more readable with -d:danger)
17:46:08hendursagaThat sounds workable, I'll go through some more tutorials and see if I have any additional questions :)
17:47:00FromDiscord<timotheecour> (i mean of course, anything is possible, and importcpp classes could be made to support multiple inheritance just for C++ interop, but it's really unclear whether this is a good idea, it's even more clear that there's more useful things to do in nim on the C++ interop side to improve things)
17:54:42FromDiscord<Chem> Yeah that's reasonable. Only reason I ask is in the case of headers where the implementation "requires" multiple inheritance.↵↵But I'm not very familiar with C++ and it could be very possible that if you just have a class with all the same methods, whether you declare the inheritances or not, it will work.
17:54:53FromDiscord<Chem> I should probably test on Godbolt really quick just to see
17:56:21FromDiscord<Chem> I might spend some time working on a Nim adapter for `clang-cpp`/`LibTooling` based codegen from C++ headers, that have been working on for D
18:00:50FromDiscord<timotheecour> maybe create a repo so others can contribute?
18:01:12FromDiscord<VinKer> Hi all, I don't know how many lines are in my file. How do I call the readLine proc ?
18:01:20FromDiscord<timotheecour> (edit) "contribute?" => "contribute ?"
18:01:41FromDiscord<VinKer> (edit) "readLine" => "readLines"
18:03:42FromDiscord<timotheecour> https://nim-lang.github.io/Nim/io.html#lines.i%2Cstring
18:03:51*MarderIII quit (Quit: Leaving)
18:04:58FromDiscord<VinKer> @timotheecourBut that's a string. I need a seq[string]
18:05:10FromDiscord<timotheecour> `toSeq(lines(f))`
18:05:40FromDiscord<VinKer> Let me check what this toSeq does. Thanks 🙂
18:10:14FromDiscord<VinKer> @timotheecour Thanks, it worked. But if we read the documentation of toSeq, we won't know that it is capable of splitting string into a seq.
18:10:47FromDiscord<timotheecour> it's not splitting a string, read manual section on iterators
18:13:39FromDiscord<VinKer> If it's not splitting a string, then how come the seq is filled with each line on that file. I wonder
18:14:26FromDiscord<Tavon> It's equivalent to↵var a = newSeq[string]()↵for i in lines(f):↵ a.add(i)
18:14:50ForumUpdaterBotNew post on r/nim by piperman7: How to create a file upload server?, see https://reddit.com/r/nim/comments/nfhtxu/how_to_create_a_file_upload_server/
18:15:39FromDiscord<VinKer> That's confuisng, because, the doc of "lines" says that it returns a string. Means all text from the file as a single string.
18:16:34FromDiscord<VinKer> AFAIK, if a string is iterable, then we can iterate each character.
18:16:43FromDiscord<VinKer> Please correct if I am wrong
18:16:56FromDiscord<timotheecour> again, read the manual on iterators, it'll clarify.
18:17:01FromDiscord<VinKer> Okay
18:17:37FromDiscord<timotheecour> (edit) "again, read the manual on iterators, it'll clarify. ... " added "after that, you can ask again here."
18:17:44FromDiscord<timotheecour> (edit) "here." => "here if still unclear."
18:20:38FromDiscord<VinKer> I am sorry to bother you, but I failed to understand what you said. Doc of Iterators say that "Iterates over each item of a"
18:20:56FromDiscord<Tavon> lines returning a string means each iteration of the function will return a string
18:21:44FromDiscord<VinKer> I thought, lines is returning the whole string
18:22:40FromDiscord<VinKer> My bad.
18:23:03FromDiscord<VinKer> The doc of "lines" clearly say that - "iterate over any line in the file f"
18:23:33FromDiscord<VinKer> Thank you guys for your time.
18:38:16FromDiscord<Traveler> Hi, I recently learned about nim and i am interested in getting into this language. In my day to day I interface a lot with python code, and I see that nimpy offers this interfacing with python. The git repo implies that interactions works perfect from python -> nim but not the other way around. The biggest omision seems to be the type export, is anyone here aware of allowing extensions to be seen as classes under python similar to how p
18:42:04FromDiscord<Hi02Hi> Hi, I am not an expert on py<->nim, but i found this talk about it↵It also gives a minimal intro to nim↵https://www.youtube.com/watch?v=IVgNVJdizHg
18:43:44FromDiscord<Traveler> Will have a look, the nim-pymod repo I also found but last update was some years ago; which made me a bit worried ;-)!
18:44:31ForumUpdaterBotNew thread by Etorres404: Dynamic size limit for sets, see https://forum.nim-lang.org/t/7998
18:58:44*NimBot joined #nim
19:00:22*Gustavo6046 quit (Ping timeout: 252 seconds)
19:05:04*void09 joined #nim
19:33:03FromDiscord<kunitoki> i keep getting this Unknown error occurred in the forum registration https://media.discordapp.net/attachments/371759389889003532/844296546190622720/unknown.png
19:33:27FromDiscord<kunitoki> is this to prevent more new joiners from entering ? 😄
19:34:40FromDiscord<kunitoki> btw, i noticed that Nim doesn't respect immutability when importcpp is involved and there are mistakes in proc constness mapping
19:35:18FromDiscord<kunitoki> not sure if it's normal, but i think it should prevent code from compiling when it doesn't respect invariants
19:35:36FromDiscord<kunitoki> consider this snippet
19:36:43FromDiscord<kunitoki> sent a code paste, see https://play.nim-lang.org/#ix=3nfq
19:36:56FromDiscord<kunitoki> this prints "def"
19:37:06FromDiscord<kunitoki> it compiles and everything
19:37:20FromDiscord<ElegantBeef> Yea i think it explictly states that it doesnt handle immutability for imported types
19:37:21FromDiscord<kunitoki> i was expecting the c++ compiler to boom
19:37:53FromDiscord<kunitoki> it's a ticking bomb, especially if someone forget the `var`
19:38:51FromDiscord<ElegantBeef> Yea i was right https://nim-lang.org/docs/manual.html#statements-and-expressions-let-statement
19:39:57FromDiscord<kunitoki> In reply to @ElegantBeef "Yea i think it": well, in c++ at least if a variable is declared const, mutating it is UB
19:40:57FromDiscord<kunitoki> i will try to compile generated cpp code by nim with ubsan and see what happens. i saw a bunch of C style casts in c++ generated code
19:41:04FromDiscord<ElegantBeef> I'd reason the best way to do this is to wrap the object with a nim object so immutability holds
19:41:08FromDiscord<kunitoki> (edit) "happens." => "happens 😄 ."
19:41:30FromDiscord<kunitoki> yeah probably that's a good idea
19:41:59FromDiscord<kunitoki> anything `import` in Nim ends up being unsafe
19:42:56FromDiscord<kunitoki> also found this today, a SIGSEGV in the compiler
19:42:57FromDiscord<kunitoki> https://github.com/nim-lang/Nim/issues/18042
19:43:25FromDiscord<kunitoki> it's maybe a silly example (not sure if it is even valid)
19:43:38FromDiscord<kunitoki> but at least the compiler should not seppuku 😄
19:44:42FromDiscord<kunitoki> is there a more recent release of the nim compiler after 1.4.6 ?
19:45:52FromDiscord<zetashift> As in stable? No but you can download devel with choosenim
19:45:54FromDiscord<ElegantBeef> The issue is the distinct, there is no other enum 😄
19:46:13FromDiscord<kunitoki> yeah i know it's silly
19:46:50FromDiscord<kunitoki> probably `type X = distict enum Y` crashes as well
19:46:57FromDiscord<ElegantBeef> Yea with invalid indentation
19:47:40FromDiscord<ElegantBeef> Which is a general "you fucked up hard" message sometimes 😄
19:48:24FromDiscord<kunitoki> doh
19:49:13FromDiscord<kunitoki> In reply to @zetashift "As in stable? No": thanks
19:49:26FromDiscord<ElegantBeef> distinct is for creating a same but type different type of an already existing object, so it's expected to error with `distinct enum` 😄
19:49:41FromDiscord<ElegantBeef> (edit) "object," => "type,"
19:50:02FromDiscord<kunitoki> yeah, but i prefer a "you fucked up hard" than SIGSEGV 😄
19:50:22FromDiscord<ElegantBeef> Lol indeed, just explaining why if you didnt know why
19:53:00*beshr quit (Remote host closed the connection)
19:58:38*Gustavo6046 joined #nim
20:03:27FromDiscord<kunitoki> btw i have not really clear the distinction between Error and Defect
20:03:42FromDiscord<kunitoki> it seems like defects are converted into panics ?
20:04:59ForumUpdaterBotNew thread by SimplyZ: Concept containing seq of self, see https://forum.nim-lang.org/t/7999
20:08:37FromDiscord<ElegantBeef> defects are not supposed to be caught and supposed to be designed around, errors are supposed to be managed
20:19:37FromDiscord<kunitoki> yeah i see
20:26:10*narimiran quit (Ping timeout: 252 seconds)
20:29:35FromDiscord<carpal> In reply to @ElegantBeef "distinct is for creating": 😄 😄 :smiel
20:29:38FromDiscord<carpal> (edit) ":smiel" => "😄"
20:30:30*Vladar quit (Remote host closed the connection)
20:31:55FromDiscord<zidsal> so I'm writing a triplestore (tuple of subject, predicate, object). Currently my `query()` function always returns a sequence of tuples but I'm wondering how I can support selecting specific data e.g. `select subjects where ....'` would instead return a sequence of subjects.↵↵Is there anyway to do something like the following https://play.nim-lang.org/#ix=3nfB
20:36:37FromDiscord<ElegantBeef> Not that i know of, the issue is that the return type is calculated at compiletime but the logic needs to be done at run time, so you need runtime logic to change the behaviour
20:37:03FromDiscord<ElegantBeef> I faced a similar issue with my hseq stuff and i just made a custom macro that allows differentiation internally
20:37:46FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3nfF
20:38:19FromDiscord<zidsal> are you saying you always return yourT and then you wrote some helper macro's to easily extract the responses once you've run your query??
20:39:07FromDiscord<zidsal> I don't know why I double question marked that, that's not outrageous at all I need sleep
20:40:37FromDiscord<ElegantBeef> Basically it's just expanded into your case body like you have in test, so you need to have an `Option[T]` for each value so you can set it and figure out which you set
20:41:38FromDiscord<zidsal> ah I'm with you now
20:42:14FromDiscord<zidsal> shame I was looking forward to building my own querying language for the in memory database, but it seems pointless now that I can't really define the return types!
20:42:47FromDiscord<ElegantBeef> Yea welcome to static typing 😛
20:43:34FromDiscord<zidsal> pretty sure typescript can handle that so its def possible! who wants to write the rfc to make nim's type system turing complete
20:43:46FromDiscord<zidsal> (edit) "possible!" => "possible for a static typed language!"
20:45:26FromDiscord<zidsal> infact https://github.com/codemix/ts-sql shudders
20:45:28FromDiscord<ElegantBeef> Well i have an idea, so dont go to sleep right now 😛
20:45:41FromDiscord<zidsal> 😛 I'm going to get a coffee
20:51:57FromDiscord<ElegantBeef> Hmm all i've got is a slightly non annoying object variant now https://play.nim-lang.org/#ix=3nfG 😄
20:53:31*tane_ quit (Quit: Leaving)
21:00:59*zyklon joined #nim
21:01:17*uvegbot quit (Ping timeout: 246 seconds)
21:04:36*thomasross joined #nim
21:07:15*pbb quit (Ping timeout: 260 seconds)
21:09:25*uvegbot joined #nim
21:09:37*zyklon quit (Ping timeout: 252 seconds)
21:29:59FromDiscord<zidsal> hmm I think I've resigned to having to do this with multiple methods, althought I wonder if I can do something nasty so that its one method that takes a typedesc of either a subject, predicate, object or of any combination of the above (should only be 7 permutations) .↵↵That way it becomes something like `query(SubjectPredicate, "where ....")`
21:30:45FromDiscord<zidsal> if you always have to pass in a typedec then I suspect a macro / template can do this as you provide that info at compile time
21:41:54FromDiscord<zidsal> so something like https://play.nim-lang.org/#ix=3nfP, then I can use a macro to return different stuff depending on the typedesc maybe
21:41:55FromDiscord<zidsal> (edit) "maybe" => "maybe?"
21:57:40FromDiscord<Vindaar> if I understand you correctly, that's already achieved by a regular generic. So what you wrote is almost what simply works: ↵https://play.nim-lang.org/#ix=3nfU↵↵There's a bit of freedom how exactly to write this, but as long as you hand something at CT that determines the return type, it's not a problem
22:11:40FromDiscord<zidsal> perfect thanks guys
22:15:03*kayabaNerve_ joined #nim
22:15:17*kayabaNerve_ is now known as kayabaNerve
22:15:24kayabaNerveWho maintains the brew formulas for Nim?
22:15:30kayabaNerveAlso, same question yet for the Docker images.
22:15:36kayabaNerveBoth are missing multiple Nim versions :/
22:16:17kayabaNerveAnd choosenim doesn't handle ARM Macs, even just via offloading to Rosetta (I do understand the lack of upstream binaries)
22:18:50kayabaNerveI wrote my own Nim 1.2.12 Dockerfile ages ago, not really an active concern for me, yet the brew thing is as the only alt is having users manually install from a tar. Looks like the brew team themselves wrote and committed all of them? So I'd have to reach out to them?
22:24:34*azed joined #nim
23:24:51FromDiscord<James> AFAIK, Homebrew treats formulas as a community effort. I think you can update the formula and open a PR on GitHub.
23:25:24*ronny quit (Ping timeout: 258 seconds)
23:25:48*cadmium[m] quit (Ping timeout: 258 seconds)
23:26:10*reversem3 quit (Ping timeout: 258 seconds)
23:26:14*vegai1 quit (Ping timeout: 245 seconds)
23:26:15*customer[m] quit (Ping timeout: 250 seconds)
23:26:33*Northstrider[m] quit (Ping timeout: 258 seconds)
23:26:33*CodeBitCookie[m] quit (Ping timeout: 258 seconds)
23:26:39*cheer[m] quit (Ping timeout: 245 seconds)
23:27:19*stisa quit (Ping timeout: 258 seconds)
23:27:20*lnxw37d4 quit (Ping timeout: 258 seconds)
23:27:33*dithpri[m] quit (Ping timeout: 250 seconds)
23:37:56*ronny joined #nim
23:42:31*reversem3 joined #nim
23:43:58*cadmium[m] joined #nim
23:45:35*Northstrider[m] joined #nim
23:45:43*CodeBitCookie[m] joined #nim
23:46:21*stisa joined #nim
23:46:29*vegai1 joined #nim
23:48:50*customer[m] joined #nim
23:49:32*cheer[m] joined #nim
23:52:00kayabaNerveJames: Yeah. Was more looking to see if the community had a contact. I looked into it, and I don't think Nim 1.2.X will be added.
23:53:14kayabaNerveAFAICT, someone would have to open a PR for 1.4.X -> 1.2.X (not sure if that would work yet definitely wouldn't fly; would also need -> 1.4.X to restore existing functionality) OR we'd need to setup a nim1.2 package which they're very aggressive about.
23:53:56kayabaNerveAnd I don't think the former would work; I think we'd explicitly need a nim1.2 package.
23:54:08kayabaNerve> Versioned formulae submitted should be expected to be used by a large number of people. If this ceases to be the case, they will be removed.
23:54:27FromDiscord<timotheecour> please write a PR for homebrew but maybe open it in nim repo first to get feedback; in particular the csources code must be updated
23:55:09FromDiscord<timotheecour> (edit) "please write a PR for homebrew but maybe open it in nim repo first to get feedback; in particular the csources code must be updated ... " added "to use the newer `nimBuildCsourcesIfNeeded` which is fwd compatible"
23:56:11FromDiscord<timotheecour> (edit) "please write a PR for homebrew but maybe open it in nim repo first to get feedback; in particular the csources code ... must" added "(in `if build.head?`)"
23:57:15*lnxw37d4 joined #nim
23:58:05kayabaNerveFlip side of the coin: I have never used homebrew before today. If I do write a new recipe, you just mean open a matching issue on nim-lang/Nim, right?
23:58:24kayabaNerveOr another repo?
23:58:49*dithpri[m] joined #nim