<< 17-10-2018 >>

00:05:15*abm quit (Ping timeout: 252 seconds)
00:11:57*Jesin joined #nim
00:34:36*seni quit (Quit: Leaving)
00:44:31*Jesin quit (Quit: Leaving)
00:45:28*vlad1777d__ quit (Ping timeout: 272 seconds)
00:51:12*zachk quit (Quit: Leaving)
01:24:16*Guest32018 quit (Quit: WeeChat 2.0)
01:24:34*c15ade4 joined #nim
01:24:57*c15ade4 is now known as Guest89712
01:26:00*Guest89712 quit (Client Quit)
01:26:14*c15ade4 joined #nim
01:46:00FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc694581c100a4f299a2993]
02:04:51*banc quit (Quit: ZNC - http://znc.in)
02:23:04*banc joined #nim
02:36:49FromGitter<yyyc514> i can call methods directly without importing them, can’t it?
02:38:04FromGitter<yyyc514> or only if they are marked public?
02:48:47*dddddd quit (Remote host closed the connection)
02:50:08FromGitter<yyyc514> jester makes it hard to just use the router portions :)
02:50:22FromGitter<yyyc514> wonder if they’d be open to splitting those out into a router.nim
03:00:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:12:41*chemist69 quit (Ping timeout: 250 seconds)
03:14:37*chemist69 joined #nim
03:56:00FromGitter<juancarlospaco> I need to rate limit api calls to 5000/day without persistance (eg write to disk etc), what would be the best way?.
03:59:23shashlickdom96: nimble is broken on #head - doesn't recognize tasks anymore
03:59:24shashlick```
03:59:26shashlickError: undeclared identifier: 'task'
03:59:27shashlick```
04:24:30*MyMind joined #nim
04:26:21*Sembei quit (Ping timeout: 250 seconds)
04:29:08shashlickhttps://github.com/nim-lang/nimble/issues/562
04:31:11FromGitter<yyyc514> anyway to see what a template is spitting out?
04:33:51*endragor joined #nim
04:51:20FromGitter<juancarlospaco> @yyyc514 https://nim-lang.org/docs/macros.html#treeRepr%2CNimNode
05:17:51*leorize quit (Ping timeout: 252 seconds)
05:19:10*narimiran joined #nim
05:23:11*nsf joined #nim
05:40:36*regtools quit (Ping timeout: 272 seconds)
05:41:09*regtools joined #nim
05:49:11*smt quit (Read error: Connection reset by peer)
05:51:52*narimiran quit (Quit: Konversation terminated!)
05:54:25*k0mpjut0r joined #nim
06:09:09*darithorn quit ()
06:13:53FromGitter<vegai> is there a code formatter anywhere?
06:15:55FromGitter<technicallyagd> `nimpretty`
06:20:40*MyMind quit (Excess Flood)
06:21:45*MyMind joined #nim
06:22:41FromGitter<technicallyagd> @vegai, You can find the code here (https://github.com/nim-lang/Nim/blob/devel/nimpretty/nimpretty.nim). It should be installed if you compiled from the Nim source code, or use `devel` channel with `choosenim`. It has some quirks, but it's totally usable. Plus, @Araq just made a lot of commit fixing the quirks.
06:42:39FromGitter<cipharius> How would one call the statement line that starts a new control flow block in python style syntax? Been trying to find tool that displays beginning of indented block my cursor is currently in, can't seem to find anything online
06:44:49FromGitter<cipharius> I ran in a problem, of having long enough if statement block, but i want to return to lower level block, except i have to scroll up and see if I am on the correct indentation depth. Instead i thought of tool that prints beginning of current block, like an if statement
06:45:13FromGitter<vegai> @technicallyagd thanks
06:48:23FromGitter<cipharius> It wouldn't be tough to create the command myself, but i wanted to see how others deal with such problem. I guess i can always just try to keep the functions short and split it up in smaller logical parts
06:50:01FromGitter<technicallyagd> @vegai You're welcome :D ⏎ @cipharius I would love this tool too.
06:50:21*krux02 joined #nim
06:51:48FromGitter<cipharius> I'm using emacs, so it has all the nescessary functions to easily do it. It's hard to believe something like that doesn't exist already
06:53:21krux02cipharius: I just joined and I have no history.
06:53:34krux02what doesn't exist already?
06:53:47krux02and I have a question
06:53:49krux02nimble is broken
06:53:55krux02what can I do about it?
06:54:04krux02it crashes when it tries to parse the version
06:54:20FromGitter<technicallyagd> @krux02 jumping to/peeking at the top of a code block like `if`
06:54:31FromGitter<cipharius> krux02: Tool that displays headline of control flow block your cursor is on
06:54:45krux02ah
06:54:55krux02like in the git diff
06:55:03FromGitter<cipharius> Annoying when you have long nested if statements
06:55:17krux02shouldn't be too hard to implement
06:55:40krux02just show last top level statement
06:55:56FromGitter<cipharius> Yeah, at the least create keybinding that prints the line in mini-buffer
06:56:09FromGitter<cipharius> Fancier version cpuld use the popup.el
06:56:09krux02tho only thing I don't trust emacs in is to visualize that information without breaking the content of some buffers
06:56:24krux02(sorry windows I mean)
06:56:50FromGitter<cipharius> oh i meant just with message, not popup window
06:57:09FromGitter<technicallyagd> Yeah, but should this function be implemented separately in each IDE/editor or could we incorporate this into `nimsuggest`?
06:57:38FromGitter<cipharius> It could be nice feature of nimsuggest
06:58:11FromGitter<technicallyagd> Does python have this feature in most editors?
06:58:16krux02something like this pseudo code (save-excursion (re-search backwards "^[^ ]") (message-the-current-line))
06:59:31krux02another question does anybody have problems with recent nimble version?
06:59:37FromGitter<cipharius> i was actually looking for that to use in python, so i didn't find anything
06:59:42krux02My nimble can't parse my version string anymore
07:00:18*rewadz joined #nim
07:00:42FromGitter<cipharius> I also can't believe that nim-mode company support is still so broken
07:01:10krux02I think the most useful version of that feature would print that information at the top of the window (first line or something), but only when it is not already visible
07:01:33krux02cipharius: yea I just disabled it
07:01:40krux02just causes problems
07:02:04krux02I made a PR with readme changes that warns about the immature state of nimsuggest-mode
07:02:06FromGitter<cipharius> Last time i tried, it hung up and failed to communicate with nimsuggest
07:02:13FromGitter<technicallyagd> @krux02 I haven't tried the latest nimble yet.
07:02:26krux02but that is something the current maintainer doesn't like
07:02:35FromGitter<cipharius> krux02: yeah, would like that too. Basically stickyfunc but for each scope
07:03:07*leorize joined #nim
07:04:34krux02I can't find the source folder of nimble
07:09:35krux02I did find it
07:21:05Araqkrux02: nimble works for me
07:37:18krux02Araq: it crashes on my project
07:37:30krux02I looked in the sourcecode, and it looks clearly like a bug
07:38:51krux02Araq: here is the bug https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/version.nim#L193
07:39:01krux02i+1 is out of bounds
07:39:14krux02the if condition before is incorrect
07:39:29krux02but I checked when that code was changed the last time
07:39:34krux02it was 6 years ago
07:39:56krux02so I guess it was dead and now it is active for some reason
07:43:53krux02I am actually surprised that this isn't done with regular expressions
07:44:07krux02they would really match the problem better
07:46:24Araqregexes suck
07:46:43Araqanyhow, accessing the \0 used to not be an error, remember
07:47:04Araqand the code wasn't updated properly for newer Nims, compile Nimble with --laxStrings:on
07:49:10FromGitter<yyyc514> lol
08:01:36FromGitter<yyyc514> "A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature."
08:01:37*floppydh joined #nim
08:01:51FromGitter<yyyc514> but this doesn’t hold true if you’re using a type that knows the function signature?
08:11:15*abm joined #nim
08:21:39*stefanos82 joined #nim
08:46:25*Vladar joined #nim
08:51:35*platoff joined #nim
08:55:17FromGitter<glassofethanol> Good Morning
08:58:33*krux02_ joined #nim
09:00:53*krux02 quit (Ping timeout: 245 seconds)
09:02:35*gmpreussner quit (Ping timeout: 244 seconds)
09:03:28*gmpreussner joined #nim
09:05:22*anamok joined #nim
09:05:23anamokhi
09:05:48*leorize quit (Ping timeout: 272 seconds)
09:06:23anamokFrom the official tutorial: "Note that $ applied to strings is a nop." What is a nop? Does it mean the compiler notices that you want to convert a string to a string and does nothing with that? "No operation"?
09:13:24Araqyes
09:14:13Araqbut this sentence should be removed, tutorials should not be about compiler optimizations
09:14:54Araqwith 0.20 we may get a real high-level optimizer anyway (*cough*)
09:15:44FromGitter<yyyc514> Error: type mismatch: got <proc (r: var Request){.closure, noSideEffect, gcsafe, locks: <unknown>.}> but expected 'proc (r: var Request){.gcsafe, locks: <unknown>.}'
09:15:49FromGitter<yyyc514> ok this one has me head scratching
09:17:27Araq.closure vs .nimcall mismatch?
09:17:39*glassofethanol joined #nim
09:18:37FromGitter<yyyc514> so it doesn’t like that i’m using a closure?
09:18:57anamokthanks
09:19:45*glassofethanol quit (Remote host closed the connection)
09:27:04*krux02_ quit (Remote host closed the connection)
09:46:40FromGitter<yyyc514> https://gist.github.com/yyyc514/3c5dbcbf67b64d1cbbc42c68df104ece
09:46:43FromGitter<yyyc514> can someone help
09:47:00FromGitter<yyyc514> i’m trying to build a stack of middleware but it’s creating an infinite loop
09:47:12FromGitter<yyyc514> i think i’m not understanding the proc variables or something
09:47:45FromGitter<yyyc514> stack[0] is corret but stack[1] must not be
09:48:12Araqdon't use .global here
09:48:29Araqdon't use ': void' as the return type, Nim is not C++
09:48:57FromGitter<yyyc514> ok but those arne’t the issues. it was working fine when i manually hooked up each middlware
09:49:00FromGitter<yyyc514> but the loop isn’t working
09:49:33Araquse the 'mitems' iterator instead 'for mw in mitems(stack)' so the changes are write-through
09:50:23FromGitter<yyyc514> mw is a ref, does that matter?
09:50:35FromGitter<yyyc514> they seem to be getting changed
09:51:09FromGitter<yyyc514> same with mitems
09:51:48FromGitter<yyyc514> illegal capture 'mw' of type <var Middleware> which is declared here: pastie.nim(80, 6)
09:51:51FromGitter<yyyc514> oh that’s diff
09:51:54FromGitter<yyyc514> if i remove the inbetween variable
10:03:17FromGitter<yyyc514> i made the changes you suggested, btu same behavior
10:03:24*leorize joined #nim
10:14:32*dddddd joined #nim
10:15:13Araqoh I think you need system.closureScope here :P
10:17:13FromGitter<yyyc514> bingo :)
10:17:17FromGitter<yyyc514> but only works if i remove mitem
10:18:20FromGitter<yyyc514> Error: illegal capture 'mw' of type <var Middleware> which is declared here: pastie.nim(80, 6) with mitems
10:18:34Araqsure
10:18:35FromGitter<yyyc514> man nim is just such a huge thing to learn
10:19:18Araqnot really, it's still the smallest systems programming language ;-)
10:19:29FromGitter<yyyc514> is it now?
10:19:54Araqif you compare the manual against the specs of the other systems programming languages
10:20:12Araqbut admittedly it's an unfair comparison as Nim's spec is not yet complete
10:20:58Araqbut still, it's not as big as many make it to be and we also occasionally remove features
10:21:08FromGitter<yyyc514> yikes :)
10:23:06FromGitter<yyyc514> hmmm
10:23:11FromGitter<yyyc514> i’m losing 4-5us per nested call
10:26:12FromGitter<yyyc514> i wonder if that’s because of all the indirection or just function calls in general
10:28:19anamokbye
10:28:23*anamok quit (Remote host closed the connection)
10:34:22FromGitter<yyyc514> trying to think og how you’d compile this tighter
10:39:15*elrood joined #nim
10:42:48Araqyyyc514, well closures are quite expensive, if speed is really important, better use something else :-)
10:43:08Araqlike proc (this: FooBase; params) {.nimcall.}
10:44:04FromGitter<xmonader> Is nim plugin for vscode working well with autocompletion everyone?
10:44:55FromGitter<yyyc514> is there a noclosure pragma?
10:45:07FromGitter<yyyc514> is that what nimcall is?
10:45:08Araqyyyc524, that's .nimcall
10:45:41Araqxmonader: I'd give it a 5 out of 10 currently
10:46:17FromGitter<xmonader> @Araq been coding without autocomplete for the past week i'd say (not sure if it's my setup or something else)
10:46:18FromGitter<yyyc514> i need a better bench env but speed seems about the same to me
10:46:28FromGitter<kaushalmodi> @cipharius I wouldn't be surprised if you are looking for (showing the line on parent indentation level) already exist. I'd suggest asking about this on the Emacs subreddit or the official help-gnu-emacs mailing list (great to see another Emacs user here!)
10:48:00FromGitter<cipharius> I ended up writing function for that, was easy enough
10:48:35FromGitter<kaushalmodi> @cipharius It shouldn't be difficult to derive something from this package: https://github.com/alphapapa/org-sticky-header/blob/master/README.org (see the gif).
10:48:40FromGitter<kaushalmodi> Ok
10:49:55FromGitter<cipharius> I mean, i just wrote the function that retrieves the headline. No fancy display yet, just printing it
10:53:39FromGitter<cipharius> Basically recursively went to previous line beginning of text and checked if line isn't empty and if indentation is less than one at point. Should also check if point is inside multi-line string
11:05:57*sagax joined #nim
11:18:49*PMunch joined #nim
11:24:28FromGitter<kaushalmodi> @cipharius Yes, that's what you'd need to do. Btw every major mode can also implement its own `which-func` hook. I haven't checked if nim-mode has done that too. Try `M-x which-func-mode`. Even if it's not implemented, it's pretty easy to do so. https://emacs.stackexchange.com/questions/18391/which-class-or-method-or-function-am-i-in
11:25:25*Snircle joined #nim
11:27:29FromGitter<cipharius> Thing is i want to get beginning of any control block, not just function or class. Stickyfunc would be enough then
11:40:46*revere quit (Ping timeout: 246 seconds)
11:41:37*revere joined #nim
11:49:15*revere quit (Ping timeout: 264 seconds)
11:51:19*revere joined #nim
11:51:23*Vladar quit (Read error: Connection reset by peer)
11:56:45*Vladar joined #nim
11:58:38poopBotnimx or what gui lib?
11:59:59*vlad1777d__ joined #nim
12:01:55FromGitter<narimiran> @poopBot https://github.com/trustable-code/NiGui ?
12:06:37poopBothmm i just tryed nimx but it crys ... kAlt.nim(4, 12) Error: cannot open file: nimx/window
12:06:47poopBotand i did nimble install nimx
12:07:45poopBotnarimiran[m], hmm WIP Event handling , so no buttons or what?
12:11:30poopBoti just need some buttons image display and text fileds
12:11:40poopBotbest would be some gtk
12:12:29AraqpoopBot please try nim-lang/ui
12:12:38*kapil____ joined #nim
12:13:38leorizea bit of advice when installing `ui`: after installation `cd` into the package dir, then run `git submodule update --init`
12:13:44poopBothmm am trying atm nigui will try that next xD
12:14:16poopBotleorize, thats for restarting autocomplete or what?
12:14:33poopBotupdating submodule?
12:14:44poopBotwont nimble install get latest
12:19:29poopBothmm
12:19:31poopBotError: cannot open file: nigui
12:19:40poopBotwhy am i getting this even i installed lib
12:19:56poopBotsame heppend with nimix
12:20:57poopBotthink nimble is joking me or something
12:23:28AraqpoopBot, bug https://github.com/nim-lang/Nim/issues/9375 ?
12:28:15poopBothmm , same for ui too , Alt.nim(1, 16) Error: cannot open file: ui , guess same for all
12:28:26poopBotam reading link
12:29:01poopBothmm but i have gcc (GCC) 8.2.1 20180831
12:29:48poopBoti try with clang
12:37:02poopBotlife sux
12:37:03poopBotError: execution of an external compiler program 'clang -c -w /bin/sh: pkg-config: command not found -I/home/me/.choosenim/toolchains/nim-0.19.0/lib -o /home/me/.cache/nim/kAlt_d/common_shouldquit.c.obj /home/me/.nimble/pkgs/ui-0.9.2/ui/./libui/common/shouldquit.c' failed with exit code: 1
12:37:26poopBotis this pgk-config some lib i missing
12:37:51poopBotyep
12:38:10poopBotyey it worked
12:40:19Araqseems like we need to replace O3 with O2 asap
12:44:32*cavariux quit (Quit: Ping timeout (120 seconds))
12:44:59*cavariux joined #nim
13:03:41FromGitter<alehander42> Araq, weren't there some plans to make karax able to as a server-side html renderer
13:03:48FromGitter<alehander42> able to be used as*
13:04:48*smt joined #nim
13:05:16*anamok joined #nim
13:05:21anamokhi
13:05:30PMunchHello
13:06:34anamokWhen launching my program, I want to change the directory to somewhere and I want to work there. So for instance if I create a file, I want it to be created in that selected folder.
13:06:55anamokI want that to be the current folder.
13:07:33PMunchanamok, maybe the setCurrentDir in the os module will help
13:07:58FromGitter<alehander42> huh it works already
13:08:18anamokthanks, I think this is what I need
13:09:29*endragor quit (Remote host closed the connection)
13:10:07anamokI want to set that dir. to be the current dir. I want to do some work, and then switch back to the original dir. In Python there are context managers (`with` blocks). Is there something similar in Nim?
13:11:16FromGitter<alehander42> I just need karaxdsl, I can probably even staticRead the buildHtml-s from template files
13:11:34FromGitter<alehander42> @anamok you can easily simulate with blocks using templates
13:12:27PMunchanamok, well you can easily create one with a template
13:12:28anamokRight, I can do that with a template. Something like `with_chdir("/path/to/dest"): ...`
13:12:49FromGitter<alehander42> e.g. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7355164cfc273f9df27eb]
13:13:53FromGitter<alehander42> you might want to have ⏎ ⏎ ```try: `handler` finally: restoring directory ``` [https://gitter.im/nim-lang/Nim?at=5bc73590c08b8b30672b69f4]
13:14:02FromGitter<kaushalmodi> anamok: we already have `withDir` that does exactly what you want
13:14:19FromGitter<kaushalmodi> .. or is that only in NimScripts?
13:14:24FromGitter<alehander42> but still this pattern is useful if you want to make a similar resource/context manager
13:16:00FromGitter<kaushalmodi> anamok: the best way to discover things is to visit the *theindex* page, and Ctrl+F to search in there.
13:16:18FromGitter<alehander42> actually one can even have a general `buildwith` macro which just lets the user define custom enter / exit templates
13:16:32FromGitter<alehander42> we did something like this in py2nim, but not sure how useful would it be
13:17:32anamokkaushalmodi: thanks, I didn't know that page. Very useful.
13:19:12FromGitter<kaushalmodi> Search for "with" on that page :)
13:26:24anamokSince an import brings in a lot of things, very often I don't know where a proc came from. Thus this index will be very helpful to find the corresponding lib.
13:30:58FromGitter<alehander42> ok i needed import karaxdsl, vdom actually
13:33:27*endragor joined #nim
13:33:28*endragor quit (Remote host closed the connection)
13:43:14FromGitter<Vindaar> Not sure how useful this actually is, but it was fun: https://github.com/Vindaar/shell ⏎ @kaushalmodi you might like this :D
13:49:32FromGitter<kaushalmodi> @Vindaar looks great!
13:49:59FromGitter<kaushalmodi> And no kidding, just yesterday I was thinking of:
13:50:24poopBothow is going with karax , i think it will be a nice thing when it finishes i hate js
13:52:09FromGitter<kaushalmodi> sed:\n search: ..\n replace: .. \n delete: book
13:52:23FromGitter<kaushalmodi> (sorry, on phone Gitter app)
13:53:39FromGitter<alehander42> awesome idea @Vindaar
13:54:48FromGitter<alehander42> the cool thing with such a dsl is that it's easy to add custom behavior for each command
13:55:04FromGitter<alehander42> e.g. debugging info (starting command ... finished with status )
13:55:05leorizeVindaar: you might want to try copying https://xon.sh/ ;)
13:56:03FromGitter<alehander42> once we have a good REPL, sometimes like this https://github.com/tqdm/tqdm would be very cool
13:56:41FromGitter<kaushalmodi> @Vindaar Why do you have run command in this order? `run "--out:test.txt" myProg`
13:56:48FromGitter<Vindaar> thanks! ⏎ @kaushalmodi in what context where you thinking about that? As as Nim macro? ⏎ @leorize: haha, maybe one day ;) ⏎ @alehander yep, indeed! [https://gitter.im/nim-lang/Nim?at=5bc73f9f82893a2f3bf716f6]
13:57:03FromGitter<Vindaar> oh, that `run` there is just supposed to be a dummy program
13:57:06FromGitter<Vindaar> :D
13:57:23FromGitter<Vindaar> I'll change it to something clearer
13:57:57*vlad1777d__ quit (Ping timeout: 252 seconds)
13:58:25FromGitter<kaushalmodi> Ok, I thought that "nim c foo.nim" would need to be run as `run "c foo.nim" "nim"`, which looks odd
13:58:51FromGitter<Vindaar> updated
13:59:09anamokvindaar: Windows support would be great too
13:59:37leorizeI think it's possible to implement something like xon.sh in pure macro
13:59:51FromGitter<kaushalmodi> Ok, for the sed context, I thought of that after I needed sed in the docs task (and many other places) in my nim_config repo
14:00:35FromGitter<kaushalmodi> There's also a Python library which allows shell piping in pythonic code
14:00:36FromGitter<Vindaar> @anamok: well in theory I'm just calling `execCmdEx` in the background with some string. So if you run this in powershell and use proper syntax, it should work
14:01:12anamokok
14:01:32FromGitter<kaushalmodi> anamok: or just use bash on Windows?
14:02:37FromGitter<Vindaar> Ok, I currently don't consider `\`. So if you were to hand Windows as `Some\Path\To` it would break. I can add that real quic
14:02:38FromGitter<Vindaar> k
14:03:48FromGitter<kaushalmodi> `foo/bar/paths` work on windows too
14:04:10FromGitter<Vindaar> ah, that's good then
14:04:15FromGitter<kaushalmodi> @Vindaar any idea to make this prettier? ⏎ ⏎ ```sedCmd = "sed -i 's|" & pkgName & r"\.html|" & docOutBaseName & ".html|' " & deployIdxFile``` ⏎ ⏎ (on PC now) [https://gitter.im/nim-lang/Nim?at=5bc7415f384492366153c810]
14:04:47FromGitter<kaushalmodi> used raw string `r"\.html|"` to avoid needing double backslashes
14:05:28anamokalehander42: you said "once we have a good REPL". Is it planned to be part of a future Nim release?
14:05:54*PrimHelios joined #nim
14:06:05leorizemore like: once FFI works in VM context...
14:06:28FromGitter<alehander42> not sure, but we have https://github.com/nim-lang/Nim/issues/8927
14:06:38FromGitter<alehander42> so I guess if the grant is accepted, it can happen
14:07:17FromGitter<kaushalmodi> @Vindaar something like? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7421582893a2f3bf72d10]
14:07:21leorizeIIRC when Araq was implementing incremental compilation, he said something about it would enable FFI in VM context
14:09:18FromGitter<Vindaar> @kaushalmodi sure, that should be possible. A little bit of work, but if used a lot probably worth it. ⏎ Regarding the string comment, I had a little trouble with strings and raw string literals right now. But I guess so.
14:13:08anamokI just made a discovery... You told me about the Index where one can look up functions / procs / etc. In VS Code with the Nim plugin, if you leave the cursor on a function name, in a popup it's also indicated the package from where the given function came from.
14:17:00FromGitter<alehander42> Araq, I made a macro which lets me use karaxdsl-based template files in Jester
14:17:46*PrimHelios quit (Ping timeout: 260 seconds)
14:18:21FromGitter<alehander42> does it make sense to include something like this in karax (it basically does render(path) => string with html so it can be used in any server side setting)
14:18:34FromGitter<alehander42> or should it be its own lib
14:21:41FromGitter<kaushalmodi> @Vindaar You are already depending on elnim in shell?
14:22:57FromGitter<kaushalmodi> I haven't published it yet as it doesn't yet have much material
14:32:23*elrood_ joined #nim
14:32:57FromGitter<Vindaar> @kaushalmodi sorry, was afk. Met someone when making coffee, haha. ⏎ Well, I just wanted to try if it works. :D I only use it for mapconcat.
14:36:22FromGitter<Vindaar> But since `elnim` is on github it can be installed via `nimble`. But I can also just use `mapIt` if you wish
14:37:53FromGitter<alehander42> please add all packages to the .nimble file
14:38:16FromGitter<alehander42> one can add github paths
14:38:20FromGitter<kaushalmodi> > But since elnim is on github it can be installed via nimble ⏎ ⏎ Can you add an unpublished dependency to nimble?
14:38:26FromGitter<Vindaar> yep, just did that
14:38:29FromGitter<kaushalmodi> @alehander42 ah cool
14:38:48*brainproxy quit (Ping timeout: 245 seconds)
14:38:50FromGitter<kaushalmodi> > But I can also just use mapIt if you wish ⏎ ⏎ Nope, was just plesantly surprised to see elnim being used :)
14:39:02FromGitter<Vindaar> :)
14:40:04*PrimHelios joined #nim
14:41:14leorizeisn't `mapconcat` just a fancier `foldr`?
14:44:28*Snircle_ joined #nim
14:44:33FromGitter<Vindaar> yeah, it basically is
14:44:41FromGitter<kaushalmodi> leorize: looks like it is! `@["nim", "is", "cool"].foldr(a & " " & b)`
14:46:13*craigger_ joined #nim
14:46:51FromGitter<kaushalmodi> `mapconcat` is just a useful sugar for folks who know what that term means :)
14:46:54FromGitter<kaushalmodi> `@["nim", "is", "cool"].mapconcat()`
14:47:12*craigger quit (Ping timeout: 244 seconds)
14:47:54leorizekaushalmodi: if you use it like that then, uh... use `strutils.join()`
14:48:18FromGitter<kaushalmodi> above does the same as that `foldr`. My hope is to have a much mature lisp-like Nim procs library over time; it has just started: https://kaushalmodi.github.io/elnim/
14:48:20FromGitter<zah> Hey, do you guys know that bootstrapping currently fails with VCC 2017. What is worse, it looks like some kind of memory corruption problem (happens only in release)
14:48:20*syntonym[m]1 joined #nim
14:49:21FromGitter<kaushalmodi> leorize: yeah `join(" ")` is nicer than `foldr` for this
14:49:42*Snircle quit (*.net *.split)
14:49:42*elrood quit (*.net *.split)
14:49:43*nsf quit (*.net *.split)
14:49:43*flyx quit (*.net *.split)
14:49:43*gh0st[m] quit (*.net *.split)
14:49:43*syntonym[m] quit (*.net *.split)
14:49:45*planetis[m] quit (*.net *.split)
14:49:45*TheKing[m] quit (*.net *.split)
14:49:46*nif quit (*.net *.split)
14:49:48*def- quit (*.net *.split)
14:52:57*banc quit (Ping timeout: 252 seconds)
14:53:51FromGitter<kaushalmodi> also, I don't have a real use case on when I might need to specify a closure to `mapconcat` as allowed in the original elisp version, but my idea was to port that fn to Nim as much faithfully as possible.. so this works `@["nim", "is", "cool"].mapconcat(" + ", proc (x: string): string = x & "(" & $x.len & ")")`
14:54:15*PrimHelios quit (Ping timeout: 250 seconds)
14:54:21leorizeyou know, there's the `do` notation
14:54:24FromGitter<Vindaar> @leorize: good point regarding `join`
14:54:45FromGitter<kaushalmodi> leorize: yes, but afair, `do` is on chopping block
14:55:03leorize?
14:55:13FromGitter<kaushalmodi> I had done some analysis between do and anon procs:https://scripter.co/notes/nim/#summary-of-anonymous-procs-and-do-notation
14:55:55*banc joined #nim
14:57:03FromGitter<kaushalmodi> leorize: I could be mistaken, but a while back, there were some talks about `do` notation. May be Araq can help clarify this. (or may be it was `do` notation in some other context in Nim)
14:57:33leorizethere used to be a syntax change for the `do` notation
14:57:49leorizeit was reverted in the release after that however
14:59:18Araqalehander42: Karax already supports this
14:59:45Araqif you import karax_dsl from native Nim it's a toString renderer
15:00:26FromGitter<kaushalmodi> Araq: the `do` notation for anon procs is here to stay?
15:02:23leorizekaushalmodi: https://stackoverflow.com/questions/12450066/flushing-buffers-in-c
15:02:29*sagax quit (Quit: Konversation terminated!)
15:02:34leorizethat should address the `stdout.flushFile` in your notes
15:03:06FromGitter<kaushalmodi> leorize: Ah yes, I have to yet respond to a kind comment someone posted. I never got back to them.
15:03:59FromGitter<kaushalmodi> thanks for that link; I will assimilate that into my notes
15:04:13Araqkaushalmodi: I don't like it but it's not in .experimental so unless somebody writes an RFC with a massive number of upvotes, it's here to stay
15:04:29FromGitter<kaushalmodi> Araq: cool
15:05:11FromGitter<kaushalmodi> I then got confused with discussion about deprecating some other do syntax few months back
15:05:32Araqwell I really don't like it :P
15:05:38*craigger joined #nim
15:05:46Araqit feels bolted on
15:06:13Araqand its primary use cases never materialized
15:06:26Araqso ... don't make me think about it
15:06:35FromGitter<kaushalmodi> :P OK
15:06:37*narimiran joined #nim
15:06:42*craigger_ quit (Ping timeout: 252 seconds)
15:13:37*planetis[m] joined #nim
15:15:53*TheKing[m] joined #nim
15:17:03anamokIn system we have Natural, Positive, but no Negative.
15:19:29anamokShouldn't Negative be there too?
15:20:04leorizewell, how many times would you found yourself using `Negative`?
15:20:36anamokwell, rarely :)
15:20:49anamokOK, so that's the reason
15:23:30*nsf joined #nim
15:25:20shashlickAny ideas in this https://github.com/dom96/choosenim/issues/96
15:25:53FromGitter<kaushalmodi> Can we have generic anonymous procs?
15:26:22leorizewhy would that even be a thing?
15:26:47FromGitter<zah> I remember implementing generic lambdas in the past ⏎ try map(list, proc (x: auto): auto)
15:26:48FromGitter<kaushalmodi> hehe, I was just trying this out: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc754b8600c5f6423c42925]
15:27:12FromGitter<zah> the -> sugar syntax is based on this I think
15:27:38FromGitter<kaushalmodi> @zah yay! `auto` works
15:27:42FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc754ee6e5a401c2d882a19]
15:27:44FromGitter<kaushalmodi> thanks
15:27:51FromGitter<zah> Any other generic type class will work as well
15:28:13leorizewhy would one even use that...
15:28:21FromGitter<kaushalmodi> leorize: in above example, it would be odd to restrict the type in the anon proc if the parent proc is generic
15:28:39FromGitter<kaushalmodi> In writing notes, I cover all possibilities
15:29:07FromGitter<kaushalmodi> I just end up with many "what if" questions and try them out
15:32:33*craigger quit (Ping timeout: 252 seconds)
15:32:43leorizeI don't feel "odd" at all...
15:32:43*craigger joined #nim
15:33:19leorizewell the `sugar` syntax should cover when you don't feel like typing the type out
15:35:57*Trustable joined #nim
15:39:22*darithorn joined #nim
15:43:47*craigger_ joined #nim
15:45:19*nsf quit (Quit: WeeChat 2.2)
15:45:28*craigger quit (Ping timeout: 245 seconds)
15:45:54*gh0st[m]1 joined #nim
16:07:33anamokCan we add a doc string to a var? I want to comment a public var in my library.
16:09:34leorizesure
16:10:05leorizeeither append it like this: `var smt = 0 ## doc str`
16:10:22*smt quit (Read error: Connection reset by peer)
16:10:44leorizeor `var smtelse = 1\n<indent>## doc str`
16:11:13anamokthanks
16:12:01PMunchThe variable might have to be exported as well
16:12:18leorizeit's a public var so...
16:12:30PMunchYeah
16:15:18*smt joined #nim
16:17:48anamokworked well
16:24:40*7IZAAOQQ7 joined #nim
16:24:40*flyx joined #nim
16:24:40*gh0st[m] joined #nim
16:24:40*nif joined #nim
16:24:40*def- joined #nim
16:24:41*7IZAAOQQ7 quit (Ping timeout: 252 seconds)
16:24:41*gh0st[m] quit (Ping timeout: 252 seconds)
16:26:37*Vladar quit (Remote host closed the connection)
16:49:12*platoff quit (Quit: Textual IRC Client: www.textualapp.com)
17:08:06*platoff joined #nim
17:14:30*Trustable quit (Remote host closed the connection)
17:32:06*PrimHelios joined #nim
17:41:38FromGitter<kayabaNerve> How can I overload `=` for a ref or ptr?
17:41:48FromGitter<kayabaNerve> It looks like I can't. At all.
17:42:19FromGitter<kayabaNerve> It has to be a ptr or a ref. ref has nicer syntax. If it's not either, then it crashes, because this C++ lib has the constructor marked private.
17:42:26Araqyes, by design, the destructor spec is hard enough to get right already
17:42:41Araqand it's easy to wrap the ptr/ref in an object field
17:42:55Araqshashlick, it crashes consistently... hmmm
17:42:56FromGitter<kayabaNerve> Got it. Thanks for the info.
17:50:49narimiran"Warning: safeAdd is deprecated" and should be replaced with...... ?
17:52:56*voiceftp quit (Read error: Connection reset by peer)
17:53:25Araqadd
17:54:13FromGitter<kayabaNerve> Thanks Araq for the object wrapper trick; worked perfectly.
17:54:53shashlickAraq: is it an async issue?
17:55:26Araqshashlick, probably, what does the code look like?
17:55:47narimiranAraq: should i try to replace `safeAdd` with `add` inside of compliler/, or those should not be touched?
17:56:55leorizeonce we have proper destructors, would there be a "Box" type that encapsulate a `ptr`?
17:57:12narimiran`safeAdd` is used 12 times in total, if my search is correct
17:58:03shashlickAraq: starts here - https://github.com/dom96/choosenim/blob/493d5d68cd76bb17e6ef0e49565774676cffde96/src/choosenim/telemetry.nim#L170
17:58:58shashlickCould be a bug in the analytics package but I'm a noob with macros
18:00:42Araqthere are no macros insight
18:02:08FromGitter<kayabaNerve> Araq: While you're here, there's no command line option to set the language, right?
18:02:12Araqleorize, and what would that 'Box' do? usually you have a ptr because some foreign memory management scheme
18:02:28Araqthat means you need to write your own destructor.
18:02:40Araq"set the language"?
18:02:45FromGitter<kayabaNerve> The backend.
18:02:59*rwerzxc joined #nim
18:03:49FromGitter<kayabaNerve> I'll just manually define cpp
18:03:54FromGitter<citycide> @kayabaNerve I think you need `nim c`, `nim cpp`, `nim js` etc
18:04:40*PrimHelios_ joined #nim
18:04:44FromGitter<kayabaNerve> @citycide My IDE is running `nim check`.
18:04:58FromGitter<kayabaNerve> It's a tool to see if you're command is valid when compiling it.
18:05:24FromGitter<kayabaNerve> Since it interfaces with a C++ lib, I have this block. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc779e464cfc273f9e11d18]
18:05:47FromGitter<kayabaNerve> Because I have that block, my IDE keeps complaining my code is invalid because `nim check` acts as if it's C.
18:06:05FromGitter<kayabaNerve> I think the solution is just to run `nim check -d:cpp`.
18:06:30FromGitter<citycide> can't you use a nim.cfg or `.nims`
18:06:54FromGitter<citycide> hmm actually I don't recall
18:07:09*PrimHelios quit (Ping timeout: 244 seconds)
18:07:27FromGitter<kayabaNerve> I could but that's problematic for other reasons
18:07:30Araq`-d:cpp` is the proper way to solve this, it needs to be documented.
18:07:39FromGitter<kayabaNerve> Thanks A
18:07:55Araqbut yeah, it means 'nim compile --backend:cpp' would have been a better way
18:08:02Araqwell we can still introduce it
18:08:13FromGitter<kayabaNerve> I tried that lol. Then I looked up the nimc page.
18:09:09FromGitter<kayabaNerve> @citycide The issue with a Nims is that this is a Nimble package and it would have to be placed at the root of the package. I have no idea what side effects that would cause.
18:10:34*rewadz left #nim (#nim)
18:10:43*rewadz joined #nim
18:13:56*rewadz left #nim (#nim)
18:13:59*rewadz joined #nim
18:14:10*rewadz left #nim (#nim)
18:14:18*rwerzxc quit (Quit: Page closed)
18:14:35FromGitter<bpo217> hmmm the unittest module seems to suppress any echo messages within the tested code base. Is there a way to enable it?
18:15:42FromGitter<bpo217> It looks like the default output formatter is set to print all
18:15:52FromGitter<mratsim> that’s a bug then, are you sure it’s not exceptions that are captured?
18:16:47FromGitter<bpo217> The echo happens within the code base before the assertion is fired. The assertion is printed correctly.
18:17:34FromGitter<bpo217> I just converted a simple block test to try out the `unittest` module, and the echo I was expecting disappears.
18:17:57FromGitter<bpo217> By disappears, I mean, does not appear.
18:20:58FromGitter<bpo217> Something is up, it might be my fault after all.
18:21:09narimirananother one: "Warning: mdbg is deprecated" ...and what is the alternative?
18:23:37FromGitter<bpo217> @mratsim Thank goodness it was my fault.
18:27:48*TheLemonMan joined #nim
18:28:18TheLemonManAraq, if I move() an object into a sink parameter should I get an error if I try to use it again?
18:28:31TheLemonManwasMoved seems to only zero it out
18:32:24shashlickAraq: is this crash because currentExc.msg is nil? https://github.com/dom96/choosenim/blob/master/src/choosenim.nim#L211
18:32:26*PrimHelios_ quit (Ping timeout: 276 seconds)
18:32:33shashlicknot sure where the msg is set
18:34:38*stefanos82 quit (Quit: Quitting for now...)
18:37:36TheLemonManoh I see, the move semantics are similar to C++
18:39:07AraqTheLemonMan, yeah, but sink parameters' spec is about to change slightly
18:39:36Araqthat said, in general "attempt to use after move" is at best a warning, not an error
18:40:03Araqbecause I'm not really happy how Rust models the heap
18:40:41TheLemonManI expected `sink T` to be a "give ownership to the callee" and that it'd prevent any further use of the sunk object
18:41:06Araqin a way we turn a temporal memory safety problem into a spatial one, that's good enough in my book :-)
18:41:36Araq'sink T' does mean "give ownership to the callee"
18:42:05Araqit's just that proving after an explicit 'move' that it's not gonna accessed ever again is hard
18:42:29TheLemonManlet's add lifetimes then!
18:42:32Araqessentially you can only prove it in the cases where the compiler determines this on its own
18:42:56Araqso 'move' is comparable to 'cast'
18:43:37Araqand lifetimes don't help, 'p(move a[i]); echo a[j] # valid if i != j'
18:44:05Araqit's the aliasing problem, nobody has a good solution for it.
18:44:44TheLemonManyeah, aliasing complicates every kind of analisys
18:49:02*endragor joined #nim
18:53:27*endragor quit (Ping timeout: 250 seconds)
18:53:38anamokWas Objective-C support dropped?
18:54:09poopBotok so i am no more looking for best gui , i will take any gui that has good docs
18:54:48shashlickthis is asyncmacro related - beyond me
18:55:48AraqpoopBot, I spent quite some time on ui.nim, it's portable and simple. installation problems should be solvable
18:55:58Araqshashlick, dom96 will read this :-)
18:56:36AraqTheLemonMan, what Rust does here (and correct me if I'm wrong) is it treats the array as a whole, you can only move it completely or not
18:56:59Araqwhich IMHO is too restrictive
18:57:01shashlickAraq: yep 🙂 I have a nimble and async bug for him
18:57:14shashlickbut am unable to do anything with choosenim at this time
18:57:17TheLemonManAraq, AFAIR yes, you borrow the whole thing
18:59:46poopBotAraq, ok i have some questions, var mainwin : Window , how can i do mainwin.background color or img?
19:01:44*kapil____ quit (Quit: Connection closed for inactivity)
19:03:37AraqpoopBot: ui.nim uses the native widget/window system and doesn't support that
19:04:03*rockcavera quit (Remote host closed the connection)
19:04:08poopBotoh
19:04:08FromGitter<iffy> Is there a way to use `astToStr` inside a `compileTime` proc? When I do: ⏎ ⏎ ```astToStr: ⏎ tmp``` [https://gitter.im/nim-lang/Nim?at=5bc787a8069fca52a5502129]
19:04:21poopBoti thiked i could do this with gtk
19:04:37anamokI was looking for a REPL and I just found "nim secret". It looks great.
19:04:39poopBotwanted to something like bot left on this img
19:04:40poopBothttps://kodi.tv/sites/default/files/page/field_image/about--devices.jpg
19:05:05poopBotthen should i try nuklear-nim
19:05:40poopBotdoom is coming for me :)
19:06:06FromGitter<iffy> err... I guess I'm asking if there's a way to turn a NimNode into it's equivalent Nim (as a string)
19:07:00FromGitter<iffy> *its
19:07:10anamokwell, it just crashed
19:07:12shashlicknimnuklear for latest
19:08:36AraqpoopBot: well GTK would also work, if you are familiar with that
19:09:41poopBoti used gtk with mono 1 time :)
19:10:00*PMunch shudders
19:10:05Araqor you use Karax for a HTML based UI and use a client/server split
19:10:09PMunchGtk with Mono is about as painful as it gets..
19:10:35PMunchGtk with Nim and genui is bliss in comparison :P
19:12:09Araqoh yeah, genui... I need to try that one day. too bad I don't write UIs currently
19:14:04*krux02 joined #nim
19:15:16poopBotguess that day is now for me
19:15:17FromGitter<mratsim> by the way does sink happen for aliases? ⏎ ⏎ let a = expensiveComputation() ⏎ block: ⏎ let alias123_a = a ... [https://gitter.im/nim-lang/Nim?at=5bc78a45384492366155d145]
19:15:58PMunchAraq, I'm still considering how to make the "proper" genui
19:16:13PMunchNow I'm talking about the Gtk macro (I should really have named these projects different things..)
19:16:28FromGitter<mratsim> Proper code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc78a8b069fca52a55037d4]
19:18:17poopBothmm , then nukler it is xD
19:19:08PMunchpoopBot, it works great for Gtk though :)
19:19:40PMunchhttps://github.com/PMunch/gtkgenui
19:19:42poopBotso i can use genui or you have some separte
19:19:47poopBotoh ok
19:19:55*PrimHelios joined #nim
19:19:58PMunchhttps://github.com/PMunch/gtkgenui/blob/master/example.nim
19:20:03PMunchExample of how it's used
19:22:20shashlickthere's nimui too which is up to date but i cannot get it working on windows - same with ui.nim
19:23:11FromGitter<mratsim> And also: are custom memory allocators and custom alignments for seqs working @Araq, I’m ready to rebuild Arraymancer backend using destructors and I’d like to experiment seqs on top of memory pools. (and Maybe on top of Cuda :P)
19:23:14PMunchIf you want Windows compatibility you can try wxWidgets, it also has genui support :)
19:23:44poopBoti need this for rpi3 so just linux gtk, or that nuckler lib cuz i think it can be more pritty
19:23:56FromGitter<mratsim> Webview has potential as well, just run this example: https://github.com/oskca/webview/blob/master/tests/bindEx.nim
19:25:30poopBotPMunch, i copy pasted example but i get this error
19:25:40poopBotcannot generate code for: mArrGet
19:25:44PMunchHmm
19:25:47poopBoton genui:
19:26:43PMunchSeems like it's broken past 0.17.0
19:26:52PMunchI'll see if I can fix it :)
19:26:59poopBotthen nukler it is xD
19:27:19poopBotor at least then nukler i will try
19:27:30*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
19:28:07PMunchOh wait
19:28:13PMunchI got an error from glib2
19:29:11PMunchOkay that was fixed by an update, but cairo is throwing me an error now
19:29:51poopBotyep thats how life works
19:31:14PMunchI have two different versions of cairo installed..
19:31:36PMunchI have a vague memory that this had a purpose..
19:32:44poopBotsorry i am like newbe a lot so cant really shake your memory
19:33:29PMunchHaha, no worries. IIRC the guy who made the Gtk bindings rewrote the whole thing, but something didn't work the same way
19:38:29*nsf joined #nim
19:39:53*PrimHelios_ joined #nim
19:41:57PMunchHmm, is there a way to do identifier comparison
19:42:10PMunchie. case-insensitive and underscore insensitive
19:42:13*PrimHelios quit (Ping timeout: 244 seconds)
19:42:22FromGitter<Vindaar> `eqIdent` in `macros`
19:43:04PMunchOh neat
19:47:12PMunch../../.choosenim/toolchains/nim-0.19.0/lib/pure/collections/deques.nim(171, 10) Error: internal error: too implement
19:47:15*zachk joined #nim
19:47:17PMunchWell that's not good
19:52:13PMunchWorks in 0.18.0
19:53:35poopBothmm i in no hurry :)
19:58:15Araq?
20:01:00PMunchAraq: https://github.com/PMunch/gtkgenui/tree/0.19.0
20:01:06PMunchThat's where the error message is from
20:01:13PMunchnim c example
20:01:40PMunchWorks on 0.18.0 (but is not safe for 0.18.0 use as it can have nil errors)
20:01:45anamokI'm trying to implement the functional programming function "partition", but I ran into a problem: https://pastebin.com/1atzp45W . Could someone help me?
20:01:47PMunchBut not on 0.19.0
20:04:51anamoksorry, it should be `if pred: t &= it else: f &= it`. But I get the same error
20:06:10*PrimHelios_ quit (Ping timeout: 246 seconds)
20:09:48anamokMaybe I had better write a proc called partition instead of a template.
20:11:22copygirlMhh I want to implement some union types (Union[T0,T1], implemented with case) where I have some magic to be able to do union[string] or so which would get me the string (if it is a string). Not quite sure how to go about that.
20:14:51*rockcavera joined #nim
20:15:18copygirlMhh maybe I can just do it with generic functions.
20:16:06copygirlAnd perhaps macros later to generate n-length union types, constructors and getters.
20:16:34bozaloshtshanamok: why are you using result? use the variables you defined.
20:17:05anamokAt 22:04:51 I noticed that. But I get the same error.
20:17:28anamokThere is a problem with the template.
20:17:38bozaloshtshcan you say what line the error really is on
20:17:51bozaloshtshrelative to the first line
20:18:30bozaloshtshoh nvm
20:18:30FromGitter<Vindaar> @anamok: I guess this is what you want: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ note the difference in the `newSeq` lines [https://gitter.im/nim-lang/Nim?at=5bc7991664cfc273f9e1e545]
20:18:35anamokThe problem happens when I try to call it.
20:18:42bozaloshtshuse t = newseq, not t: newseq
20:19:03*PrimHelios_ joined #nim
20:19:10bozaloshtshdo t: seq[type(arg)] = newSeq(0)
20:20:15bozaloshtshnewSeq is a value, but only types follow colons
20:21:27bozaloshtshcould even just do var t: type(s) = newSeq(0)
20:22:44anamokThanks a lot, the tests passed. Yeah, my bad.
20:23:10bozaloshtshalso if you want better compile errors if you call the template with a non-seq, use openArray[T] instead of untyped
20:23:59bozaloshtshtemplate tempname[T](arg: openArray[T]) will be the line with the compile error, rather than whenever the [] proc is called
20:26:31anamokWhy is the return type `untyped`? Could I specify that I return a tuple?
20:26:40bozaloshtshyou should
20:27:51bozaloshtshuntyped means "type doesn't matter now, the compiler will check it later on instantiation" -- it'll never lead to runtime errors but can obfuscate compile errors if misused
20:29:40*narimiran quit (Quit: Konversation terminated!)
20:29:53bozaloshtshyou should never use untyped if a generic would also work
20:30:34bozaloshtshit's for really special cases, like injecting symbols/statements into a template or complex compile-time logic
20:32:27anamokI'm trying to add the tuple as a return type but ran into newer problems: https://pastebin.com/DAQBndFj
20:33:23*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:33:37bozaloshtshopenarray can't be used as a return type
20:33:39bozaloshtshonly as a parameter
20:33:48bozaloshtshit's like varargs, a special union type
20:34:05bozaloshtshhttps://forum.nim-lang.org/t/3872
20:35:39anamokShould I return (seq[T], seq[T]) ?
20:35:53*kapil____ joined #nim
20:35:57bozaloshtshyeah, because that's what you're constructing
20:38:39dom96shashlick: Araq: what will I see?
20:40:38FromGitter<Vindaar> @dom96 I think https://irclogs.nim-lang.org/17-10-2018.html#15:25:20 shashlick's responses below
20:41:07anamokbozaloshtsh, Vindaar: thanks for the help, I could solve it. Here is the final (?) version: https://pastebin.com/2BG5Kpsz
20:41:35dom96Ahh, already replied
20:42:17shashlickdom96: any ideas how to proceed
20:42:54shashlickI looked at the exception string, nothing outstanding there
20:43:05dom96--laxStrings:on
20:43:12dom96to check if that's the cause
20:43:14shashlickAsync post not working would get caught right away
20:43:17shashlickOk
20:43:48shashlickDidn't want to jump too deep into async dispatch and macros
20:48:36*vlad1777d__ joined #nim
20:49:48anamokIs openArray a union type for arrays and seqs? When should I use it instead of seq? If I also want to pass an array to the func?
20:50:42bozaloshtshread that forum post I linked
20:50:48bozaloshtshIt explains it pretty well
20:51:36bozaloshtshtldr; it's a special parameter-only union type
20:51:38anamokoh, I missed that line
20:53:00shashlickdom96: nope --laxStrings:on didn't help
20:53:33dom96weird
20:53:48shashlickhow do exception strings get initialized?
20:54:55dom96How can it be happening with Nim 0.18.0?
20:55:04dom96Pretty sure that's what I built the latest choosenim with
20:55:10shashlickya so it isn't that
20:55:18shashlickso I had to delete my entire ~/.nimble/pkgs to even compile
20:55:30shashlicksince I had some packages installed as #head which don't get updated
20:55:43shashlicki don't think packages should make #head a dependency
20:55:51shashlickcause nimlbe will never update that
20:57:21shashlickso the NimbleError does have a valid message - can print it just fine
21:00:26*opi_ quit (Quit: ZNC - http://znc.in)
21:00:41shashlickI don't get it - my nim devel checkout is up to date but still shows as v0.18.1
21:01:07*opi_ joined #nim
21:05:36*flaviu quit (Remote host closed the connection)
21:05:55*flaviu joined #nim
21:08:18shashlickwas in some messed up state, at least one defect is gone
21:13:29*krux02 quit (Remote host closed the connection)
21:15:00*nsf quit (Quit: WeeChat 2.2)
21:22:41*flaviu quit (Remote host closed the connection)
21:27:33*PrimHelios_ quit (Ping timeout: 245 seconds)
21:28:44FromDiscord<treeform> I don't know what to do, -d:ssl = works, -d:ssL + jwt = works, -d:ssl + jwt + db_postgres = NPE SEGFAULT
21:28:50FromDiscord<treeform> why is SSL such a pain
21:29:19FromDiscord<treeform> oh and -d:ssl + db_postgres = also works
21:29:23*flaviu joined #nim
21:29:35FromDiscord<treeform> its only only when 3 things combine it SEGFAULTS
21:30:09FromDiscord<treeform> https://gist.github.com/treeform/1277270c3ece8051d5a5178923756237
21:32:07*PrimHelios joined #nim
21:34:20*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
21:40:20dom96jwt? Is that Java?
21:41:02shashlickdom96: choosenim crash is SSL related
21:41:15shashlicknot sure what to do though - this is ubuntu
21:41:32shashlick`error:140E0197:SSL routines:SSL_shutdown:shutdown while in init`
21:42:48*PrimHelios quit (Remote host closed the connection)
21:42:55FromDiscord<treeform> dom96, json web tokens: https://github.com/treeform/jwt
21:43:04*PrimHelios joined #nim
21:43:19FromDiscord<treeform> main point that it includes libcrypto again: https://github.com/treeform/jwt/blob/master/src/private/crypto.nim
21:43:44PMunchHmm, something has broken the deque module in 0.19.0
21:44:06FromDiscord<treeform> -d:ssl includes libcrypto, db_postgres includes libcrypto, then my jwt includes libcrypto
21:44:10dom96treeform: best thing to do is to reduce it to as small an example as possible, unfortunately
21:44:21*smt quit (Read error: Connection reset by peer)
21:44:23FromDiscord<treeform> they work separately, or if I have 2 of them
21:44:24FromDiscord<treeform> but not 3
21:44:33FromDiscord<treeform> 3 libcrypto includes is too much
21:45:04FromDiscord<treeform> dom96, you right if you are willing to take a look I will make the smallest thing possible
21:45:54dom96creating the smallest thing possible will make it easy for you to figure out what's going on
21:46:07dom96I'll take a look too if you ping me about it
21:46:29*abm quit (Quit: Leaving)
21:48:34*smt joined #nim
21:48:49*endragor joined #nim
21:49:08PMunchAh, it appears it's only when called from within a macro
21:52:38*shadowbane quit (Quit: Konversation terminated!)
21:53:16*endragor quit (Ping timeout: 246 seconds)
21:56:01shashlickdom96: https://github.com/nim-lang/Nim/issues/4617
21:57:12dom96oh, you're using a proxy?
21:57:35shashlickYa
21:57:47dom96well there you go
21:57:49shashlickBut nimble works fine thru it
21:57:58*zachk quit (Changing host)
21:57:58*zachk joined #nim
21:58:12shashlickWhy doesn't choosenim
21:58:39PMunchhttps://github.com/nim-lang/Nim/issues/9418 <- deque issue
22:02:08*PrimHelios quit (Ping timeout: 245 seconds)
22:02:25*PMunch quit (Remote host closed the connection)
22:05:50FromDiscord<treeform> hey @dom96 got it to a really small example, all stdlib, no my code at all: https://github.com/nim-lang/Nim/issues/9419
22:06:23*abm joined #nim
22:08:55dom96fun
22:09:17dom96Either a stack corruption
22:09:22dom96or some weird C code is generated
22:11:54dom96ugh, where the hell is nimcache
22:12:07FromGitter<kaushalmodi> ?
22:12:18FromGitter<kayabaNerve> .cache ?
22:13:04dom96bah
22:13:07dom96Why not /tmp?
22:13:30FromGitter<kayabaNerve> I also dislike the change and just manually specify the nimcache.
22:13:52*Jesin joined #nim
22:13:54FromGitter<kaushalmodi> dom96: `set XDG_CACHE_HOME /tmp/$USER/.cache` that's what I do
22:14:13FromGitter<kaushalmodi> I mixed up tchs/bash syntax.. but you got the idea
22:14:22dom96Awesome
22:14:26dom96So we all set it to something else
22:14:33dom96Sign of a great feature
22:14:36*PrimHelios joined #nim
22:14:45FromGitter<kaushalmodi> no, it uses XDG_CACHE_HOME if set
22:14:51FromGitter<kaushalmodi> I am using *that* feature
22:15:00FromGitter<kaushalmodi> I had that env var already set
22:15:31FromGitter<kaushalmodi> I like the chrome, mozilla, etc caches to live in /tmp
22:16:04*Jesin quit (Remote host closed the connection)
22:23:46*Jesin joined #nim
22:23:52anamokI think I found a "nim doc" bug. See this file: https://pastebin.com/X5xgtrLY . nim doc drops an error on this. If you remove the doc comments though, no problem. Can someone confirm it?
22:30:16FromGitter<kaushalmodi> Unrelated, but just now when I rebuilt nim from master, I saw "koch docs" fail
22:30:44FromGitter<kaushalmodi> After compiling the times module docs, I get; ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b814ae7be9401673db27]
22:31:34FromGitter<kaushalmodi> ok the root cause of the failure is: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b8461e23486b93d7335e]
22:31:54FromGitter<kaushalmodi> Wondering why Travis is green.. Araq? ^
22:36:58FromGitter<kaushalmodi> here
22:37:19FromGitter<kaushalmodi> here's a quicker recipe: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b99fef4afc4f288e025f]
22:43:25FromGitter<kaushalmodi> anamok: about the "nim doc" bug you referred, I cannot reproduce any error
22:43:40FromGitter<kaushalmodi> `nim doc yourfile.nim` builds fine, no errors: https://ptpb.pw/qbaS
22:44:11FromGitter<kaushalmodi> I am using the latest build of nim from devel
22:47:30*elrood_ quit (Quit: Leaving)
22:49:15anamokkaushalmodi: I'll try with the devel version too
22:50:00FromGitter<kaushalmodi> Araq: btw that above framePtr error started happening because I now have a config.nims in ~/.config/nim/. Odd.
22:50:26FromGitter<iffy> @alehander42 It now supports subcommands (through some black magic) but I have to figure out why the run proc is getting executing twice for a command: https://github.com/iffy/nim-argparse/blob/subcommands/tests/test1.nim#L148-L161
22:52:18FromGitter<iffy> oh nm, I know why it's getting called twice :)
22:54:27anamokkaushalmodi: thanks for trying it out. No problem with the devel build.
22:55:26*abm quit (Quit: Leaving)
22:56:16FromGitter<kaushalmodi> 👍
22:59:15*arecaceae quit (Remote host closed the connection)
22:59:34*arecaceae joined #nim
22:59:42*PrimHelios quit (Ping timeout: 252 seconds)
23:02:19FromGitter<iffy> I've satisfied my goal to learn about macros/templates... is this project worth continuing for the benefit of people who actually want to use it? https://github.com/iffy/nim-argparse
23:02:26FromGitter<iffy> I'm heading off now, but will read comments later
23:10:57FromGitter<zacharycarter> I'm finally getting a handle on tmux / kakoune
23:11:12FromGitter<zacharycarter> I haven't written / edited any Nim code with it - but I'm starting to see the attraction
23:11:36FromGitter<zacharycarter> I'm not very used to modal text editors - I can deal with having to open / use vim, but I've become way too reliant on IDEs
23:11:39FromGitter<zacharycarter> and VSCode
23:12:36FromGitter<zacharycarter> anyway - just thought I'd share my thoughts on the editor so far - as soon as I start writing some Nim code with it (starting on Sunday) - I'll report back. I may try to do a twitch stream on Sunday too - I have to see how exhausted I am after Saturday and the work I have left to do on my house is done
23:14:46FromGitter<zacharycarter> also - if anyone has any up-to-date info @PMunch *wink* about the language server for Nim - I'd love to hear about it / potentially contribute
23:15:36FromGitter<zacharycarter> I think LSP is kind of overbearing / not needed - but I guess it's really the best path atm to getting robust Nim support into other editors that implement it
23:15:38FromGitter<zacharycarter> kak being one
23:19:04*NimBot joined #nim
23:21:44*kapil____ quit (Quit: Connection closed for inactivity)
23:22:22*Jesin quit (Quit: Leaving)
23:29:51*darithorn quit (Ping timeout: 252 seconds)
23:33:19*darithorn joined #nim
23:36:29*benjikun quit (Quit: Lost terminal)
23:41:12*smt quit (Read error: Connection reset by peer)
23:41:57*smt joined #nim
23:42:29*smt quit (Max SendQ exceeded)
23:42:57*smt joined #nim
23:43:35*smt quit (Max SendQ exceeded)
23:44:03*smt joined #nim
23:47:06anamokbye
23:47:09*anamok quit (Remote host closed the connection)