<< 13-02-2022 >>

00:01:09*jmdaemon joined #nim
00:04:21*wyrd joined #nim
00:05:14NimEventerNew question by itil memek cantik: Convert array type to boolean, see https://stackoverflow.com/questions/71096881/convert-array-type-to-boolean
00:10:42FromDiscord<Elegantbeef> Also madprops where did you see that package? 😛
00:10:51madpropsscrolling on github
00:11:28madpropsthe feed or whatever it's called
00:34:40FromDiscord<Elegantbeef> Ah right people follow me
00:37:53*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
00:37:54FromDiscord<Hel> sent a code paste, see https://play.nim-lang.org/#ix=3Pr8
00:38:01FromDiscord<Hel> sent a code paste, see https://play.nim-lang.org/#ix=3Pr9
00:38:13FromDiscord<Hel> is it a bug?
00:38:17FromDiscord<Elegantbeef> No
00:38:36FromDiscord<Elegantbeef> test is looking for `int, float` not \`Thing[int], Thing[float]\`\`
00:39:37FromDiscord<Elegantbeef> That example has a converter
00:39:48FromDiscord<Elegantbeef> The converter is required for this example to make sense
00:40:43FromDiscord<Elegantbeef> It's just a general converter issue on dispatch, Nim doesnt use converters on ambiguity
00:41:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#type-relations-convertible-relation there is a whole blurb about it, it's relatively complex
00:43:28FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/7J8
00:44:17FromDiscord<Elegantbeef> Atleast i'd say that's why it doesnt work
00:44:32FromDiscord<Hel> yeah my bad forgot the converter in my example
00:44:50FromDiscord<Hel> wrote it in like 2 seconds and missed the issue
00:49:10FromDiscord<Elegantbeef> There is a chance i'm wrong and it's just a bug with converter dispatch 😀
00:54:29FromDiscord<Hel> i was just confused cause my brain just saw `converter` as another proc
00:54:41FromDiscord<Hel> also i didnt know about that feature
00:55:39FromDiscord<Hel> not something you see a lot
00:56:22FromDiscord<Elegantbeef> Ah there are some use cases that make it quite nice
01:01:27FromDiscord<Hel> yeah looks like they can have some nice uses
01:25:16*arkurious quit (Quit: Leaving)
02:14:04*fowl quit (Quit: cya pals)
02:14:45*fowl joined #nim
03:16:38FromDiscord<treeform> In reply to @ynfle "<@!107140179025735680> is hottie supposed": Sort of, it requires so many steps I don't know if I want to subject pplz to them
03:17:03FromDiscord<treeform> You need mess with certs a ton
03:32:02*vicecea quit (Remote host closed the connection)
03:32:30*vicecea joined #nim
03:36:36FromDiscord<Elegantbeef> @demotomohiro\: btw for https://internet-of-tomohiro.netlify.app/nim/faq.en.html#community-is-there-game-created-with-nimqmark you can link https://itch.io/c/1064082/games-made-with-nico and https://store.steampowered.com/app/1444480/Turing_Complete/
03:37:35FromDiscord<Elegantbeef> Ah turing complete is on the github page
03:37:40FromDiscord<Rika> Lol
03:59:42*fowl quit (Quit: cya pals)
04:00:21*fowl joined #nim
04:06:01*supakeen quit (Quit: WeeChat 3.4)
04:06:30*supakeen joined #nim
04:53:02FromDiscord<Hel> got a question
04:53:23FromDiscord<Elegantbeef> I got a possible answer
04:53:31FromDiscord<Hel> sent a code paste, see https://play.nim-lang.org/#ix=3PrR
04:53:45FromDiscord<Hel> why does delete remove wl1 from both data/original and the copy
04:53:46FromDiscord<Elegantbeef> you dont need the `%` multiple times
04:54:00FromDiscord<Hel> it's just a test ik
04:54:04FromDiscord<Hel> (edit) "ik" => "doesnt matter"
04:54:12FromDiscord<Rika> JsonNode is a ref
04:54:23FromDiscord<Rika> Copies are shallow unless specified as deep
04:54:48FromDiscord<Rika> Beef why are ya slow today smh
04:54:51FromDiscord<Elegantbeef> Yea this is just reference semantics
04:55:00FromDiscord<Hel> true
04:55:07FromDiscord<Elegantbeef> Rotting my brain thinking about traitor 😛
04:55:07FromDiscord<Rika> Not false
04:55:07FromDiscord<Hel> just checked json docs
04:55:12FromDiscord<Hel> missed the ref
04:55:17FromDiscord<Rika> 👌
04:55:20FromDiscord<Elegantbeef> Just documented all the macros in it
04:55:25FromDiscord<Elegantbeef> Questioning if i need anything else
04:55:25FromDiscord<Rika> Nice
04:55:33FromDiscord<Hel> best brain rot is brain rot after 9 hours of coding
04:55:49FromDiscord<Rika> Worst brain rot is brain rot after 9 months of not coding
04:56:03FromDiscord<Hel> that's the funny brain rot
04:56:08FromDiscord<Hel> funny cause code no work
04:56:56FromDiscord<Elegantbeef> Json does have a `copy` proc so you can do `jsonCopy = copy jsonData`
04:58:41FromDiscord<Hel> i needed to copy json but exclude a key
04:59:00FromDiscord<Hel> doesnt matter anymore found a workaround
04:59:15FromDiscord<Hel> just make the dude that's gonna work on the api backend format it
04:59:22FromDiscord<Rika> Lol amazing
04:59:47FromDiscord<Hel> working on low power cpus
04:59:56FromDiscord<Hel> i shouldnt even be formatting this stuff
05:17:47FromDiscord<Elegantbeef> @Hel\: if you're after very good performance you may consider other json implementions, the stdlib json is a bit slow comparatively
05:19:40FromDiscord<Hel> yeah i know
05:19:55FromDiscord<Hel> right now the program is just proof of concept
05:20:58FromDiscord<ajusa> Is Jason faster than jsony? Or just old benchmarks
05:21:12FromDiscord<Elegantbeef> No clue, benchmark yourself to see
05:21:32FromDiscord<sOkam!> is there a way to exit a nimscript early? something like bash's `exit` of sorts
05:22:36FromDiscord<ajusa> Fair point, I assumed you knew everything 😄
05:23:02FromDiscord<sOkam!> In reply to @ajusa "Fair point, I assumed": he almost does though, you are not too far from reality 🙈
05:29:37FromDiscord<Elegantbeef> I know nothing!
05:29:46FromDiscord<Elegantbeef> That's a reference that'll probably not land for 99.9% of people
05:39:58FromDiscord<Rika> I don’t get it
05:40:42FromDiscord<Elegantbeef> It's a hogan's heroes' reference which is a sitcom from the 60/70s iirc
05:42:34FromDiscord<abdu> How is coder mean to exit or quit in nim syntax ?
05:43:13FromDiscord<Rika> In reply to @sOkam! "is there a way": Quit?
05:43:24FromDiscord<Rika> Does os.quit work in script?
05:43:38FromDiscord<abdu> (edit) "is" => "if" | "mean" => "means"
05:53:02FromDiscord<sOkam!> In reply to @Rika "Does os.quit work in": maybe not? https://media.discordapp.net/attachments/371759389889003532/942297295603499028/unknown.png
05:53:24FromDiscord<Rika> Import not include…
05:53:30FromDiscord<sOkam!> oh sry
05:54:14FromDiscord<sOkam!> hmmm nvm https://media.discordapp.net/attachments/371759389889003532/942297598251917362/unknown.png
06:03:12FromDiscord<Rika> Well I wasn’t too sure about it either
06:18:50FromDiscord<JSONBash> has anyone gotten https://github.com/wltsmrz/nimler working on M1?
06:23:06FromDiscord<haolian9 (高浩亮)> i'd say have you googled before asking?
06:26:01FromDiscord<JSONBash> yeah, couldn't find anything outside an issue on the repo for macOS
06:29:14FromDiscord<Elegantbeef> Seems it just needs so defines for arch, could be wrong
06:31:00FromDiscord<JSONBash> any resources on how I could do that?
06:33:02FromDiscord<Elegantbeef> https://github.com/wltsmrz/nimler/blob/56c08c22db49c2986a05866ee0d274042946314b/nimler/bindings/erl_nif.nim#L171 atleast i think this maps to the procedure in question
06:34:09FromDiscord<Elegantbeef> perhaps elxir might not have it named the same on arm
06:35:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ps3
06:36:21FromDiscord<JSONBash> This might be a bit over my head for now...
06:37:02FromDiscord<Elegantbeef> I mean i think you just need to check if the OS is arm and if so give the procedure the proper name, it's an odd discrepancy i'd wager with x86 and arm
06:37:06FromDiscord<Elegantbeef> Though it could also just be clang
06:38:31FromDiscord<Elegantbeef> Ship me a m1 mac and i'll look at it 😛
06:40:01FromDiscord<Elegantbeef> Actually what's your `erl_nif.h` look like?
06:47:40FromDiscord<JSONBash> https://media.discordapp.net/attachments/371759389889003532/942311042875293716/erl_nih.h
06:49:04FromDiscord<Elegantbeef> Ah there is an `erl_nif_api_funcs.h` apparently 😀
06:50:03FromDiscord<JSONBash> https://media.discordapp.net/attachments/371759389889003532/942311644258795580/erl_nif_api_funcs.h
06:50:07FromDiscord<JSONBash> there is
06:50:41FromDiscord<Elegantbeef> Eh it's defined there, so yea perhaps just need a flag to clang
06:51:40FromDiscord<Elegantbeef> Thought it does have an added `_` so perhaps removing the `cdecl` here https://github.com/wltsmrz/nimler/blob/develop/nimler/bindings/erl_nif.nim#L8 might help
06:52:20FromDiscord<Elegantbeef> I'm just wildly throwing stuff and seeing if anything sticks
06:53:45FromDiscord<JSONBash> not super experienced with C so I am not sure what that even means
06:54:00FromDiscord<Elegantbeef> What means?
06:54:23FromDiscord<Elegantbeef> I'm tired that's a calling convention
06:54:29FromDiscord<Elegantbeef> Disregard the cdecl comment
06:54:30FromDiscord<JSONBash> how to add flag, and what cdecl does
06:55:01FromDiscord<Elegantbeef> well to add a flag you just do `--passC:"cCompilerFlagHere"` but the issue is i dont know if i'm write with that assumption
06:55:30FromDiscord<Elegantbeef> I'm just guessing that it's lacking a flag which causes it to improperly compile this code, i'm probably 120% wrong
06:57:41FromDiscord<JSONBash> could this be it? http://erlang.org/pipermail/erlang-questions/2011-June/059679.html
06:58:06FromDiscord<JSONBash> although it usses gcc i think
06:58:58FromDiscord<Elegantbeef> well you can try `--passC:"-bundle -flat_namespace -undefined suppress"` and see if that works
06:59:34FromDiscord<Elegantbeef> That's also 2011 so rather dated 😛
07:00:23FromDiscord<JSONBash> nah i still got the same errors 😦
07:02:14FromDiscord<Elegantbeef> Shared isnt passed that i can see from Nim, so yea not a clue
07:03:03FromDiscord<JSONBash> ah oh well, I got a spare x86 linux box lying around
07:03:29FromDiscord<Elegantbeef> Try it with clang on the linux box as a test for shits and giggles
07:05:06FromDiscord<Rika> Gits and shiggles
07:05:59FromDiscord<JSONBash> whats the falg for choosing compiler again?
07:06:19FromDiscord<Elegantbeef> `--cc:clang`
07:06:34FromDiscord<ynfle> In reply to @treeform "Sort of, it requires": Is it just cers?
07:06:38FromDiscord<ynfle> (edit) "cers?" => "certs?"
07:06:39FromDiscord<Rika> I was wondering what “falg” meant
07:06:43FromDiscord<ynfle> I don't mind
07:06:55FromDiscord<JSONBash> yeah it works fine for clang lol
07:07:16FromDiscord<JSONBash> In reply to @Rika "I was wondering what": it means I got fat fingers
07:07:37FromDiscord<haolian9 (高浩亮)> sorry for the timing i input, i wasnt meant to say that to your question↵(@JSONBash)
07:08:33FromDiscord<Elegantbeef> How dare you! They're so offended they didnt even mention it! Big old sarcasm indicator here
07:09:20FromDiscord<treeform> In reply to @ynfle "Is it just certs?": You need to follow all of the steps in this article to get hottie to work on mac.
07:09:24FromDiscord<treeform> http://os-tres.net/blog/2010/02/17/mac-os-x-and-task-for-pid-mach-call/
07:09:55FromDiscord<JSONBash> In reply to @haolian9 (高浩亮) "sorry for the timing": ah no problem!
07:10:37FromDiscord<Elegantbeef> Json perhaps make a forum post, something more permanent is better
07:14:35FromDiscord<ynfle> In reply to @treeform "You need to follow": It doesn't even compile for me
07:15:57FromDiscord<ynfle> Same compiler error as on your CI
07:17:30FromDiscord<JSONBash> Yeah I will do that, probably best for other if it gets solved
09:21:32*mjsir911 quit (Quit: Goodbye, World!)
09:21:47*mjsir911 joined #nim
09:22:52*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
09:22:59FromDiscord<DevNugget> are there any places that have good learning resources for Nim? I really like how Nim works but I am having a very hard time to try and learn things or see how some program would be written in NIm unlike C or Python which has a bunch of tutorials online
09:23:31*jjido joined #nim
09:25:07*jmdaemon joined #nim
09:34:35nrds<Prestige99> I'd say just look through https://nim-lang.org/documentation.html
09:55:55FromDiscord<demotomohiro> After you read an official tutorial, my Nim FAQ might help learning Nim. https://internet-of-tomohiro.netlify.app/nim/faq.en.html
09:58:56nrds<Prestige99> oh cool page
09:59:03FromDiscord<evoalg> there are also books, like\: https://www.manning.com/books/nim-in-action?query=nim%20in%20action and http://ssalewski.de/nimprogramming.html
10:07:14NimEventerNew Nimble package! crowncalc - Basic calculator in Nim, see https://github.com/RainbowAsteroids/crowncalc
10:58:09*pro joined #nim
11:17:16NimEventerNew question by itil memek cantik: Move to usage of nre from that of re, see https://stackoverflow.com/questions/71100123/move-to-usage-of-nre-from-that-of-re
11:25:04FromDiscord<untoreh> is the long term plan of nimscript to reach full nim support?
11:26:22FromDiscord<Abi> <@&371760044473319454> hey, I'm being sent bitcoin spams by someone I've only got this server in common with↵ID is 940906321035788308 https://media.discordapp.net/attachments/371759389889003532/942381180240678932/Screenshot_20220213-112517_Discord.png
11:28:08FromDiscord<Trixarian> https://media.discordapp.net/attachments/371759389889003532/942381625403117618/Screenshot_20220213_132730_com.discord.jpg
11:28:10FromDiscord<Trixarian> Same
11:28:30FromDiscord<T-taku> I got spam↵↵940908652242550834 https://media.discordapp.net/attachments/371759389889003532/942381715400314911/IMG_1786.png
11:29:47FromDiscord<Sh1be> Same
11:30:46FromDiscord<jakkn> Same here
11:32:21FromDiscord<Schelz> ay yo just to know <@!940903397626900491> is scammer and message person like me saying they win 5 eth
11:32:32FromDiscord<Schelz> dont click on that link its a scam
11:32:49FromDiscord<Schelz> https://media.discordapp.net/attachments/371759389889003532/942382799195865098/unknown.png
11:33:18FromDiscord<Yardanico> banned them all already
11:39:14FromDiscord<Rika> In reply to @untoreh "is the long term": Not that I know of, no
11:51:22*pro quit (Quit: pro)
11:52:52*pro joined #nim
12:00:42FromDiscord<enthus1ast> Does someone has a strong feeling about, changeing mimetypes from a OrderedTableRef to a OrderedTable? (so that it works on compile time)
12:04:07FromDiscord<noow> it's also important to report all such incoming messages
12:04:14FromDiscord<noow> after blocking them you can report them as spam
12:04:29FromDiscord<Rika> You can just report and afaik it will also block
12:04:55FromDiscord<noow> i just hope discord won't start mandating phone numbers for everyone because of these spammers
12:06:02*supakeen quit (Quit: WeeChat 3.4)
12:06:07FromDiscord<Rika> Is there a solution to spam other than personal identification and captcha? Just wondered
12:06:55*supakeen joined #nim
12:08:21FromDiscord<mratsim> In reply to @Rika "Is there a solution": You can have captcha that bots can't solve unless authors put efforts that aren't worth it.
12:08:59FromDiscord<mratsim> personally I just disable messages unless from servers I'm mod for
12:09:09FromDiscord<mratsim> (because bots don't message mods ;))
12:09:55FromDiscord<Rika> Same here, except I do it for all servers I’m not closely integrated with, since bots DO message mods, as long as they’re named weirdly
12:12:41FromDiscord<demotomohiro> In reply to @Elegantbeef "<@288750616510201856>\: btw for https://internet-of": Thank you! I will add the link.
12:23:45*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:33:31*arkurious joined #nim
12:41:59FromDiscord<noow> In reply to @Rika "Is there a solution": autodeleting old accounts not logged in for 3+ months
12:42:05FromDiscord<noow> or 6+
12:42:50FromDiscord<noow> mandatory 2FA
12:43:01FromDiscord<noow> these could reduce reuse of hacked accounts i guess
12:44:08FromDiscord<noow> and what servers can do is to set up a welcome room which prevents bots from seeing the member list
12:49:38FromDiscord<exelotl> I remember hearing that welcome rooms don't work because the API still gives them the member list
12:49:40FromDiscord<haxscramper> Most servers use welcom room
12:49:48FromDiscord<haxscramper> (edit) "welcom" => "welcome"
12:50:06FromDiscord<exelotl> I might be wrong though
13:03:40*jjido joined #nim
13:04:02FromDiscord<noow> what about honeypots
13:04:35FromDiscord<noow> userbots that are not visible in the userlist to real people but visible through the API
13:04:45FromDiscord<noow> of course discord probably would have a say
13:04:51FromDiscord<noow> they don't seem to appreciate userbots
13:05:16FromDiscord<Rika> They do not
13:05:36FromDiscord<noow> but it does sound like a theoretical solution
13:05:37*jmdaemon quit (Ping timeout: 240 seconds)
13:05:39FromDiscord<Rika> In reply to @noow "autodeleting old accounts not": They auto ban them already pm
13:05:48FromDiscord<Rika> In reply to @noow "mandatory 2FA": Prolly a nice idew
13:05:51FromDiscord<Rika> Idea
13:06:17FromDiscord<exelotl> The most regular attack I've experienced is: 50 bots join the server, they each DM a random person
13:06:43FromDiscord<exelotl> So honeypots wouldn't help much there I guess
13:07:03FromDiscord<noow> ah, they probably don't want to trigger discord's checks with DM'ing many people at once
13:07:43FromDiscord<noow> yeah you're right
13:10:16FromDiscord<noow> what if there was another kind of captcha, which worked on the basis of computational power needing to be used to perform actions such as joining servers or DM'ing people
13:10:21FromDiscord<noow> instead of bothering the user
13:10:46FromDiscord<Rika> So now it's just like bitcoin and everyone's gonna get mad at it being wasteful
13:11:17FromDiscord<noow> i was thinking more like a password key derivation function
13:11:37FromDiscord<noow> from invite link or user ID to the actual server/user DM api path or something
13:12:53FromDiscord<noow> In reply to @Rika "So now it's just": captchas sound more wasteful
13:13:03FromDiscord<Rika> In terms of what
13:13:10FromDiscord<Rika> Energy? No, time? Yes
13:13:20FromDiscord<noow> human time translates to computers being turned on longer
13:13:35FromDiscord<Rika> Computers have sleep states you know
13:13:42FromDiscord<Rika> Sleep and reduced power states
13:14:14FromDiscord<noow> i guess
13:14:37FromDiscord<noow> also, all energy consumed by home computers is converted to heat, which lowers heating costs
13:14:53FromDiscord<noow> so useless computations on my PC do not actually increase my energy bill I think
13:15:21*pro quit (Quit: pro)
13:15:22FromDiscord<noow> except for people living in areas of the world where the outside temperature is above room temperature
13:17:27FromDiscord<Rika> Which is a good portion of the world haha
13:17:34FromDiscord<Rika> Also doesn't account for summers
13:17:48FromDiscord<Rika> Very nice nim discussion were having here
13:30:35*pro joined #nim
13:41:37*PMunch joined #nim
14:26:30*pro quit (Quit: pro)
14:27:50*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:32:59FromDiscord<Waldecir Santos> How can I unpack a seq and use its valus in a proc that has a `varargs` ? I can do this in. python with ``, thanks in advance
14:35:43FromDiscord<demotomohiro> https://play.nim-lang.org/#ix=3PtM
14:37:00FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-varargs
14:37:28FromDiscord<Waldecir Santos> It should work automagically right ?
14:37:44FromDiscord<demotomohiro> yes
14:38:15FromDiscord<Waldecir Santos> Ok let me check why it's not working here, I'm creating a macro I have a seq[NimNode] and if I pass that to newTree it complains
14:38:20FromDiscord<demotomohiro> A varargs parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure.
14:39:28PMunch@Waldecir_Santos, macros can be a bit odd if you aren't used to them. What are you actually trying to do, and how are you calling your macro?
14:40:35FromDiscord<Waldecir Santos> I'm playing with Macro and AST generation, this is the error `src/playground2.nim(66, 29) Error: expected type, but got: newTree(nnkPragma, node)`
14:40:47FromDiscord<Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/942430103693066300/unknown.png
14:41:16PMunch(Note that macros can take types, but that is the type they will have on runtime, if you want an argument of that type during compile-time you need to use `static`. Ie. `macro test(arg: string)`, `arg` will still be a NimNode, but it is a NimNode that will somehow hold a string when it is compiled. If you do `macro test(arg: static[string])` then it is an actual string type in the body of `test`.
14:42:06FromDiscord<Waldecir Santos> Yeap I got the static thing.
14:42:12PMunchHard to tell without knowing what the `static` part is
14:42:24PMunchPlease try to share a minimal example on the playground
14:42:51FromDiscord<Waldecir Santos> Sure I'll try to extract it, thank you !
14:43:51FromDiscord<Waldecir Santos> I got the error lol
14:44:03FromDiscord<Waldecir Santos> let me explain
14:45:08FromDiscord<Waldecir Santos> here we go
14:45:09FromDiscord<Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/942431205020815390/unknown.png
14:45:18*Gustavo6046 quit (Ping timeout: 250 seconds)
14:45:29FromDiscord<Waldecir Santos> replacing `:` to `=` was the fix, 🤦
14:45:37PMunchHaha :P
14:45:40PMunchEasy mistake to make
14:45:45FromDiscord<Waldecir Santos> It's learning 😄 I'll get used to it
14:46:10PMunchDon't worry, I did the exact same mistake a couple days ago and I've been using Nim for years :P
14:47:33FromDiscord<fowl> Is that code inside a macro?
14:47:43FromDiscord<Waldecir Santos> Hhaha, the errors messages some still to crypt to me
14:47:49FromDiscord<Waldecir Santos> @fowl it is.
14:48:15FromDiscord<fowl> I need to go look at the new stuff I haven’t played with Nim macros in years
14:48:39FromDiscord<Waldecir Santos> I just started with Nim and Macros haha
14:48:48FromDiscord<fowl> assertMatch, a dsl for validating AST?
14:49:20FromDiscord<fowl> That was one of the pain points back in the day
14:49:48FromDiscord<Waldecir Santos> https://nim-lang.github.io/fusion/src/fusion/matching.html#tree-matching
14:51:20FromDiscord<fowl> This looks awesome, thank you
14:51:58PMunchI believe this is the probably more up to date non-fusion version: https://github.com/haxscramper/hmatching
14:52:12FromDiscord<Waldecir Santos> Yeah I was having huge lines of `if result.matches(` and during my studies found it, and helped alot with verbosity
14:52:14FromDiscord<DevNugget> In reply to @demotomohiro "After you read an": Thanks! thats very epic!
14:52:59FromDiscord<Waldecir Santos> In reply to @PMunch "I believe this is": are they the "same" ? what is the diference ?
14:53:22FromDiscord<Waldecir Santos> at least the doc/readme seems to be the same
14:54:42PMunchFusion is basically just a collection of packages from the community which are bundled together and shipped as a sort of extended standard library
14:55:10PMunchThe idea is nice, but it's gotten some critique for being slow to update I believe
14:59:11FromDiscord<Waldecir Santos> got it, so I should be better served from `hmatching`. ?
15:00:17PMunchMaybe
15:11:51FromDiscord<haxscramper> In reply to @Waldecir Santos "are they the "same"": fusion/matching is unmaintained unless araq finds someone who is willing to put up with the fusion bullshit
15:12:24FromDiscord<haxscramper> the package has ~6 months of patches/fixes that weren't merged in because he "didn't get notification emails" or something like that
15:13:20FromDiscord<haxscramper> I basically copied the last PR that was left to rot in the fusion and put it into my own repo
15:17:27FromDiscord<haxscramper> In reply to @Waldecir Santos "got it, so I": Depending on, but yes, if there is an interest in this I will continue to provide support for the package
15:18:21FromDiscord<Waldecir Santos> Perfect, I'll move to hmatching, thank you !
15:22:45FromDiscord<haxscramper> PMunch: if you are planning to work on json support for documentation genration for `nim doc` you can take a look at the https://github.com/nim-works/nimskull/pull/224, specifically https://github.com/haxscramper/nimskull/blob/docgen3/compiler/tools/docgen_types.nim and https://github.com/haxscramper/nimskull/blob/docgen3/compiler/tools/docgen_sqlite.nim - I think that sqlite database can be more useful in general, and serialization
15:24:19PMunchThanks
15:24:24FromDiscord<haxscramper> If you are interested in example database generated https://media.discordapp.net/attachments/371759389889003532/942441078278225940/tfile.sqlite
15:24:40PMunchI already have a pretty good idea on how I would achieve this, but its quite a lot of work
15:24:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Pvi
15:24:43FromDiscord<haxscramper> this is the code this was generated from
15:25:07FromDiscord<haxscramper> my PR also (re)implements support for sourcetrail, so I track usage information as well
15:25:13FromDiscord<haxscramper> aka "rank procs by usage count"
15:25:25FromDiscord<haxscramper> "find all calls between thos two files"
15:25:56FromDiscord<haxscramper> "is this optional argument really used anywhere?"
15:25:58FromDiscord<haxscramper> and so on
15:26:46PMunchOh that's pretty cool
15:26:49FromDiscord<Waldecir Santos> What is nimskull 🤔
15:27:24FromDiscord<haxscramper> In reply to @PMunch "I already have a": docgen3.nim is a place for the analysis pass, `use_registration` and `file_tracking` is for sourcetrail/usage
15:27:43FromDiscord<haxscramper> they should be pretty self-contained, at least I tried to make them so as much as possible
15:28:04FromDiscord<haxscramper> if you want you can just take docgen3.nim verbatim and hack on top of it
15:28:09FromDiscord<haxscramper> In reply to @Waldecir Santos "What is nimskull 🤔": nim fork
15:30:14PMunchI mean my idea was to simply remove json and latex generation, then rewrite every part of the HTML output to JSON output. While doing that I would write a program which converted the JSON back into HTML, and make sure that `nim doc` would call that program with all arguments related to documentation generation
15:30:23FromDiscord<Waldecir Santos> Sure I'm just not sure what is is trying to solve, and why is it in a fork and not in the main
15:31:02PMunchIt's made by a loose collective of contributors who didn't like how Nim was managed, especially in regards to contributions and planning
15:31:54PMunchThey wanted to do things differently, so they forked Nim as NimSkull and do their own thing there. Haven't really looked into how much they've actually gotten done since the fork though
15:32:04FromDiscord<haxscramper> that would be a N+20th iteration of the same rant, so for the sake of keeping it short - PMunch is mostly correct
15:32:43FromDiscord<haxscramper> Mostly because we care about things that are completely neglected in the mainline
15:33:25FromDiscord<Waldecir Santos> Got it, no worries, just trying to understand the ecosystem
15:33:56FromDiscord<haxscramper> Such as quality error messages (aka "I give up and accept I'm the only one left who doesn't like clang's / Rust's / Elm's error messages."), refactoring the decade-old pile of garbage, thinking ahead about tooling UX, having actual spec and so on.
15:36:01FromDiscord<haxscramper> In reply to @PMunch "I mean my idea": that might be easier to implement, although I'm not sure if that is what will be beneficial for the long-term improvements. Maybe I just don't really like use of json as an IR format for this. If things are kept in types you can serialize them in different ways, but with json you are mostly going to do tree trasnforms
15:36:26FromDiscord<haxscramper> although if the objective is simply to enable different html frontends then it is probably fine
15:37:21FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Pvn
15:37:38FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Pvo
15:37:41FromDiscord<b4mbus> oh boy oh boy
15:37:43FromDiscord<b4mbus> that looks handsome
15:37:45FromDiscord<b4mbus> thanks
15:45:05PMunchBlocks and scopes can be used for lots of fun stuff: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
15:49:18PMunchHmm fun, someone shared an presentation about website page bloat. So I got curious. Apparently my page is quite light, the above article is only 627kB
15:49:23PMunchMost of that is fonts though
15:50:17FromDiscord<haxscramper> just serve `.txt`
16:01:31*jjido joined #nim
16:04:23PMunchBut that's boring
16:32:57*[R] quit (Ping timeout: 240 seconds)
16:33:15FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3PvG
16:34:24*[R] joined #nim
16:35:00FromDiscord<b4mbus> (I'm using WSL2, `Linux stacjonarny 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux`, shell `fish`)
16:35:07FromDiscord<haxscramper> `import std/unicode`
16:35:18FromDiscord<haxscramper> `for rune in runes(<your text here>)`
16:35:56FromDiscord<haxscramper> I think it would be `toCounTable(mapIt(runes(text)))`
16:36:08FromDiscord<haxscramper> (edit) "`toCounTable(mapIt(runes(text)))`" => "`toCounTable(toSeq(runes(text)))`"
16:36:15FromDiscord<haxscramper> `toSeq` is from `sequtils`
16:36:52FromDiscord<b4mbus> that indeed does work
16:36:54FromDiscord<b4mbus> thank you sir
16:37:20FromDiscord<b4mbus> what is the choice for nim to not support unicode by default? I understand it's quite hard to get right, but there are languages that do it right
16:37:56FromDiscord<b4mbus> or maybe the strings are utf-8, but iterating over the characters returns bytes and not codepoints?
16:37:59FromDiscord<haxscramper> nim supports unicode
16:38:13FromDiscord<haxscramper> just string is an array of utf-8 bytes
16:38:21FromDiscord<b4mbus> oh that makes sense
16:38:24FromDiscord<b4mbus> and `rune` is a codepoint?
16:38:44FromDiscord<haxscramper> rune is a codepoint, yes
16:39:11FromDiscord<b4mbus> Im sorry for asking questions instead of asking, but my internet connection is basically dead for a few days now and it's 10x faster for me to ask a question instead of simply googling it
16:39:16FromDiscord<b4mbus> In reply to @haxscramper "rune is a codepoint,": 🙏
16:39:25FromDiscord<b4mbus> (edit) "asking," => "googling,"
16:40:13FromDiscord<haxscramper> https://nim-lang.org/docs/lib.html read module links from here, most of the google searches will point to one of these pages anyway
16:40:32FromDiscord<haxscramper> also IIRC there is a prebuilt HTML documentation somewhere, but I don't really remember where it was
16:42:22anddamhowdy nimfolks
16:42:40FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3PvI
16:43:29FromDiscord<b4mbus> (edit) "https://play.nim-lang.org/#ix=3PvI" => "https://play.nim-lang.org/#ix=3PvJ"
16:43:41FromDiscord<b4mbus> (edit) "https://play.nim-lang.org/#ix=3PvJ" => "https://play.nim-lang.org/#ix=3PvK"
16:44:11FromDiscord<haxscramper> because `runes` is an inlien iterator that can only be called in the `for` loop context
16:44:18FromDiscord<b4mbus> (edit) "https://play.nim-lang.org/#ix=3PvK" => "https://play.nim-lang.org/#ix=3PvL"
16:44:30FromDiscord<haxscramper> I'm pretty sure this message has more lines in it, like "found iterator XX"
16:44:35FromDiscord<haxscramper> but yeah, it is not really readable
16:45:06FromDiscord<b4mbus> Cool, I guess should just read up more on the docs but they load forever for me, I can barely read discord's chat
16:45:20FromDiscord<b4mbus> In reply to @haxscramper "but yeah, it is": It's fine, the language is amazing anyway, but it surely would be cool if the compiler was more helpful
16:45:45FromDiscord<haxscramper> well, I"m the wrong person to talk about compiler messages, but I can certainly relate
16:47:31FromDiscord<b4mbus> thanks
17:03:34*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:10:18FromDiscord<abdu> sent a long message, see http://ix.io/3PvW
17:10:40*jjido joined #nim
17:15:10FromDiscord<haxscramper> `import re` is deprecated, use `import std/re`
17:15:28FromDiscord<haxscramper> they are equivalent, but importing without `std/` prefix is deprecated
17:40:59FromDiscord<huantian> Why did they delete their message?
17:43:24*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:50:03FromDiscord<haolian9 (高浩亮)> are there resources for learning FFI of nim? something like data type translation between nim and c which is missing in the official manual
17:59:38FromDiscord<b4mbus> sent a long message, see http://ix.io/3Pwg
17:59:44FromDiscord<b4mbus> Im talking an idiomatic way, not a plain for loop
17:59:49FromDiscord<b4mbus> unless there aint such a way?
18:03:02FromDiscord<huantian> I’d say for loop modifying a string is the best
18:05:11FromDiscord<b4mbus> well that sucks
18:05:30FromDiscord<b4mbus> but aight, hand-implementation
18:06:24Amun-Raendians still fails to build on js target in 1.6.4
18:06:59anddamI canno make sense of https://github.com/nimgl/nimgl the install instructions are just "nimble install nimgl"
18:07:13anddamyet I cannot use any of the examples I tried with "nim c -r somexample.nim"
18:07:45Amun-Rado you have nimble and nimgl installed?
18:08:03anddamI do
18:08:21Amun-Rawhat's the error?
18:08:22anddamI just updated nim to 1.6.4, cleaned all nimble packages, installed nimgl with "nimble install nimgl"
18:08:52anddamalso I cloned nimgl/nimgl , updated its submodules for good measure and moved into examples/
18:09:44anddamoh twait, twebgl does work, floating green window
18:10:10anddamtopengl says /home/anddam/Development/nim/nimgl-nimgl-git/examples/topengl.nim(5, 8) Error: cannot open file: glm
18:10:28anddamtimgui says could not load: cimgui.so
18:10:52anddamthis I stumbled on already and Yardanico_ helped building cimgui lib
18:11:20anddambut what I gather from then was that I needed to do that because I was trying to use nimgl/imgui repo, that was not packaged for nimble
18:11:51anddamnow I am installing a nimble package, I somehow expected things to work, or at least to tell me "you need to install this and this other library as well" someplace
18:23:14FromDiscord<b4mbus> In reply to @b4mbus "what would be the": ok I got it with `string.reversed().insertSep(' ', 2)`
18:26:43FromDiscord<rishav> For options, is it possible to pack something in the none return? I want both the success and failure states to pass some extra information.↵For example, i really want to return something like `none(42)` instead of `none(int)`.↵Anyway to achieve this?
18:27:37Amun-Ranope, none is none
18:28:24FromDiscord<demotomohiro> How about to return tuple? like `return (none, 42)`
18:28:37Amun-Ralooks like you need a tagged union or sth
18:29:40FromDiscord<rishav> sent a code paste, see https://play.nim-lang.org/#ix=3Pwp
18:33:35*jjido joined #nim
18:33:45FromDiscord<auxym> Consider this? https://github.com/arnetheduck/nim-result
18:34:50FromDiscord<auxym> In reply to @haolian9 (高浩亮) "are there resources for": not aware of anything except manual or c2nim docs. You're right though that extra docs would be needed. Do feel free to ask questions here.
18:42:32FromDiscord<Waldecir Santos> @haxscramper the matched variable is passed by ref if not how should I do it ? I'm matching identdefs looping and changing some values but it get lost after I leave the if matches context
18:44:05*jmdaemon joined #nim
18:44:39FromDiscord<haxscramper> there is no "pass by ref" in nim, there is a `ref` type, it is different from C++ `&` ref. And match branch creates a number of `var matchedName` placeholders that get assigned to it
18:45:13FromDiscord<haxscramper> `if matches()`'s scope is created by `if`, so all variables injected by `matches` are available only in `if` scope
18:45:34FromDiscord<Waldecir Santos> This is what I did, basically "replaces" a Ident Node with a PragmaExpr:
18:45:41FromDiscord<Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3Pwz
18:46:12FromDiscord<haxscramper> there is no matching call here
18:46:17FromDiscord<Waldecir Santos> Got it any advice for using the match and replace the body part in a macro
18:46:45FromDiscord<Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/942492007295746108/unknown.png
18:46:51FromDiscord<Waldecir Santos> Here it's the full test code.
18:47:01FromDiscord<haxscramper> https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html
18:47:17FromDiscord<haxscramper> this is an article I wrote for use of the library in pattern matching
18:47:21FromDiscord<haxscramper> in macros
18:47:50FromDiscord<Waldecir Santos> sure, thank you
18:48:08FromDiscord<haxscramper> well, you are using it correctly, at least as far as matching is concerned
18:48:22FromDiscord<Waldecir Santos> Glad to hear it, thank you
18:48:44FromDiscord<haxscramper> also https://www.youtube.com/watch?v=GJpn6SfR_1M
18:49:17FromDiscord<Waldecir Santos> Is that you ? Thanks for sharing it.
18:49:57FromDiscord<haxscramper> no, someone else made a series of videos on nim, and one of them was about pattern matching
19:08:21*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:10:58*rockcavera joined #nim
19:10:58*rockcavera quit (Changing host)
19:10:58*rockcavera joined #nim
19:16:10FromDiscord<haolian9 (高浩亮)> i almost have no concept about FFI, in which case i hardly can ask question using accurate keywords; but thanks to mention c2nim that shows me a light!↵(@auxym)
19:20:35FromDiscord<auxym> In reply to @haolian9 (高浩亮) "i almost have no": Check this out for FFI against a dynamic library: https://xmonader.github.io/nimdays/day03_libmagic.html
19:21:37FromDiscord<auxym> static library is similar but you'd use the `header` pragma instead of `dynlib`. And somehow link the lib in your build
19:23:17FromDiscord<auxym> eg using `--clib` or `{.link.}` or `{.compile.}`
19:28:44*jjido joined #nim
19:33:48*vicfred joined #nim
19:34:14*vicfred quit (Remote host closed the connection)
19:34:37*vicfred joined #nim
19:37:23*PMunch quit (Quit: leaving)
19:59:23*vicfred quit (Quit: Leaving)
20:14:56*Gustavo6046 joined #nim
21:39:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:51:43*arkurious quit (Quit: Leaving)
22:21:45*jjido joined #nim
22:33:30*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:16:22FromDiscord<abdu> What this error solution :↵Error: unhandled exception: Can't obtain a value from a `none` [UnpackDefect]
23:17:20nrds<Prestige99> Need to check if yourOption.isSome first?
23:17:39nrds<Prestige99> https://nim-lang.org/docs/options.html#isNone%2COption%5BT%5D isNone and isSome
23:19:42*Gustavo6046 quit (Quit: Leaving)
23:23:26*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
23:24:34FromDiscord<Elegantbeef> TO elaborate `Defect` s are logical issues which can easily be resolved with checks like prestige eluded to
23:27:14*jmdaemon joined #nim
23:35:13arkanoidhow can I write and get a list with parsecfg?
23:35:20arkanoidit seems only key:value
23:35:58FromDiscord<Elegantbeef> The jovial side of me cannot help but say "use toml" 😀
23:36:18FromDiscord<Arathanis> or yaml
23:37:05FromDiscord<Arathanis> i think config files which are generally `ini` files are pretty strictly key:value (as string). But if you know its a string representation of a list it shouldn't be too hard to parse your sequence our using split, etc
23:37:17FromDiscord<Arathanis> (edit) "our" => "out"
23:37:21arkanoidyeah but it is ugly
23:37:30arkanoidwell, let's move to yaml
23:37:58FromDiscord<Arathanis> well if you make a nice proc to parse the sequence out you can make it beautiful but i like yaml a lot better anyway so I cant say I disagree with you
23:42:56*xet7 quit (Read error: Connection reset by peer)
23:54:15FromDiscord<huantian> to misquote a youtuber, I use yaml because I love myself
23:58:30*xet7 joined #nim