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:21 | FromGitter | <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:42 | user1101 | Hello 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:28 | shashlick | Yes you can exportc and have other languages interop |
03:08:21 | shashlick | https://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:15 | Tanger | Hey 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:07 | Tanger | Version 0.18.0 as well |
05:50:51 | FromGitter | <Varriount> Tanger: What platform are you using? |
05:51:41 | Tanger | Varriount: Ubuntu 14.04.1 |
05:53:00 | FromGitter | <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:12 | Tanger | Varriount: Runtime. It's being called inside a unittest test, if that makes a difference |
06:15:27 | Tanger | I do open the MemFile object in setup(). And it is inside a when isMainModule block. |
06:16:56 | FromGitter | <Varriount> Hm, |
06:19:23 | FromGitter | <Varriount> Tanger: Are you using the latest development version of the compiler? |
06:21:15 | Tanger | Varriount: Currently using the stable 0.18 via choosenim |
06:21:28 | Tanger | *stable channel |
06:22:16 | * | chopzwei joined #nim |
06:26:17 | * | yglukhov[i] joined #nim |
06:31:49 | FromGitter | <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:57 | FromGitter | <Varriount> Tanger? |
06:42:27 | * | arecaceae joined #nim |
06:44:49 | Tanger | Varriount: Sorry. Good idea. How would you recommend I go about doing that? |
06:47:49 | Tanger | Nevermind, strace is probably the way to go |
06:52:19 | Tanger | Varriount: https://pastebin.com/Vtp41BEu |
06:53:05 | Tanger | It looks like the actual system calls failing are mmap and lseek |
06:53:42 | Tanger | lseek I assume because mmap is failing to allocate any memory |
07:05:54 | * | Vladar joined #nim |
07:09:10 | * | jjido joined #nim |
07:16:35 | Tanger | Hmmm, could be as described in the mmap man page - "EINVAL (since Linux 2.6.12) length was 0." |
07:16:46 | Tanger | http://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:50 | Tanger | Ok, 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:46 | FromGitter | <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:38 | Tanger | Varriount: 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:16 | FromGitter | <kindlychung> ```template `|=`(a, b: untyped) = ⏎ not (a == b) ⏎ ⏎ echo &"2 != 3? {2 |= 3}"``` [https://gitter.im/nim-lang/Nim?at=5b334a64be98b142240cae92] |
08:32:54 | Araq | template `|=`(a, b: untyped): bool |
08:33:05 | FromGitter | <kindlychung> Ok, thanks. |
08:36:32 | Araq | btw Nim has != for unequality |
08:52:10 | FromGitter | <kindlychung> @Araq Yeah, I was just learning about templates. :) |
08:53:51 | FromGitter | <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:55 | FromGitter | <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:59 | FromGitter | <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:56 | FromGitter | <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:23 | FromGitter | <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:22 | leorize | codenoid: yes, you can |
11:08:38 | FromGitter | <codenoid> how, i'm new about STDIN inside executable app |
11:10:01 | leorize | use startProcess to create a Process object |
11:10:04 | leorize | https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] |
11:10:24 | leorize | then grab it's inputStream |
11:10:27 | leorize | https://nim-lang.org/docs/osproc.html#inputStream,Process |
11:11:21 | leorize | then 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:24 | FromGitter | <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:46 | Araq | yeah, what about it |
13:29:33 | FromGitter | <mratsim> ugh, Gitter ate my indentation |
13:31:18 | * | fjvallarino quit (Remote host closed the connection) |
13:31:25 | * | fjvallarino joined #nim |
13:31:27 | FromGitter | <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:35 | FromGitter | <kaushalmodi> Can we have 2 or more? |
13:32:49 | Araq | yeah, via 'do:' |
13:33:52 | FromGitter | <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:18 | dom96 | Ugh |
13:35:32 | FromGitter | <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:34 | dom96 | People are suddenly deciding to remove their GitHub accounts |
13:35:50 | miran | dom96: people? plural? |
13:35:53 | dom96 | yes |
13:35:57 | dom96 | Second person so far |
13:36:11 | Araq | can we fork every nimble package already? |
13:36:23 | dom96 | yes, we can |
13:36:29 | miran | heh, Araq took the words from my mouth |
13:36:36 | Araq | let's do it. |
13:36:47 | dom96 | Someone just has to write a script that does it |
13:36:56 | FromGitter | <mratsim> do they put back their repo somewhere else? |
13:37:22 | dom96 | I dunno, but I'm going to make the packages CI more lenient |
13:37:31 | Yardanico | dom96, well, it means that they don't know that they can mirror gitlab repos to github |
13:37:35 | Yardanico | as nesm creator did |
13:37:42 | Yardanico | (https://github.com/xomachine/NESM) |
13:37:51 | dom96 | Yardanico: Or... they did mirror them, but deleted their account anyway |
13:37:57 | dom96 | and forgot that they need to update nimble |
13:38:10 | dom96 | https://github.com/konqoro/fractions |
13:38:12 | dom96 | That's the repo |
13:38:22 | FromGitter | <tim-st> Does someone know an answer to my question about nimcache? it doesnt seem to know when it has to rebuild... |
13:38:51 | Yardanico | don't use shared nimcache folder |
13:39:03 | Yardanico | it won't really give you any advantages because nim uses dead code elimination |
13:39:32 | FromGitter | <tim-st> yardanico: I though it's about reusing compiled *.o files? |
13:39:40 | Yardanico | so 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:10 | FromGitter | <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:37 | Araq | dom96: ok, who writes this script? shashlick? |
13:43:57 | dom96 | whoever is willing to write it |
13:45:01 | Araq | so ... not you |
13:45:10 | Yardanico | wait, why would we want to fork every nimble package? |
13:45:20 | Yardanico | we will need to update them then |
13:45:23 | FromGitter | <tim-st> what do other languages do about this? isnt this normal that people can delete their packages if they want? |
13:45:43 | Yardanico | we don't have a proper package index (with website and accounts) |
13:45:55 | Yardanico | and you can delete your package with a PR to the packages repo |
13:46:12 | dom96 | AFAIK npm et al. don't allow packages to be deleted |
13:46:33 | FromGitter | <Vindaar> @tim-st depending on the license of the code, it should be perfectly fine to do just that |
13:46:33 | Araq | smart. :-) |
13:46:47 | nkaramolegos[m] | Hello guys. Did you see my message? |
13:46:56 | dom96 | Indeed, it's not just a case of "Fork all packages" |
13:47:02 | dom96 | You need to keep them up to date |
13:47:05 | dom96 | which is a PITA in itself |
13:47:16 | Yardanico | yeah |
13:47:23 | miran | nkaramolegos[m]: from when? there was nothing in the last 10-15min on IRC from you |
13:47:24 | Yardanico | nkaramolegos[m], yes, matrix-irc bridge works |
13:47:36 | Yardanico | but we saw only your last message |
13:48:28 | Araq | well the "fork" would only be a fallback |
13:48:36 | FromGitter | <tim-st> https://opensource.stackexchange.com/questions/1154/how-does-githubs-forking-right-cope-with-an-all-rights-reserved-project |
13:48:50 | Araq | I'm not saying it's a viable long-term strategy |
13:48:57 | * | btbytes quit (Ping timeout: 264 seconds) |
13:49:28 | dom96 | A 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:58 | nkaramolegos[m] | miran: Let me send the message again |
13:49:59 | miran | dom96: sounds like a (private) gitlab, no? |
13:50:20 | dom96 | yes |
13:50:38 | Yardanico | how does crystal or rust do this? |
13:50:46 | FromGitter | <mratsim> or nimble pull the installable files regularly. |
13:51:47 | Araq | dom96: isn't that muhc work to setup? |
13:51:52 | FromGitter | <mratsim> tests should be ignored though |
13:52:03 | miran | nkaramolegos[m]: i see your message, loud and clear |
13:52:08 | dom96 | Araq: Sure, but so is forking and updating each package |
13:52:19 | dom96 | mratsim: 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:36 | miran | update only on new nim releases? :) |
13:53:05 | dom96 | Really wish Matrix would format long messages better |
13:53:08 | FromGitter | <mratsim> @dom96, every day you have something that pull every install files of packages in package.json. |
13:53:29 | dom96 | mratsim: yes, that's the other approach, but it's worse than having the author push |
13:53:42 | dom96 | and I wouldn't be surprised if GitHub bans us for that |
13:54:21 | dom96 | Yardanico: Pretty sure Crystal does the same as us |
13:54:28 | FromGitter | <mratsim> having author push means even more friction though |
13:54:29 | dom96 | Rust has its own package website where you upload packages AFAIK |
13:55:09 | Yardanico | https://crates.io/ |
13:55:31 | Yardanico | https://doc.rust-lang.org/cargo/reference/publishing.html |
13:55:50 | Yardanico | yeah, author should upload newer version manually |
13:56:30 | Araq | well we're dealing here with unresponsible authors |
13:56:47 | Araq | can't tell these guys to "upload yourself" |
13:57:30 | FromGitter | <mratsim> or maybe there is a malware that targets Nim devs <insert conspiracy theory> |
13:57:54 | dom96 | I'm guessing people are leaving because of the MS acquisition |
13:58:06 | Yardanico | dom96, imo this is stupid |
13:58:21 | miran | Yardanico: ofcourse it is |
13:58:22 | dom96 | I agree |
13:58:40 | FromGitter | <tim-st> github and ms both are similiar companies |
13:58:56 | Araq | they are free to do that, but not updating the nimble entry to gitlab or whatever else is just mean |
13:58:58 | dom96 | but people will always find reasons to delete their repos or accounts |
13:59:25 | Araq | it's not our fault github got bought by MS... |
14:00:08 | dom96 | nkaramolegos[m]: seems like a very Greek-centered event |
14:00:50 | dom96 | Araq: Indeed, and in fact we're happy for packages to come from any provider |
14:01:12 | dom96 | (there are some niche ones which is also another reason why we should back everything up) |
14:01:13 | cryptocat1094 | A private repo is not particularly hard to deal with... git was kind of make with that in mind |
14:01:20 | cryptocat1094 | *made |
14:01:34 | Araq | dom96: agreed. |
14:01:40 | dom96 | Indeed. I do agree that there is more friction though |
14:01:46 | miran | dom96: a bit offtopic - how many responders to the survey so far? |
14:02:18 | dom96 | 335 |
14:02:25 | miran | noice! |
14:02:32 | cryptocat1094 | Survey? |
14:02:35 | Yardanico | cryptocat1094, yes? |
14:02:46 | dom96 | https://nim-lang.org/blog/2018/06/23/community-survey-2018.html |
14:02:49 | Yardanico | cryptocat1094, didn't you see an article on nim website ? :) |
14:03:46 | FromGitter | <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:12 | Araq | yeah, the manual is misleading |
14:04:34 | Araq | and it's hard to put it in words |
14:04:38 | Yardanico | @kaushalmodi said: |
14:04:41 | Yardanico | But I don't know what to PR?\nJust remove that sentence? |
14:04:55 | Yardanico | (gitter doesn't send some messages to the API so FromGitter can't relay them) |
14:05:13 | Yardanico | also @mratsim's message didn't go through |
14:05:41 | FromGitter | <kaushalmodi> Yardanico: Curious.. how do you figure that out.. do you have a live diff ongoing between Gitter/IRC? |
14:06:10 | Yardanico | @kaushalmodi well, I have a browser and an IRC :) |
14:06:53 | Araq | Nim 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:47 | FromGitter | <kaushalmodi> Also, based on brief experimentation, backquoting seems optional at few places in templates |
14:08:21 | Araq | well "nothing to do" ... not much else works for a list of statements |
14:08:37 | Araq | but that's a type checking issue, not a syntactic issue. |
14:08:57 | FromGitter | <kaushalmodi> About optional backquotes: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b339a795862c35f47cccaa7] |
14:09:04 | Araq | do my words clear things up or make everything more confusing? ;-) |
14:11:13 | FromGitter | <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:24 | FromGitter | <Araq> well that sentence is correct, but better without the reference to 'template' |
14:13:46 | FromGitter | <Araq> to a macro. |
14:14:55 | FromGitter | <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:51 | FromGitter | <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:04 | Gnjurac | i did survawy too |
14:19:25 | FromGitter | <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:22 | FromGitter | <Araq> I always wanted to describe Nim with two HTML tables... |
14:21:30 | * | cspar_ joined #nim |
14:24:15 | FromGitter | <Araq> maybe I'll write yet-another introduction into the language. |
14:25:26 | FromGitter | <Araq> yeah. :P |
14:29:31 | * | cryptocat1094 joined #nim |
14:32:05 | FromGitter | <Vindaar> @Araq There can never be too many introductions written by you ;) |
14:34:39 | Araq | crap. I forgot about the match. |
14:36:06 | FromGitter | <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:44 | FromGitter | <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:18 | FromGitter | <Araq> there are no "named" blocks. you can pass a block to a "routine" |
14:40:53 | FromGitter | <kaushalmodi> Yes, I was confusing `foo:` with that.. |
14:42:38 | FromGitter | <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:44 | FromGitter | <mratsim> why call? just “to a template” is enough no? |
14:46:07 | FromGitter | <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:05 | FromGitter | <kaushalmodi> Done in https://github.com/nim-lang/Nim/pull/8133. |
14:56:33 | miran | btw, should the changes to the manual like this one be merged to devel or master? |
14:57:41 | FromGitter | <Araq> devel. |
14:58:04 | miran | ok |
14:59:05 | * | Vladar quit (Quit: Leaving) |
15:01:28 | FromGitter | <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:19 | FromGitter | <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:26 | FromGitter | <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:24 | skrylar | just 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:45 | skrylar | was re-reading and poking it earlier and they are hit pretty hard by high-ram use middleware |
15:15:05 | FromGitter | <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:45 | FromGitter | <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:49 | FromGitter | <kaushalmodi> As an aside, the Nim tutorials, manual, etc. site are nicely readable in Emacs eww browser :) |
15:20:35 | Araq | eww |
15:20:44 | * | Vladar joined #nim |
15:21:45 | FromGitter | <kaushalmodi> yeah.. funny acronym |
15:24:59 | * | xkapastel joined #nim |
15:26:56 | FromGitter | <Vindaar> @kaushalmodi Do you have an example as to when and how you'd use such a template with multiple bodies? |
15:29:24 | FromGitter | <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:04 | FromGitter | <mratsim> I use multiple body template in Arraymancer: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/aggregate.nim#L89 |
15:32:29 | FromGitter | <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:22 | Araq | no, you can *never* leave out the return type. for templates or anything else. |
15:33:51 | FromGitter | <ephja> yeah I think libsoundio does spawn a thread. the inattentive brain strikes again :p |
15:33:56 | Araq | unless it's 'void' |
15:38:15 | * | lompik joined #nim |
15:41:30 | * | yglukhov[i] joined #nim |
15:42:04 | FromGitter | <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:37 | FromGitter | <mratsim> untyped always work |
15:48:19 | oprypin | i'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:32 | FromGitter | <kaushalmodi> @mratsim Thanks. That's what I derived :) |
15:49:14 | Yardanico | oprypin, 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:41 | oprypin | sigh, 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:17 | FromGitter | <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:15 | FromGitter | <Quelklef> As in, not precise enough? |
16:38:55 | FromGitter | <Quelklef> I'm not sure, but my bet is that the time is only stored to the second |
16:40:11 | FromGitter | <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:43 | FromGitter | <mratsim> Yes use devel it has nanoseconds presolution: https://github.com/nim-lang/Nim/blob/devel/lib/pure/times.nim#L102 |
16:41:01 | FromGitter | <mratsim> resolution* |
16:42:10 | FromGitter | <OldhamMade> @Quelklef yeah, according to the docs `FileInfo` shows `lastWriteTime*: times.Time`, which one would expect to have millisecond precision |
16:42:29 | ldlework | Are there any Nim "killer apps" or libraries I can share that come to mind? |
16:42:53 | cryptocat1094 | `yes` is pretty neat. :p |
16:43:01 | dom96 | Nim forum? |
16:43:26 | Yardanico | ldlework, nim compiler :) |
16:43:34 | FromGitter | <mratsim> This: https://onsetgame.com/ |
16:43:39 | Yardanico | arraymancer also |
16:44:00 | FromGitter | <Quelklef> @OldhamMade my bad then |
16:44:21 | ldlework | dom96: the counter example posited to me was ripgrep |
16:44:25 | cryptocat1094 | It's a bit odd for a forum. What with the discourse-like hierarchy-less architecture. |
16:44:32 | FromGitter | <mratsim> @Idlework Reel Valley is written in Nim: https://play.google.com/store/apps/details?id=com.onsetgame.reelvalley&hl=en_US |
16:44:55 | FromGitter | <mratsim> available as a Facebook Game as well: https://www.facebook.com/reelvalley/ |
16:45:29 | dom96 | ldlework: nimgrep? lol |
16:45:37 | ldlework | dom96: is it as fast as ripgrep? |
16:45:47 | dom96 | Doubt it |
16:45:49 | ldlework | apparently ripgrep is the fastest grip to date |
16:45:54 | ldlework | grep* |
16:46:09 | FromGitter | <Quelklef> Woah, @mratsim, compiled to what? I thought Android apps were in Java? |
16:46:17 | FromGitter | <mratsim> C |
16:46:21 | ldlework | Anyway, I was just curious. |
16:46:27 | dom96 | Doubt that's thanks to Rust, more thanks to how much effort the author put into optimising it |
16:46:46 | dom96 | mratsim: is it not C++? |
16:46:50 | dom96 | AFAIK the Android NDK is C++ |
16:46:51 | FromGitter | <mratsim> BurntSushi is an awesome optimizer |
16:47:09 | FromGitter | <mratsim> or maybe C++, but you don’t compile Nim to Java ;) |
16:47:50 | FromGitter | <kaushalmodi> @mratsim Maybe BurntSushi should try out Nim some day.. and then we have *nipgrep*! |
16:48:38 | ldlework | dom96: 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:41 | dom96 | IIRC I did see BurnSushi in here a couple of years ago :) |
16:48:41 | FromGitter | <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:42 | cryptocat1094 | Rust helps because of some better abstractions than C (not a high bar). |
16:48:47 | dom96 | *BurntSushi |
16:49:21 | Yardanico | ah yes, about rust - they'll add high-level additions to the stdlib to use SIMD instructions |
16:49:23 | Yardanico | which is pretty neat |
16:50:25 | Yardanico | atm it's only unsafe |
16:50:34 | * | fjvallarino quit (Remote host closed the connection) |
16:50:36 | FromGitter | <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:37 | cryptocat1094 | "lock-free parallel recursive directory iterator" if it's not IO-starved, that would also help. |
16:50:49 | Yardanico | https://blog.rust-lang.org/2018/06/21/Rust-1.27.html simd section here |
16:50:51 | FromGitter | <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:20 | Yardanico | we need to compare nim-regex to rust's regex lib :) |
16:51:30 | FromGitter | <mratsim> @ephja, cast\ptr uncheckedArray\ (fooPtr) ? |
16:51:39 | FromGitter | <mratsim> with uppercase U |
16:52:27 | FromGitter | <mratsim> UncheckedArray should probably appear in a “Nim for the low-level” developer |
16:52:53 | FromGitter | <mratsim> It’s asked often and I’m pretty sure there is no doc about it |
16:53:51 | FromGitter | <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:32 | FromGitter | <ephja> that should do. I was only looking at the unchecked pragma |
16:55:20 | * | fjvallarino quit (Ping timeout: 255 seconds) |
16:57:00 | FromGitter | <OldhamMade> out of interest, is there anyway to get a more precise lastWriteTime for a file using Nim 0.18.0? |
16:57:58 | FromGitter | <ephja> speaking of which, maybe there should be a distinction between pointers to individual values and pointers to arrays when allocating. |
16:57:58 | Yardanico | probably by using some stuff from posix module? |
17:00:18 | * | fjvallarino joined #nim |
17:01:20 | FromGitter | <OldhamMade> @Yardanico ah, yes -- I'm already using Stat somewhere, that might have something more precise. thanks! |
17:01:23 | FromGitter | <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:47 | Yardanico | @OldhamMade oh, so ll is yours :) |
17:06:20 | FromGitter | <tim-st> Can I use c2nim to create a nim wrapper directly from a dll like `c2nim lib.dll > lib.nim`? |
17:06:47 | FromGitter | <tim-st> there is a windows tool that can read api from a dll file so it should be possible |
17:08:08 | FromGitter | <ephja> alright, more old issues resolved! |
17:10:03 | FromGitter | <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:25 | Yardanico | @OldhamMade btw, why are you using makefile at the same time with nimble? |
17:10:38 | FromGitter | <OldhamMade> laziness :D |
17:10:58 | * | vivus quit (Quit: Leaving) |
17:11:04 | FromGitter | <OldhamMade> actually, it's because I occasionally run local Travis docker images to test failing builds |
17:11:36 | FromGitter | <OldhamMade> and not being too familiar with Nim and nimble files, it was a quick way to get started |
17:12:03 | FromGitter | <OldhamMade> also, `make` his hardwired into my hands. |
17:13:07 | FromGitter | <OldhamMade> @kaushalmodi haven't heard about exa, do you have a link? |
17:16:44 | FromGitter | <kaushalmodi> https://the.exa.website/ |
17:17:27 | FromGitter | <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:34 | FromGitter | <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:49 | FromGitter | <kaushalmodi> Look into private imports in Nimble. |
17:20:54 | FromGitter | <OldhamMade> that's not a bad idea, actually |
17:21:07 | ldlework | btw, the answer I came up with was the GC |
17:21:11 | ldlework | heh *shrug* |
17:22:24 | FromGitter | <kaushalmodi> @OldhamMade Yeah, just a thought. You'll need to check if devel/time works independently on stable. |
17:24:49 | FromGitter | <OldhamMade> @kaushalmodi hmm... might end up going down a rabbit-hole; bringing that in might mean I need to copy other modules. |
17:25:07 | FromGitter | <OldhamMade> anyone know if there's a timeline for the next release? |
17:25:10 | Yardanico | not really |
17:25:26 | Yardanico | why not just use devel for now? :) |
17:25:55 | FromGitter | <OldhamMade> don't think devel is available via `asdf` |
17:26:05 | Yardanico | asdf? |
17:26:26 | FromGitter | <kaushalmodi> Yardanico: It's a CLI utility to update things |
17:26:29 | FromGitter | <OldhamMade> https://github.com/asdf-vm/asdf |
17:26:36 | Yardanico | well, make a PR to add devel nim then :) |
17:26:44 | Yardanico | or compile manually, it's very easy |
17:26:48 | Yardanico | or use choosenim |
17:26:56 | FromGitter | <kaushalmodi> @OldhamMade You don't need asdf.. just clone the Nim repo, checkout devel and copy the pure time.nim file. |
17:27:26 | FromGitter | <OldhamMade> I'll give it a shot. |
17:27:54 | FromGitter | <OldhamMade> and adding a `devel` option to `asdf` might be a nice way to feed back to that project, too |
17:32:52 | FromGitter | <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:24 | FromGitter | <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:34 | FromGitter | <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:34 | FromGitter | <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:14 | FromGitter | <mratsim> you can just pass includes.h though no? |
17:39:29 | FromGitter | <tim-st> I tried that it had parsing errors |
17:39:37 | FromGitter | <tim-st> I think it cannot parse two `##` |
17:40:15 | FromGitter | <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:50 | FromGitter | <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:12 | FromGitter | <kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33cd6472b31d3691f8d371] |
17:46:24 | FromGitter | <OldhamMade> @kaushalmodi feel free to send feedback my way; I'm always looking for ways to improve my code! :D |
17:46:39 | FromGitter | <kindlychung> I am trying to write a macro that achieves something like `echo &"x == 42? {x == 42}"`. |
17:46:49 | FromGitter | <kindlychung> but can't seem to get it to work. |
17:47:08 | FromGitter | <kindlychung> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
17:47:41 | FromGitter | <kindlychung> Could anyone help? |
17:47:45 | Yardanico | @kindlychung you want something like "dump" from "future" module? |
17:47:57 | FromGitter | <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:05 | FromGitter | <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:33 | FromGitter | <kaushalmodi> *I happen to have delved into improving the `terminal` module on devel very recently.* |
17:48:50 | FromGitter | <kaushalmodi> @OldhamMade 👍 |
17:48:59 | FromGitter | <kindlychung> @Yardanico Thanks. Didn't know that. |
17:49:21 | FromGitter | <kindlychung> But I still would like to finish this macro, just as an exercise. |
17:49:25 | FromGitter | <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:32 | FromGitter | <kindlychung> I am very close to make it work. |
17:49:55 | FromGitter | <kindlychung> Just don't know how to get the value of `value`. |
17:50:13 | FromGitter | <Yardanico> @kindlychung what should you macro do and how would you want to use it? |
17:50:58 | FromGitter | <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:02 | FromGitter | <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:19 | FromGitter | <Yardanico> @Quelklef it means noSideEffects in devel |
17:51:30 | FromGitter | <Quelklef> @Yardanico I'm on devel :\ |
17:51:47 | FromGitter | <kindlychung> Given a variable and a value, print something like `&"x == value? {x == value}` |
17:51:55 | FromGitter | <kindlychung> @Yardanico |
17:51:58 | FromGitter | <Quelklef> Do I not understand `rand`, or is this a bug? |
17:52:10 | FromGitter | <Yardanico> @kindlychung so how would you call it? checkEqual(x, value) ? |
17:52:18 | FromGitter | <kindlychung> yes. |
17:53:02 | Yardanico | well, 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:46 | FromGitter | <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:07 | FromGitter | <kindlychung> In short, I am looking for something like the unquote form in clojure. |
17:58:54 | * | PMunch joined #nim |
18:00:43 | FromGitter | <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:52 | FromGitter | <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:56 | FromGitter | <Quelklef> Wait, is a `func f(x: var X)` |
18:14:11 | FromGitter | <Quelklef> i.e. does `func` guarantee total purity, or only purity on non-`var` variables? |
18:15:42 | FromGitter | <tim-st> c2nim now gets most working, but for example this is just skipped: `typedef struct MDB_env MDB_env;` |
18:15:57 | FromGitter | <tim-st> honestly I dont know myself what this definition means :\ |
18:15:58 | FromGitter | <Quelklef> Apprently `{.noSideEffect.}` only complains about anything outside of the function signature. Cool! |
18:15:59 | FromGitter | <GULPF> `func` is not about purity, it's about `{.noSideEffects.}` |
18:16:12 | FromGitter | <Quelklef> yeah @GULPF I got it. I really like how it's set up! |
18:18:22 | FromGitter | <Quelklef> Although file IO seems to not be marked as a side effect? |
18:18:40 | FromGitter | <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:35 | FromGitter | <tim-st> ah, it's called an opaque type.. |
18:20:39 | FromGitter | <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:51 | FromGitter | <Yardanico> @kindlychung probably something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33d9f77d3bca737a0f4a7e] |
18:40:16 | FromGitter | <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:14 | FromGitter | <Varriount> @Yardanico Don't forget the `quote` helper. |
18:46:20 | Yardanico | I know about it |
18:46:35 | Yardanico | but @kindlychung probably wanted to use "traditional" style |
18:47:59 | FromGitter | <kindlychung> Hm, does the `$` in `$value` differ from the `$` in `$varName`? |
18:51:25 | * | jsn-_ is now known as jsn- |
18:51:33 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33dcb56ceffe4eba3888ad] |
18:55:40 | FromGitter | <kindlychung> Yeah, that's easier to understand. Thanks! |
18:56:22 | FromGitter | <kindlychung> The template is nice! |
18:58:00 | Yardanico | !eval import future; let x = 1; echo dump(x == 1) |
18:58:01 | NimBot | Compile failed: in.nim(1, 37) Error: type mismatch: got <void> |
18:58:04 | Yardanico | !eval import future; let x = 1; dump(x == 1) |
18:58:06 | NimBot | x == 1 = true |
18:58:31 | FromGitter | <kindlychung> 👍 |
18:58:55 | FromGitter | <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:28 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33dfbc5862c35f47cd9dfe] |
19:04:35 | * | fjvallarino quit (Ping timeout: 240 seconds) |
19:04:45 | FromGitter | <Yardanico> https://nim-lang.org/docs/macros.html#quote,typed,string |
19:08:59 | * | cspar_ quit (Ping timeout: 255 seconds) |
19:11:59 | FromGitter | <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:15 | FromGitter | <kaushalmodi> Can someone confirm if the ref object section in https://nim-by-example.github.io/types/objects/ is wrong? |
19:47:33 | FromGitter | <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:51 | FromGitter | <kaushalmodi> Fixed code should be: `mittens[].sleep()` |
19:48:33 | FromGitter | <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:54 | FromGitter | <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:08 | Araq | I confirm it's misleading. |
19:52:54 | Araq | tim-st: I don't think I want 'vref' either but "easy to read" is not much of a language design concept. |
19:53:50 | Araq | it's subjective. what we can agree on though, is that Nim needs less complexity :-) |
19:53:52 | * | Vladar quit (Quit: Leaving) |
19:54:01 | FromGitter | <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:15 | FromGitter | <tim-st> ok |
19:54:33 | FromGitter | <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:47 | Araq | I couldn't read and adapt Python's RST parser back in the days and wrote my own. |
19:55:09 | FromGitter | <GULPF> @OldhamMade it depends on the OS |
19:55:13 | Araq | for me anything that's dynamically typed is definitely not "easy to read". |
19:55:51 | FromGitter | <OldhamMade> @GULPF interesting. I'm on macOS High Sierra |
19:56:09 | FromGitter | <tim-st> yes, that's a downside of python, nims current syntax is very good imo, next to perfect |
19:56:57 | Araq | Python is successful because it has good libraries and it enabled good libraries by not being smug about e.g. operator overloading. |
19:57:21 | ldlework | It's object model is pretty straight-forward too |
19:57:34 | ldlework | Easy to teach |
19:58:09 | Araq | not really, how it does MI is "hard" to teach. |
19:58:11 | FromGitter | <tim-st> ok, these just where my thought on adding new keywords, of course maybe a few new ones could be useful |
19:58:15 | FromGitter | <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:45 | ldlework | MI is not popular in Python |
19:58:50 | Araq | but many can ignore Python's MI, sure. |
19:58:56 | ldlework | And that's an edge case. The core object model is indeed very easy to teach. |
19:59:42 | FromGitter | <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:30 | FromGitter | <GULPF> Not that I know of, no |
20:01:14 | FromGitter | <OldhamMade> ah. bummer. |
20:03:28 | FromGitter | <tim-st> @Araq c2nim cannot translate and skips `typedef struct X X;` can this always be translated to `type X`* = object`? |
20:03:53 | FromGitter | <tim-st> I dont know c so I dont understand what this does |
20:04:07 | Araq | yes. |
20:04:13 | FromGitter | <tim-st> ok, thanks! |
20:05:30 | Araq | ldlework, do you have experience in teaching Python? |
20:06:19 | * | xkapastel quit (Quit: Connection closed for inactivity) |
20:11:02 | FromGitter | <kaushalmodi> devel broke the Nim emacs modules again |
20:11:15 | FromGitter | <kaushalmodi> I have: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b33ef630168e70c08f44343] |
20:11:37 | FromGitter | <kaushalmodi> and then I use the template as: ⏎ ⏎ ```init(emacs, "modtest")``` [https://gitter.im/nim-lang/Nim?at=5b33ef79960fcd4eb928dd4d] |
20:11:54 | FromGitter | <kaushalmodi> and further.. ⏎ ⏎ ```emacs.foo ..``` [https://gitter.im/nim-lang/Nim?at=5b33ef8a7da8cd7c8c73538a] |
20:11:57 | Araq | use a .compileTime var outside the 'static' section |
20:12:04 | Araq | static now gets its own scope |
20:12:22 | ldlework | Araq: yeah |
20:13:21 | FromGitter | <kaushalmodi> I moved that var before static.. now I get ⏎ ⏎ > Error: cannot evaluate at compile time: emacs |
20:13:31 | ldlework | Araq: also C++ and x86 assembler |
20:15:26 | Araq | interesting |
20:19:33 | ldlework | to kids at a computer summer camp for a few weeks :) |
20:20:04 | FromGitter | <mratsim> how many candies do you need to go through that? xD |
20:21:59 | ldlework | they mostly gained sustenance through the DDR machine somehow |
20:22:24 | FromGitter | <mratsim> DDR like in Dance Dance Revolution? |
20:22:28 | ldlework | Yeah |
20:25:21 | * | Disavowed joined #nim |
20:25:57 | Disavowed | Morning all. I don't suppose anyone knows of a gRPC library for Nim? Haven't found anything so far |
20:27:43 | FromGitter | <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:45 | FromGitter | <kaushalmodi> Help please |
20:28:22 | FromGitter | <mratsim> you should probably quote the self in the emit section |
20:28:37 | FromGitter | <mratsim> it won’t have the same symbol otherwise |
20:29:08 | FromGitter | <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:42 | FromGitter | <kaushalmodi> Thanks. I tried quoting `self`, still compilation fails. |
20:29:57 | FromGitter | <kaushalmodi> about provideString.. it used to work before without exportC too |
20:29:58 | FromGitter | <mratsim> why static + const? isn’t const enough? |
20:30:53 | ashleyk | hello FromGitter |
20:31:04 | FromGitter | <mratsim> Hello ashleyk |
20:31:06 | FromGitter | <kaushalmodi> I am not the author of that module.. I am just adding a wrapper file in Nim to top |
20:31:11 | FromGitter | <mratsim> ah Isee |
20:31:13 | FromGitter | <kaushalmodi> @mratsim See https://github.com/kaushalmodi/nim-emacs-module/blob/wrappers/emacs_module/helpers.nim |
20:31:32 | FromGitter | <kaushalmodi> That helpers.nim was already there (I just renamed, moved, etc.) |
20:33:59 | FromGitter | <kaushalmodi> So.. if a var is `const`, I don't need `{.compileTime.}`, right? As `const` implies compile-time. |
20:34:07 | FromGitter | <mratsim> yes |
20:34:32 | FromGitter | <mratsim> compileTime is actually not needed, it was there for procs that operated on NimNode |
20:35:13 | FromGitter | <mratsim> but now it’s automatically implied depending on the type signature |
20:36:20 | skrylar | bleh. i hear things are broken |
20:36:31 | skrylar | when i get back to coding next week its time to put the jenkins back up ._. |
20:36:44 | ashleyk | nice, nim has a case statement |
20:36:49 | ashleyk | python doesnt |
20:37:25 | FromGitter | <kaushalmodi> @mratsim Looks like I do need compileTime in https://gitter.im/nim-lang/Nim?at=5b33f33f960fcd4eb928e964 |
20:37:34 | FromGitter | <kaushalmodi> The variable needs to be mutable |
20:37:42 | FromGitter | <kaushalmodi> but available at compile time |
20:38:02 | FromGitter | <kaushalmodi> .. talking about the `init` template in that example |
20:38:31 | FromGitter | <mratsim> use a macro |
20:39:21 | FromGitter | <mratsim> do the compile time part in the macro and do var foo = macroCall() in your nim file |
20:40:16 | FromGitter | <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:32 | FromGitter | <mratsim> it’s not that hard, take 2 hours and try it ;) |
20:42:16 | skrylar | it 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:41 | skrylar | =P |
20:42:50 | FromGitter | <mratsim> what did I do Ó_Ó |
20:46:28 | FromGitter | <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:49 | FromGitter | <mratsim> I dont have time unfortunately. |
20:46:52 | FromGitter | <kaushalmodi> The above linked commit shows my unsuccessful attempt.. with that, now C compilation fails |
20:46:55 | FromGitter | <kaushalmodi> OK |
20:47:22 | * | miran quit (Ping timeout: 260 seconds) |
20:47:33 | * | Disavowed left #nim (#nim) |
20:47:51 | Araq | I think you've hit https://github.com/nim-lang/Nim/pull/6041 |
20:48:04 | Araq | that well... will happen anytime soon now... |
20:56:50 | * | cryptocat1094 quit (Quit: gtg) |
20:58:00 | * | zahary joined #nim |
20:59:25 | FromGitter | <ephja> krux02: it seems unlikely that they would actually remove opengl support in the forseeable future |
21:01:19 | FromGitter | <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:35 | FromGitter | <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:09 | FromGitter | <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:12 | ashleyk | i guess people actually use gitter.im to talk to irc |
21:28:29 | * | mitai quit (Ping timeout: 255 seconds) |
21:28:38 | ashleyk | oh they are talking to eachother |
21:32:07 | * | xet7 joined #nim |
21:35:49 | * | yglukhov[i] joined #nim |
21:37:04 | FromGitter | <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:08 | carterza[m] | o/ |
21:40:12 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
21:56:37 | Araq | kaushalmodi: I'll be busy the next days but we'll sort it out |
21:58:55 | dom96 | Interesting. |
21:59:07 | dom96 | I googled the `fractions` package that went missing |
21:59:23 | dom96 | and another repo by that name was owned by `notTito` the other user that removed their account |
22:05:21 | FromGitter | <kaushalmodi> Araq: Thanks! |
22:05:38 | FromGitter | <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:38 | FromGitter | <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:15 | FromGitter | <Quelklef> Is there a terser lambda syntax besides `proc(a: A, b: B): C = ...`? |
23:05:37 | FromGitter | <mratsim> (A, B) -> C: in future/sugar module |
23:06:13 | FromGitter | <Quelklef> ooooh, really? |
23:06:27 | FromGitter | <Quelklef> fantastic, thanks! |
23:07:01 | FromGitter | <mratsim> also checks the => symbol like here: https://github.com/mratsim/nim-projecteuler/blob/master/src/pe002_even_fibonacci_numbers.nim#L15 |
23:07:10 | FromGitter | <Quelklef> Wait, is this implemented as a macro `=>`? |
23:07:27 | FromGitter | <mratsim> there is -> for function signature and => for closure implementation |
23:07:41 | FromGitter | <Quelklef> elaborate? |
23:07:50 | FromGitter | <Quelklef> But I meant it's implemented totally "inside" Nim |
23:07:55 | FromGitter | <mratsim> yes |
23:08:01 | FromGitter | <mratsim> it’s implemented as macro |
23:08:04 | FromGitter | <Quelklef> super cool |
23:08:06 | FromGitter | <mratsim> function signature: https://github.com/vegansk/nimfp/blob/master/src/fp/stream.nim#L18 |
23:08:17 | FromGitter | <Quelklef> Ah I see |
23:08:22 | FromGitter | <mratsim> closure: https://github.com/vegansk/nimfp/blob/master/src/fp/stream.nim#L41 |
23:08:40 | FromGitter | <Quelklef> cool cool cool |
23:08:57 | FromGitter | <kaushalmodi> I was going to suggest anonymous procs and do notation, but this is better.. need to check out sugar. |
23:10:18 | FromGitter | <Quelklef> Now all we need is nice partial application... |
23:10:28 | * | ashleyk_ joined #nim |
23:11:49 | FromGitter | <Quelklef> how about something like `echo%("before", _, "after")` |
23:12:22 | FromGitter | <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:39 | FromGitter | <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:19 | FromGitter | <mratsim> if you search for nim + curry you will find example, even from Araq iirc |
23:26:44 | FromGitter | <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:28 | FromGitter | <Quelklef> Should range checking be done in -d:release? |