<< 15-10-2018 >>

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:41FromGitter<yyyc514> so is “nimf” still a thing?
00:51:46FromGitter<yyyc514> for filters?
00:51:59FromGitter<yyyc514> seems to work just fine if it’s .nim and .nimf doens’t actually work
00:53:46FromGitter<yyyc514> @elrood thanks
00:54:31FromGitter<yyyc514> is there any way to @ people who are on the IRC gateway?
00:56:58ryuoyyyc514: not really. the normal method here is normally to do it like I am here.
00:57:22FromGitter<yyyc514> right but i’m not on IRC :)
00:57:26FromGitter<yyyc514> @ryuo so does this ping you?
00:57:35ryuoyyyc514: most clients will highlight us if our nick is mentioned.
00:57:47FromGitter<yyyc514> true, just the autocomplete here is soorly lacking :)
00:58:12ryuowhat do you expect? Gitter can't see what's beyond the bridge.
00:58:24ryuoAnd there's 157 people here in the channel.
00:59:13FromGitter<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:16FromGitter<yyyc514> oh well
01:00:11ryuoSituation isn't much better for IRC. I can't autocomplete people either from another destination.
01:00:24ryuoMy client only recognizes native users.
01:00:39ryuoThough I could probably extend my client if I cared enough.
01:01:39FromGitter<yyyc514> yeah depending what it is :)
01:02:01ryuoBecause 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:35FromGitter<yyyc514> `nim/lib/pure/os.nim(765, 11) Error: cannot 'importc' variable at compile time`
01:04:38FromGitter<yyyc514> another macro isuse?
01:04:59FromGitter<yyyc514> trying to use os.walkFiles
01:05:21FromGitter<yyyc514> but that’s probably libraries so it won’t run in the VM?
01:06:04ryuoLet me guess. It's an alternative to ftw.
01:06:18FromGitter<yyyc514> ftw?
01:06:25ryuoPOSIX function.
01:06:36ryuoFile Tree Walk.
01:06:49FromGitter<yyyc514> it says it uses POSIX
01:07:06ryuoyea, it has to use native APIs to walk folders/directories.
01:07:20ryuoI was just reminded of C ftw/nftw.
01:07:50FromGitter<yyyc514> hmmmm so i can’t ahve a macro do any code generation that involves a dynamic list of files?
01:08:31ryuoIs that surprising? Compile time expressions normally require it to be knownable at compile time.
01:08:44ryuoknowable*
01:09:04FromGitter<yyyc514> a dynamic list of files knoable at compile time
01:09:20FromGitter<yyyc514> i know readFile works
01:09:29FromGitter<yyyc514> so if i wante dto hard code the list i could, but i don't
01:11:28FromGitter<yyyc514> maybe you could build a two stage pipeline with staticExec?
01:12:37ryuoNo 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:54FromGitter<yyyc514> ok so import from inside macro doesn’t work
01:21:57FromGitter<yyyc514> even if the macro IS at thet op level
01:23:27FromGitter<timotheecour> Well feel free to upvote https://github.com/nim-lang/Nim/issues/9253
01:28:26FromGitter<yyyc514> did and added comment, thanks :)
01:29:02FromGitter<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:47FromGitter<yyyc514> no way of using variable in import i suppose to have like an application root?
01:44:17FromGitter<yyyc514> hmmm strings are allowed
01:45:19FromGitter<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:18FromGitter<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:17FromGitter<xmonader> guys i tried lots of combinations for \r\n but no luck ?
07:45:31FromGitter<xmonader> the line never gets retwritten over?
07:47:02leorizeremember that `\n` is 1 character...
07:47:07FromGitter<xmonader> ```echo "Hello world\r\nthis is should replace it"```
07:47:38leorize!eval echo "Hello world\rthis should replace it"
07:47:42NimBotHello world↵this should replace it
07:48:54leorizewell it only works when you run in terminal :P
07:49:10FromGitter<xmonader> @leorize i'm running it in the terminal xD
07:49:32leorizedon't do `\n` after `\r` and you should be fine
07:50:04FromGitter<xmonader> ah right what am i thinking! sorry
07:52:36FromGitter<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:36FromGitter... 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:19FromGitter<yyyc514> i do’nt suppose there is a way to define my own pseudo include paths?
08:14:08FromGitter<yyyc514> ok wow just adding lib and app to the paths is a huge help :)
08:16:55*rewadz joined #nim
08:20:35FromGitter<mratsim> @yyyc514 {.passC: “-I” & yourOwnPath.}
08:20:54*vegai joined #nim
08:21:18FromGitter<yyyc514> and where would i put that pragma?
08:21:29FromGitter<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:55leorizeyyyc514: `nim --fullhelp | grep include`
08:26:17leorizethen write your own `config.nims` containing the flags you need
08:26:54FromGitter<yyyc514> isn’t nim.cfg just oen option per line?
08:26:59FromGitter<yyyc514> -p doesn’t seem to work in there
08:28:16leorizewrite `path=/path/to/what/you/need`
08:28:36leorizeor in NimScript `--path:"/path/to/modules"`
08:28:52leorizeor `switch("path", "/path/to/modules")`
08:28:57FromGitter<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:57FromGitter<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:51FromGitter<bpo217> I guess I could use readBytes but then how do I convert that array.
09:27:57FromGitter<bpo217> I guess I mean is there a simpler when other than calculating the value from an array of bytes.
09:28:03FromGitter<bpo217> *simpler way
09:28:37FromGitter<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:09FromGitter<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:14FromGitter<bpo217> @Vindaar Neat trick. It isn't the only one though, I'm packing up my own file.
09:31:35FromGitter<Vindaar> figured as much. What's the content of the file look like?
09:31:36*Senketsu joined #nim
09:32:47FromGitter<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:22FromGitter<bpo217> Actually lets say an int then a string whose length is denoted by the int, assuming UTF-8
09:36:01FromGitter<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:07FromGitter<bpo217> @Vindaar cool cool. Thanks for your help!
09:37:39FromGitter<Vindaar> no worries! if you have trouble understanding how to use something, just ask :)
09:40:26Araqor maybe 'copyMem' is what you want
09:42:15FromGitter<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:35FromGitter<bpo217> I'll keep messing with it.
09:43:39FromGitter<bpo217> Does `addr` convert the int to what I want? How do I write it to a file at that point?
09:44:46FromGitter<bpo217> Unsafe procedures are fine too since I'm aware of the file structure too.
09:45:04PMunchbpo217, I'd take a look at the streams module
09:45:42PMunchCreate a filestream and use the read/write procedures in the module to read and write your data
09:46:31FromGitter<bpo217> Oh this stream module looks very promising.
09:47:34FromGitter<bpo217> Thanks for the tip.
09:48:50FromGitter<bpo217> 100% what I was looking for thanks for that.
10:01:36FromGitter<gogolxdong> Any guide of Android and iOS development?
10:03:09Araqyay, I destroyed my .git
10:03:19FromGitter<bpo217> nailed it
10:03:23Araqthanks to this "must not merge" crap
10:03:33AraqUnlink of file 'lib/system.nim' failed. Should I try again? (y/n) n
10:03:33Araqerror: unable to unlink old 'lib/system.nim': Invalid argument
10:03:40FromGitter<bpo217> @gogolxdong What kind of tips were you looking for?
10:03:45Araqwtf, lib\system.nim never went anywhere
10:04:10FromGitter<bpo217> Also thanks for the help guys: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc4661ac08b8b3067194033]
10:04:37FromGitter<gogolxdong> How to begin ? nim compiled to cpp for Android and objc for iOS?
10:07:19Araqgogolxdong, checkout how 'nimx' does it, maybe
10:08:47FromGitter<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:27FromGitter<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:35FromGitter<gogolxdong> write pure Nim without native code?
10:11:05FromGitter<bpo217> https://nim-lang.org/docs/manual.html#foreign-function-interface
10:15:42FromGitter<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:58FromGitter<gogolxdong> what's like your APP?
10:15:58AraqI'm at (HEAD detached at 8252c65) and yet 'git diff' shows diffs that are not mine, what now?
10:15:58Araqwho asked for this detached head state btw, is this whole system just a single exposed bug?
10:16:42FromGitter<narimiran> Araq: https://xkcd.com/1597/
10:17:52Araqso true...
10:18:29FromGitter<bpo217> lol
10:19:04FromGitter<bpo217> It is beautiful
10:19:05Arrrrlol
10:19:17federico3it's sad
10:19:19FromGitter<bpo217> It's easy to take git for granted
10:20:11FromGitter<narimiran> `git reflog` to the rescue! saved my ass so many times!
10:23:03AraqI want Fossil.
10:23:32FromGitter<bpo217> I found that command on stack overflow when a reset crisis was happening lol
10:23:46Araqwell crisis is gone
10:24:04AraqI typed in some random commands from stack overflow and lost one commit or something
10:24:42*kapil____ joined #nim
10:24:50FromGitter<mratsim> I think that’s the whole crisis in java and JS ecosystems. copy-pasting from SO :P
10:24:55FromGitter<bpo217> "or something" is a loaded statement lol
10:28:01FromGitter<bpo217> Speaking of cross language bridges, I'm genuinely surprised Apache Thrift doesn't have Nim support atm.
10:30:39FromGitter<mratsim> In minimal you have Nim, Apache Thrift is not minimal ;)
10:31:13FromGitter<bpo217> touché
10:31:27Araqmratsim: wanna try a compiler patch for your .compile problem?
10:32:54FromGitter<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:25Araqok, you need to mark the important bugs somehow
10:33:51FromGitter<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:43FromGitter<mratsim> you can give me tagging power for Nim issues
10:35:21Araqdone (I think)
10:36:46*leorize joined #nim
10:36:58FromGitter<mratsim> works, thanks
10:39:29FromGitter<narimiran> Araq: re moving RFCs to their own repo: is that possible without losing all their current comments?
10:40:12AraqI doubt it but we can start new RFCs in the new repo and the old RFCs ...well...
10:46:12vegaianyone 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:07vegaie.g. by just typing "when " into an empty nim file
10:48:02FromGitter<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:25FromGitter<alehander42> e.g. https://github.com/IQAndreas-testprojects/github-issues-import-example/issues/10
10:50:09FromGitter<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:53FromGitter<mratsim> @vegai, killall nimsuggest and killall nim
11:04:33Araqnarimiran, give it a try, create nim-lang/rfcs
11:04:34FromGitter<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:19FromGitter<narimiran> Araq: will do (later today, if i find the time)
11:12:55Araqmratsim: we should really fix that one...
11:12:58FromGitter<narimiran> in the mean time, see if any of the existing RFCs can be closed
11:14:36FromGitter<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:57vegaimratsim: didn't seem to be the issue here
12:00:37*dddddd joined #nim
12:05:00FromGitter<kaushalmodi> Araq: Is there a plan to support a global config.nims?
12:06:37FromGitter<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:16FromGitter<narimiran> that new repo for RFCs: is "rfcs" too cryptic? should it be named "proposals", to make it clearer?
12:16:25FromGitter<dom96> RFCs sounds good to me
12:16:29FromGitter<dom96> Rust's repo is named the same https://github.com/rust-lang/rfcs
12:18:09FromGitter<narimiran> alrighty
12:18:18krux02I think rfc is fine
12:19:44FromGitter<narimiran> without "s"? sounds better to me
12:21:04krux02I like the idea to have a separate repo to organize RFCs
12:21:20FromGitter<dom96> rfcs makes more sense
12:21:27krux02the issue counter is too high, and an RFC is something you can't fix or close or put aside
12:21:38krux02it just hangs there in your view
12:21:44FromGitter<dom96> It sucks but we need a higher barrier to entry for RFCs
12:21:56FromGitter<narimiran> @dom96 but each of R F C is a word, "s" isn't
12:22:15FromGitter<dom96> We need to outline exactly what is required from an RFC, not just "Let's have better imports kthxbai" :)
12:22:38FromGitter<kaushalmodi> +1 for "rfcs"
12:22:43FromGitter<dom96> RFC is a document
12:22:51krux02narimiran[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:51FromGitter<dom96> RFCs is multiple such documents
12:23:05FromGitter<dom96> Yes, GitHub doesn't care about the casing but shrug
12:23:20FromGitter<narimiran> ok, rfcs it is
12:23:47FromGitter<narimiran> @krux02 when i use plural is like RFCs, not RFCS nor rfcs
12:24:01FromGitter<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:09FromGitter<alehander42> @dom96 a default issue template would help with that
12:24:18FromGitter<kaushalmodi> (because GitHub has great API for probably everything)
12:24:53FromGitter<narimiran> @kaushalmodi that link was already posted and i'm about to use it ;)
12:25:42FromGitter<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:52krux02another thing, is the amount of registers lowered?
12:26:02krux02my tests on ast pattern maching don't run anymore
12:26:41FromGitter<narimiran> @kaushalmodi well it says i could use `--issues 3 27 3428 1199`
12:27:10FromGitter<narimiran> i cannot automatically export all issues containing a certain label, but oh well
12:27:30FromGitter<kaushalmodi> Nimble project idea :P
12:27:40FromGitter<alehander42> e.g. ``` ⏎ Problem: .. ⏎ ⏎ Current solution: .. ⏎ ... [https://gitter.im/nim-lang/Nim?at=5bc487bbc08b8b30671a2124]
12:32:06FromGitter<narimiran> https://github.com/nim-lang/rfcs/issues/1
12:32:18FromGitter<narimiran> it seems it works! woohoo
12:33:10FromGitter<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:05FromGitter<mratsim> write a Nim parse :P
12:41:08FromGitter<mratsim> parser*
12:41:27FromGitter<mratsim> but otherwise doesn’t api.github.com offers a json/rest API?
12:42:15FromGitter<mratsim> GET /repos/:owner/:repo/issues
12:42:25FromGitter<mratsim> https://developer.github.com/v3/issues/#list-issues-for-a-repository
12:43:25FromGitter<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:33FromGitter<narimiran> naah, manually copy-pasting is fiiine :D
12:46:39FromGitter<alehander42> just copy the element contents in an array using querySelector in the browser console
12:47:04FromGitter<alehander42> (the elements which have `#..`, you can find their css class in the inspector)
12:47:06FromGitter<mratsim> otherwise this should work: https://chrome.google.com/webstore/detail/instant-data-scraper/ofaokhiedipichpaobibbnahnkdoiiah?hl=en
12:47:34FromGitter<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:47FromGitter<dom96> Wouldn't it be better to start fresh?
13:01:09FromGitter<dom96> If the RFC is wanted enough someone will take the time to write a properly structured RFC
13:01:31FromGitter<dom96> Otherwise we are starting out with RFCs that are all over the place in terms of quality.
13:03:38FromGitter<alehander42> this would be a very demotivational step
13:03:55FromGitter<narimiran> i don't want to be the one that will be yelled at with "why did you close my RFC" ;)
13:04:08FromGitter<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:45FromGitter<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:34FromGitter<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:05FromGitter<mratsim> sounds good, kudos
13:07:16*endragor quit (Remote host closed the connection)
13:08:58FromGitter<narimiran> btw, i guess i'm hitting some github limit with too many requests.... this transfer might take a while....
13:10:18FromGitter<narimiran> anybody interested in dividing this work? :)
13:10:52FromGitter<dom96> Did you grab an API key?
13:10:56FromGitter<narimiran> nope
13:11:02FromGitter<dom96> Get one :)
13:11:09FromGitter<dom96> Using it is simple
13:11:27FromGitter<dom96> Check out how my bounty source updater script works if you're curious how to use it
13:11:35FromGitter<dom96> It's in the website repo
13:12:04FromGitter<narimiran> does that mean i should modify the python script used for this?
13:12:37*smt joined #nim
13:16:30FromGitter<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:18FromGitter<narimiran> ...but i get the same error as before
13:27:53*skelett quit (Read error: Connection reset by peer)
13:28:02FromGitter<Varriount> Neat, a new RFC repo
13:29:39*skelett joined #nim
13:36:11FromGitter<dom96> Python? Blasphemy.
13:36:47FromGitter<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:02FromGitter<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:46FromGitter<narimiran> damn, i spoke too early
13:44:53FromGitter<dom96> Should be easy in python too in any case
13:49:04*endragor joined #nim
13:50:12krux02Araq: what has been changed recently in the VM? number of used registers was already limiting in my ast-pattern matching library
13:50:44krux02but now it became worse and the test case from that library broke
13:53:45*endragor quit (Ping timeout: 252 seconds)
14:03:33Araqkrux02: nothing changed except that maybe 'assert' produces more bytecode
14:04:47Araqwe need some register spilling mechanism, yay
14:37:31*nsf quit (Quit: WeeChat 2.2)
14:37:53shashlickdom96: thanks for reviewing the choosenim pr. Am traveling but will get back soon. Doesn't look like any show stoppers
14:39:39shashlickRegarding 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:52Araqshashlick: I'm slowing talking dom96 into making you a core dev for choosenim :-)
14:58:59Araq*of
15:08:35FromGitter<alehander42> btw I saw some nimpretty tagged issues
15:09:27FromGitter<alehander42> last thing i remember is that nimpretty was supposed to be based on local-for-each-line token analysis
15:09:36FromGitter<alehander42> has that happened already
15:10:02FromGitter<alehander42> and is it time for users to test it?
15:10:20Araqhmm "local-for-each-line token analysis"?
15:10:36Araqit is indeed based on the tokens now (though not obvious from the code)
15:10:54Araqbut so far the bugs have been rather hard to fix
15:12:14Araqat least he have a decent testing infrastructure inplace for it
15:12:52*anamok joined #nim
15:12:54anamokhi
15:13:48shashlickAraq: I'll be honored 😊
15:14:40anamokI'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:05Araqwhen defined(windows): "prg.exe" else: "prog"
15:15:35anamokthanks
15:17:32FromGitter<alehander42> @Araq well, so it's just the stream of tokens
15:17:57Araqthe parser also gives it some feedback for better results
15:19:49FromGitter<alehander42> and what is nimpretty2 ?
15:19:54FromGitter<alehander42> (in parser.nim )
15:21:51krux02Araq: It would already help in my test case, when blocks would free used registers
15:22:10krux02but I changed the tests to generate more local functions
15:26:04*narimiran joined #nim
15:27:48FromGitter<alehander42> nimpretty works better than I expected
15:28:03Araqalehander42: nimpretty2 is active for the current nimpretty
15:28:28FromGitter<alehander42> but I have to give up my horizontally aligned field types
15:29:44FromGitter<alehander42> ``` a*: T ⏎ bcvb*: U``` ⏎ ⏎ is just so much more readable [https://gitter.im/nim-lang/Nim?at=5bc4b267c7bf7c3662168f5f]
15:29:47FromGitter<alehander42> oh wait
15:29:57narimirandoes nimpretty still forces usage of ; instead of , in proc params?
15:30:12FromGitter<alehander42> ```a*: T ⏎ bavce*: U``` [https://gitter.im/nim-lang/Nim?at=5bc4b284c08b8b30671b56fe]
15:30:17FromGitter<alehander42> of gitter..
15:30:34FromGitter<alehander42> i cant demonstrate it here, but imagine T and U are aligned
15:30:44anamokis 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:51FromGitter<alehander42> i guess people hate that this leads to big diffs tho
15:31:36FromGitter<alehander42> @narimiran no, it got the smarter `, ` detection
15:32:27narimirannice to hear! i might give it a try one day :)
15:36:56FromGitter<alehander42> @Araq are there any escape hatches for sections of code ? e.g. # nimpretty:off .. # nimpretty:on or pragma or something
15:37:27FromGitter<alehander42> yeah I plan to turn it on for some of my libs and dogfood it
15:37:29Araqanamok: os.findExe()
15:37:45Araqalehander42: no but it's good idea
15:39:20narimiranAraq: once all RFC-labeled issues are in rfcs repo — can i close all those issues in nim repo?
15:39:51narimiran(better to ask permission than forgiveness ;))
15:41:24Araqwait ... what?
15:41:33narimiranif something is wrongly transferred (and closed), it can be reopened
15:42:08narimiranonce all RFC-labeled issues are here: https://github.com/nim-lang/rfcs/issues , we can close them in nim repo
15:44:05Araqer... hmm you're the author of every post, not fair :P
15:44:34narimirani would rather that i'm not, trust me
15:45:21Araqalso all the votes got lost :-(
15:45:38Araqand it's really confusing to read with you being the author of every post
15:45:48AraqI'm afraid that's just not good enough
15:46:03narimiranbut don't worry, this repo will bring hundreds of new RFCs :D (with correct authors, and everything in order)
15:46:26narimiranwell, there's a link to the original issue where you can check up/down-votes
15:49:24*darithorn joined #nim
15:54:14narimirani 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:42shashlickIf there's a link to the original issue, how does it matter
15:57:19FromGitter<kaushalmodi> yeah.. it anyways shouldn't matter *who* wrote the argument.. the meat of the argument should matter
15:58:54Araqnarimiran: create a poll about it please
16:00:55narimiranRFC about RFC :D
16:01:51narimiranok, 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:16FromGitter<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:25narimiranpros: 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:32FromGitter<kaushalmodi> Does that filtered output show the RFC's you expected to see?
16:06:36krux02I would post a question to move all RFC to the new repo including a deadline.
16:06:36narimirancons: 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:13krux02Everything that isn't ported within time (A month is OK to do copy paste) isn't important enough to keep alive.
16:07:54FromGitter<kaushalmodi> krux02: But the current issue of votes not getting ported would still apply
16:08:00narimirankrux02: that means the original authors should manually re-post their RFCs? and after that people who commented should do the same?
16:08:20narimiranbtw, i got blessing for this new repo this morning: https://irclogs.nim-lang.org/15-10-2018.html#11:04:33
16:08:35krux02narimiran: no need to port the conversation
16:08:42krux02the old (closed) issue can still be linked
16:08:46FromGitter<kaushalmodi> krux02: ?!
16:08:48krux02for the conversation
16:09:34FromGitter<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:45narimiranso 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:49krux02the feedback isn't lost
16:09:52FromGitter<kaushalmodi> the original author is anyways accredited by the first string "Issue by Foo"
16:09:54narimiranseems too drastic
16:10:08krux02either the feedback is weaved into the RFC, or it is ignored.
16:10:19krux02it's not lost
16:10:52FromGitter<kaushalmodi> narimiran has successfully ported old RFCs including comments to the new repo
16:11:19FromGitter<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:21narimiran(not all of them yet, btw, couple more to go)
16:11:33FromGitter<kaushalmodi> narimiran: OK :)
16:11:47krux02can the original author still make changes?
16:12:07krux02the origial auther needs to be able to change the issue content
16:12:19FromGitter<kaushalmodi> krux02: That's a valid point
16:12:34narimiranif the original author still cares, he can create a new issue in rfcs, which will reference and close the existing one
16:12:46narimiranor post the modified version as a comment
16:13:34FromGitter<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:16FromGitter<kaushalmodi> the original authors can then further tweak things (add comments, manually copy the ported RFC, etc if they like)
16:14:38shashlickGreat work
16:14:46krux02I don't think so
16:14:48shashlickNo need to over think
16:14:59shashlickNo info is lost
16:15:05krux02I think the original author will write and comment and be frustrated that he can't change things anymore
16:15:14krux02eventually changing the original issue
16:15:26krux02or give up in frustration
16:15:31narimirankrux02: do your comments have anything to do with the recent PR mishap? :D :D
16:15:41krux02no I think an issue where the original author isn't able to edit the issue is no option.
16:16:02krux02maybe you can find a way to automatically change the ownership of an issue with the github api
16:16:09FromGitter<kaushalmodi> krux02: but why can't what you suggest be done on top of narimiran's work
16:16:10FromGitter<kaushalmodi> ?
16:16:22shashlickThis is 72 issues migrated, amazing how you did this so fast
16:16:23krux02narimiran, no
16:16:30FromGitter<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:43narimiranok, we have 2 yays, 1 nay. voting is still open
16:17:05krux02I am not sure if democracy is the correct approach here.
16:17:22nolan_dIs there a way to programatically identify the nimcache directory for a given project?
16:17:28shashlickMine is a yay, there's better things to do than perfecting issue tracking
16:17:54narimiranshashlick: i already counted you and @kaushalmodi as yays (i didn't vote yet :D)
16:17:58krux02nolan_d, there is a parameter for the nim compiler to print the exact backend compiler argument
16:18:07krux02but apart from that, nothing reliable
16:18:17FromGitter<kaushalmodi> shashlick: precisely.. let's work on closing the ported RFCs
16:18:27leorizenolan_d: but you can choose the nimcache folder yourself
16:18:41krux02from me it's a clear No.
16:18:44FromGitter<kaushalmodi> nolan_d: ironically your IRC handle has one of the two nimcache dir suffixes
16:18:54krux02I think most original authors will hate it
16:19:33krux02so I would recommend to ask the authors of the RCF's
16:19:50shashlickThat's fair and they can recreate it and have copy closed - narimiran can monitor
16:19:51krux02so ask timotheecour, I think he has most RFC's
16:20:05narimirani think the original authors of RFCs from 2014, 2015 and 2016 won't care that much
16:20:25krux02narimiran, I think those should be closed anyway
16:20:39narimirankrux02: 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:40krux02why should we care to change something that nobody cares about anymore?
16:20:47nolan_dHmm, 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:13narimirankrux02: well, when i asked about closing old issues/RFCs there were crickets chirping ;)
16:21:35narimiranlet'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:08krux02well I won't ask now
16:22:16narimiranand if the authors of the newer RFCs mind — when/if they open their new RFC, the automatic one can be closed
16:22:16krux02I have a presentation to prepare
16:22:24krux02I want to make a demo where I show some Nim code
16:22:27krux02that has to work
16:22:40narimiranwhat could go wrong :D
16:22:47leorizenolan_d: you can make the thing call `nim` with `--nimcache:/path/to/cache` parameter
16:22:51leorizeit's the most reliable
16:23:01nolan_dOr 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:43krux02I work a lot with macros, and the changes on the internal representation of range broke my compilation
16:24:38nolan_dOK, will do.
16:28:17narimiranbtw, 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:11FromGitter<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:34FromGitter<kaushalmodi> this is the syntax in that PR: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc4c1226e5a401c2d7773a3]
16:32:50FromGitter<kaushalmodi> Ref: https://github.com/kaushalmodi/nimy_lisp/pull/1/files#diff-48176644729de9594c2a9248cdb407b9R120
16:32:58FromGitter<kaushalmodi> So here's the question
16:33:23FromGitter<kaushalmodi> we need to use that clumsy `op:` syntax because `do:` is not allowed in that macro definition
16:33:56FromGitter<kaushalmodi> Is there any way to use `do:` instead of `op:` there, in that `if_let` macro definition?
16:34:44FromGitter<kaushalmodi> the macro defn: https://github.com/kaushalmodi/nimy_lisp/blob/8bb60291c23e44ca27259b35e024fc9fde24852b/src/nimy_lisp.nim#L72-L152
16:35:49leorizehave you looked at the ast?
16:37:02leorizejust tried, it can't even generate the ast
16:37:20narimiranyay! all 88 RFC issues are successfully transferred to https://github.com/nim-lang/rfcs/issues
16:38:03narimiranoh, and to add on that 'pros' list: original labels are preserved
16:39:06leorizenarimiran: maybe you should strip the "RFC" prefix from those issues
16:40:03narimiranleorize: that would include manual work ;) but i'm willing to do that if necessary
16:42:31anamokbye
16:42:38*anamok quit (Quit: Leaving)
16:43:55FromGitter<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:57FromGitter<kaushalmodi> As an aside, the dumptree output doesn't seem to go to stdout
16:46:18FromGitter<kaushalmodi> so I cannot auto-capture results of dumpTree evaluations using Org Babel :(
16:48:07krux02kaushalmodi: I would call it lispy-nim
16:48:16krux02because it is Nim and not lisp
16:48:26FromGitter<kaushalmodi> good point
16:48:29FromGitter<kaushalmodi> will rename it
16:48:37leorizekaushalmodi: You could pass `--stdout` to `nim`
16:48:42FromGitter<kaushalmodi> but has to be lispy_nim
16:49:05FromGitter<kaushalmodi> leorize: actually I figured out.. it probably has to do with that output coming out during compile
16:49:16FromGitter<kaushalmodi> Org Babel captures run-time stdout
16:49:25*craigger_ joined #nim
16:50:18*craigger quit (Ping timeout: 252 seconds)
16:52:55nolan_dOK, another one, is it possible to programatically find nimbase.h?
16:53:28leorizeit should be near the stdlib
16:53:29krux02kaushalmodi: http://ix.io/1pe0
16:53:34krux02try that
16:54:42krux02narimiran: that depends on the definition of "successful"
16:55:37narimiran:P
16:56:32nolan_dI'm poking around on my system, which I installed via choosenim. ~/.nimble seems to just contain the compiler and installed packages.
16:57:00leorizenolan_d: in module `compiler / nimeval`
16:57:03*seni joined #nim
16:57:06leorizethere's `findNimStdLib()`
16:57:14leorizenimbase.h should be in there
16:57:55nolan_dNice, thanks.
16:58:16leorizeit 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:14krux02leorize, you should report it.
16:59:41krux02I use Manjaro, if you report the issue I will fix it.
16:59:57poopBotwhat issue i am to on manjaro
17:00:07poopBotjust installed nim
17:00:21nolan_dHmm, can't get it working in `nim secret`. Is that a nim secret shortcoming?
17:00:42leorizeyea, it can't support C FFI
17:00:57krux02leorize, it doesn't
17:01:10krux02it is possible though
17:01:22leorizesorry, wrong words :P
17:01:33krux02it is just not practical
17:01:38poopBotduno 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:36poopBotmy 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:54leorizeor you could just make your code execute the binary
17:03:15nolan_dI get file not found errors when running `import compiler/nimeval` from within my code.
17:03:15krux02poopBot: 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:06poopBotleorize, thats option 2 if option 1 dosent work :)
17:04:40leorizepoopBot: or maybe look for a library that implements the EWMH extension :P
17:04:45krux02that is all written in C
17:05:00krux02you you might be lucky if you use the compile pragma,
17:05:07poopBotwill try that krux02, anywya hows progress on karax would like to learn to use it leater on, but baby steps first
17:05:11krux02you you need to rename the main function
17:05:25leorizewmctrl uses glib so I doubt it's that simple
17:05:32krux02otherwise there will be to in the final binary
17:05:49krux02leorize, you can't just like glib?
17:05:57krux02link
17:05:58krux02not like
17:06:40leorizeok, doesn't look like it uses any gobject horror
17:07:18leorizenolan_d: what distro are you using?
17:07:38krux02if you just wrap the "main" from wmctrl and rename it to wmctrlMain, you should be able to call it like this:
17:07:50leorizenolan_d: probably someone forgot to package the compiler source...
17:07:55nolan_dFedora, and choosenim for the installation.
17:07:55krux02wmctrlMain(arr, arr.len)
17:08:08poopBotwill try
17:08:12krux02where arr is an array of cstring
17:08:50nolan_dAh, maybe there's some way to install the source via choosenim? Let me check.
17:10:13nolan_dHmm, not immediately seeing one.
17:11:05leorizekrux02: if you do that you might as well `import osproc` then use `execProcess` :P
17:11:51poopBotif i go that way i will just make bash scipt xD
17:13:28leorizenolan_d: you could use `nimble` to install the compiler source
17:13:34nolan_dOh no, I see a compiler/ directory, it just doesn't appear to be available to code compiled with itself.
17:13:55leorizehttps://github.com/dom96/choosenim/issues/46
17:13:56krux02leorize, well you start with the most simple version possible
17:15:50leorizepoopBot: sometimes bash just works :P no, use fish. it has saner scripting interfaces
17:16:46FromGitter<kaushalmodi> krux02: Thanks! Keeping `do:` and `else:` at the same level as `if_let:` works.
17:17:15poopBotnewer heard about fish, yep bash brakes my brain alwies
17:17:51krux02fish is cool, except when it isn't
17:20:13krux02the PATH management is something that caused problems for me
17:20:15krux02my emacs doesn't properly see the PATH like I set it in fish
17:20:15krux02that is a major bummer for me
17:20:15leorizehave you exported the new PATH?
17:21:19*Vladar quit (Remote host closed the connection)
17:21:43leorizethere's also `xonsh` which is a `python` + `shell` mix
17:21:51*pigmej quit (Ping timeout: 252 seconds)
17:22:03leorizeactually it might be possible to implement xonsh as a macro in nim...
17:23:20nolan_dAny 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:37nolan_dThe binary builds, the installation fails.
17:24:35*krux02 quit (Quit: Leaving)
17:25:49leorizemore like a Nim bug...
17:27:00*pigmej joined #nim
17:27:52nolan_dIf I mkdir bin/ under the package directory, it seems to work.
17:28:06nolan_dI.e. the directory to which nimble is installing.
17:28:18leorizeyea it's a nim bug
17:28:54nolan_dNot a nimble bug--needing to create the directory before copying to it, for instance?
17:29:01leorizenolan_d: if you install the thing with nimble
17:29:13leorizelike this `nimble install https://github.com/ndarilek/napibindings`
17:29:50leorizethen you'll realise that the installed package doesn't have the `bin/` subfolder
17:30:04leorizenor does it has the `napibuild.nim`
17:30:12leorizeso the compiler trip on that and can't do anything
17:30:41leorizeit's a bug that the compiler doesn't output an proper error msg IMO
17:31:56nolan_dHmm, 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:10leorizeit doesn't "fail"
17:32:18leorizeit just keeps the part that's necessary
17:32:28leorizenever know who designed it like that
17:32:43leorizeit keeps the bare minimum to build a package
17:32:46leorizenothing more
17:33:16nolan_dBUt the package specifies that it contains a binary, right?
17:34:02nolan_dI don't get how it can claim to successfully download a bare minimum less than that which is specified in the manifest.
17:34:16leorizenow that's a bug
17:34:42leorizeprobably because nimble expects your package to follow the structure: https://github.com/nim-lang/nimble#project-structure
17:34:45narimirani think there was a discussion about that recently. pinging @dom96
17:36:01nolan_dCould 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:10leorizenolan_d: for now just do `nimble develop` on the repo
17:37:19leorizeit'll create a link to `~/.nimble`
17:37:24leorizepackages using it'll be happy
17:37:35nolan_dThanks.
17:38:29*amk joined #nim
17:42:10nolan_dOK, putting everything under src/ got it working. Thanks.
17:47:45FromGitter<timotheecour> please remove the rfc repo, see https://github.com/nim-lang/Nim/issues/9378 "rfcs repo is a bad idea"
17:47:51nolan_dOK, 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:14narimirantry replacing $foo with repr(foo) and see if it works (i'm just guessing this)
17:49:20elroodfun to get a deprecation warning but no alternative, isn't it?
17:49:44narimiranelrood: yup, that should be fixed
17:50:40nolan_dSo replace $ident with repr?
17:56:26leorizereplace it with `ident.strVal`
17:57:52narimiranfunny 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:07FromGitter<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:19dom96narimiran: what's the ping about?
19:01:42*Jesin quit (Quit: Leaving)
19:11:57*amk quit (Quit: Leaving)
19:20:17FromGitter<alehander42> @timotheecour "close this, look at the issue I created right now which says close this"
19:20:39FromGitter<alehander42> come on, start a discussion, but don't be so dismissive
19:21:31FromGitter<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:50vivuswhere can I find an example .nimble file for a non-lib Nim program?
19:28:57dom96vivus: nimble init -> select `bin`
19:31:11vivusty
19:54:30*abm quit (Quit: Leaving)
20:10:41*Trustable quit (Remote host closed the connection)
20:18:33FromGitter<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:19FromGitter<Vindaar> @kaushalmodi I think ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ should word [https://gitter.im/nim-lang/Nim?at=5bc4f7ebc08b8b30671d3af8]
20:26:21FromGitter<Vindaar> *work
20:27:02FromGitter<kaushalmodi> @Vindaar thanks to your PR, I think I am now starting to "get" nim macros
20:27:05FromGitter<kaushalmodi> https://ptpb.pw/Pfi5/nim
20:27:17FromGitter<kaushalmodi> there are still many many questions :)
20:27:39FromGitter<Vindaar> I'm really glad to hear that!
20:27:44FromGitter<kaushalmodi> btw that last snippet I pasted gets a compilation failure
20:27:45FromGitter<kaushalmodi> nimy_lisp.nim(178, 5) Error: redefinition of 'a'; previous declaration here: nimy_lisp.nim(178, 4)
20:27:58FromGitter<kaushalmodi> looks like `if_let` is not creating its own let-like scope
20:28:08FromGitter<Vindaar> Shouldn't be too long before you will actually know what the questions are that you have!
20:28:27FromGitter<Vindaar> I'm cooking smth right now and will eat. Then I'll take a closer look at this :)
20:28:50FromGitter<kaushalmodi> no prob, thanks!
20:29:01FromGitter<kaushalmodi> (I am counting on you to finalize that PR :))
20:29:09FromGitter<kaushalmodi> I am just tinkering with Nim macros in parallel
20:32:03FromGitter<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:58FromGitter<kaushalmodi> looks like removing that `()` after `newEmptyNode` worked
20:36:28*narimiran quit (Ping timeout: 246 seconds)
20:36:29krux02I have a compiler crash
20:36:41krux02normally I can jump to the crash with gdb und inspect tha stack
20:36:57krux02but now the process justs exits with exit code 1
20:37:14krux02it does some internal execCmd
20:39:33krux02oh never mind my bad
20:41:26*Arrrr quit (Quit: Arrrr)
20:41:51FromGitter<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:50FromGitter<kaushalmodi> It generates the .idx but in a subdir called htmldocs
20:52:29FromGitter<kaushalmodi> not yet able to get the search to work
20:52:58FromGitter<rayman22201> interesting. Well, that's progress at least
20:54:42FromGitter<kaushalmodi> so I moved the .idx to the same dir as foo.html
20:54:50FromGitter<kaushalmodi> also downloaded dochack.js to the same dir
20:54:58FromGitter<kaushalmodi> but still I get "no search results"
20:57:09*chronnis joined #nim
20:58:25FromGitter<kaushalmodi> @rayman22201 OK I see "XHR ⏎ http://localhost:7867/theindex.html 404" so it always expects theindex.html
20:59:10FromGitter<rayman22201> yeah
20:59:53FromGitter<kaushalmodi> so `nim buildIndex` generates theindex.html, but still nothing ..
21:00:20FromGitter<rayman22201> what directory does it put theindex.html?
21:01:23FromGitter<kaushalmodi> in the same directory and ..
21:01:26FromGitter<kaushalmodi> it is empty
21:01:31FromGitter<kaushalmodi> (wonder why)
21:01:35FromGitter<rayman22201> theindex.html is empty?
21:01:39FromGitter<rayman22201> That is interesting
21:02:15FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc50056c7bf7c366218b6ea]
21:02:19FromGitter<rayman22201> The rst generator code should search the directory for idx files and use it to generate theindex.html
21:03:18FromGitter<rayman22201> yup, very empty indeed. I wonder if it expects the idx files to be a particular place
21:04:13FromGitter<rayman22201> https://github.com/nim-lang/Nim/blob/c404163bbf39d8d8311c516d6e89d531ffea151c/lib/packages/docutils/rstgen.nim#L576
21:04:54FromGitter<kaushalmodi> i put the .idx at 2 diff places hoping for buildIndex to find it
21:04:56FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc500f8f659e67772c01c6f]
21:05:00FromGitter<kaushalmodi> but didn't work
21:05:20FromGitter<kaushalmodi> the .idx file looks correctly generated: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc50110ef4afc4f287cc1c5]
21:08:43FromGitter<rayman22201> what directory are you running `nim buildIndex` from?
21:09:09FromGitter<juancarlospaco> Opportunity to promote Nim https://dev.to/ben/whos-looking-for-open-source-contributors-october-15th-edition-58ba
21:10:56FromGitter<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:06FromGitter<kaushalmodi> @rayman22201 success at last!
21:12:33FromGitter<kaushalmodi> the syntax is `nim buildIndex <dir>` and `<dir>` cannot be `.`
21:13:03FromGitter<kaushalmodi> in summary, both `foo.idx` and `theindex.html` are needed
21:14:28FromGitter<kaushalmodi> umm.. actually `.` works..
21:15:02FromGitter<kaushalmodi> instestingly, if I run `nim buildIndex .` inside `<nimbledir>/src/`, the `theindex.html` gets generated in `<nimbledir>`.
21:16:18FromDiscord<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:05FromGitter<rayman22201> @kaushalmodi That makes sense given the code snippet I posted with the `conf.projectFull.string`
21:17:54FromGitter<rayman22201> Great success though!
21:18:30FromGitter<kaushalmodi> @rayman22201 thanks for the help.
21:18:38FromGitter<kaushalmodi> But getting this to work was really cryptic
21:18:53FromGitter<kaushalmodi> I need to commit and deploy this before I forget how I did this :P
21:19:05FromGitter<rayman22201> np .... Yeah. There is some room for improvement with the workflow here.
21:21:12*Jesin joined #nim
21:24:00FromGitter<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:23krux02@mratsim are you here if yes I have a question you might very well help me with
21:28:25krux02Chronnis: that is possible
21:28:46krux02but only with reference types that have an object header
21:29:31FromGitter<rayman22201> Chronnis: stupid simple example: https://gist.github.com/rayman22201/cb29c89fb06b512c450a1bb9659d9f44
21:29:49krux02and 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:51vivus@Vindaar great work on nimyaml :D
21:30:09vivusShould I be putting anything in a .gitignore file for nim projects?
21:30:20krux02I have the impression here are many more nim programmers than I am used to
21:30:25krux02wasn't online for some time
21:30:27krux02:D
21:30:57krux02pleas raise hands: Who is here for less than a month?
21:33:13FromDiscord<Chronnis> Literally joined today after a couple hours of banging my head into the sequence thing
21:33:26FromDiscord<Chronnis> it was the 'ref' bit on the types i was missing
21:35:01vivus@kaushalmodi what is the link to your project?
21:36:30FromGitter<kaushalmodi> vivus: what's the context
21:36:51vivus@kaushalmodi I am trying to add better descriptions to each argument in my cligen project
21:37:44FromGitter<kaushalmodi> see https://github.com/OrgTangle/ntangle/blob/4dc300696b2e0fa5308ecfed7641354c8ed6483f/src/ntangle.nim#L561
21:39:16vivusis this where the descriptions should be: proc echoVersion() =## Echo the version string. ?
21:40:34FromGitter<kaushalmodi> I'm not sure if it picks up the help strings from proc doc strings
21:40:44FromGitter<kaushalmodi> I think it does that only for the dispatching proc
21:42:26*shadowbane quit (Quit: Konversation terminated!)
21:42:47vivusthe documentation on cligen doesn't mention how to make better help instructions
21:42:58FromGitter<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:08krux02Chronnis: 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:40FromGitter<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:25FromGitter<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:39FromGitter<rayman22201> baby steps though. At least we have a working baseline
21:50:43FromGitter<kaushalmodi> Couldn't have done this without your help @rayman22201. Thanks!
21:51:43FromGitter<rayman22201> 👍 of course! glad to help! more fun than my day job :-P
22:00:45*anamok joined #nim
22:01:08anamokhi
22:01:23krux02ho
22:02:14krux02anamok, welcome to Nim, the objectively best programming language in the World
22:02:17krux02:P
22:02:23anamokWhen launching "nimble install" for installing a local package, how to tell nimble to compile with the `-d:ssl` option?
22:03:01anamokkrux02: I'm starting to realize that :)
22:05:41krux02honestly I have no idea, but I think there should be something you can append to for that
22:06:40FromGitter<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:28anamokkaushalmodi: thanks, it did the trick. What is `config.nims`?
22:09:33krux02anamok: how did you find out about Nim?
22:09:55FromGitter<kaushalmodi> anamok: https://nim-lang.org/docs/nims.html
22:09:56krux02anamok, it is a file detected by nim (not nimble) for compiler flags
22:10:15FromGitter<kaushalmodi> *Why does it seem that only I am a `config.nims` proponent? :P*
22:10:20anamokkrux02: I was looking for a compiled Python :)
22:10:23vivus@kaushalmodi are you using dispatchMulti?
22:10:35FromGitter<kaushalmodi> vivus: In one another project, yes
22:10:47vivusWhat is the link to that project?
22:11:36FromGitter<kaushalmodi> vivus: for now, it has just an `init` subcommand: https://github.com/kaushalmodi/noxhugo/blob/47a7668cd28d9ef3c46ea48858a364bd9ca64aa4/src/noxhugo.nim#L242-L250
22:11:46FromGitter<kaushalmodi> but you should be able to extend from that example
22:13:28vivusim 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:32FromGitter<Vindaar> @kaushalmodi taking a look now! ⏎ @vivus: glad it helped you :)
22:24:29nolan_dI 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:43nolan_dWorst 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:05FromGitter<mratsim> maybe you can use Ormin?
22:30:18FromGitter<mratsim> never used it but it’s supposed to address SQL
22:30:35krux02anamok: 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:23nolan_dEh, would really rather not pull in an ORM. This is embedded and using SpatiaLite, so it's pretty low-level.
22:31:26anamokkrux02: I've been playing with Nim for two weeks and I'm amazed what a nice language it is
22:31:37krux02mratsim: did you create any PR's that were merged based on macros/generics?
22:32:04krux02it is cool that you like it
22:32:20krux02then the hard work that was put into it wasn't for nothing :P
22:33:40krux02nolan_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:41anamokkrux02: 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:22krux02I think python as other problems
22:34:43anamokyeah, distribution for instance
22:34:45krux02most importantly for me is, it isn't statically checked at all
22:35:07anamokmypy gives a partial solution for that
22:35:12nolan_dPerhaps, but sometimes those things aren't within your control. Anyhow, I can't find a solution, so string concatenation it is.
22:35:28krux02All python programming I ever did is the nim gdb support for Nim, so I am by far not an expert in Python
22:35:58krux02but it didn't appear to be very compact
22:36:28krux02anamok, I only know pypy
22:37:17krux02nolan_d, yes string concatenation is a good start.
22:37:29*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:38:06anamokAfter 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:07krux02I generate GLSL at compile time also into a string. But for GLSL there is a command line validator that I can call
22:38:33krux02that allows me to have nice error messages
22:39:52krux02anamok, the syntax of Nim was what almost alienated me when learning Nim. But aparently a lot of people like it a lot.
22:40:28anamokkrux02, I love this syntax
22:41:51krux02did you ever programmed in scala or Go?
22:42:34anamokkrux02, 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:17krux02yea better don't use the map, filter procedures in Nim yet.
22:43:41krux02they are immature in Nim
22:44:05anamokkrux02: I tried both but they didn't impress me.
22:44:25krux02with 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:20krux02instead of filter, you can do a for loop with an ``if`` statement inside
22:45:58krux02a for loop that updates a local variable on each iteration is a fold.
22:46:27anamokHow does that work? Can you give an example? I mean the for loop with if.
22:46:37krux02I 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:43nolan_dIs there any kind of string interpolation? Or is concatenation the only way to build a long string?
22:47:01FromGitter<mratsim> @krux02 no I didn’t write any PR recently
22:47:05krux02but 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:13FromGitter<mratsim> last one was about adding test cases for issues that were closed
22:47:27krux02nolan_d, there is string interpolation in Nim
22:47:33krux02there is a macro that can do it
22:47:41anamoknolan_d, There is. var age = 20. echo &"He is {age} years old"
22:47:42krux02strformat iirc
22:48:08FromGitter<mratsim> also seemed like you had a question for me 4 hours ago
22:48:23nolan_dThanks.
22:48:24krux02mratsim: I thought you implemented something
22:49:09anamoknolan_d, import strformat for that
22:49:10krux02based on macros
22:49:34krux02but I guess I am wrong
22:50:05krux02mratsim: something that is related to this issue: https://github.com/nim-lang/Nim/issues/7974
22:51:45FromGitter<mratsim> ah I think I know what conversation you’re referring too
22:52:20anamokkrux02: `(1 .. 10).filterIt(it mod 2 == 0)` gives back `@[2,4,6,8,10]`. How do you rewrite it with for loop?
22:53:09FromGitter<mratsim> var foo: seq[int]; for i in 1 .. 10: if i mod 2 == 0: foo.add i
22:53:29krux02^^
22:53:30krux02yes
22:54:02anamokAnd is it much faster?
22:54:23krux02not in this particular case
22:54:33FromGitter<mratsim> @krux I think it’s related to that: https://github.com/nim-lang/Nim/issues/7719
22:54:48krux02but creating a lot of intermediate seq objects is slow because they need to be allocated and freed again
22:55:04krux02with a for loop you can often avoid creating such an intermediate object
22:55:25FromGitter<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:03FromGitter<mratsim> and referring to this discussion? https://irclogs.nim-lang.org/14-10-2018.html#21:55:13
22:56:24FromGitter<mratsim> > note that the AST after symbol resolution is finally getting fixed and spec'ed :-)
22:57:08anamokkrux02: Nim could use more iterators to avoid the creation of lots of seqs
22:58:12krux02iterators are definitively the way to go in Nim
22:58:22krux02they are fast and very flexible
22:58:37krux02but it is very hard to interleave two iterators
23:01:03FromGitter<mratsim> @anamok that was the discussion this morning
23:01:22anamokay, I missed that
23:01:27FromGitter<mratsim> ah no yesterday: https://irclogs.nim-lang.org/14-10-2018.html#22:34:38
23:02:11anamokthanks for the link
23:02:31FromGitter<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:53FromGitter<mratsim> zero-functional with a functional style and loop fusion with a procedural style
23:08:30anamokinteresting libraries
23:11:22FromGitter<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:44FromGitter<mratsim> `echo lc[x | (x <- 1..10, x mod 2 == 0), int]`
23:11:55FromGitter<mratsim> this is your example using the list comprehension macro
23:12:38FromGitter<bpo217> cool libs thanks for sharing
23:12:41FromGitter<kaushalmodi> Fyi, lc is on chopping block
23:13:35FromGitter<kaushalmodi> But `map` + sugar `=>` works great instead or even `mapIt`
23:13:39FromGitter<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:31FromGitter<mratsim> something to test if a NimNode is an expression would be nice
23:19:04anamokThanks 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:07FromGitter<yyyc514> imports can’t layer can they? import “helpers/all” can’t import other things into the current scope, right?
23:48:31FromGitter<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)