<< 16-11-2020 >>

00:03:03FromDiscord<nikki> this makes the first choice p uniform, and the second choice q uniform among the rest but ur just swapping the last value for q with p
00:04:48disruptekthere's a bug here; what is it?
00:04:52disruptekhttps://play.nim-lang.org/#ix=2Ek1
00:06:04disruptekzedeus: why do you care about submodules?
00:06:22zedeusI wish I didn't have to
00:06:35disruptekwhat does that mean?
00:07:05zedeusnimble installs your package by recursively cloning it. since submodules being pinned is just how git works, it clones an old commit of jason, since you didn't update the submodule
00:07:16zedeusif nimph just ignores how git works that's great, but it breaks nimble
00:07:52disruptekwell, i cannot reproduce your issue.
00:08:19disruptekfrosty runs CI and doesn't check out jason, for example.
00:08:23zedeusall it takes is `git clone --recursive https://github.com/disruptek/frosty`
00:08:36zedeusand you'll see that it checks out an old commit
00:09:22disruptekwell, i don't use that to develop modules. i use nimph. and i use nimble for CI.
00:09:32zedeusyeah, well then nimph is broken
00:09:47disrupteksure.
00:10:08disrupteknimph knows how to roll repositories and nimble is living in the dark ages, but okay, dude.
00:10:21zedeusit's just how git works, man
00:10:27disrupteki'm alright with it.
00:10:33zedeusso, are you going to update it?
00:10:41zedeusor should i find another package for serialization
00:10:46disrupteknah. i cannot see how to help you. try flatty.
00:11:28zedeusgit submodule update --remote --merge
00:12:03zedeusthen commit, tag, and push, and that's it
00:12:18disrupteksounds like too much work.
00:12:41miprithe less-work solution is to never use git submodules
00:13:21disrupteki think they are good.
00:13:32disrupteknimph-2 will use them extensively.
00:13:44zedeusdisruptek insists on using submodules with his nimble alternative, but unfortunately he isn't using them like git intended, so the rest of us has to suffer
00:14:02zedeusi guess it's a sneaky marketing ploy to force us to use nimph
00:14:16disruptekthere's only one user afaik, and that user is breaking my balls. as usual.
00:15:43zedeusone direct user, and tens of thousands of indirect users
00:15:51disruptektry flatty.
00:16:16zedeusguess I'll have to
00:16:45disruptekjason 0.3.2 is as up-to-date as i'm going to make it.
00:16:51disruptekif it works for you, great.
00:17:05zedeusjust one commit away from actually working
00:17:20disrupteki just pushed it, chucklehead.
00:17:35zedeusit's stil in frosty, not jason
00:17:56disruptekokay, 0.4.3 then.
00:18:14*thomasross joined #nim
00:18:22disruptekbut get used to this. we won't be pinning submodules.
00:18:28*Quibono quit (Remote host closed the connection)
00:18:33disruptekthat's not the interface that anyone wants to use.
00:18:38zedeusit's how git works.
00:18:46zedeusI guess I'll get used to not using your packages then
00:18:51disruptekit's fine.
00:18:57disruptekthere are many fish in the sea.
00:19:01disruptektry flatty.
00:19:10zedeusalong with all other nimble users
00:19:17disruptekyeah, fuck 'em.
00:19:45disrupteklife is too short to use nimble.
00:21:24mipricredibility nil when the only way to fix nimble here would be to add a bug to it.
00:21:52disruptekseems that a few hundred other people beat me to it.
00:22:42disruptekit's ridiculous to expect my package manager to use whatever version git is pointing to.
00:23:00disruptekthat's a recommendation, it's not an authority.
00:23:05mipriif you don't like git submodules, don't use them
00:23:21disruptekif you don't like working package management, don't use nimph.
00:23:22mipriyou using something that you only call git submodules is not liking them.
00:23:46disruptekthe reason nimph uses them is because they allow other tooling to identify links.
00:23:55mipriimagine anyone listening to this conversation and then thinking "I'd better depend on nimph. Sounds like that won't bite me in the ass later."
00:24:02zedeusincorrect links
00:24:17disruptekthey are only incorrect for /you/, chucklehead.
00:24:27zedeusthe links include a commit, that's the problem
00:24:50disruptekno, it's not.
00:25:05disruptekthe problem is that you don't have a package manager that understands how to roll your repo to the prescribed versions.
00:25:31disruptekwhat's the point of using git in nimble?
00:25:35disrupteknone.
00:25:44disruptekwhat's the point of using submodules when almost no one does?
00:25:45disrupteknone.
00:26:01disruptekwhat's the point of talking to me about nimble?
00:26:01zedeusso, actually following the links result in using the wrong versions, unless you use a custom solution (nimph) which ignore the commit that makes up half of the link. so why even use submodules?
00:26:02disrupteknone.
00:26:46zedeusthis isn't even about nimble
00:26:56disruptekbecause they allow tooling to discover links without having to invoke nim's vm.
00:26:58mipriyou're breaking your repos and then patching a workaround into nimph.
00:27:03disruptekuh, no.
00:27:12zedeusbasically
00:27:19mipriyou know what else can allow tooling to discover links? anything. a file. you don't need to misuse this dumb feature
00:27:19disruptekwhatever. don't fucking use my software, then.
00:27:25mipriI pray I never do.
00:27:54disruptekif the nim vm was faster, i wouldn't have to do this.
00:28:07disruptekif the configuration system was tighter and better standardized, i'd be able to use it.
00:29:33*hnOsmium0001 quit (Quit: Connection closed for inactivity)
00:35:51FromDiscord<nikki> Zoom: @ElegantBeef i believe this works: https://play.nim-lang.org/#ix=2Ek7
00:36:39FromDiscord<nikki> reason: first value `p` is picked normally. for the second one, we need to pick among N - 1 things, but we just replace `p` with the high of the range
00:58:06*Quibono joined #nim
01:10:22*vicfred quit (Quit: Leaving)
01:15:47*Tanger joined #nim
01:32:20*voltist quit (Quit: The Lounge - https://thelounge.chat)
01:34:16*Quibono quit (Remote host closed the connection)
01:34:21*voltist joined #nim
01:34:38*hnOsmium0001 joined #nim
02:15:02*apahl quit (Ping timeout: 264 seconds)
02:16:42*apahl joined #nim
02:24:04FromDiscord<Rebel> When using hmac sha256 in Nim how do I just get the bytes I do not want the string. (https://play.nim-lang.org/#ix=2EkI) Why do people who use Nim prefer using strings over byte arrays when dealing with cryptography?
02:24:42disruptekwhat makes you think there's a difference?
02:28:11FromDiscord<Rebel> well I just wasted like an hour debugging because I didn't realize he was returning the string which is length 64 when I need the raw bytes of length 32 because I am talking to Python apps in this instance... which caused HMAC verification to fail.
02:28:58FromGitter<sealmove> huh
02:29:16FromGitter<sealmove> so raw bytes are 32 but string has length 64? :P
02:31:19FromDiscord<Rebel> Sha256 is 32 bytes I was getting the string back from nimcrypto's hmac sha256 proc and converting to that to a byte array which would be size 64....
02:32:48FromDiscord<ElegantBeef> I'd imagine the reason is that you can use a string stream and easily write the data to send/encrypt, but there really is no difference so eh
02:46:13FromDiscord<Rebel> the answer was just to use the finish function
02:46:18FromDiscord<Rebel> (edit) "the answer was just to use the finish function ... " added "and use a buffer"
03:02:22FromDiscord<nikki> the type of `result` is `Digest[256]` and not `string ` right
03:14:10Zoom[m]disruptek I don't really get what you were trying to achieve, but your example doesn't give unique numbers, and Y is never Max
03:21:05FromDiscord<nikki> Zoom -- https://play.nim-lang.org/#ix=2Ek7 what do u think of this one
03:21:36Zoom[m]nikki I'll show you
03:25:58Zoom[m]https://imgur.com/a/kHYWPw9
03:26:03FromDiscord<nikki> the logic is (using a specific example so it's clearer): for 1..10 for example: the first number is picked from 1..10 as expected. say it picked 3. for the second number, the range is 1..9, but if you get 3 it maps to 10 instead. so the range for the second number is 1..2 union 9..10 which is what you want
03:26:34Zoom[m]What I can say is that your way gives distinctly different results than dumb rand in a loop
03:27:58FromDiscord<nikki> seems like they are both uniformly distributed? also it's hard to really evaluate this without being sure that the `rand` primitive being used has uniform results
03:28:21FromDiscord<nikki> like try generating pairs of (a, b) (without the a != b constraint) and seeing if that looks evenly distributed
03:29:56Zoom[m]You can see there's something off with your approach as we reach 1400 while with looping we're maxing at 1200
03:30:41FromDiscord<nikki> can't say for sure until i see the whole code generating these results
03:31:28FromDiscord<nikki> i'm wondering tho about the idea of having a unique id for each of these pairs and being able to just generate the id and generate the pair out of that back 🤔 would be interesting
03:32:39FromDiscord<nikki> like for the range 0-9 of 10 numbers, there are 10x10 - 10 results
03:32:42FromDiscord<nikki> i'll think about that approach
03:32:46FromDiscord<nikki> just curious / interested
03:36:05Zoom[m]I've added the control to the album.
03:36:09FromDiscord<ElegantBeef> I mean like i said nikki i did 100k samples with 0..10 and each value was around 9k, so it's pretty even atleast for the small 11 values 😄
03:40:31FromDiscord<Rebel> oh nikki if you are curious https://play.nim-lang.org/#ix=2EkY
03:40:53FromDiscord<Rebel> oops wrong one lol
03:40:59FromDiscord<Rebel> (edit) "https://play.nim-lang.org/#ix=2EkY" => "https://play.nim-lang.org/#ix=2EkP"
03:41:04FromDiscord<Rebel> there you go
03:41:17FromDiscord<Rebel> but my MAC check still fails on Python side 🙃
03:41:25FromDiscord<nikki> Zoom: given how the control looks, idk if this graphing approach is the right way to judge which things are uniform
03:41:29FromDiscord<nikki> it has to be by proof
03:41:42FromDiscord<nikki> but here's another approach: https://play.nim-lang.org/#ix=2El7
03:42:25FromDiscord<nikki> this one works in the 0..<n range, and what it does is map a space of integers to the pairs you want
03:42:55Zoom[m]It's pretty clear when the squares are all close in temp we're at uniform.
03:43:09FromDiscord<nikki> right, but the control doesn't look like that?
03:43:14*muffindrake quit (Ping timeout: 264 seconds)
03:43:34FromDiscord<nikki> so the methodology seems to suggest that just generating possibly equal integers is non-uniform
03:43:41FromDiscord<nikki> in any case wonder what you think of this last attempt
03:44:54FromDiscord<nikki> i can explain it better if you want. one way to visualize it is to look at the graphs you have, and imagine assigning numbers to each allowed square starting at 0 moving upwards along columns then to the next row
03:45:15*muffindrake joined #nim
03:47:24Zoom[m]Eh, I get strange results with the last approach
03:47:42Zoom[m]I'm too sleepy to understand why, though :)
03:48:02Zoom[m]https://i.imgur.com/oW3FDG3.png
03:48:24FromDiscord<nikki> because it's exclusive, not inclusive, as explained by the name of the parameter in the function
03:48:48FromDiscord<nikki> and also my comment about working in the 0..<n range
03:49:49FromDiscord<nikki> https://play.nim-lang.org/#ix=2El8
03:49:55FromDiscord<nikki> added a comment to the bottom explaining the logic
03:50:23Zoom[m]https://play.nim-lang.org/#ix=2El9
03:51:08FromDiscord<nikki> still don't understand why your graphs are helpful if the control looks like the least uniform example
03:51:11Zoom[m]Here's the code for generating the stats for the gnuplot.
03:52:30Zoom[m]They are comparable. At the very least they allow to catch buggy versions. :)
03:53:10FromDiscord<nikki> https://play.nim-lang.org/#ix=2Ela fixed explanation
03:53:39FromDiscord<nikki> but yeah if you want to try this final ^ one, you have to use randPairs(max + 1) sorry or that can be in the func i.e., `let n = param + 1`
03:54:07FromDiscord<nikki> but yeah the control is the least uniform thing in your graph. can you explain that 🤔 or are we just going to ignore it
03:54:18Zoom[m]I think I'm going to wrap up for tonight, please, ping me here if anyone continues with the topic. I think we should at least document this in the forum, as it's rather interesting
03:54:36FromDiscord<nikki> haha aite, ttyl!
03:57:34Zoom[m]nikki, this looks the same as loops
03:58:07FromDiscord<nikki> haha nice! also in the max substitution one -- it seems to have put 1400 as the top of the heatmap but doesn't actually color any of the grid cells yellow and makes them orange (which is 1200) 🤔
03:58:24FromDiscord<nikki> anyways the last one has the property that it only calls `rand` once, which maybe is nice
03:58:53FromDiscord<nikki> but it also means that you need to be able to call `rand` on a larger range than the input range (which may be a problem if it's eg. all of a big integer)
03:59:01Zoom[m]Updated the album with your second solution: https://imgur.com/a/kHYWPw9
03:59:16FromDiscord<nikki> thanks for trying them out!
04:00:15Zoom[m]I should probably have added the labels for each square
04:00:37Zoom[m]Thanks for the fun, I'm out.
04:00:42*rockcavera quit (Remote host closed the connection)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:33:19*thomasross quit (Ping timeout: 265 seconds)
04:59:30*apahl quit (Remote host closed the connection)
04:59:56*apahl joined #nim
05:04:33*xet7 quit (Remote host closed the connection)
05:06:29*vicfred joined #nim
05:11:14*vicfred quit (Client Quit)
05:13:50*NimBot joined #nim
05:14:13*xet7 joined #nim
05:15:59*narimiran joined #nim
05:52:00*solitudesf joined #nim
06:26:00*habamax joined #nim
07:01:37*waleee-cl quit (Quit: Connection closed for inactivity)
08:00:25*PMunch joined #nim
08:40:53*Vladar joined #nim
09:07:32*Tanger quit (Quit: Leaving)
09:16:46*Oddmonger quit (Ping timeout: 246 seconds)
09:19:33*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:29:41*Oddmonger joined #nim
09:33:14*Oddmonger quit (Changing host)
09:33:14*Oddmonger joined #nim
09:34:47*neceve joined #nim
09:38:39*xace quit (Ping timeout: 256 seconds)
09:58:48*lritter joined #nim
10:45:59ForumUpdaterBotNew thread by B3liever: A DSL to construct Nim AST based on karax, see https://forum.nim-lang.org/t/7098
10:49:09planetis[m]i just couldnt resist 😁
10:50:06AraqI love it
10:50:15Araqhad the same idea but never implemented it
10:52:59planetis[m]yay glad you like it
11:01:43AraqI would name it 'buildAst' though, 'buildMacro' doesn't build a macro
11:02:39Araqor maybe 'buildNimTree'
11:08:02planetis[m]yes buildAst is better
11:08:18planetis[m]similar to getAst
11:11:06FromDiscord<Rika> looks awesome damn
11:20:12*abm joined #nim
11:38:27*cgfuh joined #nim
12:03:35*rockcavera joined #nim
12:05:44*xace joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:34*supakeen joined #nim
13:01:15Zoom[m]Sooo, I've updated the pretty pictures: https://imgur.com/a/kHYWPw9
13:04:47Zoom[m]From what I see, there's not much difference in the outcomes for any routine except the coin toss, where my initial intuition proved to be correct - we have 1:2 total for both lower and higher "half" even though they contain different number of "bins". For others the standard deviation is fluctuating in 29-36 between program runs.
13:06:06Zoom[m]Gnuplot is fun, never used it before
13:07:33Zoom[m]The code: https://play.nim-lang.org/#ix=2EmY
13:08:29PMunchIsn't that control plot a bit worrying
13:09:15*Mortir joined #nim
13:11:08Zoom[m]Nope, look at the min, the colors are not consistent between images.
13:11:51PMunchI was more talking about the ~9x pooling around the bottom left and top right
13:12:22FromDiscord<Rika> i have no idea what im looking at
13:12:33PMunchOh wait, that's the Coin toss?
13:12:43Zoom[m]Yep
13:14:26ForumUpdaterBotNew thread by HJarausch: Real sets and tables anywhere? , see https://forum.nim-lang.org/t/7099
13:16:48Zoom[m]That's what I was talking about. We have 1:2 for the smaller part, if it's just one bin we have about half of the pairs there, and for other half we have 1:2/8=1:16 for each
13:18:24Zoom[m]So I think the rand_pair_b or rand_pair_c should be used
13:18:26ForumUpdaterBotNew thread by Bung: Amysql - Async MySQL Connector write in pure Nim., see https://forum.nim-lang.org/t/7100
13:19:25*hmmmm joined #nim
13:20:08hmmmmhallo
13:20:19hmmmmanyone home
13:20:37FromDiscord<Rika> hello
13:20:53Zoom[m]Hola!
13:20:54hmmmmI have a super newbie question
13:20:58FromDiscord<Rika> sur
13:20:59FromDiscord<Rika> e
13:21:04FromDiscord<Rika> ask away
13:21:21hmmmmI was trying to write a proc to get as a return type a tuple
13:21:58hmmmmI stumbled a lot but it seems the idiomatic way to do that is passing a var parameter and let the function manipulate that
13:22:10FromDiscord<Rika> you want to return a tuple?
13:22:18narimiranhmmmm: what's the problem with returning a tuple?
13:22:22hmmmmI find it weird and a bit disturbing and was looking to confirm that is the accepted way
13:22:50FromDiscord<Rika> its accepted but its also okay to return a tuple
13:23:09FromDiscord<Rika> `proc someProc(): tuple[a: int, b: int] =...` is okay
13:23:33hmmmmohh
13:23:55narimiran...or `proc someProc(): (int, int) =...`
13:24:14hmmmmI was trying something like tuple[a,b : seq[int]] or something incredibly bad like that
13:24:18FromDiscord<haxscramper> !eval var tmp: proc(): proc(): proc(): proc(): proc(): tuple[a: proc(), b: proc()]
13:24:22NimBot<no output>
13:24:37hmmmmI'm not used to pass a lot of stuff in the declaration since I come to python and I'm a total noob
13:25:06Zoom[m]From my point of view having var args accentuates the mutable nature of your proc, if you're not mutating it's better to return
13:25:11FromDiscord<haxscramper> Returning multiple things from function using tuple is perfectly fine. `tuple[a,b : seq[int]] ` has nothing wrong with it
13:25:17FromDiscord<Rika> i dont see why tuple[a,b : seq[int]] woudlnt work
13:25:23FromDiscord<Rika> it should
13:25:41narimiran..unless you're returning something else ;)
13:25:52FromDiscord<Rika> wrap it in another tuple 😄
13:26:44hmmmmok I'll re try it later since having a variable outside the scope of the proc that gets changed seems a bit out my confort zone
13:26:51hmmmmthanks all, see yall later
13:27:07Zoom[m]The question I think you should ask yourself first is what am I passing to a function and what am I doing with the data that I passed there
13:27:16*Mortir quit (Quit: leaving)
13:27:28*hmmmm quit (Remote host closed the connection)
13:42:17*hmmm joined #nim
13:42:45hmmmI'm back :o
13:46:24narimiranhmmm: where are the rest of "m"'s?
13:47:17FromDiscord<lqdev> he dropped one
13:50:38planetis[m]and i was wondering why he changed color (yes my client has bubble colors)
13:51:00PMunchMy client also has coloured nicks, be he somehow has the same colour with both of those
13:51:22narimirandifferent color here too
13:51:33FromDiscord<lqdev> it's all white for me
13:54:30ForumUpdaterBotNew thread by Gcao: Which one to choose, Asyncdispatch in Nim vs Chronos?, see https://forum.nim-lang.org/t/7101
14:13:30*Kaivo quit (Quit: WeeChat 2.9)
14:14:31ForumUpdaterBotNew thread by Zoom: Getting random non-equal int pairs, comparison of routines., see https://forum.nim-lang.org/t/7102
14:14:58*habamax quit (Ping timeout: 246 seconds)
14:15:44Oddmongeri import foo in a.nim , and then import a.nim in b.nim . How can i use «foo» in b.nim ?
14:16:09Oddmongerit seems that «foo» is only visible in a.nim
14:18:17narimiranOddmonger: `export`
14:18:32narimiranhttps://nim-lang.github.io/Nim/manual.html#modules-export-statement
14:20:15Oddmongerthank you
14:24:34hmmmI have another noob question
14:25:18FromDiscord<Rika> ask away
14:25:40hmmmoh rika hi!
14:25:58hmmmso I'm trying to nimify a python function exercise I made some time ago
14:26:20hmmmI have a recursive function that uses array, should I use @seq for the nim version?
14:26:30narimiranprobably
14:28:29hmmmhmm
14:28:40hmmmok and what if I have to slice that @seq?
14:33:43FromDiscord<notchris> morning Rika
14:33:46FromDiscord<Rika> theSeq[index1..<index2]
14:33:49FromDiscord<Rika> gm to you
14:35:22hmmmok I'm making progress
14:37:36hmmmhey rika my python fuction takes 2 parameters and returns 2, but my nim proc takes 2 but can only return one, so I can't call it recursively
14:37:49narimiranhmmm: show us your python code
14:38:24hmmmnari what is the accepted way of sharing code here
14:38:28FromDiscord<shashlick> Use a tuple return value no
14:38:34*cgfuh quit (Quit: WeeChat 2.9)
14:39:21narimiranhmmm: use my full nick (tab completion), otherwise i'm not pinged. ix.io is popular, but any code-pasting site will do
14:39:49*cgfuh joined #nim
14:40:11Zevvhmmm: use any paste thing, ix.io is popular here, you can also post it in nim playground
14:40:12narimiranhmmm: or you can even use https://play.nim-lang.org/ for non-nim code :)
14:40:23Zevvoh what narimiran says
14:40:41narimiranPMunch: are you around?
14:40:45Zevvif i wasnt engaged to disruptek yet id ask narimiran to marry me
14:41:13narimiranZevv: disruptek didn't turn you down? i'm disappointed in him!
14:41:28narimirani guess he *does* have a soft spot after all
14:41:46Zevvhe did but not on personal grounds, something about marriage in general I bet
14:41:58narimiranyep, that's more like him
14:42:04Zevvthe guy is one huge soft spot with a big mouth on it
14:42:27narimiran(no comment)
14:44:14narimiranany json-gurus around?
14:45:17Zevvwhat is there to guru about json
14:45:18narimiranto be more concrete: is the stuff at the end of line 2 valid json? https://play.nim-lang.org/#ix=2Enz
14:45:46narimiranthese commas after which is a closing bracket
14:46:11Zevvnoper
14:46:24Zevvcan't do that, because json
14:46:26Zevvjson is great
14:47:45narimiranZevv: ok, thought so. thanks!
14:49:10planetis[m]narimiran: hi can you merge https://github.com/nim-lang/fusion/pull/36 please
14:49:11disbotMake module smartptrs compile and expand tests
14:49:13hmmmnarimiran https://paste.ofcode.org/UU5GtfApkxQsRXwnXPzkJK
14:49:24planetis[m]without it uniqueptr doesnt compile
14:50:01narimiranplanetis[m]: oh wait, i though i already merged it. or was there a similar PR touching that code?
14:50:48planetis[m]yes i made two prs. https://github.com/nim-lang/fusion/pull/37 was the one you mention
14:50:49disbotCompile smartptrs without threads:on
14:50:57PMunchnarimiran, I'm here now
14:51:06PMunchJust had to pop out to the dry cleaners for a second
14:51:26Zevvdry cleaner. I don't think I ever went to the dry cleaner in my life. Does that say anything about me?
14:51:42narimiranPMunch: ok, i rebased your jsondoc PR (it is in my branch, didn't want to force-push to yours), and it seems like i found a bug :)
14:51:52PMunchGotta get the suits ready for Christmas :)
14:52:14planetis[m]that you dont own carpets
14:52:16PMunch(and partially because I just ordered a new suit and the pants where all wrinkly and I couldn't be arsed to iron it myself)
14:52:23planetis[m]...or suits
14:52:45PMunchnarimiran, oh right, that was never merged..
14:52:49PMunchWhat's the bug?
14:53:02narimiranPMunch: let me make a small repro code, just a second
14:53:04planetis[m]narimiran thanks
14:53:07*tane joined #nim
14:54:59planetis[m]oh i was looking at the wrong pr, got confused too
14:55:19narimiranplanetis[m]: this one is quite a mouthful :) `if (when compileOption("threads"): atomicLoadN(addr p.val[].atomicCounter, ATOMIC_CONSUME) == 0 else: p.val[].atomicCounter == 0):`
14:55:47planetis[m]yeah i put it in a seperate one bc i wasnt sure
14:56:08planetis[m]but it works
14:56:40narimiranplanetis[m]: ok, i'll merge it
14:56:52planetis[m]thanks :)
14:58:03narimiranplanetis[m]: but wait, this one is older than a merged one!?
14:58:42planetis[m]yes... did i messed up the merge?
14:59:02narimirani'm not sure (and that's the reason enough to be careful)
14:59:17narimirancan you make a new PR based on the latest master, just to be sure?
14:59:22planetis[m]ok
14:59:34narimiranplanetis[m]: great, ping me when you do
15:01:08Zoom[m]Hey, guys, Is there any official/semi-official Rossetacode effort going on?
15:01:25PMunchZoom[m], nothing coordinated I think
15:02:28Zoom[m]Too bad, it's a great resource to promote idiomatic solutions to common problems.
15:02:56Zoom[m]Everyone has some real work to do, I suppose.
15:03:13PMunchI mean there are a lot of Nim code on Rosetta (I've even added some myself), but it's not a coordinated
15:03:18PMuncheffort
15:04:21Zoom[m]Yeah, I see there's a lot, but some coordination which would encourage using some particular style would be of much help
15:05:19Zoom[m]What I mean is a git repo, of course. :)
15:05:38planetis[m]narimiran: done, https://github.com/nim-lang/fusion/pull/41
15:05:39disbotfix smartptrs
15:06:01narimiranplanetis[m]: oh, this is much cleaner now!!
15:07:31narimiranPMunch: hmmm, i can create a bug when i call my newly-created `rstToJson` proc (similar to `rstToLatex`), but not when i do `nim jsondoc`. let me try to see what's going on there....
15:09:31narimiranPMunch: this is the stuff i'm experiencing: https://play.nim-lang.org/#ix=2Enz
15:09:47*abm quit (Read error: Connection reset by peer)
15:10:17PMunchI think there's a post-process step in there somewhere
15:12:38ForumUpdaterBotNew thread by Lucas_Ullon: GC Safe Problem, see https://forum.nim-lang.org/t/7103
15:13:24narimiranPMunch: ah yes, there's `sanitize`
15:13:33narimiran`var sane = generated.replace(", ]", "]")
15:13:34narimiran`
15:13:35PMunch:)
15:15:28planetis[m]btw, was there a reason that alignedAlloc wasn't made public?
15:16:49Araqit's semver, all the good stuff is hidden
15:16:58Araqinstead you get the bugfixes that might break your code
15:17:34Araqit's all completely nuts but semver's the industry standard so don't complain
15:18:07FromDiscord<Rika> i think semver only works with applications, and even then not completely
15:18:31planetis[m]ok i won't lol
15:23:37narimiranhmmm: sorry for the slow reply. i think a third func parameter will be needed in nim version of that code
15:27:18narimiranPMunch: yep, my "helper proc" was missing one call to `sanitize`, now it is ok
15:28:01FromDiscord<alehander42> oi
15:37:05*narimiran quit (Ping timeout: 240 seconds)
15:37:24*hmmmmm joined #nim
15:37:34hmmmmmI'm back ! :>
15:37:42FromDiscord<notchris> wb +3 m's
15:38:17*narimiran joined #nim
15:38:49ForumUpdaterBotNew question by Andrea T.: statically compile a Nim program in macOS, see https://stackoverflow.com/questions/64860969/statically-compile-a-nim-program-in-macos
15:39:18*hmmm quit (Ping timeout: 272 seconds)
15:39:34hmmmmmnarimiran what if I make a proc that takes a 2 value tuple that has in the first spot a @seq and in the second an int?
15:40:05narimiranhmmmmm: how does that help?
15:40:14hmmmmmhelps with the recursion I think
15:40:21narimirandon't think so
15:40:25hmmmmm:(
15:42:12hmmmmmwhy nim procs can't return more than 1 value btw?
15:42:27FromDiscord<Rika> python procs cant either
15:42:32solitudesfwhat are tuples
15:42:38hmmmmmoh
15:43:01hmmmmmI'll keep trying, there must be a way
15:43:12Prestigereturn a tuple
15:43:20Prestigereturn (x, y)
15:43:25hmmmmmI agree!
15:43:31hmmmmmbut x must be a seq!
15:44:02solitudesfso?
15:44:07Prestigeproc foo(): (x: seq[int], y: string)
15:44:45FromDiscord<Rika> and x can be a seq idgi
15:44:58FromDiscord<Rika> tuples are just simpler objects
15:45:12FromDiscord<notchris> tuples confuse me idk why
15:45:14solitudesfPrestige, thats some weird mix or named/unnamed tuple syntax
15:45:15Zevvdont tuple
15:45:18Zevvthey're nasty
15:45:26Zevvsecond class citizens
15:45:28hmmmmmPrestige can I do it like this -> proc foo(): (x: seq[int], y: int) : x: seq[int], y: int =
15:45:39solitudesfwhat
15:46:07FromDiscord<Rika> what
15:46:14hmmmmmI mean the proc must be able to call himself so it should return a seq and an in too
15:46:19FromDiscord<Rika> i dont understand what youre trying to do
15:46:21FromDiscord<Rika> no
15:46:51Prestigeyeah I meant: https://play.nim-lang.org/#ix=2EnY
15:46:54FromDiscord<Rika> `proc foo(a: tuple[x: seq[int], y: int]): tuple[x: seq[int], y: int]`
15:47:19hmmmmmrika!
15:47:23FromDiscord<Rika> or just var it
15:47:24hmmmmmit's perfect
15:47:36narimiranhmmmmm: should your python proc return `[4, 5]`, or `9`?
15:47:45hmmmmmI'll try to use that first and maybe try the var later
15:48:00hmmmmmit should return [4,5] the only subset that sums to 9
15:48:05narimiranhmmmmm: also, python pro-tip NEVER use `sum` as a variable name
15:48:18hmmmmmlol nari I'll keep in mind
15:49:01narimiranhmmmmm: and what if `listx` was `[3, 4, 5, 6]`?
15:49:07narimirannow it returns just `[3, 6]`
15:49:23bungI'd like to change a old test file to unittest style, does this kind of PR acceptable ?
15:49:36hmmmmmnari it returns the first subset that sums to 9
15:49:46bungcurrent it use doAssert
15:50:20*hnOsmium0001 joined #nim
15:50:24FromDiscord<flywind> `doassert` is preferred than `unittest` in `testament`.
15:51:10notchriswhats the deal with flylind
15:51:15notchriswhy is that a default
15:51:30Araqbung, I prefer the other direction
15:51:44notchrisoh wait its not a bot
15:51:46notchrisjk
15:52:01Araqreplace unittest based tests with testament tests
15:52:43bungwhen I run it directly I only get AssertionDefect
15:53:18bungwith check I got expect something got other thing
15:54:06bungunless the test author write assert fails message param, I'd prefer unittest
15:54:40FromDiscord<flywind> Could you give a small example?
15:55:15FromDiscord<flywind> You could use raise and doAssertRaises I think
15:55:16*MyMind quit (Ping timeout: 256 seconds)
15:56:09bunghttps://paste.ofcode.org/3aTWYpcRkXhP9UBrsZX7pnj
15:58:04FromDiscord<flywind> Anyway you could use `unittest` locally and remove it when pushing.
15:58:35FromDiscord<notchris> just dont use tets
15:58:37FromDiscord<notchris> tests
15:58:41FromDiscord<notchris> problem solved
15:58:55FromDiscord<alehander42> 😄
15:58:56*notchris hides
15:59:13bungno, that's not how things solved
15:59:19*hmmmm joined #nim
15:59:23notchrisORLY
16:01:09*hmmmmm quit (Ping timeout: 256 seconds)
16:01:24*krux02 joined #nim
16:03:47FromDiscord<Rika> cant break code if there is none
16:04:24*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:06:17hmmmmrika it works
16:06:30FromDiscord<Rika> congrats
16:06:35hmmmmI mean I'm able to pass data to it and echo it to console
16:06:39hmmmmstill big steps
16:10:12narimiranhmmmm: here you go: https://play.nim-lang.org/#ix=2Eo9
16:10:47narimiranspoiler alert: no tuples needed
16:13:30*blueberrypie quit (Quit: Ping timeout (120 seconds))
16:13:58*blueberrypie joined #nim
16:15:05*hmmmmm joined #nim
16:15:25*MyMind joined #nim
16:15:51hmmmmm:0
16:15:56hmmmmmnami that's very pretty
16:16:02hmmmmmhow did you avoid tuples
16:16:11narimiranhmmmmm: by reading your python code
16:16:17hmmmmm:>
16:16:17FromDiscord<Rika> oof
16:16:43narimiranhmmmmm: where are tuples there!?
16:16:52hmmmmmI see no tuples!
16:17:33*hmmmm quit (Ping timeout: 260 seconds)
16:19:31hmmmmmreturn @[] is like returning none?
16:19:43narimiranhmmmmm: no, it returns an empty sequence
16:20:01narimiranthat's the biggest difference between the two versions, IMO
16:20:21hmmmmmso if @[] evalues to false?
16:20:27narimiranno
16:20:32narimiranread my code
16:20:38hmmmmmI'm trying lol :D
16:21:02narimiranthere's no implicit "booleaness" of 0 or zero-length stuff in nim
16:21:11narimiranyou cannot do `while 1`
16:21:16hmmmmmoh
16:21:16narimiranor `if someInt`
16:21:28hmmmmmand what people do instead
16:21:35narimiranwhat i did
16:21:38narimiran`if withv.len > 0:`
16:21:46hmmmmmah ok makes sense
16:22:40solitudesfamazing
16:23:17hmmmmmis it possible to make the same function but with a var parameter outside the function
16:23:17*solitudesf quit (Quit: Leaving)
16:23:32narimiranprobably
16:23:42*MyMind quit (Ping timeout: 260 seconds)
16:25:36hmmmmmI've seen it in the tutorial functions that return nothing because they manipulate the external var
16:25:39hmmmmmit's interesting
16:25:52hmmmmmpeople do it a lot or it's an edge case?
16:26:11narimiranneither? :D
16:26:14hmmmmmlol
16:26:20hmmmmm:>
16:27:16hmmmmmok, I'll try to look some other mini project to nimify, thanks for all the help people c u soon :>
16:31:17*MyMind joined #nim
16:35:06*hmmmm joined #nim
16:36:51*hmmmmm quit (Ping timeout: 256 seconds)
16:39:35*natrys joined #nim
16:44:45*hmmmmm joined #nim
16:46:05*hmmmm quit (Ping timeout: 260 seconds)
16:47:39*PMunch quit (Quit: leaving)
16:57:20FromGitter<eagledot> can somebody take a look ...https://play.nim-lang.org/#ix=2Eoe (https://play.nim-lang.org/#ix=2Eoe)
16:57:55*neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:58:20*neceve joined #nim
16:59:16FromGitter<eagledot> Actually updated ....https://play.nim-lang.org/#ix=2Eof (https://play.nim-lang.org/#ix=2Eof)
17:08:42bungshould I merge my two PRs on same lib even on differient purpose ?
17:15:13disruptekno.
17:18:59bungtest file has constant result compare that may not able auto solve comflicts.
17:30:46*hmmm joined #nim
17:33:06*habamax joined #nim
17:41:56*bung quit (Quit: Lost terminal)
17:46:27*thomasross joined #nim
17:54:53disruptekdepend the 2nd PR upon the 1st.
17:57:01FromDiscord<Vindaar> @Zevv saw your heatmaps earlier. Thought I'd come in and post a ggplotnim solution only to end up fixing some issues. So thanks I guess, haha. Well, for anyone who doesn't want to use gnuplot: https://play.nim-lang.org/#ix=2Eot
17:58:21FromDiscord<Vindaar> https://media.discordapp.net/attachments/371759389889003532/777955728987521042/heatmap.png
17:58:23hmmmmmhallo nimlets
17:58:37Zevvthat's neat
17:59:24FromDiscord<Vindaar> 🙂
17:59:50hmmmmmnari u still around?
18:02:54*hmmm quit (Ping timeout: 265 seconds)
18:05:47*ehmry joined #nim
18:10:04hmmmmmhow does a proc knows it should return something if you never specify "return"?
18:10:16Zevvthe type of the last expression
18:10:33Zevvor assigning to `result`
18:10:36hmmmmmand how does it knows that it's the last one
18:10:47Zevvbecause there is nothing coming after it?
18:10:47hmmmmmoh so result is a special keyword like return?
18:11:02Zevvno, it's more like a magically injected variable
18:11:13hmmmmmhmm
18:11:14Zevvevery proc with a return type has this variable
18:11:41hmmmmmwait I test something
18:15:55FromDiscord<LlamaLad7> which editor/editor plugin would you say has the best nim support at the moment?
18:16:17FromDiscord<Recruit_main707> vscode
18:16:51FromDiscord<Recruit_main707> vim would probably come second
18:17:00FromDiscord<Recruit_main707> https://github.com/nim-lang/Nim/wiki/Editor-Support
18:17:10FromDiscord<LlamaLad7> is that in order of completeness or something?
18:17:46FromDiscord<Recruit_main707> no
18:18:00FromDiscord<Recruit_main707> wait, what i said yes
18:18:08FromDiscord<Recruit_main707> the github list not
18:18:13FromDiscord<LlamaLad7> ok
18:18:42FromDiscord<LlamaLad7> thanks
18:19:49Zoom[m]Vindaar, wow, that's cool! Totaly missed the package. Post it on forum https://forum.nim-lang.org/t/7102
18:22:16hmmmmmZevv I made a test proc, it works if I use return, it makes strange noises if I use result, and if I don't use neither it says the variable I want to return "is declared but not used"
18:22:52Zevvshow the code
18:23:36FromGitter<sealmove> @PMunch is it possible to call a read within a custom parser? In your example (http://ix.io/2EiE) `proc parseDnsName` only uses primitive reads like `readChar`. If codegen produced predictable names you could call a custom parser, but since `gensym` is used...
18:25:12FromGitter<sealmove> for example how would you do a conditional field of non-primitive type?
18:25:20hmmmmmhttps://paste.ofcode.org/AP24CHyT3BCivB3nX2XGcU
18:30:14FromDiscord<nikki> https://twitter.com/lzsthw/status/1328403367467610116?s=21
18:30:23FromDiscord<nikki> some async-related questions from this person on twitter
18:30:40FromDiscord<nikki> i haven't used async much so didn't answer, but maybe someone else here is more familiar
18:30:58FromDiscord<nikki> (they posted their code in a previous tweet that this responds to)
18:31:25*abm joined #nim
18:31:44*abm quit (Client Quit)
18:32:29*jjido joined #nim
18:41:41*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:44:56*jjido joined #nim
18:45:04FromDiscord<alehander42> https://www.youtube.com/watch?v=qMtyTXDc9Fw disruptek
18:45:23FromDiscord<alehander42> i know you need that
18:45:36FromDiscord<alehander42> wow
18:45:41FromDiscord<alehander42> this is zed shaw?
18:46:15planetis[m]@dom96: ^
18:46:39FromDiscord<alehander42> yeah @dom96 engage
18:46:49disrupteksolution: use cps and not async/await.
18:46:49FromDiscord<alehander42> he is author of the probably most famous python book
18:47:17FromDiscord<alehander42> (edit) "he is author of the probably ... mostread" added " one of the" | "famous" => "read" | "book" => "books"
18:47:44FromDiscord<alehander42> (edit) "yeah @dom96 ... engage(maybe" added "we can" | "we canengage ... " added "(maybe inviting him to irc)"
18:49:38planetis[m]to late for edits (we can see them on irc), what you wanted to really say is: "dom unleash the beast"
18:50:55FromDiscord<alehander42> hahaha
18:51:17FromDiscord<alehander42> he .. uses nim a lot
18:51:23FromDiscord<alehander42> in the last several days
18:51:41FromDiscord<alehander42> could really use some context I guess
18:51:45planetis[m]btw is he using async wrong or that's how is it supposed to be written?
18:52:10FromDiscord<alehander42> https://twitter.com/lzsthw/status/1323291423752544262
18:52:22FromDiscord<alehander42> ^ ok .. I really should go back to work 😄 😄
18:52:26FromDiscord<alehander42> which reminds me
18:54:41disrupteksasha: wtf.
18:54:51disruptekthe bridegroom only comes once? at midnight?
18:55:25disruptekasync is not supposed to be written.
18:56:09*vicfred joined #nim
18:56:13FromDiscord<alehander42> wow that is the lamp parable
18:56:20FromDiscord<alehander42> i didn't make the connection before I think.
18:56:44FromDiscord<alehander42> I probably thought about revelation
18:57:27FromDiscord<alehander42> I really like the 7nd one: Remain with us, O Lord of Hosts
18:59:21disruptekthis really is the best programming soundtrack.
18:59:31disrupteki mean, if you're a prudish evangelical.
18:59:41FromDiscord<alehander42> it's literally russian orthodox music
19:00:00FromDiscord<alehander42> 😄
19:00:32FromDiscord<Daniel> Would it not be awesome for all this chat in discord/irc to be available on some live blog form, where it would stay forever on internet and be accessible through search engines, for educational and historical reasons
19:00:46disruptekwell, it is.
19:00:48FromDiscord<alehander42> this amazing conversation inspired you, right
19:01:05FromDiscord<alehander42> imagine people in the tribulation analyzing it
19:01:30FromDiscord<Daniel> last week or two, this is the most exciting discord server for me, i am a member of more than dozen discord servers
19:01:43disruptekyou need to get out more.
19:01:45disruptekjust sayin'.
19:01:59FromDiscord<nikki> lulz
19:02:05FromDiscord<nikki> i went outside yday, was p solid
19:02:08FromDiscord<nikki> went to a park
19:02:14FromDiscord<nikki> sat on a blanket
19:02:43FromDiscord<Daniel> park is nice, contains good ions 😉
19:02:59FromDiscord<alehander42> i want to go to taiga
19:03:25FromDiscord<alehander42> where are you from?
19:03:32disruptekplanet xantu.
19:03:54FromDiscord<alehander42> ew
19:04:02FromDiscord<alehander42> those are the bad guys
19:04:25disruptekthat's a matter of perspective.
19:04:35*hmmmmm quit (Remote host closed the connection)
19:04:39FromDiscord<alehander42> disruptek my father yesterday was angry with me for talking more about US politics than bulgarian
19:04:45FromDiscord<alehander42> maybe he'd like you
19:04:50disruptekdoubtful.
19:04:59FromDiscord<alehander42> you don't know him
19:05:32disruptekno, but statistically speaking, it's very unlikely.
19:05:42FromDiscord<alehander42> I like you
19:05:45FromDiscord<alehander42> it might be genetic?
19:06:07disruptekcould be, i guess. crazy does seem to run in families.
19:07:08FromDiscord<alehander42> we don't run
19:07:09FromDiscord<alehander42> a lot
19:07:12FromDiscord<Daniel> also, where can i find instructions how to setup Nim IDE on win10?....at the moment i am using Notepad++, where i need every time to save the file, then switch to command prompt compile with -r switch
19:07:14FromDiscord<alehander42> i need to work on my cardio
19:07:30FromDiscord<Daniel> (edit) "switch" => "switch..then go back to Notepad++"
19:07:48FromDiscord<alehander42> Daniel, i love the fact you write complete sentences , people try to teach me that a lot and I usually fail
19:07:58*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:08:07FromDiscord<alehander42> are you ok with using `vscode` ?
19:08:19FromDiscord<alehander42> probably simplest to setup with inline terminal
19:08:24FromDiscord<alehander42> or build config
19:10:15FromDiscord<Daniel> Honestly, i dont care if its vscode, notepad++ or any other editor, as long as there are instructions how to set it up and get it running in a better workflow as opposed to my current one.
19:11:04FromDiscord<Daniel> It would be very useful for every Nim newcomer as well.
19:11:08FromDiscord<alehander42> install vscode 🙂
19:11:24FromDiscord<Daniel> ok, sec, let me google and download it
19:11:41FromDiscord<alehander42> then https://github.com/pragmagic/vscode-nim 🙂
19:12:04FromDiscord<alehander42> you can follow the instructions
19:12:21FromDiscord<alehander42> and use terminal from Ctrl+Shift+`
19:12:47FromDiscord<alehander42> also, use ctrl+P and ctrl+shift+P
19:12:48FromDiscord<alehander42> a lot
19:13:04FromDiscord<alehander42> if you haven't used sublime or similar editor with command pallete
19:13:09FromDiscord<alehander42> i think those are the basic
19:13:10FromDiscord<alehander42> (edit) "basic" => "basics"
19:16:21FromDiscord<Daniel> do i install this one? https://media.discordapp.net/attachments/371759389889003532/777975360079659028/unknown.png
19:16:45FromDiscord<Daniel> Indeed, i nver used sublime or similar editor
19:16:52FromDiscord<Daniel> (edit) "nver" => "never" | "editor" => "editor."
19:16:59FromDiscord<nikki> https://marketplace.visualstudio.com/items?itemName=kosz78.nim
19:17:07FromDiscord<nikki> go to this ^ specific link
19:17:31FromDiscord<Daniel> k, sec
19:19:38FromDiscord<Daniel> Alright, i installed that particular extension, so far so good 👍
19:20:36*PMunch joined #nim
19:20:53FromDiscord<nikki> time to code some nim 🙂
19:21:17FromDiscord<Daniel> Looking into settings of this extensions, should do any particular setup?
19:22:49FromDiscord<alehander42> just follow the repo https://github.com/pragmagic/vscode-nim
19:23:07FromDiscord<alehander42> for the configuration
19:23:22FromDiscord<alehander42> i am not sure if it's super important to set it up
19:23:40PMunchHmm, would be an interesting mini-series. Have the "famous" Nimmers show off their set-ups for Nim development
19:25:04FromDiscord<alehander42> 😄 dom96 and "i wrote my own ide once"
19:25:13FromDiscord<alehander42> yeah, many vim-ers
19:25:15FromDiscord<alehander42> i guess
19:25:39FromDiscord<alehander42> and Araq coming out with the "unix is wrong" stuff
19:27:12ForumUpdaterBotNew thread by Zulu: Is there a torrent library for Nim?, see https://forum.nim-lang.org/t/7105
19:28:53PMunchI'm a vim-er at least, but my set-up is pretty minimal
19:29:04PMunchI don't even have bindings for the LSP functions
19:29:25PMunchSo I end up typing `:LspDefinition` every time I want to jump to def :P
19:29:51*hmmm joined #nim
19:30:13FromDiscord<dom96> I'm answering ^^^
19:30:34hmmmhulla!
19:31:49*bung joined #nim
19:31:58hmmmvscode setup was very simple for me, you just search "nim" in the extension panel and install the first one
19:32:13hmmmif I did it anyone can do eet
19:33:09FromDiscord<haxscramper> Fusion CI fails on all tasks with `Unable to process command '::add-path::/home/runner/work/fusion/fusion/nim/bin' successfully.` ... `` Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. `` - I pushed PR with fix https://github.com/nim-lang/fusion/pull/35 (along with option to `[skip ci]` (like in main nim repo))
19:33:10disbotAllow skipping CI run on commit, copied from Nim/#15289 (with fix from Nim/#15556)
19:33:15FromDiscord<Daniel> Success!!↵i just tested my first code in VSC:↵Although, Avast goes crazy when pressing F6, lol ...i like this, much better than manually doing compilation and saving in Notepad++ https://media.discordapp.net/attachments/371759389889003532/777979611501690900/unknown.png
19:33:17FromDiscord<haxscramper> Could someone look at it
19:33:56FromDiscord<haxscramper> In total it is a five-line fix
19:40:41FromDiscord<haxscramper> By the way, @alehander42 - I started writing article I talked about several days prior - https://gist.github.com/haxscramper/ad781ebd5a343b53197bf538a1252f83 - not finished yet, but `flow` macro idea turned out to be quite interesting
19:40:44*abm joined #nim
19:41:23FromDiscord<alehander42> hey , very cool
19:41:40FromDiscord<alehander42> it was a good example, I guess?
19:41:54FromDiscord<alehander42> are you planning on making flow a package
19:42:42FromDiscord<haxscramper> Yeah. Probably a bit too complicated though, because by the end of article there is too much code that is basically implementation details all over the place, so I need to make better explanation for this part too.
19:43:32FromDiscord<haxscramper> @alehander42 I thought about this - maybe sometime in the future, but for now `mapIt` is good enough. Though it does not look that pretty. And `zero_functional` is a good alternative too.
19:44:23FromDiscord<haxscramper> For now this is a "leave implementation details to the reader" or something like that. Although I wrote macro itself and added it to test suite
19:44:37FromDiscord<haxscramper> With support for only `map`, `filter` and `each`
19:46:33*waleee-cl joined #nim
19:49:55*vicfred quit (Quit: Leaving)
19:52:44PMunchnarimiran, thanks for keeping my PRs up to date :)
19:53:24FromDiscord<Vindaar> @Zoom: thanks! Yes, I can post about it later
19:54:19FromGitter<sealmove> oh hey PMunch, if you read my question above it's wrong. I realized what's the problem. When making a custom parse proc, if you want to return something compatible with another parser, the return type will be a mess of nested tuples. I was wondering if there is a way around this. (if you don't understand what I am tell me and I'll make a demo).
19:55:10Zoom[m]Vindaar, I meant, just in that particular. I have no doubt you've posted about that whole awesome library and gained the deserved interest!
19:55:21Zoom[m] * Vindaar, I meant, just in that particular topic. I have no doubt you've posted about that whole awesome library and gained the deserved interest!
19:55:31FromDiscord<Vindaar> Haha, I'm aware, yes
19:55:44FromDiscord<Vindaar> There already is a thread about ggplotnim on the forum anyway
19:56:09FromDiscord<Vindaar> (pinging works fine from Matrix to Discord using `@` btw)
19:56:38Zoom[m]Yeah, I just understood my comment may have sounded a bit condescending, unintentionally. Thanks for the tip.
19:57:15FromDiscord<Vindaar> what, no. I didn't understand it that way, don't worry!
19:58:03PMunchsealmove, not entirely sure what you mean
19:58:19PMunchDo you want something that could add fields into the origin tuple?
19:58:26*jjido joined #nim
19:58:38FromGitter<sealmove> I'll show, w8
20:03:02FromDiscord<alehander42> ok @haxscramper
20:03:11FromDiscord<alehander42> i hope i ll be able to look at it later
20:05:21FromDiscord<haxscramper> Alright. And also - do you know how I can get someone to review the implementation? Because it is mostly done ... technically. `Yardanico` said I could probably ping `timotheecour` for that
20:05:57FromDiscord<haxscramper> But I'm kind of hesitant to ping people just becase
20:06:04FromDiscord<alehander42> oh ping him
20:06:46FromDiscord<alehander42> i think he
20:06:47FromGitter<sealmove> custom parse procs have to return a tuple right?
20:06:51FromDiscord<alehander42> might have feedback
20:06:53FromDiscord<alehander42> if he has time
20:07:07*habamax quit (Ping timeout: 265 seconds)
20:08:42PMunchsealmove, don't think so
20:09:18FromGitter<sealmove> I assumed so because you used `tuple[labels: seq[string]]` instead of simply `seq[string]`
20:10:49PMunchMaybe I just like tuples :P
20:11:03disruptekkinky.
20:11:17PMunchIt might have to be a tuple
20:11:23PMunchTBH I don't remember :P
20:12:47FromGitter<sealmove> well that's besides the point
20:14:35hmmmhey I have a stupid question
20:14:42PMunchFire away
20:15:17hmmmI'm looking into the docs of parsecsv and there is from os import Parastr and from streams import newfilestream
20:15:22hmmmwhat do they do
20:15:35disrupteklook at the docs for os, or the docs for streams.
20:15:41hmmmhmm
20:15:44hmmmhow
20:15:46disruptekweird, i know.
20:15:55disruptekhow did you look at the docs for parsecsv?
20:16:03hmmmlooked on google :D
20:16:07disruptektry that.
20:16:11hmmm:|
20:16:42PMunchStop being mean to him disruptek :P
20:16:51disrupteknothing mean about it.
20:16:53hmmmtell him PMunch
20:16:58PMunchhmmm, do you wonder what those procedures do, or what that syntax does?
20:17:08hmmmyes
20:17:09PMunchLike `from X import Y`
20:17:26*lritter quit (Ping timeout: 264 seconds)
20:17:30hmmmwhat do they do and if I need them to read a csv
20:19:02PMunchWell the `from X import Y` syntax just imports a specific thing from a module without importing the entire module
20:19:14PMunchUseful if you have naming clashes between modules
20:19:27FromDiscord<nikki> paramStr is for reading command line arguments to the program. it's just for the example in the parsecsv docs
20:19:42FromDiscord<nikki> newFileStream is for opening a stream to read from a file. again it's just for that example
20:19:43PMunchnewFileStream does well, create a new file stream, which is an interface for reading a file
20:19:52hmmmah ok it's like argparse from python
20:19:55FromDiscord<nikki> the example in the docs is taking a name of a file as a command line argument and reading that, so it uses those
20:20:02hmmmI always need stram to open from a file?
20:20:21FromDiscord<nikki> nah you can just do `open(...)` and use that
20:20:28hmmmah ok
20:20:37hmmmthat makes sense
20:20:39FromGitter<sealmove> here you go https://play.nim-lang.org/#ix=2Ep9. Now... the problem is the type signatures of `parseConditionalU8` and `encodeConditionalU8`. the more complex parser `inner` gets, the more complex these signatures will get. Can easily imagine having 3 levels of nested tuples with 8 fields each.
20:21:44FromGitter<sealmove> i think it would be nice if binaryparse produced aliases for those
20:23:25PMunchWell you can do this: https://play.nim-lang.org/#ix=2Epa
20:23:50PMunch`typeGetter` is super poorly named, and should be renamed though..
20:23:54FromGitter<sealmove> oh ok i was looking exactly for something like this
20:24:24PMunchAnd probably documented.. It was initially only used internally, but I found it useful so I exported it without telling anyone :P
20:25:39FromGitter<sealmove> Yeah this will do ;D
20:26:07PMunchYou could of course do this as well: https://play.nim-lang.org/#ix=2Epc
20:26:11PMunchIf you want an alias
20:29:10FromGitter<sealmove> sure, just needed a way to generate the type, and you've already exposed it
20:29:35*vicfred joined #nim
20:30:27*apahl quit (Ping timeout: 260 seconds)
20:30:34PMunchBut yeah, feel free to come up with a better name and add a `deprecated` tag to it
20:30:51*apahl joined #nim
20:31:32FromGitter<sealmove> oook
20:32:16hmmmhey PMunch what is the official doc on opening files and readlines
20:34:05PMunchHuh?
20:34:35PMunchNot the official, but may I recommend: https://peterme.net/handling-files-in-nim.html
20:34:40planetis[m]good question
20:34:52hmmmthat's perfect
20:34:58hmmmthanks munchie
20:35:08PMunchHaha, no problem :)
20:35:29PMunchThis is the official docs by the way: https://nim-lang.org/docs/io.html#readLine%2CFile
20:35:45PMunch`io` is automatically imported by system
20:36:02hmmmyea I can't read that unfortunately, will stick with the first link
20:36:16hmmmwtf is a tainted string
20:36:30planetis[m]nothing ignore it
20:36:43hmmmlol :D
20:36:47hmmmI'm sorry I'm just a noob
20:37:23PMunchHaha
20:37:28*vicfred quit (Quit: Leaving)
20:37:31PMunchTaintedString is just a distinct string
20:37:49PMunchIt's just to make sure that you think about where the string came from and that you handle it properly
20:38:14hmmmhmmm
20:38:18Zevvwhich in practice is converting it to .string right away
20:38:27Zevvbecause you can't do anything else with it
20:39:11PMunchWell you should implement your own stringification that does escaping and such
20:39:49Zevvand you should floss twice a day
20:39:51PMunchBut yeah, some of the `escape` procedures should probably take a TaintedString and return a string
20:39:55PMunchHaha :P
20:44:43Zoom[m]"Since this is a rather simple topic..." famous last words
20:45:27disruptekjust delete whatever you don't recognize.
20:45:29PMunchHaha :P
20:45:46PMunchWell it's comparatively simple to my other articles on macros and such
20:46:07PMunchOh, I've still got some half-finished articles on async and threads..
20:46:12PMunchI should get those out the way
20:46:23disruptekjust in time to deprecate async.
20:46:29PMunchHaha :P
20:46:37PMunchYeah they have been a bit of a moving target..
20:46:48PMunchWhich is part of why they have taken so long
20:49:12hmmm.lines is an iterator right?
20:49:35PMunchYup
20:49:54hmmmok I will need that
20:50:01hmmmto save I just close() right?
20:51:29PMunchYup
20:51:36PMunch`close` calls flush
20:54:29*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:55:26*Jesin quit (Quit: Leaving)
20:56:04*natrys quit (Ping timeout: 246 seconds)
20:56:38*opal quit (Remote host closed the connection)
20:58:02*opal joined #nim
21:03:13*neceve quit (Ping timeout: 264 seconds)
21:05:57PMunchHmm, I'm considering to split the `monitor` parameter for notifishower..
21:08:42*natrys joined #nim
21:13:18FromDiscord<alehander42> woww
21:13:22FromDiscord<alehander42> what happened to async 😦
21:13:40PMunchSomething happened to async?
21:15:38FromDiscord<alehander42> disruptek doesn't love it
21:17:34*bung quit (Quit: Lost terminal)
21:17:40PMunchIs there anyone who loves it?
21:18:50*Jesin joined #nim
21:18:54*Jesin quit (Remote host closed the connection)
21:22:28FromDiscord<ElegantBeef> Is there anything disruptek loves?
21:22:34FromDiscord<kodkuce> @dom96 am i tarded or what, i wanted to install nim in documents/apps/nim
21:22:57FromDiscord<kodkuce> choosenim --choosenimDir:/home/me/Documents/Apps/nim/choosenim --nimbleDir:/home/me/Documents/Apps/nim/nimble stable
21:23:33FromDiscord<kodkuce> when i run nim i get Error: getAppFilename failed. (Error was: Unable to read /home/me/.choosenim/current. (Error was: No installation has been chosen. (File missing: /home/me/.choosenim/current)))
21:23:59FromDiscord<kodkuce> do i need to exporth choosenim path too?
21:24:17disrupteki love replacing dom's tooling.
21:25:20FromDiscord<kodkuce> exporting choosenim part dident help
21:25:29FromDiscord<kodkuce> any good replace xD
21:25:38disruptek~gitnim
21:25:38disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
21:26:14*Jesin joined #nim
21:26:38PMunchOhohoh, do nimsugges next disruptek :P
21:27:12disruptekit works okay for me.
21:28:01disruptekprobably because dom didn't write it.
21:28:54FromDiscord<kodkuce> xD
21:29:12FromDiscord<kodkuce> only thing that sux there is no gitnim in repo
21:29:24disruptekwhat?
21:29:47FromDiscord<kodkuce> i cant just xbps-install gitnim not in repo
21:30:01disruptekwtf is xbps-install?
21:30:18FromDiscord<kodkuce> shhh
21:30:18disruptekit's choosenim for choosey nimions, not nimskulls.
21:31:25FromDiscord<kodkuce> hmm i have to have nim installed to build gitnim?
21:32:00disruptekdid you go to the web-site? it explains the three trivial steps to setup.
21:32:39*vicfred joined #nim
21:33:10FromDiscord<kodkuce> i dident got why you exporting path then i saw you have nim bins there too
21:33:26FromDiscord<kodkuce> only thing that is issue now is why name it git nim
21:33:35FromDiscord<kodkuce> wont it conflick with git ?
21:33:35disruptekkeep reading, chucklhead.
21:34:29FromDiscord<kodkuce> hmm i did i did
21:35:06FromDiscord<kodkuce> "git nim" = dont like it, why dident make it togheter or _ connected
21:35:28disruptek...only because then it wouldn't work. 🙄
21:35:38disrupteki swear, i don't know why i try with you guys.
21:37:58FromDiscord<exelotl> is there a way to turn an ident in to a template into a string?
21:38:23disruptekwhat?
21:38:38hmmmhmmmm
21:38:41FromDiscord<exelotl> wait sorry I mistyped that
21:38:55hmmmI get IOError when reading from a text file :|
21:39:06FromDiscord<kodkuce> hmm sorry i dont like that git nim :(, i rm it and sybolic link choosenim to home like tard
21:39:21PMunchhmmm, sure you have the right path and such?
21:39:27disruptekcool. one less user to worry about.
21:39:33FromDiscord<kodkuce> :(
21:39:34hmmmpath is the same of the script
21:40:42FromDiscord<exelotl> What I mean is, I want something like `template greet(a: untyped)`↵I call it like `greet(Foo)` and it expands to `echo "Hello Foo"`
21:41:15disruptekyou can take the strVal of the ident or just repr it. people like to astAsStr but i'm not a fan.
21:42:09FromDiscord<nikki> yeah `$ident` wfm
21:42:16FromDiscord<kodkuce> from where does nim know to look for choosenim anywya is that hardcoded?
21:42:20FromDiscord<kodkuce> (edit) "hardcoded?" => "hardcoded when build?"
21:42:40FromDiscord<nikki> @kodkuce nim isnt' looking for choosenim. choosenim installs nim somewhere. the place the binaries are need to be put on your path.
21:43:00disruptekactually, there's some kinda stupid-ass fucking shim shit going on.
21:43:06FromDiscord<exelotl> ah I was looking for a solution that can work in a template instead of a macro - I guess astToStr does the trick
21:43:42FromDiscord<kodkuce> @nikki you sure cuz running nim whitout choosnim in home . gives me Error: getAppFilename failed. (Error was: Unable to read /home/me/.choosenim/current.
21:44:22FromDiscord<kodkuce> disruptek is right there is some wirdo magic goin on
21:44:56FromDiscord<nikki> have u gotten nim to work ever yet?
21:44:58FromDiscord<nikki> or is this your first time?
21:45:36hmmmI think he is looking in the wrong folder
21:45:42hmmmis there some kind of get cwd?
21:46:09disruptekyes.
21:46:15hmmm:|
21:46:17PMunchgetCurrentDir in os
21:46:21hmmm<3
21:46:33disruptekthanks, munchie.
21:46:39hmmmalways
21:47:04FromDiscord<kodkuce> its not my first time tough duno what has to do with anything
21:47:19disruptekthe first time is always pretty messy.
21:47:43FromDiscord<kodkuce> i know you dident mean that in Nim context xD
21:48:45hmmmI knew it was totally the wrong this!
21:48:50hmmmdirectory I mean
21:49:54hmmmso I guess I'll use setcurrentdir
21:50:04disruptekhmmm.
21:50:05hmmmbut why the cwd is not the place where the nim script is
21:50:30PMunchNimScript? Or Nim?
21:50:40hmmmnim file
21:50:44hmmmI think
21:50:46PMunchgetCurrentDir gets the directory executed from
21:50:50PMunchOr the binary path
21:52:38FromDiscord<Zachary Carter> you want `currentSourcePath` from the `os` module
21:52:56FromDiscord<Zachary Carter> I think anyway
21:53:26disruptekit's because they are using -r and the default outdir is .cache
21:55:21hmmmyea it works, if I put a.txt into c:/users/hmmm it gets read
21:55:31hmmmmight be some strange vscode settings?
21:55:48hmmmI want my cwd to be set at my current .nim file location
21:57:38PMunchDid you try `currentSourcePath` like Zachary suggested?
21:58:00hmmmI'll try
21:59:34*jjido joined #nim
21:59:56*PMunch quit (Quit: leaving)
22:00:25*narimiran quit (Ping timeout: 240 seconds)
22:02:29FromDiscord<nikki> so i collect a bunch of idents as a `.compileTime.` `seq[NimNode]` somewhere to register a bunch of types that can be component types for game objects in this game thing i'm working on -- i wanted to make a static construct that lets me loop over the idents and substitute them
22:02:58FromDiscord<nikki> so like `forEachType: doFoo[T](...)` where `T` would be substituted with each type
22:03:33FromDiscord<dom96> @kodkuce yeah, that's a bug. we need a way to specify this in a config
22:03:47FromDiscord<nikki> the main q is -- is there some sensible construct to use for static unrolled loops (kinda) like this? or would i just do a macro that takes the param and repeats it a bunch with eg. the `T` ident substituted with each one
22:16:55*natrys quit (Ping timeout: 246 seconds)
22:22:33disruptekmake a macro. it's exactly the semantic you want.
22:27:20hmmmha
22:27:27hmmmit was vscode weirdness
22:28:04FromGitter<ynfle> Where did I go wrong here? https://play.nim-lang.org/#ix=2EpG ⏎ We discussed this in the past week I think
22:31:44FromGitter<ynfle> NVM got it
22:33:19FromDiscord<exelotl> is there a word for an individual enum item?
22:34:43FromDiscord<ElegantBeef> enum value?
22:34:47FromDiscord<Recruit_main707> ynfle: https://play.nim-lang.org/#ix=2EpK
22:35:22*Onionhammer quit (Quit: Ping timeout (120 seconds))
22:35:37*Onionhammer joined #nim
22:36:32FromGitter<ynfle> Ya I figured it out
22:36:35FromGitter<ynfle> Thanks anyways
22:36:45FromDiscord<Recruit_main707> Great
22:36:45FromDiscord<exelotl> yeah I guess enum value is right
22:36:54hmmmhow does defer: file.close() know that I'm done with a file
22:36:55*snowolf quit (Remote host closed the connection)
22:38:00FromDiscord<ElegantBeef> it is just a fancy `try` `finally`
22:38:20hmmmhm
22:38:27*snowolf joined #nim
22:38:28FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#exception-handling-defer-statement
22:38:53FromDiscord<ElegantBeef> So basically it inserts the finally after the stmt block
22:39:36hmmmoh it's clear
22:39:38hmmmthanks
22:49:43*opal quit (Ping timeout: 240 seconds)
22:52:27*opal joined #nim
22:56:23*Vladar quit (Quit: Leaving)
23:21:50*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:27:17*hmmm left #nim (#nim)
23:36:56*tane quit (Quit: Leaving)
23:38:55FromDiscord<Xydium> Anyone know a fix for missing the handleapi.h header? (nim version 1.4.0)
23:43:37FromDiscord<Xydium> (and Windows 10 v1909)
23:48:54FromDiscord<Xydium> It's include in at least nim 1.0.2, do I just need to downgrade?
23:54:20FromGitter<ynfle> I'm assuming this is a bughttps://play.nim-lang.org/#ix=2EpY
23:58:09FromGitter<ynfle> Why is the reference to `a[<index>]` changed?