<< 06-03-2018 >>

00:12:10FromGitter<matrixbot> `Temperance` I'll see, I'll give it a look over the week.
01:33:30*xkapastel joined #nim
01:36:47FromGitter<zacharycarter> hrm - anyone around that has knowledge of the Nim VM?
01:38:48*tiorock joined #nim
01:38:48*rockcavera quit (Killed (wilhelm.freenode.net (Nickname regained by services)))
01:38:48*tiorock is now known as rockcavera
01:58:31*MJCaley quit (Quit: MJCaley)
02:09:19*S1tiSchu joined #nim
02:13:06*S1t1Schu quit (Ping timeout: 265 seconds)
02:15:32*arnetheduck joined #nim
02:32:05*d10n-work quit (Quit: Connection closed for inactivity)
03:08:30*arnetheduck quit (Remote host closed the connection)
03:10:35*arnetheduck joined #nim
03:17:09*SenasOzys quit (Ping timeout: 252 seconds)
03:28:01*vlad1777d quit (Ping timeout: 265 seconds)
03:29:37*endragor joined #nim
03:36:10*tiorock joined #nim
03:36:10*tiorock quit (Changing host)
03:36:10*tiorock joined #nim
03:36:10*rockcavera is now known as Guest37660
03:36:10*Guest37660 quit (Killed (rajaniemi.freenode.net (Nickname regained by services)))
03:36:10*tiorock is now known as rockcavera
04:54:19*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:02:12*r3d9u11 joined #nim
05:13:48*r3d9u11 quit (Remote host closed the connection)
05:14:21*r3d9u11 joined #nim
05:50:04*r3d9u11 quit (Remote host closed the connection)
05:53:08*nsf joined #nim
05:58:20*xet7 quit (Ping timeout: 265 seconds)
06:26:10*dddddd quit (Remote host closed the connection)
06:29:43*r3d9u11 joined #nim
07:08:43*yglukhov joined #nim
07:22:15*solitudesf joined #nim
07:50:09*Vladar joined #nim
07:57:53*far4ia4650 quit (Ping timeout: 240 seconds)
08:01:14*far4ia4650 joined #nim
08:10:45*PMunch joined #nim
08:29:37*SenasOzys joined #nim
08:32:22*SenasOzys quit (Remote host closed the connection)
08:32:52*yglukhov quit (Remote host closed the connection)
08:33:09*SenasOzys joined #nim
08:34:03*SenasOzys quit (Remote host closed the connection)
08:42:41*solitudesf quit (Ping timeout: 248 seconds)
08:44:50*solitudesf joined #nim
08:57:32*sendell joined #nim
08:58:48*solitudesf quit (Quit: solitudesf)
09:04:43*solitudesf joined #nim
09:05:24*floppydh joined #nim
09:19:56*rokups joined #nim
09:24:23*yglukhov joined #nim
09:28:59*yglukhov quit (Ping timeout: 260 seconds)
09:37:44livcdI am kinda disappointed by Manning
09:39:45*r3d9u11 quit (Read error: Connection reset by peer)
09:45:01*yglukhov joined #nim
09:49:23*yglukhov quit (Ping timeout: 256 seconds)
09:51:41PMunchlivcd, how so?
09:55:43*r3d9u11 joined #nim
09:59:45*onionhammer1 quit (Ping timeout: 252 seconds)
10:05:38*yglukhov joined #nim
10:07:20livcdPMunch: they are not replying to e-mails about bad formatting in some of the book ...for months
10:10:09*yglukhov quit (Ping timeout: 265 seconds)
10:26:15*yglukhov joined #nim
10:30:30*yglukhov quit (Ping timeout: 256 seconds)
10:35:13*floppydh quit (Ping timeout: 240 seconds)
10:36:49*floppydh joined #nim
10:37:39*couven92 joined #nim
10:42:48PMunchOuch, yeah that's no good
10:42:58*xkapastel quit (Quit: Connection closed for inactivity)
10:47:42*Amun_Ra quit (Quit: brb)
10:51:53*Amun_Ra joined #nim
11:02:04*dmi0 joined #nim
11:04:21*onionhammer1 joined #nim
11:06:54FromGitter<Bennyelg> how I can return a json response using jester?
11:07:31*yglukhov joined #nim
11:07:56*floppydh quit (Ping timeout: 255 seconds)
11:08:11FromGitter<Bennyelg> I tried something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9e769b8f1c77ef3a8b166c]
11:08:48PMunchAnd that didn't work?
11:08:55FromGitter<Bennyelg> nop :/
11:09:00PMunchError?
11:09:08PMunchYou might have to call $ on it
11:09:45*floppydh joined #nim
11:10:07FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9e770fe4ff28713afd2ac6]
11:10:52PMunchYeah
11:10:58PMunchThat's a type mismatch
11:11:18PMunchhttp://ix.io/TfE/nim
11:11:20PMunchThat works
11:11:54PMunchNote the explicit $ call on line 6 to convert the JSON to a string
11:12:01*yglukhov quit (Ping timeout: 248 seconds)
11:12:03*vlad1777d joined #nim
11:13:44PMunchdom96, maybe it would be nice to have a resp variant in Jester that took JSON data and set the Content-Type header to "application/json"
11:15:32Araqyeah, seems such a common thing
11:16:49FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9e78a16fba1a703ad408d1]
11:17:00FromGitter<Bennyelg> my response: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9e78ac35dd17022e28c3fa]
11:19:01Araqecho (1, 2, 3)
11:19:04Araqvs
11:19:07Araqecho(1, 2, 3)
11:19:15Araqthe first passes a tuple to 'echo'
11:19:25Araqthe second calls echo with 3 arguments
11:19:45Araqprobably the Nim tutorials should highlight this difference
11:19:45FromGitter<Bennyelg> :O
11:20:35Araqthe error message says 'tuple of' explicitly though, maybe read the error message ;-)
11:21:30FromGitter<Bennyelg> thanks.
11:22:00PMunchOh and Bennyelg, I think contentType wraps it in the Content-Type header itself, so you should either change it to contentType: "application/json" or to headers: [("Content-Type", "application/json"")]
11:22:37AraqI could it make it more chatty so that you can then ignore even more of it... we can't win the fight against the non-readers. and I'm not blaming you at all, I prefer to not read things myself too.
11:27:29*floppydh quit (Ping timeout: 248 seconds)
11:28:09*yglukhov joined #nim
11:29:19*floppydh joined #nim
11:32:17*yglukhov quit (Ping timeout: 245 seconds)
11:35:22*Amun_Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
11:35:47*Amun_Ra joined #nim
11:43:52federico3urgh... that's very error prone
11:44:56PMunchThe whole echo () vs echo() thing?
11:45:20federico3yep
11:45:30PMunchYeah, but I wouldn't want to be without it..
11:46:00federico3do you use "procname (...)" often?
11:46:23PMunchNo but I use "procname 10" a lot
11:46:30FromGitter<ZarsBranchkin> Not sure if I know of a language, that has `name (args)` syntax with space, hadn't noticed at least
11:46:33federico3that's different
11:46:34PMunchNot often you would pass a tuple to something in that way
11:46:44PMunchbrb
11:47:28FromGitter<survivorm> Personally, i'd warn user on that
11:47:49FromGitter<survivorm> not error, but seing it as error prone as it is...
11:48:07FromGitter<survivorm> it's better be reformulated
11:48:12federico3survivorm: yep. "foo a" where a is a tuple is ok, but when "foo (..." trigger a type error a special warning could be printed out
11:48:22*MJCaley joined #nim
11:48:40FromGitter<ZarsBranchkin> I guess "Did you mean .." message wouldn't do too much harm. Might make the error noiser, but maybe it's fine here
11:48:45*dmi0_ joined #nim
11:48:46FromGitter<survivorm> i agree on that 😄
11:49:39PMunchIt would be interesting if we could call procedures by passing them a tuple with it's arguments..
11:49:41FromGitter<survivorm> cause situation there foo tuple is incorrect is better yet
11:49:43federico3not much noisier when is triggered only by the "foo (" pattern
11:49:47PMunchProbably a horrible idea, but would be interesting
11:50:17PMunchI mean the error message is pretty clear
11:50:29federico3PMunch: you mean like python's foo(*list_of_args, **dict_of_keyword_args) ?
11:50:29PMunchYou passed a tuple but I expected these options
11:50:31FromGitter<survivorm> than situation then you're actually CAN do a foo tuple, but DON't want to
11:51:35FromGitter<survivorm> I'd say passing foo (tuple) should be considered bad practice, anyway
11:51:39*dmi0 quit (Ping timeout: 265 seconds)
11:51:48PMunchsurvivorm, well the tuple would have to match typewise obviously. So that would likely seldom occur, but you can always use "procname((<tuple goes here>)) to call it with the tuple as the first argument
11:52:10FromGitter<survivorm> if you want to, you'd better use foo((tuple))
11:52:17PMunchsurvivorm, yeah foo (tuple) should indeed be considered bad practice as it's confusing
11:52:31FromGitter<jaco60> so enforce use of parenthesis in proc call ?
11:52:33FromGitter<survivorm> And i think it should be strict
11:52:38FromGitter<survivorm> no
11:52:41FromGitter<ZarsBranchkin> Gah, I keep naming proc arguments as `func` and being confused by weird compiler errors, because my editor doesn't highlight it as keyword
11:52:46FromGitter<survivorm> only in this situation
11:52:48PMunchjaco60, but only for tuples? That's confusing :P
11:53:03FromGitter<ZarsBranchkin> It doesn't even say that func is deprecated, just that i'm missing some `)`
11:53:03FromGitter<jaco60> No, in all cases
11:53:34FromGitter<survivorm> @jaco60 I don't think everyone will agree on that
11:53:41FromGitter<jaco60> i’m not :)
11:53:46PMunchI don't agree
11:53:49FromGitter<jaco60> i’m a Haskell fan :)
11:53:56FromGitter<survivorm> and, besides, it's not wthat we want
11:53:58PMunch(((((()))))))
11:54:10PMunchThere you go jaco60 :P
11:54:18PMunchSome extra brackets for you
11:54:19FromGitter<survivorm> we want a situation to be clear
11:54:36FromGitter<ZarsBranchkin> Dunno, I kind of like no parantheis procedure call. For example, in macro it's more readable when I use `newIdentNode "someIdent"` instead of using parenthesis
11:54:49PMunchI like Clojure though so I'm not really the right person to mock you for that :P
11:54:53FromGitter<survivorm> and it will be if we are to throw error on foo (...) constructs
11:55:09federico3why throwing error if the construct is valid?
11:55:13FromGitter<survivorm> and only then
11:55:19PMunchAn error is a bit strict
11:55:26PMunchYeah, why throw an error if it's valid
11:55:52federico3a more explicit warning is enough - to be printed only if there's a type error
11:55:57FromGitter<survivorm> Because it may lead to bad consequences. And warnings are seldom read
11:56:23dom96There already is an error?
11:56:26PMunchI think it would be very rare for this to lead to bad consequences that wouldn't be caught by the type checking
11:56:32dom96You get a type mismatch error on this
11:56:35FromGitter<survivorm> that warrants only a simple change
11:56:37FromGitter<ZarsBranchkin> I mean, error will be thrown in most cases anyway. Just have to add message like "Did you mean to call procedure?" or something
11:56:50PMunchdom96, yeah, but they want to add a hint on what you did wrong
11:57:04federico3dom96: the current error message does not hint on the whitespace
11:57:32dom96yes, in general we need a better error system in Nim
11:57:32PMunchIf you have a mismatch with a tuple it could add an extra "are you trying to do <this> while meaning to do <that>"
11:57:58dom96With hints that explain possible steps to fix the problem
11:58:09FromGitter<survivorm> @PMunch don't use word rare. In programming unforseen consequences are everythere. Even if the error situation is supposed to happen NEVER, not only rare
11:58:37FromGitter<survivorm> Safe is better than sorry
11:58:43*MJCaley quit (Quit: MJCaley)
11:59:44PMunchWell, you don't want to end up like this: http://www.breachbangclear.com/wp-content/uploads/2015/03/too_safe003.jpg
11:59:59federico3survivorm: perhaps refactoring "foo (..)" into "foo((...))" could be a task for a code formatter yet to happen
12:00:11FromGitter<survivorm> Remember lessons of the Halflife (about the things that shoud not have been happend never :))
12:00:56FromGitter<survivorm> @federico3 That's WRONG. Cause it requires a user input
12:01:04dom96There is a lot of things in Nim that fall under the "it feels like it could cause issues in the future"
12:01:09dom96Like style insensitivity
12:01:23federico3survivorm: huh?
12:01:29FromGitter<survivorm> it may be translated to foo(xx) or to foo((xx))
12:01:45dom96It's annoying because a lot of people decide to dismiss Nim because of these things
12:01:54FromGitter<survivorm> And program doesn't know which one is correct
12:02:46*Snircle joined #nim
12:02:51FromGitter<survivorm> @dom96 More like they are cautious of this issues, so decide against investigating
12:03:17federico3survivorm: the tool reformats only if there is no ambiguity around types
12:03:17FromGitter<survivorm> Less such things, more interested people
12:03:27FromGitter<jaco60> i admit these spacing things disturbed me when i first met Nim
12:04:29FromGitter<survivorm> @federico3 that might help. And might not. There may be two errors at a place just as easily as one
12:04:52FromGitter<survivorm> False-positive results are the worst
12:05:31*yglukhov joined #nim
12:05:37federico3survivorm: also, you could be able to configure the formatter to be more or less strict
12:06:21federico3e.g. avoid guesswork and throw an error on unclear syntax
12:06:44FromGitter<survivorm> @federico3. People rarely read manuals. And people rarely patch default configs. Sad, but true
12:07:11FromGitter<survivorm> So the default shoud be as strict as it may be
12:07:35FromGitter<survivorm> And the changes must be made on the own risk
12:08:01federico3survivorm: if it's an external formatter tool it can ship with strict defaults without changing the language itself
12:15:06Araqthat spacing change was part of an RFC and it makes the language more consistent and easier to work with
12:16:02*floppydh quit (Ping timeout: 245 seconds)
12:16:20Araq"it might cause trouble" continues to be the least convincing argument you can come up with.
12:16:55Araqwe use the scientific method here instead, where we change stuff based on "it really did cause trouble"
12:17:09Araqlike the unary <
12:18:10Araqwhich is annoying enough, having to rewrite my code all the time because somebody somewhere had a bug.
12:18:51*floppydh joined #nim
12:20:27Araqbesides the spacing is natural, f [1] # pass an array to f, f[1] # array access
12:20:57Araqin C we have #define foo(a) vs #define foo (a)
12:26:00Yardanicohttps://github.com/nim-lang/Nim/pull/6600#issuecomment-370760846 https://github.com/nim-lang/Nim/pull/6999#issuecomment-370761180 :(
12:26:51*vlad1777d quit (Ping timeout: 268 seconds)
12:33:46federico3:(
12:41:14*dmi0__ joined #nim
12:43:39*dmi0_ quit (Ping timeout: 252 seconds)
12:46:11*endragor quit (Remote host closed the connection)
12:47:17*yglukhov quit (Remote host closed the connection)
12:58:07*floppydh quit (Ping timeout: 245 seconds)
13:00:30*floppydh joined #nim
13:04:17*Vladar quit (Quit: Leaving)
13:11:48*rustomax joined #nim
13:29:13dom96hrm, do we have something like this? https://twitter.com/_inside/status/970746679275159553
13:29:18dom96The `canImport` specifically
13:30:55AraqfileExists works at compile-time iirc
13:31:07*endragor joined #nim
13:31:21Araqso it should be possible
13:31:44PMunchWell, then you'd have to implement the module lookup logic manualy
13:31:56dom96yeah
13:32:00Araqyeah :-)
13:32:16FromGitter<andreaferretti> does `when compiles(import foo)` work?
13:32:21PMunchIt would be cool to have it use the same code-path as for imports, just excluding the last step which is actually loading the module
13:32:47Araqandreaferretti, oh I need to try
13:34:27Araqnope :-)
13:34:30Araqtemplate imp(x) =
13:34:30Araq import x
13:34:31Araqwhen compiles(imp(strutils)):
13:34:32Araq imp strutils
13:34:34Araq echo "abc".toUpperAscii
13:34:36Araqelse:
13:34:38Araq echo "meh"
13:36:04PMunchHmm, that does neither echo ABC nor meh for me..
13:36:22*dmi0__ quit (Ping timeout: 256 seconds)
13:37:01PMunchOh wait, it does it at runtime
13:38:03Araqinternally it produces Error: 'import' is only allowed at top level
13:38:13Araqso that's why the 'compiles' fails
13:38:54Araqwhich is weird ...
13:39:39Araqah no it needs to open a new scope so that symbol table changes can be rolled back...
13:39:48Araqhacky.
13:40:44FromGitter<ZarsBranchkin> hmmm, why does template also includes docstring? Kind of annoying, when I want it to be just one statement, but have some documentation
13:40:54FromGitter<ZarsBranchkin> Kind of have to use macro now
13:41:12Araqwell docstrings are part of the AST
13:41:25FromGitter<ZarsBranchkin> Yeah, it does make sense, but slighltly inconvinient
13:41:31Araqmacros need to be able to influence them
13:41:40PMunchThey are?
13:41:46Araqyup.
13:42:01PMunchI just assumed they weren't, that's great news for my protobuf implementation
13:42:06FromGitter<ZarsBranchkin> IF they weren't it would be more annoying to create doc generating tools
13:42:48Araqsystem.compiles is under-specified
13:44:08Araqif it weren't for the scope my compiles(imp(x)) would work :D
13:44:38PMunchHmm, why doesn't dumpTree show the docstring?
13:45:05dom96asserts are still giving me incorrect stack traces in my program...
13:45:10dom96(that compiles to cpp)
13:45:43AraqStmtList
13:45:43Araq CommentStmt
13:45:53dom96https://gist.github.com/dom96/44409c8133359eaa591a946792fc16b9
13:45:54Araq^ PMunch, it kinda does
13:45:57dom96Here is the strange stack trace
13:46:37Araqdom96: does that have anything to do with C++ though?
13:46:51AraqI bet for the C target it would be the same
13:47:29dom96Well, I can't test it on the C target anymore
13:47:36dom96but back when I could it only happened in the C++ backend
13:48:27PMunchAraq, ah my bad. I was looking for the string I had added :P
13:49:30*yglukhov joined #nim
13:50:57*rustomax quit (Remote host closed the connection)
13:52:54*aziz joined #nim
13:53:37*yglukhov quit (Ping timeout: 248 seconds)
13:54:35PMunchHmm, when is documentation generated from something like that though?
13:55:11PMunchI've tried creating a macro that outputs a proc with a docstring and call it, but running "nim jsondoc2" on it generates an empty result..
14:00:49*athenot joined #nim
14:01:33*rustomax joined #nim
14:01:34*rustomax quit (Remote host closed the connection)
14:10:08*yglukhov joined #nim
14:10:25Araqgive the proc an export marker
14:13:41PMunchAha!
14:13:45PMunchThat's great!
14:14:49*yglukhov quit (Ping timeout: 260 seconds)
14:18:16FromGitter<narimiran> @dom96 i'm trying to install (choose)nim on windows, and i downloaded latest choosenim release for windows (choosenim-0.3.2_windows_i386.zip). is this 32-bit version?
14:18:33dom96yes
14:18:54*aziz quit (Quit: Ex-Chat)
14:19:18Araqok, I made 'canImport' work
14:19:41FromGitter<narimiran> would that explain "out of memory" notifications i've been getting when trying to run something that works on my linux machine?
14:19:55Araqcertainly
14:20:10Araqon 32bits you can't use more than 3GB on Windows
14:20:45Araqwhy do we have so many users with programs that eat memory like no tomorrow?
14:21:33FromGitter<narimiran> because i'm doing some numerical computations with a domain of 100 space-steps and 500,000 time-steps? ;)
14:22:01Araqwhat did you do in the 90ies then? :P
14:22:36FromGitter<narimiran> went to elementary school and play on my 486
14:23:53FromGitter<narimiran> is there some other way (as easy as choosenim) to install nim to a windows machine on which i don't have admin privileges?
14:24:09Araqunzip the file and run finish.exe
14:24:43FromGitter<narimiran> btw, is there a reason why there are no 64-bit releases of choosenim for windows, @dom96?
14:24:48Araqhttps://nim-lang.org/download/nim-0.18.0_x64.zip
14:25:17dom96narimiran: Lack of time
14:26:17FromGitter<narimiran> @Araq will try that. i thought it is more complicated than that! :)
14:26:42FromGitter<narimiran> should i uninstall choosenim-version first?
14:27:02AraqI think so, not sure.
14:27:17FromGitter<narimiran> @Araq finish.exe can't be run without admin privileges :(
14:27:29Araqlol what?
14:27:39dom96You don't have to uninstall choosenim
14:27:59AraqI don't even test it with admin privs
14:28:12Araqfix your security setting maybe?
14:28:32FromGitter<narimiran> oh, it wanted MY password, not admin's
14:28:52dom96Why does it want your password? 0_o
14:29:06Araqyeah, never heard that one before
14:29:24FromGitter<narimiran> @dom96 because it is "protecting me" or whatever windows popup has just said....
14:29:42dom96oh, is this Windows 10's thing?
14:29:50Araqthat's now how Windows 10 works
14:29:52FromGitter<narimiran> it's the first time i see this screen....
14:29:55FromGitter<narimiran> win 8.1
14:30:19Araqscreenshot! :-)
14:30:46euantorprobably can't do an actual screenshot if it's UAC
14:30:46*yglukhov joined #nim
14:31:11AraqUAC doesn't ask for a password
14:31:15euantorI'd guess this is a machine ona domain and you don't have domain admin privileges
14:31:23euantorIt does if you set it up to do so
14:31:25*birdspider joined #nim
14:31:47Araqok, I have never set it up to do so and it's not the default
14:32:14FromGitter<narimiran> screenshot coming up :)
14:32:18euantoryeah, it's not default for administrator accounts. it is for user accounts I believe
14:32:25Araqconfused me when I first used Linux :-)
14:32:42euantoryou can modify it in secpol.msc
14:32:44Araq"what the ...? I have not forgotten my pw, thanks"
14:33:04Araq"why do you keep asking me about my pw? I used it to login"
14:33:05FromGitter<narimiran> https://i.imgur.com/JnGh8KA.png
14:33:29dom96yep, "SmartScreen"
14:33:31euantoroh, that's smart screen rather than UAC. it's because the binary isn't signed
14:33:54Araqand choosenim.exe is signed?
14:34:37FromGitter<narimiran> choosenim.exe - the same thing. so i downloaded .zip and that didn't bring up this screen
14:34:59*yglukhov quit (Ping timeout: 256 seconds)
14:36:07Araqjust let Windows 8 die :P
14:38:16FromGitter<narimiran> wooohooo, this works!!
14:38:36FromGitter<narimiran> now i can freely use my enormous program :)
14:38:44dom96choosenim gets around this by using a .bat script :P
14:38:59dom96and then using it via the terminal doesn't trigger SmartScreen
14:39:22dom96Araq: Pretty sure Windows 10 has this too
14:39:40Araqdom96: never seen it in my life
14:39:54*salewski joined #nim
14:39:57FromGitter<narimiran> now i need to find how to easily measure elapsed time.... too used to use linux tools
14:40:18dom96You've probably disabled it or something
14:40:21Araqnimble install nimbench
14:41:03Araqdom96: how can I disable what I am unaware of?
14:41:32dom96Maybe you've turned down the security settings
14:41:42FromGitter<narimiran> heh, i guess i could measure time inside nim, you're right :) didn't cross my mind
14:42:19Araqhmm doesn't sound like me. I'm always concerned about security. :P
14:42:24*floppydh quit (Quit: WeeChat 2.0.1)
14:44:51FromGitter<narimiran> @Araq can i use `times.cpuTime` for measurement? why is `nimbench` your recommendation?
14:45:28Araqso that you test nimble.exe
14:45:37AraqXD
14:45:39*floppydh joined #nim
14:45:53FromGitter<narimiran> :D
14:47:17*athenot quit (Ping timeout: 245 seconds)
14:47:49salewskiAraq, for the bug of the prime guy from forum post https://forum.nim-lang.org/t/3613/1#22540
14:47:52salewskiThe fact that "for byt in seg[0..Kn-1]:" creates a copy of the seq for each call is indeed not that obviously for beginners...
14:48:36*athenot joined #nim
14:49:03Araqit creates a single copy and then iterates over it, no?
14:49:41salewskiYes, but creates a copy!
14:50:07salewskiAnd he call it often!
14:51:13salewskiThat may be a common pattern when someone wants to process only a few elements of a seq.
14:51:24*yglukhov joined #nim
14:52:17Araqa day only has 24 hours
14:52:38Araqand sometimes I care more about the users who can read a tutorial.
14:53:12*athenot quit (Ping timeout: 260 seconds)
14:53:53salewskiThat it crash when swapping starts is a bit strange for me still.
14:54:01dom96I guess we should change the syntax to `list[!thisCopies!0..kn-1!thisCopies!]` :)
14:54:31salewskiBut of course turning of GC and not btesting with GC when there are problems is not really smart.
14:54:58Araqdom96: Python's slices copy too and nobody does mind ;-)
14:55:29*yglukhov quit (Ping timeout: 248 seconds)
14:55:44salewskiPython people care not that much for performance.
14:56:11Araqbesides we have non-copy slices in the proposals under the not-to-be-mentioned-name
14:57:05salewskiOf course it is not that surprising that that construct creates a copy, but one may overlook that fact easily.
14:57:32Araqwell if you "care" about performance and don't use a profiler. or any tool.
14:57:42Araqand disable the GC based on guesswork.
14:58:00Araqthen you may have other problems than the programming language that you happen to use...
14:58:35salewskiYes that is true -- but with V 1.0 there will come many fools to Nim.
14:59:46Araqlet us get out V 1.0 first and then worry, ok?
15:00:07Araqwe tried the alternative without much success.
15:01:18Araqtemplate canImport(x): bool =
15:01:18Araq compiles:
15:01:18Araq import x
15:01:39salewskiYes, it will be really interesting how many new users V 1.0 will bring us.
15:01:51Araqnow works. not sure if developing features based on twitter messages is a wise thing to do... :-(
15:02:10Araqbut arguably it was only a bug that it didn't work before
15:02:48PMunchHaha, it's nice to take inspiration where you can
15:04:30*athenot joined #nim
15:04:56salewskiAraq, maybe you can comment on https://forum.nim-lang.org/t/3604 I dont understand it. And there is just a new invisible post.
15:07:28salewskiBye.
15:07:40Araqthe manual in 0.18 should states that the type of an integer literal is 'int' unless it doesn't fit in 32 bits
15:08:05dom96You see, now I can reply to that tweet with this amazing template ;)
15:08:18Araqotherwise it's of type int64
15:08:37Araq10 * 1_000_000_000 is an expression, not a literal
15:08:46Araqand so the compiler remains silent
15:09:08Araqit's only about the integer *literals*, not about the resulting values
15:09:38Araqbecause the values might not be known at compiletime
15:10:09Araqdom96: maybe wait for travis to be green :-)
15:10:32dom96Too late :P
15:10:32dom96https://twitter.com/d0m96/status/971040271784923136
15:10:51dom96That's what I call marketing ;)
15:12:02*yglukhov joined #nim
15:12:15Araqsome credit goes to andreaferretti
15:12:20FromGitter<zacharycarter> is it possible to create a macro that takes in blocks of statements and also injects some new code?
15:12:29FromGitter<zacharycarter> I want to do something like this -
15:12:33Araqcertainly
15:12:41Araqthat's how .async works, for example
15:13:37Araqbbl
15:13:55FromGitter<narimiran> here are some interesting/strange results from my nim installation on my work windows machine:
15:14:17*r3d9u11 quit (Remote host closed the connection)
15:14:20FromGitter<zacharycarter> ```api: ⏎ expose add: ⏎ #impl``` [https://gitter.im/nim-lang/Nim?at=5a9eb04c0a1614b712eb1a60]
15:14:37FromGitter<narimiran> i'm comparing speed of my personal linux i7-970, and work windows i7-4770
15:15:32FromGitter<narimiran> there are three "benchmarks" i'm running, and on average python is 40% faster on i7-4770 than on i7-970
15:15:52FromGitter<narimiran> the same tests, nim is only 15% faster
15:16:02*yglukhov quit (Ping timeout: 245 seconds)
15:16:23FromGitter<narimiran> and to be more interesting, julia almost takes no advantage of this faster cpu
15:19:14PMunchDid doc2 change to just doc? ref: https://github.com/nim-lang/Nim/pull/7279#issuecomment-370801921
15:19:25dom96PMunch: yes
15:19:38PMunchWhen did that happen`
15:19:51dom96It's in the changelog...
15:19:55dom96https://nim-lang.org/blog/2018/03/01/version-0180-released.html
15:19:59dom96Under "tool changes"
15:20:11*athenot_ joined #nim
15:21:17*athenot quit (Ping timeout: 255 seconds)
15:22:42PMunchAah, so as he says jsondoc should become jsondoc0 and jsondoc2 should become the new jsondoc then?
15:24:51FromGitter<zacharycarter> so can anyone provide me with an explanation of how to do what I'm trying to do?
15:25:08FromGitter<zacharycarter> I'll try to create a playground sample with a trivial example
15:25:45*dddddd joined #nim
15:31:52*r3d9u11 joined #nim
15:32:18*d10n-work joined #nim
15:34:08*r3d9u11 quit (Remote host closed the connection)
15:36:41YardanicoAraq, that commit hash start :D eeea000 - https://github.com/nim-lang/Nim/commit/eeea00058247e09a81e802f541194389d673c627
15:37:44*salewski quit (Quit: WeeChat 1.9.1)
15:39:29*endragor quit (Remote host closed the connection)
15:40:00*Jesin joined #nim
15:52:37*couven92 quit (Quit: Client disconnecting)
15:52:41*endragor joined #nim
15:55:52*endragor quit (Remote host closed the connection)
15:57:45*PMunch quit (Quit: Leaving)
16:03:00*endragor joined #nim
16:03:16*miran joined #nim
16:09:18FromGitter<jaco60> When i write `Foo = concept x, y`, it means that x and y are types potentially differents, right?
16:10:23FromGitter<andreaferretti> nope
16:10:58FromGitter<andreaferretti> it means: to check that a type T satisfies concept Foo
16:11:03FromGitter<andreaferretti> take x, y from T
16:11:17FromGitter<andreaferretti> and then do something
16:11:32FromGitter<jaco60> @andreaferretti Thanks...
16:11:54FromGitter<andreaferretti> you have to think what would even mean for x and y to have different type
16:12:18FromGitter<andreaferretti> say you have some type T that you want to figure out whether it belongs to the concept
16:12:36FromGitter<andreaferretti> how do you come up with another type for the second variable?
16:13:11FromGitter<andreaferretti> if you think of it a bit, you will see that it would not be well define
16:14:24FromGitter<jaco60> i was wondering, because i’ve seen two versions of Comparable concept… The one in the manual (with x and y), another in the dom96 book, with only x...
16:14:49FromGitter<andreaferretti> it's just more readable with two variables
16:15:02FromGitter<andreaferretti> using only one may be confusing
16:15:32FromGitter<jaco60> yes, in fact, it does confuse me!
16:16:50*SenasOzys joined #nim
16:17:33FromGitter<andreaferretti> :-)
16:20:45*floppydh quit (Quit: WeeChat 2.0.1)
16:34:19*Trustable joined #nim
16:36:47*subsetpark joined #nim
16:49:12*jubalh left #nim (#nim)
16:53:24*Jesin quit (Quit: Leaving)
16:54:52Yardanico@data-man - I think t1ha won't satisfy our needs - https://github.com/nim-lang/Nim/pull/6600#issuecomment-370844205
16:54:59Yardanicobecause nim wants to be very portable
16:57:47*cornfeedhobo quit (Ping timeout: 256 seconds)
17:02:31*cornfeedhobo joined #nim
17:07:26*xkapastel joined #nim
17:10:17*vivus joined #nim
17:17:12*r3d9u11 joined #nim
17:17:37*cornfeedhobo quit (Quit: ZNC - http://znc.in)
17:22:01FromGitter<zacharycarter> how could I write this - https://play.nim-lang.org/?gist=7582c7fd35e6eadb2f7e15ec8249612f
17:22:16FromGitter<zacharycarter> so that instead of having to call api() and then be able to use the template produced by the API macro
17:22:41FromGitter<zacharycarter> I could do something like - ⏎ ⏎ ```api: ⏎ expose add: ⏎ #body``` [https://gitter.im/nim-lang/Nim?at=5a9ece60c3c5f8b90d3e207d]
17:26:17FromGitter<ZarsBranchkin> Have api accept untyped argument, return statement list with that template and the passed argument. Basically what you're already doing, just appending the body as well
17:27:02FromGitter<zacharycarter> ah okay I'll give that a shot! thanks @ZarsBranchkin!
17:27:24FromGitter<ZarsBranchkin> Hm, wait, i think the argument already will be statement list, so prepend template definition to it
17:27:38FromGitter<zacharycarter> okay
17:29:05FromGitter<ZarsBranchkin> I do something similar as well, except rewriting procedure defintions to make them compatible with external application
17:38:31*cornfeedhobo joined #nim
17:41:26*xet7 joined #nim
17:47:45*birdspider quit (Quit: Leaving)
17:57:10*sendell quit (Remote host closed the connection)
18:02:19*xet7 quit (Ping timeout: 268 seconds)
18:14:05*xet7 joined #nim
18:21:22*endragor quit (Remote host closed the connection)
18:37:50FromGitter<msiglreith> Hey! I'm trying to implement a macro to 'rewrite' a function (injecting own code) but I'm stuck at a 'redefinition' error: https://play.nim-lang.org/?gist=514ae8ff994475d50deb46c6cda99c5b ⏎ Any way to 'undefine' to old function? thanks
18:40:11*Vladar joined #nim
18:41:55*PMunch joined #nim
18:44:49FromGitter<ZarsBranchkin> I'd set argument as result, set result.params[0] as uint32 and append nodes to result.body
18:45:05FromGitter<ZarsBranchkin> Would be cleaner and more readable
18:46:56FromGitter<ZarsBranchkin> On phone though, won't be able to edit snippet
18:47:40FromGitter<alehander42> your poblem is that you need
18:47:44FromGitter<alehander42> code to be `untyped`
18:47:46FromGitter<alehander42> not `typed`
18:48:01FromGitter<alehander42> because you want to run the type system after the rewrite
18:48:12FromGitter<alehander42> also, you can just return newProc, no need of stmt list
18:48:16FromGitter<alehander42> for it
18:50:21Araqhi alehander42
18:50:47AraqI've written another karax related experiment and I'd like your opinion on it
18:51:07AraqI used Karax's DSL and threw away the DOM diffing :-)
18:52:13Araqso in every onaction callback you have to run some specialized DOM update
18:53:25*rokups quit (Quit: Connection closed for inactivity)
18:53:26Araqso it's slightly more tedious to work with but as reward one gets to work on the stateful browser DOM directly, perfect interop with all the JavaScript components
18:54:18Araqno idea how it will scale for bigger examples though :-)
18:57:55FromGitter<alehander42> very interesting
18:58:03FromGitter<alehander42> I will take a look now
18:58:06FromGitter<alehander42> the trello one right
18:58:10Araqright
18:59:11FromGitter<aboisvert> perhaps related karax question: Is there a way to exclude DOM nodes (recursively) from the diff'ing algorithm? I'm running into issues with a charting library that's doing changes behind Karax's back and it's triggering assertion failures
18:59:28Araqlook at the examples
18:59:43AraqI have added some blacklisting of DOM IDs for echarts
19:00:51FromGitter<aboisvert> thanks, I'll take a look
19:00:57FromGitter<msiglreith> @ZarsBranchkin @alehander42 Thanks, as it doesn't seem to be possible with `typed` I'm switching to `untyped` :)
19:01:54FromGitter<aboisvert> @Araq Are you referring to `setForeignNodeId` ?
19:02:28FromGitter<aboisvert> (i was wondering what that was for ... cool)
19:04:56Araqyeah setForeignNodeId
19:11:07Araqthe DOM updates can be automated further by "reactive" data structures/ideas but I'm not happy with them, too much runtime magic. The existing solutions all require something like 'onNextTickDo' to prevent infinite update loops which gets confusing
19:12:51shodan45I haven't read all the context for that, but "onNextTickDo" & "infinite update loops" makes me shiver a bit
19:13:12Araqdirect DOM updates are a poor man's reactive system but sometimes worse is better.
19:13:34Araqshodan45, well that's what I want to avoid like the plague :-)
19:14:14Araqso don't worry, these things are not in Karax.
19:17:32shodan45OT: wow, Dart needs to get its marketing together... it just feels so confused - v1 vs v2, client & server vs just client... blargh.
19:19:52*r3d9u11 quit (Remote host closed the connection)
19:23:58*solitudesf quit (Quit: solitudesf)
19:48:49*arthurz joined #nim
19:50:37*zarthur quit (Ping timeout: 245 seconds)
19:52:40*endragor joined #nim
20:05:23FromGitter<zetashift> dart's marketing is all flutter
20:05:29FromGitter<zetashift> maybe angular but that ain't hip atm
20:05:39FromGitter<zetashift> also #off-topic kek
20:13:30FromGitter<ivanflorentin> hello
20:14:16FromGitter<ivanflorentin> in karax when a component tries to render a variable which is null the whole render fails
20:14:22*athenot_ quit (Read error: Connection reset by peer)
20:16:53*endragor quit (Ping timeout: 240 seconds)
20:17:08*athenot joined #nim
20:18:19FromGitter<ivanflorentin> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9ef78bc3c5f8b90d3f1eb3]
20:18:59FromGitter<ivanflorentin> if I remove ```text(s.name)``` it works fine
20:21:04FromGitter<ivanflorentin> ``````
20:30:03PMunchivanflorentin, yeah what would you expect would happen?
20:37:28*athenot_ joined #nim
20:37:33*athenot quit (Ping timeout: 240 seconds)
20:41:58FromGitter<ivanflorentin> to render an empty text enstead
20:42:33Yardanicoyou should initialize the variable with "" then
20:43:50*nsf quit (Quit: WeeChat 2.0.1)
20:44:17*endragor joined #nim
20:50:41FromGitter<ivanflorentin> and validate everything before rendering or risk breking the app... I think it would make sense to just render "" whenever a variable comes null
20:51:09Araqyou can annotate your fields with 'not nil' and make the compiler check it for you
20:51:51Araqand you really should "validate everything" IMO
20:53:48*miran quit (Quit: Konversation terminated!)
21:06:32*endragor quit (Ping timeout: 276 seconds)
21:06:40*athenot joined #nim
21:08:17*athenot_ quit (Ping timeout: 260 seconds)
21:13:10*athenot quit (Remote host closed the connection)
21:13:28*Vladar quit (Quit: Leaving)
21:13:48*athenot joined #nim
21:22:01FromGitter<zacharycarter> that was a long day 😧
21:22:36FromGitter<zacharycarter> but I managed to write my first macro in between surgery sessions :D
21:26:40Araqbetween surgery sessions? o.O
21:26:46Araqget well soon please
21:27:29FromGitter<zacharycarter> thanks :) I'm fine though - had a basal cell carcinoma removed from the top of my head
21:27:41FromGitter<zacharycarter> just took a long time
21:32:16*endragor joined #nim
21:37:55FromGitter<matrixbot> `Temperance` So, I'll try to learn Nim over the week, what would be the recommended resource for a C programmer?
21:47:00*PMunch quit (Quit: leaving)
21:47:37dom96Temperance: I haven't personally read this, but it might be helpful: https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers
21:47:45*far4ia4650 quit (Quit: WeeChat 2.0.1)
21:47:51dom96Also if you see things that could be better explained, please edit it, it's a wiki after all :)
21:49:26*whisky joined #nim
21:50:11*endragor quit (Ping timeout: 256 seconds)
21:52:32*Jesin joined #nim
21:56:37AraqTemperance: you can also try to translate some C code via c2nim
21:59:37FromGitter<matrixbot> `Temperance` well, for starters, the two links on that page actually don't work :P
21:59:51FromGitter<zacharycarter> any ideas? - https://gist.github.com/zacharycarter/a4058a6e536e45c6eb88b493eb34708d
21:59:54dom96lol
22:00:00dom96Simple to fix
22:00:28Araqwhich links?
22:00:50FromGitter<matrixbot> `Temperance` the ones for the tutorial
22:00:56dom96I fixed them
22:01:17FromGitter<matrixbot> `Temperance` http://nim-lang.org/tut1.html
22:01:46Araqoh you mean on the wiki
22:01:48Araqok
22:01:57FromGitter<matrixbot> `Temperance` ah, nice :P
22:06:52*endragor joined #nim
22:11:43*endragor quit (Ping timeout: 256 seconds)
22:17:02*endragor joined #nim
22:17:49*Jesin quit (Quit: Leaving)
22:19:47FromGitter<zacharycarter> anyone have a sec to look at my macro issue?
22:20:12FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a9f141cc3c5f8b90d3fbae5]
22:22:44*Jesin joined #nim
22:23:51*Trustable quit (Remote host closed the connection)
22:30:44GitDisc<sion> Type inference question, should a and b in this gist infer to int32? https://gist.github.com/GrundleTrundle/de42f236d3be74def27da86fa47c88af
22:31:27*Jesin quit (Quit: Leaving)
22:35:09*Jesin joined #nim
22:36:27dom96sion: pretty sure you're getting `a`=index, `b`=tuple
22:36:39*endragor quit (Ping timeout: 256 seconds)
22:42:23GitDisc<sion> You are right. It should have been "for a, b in items(edges)". I knew I had destructured tuples before, but forgot that was with iterators.
22:44:01dom96yeah, Nim will use `pairs` implicitly if you have two vars in a for loop
22:44:26GitDisc<sion> Thanks.
22:53:47GitDisc<Teapotrick> Hate to be that guy, but I can't get "--out" to work on c2nim. it just errors out, spouting that it can't open the outfile (which... i mean, it doesn't exist yet).
22:54:07GitDisc<treeform> it could be a directory or some thing?
22:54:34GitDisc<treeform> I have run into directory thing before
22:55:35FromGitter<zacharycarter> I'm stuck on a windows machine for the time being - does anyone have a shell recommendation or should I just use PowerShell?
22:57:03GitDisc<Teapotrick> @treeform oh, like it wants a directory, rather than a file...?
22:57:25GitDisc<Teapotrick> nope: "Can't open <that directory>
22:57:59GitDisc<Teapotrick> ah, craps. it has to be absolute. ffffffff no `~` for me
22:58:07GitDisc<Teapotrick> thanks for the response. 😄
22:58:12*birdspider joined #nim
23:00:04GitDisc<treeform> zacharycarter, I do! Let me find it.
23:00:19GitDisc<treeform> I recommend this: http://cmder.net/
23:01:03*reginald_ joined #nim
23:01:21GitDisc<treeform> You can chose to run cmd, power shell or bash with it. So its not really a different shell just a skin that combines them nicely.
23:01:54FromGitter<zacharycarter> treeform: ah cool - I was about to ask about that. I need to invoke powershell so that is good :D
23:03:13*endragor joined #nim
23:04:28GitDisc<treeform> its a "console emulator" not a shell... console emulator is the GUI part and shell is the non gui part.
23:05:04GitDisc<treeform> console emulator that windows ships with is bad, while shell is awkward you need it to do windows stuff.
23:05:14GitDisc<treeform> console emulator that windows ships with is bad, while shell is awkward but you need it to do windows stuff.
23:05:30*reginald_ quit (Ping timeout: 260 seconds)
23:13:15*birdspider quit (Quit: Leaving)
23:19:43*endragor quit (Ping timeout: 256 seconds)
23:31:52*MJCaley joined #nim
23:32:08*S1tiSchu quit (Read error: Connection reset by peer)
23:32:26*S1tiSchu joined #nim
23:41:50*NimBot joined #nim
23:43:15*d10n-work quit (Quit: Connection closed for inactivity)
23:43:17arthurzAre we going to get #Nim #REPL anytime soon?
23:46:02*endragor joined #nim
23:48:39dom96arthurz: https://media3.giphy.com/media/wPkWlsnohtn7a/giphy.gif
23:54:21FromGitter<zetashift> @zacharycarter those kinds of skin cancer rarely form a threat, unless you delay it waaaayy too long, so glad you got rid of it asap !
23:54:31FromGitter<zetashift> And I'm also a cmder
23:54:55*MJCaley quit (Quit: MJCaley)
23:58:24arthurz@zacharycarter I trust the worst is behind you. You are a very brave man! Also devoted to #Nim :-)