00:00:40 | disruptek | nimph now knows when your project is missing tags and warns you about 'em with the commit hash in which the version was first published. |
00:03:30 | * | abm quit (Read error: Connection reset by peer) |
00:04:40 | FromDiscord | <Clyybber> fixing the ecosystem |
00:04:44 | FromDiscord | <Clyybber> one tag at a time |
00:08:56 | * | hexeratops joined #nim |
00:17:59 | FromDiscord | <Fern & Simula (They/Them)> is there a way to get all methods attached to a certain object? |
00:30:20 | * | zedeus quit (Quit: WeeChat 2.5) |
00:31:38 | FromDiscord | <Fern & Simula (They/Them)> alternatively, is there a way to send a method call to an object without knowing if it implements the method? |
00:35:33 | FromDiscord | <Fern & Simula (They/Them)> nvm, second one won't work |
00:37:36 | * | leorize quit (Ping timeout: 260 seconds) |
00:38:38 | * | leorize joined #nim |
00:59:17 | * | lkw quit (Ping timeout: 240 seconds) |
01:48:11 | * | liam_ quit (Quit: Leaving) |
02:27:22 | * | lkw joined #nim |
02:30:40 | * | Hideki_ joined #nim |
02:35:26 | * | Hideki_ quit (Ping timeout: 276 seconds) |
02:56:14 | * | gangstacat quit (Ping timeout: 276 seconds) |
03:27:01 | * | endragor joined #nim |
03:36:52 | * | rockcavera quit (Remote host closed the connection) |
03:38:58 | FromDiscord | <snluu> If I have a `ss: var seq[T]` where `T` is an object type, what is the syntax to reference `ss[i]` with a variable so I don't have to call `ss[i]` all the time/pay the array access penalty for `address at zero + i`? |
03:39:21 | FromDiscord | <snluu> I tried `var s = ss[i]` and it seems like that is doing a copy? |
03:44:23 | * | Marquisdefalbala quit () |
03:45:57 | FromDiscord | <snluu> ``` |
03:45:57 | FromDiscord | <snluu> var s = ss[i] |
03:45:58 | FromDiscord | <snluu> s.x = 1 |
03:45:58 | FromDiscord | <snluu> ``` |
03:46:05 | FromDiscord | <snluu> that seems to create a opy |
03:46:08 | FromDiscord | <snluu> copy |
04:00:35 | * | drewr quit (Ping timeout: 250 seconds) |
04:03:23 | * | gangstacat joined #nim |
04:07:18 | * | Tanger quit (Quit: Leaving) |
04:26:15 | * | nsf joined #nim |
04:30:44 | * | hexeratops quit (Remote host closed the connection) |
04:32:36 | * | artemis_coven joined #nim |
04:32:37 | * | artemis_coven quit (Client Quit) |
04:32:55 | * | dddddd quit (Remote host closed the connection) |
04:55:47 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:57:30 | * | narimiran joined #nim |
04:57:51 | * | chemist69 joined #nim |
04:58:30 | FromDiscord | <Kaynato> You could have T be a ref object type instead. |
05:05:47 | FromDiscord | <snluu> what would get on the heap tho? |
05:21:48 | * | endragor quit (Remote host closed the connection) |
05:22:54 | * | endragor joined #nim |
06:06:03 | FromDiscord | <demotomohiro> I think `var s = addr ss[i]` is what you want, but just write simple code and let Nim or backend compiler optimize your code would be bettter. |
06:07:21 | FromDiscord | <snluu> oh, let me give that a try |
06:07:30 | FromDiscord | <demotomohiro> Nim language is designed so that simple code generate fastest code |
06:09:27 | FromDiscord | <demotomohiro> addr operator is supposed to be used only when you need to use C code. |
06:09:47 | FromDiscord | <snluu> in my case tho, not sure what is the "right" way to do things? |
06:10:18 | FromDiscord | <snluu> i dont want to keep typing `myListThing[index]`, rather just have an alias at the beginning of the loop |
06:10:20 | FromDiscord | <snluu> which does not work |
06:11:02 | FromDiscord | <Kaynato> Instead of passing pointers around (dangerous C conventions), make a type which is a ref object, fill the seq with the ref objects, and then `let s = ss[i]` will give you the reference, which you can use to mutate the internal contents |
06:11:37 | FromDiscord | <Kaynato> It is basically (?) the same as passing by addr, except this is how you "should" do it in nim |
06:11:44 | FromDiscord | <Kaynato> please correct me if I am wrong |
06:11:49 | FromDiscord | <snluu> afaik, `ref object` will always guarantee GC/heap allocation--which is unnecessary in this case |
06:12:06 | FromDiscord | <snluu> addr is different, it's just getting the memory address of something, which could be on the stack |
06:12:16 | FromDiscord | <Kaynato> right, I suppose you could just do that instead, then |
06:12:26 | FromDiscord | <Kaynato> then addr sounds like a fit for your use case :x |
06:12:34 | FromDiscord | <snluu> yeah, thanks! |
06:18:18 | FromDiscord | <snluu> @Kaynato, the thing I'm looking for is basically the equivalent of `T&` in C++ |
06:18:44 | FromDiscord | <Kaynato> Oh. Then yes, addr and ptr are exactly what you want |
06:19:38 | FromDiscord | <Kaynato> calling addr on x gives you the pointer to x. The pointer will be of type `ptr T` where T is the type of x. |
06:21:17 | FromDiscord | <demotomohiro> You can write `template ss: untyped = myListThing[index]` and `ss` in your code are replaced with `myListThing[index]`. |
06:22:17 | FromDiscord | <snluu> hmm... that's one angle |
06:23:40 | FromDiscord | <demotomohiro> You cannot use addr operator to let or const variable. |
06:27:55 | FromDiscord | <demotomohiro> `with` macro might be better. https://github.com/zevv/with |
06:32:20 | * | Hideki_ joined #nim |
06:36:51 | * | Hideki_ quit (Ping timeout: 252 seconds) |
06:38:04 | lqdev[m] | @demotomohiro you can use unsafeAddr if you seriously need to get the address, though. |
06:45:07 | leorize | snluu: you've over optimizing, just write idiomatic code and it'll be fast |
06:46:15 | leorize | but if you love micro-optimizations, @mratsim can help you with that |
06:47:32 | lqdev[m] | yeah, if you need to pass by reference you almost always want to declare your type as ref |
06:47:41 | leorize | just use `var` |
06:47:46 | leorize | it'll be by-ref |
06:47:53 | FromDiscord | <snluu> huh? |
06:48:10 | lqdev[m] | but Nim's pretty fast anyways, I'm doing many, many table lookups per frame in my game and it works well |
06:48:11 | FromDiscord | <snluu> no, what i have is something like this: |
06:48:40 | leorize | but the compiler will auto pass by ref if the type size is 3x ref |
06:48:40 | lqdev[m] | please use a pastebin. |
06:48:47 | leorize | s/ref/float |
06:50:27 | * | narimiran quit (Ping timeout: 250 seconds) |
06:50:58 | FromDiscord | <snluu> https://pastebin.com/3mKKnCb6 |
06:51:04 | FromDiscord | <snluu> that's what I have. |
06:51:27 | FromDiscord | <snluu> i don't want to repeatedly type `myObjects[i]`. `var o = myObjects[i]` seem to make a copy |
06:55:18 | FromDiscord | <snluu> https://play.nim-lang.org/#ix=24h4 |
06:55:25 | FromDiscord | <snluu> ^ the last loop does not work |
06:55:44 | FromDiscord | <snluu> well it works, but it only mutates the copy π |
06:56:23 | FromDiscord | <snluu> `addr` seem to do the trick |
06:56:46 | leorize | https://play.nim-lang.org/#ix=24h5 :P |
06:57:02 | FromDiscord | <snluu> π |
07:00:13 | leorize | Zevv's with macro is a good choice also |
07:00:20 | FromDiscord | <snluu> thats a neat trick. |
07:01:19 | leorize | https://play.nim-lang.org/#ix=24h7 |
07:01:22 | leorize | even more tricks :P |
07:02:18 | FromDiscord | <snluu> that would be my preferred approach, unfortunately i'm doing a bunch of puzzling thing (Advent Code) that requires index jumping around and stuff |
07:03:36 | leorize | well, template or `with` is a good choice |
07:03:49 | leorize | I'd say `with` is better :p |
07:03:52 | FromDiscord | <snluu> Thanks! |
07:06:30 | FromDiscord | <snluu> i'll stick with my sinful `addr` for now until i understand how that magic `with` template works |
07:06:31 | FromDiscord | <snluu> π |
07:08:27 | * | endragor quit (Remote host closed the connection) |
07:14:15 | leorize | please use a template instead :P |
07:14:30 | leorize | good Nim code avoids unsafe features when unneeded |
07:17:17 | * | gangstacat quit (Quit: Δis!) |
07:24:58 | FromDiscord | <snluu> yeah template works too |
07:30:59 | * | solitudesf joined #nim |
07:51:15 | * | letto joined #nim |
07:58:13 | * | gour joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:20 | * | PMunch joined #nim |
08:05:15 | * | gmpreussner joined #nim |
08:06:51 | FromDiscord | <mratsim> @snluu, not sure about your use case but I use cast[ptr UncheckedArray[T](mySeq[0].addr) when I will need to do a lot of indexing |
08:07:24 | * | FromGitter quit (Remote host closed the connection) |
08:07:42 | * | FromGitter joined #nim |
08:08:11 | FromDiscord | <mratsim> my main goal is to be able to pass "restrict" and "assume_aligned" though: https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L69-L71 |
08:09:02 | FromDiscord | <mratsim> Seq indexing is as lightweight as array indexing in C, and if they are indexed in a hot loop, the compiler should hoist the seq accesses. And it will also be in L1 cache |
08:18:12 | FromGitter | <cndkhuong> hi, Nim's authors, I'm falling love with Nim, can I translate your nim-lang.org to Vietnamese ? All download, forum and irc still link back to nim-lang.org , I just try to translate introduction, learning resource |
08:18:35 | * | NimBot joined #nim |
08:19:35 | * | letto quit (Quit: Konversation terminated!) |
08:20:00 | * | letto joined #nim |
08:20:19 | * | gangstacat joined #nim |
08:24:27 | FromDiscord | <mratsim> I don't think there is any issue, have a look into: https://nim-cn.com/ |
08:24:36 | FromDiscord | <mratsim> and: https://forum.nim-lang.org/t/5045 |
08:24:59 | * | letto quit (Quit: Konversation terminated!) |
08:25:03 | FromDiscord | <mratsim> ideally you should create an organization on Github like the Chinese community: https://github.com/nim-lang-cn |
08:26:03 | FromDiscord | <mratsim> and you give someone core admin rights also so that there is always a fallback |
08:30:24 | FromDiscord | <Rika> is it not possible to get the position of the cursor |
08:30:30 | FromDiscord | <Rika> in terminal |
08:34:10 | FromDiscord | <mratsim> If there is anything you can do in the terminal, ncurses probably does it |
08:34:14 | FromGitter | <cndkhuong> thanks mratsim |
08:34:16 | FromDiscord | <mratsim> or emacs |
08:35:18 | PMunch | Hmm, `var x, y {.compileTime.}: int` leads to a very strange error |
08:35:29 | PMunch | When you try to assign to the variables |
08:36:16 | PMunch | https://play.nim-lang.org/#ix=24hi |
08:38:59 | FromDiscord | <mratsim> that's new |
08:39:12 | PMunch | https://play.nim-lang.org/#ix=24hj |
08:40:09 | FromDiscord | <mratsim> maybe @Zevv broke it :p |
08:40:21 | FromDiscord | <mratsim> you have to do arithmetics in npeg now |
08:40:27 | FromDiscord | <mratsim> I'm pretty sure it's Turing complete |
08:45:30 | livcd | Oops. I am getting SIGSEGV: Illegal storage access. (Attempt to read from nil?) with d:danger but not with d:release |
08:45:41 | livcd | not with just d:release* |
08:47:40 | FromDiscord | <mratsim> compile with --debugger:native and launch with gdb/lldb |
08:47:48 | FromDiscord | <mratsim> you'll get a stackTrace |
08:52:34 | livcd | thanks |
08:54:53 | * | endragor joined #nim |
09:01:25 | * | letto joined #nim |
09:04:49 | * | floppydh joined #nim |
09:19:42 | Zevv | what did I break |
09:22:48 | Zevv | works fine in devel? |
09:29:47 | FromDiscord | <mratsim> this: https://play.nim-lang.org/#ix=24hi |
09:29:56 | madprops | does os.nim have a way to decontruct a path like /some/dir to ["some", "dir"] ? |
09:30:12 | madprops | i could just split at / |
09:30:19 | madprops | but might be too os specific |
09:30:50 | FromDiscord | <mratsim> yes it has |
09:30:53 | FromDiscord | <Rika> @mratsim I meant, with nim, the "in terminal" was to clarify where this cursor is |
09:32:31 | FromDiscord | <mratsim> @madprops, use splitpath in os module or rsplit/lsplit in strutils |
09:32:41 | FromDiscord | <mratsim> see usage: https://github.com/status-im/nim-secp256k1/blob/master/secp256k1.nim#L4 |
09:32:47 | madprops | im checking splitPath, but seems to only split on the last component |
09:32:56 | FromDiscord | <mratsim> rsplit and lsplit should be passed "DirSep" to be OS independant |
09:37:00 | * | ng0 joined #nim |
09:40:07 | FromDiscord | <mratsim> @Rika ah I see, no idea. Me and user interfaces == 2. |
10:07:31 | * | zedeus joined #nim |
10:15:24 | * | tklohna joined #nim |
10:19:32 | Zevv | I didn't do it |
10:20:29 | * | kevinchau joined #nim |
10:26:16 | Araq | never use rsplit/spit for Path operations! |
10:26:44 | Araq | yeah, I broke .compileTime vars for 1.0 in an attempt to fix a design problem |
10:27:02 | * | kevinchau quit (Quit: ERC (IRC client for Emacs 26.3)) |
10:27:05 | Araq | my cure seems to be worse than we were previously though |
10:28:06 | Araq | so ... do we want --gc:arc vs --gc:orc ? |
10:32:44 | Zevv | you deserve your 'a' in there |
10:33:41 | Araq | yeah but 'arc' would be the MM without the cycle detection and 'orc' would detect cycles |
10:34:05 | * | Hideki_ joined #nim |
10:34:12 | Araq | 'o' because it's a circle, so it can detect cycles. it also does it like an Orc, via brute-force |
10:38:56 | * | Hideki_ quit (Ping timeout: 268 seconds) |
10:40:50 | Zevv | Dude, really? You are willingly offending the Orc minority group here |
10:42:15 | * | nc-x joined #nim |
10:42:27 | nc-x | Araq: regarding nimscript.nim / os.nim issue |
10:42:36 | Araq | nc-x, I had an idea |
10:42:55 | nc-x | moving paramStr() and paramCount() only to os is a bad idea IMO |
10:43:02 | nc-x | because then you have to import os |
10:43:14 | nc-x | and that causes ambiguos calls |
10:43:19 | Araq | but os nowadays works in the NimScript environment! |
10:43:31 | nc-x | for other symbols defined in nimscript.nim |
10:43:35 | Araq | the only real issue is that nimscript.nim is part of freaking system.nim |
10:43:54 | Araq | nimscript should import os.nim and export paramStr |
10:44:02 | nc-x | yeah |
10:44:47 | Araq | we must turn nimscript into an explicit import |
10:45:09 | Araq | nimble packages are not affected since nimble writes a wrapper that imports more stuff already |
10:45:09 | nc-x | but that will break almost every nims file |
10:45:35 | Araq | yes, every nims file, but not the .nimble files |
10:46:13 | nc-x | or we could just deprecate nimscript and use nake, because it has uses proper nim and not nims :D, but yeah people here love nims |
10:46:39 | nc-x | well, i can move nimscript out of system if that is what you want |
10:47:10 | Araq | we can also do nothing whatsoever |
10:47:29 | Araq | so kaushalmodi has to write os.paramStr or system.paramStr, big deal... |
10:49:06 | Araq | btw ever since Nim got caching support for '-r' nake lost its relevance IMO |
10:50:08 | nc-x | actually os.paramStr is an error in nims right now. so IMO my previous patch, removing paramStr from os.nim for would be fine. |
10:51:11 | Araq | meh |
10:51:18 | nc-x | or there are plenty of os.nim stuff in nimscript.nim which is not exported like `removeDir`, and nimscript.nim then defines a short named function for it. |
10:51:28 | nc-x | we could do the same for paramstr and paramcount |
10:51:34 | nc-x | but that would be breaking too. |
10:51:43 | nc-x | do just let me know whatever you want. |
10:51:45 | Araq | it's also not consistent with the design |
10:51:47 | nc-x | *so |
10:52:08 | Araq | the short names are because it's a different operation with the Whatif support and logging going on |
10:52:35 | Araq | I don't know what I want :-) |
10:53:31 | nc-x | well, i do know what i want, but nobody agrees with me ;P |
10:53:36 | FromDiscord | <mratsim> "-r" caching is a bit flaky, sometimes I recompile just to see my dumpTree / toStrLit output |
10:54:02 | Araq | nc-x, and that's 'nake'? |
10:54:42 | nc-x | i have not used nake |
10:54:45 | nc-x | but yeah similar idea |
10:54:51 | nc-x | of using proper nim |
10:54:55 | nc-x | instead of nims |
10:55:02 | nc-x | zig and jai also do the same iirc |
10:55:06 | nc-x | and rust also has build.rs |
10:55:08 | Araq | same here so I added caching for '-r' |
10:55:15 | * | nsf quit (Quit: WeeChat 2.6) |
10:55:35 | Araq | mratsim: I don't understand your remark. |
10:55:37 | * | tklohna quit (Ping timeout: 240 seconds) |
10:56:51 | nc-x | well i guess then we should just close this issue and pr for now. and think of a proper design/rfc for moving forward. |
10:58:00 | * | nc-x quit (Remote host closed the connection) |
10:58:28 | FromDiscord | <mratsim> sometimes I need to delete the binary to ensure my macro gets triggered again and I can see the nim code generated |
10:58:57 | FromDiscord | <mratsim> and sometimes even if the macro actually change the resulting code, it doesn't get recompiled |
10:59:03 | Araq | but every edit causes a recompile |
10:59:18 | FromDiscord | <mratsim> mmm |
10:59:32 | FromDiscord | <mratsim> maybe it's VS code which is buffering edits then |
10:59:36 | Araq | it even tracks the nim.exe you used to build it |
10:59:56 | Araq | so if you change the compiler and nothing in your project, it gets recompiled anyway since the compiler changed |
11:17:38 | * | narimiran joined #nim |
11:33:50 | shashlick | @nc-x I'll look into it a bit and see if I have any ideas |
11:35:48 | shashlick | Nimscript doesn't import os |
11:42:25 | Zevv | araq, about the deque autoinit: why is the tableimpl.nim way "more elegant"? It boils down to the same? You initialize if it is not inialized, otherwise you dont? What obvious thing do I miss here? |
11:46:28 | shashlick | @nc-x why was your original pr not good enough |
11:56:11 | * | dddddd joined #nim |
11:58:33 | * | rockcavera joined #nim |
12:19:51 | * | luis_ joined #nim |
12:20:06 | * | rockcavera quit (Read error: Connection reset by peer) |
12:20:48 | * | rockcavera joined #nim |
12:20:48 | * | rockcavera quit (Changing host) |
12:20:48 | * | rockcavera joined #nim |
12:21:11 | * | tklohna joined #nim |
12:32:00 | FromGitter | <alehander92> Araq |
12:32:05 | FromGitter | <alehander92> can i make an async iterator |
12:41:33 | * | luis_ quit (Ping timeout: 245 seconds) |
12:41:45 | Zevv | I bet you can alehander92, we all believe in you. You can *do* it, go for it! |
12:42:18 | * | tklohna quit (Remote host closed the connection) |
12:43:32 | FromDiscord | <michalm> Hi. Is is possible to use channels with some kind of generic messages? |
12:43:34 | FromGitter | <alehander92> *sounds of callbacks crashing in the ocean* |
12:44:02 | FromGitter | <alehander92> Zevv i tried |
12:44:13 | FromGitter | <alehander92> but the compiler SAYS NO |
12:44:28 | FromGitter | <alehander92> https://www.youtube.com/watch?v=AJQ3TM-p2QI |
12:51:01 | Zevv | I'm not in any position to say anything sensible about these things, but given my assumptions that async rewrites your procs into closure iterators *might* be a complicating factor in what you are trying to accomplish |
12:53:00 | FromGitter | <alehander92> thats what i also thought |
12:53:11 | FromGitter | <alehander92> but i thought that the smart people here |
12:53:16 | FromGitter | <alehander92> might have thought of something man |
12:53:19 | FromGitter | <alehander92> come on man |
12:53:21 | FromGitter | <alehander92> its 2019 |
12:53:38 | FromGitter | <alehander92> man |
12:54:22 | FromGitter | <alehander92> (and realistically this shouldn't be fatal imo) |
12:54:43 | * | nsf joined #nim |
12:56:39 | FromGitter | <alehander92> and actually we can do it in asyncjs |
12:56:46 | FromGitter | <alehander92> if we target es2018 iirc |
13:08:59 | * | luis_ joined #nim |
13:14:00 | * | MarquisdeFalbala joined #nim |
13:15:17 | * | Hideki_ joined #nim |
13:17:29 | * | luis_ quit (Quit: luis_) |
13:21:12 | * | solitudesf- joined #nim |
13:23:17 | * | solitudesf quit (Ping timeout: 240 seconds) |
13:28:18 | FromGitter | <bung87> `error: member reference base type 'natural_t' (aka 'unsigned int') is not a structure or union β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df391f1ac14cc652c78395e] |
13:29:46 | FromGitter | <bung87> the code gen make `cpu_ticks` as structure? |
13:30:09 | leorize | depends on your code |
13:30:16 | leorize | what's the nim code of that structure? |
13:30:37 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df3927cac14cc652c783de8] |
13:30:56 | leorize | use UncheckedArray[Natural] instead |
13:31:10 | leorize | you're interfacing with C, and they don't have seq |
13:33:18 | FromGitter | <bung87> ` Error: invalid type: 'UncheckedArray[Natural]' in this context: 'host_cpu_load_info_data_t' for var` |
13:34:25 | FromGitter | <bung87> actually it is a array with length, but the length assign through c define |
13:36:29 | leorize | the length probably wouldn't change, so just hardcode it in |
13:37:43 | FromGitter | <bung87> it named as CPU_STATE_MAX, I dont know it means what and depends on what |
13:37:52 | FromDiscord | <mratsim> I suggest you just use RDTSC instead of fiddling with Mac stuff: https://github.com/status-im/nim-beacon-chain/blob/aec3d5ac98c65850fb5716adf1a307a85edd98d9/nbench/platforms/x86.nim#L51 |
13:38:23 | FromDiscord | <mratsim> it's probably the number of frequencies state the CPU supports |
13:39:56 | FromGitter | <bung87> so it βs not constant, |
13:40:35 | leorize | bung87: for ABI stability they wouldn't meddle with that struct too much |
13:40:47 | FromDiscord | <mratsim> but you can use UncheckedArray, don't use Natural, it's probably int32/cint |
13:42:07 | * | Hideki_ quit (Remote host closed the connection) |
13:42:20 | * | Hideki_ joined #nim |
13:42:38 | FromGitter | <bung87> @ leorize so itβs the os supported number right? |
13:42:54 | FromGitter | <bung87> @ mratsim Ok, I β ll try it |
13:49:23 | * | abm joined #nim |
13:50:17 | FromGitter | <bung87> using UncheckedArray make `var r_load: host_cpu_load_info_data_t ` impossible pass compile time. |
13:50:41 | FromGitter | <bung87> hmm ,hard code it to 4 ,simplly work. |
14:01:43 | * | sealmove joined #nim |
14:02:17 | sealmove | hey, i have an issue. when i do `nimble install kaitai_struct_nim_runtime` only the .nimble file is installed |
14:03:09 | leorize | srcDir = "src" |
14:03:20 | leorize | remove that :P |
14:03:24 | sealmove | oh thanks! |
14:03:45 | disruptek | people still use nimble? |
14:03:50 | FromGitter | <bung87> `error: must use 'struct' tag to refer to type 'vmmeter' β β ``` vmmeter vmstat;` I think I almost there``` [https://gitter.im/nim-lang/Nim?at=5df39a4555d939230003e7b6] |
14:03:56 | FromGitter | <Willyboar> :P |
14:05:11 | * | lritter joined #nim |
14:06:36 | * | krux02 joined #nim |
14:13:30 | * | tane joined #nim |
14:17:42 | sealmove | what's so bad about nimble? |
14:30:40 | lqdev[m] | β |
14:31:24 | * | PMunch quit (Quit: Leaving) |
14:32:11 | * | nsf quit (Quit: WeeChat 2.6) |
14:32:26 | FromGitter | <Willyboar> disruptek advertises nimph :) |
14:35:56 | Araq | Zevv, maybe I misread but queries shouldn't cause an init |
14:36:25 | Araq | bung87: .importc: "struct vmmeter" is the syntax then |
14:37:16 | disruptek | shashlick: hmm, if you kept nim.cfg in your repo and then you removed it, you might not be able to roll to a previous version due to an existing nim.cfg (and one in the target version). |
14:38:01 | disruptek | which causes my auto-tag-my-repo feature to not work with such versions. |
14:38:21 | disruptek | i'm sure it's good enough, though. |
14:39:28 | disruptek | also, the auto-tag-my-repo will not be optional. |
14:41:20 | disruptek | well, it can default to ON, okay/ |
14:41:39 | disruptek | i mean, the whole idea here is to make it easier to do the right thing than it is to do the wrong thing. |
14:41:42 | disruptek | so, we do that. |
14:42:13 | disruptek | we do that FOR YOU. |
14:44:51 | FromGitter | <bung87> @Araq yes, I just tried out , |
14:46:01 | FromGitter | <bung87> ah I wish I see you reply earlier ,thank you ! |
14:48:22 | FromGitter | <bung87> other types declared as typedef in c, this one is different, so it throw must use 'struct' tag to refer to type 'vmmeter' |
14:49:08 | * | zahary quit (Quit: Connection closed for inactivity) |
14:49:50 | FromGitter | <bung87> I thought import c type as object in nim is same thing months ago. I misunderstood. |
14:52:20 | * | Hideki_ quit (Remote host closed the connection) |
14:53:04 | * | Hideki_ joined #nim |
14:55:04 | Araq | uh oh |
14:57:17 | * | Hideki_ quit (Ping timeout: 240 seconds) |
14:59:15 | * | Hideki_ joined #nim |
15:01:10 | * | ng0_ joined #nim |
15:01:14 | * | ng0 quit (Disconnected by services) |
15:01:16 | * | ng0_ is now known as ng0 |
15:01:36 | disruptek | hearts and minds, people; hearts and minds! |
15:04:06 | * | Hideki_ quit (Ping timeout: 268 seconds) |
15:09:23 | * | m_v_m_v joined #nim |
15:12:30 | * | Vladar joined #nim |
15:13:51 | m_v_m_v | Hi all. I am struggling with it for a couple of hours. Do you know how I can pass message from channel X to channel Y and inside that message put address of the generic message creator like a "sender: ptr to channel which satisfy some kind of interface"? |
15:15:42 | leorize | recv it from X then send to Y? |
15:16:11 | leorize | I'm not sure about the latter constraints, can you elaborate, example use case maybe? |
15:19:42 | m_v_m_v | Sure. For example I have an ChannelMessage definition: https://pastebin.com/4s2u6k3Y now based on that definition if I will create group of channels they will by able to pass only a one type of messages. I would like to do it more generic. |
15:21:10 | * | Hideki_ joined #nim |
15:22:04 | m_v_m_v | In that example my mainChannel can not send message to cmdChannel: https://pastebin.com/teH8GSba |
15:22:17 | FromGitter | <bung87> https://github.com/jangko/msgpack4nim sounds like this one ? |
15:23:42 | m_v_m_v | I thought about it. But to be honest I am thinking that I am missing something in the channel definition. |
15:25:27 | disruptek | seems like a problem of inception. |
15:26:20 | * | Hideki_ quit (Ping timeout: 276 seconds) |
15:26:42 | Araq | m_v_m_v, easiest is to make your message type a case object |
15:26:59 | m_v_m_v | Hmm so something like: Channel #1: I am sending you a CustomMathTask to solve and I am waiting for result. Channel #2: Cool dude. This is your float as an message. Is not possible ? |
15:27:27 | disruptek | i think generics are easier, but both solve the problem. |
15:27:52 | disruptek | probably a case object is the right choice because it's the simplest. |
15:28:05 | Araq | m_v_m_v, or use different request/result channels |
15:28:54 | m_v_m_v | I don't think that case object would solve my problem in a scalable way. |
15:29:05 | m_v_m_v | Request/result? |
15:29:29 | disruptek | you move one type on request and another on result. |
15:30:39 | Araq | there is this word again, it always triggers me, "scalable". Struggling with 50 lines solutions but anticipating problems for when you have 5 million lines |
15:31:06 | disruptek | well, you have to enter at the right magnitude. |
15:31:13 | m_v_m_v | aaa....but then still I have only two types. Then for example I am implementing a new Channel with new type... |
15:31:25 | m_v_m_v | Is it possible to use generics for that? |
15:31:34 | disruptek | sure. |
15:31:38 | Araq | no, it's possible ot use json for that |
15:32:09 | disruptek | araqlogic describes a series of semaphores... |
15:32:28 | Araq | json is "scalable", everything compiles, you can pass every kind of message, you never get any compiletime checking, enjoy |
15:33:58 | FromGitter | <bung87> @Araq Today best joke! : ) |
15:34:36 | m_v_m_v | ... thx |
15:36:21 | * | MarquisdeFalbala quit (Remote host closed the connection) |
15:38:49 | * | m_v_m_v quit (Remote host closed the connection) |
15:41:17 | * | njoseph quit (Ping timeout: 250 seconds) |
15:44:35 | * | couven92 joined #nim |
15:55:20 | * | Mike[m]2 quit (Ping timeout: 250 seconds) |
16:00:42 | * | couven92 quit (Read error: Connection reset by peer) |
16:01:05 | * | couven92 joined #nim |
16:01:23 | * | floppydh quit (Quit: WeeChat 2.6) |
16:04:49 | * | Hideki_ joined #nim |
16:10:56 | * | ng0 quit (Ping timeout: 260 seconds) |
16:12:28 | * | ng0 joined #nim |
16:16:45 | shashlick | disruptek the direction I'm going with is to use project.nim.cfg 100% for Nimble interop |
16:17:15 | shashlick | And if a user already using it, just grumble and fail |
16:17:47 | shashlick | I'm not fond of a solution that mixed manual and automated processing of the cfg |
16:18:13 | shashlick | Still don't get your scenario but I suspect it might still impact me |
16:18:59 | * | fanta1 joined #nim |
16:21:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:23:23 | * | kungtotte joined #nim |
16:25:17 | * | Hideki_ joined #nim |
16:27:05 | * | Hideki_ quit (Remote host closed the connection) |
16:29:42 | * | couven92 quit (Read error: Connection reset by peer) |
16:30:10 | * | couven92 joined #nim |
16:40:43 | * | Hideki_ joined #nim |
16:41:16 | FromGitter | <sheerluck> hi. I use cxxopts::Options (https://github.com/jarro2783/cxxopts) in c++, is there similar lib for Nim? Thank you. |
16:42:16 | leorize | checkout: https://nimble.directory/pkg/argparse |
16:42:18 | leorize | https://nimble.directory/pkg/cligen |
16:42:24 | leorize | and stdlib's parseopt |
16:42:44 | FromGitter | <sheerluck> Great! |
16:44:59 | * | Hideki_ quit (Ping timeout: 250 seconds) |
16:52:02 | * | endragor quit (Remote host closed the connection) |
16:56:36 | * | clyybber joined #nim |
17:02:27 | disruptek | github seems to be struggling. |
17:02:27 | * | njoseph joined #nim |
17:02:57 | * | clyybber quit (Remote host closed the connection) |
17:04:23 | disruptek | shashlick: i thought we were using flags in project.nim.cfg, which makes sense, because that's when you set compile-time options for the program. then nim.cfg can hold paths and get fully managed by the package manager. |
17:04:41 | disruptek | this has the result we want, which is that projects below can share the same paths. |
17:05:00 | disruptek | but this doesn't impact the main project in any negative way, because they have project.nim.cfg to work with. |
17:05:54 | disruptek | you can see an example of this in the way nimph's project is setup. |
17:07:58 | disruptek | anyway, as araq says, "get used to editing nim.cfg" |
17:08:04 | disruptek | may as well do it up right. |
17:11:15 | sealmove | software engineering question: if you have a bunch of flags, and not all combinations are valid, how do you handle the checking? |
17:12:27 | sealmove | for example "if A is enabled, then B shouldn't be enabled" |
17:12:53 | sealmove | do you make a big block of if .. elses ? |
17:14:26 | disruptek | compare sets, probably. |
17:14:33 | disruptek | !pull jsfetch |
17:14:44 | * | JustASlacker joined #nim |
17:14:49 | disruptek | wtf where is the bot |
17:16:33 | sealmove | so i need to make sets with all valid (or all invalid) combinations? |
17:17:24 | disruptek | sure, but they can be constants and you can build them from each other, etc. |
17:17:36 | disruptek | !pull jsfetch |
17:17:37 | disbot | https://github.com/nim-lang/Nim/pull/12531 -- 3Add module jsfetch |
17:18:08 | * | ng0 quit (Ping timeout: 260 seconds) |
17:18:54 | sealmove | nice disruptek, thx |
17:20:24 | * | Hideki_ joined #nim |
17:23:36 | * | abm quit (Quit: Leaving) |
17:31:59 | FromDiscord | <mratsim> lol @solitudesf: https://forum.nim-lang.org/t/5623#35264 |
17:33:45 | FromDiscord | <mratsim> @m_v_m_v use 2 channels, a channel where one can both read from and write to will be a mess |
17:34:29 | FromDiscord | <mratsim> and yes you can pass a callback channel in your channels |
17:40:29 | FromDiscord | <Clyybber> solitudesf spittin straight fax |
17:40:42 | FromDiscord | <Clyybber> disruptek: Are you using wayfire? |
17:41:16 | disruptek | no, sway. you actually use wayfire? |
17:41:32 | FromDiscord | <Clyybber> tried it just now |
17:41:36 | FromDiscord | <Clyybber> but I have to configure it |
17:41:38 | disruptek | yeah? |
17:42:01 | disruptek | too much candy and not enough fibre for me; i'm old, man. |
17:42:53 | FromDiscord | <Clyybber> from the introduction blog post it seems great |
17:43:07 | FromDiscord | <Clyybber> I like it being modular |
17:43:34 | FromDiscord | <Clyybber> thats also why I currently use bspwm and not i3wm |
17:43:41 | disruptek | it looks cool, but i don't use any window decoration. not sure it's got something i want. |
17:44:07 | FromDiscord | <Clyybber> I don't use window decorations either |
17:44:11 | FromDiscord | <Clyybber> I don't even use a bar |
17:44:39 | disruptek | i have a bar on a hotkey but i go days without using it. |
17:45:21 | disruptek | i need to be able to drive it with software. if i can do that, and it's robust, i'm down. |
17:45:32 | disruptek | !repo swayipc |
17:45:33 | disbot | https://github.com/disruptek/swayipc -- 9swayipc: 11swayipc (i3ipc) for Nim 15 3β 0π΄ |
17:46:22 | * | kungtotte quit (Read error: No route to host) |
17:46:47 | FromGitter | <bung87> lib `segfaults` needs to using `include` ? |
17:46:52 | federico3 | !repo i3ipc |
17:46:53 | disbot | https://github.com/disruptek/swayipc -- 9swayipc: 11swayipc (i3ipc) for Nim 15 3β 0π΄ 7& 1 more... |
17:46:59 | disruptek | lol |
17:47:03 | disruptek | !package i3ipc |
17:47:04 | disbot | https://github.com/FedericoCeratto/nim-i3ipc -- 9i3ipc: 11i3 IPC client library |
17:47:28 | disruptek | somehow, i couldn't find it. but i think swayipc is a little more complete now. |
17:48:24 | FromDiscord | <Clyybber> disruptek: wayfire seems to be designed for that |
17:48:38 | disruptek | let us know how it goes. |
17:48:45 | * | kungtotte joined #nim |
17:50:09 | FromDiscord | <Clyybber> sure |
17:52:35 | * | nsf joined #nim |
17:54:06 | * | Hideki_ quit (Ping timeout: 252 seconds) |
17:55:14 | solitudesf- | same guy who wrote that suggested procedures list is too long to scroll wrote that he uses verbosity:3 |
17:55:21 | solitudesf- | is this some kind of trolling? |
17:55:37 | disruptek | yes, a very poor kind. |
17:55:50 | * | njoseph quit (Ping timeout: 276 seconds) |
17:56:48 | * | endragor joined #nim |
17:59:16 | solitudesf- | uhhhh, my nimble broke |
17:59:35 | solitudesf- | why the heck does it think that its directory is ~/.nimble/pkgs/pkgs |
18:00:25 | disruptek | rmdir ~/.nimble/pkgs/pkgs; it's from nimph running nimble with a --nimbleDir that it couldn't grok. |
18:00:30 | disruptek | fixed. |
18:01:15 | * | endragor quit (Ping timeout: 250 seconds) |
18:05:43 | FromDiscord | <Clyybber> disruptek: Used wf-shell to test if I could start anything |
18:05:45 | FromDiscord | <Clyybber> But I can't |
18:06:06 | FromDiscord | <Clyybber> I don't necessarily think wayfire is to blame, since I'm trying this with an optimus setup |
18:06:08 | disruptek | he didn't start wayfire. |
18:06:12 | disruptek | it was always burning, |
18:06:16 | disruptek | since the world's been turnin'. |
18:06:59 | FromDiscord | <Clyybber> no I didn't start it but I still broke it |
18:07:15 | disruptek | this is why we can't have nice things. |
18:07:17 | solitudesf- | disruptek, `Exception: unparsable version `2.0.10.0` in sdl2_nim`. why does nimph struggle with that? |
18:07:49 | disruptek | it doesn't know how to handle 4 digits. |
18:07:56 | solitudesf- | cool |
18:08:04 | disruptek | but i think it's supposed to parse that as 2.0.10. |
18:08:09 | sealmove | how do I get size of object? `sizeof`? |
18:08:09 | disruptek | where is that version? |
18:08:27 | solitudesf- | what do you mean where? |
18:08:35 | disruptek | where can i test that package? |
18:08:52 | disruptek | the npeg-based loose parser i just added should slurp that up happily. |
18:09:04 | disruptek | !package sdl2_nim |
18:09:05 | disbot | https://github.com/Vladar4/sdl2_nim -- 9sdl2_nim: 11Wrapper of the SDL 2 library for the Nim language. |
18:09:10 | disruptek | ah, okay. |
18:09:12 | disruptek | i will fix it. |
18:10:37 | * | fanta1 quit (Quit: fanta1) |
18:10:38 | disruptek | is that nimph or bump that yielded that message? |
18:11:09 | solitudesf- | nimph |
18:11:14 | disruptek | ok, thanks. |
18:14:59 | dom96 | why don't you just use Nimble's version parser? |
18:27:19 | * | njoseph joined #nim |
18:37:45 | FromDiscord | <Clyybber> disruptek: Can nimph work with repos without a nimble file? |
18:43:34 | sealmove | nimitai is starting to pass some of the first official tests :) |
18:45:10 | FromGitter | <indiscible> hello, I cannot create seq of string with repeat, it always concatenate all the string into one single string. how do I do :repeat("hello",3)=["hello","hello","hello"] ? |
18:45:24 | FromGitter | <indiscible> instead of "hellohellohello" |
18:46:01 | FromGitter | <sheerluck> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df3dc6942784416abe00d8f] |
18:48:01 | * | endragor joined #nim |
18:52:37 | * | endragor quit (Ping timeout: 240 seconds) |
18:58:40 | * | couven92 quit (Read error: Connection reset by peer) |
18:59:05 | * | couven92 joined #nim |
18:59:21 | sealmove | indiscible: you need to use sequtils's repeat |
18:59:54 | sealmove | both strutils.repeat() and sequtils.repeat() exist |
19:01:05 | federico3 | this kaitai is interesting, actually |
19:01:13 | sealmove | sheerluck: sorry, the project needs the very new changes to the VM (https://github.com/nim-lang/Nim/pull/12775, https://github.com/nim-lang/Nim/pull/12777) |
19:01:14 | disbot | β₯ Increased TInstr field sizes: allow long jumps and 65535 VM registers |
19:01:27 | federico3 | https://kaitai.io/ |
19:02:37 | sealmove | federico3, the implementation though is disappointing. I think the language-agnostic approach they used leads to bad quality. |
19:03:10 | federico3 | how so? |
19:03:32 | sealmove | the source code is constructed with strings (instead of AST) |
19:03:49 | federico3 | you are talking about the compiler? |
19:04:08 | sealmove | yes, Kaitai Struct compiler does code generation using strings. |
19:04:39 | federico3 | yes, it's mean to generate valid code |
19:04:41 | sealmove | the ksy language design is great, I haven't seen anything more powerful for parsing binary data |
19:04:55 | Zevv | anyone any lodging tips for @ fosdem? |
19:06:21 | sealmove | sheerluck: nim 1.1.1 is nim devel |
19:06:27 | sealmove | there is no package yet |
19:06:30 | federico3 | sealmove: I suppose a common use case could be to use kaitai to genere parsers and protocol handlers and release them as libraries |
19:07:45 | sealmove | federico3: not necessarily, for example https://github.com/kaitai-io/kaitai_fs |
19:08:43 | sealmove | ksy files should work as parsers on demand |
19:09:29 | sealmove | nimitai is able to inject the parser with a macro, so you don't have to have a library for each file format |
19:09:58 | sealmove | i plan to implement dll generation too (if someone prefers dynamic over static linking) |
19:10:14 | * | solitudesf- quit (Remote host closed the connection) |
19:10:37 | * | solitudesf- joined #nim |
19:12:05 | * | ng0 joined #nim |
19:13:57 | FromGitter | <indiscible> @sealmove: doh!! thankyou |
19:15:35 | federico3 | sealmove: sure it's possible to parse the ksy files at build time or even run time but it's not always practical or efficient |
19:17:04 | sealmove | federico3: that's why there should be alternatives like ddl |
19:17:08 | sealmove | dll* |
19:17:56 | sealmove | but only providing the source code (and especially building it with strings) is bad style |
19:18:27 | sealmove | obtaining the source code is the edge case, and you only need to do it if you want to optimize the parser |
19:19:08 | sealmove | these stuff should be integrated into the language |
19:19:32 | FromDiscord | <Clyybber> Araq: What was your argument against making sink a default? Because it might be worthwhile in the light of the cycle detector |
19:20:40 | federico3 | sealmove: if you want to provide a client rather than a raw parser and let people use it without having the keitai compiler as a build dependency, a library makes sense |
19:22:05 | federico3 | sealmove: especially if parsing is just a fraction of the work (e.g. a png decoder, a music player) |
19:23:31 | sealmove | i think in any case it's work having it installed (especially if kaitai is just a library in your language), because then you can use a ksy file as the parser |
19:23:37 | sealmove | it's worth* |
19:24:03 | sealmove | but your argument makes sense |
19:24:50 | sealmove | not detaching the parser generation from your project has benefits |
19:25:49 | sealmove | for example if the ksy file is updated/improved, the changes are applied automatically |
19:25:56 | FromGitter | <sheerluck> @sealmove Thank you, I've got myself a Nim Compiler Version 1.1.1 [Linux: amd64] from 2019-12-13-devel-22b2684 nightly build β β ``` Success: kaitai_struct_nim_runtime installed successfully.``` [https://gitter.im/nim-lang/Nim?at=5df3e5c4578ecf4b1f9a76b0] |
19:26:34 | sealmove | sheerluck: you are welcome, thanks for trying it out! :) although it's still completely not functional... |
19:27:58 | * | Vladar quit (Quit: Leaving) |
19:29:22 | sealmove | the example in README.md works though |
19:29:40 | disruptek | clyybber: not really, no. |
19:30:05 | FromDiscord | <Clyybber> disruptek: Can you make it? |
19:30:09 | disruptek | it uses the .nimble to figure out where the project root is. that could be fixed, i guess. |
19:30:15 | FromDiscord | <Clyybber> Nice |
19:30:19 | disruptek | why don't you want a .nimble? |
19:30:50 | FromDiscord | <Clyybber> I don't care, but its kinda overkill for wrappers |
19:31:01 | FromDiscord | <Clyybber> (some wrappers IMO) |
19:31:06 | disruptek | but they don't work in the existing ecosystem otherwise, right? |
19:31:13 | disruptek | ie. you cannot install them with nimble. |
19:31:25 | FromDiscord | <Clyybber> I dont care about nimble |
19:31:31 | FromDiscord | <Clyybber> I actually don't care at all |
19:31:35 | FromDiscord | <Clyybber> wrappers are single files |
19:31:40 | FromDiscord | <Clyybber> so ppl will just copy them |
19:31:56 | disruptek | in that case, maybe nimph doesn't need to operate upon them at all. |
19:32:04 | FromDiscord | <Clyybber> No, but it could? |
19:32:14 | FromDiscord | <Clyybber> Like I still approve of versioning/tagging |
19:32:17 | disruptek | i mean, maybe you don't need a package manager for a single file you're going to copy into your repo. |
19:32:37 | FromDiscord | <Clyybber> disruptek: Sure, but some ppl might still want it managed |
19:33:04 | disruptek | alright, but what does that even mean? i'm asking what it does for you. i don't even know. |
19:33:23 | FromDiscord | <Clyybber> Treat it like an empty nimble file? |
19:33:25 | FromDiscord | <Clyybber> The name of the package is the repo name? |
19:33:38 | disruptek | yeah, but what does nimph do inside such a repository? |
19:33:52 | disruptek | we're talking about a directory that isn't git versioned? or, it is? |
19:33:56 | FromDiscord | <Clyybber> Nothing, except I guess locking and updating |
19:34:11 | FromDiscord | <Clyybber> disruptek: No, it is a git repo that I'm talking about |
19:34:54 | disruptek | okay, so it's a versioned directory with one file in it. and you can generate lockfiles against it, but you can't tag it with nimph because there's no concept of versions except as tags. |
19:35:05 | disruptek | so it's the inception problem -- you have to tag it manually. |
19:35:31 | FromDiscord | <Clyybber> hmm |
19:36:04 | FromDiscord | <Clyybber> I mean, I don't care wether to tag with nimph or git |
19:36:15 | FromDiscord | <Clyybber> why cant you tag it with nimph? |
19:36:42 | disruptek | you can issue tags with nimph or git, but nimph cannot auto-tag it because there's no concept of versions, just commit hashes. |
19:36:50 | disruptek | ie. there's nowhere to store a version number. |
19:37:36 | disruptek | the way nimph solves tags-for-versions is that it actually rolls the repo to every commit of the .nimble file and measures the version it finds within. |
19:38:06 | disruptek | then it's like, "hey, there's no tag for this commit that changed your project to version X". |
19:38:43 | FromDiscord | <Clyybber> disruptek: Ah, alright that makes sense |
19:38:54 | FromDiscord | <Clyybber> commit hashes it is then |
19:39:27 | federico3 | sealmove: are you aware of https://github.com/xomachine/NESM ? |
19:39:58 | shashlick | @disruptek so nim.cfg is inherited by local deps but not project.nim.cfg? Makes sense what you say |
19:40:38 | shashlick | So if a user already has a nim.cfg we grumble asking them to rename to project.nim.cfg |
19:40:46 | shashlick | Assuming they want to usecfg |
19:41:24 | shashlick | And nimble starts managing the nim.cfg going forward |
19:41:32 | shashlick | ^^ Araq |
19:42:04 | sealmove | federico3: yup |
19:43:42 | sealmove | (de)serialization is different from parsing binaries. the reason is serialization formats are intentionally simple, whereas not all binary formats are simple. |
19:44:23 | federico3 | indeed, and I feel the need for good tooling around network protocols in Nim |
19:44:40 | sealmove | so de(serialization) tools can't help you parse arbitarily complex formats. well, protobuf allows extension, but thats... bad hacking. |
19:45:01 | FromGitter | <sheerluck> @sealmove oh so `generateParser` does not actually generate files with nim code, with xxx.fromFile("bin") |
19:45:25 | sealmove | sheerluck: exactly! it injects the parser directly in your binary |
19:46:04 | federico3 | pity kaitai uses yaml + custom grammar instead of something more expressive |
19:46:05 | sealmove | fromFile() feels in an object with the data read from the file |
19:46:24 | sealmove | hmm, federico3 what could it use instead? |
19:46:36 | disruptek | shashlick: yes, that's the assumptiong i'm making. that we can blow away what we find in the nim.cfg at the root of the project. that's where we'll manipulate the environment for the project. |
19:46:58 | disruptek | then it doesn't have to be checked in and can be recreated from scratch, etc. |
19:48:15 | disruptek | clyybber: so what should nimph do for you when there's no .nimble?? |
19:49:11 | disruptek | a lockfile seems overkill for a project with no dependencies. |
19:49:20 | federico3 | sealmove: ASN.1 for example |
19:50:14 | FromDiscord | <Clyybber> disruptek: nimph updates your dependencies for you right? Doesn't seem overkill to support a lockfile then IMO |
19:52:15 | * | JustASlacker quit (Quit: Leaving) |
19:52:20 | FromDiscord | <Clyybber> disruptek: In general, why limit it to nim projects? I might wonna include some C library. |
19:53:33 | sealmove | well, Kaitai is not ideal for network protocols imo; it tries to be more general and has features for describing ridiculously complex formats which ASN.1 can't. |
19:54:02 | sealmove | I got interested in it because it's very useful in computer forensics |
19:54:02 | FromDiscord | <Clyybber> disruptek: Does nimph use git submodules? |
19:54:21 | sealmove | parsing stuff like the windows registry |
19:54:33 | FromDiscord | <Clyybber> sealmove: ##FUN## |
19:54:40 | FromDiscord | <Clyybber> :p |
19:55:58 | federico3 | urgh |
19:56:17 | FromGitter | <sheerluck> @sealmove if it injects the parser directly it does not allow me to `seek` to some offset before parsing. Well I guess I have to imitate my generated.cpp by hand then. Thank you for your work! |
19:57:16 | sealmove | sheerluck: ksy grammar has features for seeking |
19:57:44 | disruptek | clyybber: we should make it support submodules. |
19:59:33 | sealmove | sheerluck: you can even simply do: |
19:59:34 | sealmove | - id: skip_bytes |
19:59:36 | sealmove | size: 256 |
20:00:36 | sealmove | but if you don't want to involve the grammar, then you can (not yet implemented) a string to fromFile() instead of a file path. |
20:00:41 | FromGitter | <sheerluck> @sealmove my seeking is way beyond abilities of ksy grammar: β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df3ede9e47fb31eb7a85d33] |
20:00:47 | sealmove | a stream* |
20:01:45 | sealmove | hmm, are you sure? what does find_mvhd() do? |
20:02:06 | FromDiscord | <niv> hello! i'm trying to link a .cpp-sourced object file into a nim program. the .cpp file requires -std=c++14 to compile. i can't use {.compile: } because that doesn't allow me to pass this arg, and i can't pass -std=c++14 to nim (via passC) itself because then everything else blows up (i.e. i the compilation of C files doesn't work anymore, including stdlib). i know i can write my own shim via {.link} but if there's a cleaner solution, i'd wa |
20:02:14 | sealmove | if it's not independent of the file you are parsing then I am sure KS can do it |
20:03:54 | sealmove | sheerluck: KS has an expression language with functions and all: https://doc.kaitai.io/user_guide.html#_expression_language |
20:04:17 | sealmove | but again if it's easier to do in your host language then you should pass a stream to fromFile() |
20:04:45 | FromGitter | <sheerluck> @sealmove thank you for your help |
20:14:07 | FromGitter | <bung87> federico3 you may just need zeromq |
20:45:33 | FromDiscord | <mratsim> wow those are some bat shit crazy coroutines: https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html I think we can now rewrite asyncdispatch with coroutines. I do not guarantee the usability of the stacktraces π |
20:46:02 | FromDiscord | <mratsim> @niv use {.passC:-std=c++14.} |
20:46:12 | FromDiscord | <mratsim> ah |
20:46:20 | FromDiscord | <mratsim> use file specific nim.cfg |
20:46:50 | FromDiscord | <mratsim> for example: https://github.com/mratsim/weave/blob/master/benchmarks/matmul_gemm_blas/gemm_pure_nim/nim.cfg |
20:47:20 | FromDiscord | <mratsim> so that the flag don't infect the other SIMD files: https://github.com/mratsim/weave/tree/master/benchmarks/matmul_gemm_blas/gemm_pure_nim/common |
20:47:34 | FromGitter | <Milerius> Hello |
20:47:43 | FromGitter | <Milerius> I tried to install nim on my osx but got |
20:47:46 | FromGitter | <Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df3f8f2c6ce6027ebb72fe6] |
20:47:49 | FromGitter | <Milerius> Is it normal ? |
20:48:10 | * | couven92 quit (Read error: Connection reset by peer) |
20:48:24 | FromDiscord | <mratsim> or apparently there is this new localPassc pragma that I didn't hear about: https://github.com/nim-lang/Nim/pull/12706 |
20:48:25 | disbot | β₯ implemented a new localPassc pragma |
20:48:37 | * | couven92 joined #nim |
20:49:10 | FromDiscord | <mratsim> @Milerius, no, and it seems like a choosenim crash |
20:49:41 | * | endragor joined #nim |
20:50:51 | FromGitter | <Asc2011> @Milerius hi roman, i installed from git yesterday, took < 10min to compile. never tried choosenim |
20:51:39 | FromGitter | <Asc2011> @Milerius brew has nim, too. |
20:51:55 | FromGitter | <Milerius> Yeah but choosetim install everything important |
20:52:01 | FromGitter | <Milerius> choosenim* |
20:52:06 | FromGitter | <Milerius> Nimble, Nim, Nimpretty etc |
20:52:45 | FromGitter | <Asc2011> i tried brew first and AFAIK nimble was in the box |
20:53:29 | FromGitter | <Milerius> ok i will try with brew |
20:53:30 | FromGitter | <Milerius> thanks |
20:54:22 | * | endragor quit (Ping timeout: 268 seconds) |
20:57:15 | * | nsf quit (Quit: WeeChat 2.6) |
20:57:28 | FromGitter | <Milerius> @Asc2011 Work's like a charm. |
20:57:29 | FromGitter | <Milerius> Thank's |
20:58:00 | FromGitter | <Milerius> Can I ask about design here ? β β I try to move from my c++ app to here, I would appreciate some advice |
20:58:31 | FromGitter | <Milerius> Not exactly move everything, but understand how I can do the equivalent of some c++ as nim idiom |
21:05:16 | FromGitter | <Asc2011> @Milerius i'm new to nim, better ask the pros around here :) |
21:12:40 | FromDiscord | <niv> @mratsim that nim.cfg trick is exactly what i wanted, thank you |
21:15:46 | * | narimiran quit (Ping timeout: 252 seconds) |
21:23:26 | FromDiscord | <mratsim> check the localPassC pragma as well, I asked Araq to add it because I didn't want to ship my cfg all the time |
21:23:30 | FromDiscord | <mratsim> I didn't try it though |
21:23:48 | FromDiscord | <mratsim> cc @niv |
21:28:15 | FromDiscord | <niv> i got the code to work by passing -std=c++14 globally meanwhile. maybe i had some stale cache somewhere |
21:31:09 | disruptek | solitudesf-: fixed #62. |
21:31:11 | disbot | https://github.com/nim-lang/Nim/issues/62 -- 5lispRepr() crashes with SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=24kp |
21:31:21 | disruptek | er, |
21:31:25 | solitudesf- | disbot, you played yourself |
21:31:34 | disruptek | dummy. |
21:32:01 | disruptek | now there's no excuse for missing tags. |
21:34:29 | disruptek | !search require release tags |
21:34:30 | disbot | https://github.com/nim-lang/packages/issues/1051 -- 3Require Release Tags 7& 13 more... |
21:34:46 | * | filcuc joined #nim |
21:34:51 | disruptek | i'm calling that one, and lockfiles, fully solved. |
21:39:54 | * | Kaynatwo joined #nim |
21:42:05 | * | filcuc quit (Quit: Konversation terminated!) |
21:43:01 | * | filcuc joined #nim |
21:43:23 | FromDiscord | <mratsim> mmmh, how do you normalize Nim identifiers in macros? |
21:43:30 | * | filcuc quit (Client Quit) |
21:43:56 | disruptek | mratsim: i pulled sanitize out of openapi code. it works well. it's in nimph. |
21:44:10 | * | Kanato quit (Ping timeout: 265 seconds) |
21:44:17 | disruptek | https://github.com/disruptek/nimph/blob/master/src/nimph/sanitize.nim |
21:45:37 | FromDiscord | <mratsim> camel_Case with underscore? |
21:45:51 | disruptek | yeah, but there's a const you can override... |
21:46:08 | FromDiscord | <mratsim> this looks quite costly |
21:46:16 | disruptek | yep. |
21:47:08 | FromDiscord | <mratsim> It's for compile-time use before hashing for tables for codegen, I fear slwing down compile to a crawl |
21:47:21 | * | filcuc joined #nim |
21:47:26 | FromDiscord | <mratsim> I'm playing with a state machine generator as well π |
21:47:26 | * | filcuc quit (Remote host closed the connection) |
21:47:36 | disruptek | well, optimize it for me. |
21:48:02 | disruptek | openapi is slow. this could be one reason for that. |
21:49:27 | FromDiscord | <mratsim> I'll just assume people don't make the mistake :p |
21:50:05 | disruptek | i wish this was magic but, eh, it ain't. |
21:50:34 | FromDiscord | <mratsim> Yeah, even for macro that would be very useful |
21:51:02 | * | Hideki_ joined #nim |
21:54:45 | * | gour quit (Remote host closed the connection) |
21:55:21 | * | Hideki_ quit (Ping timeout: 246 seconds) |
22:08:41 | * | odc quit (Ping timeout: 276 seconds) |
22:10:12 | * | odc joined #nim |
22:10:50 | * | Kanato joined #nim |
22:10:57 | disruptek | wow, nimph just found a broken tag for me. |
22:11:28 | disruptek | i'm one of those bozos. |
22:14:37 | * | Kaynatwo quit (Ping timeout: 265 seconds) |
22:28:39 | * | hexeratops joined #nim |
22:45:59 | * | solitudesf- quit (Ping timeout: 268 seconds) |
22:50:28 | * | endragor joined #nim |
22:54:46 | * | endragor quit (Ping timeout: 252 seconds) |
23:22:39 | * | sealmove quit (Quit: WeeChat 2.6) |
23:23:33 | * | lritter quit (Ping timeout: 246 seconds) |
23:27:50 | * | endragor joined #nim |
23:28:14 | * | lritter joined #nim |
23:31:57 | * | endragor quit (Ping timeout: 240 seconds) |
23:36:09 | * | Hideki_ joined #nim |
23:50:03 | * | Hideki_ quit (Remote host closed the connection) |
23:50:50 | * | Hideki_ joined #nim |
23:55:12 | * | tane quit (Quit: Leaving) |
23:55:17 | * | Hideki_ quit (Ping timeout: 250 seconds) |