00:00:33 | * | dddddd quit (Ping timeout: 260 seconds) |
00:01:16 | * | vendethiel- joined #nim |
00:02:47 | * | vendethiel quit (Ping timeout: 264 seconds) |
00:11:15 | * | vendethiel- quit (Ping timeout: 268 seconds) |
00:13:23 | * | dddddd joined #nim |
00:15:09 | * | vendethiel joined #nim |
00:18:03 | * | hcorion quit (Quit: Konversation terminated!) |
00:20:59 | dom96 | wow, I just bootstrapped devel with Nim 0.14.3 |
00:34:01 | * | Tiberium quit (Remote host closed the connection) |
00:40:58 | * | gokr quit (Ping timeout: 240 seconds) |
00:44:20 | * | Kingsquee joined #nim |
00:44:21 | * | nsf quit (Quit: WeeChat 1.7) |
00:47:56 | dom96 | Live scores are working! http://picheta.me/snake/ |
00:47:58 | dom96 | :D |
00:51:45 | FromGitter | <TiberiumPY> Can I play without keys? |
00:51:59 | FromGitter | <TiberiumPY> On android :) |
00:52:07 | dom96 | heh, not yet. It's on my to do list |
00:53:14 | FromGitter | <TiberiumPY> If you will do it - I will happy to test it on my phone. Android 6 and latest Chrome |
00:53:28 | FromGitter | <TiberiumPY> Also, game works on my phone |
00:53:35 | FromGitter | <TiberiumPY> I just need the controls :) |
00:55:52 | dom96 | Araq: You can pause with P btw :P |
00:56:42 | Araq | wasn't me. somebody else named himself Araq |
00:56:55 | FromGitter | <TiberiumPY> LOL |
00:57:12 | Araq | ugh, stupid time change |
00:57:31 | dom96 | hah |
00:57:42 | dom96 | oh shit, yeah. Time change :\ |
01:01:33 | dom96 | yay, it's 3am D: |
01:02:27 | FromGitter | <TiberiumPY> Are you in Europe? |
01:02:50 | FromGitter | <TiberiumPY> Because it's 4 AM for me in Russia :) |
01:03:28 | Araq | hardly real russia when the time diff is only one hour ;-) |
01:04:11 | dom96 | oh well, I shall implement touch controls tomorrow |
01:04:12 | dom96 | good night |
01:04:55 | FromGitter | <TiberiumPY> Araq - Central Russia has UTC+3 timezone |
01:05:29 | Araq | I know. |
01:05:31 | Araq | good night. |
01:32:25 | FromGitter | <TiberiumPY> Hmm, I want to experiment with Nim - look at this C++ https://github.com/AimTuxOfficial/AimTux/blob/master/src/AimTux.cpp |
01:32:57 | zachcarter | damn ate myself |
01:33:13 | FromGitter | <TiberiumPY> How to make the same for "int *attribute*((constructor)) AimTux it()" |
01:35:43 | FromGitter | <TiberiumPY> So *some* code will be called when my dynamic library is loaded |
01:35:55 | FromGitter | <TiberiumPY> into other process |
01:36:15 | demi- | that is a linker flag you will have to supply to define the init of the library |
01:37:48 | * | chemist69 quit (Disconnected by services) |
01:37:53 | * | chemist69_ joined #nim |
02:23:10 | * | dddddd quit (Ping timeout: 240 seconds) |
02:37:05 | * | dddddd joined #nim |
03:08:11 | * | BitPuffin|osx quit (Ping timeout: 264 seconds) |
03:18:48 | * | arnetheduck joined #nim |
03:41:32 | * | def-pri-pub joined #nim |
03:41:53 | def-pri-pub | Just updated the stopwatch package to v3.4, I fixed a really bad bug for the Js target |
03:42:08 | * | chemist69_ quit (Ping timeout: 258 seconds) |
03:46:44 | * | chemist69 joined #nim |
03:49:10 | zachcarter | nice |
03:53:04 | zachcarter | starting on a main menu for a space shooter sample game : http://imgur.com/a/r3yVF |
04:35:11 | * | shashlick quit (Ping timeout: 268 seconds) |
04:36:56 | * | shashlick joined #nim |
04:43:57 | * | zachcarter quit (Quit: zachcarter) |
04:52:58 | * | Nobabs27 quit (Quit: Leaving) |
05:09:41 | * | dddddd quit (Remote host closed the connection) |
05:21:19 | * | bjz_ joined #nim |
05:22:50 | * | bjz quit (Ping timeout: 246 seconds) |
05:38:37 | * | bjz joined #nim |
05:39:36 | * | bjz_ quit (Ping timeout: 240 seconds) |
05:54:34 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:04:00 | def-pri-pub | /quit |
06:04:01 | * | def-pri-pub quit (Quit: leaving) |
06:09:04 | * | bjz joined #nim |
06:10:25 | * | Guest96845 joined #nim |
06:25:51 | * | Guest96845 quit (Quit: 'Goodbye') |
07:00:50 | * | Matthias247 joined #nim |
07:04:38 | * | user0___ joined #nim |
07:18:48 | * | rauss quit (Quit: WeeChat 1.7) |
07:25:00 | * | user0___ quit (Quit: user0___) |
07:32:54 | * | yglukhov joined #nim |
07:36:28 | * | yglukhov quit (Remote host closed the connection) |
07:39:42 | * | vlad1777d joined #nim |
07:51:49 | * | chemist69 quit (Ping timeout: 240 seconds) |
07:57:54 | * | Parashurama joined #nim |
07:58:39 | * | chemist69 joined #nim |
08:36:33 | * | vlad1777d quit (Remote host closed the connection) |
08:45:30 | * | user0___ joined #nim |
08:48:14 | * | Matthias247 quit (Read error: Connection reset by peer) |
08:49:28 | * | couven92 joined #nim |
08:51:18 | * | user0____ joined #nim |
08:52:53 | * | user0___ quit (Ping timeout: 256 seconds) |
08:54:25 | * | user0___ joined #nim |
08:55:59 | * | user0____ quit (Ping timeout: 246 seconds) |
08:56:22 | * | user0___ quit (Client Quit) |
09:14:10 | * | bungoman joined #nim |
09:29:25 | * | nsf joined #nim |
09:37:48 | * | user0___ joined #nim |
09:38:03 | * | user0___ quit (Client Quit) |
09:38:33 | euantor | That Snake game's pretty good dom96, was nice and smooth in Safari for me |
09:45:24 | couven92 | `{.importc: "#".}` is that how i say that a proc or const in nim is mapped to a C define? |
09:57:44 | * | gokr joined #nim |
09:58:02 | couven92 | ah, no, I guess {.importc: "SYMBOL".} is still the right way to go, right? even if the C source says: #define SYMBOL STH_MAGIC |
10:03:57 | dom96 | euantor: :D |
10:04:06 | dom96 | Glad to hear it :) |
10:04:52 | dom96 | I think I will save the highest score to make it a bit more fun when nobody is playing at the minute |
10:04:56 | Parashurama | Hey! |
10:05:18 | Parashurama | dom96: when you have some time can you take another look at https://github.com/nim-lang/zip/pull/17 |
10:05:19 | dom96 | I must admit though, it is a bit choppy in Firefox at times |
10:08:10 | Parashurama | I also tried the snake game, also with firefox. It work great, but the animation timing seems a slightly off, which means occasionally the snake won't turn when you meant to. |
10:14:50 | dom96 | Parashurama: merged |
10:15:11 | Parashurama | thanks |
10:15:33 | Parashurama | dom96: I also have a gzipfiles PR in the works |
10:16:09 | Parashurama | with read/write support. |
10:17:49 | dom96 | cool |
10:22:42 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:25:08 | couven92 | dom96, for the SChannel stuff, I'll need to import quite a lot of functions from the Win32 API... Is it legit to create a sspi.nim file in the lib/windows folder (next to winlean.nim) so that some of the stuff I use could be re-used for other Windows purposes, or should I just keep everything in a lib/wrappers/schannel.nim (next to openssl.nim) |
10:25:38 | couven92 | (sspi is the name of the Windows header that contains the Schannel stuff) |
10:25:50 | dom96 | Since it's Windows specific I think it should go into lib/windows |
10:27:19 | * | BitPuffin|osx joined #nim |
10:27:20 | couven92 | ok... I can follow the naming from the Windows header file that the nim source imports from? I think that makes the most sense... |
10:30:33 | * | federico3 quit (Quit: WeeChat 1.5) |
10:30:45 | * | federico3 joined #nim |
10:43:25 | cheatfate | couven92, do you know that on Windows XP, (which nim supports) schannel only supports deprecated cipher suites? |
10:43:54 | couven92 | Yes, I read that yesterday |
10:44:09 | cheatfate | so if you use nim program on windows xp, you will not be able to connect to modern https servers? |
10:44:40 | cheatfate | or if you create server, modern browsers will not connect to your server? |
10:45:04 | couven92 | Not if you use SChannel, but since you can always use OpenSSL if you want to, I don't see the issue |
10:45:48 | cheatfate | and i dont see the reason why this schannel must appears in nim stdlib, since nim supports windows xp, and this header will be security flaw for everybody uses it |
10:47:15 | couven92 | I am happy to create a nimble instead, but dom96 and Araq wanted to get rid of the openssl dependency for stuff like nimble... Since SChannel is a part of the Windows OS, it makes sense to prove that as an alternative |
10:47:43 | couven92 | s/prove/provide |
10:48:01 | cheatfate | but maybe dom96 and Araq made decision without full information? |
10:49:06 | dom96 | I don't think this is an issue we should be worrying about. Windows XP is deprecated or due to be deprecated. |
10:50:05 | couven92 | Agreed, that is also the reason, why SChannel was not updated by MS for WinXP |
10:50:09 | cheatfate | https://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0 |
10:50:24 | cheatfate | Windows XP users is 8%, and its more then Linux users count... |
10:52:48 | couven92 | Uhm, dom96, for the Windows header stuff... In wxNim PMunch, Araq and I used both the importc and header pragmas for all symbols... However, the winlean module does not use the header pragma at, but instead converts the entire symbol declaration to its corresponding nim declaration |
10:53:00 | couven92 | I should probably do it like winlean does, right? |
10:53:47 | dom96 | winlean uses dynlib |
10:53:52 | dom96 | You should use it too if you can |
10:54:12 | couven92 | Yes, of course I should, or else I would require people to have the Windows SDK installed (which might not be the case for compilers other than vcc) |
11:04:59 | couven92 | In Nim is there a way to say that a function takes a const string pointer instead of just a string pointer? |
11:05:35 | couven92 | Or is LPSTR just the same as LPCSTR in Nim? |
11:09:55 | * | Vladar joined #nim |
11:10:22 | * | bungoman quit (Quit: Leaving) |
11:12:53 | * | zachcarter joined #nim |
11:14:06 | dom96 | Not sure |
11:15:07 | * | zachcarter quit (Read error: Connection reset by peer) |
11:15:51 | * | zachcarter joined #nim |
11:30:33 | * | gokr quit (Remote host closed the connection) |
11:47:22 | * | bjz_ joined #nim |
11:49:17 | * | bjz quit (Ping timeout: 260 seconds) |
11:54:58 | * | Tiberium joined #nim |
12:01:34 | * | nsf quit (Quit: WeeChat 1.7) |
12:03:51 | * | chemist69 quit (Ping timeout: 256 seconds) |
12:04:11 | FromGitter | <Varriount> couven92: What are you trying to do, interface with C? |
12:07:08 | * | chemist69 joined #nim |
12:09:34 | Tiberium | I have a question - with --os:standalone GC is here or not? |
12:09:41 | Tiberium | Just want to try to build Nim for another OS |
12:11:09 | cheatfate | Tiberium, GC is always present |
12:11:25 | Tiberium | cheatfate, and what can I use with --os:standalone? almost nothing? |
12:12:00 | cheatfate | --os:standalone i dont know, but i think it will create plain binary (so not PE or ELF or any other format) |
12:13:16 | Tiberium | I want to compile Nim for a OS, where C library is called "newlib" |
12:14:08 | cheatfate | if it compatible with any other stdlib you don't need to standalone... |
12:14:23 | Tiberium | it's compatible, but not fully |
12:16:11 | * | couven92 quit (Ping timeout: 258 seconds) |
12:17:19 | cheatfate | then check it |
12:18:14 | * | dddddd joined #nim |
12:33:43 | * | couven92 joined #nim |
12:35:51 | * | vlad1777d joined #nim |
12:37:10 | * | yglukhov joined #nim |
12:41:36 | * | yglukhov quit (Ping timeout: 240 seconds) |
12:52:15 | * | rokups joined #nim |
13:04:59 | * | PMunch joined #nim |
13:14:17 | PMunch | Wowzer :S |
13:14:48 | PMunch | The article on Nim and cross-platform GUIs have gotten 17k views now |
13:15:05 | SusWombat | PMunch, yeah its a nice one |
13:15:17 | couven92 | Uhm: doccomments on proc parameters? |
13:15:17 | PMunch | Thanks :) |
13:15:22 | SusWombat | how to i "cast" a int to a uint? |
13:15:35 | def- | SusWombat: cast[uint](myInt) |
13:15:35 | PMunch | cast[uint](int) |
13:15:46 | def- | are you sure you want to cast and not convert? |
13:15:51 | def- | convert would be uint(myInt) |
13:16:04 | SusWombat | ah i guess i want to convert! thanks guys |
13:16:07 | PMunch | or myInt.uint since we have the unified call syntax :) |
13:16:26 | PMunch | couven92, what do you mean? |
13:16:35 | Tiberium | var matches: openarray[string] says openarray[string] is invalid type |
13:16:52 | Tiberium | I want to use re module - string.match(regexp, matches) |
13:16:53 | def- | Tiberium: openarray is not a type you can use |
13:17:07 | Tiberium | def-, how can I use re module? string.match(regexp, matches) |
13:17:08 | def- | Tiberium: you can have seq[string] or array with fixed size |
13:17:19 | couven92 | Is it possible to have doccomments on proc parameters... I am getting an error on the last parameter doccomment stating that instead of the ## it expects the closing paranthesis |
13:17:28 | def- | openarray just generalizes seq and array for passing as proc parameters |
13:17:54 | def- | couven92: haven't seen that used in nim code, so i guess not |
13:18:04 | SusWombat | PMunch, ah yeah that worked (x.uint8) thanks |
13:18:33 | couven92 | def-, so you cannot document the parameters of a proc??? Why the hell not???? |
13:18:47 | couven92 | That would just be stupid! |
13:19:47 | Tiberium | how can I remove first and last letter from my string? |
13:20:02 | Tiberium | ah, nvm |
13:20:07 | Tiberium | string[1..<string.high()] |
13:20:36 | def- | Tiberium: [1..^2] |
13:21:10 | * | bjz_ quit (Ping timeout: 240 seconds) |
13:21:25 | def- | couven92: docgen documentation is here: https://nim-lang.org/docs/docgen.html |
13:21:39 | * | bjz joined #nim |
13:22:08 | def- | couven92: Personally I think the granularity of describing each proc parameter is too low, I'd prefer a piece of text for the proc that explains how the params stand in releation to each other |
13:22:34 | couven92 | def-, yeah I was reading that, but there is nothing there on how to properly document a proc. Only on how to document a type and fields |
13:23:03 | couven92 | def-, I disagree, especially when documenting native C API functions that take 8 parameters! |
13:23:12 | Araq | couven92, dom96: I agree with cheatfate. Windows' SSL implementation is not good enough and that Nim supports Win XP well is one of its strengths. |
13:23:14 | couven92 | (or more) |
13:23:43 | couven92 | Araq, so no SChannel in nim stdlib? |
13:23:44 | Araq | let's not throw this away just because "nimble cannot find DLL" used to be a problem |
13:24:29 | dom96 | What's the problem with using OpenSSL on Win XP and SChannel on other Windows'? |
13:24:57 | Araq | couven92: it could be an alternative impl selectable with -d:someDefine but this is growing out of hands. then we need to support and test 2 different SSL implementations, meh |
13:25:33 | Tiberium | def-, ^2, not ^1 because last char is \0 |
13:25:34 | couven92 | Okay... so if we do SChannel support, it will be as a nimble |
13:25:39 | Tiberium | def-, ? |
13:25:42 | cheatfate | The main problem if you distribute your software which need to work on windows, you will need to put openssl inside of it, and if openssl is already inside of it, then why it needs schanel? |
13:26:14 | cheatfate | but if openssl is not bundled inside of package, then omg, it not works on windows xp/vista... wtf? |
13:26:50 | def- | Tiberium: counting from the front begins with 0, from the back with 1 |
13:27:12 | def- | (confuses me every time as well) |
13:27:14 | cheatfate | and this is not exception on windows xp/vista this error is hidden, because everything will work, until somebody can't connect to somewhere |
13:28:31 | Tiberium | does httpclient.request automatically follow redirects via "Location" header? |
13:28:49 | dom96 | Tiberium: get does |
13:28:58 | Tiberium | dom96, and post? |
13:29:07 | couven92 | Okay... I haven't done much besides reading and trying to understand dynlib so far... So if we don't want/need SChannel immediately, now would be the time to tell not to waste much effort on it... |
13:29:09 | dom96 | actually request does too nowadays |
13:29:10 | cheatfate | so question is open, do developer needs openssl or needs to put 4 packages on his website, package_x86.msi (with openssl), package_x86.msi (without openssl)... etc |
13:29:10 | zachcarter | is there an easy way to check if a field is present on an object? |
13:29:19 | zachcarter | referencing generics here |
13:30:40 | dom96 | couven92: There is no rush on it, but it would be a nice thing to have. So since you've already started please continue. |
13:30:46 | Tiberium | how do I set maxRedirects for httpclient instance? client.maxRedirects = 0 doesn't work |
13:30:59 | dom96 | Tiberium: In the constructor perhaps |
13:31:13 | couven92 | dom96, But it seems like it would be a nimble package rather than a stdlib feature... |
13:31:14 | Tiberium | dom96, thanks :) |
13:31:33 | Araq | couven92: https://github.com/nim-lang/Nim/pull/5575 you should finish this one first anyway ;-) |
13:32:58 | Araq | --os:standalone is orthogonal to --gc:none |
13:33:05 | couven92 | Araq, isn't that one done? You said, that I should put vswhere support in the next PR... cheatfate found out that it is easy to do in nim, so that one will come very quickly (but it will only give us VS2017 support in addtion) |
13:33:06 | dom96 | couven92: To be honest I'm not sure that it can work as a nimble package. If it's not in the stdlib then httpclient cannot use it. |
13:33:22 | couven92 | dom96, true that... |
13:34:02 | Araq | couven92: it's hard to review |
13:34:03 | Tiberium | ok, another question - how to post form data via request? just like body = $%*{"email": login, "pass": password} for example? |
13:34:24 | Araq | sure it can work as a nimble package. patchFile ftw |
13:34:40 | Tiberium | I mean client.request(url, httpMethod= HttpPost, body = $ %*{"email": login, "pass": password}) |
13:34:52 | dom96 | Tiberium: You can use something like this I think: https://nim-lang.org/docs/httpclient.html#using-http-post |
13:35:47 | couven92 | ok, sry... :P I have restructured the original vccenv implementation... there quite a lot has changed... But the new vccexe modules allow much nicer integration than before... just in case MS throw yet another variation on the tooling at us in the future |
13:36:46 | Tiberium | hmm, still doesn't work.. is there any way I can see what does httpclient send and receive? some debug mode |
13:37:24 | dom96 | Tiberium: You can add some echo's into the stdlib's source code |
13:38:14 | Tiberium | dom96, ok |
13:38:54 | Araq | another point: we should have a native SSL implementation eventually, like Go does. |
13:39:03 | Araq | no dependencies, no cry |
13:39:19 | Araq | and different security issues than OpenSSL ;-) |
13:39:29 | Araq | (hopefully fewer *cough* ) |
13:39:48 | zachcarter | question : is there a way to check whether a generic has a field or not? |
13:40:06 | Araq | zachcarter: when compiles(x.field): |
13:40:17 | zachcarter | thank you |
13:40:18 | couven92 | Araq, couldn't we bundle the C source of OpenSSL into Nim (instead of the dll/lib)... That could be a starting point at least |
13:40:39 | dom96 | We're probably better off waiting on https://bearssl.org/ to be finished |
13:41:59 | Araq | couven92: would be an option if Linux package managers wouldn't mind shipping C code, but they do. |
13:42:06 | dom96 | This SSL crap is really a PITA though. On my OSX for example, the version of OpenSSL it comes with fails to load nim-lang.org |
13:42:36 | couven92 | Araq, ah... I understand |
13:42:38 | dom96 | Araq: So we don't bundle it on Linux |
13:42:42 | dom96 | Just on Windows and OS X |
13:43:16 | dom96 | Keeping the C sources of OpenSSL in Nim's repo sounds horrible though |
13:43:32 | couven92 | Araq, is there a way to provide doccomments on the individual fields of an enum? The parameters of a proc? |
13:43:40 | Araq | we don't have to do that, koch can bundle anything with the installers |
13:44:04 | Araq | individual fields of an enum? see the stdlib for plenty of examples |
13:44:34 | Araq | parameters of a proc: easy but has no special syntax |
13:44:40 | Araq | param |
13:44:46 | Araq | Description of the param. |
13:45:00 | Araq | I forgot the name RST uses for this construct. |
13:45:15 | Araq | definition list or something. |
13:45:24 | couven92 | Hmm... ok, then I must have done sth else wrong... |
13:45:50 | couven92 | Araq, I am adding doccomments to the vccexe stuff... Would that help for your PR review? |
13:46:29 | Araq | well maybe add what is now different |
13:46:32 | Araq | and what works |
13:46:35 | Araq | and what still doesn't. |
13:46:45 | couven92 | oki doki |
13:47:47 | Araq | dom96: interesting that OSX is also affected but the previous planned improvements were all about Windows |
13:49:53 | dom96 | Araq: What are you insinuating? :P |
13:50:46 | dom96 | I think OS X also has its own native SSL implementation |
13:50:53 | dom96 | Which would also be a nice thing to wrap |
13:51:12 | dom96 | Racket seems to support it https://docs.racket-lang.org/osx-ssl/index.html |
13:52:54 | couven92 | Araq, doccomments on proc parameter don't seem to work. Nim states that is expects the closing parenthesis for the parameter declarations instead of the `##` |
13:53:09 | couven92 | What am I doing wrong? |
13:53:52 | dom96 | I also wouldn't be surprised if the DLL that we ship for openssl is outdated and suffers from the same bug. |
13:54:09 | * | nsf joined #nim |
13:55:54 | Tiberium | does httpclient automatically saves all cookies and sends them with new requests? |
13:56:45 | Tiberium | is there any http library in nimble? |
13:57:07 | dom96 | it doesn't |
14:00:59 | * | nightmared joined #nim |
14:01:48 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:02:35 | PMunch | Hmm, I'm reading the comments over on hackernews (thanks dom96 for posting there, I was wondering were all the page-views came from), and a lot of iOS users seems to have trouble with the page. Anyone on iOS that knows what they are talking about? |
14:06:54 | * | Ven joined #nim |
14:07:18 | * | Ven is now known as Guest84346 |
14:08:07 | dom96 | PMunch: Unfortunately I don't have an iOS device with me at the moment. FWIW it seems fine on an Android phone, although the static banner at the bottom is rather annoying :) |
14:08:32 | dom96 | I would look for any CSS/JS that changes scrolling behaviour, IIRC that's what they complained about |
14:09:06 | dom96 | couven92: So, will you work on SChannel even if it is destined to be a Nimble package? |
14:09:07 | PMunch | Yeah, I don't have any iOS devices either.. I've tested it on Android myself so I know that works fine :) |
14:09:20 | Tiberium | yeah |
14:09:28 | Tiberium | dom96, i'll report a bug now |
14:09:32 | PMunch | The static banner is collapsible but I'll look into collapsing it automatically on scroll |
14:09:45 | Tiberium | if there's multiple "Set-Cookie" in headers, httpcore saves only last header :( |
14:10:19 | Tiberium | I'll make a short repro with httpbin.org |
14:10:27 | couven92 | dom96, yes, I will... I think, I might even go ahead and write a Windows API nimble and get SChannel to depend on that,,, |
14:14:15 | euantor | What website is it? I have an iOS device I can test on if you want |
14:17:40 | dom96 | PMunch: I think you should either show it only at the top of the page or make it significantly smaller. |
14:17:57 | * | dom96 really dislikes this new trend of always visible banners |
14:18:00 | dom96 | Even on phones |
14:18:33 | PMunch | euantor, http://serv.peterme.net/devlog/cross-platform-guis-and-nim-macros.html |
14:19:06 | PMunch | dom96, hmm I dislike the top since it means you have to move your thumb all across the screen to interact with it.. |
14:19:14 | PMunch | That's why I put it on the bottom |
14:19:56 | PMunch | But how big is it for you? On my phone it only takes up the space of a line of text or so |
14:20:16 | euantor | https://usercontent.irccloud-cdn.com/file/gvJxmG2M/2017-03-26%2015.19.08.png https://usercontent.irccloud-cdn.com/file/nNe8L6Wt/2017-03-26%2015.19.32.png |
14:20:55 | PMunch | Yeah okay, so about the same size as for me |
14:21:08 | euantor | @PMunch That's how it displays on my iPhone. The banner at the bottom is collapsable, but the scrolling isn't as smooth as it usually is on iOS, and the code at the bottom is both not formatted correctly and cut off by the banner |
14:21:43 | PMunch | Oh, you can't scroll further than that code? |
14:21:58 | Tiberium | dom96, https://github.com/nim-lang/Nim/issues/5611 |
14:21:58 | euantor | no, that's as far as it'll go |
14:22:07 | Tiberium | that's a big issue for me |
14:22:07 | PMunch | Oh wow, yeah that's an issue |
14:23:45 | Tiberium | the fix would be to check if we have "Set-Cookie" header, and if it's here, append to it |
14:23:51 | * | nightmared quit (Quit: WeeChat 1.7) |
14:25:21 | dom96 | PMunch: Yes, but how often do people actually interact with this banner? |
14:25:33 | * | nightmared joined #nim |
14:25:48 | PMunch | Probably never to be honest. I just wanted it to look similar to it's web-version |
14:26:55 | dom96 | Yeah :) But hey, it's your blog. Just letting you know how I feel about these banners. |
14:27:33 | Tiberium | dom96, can you place some labels ? https://github.com/nim-lang/Nim/issues/5611 |
14:28:25 | dom96 | Tiberium: Sure. Wanna have a go at fixing it? I can help you out with where to look. |
14:28:36 | * | Guest84346 quit (Ping timeout: 240 seconds) |
14:28:41 | Tiberium | dom96, where headers are set? |
14:28:43 | Tiberium | httpcore? |
14:28:49 | PMunch | dom96, I really appreciate it :) I was just trying to have a style that was slightly different from all the sites that look 99% the same :P |
14:28:50 | dom96 | I think so, yeah. |
14:29:14 | dom96 | PMunch: Fair enough. I do like the look :) |
14:30:57 | * | yglukhov joined #nim |
14:31:11 | * | Ven_ joined #nim |
14:31:54 | dom96 | Btw http://picheta.me/snake/ |
14:31:57 | dom96 | Now supports touch |
14:32:43 | Tiberium | dom96, let me tryyy |
14:33:11 | dom96 | Might need to add buttons for Pause and New Game for mobile though |
14:33:13 | Tiberium | dom96, works |
14:33:18 | dom96 | On a keyboard that's just the P and N keys |
14:33:43 | dom96 | Also there is now a timed food item |
14:34:03 | dom96 | D: |
14:34:05 | dom96 | my server crashed |
14:34:48 | dom96 | I guess I should implement reconnections |
14:35:03 | PMunch | Yeah, I got disconnected :( |
14:35:20 | dom96 | https://gist.github.com/dom96/6afaff5200f1211c3038a1ce2b782d47 D: |
14:35:25 | PMunch | Pretty cool though :) |
14:35:58 | Tiberium | dom96, nice error |
14:36:52 | * | yglukhov quit (Remote host closed the connection) |
14:39:02 | dom96 | Yeah, looks like a GC problem. I guess I should try boehm. |
14:39:13 | dom96 | damn, died at 82 |
14:39:28 | dom96 | fighting against SusWombat :) |
14:41:24 | SusWombat | noooooooooooooooooooooooooooooooooooooooooo |
14:41:35 | SusWombat | 109 :/ |
14:42:16 | dom96 | heh |
14:42:25 | dom96 | Highest score ever I think |
14:42:38 | dom96 | I'm going to make the server track the highest score and show it as well |
14:42:50 | SusWombat | nice idea |
14:43:01 | Tiberium | dom96, but if someone cheat? xD |
14:43:15 | SusWombat | dom96, does the timed food give me full points even when it is nearly gone? |
14:43:23 | dom96 | SusWombat: Yeah |
14:43:26 | SusWombat | ok |
14:43:30 | dom96 | Tiberium: Then I will have to reset it :P |
14:43:39 | dom96 | Cheating would be easy right now |
14:44:01 | dom96 | I could send the game replay and verify it on the server but I think that would be overkill |
14:44:30 | dom96 | But yeah, need to implement reconnecting |
14:44:45 | dom96 | That way I can update the server without problems as well |
14:46:59 | dom96 | Also, seems the special food is not disappearing when you eat it |
14:48:25 | SusWombat | for me it does |
14:49:14 | PMunch | dom96, fixed at least some of the concerns over the design now. The static bar auto-scrolls, the code scrolling shouldn't be an issue any-longer, and I've got better styles for printing the site, plus it now renders without JS turned on. |
14:49:27 | PMunch | Or auto-shrinks rather |
14:49:28 | Tiberium | dom96, is there a way to have multi-line headers? |
14:49:55 | dom96 | SusWombat: It's only visible when your snake is short, otherwise it ends up expiring anyway :) |
14:50:00 | Tiberium | dom96, I mean one header with multiple lines |
14:50:13 | * | PMunch quit (Quit: leaving) |
14:50:14 | dom96 | Tiberium: I think you can separate the values with a semicolon |
14:55:48 | * | bjz joined #nim |
14:58:45 | * | yglukhov joined #nim |
14:59:16 | dom96 | Should reconnect now :D |
14:59:44 | * | yglukhov quit (Remote host closed the connection) |
15:00:59 | dom96 | Hopefully boehm will handle it better |
15:01:08 | * | vlad1777d quit (Remote host closed the connection) |
15:09:08 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:09:19 | * | yglukhov joined #nim |
15:11:02 | * | yglukhov quit (Remote host closed the connection) |
15:14:33 | SusWombat | Tiberium, any luck finding a site like codingame for nim btw? |
15:14:55 | Tiberium | SusWombat, no |
15:15:01 | Tiberium | SusWombat, but I hope for CodinGame to add it |
15:15:09 | Tiberium | since dom96 said they emailed him |
15:15:21 | couven92 | ok Araq, new commit to vccexe (https://github.com/nim-lang/Nim/pull/5575)... Added documentation and comments... Hope that helps |
15:15:33 | dom96 | Yeah, I emailed them back. |
15:15:41 | dom96 | Still haven't heard anything though |
15:19:54 | euantor | Any ideas why the compiler might give an error like `sysrandom.nim(124, 5) Error: type mismatch: got (int) but expected 'uint32'` when line 124 is a comment? |
15:20:03 | * | Ven joined #nim |
15:20:07 | euantor | Got me scratching my head, as I can't see anything obviously wrong |
15:20:26 | * | Ven is now known as Guest99943 |
15:20:30 | dom96 | are you sure line 124 is a comment? |
15:20:39 | dom96 | Maybe you modified something since the last compile? |
15:20:57 | euantor | Nope, 124 is definitely a comment |
15:21:09 | euantor | https://github.com/euantorano/sysrandom.nim/blob/master/src/sysrandom.nim#L124 |
15:22:26 | dom96 | oh, it's because that's the first line inside the proc I guess |
15:22:37 | dom96 | You're returning an int instead of a uint32? |
15:22:55 | euantor | nope, definitely returning a uint32 |
15:22:55 | dom96 | Presumably readBuffer returns an int |
15:23:10 | euantor | I guess it's because I'm not discarding the call to `readBuffer` |
15:23:20 | euantor | Yeah, but I didn't think that would be a return? |
15:23:37 | euantor | Surely the error should be that the int has to be discarded? |
15:23:52 | * | Guest99943 quit (Client Quit) |
15:24:11 | euantor | Putting a discard in does indeed fix the problem, but I would have expected a more clear error message about it needing to be discarded |
15:24:42 | dom96 | The error could be clearer, but it does make sense. |
15:24:45 | dom96 | Nim supports implicit returns |
15:25:08 | euantor | Ah, I hadn't realised that, it's news to me :) |
15:25:23 | euantor | All fixed now anyway, thanks! |
15:26:25 | Araq | euantor: funny thing. |
15:26:32 | Araq | I just improved that very error message |
15:26:41 | euantor | Hah, thanks! |
15:27:01 | Araq | and also the mysterious "identifier expected, but found" |
15:27:09 | Araq | that comes up in wrong macros/templates |
15:27:33 | euantor | Yeah, I think I've had that one in the past and it's caused me some confusion |
15:27:39 | cheatfate | euantor, i think you need to read http://insanecoding.blogspot.com/2014/05/a-good-idea-with-bad-usage-devurandom.html |
15:27:42 | euantor | Any better error messages are always welcome to me! |
15:28:05 | Araq | speaking of which ... can we just have links in error messages that explain more? |
15:28:11 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:28:27 | euantor | cheatfate: I've read a couple of such articles recently. That's why on Linux (new versions at least) the library uses the `getrandom` syscall |
15:28:47 | cheatfate | euantor, but you still have /dev/urandom and you handle it insecure |
15:28:53 | euantor | And on OpenBSD uses arc4random (there's is the only good implementation not using RC4 anymore) |
15:29:05 | euantor | Yes, it's the initial implementation, as you can see in the commit message |
15:31:11 | dom96 | Araq: Yes! |
15:32:43 | dom96 | I was going to do that for Nimble. |
15:32:57 | Araq | https://github.com/nim-lang/Nim/pull/5613 |
15:33:30 | dom96 | Exemplary PR improving error messages? :) |
15:33:58 | Araq | I switched from "push to devel directly" to "create PRs and merge when green" |
15:34:25 | * | ggVGc quit (Ping timeout: 260 seconds) |
15:35:47 | dom96 | I see |
15:36:05 | dom96 | Why create PRs though? |
15:36:16 | dom96 | If you push into a new branch the tests will be run as well. |
15:36:27 | * | mazrui254 joined #nim |
15:36:36 | couven92 | dom96, maybe because a PR prompts the CI to run? |
15:36:41 | Araq | I know but github has a nice overview over PRs |
15:36:52 | Araq | and a shitty one for mere branches |
15:36:56 | * | mazrui254 left #nim (#nim) |
15:37:31 | couven92 | ah, that makes sense... Araq, I think, I am going to adopt that for my own repos... :) |
15:37:37 | dom96 | How so? https://github.com/nim-lang/Nim/compare/araq-better-error-messages |
15:37:49 | dom96 | What's better about the PR view? |
15:41:31 | Araq | there is an overview. |
15:41:41 | Araq | like in a separate tab |
15:41:48 | Araq | listing all the PRs. |
15:42:54 | Araq | list of branches is just a list element on the "Code" tab |
15:43:04 | Araq | and it has lots of branches I don't care about |
15:43:18 | couven92 | also, a PR is archived forever... While branches, well I think it clutters the repo to have several thousand stale branches |
15:43:35 | dom96 | Okay, but the problem with this approach is that everyone who is watching the repo will get a notification. |
15:43:40 | Araq | PRs is like "todo", branches is like "oh btw, there are also these random things" |
15:43:45 | dom96 | For each of these PRs which aren't really PRs. |
15:44:29 | couven92 | dom96, so you'd really like a 'silent' PR? :P |
15:44:53 | FromGitter | <yuutayamada> Hi, Araq I have a quick question about nimsuggest's new error format. |
15:45:00 | dom96 | I would like it if PRs weren't abused. |
15:45:38 | FromGitter | <yuutayamada> What is `quality` parameter? it just returns 0. |
15:48:01 | Araq | that's just for consistency with the 'sug' results |
15:48:13 | Araq | you can ignore it. |
15:48:44 | FromGitter | <yuutayamada> Ok. thank you Araq always:) |
15:52:59 | Araq | dom96: fine, I'll use an 'araq' branch then |
15:53:10 | Araq | since 'devel' should remain green |
15:55:17 | dom96 | great, thank you |
16:06:42 | * | rauss joined #nim |
16:17:00 | Tiberium | is it possible to do something like that in Nim: let (eventType, eventData) = event.getElems() |
16:17:05 | Tiberium | currently I do it in two lines |
16:17:27 | Tiberium | let eventType = elems[0]; let eventData = elems[1..^2] |
16:17:36 | Tiberium | elems[1..^1] sorry |
16:23:18 | def- | Tiberium: you could use map from sequtils |
16:23:31 | def- | or mapIt |
16:23:46 | Tiberium | def-, no, I just wanted to maybe make my code more beautiful :) |
16:23:48 | dom96 | let (eventType, eventData) = (elems[0], elems[1..^2]) |
16:24:24 | dom96 | And you can create a proc called getElems that does that too of course. |
16:24:37 | Tiberium | dom96, thanks. getElems() is from json |
16:42:07 | * | vlad1777d joined #nim |
16:49:57 | * | Matthias247 joined #nim |
16:57:04 | rauss | dom96: I can't register on the forums |
16:57:16 | rauss | the captcha is never accepted |
16:57:39 | * | yglukhov joined #nim |
16:58:19 | dom96 | rauss: Could you try again? |
16:58:32 | dom96 | Do a hard reload as well on the register page |
16:59:12 | rauss | dom96: Still not working |
17:00:11 | dom96 | :\ |
17:01:20 | dom96 | Try a different browser? |
17:01:46 | rauss | dom96: I worked this time |
17:01:56 | rauss | hard refreshing the first time you said yielded the same captcha |
17:01:59 | dom96 | good |
17:02:01 | rauss | the second time i tried it was a new one |
17:02:10 | rauss | Thanks! |
17:04:01 | Tiberium | shame, I forgot to register on nim-lang forums |
17:04:38 | Tiberium | done :) |
17:04:51 | * | yglukhov quit (Remote host closed the connection) |
17:07:54 | euantor | Captcha issues wouldn't be issues with NoCaptcha ;) |
17:08:03 | euantor | *nudge nudge* |
17:12:06 | * | user0___ joined #nim |
17:12:29 | Araq | they are an issue because of https or caching |
17:12:43 | Araq | they used to work fine for years |
17:14:02 | Tiberium | who manages https://nimble.directory/ ? |
17:14:07 | Tiberium | there are some dead links |
17:15:32 | def- | Tiberium: more importantly, throws an SSL exception for me |
17:15:40 | Tiberium | def-, not for me |
17:15:53 | def- | only sometimes when i refresh the page |
17:15:59 | Tiberium | it uses TLS 1.2 |
17:16:14 | def- | on this page: https://nimble.directory/pkg/nimes |
17:16:30 | Tiberium | 502 ? |
17:16:35 | def- | that too, sometimes |
17:16:45 | def- | after crashing jester i guess, before it can restart |
17:16:46 | Tiberium | wow |
17:16:50 | Tiberium | SSL erro really |
17:17:00 | Tiberium | error:140E0114:SSL routines:SSL_shutdown:uninitialized |
17:17:14 | * | user0___ quit (Quit: user0___) |
17:17:38 | * | user0___ joined #nim |
17:22:07 | * | yglukhov joined #nim |
17:25:04 | dom96 | federico3: ^ |
17:25:19 | * | yglukhov quit (Remote host closed the connection) |
17:32:16 | * | user0___ quit (Quit: user0___) |
17:32:25 | * | user0___ joined #nim |
17:36:38 | * | user0___ quit (Client Quit) |
17:42:27 | * | ggVGc joined #nim |
17:48:37 | dom96 | All time high scores are now tracked! http://picheta.me/snake/ |
17:48:49 | dom96 | Also, deaths and pauses are now shown in the score board. |
17:51:31 | Tiberium | oh noo |
17:51:53 | dom96 | cool, it's working pretty well |
17:52:01 | dom96 | Tiberium: That was a close battle :) |
17:52:16 | * | rokups quit (Quit: Connection closed for inactivity) |
17:53:01 | dom96 | well, I got 66 |
17:54:30 | dom96 | Tiberium: did you play on mobile? |
17:54:41 | Tiberium | dom96, not yet:) but I tested it like 4 hours ago |
17:55:06 | dom96 | Cool. Think the controls are okay? |
17:55:20 | Tiberium | dom96, yeah |
17:57:01 | Tiberium | by the way, is there any performance impact if I use "var" everywhere or I use "let" and "const" where I can? |
17:58:14 | Tiberium | and also in the future I hope Nim will compile for WebAssembly target - so we can have almost native speed |
17:59:27 | dom96 | Not sure about 'var' vs. 'let', but 'const' should be faster in many cases. |
18:01:49 | Araq | let can be faster than var |
18:02:16 | Araq | const is faster than let. |
18:05:14 | dom96 | Araq: Trying to beat me? or is it an imposter? |
18:07:22 | dom96 | hah |
18:07:27 | dom96 | Didn't take long for somebody to hack it |
18:07:50 | Araq | I did beat you. |
18:08:06 | Araq | yup, hacked already, nice |
18:08:56 | dom96 | I just got 91 |
18:09:17 | dom96 | Not cool whoever that was |
18:09:26 | Tiberium | probably it wasn't necessary for me to ask about cheating :( |
18:10:26 | cheatfate | Araq, of course maybe assembler code looks better, but c generated code on `const` with `let` is looks similar, at least for objects |
18:11:17 | dom96 | Of course, I can easily fix it :P |
18:12:50 | * | stisa left #nim ("User left") |
18:13:35 | dom96 | Now that's just asshole behaviour |
18:13:57 | dom96 | Yes, you've killed the server by sending it bad JSON. Maybe time to give it a rest? |
18:14:55 | Tiberium | dom96, who killed it? |
18:15:02 | Tiberium | dom96, it wasn't me :) |
18:15:03 | dom96 | No idea. |
18:15:31 | dom96 | I'm happy with people trying to break it, but don't do it from the shadows. |
18:16:19 | * | Jehan_ joined #nim |
18:18:31 | * | stisa joined #nim |
18:18:59 | Tiberium | dom96, trace the IP :P |
18:19:12 | Tiberium | or give it to this chat xD |
18:19:27 | dom96 | Let me crack out my VB.NET IP tracer. |
18:19:50 | Araq | cheatfate: code quality depends on the involved types, my advice is about the general case |
18:20:20 | Tiberium | dom96, hmm, where is my brainf*ck IP tracer |
18:20:34 | dom96 | best I can do is befungee |
18:20:49 | dom96 | *befunge |
18:22:39 | * | stisa left #nim ("User left") |
18:25:23 | * | stisa joined #nim |
18:29:49 | * | Jehan_ quit (Read error: Connection reset by peer) |
18:42:03 | Tiberium | ok, another question about styling: what's better - echo("hello") or echo "hello" or echo"hello" ? |
18:42:24 | * | dddddd quit (Remote host closed the connection) |
18:46:29 | * | yglukhov joined #nim |
18:46:36 | * | yglukhov quit (Remote host closed the connection) |
18:50:05 | * | Jehan_ joined #nim |
18:51:35 | dom96 | Definitely not the last one :) |
18:54:06 | * | Jehan_ quit (Ping timeout: 240 seconds) |
18:54:38 | * | Jehan_ joined #nim |
19:02:29 | dom96 | Okay. Should be a lot more cheat proof now :) |
19:06:09 | Tiberium | first Nim repo in github, by advanced search: https://github.com/Rosetta-FizzBuzz/nimrod-FizzBuzz |
19:06:17 | * | Parashurama left #nim (#nim) |
19:07:39 | dom96 | hah, i've got an older one https://github.com/dom96/AELC |
19:12:59 | Tiberium | dom96, it's not detected by github, wow |
19:13:11 | Tiberium | does it compile? |
19:13:44 | dom96 | No D: |
19:14:08 | dom96 | Because for some reason I upper cased my parameters |
19:15:20 | dom96 | and uppercased True |
19:15:22 | Tiberium | dom96, compiled wow |
19:15:54 | dom96 | But yeah, doesn't take much to fix |
19:16:03 | Tiberium | dom96, backwards compatibility |
19:16:19 | dom96 | I guess that sorta shows that we should release v1 asap |
19:16:29 | * | kunev quit (Ping timeout: 240 seconds) |
19:16:36 | Tiberium | wait, SEVEN YEARS AGO |
19:16:39 | Tiberium | oh my gawd |
19:16:50 | dom96 | yep |
19:17:11 | dom96 | That's when I started using Nim |
19:17:38 | Tiberium | dom96, it's actually a surprise for me, because I'm 16 years old (almost 17) |
19:17:46 | dom96 | The reason I wrote a stack language interpreter was because I used Factor before and was fascinated by these types of languages. |
19:18:37 | dom96 | Tiberium: I was ... let me think... 14 back then |
19:19:02 | dom96 | Damn... I really feel old now. |
19:19:06 | Tiberium | dom96, I was 10, as you can guess |
19:19:13 | Tiberium | I didn't knew about things like that |
19:19:17 | * | kunev joined #nim |
19:19:19 | Tiberium | I didn't knew about programming languages at all |
19:19:38 | dom96 | When I was 10 I was starting to program with VB.NET heh |
19:20:05 | dom96 | Hanging out in MSDN forums asking very silly questions. |
19:20:21 | dom96 | But without those kind people I wouldn't have learned it at all |
19:22:35 | * | shashlick quit (Ping timeout: 264 seconds) |
19:23:23 | federico3 | thanks for the ping dom96 |
19:23:36 | * | shashlick joined #nim |
19:23:37 | dom96 | np |
19:24:11 | Tiberium | what can be the reason of "Error: attempting to call undeclared routine: 'nnkIdent'" ? |
19:24:16 | Tiberium | I imported `macros` |
19:25:05 | SusWombat | Would it make sense for a noob like me who never used stuff like the macros in nim to learn a different language like scheme to better understand the ones in nim? |
19:25:14 | SusWombat | as there are more ressources atm for scheme |
19:27:15 | dom96 | Tiberium: Are you trying to do nnkIdent()? |
19:27:20 | Tiberium | dom96, yeah |
19:27:28 | dom96 | SusWombat: There might even be some language-agnostic examples. |
19:27:34 | Tiberium | nnkIdent(!"AccountAccountCounters") |
19:27:46 | dom96 | Tiberium: Yeah, the examples on the page aren't actual Nim code. |
19:27:54 | SusWombat | dom96, so youd say looking at some lisp stuff might make sense? |
19:27:58 | Tiberium | dom96, lol :) |
19:28:16 | Tiberium | it would've been easy with that kind of syntax |
19:28:19 | dom96 | SusWombat: sure |
19:28:33 | SusWombat | dom96, ok thank you :) |
19:28:44 | dom96 | If you're willing to spend some money though, my book has a metaprogramming chapter. |
19:29:16 | dom96 | Tiberium: Yeah, I wonder if we could get that syntax. |
19:29:24 | SusWombat | dom96, i dont have the money currently but its on my "might buy" list :) |
19:29:44 | dom96 | I would give it away for free if I could :( |
19:30:37 | Tiberium | dom96, ehm, random guys from internet will give it away for free probably |
19:30:53 | Tiberium | if it was the book about C++, it would already be pirated |
19:31:14 | Tiberium | I think it's sometimes better if a language has smaller popularity than others |
19:31:50 | dom96 | hehe, indeed. |
19:35:16 | Tiberium | dom96, how can I debug my macro via dumpTree: |
19:35:36 | dom96 | You probably treeRepr |
19:35:52 | dom96 | dumpTree is to see the representation of some Nim code as an AST |
19:35:54 | Tiberium | dom96, thanks |
19:35:57 | dom96 | treeRepr takes a NimNode |
19:38:10 | * | couven92 quit (Ping timeout: 258 seconds) |
19:45:08 | Tiberium | dom96, how to define a tuple with macro? |
19:45:40 | Tiberium | ah, nvm |
19:45:45 | Tiberium | dumpTree helps |
19:46:51 | zachcarter | I’m writing a set of bindings to the C Spine runtime |
19:46:59 | zachcarter | running into a tiny bit of trouble here at the end |
19:47:31 | zachcarter | spine expects you to implement a few functions on your own in your engine |
19:47:50 | zachcarter | an example of those functions is here : https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39-L58 |
19:47:59 | zachcarter | I’m compiling the spine sources inside my nim source |
19:48:13 | Tiberium | wait, macro's are not that scary |
19:48:18 | zachcarter | and I’m getting undefined symbols for those functions |
19:48:38 | zachcarter | as they’re referred to in the sources I’m compiling |
19:48:44 | zachcarter | but the linker can’t find an implementation |
19:48:48 | * | bjz joined #nim |
19:49:11 | zachcarter | not quite sure how to hook up an implementaiton I write in nim with what the linker is looking for |
19:49:13 | zachcarter | any help? |
19:49:54 | zachcarter | I can write the implementations in Nim no problem, it’s getting them to the linker that I’m struggling with |
19:50:40 | dom96 | zachcarter: Don't have much experience with this i'm afraid |
19:50:54 | zachcarter | hrm :/ |
19:51:02 | zachcarter | it’s like I need to precompile a nim source |
19:51:26 | zachcarter | any ideas Araq? |
19:55:47 | * | krux02 joined #nim |
19:58:13 | Tiberium | dom96, I have "macro testGen(tupName, name, fieldType: string): untyped =" macro definition, and in this macro I do this: let tupleName = slurp(tupName.strVal) but it fails |
19:58:22 | * | yglukhov joined #nim |
19:58:41 | Tiberium | what I'm doing wrong? |
19:58:52 | dom96 | what error does it give? |
19:59:03 | Tiberium | dom96, "Error: field 'strVal' cannot be found" |
19:59:50 | Tiberium | dom96, it only gives it for this exact "let" statement, I have two others like that |
20:00:14 | Tiberium | hm |
20:00:17 | Tiberium | I don't know |
20:00:33 | Tiberium | ok, my question - how to make macro with parameters, so this parameters will be passed into newIdentNode() |
20:00:43 | Tiberium | parameters - I mean strings |
20:01:34 | * | yglukhov quit (Remote host closed the connection) |
20:02:07 | dom96 | hrm, i'm not sure. These attributes could certainly be more visible when doing treeRepr et al. |
20:02:25 | dom96 | I remember running into a similar problem where I wasn't sure how I can get the underlying node's value. |
20:02:29 | zachcarter | krux02: have a second? |
20:02:40 | krux02 | yes |
20:02:49 | zachcarter | hoping maybe you can help me with something |
20:03:04 | krux02 | I hope so too |
20:03:05 | zachcarter | I’m trying to write bindings to a library - specifically the spine C runtime |
20:03:07 | Tiberium | dom96, ah, ok, but I will definitely need to have simple code generation with strings, without macros (because I need to parse json) |
20:03:19 | Tiberium | It's not too hard, just define all types as tuples |
20:03:24 | Tiberium | (from web api) |
20:03:26 | krux02 | I have to google spine |
20:03:31 | zachcarter | let me link |
20:03:39 | zachcarter | http://esotericsoftware.com/spine-in-depth |
20:04:07 | zachcarter | they have a C runtime which is what I”m binding to |
20:04:16 | zachcarter | I’ve written the bindings already but I’m hitting a snag |
20:04:37 | * | Sentreen quit (Ping timeout: 260 seconds) |
20:04:44 | zachcarter | you can’t actually build the C runtime as a shared library because it expects you to implement three or four methods on your own |
20:05:03 | zachcarter | ideally I want to implement these methods in Nim |
20:05:36 | * | user0___ joined #nim |
20:05:49 | zachcarter | here are those methods - https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39-L58 |
20:06:06 | zachcarter | they’re not present for instance in - https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-c |
20:06:50 | zachcarter | so I’m not sure how to go about building these bindings in the best way |
20:07:57 | krux02 | well, you could write the forward declaration in C, and the implement them in nim |
20:08:26 | zachcarter | ah yeah okay I see |
20:08:35 | zachcarter | let me try that, thank you |
20:08:49 | krux02 | with the exportc pragma, you can control the name of a nim function in C |
20:09:10 | zachcarter | oh cool |
20:09:12 | krux02 | the rest is just correct types |
20:09:15 | zachcarter | right |
20:11:43 | Tiberium | lol, in json describing web api: base_bool_int is enum with 0, 1 with names "no", "yes" |
20:11:59 | Tiberium | and it's used in 120 places |
20:18:57 | * | Sentreen joined #nim |
20:20:20 | * | couven92 joined #nim |
20:31:40 | * | Vladar quit (Remote host closed the connection) |
20:34:04 | krux02 | zachcarter, I did not know about spine, but it does look cool. |
20:34:14 | zachcarter | yeah, kinday pricey but neat |
20:34:56 | krux02 | they wanna live, too |
20:35:06 | Tiberium | what would be the best way to define types from WebApi? they have in their name: apiSection_objectName |
20:35:23 | Tiberium | I firstly done ApiSectionObjectName (like PhotosPhotoTag) |
20:35:45 | Tiberium | but it doesn't look good, so I've done Photos_PhotoTag to separate section and name |
20:35:47 | Tiberium | ah, nevermind |
20:35:48 | krux02 | Tiberium, well that seems legit |
20:35:55 | Tiberium | I will split these types into modules |
20:36:03 | Tiberium | one file = one section |
20:36:15 | Tiberium | and good syntax accessing them "Photos.PhotoTag" |
20:36:25 | krux02 | Tiberium, you should know that in nim name_A and namea is actually considered as equal identifiers |
20:36:30 | Tiberium | krux02, I know |
20:36:30 | * | user0___ quit (Quit: user0___) |
20:36:45 | Tiberium | krux02, I want to autogenerate types from JSON Schema |
20:36:56 | Tiberium | I'm doing it with simple strings, not macro's, because I can't |
20:37:07 | krux02 | I always treat nim as if it case sensitive though, I don't like inconsistent writing of the same identifier |
20:37:11 | Tiberium | (or I can, but it would require to make another file format) |
20:37:13 | Tiberium | krux02, me too |
20:37:45 | Tiberium | currently my tiny script does something like this "type Widgets_CommentMedia = tuple[type: string, owner_id: int, item_id: int, thumb_src: string]" |
20:37:53 | krux02 | I think the first one is good, just take over the name as it is, just make the name capital case in the begining |
20:38:45 | Tiberium | krux02, it then would look like Wall_app_post |
20:39:19 | krux02 | well you can also just take the name as it is |
20:39:43 | Tiberium | krux02, I want to have shiny good names like in normal Nim :) |
20:40:01 | Tiberium | i plan to make a nimble package for that api, but it would take some time |
20:40:25 | Tiberium | I want firstly to make auto-gen script to generate all types, and then write api wrapper (it's easier) |
20:41:19 | krux02 | well, you could apply some name transformation from snake_case to CamelCase |
20:41:36 | Tiberium | krux02, I've done it:) capitalizeAscii helps |
20:42:41 | krux02 | but for the beginning it should be your priority to make it work, not fiddle with beautiful names |
20:43:03 | krux02 | remember, don't get stuck with ugly naming, but also don't waste your time there |
20:43:09 | Tiberium | krux02, I already have a little working script (like 50 lines) |
20:43:16 | Tiberium | it sends http requests already |
20:43:17 | krux02 | ok |
20:43:45 | Tiberium | so you can call api like apiInstance.callMethod("messages.send", {"message": "hello", "peer_id": "1"}) |
20:44:30 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:44:34 | Tiberium | and I want it to be like apiInstance.messages.send(message = "hello", peer_id = 1) |
20:45:11 | Tiberium | (with type checks so you can 100% know what you will get) |
20:49:12 | krux02 | Tiberium, well with the internet nothing is 100% sure |
20:50:06 | krux02 | I don't know the API, but there is always more than one thing you can do |
20:50:56 | krux02 | objects cal always be layed out in function parameters, o |
20:51:16 | krux02 | not always but often |
20:52:44 | krux02 | so instead of send( myobject(i:123,s:"abc") ) you can have send(i=123,s="abc") |
20:53:43 | krux02 | maybe you want to prefer the first version, because it is easier to generate, or maybe for other reasons |
20:55:18 | Tiberium | krux02, yeah, but api method can have photo object, which itself can have other objects |
20:55:22 | Tiberium | I don't know for real :) |
20:55:38 | Tiberium | yeah, maybe I should just put my simple version on nimble first |
20:55:40 | krux02 | me neither |
20:56:10 | krux02 | not sure for nimble though |
20:56:16 | krux02 | but it is an idea |
20:56:27 | Tiberium | krux02, btw, do you know, is there any libraries like "requests" in Python for Nim? |
20:56:28 | krux02 | I recommend using an API internally first before publishing it |
20:56:58 | Tiberium | because httpclient isn't the best for complicated cookies/headers stuff |
20:57:08 | krux02 | I don't know python, so I can't really tell you that |
20:59:39 | Tiberium | krux02, currently stuck at https://github.com/nim-lang/Nim/issues/5611 |
21:00:24 | krux02 | well that looks like something that can be fixed with a pull request |
21:00:36 | Tiberium | krux02, I know :) |
21:00:59 | krux02 | I mean it is not a compiler bug, you have the chance that it is readable code |
21:01:14 | krux02 | even though I don't think that the nim programming language has very readable code |
21:01:31 | krux02 | I mean the main repository |
21:01:57 | Tiberium | krux02, with some IDE with "jump to definition" it would be much easier :) |
21:02:18 | Tiberium | ehh, why JetBrains just doesnt make a Nim IDE with free version, so there will be a lot of new users |
21:02:52 | krux02 | Tiberium, well JetBrains wants to sell IDE software, so they chose languages by popularity |
21:03:19 | krux02 | and I don't think that JetBrains is really that great of an IDE |
21:03:25 | krux02 | I mean it is really good |
21:03:25 | Tiberium | krux02, they do |
21:03:30 | Tiberium | for example PyCharm is the best for Python |
21:03:32 | krux02 | but it is also clunky and slow |
21:03:38 | Tiberium | yeah, you need good PC too |
21:03:40 | krux02 | uses a lot of resources |
21:03:46 | Tiberium | but it provides a LOT of features |
21:04:00 | krux02 | well most of them you never use |
21:04:27 | krux02 | I learned for myself, that I do not want an IDE |
21:04:34 | krux02 | I want a toolbox to work with |
21:04:47 | krux02 | a box where I can replace tools with new ones when I don't like them |
21:04:54 | Tiberium | krux02, I really like one thing - all JetBrain IDE's do source files indexing (from stdlib and your projects), so you can easily "jump to definiton", and IDE can check all types itself |
21:04:57 | krux02 | with IDE's I have to throw away everything |
21:05:04 | krux02 | I can't replace little things |
21:05:39 | krux02 | well that can emacs, too (in theory when the damn thing would actually work out of the box) |
21:05:47 | * | chemist69 quit (Ping timeout: 264 seconds) |
21:06:07 | krux02 | it's not an editor feature, it is nimsuggest that does it |
21:06:17 | Tiberium | krux02, I know |
21:06:29 | Tiberium | but it's not instant :) |
21:06:29 | krux02 | jetbrains is just a company that does a lot of things an top of the normal compilation information |
21:06:46 | * | def-pri-pub joined #nim |
21:06:49 | krux02 | it's neither instant in jetbrains |
21:06:57 | Tiberium | krux02, it is on good PC's :) |
21:06:58 | krux02 | there is another feature every editor should have |
21:07:07 | krux02 | and that is quick navigation between files via keyboard |
21:07:13 | krux02 | I think jetbrains has it |
21:07:27 | Araq | VS Code has it. control+P |
21:07:46 | krux02 | Araq, vim has it too (via plugin :P) |
21:09:15 | Tiberium | But really, Nim needs some good ide plugin or own IDE :) For example, if you type "nim lang" in Google, the third suggestion would be "nim lang ide" |
21:09:16 | krux02 | https://youtu.be/5FQwQ0QWBTU?t=44s |
21:09:27 | krux02 | those are the things that truely matter |
21:09:50 | * | nsf quit (Quit: WeeChat 1.7) |
21:10:01 | krux02 | everything else is unimportant |
21:10:05 | * | chemist69 joined #nim |
21:10:18 | krux02 | (don't watch the video it's about c++ and emacs) |
21:10:36 | krux02 | but the point is, this is true no matter what the ide and the programming language is |
21:12:07 | * | Trustable joined #nim |
21:20:36 | Tiberium | wow, nim even compiles on a free CodeAnywhere container (256mb ram + 512mb swap) |
21:23:15 | * | bjz joined #nim |
21:25:23 | krux02 | what is a code anywhere container |
21:25:57 | Tiberium | krux02, CodeAnywhere is a cloud IDE |
21:26:05 | Tiberium | so you can have a free account |
21:26:17 | Tiberium | but there's no syntax highlighting for Nim sadly |
21:26:27 | Tiberium | there's plenty of cloud IDE's |
21:27:02 | Tiberium | c9.io for example |
21:27:21 | Tiberium | let me see if it provides Nim syntax highlighting |
21:27:45 | Tiberium | sadly no :( |
21:27:55 | Tiberium | but you can, for example, connect to CodeAnywhere container via SSH |
21:28:50 | krux02 | well I did not entirely get this trend of new browser editors, I prefor working locally. |
21:29:54 | Tiberium | krux02, for example if you're not on your PC |
21:29:59 | Tiberium | so you can't install Nim :) |
21:33:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:34:18 | * | gokr joined #nim |
21:36:29 | krux02 | well when I am not on my pc it probably means that I am on vacation ;) |
21:40:02 | Tiberium | ehm |
21:40:19 | Tiberium | I found a 650kb json, both stdlib json and jsmn can't parse it |
21:40:24 | Tiberium | while python's standart module can |
21:41:50 | Tiberium | maybe because this file contains A LOT of chinese unicode characters |
21:42:14 | Tiberium | like this "マイリスト】【彩りりあ" |
21:43:48 | Tiberium | oh wait |
21:43:50 | krux02 | that is japanese |
21:43:51 | Tiberium | it succeed |
21:43:55 | Tiberium | krux02, sorry :( |
21:44:01 | Tiberium | maybe some disk caching issues |
21:44:06 | Tiberium | but it succeed this time lol |
21:44:25 | Tiberium | (just testing python json benchmark vs nim) xd |
21:45:35 | Tiberium | and you know who's the winner. cpython averages at ~0.4s, pypy - almost the same, Nim - 0.045s |
21:46:05 | krux02 | yay |
21:46:09 | Tiberium | But "jsmn" - another json library for Nim can't parse this file :( |
21:46:17 | Tiberium | https://github.com/OpenSystemsLab/jsmn.nim |
21:46:18 | * | Jehan_ quit (Quit: Leaving) |
21:46:41 | krux02 | I would say the difference is neglible |
21:46:48 | krux02 | what file are you parsing? |
21:47:08 | krux02 | 0.4 seconds sounds like a very big file |
21:47:18 | Tiberium | krux02, I found python benchmarks :) it's 750kb json with some twitter data |
21:47:30 | krux02 | that is small |
21:47:32 | Tiberium | oh, 624kb |
21:47:38 | krux02 | even smaller |
21:47:54 | krux02 | well I don't know much about the json parson of nim |
21:48:19 | krux02 | probably not very optimized just something to get the job done and not a lot of thoughts went into optimization |
21:48:23 | Tiberium | krux02, the main thing - you actually have the same amount of lines in Python and Nim |
21:49:27 | krux02 | what a coincidence |
21:51:37 | Tiberium | krux02, I'll translate some benchmarks from Python to nim, just to satisfy myself xD |
21:52:24 | * | Trustable quit (Remote host closed the connection) |
21:53:59 | krux02 | well yea, whatever pleases you |
21:55:06 | Tiberium | krux02, yay, I found old (2 year) repo of "benchmarks game" benchmarks ported to nim |
22:00:03 | krux02 | Tiberium, do you have experience with c++ and optimizing that? |
22:00:08 | Tiberium | krux02, no |
22:00:09 | krux02 | or C? |
22:00:16 | Tiberium | I have only experience with Python :) |
22:00:20 | Tiberium | so i'm noob |
22:00:35 | krux02 | well when you want to optimize nim, you should read tutorials for that |
22:00:55 | krux02 | there are not tutorials written on how to optimize for nim, because that community is too small |
22:01:01 | krux02 | you have to map c++ to nim then |
22:01:37 | cheatfate | Tiberium, there only one optimization technique in nim, try to avoid allocations |
22:01:50 | krux02 | the short for is, use little memory. But stuff in continuous array of structs or strucs of arrays |
22:02:01 | krux02 | don't use ref types |
22:02:10 | cheatfate | ref types is good |
22:02:10 | Tiberium | krux02, I don't use it:) |
22:02:16 | krux02 | especially don't use seq[ref Something] |
22:02:33 | cheatfate | krux02, why? |
22:03:08 | krux02 | cheatfate, well you said it already, allocation |
22:03:09 | cheatfate | until you are single threaded its pretty fast |
22:03:19 | cheatfate | ahh yeah of course :) |
22:03:19 | Tiberium | krux02, ok, for example, nbody in Nim and C++: 3.6s for my machine for C++ and 5.2s for Nim. But hey, nim src is 113 lines, and C++ one is 190 |
22:03:31 | krux02 | cheatfate, well you said it already, seq[ref Something] is a lot of allocation, and also might have fractured memory |
22:03:39 | Tiberium | and nim is more readable (but it's just calculations) |
22:03:53 | cheatfate | 3.6s and 5.2 is something wrong with optimizations |
22:04:01 | Tiberium | yes |
22:04:03 | Tiberium | maybe |
22:04:05 | cheatfate | 3.6s and 3.8-3.9 is ok |
22:04:10 | Tiberium | nim's nbody uses "addr" |
22:04:15 | Tiberium | I don't know what is it |
22:04:21 | Tiberium | "var b2 = addr bodies[j]" |
22:04:45 | krux02 | well nobody really cares that much about micro optimizations |
22:04:52 | krux02 | what matters is that it can be fast enough |
22:05:23 | krux02 | Tiberium, that case can easily create you invalid pointers |
22:05:30 | Tiberium | well, python takes ~ 700 secs on this benchmark :D |
22:06:25 | krux02 | Tiberium, addr creates a pointer, that is something like a reference |
22:06:34 | krux02 | so you have a ptr type |
22:06:46 | krux02 | ptr and ref types in nim are very much the same |
22:06:51 | Tiberium | krux02, maybe they just made it to have less array access |
22:07:03 | Tiberium | var b2 = addr bodies[j] and then b2's fields are changed 3 times |
22:07:05 | krux02 | the only difference is for the garbage collector |
22:07:15 | krux02 | the gc doesn't care for ptr types |
22:07:50 | krux02 | Tiberium, that means that bodies[j]'s fields are changed 3 times |
22:08:18 | krux02 | probably to avoid writing bodies[j] three times |
22:09:56 | * | Kingsquee joined #nim |
22:10:58 | Tiberium | well, this repo is 2 years old, and all benchmarks except one (it's using gmp), compiled successfully with some deprecation warnings |
22:11:47 | krux02 | Tiberium, then do a good thing and resolve all deprecation warnings |
22:12:05 | krux02 | it should also give you a hint on how things work in the Nim world |
22:12:14 | Tiberium | krux02, btw, it's def- 's repo :) |
22:12:20 | Tiberium | https://github.com/def-/nim-benchmarksgame |
22:12:24 | krux02 | after two years the things you based you work on might be deprecated |
22:14:34 | * | couven92 quit (Ping timeout: 258 seconds) |
22:29:11 | * | Nobabs27 joined #nim |
22:31:17 | * | Tiberium quit (Read error: Connection reset by peer) |
22:31:46 | * | Tiberium joined #nim |
22:35:24 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:36:40 | * | PMunch joined #nim |
22:39:40 | * | couven92 joined #nim |
22:46:04 | * | Tiberium quit (Remote host closed the connection) |
22:47:55 | * | Tiberium joined #nim |
22:52:36 | * | gokr quit (Ping timeout: 240 seconds) |
22:53:07 | zachcarter | what’s the propper type to bind a c array to? |
22:53:12 | zachcarter | c2nim produces ptr ptr |
22:54:25 | PMunch | A ptr to a Nim array? |
22:54:54 | zachcarter | like |
22:55:03 | zachcarter | spBone** bones; |
22:55:12 | zachcarter | if spBone is a struct |
22:55:26 | zachcarter | in C that’s essentially an array right? |
22:56:19 | zachcarter | https://forum.nim-lang.org/t/567 |
22:56:22 | zachcarter | I think this answers my question |
22:56:51 | Tiberium | dom96: got 30 points with phone (just my inattention) |
22:57:18 | dom96 | Tiberium: nice :) |
22:57:43 | Tiberium | btw sometimes it zooms in (when you tap two times like double click). i don't know if there's a way to disable it |
22:58:05 | Tiberium | maybe some JS |
22:58:36 | Tiberium | maybe this helps |
22:58:43 | Tiberium | http://stackoverflow.com/questions/4472891/how-can-i-disable-zoom-on-a-mobile-web-page |
22:59:04 | PMunch | zachcarter, no that's a pointer to a pointer |
22:59:16 | PMunch | Or that's how you would typically write a pointer to a pointer |
22:59:48 | PMunch | If you were to need a pointer for something, you could pass the pointer to the pointer to a function which would malloc the data and set the pointer to that address. |
23:00:01 | * | smt quit (Read error: Connection reset by peer) |
23:00:13 | PMunch | So when the function returned you would have a pointer to the pointer to your data |
23:01:03 | zachcarter | ah okay |
23:01:04 | * | smt joined #nim |
23:02:17 | * | Sentreen quit (Ping timeout: 246 seconds) |
23:03:18 | * | zxtx left #nim ("Leaving") |
23:16:03 | * | Sentreen joined #nim |
23:20:53 | dom96 | Tiberium: Yeah, I noticed that sometimes it selects the text as well. Definitely needs polishing, but hopefully playable in general :) |
23:21:00 | dom96 | Thanks for testing. Good night. |
23:42:36 | * | PMunch quit (Quit: leaving) |
23:43:31 | Tiberium | oh, it seems that we can actually have a revolution based on what happened on yesterday's rallies almost in all big cities in Russia |