00:05:43 | * | ftsf joined #nim |
00:18:58 | * | craigger_ quit (Read error: Connection reset by peer) |
00:20:42 | * | craigger joined #nim |
00:36:03 | * | ftsf_ joined #nim |
00:36:13 | * | ftsf quit (Read error: Connection reset by peer) |
00:38:03 | * | vlad1777d__ quit (Ping timeout: 250 seconds) |
00:44:25 | * | stefanos82 quit (Quit: Quitting for now...) |
00:51:41 | FromGitter | <yyyc514> so is “nimf” still a thing? |
00:51:46 | FromGitter | <yyyc514> for filters? |
00:51:59 | FromGitter | <yyyc514> seems to work just fine if it’s .nim and .nimf doens’t actually work |
00:53:46 | FromGitter | <yyyc514> @elrood thanks |
00:54:31 | FromGitter | <yyyc514> is there any way to @ people who are on the IRC gateway? |
00:56:58 | ryuo | yyyc514: not really. the normal method here is normally to do it like I am here. |
00:57:22 | FromGitter | <yyyc514> right but i’m not on IRC :) |
00:57:26 | FromGitter | <yyyc514> @ryuo so does this ping you? |
00:57:35 | ryuo | yyyc514: most clients will highlight us if our nick is mentioned. |
00:57:47 | FromGitter | <yyyc514> true, just the autocomplete here is soorly lacking :) |
00:58:12 | ryuo | what do you expect? Gitter can't see what's beyond the bridge. |
00:58:24 | ryuo | And there's 157 people here in the channel. |
00:59:13 | FromGitter | <yyyc514> true, thought one could imagine an API there gitter allowed for “proxies” and then it would know nicks of peopel who’ve spoken, etc. |
00:59:16 | FromGitter | <yyyc514> oh well |
01:00:11 | ryuo | Situation isn't much better for IRC. I can't autocomplete people either from another destination. |
01:00:24 | ryuo | My client only recognizes native users. |
01:00:39 | ryuo | Though I could probably extend my client if I cared enough. |
01:01:39 | FromGitter | <yyyc514> yeah depending what it is :) |
01:02:01 | ryuo | Because IRC is an open protocol, it could probably be extended like that, but Gitter not so much. I think you're stuck with the web client. |
01:04:35 | FromGitter | <yyyc514> `nim/lib/pure/os.nim(765, 11) Error: cannot 'importc' variable at compile time` |
01:04:38 | FromGitter | <yyyc514> another macro isuse? |
01:04:59 | FromGitter | <yyyc514> trying to use os.walkFiles |
01:05:21 | FromGitter | <yyyc514> but that’s probably libraries so it won’t run in the VM? |
01:06:04 | ryuo | Let me guess. It's an alternative to ftw. |
01:06:18 | FromGitter | <yyyc514> ftw? |
01:06:25 | ryuo | POSIX function. |
01:06:36 | ryuo | File Tree Walk. |
01:06:49 | FromGitter | <yyyc514> it says it uses POSIX |
01:07:06 | ryuo | yea, it has to use native APIs to walk folders/directories. |
01:07:20 | ryuo | I was just reminded of C ftw/nftw. |
01:07:50 | FromGitter | <yyyc514> hmmmm so i can’t ahve a macro do any code generation that involves a dynamic list of files? |
01:08:31 | ryuo | Is that surprising? Compile time expressions normally require it to be knownable at compile time. |
01:08:44 | ryuo | knowable* |
01:09:04 | FromGitter | <yyyc514> a dynamic list of files knoable at compile time |
01:09:20 | FromGitter | <yyyc514> i know readFile works |
01:09:29 | FromGitter | <yyyc514> so if i wante dto hard code the list i could, but i don't |
01:11:28 | FromGitter | <yyyc514> maybe you could build a two stage pipeline with staticExec? |
01:12:37 | ryuo | No idea. I've never really used CTFE, so I'm not entirely sure what the benefit is. |
01:15:09 | * | owner_ joined #nim |
01:15:10 | * | Tortice quit (Read error: Connection reset by peer) |
01:15:33 | * | owner_ is now known as Guest86033 |
01:15:43 | * | dddddd quit (Remote host closed the connection) |
01:15:52 | * | Guest86033 left #nim (#nim) |
01:16:06 | * | Tortice joined #nim |
01:21:54 | FromGitter | <yyyc514> ok so import from inside macro doesn’t work |
01:21:57 | FromGitter | <yyyc514> even if the macro IS at thet op level |
01:23:27 | FromGitter | <timotheecour> Well feel free to upvote https://github.com/nim-lang/Nim/issues/9253 |
01:28:26 | FromGitter | <yyyc514> did and added comment, thanks :) |
01:29:02 | FromGitter | <yyyc514> ok not surprise but parseStmt doesn’t seem to work on filter templates |
01:42:10 | * | craigger_ joined #nim |
01:42:29 | * | craigger quit (Ping timeout: 244 seconds) |
01:43:47 | FromGitter | <yyyc514> no way of using variable in import i suppose to have like an application root? |
01:44:17 | FromGitter | <yyyc514> hmmm strings are allowed |
01:45:19 | FromGitter | <yyyc514> a static string evidentally :) |
01:50:16 | * | craigger joined #nim |
01:50:52 | * | craigger_ quit (Ping timeout: 246 seconds) |
02:04:48 | * | banc quit (Quit: ZNC - http://znc.in) |
02:05:11 | * | Snircle quit (Remote host closed the connection) |
02:20:28 | * | banc joined #nim |
02:34:06 | * | dekz joined #nim |
02:34:48 | * | dekz quit (Client Quit) |
02:38:15 | * | dekz joined #nim |
03:09:23 | * | craigger_ joined #nim |
03:10:15 | * | craigger quit (Ping timeout: 252 seconds) |
03:14:42 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:16:50 | * | chemist69 joined #nim |
03:37:14 | * | Tortice quit (Ping timeout: 276 seconds) |
03:48:18 | FromGitter | <yyyc514> anyone know why i can’t ab (apache bench) Jester? It’s like it hangs on the first connection. |
03:55:31 | * | endragor joined #nim |
04:06:42 | * | craigger joined #nim |
04:09:32 | * | craigger_ quit (Ping timeout: 268 seconds) |
04:28:26 | * | Tortice joined #nim |
04:42:51 | * | craigger_ joined #nim |
04:45:01 | * | craigger quit (Ping timeout: 260 seconds) |
04:53:48 | * | craigger_ quit (Ping timeout: 245 seconds) |
04:54:10 | * | ftsf_ quit (Quit: Leaving) |
04:58:34 | * | craigger joined #nim |
05:01:18 | * | craigger_ joined #nim |
05:03:19 | * | craigger- joined #nim |
05:03:28 | * | craigger quit (Ping timeout: 272 seconds) |
05:06:03 | * | craigger_ quit (Ping timeout: 244 seconds) |
05:09:41 | * | dekz quit (Quit: Leaving) |
05:16:31 | * | craigger joined #nim |
05:18:48 | * | craigger_ joined #nim |
05:19:13 | * | craigger- quit (Ping timeout: 245 seconds) |
05:21:50 | * | craigger quit (Ping timeout: 272 seconds) |
05:23:08 | * | craigger joined #nim |
05:23:12 | * | leorize quit (Ping timeout: 276 seconds) |
05:23:32 | * | craigger_ quit (Ping timeout: 268 seconds) |
05:25:16 | * | craigger_ joined #nim |
05:28:10 | * | craigger quit (Ping timeout: 272 seconds) |
05:36:15 | * | nsf joined #nim |
05:37:28 | * | craigger_ quit (Read error: Connection reset by peer) |
05:38:50 | * | craigger joined #nim |
05:40:56 | * | craigger_ joined #nim |
05:43:42 | * | craigger quit (Ping timeout: 252 seconds) |
05:47:07 | * | leorize joined #nim |
06:20:55 | * | craigger joined #nim |
06:22:33 | * | craigger_ quit (Ping timeout: 245 seconds) |
06:50:48 | * | Vladar joined #nim |
06:52:56 | * | smt` quit (Read error: Connection reset by peer) |
07:08:31 | * | rlr quit (Quit: -) |
07:08:39 | * | rlr joined #nim |
07:26:49 | * | Arrrr joined #nim |
07:44:19 | * | floppydh joined #nim |
07:45:17 | FromGitter | <xmonader> guys i tried lots of combinations for \r\n but no luck ? |
07:45:31 | FromGitter | <xmonader> the line never gets retwritten over? |
07:47:02 | leorize | remember that `\n` is 1 character... |
07:47:07 | FromGitter | <xmonader> ```echo "Hello world\r\nthis is should replace it"``` |
07:47:38 | leorize | !eval echo "Hello world\rthis should replace it" |
07:47:42 | NimBot | Hello world↵this should replace it |
07:48:54 | leorize | well it only works when you run in terminal :P |
07:49:10 | FromGitter | <xmonader> @leorize i'm running it in the terminal xD |
07:49:32 | leorize | don't do `\n` after `\r` and you should be fine |
07:50:04 | FromGitter | <xmonader> ah right what am i thinking! sorry |
07:52:36 | FromGitter | <mratsim> @timotheecour @Araq we can have almost first class iter. I like your previous proposition of them just having `init` and `next` and then using a state machine. I also like the yield version but it’s easy to switch between the two. Just always write iterators in a `while true` everything before is `init` everything after is `next`. Now in terms of ergonomic the yield version is better so we should have a macro that |
07:52:36 | FromGitter | ... transforms all while/for loop into while true loop, luckily the compiler already does that for the codegen. |
08:04:25 | * | PMunch joined #nim |
08:12:19 | FromGitter | <yyyc514> i do’nt suppose there is a way to define my own pseudo include paths? |
08:14:08 | FromGitter | <yyyc514> ok wow just adding lib and app to the paths is a huge help :) |
08:16:55 | * | rewadz joined #nim |
08:20:35 | FromGitter | <mratsim> @yyyc514 {.passC: “-I” & yourOwnPath.} |
08:20:54 | * | vegai joined #nim |
08:21:18 | FromGitter | <yyyc514> and where would i put that pragma? |
08:21:29 | FromGitter | <mratsim> For example try to compile that you will it will crash and you will see how it works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc44e0864cfc273f9cc72dc] |
08:25:55 | leorize | yyyc514: `nim --fullhelp | grep include` |
08:26:17 | leorize | then write your own `config.nims` containing the flags you need |
08:26:54 | FromGitter | <yyyc514> isn’t nim.cfg just oen option per line? |
08:26:59 | FromGitter | <yyyc514> -p doesn’t seem to work in there |
08:28:16 | leorize | write `path=/path/to/what/you/need` |
08:28:36 | leorize | or in NimScript `--path:"/path/to/modules"` |
08:28:52 | leorize | or `switch("path", "/path/to/modules")` |
08:28:57 | FromGitter | <yyyc514> thanks |
08:44:47 | * | tdc joined #nim |
08:59:04 | * | leorize quit (Ping timeout: 272 seconds) |
09:03:41 | * | gmpreussner_ joined #nim |
09:04:06 | * | gmpreussner quit (Ping timeout: 252 seconds) |
09:06:33 | * | ven473 quit (Remote host closed the connection) |
09:23:56 | * | platoff joined #nim |
09:25:57 | FromGitter | <bpo217> If I write an int to a file, using `file.write(10)`, how do I read it back into an int variable? |
09:26:51 | FromGitter | <bpo217> I guess I could use readBytes but then how do I convert that array. |
09:27:57 | FromGitter | <bpo217> I guess I mean is there a simpler when other than calculating the value from an array of bytes. |
09:28:03 | FromGitter | <bpo217> *simpler way |
09:28:37 | FromGitter | <Vindaar> @bpo217 if you only store a single int, you can do ⏎ ⏎ ```import strutils ⏎ ⏎ let a = readFile("filename.txt").parseInt``` [https://gitter.im/nim-lang/Nim?at=5bc45dc582893a2f3be450f4] |
09:29:09 | FromGitter | <Vindaar> For more data in the file, you need to parse the string you get from `readFile` and split it into the individual numbers first. Then you can use `parseInt` on those again |
09:31:14 | FromGitter | <bpo217> @Vindaar Neat trick. It isn't the only one though, I'm packing up my own file. |
09:31:35 | FromGitter | <Vindaar> figured as much. What's the content of the file look like? |
09:31:36 | * | Senketsu joined #nim |
09:32:47 | FromGitter | <bpo217> Well I mean lets say for simplicity it's just 2 ints in a row. Just want to know a reasonable strategy for converting bytes to Nim's types. |
09:33:22 | FromGitter | <bpo217> Actually lets say an int then a string whose length is denoted by the int, assuming UTF-8 |
09:36:01 | FromGitter | <Vindaar> I mean unless you're really after maximum performance, all the procs in `strutils` are just fine for that. And for UTF-8 there's the `unicode` module |
09:37:07 | FromGitter | <bpo217> @Vindaar cool cool. Thanks for your help! |
09:37:39 | FromGitter | <Vindaar> no worries! if you have trouble understanding how to use something, just ask :) |
09:40:26 | Araq | or maybe 'copyMem' is what you want |
09:42:15 | FromGitter | <bpo217> I'll look at that too. It might be it looks like write converts int to a string also, which isn't really what I want honestly. |
09:42:35 | FromGitter | <bpo217> I'll keep messing with it. |
09:43:39 | FromGitter | <bpo217> Does `addr` convert the int to what I want? How do I write it to a file at that point? |
09:44:46 | FromGitter | <bpo217> Unsafe procedures are fine too since I'm aware of the file structure too. |
09:45:04 | PMunch | bpo217, I'd take a look at the streams module |
09:45:42 | PMunch | Create a filestream and use the read/write procedures in the module to read and write your data |
09:46:31 | FromGitter | <bpo217> Oh this stream module looks very promising. |
09:47:34 | FromGitter | <bpo217> Thanks for the tip. |
09:48:50 | FromGitter | <bpo217> 100% what I was looking for thanks for that. |
10:01:36 | FromGitter | <gogolxdong> Any guide of Android and iOS development? |
10:03:09 | Araq | yay, I destroyed my .git |
10:03:19 | FromGitter | <bpo217> nailed it |
10:03:23 | Araq | thanks to this "must not merge" crap |
10:03:33 | Araq | Unlink of file 'lib/system.nim' failed. Should I try again? (y/n) n |
10:03:33 | Araq | error: unable to unlink old 'lib/system.nim': Invalid argument |
10:03:40 | FromGitter | <bpo217> @gogolxdong What kind of tips were you looking for? |
10:03:45 | Araq | wtf, lib\system.nim never went anywhere |
10:04:10 | FromGitter | <bpo217> Also thanks for the help guys: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc4661ac08b8b3067194033] |
10:04:37 | FromGitter | <gogolxdong> How to begin ? nim compiled to cpp for Android and objc for iOS? |
10:07:19 | Araq | gogolxdong, checkout how 'nimx' does it, maybe |
10:08:47 | FromGitter | <bpo217> Well, I know if you use the c compiler flag, the app static lib or lib flags, and the header flag, plus you add the os flag, you get a completely cross platform library which you can import into projects. I successfully used my library in a swift project and I will be doing so in production. |
10:09:27 | FromGitter | <bpo217> The pragmas you use on your proc will be a little different, instead of `exportc` it's something else for the objc or cpp |
10:10:35 | FromGitter | <gogolxdong> write pure Nim without native code? |
10:11:05 | FromGitter | <bpo217> https://nim-lang.org/docs/manual.html#foreign-function-interface |
10:15:42 | FromGitter | <bpo217> @gogolxdong yep. You have to decide how you want to communicate between the two languages though, which can vary based on your situation. |
10:15:58 | FromGitter | <gogolxdong> what's like your APP? |
10:15:58 | Araq | I'm at (HEAD detached at 8252c65) and yet 'git diff' shows diffs that are not mine, what now? |
10:15:58 | Araq | who asked for this detached head state btw, is this whole system just a single exposed bug? |
10:16:42 | FromGitter | <narimiran> Araq: https://xkcd.com/1597/ |
10:17:52 | Araq | so true... |
10:18:29 | FromGitter | <bpo217> lol |
10:19:04 | FromGitter | <bpo217> It is beautiful |
10:19:05 | Arrrr | lol |
10:19:17 | federico3 | it's sad |
10:19:19 | FromGitter | <bpo217> It's easy to take git for granted |
10:20:11 | FromGitter | <narimiran> `git reflog` to the rescue! saved my ass so many times! |
10:23:03 | Araq | I want Fossil. |
10:23:32 | FromGitter | <bpo217> I found that command on stack overflow when a reset crisis was happening lol |
10:23:46 | Araq | well crisis is gone |
10:24:04 | Araq | I typed in some random commands from stack overflow and lost one commit or something |
10:24:42 | * | kapil____ joined #nim |
10:24:50 | FromGitter | <mratsim> I think that’s the whole crisis in java and JS ecosystems. copy-pasting from SO :P |
10:24:55 | FromGitter | <bpo217> "or something" is a loaded statement lol |
10:28:01 | FromGitter | <bpo217> Speaking of cross language bridges, I'm genuinely surprised Apache Thrift doesn't have Nim support atm. |
10:30:39 | FromGitter | <mratsim> In minimal you have Nim, Apache Thrift is not minimal ;) |
10:31:13 | FromGitter | <bpo217> touché |
10:31:27 | Araq | mratsim: wanna try a compiler patch for your .compile problem? |
10:32:54 | FromGitter | <mratsim> Currently no, I have already too many stuff I want to do :P, I can use relative paths fine for my lib: https://github.com/numforge/laser/blob/master/laser/cpuinfo.nim#L285-L301 |
10:33:25 | Araq | ok, you need to mark the important bugs somehow |
10:33:51 | FromGitter | <mratsim> but relative paths don’t work for headers because they are not moved in the nimcache directory, that’s why I always need Absolute path to the currentSourcePath() |
10:34:43 | FromGitter | <mratsim> you can give me tagging power for Nim issues |
10:35:21 | Araq | done (I think) |
10:36:46 | * | leorize joined #nim |
10:36:58 | FromGitter | <mratsim> works, thanks |
10:39:29 | FromGitter | <narimiran> Araq: re moving RFCs to their own repo: is that possible without losing all their current comments? |
10:40:12 | Araq | I doubt it but we can start new RFCs in the new repo and the old RFCs ...well... |
10:46:12 | vegai | anyone using the nim layer in spacemacs (0.300)? I seem to get it into a 100% CPU loop very easily |
10:47:03 | * | Senketsu quit (Quit: WeeChat 2.2) |
10:47:07 | vegai | e.g. by just typing "when " into an empty nim file |
10:48:02 | FromGitter | <alehander42> @narimiran this seems kinda useful: https://github.com/IQAndreas/github-issues-import it's the closest thing to adequately copying the comments |
10:48:25 | FromGitter | <alehander42> e.g. https://github.com/IQAndreas-testprojects/github-issues-import-example/issues/10 |
10:50:09 | FromGitter | <narimiran> @alehander42 looks good enough to me. let's wait and see what Araq says.... |
10:52:05 | * | enthus1ast quit (Ping timeout: 276 seconds) |
10:58:25 | * | elrood joined #nim |
11:01:28 | * | Senketsu joined #nim |
11:03:53 | FromGitter | <mratsim> @vegai, killall nimsuggest and killall nim |
11:04:33 | Araq | narimiran, give it a try, create nim-lang/rfcs |
11:04:34 | FromGitter | <mratsim> compiletime evaluation can boggle nimsuggest down, it’s not emacs specific, it always happen to me in Vscode when I work on macros |
11:07:19 | FromGitter | <narimiran> Araq: will do (later today, if i find the time) |
11:12:55 | Araq | mratsim: we should really fix that one... |
11:12:58 | FromGitter | <narimiran> in the mean time, see if any of the existing RFCs can be closed |
11:14:36 | FromGitter | <mratsim> nice afternoon in planning :p |
11:16:56 | * | stefanos82 joined #nim |
11:46:24 | * | abm joined #nim |
11:48:29 | * | PMunch quit (Remote host closed the connection) |
11:53:54 | * | vlad1777d__ joined #nim |
11:58:57 | vegai | mratsim: didn't seem to be the issue here |
12:00:37 | * | dddddd joined #nim |
12:05:00 | FromGitter | <kaushalmodi> Araq: Is there a plan to support a global config.nims? |
12:06:37 | FromGitter | <kaushalmodi> Thinking of my hello_musl project, and things like https://www.reddit.com/r/nim/comments/9o4y4m/nimclihelper_v2_completely_rewritten_in_nim_it/, it would be nice to have a global config.nims so that generic tasks and "when defined ..." blocks don't need to be copy pasted in each new project. |
12:11:47 | * | krux02 joined #nim |
12:14:16 | FromGitter | <narimiran> that new repo for RFCs: is "rfcs" too cryptic? should it be named "proposals", to make it clearer? |
12:16:25 | FromGitter | <dom96> RFCs sounds good to me |
12:16:29 | FromGitter | <dom96> Rust's repo is named the same https://github.com/rust-lang/rfcs |
12:18:09 | FromGitter | <narimiran> alrighty |
12:18:18 | krux02 | I think rfc is fine |
12:19:44 | FromGitter | <narimiran> without "s"? sounds better to me |
12:21:04 | krux02 | I like the idea to have a separate repo to organize RFCs |
12:21:20 | FromGitter | <dom96> rfcs makes more sense |
12:21:27 | krux02 | the issue counter is too high, and an RFC is something you can't fix or close or put aside |
12:21:38 | krux02 | it just hangs there in your view |
12:21:44 | FromGitter | <dom96> It sucks but we need a higher barrier to entry for RFCs |
12:21:56 | FromGitter | <narimiran> @dom96 but each of R F C is a word, "s" isn't |
12:22:15 | FromGitter | <dom96> We need to outline exactly what is required from an RFC, not just "Let's have better imports kthxbai" :) |
12:22:38 | FromGitter | <kaushalmodi> +1 for "rfcs" |
12:22:43 | FromGitter | <dom96> RFC is a document |
12:22:51 | krux02 | narimiran[m], it doesn't really matter, does it? I mean it is plural. it isn't like you don't use plural s on other acronyms |
12:22:51 | FromGitter | <dom96> RFCs is multiple such documents |
12:23:05 | FromGitter | <dom96> Yes, GitHub doesn't care about the casing but shrug |
12:23:20 | FromGitter | <narimiran> ok, rfcs it is |
12:23:47 | FromGitter | <narimiran> @krux02 when i use plural is like RFCs, not RFCS nor rfcs |
12:24:01 | FromGitter | <kaushalmodi> @narimiran just randomly searched for it and was not surprised to find something like this: https://github.com/IQAndreas/github-issues-import |
12:24:09 | FromGitter | <alehander42> @dom96 a default issue template would help with that |
12:24:18 | FromGitter | <kaushalmodi> (because GitHub has great API for probably everything) |
12:24:53 | FromGitter | <narimiran> @kaushalmodi that link was already posted and i'm about to use it ;) |
12:25:42 | FromGitter | <kaushalmodi> As I said, that was a random search, and that project happens to be dead. But there should be an actively developed tool out there that allows transferring selected issues from one repo to another. |
12:25:52 | krux02 | another thing, is the amount of registers lowered? |
12:26:02 | krux02 | my tests on ast pattern maching don't run anymore |
12:26:41 | FromGitter | <narimiran> @kaushalmodi well it says i could use `--issues 3 27 3428 1199` |
12:27:10 | FromGitter | <narimiran> i cannot automatically export all issues containing a certain label, but oh well |
12:27:30 | FromGitter | <kaushalmodi> Nimble project idea :P |
12:27:40 | FromGitter | <alehander42> e.g. ``` ⏎ Problem: .. ⏎ ⏎ Current solution: .. ⏎ ... [https://gitter.im/nim-lang/Nim?at=5bc487bbc08b8b30671a2124] |
12:32:06 | FromGitter | <narimiran> https://github.com/nim-lang/rfcs/issues/1 |
12:32:18 | FromGitter | <narimiran> it seems it works! woohoo |
12:33:10 | FromGitter | <narimiran> now, is there a way to somehow get a list of all issue numbers for all these? https://github.com/nim-lang/Nim/issues?q=is%3Aopen+is%3Aissue+label%3ARFC |
12:40:39 | * | arecaceae quit (Remote host closed the connection) |
12:40:58 | * | arecaceae joined #nim |
12:41:05 | FromGitter | <mratsim> write a Nim parse :P |
12:41:08 | FromGitter | <mratsim> parser* |
12:41:27 | FromGitter | <mratsim> but otherwise doesn’t api.github.com offers a json/rest API? |
12:42:15 | FromGitter | <mratsim> GET /repos/:owner/:repo/issues |
12:42:25 | FromGitter | <mratsim> https://developer.github.com/v3/issues/#list-issues-for-a-repository |
12:43:25 | FromGitter | <mratsim> THere is a GraphQL API too, you can check a tuto here: https://blog.codeship.com/an-introduction-to-graphql-via-the-github-api/ |
12:43:33 | FromGitter | <narimiran> naah, manually copy-pasting is fiiine :D |
12:46:39 | FromGitter | <alehander42> just copy the element contents in an array using querySelector in the browser console |
12:47:04 | FromGitter | <alehander42> (the elements which have `#..`, you can find their css class in the inspector) |
12:47:06 | FromGitter | <mratsim> otherwise this should work: https://chrome.google.com/webstore/detail/instant-data-scraper/ofaokhiedipichpaobibbnahnkdoiiah?hl=en |
12:47:34 | FromGitter | <narimiran> fuck, trying to move multiple issues, i get: "Double check that your username and password are correct, and that you have permission to read from or write to the specified repositories." |
13:00:47 | FromGitter | <dom96> Wouldn't it be better to start fresh? |
13:01:09 | FromGitter | <dom96> If the RFC is wanted enough someone will take the time to write a properly structured RFC |
13:01:31 | FromGitter | <dom96> Otherwise we are starting out with RFCs that are all over the place in terms of quality. |
13:03:38 | FromGitter | <alehander42> this would be a very demotivational step |
13:03:55 | FromGitter | <narimiran> i don't want to be the one that will be yelled at with "why did you close my RFC" ;) |
13:04:08 | FromGitter | <alehander42> we can just review the rfc-s: leave the good ones, close/or ask the creator of weaker ones to improve them |
13:04:45 | FromGitter | <narimiran> i'll transfer currently open ones, and close them in nim repo. then somebody else can go trough rfcs repo and see what can be closed |
13:06:34 | FromGitter | <narimiran> and if something is a false positive (transferred if it shouldn't have been), we'll reopen it in main nim repo |
13:07:05 | FromGitter | <mratsim> sounds good, kudos |
13:07:16 | * | endragor quit (Remote host closed the connection) |
13:08:58 | FromGitter | <narimiran> btw, i guess i'm hitting some github limit with too many requests.... this transfer might take a while.... |
13:10:18 | FromGitter | <narimiran> anybody interested in dividing this work? :) |
13:10:52 | FromGitter | <dom96> Did you grab an API key? |
13:10:56 | FromGitter | <narimiran> nope |
13:11:02 | FromGitter | <dom96> Get one :) |
13:11:09 | FromGitter | <dom96> Using it is simple |
13:11:27 | FromGitter | <dom96> Check out how my bounty source updater script works if you're curious how to use it |
13:11:35 | FromGitter | <dom96> It's in the website repo |
13:12:04 | FromGitter | <narimiran> does that mean i should modify the python script used for this? |
13:12:37 | * | smt joined #nim |
13:16:30 | FromGitter | <narimiran> i've followed these steps: https://github.com/IQAndreas/github-issues-import/issues/21 |
13:18:57 | * | vlad1777d__ quit (Ping timeout: 244 seconds) |
13:19:18 | FromGitter | <narimiran> ...but i get the same error as before |
13:27:53 | * | skelett quit (Read error: Connection reset by peer) |
13:28:02 | FromGitter | <Varriount> Neat, a new RFC repo |
13:29:39 | * | skelett joined #nim |
13:36:11 | FromGitter | <dom96> Python? Blasphemy. |
13:36:47 | FromGitter | <narimiran> don't you dare to talk like that to my favourite language until i met nim! :D |
13:36:57 | * | shadowbane joined #nim |
13:37:02 | FromGitter | <narimiran> putting some `sleep` in that script helped ;) |
13:39:26 | * | xet7 quit (Remote host closed the connection) |
13:40:48 | * | xet7 joined #nim |
13:42:46 | FromGitter | <narimiran> damn, i spoke too early |
13:44:53 | FromGitter | <dom96> Should be easy in python too in any case |
13:49:04 | * | endragor joined #nim |
13:50:12 | krux02 | Araq: what has been changed recently in the VM? number of used registers was already limiting in my ast-pattern matching library |
13:50:44 | krux02 | but now it became worse and the test case from that library broke |
13:53:45 | * | endragor quit (Ping timeout: 252 seconds) |
14:03:33 | Araq | krux02: nothing changed except that maybe 'assert' produces more bytecode |
14:04:47 | Araq | we need some register spilling mechanism, yay |
14:37:31 | * | nsf quit (Quit: WeeChat 2.2) |
14:37:53 | shashlick | dom96: thanks for reviewing the choosenim pr. Am traveling but will get back soon. Doesn't look like any show stoppers |
14:39:39 | shashlick | Regarding the comment of checking for sources on http://github.com if not on http://nim-lang.org, idea was that eventually you won't need to post anything to nim-lang since it is already there on http://github.com. |
14:58:52 | Araq | shashlick: I'm slowing talking dom96 into making you a core dev for choosenim :-) |
14:58:59 | Araq | *of |
15:08:35 | FromGitter | <alehander42> btw I saw some nimpretty tagged issues |
15:09:27 | FromGitter | <alehander42> last thing i remember is that nimpretty was supposed to be based on local-for-each-line token analysis |
15:09:36 | FromGitter | <alehander42> has that happened already |
15:10:02 | FromGitter | <alehander42> and is it time for users to test it? |
15:10:20 | Araq | hmm "local-for-each-line token analysis"? |
15:10:36 | Araq | it is indeed based on the tokens now (though not obvious from the code) |
15:10:54 | Araq | but so far the bugs have been rather hard to fix |
15:12:14 | Araq | at least he have a decent testing infrastructure inplace for it |
15:12:52 | * | anamok joined #nim |
15:12:54 | anamok | hi |
15:13:48 | shashlick | Araq: I'll be honored 😊 |
15:14:40 | anamok | I'm working on a script that calls external commands. I want to verify if the ext. command exists. However, under Linux it's called `prog`, while under Windows it's `prg.exe`. What is a good way for this check? |
15:15:05 | Araq | when defined(windows): "prg.exe" else: "prog" |
15:15:35 | anamok | thanks |
15:17:32 | FromGitter | <alehander42> @Araq well, so it's just the stream of tokens |
15:17:57 | Araq | the parser also gives it some feedback for better results |
15:19:49 | FromGitter | <alehander42> and what is nimpretty2 ? |
15:19:54 | FromGitter | <alehander42> (in parser.nim ) |
15:21:51 | krux02 | Araq: It would already help in my test case, when blocks would free used registers |
15:22:10 | krux02 | but I changed the tests to generate more local functions |
15:26:04 | * | narimiran joined #nim |
15:27:48 | FromGitter | <alehander42> nimpretty works better than I expected |
15:28:03 | Araq | alehander42: nimpretty2 is active for the current nimpretty |
15:28:28 | FromGitter | <alehander42> but I have to give up my horizontally aligned field types |
15:29:44 | FromGitter | <alehander42> ``` a*: T ⏎ bcvb*: U``` ⏎ ⏎ is just so much more readable [https://gitter.im/nim-lang/Nim?at=5bc4b267c7bf7c3662168f5f] |
15:29:47 | FromGitter | <alehander42> oh wait |
15:29:57 | narimiran | does nimpretty still forces usage of ; instead of , in proc params? |
15:30:12 | FromGitter | <alehander42> ```a*: T ⏎ bavce*: U``` [https://gitter.im/nim-lang/Nim?at=5bc4b284c08b8b30671b56fe] |
15:30:17 | FromGitter | <alehander42> of gitter.. |
15:30:34 | FromGitter | <alehander42> i cant demonstrate it here, but imagine T and U are aligned |
15:30:44 | anamok | is there a function in the stdlib that can check if a program is available in the PATH or not? I want to call an external command and I want to check if the given command is installed or not. |
15:30:51 | FromGitter | <alehander42> i guess people hate that this leads to big diffs tho |
15:31:36 | FromGitter | <alehander42> @narimiran no, it got the smarter `, ` detection |
15:32:27 | narimiran | nice to hear! i might give it a try one day :) |
15:36:56 | FromGitter | <alehander42> @Araq are there any escape hatches for sections of code ? e.g. # nimpretty:off .. # nimpretty:on or pragma or something |
15:37:27 | FromGitter | <alehander42> yeah I plan to turn it on for some of my libs and dogfood it |
15:37:29 | Araq | anamok: os.findExe() |
15:37:45 | Araq | alehander42: no but it's good idea |
15:39:20 | narimiran | Araq: once all RFC-labeled issues are in rfcs repo — can i close all those issues in nim repo? |
15:39:51 | narimiran | (better to ask permission than forgiveness ;)) |
15:41:24 | Araq | wait ... what? |
15:41:33 | narimiran | if something is wrongly transferred (and closed), it can be reopened |
15:42:08 | narimiran | once all RFC-labeled issues are here: https://github.com/nim-lang/rfcs/issues , we can close them in nim repo |
15:44:05 | Araq | er... hmm you're the author of every post, not fair :P |
15:44:34 | narimiran | i would rather that i'm not, trust me |
15:45:21 | Araq | also all the votes got lost :-( |
15:45:38 | Araq | and it's really confusing to read with you being the author of every post |
15:45:48 | Araq | I'm afraid that's just not good enough |
15:46:03 | narimiran | but don't worry, this repo will bring hundreds of new RFCs :D (with correct authors, and everything in order) |
15:46:26 | narimiran | well, there's a link to the original issue where you can check up/down-votes |
15:49:24 | * | darithorn joined #nim |
15:54:14 | narimiran | i know this is not ideal, but this way the existing discussions can continue in the rfcs repo, and we have a place for new rfcs (where you can search the repo to see if something alredy exists) |
15:56:42 | shashlick | If there's a link to the original issue, how does it matter |
15:57:19 | FromGitter | <kaushalmodi> yeah.. it anyways shouldn't matter *who* wrote the argument.. the meat of the argument should matter |
15:58:54 | Araq | narimiran: create a poll about it please |
16:00:55 | narimiran | RFC about RFC :D |
16:01:51 | narimiran | ok, you guys who are here: how do you like the issues here: https://github.com/nim-lang/rfcs/issues ? yay or nay? |
16:02:24 | * | Trustable joined #nim |
16:05:16 | FromGitter | <kaushalmodi> yay from me. Araq: If you want to search RFC's opened by you, you can do: https://github.com/nim-lang/rfcs/issues?utf8=%E2%9C%93&q=%22Issue+by+Araq%22 |
16:05:25 | narimiran | pros: we now have a repo for all the proposals (past and future ones); the original issues are linked; all previous comments are here |
16:05:32 | FromGitter | <kaushalmodi> Does that filtered output show the RFC's you expected to see? |
16:06:36 | krux02 | I would post a question to move all RFC to the new repo including a deadline. |
16:06:36 | narimiran | cons: i'm the author of all the previous issues/comments (but every issue and comment clearly state the original author); there are no previous up/down-votes |
16:07:13 | krux02 | Everything that isn't ported within time (A month is OK to do copy paste) isn't important enough to keep alive. |
16:07:54 | FromGitter | <kaushalmodi> krux02: But the current issue of votes not getting ported would still apply |
16:08:00 | narimiran | krux02: that means the original authors should manually re-post their RFCs? and after that people who commented should do the same? |
16:08:20 | narimiran | btw, i got blessing for this new repo this morning: https://irclogs.nim-lang.org/15-10-2018.html#11:04:33 |
16:08:35 | krux02 | narimiran: no need to port the conversation |
16:08:42 | krux02 | the old (closed) issue can still be linked |
16:08:46 | FromGitter | <kaushalmodi> krux02: ?! |
16:08:48 | krux02 | for the conversation |
16:09:34 | FromGitter | <kaushalmodi> krux02: That's too inconvenient; the RFC loses all the feedback, just to have the original author's name in the ported RFC? |
16:09:45 | narimiran | so basically posting this to all the existing RFC issues: "if you want your RFC to still count, repost it in rfcs repo, i'm closing this" ? |
16:09:49 | krux02 | the feedback isn't lost |
16:09:52 | FromGitter | <kaushalmodi> the original author is anyways accredited by the first string "Issue by Foo" |
16:09:54 | narimiran | seems too drastic |
16:10:08 | krux02 | either the feedback is weaved into the RFC, or it is ignored. |
16:10:19 | krux02 | it's not lost |
16:10:52 | FromGitter | <kaushalmodi> narimiran has successfully ported old RFCs including comments to the new repo |
16:11:19 | FromGitter | <kaushalmodi> the only con I see is that votes are not ported (which anyways won't happen even if the original RFC author did this) |
16:11:21 | narimiran | (not all of them yet, btw, couple more to go) |
16:11:33 | FromGitter | <kaushalmodi> narimiran: OK :) |
16:11:47 | krux02 | can the original author still make changes? |
16:12:07 | krux02 | the origial auther needs to be able to change the issue content |
16:12:19 | FromGitter | <kaushalmodi> krux02: That's a valid point |
16:12:34 | narimiran | if the original author still cares, he can create a new issue in rfcs, which will reference and close the existing one |
16:12:46 | narimiran | or post the modified version as a comment |
16:13:34 | FromGitter | <kaushalmodi> krux02: But the current port seems to be the most effective; requiring minimal manual intervention |
16:13:43 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:14:16 | FromGitter | <kaushalmodi> the original authors can then further tweak things (add comments, manually copy the ported RFC, etc if they like) |
16:14:38 | shashlick | Great work |
16:14:46 | krux02 | I don't think so |
16:14:48 | shashlick | No need to over think |
16:14:59 | shashlick | No info is lost |
16:15:05 | krux02 | I think the original author will write and comment and be frustrated that he can't change things anymore |
16:15:14 | krux02 | eventually changing the original issue |
16:15:26 | krux02 | or give up in frustration |
16:15:31 | narimiran | krux02: do your comments have anything to do with the recent PR mishap? :D :D |
16:15:41 | krux02 | no I think an issue where the original author isn't able to edit the issue is no option. |
16:16:02 | krux02 | maybe you can find a way to automatically change the ownership of an issue with the github api |
16:16:09 | FromGitter | <kaushalmodi> krux02: but why can't what you suggest be done on top of narimiran's work |
16:16:10 | FromGitter | <kaushalmodi> ? |
16:16:22 | shashlick | This is 72 issues migrated, amazing how you did this so fast |
16:16:23 | krux02 | narimiran, no |
16:16:30 | FromGitter | <kaushalmodi> if the original author wants full control of the ported RFC, request the ported one to be closed and open a new one |
16:16:43 | narimiran | ok, we have 2 yays, 1 nay. voting is still open |
16:17:05 | krux02 | I am not sure if democracy is the correct approach here. |
16:17:22 | nolan_d | Is there a way to programatically identify the nimcache directory for a given project? |
16:17:28 | shashlick | Mine is a yay, there's better things to do than perfecting issue tracking |
16:17:54 | narimiran | shashlick: i already counted you and @kaushalmodi as yays (i didn't vote yet :D) |
16:17:58 | krux02 | nolan_d, there is a parameter for the nim compiler to print the exact backend compiler argument |
16:18:07 | krux02 | but apart from that, nothing reliable |
16:18:17 | FromGitter | <kaushalmodi> shashlick: precisely.. let's work on closing the ported RFCs |
16:18:27 | leorize | nolan_d: but you can choose the nimcache folder yourself |
16:18:41 | krux02 | from me it's a clear No. |
16:18:44 | FromGitter | <kaushalmodi> nolan_d: ironically your IRC handle has one of the two nimcache dir suffixes |
16:18:54 | krux02 | I think most original authors will hate it |
16:19:33 | krux02 | so I would recommend to ask the authors of the RCF's |
16:19:50 | shashlick | That's fair and they can recreate it and have copy closed - narimiran can monitor |
16:19:51 | krux02 | so ask timotheecour, I think he has most RFC's |
16:20:05 | narimiran | i think the original authors of RFCs from 2014, 2015 and 2016 won't care that much |
16:20:25 | krux02 | narimiran, I think those should be closed anyway |
16:20:39 | narimiran | krux02: this will be our revenge for what he did to you!! :P :D (this is a joke, if smileys are not enough to tell) |
16:20:40 | krux02 | why should we care to change something that nobody cares about anymore? |
16:20:47 | nolan_d | Hmm, recommendations on how/whether to upgrade https://github.com/AjBreidenbach/napibindings/blob/master/bin/napibuild.nim? It assumes a nimcache/ directory alongside project code. I can update my build to do that of course, I'm just wondering if there's a fix I can upstream. |
16:21:13 | narimiran | krux02: well, when i asked about closing old issues/RFCs there were crickets chirping ;) |
16:21:35 | narimiran | let's close those old stuff, i'm all for it. |
16:21:38 | * | druonysus joined #nim |
16:21:39 | * | druonysus quit (Changing host) |
16:21:39 | * | druonysus joined #nim |
16:22:08 | krux02 | well I won't ask now |
16:22:16 | narimiran | and if the authors of the newer RFCs mind — when/if they open their new RFC, the automatic one can be closed |
16:22:16 | krux02 | I have a presentation to prepare |
16:22:24 | krux02 | I want to make a demo where I show some Nim code |
16:22:27 | krux02 | that has to work |
16:22:40 | narimiran | what could go wrong :D |
16:22:47 | leorize | nolan_d: you can make the thing call `nim` with `--nimcache:/path/to/cache` parameter |
16:22:51 | leorize | it's the most reliable |
16:23:01 | nolan_d | Or is there any more up-to-date work on building native Node modules in Nim? Note that I'm not talking about the JS backend, but building native modules that link against native libraries. |
16:23:43 | krux02 | I work a lot with macros, and the changes on the internal representation of range broke my compilation |
16:24:38 | nolan_d | OK, will do. |
16:28:17 | narimiran | btw, krux02, my plan is to close all the existing RFCs. this should automatically alarm all the authors that something is going on — they'll see the link to the new rfcs repo, and they can port manually their RFC if they want to have authorship and think the issue is still actual. i guess you're ok with that original issue closing? |
16:31:11 | FromGitter | <kaushalmodi> @Vindaar has created an awesome PR on a startup "nimy_lisp" lib that allows doing something like `if-let*` in Lisp, in Nim |
16:32:34 | FromGitter | <kaushalmodi> this is the syntax in that PR: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc4c1226e5a401c2d7773a3] |
16:32:50 | FromGitter | <kaushalmodi> Ref: https://github.com/kaushalmodi/nimy_lisp/pull/1/files#diff-48176644729de9594c2a9248cdb407b9R120 |
16:32:58 | FromGitter | <kaushalmodi> So here's the question |
16:33:23 | FromGitter | <kaushalmodi> we need to use that clumsy `op:` syntax because `do:` is not allowed in that macro definition |
16:33:56 | FromGitter | <kaushalmodi> Is there any way to use `do:` instead of `op:` there, in that `if_let` macro definition? |
16:34:44 | FromGitter | <kaushalmodi> the macro defn: https://github.com/kaushalmodi/nimy_lisp/blob/8bb60291c23e44ca27259b35e024fc9fde24852b/src/nimy_lisp.nim#L72-L152 |
16:35:49 | leorize | have you looked at the ast? |
16:37:02 | leorize | just tried, it can't even generate the ast |
16:37:20 | narimiran | yay! all 88 RFC issues are successfully transferred to https://github.com/nim-lang/rfcs/issues |
16:38:03 | narimiran | oh, and to add on that 'pros' list: original labels are preserved |
16:39:06 | leorize | narimiran: maybe you should strip the "RFC" prefix from those issues |
16:40:03 | narimiran | leorize: that would include manual work ;) but i'm willing to do that if necessary |
16:42:31 | anamok | bye |
16:42:38 | * | anamok quit (Quit: Leaving) |
16:43:55 | FromGitter | <kaushalmodi> leorize: yeah, this gives "Error: expression expected, but found 'keyword do'": ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc4c3cb435c2a518eafcfb2] |
16:45:57 | FromGitter | <kaushalmodi> As an aside, the dumptree output doesn't seem to go to stdout |
16:46:18 | FromGitter | <kaushalmodi> so I cannot auto-capture results of dumpTree evaluations using Org Babel :( |
16:48:07 | krux02 | kaushalmodi: I would call it lispy-nim |
16:48:16 | krux02 | because it is Nim and not lisp |
16:48:26 | FromGitter | <kaushalmodi> good point |
16:48:29 | FromGitter | <kaushalmodi> will rename it |
16:48:37 | leorize | kaushalmodi: You could pass `--stdout` to `nim` |
16:48:42 | FromGitter | <kaushalmodi> but has to be lispy_nim |
16:49:05 | FromGitter | <kaushalmodi> leorize: actually I figured out.. it probably has to do with that output coming out during compile |
16:49:16 | FromGitter | <kaushalmodi> Org Babel captures run-time stdout |
16:49:25 | * | craigger_ joined #nim |
16:50:18 | * | craigger quit (Ping timeout: 252 seconds) |
16:52:55 | nolan_d | OK, another one, is it possible to programatically find nimbase.h? |
16:53:28 | leorize | it should be near the stdlib |
16:53:29 | krux02 | kaushalmodi: http://ix.io/1pe0 |
16:53:34 | krux02 | try that |
16:54:42 | krux02 | narimiran: that depends on the definition of "successful" |
16:55:37 | narimiran | :P |
16:56:32 | nolan_d | I'm poking around on my system, which I installed via choosenim. ~/.nimble seems to just contain the compiler and installed packages. |
16:57:00 | leorize | nolan_d: in module `compiler / nimeval` |
16:57:03 | * | seni joined #nim |
16:57:06 | leorize | there's `findNimStdLib()` |
16:57:14 | leorize | nimbase.h should be in there |
16:57:55 | nolan_d | Nice, thanks. |
16:58:16 | leorize | it should be noted that the proc doesn't work if the compiler is packaged like how Arch Linux folks does it |
16:58:36 | * | poopBot joined #nim |
16:58:53 | * | nsf joined #nim |
16:59:14 | krux02 | leorize, you should report it. |
16:59:41 | krux02 | I use Manjaro, if you report the issue I will fix it. |
16:59:57 | poopBot | what issue i am to on manjaro |
17:00:07 | poopBot | just installed nim |
17:00:21 | nolan_d | Hmm, can't get it working in `nim secret`. Is that a nim secret shortcoming? |
17:00:42 | leorize | yea, it can't support C FFI |
17:00:57 | krux02 | leorize, it doesn't |
17:01:10 | krux02 | it is possible though |
17:01:22 | leorize | sorry, wrong words :P |
17:01:33 | krux02 | it is just not practical |
17:01:38 | poopBot | duno what secret is at all, anyway i have question too, i want to use this https://github.com/dancor/wmctrl , its c++ comand line utility, can i somhow boundle it with nim? |
17:02:36 | poopBot | my only logical way is to use some c2nim but again i am newb with c++ and issue 2 is this isent a lib is an command line utility so my guess would need to hack the code, or am i worng? |
17:02:54 | leorize | or you could just make your code execute the binary |
17:03:15 | nolan_d | I get file not found errors when running `import compiler/nimeval` from within my code. |
17:03:15 | krux02 | poopBot: when you are lucky, you can use the {.compile.} pragma to compile everything from that utility, then you might even eb able to call it's native funtions without exiting out to the shell |
17:04:06 | poopBot | leorize, thats option 2 if option 1 dosent work :) |
17:04:40 | leorize | poopBot: or maybe look for a library that implements the EWMH extension :P |
17:04:45 | krux02 | that is all written in C |
17:05:00 | krux02 | you you might be lucky if you use the compile pragma, |
17:05:07 | poopBot | will try that krux02, anywya hows progress on karax would like to learn to use it leater on, but baby steps first |
17:05:11 | krux02 | you you need to rename the main function |
17:05:25 | leorize | wmctrl uses glib so I doubt it's that simple |
17:05:32 | krux02 | otherwise there will be to in the final binary |
17:05:49 | krux02 | leorize, you can't just like glib? |
17:05:57 | krux02 | link |
17:05:58 | krux02 | not like |
17:06:40 | leorize | ok, doesn't look like it uses any gobject horror |
17:07:18 | leorize | nolan_d: what distro are you using? |
17:07:38 | krux02 | if you just wrap the "main" from wmctrl and rename it to wmctrlMain, you should be able to call it like this: |
17:07:50 | leorize | nolan_d: probably someone forgot to package the compiler source... |
17:07:55 | nolan_d | Fedora, and choosenim for the installation. |
17:07:55 | krux02 | wmctrlMain(arr, arr.len) |
17:08:08 | poopBot | will try |
17:08:12 | krux02 | where arr is an array of cstring |
17:08:50 | nolan_d | Ah, maybe there's some way to install the source via choosenim? Let me check. |
17:10:13 | nolan_d | Hmm, not immediately seeing one. |
17:11:05 | leorize | krux02: if you do that you might as well `import osproc` then use `execProcess` :P |
17:11:51 | poopBot | if i go that way i will just make bash scipt xD |
17:13:28 | leorize | nolan_d: you could use `nimble` to install the compiler source |
17:13:34 | nolan_d | Oh no, I see a compiler/ directory, it just doesn't appear to be available to code compiled with itself. |
17:13:55 | leorize | https://github.com/dom96/choosenim/issues/46 |
17:13:56 | krux02 | leorize, well you start with the most simple version possible |
17:15:50 | leorize | poopBot: sometimes bash just works :P no, use fish. it has saner scripting interfaces |
17:16:46 | FromGitter | <kaushalmodi> krux02: Thanks! Keeping `do:` and `else:` at the same level as `if_let:` works. |
17:17:15 | poopBot | newer heard about fish, yep bash brakes my brain alwies |
17:17:51 | krux02 | fish is cool, except when it isn't |
17:20:13 | krux02 | the PATH management is something that caused problems for me |
17:20:15 | krux02 | my emacs doesn't properly see the PATH like I set it in fish |
17:20:15 | krux02 | that is a major bummer for me |
17:20:15 | leorize | have you exported the new PATH? |
17:21:19 | * | Vladar quit (Remote host closed the connection) |
17:21:43 | leorize | there's also `xonsh` which is a `python` + `shell` mix |
17:21:51 | * | pigmej quit (Ping timeout: 252 seconds) |
17:22:03 | leorize | actually it might be possible to implement xonsh as a macro in nim... |
17:23:20 | nolan_d | Any thoughts on why https://github.com/ndarilek/napibindings might fail to install with `nimble install`? I get `Error: unhandled exception: No such file or directory [OSError]`. Is that a Nimble bug? |
17:23:37 | nolan_d | The binary builds, the installation fails. |
17:24:35 | * | krux02 quit (Quit: Leaving) |
17:25:49 | leorize | more like a Nim bug... |
17:27:00 | * | pigmej joined #nim |
17:27:52 | nolan_d | If I mkdir bin/ under the package directory, it seems to work. |
17:28:06 | nolan_d | I.e. the directory to which nimble is installing. |
17:28:18 | leorize | yea it's a nim bug |
17:28:54 | nolan_d | Not a nimble bug--needing to create the directory before copying to it, for instance? |
17:29:01 | leorize | nolan_d: if you install the thing with nimble |
17:29:13 | leorize | like this `nimble install https://github.com/ndarilek/napibindings` |
17:29:50 | leorize | then you'll realise that the installed package doesn't have the `bin/` subfolder |
17:30:04 | leorize | nor does it has the `napibuild.nim` |
17:30:12 | leorize | so the compiler trip on that and can't do anything |
17:30:41 | leorize | it's a bug that the compiler doesn't output an proper error msg IMO |
17:31:56 | nolan_d | Hmm, I see that now, I was doing the installation from my local checkout. How is that not a nimble bug--failing to download the entire repo? |
17:32:10 | leorize | it doesn't "fail" |
17:32:18 | leorize | it just keeps the part that's necessary |
17:32:28 | leorize | never know who designed it like that |
17:32:43 | leorize | it keeps the bare minimum to build a package |
17:32:46 | leorize | nothing more |
17:33:16 | nolan_d | BUt the package specifies that it contains a binary, right? |
17:34:02 | nolan_d | I don't get how it can claim to successfully download a bare minimum less than that which is specified in the manifest. |
17:34:16 | leorize | now that's a bug |
17:34:42 | leorize | probably because nimble expects your package to follow the structure: https://github.com/nim-lang/nimble#project-structure |
17:34:45 | narimiran | i think there was a discussion about that recently. pinging @dom96 |
17:36:01 | nolan_d | Could be. I just forked someone else's project and am trying to get it working, don't really know what I'm doing. |
17:37:10 | leorize | nolan_d: for now just do `nimble develop` on the repo |
17:37:19 | leorize | it'll create a link to `~/.nimble` |
17:37:24 | leorize | packages using it'll be happy |
17:37:35 | nolan_d | Thanks. |
17:38:29 | * | amk joined #nim |
17:42:10 | nolan_d | OK, putting everything under src/ got it working. Thanks. |
17:47:45 | FromGitter | <timotheecour> please remove the rfc repo, see https://github.com/nim-lang/Nim/issues/9378 "rfcs repo is a bad idea" |
17:47:51 | nolan_d | OK, one more issue and I can submit a PR upstream. The line `macro getIdentStr*(n: untyped): string = $ident(n)` tells me both $ and ident are deprecated. Any quick fix for that? |
17:49:14 | narimiran | try replacing $foo with repr(foo) and see if it works (i'm just guessing this) |
17:49:20 | elrood | fun to get a deprecation warning but no alternative, isn't it? |
17:49:44 | narimiran | elrood: yup, that should be fixed |
17:50:40 | nolan_d | So replace $ident with repr? |
17:56:26 | leorize | replace it with `ident.strVal` |
17:57:52 | narimiran | funny that in macros.nim there are deprecations telling you to use `ident` instead. and then `ident` is also deprecated :D |
18:03:15 | * | flaviu quit (Remote host closed the connection) |
18:03:40 | * | flaviu joined #nim |
18:05:39 | * | amk quit (Ping timeout: 252 seconds) |
18:13:14 | * | zachk joined #nim |
18:14:48 | * | zachk quit (Changing host) |
18:14:48 | * | zachk joined #nim |
18:35:07 | FromGitter | <Vindaar> @krux02: ahh, thanks! I had no idea the `do` as such to be part of the `if_let` call. My macro inexperience shows :) |
18:41:44 | * | abm quit (Ping timeout: 272 seconds) |
18:48:40 | * | amk joined #nim |
18:51:42 | * | endragor joined #nim |
18:56:18 | * | endragor quit (Ping timeout: 268 seconds) |
19:01:19 | dom96 | narimiran: what's the ping about? |
19:01:42 | * | Jesin quit (Quit: Leaving) |
19:11:57 | * | amk quit (Quit: Leaving) |
19:20:17 | FromGitter | <alehander42> @timotheecour "close this, look at the issue I created right now which says close this" |
19:20:39 | FromGitter | <alehander42> come on, start a discussion, but don't be so dismissive |
19:21:31 | FromGitter | <timotheecour> sure, I agree I should’ve phrased it differently. |
19:22:30 | * | abm joined #nim |
19:24:14 | * | krux02 joined #nim |
19:26:05 | * | vivus joined #nim |
19:26:50 | vivus | where can I find an example .nimble file for a non-lib Nim program? |
19:28:57 | dom96 | vivus: nimble init -> select `bin` |
19:31:11 | vivus | ty |
19:54:30 | * | abm quit (Quit: Leaving) |
20:10:41 | * | Trustable quit (Remote host closed the connection) |
20:18:33 | FromGitter | <kaushalmodi> how do I make the `falseCond` optional in this macro? ⏎ ⏎ ```macro if_let*(letExpr: untyped, trueCond: untyped, falseCond: untyped): untyped =``` [https://gitter.im/nim-lang/Nim?at=5bc4f6191e23486b93c593ca] |
20:26:19 | FromGitter | <Vindaar> @kaushalmodi I think ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ should word [https://gitter.im/nim-lang/Nim?at=5bc4f7ebc08b8b30671d3af8] |
20:26:21 | FromGitter | <Vindaar> *work |
20:27:02 | FromGitter | <kaushalmodi> @Vindaar thanks to your PR, I think I am now starting to "get" nim macros |
20:27:05 | FromGitter | <kaushalmodi> https://ptpb.pw/Pfi5/nim |
20:27:17 | FromGitter | <kaushalmodi> there are still many many questions :) |
20:27:39 | FromGitter | <Vindaar> I'm really glad to hear that! |
20:27:44 | FromGitter | <kaushalmodi> btw that last snippet I pasted gets a compilation failure |
20:27:45 | FromGitter | <kaushalmodi> nimy_lisp.nim(178, 5) Error: redefinition of 'a'; previous declaration here: nimy_lisp.nim(178, 4) |
20:27:58 | FromGitter | <kaushalmodi> looks like `if_let` is not creating its own let-like scope |
20:28:08 | FromGitter | <Vindaar> Shouldn't be too long before you will actually know what the questions are that you have! |
20:28:27 | FromGitter | <Vindaar> I'm cooking smth right now and will eat. Then I'll take a closer look at this :) |
20:28:50 | FromGitter | <kaushalmodi> no prob, thanks! |
20:29:01 | FromGitter | <kaushalmodi> (I am counting on you to finalize that PR :)) |
20:29:09 | FromGitter | <kaushalmodi> I am just tinkering with Nim macros in parallel |
20:32:03 | FromGitter | <kaushalmodi> newEmptyNode() didn't work: nimy_lisp.nim(72, 73) Error: expression 'newEmptyNode' is of type 'proc (): NimNode{.noSideEffect, gcsafe, locks: 0.}' and has to be discarded; start of expression here: nimy_lisp.nim(153, 16); for a function call use () |
20:32:58 | FromGitter | <kaushalmodi> looks like removing that `()` after `newEmptyNode` worked |
20:36:28 | * | narimiran quit (Ping timeout: 246 seconds) |
20:36:29 | krux02 | I have a compiler crash |
20:36:41 | krux02 | normally I can jump to the crash with gdb und inspect tha stack |
20:36:57 | krux02 | but now the process justs exits with exit code 1 |
20:37:14 | krux02 | it does some internal execCmd |
20:39:33 | krux02 | oh never mind my bad |
20:41:26 | * | Arrrr quit (Quit: Arrrr) |
20:41:51 | FromGitter | <rayman22201> Hey @kaushalmodi, were you able to get nim doc to generate idx files? |
20:48:04 | * | nsf quit (Quit: WeeChat 2.2) |
20:48:32 | * | vlad1777d__ joined #nim |
20:51:50 | FromGitter | <kaushalmodi> It generates the .idx but in a subdir called htmldocs |
20:52:29 | FromGitter | <kaushalmodi> not yet able to get the search to work |
20:52:58 | FromGitter | <rayman22201> interesting. Well, that's progress at least |
20:54:42 | FromGitter | <kaushalmodi> so I moved the .idx to the same dir as foo.html |
20:54:50 | FromGitter | <kaushalmodi> also downloaded dochack.js to the same dir |
20:54:58 | FromGitter | <kaushalmodi> but still I get "no search results" |
20:57:09 | * | chronnis joined #nim |
20:58:25 | FromGitter | <kaushalmodi> @rayman22201 OK I see "XHR ⏎ http://localhost:7867/theindex.html 404" so it always expects theindex.html |
20:59:10 | FromGitter | <rayman22201> yeah |
20:59:53 | FromGitter | <kaushalmodi> so `nim buildIndex` generates theindex.html, but still nothing .. |
21:00:20 | FromGitter | <rayman22201> what directory does it put theindex.html? |
21:01:23 | FromGitter | <kaushalmodi> in the same directory and .. |
21:01:26 | FromGitter | <kaushalmodi> it is empty |
21:01:31 | FromGitter | <kaushalmodi> (wonder why) |
21:01:35 | FromGitter | <rayman22201> theindex.html is empty? |
21:01:39 | FromGitter | <rayman22201> That is interesting |
21:02:15 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc50056c7bf7c366218b6ea] |
21:02:19 | FromGitter | <rayman22201> The rst generator code should search the directory for idx files and use it to generate theindex.html |
21:03:18 | FromGitter | <rayman22201> yup, very empty indeed. I wonder if it expects the idx files to be a particular place |
21:04:13 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/blob/c404163bbf39d8d8311c516d6e89d531ffea151c/lib/packages/docutils/rstgen.nim#L576 |
21:04:54 | FromGitter | <kaushalmodi> i put the .idx at 2 diff places hoping for buildIndex to find it |
21:04:56 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc500f8f659e67772c01c6f] |
21:05:00 | FromGitter | <kaushalmodi> but didn't work |
21:05:20 | FromGitter | <kaushalmodi> the .idx file looks correctly generated: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc50110ef4afc4f287cc1c5] |
21:08:43 | FromGitter | <rayman22201> what directory are you running `nim buildIndex` from? |
21:09:09 | FromGitter | <juancarlospaco> Opportunity to promote Nim https://dev.to/ben/whos-looking-for-open-source-contributors-october-15th-edition-58ba |
21:10:56 | FromGitter | <rayman22201> It looks like nim is looking in the project root directory https://github.com/nim-lang/Nim/blob/173e8c49134c04c13870192884f6c1bf00cbe7e5/compiler/docgen.nim#L1039 |
21:12:06 | FromGitter | <kaushalmodi> @rayman22201 success at last! |
21:12:33 | FromGitter | <kaushalmodi> the syntax is `nim buildIndex <dir>` and `<dir>` cannot be `.` |
21:13:03 | FromGitter | <kaushalmodi> in summary, both `foo.idx` and `theindex.html` are needed |
21:14:28 | FromGitter | <kaushalmodi> umm.. actually `.` works.. |
21:15:02 | FromGitter | <kaushalmodi> instestingly, if I run `nim buildIndex .` inside `<nimbledir>/src/`, the `theindex.html` gets generated in `<nimbledir>`. |
21:16:18 | FromDiscord | <Chronnis> I feel like I'm missing something. Is it possible to put an object of SomeSubType into a seq[SomeBaseType]? Getting a runtime ObjectAssignmentError when attempting to do so and I'm not sure where to dig. |
21:16:33 | * | chronnis quit (Quit: Page closed) |
21:17:05 | FromGitter | <rayman22201> @kaushalmodi That makes sense given the code snippet I posted with the `conf.projectFull.string` |
21:17:54 | FromGitter | <rayman22201> Great success though! |
21:18:30 | FromGitter | <kaushalmodi> @rayman22201 thanks for the help. |
21:18:38 | FromGitter | <kaushalmodi> But getting this to work was really cryptic |
21:18:53 | FromGitter | <kaushalmodi> I need to commit and deploy this before I forget how I did this :P |
21:19:05 | FromGitter | <rayman22201> np .... Yeah. There is some room for improvement with the workflow here. |
21:21:12 | * | Jesin joined #nim |
21:24:00 | FromGitter | <rayman22201> @Chronnis, That should be possible, but I don't do a lot of OO with Nim, so I'm not much help... Can you post some example code of what you are trying to do? |
21:27:23 | krux02 | @mratsim are you here if yes I have a question you might very well help me with |
21:28:25 | krux02 | Chronnis: that is possible |
21:28:46 | krux02 | but only with reference types that have an object header |
21:29:31 | FromGitter | <rayman22201> Chronnis: stupid simple example: https://gist.github.com/rayman22201/cb29c89fb06b512c450a1bb9659d9f44 |
21:29:49 | krux02 | and you should be aware that that kind of polymorphism is one of the main reasons why "modern" OO languages have such high demands in ram. |
21:29:51 | vivus | @Vindaar great work on nimyaml :D |
21:30:09 | vivus | Should I be putting anything in a .gitignore file for nim projects? |
21:30:20 | krux02 | I have the impression here are many more nim programmers than I am used to |
21:30:25 | krux02 | wasn't online for some time |
21:30:27 | krux02 | :D |
21:30:57 | krux02 | pleas raise hands: Who is here for less than a month? |
21:33:13 | FromDiscord | <Chronnis> Literally joined today after a couple hours of banging my head into the sequence thing |
21:33:26 | FromDiscord | <Chronnis> it was the 'ref' bit on the types i was missing |
21:35:01 | vivus | @kaushalmodi what is the link to your project? |
21:36:30 | FromGitter | <kaushalmodi> vivus: what's the context |
21:36:51 | vivus | @kaushalmodi I am trying to add better descriptions to each argument in my cligen project |
21:37:44 | FromGitter | <kaushalmodi> see https://github.com/OrgTangle/ntangle/blob/4dc300696b2e0fa5308ecfed7641354c8ed6483f/src/ntangle.nim#L561 |
21:39:16 | vivus | is this where the descriptions should be: proc echoVersion() =## Echo the version string. ? |
21:40:34 | FromGitter | <kaushalmodi> I'm not sure if it picks up the help strings from proc doc strings |
21:40:44 | FromGitter | <kaushalmodi> I think it does that only for the dispatching proc |
21:42:26 | * | shadowbane quit (Quit: Konversation terminated!) |
21:42:47 | vivus | the documentation on cligen doesn't mention how to make better help instructions |
21:42:58 | FromGitter | <rayman22201> I bit the bullet and registered for that dev.to thing. What the hell? Free advertising right? https://dev.to/rayman22201/comment/66oo |
21:45:08 | krux02 | Chronnis: you should get your head around that in Nim you normally don't do the ref thing. You really need a ref type only very rarely in Nim |
21:45:40 | FromGitter | <kaushalmodi> @rayman22201 I need all of this to finally get the search working: https://github.com/kaushalmodi/nimy_lisp/blob/39466070fdf0024a7ec0f696c108f7c262bd80ef/nimy_lisp.nimble#L23-L41 |
21:48:23 | * | rewadz quit (Ping timeout: 244 seconds) |
21:49:25 | FromGitter | <rayman22201> :-/ I agree. Way too many steps. IMO `--index:on` should generate the idx files, theindex.html, and dochack.js all in one step |
21:49:39 | FromGitter | <rayman22201> baby steps though. At least we have a working baseline |
21:50:43 | FromGitter | <kaushalmodi> Couldn't have done this without your help @rayman22201. Thanks! |
21:51:43 | FromGitter | <rayman22201> 👍 of course! glad to help! more fun than my day job :-P |
22:00:45 | * | anamok joined #nim |
22:01:08 | anamok | hi |
22:01:23 | krux02 | ho |
22:02:14 | krux02 | anamok, welcome to Nim, the objectively best programming language in the World |
22:02:17 | krux02 | :P |
22:02:23 | anamok | When launching "nimble install" for installing a local package, how to tell nimble to compile with the `-d:ssl` option? |
22:03:01 | anamok | krux02: I'm starting to realize that :) |
22:05:41 | krux02 | honestly I have no idea, but I think there should be something you can append to for that |
22:06:40 | FromGitter | <kaushalmodi> anamok: have you tried adding `switch("define", "ssl")` to a `config.nims` in your nimble project root? |
22:07:24 | * | NimBot joined #nim |
22:09:28 | anamok | kaushalmodi: thanks, it did the trick. What is `config.nims`? |
22:09:33 | krux02 | anamok: how did you find out about Nim? |
22:09:55 | FromGitter | <kaushalmodi> anamok: https://nim-lang.org/docs/nims.html |
22:09:56 | krux02 | anamok, it is a file detected by nim (not nimble) for compiler flags |
22:10:15 | FromGitter | <kaushalmodi> *Why does it seem that only I am a `config.nims` proponent? :P* |
22:10:20 | anamok | krux02: I was looking for a compiled Python :) |
22:10:23 | vivus | @kaushalmodi are you using dispatchMulti? |
22:10:35 | FromGitter | <kaushalmodi> vivus: In one another project, yes |
22:10:47 | vivus | What is the link to that project? |
22:11:36 | FromGitter | <kaushalmodi> vivus: for now, it has just an `init` subcommand: https://github.com/kaushalmodi/noxhugo/blob/47a7668cd28d9ef3c46ea48858a364bd9ca64aa4/src/noxhugo.nim#L242-L250 |
22:11:46 | FromGitter | <kaushalmodi> but you should be able to extend from that example |
22:13:28 | vivus | im trying something like this, but im not sure if it is correct: dispatchMulti([super_long_function_name, cmdName="short"], ...) but it doesn't work |
22:13:32 | FromGitter | <Vindaar> @kaushalmodi taking a look now! ⏎ @vivus: glad it helped you :) |
22:24:29 | nolan_d | I need to construct a large SQL query by hand, in part by iterating through a series of database tables. What's the best way to do that? Is there any sort of prepared statement? |
22:25:43 | nolan_d | Worst case I can just concatenate strings--none of the input comes from the user--but I'd like to be as correct as possible. |
22:30:05 | FromGitter | <mratsim> maybe you can use Ormin? |
22:30:18 | FromGitter | <mratsim> never used it but it’s supposed to address SQL |
22:30:35 | krux02 | anamok: well Nim is only on the surface like Python, but it is not python and you will realize that. But it is certainly as expressive as python, if not even more expressive at some points |
22:31:23 | nolan_d | Eh, would really rather not pull in an ORM. This is embedded and using SpatiaLite, so it's pretty low-level. |
22:31:26 | anamok | krux02: I've been playing with Nim for two weeks and I'm amazed what a nice language it is |
22:31:37 | krux02 | mratsim: did you create any PR's that were merged based on macros/generics? |
22:32:04 | krux02 | it is cool that you like it |
22:32:20 | krux02 | then the hard work that was put into it wasn't for nothing :P |
22:33:40 | krux02 | nolan_d, when you need to iterate through the tables just to create the query, maybe there is something wrong with the design of the database |
22:33:41 | anamok | krux02: I was looking for a compiled language. My favorite is Python but producing an exe from Python is painful. And those are not official solutions, thus they don't always work. |
22:34:22 | krux02 | I think python as other problems |
22:34:43 | anamok | yeah, distribution for instance |
22:34:45 | krux02 | most importantly for me is, it isn't statically checked at all |
22:35:07 | anamok | mypy gives a partial solution for that |
22:35:12 | nolan_d | Perhaps, but sometimes those things aren't within your control. Anyhow, I can't find a solution, so string concatenation it is. |
22:35:28 | krux02 | All python programming I ever did is the nim gdb support for Nim, so I am by far not an expert in Python |
22:35:58 | krux02 | but it didn't appear to be very compact |
22:36:28 | krux02 | anamok, I only know pypy |
22:37:17 | krux02 | nolan_d, yes string concatenation is a good start. |
22:37:29 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:38:06 | anamok | After Python I feel at home in Nim. There are lots of things to learn, but lots of things are familiar and done in a logical way. |
22:38:07 | krux02 | I generate GLSL at compile time also into a string. But for GLSL there is a command line validator that I can call |
22:38:33 | krux02 | that allows me to have nice error messages |
22:39:52 | krux02 | anamok, the syntax of Nim was what almost alienated me when learning Nim. But aparently a lot of people like it a lot. |
22:40:28 | anamok | krux02, I love this syntax |
22:41:51 | krux02 | did you ever programmed in scala or Go? |
22:42:34 | anamok | krux02, Last year I also tried Kotlin and it's good to see that ideas from there are also in Nim. Examples: `let` for immutability, `if` ... is an expression, functional things (map, filter). |
22:43:17 | krux02 | yea better don't use the map, filter procedures in Nim yet. |
22:43:41 | krux02 | they are immature in Nim |
22:44:05 | anamok | krux02: I tried both but they didn't impress me. |
22:44:25 | krux02 | with immature I mean they are inconsistenty implemented for the different collections and when you get used to use them, you might miss them when you want to use them on another type |
22:45:20 | krux02 | instead of filter, you can do a for loop with an ``if`` statement inside |
22:45:58 | krux02 | a for loop that updates a local variable on each iteration is a fold. |
22:46:27 | anamok | How does that work? Can you give an example? I mean the for loop with if. |
22:46:37 | krux02 | I really liked to work with those functional concepts in scala (very similar to Kotlin) they helped me structure my loops and they gave the patterns I used a name |
22:46:43 | nolan_d | Is there any kind of string interpolation? Or is concatenation the only way to build a long string? |
22:47:01 | FromGitter | <mratsim> @krux02 no I didn’t write any PR recently |
22:47:05 | krux02 | but now I know the patterns and I know the overhead of functional programming. So in my head I do functional programming, but I write down the loop. |
22:47:13 | FromGitter | <mratsim> last one was about adding test cases for issues that were closed |
22:47:27 | krux02 | nolan_d, there is string interpolation in Nim |
22:47:33 | krux02 | there is a macro that can do it |
22:47:41 | anamok | nolan_d, There is. var age = 20. echo &"He is {age} years old" |
22:47:42 | krux02 | strformat iirc |
22:48:08 | FromGitter | <mratsim> also seemed like you had a question for me 4 hours ago |
22:48:23 | nolan_d | Thanks. |
22:48:24 | krux02 | mratsim: I thought you implemented something |
22:49:09 | anamok | nolan_d, import strformat for that |
22:49:10 | krux02 | based on macros |
22:49:34 | krux02 | but I guess I am wrong |
22:50:05 | krux02 | mratsim: something that is related to this issue: https://github.com/nim-lang/Nim/issues/7974 |
22:51:45 | FromGitter | <mratsim> ah I think I know what conversation you’re referring too |
22:52:20 | anamok | krux02: `(1 .. 10).filterIt(it mod 2 == 0)` gives back `@[2,4,6,8,10]`. How do you rewrite it with for loop? |
22:53:09 | FromGitter | <mratsim> var foo: seq[int]; for i in 1 .. 10: if i mod 2 == 0: foo.add i |
22:53:29 | krux02 | ^^ |
22:53:30 | krux02 | yes |
22:54:02 | anamok | And is it much faster? |
22:54:23 | krux02 | not in this particular case |
22:54:33 | FromGitter | <mratsim> @krux I think it’s related to that: https://github.com/nim-lang/Nim/issues/7719 |
22:54:48 | krux02 | but creating a lot of intermediate seq objects is slow because they need to be allocated and freed again |
22:55:04 | krux02 | with a for loop you can often avoid creating such an intermediate object |
22:55:25 | FromGitter | <mratsim> you can check this one where we basically replaced NimSym and NimIdents with fresh ident nodes to trick the semcheck pass: https://github.com/nim-lang/Nim/issues/7719 |
22:56:03 | FromGitter | <mratsim> and referring to this discussion? https://irclogs.nim-lang.org/14-10-2018.html#21:55:13 |
22:56:24 | FromGitter | <mratsim> > note that the AST after symbol resolution is finally getting fixed and spec'ed :-) |
22:57:08 | anamok | krux02: Nim could use more iterators to avoid the creation of lots of seqs |
22:58:12 | krux02 | iterators are definitively the way to go in Nim |
22:58:22 | krux02 | they are fast and very flexible |
22:58:37 | krux02 | but it is very hard to interleave two iterators |
23:01:03 | FromGitter | <mratsim> @anamok that was the discussion this morning |
23:01:22 | anamok | ay, I missed that |
23:01:27 | FromGitter | <mratsim> ah no yesterday: https://irclogs.nim-lang.org/14-10-2018.html#22:34:38 |
23:02:11 | anamok | thanks for the link |
23:02:31 | FromGitter | <mratsim> in any case you can use zero-functional: https://github.com/zero-functional/zero-functional or loop-fusion: https://github.com/numforge/loop-fusion, both will allow you to avoid temporaries |
23:02:53 | FromGitter | <mratsim> zero-functional with a functional style and loop fusion with a procedural style |
23:08:30 | anamok | interesting libraries |
23:11:22 | FromGitter | <mratsim> You can also check the list comprehension macro: https://github.com/nim-lang/Nim/blob/devel/lib/pure/sugar.nim#L125-L179 |
23:11:44 | FromGitter | <mratsim> `echo lc[x | (x <- 1..10, x mod 2 == 0), int]` |
23:11:55 | FromGitter | <mratsim> this is your example using the list comprehension macro |
23:12:38 | FromGitter | <bpo217> cool libs thanks for sharing |
23:12:41 | FromGitter | <kaushalmodi> Fyi, lc is on chopping block |
23:13:35 | FromGitter | <kaushalmodi> But `map` + sugar `=>` works great instead or even `mapIt` |
23:13:39 | FromGitter | <mratsim> well I need to get some inspiration from it to support filter in loop fusion. I have type issues, you can’t sometimes return int and sometimes return void (like filter does) in my lib currently |
23:16:31 | FromGitter | <mratsim> something to test if a NimNode is an expression would be nice |
23:19:04 | anamok | Thanks for the help. I need to go now. Bye. |
23:19:25 | * | anamok quit (Remote host closed the connection) |
23:29:42 | * | elrood quit (Quit: Leaving) |
23:45:10 | * | fettbb joined #nim |
23:48:07 | FromGitter | <yyyc514> imports can’t layer can they? import “helpers/all” can’t import other things into the current scope, right? |
23:48:31 | FromGitter | <yyyc514> and you can’t write imports with macros and such, right? so if it’s not possible ther eisn’t really any way to do it? |
23:53:19 | * | fettbb quit (Ping timeout: 256 seconds) |
23:56:13 | * | seni quit (Quit: Leaving) |