00:01:34 | * | vlad1777d quit (Remote host closed the connection) |
00:02:11 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:05:51 | * | Jesin quit (Ping timeout: 248 seconds) |
00:13:54 | * | Jesin joined #nim |
00:28:42 | * | relax joined #nim |
00:52:27 | * | cspar_ joined #nim |
01:02:30 | FromGitter | <FridgeSeal> I have a noob question: is there any guide/rule for when I should use the `result` variable, and when I should just `return` something normally? |
01:06:41 | * | mahmudov quit (Ping timeout: 248 seconds) |
01:23:39 | * | mahmudov joined #nim |
01:33:17 | * | dddddd quit (Read error: Connection reset by peer) |
01:37:37 | * | gangstacat quit (Quit: Leaving) |
01:39:05 | * | pilne joined #nim |
01:43:16 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:52:11 | * | francisl quit (Quit: francisl) |
01:52:37 | * | francisl joined #nim |
01:54:44 | * | def-pri-pub quit (Quit: leaving) |
01:55:10 | * | arnetheduck quit (Ping timeout: 240 seconds) |
01:57:05 | * | francisl quit (Ping timeout: 240 seconds) |
01:57:38 | * | chemist69 joined #nim |
02:24:45 | Tanger | FromGitter, https://nim-lang.org/docs/nep1.html#introduction-coding-conventions |
02:24:46 | FromGitter | Tanger, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
02:25:13 | FromGitter | <FridgeSeal> Ha, managed to miss that completely, thanks for that! :) |
02:32:17 | * | relax quit (Ping timeout: 260 seconds) |
02:47:36 | * | SusWombat joined #nim |
02:49:47 | * | SusWombat_ quit (Ping timeout: 260 seconds) |
02:53:27 | * | SusWombat_ joined #nim |
02:54:42 | * | SusWombat quit (Ping timeout: 252 seconds) |
03:01:29 | * | relax joined #nim |
03:06:08 | * | onionhammer joined #nim |
03:13:33 | * | endragor joined #nim |
03:45:44 | skrylar | i feel for everyone writing client facing code x.x |
03:45:58 | skrylar | just watched someone go "how do i do a thing" when it straight up said "to do the thing, press this button" |
04:05:08 | * | idonob joined #nim |
04:15:30 | * | ludocode quit (Quit: No Ping reply in 180 seconds.) |
04:18:12 | * | ludocode joined #nim |
04:18:27 | * | pilne quit (Quit: Quitting!) |
04:22:31 | * | ludocode quit (Ping timeout: 246 seconds) |
04:23:00 | * | BigEpsilon joined #nim |
04:30:46 | * | ShalokShalom joined #nim |
05:01:22 | skrylar | anyone know off the top of their head if we already have rfc3339 date/times |
05:01:32 | skrylar | looking in to that toml4 thing someone requested and it needs them |
05:07:48 | * | relax quit (Ping timeout: 252 seconds) |
05:12:01 | * | mahmudov quit (Remote host closed the connection) |
05:19:03 | * | gokr joined #nim |
05:38:37 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
06:01:02 | * | nsf joined #nim |
06:04:48 | * | BigEpsilon joined #nim |
06:10:18 | * | rauss quit (Quit: WeeChat 1.9) |
06:13:39 | * | Vladar joined #nim |
06:19:14 | * | vlad1777d joined #nim |
06:22:32 | * | skrylar quit (Remote host closed the connection) |
06:25:21 | FromGitter | <Grabli66> Hi. Is there a way to make a readonly field in object, that can be initialized only in "constructor" proc? ⏎ May be like this https://play.nim-lang.org/?gist=2084d4989b90d66049f1301f430cfd8c |
06:32:02 | * | cspar_ quit (Ping timeout: 260 seconds) |
06:38:59 | * | Pisuke quit (Ping timeout: 246 seconds) |
06:41:19 | * | Pisuke joined #nim |
06:49:14 | * | cspar_ joined #nim |
06:53:19 | livcd | readm.txt on nim-0.17.0._x64 for windows points you to install.txt but there's nothing like that inside the zipfile |
07:02:13 | Araq | ok thanks for reporting |
07:06:14 | * | PMunch joined #nim |
07:18:41 | * | claudiuinberlin joined #nim |
07:20:42 | * | claudiuinberlin quit (Client Quit) |
07:32:14 | * | claudiuinberlin joined #nim |
07:32:39 | * | yglukhov joined #nim |
07:35:21 | * | Arrrr joined #nim |
07:36:11 | * | Yardanico joined #nim |
07:50:35 | * | Yardanico quit (Remote host closed the connection) |
07:54:52 | * | endragor quit (Ping timeout: 260 seconds) |
07:56:37 | * | claudiuinberlin quit (Ping timeout: 240 seconds) |
07:58:56 | * | endragor joined #nim |
08:02:38 | * | endragor quit (Read error: Connection reset by peer) |
08:02:53 | * | endragor joined #nim |
08:19:23 | * | peanut joined #nim |
08:25:25 | yglukhov | dom96: ping |
08:26:55 | peanut | when using osproc, is using process.inputStream.writeLine("test") the same as echo "test" | subcommand ? |
08:27:24 | peanut | Can't get it working, even when using "/bin/echo" as the subcommand |
08:33:07 | FromGitter | <ephja> I'll try it myself |
08:33:41 | peanut | actually nevermind, a really simple example works with /bin/echo |
08:35:53 | crem | Morgen. |
08:39:24 | def- | peanut: you might also want to flush |
08:42:38 | peanut | def-: thanks, is that something stream specific? |
08:43:05 | peanut | I think I've narrowed down the issue. How can I send EOF to the processes inputStream? |
08:43:39 | def- | by closing it I guess |
08:44:06 | def- | Well, when you write to anything, you can tell the OS that you want it to be actually flushed to the output |
08:44:24 | def- | (or the internal buffer implementation) |
08:44:34 | peanut | def-: Ok, will try that, thanks! :) |
08:54:09 | * | peanut quit (Ping timeout: 260 seconds) |
08:56:19 | * | idonob quit (Quit: host lost) |
08:57:17 | FromGitter | <Grabli66> Does anybody seen job vacancies with knowledge of "Nim" language? :) |
09:01:28 | * | thomasross quit (Remote host closed the connection) |
09:01:53 | * | thomasross joined #nim |
09:03:56 | * | BitPuffin|osx joined #nim |
09:07:31 | Vladar | Grabli66, I saw one =) |
09:07:44 | Vladar | not vacancy, just one-time job |
09:08:25 | FromGitter | <Grabli66> Where? |
09:08:54 | Vladar | upwork |
09:09:41 | * | Matthias247 joined #nim |
09:12:39 | * | peanut joined #nim |
09:12:47 | * | dom96|w joined #nim |
09:13:10 | FromGitter | <Grabli66> It's strange, i found none. Why nim is not mainstream? |
09:14:13 | crem | dosens of reasons |
09:14:52 | Vladar | now of course there's none. I took that one jobe half-year ago ) |
09:15:35 | crem | nim doesn't even have code formatter! |
09:16:01 | Vladar | code formatter? |
09:16:24 | crem | Yes, all proper languages have code formatter nowadays. :) |
09:17:03 | Vladar | Oh, nim has one, it usually could be found between the chair and the keyboard =) |
09:17:40 | crem | It takes longer for that one to do the formatting. |
09:18:03 | yglukhov | Grabli66: we're using Nim fulltime, but not looking for Nim developers, because its pretty hard to find those =) |
09:18:44 | * | BitPuffin|osx quit (Remote host closed the connection) |
09:18:54 | yglukhov | dom96: ping |
09:19:02 | yglukhov | got 10 mins? |
09:19:26 | yglukhov | regarding https://github.com/nim-lang/nimble/pull/401 |
09:22:34 | dom96|w | Not right now. Maybe in 2 hours or so? |
09:25:15 | * | dom96|w quit (Read error: Connection reset by peer) |
09:28:37 | * | BitPuffin|osx joined #nim |
09:30:30 | * | thomasross_ joined #nim |
09:30:50 | * | thomasross quit (Read error: Connection reset by peer) |
09:42:01 | FromGitter | <BigEpsilon> Hi, I'm trying to run nim compiler tests on my machine, but get error at tests/cpp/tasync_cpp.nim : "cannot open jester" |
09:42:05 | FromGitter | <BigEpsilon> any idea ? |
09:43:06 | FromGitter | <BigEpsilon> and other tests fail with "cannot open zip/zlib" |
09:43:28 | FromGitter | <BigEpsilon> and cannot open zip/zipfiles and opengl |
09:43:39 | FromGitter | <BigEpsilon> I'm on devel |
09:47:15 | FromGitter | <ephja> all of those are packages that you can install with nimble |
09:57:31 | FromGitter | <BigEpsilon> Ok I didn't except to need installing external packages for the test suite |
09:57:37 | FromGitter | <BigEpsilon> thanks |
09:57:51 | * | tankfeeder joined #nim |
09:57:57 | tankfeeder | hi all |
09:58:30 | tankfeeder | i've got number from random generator, how to write to stdout as binary raw data ? |
09:58:31 | FromGitter | <BigEpsilon> hi |
10:01:36 | * | adamchainz joined #nim |
10:03:35 | * | BigEpsilon quit (Ping timeout: 255 seconds) |
10:08:32 | flyx | tankfeeder: something along the lines of newFileStream(stdout).write(myNum) |
10:11:07 | euantor | tankfeeder: By "binary raw data", do you mean the bytes making up the number (which I assume is an int32 or int)? |
10:11:19 | tankfeeder | euantor: yea |
10:12:05 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:12:11 | euantor | If so, you can cast the value to a byte array (so long as you know the size). If it's an `int32` something like this: `let numBytes = cast[array[4, byte]](num)` |
10:12:43 | euantor | Then you can either use `repr(numBytes)` or you can build a string by looping through the bytes and appending them (I don't think `$` is implemented for arrays - it wasn't a while back) |
10:13:42 | euantor | https://play.nim-lang.org/?gist=fc9857cc7aa0209ef02061586b28829c |
10:14:01 | euantor | Obviously `int64` would be an 8 byte array, etc. |
10:16:53 | tankfeeder | https://pastebin.com/C4VdCg3M |
10:17:12 | tankfeeder | now it prints int64 bit number as should |
10:20:04 | tankfeeder | maybe cast random number to array[8] and writeBuffer helps |
10:21:12 | Araq | tests/stdlib/thttpclient.nim failed |
10:26:10 | * | ShalokShalom_ joined #nim |
10:29:33 | * | ShalokShalom quit (Ping timeout: 252 seconds) |
10:37:22 | * | arnetheduck joined #nim |
10:37:58 | crem | I thought community survey results were always announced on September 3rd. |
10:47:31 | * | Xe quit (Ping timeout: 246 seconds) |
10:50:24 | * | haha_ joined #nim |
11:02:58 | * | Yardanico joined #nim |
11:04:15 | * | haha_ quit (Quit: haha_) |
11:05:44 | * | haha_ joined #nim |
11:09:09 | * | gokr quit (Ping timeout: 252 seconds) |
11:11:12 | * | pwntus quit (Ping timeout: 246 seconds) |
11:11:28 | * | haha_ quit (Quit: haha_) |
11:11:51 | * | gokr joined #nim |
11:13:07 | * | dddddd joined #nim |
11:18:04 | Yardanico | hi guys |
11:18:21 | crem | hi |
11:43:16 | FromGitter | <k0pernicus> Hello world! ⏎ Is anybody here worked /is working on PDF parsers? :-) |
11:44:11 | Yardanico | yes |
11:44:20 | Yardanico | k0pernicus: https://github.com/jangko/nimpdf |
11:44:36 | * | dom96|w joined #nim |
11:45:05 | FromGitter | <k0pernicus> WOW! AWESOME! |
11:45:12 | FromGitter | <k0pernicus> Thanks @Yardanico |
11:45:12 | Yardanico | xD |
11:45:24 | dom96|w | yglukhov: here now if you want to discuss, but I'd prefer if we just discussed on GitHub |
11:45:27 | Yardanico | https://github.com/jangko/nimpdf/blob/master/demo/demo.pdf |
11:46:37 | livcd | Is there any docu / pkg for a windows service ? |
11:46:45 | Yardanico | livcd, windows service? |
11:47:57 | livcd | Yes |
11:48:24 | Yardanico | I doub there's, you should find docs for c/c++ |
11:48:32 | Yardanico | and then use same winapi functions in nim |
11:48:44 | livcd | Ah |
11:48:44 | livcd | ok |
11:48:58 | yglukhov | dom96: i just wanted to say that i could not understand your case. in your issue you were using nim to compile nimble, so thats a different problem, imo |
11:50:13 | dom96|w | yglukhov: Yes, but your patch encourages these kind of imports which will fail as soon as you use nim to compile. |
11:50:47 | dom96|w | why can't you import using the syntax I suggested? |
11:55:31 | yglukhov | dom96: relative paths are trickier to maintain, imo. if i want to move the referring file to another location, relative imports should likely be modified as well. |
11:55:53 | yglukhov | not that it is critical in any way. just feels more right to me. |
11:56:44 | tankfeeder | testing buildin rng's by "practically random" software |
11:57:17 | tankfeeder | mersenne pass, xoro failed, quite the same code in generating numbers. |
11:58:03 | dom96|w | yglukhov: okay, we should discuss how to solve my issue then. But let's do that on GitHub, can't talk much right now. |
11:58:15 | tankfeeder | my own implementation of xoroshiro128+ on PicoLisp passed tests even without seeding. |
12:03:34 | * | BigEpsilon joined #nim |
12:04:59 | * | BigEpsilon quit (Client Quit) |
12:08:34 | Yardanico | Araq, I found out that I need to change it somewhere in types.nim |
12:08:48 | Yardanico | but there's already a thing that checks that |
12:09:06 | Yardanico | of tyRef: if kind == skConst: result = t |
12:11:29 | Yardanico | I'm not sure why it doesn't work |
12:12:58 | Yardanico | ah, because this isn't a "ref", but an object |
12:14:30 | FromGitter | <xmonader> https://gist.github.com/xmonader/10cd5ccbc7f24b35910010e0dccca71a I tried it on ubuntu 16.04 and it completes unlike on my archlinux machine |
12:15:01 | FromGitter | <xmonader> however it always return false for the link checks for the async part |
12:15:32 | * | m712 quit (Quit: bye-nyan!) |
12:16:22 | Yardanico | Araq, ah |
12:16:35 | Yardanico | I only need to add "if kind == skConst and t.sons[0].kind == tyRef: return t" to tySequence branch |
12:16:55 | Yardanico | but |
12:17:02 | Yardanico | it would still fail for tyArray for example |
12:21:32 | * | m712 joined #nim |
12:33:55 | * | kunev quit (Ping timeout: 246 seconds) |
12:35:28 | * | kunev joined #nim |
12:46:08 | * | cspar_ quit (Ping timeout: 246 seconds) |
12:57:24 | * | sz0 joined #nim |
13:01:00 | * | yglukhov quit (Remote host closed the connection) |
13:01:56 | * | yglukhov joined #nim |
13:03:23 | * | haha_ joined #nim |
13:03:40 | * | yglukhov quit (Remote host closed the connection) |
13:03:54 | * | yglukhov joined #nim |
13:16:48 | * | haha_ quit (Quit: haha_) |
13:18:35 | Araq | yardanico: that's not how things work, that proc is recursive and invalid 'ref' type bubbles up |
13:20:12 | * | haha_ joined #nim |
13:23:11 | Yardanico | Araq, but why "if kind == skConst: result = t" check doesn't work then? |
13:23:15 | Yardanico | in this proc |
13:23:22 | Yardanico | of tyRef: if kind == skConst: result = t |
13:32:31 | * | Snircle joined #nim |
13:35:33 | Yardanico | When was first Nim version released? |
13:35:59 | crem | There's no nim in debian/ubuntu distro, is there? |
13:37:37 | Yardanico | crem, there is |
13:37:43 | tankfeeder | now my xoro implementation dont pass tests too, its ok |
13:37:52 | Yardanico | crem, https://tracker.debian.org/pkg/nim |
13:37:59 | Yardanico | in testing/unstable |
13:38:05 | Yardanico | 0.16.0 in stable thought |
13:38:09 | tankfeeder | found in changelog of software |
13:38:23 | tankfeeder | non-recommended |
13:38:23 | tankfeeder | added xoroshiro128plus |
13:38:32 | tankfeeder | so it should fail. issue closed. |
13:38:39 | Yardanico | crem, and also https://launchpad.net/ubuntu/+source/nim 0.17.0 in the artful aardvark |
13:38:52 | Yardanico | crem, use choosenim for easy installation :) |
13:39:39 | * | yglukhov quit (Remote host closed the connection) |
13:39:54 | Yardanico | well they have older nim versions in older distro versions |
13:40:15 | Yardanico | but this is normal for distributives with separate releases |
13:43:14 | * | rauss joined #nim |
13:43:30 | crem | I'm not sure I'm allowed it on work machine, it's not listed in our approved repo. (which is based on ubuntu 14) |
13:44:26 | Yardanico | crem, you can statically compile binary |
13:44:30 | Yardanico | and that's it :) |
13:44:39 | Yardanico | so you will be able to use it almost on any linux |
13:45:15 | Yardanico | ah you want nim compiler itself |
13:45:22 | Yardanico | why you don't want to compile it from the source? |
13:45:32 | Yardanico | if you have gcc - you can use nim |
13:45:34 | Yardanico | or clang |
13:45:40 | crem | I'm sure I can run it, I don't know whether it's allowed. It's not in the list of pre-allowed software, and for the rest I should manually inspect it, which I'm lazy to do (and there's probably too much code to inspect). |
13:46:31 | Yardanico | crem, what do you mean by "inspect" ? are you working for government ? :P |
13:47:53 | crem | Not really. But still for example if software sends some (usage) stats back to somewhere, it's usually not allowed to use. |
13:48:10 | Yardanico | nim doesn't send anything |
13:48:11 | crem | Do you know when it appeared in ubuntu repos? |
13:48:23 | Yardanico | crem, I doubt it's in ubuntu 14.04 repos |
13:48:50 | Yardanico | but really, nim doesn't send any data |
13:48:55 | Yardanico | at all |
13:49:03 | FromGitter | <Grabli66> But why? :) |
13:49:11 | Yardanico | because it doesn't need to |
13:49:28 | Yardanico | why do you want COMPILER to send something to some server? |
13:49:49 | crem | Like crash reports for debugging. |
13:49:57 | crem | (compiler crash reports) |
13:49:58 | Yardanico | it doesn't |
13:50:15 | Yardanico | crem, can you give an example compiler which does that? |
13:50:20 | crem | It was the answer to a question "why would you do that" |
13:50:32 | Yardanico | I doubt there's open-source compilers with stuff like that |
13:50:39 | euantor | dotnet's CLI does |
13:50:44 | euantor | (it's open source) |
13:50:50 | Yardanico | euantor, microsoft? :) |
13:50:53 | euantor | On by default, with an opt out |
13:50:55 | euantor | Yep |
13:51:00 | Yardanico | lol |
13:51:05 | Yardanico | well it's microsoft :P |
13:51:40 | crem | Sometimes random things do send some stats. For example some of sublime text's plugins. Altough "why would they do that". |
13:51:44 | * | ShalokShalom_ is now known as ShalokShalom |
13:51:53 | * | aziz joined #nim |
13:51:57 | crem | So anyway, keeping nim to be home only for now. Too much to bother. |
13:52:07 | * | aziz quit (Client Quit) |
13:53:37 | * | yglukhov joined #nim |
13:55:43 | * | gokr quit (Ping timeout: 248 seconds) |
13:56:38 | * | gokr joined #nim |
13:56:51 | * | PMunch quit (Quit: Leaving) |
13:59:35 | * | tankfeeder left #nim (#nim) |
14:03:43 | dom96|w | Note: choosenim may start doing that |
14:03:46 | dom96|w | but it will be opt-in |
14:04:01 | * | vlad1777d quit (Ping timeout: 240 seconds) |
14:04:05 | dom96|w | well, it will ask you during installation and force you to give an answer :) |
14:06:38 | Yardanico | dom96|w, what stats will it send? |
14:06:53 | dom96|w | mainly crash logs |
14:07:00 | dom96|w | but also OS stats |
14:07:43 | Yardanico | dom96|w, how will it be able to do that? |
14:07:44 | Yardanico | ah |
14:07:49 | Yardanico | nim is a proxy exe, forgot about that |
14:07:54 | Yardanico | (in choosenim installation) |
14:07:58 | Yardanico | well I'm fine with that |
14:08:05 | dom96|w | Yes, but mainly choosenim will do it |
14:08:10 | dom96|w | The proxyexe might collect some data |
14:08:13 | dom96|w | but it won't ever send anything |
14:08:22 | Yardanico | but I don't use choosenim because I really don't want to download nim repo again on every devel update :) |
14:08:24 | euantor | Yeah, I would only expect it to send when choosenim itself runs |
14:08:29 | * | Xe joined #nim |
14:09:52 | dom96|w | Yardanico: Yeah, I will likely make that scenario easier to work with,] |
14:10:08 | FromGitter | <BigEpsilon> Does any body know why thttpclient.nim is failing in the tests ? |
14:10:42 | * | BigEpsilon joined #nim |
14:11:25 | euantor | Which tests? What's the rrror? |
14:12:17 | FromGitter | <BigEpsilon> comipler tests on appVeyor |
14:13:13 | euantor | Have you tried running that test manually? |
14:13:14 | FromGitter | <BigEpsilon> I made a PR which is not related and it is failing, I think Araq mensioned it this morning if I'm not mistaken |
14:13:25 | FromGitter | <BigEpsilon> I'm doing that now |
14:13:59 | Araq | bigEpsilon: Either way, reorderings for 'var' seem overkill |
14:14:21 | FromGitter | <BigEpsilon> https://ci.appveyor.com/project/dom96/nim/build/252 |
14:14:27 | Araq | var and let are imperative statements, please do not reorder these |
14:14:41 | Araq | type and const sections are fine to split up though |
14:14:56 | FromGitter | <BigEpsilon> Yes I hesitated doing that |
14:15:10 | FromGitter | <BigEpsilon> ok I'll do that then |
14:15:16 | Araq | btw you need to merge the type sections back afterwards or else it's still not sufficient |
14:15:55 | FromGitter | <BigEpsilon> all the type sections or only the ones that I splited ? |
14:16:30 | FromGitter | <BigEpsilon> In what case not joining them can cause a problem ? |
14:16:52 | gokr | Joe Armstrong just twittered and mentioned that he was perhaps looking at Nim. I invited him :) |
14:17:07 | gokr | Do invite him you guys too: https://twitter.com/joeerl |
14:23:18 | crem | Looks more that he just says that he's overwhelmed with requests to "look at <some language>". |
14:30:59 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:31:55 | Arrrr | lol |
14:34:38 | crem | On the other hand, nim community is pretty mediocre. :) |
14:35:29 | Yardanico | crem, you mean "small" ? |
14:36:31 | crem | Nope, I was trying to joke. :) |
14:37:13 | FromGitter | <BigEpsilon> @Araq , nevermind my 2 questions about sections. Now I understand. |
14:38:16 | Arrrr | Jokes and conversations about transpilers are a tabu here, be careful. |
14:39:54 | Araq | you can transfinitecompile all you want, it's just not a word with any rationale meaning |
14:40:24 | Araq | I can *compile* high level C to lower level C and it's still a "compilation" |
14:40:38 | Yardanico | Araq, don't worry, Arrrr just said this as an example |
14:40:39 | crem | Is decompilation a compilation? |
14:40:54 | federico3 | Arrrr: noo, you triggered the automated ranting device |
14:40:56 | * | def-pri-pub joined #nim |
14:41:03 | Yardanico | crem, no |
14:41:10 | Yardanico | "de" means opposite :D |
14:41:31 | Yardanico | pls don't do too many jokews |
14:41:55 | crem | What wasn't a joke, it was a deep philosophical question. |
14:42:36 | Yardanico | crem, there's #nim-offtopic btw |
14:42:59 | * | peanut quit (Ping timeout: 260 seconds) |
14:43:39 | crem | That was pretty silent last time I checked. But I'll join, now that I've switched from irssi to weechat and large number of channels is more manageable. |
14:43:57 | * | PMunch joined #nim |
14:44:06 | Arrrr | We were talking about you |
14:44:07 | Yardanico | crem, well it is pretty silent |
14:45:04 | FromGitter | <BigEpsilon> @Araq , In fact no :/ I still don't see it |
14:45:07 | FromGitter | <BigEpsilon> "@BigEpsilon ⏎ all the type sections or only the ones that I splited ? ⏎ In what case not joining them can cause a problem ?" |
14:45:28 | Araq | all that you can |
14:45:44 | Yardanico | "Mutually recursive types are only possible within a single type section." maybe this? |
14:46:50 | FromGitter | <BigEpsilon> hmmm yes that's it i think |
14:47:31 | Araq | type A = int; const x = 4; type B = type(x) # can't merge these |
14:49:31 | FromGitter | <BigEpsilon> yes I see |
14:49:49 | FromGitter | <BigEpsilon> I'll modify my PR then when I finish |
14:51:09 | * | yglukhov quit (Remote host closed the connection) |
14:51:47 | * | yglukhov joined #nim |
14:52:10 | FromGitter | <BigEpsilon> thanks |
14:53:27 | gokr | crem: Ah, perhaps I didn't read too closely, sorry. |
14:54:49 | * | Trustable joined #nim |
14:57:02 | * | yglukhov quit (Ping timeout: 246 seconds) |
14:58:34 | * | endragor quit (Remote host closed the connection) |
14:59:20 | * | nsf quit (Quit: WeeChat 1.9) |
15:00:37 | * | endragor_ joined #nim |
15:04:41 | * | endragor_ quit (Ping timeout: 240 seconds) |
15:06:37 | * | yglukhov joined #nim |
15:10:43 | * | arnetheduck quit (Ping timeout: 246 seconds) |
15:11:32 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:14:32 | * | dom96|w joined #nim |
15:17:05 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
15:26:21 | * | gokr quit (Ping timeout: 240 seconds) |
15:52:02 | * | def-pri-pub joined #nim |
15:52:02 | * | def-pri-pub quit (Changing host) |
15:52:02 | * | def-pri-pub joined #nim |
15:56:35 | * | def-pri-pub quit (Client Quit) |
15:57:04 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:59:13 | * | TjYoco joined #nim |
16:02:11 | TjYoco | Is it possible to make a proc like setConent? Its throwing an error rn: https://pastebin.com/63fpFkhr |
16:02:30 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:03:48 | def- | TjYoco: you have to use new to initialize a ref |
16:04:30 | def- | ah, you don't mean an exception |
16:04:40 | def- | you need to use compiletime when |
16:05:38 | def- | when content is string: ... |
16:05:50 | TjYoco | ahhhh okay, thank you |
16:05:53 | def- | but you can also just overload setContent and have 3 different procs |
16:06:17 | TjYoco | I had that at first but I wanted try out this method |
16:07:02 | def- | and then you can assert the kind |
16:10:07 | * | ShalokShalom quit (Ping timeout: 248 seconds) |
16:19:05 | * | ShalokShalom joined #nim |
16:19:10 | * | yglukhov quit (Remote host closed the connection) |
16:20:39 | * | yglukhov joined #nim |
16:26:37 | * | yglukhov quit (Ping timeout: 255 seconds) |
16:29:28 | * | couven92 quit (Ping timeout: 246 seconds) |
16:34:22 | * | yglukhov joined #nim |
16:36:32 | * | haha_ quit (Quit: haha_) |
16:38:57 | * | yglukhov quit (Ping timeout: 248 seconds) |
16:41:34 | * | nsf joined #nim |
16:41:43 | * | def-pri-pub joined #nim |
16:42:51 | * | Trustable quit (Remote host closed the connection) |
16:46:25 | FromGitter | <Bennyelg> hey do we have any aws integration ? |
16:51:38 | FromGitter | <Bennyelg> Open an in-memory sqlite ? |
16:51:49 | FromGitter | <Bennyelg> let db = open("localhost", "user", "password", "dbname") ⏎ let db = open(":memory:") |
16:52:28 | Yardanico | I don't think so |
16:52:54 | FromGitter | <Bennyelg> I found it |
16:52:55 | FromGitter | <Bennyelg> let theDb = open(":memory:",nil,nil,nil) |
16:53:09 | Yardanico | well yeah |
16:53:17 | Yardanico | sqlite is just a wrapper for sqlite library |
16:54:45 | FromGitter | <xmonader> So it's bit frustrating :D :D |
16:59:45 | * | loc8 quit (Quit: WeeChat 1.9) |
17:02:51 | * | endragor joined #nim |
17:06:45 | FromGitter | <Bennyelg> casting string to int or string to float |
17:06:54 | FromGitter | <Bennyelg> not working int(element) |
17:07:00 | FromGitter | <xmonader> parseInt ? |
17:07:04 | def- | strutils.parseInt |
17:07:07 | * | endragor quit (Ping timeout: 240 seconds) |
17:07:23 | def- | and int(element) is a type conversion, cast[int](element) is a cast |
17:10:48 | FromGitter | <Bennyelg> How Do I implement something like this |
17:10:55 | FromGitter | <Bennyelg> ```proc castIt(element: string): string | float | int ⏎ ``` [https://gitter.im/nim-lang/Nim?at=59ad891fee5c9a4c5f313b84] |
17:11:15 | def- | you can't overload based on return type |
17:12:04 | FromGitter | <Bennyelg> :( any way to return something like "untyped" |
17:12:12 | FromGitter | <xmonader> auto i guess |
17:12:25 | def- | Nim is a statically typed programming language, what you're trying to do would make sense in Python |
17:12:35 | def- | but in Nim you wouldn't solve it that way |
17:12:45 | FromGitter | <Bennyelg> oh |
17:12:46 | FromGitter | <Bennyelg> hehe I know |
17:12:59 | FromGitter | <Bennyelg> I still need to get ride of my old meners :D |
17:14:18 | FromGitter | <xmonader> Can't you do an auto return? |
17:14:22 | def- | no |
17:14:32 | FromGitter | <xmonader> I'm sure i saw it in the stdlib code |
17:15:26 | def- | Sure, you can return auto, when the type is obvious from some "result = 123" |
17:15:37 | def- | but not in this case where it will be determined at runtime |
17:15:49 | * | nattefrost joined #nim |
17:16:12 | * | miran joined #nim |
17:16:39 | FromGitter | <k0pernicus> Generic return type? |
17:16:40 | * | miran quit (Remote host closed the connection) |
17:17:01 | * | miran joined #nim |
17:18:23 | def- | yeah, you can do proc castIt[T: string | float | int](element: string): T = |
17:18:35 | def- | and then use castIt[float](...) |
17:18:39 | FromGitter | <k0pernicus> Yep |
17:19:21 | FromGitter | <xmonader> @dom96 How do i reset the download code in choosenim? as it's not a git repo? |
17:20:16 | Yardanico | what do you mean by "reset"? |
17:20:33 | FromGitter | <k0pernicus> I didn’t understand “reset” neither... |
17:20:45 | FromGitter | <xmonader> I mean i tinkered a bit with the code in the toolchain nim#devel |
17:21:02 | FromGitter | <xmonader> and i want to reset it as in `git reset` except it's not really a git repo |
17:22:09 | FromGitter | <k0pernicus> If you don’t need your modifications, and if the devel branch is a toolchain, remove the toolchain and reinstall this one |
17:22:39 | FromGitter | <xmonader> I don't have that great internet it may take 15 mins :( |
17:22:45 | FromGitter | <k0pernicus> Aoutch... |
17:22:52 | * | BigEpsilon quit (Ping timeout: 255 seconds) |
17:23:04 | FromGitter | <xmonader> maybe i can just copy the raw files from github, that should work |
17:23:42 | FromGitter | <k0pernicus> Just copy the original files where you made some modifications |
17:23:46 | FromGitter | <k0pernicus> Replace them |
17:23:47 | FromGitter | <Bennyelg> How do i get the variable type name |
17:24:06 | FromGitter | <xmonader> @k0pernicus yupp |
17:24:45 | Yardanico | Bennyelg: why do you want to get it? |
17:24:51 | Yardanico | you can do that in the macro |
17:25:08 | FromGitter | <k0pernicus> @Bennyelg my_var.type.name ? |
17:25:19 | FromGitter | <Bennyelg> Im pretty newibe to nim do know macros yet |
17:25:44 | FromGitter | <Bennyelg> undeclared field: 'name' |
17:25:46 | * | gokr joined #nim |
17:25:51 | Yardanico | k0pernicus no |
17:26:04 | Yardanico | Bennyelg: why do you want to get it in the first place? |
17:26:29 | FromGitter | <xmonader> I found very annoying problem with nim http client |
17:26:37 | FromGitter | <Bennyelg> Im trying to parse csv file get the types and put it into database |
17:26:44 | FromGitter | <Bennyelg> by creating the apropirate types |
17:26:55 | Yardanico | Bennyelg: you can use |
17:27:25 | Yardanico | well you can;'t |
17:27:32 | Yardanico | well you want to have a macro |
17:27:36 | Yardanico | you can't define new types at runtime |
17:27:45 | FromGitter | <xmonader> in python ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ If I do same requests in nim i get moved to https://www.google.com.eg [https://gitter.im/nim-lang/Nim?at=59ad8d108f4427b462d02d8f] |
17:27:57 | Yardanico | disable redirects? |
17:28:18 | FromGitter | <Yardanico> client.maxRedirects = 0 |
17:28:18 | * | Serenitor joined #nim |
17:28:25 | FromGitter | <Yardanico> if your http client is named "client" |
17:28:27 | FromGitter | <k0pernicus> Oh, actually, `my_var.type.name` works if you import `typetraits` |
17:28:36 | FromGitter | <xmonader> Yardanico let me try |
17:28:56 | FromGitter | <Bennyelg> thx |
17:28:58 | FromGitter | <Bennyelg> your are hero |
17:29:24 | FromGitter | <xmonader> @Yardanico ```asynclinkschecker.nim(28, 25) Error: attempting to call undeclared routine: 'maxRedirects='``` |
17:29:44 | Yardanico | can you show full code? |
17:29:50 | FromGitter | <xmonader> sure |
17:30:42 | FromGitter | <Bennyelg> I did it |
17:30:46 | FromGitter | <Bennyelg> OMG I love you all :) |
17:31:29 | * | thomasross_ is now known as thomasross |
17:31:54 | * | ofelas joined #nim |
17:33:10 | FromGitter | <xmonader> https://gist.github.com/ |
17:33:14 | Yardanico | well |
17:33:33 | FromGitter | <xmonader> I think my changes in the toolchain were needed :( |
17:33:46 | FromGitter | <xmonader> because now it keeps hanging again, dammit |
17:33:52 | FromGitter | <Yardanico> @xmonader ah sorry |
17:34:45 | FromGitter | <xmonader> It was basically supporting DONT_WAIT flag in socketflags |
17:34:56 | FromGitter | <Yardanico> ah |
17:34:59 | FromGitter | <Yardanico> wait |
17:35:05 | FromGitter | <Bennyelg> format("c_%d", ind) formatting anyone? :) |
17:35:19 | FromGitter | <Yardanico> @Bennyelg "c_" & $ind ? |
17:35:41 | FromGitter | <xmonader> cant u use # in the format @Bennyelg ? |
17:35:46 | FromGitter | <Yardanico> @xmonader initialise client like this: ```nim ⏎ var client = newAsyncHttpClient(maxRedirects = 0) ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59ad8ef2b16f264642054436] |
17:35:55 | FromGitter | <Yardanico> @xmonader # ? |
17:36:02 | FromGitter | <Yardanico> ah |
17:36:05 | FromGitter | <Yardanico> you mean $ |
17:36:12 | FromGitter | <Bennyelg> sample |
17:36:14 | FromGitter | <Yardanico> @Bennyelg yeah you also can use "format" from strutils |
17:36:18 | FromGitter | <Yardanico> like this: |
17:36:38 | FromGitter | <Bennyelg> this is what I do now: ⏎ format("c_$1", ind) |
17:36:50 | FromGitter | <Yardanico> yeah that's nice |
17:37:30 | FromGitter | <xmonader> @Yardanico as a variable placeholder same as in python {} |
17:37:31 | FromGitter | <Yardanico> @xmonader also, why do you use "poll"? |
17:37:34 | FromGitter | <Yardanico> no |
17:38:32 | FromGitter | <Yardanico> ah |
17:38:35 | FromGitter | <Yardanico> you mean $var |
17:38:35 | FromGitter | <xmonader> I'm afraid i really need the DONTWAIT socket flag |
17:39:16 | FromGitter | <Yardanico> @xmonader why? |
17:39:25 | FromGitter | <xmonader> @dom96 is that missing from socket library? maybe if so it could be my first nim contribution :D |
17:39:50 | FromGitter | <Yardanico> you can also add a timeout |
17:40:14 | FromGitter | <Yardanico> and also it's better to create different http client for each website |
17:40:31 | FromGitter | <Yardanico> yes |
17:40:33 | FromGitter | <Yardanico> it works for me |
17:40:50 | FromGitter | <Yardanico> without any DONT_WAIT |
17:40:59 | FromGitter | <Bennyelg> optional argument pass to function? |
17:41:05 | FromGitter | <xmonader> my god i'm really getting frustrated with this |
17:41:06 | FromGitter | <Bennyelg> f(x, f=None) |
17:41:11 | FromGitter | <Yardanico> @Bennyelg ??? |
17:41:20 | FromGitter | <xmonader> why creating a special http client for each site? |
17:41:21 | FromGitter | <Yardanico> @Bennyelg myProc(x, f = myThing) |
17:41:32 | FromGitter | <Yardanico> @xmonader because http clients holds a connection to one website |
17:41:40 | FromGitter | <Yardanico> and it's better to create each http client for each website :) |
17:41:44 | FromGitter | <Yardanico> also this solves the deadlock |
17:42:21 | FromGitter | <xmonader> really!!! I didn't know that how about the cost of creating lots of httpclients? |
17:42:30 | FromGitter | <Yardanico> well |
17:42:34 | FromGitter | <Yardanico> I benchmarked it a while ago |
17:42:46 | FromGitter | <Yardanico> you can create 2 million instances of httpclient in one seconds |
17:42:52 | FromGitter | <Yardanico> I mean just object creation |
17:42:56 | * | Sentreen quit (Ping timeout: 246 seconds) |
17:43:00 | FromGitter | <xmonader> Interesting |
17:43:07 | FromGitter | <Yardanico> well you wouldn't have any performance problems |
17:43:15 | FromGitter | <Yardanico> because your code still would be IO bound :) |
17:43:41 | FromGitter | <xmonader> That's is supposed to be fixed with async ... which doesn't work for me :( |
17:43:55 | FromGitter | <Yardanico> do you have any performance problems? |
17:43:59 | * | Matthias247 joined #nim |
17:44:58 | FromGitter | <xmonader> @Yardanico I've the weirdest issues with it. As you know that code hangs on my archlinux machine, works on my ubuntu and apparently works on dom's machine and urs :D |
17:45:10 | FromGitter | <Yardanico> well no |
17:45:12 | FromGitter | <Yardanico> I changed the code a bit |
17:45:19 | FromGitter | <Yardanico> and I use antegros (basically arch) |
17:46:46 | FromGitter | <Yardanico> @xmonader https://gist.github.com/Yardanico/a5b860ec7eaf59f9f2f33ba2bee97a73 |
17:46:56 | FromGitter | <Yardanico> I added "result" because it's more idiomatic in Nim :) |
17:47:14 | FromGitter | <Yardanico> try this |
17:47:41 | FromGitter | <Yardanico> it gives "False" for google because it returns non-200 http code |
17:47:44 | FromGitter | <Yardanico> because it redirects |
17:47:59 | FromGitter | <Yardanico> and in this code nim doesn't follow redirects |
17:48:18 | FromGitter | <Yardanico> oh wait |
17:48:19 | FromGitter | <Yardanico> sorry |
17:48:34 | FromGitter | <Yardanico> Check gist again, I fixed the code :) |
17:48:44 | FromGitter | <Yardanico> or no |
17:48:45 | FromGitter | <Yardanico> :D |
17:48:59 | FromGitter | <Yardanico> ah yes, I did |
17:49:19 | FromGitter | <Yardanico> So this would work 100% - https://gist.github.com/Yardanico/a5b860ec7eaf59f9f2f33ba2bee97a73. Sorry for spamming so much messages |
17:49:55 | FromGitter | <xmonader> I get ``` ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?) ⏎ Error: execution of an external program failed: '/tmp/async2 '``` |
17:50:07 | FromGitter | <Yardanico> I fixed it |
17:50:10 | FromGitter | <Yardanico> check the gist again |
17:50:11 | FromGitter | <xmonader> it's okay let me retry that again |
17:50:19 | * | yglukhov joined #nim |
17:51:26 | FromGitter | <xmonader> @Yardanico amazing works like a charm |
17:51:58 | FromGitter | <xmonader> But why u needed to convert asyncLinksChecker to async pragma? because in the testcases provided for nim the calling function doesn't need to be async |
17:52:31 | FromGitter | <Yardanico> well it feels better for me |
17:52:34 | FromGitter | <Yardanico> you can change it back |
17:52:36 | FromGitter | <Yardanico> it would work |
17:52:43 | FromGitter | <Yardanico> it didn't work because you had only one http client |
17:52:47 | FromGitter | <Yardanico> that's probablt the reason |
17:53:28 | FromGitter | <xmonader> I really didn't know that is that documented anywhere? to have 1 httpclient per connection? |
17:53:40 | FromGitter | <Yardanico> well I think it isn't |
17:53:52 | FromGitter | <Yardanico> but look: httpclient holds a socket |
17:53:57 | FromGitter | <Yardanico> which is connected to one website |
17:54:02 | FromGitter | <Yardanico> and you're trying to connect to another website |
17:54:07 | FromGitter | <Yardanico> and coroutines are executed separately |
17:54:32 | FromGitter | <Yardanico> well you can still use one http client for many http clients |
17:54:42 | FromGitter | <xmonader> by spawning u mean? |
17:54:58 | * | yglukhov quit (Ping timeout: 264 seconds) |
17:55:02 | FromGitter | <xmonader> because that's what i used for the threaded one, but no wonder it was bit slow |
17:55:04 | FromGitter | <Yardanico> you cna still use one http client but only if you're sure you're not using the same client somewhere else |
17:55:13 | FromGitter | <Yardanico> no, not by spawning |
17:56:13 | * | Sentreen joined #nim |
17:57:06 | FromGitter | <xmonader> Okay what would be the effect in spawning? no multiplexing allowed? |
17:57:21 | FromGitter | <Yardanico> I don't really know |
17:57:27 | FromGitter | <Yardanico> I don't use threads |
17:57:56 | FromGitter | <Yardanico> and if you try to use spawn - you will be not able to do it |
17:58:03 | FromGitter | <Yardanico> well you probably will be able |
17:58:12 | FromGitter | <Yardanico> because http client will probably be just deeply copied to your procedure |
17:58:17 | FromGitter | <xmonader> I did, but i noticed it's bit slow |
17:58:20 | * | xet7 quit (Read error: Connection reset by peer) |
17:58:29 | def-pri-pub | zacharycarter: sorry for being a pest, but I've found another issue or two and I'm starting to get blocked on more progress. I really want to address the origin/coordinate issue ASAP, as well as timing |
17:58:44 | * | yglukhov joined #nim |
17:58:50 | def-pri-pub | I also submitted a PR that adds in rudimentary animation of the sprites, but I don't consider it done yet. |
17:58:58 | * | haha_ joined #nim |
17:59:57 | FromGitter | <xmonader> What's the difference between await/waitFor ? |
18:00:10 | FromGitter | <Yardanico> big difference |
18:00:12 | * | mahmudov joined #nim |
18:00:23 | FromGitter | <xmonader> are the testcases for nim not updated? because i see in it they use waitFor |
18:00:28 | FromGitter | <Yardanico> they ARE updated |
18:00:30 | FromGitter | <Yardanico> as I said |
18:00:35 | FromGitter | <Yardanico> you CAN use waitFor in your code |
18:00:50 | FromGitter | <Yardanico> the issue was that you've used one http client for all requests |
18:01:05 | FromGitter | <Yardanico> waitFor is used in non-async procs whose want to call async procs |
18:01:12 | FromGitter | <Yardanico> it waits for specific future to complete |
18:01:17 | FromGitter | <Yardanico> and "await" is used in async procs |
18:01:28 | FromGitter | <xmonader> uha that's why it worked for asyncLinksChecker with no async pargma |
18:01:50 | FromGitter | <xmonader> maybe that's what i mixed the two from my source code reading |
18:01:53 | FromGitter | <Yardanico> if you don't really want to use await |
18:01:54 | FromGitter | <Yardanico> https://gist.github.com/Yardanico/f8cc9a715461def8ba775b1105224bf4 |
18:02:22 | FromGitter | <xmonader> i updated the code thank you. that was enlightening |
18:04:01 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
18:06:12 | * | Serenit0r joined #nim |
18:08:46 | * | Serenitor quit (Ping timeout: 255 seconds) |
18:11:41 | FromGitter | <xmonader> Okay now i'm curious a bit ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ad975cc101bc4e3a8c704d] |
18:15:46 | * | xet7 joined #nim |
18:16:44 | FromGitter | <Yardanico> 1) 01 seconds for me |
18:16:50 | FromGitter | <Yardanico> in async |
18:16:50 | FromGitter | <Yardanico> in release mode :) |
18:17:06 | FromGitter | <xmonader> oh maybe debug is the reason? |
18:17:26 | * | haha_ quit (Quit: haha_) |
18:17:56 | FromGitter | <Yardanico> yes |
18:18:02 | FromGitter | <Yardanico> why you test speed in debug mode? |
18:18:02 | FromGitter | <Yardanico> lol |
18:18:08 | * | vlad1777d joined #nim |
18:19:41 | FromGitter | <xmonader> even if debug it should be faster than sequential no? |
18:19:46 | Yardanico | no |
18:20:02 | FromGitter | <xmonader> i used release mode -d:release ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ad9952c101bc4e3a8c7791] |
18:20:06 | FromGitter | <xmonader> Not cool |
18:20:24 | FromGitter | <Yardanico> well it's something weird with your internet connection or your pc :) |
18:20:28 | FromGitter | <xmonader> problem is I can see sequential taking time, but it's logged as the best of them |
18:20:33 | FromGitter | <Yardanico> can you share the code? |
18:20:41 | FromGitter | <Yardanico> for this "benchmark" |
18:21:05 | * | taaperotassu joined #nim |
18:21:34 | FromGitter | <xmonader> https://gist.github.com/xmonader/fdbecbe01cb5ff349d994bc92dcc5945 |
18:21:50 | FromGitter | <xmonader> Maybe I'm doing smething wrong don't know |
18:24:19 | * | BigEpsilon joined #nim |
18:29:50 | * | vlad1777d quit (Ping timeout: 255 seconds) |
18:30:05 | * | haha_ joined #nim |
18:30:13 | FromGitter | <Yardanico> they all have the same time for me |
18:30:32 | FromGitter | <Yardanico> ```code paste, see link``` ⏎ ⏎ Almost the same time :) [https://gitter.im/nim-lang/Nim?at=59ad9bc8c101bc4e3a8c8319] |
18:30:57 | crem | I'm trying to use Table[string, MyObjRef not nil], it complains that it cannot prove it's initialized. :( |
18:31:02 | FromGitter | <Yardanico> yes |
18:31:09 | FromGitter | <Yardanico> not nil isn't bug-free yet |
18:31:41 | * | der joined #nim |
18:32:11 | FromGitter | <xmonader> @Yardanico How is that possible |
18:32:16 | FromGitter | <Yardanico> and I don't think CPU time is reliable |
18:32:24 | FromGitter | <Yardanico> it's "cpu time" |
18:32:28 | FromGitter | <Yardanico> not real time |
18:33:16 | FromGitter | <xmonader> okay how can i measure it? because in docs they say cpuTime - prev time |
18:34:34 | * | beatmox_ joined #nim |
18:34:35 | FromGitter | <Yardanico> ===```nim=== ⏎ ⏎ ===GlobalBenchmark relative time/iter iters/s=== ⏎ ⏎ ===GlobalBenchmark 294.84ps 3.39G=== ... [https://gitter.im/nim-lang/Nim?at=59ad9cbb210ac26920f48c5c] |
18:34:54 | FromGitter | <Yardanico> and sometimes "async" is even faster |
18:35:08 | FromGitter | <Yardanico> so it's something weird on your side really |
18:35:25 | FromGitter | <xmonader> maybe, it's a very old machine i'm using |
18:35:39 | FromGitter | <xmonader> I'll try it on my workmachine |
18:35:50 | FromGitter | <xmonader> but yes, you got more reasonable results |
18:37:06 | * | thomasross quit (Remote host closed the connection) |
18:37:24 | * | thomasross joined #nim |
18:37:35 | * | beatmox quit (*.net *.split) |
18:37:36 | * | niv quit (*.net *.split) |
18:37:36 | * | joshbaptiste_ quit (*.net *.split) |
18:37:37 | * | ehmry quit (*.net *.split) |
18:37:37 | * | byteflame quit (*.net *.split) |
18:37:37 | * | derlafff quit (*.net *.split) |
18:37:40 | * | beatmox_ is now known as beatmox |
18:39:31 | * | thomasross quit (Read error: Connection reset by peer) |
18:39:38 | * | Yardanico_ joined #nim |
18:39:42 | * | Yardanico_ quit (Client Quit) |
18:39:49 | * | BigEpsilon quit (Ping timeout: 255 seconds) |
18:40:01 | * | thomasross joined #nim |
18:41:35 | crem | There's no server-side doc search, is there? I wanted to have a chrome search shortcut like with any other search engine. (and if it's possible, it would be nice to have it auto-added). |
18:41:48 | * | def-pri-pub joined #nim |
18:41:48 | * | def-pri-pub quit (Changing host) |
18:41:48 | * | def-pri-pub joined #nim |
18:42:03 | * | Yardanico quit (Remote host closed the connection) |
18:42:38 | * | def-pri-pub quit (Client Quit) |
18:42:48 | crem | It may still be client-side, but if only there were a way to specify search term in URL (z.B. after '#') |
18:44:17 | * | niv joined #nim |
18:44:58 | * | Yardanico joined #nim |
18:45:23 | * | joshbaptiste_ joined #nim |
18:45:42 | * | Nikky quit (Quit: WeeChat 1.9) |
18:45:55 | Yardanico | crem, sadly no |
18:46:20 | FromGitter | <ephja> the index might be the next best thing |
18:46:30 | FromGitter | <Yardanico> well it doesn't contain proc comments |
18:46:59 | * | claudiuinberlin joined #nim |
18:47:14 | FromGitter | <ephja> right |
18:48:42 | * | ehmry joined #nim |
18:48:42 | * | byteflame joined #nim |
18:49:04 | crem | What is "nimsuggest" and how to install it? There is an aur pkg for it in arch, but maybe I should use some nimble (whatever it is). Or "Setup nimsuggest" menu item in sublime's nimlime should work? |
18:49:11 | FromGitter | <Yardanico> nonononoono |
18:49:16 | FromGitter | <Yardanico> how did you install nim? |
18:49:26 | crem | from aur. |
18:49:29 | Yardanico | crem, ah |
18:49:39 | Yardanico | then you should install nimsuggest from aur too |
18:49:48 | * | Nikky joined #nim |
18:49:49 | Yardanico | nimsuggest is a tool (mainly for IDEs) which allows IDEs to query nim compiler for autocompletion |
18:50:01 | Yardanico | so IDEs don't need to implement their own autocompletion |
18:50:08 | Yardanico | and it's integrated with the compiler so it know everything |
18:50:11 | * | Nikky quit (Client Quit) |
18:50:41 | Yardanico | crem, if you don't hate GUI IDEs - use VSCode with nim plugin |
18:50:53 | Yardanico | if you prefer console IDEs - try emacs or vim |
18:50:57 | crem | actually not from aur but from proper arch repo. |
18:50:59 | Yardanico | they have nim plugins too |
18:51:35 | crem | I use Sublime, it it's nimlime is good, i just feel that there's something more that I miss. |
18:51:38 | FromGitter | <k0pernicus> VSCode is the must for GUI IDEs |
18:51:50 | Yardanico | crem, yes, nimlime can use nimsuggest |
18:51:52 | FromGitter | <k0pernicus> The NIM plugin is really great also |
18:52:26 | * | Nikky joined #nim |
18:52:38 | crem | So fetching nimsuggest from aur |
18:52:41 | Yardanico | k0pernicus: install "vscode-icons" extension to get a lot more file icons :) |
18:52:50 | Yardanico | and there's also .nim file icon :) |
18:53:12 | FromGitter | <Yardanico> like this: |
18:53:13 | FromGitter | <Yardanico> (https://files.gitter.im/nim-lang/Nim/cErt/image.png) |
18:53:28 | FromGitter | <Yardanico> https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons |
18:53:51 | FromGitter | <k0pernicus> @Yardanico Already done ;-) |
18:54:02 | crem | arrrr it cannot compile nimsuggest for some reason. |
18:54:12 | crem | why cannot it just work. :-\ |
18:54:18 | Yardanico | because it's aur |
18:54:25 | Yardanico | it works if you compile nim yourself :) |
18:54:33 | Yardanico | and compiling nim yourself is very easy |
18:54:47 | FromGitter | <k0pernicus> @crem Compiling nim yourself is super-easy |
18:54:50 | FromGitter | <Yardanico> https://github.com/nim-lang/Nim ⏎ ⏎ all commands in readme |
18:54:53 | FromGitter | <Yardanico> and ./koch tools |
18:55:01 | FromGitter | <xmonader> @Yardanico so epochTime not cpuTime works for me |
18:55:04 | FromGitter | <Yardanico> to compile nimsuggest, nimble, and some other tools |
18:55:26 | crem | If I compile everything manually, I need to manually update and recompile things. That's not what I want to do. |
18:56:08 | Yardanico | crem, well it's not our fault that aur package doesn't work |
18:56:26 | FromGitter | <k0pernicus> Crem choosenim? |
18:56:29 | Yardanico | yeah |
18:56:31 | Yardanico | also +1 |
18:56:36 | Yardanico | crem, https://github.com/dom96/choosenim |
18:56:41 | Yardanico | curl https://nim-lang.org/choosenim/init.sh -sSf | sh |
18:56:43 | FromGitter | <k0pernicus> choosenim is really super-cool |
18:56:46 | Yardanico | to install chooseni |
18:56:47 | Yardanico | choosenim |
18:56:55 | Yardanico | it's nim version manager |
18:57:07 | crem | There's no pkg for it in aur, I'll wait for it. :) |
18:57:10 | FromGitter | <k0pernicus> Coming from Rust, choosenim is the `rustup` for Nim |
18:57:16 | FromGitter | <k0pernicus> crem ? |
18:57:23 | crem | ok, I don't need nimsuggest that much actually |
18:57:24 | FromGitter | <k0pernicus> Just a command and it’s done |
18:57:37 | Yardanico | crem, I use arch too, but I don't think it's really NEEDED to have packages for every file in your system :) |
18:57:42 | FromGitter | <k0pernicus> No AUR need for that... |
18:59:02 | FromGitter | <k0pernicus> Just a simple command (`curl https://nim-lang.org/choosenim/init.sh -sSf | sh`), it’s done :-) |
18:59:04 | Yardanico | and aur is "user" repository |
18:59:09 | crem | yes, running it |
18:59:39 | Yardanico | and then you'll need to add ~/.nimble/bin to path |
18:59:52 | Yardanico | don't say "why I should do this manually?" because it's really needed to let user do it manually |
19:00:05 | Yardanico | the amount of different shells on linux is.... big |
19:00:13 | crem | ok ok :) |
19:00:16 | FromGitter | <k0pernicus> @Yardanico An issue about that has been created :-) |
19:00:17 | * | xet7 quit (Ping timeout: 248 seconds) |
19:00:23 | Yardanico | even rust requires you to add it to path |
19:00:28 | FromGitter | <k0pernicus> Soon, choosenim will update your `PATH` itself |
19:00:35 | FromGitter | <k0pernicus> @Yardanico true |
19:00:38 | Yardanico | *rustup |
19:00:44 | Yardanico | well yeah it lets you choose |
19:00:56 | FromGitter | <k0pernicus> Yep |
19:01:04 | FromGitter | <k0pernicus> It’s planned |
19:01:46 | Yardanico | dom96, why it's named "Araq's wishlist" ? :) https://github.com/dom96/choosenim/milestone/1 |
19:02:08 | Yardanico | so this is what Araq wants to be implemented? |
19:03:44 | * | TjYoco quit (Ping timeout: 260 seconds) |
19:07:40 | * | Nikky quit (Quit: WeeChat 1.9) |
19:08:26 | * | Nikky joined #nim |
19:14:26 | * | nsf quit (Quit: WeeChat 1.9) |
19:17:49 | crem | Still looking where to add PATH to. :) |
19:17:58 | Yardanico | crem, .bashrc, .zshrc |
19:18:01 | crem | Probably need to create some .xsessionrc... |
19:18:04 | Yardanico | crem, |
19:18:04 | Yardanico | no |
19:18:17 | Yardanico | crem, PATH is added to your shell config file |
19:18:21 | crem | nope, I also want it outside of terminal |
19:18:27 | crem | outside of shell |
19:18:29 | Yardanico | crem, /etc/profile then |
19:18:33 | crem | in sublime |
19:18:40 | crem | /etc/profile is for all users |
19:18:44 | Yardanico | crem, https://wiki.archlinux.org/index.php/Environment_variables#Globally |
19:19:47 | crem | yeah, it says .xinitrc, and in another place it tells that it's actually wrong and I should use xsessionrc |
19:20:12 | crem | xprofile.. Will give it a try! |
19:21:48 | crem | I wonder if i should chmod +x it and add a shebang line.. |
19:21:54 | crem | Will find out! |
19:22:05 | Yardanico | crem, I don't know why your system is so complicated |
19:22:21 | FromGitter | <k0pernicus> (me neither actually…) |
19:22:37 | Yardanico | I've just set my PATH in /etc/profile to this |
19:22:38 | Yardanico | PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/home/tiber/nim/bin:/home/tiber/.nimble/bin" |
19:23:09 | Yardanico | in /etc/profile file |
19:24:54 | crem | it works with .xprofile. |
19:25:02 | Yardanico | I don't know what .xprofile is :) |
19:26:24 | crem | That's the recommended place to add things to PATH. I probably should have created symlinks from ~/bin though. If I'd need to add something in PATH for all kinds of software, it would quickly become unmanageable. |
19:26:57 | Yardanico | well I don't need to add some software to global system path |
19:27:12 | Yardanico | because I mostly use all software in console (because on linux almost everything is a terminal command) |
19:27:15 | crem | like programming languages |
19:28:12 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:28:54 | crem | "not nil" doesn't work if type defined later (in the same type block), is it intended? |
19:29:03 | * | haha_ quit (Quit: haha_) |
19:29:35 | Yardanico | crem, can you give an example? |
19:30:01 | * | claudiuinberlin joined #nim |
19:30:16 | crem | https://pastebin.com/M5udzUi4 |
19:30:33 | Yardanico | well yeah |
19:30:36 | Yardanico | you can't do that AFAIK |
19:31:05 | FromGitter | <mratsim> On Arch I create a package for everything, it’s part of the Arch philosophy I think :p. Every single python package I find on git/pip I create an Arch package for it. Pacman is just too nice |
19:31:18 | Yardanico | well I'm lazy |
19:31:27 | Yardanico | crem, and also consider posting your code to gist maybe :) pastebin is really not the best thing for code pasting |
19:31:37 | Yardanico | ads/many JS scripts |
19:31:52 | crem | I was trying to rememeber what was that thingy that you recommended but couldn't |
19:32:11 | Yardanico | well gist is quite popular |
19:32:13 | Yardanico | gist.github.com |
19:32:24 | Yardanico | so gist takes 1.7 sec to load for me FULLY with disabled browser cache |
19:32:45 | Yardanico | and pastebin takes 4 seconds (with adblock enabled) or 7 seconds with adblock disabled |
19:33:18 | crem | pastebin takes 2.1s for me, not that different :) |
19:33:23 | Yardanico | well it's just a suggestion |
19:33:30 | Yardanico | crem, did you check with disabled browser cache? |
19:33:37 | crem | ok, i'll try to remember it |
19:34:12 | crem | yes, now it's 1.9 :) |
19:34:28 | Yardanico | well pastebin is just not very nice |
19:34:29 | crem | ah, it was disabled and I've just enabled it |
19:35:01 | crem | because I did some typescipt/angular dev last month. |
19:35:47 | crem | typescript is well, that yet another transpieler like nim :-P |
19:35:59 | Yardanico | crem, no jokes like this pls :D |
19:37:31 | crem | but back to https://pastebin.com/M5udzUi4 it's not entirely obvious for me why the last example is impossible but first two possible. |
19:38:04 | * | ipjk quit (Quit: Leaving) |
19:38:14 | Yardanico | crem, second example isn't possible too |
19:38:20 | Yardanico | ah wait sorry |
19:38:23 | Yardanico | it works too |
19:40:40 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:40:48 | Arrrr | https://github.com/nim-lang/Nim/commit/8ce42738648e70e562e7f1bbe925257cddf0b392 |
19:40:54 | Arrrr | Ujj, this is going to break a lot of things |
19:41:05 | Arrrr | For example, https://nim-lang.org/docs/ospaths.html#DirSep |
19:41:07 | Yardanico | oh yes |
19:41:22 | Yardanico | why DirSep? |
19:41:31 | Yardanico | ehm |
19:41:41 | * | claudiuinberlin joined #nim |
19:41:48 | Yardanico | Arrrr, you're quite wrong |
19:41:54 | Yardanico | os imports and exports ospaths |
19:42:00 | Yardanico | and it was previously also including it |
19:42:05 | Yardanico | https://github.com/nim-lang/Nim/commit/8ce42738648e70e562e7f1bbe925257cddf0b392#diff-2fd1cb6fa2de35053b75e69dcddfd419R29 |
19:42:10 | FromGitter | <adamrezich> i'm having trouble calling a proc that takes both a type generic parameter and a static[int], as well as other regular parameters https://pastebin.com/mTVKjJiF what am I missing here? |
19:42:14 | Arrrr | You are right. Then everythig is ok |
19:43:17 | Yardanico | adamrezich: can you provide some example with full code? |
19:43:33 | Arrrr | I said DirSep because sometimes i import os just for DirSep, CurDir, etc, and i thought i'd need to replace the imports |
19:43:53 | Yardanico | Arrrr, well I quite like / proc |
19:43:55 | Yardanico | for paths |
19:46:54 | FromGitter | <adamrezich> @Yardanico: I'm making a complex game engine with an entity-component system, and my `register()` function registers a component with the system. right now I'm not using the `static[int]` in my code here https://github.com/rezich/nch/blob/master/src/nch.nim#L188 and it works just fine, but I'd like to include a `static[int]`so the user who's making a game with the engine can specify at compile-time how many component |
19:46:54 | FromGitter | ... instances fit in a "page" (static array) of memory (when you allocate more than the "expected" number, it makes another page, but for performance reasons you ideally want all instances of the same component to fit in the same page) |
19:47:21 | Yardanico | why make it static int? |
19:47:52 | Yardanico | newSeq just uses int for specifying seq size (how many will be allocated) |
19:48:06 | crem | How to properly use "not nil"? https://gist.github.com/mooskagh/58369a034b165a795a69a69d487a5ef9 |
19:48:08 | crem | well |
19:48:12 | crem | no need to answer that |
19:48:30 | Yardanico | crem, not nil is still buggy sadly |
19:49:00 | FromGitter | <adamrezich> @Yardanico I don't want to use seqs, I used them initially but then I switched over to the page system to avoid reallocating. I'd really like to use static arrays |
19:49:11 | Yardanico | ah |
19:49:30 | * | Vladar quit (Quit: Leaving) |
19:49:52 | * | TjYoco joined #nim |
19:50:02 | FromGitter | <adamrezich> I'm just confused by the syntax, why does it want me to stick the static[int] both in the square brackets and as a regular parameter? |
19:50:33 | Yardanico | adamrezich: https://nim-lang.org/docs/manual.html#special-types-static-t |
19:51:02 | Yardanico | or the purposes of code generation, all static params are treated as generic params - the proc will be compiled separately for each unique supplied value (or combination of values). |
19:52:17 | FromGitter | <adamrezich> I get that, and I see now also that part of my problem is I didn't get that you use semicolons to separate generic parameters, that makes sense |
19:52:25 | FromGitter | <adamrezich> I just don't get why I have to stick it in both places? |
19:52:45 | Yardanico | because it's like a generic param |
19:53:25 | Yardanico | I think you'll able to implement the thing that you want with runtime ints |
19:53:46 | Yardanico | and btw |
19:54:02 | Yardanico | seq internally is an object (struct) like (len, arrayOfData) |
19:54:17 | * | couven92 joined #nim |
19:54:47 | FromGitter | <adamrezich> sure but when you expand it, everything gets copied over into a new buffer, right? |
19:55:03 | FromGitter | <k0pernicus> Is it possible to « deconstruct » a couple like that ? ⏎ ⏎ ```let info, path = res_from_walkdir``` [https://gitter.im/nim-lang/Nim?at=59adaf979acddb24070115a4] |
19:55:18 | Yardanico | yes |
19:55:26 | Yardanico | if this proc returns a tuple |
19:55:33 | Yardanico | you can do let (info, path) = res_from_walkdir |
19:55:35 | Yardanico | or if this is a tuple |
19:56:05 | * | Arrrr quit (Ping timeout: 240 seconds) |
19:56:18 | FromGitter | <k0pernicus> Ah yeah, I forgot parenthesis arount my new variables, sorry for that... |
19:56:23 | FromGitter | <k0pernicus> Thanks @Yardanico :-) |
19:57:56 | Araq | adamrezich: seqs copy when the capacity cannot hold e |
19:57:59 | Araq | another element |
19:58:25 | Araq | the capacity is multiplied with a factor of 1.5 |
19:58:31 | FromGitter | <adamrezich> right, they're basically analogous to std::vector, right? |
19:58:35 | Araq | yes |
19:58:48 | * | couven92 quit (Client Quit) |
20:00:15 | FromGitter | <adamrezich> yeah so I get that, but I want to avoid that, I want to use this "pages of memory" system instead (page = static array with a pointer to another page in case of overflow). I've got it all implemented and working just fine, but now I want to change the system from having one global "pagesPerComp" constant into having a constant per component type, which means passing a static[int] through various procs |
20:00:31 | FromGitter | <adamrezich> and I'm just confused as to why I have to specify the value both in the [] and in the () |
20:00:51 | FromGitter | <adamrezich> *compsPerPage |
20:01:33 | Yardanico | well static[int] works without [] for me in simple cases |
20:02:15 | crem | What does 'm' stand for in mgetOrPut? |
20:02:28 | Yardanico | "modify" |
20:02:45 | Yardanico | it's actually in doc comment |
20:02:50 | Yardanico | https://nim-lang.org/docs/tables.html#mgetOrPut,Table[A,B],A,B |
20:02:53 | Yardanico | retrieves value at t[key] or puts val if not present, either way returning a value which can be modified. |
20:03:18 | Yardanico | so you can modify value returned from this proc, and it will be changed in table |
20:03:33 | TjYoco | What's the proper way to assign a value to a field of an object that's contained within a seq[T] of another object? One way I got a list where each object was a copy of the last object I tried adding to the list and the other way I get an error saying I can't assign a value to it. Sorry if I worded this poorly.. |
20:03:58 | TjYoco | I think I'm just very confused about ref objects |
20:04:02 | Yardanico | TjYoco, best wording would be the code you're trying to ged running :) |
20:04:03 | Yardanico | *get |
20:04:43 | TjYoco | one sec! Im sure this will be embarrassing for me |
20:05:15 | Araq | use 'param: var T' instead of 'param: T' |
20:05:32 | Araq | if you need to modify it |
20:10:31 | crem | There's not way to "init Table" when the variable already there, only assign a new "inited Table", right? |
20:11:23 | crem | if I have var x: Table[string, MyObj], the only thing I can do is x = initTable[string, MyObj](), right? |
20:11:46 | crem | Is there a way to avoid need of typing [string, MyObj] twice? |
20:11:51 | Yardanico | crem, yes -_-? |
20:11:59 | Yardanico | var x = initTable[string, MyObj]() |
20:12:00 | Yardanico | or |
20:12:10 | TjYoco | here's my issue from earlier: https://pastebin.com/eB5ABWnD . Sorry, <Araq> I'm not sure where that would go. |
20:12:14 | Yardanico | var x: auto |
20:12:21 | Yardanico | x = initTable[string, MyObj]() |
20:12:24 | Yardanico | but first one is better |
20:12:37 | crem | x is object field actually |
20:12:47 | Yardanico | ah |
20:13:59 | crem | so no way to avoid typing [string, MyObj] twice? |
20:14:21 | Yardanico | crem, well I don't really see bad things here |
20:14:34 | Yardanico | nim greatly removes a lot of boilerplate already |
20:14:36 | Yardanico | with templates/macros |
20:14:53 | Yardanico | well you can always make a feature request |
20:14:54 | crem | That's the most frequent answer on #go-lang too! |
20:15:11 | Yardanico | crem, well because making compiler overly smart would make it slower and harder to maintain |
20:15:11 | crem | "I don't see a problem here, that's by design!" |
20:16:12 | crem | I don't buy that argument too. Compiler and development complexity is a tradeoff, we don't optimize just for compiler simplicity. |
20:16:33 | Araq | ok, patch the compiler to allow that then |
20:16:51 | crem | I need to learn nim basics first :) |
20:16:57 | Araq | can't be hard since you don't "buy that argument" |
20:17:04 | Yardanico | crem, well nim already does almost the best compiler complexity / developer speed |
20:17:05 | FromGitter | <k0pernicus> crem you know, you can propose an RFC ;-) |
20:17:24 | * | xet7 joined #nim |
20:17:30 | Yardanico | also program performance to development speed ratio |
20:18:02 | FromGitter | <k0pernicus> (true - coming from Rust to Nim - better compiler complexity/developer speed EVER) |
20:18:12 | Yardanico | how many KLOC does Rust compiler have? |
20:18:36 | FromGitter | <k0pernicus> Wow |
20:18:38 | FromGitter | <k0pernicus> I don’t know |
20:18:41 | crem | Araq: Well, if you told me that particular feature is not there because it makes compiler too complex, I would buy it. But Yardanico says that argument not the first time, and it's not obvious for me that in that particular cast that is the reason it's done one way and not another. |
20:18:43 | FromGitter | <k0pernicus> I will check |
20:19:02 | crem | s/cast/case |
20:19:02 | Araq | actually I find this annoying too |
20:19:17 | Araq | and I know it's not that hard to implement :P |
20:19:31 | Araq | but I cannot see a syntax for it |
20:19:32 | FromGitter | <Bennyelg> there is a built in "magic" variable on golang called result? |
20:19:52 | Araq | Bennyelg: no. |
20:19:57 | FromGitter | <k0pernicus> @Bennyelg don’t think so |
20:20:13 | * | xet7 quit (Read error: Connection reset by peer) |
20:20:25 | FromGitter | <k0pernicus> But I know they plan to implement this feature with generics... |
20:20:30 | FromGitter | <k0pernicus> ( :-) ) |
20:20:39 | FromGitter | <Bennyelg> :D |
20:20:55 | FromGitter | <Bennyelg> what is the best argparse library out there? |
20:21:00 | FromGitter | <Bennyelg> I need something |
20:21:06 | * | xet7 joined #nim |
20:21:06 | Araq | obj.field: initTable[?, ?]() |
20:21:33 | Yardanico | wait what? |
20:21:49 | crem | obj.field.init() ? :) |
20:21:51 | FromGitter | <Bennyelg> cli arg parser |
20:22:06 | Araq | I use parseopt |
20:22:16 | Yardanico | Bennyelg: if you want something more python-like https://github.com/docopt/docopt.nim |
20:22:21 | crem | Or maybe some notion of constructors... hm... |
20:22:28 | Yardanico | because it's a port of docopt to Nim :D |
20:22:35 | FromGitter | <Bennyelg> what is the different between parseopt2 and parseopt lol |
20:22:41 | FromGitter | <Bennyelg> thanks Yardanico I'll see now |
20:22:50 | Araq | crem: Java has constructors and yet the same problem. stop pretending it's about constructors when it's clearly not. |
20:23:01 | Araq | parseopt2 will die |
20:23:24 | Yardanico | Araq, it will be renamed to parseopt? |
20:23:39 | Yardanico | ah I see |
20:23:46 | Araq | I said 'die', not 'renamed' |
20:23:55 | Yardanico | parseopt2 is a higher-level implementation |
20:24:21 | FromGitter | <Bennyelg> docopt looks fantastic |
20:24:28 | FromGitter | <Bennyelg> I 'll take it :p |
20:24:31 | crem | but if initObj were methods rather then factories, it would work. They wouldn't be able to be used in object initialization though.. |
20:24:57 | Araq | how so? it doesn't work in Java either |
20:25:07 | Araq | or C# |
20:25:45 | Araq | I guess I jsut don't understand you. construction by definition cannot use "method" |
20:25:46 | crem | I mean if it was proc init(self: var Obj) |
20:25:47 | * | Yardanico quit (Remote host closed the connection) |
20:25:49 | Araq | (dynamic binding) |
20:26:09 | crem | var x: Obj; x.init() |
20:26:19 | crem | var x: Table[string,string]; x.init() |
20:26:41 | Araq | that only works for vars which have no problem |
20:26:47 | Araq | it fails for object fields |
20:27:06 | Araq | var x = initTable[string, string]() |
20:27:34 | Araq | can you imagine this has been discussed already and guys like you lost the argument? |
20:27:48 | Araq | it was discussed to death, in fact. |
20:28:30 | * | vlad1777d joined #nim |
20:29:01 | crem | Ok, I'm not trying to convince anyone, I don't know why it always ends up looking like that! I only wanted to know whether something was possible or not, and what's the most correct way to do something. |
20:30:41 | crem | I mean usually I try something (incorrectly), it fails for me, and I'm asking why this doesn't work. |
20:32:30 | crem | like if I have "not nil" field in Obj, I seem to not being able to use new(result) in newObj(). I suppose I'm supposed to do return Obj(all fields listed) instead. |
20:32:35 | * | miran quit (Ping timeout: 240 seconds) |
20:33:55 | * | nsf joined #nim |
20:34:13 | FromGitter | <Yardanico> Do you use new result in a non-ref object? |
20:34:30 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:34:35 | FromGitter | <Yardanico> If your object is "object", you don't need new |
20:34:56 | FromGitter | <Yardanico> You can directly assign to your object like |
20:35:04 | FromGitter | <Yardanico> result.field = 1 |
20:35:06 | crem | newObj() returns ref Obj. |
20:35:38 | FromGitter | <Yardanico> Ah, you mean with not nil |
20:36:15 | Araq | crem: yeah, pretty much |
20:36:23 | Araq | how else would it work? |
20:38:32 | crem | if newObj() was some kind of special function, like "constructor", those not nil could be enforced only at it return point. :) In the middle of the "constructor" the object is considered not fully constructed, so some restrictions may be relaxed. Also immutable fields (are there those?) could be mutable, for example. |
20:42:08 | Araq | yeah that's completely not how such an analysis would work |
20:42:49 | Araq | 1. you need to prevent 'x.field' from being read before written (or not read at all in a constructor) |
20:43:07 | Araq | 2. you need to ensure every control flow path sets x.field (or forbid control flow) |
20:43:35 | Araq | 3. you need to ensure x.field is not passed to a proc by 'var T' because that could read it before writing it |
20:43:54 | FromGitter | <Bennyelg> anyone has something with fetching arugments from script run |
20:44:05 | Araq | 4. you need to ensure that 'addr x.field' cannot do harm |
20:44:13 | FromGitter | <Bennyelg> x.nim --file /path/to_file/... |
20:44:31 | Araq | x.nim --file:/path/to_file/... |
20:44:49 | crem | fine, so there is a plan of what should be done. :-P |
20:46:53 | Araq | I prefer my own plans that are not based on "oh, nice Fata Morgana here, how refreshing" |
20:48:23 | * | ofelas quit (Quit: shutdown -h now) |
20:54:31 | * | vlad1777d quit (Remote host closed the connection) |
20:54:35 | * | mahmudov quit (Ping timeout: 240 seconds) |
20:56:16 | * | vlad1777d joined #nim |
20:57:33 | * | Kingsquee joined #nim |
20:58:32 | crem | https://gist.github.com/mooskagh/66a7f80bb8869fadadaee2ca50d99694 is it ok to create throwaway Tables with initTable (like in variant 1). Variant 2 is much more verbose (and also it has two lookups per key, which I don't like). |
21:06:13 | FromGitter | <Bennyelg> hey, zipping list any easy way? |
21:06:38 | TjYoco | is there an easy way to set a ref object |
21:06:54 | TjYoco | objects fields to the same as a corresponding object |
21:08:15 | TjYoco | like var r: refObj = new o |
21:08:32 | TjYoco | where o has already been set as an Obj |
21:09:18 | FromGitter | <Yardanico> @Bennyelg use zip? From sequtils |
21:13:15 | FromGitter | <Bennyelg> what I am missing ⏎ ⏎ ```var elements = map(s, proc(i: int, x: string): = i mod 2 == 0)``` [https://gitter.im/nim-lang/Nim?at=59adc1ebb16f264642061be1] |
21:13:31 | FromGitter | <Bennyelg> I want to take all the even places from the list and put it on new list elements |
21:18:40 | FromGitter | <Yardanico> Firstly - use mapIt if you want to construct new sequence |
21:19:13 | FromGitter | <Bennyelg> anyone can share some code example (but good one) with nim argparse |
21:19:36 | FromGitter | <Yardanico> Well no, you can still use map |
21:19:43 | FromGitter | <Yardanico> But mapIt is nicer |
21:19:47 | FromGitter | <Yardanico> E.g |
21:19:57 | * | PMunch quit (Quit: leaving) |
21:20:13 | FromGitter | <Yardanico> var elements = data.mapIt(it mod 2 == 0) |
21:21:35 | * | Sentreen quit (Ping timeout: 240 seconds) |
21:22:24 | FromGitter | <Yardanico> Ah sorry |
21:22:30 | FromGitter | <Yardanico> You don't want to use map |
21:22:43 | FromGitter | <Yardanico> Use keepIfIt |
21:23:28 | FromGitter | <Yardanico> "anyone can share some code example (but good one) with nim argparse" you mean parseopt? |
21:34:02 | * | gangstacat joined #nim |
21:34:47 | * | Sentreen joined #nim |
21:42:20 | * | SerenityStyle joined #nim |
21:45:41 | * | Serenit0r quit (Ping timeout: 240 seconds) |
21:49:47 | * | Serenit0r joined #nim |
21:52:41 | * | SerenityStyle quit (Ping timeout: 240 seconds) |
21:54:12 | * | vlad1777d quit (Remote host closed the connection) |
21:55:55 | * | vlad1777d joined #nim |
21:56:09 | * | relax joined #nim |
21:59:15 | * | francisl joined #nim |
21:59:52 | * | endragor joined #nim |
22:04:01 | * | endragor quit (Ping timeout: 240 seconds) |
22:09:26 | FromGitter | <abijahm> guys any reason why this fails ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59adcf169acddb2407019349] |
22:15:09 | FromGitter | <abijahm> in nim 0.17.1 ⏎ the error is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59add06dbac826f0547da320] |
22:15:53 | FromGitter | <abijahm> but it works in a non async |
22:18:28 | * | Serenitor joined #nim |
22:20:48 | * | Serenit0r quit (Ping timeout: 248 seconds) |
22:21:38 | * | Kingsquee quit (Remote host closed the connection) |
22:22:03 | * | Kingsquee joined #nim |
22:24:50 | * | Ven joined #nim |
22:25:13 | * | Ven is now known as Guest88896 |
22:28:35 | FromGitter | <abijahm> using sequence works, did not see this https://github.com/nim-lang/Nim/issues/2361 |
22:31:05 | * | gokr quit (Ping timeout: 240 seconds) |
22:38:05 | * | nsf quit (Quit: WeeChat 1.9) |
22:44:05 | * | relax quit (Ping timeout: 240 seconds) |
22:45:58 | * | TjYoco quit (Quit: Page closed) |
22:53:18 | * | Guest88896 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:55:20 | * | cspar_ joined #nim |
23:08:24 | * | mahmudov joined #nim |
23:09:29 | * | thomasross quit (Remote host closed the connection) |
23:09:56 | * | thomasross joined #nim |
23:14:14 | * | gmpreussner quit (Ping timeout: 255 seconds) |
23:15:25 | * | gmpreussner joined #nim |
23:33:35 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
23:36:57 | * | def-pri-pub joined #nim |
23:36:57 | * | def-pri-pub quit (Changing host) |
23:36:57 | * | def-pri-pub joined #nim |
23:42:23 | * | yglukhov quit (Remote host closed the connection) |
23:48:32 | * | nattefrost quit (Remote host closed the connection) |