<< 11-03-2020 >>

00:14:32*krux02_ joined #nim
00:18:27*krux02 quit (Ping timeout: 260 seconds)
00:25:55*s4mu3lbk quit (Ping timeout: 260 seconds)
00:48:31FromDiscord<Elegant Beef> How would i fetch the stdout of a process without freezing because no EOF?
00:50:48*krux02_ quit (Remote host closed the connection)
01:01:14*krux02 joined #nim
01:06:57disruptekbeef: i have an example in golden; see the invocation file.
01:07:00disruptek!repo golden
01:07:00disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 16⭐ 0🍴
01:07:17*Hideki_ joined #nim
01:08:32disruptek~stream
01:08:33disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
01:08:45disruptekbot features for Z3vv
01:11:39*Hideki_ quit (Ping timeout: 260 seconds)
01:20:12FromGitter<DeathPoison> ährm, could anyone give me a hint how to solve my error? ⏎ ⏎ i've wrote some code without -d:release, all worked fine, ⏎ but later i turned this swtich on and got the following error in runtime: ⏎ ... [https://gitter.im/nim-lang/Nim?at=5e683ccc80cc7b7924b80f23]
01:20:25FromGitter<DeathPoison> does it mean that i try to request the repo attribute without knowing that it have the correct type?
01:20:27disruptek~paste
01:20:27disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
01:22:43disruptekyes, it does.
01:22:56disruptekit has the wrong variant.
01:23:55FromGitter<DeathPoison> but it does not... ⏎ https://play.nim-lang.org/#ix=2dVt
01:24:09FromGitter<DeathPoison> if have a case of around it checking the kind
01:25:20FromGitter<DeathPoison> the debug line above the critical line showing correct data
01:26:54disruptekentry.repo.gitPull ...
01:28:20FromGitter<DeathPoison> badly not, GitRepo is the type oof the gitapi lib; GitRepository is mine, where the path comes from
01:29:10FromGitter<DeathPoison> little bit confusing sry
01:29:41disruptekcan i see the types?
01:30:31disruptekde-indent LBEntry, for one thing. the case within, i mean.
01:30:47disrupteklooks okay otherwise.
01:31:00disruptekyou don't need a trailing else if your case is exhaustive.
01:31:12disruptek(ie. it's best not to have it)
01:31:44*lbart quit (Ping timeout: 256 seconds)
01:32:35FromGitter<DeathPoison> i have added the else just because i've deleted the lbetDirectory case
01:32:40FromGitter<DeathPoison> deindent the case?
01:32:44disruptekyes.
01:32:50FromGitter<DeathPoison> i try
01:33:12FromGitter<DeathPoison> you mean the whitespace, right?
01:33:16disrupteki do.
01:33:39FromGitter<DeathPoison> so the case should be in line with types name?
01:33:54disruptekno, but use a consistent indent of either 2 (ideally) or 4 spaces.
01:34:00disrupteknot 2, 4, 5, or 3.
01:34:05disruptekjust pick one.
01:34:17FromGitter<DeathPoison> ive using 2; the copied from gitapi uses 4...
01:34:29disruptekwhich gitapi?
01:34:36FromGitter<DeathPoison> thats not really what i want to discuss here :P
01:34:47FromGitter<DeathPoison> sry, no offense, thanks for helping me
01:35:13disruptekmaybe not, but it's hard to debug code that might be broken because of whitespace in a whitespace-sensitive language.
01:35:17FromGitter<DeathPoison> https://nimble.directory/pkg/gitapi
01:35:20disruptekso do us a favor and try to write working nim.
01:36:53FromGitter<DeathPoison> sry, the whitespace thing, yeah you are right, but my problem is not, that the code does not compile ⏎ ⏎ i have a problem at runtime, so the code is formerly valid i think
01:37:09disruptekwhat do you think the problem is?
01:37:19FromDiscord<Elegant Beef> Yea disruptek that's not working for me it just locks my system cause the second process is still running
01:37:36disrupteksecond process?
01:37:44FromGitter<DeathPoison> iam not sure, that what i try to figure out
01:37:56FromDiscord<Elegant Beef> The stdout question
01:38:39disruptekdid you use my code?
01:38:51*lbart joined #nim
01:38:52FromDiscord<Elegant Beef> yes the while not at read a char
01:39:02disruptekthe what?
01:39:13FromDiscord<Elegant Beef> not at end*
01:39:50FromDiscord<Elegant Beef> you do mean drainStreamInto right?
01:40:17disruptekyou probably need /all/ the machinery in there.
01:40:21disrupteknot just one proc.
01:40:27disruptekit's more complex than that.
01:40:38disruptekdeathpoison: i just cannot help without seeing more code.
01:41:00disrupteki don't see a problem here.
01:41:12disruptekcan you reduce it to a minimal example that doesn't work?
01:42:06FromGitter<xflywind> Hello, I want to install `nimph`,but I can't install `nimterop` in Nim version 1.0x in Ubuntu. ⏎ ⏎ nimble install nimterop -y ⏎ ⏎ Get error: ... [https://gitter.im/nim-lang/Nim?at=5e6841eea2ccef3232e63929]
01:43:01disruptek!repo gittyup
01:43:03disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 1⭐ 0🍴
01:43:05disruptek!repo github
01:43:05shashlickCan you remove the nimterop directory in cache and try again
01:43:08disbothttps://github.com/disruptek/github -- 9github: 11github api v3 for nim 15 6⭐ 0🍴 7& 29 more...
01:43:35shashlickAnd share a paste of the full error
01:44:48FromGitter<DeathPoison> sadly that was the full error message ⏎ ⏎ sysfatal.nim:39 ⏎ Error: unhandled exception: 'repo' is not accessible using discriminant 'kind' of type 'LBEntry' [FieldError] [https://gitter.im/nim-lang/Nim?at=5e684290ff8bf14a544b4ffd]
01:45:15FromGitter<DeathPoison> but i try another tomorrow, and try to encapsulate the whole thing
01:45:46disruptekit's probably an error in the api.
01:45:54disruptekwithout seeing more of the stacktrace, i really cannot tell.
01:46:08disrupteki can't even tell if it's an error pointing at your code; ya feel me?
01:47:25FromGitter<DeathPoison> sure but the whole output is this: ⏎ ⏎ DEBUG Checking for project: test ⏎ DEBUG located at: /home/poisonweed/git/test ⏎ DEBUG aready exists: /home/poisonweed/git/test ... [https://gitter.im/nim-lang/Nim?at=5e68432d8e423969577ed086]
01:47:38FromGitter<DeathPoison> so the is sadly no stack trace available
01:48:20FromGitter<DeathPoison> but yeah i feel you :P
01:50:30FromGitter<DeathPoison> i already fixed some other issues with this library, probably another will do it, if not i will try my best to encapsulate all this stuff
01:50:35*marmotini_ joined #nim
01:51:20FromGitter<DeathPoison> gn8 folks, its enough ;)
01:51:57disruptekaight, good luck.
01:54:46FromGitter<DeathPoison> in worst case, a execCmd will do the trick anyway :D
01:55:14FromGitter<DeathPoison> but feels bad not getting around this error
01:58:24FromGitter<xflywind> Now, It stucks here.But it maybe owe to my internet[for me it's slow to pull repo from github]. ⏎ Installing [email protected] ⏎ Building nimterop/nimterop/toast using c backend
01:58:53leorizeprobably it's just slow
01:59:10disruptekif it's nimph, it's probably downloading and building libgit. maybe.
01:59:28leorizeif it's stuck at building toast, then it's not there yet :P
01:59:47disruptektrue.
02:02:19*dwdv quit (Ping timeout: 265 seconds)
02:03:36disruptekgithub seems dead.
02:03:46disruptekmaybe it's just slow.
02:05:22FromGitter<xflywind> If I use ctrl+c to exit.Next I will fail to install nimterop at once because of cache. ⏎ Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N]
02:06:48shashlickYa just wait it out
02:09:38FromGitter<alaviss> test
02:11:34leorizethe gitter official irc bridge doesn't seem to support edits :P
02:22:53FromGitter<xflywind> Thanks.Now I have installed nimterop successfully. @shashlick
02:23:07FromDiscord<Elegant Beef> When you commit using your terminal and push the changes using it
02:24:12FromDiscord<Elegant Beef> I still have to parse so many ansicodes
02:24:23FromDiscord<Elegant Beef> Probably have to remake the drawing/parsing for a third time
02:25:06*muffindrake quit (Ping timeout: 240 seconds)
02:35:46*endragor joined #nim
02:38:55*lbart quit (Ping timeout: 260 seconds)
02:51:13*lbart joined #nim
02:51:24*chemist69 quit (Ping timeout: 256 seconds)
02:53:18*chemist69 joined #nim
03:20:55*dadada quit (Ping timeout: 260 seconds)
03:22:47*dadada joined #nim
03:23:11*dadada is now known as Guest68714
03:24:02*okcy quit (Ping timeout: 240 seconds)
03:24:35*okcy joined #nim
03:24:35*rockcavera quit (Remote host closed the connection)
03:28:43*opal quit (Ping timeout: 240 seconds)
03:32:03*opal joined #nim
03:32:52disruptektestes
03:34:31disrupteka feature for zevv:
03:34:40disruptek!last disruptek
03:34:41disbotdisruptek did something unexpected in 12#nim 9 seconds ago and last spoke 79 seconds ago
03:36:20disruptek!last beef
03:36:20disbotbeef never seen.
03:37:30*okcy quit (Remote host closed the connection)
03:37:41*okcy joined #nim
03:37:52disrupteki guess i won't be able to support people with spaces in their nicks unless...
03:39:53disruptek!last elegant beef
03:39:54disbotelegant beef never seen.
03:41:04FromDiscord<Elegant Beef> !last "Elegant Beef"
03:41:04disbot"Elegant Beef" never seen.
03:41:08FromDiscord<Elegant Beef> 😄
03:41:23disruptek!last elegant beef
03:41:23disbotElegant Beef did something unexpected in 12#nim 19 seconds ago and last spoke 719 seconds ago
03:41:42disrupteknice try, sport.
03:42:09FromDiscord<Elegant Beef> no you
03:44:44leorize!last leorize
03:44:45disbotleorize never seen.
03:44:50leorize!last leorize
03:44:50disbotleorize spoke in 12#nim 5 seconds ago and last spoke 75 seconds ago
03:45:39disruptekfor some reason, the datetimes are unequal.
03:45:57disruptekalthough i copy the first to the second.
03:46:06disruptek!last leorize
03:46:06disbotleorize spoke in 12#nim 76 seconds ago
03:47:23disruptekfixed.
03:47:34disruptek!last leorize
03:47:34disbotleorize spoke in 12#nim 2 minutes ago
03:47:43leorize!last disruptek
03:47:44disbotdisruptek spoke in 12#nim 9 seconds ago
03:49:13disrupteksomeone needs to leave and come back in.
03:49:19disruptek!last disruptek
03:49:20disbotdisruptek spoke in 12#nim 5 seconds ago
03:49:23*okcy quit (Ping timeout: 260 seconds)
03:49:31*axion left #nim ("WeeChat 2.6")
03:49:33*axion joined #nim
03:49:33disruptek!last okcy
03:49:33disbotokcy never seen.
03:49:38disruptek!last axion
03:49:38disbotaxion never seen.
03:49:57*okcy joined #nim
03:51:10disruptektake 3.
03:53:46*axion left #nim ("WeeChat 2.6")
03:53:47*axion joined #nim
03:53:52axion!seen axion
03:53:52disbotaxion never seen.
03:54:14leorize!help
03:54:27leorizedisruptek: are you streaming?
03:54:31disruptekyeah?
03:54:37disruptek!last axion
03:54:38disbotaxion spoke in 12#nim 45 seconds ago
03:55:28*thomasross quit (Remote host closed the connection)
03:56:26disruptek!axion
03:56:31disruptek!last axion
03:56:32disbotaxion spoke in 12#nim 2 minutes ago
03:57:24disruptek!last thomasross
03:57:25disbotthomasross quit from 12 115 seconds ago
03:57:53FromDiscord<Elegant Beef> <disbot> disruptek spammed the bot 1 second ago
03:59:51*leorize left #nim ("WeeChat 2.7.1")
04:00:05*leorize joined #nim
04:00:48disruptek!last leorize
04:00:49*okcy quit (Remote host closed the connection)
04:00:49disbotleorize joined 12#nim 42 seconds ago and last spoke 749 seconds ago
04:01:28*okcy joined #nim
04:01:54*axion left #nim ("WeeChat 2.6")
04:01:56*axion joined #nim
04:02:00axion!seen axion
04:02:00disbotaxion joined 12#nim 4 seconds ago and last spoke 75 seconds ago
04:03:09*axion left #nim ("WeeChat 2.6")
04:03:10*axion joined #nim
04:03:14axion!seen axion
04:03:14disbotaxion joined 12#nim 4 seconds ago and last spoke 773 seconds ago
04:04:38disruptek!last leorize
04:04:38disbotleorize never seen.
04:04:44disruptek!last axion
04:04:45disbotaxion spoke in 12#nim 90 seconds ago
04:22:48*krux02 quit (Remote host closed the connection)
04:32:15disruptek!last krux02
04:32:16disbotkrux02 quit 79 minutes ago
04:35:45*nsf joined #nim
04:36:00disruptekmaybe it should mangle the username if they are on irc, so they don't get pinged.
04:37:01shashlickwhy not
04:37:28shashlickgets tagged in the command anyway
04:37:34disruptekoh, good point.
04:39:34disruptekpeople can query the bot privately to avoid a ping.
05:03:10*okcy quit (Remote host closed the connection)
05:03:54*okcy joined #nim
05:09:48FromDiscord<Rika> Is this the classic testing in production I see
05:15:39*okcy quit (Ping timeout: 265 seconds)
05:16:12*okcy joined #nim
05:20:08*narimiran joined #nim
05:20:31*rmt joined #nim
05:29:15*muffindrake joined #nim
05:31:37*okcy quit (Ping timeout: 255 seconds)
05:31:47*okcy joined #nim
06:08:35axionDoes Nim have anything like CL keywords? Self-referential symbols to use instead of strings, for example to dispatch on within a case statement
06:13:12FromDiscord<Rika> what do you mean
06:16:45axionI mean exactly self-referential symbols/identifiers that can be resolved at runtime. Not sure how I should describe it in terms of Nim.
06:18:12Zevv!last disruptek
06:18:12disbotdisruptek never seen.
06:18:16Zevvha
06:18:21leorizeaxion: if you can write some mock nim code to describe it then that'd be great
06:21:30rmtSomething like Ruby's :symbols, I imagine?
06:22:37rmtI imagine that Enums are a typical approach,.. probably better than open-ended non-contextual symbols, anyway.
06:23:24axionhttps://gist.github.com/mfiano/f04eb97e3e665f3b242206f30f3eacc5
06:27:29axionEnums are fine and all, but assume a finite set.
06:27:38axionI guess a case statement was a bad example
06:28:40leorizeso basically you want a way to not have to write string quotes?
06:29:00*chemist69 quit (Ping timeout: 256 seconds)
06:29:24*chemist69 joined #nim
06:32:10axionI realize now my question was pointless and Nim doesn't allow evaluation control of arbitrary expressions outside of meta-programming like Lisp does.
06:32:24axionWell, yes, but not specific to strings.
06:32:34axionDon't worry :)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:30*marmotini_ quit (Remote host closed the connection)
07:00:43*rmt quit (Ping timeout: 255 seconds)
07:01:02*marmotini_ joined #nim
07:02:17*rmt joined #nim
07:04:51*gmpreussner joined #nim
07:05:51*marmotini_ quit (Ping timeout: 265 seconds)
07:21:56*hax-scramper quit (Ping timeout: 258 seconds)
07:22:34*hax-scramper joined #nim
07:22:55*PMunch joined #nim
07:26:01*hax-scramper quit (Read error: Connection reset by peer)
07:26:02*s4mu3lbk joined #nim
07:26:16*hax-scramper joined #nim
07:26:38Mister_MagisterHi people, i need to extract something (text) from website (curl tha html). Any tips/libs on how to do that?
07:27:43PMunchhttps://nim-lang.org/docs/httpclient.html
07:27:48PMunchThat would be a good place to start
07:28:03FromDiscord<Elegant Beef> use the http client to get, then use the xml tree or html parser libs
07:28:34Mister_Magisteri know that much :P i'm using it for http server PMunch
07:28:56PMunchFor a server?
07:29:01Mister_Magister@Elegant Beef ye i'm more interested in those
07:29:19PMunchThere is this in the stdlib: https://nim-lang.org/docs/htmlparser.html
07:29:45Mister_MagisterPMunch: thanks
07:29:54FromDiscord<Elegant Beef> funnily because of the source code the html parser doesnt work on this https://nim-lang.org/docs/theindex.html
07:30:01PMunchThis if you want a bit easier way of finding the node you're looking for: https://github.com/GULPF/nimquery
07:30:14FromDiscord<Elegant Beef> <p /> doesnt work with the parser
07:30:27*hax-scramper quit (Read error: Connection reset by peer)
07:30:39PMunchHmm, well that's a shame..
07:30:46*hax-scramper joined #nim
07:30:57Mister_Magisterand since we are at it, do you have some async tutorial? i'm awaiting everything and that's bad :(
07:31:21PMunchHmm, I was about to write one
07:31:34PMunchBut then life happened and I actually forgot about it until now..
07:32:01PMunchIf you've got Nim in action I think there's some good info in there
07:32:20Mister_Magisterlike i'm using telegram bot library and get requests as async, and i'm downloading video from message (async but await) and then running ffmpeg on it (again async but await) and then sending it back (again await) and i would like to do it totally async
07:32:50PMunchWell, you need to do those things one after the other anyways
07:32:54Mister_Magisterotherwise i'm blocking other requests
07:32:55PMunchSo you need to await the results
07:33:04Mister_Magistermhm
07:33:07PMunchThe benfit comes from handling multiple requests
07:33:23Mister_Magistercan i await without blocking other requests?
07:33:32Mister_Magister>inb4 threads
07:33:43Mister_Magisteri'm not sure what is async for
07:33:44PMunchEvery time you `await` Nim will hand control over to something else (for example the thing you awaited, or the handler of new requests)
07:34:38Mister_MagisterPMunch: that doesn't happen tho or i broke something :< when i await getting requests is freezed
07:35:15*solitudesf joined #nim
07:35:32FromDiscord<Rika> i feel like youre getting the same issue as i am
07:35:36PMunchWell if any of the tasks stay busy for a long time without allowing other tasks to run you will still block.
07:35:38FromDiscord<Rika> though i cant easily explain the issue
07:36:19Mister_Magisteryeah… i don't get the idea of async at all
07:36:44FromDiscord<Rika> well async works if you're waiting for stuff a lot
07:36:47FromDiscord<Rika> aka an IO issue
07:36:55leorizethe idea of async is to dispatch the control flow to something else while your request is being fulfilled
07:36:57FromDiscord<Rika> if you're PROCESSING a lot that probably needs threading
07:37:14PMunchAsync/await still only does one thing at a time, and it is what's called co-operative multitasking. So every time you await something that single thing you're doing can now be something else. The benefit comes when doing IO, which is when the OS does things for you. For example when reading a file or getting a network request you ask the OS to put something into memory for you. While you wait for it to do that you are free to do other things instead of just
07:37:15PMunchsitting idly by waiting.
07:37:16Mister_Magisterleorize: well that doesn't happen :C
07:37:42FromDiscord<Rika> ok so what libraries are you using exactly
07:38:05Mister_Magistertelebot
07:38:26FromDiscord<Rika> is it async
07:38:28PMunchIt can also give the impression of multiple things happening at once since simply because you're switching back and forth between things quickly, think about how single processor machines could still run multiple programs "at the same time"
07:39:02leorize!repo telebot
07:39:03disbothttps://github.com/ba0f3/telebot.nim -- 9telebot.nim: 11Async client for Telegram Bot API in pure Nim [Bot API 4.6] 15 61⭐ 7🍴 7& 1 more...
07:39:05Mister_Magister hmm wait
07:39:15Mister_MagisterexecShellCmd isn't async :C
07:39:25*alexande192 joined #nim
07:39:30FromDiscord<Rika> ah youre gonna want the one that returns immediately
07:39:43Mister_Magisterwhat do you mean?
07:39:46leorizeMister_Magister: well that's your bottleneck :P
07:39:48*Vladar joined #nim
07:39:52Mister_Magisterleorize: ye i just realised
07:40:12leorizeI thought you're using asynctools
07:40:14leorize!repo asynctools
07:40:15disbothttps://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 51⭐ 11🍴
07:40:28Mister_Magisterno unfortunately
07:40:33leorizewhich does have async processes :)
07:40:36leorizeso use it :P
07:40:51*s4mu3lbk quit (Ping timeout: 260 seconds)
07:41:06FromDiscord<Rika> i was thinking of https://nim-lang.org/docs/osproc.html#startProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D but thats okay too
07:41:10FromDiscord<Rika> wow, 11 cutleries
07:41:29PMunchHaha, I'm guessing that's forks
07:41:56Mister_Magisterleorize: okay
07:42:38*alexander92 quit (Ping timeout: 258 seconds)
07:42:43Mister_Magisteroh one more question, do you have any code style guides? I'm comming form oop and without oop i'm like child with toys, i make huge mess
07:42:48FromDiscord<Rika> PMunch, it's a joke some of us make in reference to the original joke, which was a while back
07:43:02leorizeMister_Magister: https://nim-lang.org/docs/nep1.html
07:43:13*Mister_Magister nepnep
07:43:31leorizealso give your data structures a lot of care
07:43:53*Mister_Magister >https://www.youtube.com/watch?v=3YaRUKhf-Qc eh memes :D
07:43:53PMunchOh, must've missed that joke :(
07:45:36PMunchThe NEP1 is more about syntactic style, not so much about writing code without objects
07:45:44PMunchAnything in particular you feel is "messy"?
07:46:07FromDiscord<Rika> nepu
07:46:18Mister_MagisterPMunch: long file without any structure really, wait here is my bot https://github.com/Michal-Szczepaniak/lenislaw/blob/master/bot.nim
07:46:24Mister_Magisteryou will see right away
07:47:08leorizewell try this:
07:47:25leorizeif you wanna make a class, then split it to another module
07:47:32Mister_Magisterin oop i would split it into objects and files and shit
07:47:46Mister_Magisterleorize: another module aka new file?
07:47:49leorizeyep
07:48:07Mister_Magisterokay makes sense (what i wanted to do tbh)
07:48:39*sz0 joined #nim
07:48:55Mister_Magisteri like nim and it feels like it has potential for making small lightweight programs (fsck python :D)
07:49:04Mister_Magisterjust gotta understand it more…
07:49:49PMunchYeah, I'd split all the DB stuff into it's own file. Then possibly the downloader procedures into one file
07:50:25PMunchAnd I'd look into a template or something to do the handler, seems like a lot of repetition is going on there
07:50:41leorizealso... asynchttpserver is **not** threaded
07:50:47leorizeplease don't spawn a thread for it
07:52:06Mister_MagisterPMunch: same
07:52:10Mister_Magisterleorize: what do you mean
07:52:34leorizehttps://github.com/Michal-Szczepaniak/lenislaw/blob/master/bot.nim#L774-L777
07:52:41leorizethat's pure evil :P
07:53:04Mister_Magisteralso i have like downloadDocument downloadImage but the Document and Image objects are made from same base object and i was wondering if i could cast them into one function
07:53:51Mister_Magisterleorize: but it works! and i thought that if i run waitFor server.serve(Port(2137), cb) before bot.poll(timeout=300) the bot thing won't run
07:54:19leorizeit works for now
07:54:22*Mister_Magister in fact that's what was happening i believe
07:54:41Mister_Magisterleorize: i can't wait for both of them at the same time
07:54:56leorizethe idea of asyncdispatch is that you don't have to
07:55:06Mister_Magisterbut the waitFor
07:55:11leorizethe poll() wait for the event
07:55:18leorizethen you can act on it
07:55:29Mister_Magisterwhat do you mean
07:55:50leorizeso here's a brief on how async works:
07:56:30*rmt quit (Ping timeout: 256 seconds)
07:56:49leorizeyou register your event handlers -> the async stuff you use register themselves with the dispatcher -> on poll() the dispatcher runs and activate the callbacks as events are received
07:57:16leorizewaitFor is: poll(), if not future.isFinished: do it again
07:58:17Mister_Magisteraaaaand?
07:58:21PMunchHmm @Elegant Beef, the htmlparser seems to work fine on theindex.html
07:58:24leorizeit's useful for just waiting for one Future in your partially async program
07:58:38leorizewhen it's fully async-powered, you don't have to
07:58:47leorizeinstead you use runForever() :)
07:59:03Mister_Magisteri don't follow…
07:59:19leorizeI'm not really the best at explaining things :P
07:59:39Mister_Magisterleorize: what i can't get is how to wait for both of them at the same time
08:00:24leorizetelebot api is weird...
08:00:36leorizewhy does it have it's own poll() if it's integrated with asyncdispatch
08:00:41Mister_Magisterhuh
08:02:27leorizeso let's make it simple
08:02:35leorizeasync give you Futures
08:03:07leorizeif you want the stuff that's gonna be the Future to run, you call poll()
08:03:24leorizewaitFor is basically just polling until the Future is complete
08:03:35leorizebut in this case you don't really care
08:04:01Mister_Magisteraaaaand?
08:04:12PMunchpoll is a wrapper that calls `waitFor loop(b, timeout, offset, limit)`
08:04:15leorizeso what you do is that you capture the Future from asynchttpserver.serve() and telebot.pollAsync()
08:04:19PMunchIn telebot
08:04:26leorizethen you call runForever()
08:04:37leorizewhich will run `poll()` forever
08:05:02leorizeso the you get both telebot and asynchttpserver to run since you got their Futures
08:05:07leorizeis that simple enough? :P
08:05:19Mister_Magisterb…but how do i do that
08:05:36PMunchYeah, so instead of the whole thread thing do `asyncCheck server.serve(Port(2137), cb)` and `asyncCheck bot.pollAsync(timeout = 300)` then instead of `thread.joinThread()` do `runForever()`
08:06:22leorizeah yea, asyncCheck works too
08:06:51Mister_MagisterPMunch: whoa thanks
08:06:53PMunchA little something like this: https://play.nim-lang.org/#ix=2dWd
08:07:26Mister_Magistersadly there is no nice IDE for nim :C
08:07:33leorizeI'm not the best at explaining these things :P IIRC Zevv wrote something related to this, and might be able to give you a better ELI5
08:07:47PMunchleorize, yeah neither serve nor poll returns anything in their Futures. So just asyncCheck them to attach an exception handler callback to them :)
08:08:09PMunchMister_Magister, what do you mean, there are many nice IDEs for Nim :)
08:08:13Mister_Magisterleorize: you are great thank you for even trying to help me!
08:08:22Mister_MagisterPMunch: like?
08:08:41PMunchWell I use Vim :P But I think most people use VSCode
08:08:51Mister_Magisteri dun like vscode cas m$
08:08:56Mister_Magistercause*
08:08:58Mister_Magister:<
08:09:06FromDiscord<Rika> then just use Code
08:09:11ZevvELI5?
08:09:15leorizeyou gotta admit one thing: MS knows how to please developers :p
08:09:15FromDiscord<Rika> the nonbranded version of vscode
08:09:22leorizeZevv: explain like I'm 5
08:09:50PMunchRika, wait, there's an unbranded version?
08:09:55PMunchWhat's the difference?
08:10:05Zevvhaha
08:10:06Mister_Magister@Rika what? link?
08:10:16leorizeZevv: I tried to give Mister_Magister a brief on how async work, and it's not simple enough :P
08:10:30Mister_Magisterleorize: i get it i get it
08:10:46Zevvoh I never made that writeup. I started it and stalled, and I think PMunch gave it another shot also
08:10:49PMunchWith nimlsp you can basically use Nim with any editor that supports LSP, but you might want to find a plug-in that does syntax highlighting if the editor doesn't have that by default
08:11:35PMunchZevv, yeah I have a series of articles on multi-tasking in Nim in the pipeline
08:11:54PMunchBut someone needs a bit more fiber in their diet, 'cause the whole line is clogged!
08:11:55leorizePMunch: well if you insist on not using nimsuggest directly, my nim.nvim does provide barebones indent & syntax highlighting
08:12:10leorizejust need a quick tweak to disable the nimsuggest integration
08:12:18PMunchMy projects unfortunately tend to be in a FILO queue..
08:12:23Mister_Magisterye so there is no nice IDE :C
08:12:55leorizeMister_Magister: well if you know your way with neovim you can use my nim.nvim
08:12:59leorize!repo nim.nvim
08:13:00disbothttps://github.com/baabelfish/nvim-nim -- 9nvim-nim: 11Vim support for nim. 15 53⭐ 17🍴 7& 3 more...
08:13:07leorize!repo alaviss/nim.nvim
08:13:08disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 69⭐ 9🍴
08:13:10PMunchHmm, I should really check out neovim..
08:13:18Mister_Magisterleorize: i know vim only unfortunately
08:13:30leorizeneovim is vim with extra features
08:13:35leorizeif you know vim you know neovim
08:13:57PMunchI should also check out kakoune again
08:14:07FromDiscord<Rika> i cant remember where the thing is
08:14:11FromDiscord<Rika> give me a few minutes
08:14:26*hax-scramper quit (Ping timeout: 240 seconds)
08:16:28PMunch@Rika, was it this thing? https://vscodium.com
08:17:07FromDiscord<Rika> no
08:17:11FromDiscord<Rika> it was Code - OSS
08:17:23FromDiscord<Rika> but it seems like it just redirects to the vscode repo now
08:17:54FromDiscord<Varriount> Isn't VSCode open source?
08:18:11*hax-scramper joined #nim
08:18:37PMunchhttps://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code
08:19:00FromDiscord<Rika> yup that
08:19:20PMunchAha, so VSCode the repository is Code without any MS stuff. Then when they go to build "Visual Studio Code" they add in their MS specific stuff.
08:19:48PMunchSo VSCodium is just a pre-built version of the VSCode repo without the addition of the MS stuff
08:19:51FromDiscord<Rika> yeah probably an internal repo
08:20:03FromDiscord<Rika> no i think vscodium is even more stripped out
08:20:14FromDiscord<Rika> probably stuff like telemetry or something
08:20:20FromDiscord<Elegant Beef> yea
08:20:23FromDiscord<Rika> though i dont know why they'd leave that in the repo
08:20:32FromDiscord<Elegant Beef> vscodium is the telemetry free version of vscode
08:20:40PMunch"The VSCodium project exists so that you don’t have to download+build from source. This project includes special build scripts that clone Microsoft’s vscode repo, run the build commands, and upload the resulting binaries for you to GitHub releases. These binaries are licensed under the MIT license. Telemetry is disabled."
08:20:42leorizePMunch: you might like this feature in nim.nvim: https://asciinema.org/a/RXbwCTJXGRKEhMRiHIUEoDGd7
08:20:46PMunchFrom the VSCodium site
08:22:28PMunchleorize, which feature?
08:22:34FromDiscord<Rika> indent stuff
08:22:34PMunchThat should at least three or four :P
08:22:55leorizewell the "smart" indent :P
08:23:04FromDiscord<Rika> ~~slow typing i see~~
08:23:14PMunchAh, that could be nice. But I find that "smart" indent often gets in the way unless it's done really well
08:23:24*rmt joined #nim
08:23:33FromDiscord<Rika> i should continue practicing actual touch typing should i lmao
08:23:42FromDiscord<Rika> because i use hybrid lmao
08:24:05leorizePMunch: it's done well :)
08:24:11FromDiscord<Elegant Beef> My left hand touch types but i use mostly my index and ring finger on my right
08:24:15Mister_MagisterPMunch: if i make second file should i import or include it
08:24:16PMunchWant a type-off? https://typing-speed-test.aoeu.eu/?lang=en
08:24:20FromDiscord<Rika> oh no
08:24:26FromDiscord<Rika> i can only do like 60
08:24:31PMunchMister_Magister, import
08:24:38FromDiscord<Rika> i aint a quick typer
08:24:44PMunchAnd mark things you want to export to other modules with *
08:24:45Mister_Magisterso * the shit out of every function… got it
08:25:05PMunchHaha, I mean you can include as well. But normally you'd do import and *
08:25:07*marmotini_ joined #nim
08:25:15FromDiscord<Rika> Mister_Magister, it depends on what the file's gonna be imported/included for
08:25:29FromDiscord<Varriount> @Rika I can type sentences quickly... But I still have to glance at the keyboard for numbers and special symbols
08:25:31*hax-scramper quit (Read error: Connection reset by peer)
08:25:46FromDiscord<Rika> oh i glance to reposition myself but after that i'm good
08:26:03leorizePMunch: I only get 71 wpm on my crappy laptop keyboard :P
08:26:04FromDiscord<Elegant Beef> i use the homing to reposition and average 70-80wpms
08:27:02PMunchRika, leorize, slow morning: Your score: 413 CPM (that is 83 WPM)
08:27:11PMunch0 mistakes ofc
08:27:15FromDiscord<Elegant Beef> im pretty much fucked without home row nibs 😄
08:27:39*rmt quit (Ping timeout: 240 seconds)
08:28:03PMunchElegant Beef, I'd like to have a Dvorak keyboard with the nibs. Never really got used to typing with them and I wonder how much of a difference it would make for me
08:28:08*hax-scramper joined #nim
08:28:12leorizegah I should get on a table :P
08:28:26FromDiscord<Rika> i did 280 on a weird typing angle
08:28:27FromDiscord<Elegant Beef> Soo anyone wanna explain the basis of reading from a stdout of process started in code?
08:28:41FromDiscord<Rika> 4 mistakes because my type of typing is prone to mistakes
08:28:48FromDiscord<Elegant Beef> Disruptek did suggest looking at his library, but i just wanna know the premise of what i should be doing
08:28:50PMunchMine would be where you have C and U, not the most optimal position for those..
08:29:09FromDiscord<Rika> i hone my left to wasd and i dont actually know where my right hand hones to
08:29:14FromDiscord<Rika> home
08:29:17FromDiscord<Rika> wrong word
08:29:27PMunch@Elegant Beef, well what do you want to know?
08:29:52*okcc joined #nim
08:30:24PMunchYou start a Process with startProcess, then you read from the outputStream by using anything in the streams module.
08:30:36leorizeok I give up: 370 CPM (that is 74 WPM)
08:30:38FromDiscord<Elegant Beef> Yes but since EOF isnt reached it freezes
08:30:46FromDiscord<Elegant Beef> I just got 417cpm or 83wpm
08:30:47*hax-scramper quit (Read error: Connection reset by peer)
08:30:49PMunchJust be sure to actually read output if it has any, otherwise I think it might fill up a buffer and stall the process on a write.
08:30:56leorizezero mistakes
08:31:11FromDiscord<Elegant Beef> Yea it's stalling my program as is
08:31:25PMunchWhat kind of read are you trying to do?
08:31:31PMunchAnd what kind of process are you reading from+
08:31:44FromDiscord<Elegant Beef> reading from a ncurses based cli application
08:32:05FromDiscord<Elegant Beef> Probably doing something wrong for my terminal 😄
08:32:10Mister_Magisterguys i want to return this from a function but i'm failiing to do so :C https://nim-lang.org/docs/db_sqlite.html#fastRows.i%2CDbConn%2CSqlQuery%2Cvarargs%5Bstring%2C%5D
08:32:23PMunchHmm, yeah that might be hard to consume..
08:32:25leorizeMister_Magister: return what?
08:32:34leorizethe Row or?
08:32:40leorizethe list of Row?
08:32:47FromDiscord<Elegant Beef> I tried multiple methods of reading and they tend to freeze it
08:32:51FromDiscord<Elegant Beef> Been testing with cmus
08:32:55*hax-scramper joined #nim
08:33:04*okcc_ joined #nim
08:33:24Mister_Magisterleorize: like put it inside function and then use function in for x in function instead of calling it directly
08:33:42leorizeyou'd want an iterator
08:33:45leorizenot a function :p
08:33:59Mister_Magisterye funciton returning iterator
08:34:08Mister_Magisteror am i mistaking something
08:34:14*okcc quit (Remote host closed the connection)
08:34:16leorizehow are you expecting to call it?
08:34:21PMunchHmm, "Your score: 448 CPM (that is 90 WPM)", but that was with 2 mistakes..
08:34:27leorizelet iter = function(); for x in iter:
08:34:33Mister_Magisteroh okay
08:34:37leorizeor for x in function()?
08:34:55leorizeif the second, then you'd want to make an iterator
08:35:13PMunchFor the first you'd need a closure iterator
08:35:40FromDiscord<Elegant Beef> But yea i've tried using the stream.atEnd with a readLine, but that locks up cause it continues expanding the output i imagine
08:36:07Mister_Magisterleorize: PMunch: i'm confused now
08:36:10PMunchatEnd checks for EOF or stream.close I think
08:36:33Mister_Magistercan't i just return iterator that fastRows returns?
08:36:41PMunchSure
08:36:45PMunchShould work
08:36:54Mister_Magisterbut how
08:36:57alexande192heyy
08:36:58okcc_i want to catch SIGTERM in order to do clean stuffs before terminating, but i got some errors with the following code
08:36:58alexande192guyss
08:37:00alexande192morning
08:37:09PMunchMorning alexande192 :)
08:37:11okcc_hey
08:37:19okcc_import posix
08:37:19okcc_proc closeDisplay() =
08:37:19okcc_ echo "sig detected"
08:37:19okcc_when isMainModule:
08:37:19okcc_ signal(SIGINT, closeDisplay)
08:37:27PMunchPlease don't paste code into IRC..
08:37:38leorizeMister_Magister: it's better if you tell us your use case...
08:37:39okcc_Sorry
08:37:46Mister_MagisterPMunch: i made proc function*(): iterator = and assigned fastRows to result
08:37:50okcc_i'll not do that
08:38:22PMunchOh, fastRows is an iterator
08:38:28leorizeokcc_: https://nim-lang.org/docs/posix.html#onSignal.t%2Cvarargs%5Bcint%5D%2Cuntyped
08:38:44PMunchThen you'd probably need to wrap that in a closure iterator to return it
08:39:18Mister_Magistero…oh…
08:39:22PMunchI don't really have a DB to try with..
08:39:24leorizePMunch: since Mister_Magister is not fluent with Nim, I don't think we should recommend that until we know the actual use case
08:39:28Mister_Magisteri don't really follow
08:39:36okcc_leorize, thanks, so the signal function is not meant to be used by users?
08:40:24leorizeokcc_: you can use it, it's just not *that* simple
08:40:52leorizeMister_Magister: well how are you gonna use this function?
08:40:57leorizelike an use case for it?
08:41:16okcc_it needs a Sighandler at position 2, meanwhile the Sighandler is not exported in posix
08:41:17Mister_Magisterleorize: i want to get all rows from database and then use/display them all
08:41:39okcc_anyway, thank you
08:42:08Mister_Magisterleorize: i wanna move getting rows from here to separate file https://github.com/Michal-Szczepaniak/lenislaw/blob/master/bot.nim#L648
08:42:16leorizeokcc_: that's probably a bug
08:42:19Mister_Magistershould explain
08:42:22leorizeyou should file it on the issue tracker
08:43:48PMunchMister_Magister, returning iterators: https://play.nim-lang.org/#ix=2dWh
08:43:58*dddddd quit (Ping timeout: 265 seconds)
08:44:00Mister_Magisterleorize: cause if i'm moving db to db module then i wanna move everything db related there
08:44:54okcc_leorize: maybe, lol
08:45:21leorizeMister_Magister: so you want something like: for cmd in db.articles()?
08:45:38Mister_Magisterleorize: yes kinda
08:46:01Araqwill stream soon
08:46:03Mister_Magisterinstead of for cmd in db.fastRows(sql…
08:46:32Araqtopic: improvements for "goto based" exception handling
08:47:17alexande192o.O strange my nick
08:47:20leorize[m]Mister_Magister: https://play.nim-lang.org/#ix=2dWi
08:47:25alexande192not sure what happened PMuch
08:47:28*watzon quit (Quit: Ping timeout (120 seconds))
08:47:51*watzon joined #nim
08:47:52PMunchMister_Magister, then you can just write your own iterator around fastRows: https://play.nim-lang.org/#ix=2dWj
08:47:52Mister_Magisterleorize[m]: oh thank you!
08:48:03*opal quit (Ping timeout: 240 seconds)
08:48:06PMunchHaha, yeah, that
08:48:18Mister_MagisterPMunch: thanks but leorize[m] has cleaner solution :)
08:48:51PMunchHaha, it's the same solution :P
08:49:02Mister_Magisterexcept it doesn't compile :P
08:49:10Mister_Magisterneither of those solutions
08:49:14PMunchUnless you're referring to my first one where I return a closure iterator
08:49:23*leorize quit (Ping timeout: 240 seconds)
08:49:33Mister_MagisterPMunch: yeah
08:49:46PMunchMine compiles on the playground. Not sure what you did to put it into your code..
08:49:46alexande192is this the same speed
08:49:52Mister_Magisterleorize[m]: Error: 'yield' only allowed in an iterator
08:50:11PMunchalexande192, yeah how did you end up with replacing the r with a 1
08:50:20Mister_Magistersame applies for PMunch then :P
08:50:32leorize[m]Mister_Magister: well... did you change iterator to proc?
08:50:49Mister_Magisteroooooooh didn't see that one!
08:51:02PMunchHaha :P
08:51:02Mister_Magistersorry :D
08:51:24leorize[m]read this to understand iterators :P https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement
08:52:24*okcy quit (Read error: Connection reset by peer)
08:52:31Mister_Magisterthank you guys!
08:52:40*okcy joined #nim
08:52:41*okcc_ quit (Remote host closed the connection)
08:53:38*okcc joined #nim
08:57:49*opal joined #nim
08:59:23*leorize joined #nim
08:59:37Mister_MagisterPMunch: leorize[m]: putting your teachings into use https://github.com/Michal-Szczepaniak/lenislaw/commit/1c351e5e700512cb0fd067abd3dfec3d2f5ddf27
09:00:02Mister_Magisternow gotta fix heresy
09:00:40leorizenow that's a good first step
09:00:51Mister_Magister:)
09:02:33leorizeI also notice a lot of try-except-discard
09:02:55leorizethere's tryExec() for that :P
09:05:19Mister_Magisterleorize: link?
09:06:03leorizehttps://nim-lang.github.io/Nim/db_sqlite#tryExec%2CDbConn%2CSqlQuery%2Cvarargs%5Bstring%2C%5D
09:06:03Mister_Magistercan't find it
09:07:12Mister_Magisterleorize: but that's only for db and i find only one case where i could use it
09:07:34*okcc_ joined #nim
09:07:59*okcy quit (Remote host closed the connection)
09:08:07*okcy joined #nim
09:08:40leorizewait except IOError?
09:08:44leorizethat doesn't sound right
09:09:10Mister_Magisterye but that's not db
09:09:59leorizewell I would be concerned if you're discarding IOError :P
09:10:10*okcc quit (Ping timeout: 256 seconds)
09:10:22Mister_Magistershhhh :D
09:10:40leorizethe IOError might have come from your threaded-async attempt :P
09:11:09leorizeasyncdispatch is not designed for it
09:11:26Mister_Magisterleorize: it's because if i try to delete message without having permissions to do so it throws io error even tho i checked for permissoins ealier :C
09:12:37*marmotini_ quit (Remote host closed the connection)
09:12:51leorizewait they actually throw IOError?
09:13:09*marmotini_ joined #nim
09:13:42leorizeyep https://github.com/ba0f3/telebot.nim/blob/2da3f0d8e9821b3aa6626251ee6edba0bd9ef78a/telebot/utils.nim#L185
09:13:55Mister_Magisterye
09:14:28leorizeI don't think that's the kind of error meant for IOError, but gotta deal with whatever cards you're dealt with I guess
09:14:46Mister_Magisteryeah
09:15:03Mister_Magisterso nim stable is 0.20 and i need 1.0.4
09:15:27leorizenim stable is 1.0.6 btw
09:15:44Mister_Magisterhmm choosenim you liar
09:16:47*floppydh joined #nim
09:17:42*marmotini_ quit (Ping timeout: 258 seconds)
09:26:30lqdev[m]ah yes, choosenim downloads the old version again!
09:26:53Mister_Magisteri need to update nim package for opensuse again
09:27:01Mister_Magisteri actually helped fixing it
09:27:31ldleworkI always forget you can use italics in IRC.
09:27:53Mister_Magisterand colors (idk how tho)
09:27:59ldlework and colors!
09:28:39Mister_Magisterand unicode 👌👌👌👌👌
09:28:50ldleworkbut no gifs :(
09:28:56Mister_Magisteror images :(
09:30:43Mister_Magisterlatest nim in repo is… 0.19.6
09:31:23Mister_Magistertho latest on obs is 1.0.2 https://build.opensuse.org/package/show/devel:languages:misc/nim
09:32:20Araqhttps://www.twitch.tv/araq4k
09:32:25*dwdv joined #nim
09:33:09Mister_Magisterhttps://paste.opensuse.org/74652436 hecc those latest libs!
09:33:16Mister_Magisterthey never work :C
09:35:07Mister_Magisterpoll async is only in newer telebot but i can't compile it fml
09:36:39lqdev[m]Idlework: nice to know that the bridge converts formatting from matrix to mIRC codes or whatever they were called
09:38:28Mister_Magisterany idea anyone?
09:42:05leorizelqdev[m]: that's a new feature
09:42:34FromDiscord<djazz> audio echo on the stream Araq
09:44:31*couven92 joined #nim
09:51:05*couven92 quit (Read error: Connection reset by peer)
09:51:31*couven92 joined #nim
10:00:18Mister_Magisterholy shit PMunch leorize the asyncCheck stuff works!
10:01:33FromDiscord<Rika> congrats
10:01:44Mister_Magisterthanks
10:02:26*okcy quit (Remote host closed the connection)
10:02:48Mister_Magisterhttps://github.com/Michal-Szczepaniak/lenislaw/commit/75b33f5d867b2e8e4117a9cccc8b72134882e1cf
10:03:20*okcy joined #nim
10:04:45dwdvAda related question: There's the strutils.HexDigits constant for manual inclusion checks, but does nim also support type decls like the following?
10:04:47dwdvsubtype hex is character with static_predicate => hex in '0'..'9' | 'a'..'f' | 'A'..'F';
10:05:23PMunchHooray! (sorry, had to go to the dentist for a bit there)
10:05:53PMunchdwdv, kinda
10:06:12Mister_Magisterleorize: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim can i make callback so that when process finishes my callback gets called and it sends video using telebot?
10:06:20alexande192oh i hope the dentist went well
10:06:24alexande192kinda scared of dentists
10:06:50PMunchMe too, but it went well. They had sent me an appointment by accident :P So I just came in, said hi, and left again
10:06:57Mister_Magisterdentists are pure evil, the more you go to them the less you need to go to them but the less you go to them the more you need to go to them
10:07:21PMunchI hadn't been to the regular dentist for 6 year, but I had no holes or anything
10:08:12PMunchThis is actually the orthodontist (sp?) because I had braces when I was younger (still have them on the back of my teeth) and we're discussing actually fixing it
10:08:19FromDiscord<Rika> i dont know why the fuck everyone hates going to the dentist
10:08:49FromDiscord<Rika> the only thing i hate about going to the dentist is the sound the scratchy thing they use to clean off plaque has
10:09:26PMunchWell, when you've been tortured as much as I have at the dentist it tends to leave a bad taste in your mouth (pun intended)
10:09:45lqdev[m]*laughs in exceptionally durable teeth*
10:09:45PMunchI didn't mind going to the dentist as a kid
10:09:52PMunchAnd I'm getting over it slowly
10:10:09PMunchlqdev[m], my teeth are just fine, it's my jaw that's messed up..
10:10:16lqdev[m]oof
10:10:24FromDiscord<Rika> whats the issue with your jaw
10:10:29PMunchBasically I have a clinical underbite
10:10:45FromDiscord<Rika> i had that as a kid, gone by teen years
10:10:48PMunchSo my front teeth meet instead of the lower ones going behind the top ones
10:10:51lqdev[m]yeah mine's a little crooked
10:11:02lqdev[m]but nothing too serious
10:11:07dwdvPMunch: what should I be looking for in the stdlib/manual regarding the type declaration? Skimmed over the manual, any keywords I could look up?
10:11:15PMunchSo they started pulling teeth and putting on various braces and expandors to try and fix it
10:11:27FromDiscord<Rika> mine're fine except for some insane cavities i somehow/mysteriously got
10:11:46FromDiscord<Rika> read the whole thing 😄
10:12:02PMunchBut through a series of unfortunate events they messed it up and it didn't help at all.. So now I'm stuck with a slight fear of dentists and no improvement (yay)
10:13:25PMunchdwdv, well Nim doesn't support declaring that as a type. What you could do is declare a distinct char and write a `converter` to it that throws an error if it isn't in the set {'0'..'9', 'a'..'f', 'A'..'F'}.
10:14:14dwdvAh, I see. Okay, thank you.
10:14:49PMunchAlternatively you could declare an enum (potentially with size: 1 to make them byte-compatible) and accept that
10:14:55PMunchThis could of course be written as a macro
10:18:26PMunchdwdv, example of the converter method: https://play.nim-lang.org/#ix=2dWD
10:18:38dwdvSure, but I would still have to manually check all over the place, right? Will look into operator overloading.
10:19:06PMunchNope, the converter will try and convert any character to a HexDigit if you pass them
10:19:30PMunchA converter is essentially a way to make Nim able to automatically convert between types
10:19:35dwdvBut ada explodes on foo := 'z'.
10:19:42dwdvWould like to replicate that.
10:20:09PMunchSo does my example: https://play.nim-lang.org/#ix=2dWE
10:20:19PMunchOn runtime though
10:20:46Mister_Magister!eval echo "test"
10:20:49NimBottest
10:22:32Mister_Magister!eval import httpclient, htmlparser; let client = newHttpClient(); loadHtml(client.getContent("https://nim-lang.org/docs/htmlparser.html"))
10:22:35NimBotCompile failed: /usercode/in.nim(1, 70) Error: expression 'loadHtml(getContent(client, "https://nim-lang.org/docs/htmlparser.html"))' is of type 'XmlNode' and has to be discarded
10:22:47Mister_Magister!eval import httpclient, htmlparser; let client = newHttpClient(); discard loadHtml(client.getContent("https://nim-lang.org/docs/htmlparser.html"))
10:22:55NimBot/usercode/in.nim(1) in↵/playground/nim/lib/pure/httpclient.nim(961) getContent↵/playground/nim/lib/pure/httpclient.nim(956) get↵/playground/nim/lib/pure/httpclient.nim(932) request↵/playground/nim/lib/pure/httpclient.nim(907) request↵/playground/nim/lib/pure/httpclient.nim(876) requestAux↵/playground/nim/lib/pure/httpclient.nim(791) newConnection↵Error: unhandled exception: SSL support is not available. Cannot connect over SSL. ...
10:23:05PMunchThe playground where that code is running don't have internet
10:23:10Mister_Magistergeez
10:23:14Mister_Magisteranyway
10:23:19Mister_Magisterthis code isn't working
10:23:34Mister_Magisterspits ioerror on me :<
10:23:51dwdvPMunch: Oh sweet, "unhandled exception: Character 'z' must be a hexadecimal digit [ValueError]". That should do, thanks again! Completely overlooked converters.
10:23:57muffindrakeHow would I write a wrapper for echo? Even something as simple as printing a timestamp before passing the actual arguments to echo?
10:24:06Mister_MagisterPMunch: could you help?
10:25:09Mister_Magisterit loads html just fine but loadHtml throws ioerror
10:26:13PMunchmuffindrake, write a proc that takes varargs[string, `$`] and pass the arguments to echo.
10:26:43PMunchMister_Magister, isn't loadHtml expecting a file? I think what you want is parseHtml
10:26:50Mister_Magisterohhhh
10:26:52Mister_Magistermakes sense
10:27:42Mister_Magisterye works now
10:28:01muffindrakeHm, I see. By 'arguments', did you mean 'argument', since that proc (and echo itself in the definition) has technically only one argument?
10:28:29muffindrakeproc echo*(x: varargs[typed, `$`])
10:29:19Mister_MagisterSIGSEGV: Illegal storage access. (Attempt to read from nil?) oh me oh my
10:30:59FromDiscord<Rika> wtf
10:31:29FromDiscord<Rika> so i just discovered why my code was taking time even when async was used, the lib i was using wasnt fully async
10:31:49PMunchmuffindrake, yeah argument is right. It takes in something which behaves pretty much like a sequence.
10:32:12PMunchMister_Magister, ouch..
10:32:19PMunchWas that without -d:release?
10:32:30PMunchOr I guess -d:danger nowadays
10:33:51FromDiscord<Rika> okay, i was wrong
10:34:11FromDiscord<Rika> how do you determine what's bottlenecking my async code ;;
10:34:20FromDiscord<Rika> how do you determine what's bottlenecking / async code ;;
10:34:33FromDiscord<Rika> ah forgot discord doesnt send s/// code
10:34:41FromDiscord<Rika> damn it sorry
10:34:53Mister_MagisterPMunch: i think attrs is nil and example isn't checking that
10:35:45Mister_Magisteryep i'm right
10:36:05*couven92 quit (Read error: Connection reset by peer)
10:36:29*couven92 joined #nim
10:36:30Mister_MagisterPMunch: instead of a.attrs.hasKey in example https://nim-lang.org/docs/htmlparser.html#examplecolon-transforming-hyperlinks i used https://nim-lang.org/docs/xmltree.html#attr%2CXmlNode%2Cstring
10:36:33Mister_Magistersaved me one if even
10:38:27Mister_MagisterPMunch: i'm now wondering how to extract text from node…
10:39:13PMunchrawText or innerText I'd assume
10:39:25PMunchIsn't the output an XMLNode? https://nim-lang.org/docs/xmltree.html
10:39:48Mister_Magisterthanks! innerText works
10:39:58PMunchRika, well by instrumenting your code somehow..
10:40:02PMunchbrb, lunch
10:40:05Mister_Magistercouldn't find it
10:41:17Mister_Magistercan i hae some array i can append stuff to?
10:47:26FromDiscord<Rika> PMunch, ah man...
10:53:47FromDiscord<Rika> my asynccheck-called procs are running immediately
10:53:54FromDiscord<Rika> i still dont know why
10:54:24FromDiscord<Rika> (theyre invoked within an async proc so poll is being called too)
11:01:05*couven92 quit (Read error: Connection reset by peer)
11:01:29*couven92 joined #nim
11:04:05*couven92 quit (Read error: Connection reset by peer)
11:04:31*couven92 joined #nim
11:12:47PMunchMister_Magister, a seq?
11:13:34PMunchRika, well yes why wouldn't your async procedures run immediately?
11:13:48Mister_Magister PMunch ye i already got it
11:18:20FromDiscord<Rika> PMunch because it's doing a network request, and i thought asyncCheck shouldnt context switch?
11:20:01PMunchasyncCheck will probably run your code until the first await statement
11:20:22FromDiscord<Rika> and then?
11:21:01PMunchAnd then?
11:21:19PMunchThen the asyncdispatcher will get control back and hand it over to anything else that's registered
11:22:44FromDiscord<Rika> AH
11:22:47FromDiscord<Rika> it clicked
11:22:50FromDiscord<Rika> okay
11:33:26PMunchAsync really isn't that hard once you realise how it works :P
11:34:22FromDiscord<Rika> well i get how async await works just asynccheck doesnt work as i though
11:36:02PMunchAh, IIRC it just works by attaching a callback that checks for errors
11:36:23FromDiscord<Rika> i thought asynccheck returns immediately?
11:36:38alexande192guys
11:36:52FromDiscord<Rika> ?
11:37:07*cgfuh joined #nim
11:37:11alexande192i generated a type with integer and CallCountKind field where CallCountKind*: Eq, GtOrEq, LsOrEq, Gt, Ls
11:37:23alexande192do you think this is a good idea in general
11:37:47alexande192to represent int more generally in cases where one might need to show approximate values
11:38:01Mister_MagisterSince now i have runForever, can i make timer that will run every 5 minutes and call callback async?
11:38:16FromDiscord<Rika> i dont see why not
11:38:28alexande192e.g. a = Int64(>= 10)
11:38:42alexande192something like that
11:38:48FromDiscord<Rika> prolly an async proc with a while true loop that has `await sleepAsync 5*60` then the callback
11:39:00FromDiscord<Rika> that might work ^ mister_magister
11:39:29Mister_Magisterwhile true loop? doesn't look sane to me
11:40:04FromDiscord<Rika> what do you mean sane lmao
11:40:37Mister_Magisteri already have waitForever and it calls my async callbacks…
11:40:55Mister_Magisterleorize: PMunch: ideas?
11:41:24PMunchWell, the addTimer feature seems like a perfect match: https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback
11:42:44FromDiscord<Rika> okay so after some thinking
11:43:10PMunchalexande192, not really sure what you're talking about there..
11:43:17Mister_MagisterPMunch: and it will connect to my runForever?
11:43:18FromDiscord<Rika> it doesnt make sense for asyncCheck to return immediately because "maybe people want this to run in the correct order" or something i dont know
11:43:22FromDiscord<Rika> im still somewhat baffled by this
11:46:31PMunchYup, it is a feature of the asyncdispatch
11:47:48PMunchWell that's how co-operative multitasking works. You run when you get told to, and control only switches when you tell it to.
11:47:53*rockcavera joined #nim
11:51:11FromDiscord<Rika> okay so how do i "queue" something
11:51:36FromDiscord<Rika> instead of it running immediately, it runs after the function already running finishes
11:55:50*lritter joined #nim
11:58:21PMunchAttach a callback to it
11:58:48FromDiscord<Rika> uh
11:58:52FromDiscord<Rika> 😅
11:58:54FromDiscord<Rika> how?
11:58:56PMunchBasically the first example in the asyncdispatch module documentation
11:59:00FromDiscord<Rika> okay thanks
11:59:50FromDiscord<Rika> wait, what's the difference of me doing that and asyncCheck then?
12:00:02FromDiscord<Rika> asyncCheck's code is literally just that isnt it?
12:00:04PMunchWhat do you mean?
12:00:28FromDiscord<Rika> asyncCheck attaches a callback to the future right?
12:00:34PMunchMhm
12:00:50FromDiscord<Rika> then why would me doing it manually have different behavior to asyncCheck
12:01:03PMunchIt wouldn't, if you use the same callback
12:01:34FromDiscord<Rika> i mean regards it running immediately and running after the calling proc finishes
12:01:35PMunchasyncCheck is just a convenience so you don't `discard` void futures :P
12:02:03PMunchOh, there's no difference to that
12:02:30PMunchAh, I misunderstood what you meant
12:03:03FromDiscord<Rika> ah
12:03:04PMunchI guess maybe callSoon could help
12:03:15PMunchThat would run it on the next dispatch
12:03:20alexande192i think asyncCheck should also do something about errors
12:03:27alexande192so its not just the same as discarding
12:03:46alexande192we were supposed to forbid direct discarding eventually
12:03:49PMunchYeah, it raises exceptions raised by the future
12:03:53FromDiscord<Rika> uh so how do i 😅
12:03:57FromDiscord<Rika> how do i use callSoon
12:04:01FromDiscord<Rika> with a Future[T
12:04:11alexande192and also forbid waitFor in {.async.}
12:04:33FromDiscord<Rika> > forbid waitFor in {.async.}
12:04:33FromDiscord<Rika> you'd make the discordnim developer mad LOL /s
12:04:37PMunchcallSoon takes a proc
12:05:33alexande192Rika well i used waitFor in one of my async modules for a long time as well
12:05:43alexande192and i think it wasnt a good idea
12:06:12FromDiscord<Rika> it definitely isnt, i'm just saying that the discordnim module has a lot of waitFor despite it being "async"
12:06:21FromDiscord<Rika> had to change it a lot to fix it up
12:06:35alexande192well, thats kinda fault of our stdlib indeed
12:06:45alexande192if we dont make it a hard error, people will use it
12:07:02PMunchWell waitFor certainly has its uses
12:07:09PMunchMostly to turn async into non-async though
12:07:25PMunchI think what async/await really needs is more tutorials and such
12:07:32alexande192no PMunch that's not what i mean
12:07:38alexande192waitFor is ok *outside* of async
12:07:49alexande192but not inside
12:07:50alexande192https://github.com/nim-lang/Nim/issues/11911
12:07:51disbotMake usage of waitFor in {.async.} compile time error
12:08:19alexande192basically i need to fix my port of yglukhov's await-as-a-template
12:08:36PMunchAren't there any reason to use it?
12:09:00alexande192and then do the waitFor error on top i guess
12:09:24alexande192PMunch well, why would you use it inside
12:09:30PMunchRika, what is it actually you're trying to do?
12:09:54PMunchalexande192, I dunno, but I guess there is some usecase for it
12:10:23FromDiscord<Rika> maybe i'm thinking of this wrongly
12:10:31PMunchProbably :P
12:10:33FromDiscord<Rika> maybe i do need threading now
12:10:40FromDiscord<Rika> argh! threading! what a pain
12:10:44PMunchAgain, what are you doing?
12:10:57FromDiscord<Rika> so i have an event loop watching for events
12:11:21alexande192PMunch i think somewhere in the docs they were forbidden
12:11:22alexande192also https://forum.nim-lang.org/t/3920
12:11:29FromDiscord<Rika> when an event is emitted, i do some stuff (irrelevant) and conditions and when something meets that condition, i make a network request
12:11:30alexande192it seems they are forbidden in the nim book
12:11:43FromDiscord<Rika> i want to make that network request not interfere with the event loop
12:12:00alexande192basically if you can think of a good contra-argument, i'd love it of course
12:12:11*lopofsky joined #nim
12:12:15FromDiscord<Rika> but i do not know how to determine whether its being interfered with
12:12:25*marmotini_ joined #nim
12:14:03PMunchI mean, it will interfere some
12:14:15PMunchThat's just the nature of async
12:14:22FromDiscord<Rika> i mean that's fine, as long as it aint 100 fuckin milliseconds
12:14:33alexande192is the network request slow?
12:14:36FromDiscord<Rika> no clue
12:14:47alexande192i mean, why is it slowing your whole event loop down?
12:14:57FromDiscord<Rika> no clue (2)
12:15:09PMunchIt seems like you're trying to optimise something without really knowing what is actually slow
12:15:13alexande192what i mean is how you profile it
12:15:20FromDiscord<Rika> to be totally fuckin honest i have no clue if my code is correct
12:15:27alexande192to make sure where is the time spent
12:15:28FromDiscord<Rika> PMunch, yes
12:15:39FromDiscord<Rika> i dont know if it's slow so i'm just assuming it is
12:15:51alexande192well, i guess it might be possible to measure it
12:15:56FromDiscord<Rika> but i'd really like to know how to determine it being slow
12:16:23PMunchYeah, before trying to optimise something you should first figure out if there is something to optimise, and what is actually worth optimising
12:16:43FromDiscord<Rika> i mean i dont know how i have no clue on how to determine that
12:17:16PMunchWell, the easiest is to throw in some timing statements and echo them out
12:17:20*lopofsky quit (Quit: Leaving)
12:17:44PMunchOr use a profiler, but I'm not sure how well they work with Nims async..
12:18:03alexande192well you can always just profile the raw event loop calls
12:18:05PMunchSince it essentially rewrites everything :P
12:18:31FromDiscord<Rika> yeah the loop does stop for a few hundred milliseconds
12:18:38alexande192you can figure out whats happening its mostly something like poll (? or something else i forgot) => series of funAsync, funIter etc
12:19:15alexande192so you have to see where exactly its stopping
12:19:16FromDiscord<Rika> this is gonna drive me insane i swear ;;
12:19:23alexande192its possible that you invoke e.g. a blocking syscall
12:19:33alexande192which still blocks your async call
12:19:45alexande192i wanted to make that detectable somehow as well
12:19:47PMunchRika, what do you mean stop the loop? The loop stops every time something gets executed..
12:20:03PMunchWait, what Nim version do you use?
12:20:28*okcc_ quit (Quit: Leaving)
12:20:34alexande192but its much harder: maybe user-defienable "block cost/functions" primitive annotations
12:21:05FromDiscord<Rika> 1.0.6 and i know it stops the loop
12:21:05*couven92 quit (Read error: Connection reset by peer)
12:21:07FromDiscord<Rika> really
12:21:10FromDiscord<Rika> im pretty confused now
12:21:19FromDiscord<Rika> i dont know what the hell im saying really
12:21:29*couven92 joined #nim
12:21:37alexande192do you have a repor
12:21:39alexande192repro*
12:21:52alexande192it would be easiest to just look at it
12:22:19FromDiscord<Rika> no i dont
12:22:30FromDiscord<Rika> ill ask another time maybe
12:22:49PMunchOf course it stops the loop, again that's how async works..
12:23:04FromDiscord<Rika> i know it does i know
12:23:10*marmotini_ quit (Remote host closed the connection)
12:23:19FromDiscord<Rika> what im saying i think is that it does it for too long
12:23:46*marmotini_ joined #nim
12:24:03*couven92 quit (Read error: Connection reset by peer)
12:24:30*couven92 joined #nim
12:28:41PMunchRika, by the way if you want a sneak peak at my article: http://ix.io/1Xyc/
12:28:41*marmotini_ quit (Ping timeout: 268 seconds)
12:29:04PMunchErr, remove the last slash there to get a readable version..
12:33:24alexande192rika well you just have to find out what call happens when it stops
12:33:56*s4mu3lbk joined #nim
12:34:33PMunchYeah, add some carefully positioned echos, and possibly some time measurements around in your calls
12:34:56PMunchWould be nice if asyncdispatch had a debug mode for this kind of stuff actually
12:40:00FromDiscord<Rika> dat formatting tho
12:40:27FromDiscord<Rika> PMunch, alexande192, i shall
12:40:36FromDiscord<Rika> still being driven insane though
12:40:42PMunchRika, what do you mean?
12:40:57PMunchAs I said, remove the last / from that link in order to actually get sane formatting
12:41:38FromDiscord<Rika> yeah i didnt read that
12:41:40FromDiscord<Rika> i did
12:41:45FromDiscord<Rika> and i shall take a look
12:43:57*s4mu3lbk quit (Ping timeout: 240 seconds)
12:44:19FromDiscord<Rika> actually the "formatted" version is still hard to read, ill read this some other time when im not sick perhaps
12:49:45alexande192take some rest man
12:53:05*natrys joined #nim
12:55:19PMunchBest way to fix bugs when you are sick, rest and wait until you're healthy :)
12:59:18*endragor quit (Remote host closed the connection)
13:03:22*solitudesf quit (Quit: Leaving)
13:03:33*marmotini_ joined #nim
13:18:29*abm joined #nim
13:22:05*okcc joined #nim
13:23:30*nsf quit (Quit: WeeChat 2.7)
13:39:43PMunchWho wrote => in sugar?
13:40:59FromDiscord<mratsim> it's old
13:41:02FromDiscord<mratsim> older than me
13:41:37FromDiscord<mratsim> also now it's quite picky, you now often need to explicitly put the type (since 0.18 iirc)
13:42:02PMunchOh really? That's what I was wondering, how on earth it worked so well :P
13:43:57FromDiscord<Rika> `git blame`
13:44:25PMunchThe module had been renamed
13:44:36PMunchBut yeah, it turns out that Dominik wrote it back in 2014
13:51:07disruptek!last zevv
13:51:08disbotZevv spoke in 12#nim 7 hours ago
13:52:01PMunchOh cool, neat feature!
13:52:05FromDiscord<Rika> how many hours ago though
13:52:23PMunchUhm, doesn't that come through Rika?
13:52:39PMunchOn IRC it says: Zevv spoke in #nim 7 hours ago
13:52:55disruptekpeople on discord or gitter don't get irc color/style formatting because dumb.
13:53:01PMunchdisruptek, is there a list of features somewhere?
13:53:27PMunchYeah but I thought it just stripped the colours, not removed the whole thing
13:53:29FromDiscord<Rika> it shows nothin o'er here
13:53:37FromDiscord<Rika> `<disbot> Zevv spoke in #nim hours ago`
13:53:52disruptekthe only ones not documented in !help are !tune and !last.
13:54:17disruptekthat's a simple bridge defect, then.
13:54:26FromGitter<kaushalmodi> !help
13:54:32aeverr !help
13:54:47FromDiscord<Rika> help does nothing?
13:54:52FromDiscord<Rika> didnt get a PM either
13:55:11disruptekyeah, discord/gitter users cannot receive PMs.
13:55:13FromGitter<kaushalmodi> I see this on Gitter: "*<disbot>* 9Zevv spoke in #nim 77 hours ago"
13:55:13disruptek~notes
13:55:14disbotnotes: 11https://gist.github.com/disruptek/41100bf20978de9a3cff55b23fcfe44e -- disruptek
13:55:22disrupteksome docs in there.
13:55:40disrupteki guess i will put the help in a footnote.
13:56:05aeverrdisruptek, i just sent here though (i'm Rika)
13:56:07FromDiscord<Rika> aeverr's me
13:56:14disruptek!help
13:56:24disruptekworks for me.
13:56:29aeverr!help
13:56:36aeverrworked on the second try
13:57:40disrupteki guess we should fix the bridges.
13:58:14disruptek!last shashlick
13:58:14disbotshashlick spoke in 12#nim 9 hours ago
13:58:15FromDiscord<Rika> what do you think yardanico's doing hahaha
13:58:40disruptekol' shashlick has some pretty advanced bridging.
14:02:55*okcy quit (Remote host closed the connection)
14:03:23PMunchaeverr, you had a space before your ! on the first try :)
14:03:39*okcy joined #nim
14:03:50PMunch!last PMunch
14:03:51disbotPMunch joined 12#nim 6 hours ago
14:04:05PMunchHuh, so if you are here it says when you joined
14:04:06PMunchNeat
14:04:38PMunchAlthough a spoke as well would be better
14:04:48PMunch!araq
14:04:53PMunch!last Araq
14:04:54disbotAraq never seen.
14:05:01PMunchUhm..
14:05:15PMunch!last dom96
14:05:15disbotdom96 never seen.
14:05:23PMunch!last disbot
14:05:24disbotdisbot joined 12#nimsec 10 hours ago and last spoke 710 hours ago
14:05:34PMunch(sorry by the way if that pinged you guys..)
14:06:18*PMunch quit (Quit: Leaving)
14:06:36*PMunch joined #nim
14:10:00disruptek!last PMunch
14:10:00disbotPMunch joined 12#nim 6 hours ago
14:10:05disruptekthat's a bug.
14:10:48disrupteki don't bother tracking people that have no events. but, ar4q should have events.
14:10:56disruptekand obviously, you spoke.
14:11:08disruptek!last Rika
14:11:08disbotRika spoke in 12#nim 9 hours ago
14:11:18disruptekwtf
14:11:48disruptek!last disruptek
14:11:49disbotdisruptek spoke in 12#nim 35 seconds ago
14:12:15*NimBot joined #nim
14:12:17disruptek!last nimbot
14:12:17disbotNimBot spoke in 12#nim 3 hours ago
14:12:29disruptek!last Elegant beef
14:12:30disbotElegant Beef spoke in 12#nim 6 hours ago
14:12:40PMunchHmm, does Nim have some similar convention to how Ruby uses ! for procedures that mutate their input?
14:13:04*dddddd joined #nim
14:13:04disrupteknot afaik.
14:13:24disrupteki guess i will debug this in the morning stream.
14:15:34disruptekit's not identifying existing users correctly, which is bizarre.
14:16:42AraqPMunch, don't return a value and assume people read the docs
14:17:40disrupteki'm an idiot.
14:19:05*couven92 quit (Read error: Connection reset by peer)
14:19:30*couven92 joined #nim
14:20:12PMunchAraq, yeah I wanted to have two versions of a proc, one that returned a new version, and one that modified in place
14:20:30PMunchWhich in ruby would typically be named "replace" and "replace!"
14:20:36Araqonly provide the inplace version and use 'dup'
14:21:09PMunchDup?
14:21:15Araqnew in 1.2
14:21:43PMunchAh..
14:24:03*couven92 quit (Read error: Connection reset by peer)
14:24:22disruptek!last nimbot
14:24:22disbotNimBot joined 12mail.nim-lang.org 12 minutes ago
14:24:26*couven92 joined #nim
14:24:30disruptek!last pmunch
14:24:31disbotPMunch spoke in 12vpn.dualog.com 11 minutes ago
14:24:41disrupteklol
14:24:55PMunchHaha, wrong field?
14:25:30disruptekparser snafu.
14:25:45disruptekgah, such a simple feature. so buggy.
14:25:48disruptek!last pmunch
14:25:49disbotPMunch spoke in 12#nim 13 minutes ago
14:25:53disruptek!last nimbot
14:25:54disbotNimBot joined 12#nim 13 minutes ago
14:26:23disruptek!last s4mu3lbk
14:26:24disbots4mu3lbk quit 7102 minutes ago and last spoke 7 hours ago
14:27:15disrupteki only write this shit late at night, so it's pretty terrible.
14:28:03PMunchHaha, an entire project written while half asleep. Don't see how that could ever go wrong :P
14:28:34disruptekoh the bot is a mess. but i realized before i implemented this feature that i could use it to demonstrate generics.
14:28:55disruptekso i wrote it just like radio and i will refactor them on-stream to explain how that works.
14:29:23disruptekradio == tune
14:29:35PMunchAah, I see
14:30:14disruptek~news is the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages.
14:30:14disbotnews: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages.
14:30:26*marmotini_ quit (Remote host closed the connection)
14:30:59*marmotini_ joined #nim
14:34:01PMunchAraq, is there a dup alternative in 1.0?
14:34:09PMunchdeepCopy?
14:35:14*marmotini_ quit (Ping timeout: 240 seconds)
14:39:05PMunchAh, for me copyNimTree does the trick
14:42:39Araqjoin #nim-news
14:43:47AraqPMunch, I'll probably write an compat nimble package so that you can use 'dup' with 1.0
14:47:07Mister_Magister!eval import parseutils; parseInt("123")
14:47:09NimBotCompile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <string>
14:47:24Araqimport strutils instead
14:47:38Mister_Magister!eval import strutils; parseInt("123")
14:47:41NimBotCompile failed: /usercode/in.nim(1, 26) Error: expression 'parseInt("123")' is of type 'int' and has to be discarded
14:47:45Araqjeezzz, how hard is to follow tutorials or browse our docs
14:47:52Mister_MagisterAraq: i was!
14:47:57Mister_Magisterhttps://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint
14:48:45Mister_Magister!eval import strutils; discard replace("123,123", ",", "").parseInt()
14:48:49NimBot<no output>
14:48:54Mister_Magisterhmpf
14:48:56Araqthe examples all call this proc with more than one argument
14:49:03Mister_Magisterwhy is it not working :C
14:49:52Araq!eval import strutils; echo replace("123,123", ",", "").parseInt()
14:49:57NimBot123123
14:50:24Mister_Magisterno that's not what i mean
14:51:39Mister_Magister!eval import strutils; discard replace("121,738", ",", "").parseInt()
14:51:42NimBot<no output>
14:51:45Mister_Magisterugh
14:52:17Mister_Magisterhttps://paste.opensuse.org/c4c3aa41 it just won't work :C
14:53:31Mister_Magister!eval import strutils; discard replace(" 121,738 ", ",", "").parseInt()
14:53:35NimBot/usercode/in.nim(1) in↵/playground/nim/lib/pure/strutils.nim(1100) parseInt↵Error: unhandled exception: invalid integer: 121738 [ValueError]
14:53:41Mister_Magisterah yes .strip
14:53:58Araquse strscans instead
14:54:13alexande192hm strange
14:54:21alexande192do you try to parse?
14:54:36alexande192Araq, good work on `panics`
14:54:37Mister_MagisterAraq: what do you mean?
14:55:01alexande192why not a user defined set of panics though: i think there such an idea: dont remember by whom(disruptek?)
14:55:52Araqimplementation complexity
14:56:23AraqI thought about exposing sysFatal as system.panic and then you can handle these via "recover" but it doesn't really solve the problem
14:56:54Araqas in the "recover" you want to use a "raise" and so the backend must assume that every bug can be caught
14:57:22Araqthe only benfit that we have 'try except' vs 'recover' in the language
14:57:55Araqbut we can already filter inside 'except' so it's pure sophistry in my book
14:58:15disruptekagreed.
14:58:45disruptekwhat about simpifying the implementation thusly:
14:59:05disruptekone can add a define to cause the named exception to abort.
15:00:54Araqwe used to have a "raise hook" for that
15:03:44*marmotini_ joined #nim
15:04:24Araqbut nobody ever used it and it introduces composition problems
15:04:54Araqsay you say "die on ValueError" and then you use a library that uses strutils.`%` and catches the ValueError...
15:06:22disrupteki consider that a feature.
15:06:32disruptekisn't that the exact semantic that we want?
15:06:56Araqin no version of Nim is a ValueError a "Defect"
15:07:15disruptekthen don't "die on ValueError", silly.
15:07:36Araqso it's not the semantic that I want. I only care about Overflows and out-of-memory really
15:08:05Araqas they are prevalent
15:08:07disruptekthen you define what those are and then allow the hook only on that class of exception.
15:08:21Araqwe already have an outOfMemHook
15:08:55Araqbut again, inside this hook you might want to raise an exception.
15:09:05disruptekokay, so you want to tell status to pound sand.
15:10:21Araq--panics:on is a good compromise for me
15:10:32AraqI'll see what the others have to say
15:10:37*nsf joined #nim
15:11:01disruptek!rfc panic
15:11:02disbothttps://github.com/nim-lang/RFCs/issues/180 -- 3Introduce safety modes
15:11:23disruptekahh
15:13:08Araqwhat we should probably do though is to make 'except:' mean 'except (not Defect)'
15:13:21Araqand if you want to catch defects you shall write 'except Defect'
15:13:59*drewr quit (Ping timeout: 260 seconds)
15:14:32Araqand we can produce a warning for 'except Defect' in combination with --panics:on
15:14:52Araqas it's meaningless
15:15:01disrupteka warning sounds right.
15:15:26disruptekis there a scenario where code won't compile with panics:on?
15:17:14*hax-scramper quit (Ping timeout: 240 seconds)
15:17:31Araqno.
15:17:44*hax-scramper joined #nim
15:18:03disruptekcool.
15:18:49disruptekdoes the exception hierarchy change?
15:19:35Araqno.
15:19:46*PMunch quit (Quit: Leaving)
15:20:14disruptekisn't it broken?
15:20:26AraqI'll add a warning though for Foo* = object of Exception
15:21:05disrupteki guess that works.
15:22:00disruptekso `except Exception` magically crashes on Defects.
15:22:05disruptekwith panics.
15:22:20Araqyup
15:22:52disrupteksounds great to me.
15:25:20AraqI still wonder if panic/recover APIs are not slightly better because more explicit
15:25:31Araqbut then they wouldn't fix empty 'except' clauses
15:25:51disruptekthe problem is that different users want different semantics for the same code.
15:26:04Araqif I do use 'raise' inside 'recover' then I need to be able to use 'except'
15:26:08disruptekthat's why i suggested the compiler opts.
15:26:58AraqI still want .quirky as a pragma though
15:27:14disruptekthen someone can just put themselves in a state where they are recovering to have open exception access.
15:27:47*marmotini_ quit (Remote host closed the connection)
15:28:02*marmotini_ joined #nim
15:28:11*drewr joined #nim
15:30:34okccif i want to select x11 events, what type should i use in newSelector[T], any help? thks
15:31:04okcci have a x11 display file descriptor which is cint
15:31:37*sacredfrog joined #nim
15:32:24okccall in one, i just want this c code (https://stackoverflow.com/questions/8592292/how-to-quit-the-blocking-of-xlibs-xnextevent) achieve in Nim
15:33:39shashlicki use matterbridge for my bridging - what's needed?
15:33:40disruptekthe type you use is that of your monitor.
15:34:05disruptekit's the payload that you pass around.
15:34:07okccnow i can only get empty seq from select() https://nim-lang.org/docs/selectors.html#select%2CSelector%5BT%5D%2Cint
15:34:37*jholland__ joined #nim
15:35:01disruptekthere's an example in golden.
15:35:20disruptek!repo golden
15:35:21disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 16⭐ 0🍴
15:35:28disrupteksee the src/golden/invoke.nim
15:36:12FromDiscord<mratsim> btw you should probably add your inputs here @disruptek: https://github.com/nim-lang/Nim/pull/13617
15:36:15disbotnew std/timers module for high performance / low overhead timers and benchmarking (formerly system/timers include) ; snippet at 12https://play.nim-lang.org/#ix=2dY3
15:37:01disrupteki don't know anything about benchmarking.
15:37:40FromDiscord<mratsim> yeah just like Araq doesn't know anything about compiler or GC 😉
15:38:10disruptekseriously, golden is crude as fuck.
15:38:48disruptekit just happens that a lot of people want to do async process i/o in the stdlib and that's the definitive example afaik.
15:39:22okccthanks, disruptek, i'm checking it out
15:39:29disrupteki really want to finish it, though.
15:41:07Araqwhen the optimizer has to assume every proc can fail at least we can use the mechanism to handle OOM without further overheads
15:41:42disruptekokcc: you can ignore the benchmarking crap, but obviously you can't really ignore the selectors stuff. also note that there's a fd leak in the signalling. iirc two workarounds are documented in the code (toggled with a define).
15:42:21disruptekbut i don't think you have to worry about that with x11 fd.
15:43:13alexande192mratsim :)
15:43:31alexande192whats happening with your compiler
15:43:40alexande192i want to start working on one of my ideas eventually
15:45:31disruptekgreat; that's coincidentally when mratsim's compiler will be ready.
15:46:06Araqor mine... :P
15:46:41*nsf quit (Quit: WeeChat 2.7)
15:47:06alexande192disruptek :))
15:49:21FromDiscord<mratsim> my compiler has been delayed by cryptography and fighting the absolutely horrible GCC codegen for bigints
15:50:29FromDiscord<mratsim> I think I can have a nice elliptic curve crypto lib in Nim in about 3 months, and there is big desire for such.
15:51:49FromDiscord<mratsim> when I say big desire, people are working full-time on template metaprogramming/generics in Go (LOL): https://github.com/ConsenSys/goff/blob/master/cmd/internal/template/element/mul.go
15:52:30FromDiscord<Recruit_main70007> just use Nim lmao
15:55:21FromDiscord<mratsim> I'm using Nim, but somehow, the go compiler is better than GCC for big integer implementation
15:55:31YardanicoI wonder why people use AGPL https://github.com/Ethosa/yukiko https://github.com/Ethosa/shizuka :(
15:55:49YardanicoAGPL basically makes it impossible to use these libs in the projects which are not open-source (even if they're web apps)
15:57:44FromDiscord<Varriount> AGPL is good for actual pieces of software. Not so much for libraries
15:58:00Yardanicothat's my point as well
15:58:48FromDiscord<mratsim> define "actual" 😛
15:59:19lqdev[m]@mratsim programs
15:59:45FromDiscord<mratsim> all my programs are libraries
16:00:42lqdev[m]apps
16:00:47lqdev[m]I meant
16:01:09Yardanicowell I don't really see why would anyone use AGPL for libs unless they're an open-source libre fanatic
16:01:32Yardanicoit's stricter than GPL
16:04:49disrupteki was attracted to it.
16:04:49lqdev[m]I can't even think of using the regular GPL for libraries
16:06:31*sz0 quit (Quit: Connection closed for inactivity)
16:06:33alexande192well it makes sense if you really want to .. not let it be used for commercial purpose
16:06:53Yardanicowell I talked with Ethosa and told why AGPL is not that good for oss libs :P
16:07:53alexande192otherwise i usually use MIT i think, but i can imagine gpl-like stuff being useful
16:24:02FromDiscord<mratsim> GPL makes sense if you want to monetize but still be open-source
16:24:29FromDiscord<mratsim> even for libraries, it takes time to maintain good libraries
16:24:39FromDiscord<mratsim> (thinking of FFMPEG for example)
16:26:08disruptek~stream
16:26:09disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
16:31:55Araqok, new overflow handling is almost done
16:36:09FromDiscord<mratsim> do you use __builtin_add_overflow and __builtin_sadd_overflow?
16:36:54FromDiscord<mratsim> or rather __builtin_add_overflow_p / __builtin_sub_overflow_p / __builtin_mul_overflow_p
16:36:58FromDiscord<mratsim> https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
16:37:52Araqyup
16:38:18Araqbut I don't use inline asm anymore, too much trouble
16:38:34AraqVCC doesn't really support it and the others have builtins I can use
16:39:08FromDiscord<Kiloneie> I've seen a good example on using a procedure while having imported 2 modules that both contain that procedure, does anyone have a link or something, i need a good example, i am trying to show this naming conflict and how to fix it, but what i've done the compiler fixes it by itself...
16:39:21Yardanicomodulename.procname()
16:39:41Yardanicoif you import module a and module b which both have the same proc "c" with same arguments, you can call it like a.c() or b.c()
16:41:01*solitudesf joined #nim
16:41:31FromDiscord<Kiloneie> i know that, but i am trying to recreate an error while having both imported
16:41:48Yardanicoif you want to recreate an error, you need to have two procs with the same name AND arguments
16:42:00Yardanicofrom two modules
16:47:14FromDiscord<Kiloneie> Is there any example of when having multiple modules imported, it will simply crash trying to use a same named procedure ? Otherwise i have to explain this by forcing a crash like you said.
16:47:37disruptekdo so.
16:48:14Yardanico@Kiloneie if you mean stdlib - these conflicts are pretty rare, even strutils/unicode was fixed (by adding Ascii to strutils variants)
16:48:27Yardanicoah actually
16:48:33Yardanicosplit from strutils/unicode
16:48:46FromDiscord<Kiloneie> i tried strutils and seutils and compiler does the work
16:49:21YardanicoI mean this https://play.nim-lang.org/#ix=2dYo
16:49:37Yardanicosplit with no arguments
16:49:43*okcc quit (Ping timeout: 265 seconds)
16:50:15FromGitter<Varriount> Araq: I like the new defects feature
16:50:17FromDiscord<Kiloneie> Perfect thanks. I assume this will be fixed in the future right ?
16:50:20Yardanicono, why?
16:50:38Yardanicoyou just have to specify either or exlude split from one of the modules when importing
16:51:10FromDiscord<Kiloneie> i know, i am just asking so i explain this right, so the video holds up.
16:51:28Yardanicowell I think this is correct behaviour
16:51:34FromGitter<Varriount> Araq: panics:on still works with range checks, right?
16:51:52Araqrange checks are turned into panics then
16:52:46FromDiscord<Kiloneie> Say the ones that have been fixed, wouldn't be fixed when my video aired, and then they would be, which would nullify the explanation if i didn't mention that it could be fixed in the future.
16:53:14Yardanicowell you're creating videos for nim 1.x right?
16:53:26Yardanicoeven if the proc names will change these version will still be kept in 1.x for backwards compat
16:53:28Yardanicoso don't worry
16:53:30FromGitter<Varriount> Araq: But the panic will always occur? There won't be the chance to read garbage data?
16:53:34FromDiscord<Kiloneie> right now i am still on 1.0.0
16:53:39*okcc joined #nim
16:53:49AraqVarriount: that depends on --rangeChecks:on/off
16:53:56Yardanicocode you write for nim 1.0.0 is supposed to work on any future nim 1.x release
16:54:30FromGitter<Varriount> Araq: Assuming range checks are on
16:54:36FromDiscord<Kiloneie> Okay good,(i did read some of the debate that came after 1.0, so i wasn't sure)
16:54:55Yardanicowell I'm not sure i'm 100% correct but I think it works like that :P
16:56:42FromDiscord<Kiloneie> Yeah well it should hold up for a while, and if some X day someone tells me on a video that it's not working, then i will just do a quick edit on that video, or MAYBE even redo it. I have planned redos of several videos anyways once i do get some money to buy better audio gear. #1 will get a big redo, and 2-6 need font changes, which requires a whole redo.
16:57:58*okcc quit (Remote host closed the connection)
16:58:19*okcc joined #nim
16:59:08AraqVarriount: well then the panic will occur, yes
16:59:36AraqKiloneie: mention that Nim version X can emulate version 1.0 via --useVersion:1.0
17:00:15FromDiscord<Kiloneie> Hmm okay, will do.
17:01:20FromDiscord<Kiloneie> Btw looking at the unicode module, are runes special characters of different languages ?
17:01:29Yardanicothey're unicode characters
17:01:30FromDiscord<Rika> just a unicode character
17:01:33FromDiscord<Rika> any character
17:01:42Yardaniconim strings are bytes, if you do stringvar[0] you get first byte in the string
17:01:47FromDiscord<Rika> be it another language character or ascii
17:01:50Yardanicoif you want to operate on unicode characters (runes) you need unicode module
17:02:30FromDiscord<Kiloneie> Huh okay, not norse mythology then xD...
17:02:38Yardanicolol
17:02:56FromDiscord<Rika> lol
17:03:46*Trustable joined #nim
17:12:13federico3Yardanico: a lot of components around the activitypub are under AGPL
17:13:42FromDiscord<treeform> Does any one know why --d:release in nim.cfg seems to have no effect?
17:13:51Yardanicowhat effect?
17:14:00Yardanicowhen compiling it should say "release build" in the end
17:14:03FromDiscord<treeform> same as it does on the command line
17:14:05Yardanicoif it's applied
17:14:22leorizeit depends on where you put it
17:14:42leorizethe code that handle -d:release is in the global system config
17:15:03leorizeuser configs are read later in the process
17:15:27leorizeso by the time it reads user configs, whatever -d:release resolves to have already been decided
17:15:28FromDiscord<treeform> leorize, oh that explain it. Do you know how I make it do what I want?
17:16:46Araqinline what the default nim.cfg does for -d:release
17:19:07FromDiscord<treeform> So my issue, I am making a game, but it runs to slow without -d:release, I don't think it's nim's stuff thats making it slow. Maybe all I need to do os make the C compiler optimize more.
17:19:35Yardanicowell you just put -d:release in your project's nim.cfg
17:19:36lqdev[m]@treeform --opt:speed?
17:19:52leorizeYardanico: that won't work
17:19:52Yardanicoit should work the same as -d:release in cmdline if you're compiling the same file and that nim.cfg is in the same folder with the code file
17:20:06Yardanicoleorize: why?
17:20:21lqdev[m]because the nim.cfg in the distribution is processed first
17:20:25lqdev[m]then the project's nim.cfg
17:20:30lqdev[m]so it won't have any effect
17:20:44lqdev[m]because -d:release is a thing from the distribution's nim.cfg
17:21:06Yardanicoah right I remember it now
17:21:14Yardanicosorry
17:21:29lqdev[m]@treeform I found that --opt:speed increases speed dramatically, --stacktrace:off even further, but you probably want stacktraces on during development
17:21:55Yardanicohttps://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L72 for -d:release
17:23:31FromDiscord<treeform> Thank you Yardanico, leorize, lqdev[m], Araq for helping me with this. I'll try out --opt:speed, I actually do want the nim's development features. I now understand how the config works.
17:36:25*solitudesf quit (Remote host closed the connection)
18:00:57*okcc quit (Ping timeout: 258 seconds)
18:04:38*okcy quit (Ping timeout: 265 seconds)
18:06:56*okcy joined #nim
18:08:13*rmt joined #nim
18:24:17alexande192guys
18:24:35alexande192ops* sorry wrong room
18:24:56*alexande192 is now known as alexander92
18:39:06*leorize quit (Quit: WeeChat 2.7.1)
18:41:49*nsf joined #nim
18:43:42*Trustable quit (Remote host closed the connection)
18:47:34*hoijui joined #nim
18:48:11*dddddd quit (Ping timeout: 260 seconds)
18:48:35*dddddd joined #nim
18:53:32*floppydh quit (Quit: WeeChat 2.7.1)
18:55:58FromDiscord<Kiloneie> Why can't i do the commented out part https://play.nim-lang.org/#ix=2dZ4 , do you need to have the imported module when using the except keyword on it's own line ?
18:56:35Araqbecause except takes a comma separated list of identifiers for itself
18:56:52Araqimport strutils except split, toLowerAscii # see?
18:57:19FromDiscord<Kiloneie> ah okay
19:01:15*hoijui quit (Ping timeout: 272 seconds)
19:08:02*rockcavera quit (Remote host closed the connection)
19:12:31*clyybber joined #nim
19:14:27*rockcavera joined #nim
19:21:04clyybberAraq: Was there a time where nim had no echo?
19:21:25clyybberBecause I'm seeing `when declared(echo):` in extccomp.nim
19:22:12Araqit's a workaround for a NimScript config bug
19:22:23Araqwhere it ended up not having echo, or something.
19:22:52clyybberdoes that bug still exist?
19:25:15*Jesin quit (Quit: Leaving)
19:26:46*thomasross joined #nim
19:26:48*rmt quit (Ping timeout: 265 seconds)
19:27:05*Jesin joined #nim
19:30:09AraqI doubt it
19:30:19Araqif it does, the CI will notice
19:31:16clyybberOk
19:31:46clyybberAraq: Another thing, should an explicit --hint:CC:on for example override --verbosity:0 ?
19:33:54Araqoh who cares
19:34:48clyybberI dunno, I just wonder what is intended
19:34:55clyybberso I can write the code accordingly :p
19:35:20*silvernode joined #nim
19:35:46*alexander92 quit (Ping timeout: 256 seconds)
19:37:35shashlickYay nimterop newalgo is now in head so I can develop in parallel!
19:37:40shashlickFeature flags ftw
19:38:24silvernodejust added a bunch of prototype code to space nim, those of you who are part of the project, I will be online around 0600 UTC for around an hour to work on it some more if anyone will be awake then.
19:38:33silvernodeUntil then goodnight
19:38:38*silvernode quit (Client Quit)
19:42:58*Vladar quit (Quit: Leaving)
19:47:55*alexander92 joined #nim
19:50:19*Jesin quit (Quit: Leaving)
19:52:14FromDiscord<Kiloneie> I can't figure this out: https://play.nim-lang.org/#ix=2dZJ
19:53:01FromGitter<kaushalmodi> Kiloneie: A char is only 8 bits
19:53:17FromGitter<kaushalmodi> so ž probably fit in a char. It probably needs to be a string
19:53:34Yardanico@Kiloneie as kaushalmodi said, nim "char" type is only for ASCII characters (because one ascii character = 1 byte)
19:53:44FromDiscord<Kiloneie> i commented out the string version though...
19:53:47FromDiscord<Kiloneie> also errors..
19:55:11*Jesin joined #nim
19:55:20Yardanico@Kiloneie the one with echo is erroring because unicode split accepts a Rune or sequence of runes, not a string
19:56:28FromGitter<kaushalmodi> Kiloneie: https://play.nim-lang.org/#ix=2dZN
19:57:38FromGitter<timotheecour> @Clyybber are you here? just PM’d you
19:58:00FromDiscord<Kiloneie> huh, thanks, i didn't know how to make a rune, didn't think there was a proc for that
19:58:16FromDiscord<Kiloneie> should of looked better D:
19:58:45*enthus1ast quit (Ping timeout: 240 seconds)
19:58:47FromDiscord<Kiloneie> this video is getting split into 2 parts... i didn't expect this much complexity
20:01:34FromGitter<kaushalmodi> now what's confusing me is that `echo "Hello Worldž!".split("ž".toRunes)` works.. but
20:01:50FromGitter<kaushalmodi> this doesn't: `echo "Hello Worldž!".split("ž".runeAt(0))`
20:02:27FromGitter<kaushalmodi> ^^ see https://play.nim-lang.org/#ix=2dZP
20:04:21FromDiscord<Kiloneie> yeah... no idea either, it works and then it doesn't
20:05:15FromGitter<kaushalmodi> use Rune splitter doesn't work.. but using seq[Rune] splitter works
20:06:21dwdvCurious about another niche feature: do we have something similar to dlang's opDispatch which get's called with the function name as a template string when it can't find any valid dispatch? This allows glsl-like swizzling for example: https://github.com/d-gamedev-team/gfm/blob/master/math/gfm/math/vector.d#L240
20:06:32dwdvgets*
20:06:53Yardanicothere's `.` operator which is a bit similar
20:07:08Yardanicohttps://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators
20:07:15FromDiscord<Kiloneie> no it works
20:07:17Araqyeah, but don't use it, it's bad. so is opDispatch btw
20:07:42dwdvFite me on opDispatch!
20:07:52FromDiscord<Kiloneie> @kaushalmodi echo "Hello Worldž!".split("ž".runeAt(0)) works, try to comment it out
20:08:14FromGitter<Clyybber> @timotheecour answered
20:08:25dwdvThanks for the link, Yardanico!
20:12:13*arecaceae quit (Remote host closed the connection)
20:12:37*arecaceae joined #nim
20:12:37*ptdel joined #nim
20:13:38FromGitter<kaushalmodi> Kiloneie: This fails for me, on devel too: https://play.nim-lang.org/#ix=2dZT
20:16:25FromGitter<kaushalmodi> Kiloneie: https://github.com/nim-lang/Nim/issues/13628
20:16:27disbotunicode.split does not work when using a Rune separator ; snippet at 12https://play.nim-lang.org/#ix=2dZU
20:16:40FromDiscord<Kiloneie> yeah it fails
20:17:36FromDiscord<Kiloneie> if you use runeAt(1) is weird
20:17:48FromDiscord<Kiloneie> both ž and ! is gone
20:18:21*hoijui joined #nim
20:32:18disruptekAraq: aws api signing broken again on devel.
20:32:38Araqwith ARC?
20:32:52*nsf quit (Quit: WeeChat 2.7)
20:33:30disruptekyeah.
20:34:59*hoijui quit (Ping timeout: 272 seconds)
20:40:06disruptek~stream
20:40:07disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
20:42:48disruptekhttps://travis-ci.org/github/disruptek/sigv4/jobs/661254990
20:42:53disruptekaws signing ^
20:45:28FromDiscord<Varriount> Has anyone implemented this: https://github.com/lemire/fast_double_parser
20:45:31FromDiscord<Varriount> ?
20:47:41*tdc joined #nim
21:02:19*solitudesf joined #nim
21:07:18*solitudesf quit (Read error: Connection reset by peer)
21:07:26*filcuc joined #nim
21:07:46*solitudesf joined #nim
21:16:31*narimiran quit (Ping timeout: 265 seconds)
21:28:23clyybberAraq: I rebased https://github.com/nim-lang/Nim/pull/13606, it should be ready to merge once its green
21:28:24disbotMake listCmd honor hint:cc:off
21:34:33*Araq sighs
21:34:51Araqso C++ decided to tell my 255 cannot fit into a 'char'
21:35:14*tdc quit (Ping timeout: 240 seconds)
21:35:36Araqhow many centuries do we have to wait for C to understand what a byte is? and how on earth is this a "portable assembler".
21:35:58Araqevery assembler I ever used understands what a byte is
21:36:17*letto quit (Ping timeout: 268 seconds)
21:36:44Araqand before you say "yeah well use 'unsigned char' "
21:37:36Araqhow do I create string literals of unsigned chars conveniently? is (unsigned char*)"hello\0" guaranteed to compile?
21:40:21*filcuc quit (Quit: Konversation terminated!)
21:40:39*filcuc joined #nim
21:41:11FromDiscord<exelotl> is there a way to do superscript/subscript in restructuredtext?
21:41:50Araqyes, `text`:sup: iirc
21:51:31*letto joined #nim
21:52:02*tiorock joined #nim
21:52:02*tiorock quit (Changing host)
21:52:02*tiorock joined #nim
21:52:02*rockcavera is now known as Guest42096
21:52:02*Guest42096 quit (Killed (weber.freenode.net (Nickname regained by services)))
21:52:02*tiorock is now known as rockcavera
22:01:33FromDiscord<exelotl> oh cool that works, thanks
22:02:27*alexander92 quit (Ping timeout: 258 seconds)
22:08:26*krux02 joined #nim
22:08:27*watzon quit (Quit: The Lounge - https://thelounge.chat)
22:08:39*watzon joined #nim
22:12:13*watzon quit (Client Quit)
22:12:25*watzon joined #nim
22:14:04*watzon quit (Client Quit)
22:15:33*letto quit (Read error: Connection reset by peer)
22:15:59*rockcavera quit (Remote host closed the connection)
22:16:15*watzon joined #nim
22:16:32FromGitter<timotheecour> @araq is there anything else blocking https://github.com/nim-lang/Nim/pull/13351 ?
22:16:35disbotstacktraces can now show custom runtime msgs per frame ; snippet at 12https://play.nim-lang.org/#ix=2e0u
22:17:43AraqI don't know but I also don't like the feature
22:17:50*solitudesf quit (Ping timeout: 256 seconds)
22:17:55FromGitter<timotheecour> Why ?
22:17:57*letto joined #nim
22:18:16*alexander92 joined #nim
22:21:39Araqmore code we have to maintain, yet another feature, unclear how it can work for an LLVM backend
22:29:14FromGitter<timotheecour> 1) it’s super useful for debugging a program, making stacktraces a whole lot more useful and user-customizable (without compiler/stdlib support needed once this PR is merged); whether debugging compiler or debugging a user program; ⏎ 2) it’s in particular incredibly useful when your program parses another source (eg for parsers, compilers, etc) as it shows where you are both in parser as well as what’s
22:29:14FromGitter... being parsed ⏎ 3) other use cases are showing more user-customizable context when an exception is thrown ⏎ 4) llvm backend: not sure why this would introduce any complication, i’m not relying on OS-specific stacktrace mechanisms here; in any case, the feature is entirely opt-in [https://gitter.im/nim-lang/Nim?at=5e69663a47b42479253f82f5]
22:31:28Araqhow is 'var frameMsgBuf* {.threadvar.}: string' entirely opt-in?
22:31:48*matlock quit (Remote host closed the connection)
22:31:48*euantor quit (Remote host closed the connection)
22:31:48*Hotbees quit (Remote host closed the connection)
22:31:48*jholland__ quit (Remote host closed the connection)
22:32:53Araqinstead why not set the existing 'procname' to something else
22:33:02Araqextra points if it can stay a 'cstring'
22:33:40*euantor joined #nim
22:34:17FromGitter<timotheecour> I can add a `—stacktracemsgs:on/off`
22:34:33*Hotbees joined #nim
22:36:17FromGitter<timotheecour> > instead why not set the existing 'procname' to something else ⏎ ⏎ I have follow up work after this PR that makes `—stacktrace:on` faster for everyone and removes all these; it works; I can show the WIP if needed.
22:36:57Araqhow does it work?
22:36:58*matlock joined #nim
22:36:58*hsh quit (Read error: Connection reset by peer)
22:36:58*npgm quit (Read error: Connection reset by peer)
22:36:58*noonien quit (Write error: Connection reset by peer)
22:36:58*LyndsySimon quit (Remote host closed the connection)
22:36:58*d10n-work quit (Remote host closed the connection)
22:36:58*ng0 quit (Remote host closed the connection)
22:37:13Araq(and now don't say "it works well" :P )
22:37:51*jholland__ joined #nim
22:38:08FromGitter<timotheecour> let me open that WIP PR (it’s entirely compatible with nim-lang/Nim#13351 )
22:38:59*LyndsySimon joined #nim
22:39:19*npgm joined #nim
22:39:29*d10n-work joined #nim
22:40:40*NimBot joined #nim
22:41:05*hsh joined #nim
22:43:20*noonien joined #nim
22:45:43*ng0 joined #nim
22:46:18*matti quit (Read error: Connection reset by peer)
22:46:41FromGitter<timotheecour> I’ve opened the WIP here https://github.com/nim-lang/Nim/pull/13630 but *I recommend only looking at it if you’re curious how it works, it’s not cleaned up*; and yes it does work (at least at some intermediate commits); there are 2 parts (that could be split in 2 PRS): ⏎ ⏎ 1) 1st speedup: get rid of `TFrame` stack allocated data at beginning of each function, and get rid of linked list of PFrames;
22:46:41FromGitter... instead I simply use a single threadvar “index” into a UncheckedArray of TFrame that’s re-alloc’d as needed; it gives a nice 2X speedup in many cases ⏎ 2) 2nd speedup on top of it (still WIP but works): replace file/line/col/procname by a single index; this has implications for other uses cases (eg nimprof) making exception handl ... [https://gitter.im/nim-lang/Nim?at=5e696a5195b8ff0bbfad1c84]
22:46:42disbotFaster --stacktrace:on
22:47:00*jjido joined #nim
22:48:50FromGitter<timotheecour> > anyhow, can you make it a 'cstring'? constants are fine and with a little care you can ensure the string is from a buffer that is not freed to early ⏎ ⏎ let me try and get back to you; r u ok if i use `c_realloc`?
22:50:02*hax-scramper quit (Ping timeout: 240 seconds)
22:50:18*r4vi quit (Remote host closed the connection)
22:50:22*surma quit (Remote host closed the connection)
22:51:02*surma joined #nim
22:51:23Araqdepends, the memory management shouldn't be done in system.nim
22:51:32Araqbut instead the user of the API should do it
22:51:52AraqI think it's an acceptable tradeoff, special apis need special care
22:52:23*matti joined #nim
22:52:38FromGitter<Clyybber> @timotheecour How does replacing file/line/col/procname by a single index?
22:52:52FromGitter<Clyybber> Do you mean to store file/line/col/procname in an array?
22:53:56*r4vi joined #nim
22:55:42*natrys quit (Quit: natrys)
22:56:07*nuxdie quit (Remote host closed the connection)
22:56:08*msmorgan quit (Remote host closed the connection)
23:02:11*nuxdie joined #nim
23:03:16*filcuc quit (Ping timeout: 255 seconds)
23:03:19*msmorgan joined #nim
23:14:16FromGitter<timotheecour> in final version of that PR, i will encode in a single `int` what’s sufficient to reconstruct (file/line/col/procname / optional other data) in a compact way; ⏎ `Index: int = (fileIndex bits + procIndex bits + remaining bits for line/col)` (skipping some details)
23:17:10FromGitter<timotheecour> so that throwing exceptions (or collecting tons of stacktraces, eg in nimprof) incurs zero symbolization cost; the symbolization can be deferred to when it’s actually needed unlike what’s currently done in nim
23:18:14Araqsounds good. now if only I could draw your attention to ARC or IC or Z3 ;-)
23:18:50*NimBot joined #nim
23:19:00AraqClyybber: are you aware of my branch?
23:19:12AraqI implemented it but the regressions are *hard*
23:19:27clyybberYeah, I'm looking at it rn
23:19:32Araqanyhow, https://github.com/nim-lang/Nim/pull/13626 is really getting good
23:19:33disbotcatchable defects
23:20:12clyybbernice
23:20:12Araqfaster overflow handling and goto-based exception handling can deal with AssertError
23:20:17*watzon quit (Quit: The Lounge - https://thelounge.chat)
23:20:22clyybberAraq: How did you improve the overflow handling?
23:20:31*watzon joined #nim
23:20:31Araqread the PR
23:20:34clyybberk
23:21:52*lritter quit (Ping timeout: 256 seconds)
23:23:10clyybberoh so we use builtins
23:23:13clyybbernice!
23:24:19*abm quit (Read error: Connection reset by peer)
23:33:52Araqdisruptek, https://github.com/nim-lang/Nim/pull/13626/files#diff-e2da3621d8e2ee26a311f04b51a21322R11 lying comment!
23:33:52disbotcatchable defects
23:39:01clyybberheh
23:39:15clyybbergood night
23:39:30*clyybber quit (Quit: WeeChat 2.7.1)
23:48:42*hax-scramper joined #nim
23:49:45Araqtimotheecour: are you sure the growable array is better than our linked list?
23:50:01*NimBot joined #nim
23:50:05Araqmaybe the speedup comes from the fewer stores entirely
23:50:34Araq(you turn the (cstring, int) store into an (int) store afaict)