00:13:01*dddddd quit (Ping timeout: 255 seconds)
00:13:32*dddddd joined #nim
00:18:09FromDiscord<Cark> Hello I'm trying to have nimsuggest-mode working in emacs on windows. But it hangs a little bit then says :
00:18:09FromDiscord<Cark> `Company: backend company-nimsuggest async timeout with args`
00:18:09FromDiscord<Cark> Did anyone have success with it ?
00:18:10FromDiscord<Cark> my init.el looks like this :
00:18:10FromDiscord<Cark> ```
00:18:12FromDiscord<Cark> (use-package nim-mode
00:18:13FromDiscord<Cark> :ensure t
00:18:14FromDiscord<Cark> :config
00:18:16FromDiscord<Cark> (add-hook 'nim-mode-hook 'nimsuggest-mode)
00:18:18FromDiscord<Cark> (add-hook 'nimsuggest-mode-hook 'company-mode)
00:18:19FromDiscord<Cark> )
00:18:20FromDiscord<Cark> ```
00:25:35shashlicki don't think people have had much luck with nimsuggest in emacs
00:26:40FromDiscord<Cark> @slashlick what's the editor i should be using on windows ?
00:39:23shashlickvscode is what most people use
00:39:41shashlickthere's a very good neovim plugin so that's also an option
00:40:31FromDiscord<Avatarfighter> When should I define something as a const vs. as a let? Also if you don't want to install VSCode https://repl.it/ has nim support
00:40:46FromDiscord<Cark> @slashlick thanks
00:41:16shashlickconst is known at compile time
00:41:29shashlickor can be calculated at compile time using static
00:41:39shashlicklet is when you have a variable that you don't want changing on you
00:41:57shashlickdepends on what you want to do
00:42:33FromDiscord<Avatarfighter> Ok I'll probably put my thing as a const, its just a number that is constant and never changes throughout the program
00:42:55FromDiscord<Avatarfighter> So const should be good
00:43:23FromDiscord<Avatarfighter> Thank you shashlick 😃
00:45:07*rockcavera quit (Remote host closed the connection)
00:45:53FromGitter<zetashift> fwiw using spacemacs and it's working okay-ish
00:46:47*laaron quit (Remote host closed the connection)
00:47:41*laaron joined #nim
00:48:17FromDiscord<Avatarfighter> Hmm so repl.it's autocomplete seems broken rn, but I can confirm that it was working correctly like a week ago
00:58:00FromGitter<kaushalmodi> Cark: Emacs user here. I tried nimsuggest earlier but stopped using it as it had issues.
00:58:35FromGitter<kaushalmodi> Now I use just nim-mode with hippie-expand and it works great.
00:59:12FromGitter<kaushalmodi> Need to try out nimsuggest again and nim_lsp with the 2 Emacs lsp client packages when I get a chance.
01:05:52FromDiscord<Cark> @kaushalmodi i'll check that out thanks
01:08:25*rockcavera joined #nim
01:12:58*stefanos82 quit (Remote host closed the connection)
01:39:37*dddddd quit (Remote host closed the connection)
01:59:14*NimBot joined #nim
02:01:11*banc quit (Quit: Bye)
02:15:48*laaron quit (Remote host closed the connection)
02:19:07*laaron joined #nim
02:20:18*banc joined #nim
02:20:46*cyberjpn quit (Ping timeout: 246 seconds)
02:24:19*theelous3 quit (Read error: Connection reset by peer)
02:29:02*leorize joined #nim
02:37:58*cyberjpn joined #nim
02:46:18*rnrwashere joined #nim
02:50:28*cyberjpn quit (Ping timeout: 245 seconds)
02:59:47*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:00:08*rnrwashere quit (Remote host closed the connection)
03:01:49*rnrwashere joined #nim
03:40:06*MightyJoe joined #nim
03:41:22*cyraxjoe quit (Ping timeout: 276 seconds)
03:42:10*mal`` quit (Quit: Leaving)
03:47:02*mal`` joined #nim
04:23:51*nsf joined #nim
04:28:14*cyberjpn joined #nim
04:58:35*mal`` quit (Quit: Leaving)
04:58:40*narimiran joined #nim
05:07:16*laaron quit (Remote host closed the connection)
05:08:40*mal`` joined #nim
05:15:59*Tanger joined #nim
05:38:46*rnrwashere quit (Remote host closed the connection)
05:58:10*Vladar joined #nim
06:05:31*hoijui joined #nim
06:12:54*krux02 joined #nim
06:16:40*cyberjpn quit (Ping timeout: 246 seconds)
06:19:42*solitudesf joined #nim
06:21:03*cyberjpn joined #nim
06:29:26*PMunch joined #nim
06:32:25*cyberjpn quit (Ping timeout: 246 seconds)
06:35:26*cyberjpn joined #nim
06:47:19*golechwi quit (Ping timeout: 264 seconds)
06:48:19FromGitter<gogolxdong> How to get the pointer address of a string variable data?
06:50:48PMunchThat's the address for the first character in the string
06:53:51FromGitter<gogolxdong> cool
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:35*gmpreussner joined #nim
07:10:35*golechwi joined #nim
07:13:54FromDiscord<kiwi> I'm not certain this is the right place to ask: what is the recommended package for doing gui's like this? I was looking at wxnim but there isn't a lot of recent work. https://i.imgur.com/cn61jpD.png
07:15:41AraqPMunch is here and might help you with wxnim
07:16:15Araqand it's still a good solution. my libui wrapper is much more limited
07:16:42PMunchkiwi, there isn't a lot of recent work because it's been working well for a while :)
07:19:03FromDiscord<kiwi> Hi, I'm using linux. I've got wxGtk & 3 + dev installed. I've cloned your directory ... but ... when it says "Install wxnim" I am scratching my head.
07:19:37FromDiscord<kiwi> (funny right :))
07:22:58*solitudesf quit (Ping timeout: 252 seconds)
07:29:15FromDiscord<kiwi> So my issue is I usually use Python or C/C++ so I'm used to compile make etc ... but I suspect you mean something more straight forward than that.
07:36:18*cyberjpn quit (Ping timeout: 258 seconds)
07:41:12PMunchnimble install wxnim
07:41:43PMunchShould be all you need :)
07:42:35FromDiscord<kiwi> https://i.imgur.com/7L7zjFP.png ... I feel better in that I tried that first ... here's what I got, am I doing something wrong?
07:42:40PMunchOh sorry: nimble install https://github.com/PMunch/wxnim
07:43:49FromDiscord<kiwi> ahhh .. thanks, excellent.
07:51:26PMunchNot sure why I haven't added it to the repositories yet..
07:52:09livcdkiwi: you can also try sciter
07:52:44*cyberjpn joined #nim
07:55:05PMunchHTML as a desktop application? Have you joined the dark side livcd?
08:03:13*floppydh joined #nim
08:06:37FromGitter<alehander42> @dom96 and what do you think of migration/scaffold tools: many frameworks come with those, many don't, i am not sure if they are a good defaul
08:08:23*cyberjpn quit (Ping timeout: 245 seconds)
08:09:21*hoijui quit (Remote host closed the connection)
08:15:21*rnrwashere joined #nim
08:19:39*rnrwashere quit (Ping timeout: 248 seconds)
08:28:29*Vladar quit (Remote host closed the connection)
08:28:54*Vladar joined #nim
08:40:38livcdPMunch: it should be relatively performant
08:46:03PMunchI'm skeptical
08:46:16PMunchDamn, seems like nimlsp is crashing..
08:47:21PMunchA SIGSEGV from deep within the compiler code by the looks of it
09:10:21PMunchHmm, have there been some re-ordering of the devel branch commits?
09:10:37PMunchI tried to compile a version that used my latest commit on devel, but even that didn't work
09:11:04narimiranPMunch: no reordering as far as i know
09:12:18PMunchMight be because I'm building from current devel?
09:13:24livcdPMunch: why skeptical ?
09:18:31PMunchJust generally skeptical of building desktop applications from something that was made for a completely different purpose over 20 years ago and has been added on to over and over
09:19:08PMunchOoof, just realised that I'm actually older than HTML..
09:19:58livcdPMunch: i think that guy was building desktop GUIs since forever
09:21:18livcdPMunch: https://terrainformatica.com/2018/12/23/sciternode-versus-electron/
09:21:23livcdsciter's author
09:24:19PMunchHmm, so sciter is just a lighter alternative to the Chromium thing that Electron uses?
09:25:56PMunchOkay, looking at Sciter it actually doesn't look all that bad
09:26:34PMunchI still don't really like using HTML/CSS though..
09:27:09livcdThe guy has many customers from China and India where resource consumption is a concern
09:27:32livcdfrom what I understand it's a custom DOM implementation?
09:29:02FromGitter<mratsim> @miran, You will have to translate Nim documentation in Thai soon :p : https://www.youtube.com/channel/UCTyvSBAvdBPDS-7isD5GDdw/videos
09:29:40FromGitter<mratsim> @PMunch, look at webview as well: https://github.com/zserge/webview
09:30:43narimiranjust by scrolling i found "part 61"! (maybe there's even more) i'm very impressed!
09:31:03PMunchThat's a lot of videos!
09:31:17livcdi also checked it a bit lol
09:32:36Zevvquestion to the general audience: should the Nim stdlib expose common hash algorithms like SHA-1 and SHA-256, or is this something an external nimble package should do? There are some half-hearted and badly exposed hashes in the stdlib, but there is no proper common API for those
09:33:00ZevvI always start feeling insecure when picking nimble packages - is this one maintained? is it stable? are there better ones?
09:33:22narimiranZevv: https://nim-lang.github.io/Nim/sha1.html
09:33:35livcdPMunch: surprisingly there are even bindings for Nim
09:33:45PMunchlivcd, for sciter or webview?
09:33:49Zevv"half-hearted api"
09:33:50livcdPMunch: sciter
09:34:01Zevvyou can't update/finalize, and the output is only available HEX encoded.
09:34:15PMunchlivcd: Well it has a C API, so that makes sense
09:34:33Zevv95% of the times I find myself doing parseHexStr on that. And the thing is called 'secureHash'. Will someone not think one day that it would be good to change the implenentation to SHA-512 because that is 'more secure'?
09:34:43PMunchlivcd, still not 100% sure exactly what sciter is :P
09:35:22livcdPMunch: did you check the architecture link ? :D
09:35:42Zevvnarimiran: If I would properly expose the SHA-1 lower level functions and add a Nim native-sha256, would that be likely to be pulled into stdlib?
09:36:09narimiranZevv: hmmm, did i see an issue mentioning exactly that (parseHex) this morning? i think i did, but i cannot find it right now
09:36:28PMunchlivcd, yes
09:36:38PMunchlivcd, I think that only confused me more :P
09:36:39Zevvyeah, but also the lack of update/finalize. If I need to hash a gig, I don't want to have the gig in a buffer in one go.
09:37:02Zevvand often the data to be hashed is scattered anyway
09:37:23FromGitter<mratsim> Just use nimcrypto for your crypto needs, AFAIK SHA1/MD5 are only used for quick low-collision hashing of files by the compiler
09:38:47ZevvWell, nimcrypto, there you have it. I didn't find this, I searched for "sha1" "sha-1" "sha256" and "sha-256", and it has none of these keywords in the nimble description
09:39:04FromGitter<mratsim> we're working on a revamped documentation but the main usage at a low level is this: https://github.com/status-im/nim-beacon-chain/blob/master/beacon_chain/spec/digest.nim#L40-L47
09:39:26FromGitter<mratsim> sha256 is there
09:40:00ZevvI *did* find the nimsha2, nim-libsha, nimssl, nimmonocypher, sha1ex, sha3, nimSHA2, shimsham, hmac and sha1 packages, though
09:40:03FromGitter<mratsim> sha1 as well
09:40:27Zevvwhich instantly paralyzes me. I simply can not choose between 23 kinds of shampoo, I'd rather go unwashed
09:40:43FromGitter<mratsim> Supported ciphers are there: https://github.com/cheatfate/nimcrypto/tree/master/nimcrypto, be aware that Rijndael == AES
09:41:04Zevvmratsim: anyway, I'll stop complaining. nimcrypto seems like a good choice, thanks.
09:42:37FromGitter<mratsim> Here you go: https://github.com/cheatfate/nimcrypto/issues/25
09:42:50poopBotcan i wrap C++ lib too?
09:42:54AraqZevv, securehash is deprecated
09:43:06Araq## This module is a deprecated alias for the ``sha1`` module.
09:43:06Araqinclude "../std/sha1"
09:43:07FromGitter<mratsim> @poopBot, yes
09:43:20PMunchpoopBot, are you asking if Nim can wrap C++ libraries? If so then yes
09:43:44livcdPMunch: i was re-checking something huh and found out you commented on this topic 2 years ago :P
09:43:50poopBotyep i read zilion times that it can wrap C easy, just wanted to be sure it can wrap C++ too :)
09:43:57livcdPMunch: https://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/
09:43:57PMunchlivcd, on Sciter?
09:44:19PMunchOh yeah :)
09:44:20livcdPMunch: on GUIs but the Sciter author also commented there
09:44:39PMunchThat's when I started writing genui for wxWidgets
09:44:55dom96poopBot: not only can it wrap C++, it can also do easily
09:46:23narimirandom96: can you drop by in our telegram group? we have constant spamming, and i delete it as fast as i can (sometimes i sleep :)). there's a bot that can help with that, but i can't give it admin rights to delete and ban posts
09:47:48FromGitter<mratsim> @poopbot there is an example of C++ SFML wrapping at the bottom of https://nim-lang.org/features.html
09:49:12poopBotty, duno why i thinked it was only for C xD
09:49:14livcdPMunch: have you seen this ? https://philippegroarke.com/posts/2018/c++_ui_solutions/
09:50:36FromGitter<mratsim> @poopBot, not many languages can wrap C++, I think only Nim and D are able to
09:51:34*sz0_ joined #nim
09:54:53PMunchlivcd, no haven't seen that one
09:54:59*dddddd joined #nim
09:55:01PMunchI'll give it a read after lunch :)
09:55:48PMunchI was thinking about writing down some of my ideas for my gui library, to get some feedback and structure my thoughts a bit more.
09:59:50*solitudesf joined #nim
10:04:39*dddddd quit (Ping timeout: 258 seconds)
10:09:35*dddddd joined #nim
10:20:26leorizethe new indent improvements for nim.nvim has been merged :)
10:20:50leorizeif you're using the indentexp branch, please switch back to master then update
10:21:04leorizenarimiran, Zevv ^
10:21:07narimiranleorize: nice!
10:21:46leorizemaybe I should remake the demo with "superior" indenting experience :p
10:22:02narimiranbtw, populating quickfix list when i do :make, is that also something because of your plugin or is it independent?
10:22:35leorizethat's my work
10:22:46Araqhttps://www.wired.com/story/whatsapp-hack-phone-call-voip-buffer-overflow/amp yay, buffer overflows, in 2019
10:22:50leorizeI added it weeks ago iirc
10:23:25narimiranleorize: nice work there too! :)
10:24:09narimirancurrently i can jump only on errors; can it be done for warnings too? (warnings are displayed, but i can't do `]q` to jump to the next one)
10:25:39leorizeno idea :P quickfix is a feature I don't pay attention to until now
10:26:39narimiranleorize: i think it is just about defining (another) errorformat, but i might be wrong
10:27:05narimiranhmmm, but you already have that :/ https://github.com/alaviss/nim.nvim/blob/master/compiler/nim.vim
10:28:05narimiranbtw, i've added `--hints:off` to my `makeprg`, it keeps the visual noise down
10:28:31leorizeyea, I'll have to make customizing makeprg easier
10:29:03leorizehaven't seen any compiler script out there that does so though
10:29:35poopBotso long game will new runtime be standard one, no more GC forewer or what?
10:29:55leorizenarimiran: tip: you can :make --hints:off --whatever-switch-you-like
10:30:52leorizepoopBot: that's the idea, unless newruntime doesn't live up to its promises
10:31:16narimiranheh, i've just done `nmap <leader>nm :setlocal makeprg=nim\ c\ --listFullPaths\ --hints:off\ -r\ %<CR>` in my init.vim, so n(im)m(ake) creates what i want
10:31:31FromGitter<jrfondren> eh? I thought the idea was just that the newruntime would replace gc:none
10:31:49leorizein the long run it'd replace the GC
10:32:09leorizeAraq dislikes GC nowadays
10:32:17FromGitter<jrfondren> how would it ever do that, since it's always going to be more work for the programmer than a GC?
10:32:29Zevv"nowadays" :) like, he changes his mind every few months
10:32:53Zevvjrfondren: c++-smart-pointer-like / rustlike
10:32:56leorizeadding "owned" is pretty light work imo
10:33:09leorizeI ported a benchmark by just adding owned everywhere :P
10:33:24leorizethe current performance is slower than the GC though
10:33:39FromGitter<jrfondren> yeah, I added dozens of "owned" to a program and its libraries just to get to some weird problem in CountTable, where I gave up.
10:34:19Zevvleorize: since you seem to be up-to-date on this topic: what is the proper way to port a common case where a single object is referenced by multiple 'equal' objects. As long at least one referencees, it should be kept alive. No one 'ownes' in this case.
10:34:42AraqZevv, you introduce an artificial owner then
10:35:06Araqpossibly handled by a separate data structure that has these owned things
10:36:35Araqand yes, --newruntime replaces gc:none but in the longer run is expected to replace the GCs
10:37:01leorizenarimiran: you can override makeprg in an after/ftplugin/nim.vim file I believe
10:37:32poopBotso jester and all web stuff would probbaly need a rewrite?
10:37:49leorizejust adding "owned" for the most part I think
10:39:23Araqwe'll see. there are also other solutions, relax, I am not insane
10:42:32PMunchHmm, can't Karax access the query string?
10:42:38PMunchOnly the hash part
10:42:45leorizeuse JS API for that
10:43:24FromGitter<jrfondren> the hash part isn't sent to the server
10:43:34PMunchHmm, I guess that'd work
10:44:02PMunchWhat I really should do is probably rework the url system, similar to what dom96 suggested earlier
10:44:34PMunchplay.nim-lang.org/ix/id play.nim-lang.org/tour/<escaped url> etc
10:44:58PMunchBut that isn't possible with Karax either is it?
10:44:59leorizePMunch: here's a one-line function:
10:45:07leorize proc getParam*(param: kstring): kstring = {.emit: "`result` = (new URL(document.location)).searchParams.get(`param`)".}
10:47:28leorizebut yea, you can rework the uri into /ix/id then use jester/patterns to parse it in your router function
10:52:44PMunchYeah.. That would be an annoying amount of work..
10:57:11FromGitter<alehander42> PMunch: routing should be relatively easy
10:57:14FromGitter<alehander42> in jester
10:58:08FromGitter<alehander42> if you're just using params currently, it should be still possible to reuse your current code but invoke it from simple `routes:` action
11:00:43PMunchWell the way it's handled now is that everything is index.html
11:01:02PMunchand through ?ix=id or ?tour=url you can load in content
11:01:16leorizetour should be it's own page
11:01:21PMunchBut the way that works is that the web-page actually does an ajax call in the background
11:01:23leorizebut ?ix can stay I think
11:01:58FromGitter<alehander42> hmm but what is the problem with rewriting the current scheme to karax
11:02:01PMunchleorize, why should tour be it's own page?
11:02:29PMunchSomething like that?
11:02:39FromGitter<jrfondren> it shouldn't be of the routing anyway. You could separate parameters and routing by putting routing after #, yeah like that
11:02:46leorizebecause tour has much more functions?
11:03:25PMunchleorize, not really. It's like 1/2 extra function :P
11:04:08leorizewell, we all know that pages are just an imaginary construct when writing SPAs :p
11:04:36FromGitter<alehander42> hm actually i wasnt sure
11:04:37FromGitter<alehander42> but window.location.search
11:04:41FromGitter<alehander42> has the query args
11:04:47FromGitter<alehander42> so you can access them in JavaScript
11:04:50leorizeyea, see the function I pasted above
11:05:18FromGitter<alehander42> ok yea exactly
11:13:12PMunchHmm, now it's in a loop..
11:13:46PMunchI put my loading in createDom, but whenever it updates the fields it runs it again..
11:14:02*solitudesf quit (Ping timeout: 258 seconds)
11:14:17leorizevdom is stateless, so you'd need to keep the state somewhere
11:22:28*_kiwi_ joined #nim
11:23:00PMunchIs there a built in way to set the route? Or do I need to use JS for that as well?
11:31:43*Mister_Magister quit (Quit: bye)
11:33:35*_kiwi_ quit (Ping timeout: 256 seconds)
11:37:26PMunchHmm, where is dom from?
11:37:49leorizethe dom module? :p
11:37:55leorizeuse kdom instead
11:38:08leorizekarax's dom has only been imported to stdlib recently iirc
11:38:09*Mister_Magister joined #nim
11:39:52*leorize quit (Quit: WeeChat 2.3)
11:42:25*kiwitrader joined #nim
11:43:38PMunchHmm, can't seem to find it in kdom
11:46:57*leorize joined #nim
11:47:44leorizeI guess it's in dom then
11:50:59PMunchHmm, it takes a lot of arguments though..
11:54:13leorizeyou can pass a JsObject() as the state object
11:54:30leorizetitle can be empty as it's not used by any browser atm
11:54:47leorizehistory is window.history iirc
12:06:58shashlickWonder why there isn't a pure C lsp client
12:11:16*clyybber joined #nim
12:12:56PMunchleorize, I just imported window.location.hash = #
12:13:57leorize[m]hmm, karax have routerdata for retrieving the hash per render calls
12:14:52PMunchYeah I know, that's what I use to get it
12:14:54leorize[m]so it should have an api to set it
12:15:18PMunchNormally that's done with buttons or links though
12:15:40PMunchBut I wanted to upload the URI so that you could copy the page more easily
12:15:48*rockcavera quit (Remote host closed the connection)
12:15:52PMunchHmm, can I parse a string into a vdom?
12:17:05PMunchThe tour function currently works by loading some HTML into the page, then traversing through it and hiding the sections that shouldn't be shown at the current time
12:17:23PMunchBut since Karax redoes the dom all the time this won't work
12:17:39PMunchI'd need to insert the correct section instead
12:18:09PMunchSo I want to parse my HTML string I got from the server into a vdom node, and then insert the correct vdom node into the actual dom
12:18:09leorize[m]use verbatim()
12:18:28PMunchWell verbatim can only be used for full blocks..
12:18:41*Snircle joined #nim
12:18:55leorize[m]what do you mean?
12:20:33leorize[m]oh, I see
12:21:09leorize[m]just use htmlparser to parse the html and pick out what you need
12:21:32FromGitter<alehander42> i still dont get the full blocks thing
12:21:33leorize[m]then convert it into string and feed it to verbatim :p
12:22:02PMunchleorize[m], I just used buildHtml and verbatim to create a vnode for me :)
12:22:12FromGitter<alehander42> exactly
12:22:55leorize[m]well, yea :p I don't get what you're trying to do though
12:24:37dom96PMunch: Why don't you pass the data and create the HTML in karax?
12:24:56dom96btw the forum has a nice routing mechanism that you can reuse
12:25:02dom96(it reuses Jester's pattern matching)
12:25:48PMunchdom96, what do you mean?
12:26:03dom96Pass JSON to the client and render it
12:26:50PMunchWell I want to keep the tours in HTML format
12:26:53PMunchMakes them easier to write
12:27:06*rockcavera joined #nim
12:31:37*nsf quit (Quit: WeeChat 2.4)
12:32:32dom96You'll have a pain of a time going between Karax and raw html
12:32:41dom96especially if you want interactivity, which I bet you will want
12:32:56*kiwitrader quit (Quit: Bye)
12:34:07PMunchTurns out the vdom that was creates when I did buildHtml and verbatim was a single node of kind "#text"..
12:35:04PMunchSo currently a tour looks like this: https://github.com/PMunch/nimtours/blob/master/example.html
12:35:45PMunchIn the current version that simply get's added to the DOM (after having been sanitized) and every top-level element that is not a <section> tag gets removed
12:36:32PMunchThen it holds state about which section you're currently at, and applies a display: none style to all the section elements except the one coresponding to the current section
12:37:04PMunchThen it reads the first <h1> element and the last <code> element and puts those as respectively the title and the editor contents
12:38:52PMunchI guess I could do it the same way if I marked in as a foreign node and put the logic in post-render..
12:45:08dom96Suggestion: use markdown instead :)
13:17:20*hoijui joined #nim
13:17:21PMunchWell then I'd have to parse markdown instead..
13:17:40PMunchAnyways, I've got feature parity between my karax version and the live version now :)
13:18:49leorize[m]too bad docutils doesn't work on js backend :p
13:27:13*laaron joined #nim
13:37:06FromGitter<kaushalmodi> PMunch: there's a Nim Markdown parser
13:37:39FromGitter<kaushalmodi> https://github.com/soasme/nim-markdown
13:42:46PMunchEh, I won't bother with it now. But all the code is open source. So if anyone else wants to try to do it be my guest :)
13:43:48PMunchHmm, I'm off in 15 minutes and probably won't be back until tomorrow. Should I update the playgroun now, yay or nay?
13:46:02*Vladar quit (Remote host closed the connection)
13:52:56PMunchI created a frontend.nimble file
13:53:03PMunchBut wanted to delete it
13:53:17PMunchrm front<tab><enter>
13:53:23PMunchManaged to delete frontend.nim
13:53:28PMunchWhich was the entire project
13:53:40PMunchAnd I'm not sure if I have any way of getting it back..
13:54:50FromGitter<alehander42> can you immediately mount your fs to readonly
13:55:35livcddont you have it open in some editor ?
13:55:44livcdor maybe you did cat somewhere in your terminal
13:55:56PMunchlivcd, no, I was just wrapping up for today and had closed vim
13:56:12livcdwhat about clipboard?
13:56:19clyybberPMunch: Do mount -o remount,ro /dev/[partition]
13:56:23clyybberas alehander said
13:57:14PMunchlivcd, no clipboard
13:57:16FromGitter<kaushalmodi> PMunch: that sucks; may be for next time you look into auto-saving features of your editor
13:57:21PMunchBut I had cat-ed it to my terminal
13:57:44PMunchNot sure why I did that, but I did it right before I started messing around with the files
13:57:44FromGitter<kaushalmodi> PMunch: who cats their code?! :P
13:57:59livcdkaushalmodi: you dont?!
13:58:10FromGitter<kaushalmodi> livcd: emacsclient FTW
13:58:25FromGitter<kaushalmodi> and auto-saving feature of emacs FTW
13:58:27PMunchkaushalmodi, I do it all the time, I've got a shortcut on my keyboard that pastes to ix directly from my selection
13:58:31narimirankaushalmodi: how would autosaving help if he did `rm`?
13:58:39livcdkaushalmodi: i use emacs less and less. It takes me so much time to configure things...
13:58:46PMunchTo avoid it showing vim stuff I cat the file, make a selection, and hit my shortcut
13:58:46FromGitter<kaushalmodi> narimiran: emacs saves backup copies in a separate backup dir
13:59:01FromGitter<kaushalmodi> emacs ix'es the current buffer
13:59:31FromGitter<alehander42> ironically having an untitled file in sublime is also a very good way to have it backedup
13:59:35FromGitter<kaushalmodi> livcd: the autobackup is enabled out of the box
13:59:37FromGitter<alehander42> but i wouldn't bet on that
13:59:42FromGitter<alehander42> as sometimes it seems to disappear
13:59:46FromGitter<alehander42> not sure why
14:00:09livcdkaushalmodi: that wont help me if half of my workflow is in VSCode
14:00:17*thomasross quit (Ping timeout: 246 seconds)
14:00:20FromGitter<kaushalmodi> livcd: of course :P
14:00:24PMunchI normally have everything checked in to git
14:00:26FromGitter<kaushalmodi> but just fyi: https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup.html
14:00:34PMunchBut for some reason this wasn't a git project yet..
14:00:49PMunchI even keep stuff in git without putting it online
14:01:01PMunchNice to be able to jump between branches to test stuff out
14:01:24narimiranPMunch: yeah, git should be used regardless if you want to put it online/public
14:01:55PMunchI have three levels, local only, private server, github
14:02:35narimiranbut even with git you can royally fuck up. ask me, i know :) (hint: `git clean` in ~ :D)
14:02:48PMunchI will typically start local only, then if I need to switch to another machine or want a backup I push it to my own server, and when the project is more suited for public consumption I push to github
14:02:58PMunchHaha, ouch
14:03:10PMunchBit harder to do though
14:03:21PMunchI run "git clean" much more seldom than "rm"
14:03:48Zevvleorize[m]: something wrong with the privmsgs somewhere I guess
14:03:50narimirannot hard at all when you have one "undo" icon in vscode
14:03:51PMunchBut I'm off now, won't be putting the new playground online until tomorrow (with that close call I'd be afraid the server would catch fire)
14:04:29narimiranlater on they put "are you really sure?" warning there, after some guy on internet did the same thing as i did and started yelling :D
14:05:01PMunchnarimiran, well yeah, I could also alias rm to "rm -rf /*", lot's of stupid things you can do if you want to :P
14:05:02narimirani was too ashamed to post anything about that publicly, but that guy became "internet famous" because of it
14:05:12PMunchHaha :P
14:05:53narimiranbut hey, at least i didn't have to buy new hard drive. suddenly plenty of space, for free. yaaay
14:05:54PMunchHaha, that would be the most evil thing ever. Alias rm to delete the requested file and a random file on your drive :P
14:06:07PMunchGood to stay positive
14:06:11PMunchAnyways, I'm off
14:06:11*PMunch quit (Remote host closed the connection)
14:08:19livcdexport EDITOR=/bin/rm
14:19:09*laaron quit (Remote host closed the connection)
14:20:06*laaron joined #nim
14:29:18Mister_Magisterlivcd: love u
14:31:52livcdMister_Magister: did it help you ?
14:32:05Mister_Magisternothing can edit files better
14:32:08Mister_Magisternot even vim
14:37:12*theelous3 joined #nim
14:45:34poopBotthat neovim plugin its now working for me i added it to plug and did plug install
14:46:17livcdkaushalmodi: are you still around ?
14:47:56narimiranpoopBot: did you also add the plugin for code completition? works like a charm
14:48:41FromDiscord<Avatarfighter> Quick question, if I have a handful of types which are all reference objects of the main type, is it possible to make a proc that works with all types that are references to that main type?
14:49:16poopBotnarimiran, nah i am vim newb first time trying :)
14:49:20poopBotwhat plugins i need
14:49:58poopBoti took this one
14:50:10poopBotInstall prabirshrestha/asyncomplete.vim and configure it to your liking
14:50:16poopBotlol am blind sorry xD
14:51:57FromDiscord<Avatarfighter> fixed my issue, apparently having `ReadByte*(p: var Packet)` is bad bc you can't edit anything that is `ref object of Packet` so the fix was to do `ReadByte*(p: AlbionPacket)`
14:52:15narimiranpoopBot: i was too, not a long time ago, but leorize's plugin really works great so i dropped vscode and started using neovim as my main editor
14:52:45poopBoti want to drop vscode too :)
14:54:08narimiran"leorize, microsoft's greatest enemy", you can put that in your CV :)
14:54:09poopBothow do you totaly quit, i :q but that only closes my open file, i put that <<nerd tree on left and split bot to have terminal
14:54:29poopBotty :)
14:54:50FromGitter<mratsim> btw @narimiran: what do you think of opening a "Backport requests" pinned issue after every release for people to request fixes for 0.0.X backports
14:55:12narimiranother than being a pandora's box? :D
14:55:37FromGitter<mratsim> why? only devel commits would be backported
14:56:05narimiranbecause i expect it to be "i really like this new feature, can you backport it?"
14:56:19FromGitter<mratsim> feature are not backported
14:56:22FromGitter<mratsim> fixes are
14:56:28FromGitter<mratsim> bugfixes
14:56:39narimiranfixes, which are "safe", not all of them
14:56:39FromGitter<mratsim> just be clear on expectations
14:57:16FromGitter<mratsim> yes, but at least you'll see what people would like to see backported.
14:57:23FromGitter<mratsim> doesn't mean you can't filter.
14:57:33narimiranbtw, once 0.20 is out, we should be in "backport mode only", if you ask me
14:58:28FromGitter<mratsim> polish as well
14:58:45FromGitter<mratsim> but I think we will have a 0.19.8 before a 0.20.0
14:59:08FromGitter<mratsim> and a single pinned issue is better than opening 10 issues "miran please backport foo"
14:59:30FromGitter<mratsim> or you asking 2 days before on IRC "what would you like to see backported"
14:59:58narimiranok, what did we miss to backport in the last three releases? :)
15:00:44poopBotthis Add this to your configuration file to register the autocomplete source:
15:00:57poopBotdo i need to put it in init.vim ?
15:01:10FromGitter<mratsim> I don't know, it's just that from a community perspective, it conveys collaboration and also committing to stability
15:02:14narimiranpoopBot: that's quite offtopic ;) but yes, put it in your init.vim
15:02:38poopBotye sorry, hmm i dumped it there but still no autocomplete
15:03:09*sealmove joined #nim
15:03:12narimiranpoopBot: did you install that plugin? did you close and reopen neovim?
15:03:26poopBotyep i did plug install and close and reopen
15:03:29poopBotcan try agian
15:05:42dom96mratsim: 0.19.8 implies delaying 0.20.0 even more
15:05:46dom96It's got 1k+ commits
15:05:47dom96It's time
15:06:09FromGitter<mratsim> it doesn't imply delaying, why would it?
15:07:42FromGitter<mratsim> I don't mind delaying 0.20 if it's to allow us to test newruntime for real
15:07:52FromGitter<mratsim> otherwise we will get 0.21 as well
15:15:26FromGitter<kaushalmodi> livcd: you had pinged?
15:15:34Araq0.20 is about v1 RC1 though, not about --newruntime
15:15:51*stefanos82 joined #nim
15:15:54dom96This. --newruntime is an experiment
15:15:58FromGitter<kaushalmodi> "v1 RC1" that's big news! :D
15:16:27dom96It's not meant to be a big part of v1 AFAIK
15:16:51FromGitter<mratsim> So destructors are part of v1 but not owned ref?
15:17:16dom96I think it's time we define precisely what is considered "part of v1"
15:17:19FromGitter<mratsim> I thought owned ref where part of v1 but implemented with refcounting for v1
15:17:28dom96I think you might be surprised what will be considered "experimental"
15:17:43dom96and thus not subject to backwards compat guarantees
15:18:02AraqI did define that, it's the manual vs manual_experimental split
15:18:31narimiranlink for the lazy: http://nim-lang.github.io/Nim/manual_experimental.html
15:20:17clyybberAraq: Hi, regarding =sink -> =move, I'm trying to fix invalid C code generated when defining a custom =move operator. The generated C code tries to call eqmove with (&a, b) instead of (&a, &b)
15:20:34clyybberany idea where the problem could be?
15:22:25Araqsome missing genAddr call
15:22:27dom96Araq: awesome, that document needs to define what the implications of this are though
15:22:53clyybberAraq: Thanks :)
15:23:05FromGitter<mratsim> Seems like the often requested getattr from Python: http://nim-lang.github.io/Nim/manual_experimental.html#special-operators-operator-doteq
15:23:29*floppydh quit (Quit: WeeChat 2.4)
15:23:38FromGitter<mratsim> I want some VTable for concepts =)
15:23:47FromGitter<alehander42> `.=` already works in jsffi
15:23:48dom96When was this added? http://nim-lang.github.io/Nim/manual_experimental.html#package-level-objects
15:23:54FromGitter<alehander42> jsffi overally depends on a lot of experimental stuff
15:24:00clyybberAraq: Thanks, it was indeed a missing genAddr \o/
15:24:48narimiran@alehander42 now that you mention jsffi, you know what my next question will be? :D
15:25:42FromGitter<alehander42> oh well
15:25:48FromGitter<alehander42> my big mouth!
15:27:05Araqdom96, why?
15:27:28dom96Araq: Because I have no idea what its use case is
15:27:42dom96and in general it sounds like a feature we could remove
15:28:17AraqI need to make this document more clear, most stuff in there is not to be removed but to be refined
15:28:22Araqseriously refined...
15:33:59FromGitter<mratsim> The word you are looking for is "overhauled"
15:34:09Araqyes, thanks
15:39:23Araqdom96, "This feature allows to
15:39:23Araqbreak up recursive type dependencies accross module boundaries."
15:40:41*sealmove quit (Quit: WeeChat 2.4)
15:41:09poopBoti figure out why autocomplet dident work i head to switch back to devel
15:42:20Araqtell me please, why didn't it work?
15:45:18FromDiscord<treeform> Araq, dom96, I am trying to raise support for merging this in: https://github.com/nim-lang/Nim/pull/11233/files its a simple change. We need it.
15:47:39Araqin my mind I merged it already
15:48:36dom96I'm still skeptical about why you need the socket
15:49:29dom96Did the other websocket package just reimplement http client?
15:49:31FromDiscord<treeform> Because I upgrade the HTTP connection WebSocket and need to read write to it.
15:49:46FromDiscord<treeform> Yes I don't want to reimplement http clien.
15:49:53FromDiscord<treeform> that is the other option
15:50:28dom96Okay. That's fair. IMO that doc comment needs to be updated though
15:50:39FromDiscord<treeform> Its really easy to get with a TCP. I have that code too. But then http redirects, proxies, SSL...
15:51:26FromDiscord<treeform> I can take a stab at a better PR.
15:52:13FromDiscord<treeform> No they just don't support redirect, proxies and SSL.
15:52:26dom96also, this should possibly be abstracted via the streams mechanism
15:52:27dom96but oh well
15:53:04*Jesin quit (Quit: Leaving)
15:53:12FromDiscord<treeform> http seems to only provide reading from a stream
15:53:16FromDiscord<treeform> not writing to eat
15:53:18FromDiscord<treeform> not writing to it
15:55:54FromGitter<mratsim> writing to eat :P
15:56:33dom96Araq: Replied to your comments on my PR
15:59:46Araqlink please
16:00:12Araqthe number of PRs never gets below 70 for some reason (thank you #nim, you're awesome!)
16:00:59FromDiscord<treeform> Next openSSL... what a mess. I think its all openSSL fault. Poor versioning, competing implementations, really old - even deprecated packages installed on peoples machines. I don't know how to solve it.
16:01:04narimiranwe should dedicate one day per week/fortnight just for reviewing and merging PRs
16:02:07*Jesin joined #nim
16:05:54FromGitter<jrfondren> the other day there was a minor controversy about OpenSSL versions that involved grepping for the OpenSSL version number for a .so file. So I said: hah, you fools! I have a programming language that I can use to just *link* the library and *ask* it for its version. But the docs are a mess. And then the most convenient option was added only recently and I didn't even have that version installed. And then...
16:05:59dom96Araq: https://github.com/nim-lang/Nim/pull/11231
16:06:23FromGitter<jrfondren> how about support libreSSL instead? :)
16:06:45FromDiscord<treeform> jrfondren: see https://docs.google.com/spreadsheets/d/1JgbQS5e2I5bEzFaVYbYrt714CoWGHj-gRIovd7MUfMw/edit?usp=sharing
16:06:59dom96narimiran: love that idea
16:07:04FromDiscord<treeform> we support libreSSL that is what makes it hard.
16:07:22FromDiscord<treeform> There is too many versions of openSSL/LibreSSL that we don't test with.
16:08:17FromDiscord<treeform> Does any one here have the libcrypto-1_1-x64.dll handy?
16:08:38FromDiscord<treeform> ```λ choosenim
16:08:38FromDiscord<treeform> could not load: (libcrypto-1_1|libeay32).dll```
16:08:43FromDiscord<treeform> choosenim needs it now?
16:09:51dom96choosenim should come with it
16:10:13FromDiscord<treeform> it did not I can't explain it
16:10:14narimirandom96: thanks, that makes two of us (we need one more vote :P)
16:10:27dom96oh no, did you update choosenim and its deps changed? D:
16:10:32FromDiscord<treeform> I got the dll from the download thanks!
16:10:40*Trustable joined #nim
16:10:47dom96treeform: how did you install choosenim?
16:10:54dom96It should install the DLLs automatically
16:11:01FromDiscord<treeform> I don't remember
16:11:21FromDiscord<treeform> It must have been long time ago
16:11:31FromDiscord<treeform> or I build choosenim from source on windows
16:12:30FromDiscord<treeform> I was on camp github only install, but slowly transition to choosenim everywhere.
16:13:45dom96awesome :)
16:15:23FromDiscord<treeform> hmm where does choosenim install the standard library?
16:18:51shashlick@dom96 - i'm thinking of re-implementing my ntlm proxy in Nim - i'll need the socket if jester does not allow sharing socket across threads / processes
16:19:08dom96treeform: ~/.choosenim/toolchains/nim-ver/lib
16:19:31dom96shashlick: Jester will give you access to the socket
16:20:02dom96You shouldn't share it across threads though
16:20:43*zestyr quit (Ping timeout: 248 seconds)
16:21:37shashlickwhy not - i do that in my python proxy
16:24:27dom96So your plan is to write a proxy on top of Jester? Am I understanding right?
16:24:54shashlickyep - https://github.com/genotrance/px
16:25:07shashlickright now it is python but considering rewrite in nim for efficiency
16:25:31shashlickalso just using libcurl instead of fighting with upstream proxy variability around NTLM/Kerberos authentication
16:25:55dom96I don't see why you'd need Jester
16:26:04dom96Why not just use httpbeast/asynchttpserver?
16:26:16shashlickyep, this is just based on thoughts from my morning shower 🙂
16:26:26shashlickzero R&D
16:28:06shashlickmeh httpbeast doesn't support windows
16:28:18FromDiscord<treeform> dom96, thanks!
16:28:59dom96shashlick yeah, the IO loops are different enough that I decided to target Unix only
16:29:07shashlick@dom96 - how do you run multiple threads in httpbeast without sharing the socket
16:29:11dom96Windows deserves its own dedicated implementation
16:29:39dom96shashlick clients are distributed across multiple threads
16:29:49dom96no need to share it
16:30:37shashlickso you have only one listener and then spawn a separate socket for each client and redirect
16:33:21federico3asynchttpserver could benefit from some more procs to act as a minimalistic web framework
16:34:05dom96I have a listener per thread and let the OS distribute the clients
16:34:27dom96(Using SO_REUSE_PORT)
16:50:53poopBothmm if i want to have a constant array can i somhow 1 line it insted declering type and size first like here in example
16:51:47FromGitter<jrfondren> just assign it without providing the type
16:52:12FromGitter<jrfondren> you can do stuff like [1.byte, 2, 3, 4] to make it clear what type the literal has
16:52:28poopBot const SUIT_TEXT = array["♠", "♥", "♦", "♣"]
16:52:35poopBoti tryd like this but it complaint
16:52:49FromGitter<jrfondren> where did you get that 'array' from?
16:53:03poopBotoh :)
16:57:03FromDiscord<demotomohiro> !eval const SUIT_TEXT = ["spades", "hearts", "diamonds", "clubs"]; echo SUIT_TEXT
16:57:06NimBot["spades", "hearts", "diamonds", "clubs"]
16:58:31Araqbtw it's 2019, constants are good style, no need to SCREAM them
16:58:53Araqwe don't have a preprocessor that rapes the language's scoping rules either
16:58:56*valo joined #nim
17:02:37*nsf joined #nim
17:04:31Araqmaybe you should write a comment instead
17:05:05*solitudesf joined #nim
17:07:45*ng0 joined #nim
17:10:44*theelous3 quit (Ping timeout: 252 seconds)
17:11:58*Trustable quit (Remote host closed the connection)
17:14:02*jxy quit (Quit: leaving)
17:22:39*Jesin quit (Quit: Leaving)
17:25:24*kapilp joined #nim
17:31:22*Jesin joined #nim
17:31:43poopBoti just copy pasted from my python thingy :)
17:32:08poopBotdont get that part about comments ata ll
17:33:27FromGitter<jrfondren> `cont SuitText = [...] # AAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHH`
17:33:32FromGitter<jrfondren> I believe that's the recommendation
17:34:21FromGitter<liquid600pgm> https://nim-lang.org/docs/nep1.html#introduction-naming-conventions
17:34:30poopBotye but what i get with that coment after
17:34:44FromGitter<liquid600pgm> nothing
17:34:47FromGitter<liquid600pgm> it's just a comment
17:40:07*zestyr joined #nim
17:41:17*libman[m] quit (Quit: Idle kick: User has been idle for 30 days.)
17:41:24*jugash[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle kick: User has been idle for 30 days.")
17:44:14*junk[m] quit (Quit: Idle kick: User has been idle for 30 days.)
17:44:38*sg-james[m] quit (Quit: Idle kick: User has been idle for 30 days.)
17:55:53*sendell[m] quit (Quit: Idle kick: User has been idle for 30 days.)
17:58:03*krux02 quit (Remote host closed the connection)
17:59:39*hoijui quit (Ping timeout: 250 seconds)
18:00:08*federico3[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:01:02*solitudesf quit (Remote host closed the connection)
18:02:59*solitudesf joined #nim
18:03:53*qwertfisch quit (Remote host closed the connection)
18:05:46*TheKing[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:06:34FromDiscord<Avatarfighter> If I have a group of types which are all references to a main type, if I make a proc take the main type will I be able to use that proc on all the types that reference the main one?
18:07:21*jjido joined #nim
18:08:17*jjido quit (Client Quit)
18:10:09disruptekdom96: i think you fixed an async bug i was working around. thanks! ;-)
18:10:47narimiranAvatarfighter: i've just tried it and the answer seems to be: yes (if i understood your question correctly)
18:11:00FromDiscord<Avatarfighter> I think I messed up then :L
18:11:21FromDiscord<Avatarfighter> And I fixed it
18:12:06narimiranhere's my quicktest example http://ix.io/1J94
18:12:34FromDiscord<Avatarfighter> hm weird
18:13:24FromDiscord<Avatarfighter> I had to change the types from `ref object of AlbionPacket` to just `object of AlbionPacket` for it to work on my stuff that reads bytes https://hastebin.com/esenasekem.cs
18:14:27FromDiscord<Avatarfighter> ignore that incomplete proc at the bottom just started writing that lol
18:17:09*hoijui joined #nim
18:20:26*ArchieT[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:22:08narimiranchange line 122 to `var command = new PhotonCommand`
18:22:16FromDiscord<Avatarfighter> O, I actually have another question, what is the point of putting `proc test(num: var specialType)` vs `proc test(num: specialType)`
18:22:23narimiranand then it works with all objects as `ref object of ...`
18:22:44narimiranyeah, you can get rid of `var` if you use `ref object`
18:22:52FromDiscord<Avatarfighter> ah
18:24:08narimiranbut if everything works with `object`, leave it as it is. more experienced people usually tell people to use `object` wherever you can (or: to not use `ref object`)
18:25:35*qwertfisch joined #nim
18:26:51FromDiscord<Avatarfighter> I would've liked use `ref object`, but the issue is that the procs which take a type of AlbionPacket wouldn't be able to handle any of the types which were references of AlbionPacket
18:27:19*dyce[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:27:42*pqflx3[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:28:01FromDiscord<Avatarfighter> I would've liked use `ref object`, but the issue is that the procs which take a type of AlbionPacket wouldn't be able to handle any of the types which were reference objects of AlbionPacket
18:29:22*xylef left #nim ("Kicked by @appservice-irc:matrix.org : Idle kick: User has been idle for 30 days.")
18:37:08*nsf quit (Quit: WeeChat 2.4)
18:55:40*flaviut[m] quit (Quit: Idle kick: User has been idle for 30 days.)
18:57:46*lqdev[m] quit (Quit: Idle kick: User has been idle for 30 days.)
19:08:52*valo quit (Remote host closed the connection)
19:13:11*sealmove joined #nim
19:16:59*sz0_ quit (Quit: Connection closed for inactivity)
19:18:37FromGitter<mratsim> you can dereference with []
19:26:39*theelous3 joined #nim
19:49:22*solitudesf- joined #nim
19:51:09*solitudesf quit (Ping timeout: 252 seconds)
19:54:42*jjido joined #nim
19:54:57*narimiran quit (Remote host closed the connection)
20:03:54*jxy joined #nim
20:04:09*sealmove quit (Quit: WeeChat 2.4)
20:04:31*Trustable joined #nim
20:05:40*ng0 quit (Quit: Alexa, when is the end of world?)
20:13:32*Trustable quit (Remote host closed the connection)
20:16:09*rnrwashere joined #nim
20:17:06FromDiscord<Avatarfighter> mratsim, if you're still here, do you have an example of how to dereference?
20:20:13leorizeAvatarfighter: var test = RootRef(); test[] # this is how you deref
20:22:45*rnrwashere quit (Remote host closed the connection)
20:24:12*kapilp quit (Quit: Connection closed for inactivity)
20:29:34*rnrwashere joined #nim
20:31:30*theelous3_ joined #nim
20:37:10FromDiscord<Avatarfighter> ohhh
20:37:14FromDiscord<Avatarfighter> That's pretty neat
20:37:37FromDiscord<Avatarfighter> Thank you leorize 😄
20:37:39*laaron quit (Remote host closed the connection)
20:39:14*solitudesf- quit (Quit: Leaving)
20:39:37*solitudesf joined #nim
20:41:00*laaron joined #nim
20:59:20*Sembei joined #nim
21:05:02*xace quit (Ping timeout: 245 seconds)
21:05:17*xace joined #nim
21:18:27*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:19:42*solitudesf quit (Ping timeout: 244 seconds)
21:20:43*laaron quit (Remote host closed the connection)
21:21:01*laaron joined #nim
21:26:08FromDiscord<kiwi> I always thought that all caps comments was one of Guido's mistakes. Most of python is pretty but shouting isn't.
21:42:57*rnrwashere quit (Remote host closed the connection)
21:43:47*rnrwashere joined #nim
21:44:05FromDiscord<exelotl> just out of interest, how come openArray starts with lowercase?
21:44:49FromGitter<jrfondren> like string and seq and int?
21:44:52clyybberseq also starts with lowercase
21:45:02FromDiscord<exelotl> oh wait because it's a builtin type, of course
21:51:53*theelous3_ quit (Quit: is outty)
21:57:39*cyraxjoe joined #nim
21:57:58*MightyJoe quit (Ping timeout: 245 seconds)
22:00:39*laaron quit (Remote host closed the connection)
22:01:15*laaron joined #nim
22:05:44*hoijui quit (Remote host closed the connection)
22:30:54disruptekis async latency gonna be fixed for 0.20?
22:32:11dom96Araq, thanks for merging https://github.com/nim-lang/Nim/pull/11231
22:32:18dom96disruptek, latency? What latency?
22:33:34disruptekthe 500ms poll() timeout
22:33:39*cyraxjoe quit (Quit: I'm out!)
22:33:46FromGitter<jrfondren> what's to be "fixed" about that?
22:35:09disruptekwell, when you're doing local i/o, 500ms is pretty painful.
22:35:13FromGitter<jrfondren> I suppose you've got some loop that calls asyncdispatch.drain() or the other one? turn that into an addTimer instead.
22:35:43*rnrwashere quit (Remote host closed the connection)
22:36:02dom96just call it with a different timeout?
22:36:25FromGitter<jrfondren> https://gist.github.com/jrfondren/bbbc3a7eb3c30d3485a3e2913557d3d2 <- compare
22:37:44*cyraxjoe joined #nim
22:38:03dom96Does drain vs. poll really make a difference in the first example?
22:38:12FromGitter<jrfondren> no that's not important
22:38:20dom96Then why use it?
22:38:42dom96Sorry, it honestly bugs me that it's in the stdlib
22:38:45disruptekhmm, well, i will test devel again, but last time i tried making queries to local http (aws lambda) via async, it didn't work correctly in async mode (ie. it was slow).
22:39:02dom96disruptek, post your code and we'll help you out
22:39:21FromGitter<jrfondren> you can compile and run both of those, and interact with them. you'll probably recognize what annoyed you, and the other fixes it.
22:39:26dom96jrfondren: in any case, as far as that code is concerned what we need and will get eventually is the ability to await a FlowVar
22:39:35dom96(A PR for that would be amazing ;))
22:40:03dom96also, calling `poll` or `drain` in a procedure is a bad pattern in my book
22:40:20dom96It should only be called at the top-level or in a proc called `main`
22:51:03disruptekstill slow. i will create a minimal example...
22:55:35*rnrwashere joined #nim
22:58:42*rnrwashere quit (Remote host closed the connection)
23:00:04FromGitter<jrfondren> there's no local I/O there.
23:00:16FromDiscord<exelotl> if I have a string or pointer to raw bytes of known length, is there a way to treat that data as array[n, MyType] without copying?
23:01:06disruptekit's loopback i/o.
23:01:20disruptekadded a comment you can probably c+p to run it.
23:01:22FromGitter<jrfondren> that's one shot of some I/O functions. the async version has extra overhead so it'll be marginally slower. I get refused connections at 3.9ms vs. 2.9ms.
23:01:51FromGitter<jrfondren> "loopback i/o" isn't a special class of I/O
23:02:03disrupteki agree.
23:02:23disruptekit's local to the node. is that better?
23:02:35FromGitter<jrfondren> No.
23:02:46FromGitter<jrfondren> It's irrelevant, so let's not speak of it at all.
23:02:58disrupteksure, let's not speak of it.
23:03:14FromGitter<jrfondren> what you're really comparing there is async overhead vs. no overhead for a single synchronous transaction.
23:03:29FromGitter<jrfondren> it takes a lot less than 500ms, why do you think that's related?
23:03:43disruptekhave you tested it on lambda? because if you haven't, let's not speak of it. :-P
23:04:34FromGitter<jrfondren> no, like I said I got refused connections on my local machine at 3.9ms vs. 2.9ms.
23:06:45FromGitter<jrfondren> man, if your isolated forest town got attacked by a dragon, you'd ride to the far-away lord and demand "What are you going to do about the dragon?" and then refuse to explain yourself, and just get angry when the court hasn't heard about the dragon.
23:07:18disruptekyeah, i'm still pretty upset about the dragon.
23:07:25disrupteklet's not speak of it, either.
23:07:43disruptekwhen i try to read the response body, it takes 500ms. here's output with a higher-resolution logger:
23:07:46disruptekDEBUG 0s 500ms 567μs 198ns -> read body
23:07:48FromGitter<jrfondren> that you are upset is communicated proficiently. Nothing else is.
23:08:22disruptekwell, if it's not solved and it's not gonna be, i have my answer.
23:09:23disruptekhere's the sync version:
23:09:24disruptekDEBUG 0s 0ms 0μs 956ns -> read body
23:10:36FromGitter<jrfondren> so this takes 500ms? `var body = waitfor response.body` so the I/O's already done and the poll times out.
23:11:12*rnrwashere joined #nim
23:12:59FromGitter<jrfondren> asyncdispatch.waitFor does `while not fut.finished: poll()`, so that's reasonable.
23:13:42disruptekiirc, it's already got all the data; it just doesn't know it yet.
23:15:44FromGitter<jrfondren> ./lib/pure/httpclient.nim:body (for AsyncResponse) does `if response.body.len == 0: response.body = await readAll(response.bodyStream)` and returns that...
23:18:12FromGitter<jrfondren> the problem may be that readAll. it does `await read` or `await future.read` until that returns nothing.
23:18:58FromGitter<jrfondren> anyway yeah, this is a bug.
23:20:18disruptekwhy didn't your reproduction reproduce it?
23:22:55FromGitter<jrfondren> like I said I ran it locally and got connrefused, so the code didn't get that far.
23:25:02*clyybber quit (Quit: WeeChat 2.4)
23:51:31FromGitter<jrfondren> https://gist.github.com/jrfondren/abeaef41b69b149945d325c34936f697 nah the 500ms is seen with the .read as well