<< 27-06-2018 >>

00:05:26*brainproxy joined #nim
00:07:54*btbytes joined #nim
00:16:24*xkapastel joined #nim
00:19:17*fjvallarino joined #nim
00:22:33*leorize joined #nim
00:26:19*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:27:21*btbytes joined #nim
00:31:19*btbytes quit (Client Quit)
00:45:05*Jesin joined #nim
01:01:36*copygirl quit (Ping timeout: 256 seconds)
01:01:54*btbytes joined #nim
01:12:00*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:14:52*btbytes joined #nim
01:16:15*btbytes quit (Client Quit)
01:18:34*donlzx joined #nim
01:22:21FromGitter<Quelklef> @krux02 Ah, I get that (ish). Although I feel like most uses of varargs probably won't use that feature (I forget what it's called). And most well-written programs probably aren't going to make extensive use of echo? Correct me if I'm wrong.
01:37:11*leorize quit (Ping timeout: 256 seconds)
01:40:19*endragor joined #nim
01:45:10*zahary joined #nim
01:45:20*endragor quit (Ping timeout: 276 seconds)
01:47:50*SenasOzys quit (Ping timeout: 260 seconds)
02:00:36*leorize joined #nim
02:13:22*zahary quit (Quit: Leaving.)
02:56:10*Jesin quit (Quit: Leaving)
02:59:42user1101Hello guys, my question probably won't make a lot of sense but I'll ask anyway. Since Nim compiles to C, are the intermediate compiler generated C translation units usable? I would like to create shared libraries that can be used by other languages that can FFI to C.
03:06:05*cspar_ quit (Ping timeout: 240 seconds)
03:07:28shashlickYes you can exportc and have other languages interop
03:08:21shashlickhttps://nim-lang.org/docs/backends.html#interfacing-backend-code-calling-nim
03:35:05*btbytes joined #nim
03:49:16*endragor joined #nim
03:52:42*cspar_ joined #nim
04:01:32*sz0 quit (Quit: Connection closed for inactivity)
04:23:16*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:49:45*chopzwei quit (Ping timeout: 250 seconds)
04:51:49*fjvallarino quit (Remote host closed the connection)
04:52:16*fjvallarino joined #nim
04:56:41*fjvallarino quit (Ping timeout: 255 seconds)
04:58:53*craigger joined #nim
05:00:20*craigger_ quit (Ping timeout: 260 seconds)
05:00:28*miran joined #nim
05:01:47*lompik joined #nim
05:03:09*chopzwei joined #nim
05:17:52*skrzyp quit (Ping timeout: 256 seconds)
05:25:25*cspar_ quit (Ping timeout: 260 seconds)
05:26:43*fjvallarino joined #nim
05:32:15TangerHey folks! I'm having an issue just calling memfiles.open. I keep getting an "Invalid argument OSError". Here is what I'm calling: https://pastebin.com/uUhd0KTP My guess was that it was somehow trying to pass in the memfiles import as the first argument, but all the examples seem to indicate that it's a valid call
05:41:27*nsf joined #nim
05:50:07TangerVersion 0.18.0 as well
05:50:51FromGitter<Varriount> Tanger: What platform are you using?
05:51:41TangerVarriount: Ubuntu 14.04.1
05:53:00FromGitter<Varriount> Tanger: Is this a compiler error, or a runtime error?
06:08:41*xkapastel quit (Quit: Connection closed for inactivity)
06:09:29*chopzwei quit (Ping timeout: 250 seconds)
06:14:12TangerVarriount: Runtime. It's being called inside a unittest test, if that makes a difference
06:15:27TangerI do open the MemFile object in setup(). And it is inside a when isMainModule block.
06:16:56FromGitter<Varriount> Hm,
06:19:23FromGitter<Varriount> Tanger: Are you using the latest development version of the compiler?
06:21:15TangerVarriount: Currently using the stable 0.18 via choosenim
06:21:28Tanger*stable channel
06:22:16*chopzwei joined #nim
06:26:17*yglukhov[i] joined #nim
06:31:49FromGitter<Varriount> I'm trying to match up the error message with the relevant underlying Linux function call
06:41:32*arecaceae quit (Ping timeout: 255 seconds)
06:41:57FromGitter<Varriount> Tanger?
06:42:27*arecaceae joined #nim
06:44:49TangerVarriount: Sorry. Good idea. How would you recommend I go about doing that?
06:47:49TangerNevermind, strace is probably the way to go
06:52:19TangerVarriount: https://pastebin.com/Vtp41BEu
06:53:05TangerIt looks like the actual system calls failing are mmap and lseek
06:53:42Tangerlseek I assume because mmap is failing to allocate any memory
07:05:54*Vladar joined #nim
07:09:10*jjido joined #nim
07:16:35TangerHmmm, could be as described in the mmap man page - "EINVAL (since Linux 2.6.12) length was 0."
07:16:46Tangerhttp://manpages.ubuntu.com/manpages/trusty/man2/mmap.2.html
07:20:09*ftsf_ joined #nim
07:23:13*ftsf quit (Ping timeout: 248 seconds)
07:28:50TangerOk, I think I've found why it's getting set to 0. https://github.com/nim-lang/Nim/blob/master/lib/pure/memfiles.nim#L226 - If the file doesn't exist or is empty, I think fstat is returning 0 as a size
07:30:46FromGitter<Varriount> Tanger: if you want to make a PR to fix this (or at least return a better error) I can review and merge it in the morning. (I need to get to bed)
07:32:38TangerVarriount: Yeah, I can give that a shot! Thanks man, hopefully will have something to look at tomorrow. Night
07:50:51*jjido quit (Ping timeout: 240 seconds)
07:51:09*dddddd joined #nim
08:26:47*donlzx quit (Quit: Leaving)
08:27:16FromGitter<kindlychung> ```template `|=`(a, b: untyped) = ⏎ not (a == b) ⏎ ⏎ echo &"2 != 3? {2 |= 3}"``` [https://gitter.im/nim-lang/Nim?at=5b334a64be98b142240cae92]
08:32:54Araqtemplate `|=`(a, b: untyped): bool
08:33:05FromGitter<kindlychung> Ok, thanks.
08:36:32Araqbtw Nim has != for unequality
08:52:10FromGitter<kindlychung> @Araq Yeah, I was just learning about templates. :)
08:53:51FromGitter<kindlychung> Shadowed with type, too. A bit difficult to understand.
08:54:11*ftsf_ quit (Quit: Leaving)
09:02:02*rauss quit (Read error: Connection reset by peer)
09:03:12*rauss joined #nim
09:06:54*samuell joined #nim
09:10:55FromGitter<kindlychung> I see, it's sort of a placeholder there.
09:21:36*brainproxy quit (Quit: WeeChat 2.1)
09:23:15*noonien joined #nim
09:44:39*copygirl joined #nim
09:55:49*miran quit (Quit: Konversation terminated!)
09:55:59FromGitter<mratsim> I thought you couldn’t shadow in templates,
10:17:26*user1101 quit (Quit: user1101)
10:23:38*user1101 joined #nim
10:33:48*user1101 quit (Quit: user1101)
10:35:39*jjido joined #nim
10:37:20*zahary joined #nim
10:47:44*vivus joined #nim
10:53:53*flyx quit (Ping timeout: 248 seconds)
10:55:25*nif quit (Ping timeout: 268 seconds)
10:55:39*flyx joined #nim
10:56:09*nif joined #nim
11:02:00*elrood joined #nim
11:02:56FromGitter<mratsim> @dom96 I think we should add miran tutos and xmonader notes on the reddit sidebar: https://www.reddit.com/r/nim/
11:04:29*zahary quit (Quit: Leaving.)
11:06:23FromGitter<codenoid> hi , i have a terminal command ⏎ ⏎ ```ssh [email protected] ⏎ << passwordxxxx ⏎ echo "success" (inside ssh)``` ⏎ ⏎ can i do that in single nim binary file ? [https://gitter.im/nim-lang/Nim?at=5b336faf59799e701745f914]
11:07:22leorizecodenoid: yes, you can
11:08:38FromGitter<codenoid> how, i'm new about STDIN inside executable app
11:10:01leorizeuse startProcess to create a Process object
11:10:04leorizehttps://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]
11:10:24leorizethen grab it's inputStream
11:10:27leorizehttps://nim-lang.org/docs/osproc.html#inputStream,Process
11:11:21leorizethen you can write stuff to the stream with https://nim-lang.org/docs/streams.html#writeLine,Stream,varargs[string,]
11:12:28*zahary joined #nim
11:18:52*couven92 joined #nim
11:24:20*zahary quit (Quit: Leaving.)
11:28:34*couven92 quit (Remote host closed the connection)
11:32:33*zahary joined #nim
11:33:53*Gnjurac joined #nim
11:40:38*yglukhov[i] quit (Remote host closed the connection)
11:41:53*yglukhov[i] joined #nim
11:43:31*Vindaar quit (Ping timeout: 268 seconds)
11:44:13*Vindaar joined #nim
11:44:36*Vindaar is now known as Guest9022
11:46:47*miran joined #nim
11:48:31*data-man joined #nim
12:09:35*chopzwei quit (Ping timeout: 250 seconds)
12:23:26*chopzwei joined #nim
12:28:01*fvs joined #nim
12:30:55*cspar_ joined #nim
12:41:37*lompik quit (Ping timeout: 248 seconds)
12:45:08*zahary quit (Ping timeout: 255 seconds)
12:55:12*nsf quit (Quit: WeeChat 2.1)
12:56:13*cryptocat1094 joined #nim
13:03:13*cspar_ quit (Ping timeout: 256 seconds)
13:21:45*yglukhov[i] quit (Read error: Connection reset by peer)
13:22:18*yglukhov[i] joined #nim
13:28:24FromGitter<kaushalmodi> In https://nim-lang.org/docs/manual.html#templates-passing-a-code-block-to-a-template, there's "You can pass a block of statements as a last parameter to a template via a special : syntax"
13:28:46Araqyeah, what about it
13:29:33FromGitter<mratsim> ugh, Gitter ate my indentation
13:31:18*fjvallarino quit (Remote host closed the connection)
13:31:25*fjvallarino joined #nim
13:31:27FromGitter<kaushalmodi> If that template has both bar and body untyped, his can you tell from the signature that the body is the actual body block? I mean that it doesn't look special as said in the manual.
13:32:35FromGitter<kaushalmodi> Can we have 2 or more?
13:32:49Araqyeah, via 'do:'
13:33:52FromGitter<kaushalmodi> So, how would that line be rephrased? What's the special : it's taking about?
13:34:22*samuell quit (Quit: Hejdå)
13:35:18dom96Ugh
13:35:32FromGitter<tim-st> when I use a shared nimcache folder, does the compiler find out when it has to rebuild the file instead of use cached?
13:35:34dom96People are suddenly deciding to remove their GitHub accounts
13:35:50mirandom96: people? plural?
13:35:53dom96yes
13:35:57dom96Second person so far
13:36:11Araqcan we fork every nimble package already?
13:36:23dom96yes, we can
13:36:29miranheh, Araq took the words from my mouth
13:36:36Araqlet's do it.
13:36:47dom96Someone just has to write a script that does it
13:36:56FromGitter<mratsim> do they put back their repo somewhere else?
13:37:22dom96I dunno, but I'm going to make the packages CI more lenient
13:37:31Yardanicodom96, well, it means that they don't know that they can mirror gitlab repos to github
13:37:35Yardanicoas nesm creator did
13:37:42Yardanico(https://github.com/xomachine/NESM)
13:37:51dom96Yardanico: Or... they did mirror them, but deleted their account anyway
13:37:57dom96and forgot that they need to update nimble
13:38:10dom96https://github.com/konqoro/fractions
13:38:12dom96That's the repo
13:38:22FromGitter<tim-st> Does someone know an answer to my question about nimcache? it doesnt seem to know when it has to rebuild...
13:38:51Yardanicodon't use shared nimcache folder
13:39:03Yardanicoit won't really give you any advantages because nim uses dead code elimination
13:39:32FromGitter<tim-st> yardanico: I though it's about reusing compiled *.o files?
13:39:40Yardanicoso if both your projects use tables module, and one uses some procedure which other one doesn't, compiled C file for tables module will be recompiled every time
13:42:10FromGitter<tim-st> maybe the compiler could build all procs of all stdlib files so it would never miss one
13:42:47*btbytes joined #nim
13:43:37Araqdom96: ok, who writes this script? shashlick?
13:43:57dom96whoever is willing to write it
13:45:01Araqso ... not you
13:45:10Yardanicowait, why would we want to fork every nimble package?
13:45:20Yardanicowe will need to update them then
13:45:23FromGitter<tim-st> what do other languages do about this? isnt this normal that people can delete their packages if they want?
13:45:43Yardanicowe don't have a proper package index (with website and accounts)
13:45:55Yardanicoand you can delete your package with a PR to the packages repo
13:46:12dom96AFAIK npm et al. don't allow packages to be deleted
13:46:33FromGitter<Vindaar> @tim-st depending on the license of the code, it should be perfectly fine to do just that
13:46:33Araqsmart. :-)
13:46:47nkaramolegos[m]Hello guys. Did you see my message?
13:46:56dom96Indeed, it's not just a case of "Fork all packages"
13:47:02dom96You need to keep them up to date
13:47:05dom96which is a PITA in itself
13:47:16Yardanicoyeah
13:47:23mirannkaramolegos[m]: from when? there was nothing in the last 10-15min on IRC from you
13:47:24Yardaniconkaramolegos[m], yes, matrix-irc bridge works
13:47:36Yardanicobut we saw only your last message
13:48:28Araqwell the "fork" would only be a fallback
13:48:36FromGitter<tim-st> https://opensource.stackexchange.com/questions/1154/how-does-githubs-forking-right-cope-with-an-all-rights-reserved-project
13:48:50AraqI'm not saying it's a viable long-term strategy
13:48:57*btbytes quit (Ping timeout: 264 seconds)
13:49:28dom96A better approach would be to host a GitHub-like site and tell people "okay, push your project here or it's not installable via Nimble"
13:49:58nkaramolegos[m]miran: Let me send the message again
13:49:59mirandom96: sounds like a (private) gitlab, no?
13:50:20dom96yes
13:50:38Yardanicohow does crystal or rust do this?
13:50:46FromGitter<mratsim> or nimble pull the installable files regularly.
13:51:47Araqdom96: isn't that muhc work to setup?
13:51:52FromGitter<mratsim> tests should be ignored though
13:52:03mirannkaramolegos[m]: i see your message, loud and clear
13:52:08dom96Araq: Sure, but so is forking and updating each package
13:52:19dom96mratsim: not sure what you mean
13:52:22*nkaramolegos[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/PrOjzHATZMmLXcCGsWnWYiGA >
13:52:36miranupdate only on new nim releases? :)
13:53:05dom96Really wish Matrix would format long messages better
13:53:08FromGitter<mratsim> @dom96, every day you have something that pull every install files of packages in package.json.
13:53:29dom96mratsim: yes, that's the other approach, but it's worse than having the author push
13:53:42dom96and I wouldn't be surprised if GitHub bans us for that
13:54:21dom96Yardanico: Pretty sure Crystal does the same as us
13:54:28FromGitter<mratsim> having author push means even more friction though
13:54:29dom96Rust has its own package website where you upload packages AFAIK
13:55:09Yardanicohttps://crates.io/
13:55:31Yardanicohttps://doc.rust-lang.org/cargo/reference/publishing.html
13:55:50Yardanicoyeah, author should upload newer version manually
13:56:30Araqwell we're dealing here with unresponsible authors
13:56:47Araqcan't tell these guys to "upload yourself"
13:57:30FromGitter<mratsim> or maybe there is a malware that targets Nim devs <insert conspiracy theory>
13:57:54dom96I'm guessing people are leaving because of the MS acquisition
13:58:06Yardanicodom96, imo this is stupid
13:58:21miranYardanico: ofcourse it is
13:58:22dom96I agree
13:58:40FromGitter<tim-st> github and ms both are similiar companies
13:58:56Araqthey are free to do that, but not updating the nimble entry to gitlab or whatever else is just mean
13:58:58dom96but people will always find reasons to delete their repos or accounts
13:59:25Araqit's not our fault github got bought by MS...
14:00:08dom96nkaramolegos[m]: seems like a very Greek-centered event
14:00:50dom96Araq: Indeed, and in fact we're happy for packages to come from any provider
14:01:12dom96(there are some niche ones which is also another reason why we should back everything up)
14:01:13cryptocat1094A private repo is not particularly hard to deal with... git was kind of make with that in mind
14:01:20cryptocat1094*made
14:01:34Araqdom96: agreed.
14:01:40dom96Indeed. I do agree that there is more friction though
14:01:46mirandom96: a bit offtopic - how many responders to the survey so far?
14:02:18dom96335
14:02:25mirannoice!
14:02:32cryptocat1094Survey?
14:02:35Yardanicocryptocat1094, yes?
14:02:46dom96https://nim-lang.org/blog/2018/06/23/community-survey-2018.html
14:02:49Yardanicocryptocat1094, didn't you see an article on nim website ? :)
14:03:46FromGitter<kaushalmodi> @mratsim Araq: Back to that topic on "special :" in templates, this works: ⏎ ⏎ ```template foo(body: untyped) = ⏎ body ⏎ foo(echo "hey")``` [https://gitter.im/nim-lang/Nim?at=5b339942aeb8fa0c0746d252]
14:04:12Araqyeah, the manual is misleading
14:04:34Araqand it's hard to put it in words
14:04:38Yardanico@kaushalmodi said:
14:04:41YardanicoBut I don't know what to PR?\nJust remove that sentence?
14:04:55Yardanico(gitter doesn't send some messages to the API so FromGitter can't relay them)
14:05:13Yardanicoalso @mratsim's message didn't go through
14:05:41FromGitter<kaushalmodi> Yardanico: Curious.. how do you figure that out.. do you have a live diff ongoing between Gitter/IRC?
14:06:10Yardanico@kaushalmodi well, I have a browser and an IRC :)
14:06:53AraqNim is based on "syntax harmony", there is syntax but it mostly maps to "calls". and then the "calls" are resolved by overload disambiguation and it's this process that has some special casing for 'templates', but 'untyped' has nothing to do with "takes a colon statement list"
14:07:47FromGitter<kaushalmodi> Also, based on brief experimentation, backquoting seems optional at few places in templates
14:08:21Araqwell "nothing to do" ... not much else works for a list of statements
14:08:37Araqbut that's a type checking issue, not a syntactic issue.
14:08:57FromGitter<kaushalmodi> About optional backquotes: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b339a795862c35f47cccaa7]
14:09:04Araqdo my words clear things up or make everything more confusing? ;-)
14:11:13FromGitter<kaushalmodi> Araq: Yeah, sorry. It's not clear.. How would you replace "You can pass a block of statements as a last parameter to a template via a special : syntax:" in https://nim-lang.org/docs/manual.html#templates-passing-a-code-block-to-a-template?
14:12:24FromGitter<Araq> well that sentence is correct, but better without the reference to 'template'
14:13:46FromGitter<Araq> to a macro.
14:14:55FromGitter<Araq> but that's not the point. Nim is simpler, the parser accepts ``callHere(a, b): body_here()`` and doesn't even know what ``callHere`` means, the parser has no symbol table.
14:16:07*cryptocat1094 quit (Quit: WeeChat 1.6)
14:16:51FromGitter<Araq> @kaushalmodi no, you can always pass a block of statements, it's just syntax. The type checking works much better when this parameter is ``untyped`` though.
14:18:04Gnjuraci did survawy too
14:19:25FromGitter<kaushalmodi> Araq: Oh, this works too (*completely colon-free* :P) ⏎ ⏎ ```template foo(body) = ⏎ body ⏎ foo(echo "hey")``` [https://gitter.im/nim-lang/Nim?at=5b339cedbe98b142240d90fb]
14:19:52*endragor quit (Remote host closed the connection)
14:20:25*rauss quit (Quit: WeeChat 2.1)
14:21:12*rauss joined #nim
14:21:22FromGitter<Araq> I always wanted to describe Nim with two HTML tables...
14:21:30*cspar_ joined #nim
14:24:15FromGitter<Araq> maybe I'll write yet-another introduction into the language.
14:25:26FromGitter<Araq> yeah. :P
14:29:31*cryptocat1094 joined #nim
14:32:05FromGitter<Vindaar> @Araq There can never be too many introductions written by you ;)
14:34:39Araqcrap. I forgot about the match.
14:36:06FromGitter<kaushalmodi> But here, foo is not a block, right? ⏎ ⏎ ```template foo(body) = ⏎ body ⏎ foo(): ⏎ echo "hello" ⏎ echo "world"``` [https://gitter.im/nim-lang/Nim?at=5b33a0d56ceffe4eba37d207]
14:37:44FromGitter<Vindaar> Not `foo` is a block, but the ⏎ ⏎ ``` echo "hello" ⏎ echo "world"``` ⏎ ⏎ is a block that is being passed to the `foo` template [https://gitter.im/nim-lang/Nim?at=5b33a137be98b142240d9f7e]
14:39:18FromGitter<Araq> there are no "named" blocks. you can pass a block to a "routine"
14:40:53FromGitter<kaushalmodi> Yes, I was confusing `foo:` with that..
14:42:38FromGitter<kaushalmodi> This discussion cleared up my confusion regarding the "special colon". I was focusing on the template definition as the wording used "parameter".
14:44:44FromGitter<mratsim> why call? just “to a template” is enough no?
14:46:07FromGitter<kaushalmodi> So I want to tell the reader which exact colon that sentence is talking about
14:47:12*chopzwei quit (Remote host closed the connection)
14:47:45*chopzwei joined #nim
14:55:05FromGitter<kaushalmodi> Done in https://github.com/nim-lang/Nim/pull/8133.
14:56:33miranbtw, should the changes to the manual like this one be merged to devel or master?
14:57:41FromGitter<Araq> devel.
14:58:04miranok
14:59:05*Vladar quit (Quit: Leaving)
15:01:28FromGitter<kaushalmodi> @mratsim and Araq: About https://gitter.im/nim-lang/Nim?at=5b3392066ceffe4eba37a337, I was referring to a hypothetical template use case like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33a6c8b9c2fb2557102809]
15:03:01*yglukhov[i] quit (Remote host closed the connection)
15:03:37*yglukhov[i] joined #nim
15:05:19FromGitter<kaushalmodi> And my final template/untyped question for today. In https://nim-lang.org/docs/manual.html#templates-passing-a-code-block-to-a-template, the first example has return type as untyped, while the second example has no return type.
15:06:26FromGitter<mratsim> @kaushalmodi use a static string and “when” to switch at copile-time
15:08:09*yglukhov[i] quit (Ping timeout: 264 seconds)
15:08:10*jjido quit (Read error: Connection reset by peer)
15:09:03*skrylar joined #nim
15:09:24skrylarjust spitballing, but there might be a (probably obscure) opening to wedge nim in for sandstorm.io apps
15:09:33*TheLemonMan joined #nim
15:09:45skrylarwas re-reading and poking it earlier and they are hit pretty hard by high-ram use middleware
15:15:05FromGitter<kaushalmodi> @mratsim About the multiple bodies, I didn't understand how to apply what you said to that template. But I'll leave this question open for now as I don't yet have a real use like in that example.
15:16:45FromGitter<kaushalmodi> About untyped being useful to make replacement before type checking.. I sort of understood that, but trying to fit some logic w.r.t the return type for templates. Isn't the return type of templates technically "void"? Because crudely speaking, they just replace the template instance with the template body?
15:19:49FromGitter<kaushalmodi> As an aside, the Nim tutorials, manual, etc. site are nicely readable in Emacs eww browser :)
15:20:35Araqeww
15:20:44*Vladar joined #nim
15:21:45FromGitter<kaushalmodi> yeah.. funny acronym
15:24:59*xkapastel joined #nim
15:26:56FromGitter<Vindaar> @kaushalmodi Do you have an example as to when and how you'd use such a template with multiple bodies?
15:29:24FromGitter<kaushalmodi> @Vindaar No, I don't have a real use case. But that pseudo code shows how multiple bodies can probably be used.
15:31:04FromGitter<mratsim> I use multiple body template in Arraymancer: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/aggregate.nim#L89
15:32:29FromGitter<kaushalmodi> @mratsim That's a pretty concise and good example.. shows me that you cannot always leave out return type for templates. Thanks.
15:33:22Araqno, you can *never* leave out the return type. for templates or anything else.
15:33:51FromGitter<ephja> yeah I think libsoundio does spawn a thread. the inattentive brain strikes again :p
15:33:56Araqunless it's 'void'
15:38:15*lompik joined #nim
15:41:30*yglukhov[i] joined #nim
15:42:04FromGitter<kaushalmodi> If a template is accepting a block of statements, then is it safe to then always set its return type to untyped, in case you cannot be sure if the body will have a void return type?
15:46:37FromGitter<mratsim> untyped always work
15:48:19oprypini'm looking at the gitter stuff and i see that https://api.gitter.im/v1/rooms/59f23b3ed73408ce4f7be2d1/chatMessages (note: requires auth) instead of keeping the connection alive just disconnects
15:48:32FromGitter<kaushalmodi> @mratsim Thanks. That's what I derived :)
15:49:14Yardanicooprypin, maybe you should contact gitter support (if that thing exists)?
15:55:21*FromGitter quit (Remote host closed the connection)
15:55:30*FromGitter joined #nim
16:04:35*leorize quit (Quit: WeeChat 2.1)
16:12:41oprypinsigh, looks like it was my fault after all. maybe I was misusing the API but it just happened to work before some change. let's see if fixing that makes the streaming work well too.
16:36:17FromGitter<OldhamMade> hey everyone, hope you're all doing well. would like a bit of advice if possible. I'm reading FileInfo for a bunch of files on disk that I'd like to sort by modification time. I'm struggling a little converting a Time to something with microsecond precision. Docs say to use `Times.toUnix` for such conversions, but that's not granular enough.
16:38:15FromGitter<Quelklef> As in, not precise enough?
16:38:55FromGitter<Quelklef> I'm not sure, but my bet is that the time is only stored to the second
16:40:11FromGitter<kaushalmodi> I don't use the time module, but I believe that the devel branch version of that recently got an update that added more precision units.
16:40:43FromGitter<mratsim> Yes use devel it has nanoseconds presolution: https://github.com/nim-lang/Nim/blob/devel/lib/pure/times.nim#L102
16:41:01FromGitter<mratsim> resolution*
16:42:10FromGitter<OldhamMade> @Quelklef yeah, according to the docs `FileInfo` shows `lastWriteTime*: times.Time`, which one would expect to have millisecond precision
16:42:29ldleworkAre there any Nim "killer apps" or libraries I can share that come to mind?
16:42:53cryptocat1094`yes` is pretty neat. :p
16:43:01dom96Nim forum?
16:43:26Yardanicoldlework, nim compiler :)
16:43:34FromGitter<mratsim> This: https://onsetgame.com/
16:43:39Yardanicoarraymancer also
16:44:00FromGitter<Quelklef> @OldhamMade my bad then
16:44:21ldleworkdom96: the counter example posited to me was ripgrep
16:44:25cryptocat1094It's a bit odd for a forum. What with the discourse-like hierarchy-less architecture.
16:44:32FromGitter<mratsim> @Idlework Reel Valley is written in Nim: https://play.google.com/store/apps/details?id=com.onsetgame.reelvalley&hl=en_US
16:44:55FromGitter<mratsim> available as a Facebook Game as well: https://www.facebook.com/reelvalley/
16:45:29dom96ldlework: nimgrep? lol
16:45:37ldleworkdom96: is it as fast as ripgrep?
16:45:47dom96Doubt it
16:45:49ldleworkapparently ripgrep is the fastest grip to date
16:45:54ldleworkgrep*
16:46:09FromGitter<Quelklef> Woah, @mratsim, compiled to what? I thought Android apps were in Java?
16:46:17FromGitter<mratsim> C
16:46:21ldleworkAnyway, I was just curious.
16:46:27dom96Doubt that's thanks to Rust, more thanks to how much effort the author put into optimising it
16:46:46dom96mratsim: is it not C++?
16:46:50dom96AFAIK the Android NDK is C++
16:46:51FromGitter<mratsim> BurntSushi is an awesome optimizer
16:47:09FromGitter<mratsim> or maybe C++, but you don’t compile Nim to Java ;)
16:47:50FromGitter<kaushalmodi> @mratsim Maybe BurntSushi should try out Nim some day.. and then we have *nipgrep*!
16:48:38ldleworkdom96: hmm the author seems to attribute its speed mostly to rust's regex engine and other libraries they used: https://github.com/BurntSushi/ripgrep#is-it-really-faster-than-everything-else
16:48:41dom96IIRC I did see BurnSushi in here a couple of years ago :)
16:48:41FromGitter<mratsim> maybe, I used his CSV library XSV as well, because it’s very hard to find a library that can deal with CSV with 2000+ columns and takes a few GBs
16:48:42cryptocat1094Rust helps because of some better abstractions than C (not a high bar).
16:48:47dom96*BurntSushi
16:49:21Yardanicoah yes, about rust - they'll add high-level additions to the stdlib to use SIMD instructions
16:49:23Yardanicowhich is pretty neat
16:50:25Yardanicoatm it's only unsafe
16:50:34*fjvallarino quit (Remote host closed the connection)
16:50:36FromGitter<ephja> is there a type that represents a manually allocated array? casting a ptr to an array pointer is often fine, but it's inconvenient when the target type is an array pointer because you need to specify the correct size when casting
16:50:37cryptocat1094"lock-free parallel recursive directory iterator" if it's not IO-starved, that would also help.
16:50:49Yardanicohttps://blog.rust-lang.org/2018/06/21/Rust-1.27.html simd section here
16:50:51FromGitter<mratsim> the thing is, compiling with march=native usually works for me, and if it doesn’t work, it’s because inline ASM is actualy rquired
16:51:01*fjvallarino joined #nim
16:51:05*erratic quit (Ping timeout: 240 seconds)
16:51:20Yardanicowe need to compare nim-regex to rust's regex lib :)
16:51:30FromGitter<mratsim> @ephja, cast\ptr uncheckedArray\ (fooPtr) ?
16:51:39FromGitter<mratsim> with uppercase U
16:52:27FromGitter<mratsim> UncheckedArray should probably appear in a “Nim for the low-level” developer
16:52:53FromGitter<mratsim> It’s asked often and I’m pretty sure there is no doc about it
16:53:51FromGitter<OldhamMade> Ah... while I'm RTFM'ing, it would help if I read the description for `Times.Time`: "This is currently implemented as a int64 representing seconds since [epoch]".
16:54:32FromGitter<ephja> that should do. I was only looking at the unchecked pragma
16:55:20*fjvallarino quit (Ping timeout: 255 seconds)
16:57:00FromGitter<OldhamMade> out of interest, is there anyway to get a more precise lastWriteTime for a file using Nim 0.18.0?
16:57:58FromGitter<ephja> speaking of which, maybe there should be a distinction between pointers to individual values and pointers to arrays when allocating.
16:57:58Yardanicoprobably by using some stuff from posix module?
17:00:18*fjvallarino joined #nim
17:01:20FromGitter<OldhamMade> @Yardanico ah, yes -- I'm already using Stat somewhere, that might have something more precise. thanks!
17:01:23FromGitter<ephja> ```code paste, see link``` ⏎ ⏎ maybe something like that, but you would often want to pass around the length as well [https://gitter.im/nim-lang/Nim?at=5b33c2e3aeb8fa0c07475d4a]
17:03:47Yardanico@OldhamMade oh, so ll is yours :)
17:06:20FromGitter<tim-st> Can I use c2nim to create a nim wrapper directly from a dll like `c2nim lib.dll > lib.nim`?
17:06:47FromGitter<tim-st> there is a windows tool that can read api from a dll file so it should be possible
17:08:08FromGitter<ephja> alright, more old issues resolved!
17:10:03FromGitter<kaushalmodi> Yardanico: Very cool. I'll be following the `ll` development. Thanks @OldhamMade. I switched to exa from ls few months back. So I'm interested in seeing ll vs exa comparison, at least for the basic ls-like features :)
17:10:08*erratic joined #nim
17:10:25Yardanico@OldhamMade btw, why are you using makefile at the same time with nimble?
17:10:38FromGitter<OldhamMade> laziness :D
17:10:58*vivus quit (Quit: Leaving)
17:11:04FromGitter<OldhamMade> actually, it's because I occasionally run local Travis docker images to test failing builds
17:11:36FromGitter<OldhamMade> and not being too familiar with Nim and nimble files, it was a quick way to get started
17:12:03FromGitter<OldhamMade> also, `make` his hardwired into my hands.
17:13:07FromGitter<OldhamMade> @kaushalmodi haven't heard about exa, do you have a link?
17:16:44FromGitter<kaushalmodi> https://the.exa.website/
17:17:27FromGitter<OldhamMade> hmm... looks like `Stat.st_mtime`isn't any more precise. looks like I'll have to wait for the next release for better precision.
17:20:34FromGitter<kaushalmodi> Or.. you can clone the time.nim in devel as a private dependency for your project, and use that instead of the time in stable Nim.. just a thought.
17:20:49FromGitter<kaushalmodi> Look into private imports in Nimble.
17:20:54FromGitter<OldhamMade> that's not a bad idea, actually
17:21:07ldleworkbtw, the answer I came up with was the GC
17:21:11ldleworkheh *shrug*
17:22:24FromGitter<kaushalmodi> @OldhamMade Yeah, just a thought. You'll need to check if devel/time works independently on stable.
17:24:49FromGitter<OldhamMade> @kaushalmodi hmm... might end up going down a rabbit-hole; bringing that in might mean I need to copy other modules.
17:25:07FromGitter<OldhamMade> anyone know if there's a timeline for the next release?
17:25:10Yardaniconot really
17:25:26Yardanicowhy not just use devel for now? :)
17:25:55FromGitter<OldhamMade> don't think devel is available via `asdf`
17:26:05Yardanicoasdf?
17:26:26FromGitter<kaushalmodi> Yardanico: It's a CLI utility to update things
17:26:29FromGitter<OldhamMade> https://github.com/asdf-vm/asdf
17:26:36Yardanicowell, make a PR to add devel nim then :)
17:26:44Yardanicoor compile manually, it's very easy
17:26:48Yardanicoor use choosenim
17:26:56FromGitter<kaushalmodi> @OldhamMade You don't need asdf.. just clone the Nim repo, checkout devel and copy the pure time.nim file.
17:27:26FromGitter<OldhamMade> I'll give it a shot.
17:27:54FromGitter<OldhamMade> and adding a `devel` option to `asdf` might be a nice way to feed back to that project, too
17:32:52FromGitter<OldhamMade> exa looks interesting. I doubt `ll` will get anywhere near that complex. I was mostly just "stratching an itch" in building it; `k` can get annoyingly slow at times.
17:33:24FromGitter<OldhamMade> git support has landed in `ll` yesterday. once I've got sorting sorted and it can install via `brew`, I think it'll be pretty much "done".
17:36:34FromGitter<kaushalmodi> I switched to exa mainly for "better" (quoted because that is heavily subjective) ls defaults and being able to just do `exa --tree` (so it acts as `tree` too). Nonetheless, I'll use your project to study how GNU Coreutils-like applications look like. I cannot do the same with exa as I don't know Rust :)
17:38:34FromGitter<tim-st> So I found out libs supply only function name as string but no args and additionally the exported function names are unique, wouldnt that help c2nim in creating an easy wrapper for dlls with `c2nim exportedNames.txt CsourceCodeFolder`? in my tests c2nim failed, but using this approach it should be quite stable, or not?
17:39:14FromGitter<mratsim> you can just pass includes.h though no?
17:39:29FromGitter<tim-st> I tried that it had parsing errors
17:39:37FromGitter<tim-st> I think it cannot parse two `##`
17:40:15FromGitter<OldhamMade> @kaushalmodi I'm not sure `ll` would be much help -- it's my first Nim project, and feels pretty "hacky" to me currently. I was actually thinking of asking in this channel for feedback on the code!
17:44:50FromGitter<kaushalmodi> @OldhamMade No worries. I'm at the bottom of the chain of Nim expertise. I'm learning Nim too. I'm sure I'll have many things to learn from your project.
17:46:12FromGitter<kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33cd6472b31d3691f8d371]
17:46:24FromGitter<OldhamMade> @kaushalmodi feel free to send feedback my way; I'm always looking for ways to improve my code! :D
17:46:39FromGitter<kindlychung> I am trying to write a macro that achieves something like `echo &"x == 42? {x == 42}"`.
17:46:49FromGitter<kindlychung> but can't seem to get it to work.
17:47:08FromGitter<kindlychung> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
17:47:41FromGitter<kindlychung> Could anyone help?
17:47:45Yardanico@kindlychung you want something like "dump" from "future" module?
17:47:57FromGitter<kaushalmodi> @OldhamMade the only feedback I have right now, is to use doc strings. See how the doc strings are written in Nim libraries (comments starting with `##`). Also look into using the `terminal` module. That way you don't need to use ANSI escapes directly.
17:48:05FromGitter<OldhamMade> heh, running `k` in the cloned copy of the `nim` source takes about 2s to finish painting. `ll` takes 0.075s, and I've done *no* optimisations other than a bit of memoization here and there.
17:48:33FromGitter<kaushalmodi> *I happen to have delved into improving the `terminal` module on devel very recently.*
17:48:50FromGitter<kaushalmodi> @OldhamMade 👍
17:48:59FromGitter<kindlychung> @Yardanico Thanks. Didn't know that.
17:49:21FromGitter<kindlychung> But I still would like to finish this macro, just as an exercise.
17:49:25FromGitter<OldhamMade> thanks @kaushalmodi. I have a couple of them scattered around, but since I don't have a public API I haven't really bothered adding them. I'll add a ticket to introduce more to the source.
17:49:32FromGitter<kindlychung> I am very close to make it work.
17:49:55FromGitter<kindlychung> Just don't know how to get the value of `value`.
17:50:13FromGitter<Yardanico> @kindlychung what should you macro do and how would you want to use it?
17:50:58FromGitter<Quelklef> is `func` still a dummy keyword, or does it mean `{.noSideEffects.}` yet? It seems to complain about some of my non-pure functions, but not one including `rand` usage...
17:51:02FromGitter<kaushalmodi> About `terminal`, here's how I use it in my contribution to `fab` module: https://github.com/icyphox/fab/blob/dev/src/fab.nim (to you and others, comments for improvement accepted here too :D)
17:51:19FromGitter<Yardanico> @Quelklef it means noSideEffects in devel
17:51:30FromGitter<Quelklef> @Yardanico I'm on devel :\
17:51:47FromGitter<kindlychung> Given a variable and a value, print something like `&"x == value? {x == value}`
17:51:55FromGitter<kindlychung> @Yardanico
17:51:58FromGitter<Quelklef> Do I not understand `rand`, or is this a bug?
17:52:10FromGitter<Yardanico> @kindlychung so how would you call it? checkEqual(x, value) ?
17:52:18FromGitter<kindlychung> yes.
17:53:02Yardanicowell, if the compiler crashes - it's always a bug, but there's probably an error in your code
17:53:06*jm1 joined #nim
17:53:16*jm1 left #nim ("Leaving")
17:55:46FromGitter<OldhamMade> hadn't seen the `terminal` module before... I've been considering reimplementing my `beanstalkctl` and `beanstalktop` tools in Nim; that module would definitely come in handy for that. Thanks @kaushalmodi!
17:57:07FromGitter<kindlychung> In short, I am looking for something like the unquote form in clojure.
17:58:54*PMunch joined #nim
18:00:43FromGitter<Yardanico> well, firstly - your checkEqual can be easily done with a simple template, but I'll try to fix your macro
18:01:51*cspar_ quit (Ping timeout: 256 seconds)
18:01:52FromGitter<kindlychung> ok, thanks.
18:02:17*lompik quit (Ping timeout: 276 seconds)
18:03:30*ketralnis quit (Quit: Coyote finally caught me)
18:09:15*chopzwei quit (Ping timeout: 250 seconds)
18:13:56FromGitter<Quelklef> Wait, is a `func f(x: var X)`
18:14:11FromGitter<Quelklef> i.e. does `func` guarantee total purity, or only purity on non-`var` variables?
18:15:42FromGitter<tim-st> c2nim now gets most working, but for example this is just skipped: `typedef struct MDB_env MDB_env;`
18:15:57FromGitter<tim-st> honestly I dont know myself what this definition means :\
18:15:58FromGitter<Quelklef> Apprently `{.noSideEffect.}` only complains about anything outside of the function signature. Cool!
18:15:59FromGitter<GULPF> `func` is not about purity, it's about `{.noSideEffects.}`
18:16:12FromGitter<Quelklef> yeah @GULPF I got it. I really like how it's set up!
18:18:22FromGitter<Quelklef> Although file IO seems to not be marked as a side effect?
18:18:40FromGitter<tim-st> Anyone has an idea why an other nim impl. just uses `type object` for the code above? how is it guaranteed to work?
18:20:35FromGitter<tim-st> ah, it's called an opaque type..
18:20:39FromGitter<Quelklef> As well, doesn't `rand` have a side effect because it mutates the global random state?
18:20:47*cspar_ joined #nim
18:22:23*chopzwei joined #nim
18:24:56*PMunch quit (Quit: Leaving)
18:25:51*nsf joined #nim
18:36:56*tiorock joined #nim
18:36:56*rockcavera is now known as Guest50015
18:36:56*Guest50015 quit (Killed (weber.freenode.net (Nickname regained by services)))
18:36:56*tiorock is now known as rockcavera
18:39:51FromGitter<Yardanico> @kindlychung probably something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33d9f77d3bca737a0f4a7e]
18:40:16FromGitter<Yardanico> But IDK why would you need a macro: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33da10be98b142240e513d]
18:43:38*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
18:46:14FromGitter<Varriount> @Yardanico Don't forget the `quote` helper.
18:46:20YardanicoI know about it
18:46:35Yardanicobut @kindlychung probably wanted to use "traditional" style
18:47:59FromGitter<kindlychung> Hm, does the `$` in `$value` differ from the `$` in `$varName`?
18:51:25*jsn-_ is now known as jsn-
18:51:33FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33dcb56ceffe4eba3888ad]
18:55:40FromGitter<kindlychung> Yeah, that's easier to understand. Thanks!
18:56:22FromGitter<kindlychung> The template is nice!
18:58:00Yardanico!eval import future; let x = 1; echo dump(x == 1)
18:58:01NimBotCompile failed: in.nim(1, 37) Error: type mismatch: got <void>
18:58:04Yardanico!eval import future; let x = 1; dump(x == 1)
18:58:06NimBotx == 1 = true
18:58:31FromGitter<kindlychung> 👍
18:58:55FromGitter<kindlychung> What's the deal about quote helper?
18:59:38*fjvallarino quit (Remote host closed the connection)
19:00:07*fjvallarino joined #nim
19:04:28FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33dfbc5862c35f47cd9dfe]
19:04:35*fjvallarino quit (Ping timeout: 240 seconds)
19:04:45FromGitter<Yardanico> https://nim-lang.org/docs/macros.html#quote,typed,string
19:08:59*cspar_ quit (Ping timeout: 255 seconds)
19:11:59FromGitter<kindlychung> Ah, you are fast. :) I was trying to figure out this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33e17faeb8fa0c0747ad2f]
19:12:59*noonien quit (Quit: Connection closed for inactivity)
19:15:43*mitai joined #nim
19:17:13*yglukhov[i] quit (Ping timeout: 256 seconds)
19:18:43*yglukhov[i] joined #nim
19:22:50*fjvallarino joined #nim
19:35:15*yglukhov[i] quit (Remote host closed the connection)
19:47:15FromGitter<kaushalmodi> Can someone confirm if the ref object section in https://nim-by-example.github.io/types/objects/ is wrong?
19:47:33FromGitter<kaushalmodi> This part and the associated code is wrong: "Its mutability also means that mittens can be passed to functions that require a variable parameter."
19:47:51FromGitter<kaushalmodi> Fixed code should be: `mittens[].sleep()`
19:48:33FromGitter<kaushalmodi> In that example `mittens` is a ref.. so it cannot be passed directly to `sleep`.. its dereferenced obj instead needs to be
19:50:54FromGitter<tim-st> @Araq I read something about `vref` or similar will maybe added to nim, I think if too much is added to the language it can have negative effects. My impression is that one of the biggest strengths of nim is that's easy to read. When it becomes to complex people could also just use rust or so
19:51:08AraqI confirm it's misleading.
19:52:54Araqtim-st: I don't think I want 'vref' either but "easy to read" is not much of a language design concept.
19:53:50Araqit's subjective. what we can agree on though, is that Nim needs less complexity :-)
19:53:52*Vladar quit (Quit: Leaving)
19:54:01FromGitter<tim-st> I think "easy to read" -> "easy to code" -> "beeing productive" is quite a good point of a language and also one important reason e.g. for python beeing popular
19:54:15FromGitter<tim-st> ok
19:54:33FromGitter<OldhamMade> hey folks, just a quick FYI: I've built from `develop` and it looks like there still isn't nanosecond precision in `FileInfo.lastWriteTime` or `Stat.st_mtim`. looks like I'll have to wait for the next release
19:54:47AraqI couldn't read and adapt Python's RST parser back in the days and wrote my own.
19:55:09FromGitter<GULPF> @OldhamMade it depends on the OS
19:55:13Araqfor me anything that's dynamically typed is definitely not "easy to read".
19:55:51FromGitter<OldhamMade> @GULPF interesting. I'm on macOS High Sierra
19:56:09FromGitter<tim-st> yes, that's a downside of python, nims current syntax is very good imo, next to perfect
19:56:57AraqPython is successful because it has good libraries and it enabled good libraries by not being smug about e.g. operator overloading.
19:57:21ldleworkIt's object model is pretty straight-forward too
19:57:34ldleworkEasy to teach
19:58:09Araqnot really, how it does MI is "hard" to teach.
19:58:11FromGitter<tim-st> ok, these just where my thought on adding new keywords, of course maybe a few new ones could be useful
19:58:15FromGitter<GULPF> @OldhamMade here's the line that activates nanosecond resolution: https://github.com/nim-lang/Nim/blob/9ed671b2fe734d6294c1aadc1b495215a3e926db/lib/posix/posix.nim#L85
19:58:45ldleworkMI is not popular in Python
19:58:50Araqbut many can ignore Python's MI, sure.
19:58:56ldleworkAnd that's an edge case. The core object model is indeed very easy to teach.
19:59:42FromGitter<OldhamMade> @GULPF thanks, that's good to know. so, to clarify, even in `devel` there's no way to get sub-second precision for file modification times on macOS?
20:00:30FromGitter<GULPF> Not that I know of, no
20:01:14FromGitter<OldhamMade> ah. bummer.
20:03:28FromGitter<tim-st> @Araq c2nim cannot translate and skips `typedef struct X X;` can this always be translated to `type X`* = object`?
20:03:53FromGitter<tim-st> I dont know c so I dont understand what this does
20:04:07Araqyes.
20:04:13FromGitter<tim-st> ok, thanks!
20:05:30Araqldlework, do you have experience in teaching Python?
20:06:19*xkapastel quit (Quit: Connection closed for inactivity)
20:11:02FromGitter<kaushalmodi> devel broke the Nim emacs modules again
20:11:15FromGitter<kaushalmodi> I have: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33ef630168e70c08f44343]
20:11:37FromGitter<kaushalmodi> and then I use the template as: ⏎ ⏎ ```init(emacs, "modtest")``` [https://gitter.im/nim-lang/Nim?at=5b33ef79960fcd4eb928dd4d]
20:11:54FromGitter<kaushalmodi> and further.. ⏎ ⏎ ```emacs.foo ..``` [https://gitter.im/nim-lang/Nim?at=5b33ef8a7da8cd7c8c73538a]
20:11:57Araquse a .compileTime var outside the 'static' section
20:12:04Araqstatic now gets its own scope
20:12:22ldleworkAraq: yeah
20:13:21FromGitter<kaushalmodi> I moved that var before static.. now I get ⏎ ⏎ > Error: cannot evaluate at compile time: emacs
20:13:31ldleworkAraq: also C++ and x86 assembler
20:15:26Araqinteresting
20:19:33ldleworkto kids at a computer summer camp for a few weeks :)
20:20:04FromGitter<mratsim> how many candies do you need to go through that? xD
20:21:59ldleworkthey mostly gained sustenance through the DDR machine somehow
20:22:24FromGitter<mratsim> DDR like in Dance Dance Revolution?
20:22:28ldleworkYeah
20:25:21*Disavowed joined #nim
20:25:57DisavowedMorning all. I don't suppose anyone knows of a gRPC library for Nim? Haven't found anything so far
20:27:43FromGitter<kaushalmodi> Araq: I changed the above code snippet to below: ⏎ ⏎ ```template provide*(self: Emacs) {.dirty.} = ⏎ {.emit: self.provideString().}``` ⏎ ⏎ These changes don't look equivalent as now the C compilation fails. [https://gitter.im/nim-lang/Nim?at=5b33f33f960fcd4eb928e964]
20:27:45FromGitter<kaushalmodi> Help please
20:28:22FromGitter<mratsim> you should probably quote the self in the emit section
20:28:37FromGitter<mratsim> it won’t have the same symbol otherwise
20:29:08FromGitter<mratsim> make sure provideString is properly exportc, the thing is that the template doesn’t know about it so it will not be imported if it’s only called there
20:29:09*ashleyk joined #nim
20:29:42FromGitter<kaushalmodi> Thanks. I tried quoting `self`, still compilation fails.
20:29:57FromGitter<kaushalmodi> about provideString.. it used to work before without exportC too
20:29:58FromGitter<mratsim> why static + const? isn’t const enough?
20:30:53ashleykhello FromGitter
20:31:04FromGitter<mratsim> Hello ashleyk
20:31:06FromGitter<kaushalmodi> I am not the author of that module.. I am just adding a wrapper file in Nim to top
20:31:11FromGitter<mratsim> ah Isee
20:31:13FromGitter<kaushalmodi> @mratsim See https://github.com/kaushalmodi/nim-emacs-module/blob/wrappers/emacs_module/helpers.nim
20:31:32FromGitter<kaushalmodi> That helpers.nim was already there (I just renamed, moved, etc.)
20:33:59FromGitter<kaushalmodi> So.. if a var is `const`, I don't need `{.compileTime.}`, right? As `const` implies compile-time.
20:34:07FromGitter<mratsim> yes
20:34:32FromGitter<mratsim> compileTime is actually not needed, it was there for procs that operated on NimNode
20:35:13FromGitter<mratsim> but now it’s automatically implied depending on the type signature
20:36:20skrylarbleh. i hear things are broken
20:36:31skrylarwhen i get back to coding next week its time to put the jenkins back up ._.
20:36:44ashleyknice, nim has a case statement
20:36:49ashleykpython doesnt
20:37:25FromGitter<kaushalmodi> @mratsim Looks like I do need compileTime in https://gitter.im/nim-lang/Nim?at=5b33f33f960fcd4eb928e964
20:37:34FromGitter<kaushalmodi> The variable needs to be mutable
20:37:42FromGitter<kaushalmodi> but available at compile time
20:38:02FromGitter<kaushalmodi> .. talking about the `init` template in that example
20:38:31FromGitter<mratsim> use a macro
20:39:21FromGitter<mratsim> do the compile time part in the macro and do var foo = macroCall() in your nim file
20:40:16FromGitter<kaushalmodi> oh.. I am out of my Nim knowledge for now to do that.. :(
20:40:26*nsf quit (Quit: WeeChat 2.1)
20:41:32FromGitter<mratsim> it’s not that hard, take 2 hours and try it ;)
20:42:16skrylarit takes more than two hours when you get the thing built and it turns out half of the library doesn't work
20:42:21*skrylar leers at mratsim
20:42:41skrylar=P
20:42:50FromGitter<mratsim> what did I do Ó_Ó
20:46:28FromGitter<kaushalmodi> @mratsim If you or someone has time.. can you please advice how to write the equivalent code to what I had in the static blocks earlier?: https://github.com/kaushalmodi/nim-emacs-module/commit/774cee9bd20b365f67983b3a2d045203de01f8cc
20:46:49FromGitter<mratsim> I dont have time unfortunately.
20:46:52FromGitter<kaushalmodi> The above linked commit shows my unsuccessful attempt.. with that, now C compilation fails
20:46:55FromGitter<kaushalmodi> OK
20:47:22*miran quit (Ping timeout: 260 seconds)
20:47:33*Disavowed left #nim (#nim)
20:47:51AraqI think you've hit https://github.com/nim-lang/Nim/pull/6041
20:48:04Araqthat well... will happen anytime soon now...
20:56:50*cryptocat1094 quit (Quit: gtg)
20:58:00*zahary joined #nim
20:59:25FromGitter<ephja> krux02: it seems unlikely that they would actually remove opengl support in the forseeable future
21:01:19FromGitter<kaushalmodi> Araq: Reverting just https://github.com/nim-lang/Nim/commit/95436893061176d51b1c11fdf5418b3ed17a8455 did not fix the issue.. there's another breaking change in one of the PR's merged in last 24 hrs.. will need to bisect.
21:01:35FromGitter<kaushalmodi> With just that one commit reverted, I get C compilation errors: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33fb2f72b31d3691f94a2e]
21:02:09FromGitter<kaushalmodi> (I also reverted the nim-emacs-module project to previous working state as well)
21:07:56*oprypin quit (Quit: Bye)
21:08:39*oprypin joined #nim
21:22:21*avsej quit (Ping timeout: 240 seconds)
21:27:49*avsej joined #nim
21:27:49*avsej quit (Changing host)
21:27:49*avsej joined #nim
21:28:12ashleyki guess people actually use gitter.im to talk to irc
21:28:29*mitai quit (Ping timeout: 255 seconds)
21:28:38ashleykoh they are talking to eachother
21:32:07*xet7 joined #nim
21:35:49*yglukhov[i] joined #nim
21:37:04FromGitter<kaushalmodi> Araq: Coincidentally 2 consecutive PR merges caused the above issue for me. The other PR merge was the one just before that static scope change: https://github.com/nim-lang/Nim/commit/236bc06b5f1a1a1fc4a711007aed0b60b6656a4f @GULPF
21:38:08carterza[m]o/
21:40:12*yglukhov[i] quit (Ping timeout: 245 seconds)
21:56:37Araqkaushalmodi: I'll be busy the next days but we'll sort it out
21:58:55dom96Interesting.
21:59:07dom96I googled the `fractions` package that went missing
21:59:23dom96and another repo by that name was owned by `notTito` the other user that removed their account
22:05:21FromGitter<kaushalmodi> Araq: Thanks!
22:05:38FromGitter<kaushalmodi> For now, I am just reverting those 2 commits to make by.
22:23:15*elrood quit (Quit: Leaving)
22:26:10*xkapastel joined #nim
22:34:38FromGitter<kaushalmodi> I was finally able to fix the failure during to static scope change. Now I need to revert just https://github.com/nim-lang/Nim/commit/236bc06b5f1a1a1fc4a711007aed0b60b6656a4f.
22:53:29*mitai joined #nim
23:00:24*xet7 quit (Quit: Leaving)
23:03:37*cspar_ joined #nim
23:04:15FromGitter<Quelklef> Is there a terser lambda syntax besides `proc(a: A, b: B): C = ...`?
23:05:37FromGitter<mratsim> (A, B) -> C: in future/sugar module
23:06:13FromGitter<Quelklef> ooooh, really?
23:06:27FromGitter<Quelklef> fantastic, thanks!
23:07:01FromGitter<mratsim> also checks the => symbol like here: https://github.com/mratsim/nim-projecteuler/blob/master/src/pe002_even_fibonacci_numbers.nim#L15
23:07:10FromGitter<Quelklef> Wait, is this implemented as a macro `=>`?
23:07:27FromGitter<mratsim> there is -> for function signature and => for closure implementation
23:07:41FromGitter<Quelklef> elaborate?
23:07:50FromGitter<Quelklef> But I meant it's implemented totally "inside" Nim
23:07:55FromGitter<mratsim> yes
23:08:01FromGitter<mratsim> it’s implemented as macro
23:08:04FromGitter<Quelklef> super cool
23:08:06FromGitter<mratsim> function signature: https://github.com/vegansk/nimfp/blob/master/src/fp/stream.nim#L18
23:08:17FromGitter<Quelklef> Ah I see
23:08:22FromGitter<mratsim> closure: https://github.com/vegansk/nimfp/blob/master/src/fp/stream.nim#L41
23:08:40FromGitter<Quelklef> cool cool cool
23:08:57FromGitter<kaushalmodi> I was going to suggest anonymous procs and do notation, but this is better.. need to check out sugar.
23:10:18FromGitter<Quelklef> Now all we need is nice partial application...
23:10:28*ashleyk_ joined #nim
23:11:49FromGitter<Quelklef> how about something like `echo%("before", _, "after")`
23:12:22FromGitter<Quelklef> a macro operator `%` (or whatever) which recognizes the identifier `_` as a "blank space"
23:12:35*ashleyk quit (Ping timeout: 250 seconds)
23:12:39FromGitter<Quelklef> so this would be expanded to `a => echo("before", a, "after")`
23:16:03*ashleyk_ quit (Ping timeout: 250 seconds)
23:25:12*data-man quit (Ping timeout: 245 seconds)
23:26:19FromGitter<mratsim> if you search for nim + curry you will find example, even from Araq iirc
23:26:44FromGitter<mratsim> ah you’re not looking for curry
23:29:42*gangstacat quit (Ping timeout: 256 seconds)
23:33:21*find0x90 joined #nim
23:37:49*yglukhov[i] joined #nim
23:38:51*gangstacat joined #nim
23:41:57*yglukhov[i] quit (Ping timeout: 240 seconds)
23:47:07*mitai42 joined #nim
23:47:11*fjvallarino quit (Remote host closed the connection)
23:47:38*fjvallarino joined #nim
23:50:10*mitai quit (Ping timeout: 264 seconds)
23:52:22*fjvallarino quit (Ping timeout: 256 seconds)
23:53:53*dddddd quit (Read error: Connection reset by peer)
23:56:23*fjvallarino joined #nim
23:56:28FromGitter<Quelklef> Should range checking be done in -d:release?