<< 26-03-2017 >>

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:59dom96wow, 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:56dom96Live scores are working! http://picheta.me/snake/
00:47:58dom96:D
00:51:45FromGitter<TiberiumPY> Can I play without keys?
00:51:59FromGitter<TiberiumPY> On android :)
00:52:07dom96heh, not yet. It's on my to do list
00:53:14FromGitter<TiberiumPY> If you will do it - I will happy to test it on my phone. Android 6 and latest Chrome
00:53:28FromGitter<TiberiumPY> Also, game works on my phone
00:53:35FromGitter<TiberiumPY> I just need the controls :)
00:55:52dom96Araq: You can pause with P btw :P
00:56:42Araqwasn't me. somebody else named himself Araq
00:56:55FromGitter<TiberiumPY> LOL
00:57:12Araqugh, stupid time change
00:57:31dom96hah
00:57:42dom96oh shit, yeah. Time change :\
01:01:33dom96yay, it's 3am D:
01:02:27FromGitter<TiberiumPY> Are you in Europe?
01:02:50FromGitter<TiberiumPY> Because it's 4 AM for me in Russia :)
01:03:28Araqhardly real russia when the time diff is only one hour ;-)
01:04:11dom96oh well, I shall implement touch controls tomorrow
01:04:12dom96good night
01:04:55FromGitter<TiberiumPY> Araq - Central Russia has UTC+3 timezone
01:05:29AraqI know.
01:05:31Araqgood night.
01:32:25FromGitter<TiberiumPY> Hmm, I want to experiment with Nim - look at this C++ https://github.com/AimTuxOfficial/AimTux/blob/master/src/AimTux.cpp
01:32:57zachcarterdamn ate myself
01:33:13FromGitter<TiberiumPY> How to make the same for "int *attribute*((constructor)) AimTux it()"
01:35:43FromGitter<TiberiumPY> So *some* code will be called when my dynamic library is loaded
01:35:55FromGitter<TiberiumPY> into other process
01:36:15demi-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:53def-pri-pubJust 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:10zachcarternice
03:53:04zachcarterstarting 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:00def-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:33euantorThat Snake game's pretty good dom96, was nice and smooth in Safari for me
09:45:24couven92`{.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:02couven92ah, 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:57dom96euantor: :D
10:04:06dom96Glad to hear it :)
10:04:52dom96I think I will save the highest score to make it a bit more fun when nobody is playing at the minute
10:04:56ParashuramaHey!
10:05:18Parashuramadom96: when you have some time can you take another look at https://github.com/nim-lang/zip/pull/17
10:05:19dom96I must admit though, it is a bit choppy in Firefox at times
10:08:10ParashuramaI 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:50dom96Parashurama: merged
10:15:11Parashuramathanks
10:15:33Parashuramadom96: I also have a gzipfiles PR in the works
10:16:09Parashuramawith read/write support.
10:17:49dom96cool
10:22:42*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:25:08couven92dom96, 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:38couven92(sspi is the name of the Windows header that contains the Schannel stuff)
10:25:50dom96Since it's Windows specific I think it should go into lib/windows
10:27:19*BitPuffin|osx joined #nim
10:27:20couven92ok... 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:25cheatfatecouven92, do you know that on Windows XP, (which nim supports) schannel only supports deprecated cipher suites?
10:43:54couven92Yes, I read that yesterday
10:44:09cheatfateso if you use nim program on windows xp, you will not be able to connect to modern https servers?
10:44:40cheatfateor if you create server, modern browsers will not connect to your server?
10:45:04couven92Not if you use SChannel, but since you can always use OpenSSL if you want to, I don't see the issue
10:45:48cheatfateand 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:15couven92I 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:43couven92s/prove/provide
10:48:01cheatfatebut maybe dom96 and Araq made decision without full information?
10:49:06dom96I don't think this is an issue we should be worrying about. Windows XP is deprecated or due to be deprecated.
10:50:05couven92Agreed, that is also the reason, why SChannel was not updated by MS for WinXP
10:50:09cheatfatehttps://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0
10:50:24cheatfateWindows XP users is 8%, and its more then Linux users count...
10:52:48couven92Uhm, 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:00couven92I should probably do it like winlean does, right?
10:53:47dom96winlean uses dynlib
10:53:52dom96You should use it too if you can
10:54:12couven92Yes, 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:59couven92In Nim is there a way to say that a function takes a const string pointer instead of just a string pointer?
11:05:35couven92Or 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:06dom96Not 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:11FromGitter<Varriount> couven92: What are you trying to do, interface with C?
12:07:08*chemist69 joined #nim
12:09:34TiberiumI have a question - with --os:standalone GC is here or not?
12:09:41TiberiumJust want to try to build Nim for another OS
12:11:09cheatfateTiberium, GC is always present
12:11:25Tiberiumcheatfate, and what can I use with --os:standalone? almost nothing?
12:12:00cheatfate--os:standalone i dont know, but i think it will create plain binary (so not PE or ELF or any other format)
12:13:16TiberiumI want to compile Nim for a OS, where C library is called "newlib"
12:14:08cheatfateif it compatible with any other stdlib you don't need to standalone...
12:14:23Tiberiumit's compatible, but not fully
12:16:11*couven92 quit (Ping timeout: 258 seconds)
12:17:19cheatfatethen 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:17PMunchWowzer :S
13:14:48PMunchThe article on Nim and cross-platform GUIs have gotten 17k views now
13:15:05SusWombatPMunch, yeah its a nice one
13:15:17couven92Uhm: doccomments on proc parameters?
13:15:17PMunchThanks :)
13:15:22SusWombathow to i "cast" a int to a uint?
13:15:35def-SusWombat: cast[uint](myInt)
13:15:35PMunchcast[uint](int)
13:15:46def-are you sure you want to cast and not convert?
13:15:51def-convert would be uint(myInt)
13:16:04SusWombatah i guess i want to convert! thanks guys
13:16:07PMunchor myInt.uint since we have the unified call syntax :)
13:16:26PMunchcouven92, what do you mean?
13:16:35Tiberiumvar matches: openarray[string] says openarray[string] is invalid type
13:16:52TiberiumI want to use re module - string.match(regexp, matches)
13:16:53def-Tiberium: openarray is not a type you can use
13:17:07Tiberiumdef-, how can I use re module? string.match(regexp, matches)
13:17:08def-Tiberium: you can have seq[string] or array with fixed size
13:17:19couven92Is 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:28def-openarray just generalizes seq and array for passing as proc parameters
13:17:54def-couven92: haven't seen that used in nim code, so i guess not
13:18:04SusWombatPMunch, ah yeah that worked (x.uint8) thanks
13:18:33couven92def-, so you cannot document the parameters of a proc??? Why the hell not????
13:18:47couven92That would just be stupid!
13:19:47Tiberiumhow can I remove first and last letter from my string?
13:20:02Tiberiumah, nvm
13:20:07Tiberiumstring[1..<string.high()]
13:20:36def-Tiberium: [1..^2]
13:21:10*bjz_ quit (Ping timeout: 240 seconds)
13:21:25def-couven92: docgen documentation is here: https://nim-lang.org/docs/docgen.html
13:21:39*bjz joined #nim
13:22:08def-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:34couven92def-, 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:03couven92def-, I disagree, especially when documenting native C API functions that take 8 parameters!
13:23:12Araqcouven92, 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:14couven92(or more)
13:23:43couven92Araq, so no SChannel in nim stdlib?
13:23:44Araqlet's not throw this away just because "nimble cannot find DLL" used to be a problem
13:24:29dom96What's the problem with using OpenSSL on Win XP and SChannel on other Windows'?
13:24:57Araqcouven92: 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:33Tiberiumdef-, ^2, not ^1 because last char is \0
13:25:34couven92Okay... so if we do SChannel support, it will be as a nimble
13:25:39Tiberiumdef-, ?
13:25:42cheatfateThe 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:14cheatfatebut if openssl is not bundled inside of package, then omg, it not works on windows xp/vista... wtf?
13:26:50def-Tiberium: counting from the front begins with 0, from the back with 1
13:27:12def-(confuses me every time as well)
13:27:14cheatfateand 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:31Tiberiumdoes httpclient.request automatically follow redirects via "Location" header?
13:28:49dom96Tiberium: get does
13:28:58Tiberiumdom96, and post?
13:29:07couven92Okay... 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:09dom96actually request does too nowadays
13:29:10cheatfateso 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:10zachcarteris there an easy way to check if a field is present on an object?
13:29:19zachcarterreferencing generics here
13:30:40dom96couven92: 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:46Tiberiumhow do I set maxRedirects for httpclient instance? client.maxRedirects = 0 doesn't work
13:30:59dom96Tiberium: In the constructor perhaps
13:31:13couven92dom96, But it seems like it would be a nimble package rather than a stdlib feature...
13:31:14Tiberiumdom96, thanks :)
13:31:33Araqcouven92: https://github.com/nim-lang/Nim/pull/5575 you should finish this one first anyway ;-)
13:32:58Araq--os:standalone is orthogonal to --gc:none
13:33:05couven92Araq, 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:06dom96couven92: 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:22couven92dom96, true that...
13:34:02Araqcouven92: it's hard to review
13:34:03Tiberiumok, another question - how to post form data via request? just like body = $%*{"email": login, "pass": password} for example?
13:34:24Araqsure it can work as a nimble package. patchFile ftw
13:34:40TiberiumI mean client.request(url, httpMethod= HttpPost, body = $ %*{"email": login, "pass": password})
13:34:52dom96Tiberium: You can use something like this I think: https://nim-lang.org/docs/httpclient.html#using-http-post
13:35:47couven92ok, 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:46Tiberiumhmm, still doesn't work.. is there any way I can see what does httpclient send and receive? some debug mode
13:37:24dom96Tiberium: You can add some echo's into the stdlib's source code
13:38:14Tiberiumdom96, ok
13:38:54Araqanother point: we should have a native SSL implementation eventually, like Go does.
13:39:03Araqno dependencies, no cry
13:39:19Araqand different security issues than OpenSSL ;-)
13:39:29Araq(hopefully fewer *cough* )
13:39:48zachcarterquestion : is there a way to check whether a generic has a field or not?
13:40:06Araqzachcarter: when compiles(x.field):
13:40:17zachcarterthank you
13:40:18couven92Araq, 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:39dom96We're probably better off waiting on https://bearssl.org/ to be finished
13:41:59Araqcouven92: would be an option if Linux package managers wouldn't mind shipping C code, but they do.
13:42:06dom96This 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:36couven92Araq, ah... I understand
13:42:38dom96Araq: So we don't bundle it on Linux
13:42:42dom96Just on Windows and OS X
13:43:16dom96Keeping the C sources of OpenSSL in Nim's repo sounds horrible though
13:43:32couven92Araq, is there a way to provide doccomments on the individual fields of an enum? The parameters of a proc?
13:43:40Araqwe don't have to do that, koch can bundle anything with the installers
13:44:04Araqindividual fields of an enum? see the stdlib for plenty of examples
13:44:34Araqparameters of a proc: easy but has no special syntax
13:44:40Araq param
13:44:46Araq Description of the param.
13:45:00AraqI forgot the name RST uses for this construct.
13:45:15Araqdefinition list or something.
13:45:24couven92Hmm... ok, then I must have done sth else wrong...
13:45:50couven92Araq, I am adding doccomments to the vccexe stuff... Would that help for your PR review?
13:46:29Araqwell maybe add what is now different
13:46:32Araqand what works
13:46:35Araqand what still doesn't.
13:46:45couven92oki doki
13:47:47Araqdom96: interesting that OSX is also affected but the previous planned improvements were all about Windows
13:49:53dom96Araq: What are you insinuating? :P
13:50:46dom96I think OS X also has its own native SSL implementation
13:50:53dom96Which would also be a nice thing to wrap
13:51:12dom96Racket seems to support it https://docs.racket-lang.org/osx-ssl/index.html
13:52:54couven92Araq, 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:09couven92What am I doing wrong?
13:53:52dom96I 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:54Tiberiumdoes httpclient automatically saves all cookies and sends them with new requests?
13:56:45Tiberiumis there any http library in nimble?
13:57:07dom96it doesn't
14:00:59*nightmared joined #nim
14:01:48*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:02:35PMunchHmm, 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:07dom96PMunch: 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:32dom96I would look for any CSS/JS that changes scrolling behaviour, IIRC that's what they complained about
14:09:06dom96couven92: So, will you work on SChannel even if it is destined to be a Nimble package?
14:09:07PMunchYeah, I don't have any iOS devices either.. I've tested it on Android myself so I know that works fine :)
14:09:20Tiberiumyeah
14:09:28Tiberiumdom96, i'll report a bug now
14:09:32PMunchThe static banner is collapsible but I'll look into collapsing it automatically on scroll
14:09:45Tiberiumif there's multiple "Set-Cookie" in headers, httpcore saves only last header :(
14:10:19TiberiumI'll make a short repro with httpbin.org
14:10:27couven92dom96, 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:15euantorWhat website is it? I have an iOS device I can test on if you want
14:17:40dom96PMunch: 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:00dom96Even on phones
14:18:33PMuncheuantor, http://serv.peterme.net/devlog/cross-platform-guis-and-nim-macros.html
14:19:06PMunchdom96, hmm I dislike the top since it means you have to move your thumb all across the screen to interact with it..
14:19:14PMunchThat's why I put it on the bottom
14:19:56PMunchBut how big is it for you? On my phone it only takes up the space of a line of text or so
14:20:16euantorhttps://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:55PMunchYeah okay, so about the same size as for me
14:21:08euantor@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:43PMunchOh, you can't scroll further than that code?
14:21:58Tiberiumdom96, https://github.com/nim-lang/Nim/issues/5611
14:21:58euantorno, that's as far as it'll go
14:22:07Tiberiumthat's a big issue for me
14:22:07PMunchOh wow, yeah that's an issue
14:23:45Tiberiumthe 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:21dom96PMunch: Yes, but how often do people actually interact with this banner?
14:25:33*nightmared joined #nim
14:25:48PMunchProbably never to be honest. I just wanted it to look similar to it's web-version
14:26:55dom96Yeah :) But hey, it's your blog. Just letting you know how I feel about these banners.
14:27:33Tiberiumdom96, can you place some labels ? https://github.com/nim-lang/Nim/issues/5611
14:28:25dom96Tiberium: 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:41Tiberiumdom96, where headers are set?
14:28:43Tiberiumhttpcore?
14:28:49PMunchdom96, 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:50dom96I think so, yeah.
14:29:14dom96PMunch: Fair enough. I do like the look :)
14:30:57*yglukhov joined #nim
14:31:11*Ven_ joined #nim
14:31:54dom96Btw http://picheta.me/snake/
14:31:57dom96Now supports touch
14:32:43Tiberiumdom96, let me tryyy
14:33:11dom96Might need to add buttons for Pause and New Game for mobile though
14:33:13Tiberiumdom96, works
14:33:18dom96On a keyboard that's just the P and N keys
14:33:43dom96Also there is now a timed food item
14:34:03dom96D:
14:34:05dom96my server crashed
14:34:48dom96I guess I should implement reconnections
14:35:03PMunchYeah, I got disconnected :(
14:35:20dom96https://gist.github.com/dom96/6afaff5200f1211c3038a1ce2b782d47 D:
14:35:25PMunchPretty cool though :)
14:35:58Tiberiumdom96, nice error
14:36:52*yglukhov quit (Remote host closed the connection)
14:39:02dom96Yeah, looks like a GC problem. I guess I should try boehm.
14:39:13dom96damn, died at 82
14:39:28dom96fighting against SusWombat :)
14:41:24SusWombatnoooooooooooooooooooooooooooooooooooooooooo
14:41:35SusWombat109 :/
14:42:16dom96heh
14:42:25dom96Highest score ever I think
14:42:38dom96I'm going to make the server track the highest score and show it as well
14:42:50SusWombatnice idea
14:43:01Tiberiumdom96, but if someone cheat? xD
14:43:15SusWombatdom96, does the timed food give me full points even when it is nearly gone?
14:43:23dom96SusWombat: Yeah
14:43:26SusWombatok
14:43:30dom96Tiberium: Then I will have to reset it :P
14:43:39dom96Cheating would be easy right now
14:44:01dom96I could send the game replay and verify it on the server but I think that would be overkill
14:44:30dom96But yeah, need to implement reconnecting
14:44:45dom96That way I can update the server without problems as well
14:46:59dom96Also, seems the special food is not disappearing when you eat it
14:48:25SusWombatfor me it does
14:49:14PMunchdom96, 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:27PMunchOr auto-shrinks rather
14:49:28Tiberiumdom96, is there a way to have multi-line headers?
14:49:55dom96SusWombat: It's only visible when your snake is short, otherwise it ends up expiring anyway :)
14:50:00Tiberiumdom96, I mean one header with multiple lines
14:50:13*PMunch quit (Quit: leaving)
14:50:14dom96Tiberium: I think you can separate the values with a semicolon
14:55:48*bjz joined #nim
14:58:45*yglukhov joined #nim
14:59:16dom96Should reconnect now :D
14:59:44*yglukhov quit (Remote host closed the connection)
15:00:59dom96Hopefully 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:33SusWombatTiberium, any luck finding a site like codingame for nim btw?
15:14:55TiberiumSusWombat, no
15:15:01TiberiumSusWombat, but I hope for CodinGame to add it
15:15:09Tiberiumsince dom96 said they emailed him
15:15:21couven92ok Araq, new commit to vccexe (https://github.com/nim-lang/Nim/pull/5575)... Added documentation and comments... Hope that helps
15:15:33dom96Yeah, I emailed them back.
15:15:41dom96Still haven't heard anything though
15:19:54euantorAny 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:07euantorGot me scratching my head, as I can't see anything obviously wrong
15:20:26*Ven is now known as Guest99943
15:20:30dom96are you sure line 124 is a comment?
15:20:39dom96Maybe you modified something since the last compile?
15:20:57euantorNope, 124 is definitely a comment
15:21:09euantorhttps://github.com/euantorano/sysrandom.nim/blob/master/src/sysrandom.nim#L124
15:22:26dom96oh, it's because that's the first line inside the proc I guess
15:22:37dom96You're returning an int instead of a uint32?
15:22:55euantornope, definitely returning a uint32
15:22:55dom96Presumably readBuffer returns an int
15:23:10euantorI guess it's because I'm not discarding the call to `readBuffer`
15:23:20euantorYeah, but I didn't think that would be a return?
15:23:37euantorSurely the error should be that the int has to be discarded?
15:23:52*Guest99943 quit (Client Quit)
15:24:11euantorPutting 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:42dom96The error could be clearer, but it does make sense.
15:24:45dom96Nim supports implicit returns
15:25:08euantorAh, I hadn't realised that, it's news to me :)
15:25:23euantorAll fixed now anyway, thanks!
15:26:25Araqeuantor: funny thing.
15:26:32AraqI just improved that very error message
15:26:41euantorHah, thanks!
15:27:01Araqand also the mysterious "identifier expected, but found"
15:27:09Araqthat comes up in wrong macros/templates
15:27:33euantorYeah, I think I've had that one in the past and it's caused me some confusion
15:27:39cheatfateeuantor, i think you need to read http://insanecoding.blogspot.com/2014/05/a-good-idea-with-bad-usage-devurandom.html
15:27:42euantorAny better error messages are always welcome to me!
15:28:05Araqspeaking 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:27euantorcheatfate: 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:47cheatfateeuantor, but you still have /dev/urandom and you handle it insecure
15:28:53euantorAnd on OpenBSD uses arc4random (there's is the only good implementation not using RC4 anymore)
15:29:05euantorYes, it's the initial implementation, as you can see in the commit message
15:31:11dom96Araq: Yes!
15:32:43dom96I was going to do that for Nimble.
15:32:57Araqhttps://github.com/nim-lang/Nim/pull/5613
15:33:30dom96Exemplary PR improving error messages? :)
15:33:58AraqI switched from "push to devel directly" to "create PRs and merge when green"
15:34:25*ggVGc quit (Ping timeout: 260 seconds)
15:35:47dom96I see
15:36:05dom96Why create PRs though?
15:36:16dom96If you push into a new branch the tests will be run as well.
15:36:27*mazrui254 joined #nim
15:36:36couven92dom96, maybe because a PR prompts the CI to run?
15:36:41AraqI know but github has a nice overview over PRs
15:36:52Araqand a shitty one for mere branches
15:36:56*mazrui254 left #nim (#nim)
15:37:31couven92ah, that makes sense... Araq, I think, I am going to adopt that for my own repos... :)
15:37:37dom96How so? https://github.com/nim-lang/Nim/compare/araq-better-error-messages
15:37:49dom96What's better about the PR view?
15:41:31Araqthere is an overview.
15:41:41Araqlike in a separate tab
15:41:48Araqlisting all the PRs.
15:42:54Araqlist of branches is just a list element on the "Code" tab
15:43:04Araqand it has lots of branches I don't care about
15:43:18couven92also, a PR is archived forever... While branches, well I think it clutters the repo to have several thousand stale branches
15:43:35dom96Okay, but the problem with this approach is that everyone who is watching the repo will get a notification.
15:43:40AraqPRs is like "todo", branches is like "oh btw, there are also these random things"
15:43:45dom96For each of these PRs which aren't really PRs.
15:44:29couven92dom96, so you'd really like a 'silent' PR? :P
15:44:53FromGitter<yuutayamada> Hi, Araq I have a quick question about nimsuggest's new error format.
15:45:00dom96I would like it if PRs weren't abused.
15:45:38FromGitter<yuutayamada> What is `quality` parameter? it just returns 0.
15:48:01Araqthat's just for consistency with the 'sug' results
15:48:13Araqyou can ignore it.
15:48:44FromGitter<yuutayamada> Ok. thank you Araq always:)
15:52:59Araqdom96: fine, I'll use an 'araq' branch then
15:53:10Araqsince 'devel' should remain green
15:55:17dom96great, thank you
16:06:42*rauss joined #nim
16:17:00Tiberiumis it possible to do something like that in Nim: let (eventType, eventData) = event.getElems()
16:17:05Tiberiumcurrently I do it in two lines
16:17:27Tiberiumlet eventType = elems[0]; let eventData = elems[1..^2]
16:17:36Tiberiumelems[1..^1] sorry
16:23:18def-Tiberium: you could use map from sequtils
16:23:31def-or mapIt
16:23:46Tiberiumdef-, no, I just wanted to maybe make my code more beautiful :)
16:23:48dom96let (eventType, eventData) = (elems[0], elems[1..^2])
16:24:24dom96And you can create a proc called getElems that does that too of course.
16:24:37Tiberiumdom96, thanks. getElems() is from json
16:42:07*vlad1777d joined #nim
16:49:57*Matthias247 joined #nim
16:57:04raussdom96: I can't register on the forums
16:57:16raussthe captcha is never accepted
16:57:39*yglukhov joined #nim
16:58:19dom96rauss: Could you try again?
16:58:32dom96Do a hard reload as well on the register page
16:59:12raussdom96: Still not working
17:00:11dom96:\
17:01:20dom96Try a different browser?
17:01:46raussdom96: I worked this time
17:01:56rausshard refreshing the first time you said yielded the same captcha
17:01:59dom96good
17:02:01raussthe second time i tried it was a new one
17:02:10raussThanks!
17:04:01Tiberiumshame, I forgot to register on nim-lang forums
17:04:38Tiberiumdone :)
17:04:51*yglukhov quit (Remote host closed the connection)
17:07:54euantorCaptcha issues wouldn't be issues with NoCaptcha ;)
17:08:03euantor*nudge nudge*
17:12:06*user0___ joined #nim
17:12:29Araqthey are an issue because of https or caching
17:12:43Araqthey used to work fine for years
17:14:02Tiberiumwho manages https://nimble.directory/ ?
17:14:07Tiberiumthere are some dead links
17:15:32def-Tiberium: more importantly, throws an SSL exception for me
17:15:40Tiberiumdef-, not for me
17:15:53def-only sometimes when i refresh the page
17:15:59Tiberiumit uses TLS 1.2
17:16:14def-on this page: https://nimble.directory/pkg/nimes
17:16:30Tiberium502 ?
17:16:35def-that too, sometimes
17:16:45def-after crashing jester i guess, before it can restart
17:16:46Tiberiumwow
17:16:50TiberiumSSL erro really
17:17:00Tiberiumerror: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:04dom96federico3: ^
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:37dom96All time high scores are now tracked! http://picheta.me/snake/
17:48:49dom96Also, deaths and pauses are now shown in the score board.
17:51:31Tiberiumoh noo
17:51:53dom96cool, it's working pretty well
17:52:01dom96Tiberium: That was a close battle :)
17:52:16*rokups quit (Quit: Connection closed for inactivity)
17:53:01dom96well, I got 66
17:54:30dom96Tiberium: did you play on mobile?
17:54:41Tiberiumdom96, not yet:) but I tested it like 4 hours ago
17:55:06dom96Cool. Think the controls are okay?
17:55:20Tiberiumdom96, yeah
17:57:01Tiberiumby the way, is there any performance impact if I use "var" everywhere or I use "let" and "const" where I can?
17:58:14Tiberiumand also in the future I hope Nim will compile for WebAssembly target - so we can have almost native speed
17:59:27dom96Not sure about 'var' vs. 'let', but 'const' should be faster in many cases.
18:01:49Araqlet can be faster than var
18:02:16Araqconst is faster than let.
18:05:14dom96Araq: Trying to beat me? or is it an imposter?
18:07:22dom96hah
18:07:27dom96Didn't take long for somebody to hack it
18:07:50AraqI did beat you.
18:08:06Araqyup, hacked already, nice
18:08:56dom96I just got 91
18:09:17dom96Not cool whoever that was
18:09:26Tiberiumprobably it wasn't necessary for me to ask about cheating :(
18:10:26cheatfateAraq, of course maybe assembler code looks better, but c generated code on `const` with `let` is looks similar, at least for objects
18:11:17dom96Of course, I can easily fix it :P
18:12:50*stisa left #nim ("User left")
18:13:35dom96Now that's just asshole behaviour
18:13:57dom96Yes, you've killed the server by sending it bad JSON. Maybe time to give it a rest?
18:14:55Tiberiumdom96, who killed it?
18:15:02Tiberiumdom96, it wasn't me :)
18:15:03dom96No idea.
18:15:31dom96I'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:59Tiberiumdom96, trace the IP :P
18:19:12Tiberiumor give it to this chat xD
18:19:27dom96Let me crack out my VB.NET IP tracer.
18:19:50Araqcheatfate: code quality depends on the involved types, my advice is about the general case
18:20:20Tiberiumdom96, hmm, where is my brainf*ck IP tracer
18:20:34dom96best I can do is befungee
18:20:49dom96*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:03Tiberiumok, 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:35dom96Definitely not the last one :)
18:54:06*Jehan_ quit (Ping timeout: 240 seconds)
18:54:38*Jehan_ joined #nim
19:02:29dom96Okay. Should be a lot more cheat proof now :)
19:06:09Tiberiumfirst Nim repo in github, by advanced search: https://github.com/Rosetta-FizzBuzz/nimrod-FizzBuzz
19:06:17*Parashurama left #nim (#nim)
19:07:39dom96hah, i've got an older one https://github.com/dom96/AELC
19:12:59Tiberiumdom96, it's not detected by github, wow
19:13:11Tiberiumdoes it compile?
19:13:44dom96No D:
19:14:08dom96Because for some reason I upper cased my parameters
19:15:20dom96and uppercased True
19:15:22Tiberiumdom96, compiled wow
19:15:54dom96But yeah, doesn't take much to fix
19:16:03Tiberiumdom96, backwards compatibility
19:16:19dom96I guess that sorta shows that we should release v1 asap
19:16:29*kunev quit (Ping timeout: 240 seconds)
19:16:36Tiberiumwait, SEVEN YEARS AGO
19:16:39Tiberiumoh my gawd
19:16:50dom96yep
19:17:11dom96That's when I started using Nim
19:17:38Tiberiumdom96, it's actually a surprise for me, because I'm 16 years old (almost 17)
19:17:46dom96The reason I wrote a stack language interpreter was because I used Factor before and was fascinated by these types of languages.
19:18:37dom96Tiberium: I was ... let me think... 14 back then
19:19:02dom96Damn... I really feel old now.
19:19:06Tiberiumdom96, I was 10, as you can guess
19:19:13TiberiumI didn't knew about things like that
19:19:17*kunev joined #nim
19:19:19TiberiumI didn't knew about programming languages at all
19:19:38dom96When I was 10 I was starting to program with VB.NET heh
19:20:05dom96Hanging out in MSDN forums asking very silly questions.
19:20:21dom96But without those kind people I wouldn't have learned it at all
19:22:35*shashlick quit (Ping timeout: 264 seconds)
19:23:23federico3thanks for the ping dom96
19:23:36*shashlick joined #nim
19:23:37dom96np
19:24:11Tiberiumwhat can be the reason of "Error: attempting to call undeclared routine: 'nnkIdent'" ?
19:24:16TiberiumI imported `macros`
19:25:05SusWombatWould 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:14SusWombatas there are more ressources atm for scheme
19:27:15dom96Tiberium: Are you trying to do nnkIdent()?
19:27:20Tiberiumdom96, yeah
19:27:28dom96SusWombat: There might even be some language-agnostic examples.
19:27:34TiberiumnnkIdent(!"AccountAccountCounters")
19:27:46dom96Tiberium: Yeah, the examples on the page aren't actual Nim code.
19:27:54SusWombatdom96, so youd say looking at some lisp stuff might make sense?
19:27:58Tiberiumdom96, lol :)
19:28:16Tiberiumit would've been easy with that kind of syntax
19:28:19dom96SusWombat: sure
19:28:33SusWombatdom96, ok thank you :)
19:28:44dom96If you're willing to spend some money though, my book has a metaprogramming chapter.
19:29:16dom96Tiberium: Yeah, I wonder if we could get that syntax.
19:29:24SusWombatdom96, i dont have the money currently but its on my "might buy" list :)
19:29:44dom96I would give it away for free if I could :(
19:30:37Tiberiumdom96, ehm, random guys from internet will give it away for free probably
19:30:53Tiberiumif it was the book about C++, it would already be pirated
19:31:14TiberiumI think it's sometimes better if a language has smaller popularity than others
19:31:50dom96hehe, indeed.
19:35:16Tiberiumdom96, how can I debug my macro via dumpTree:
19:35:36dom96You probably treeRepr
19:35:52dom96dumpTree is to see the representation of some Nim code as an AST
19:35:54Tiberiumdom96, thanks
19:35:57dom96treeRepr takes a NimNode
19:38:10*couven92 quit (Ping timeout: 258 seconds)
19:45:08Tiberiumdom96, how to define a tuple with macro?
19:45:40Tiberiumah, nvm
19:45:45TiberiumdumpTree helps
19:46:51zachcarterI’m writing a set of bindings to the C Spine runtime
19:46:59zachcarterrunning into a tiny bit of trouble here at the end
19:47:31zachcarterspine expects you to implement a few functions on your own in your engine
19:47:50zachcarteran 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:59zachcarterI’m compiling the spine sources inside my nim source
19:48:13Tiberiumwait, macro's are not that scary
19:48:18zachcarterand I’m getting undefined symbols for those functions
19:48:38zachcarteras they’re referred to in the sources I’m compiling
19:48:44zachcarterbut the linker can’t find an implementation
19:48:48*bjz joined #nim
19:49:11zachcarternot quite sure how to hook up an implementaiton I write in nim with what the linker is looking for
19:49:13zachcarterany help?
19:49:54zachcarterI can write the implementations in Nim no problem, it’s getting them to the linker that I’m struggling with
19:50:40dom96zachcarter: Don't have much experience with this i'm afraid
19:50:54zachcarterhrm :/
19:51:02zachcarterit’s like I need to precompile a nim source
19:51:26zachcarterany ideas Araq?
19:55:47*krux02 joined #nim
19:58:13Tiberiumdom96, 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:41Tiberiumwhat I'm doing wrong?
19:58:52dom96what error does it give?
19:59:03Tiberiumdom96, "Error: field 'strVal' cannot be found"
19:59:50Tiberiumdom96, it only gives it for this exact "let" statement, I have two others like that
20:00:14Tiberiumhm
20:00:17TiberiumI don't know
20:00:33Tiberiumok, my question - how to make macro with parameters, so this parameters will be passed into newIdentNode()
20:00:43Tiberiumparameters - I mean strings
20:01:34*yglukhov quit (Remote host closed the connection)
20:02:07dom96hrm, i'm not sure. These attributes could certainly be more visible when doing treeRepr et al.
20:02:25dom96I remember running into a similar problem where I wasn't sure how I can get the underlying node's value.
20:02:29zachcarterkrux02: have a second?
20:02:40krux02yes
20:02:49zachcarterhoping maybe you can help me with something
20:03:04krux02I hope so too
20:03:05zachcarterI’m trying to write bindings to a library - specifically the spine C runtime
20:03:07Tiberiumdom96, ah, ok, but I will definitely need to have simple code generation with strings, without macros (because I need to parse json)
20:03:19TiberiumIt's not too hard, just define all types as tuples
20:03:24Tiberium(from web api)
20:03:26krux02I have to google spine
20:03:31zachcarterlet me link
20:03:39zachcarterhttp://esotericsoftware.com/spine-in-depth
20:04:07zachcarterthey have a C runtime which is what I”m binding to
20:04:16zachcarterI’ve written the bindings already but I’m hitting a snag
20:04:37*Sentreen quit (Ping timeout: 260 seconds)
20:04:44zachcarteryou 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:03zachcarterideally I want to implement these methods in Nim
20:05:36*user0___ joined #nim
20:05:49zachcarterhere are those methods - https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39-L58
20:06:06zachcarterthey’re not present for instance in - https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-c
20:06:50zachcarterso I’m not sure how to go about building these bindings in the best way
20:07:57krux02well, you could write the forward declaration in C, and the implement them in nim
20:08:26zachcarterah yeah okay I see
20:08:35zachcarterlet me try that, thank you
20:08:49krux02with the exportc pragma, you can control the name of a nim function in C
20:09:10zachcarteroh cool
20:09:12krux02the rest is just correct types
20:09:15zachcarterright
20:11:43Tiberiumlol, in json describing web api: base_bool_int is enum with 0, 1 with names "no", "yes"
20:11:59Tiberiumand 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:04krux02zachcarter, I did not know about spine, but it does look cool.
20:34:14zachcarteryeah, kinday pricey but neat
20:34:56krux02they wanna live, too
20:35:06Tiberiumwhat would be the best way to define types from WebApi? they have in their name: apiSection_objectName
20:35:23TiberiumI firstly done ApiSectionObjectName (like PhotosPhotoTag)
20:35:45Tiberiumbut it doesn't look good, so I've done Photos_PhotoTag to separate section and name
20:35:47Tiberiumah, nevermind
20:35:48krux02Tiberium, well that seems legit
20:35:55TiberiumI will split these types into modules
20:36:03Tiberiumone file = one section
20:36:15Tiberiumand good syntax accessing them "Photos.PhotoTag"
20:36:25krux02Tiberium, you should know that in nim name_A and namea is actually considered as equal identifiers
20:36:30Tiberiumkrux02, I know
20:36:30*user0___ quit (Quit: user0___)
20:36:45Tiberiumkrux02, I want to autogenerate types from JSON Schema
20:36:56TiberiumI'm doing it with simple strings, not macro's, because I can't
20:37:07krux02I always treat nim as if it case sensitive though, I don't like inconsistent writing of the same identifier
20:37:11Tiberium(or I can, but it would require to make another file format)
20:37:13Tiberiumkrux02, me too
20:37:45Tiberiumcurrently my tiny script does something like this "type Widgets_CommentMedia = tuple[type: string, owner_id: int, item_id: int, thumb_src: string]"
20:37:53krux02I 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:45Tiberiumkrux02, it then would look like Wall_app_post
20:39:19krux02well you can also just take the name as it is
20:39:43Tiberiumkrux02, I want to have shiny good names like in normal Nim :)
20:40:01Tiberiumi plan to make a nimble package for that api, but it would take some time
20:40:25TiberiumI want firstly to make auto-gen script to generate all types, and then write api wrapper (it's easier)
20:41:19krux02well, you could apply some name transformation from snake_case to CamelCase
20:41:36Tiberiumkrux02, I've done it:) capitalizeAscii helps
20:42:41krux02but for the beginning it should be your priority to make it work, not fiddle with beautiful names
20:43:03krux02remember, don't get stuck with ugly naming, but also don't waste your time there
20:43:09Tiberiumkrux02, I already have a little working script (like 50 lines)
20:43:16Tiberiumit sends http requests already
20:43:17krux02ok
20:43:45Tiberiumso 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:34Tiberiumand I want it to be like apiInstance.messages.send(message = "hello", peer_id = 1)
20:45:11Tiberium(with type checks so you can 100% know what you will get)
20:49:12krux02Tiberium, well with the internet nothing is 100% sure
20:50:06krux02I don't know the API, but there is always more than one thing you can do
20:50:56krux02objects cal always be layed out in function parameters, o
20:51:16krux02not always but often
20:52:44krux02so instead of send( myobject(i:123,s:"abc") ) you can have send(i=123,s="abc")
20:53:43krux02maybe you want to prefer the first version, because it is easier to generate, or maybe for other reasons
20:55:18Tiberiumkrux02, yeah, but api method can have photo object, which itself can have other objects
20:55:22TiberiumI don't know for real :)
20:55:38Tiberiumyeah, maybe I should just put my simple version on nimble first
20:55:40krux02me neither
20:56:10krux02not sure for nimble though
20:56:16krux02but it is an idea
20:56:27Tiberiumkrux02, btw, do you know, is there any libraries like "requests" in Python for Nim?
20:56:28krux02I recommend using an API internally first before publishing it
20:56:58Tiberiumbecause httpclient isn't the best for complicated cookies/headers stuff
20:57:08krux02I don't know python, so I can't really tell you that
20:59:39Tiberiumkrux02, currently stuck at https://github.com/nim-lang/Nim/issues/5611
21:00:24krux02well that looks like something that can be fixed with a pull request
21:00:36Tiberiumkrux02, I know :)
21:00:59krux02I mean it is not a compiler bug, you have the chance that it is readable code
21:01:14krux02even though I don't think that the nim programming language has very readable code
21:01:31krux02I mean the main repository
21:01:57Tiberiumkrux02, with some IDE with "jump to definition" it would be much easier :)
21:02:18Tiberiumehh, why JetBrains just doesnt make a Nim IDE with free version, so there will be a lot of new users
21:02:52krux02Tiberium, well JetBrains wants to sell IDE software, so they chose languages by popularity
21:03:19krux02and I don't think that JetBrains is really that great of an IDE
21:03:25krux02I mean it is really good
21:03:25Tiberiumkrux02, they do
21:03:30Tiberiumfor example PyCharm is the best for Python
21:03:32krux02but it is also clunky and slow
21:03:38Tiberiumyeah, you need good PC too
21:03:40krux02uses a lot of resources
21:03:46Tiberiumbut it provides a LOT of features
21:04:00krux02well most of them you never use
21:04:27krux02I learned for myself, that I do not want an IDE
21:04:34krux02I want a toolbox to work with
21:04:47krux02a box where I can replace tools with new ones when I don't like them
21:04:54Tiberiumkrux02, 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:57krux02with IDE's I have to throw away everything
21:05:04krux02I can't replace little things
21:05:39krux02well 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:07krux02it's not an editor feature, it is nimsuggest that does it
21:06:17Tiberiumkrux02, I know
21:06:29Tiberiumbut it's not instant :)
21:06:29krux02jetbrains 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:49krux02it's neither instant in jetbrains
21:06:57Tiberiumkrux02, it is on good PC's :)
21:06:58krux02there is another feature every editor should have
21:07:07krux02and that is quick navigation between files via keyboard
21:07:13krux02I think jetbrains has it
21:07:27AraqVS Code has it. control+P
21:07:46krux02Araq, vim has it too (via plugin :P)
21:09:15TiberiumBut 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:16krux02https://youtu.be/5FQwQ0QWBTU?t=44s
21:09:27krux02those are the things that truely matter
21:09:50*nsf quit (Quit: WeeChat 1.7)
21:10:01krux02everything else is unimportant
21:10:05*chemist69 joined #nim
21:10:18krux02(don't watch the video it's about c++ and emacs)
21:10:36krux02but the point is, this is true no matter what the ide and the programming language is
21:12:07*Trustable joined #nim
21:20:36Tiberiumwow, nim even compiles on a free CodeAnywhere container (256mb ram + 512mb swap)
21:23:15*bjz joined #nim
21:25:23krux02what is a code anywhere container
21:25:57Tiberiumkrux02, CodeAnywhere is a cloud IDE
21:26:05Tiberiumso you can have a free account
21:26:17Tiberiumbut there's no syntax highlighting for Nim sadly
21:26:27Tiberiumthere's plenty of cloud IDE's
21:27:02Tiberiumc9.io for example
21:27:21Tiberiumlet me see if it provides Nim syntax highlighting
21:27:45Tiberiumsadly no :(
21:27:55Tiberiumbut you can, for example, connect to CodeAnywhere container via SSH
21:28:50krux02well I did not entirely get this trend of new browser editors, I prefor working locally.
21:29:54Tiberiumkrux02, for example if you're not on your PC
21:29:59Tiberiumso 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:29krux02well when I am not on my pc it probably means that I am on vacation ;)
21:40:02Tiberiumehm
21:40:19TiberiumI found a 650kb json, both stdlib json and jsmn can't parse it
21:40:24Tiberiumwhile python's standart module can
21:41:50Tiberiummaybe because this file contains A LOT of chinese unicode characters
21:42:14Tiberiumlike this "マイリスト】【彩りりあ"
21:43:48Tiberiumoh wait
21:43:50krux02that is japanese
21:43:51Tiberiumit succeed
21:43:55Tiberiumkrux02, sorry :(
21:44:01Tiberiummaybe some disk caching issues
21:44:06Tiberiumbut it succeed this time lol
21:44:25Tiberium(just testing python json benchmark vs nim) xd
21:45:35Tiberiumand you know who's the winner. cpython averages at ~0.4s, pypy - almost the same, Nim - 0.045s
21:46:05krux02yay
21:46:09TiberiumBut "jsmn" - another json library for Nim can't parse this file :(
21:46:17Tiberiumhttps://github.com/OpenSystemsLab/jsmn.nim
21:46:18*Jehan_ quit (Quit: Leaving)
21:46:41krux02I would say the difference is neglible
21:46:48krux02what file are you parsing?
21:47:08krux020.4 seconds sounds like a very big file
21:47:18Tiberiumkrux02, I found python benchmarks :) it's 750kb json with some twitter data
21:47:30krux02that is small
21:47:32Tiberiumoh, 624kb
21:47:38krux02even smaller
21:47:54krux02well I don't know much about the json parson of nim
21:48:19krux02probably not very optimized just something to get the job done and not a lot of thoughts went into optimization
21:48:23Tiberiumkrux02, the main thing - you actually have the same amount of lines in Python and Nim
21:49:27krux02what a coincidence
21:51:37Tiberiumkrux02, 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:59krux02well yea, whatever pleases you
21:55:06Tiberiumkrux02, yay, I found old (2 year) repo of "benchmarks game" benchmarks ported to nim
22:00:03krux02Tiberium, do you have experience with c++ and optimizing that?
22:00:08Tiberiumkrux02, no
22:00:09krux02or C?
22:00:16TiberiumI have only experience with Python :)
22:00:20Tiberiumso i'm noob
22:00:35krux02well when you want to optimize nim, you should read tutorials for that
22:00:55krux02there are not tutorials written on how to optimize for nim, because that community is too small
22:01:01krux02you have to map c++ to nim then
22:01:37cheatfateTiberium, there only one optimization technique in nim, try to avoid allocations
22:01:50krux02the short for is, use little memory. But stuff in continuous array of structs or strucs of arrays
22:02:01krux02don't use ref types
22:02:10cheatfateref types is good
22:02:10Tiberiumkrux02, I don't use it:)
22:02:16krux02especially don't use seq[ref Something]
22:02:33cheatfatekrux02, why?
22:03:08krux02cheatfate, well you said it already, allocation
22:03:09cheatfateuntil you are single threaded its pretty fast
22:03:19cheatfateahh yeah of course :)
22:03:19Tiberiumkrux02, 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:31krux02cheatfate, well you said it already, seq[ref Something] is a lot of allocation, and also might have fractured memory
22:03:39Tiberiumand nim is more readable (but it's just calculations)
22:03:53cheatfate3.6s and 5.2 is something wrong with optimizations
22:04:01Tiberiumyes
22:04:03Tiberiummaybe
22:04:05cheatfate3.6s and 3.8-3.9 is ok
22:04:10Tiberiumnim's nbody uses "addr"
22:04:15TiberiumI don't know what is it
22:04:21Tiberium"var b2 = addr bodies[j]"
22:04:45krux02well nobody really cares that much about micro optimizations
22:04:52krux02what matters is that it can be fast enough
22:05:23krux02Tiberium, that case can easily create you invalid pointers
22:05:30Tiberiumwell, python takes ~ 700 secs on this benchmark :D
22:06:25krux02Tiberium, addr creates a pointer, that is something like a reference
22:06:34krux02so you have a ptr type
22:06:46krux02ptr and ref types in nim are very much the same
22:06:51Tiberiumkrux02, maybe they just made it to have less array access
22:07:03Tiberiumvar b2 = addr bodies[j] and then b2's fields are changed 3 times
22:07:05krux02the only difference is for the garbage collector
22:07:15krux02the gc doesn't care for ptr types
22:07:50krux02Tiberium, that means that bodies[j]'s fields are changed 3 times
22:08:18krux02probably to avoid writing bodies[j] three times
22:09:56*Kingsquee joined #nim
22:10:58Tiberiumwell, this repo is 2 years old, and all benchmarks except one (it's using gmp), compiled successfully with some deprecation warnings
22:11:47krux02Tiberium, then do a good thing and resolve all deprecation warnings
22:12:05krux02it should also give you a hint on how things work in the Nim world
22:12:14Tiberiumkrux02, btw, it's def- 's repo :)
22:12:20Tiberiumhttps://github.com/def-/nim-benchmarksgame
22:12:24krux02after 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:07zachcarterwhat’s the propper type to bind a c array to?
22:53:12zachcarterc2nim produces ptr ptr
22:54:25PMunchA ptr to a Nim array?
22:54:54zachcarterlike
22:55:03zachcarterspBone** bones;
22:55:12zachcarterif spBone is a struct
22:55:26zachcarterin C that’s essentially an array right?
22:56:19zachcarterhttps://forum.nim-lang.org/t/567
22:56:22zachcarterI think this answers my question
22:56:51Tiberiumdom96: got 30 points with phone (just my inattention)
22:57:18dom96Tiberium: nice :)
22:57:43Tiberiumbtw 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:05Tiberiummaybe some JS
22:58:36Tiberiummaybe this helps
22:58:43Tiberiumhttp://stackoverflow.com/questions/4472891/how-can-i-disable-zoom-on-a-mobile-web-page
22:59:04PMunchzachcarter, no that's a pointer to a pointer
22:59:16PMunchOr that's how you would typically write a pointer to a pointer
22:59:48PMunchIf 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:13PMunchSo when the function returned you would have a pointer to the pointer to your data
23:01:03zachcarterah 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:53dom96Tiberium: Yeah, I noticed that sometimes it selects the text as well. Definitely needs polishing, but hopefully playable in general :)
23:21:00dom96Thanks for testing. Good night.
23:42:36*PMunch quit (Quit: leaving)
23:43:31Tiberiumoh, it seems that we can actually have a revolution based on what happened on yesterday's rallies almost in all big cities in Russia