<< 11-10-2019 >>

00:03:27*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:21:48*lritter joined #nim
01:13:41FromDiscord<krab4t> hello here, in c++ i can write `if not ` like: ` if !string.startWith("#")`
01:14:03FromDiscord<krab4t> nim has something like if !expr ?
01:18:13rayman22201It's just the word "not"
01:18:17rayman22201like Python
01:18:49rayman22201quick example: https://play.nim-lang.org/#ix=1Yi9
01:20:01FromDiscord<krab4t> perfect, thanks
01:21:09*skoude joined #nim
01:25:17*skoude quit (Ping timeout: 240 seconds)
01:30:33FromDiscord<Lunar> When compiling a Nim script, is it possible to hide the ``Hints``?
01:30:56FromDiscord<Lunar> I know the request sounds weird, but I need to compare errors quickly as I'm on a time limit
01:31:11FromDiscord<Lunar> Time limit between scripts execution, not in general
01:39:14shashlickSee the verbosity flag
01:51:49FromDiscord<Lunar> Wouldn't the verbosity flag *show* more? I want to show *less* 😂
02:02:23rockcaveraI was looking at winlean and noticed that the type DWORD is set to int32, but according to microsoft documentation it's a uint32. Why this?
02:04:41rockcaveraso does ULONG
02:05:34*traviss joined #nim
02:11:17shashlickSet it to 0
02:11:43FromDiscord<krab4t> how you use enums in nim? https://play.nim-lang.org/#ix=1Yif like line 11
02:49:07*rockcavera quit (Read error: Connection reset by peer)
02:49:25*rockcavera joined #nim
02:49:25*rockcavera quit (Changing host)
02:49:25*rockcavera joined #nim
02:49:42*seerix joined #nim
02:49:48*seerix_ joined #nim
02:49:56*seerix_ quit (Remote host closed the connection)
02:51:20shashlickjust use $Show
02:56:49*lritter quit (Ping timeout: 265 seconds)
02:57:09*lritter joined #nim
03:22:01*theelous3 joined #nim
03:33:19*yumaikas is having some speed bumps using karax
03:34:59FromDiscord<krab4t> if line.startsWith($Visibility.Show):
03:43:11*chemist69 quit (Ping timeout: 276 seconds)
03:44:47*chemist69 joined #nim
03:54:26*rockcavera quit (Read error: Connection reset by peer)
03:55:07*rockcavera joined #nim
03:55:07*rockcavera quit (Changing host)
03:55:07*rockcavera joined #nim
04:01:12*Traviss__ joined #nim
04:03:16FromGitter<me7> Hi all, don't quite sure IRC is correct place or not, I just get quicker answer if ask here. Please let me know if here is not a right place
04:04:05FromGitter<me7> I'm working on https://github.com/nim-lang/Nim/issues/2408 which is 4 years bug that tag as #easy #feature
04:04:51*traviss quit (Ping timeout: 250 seconds)
04:04:53leorizeirc is always the correct place to ask :)
04:05:05FromGitter<me7> But I'm not quite sure where to start (e.g. which file to modify to add this feature),could someone give me a clue?
04:05:44FromGitter<me7> Note: I'm new to nim-lang, bare with me if I ask kinda dump question ;)
04:07:19leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/system/dyncalls.nim#L77
04:07:22leorizehere you go :P
04:07:32leorizeit's literally mentioned in the issue you linked
04:12:30*laaron joined #nim
04:13:07*radsoc joined #nim
04:15:59*rockcavera quit (Remote host closed the connection)
04:17:48FromDiscord<Rika> does nim have something for partial functions or do i make my own macro lmao
04:26:02*dddddd quit (Ping timeout: 240 seconds)
04:27:27leorize@Rika: make a closure :P
04:27:46leorizethe sugar module got some sugar for that
04:29:10*dddddd joined #nim
04:31:31*nsf joined #nim
04:41:05FromGitter<gogolxdong> How to echo a JsObject type variable?
04:41:47FromGitter<me7> @leorize thank you
04:41:55leorize@gogolxdong use console.log() on it
04:42:00FromDiscord<treeform> rockcavera, I also noticed winlean using signed and unsigned oddly. I think it due to the fact that C just auto converts types that are similar enough while Nim is more strict.
04:51:02FromGitter<gogolxdong> aha,forget about that. thanks
04:52:41*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
04:54:09*laaron joined #nim
04:55:04*radsoc quit (Quit: radsoc)
04:55:06*laaron quit (Client Quit)
04:55:24*laaron joined #nim
04:56:11FromDiscord<Rika> closures are so eeeeeeeeeeeeeee tho
04:56:24FromDiscord<Rika> okay whatever i will
04:59:21*laaron quit (Client Quit)
04:59:40*laaron joined #nim
04:59:50*laaron quit (Remote host closed the connection)
05:00:56*radsoc joined #nim
05:28:09*Traviss__ quit (Quit: Leaving)
05:28:31*traviss joined #nim
05:30:23*laaron joined #nim
05:32:42*actuallybatman left #nim (#nim)
05:35:14*laaron quit (Client Quit)
05:35:15*narimiran joined #nim
05:36:44*dddddd quit (Remote host closed the connection)
05:45:18*radsoc quit (Quit: radsoc)
05:47:47*ldlework_ joined #nim
05:48:59*federico3_ joined #nim
05:49:51*deepend_ joined #nim
05:50:09*jmiven_ joined #nim
05:50:27*nixfreak_ joined #nim
05:51:23*Ekho- joined #nim
05:53:49leorize@Rika what's wrong with closures?
05:54:35*ldlework quit (Quit: co'o ro do)
05:54:35*deepend quit (Remote host closed the connection)
05:54:35*Ekho quit (Remote host closed the connection)
05:54:35*federico3 quit (Remote host closed the connection)
05:54:35*jmiven quit (Ping timeout: 245 seconds)
05:54:35*nixfreak quit (Ping timeout: 245 seconds)
05:54:35*Amun_Ra quit (Ping timeout: 245 seconds)
05:54:35*tribly quit (Ping timeout: 245 seconds)
05:55:13*Amun_Ra_ joined #nim
05:55:14*tribly joined #nim
05:55:15*deepend_ is now known as deepend
06:01:15FromGitter<mratsim> The only way to do currying is via closures, even if you have a curry macro it will have to create closures (even in a functional language)
06:04:07*Amun_Ra_ is now known as Amun_Ra
06:11:45*radsoc joined #nim
06:12:41*mal`` quit (Ping timeout: 276 seconds)
06:13:46*mal`` joined #nim
06:14:22*radsoc quit (Client Quit)
06:38:26*deepend quit (Quit: o/)
06:38:52*deepend joined #nim
06:39:11FromDiscord<krab4t> well i have to admit nim is cool language https://play.nim-lang.org/#ix=1Yiz basically got all unique tokens in file in 5-10 code lines
06:40:51FromDiscord<krab4t> ` var map = newSeq[string]() ` this is basically std::list (c++)?
06:51:59*PMunch joined #nim
06:53:09*LargeEpsilon joined #nim
06:55:54*solitudesf joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:03:03*skoude joined #nim
07:04:51*gmpreussner joined #nim
07:09:11FromGitter<alehander42> Zevv, so how fast can your parser parse
07:09:12FromGitter<alehander42> 2 mb json
07:10:24FromGitter<alehander42> 12 mb
07:11:26*thomasross quit (Ping timeout: 268 seconds)
07:11:28*krux02 joined #nim
07:14:05*thomasross joined #nim
07:14:35PMunchalehander42, he cited 0.4Gb/s earlier, so I guess ~30ms
07:15:04PMunchBit depending on latency vs. throughput though of course
07:15:12PMunchNot sure how that figure scales
07:21:00Zevvalehander42: indeed, my current test does about 400Mb sec, but depends on the corpus of course
07:26:40*gangstacat quit (Quit: Ĝis!)
07:27:53*gangstacat joined #nim
07:28:30*couven92 joined #nim
07:30:17*minierolls quit (Ping timeout: 240 seconds)
07:36:02*solitudesf quit (Ping timeout: 240 seconds)
07:36:20*solitudesf joined #nim
07:37:04FromGitter<alehander42> hmmm
07:37:06FromGitter<alehander42> interesting
07:37:31FromGitter<alehander42> i found out i have a lot of unneeded stuff: all my objects have the same keys, so i can just use arrays for repr
07:37:41FromGitter<alehander42> but my previous run was like 12 seconds
07:37:43FromGitter<alehander42> very strange
07:37:49FromGitter<alehander42> (not with stdlib tho)
07:37:52*Trustable joined #nim
07:40:53PMunchHmm, why are these consts and not an enum? https://nim-lang.org/docs/httpcore.html#10
07:42:04FromGitter<alehander42> http://irclogs.nim-lang.org/19-09-2016.html#19:48:27
07:42:10FromGitter<alehander42> its in the comments :O
07:42:17Zevvit seems the httpcode allows for everything from 0 to 599, but only a numer are actually defined
07:45:31PMunchYeah I get that it accepts a whole range, there are custom codes after all. But why are the constants not an enum?
07:45:46PMunchWith the number set to the correct value
07:46:25PMunchFor example: 527 Railgun Error
07:48:26*solitudesf quit (Ping timeout: 240 seconds)
07:54:20FromDiscord<Kiloneie> Finally internet D:. i got unplugged for a day, stone age.
07:56:07Zevvdude, read a book :)
07:57:16*ng0 joined #nim
08:00:27*navinmistry joined #nim
08:03:57*alexander92 joined #nim
08:04:55*skoude quit (Ping timeout: 250 seconds)
08:06:04leorizePMunch: because you don't need a yet another http code type?
08:06:24*navinmistry quit (Remote host closed the connection)
08:06:30alexander92hm, what are you going to do with comments
08:07:26PMunchleorize, but then you could enumerate the known codes..
08:07:31PMunchWhich is now impossible
08:07:48PMunchalexander92, not sure yet..
08:08:34PMunchI was thinking that I could simply check if the first node immediately after a doc-comment was a return statement I would take that. But that doesn't work through templates
08:09:05alexander92but why do you need to check that
08:09:15alexander92it can be result or if with ret
08:10:36FromDiscord<Kiloneie> i don't have many books, and i prefer my topics, not some weird ass ancient reads we got in our house D:
08:10:54PMunchKiloneie, get an e-reader :)
08:11:15PMunchalexander92, I mean to grab the doc-comment
08:11:25PMunchIf it is on the same line as a statement it will be added to a hidden variable
08:11:31PMunchSo it needs to be on a separate line
08:12:12PMunchBut that means that I need some way of knowing what it is meant to document
08:13:09PMunchBut I guess for this I could just force the return type, and then create some macro for returning errors.
08:13:16*asymptotically joined #nim
08:13:35PMunchHmm, why is an exceptions name a cstring, but the message a string?
08:15:19Araqfaster code
08:15:58AraqPMunch: IMHO your e(value, "comment here") is really nice
08:17:29PMunchI don't like it because it's not obvious that the string is a comment that will only go in the documentation and not something that will be present in the code..
08:18:03Araqit's obvious to anybody who actually read your 'e' thing
08:20:42alexander92its a bit like the _ in translation
08:20:43alexander92libs
08:20:52alexander92btw json decoding is *slow*
08:20:54alexander92for my file
08:21:02alexander92like, 0.2 seconds with ruby
08:21:29alexander92and ~1-2 seconds with stdlib json, 4 if i add `to`, 0.9 seconds with json-serialization
08:21:53alexander92i'll try packedjson now, and the zevv json
08:21:56*ng0 quit (Ping timeout: 260 seconds)
08:22:16alexander92maybe my data structure is just not good for nim
08:22:31alexander92as i have seq[Table[string, seq[seq[array[2, int]]]]]
08:22:35alexander92maybe it leads to many allocations
08:23:46leorizethat data structure is not good for probably anything :P
08:24:24*ng0 joined #nim
08:25:01PMunchAraq, yes, but all code is obvious to the person writing it
08:25:44PMunchI'm not concerned about people reading the documentation for explanations and using it, I'm concerned about the person looking at the code later and not understanding what's going on.
08:26:09FromDiscord<djazz> I want to write a program using GStreamer, but converting Gst, Glib etc to nim seems like a pain (tried c2nim and nimgen)
08:26:29FromDiscord<djazz> found Gintro, but it doesnt have Gst bindings
08:26:58leorizedon't use gstreamer, please
08:27:05leorizeuse ffmpeg
08:27:13leorizegstreamer is a heap of security bugs
08:28:08FromDiscord<djazz> I wanna make something like Snowmix (headless video mixer) with Nim
08:28:47FromDiscord<djazz> I love ffmpeg on the command line, but I dread its api
08:29:31alexander92ok never mind me i am guilty sorry
08:29:38alexander92all the json-s are fast
08:29:41alexander92i forgot -d:danger
08:29:53*navinmistry joined #nim
08:30:02leorizejust annotate the slow code path with {.checks: off.}
08:30:15leorizeafter you are sure that it won't explode ofc
08:30:43*kungtotte quit (Quit: WeeChat 2.6)
08:31:37*kungtotte joined #nim
08:31:41leorize@djazz: well if gstreamer supports gintrospection, then you can modify gintro generator to generate for that also
08:32:26alexander92good suggestion
08:32:32alexander92but the problem is the lib i use from those 3
08:32:41alexander92errors with -d:release on my file
08:32:50alexander92but works fine with default options
08:32:52alexander92strange
08:37:52*narimiran quit (Remote host closed the connection)
08:38:45*narimiran joined #nim
08:44:15*navinmistry quit (Remote host closed the connection)
08:47:03PMunchHmm, what would be the best way to get a static number from a type? Namely I have exceptions like Http404Exception which is inherits from HttpException. Now I want to get the error code from a `except HttpException as e` context.
08:47:30*LargeEpsilon_ joined #nim
08:48:20*navinmistry joined #nim
08:50:10leorizemaybe you should not have exceptions like that...
08:50:48leorizeadd a field in HttpException that stores the response code
08:51:00*LargeEpsilon quit (Ping timeout: 246 seconds)
08:51:41*shomodj joined #nim
08:51:50PMunchProblem is I want to track which exceptions can be raised with the effects system
08:52:07PMunchSo I need them to be separate exceptions
08:52:46alexander92well
08:52:53PMunchAnd I don't want to add a code field to the HttpException and set that. Because then you could create a Http404Exception with a code set to 500
08:52:54alexander92you can still get a field
08:53:19alexander92but can you have a custom message
08:53:28alexander92otherwise just dont expose the tyupes
08:53:33alexander92create singletons
08:53:34PMunchI want this to only be a compile-time thing
08:53:40PMunchWhat do you mean
08:53:53leorizePMunch: well, if you must, since they are inherited, the `of` operator should work
08:53:54alexander92ah
08:54:01alexander92well, of is runtime
08:54:20alexander92but you cant possibly get the error code from except HttpException
08:54:25leorizehe wants to catch it from the `except as` context
08:54:25alexander92at compile time
08:54:33alexander92not really
08:54:41PMunchHmm, I guess the resolution of inheritance will always be runtime..
08:54:51PMunchYeah
08:55:18alexander92well, think about it
08:55:28alexander92you want to show which exceptons are handled
08:56:21alexander92in this case imo the user has to use except Http404Exception
08:56:26alexander92to handle that etc
08:57:15PMunchWell I want the routes to know which exceptions it can throw, but then have the router just catch all and transform them into the correct error.
08:58:44*theelous3 quit (Ping timeout: 268 seconds)
09:00:32alexander92well, then the
09:00:36alexander92functions that it calls
09:00:46alexander92must raise only certain exceptions
09:01:28alexander92i get it
09:01:35leorizeis exception really the way to go?
09:01:37alexander92so you want to access inferred effects
09:01:41alexander92in your macro
09:01:45alexander92i doubt this is possible
09:01:53alexander92i think effect tracking is in the end of sem checking
09:02:28alexander92interesting, i was looking at the zig making of doc generator
09:02:39alexander92and they had also some kind of error inference thing
09:02:46alexander92you might want to check it out for comparing
09:03:02FromDiscord<djazz> is it possible to get the output of a command during compile-time?
09:03:10PMunchHmm wait, you can't get effects in a macro?
09:03:21alexander92https://twitter.com/andy_kelley/status/1181683871894704133
09:03:27leorize@djazz: staticExec
09:03:37alexander92not saying its good or bad, just relevant
09:03:48FromDiscord<djazz> thx
09:04:09alexander92well, think about it
09:04:19alexander92you run the macro in the beginning of the program
09:04:26alexander92then its expanded
09:04:36PMunchShit.. you're right
09:04:37alexander92and them semantic passes are run onto the expanded code
09:04:55alexander92effects need to know the end result of your macro etc
09:05:06alexander92there must be a way to do it tho
09:05:17alexander92e.g. there was a pragma like effects
09:05:29leorizePMunch: what are you trying to do?
09:06:20PMunchleorize, https://peterme.net/scraps/web-frameworks-in-nim.html
09:09:32PMunchEssentially I want each route to be a procedure with an input and on output type, the router will have serialisers that take the input from either query parameters or a POST body and call the route, then the output will be serialised into whatever output format is wanted. The exceptions come in as since we return a type we can't return errors.
09:10:14PMunchSo the documentation for that route procedure would then list the input of the procedure, the output, and any possible error code it could return.
09:10:47PMunchThat information could then in turn be used to generate API documentation
09:15:48PMunchHmm, can a template check if it is called in a proc that has a custom pragma?
09:16:06leorizeif a macro can, a template can
09:16:10leorizebut you'd need `when`
09:16:34PMunchWell a macro can use `hasCustomPragma`, but that takes a field
09:17:16PMunchI have a template `resp` that I want to only allowed when called in a proc that has the `route` pragma.
09:17:25*navinmistry quit (Remote host closed the connection)
09:17:39*navinmistry joined #nim
09:18:11federico3_PMunch: https://github.com/nim-lang/needed-libraries/issues/107 look at hug
09:18:45*Vladar joined #nim
09:19:24PMunchfederico3_, yeah I've already seen hug :)
09:19:43PMunchAnd yes, I know I can create a macro that inserts the template in the body, but is that the only way?
09:19:58leorizeyea
09:20:29leorizemake a `resp` template outside with the {.error.} pragma so that you can still have documentation
09:22:01PMunchOf course :)
09:23:27*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:25:55alexander92hm
09:26:12alexander92i think it would be very hard to do so
09:26:26alexander92without making your own error tracking
09:26:50alexander92the other option is to
09:26:58alexander92make each resp generate a function
09:27:17alexander92and make nim generate inferred errors for functions after compilation and post process
09:28:02alexander92overally, adding inferred errors to documentation is a valid problem
09:28:06alexander92for nim the language itself
09:28:23*dom96 quit (Ping timeout: 245 seconds)
09:29:07PMunchHmm, how do you actually set the "op" parameter for quote?
09:30:30leorizeuse a template :P
09:31:39PMunchHuh?
09:31:44*dom96 joined #nim
09:31:44*dom96 quit (Changing host)
09:31:44*dom96 joined #nim
09:32:35PMunchBrb, lunch
09:33:01leorizemake a myQuote template that calls quote with the body and your desired op
09:33:29alexander92sort of
09:33:35alexander92a custom Result[set error]
09:33:37alexander92type
09:33:50alexander92and somehow passing all the possible errors
09:34:16alexander92and typechecking with a pragma
09:35:45alexander92hm i got another idea
09:36:08ZevvI have something rather nasty I can not explain: I have a pretty deep call stack inside macros and I want to do proper error reporting on the original NimNodes. I find passing the NimNode all the way down cumbersome, so I've made a little global `gCurrentNode: NimNode`. When interating the top level node in my macro I assign the current NimNode to this global, and then there's my own `error()` wrapper that
09:36:14Zevvcalls the original `error()` with the global stored node.
09:36:32ZevvBut somehow, this messes up the original AST somehow - if I dump/repr the passed code I get seemingly random copies of stuff in my tree
09:36:53FromDiscord<Kiloneie> Huh ?, i literally also copied the example from Tables module and it did the same...
09:36:53FromDiscord<Kiloneie> https://cdn.discordapp.com/attachments/371759389889003532/632149597648846848/what.PNG
09:37:03Zevvso could this temporary storing/copying of a nimnode mess things up? Forgot to say gCurrentNode is {.compileTime.}
09:37:52alexander92but if you dont dump/repr it
09:37:54alexander92does it change
09:38:11alexander92oiii Kilo
09:38:17alexander92thats a very good bug good one
09:38:24alexander92i guess what happens is that your file
09:38:28alexander92is called Tables.nim
09:38:33FromDiscord<Kiloneie> ohhh...
09:38:36FromDiscord<Kiloneie> xD
09:38:43alexander92and maybe module names are case insensitive? not sure?
09:38:54alexander92and iirc nim has a problem when you import a in a
09:39:04*federico3_ is now known as federico3
09:39:13alexander92but we need an error
09:39:22alexander92for that
09:39:30FromDiscord<Kiloneie> i've had file naming problems before... Nim hates spaces in file names
09:40:07narimiranspaces in file names? you like to live dangerously!
09:40:11alexander92yeah
09:40:13alexander92hm https://github.com/nim-lang/rfcs/issues/91
09:40:23alexander92is another rfc for this, but probably impossible
09:40:30alexander92i wonder if one can design an effect system
09:40:39alexander92which is usable in macro
09:42:46*Vladar quit (Remote host closed the connection)
09:42:49alexander92PMunch solved it!
09:42:58alexander92just dont infer.
09:43:28*NimBot joined #nim
09:43:34alexander92so e.g.
09:43:51alexander92resp:
09:44:00alexander92 error 404, 500, 403
09:44:02alexander92 code
09:44:15alexander92this way it would be visible in the code
09:44:28alexander92compile checke
09:44:55alexander92(without the case where actually nothing raises 403: not sure if those are checked
09:45:01alexander92and easy to document
09:45:20alexander92and if you forget to write, the compiler would tell you
09:45:26alexander92what codes you need
09:46:26ZevvI'm having a hard time differentiating between alehander42 and alexander92
09:46:58narimiranZevv: well the difference is quite huge (50)
09:47:35Zevvactually, it's just 1 bit + 3 bits
09:47:36narimiranimagine if he also was alexander90 on discord
09:49:17*shomodj joined #nim
09:50:30alexander92sorry
09:50:37alexander92no many alexanders around anyway
09:50:45Zevvabout my above answer: my workaround is to extract the lineinfo and store that, instead of the nimnode itself
09:51:23alexander92i am sasho as well
09:52:24alexander92https://keleshev.com/automatic-compiler-pass-fusion
09:52:24leorizealexander92, @Kiloneie: module names are case-insensitive on windows
09:52:27alexander92cute idea
09:52:34leorizea walkaround is to `import std/tables`
09:55:22FromDiscord<Kiloneie> Okay, i put that into my notes.
09:55:48FromDiscord<Kiloneie> Does anyone have any good Block statement examples ? i seriously can't figure out a good one xD...
09:56:27alexander92generally
09:56:27narimiranyou mean `block foo: ...`?
09:56:32alexander92ah
09:56:35FromDiscord<Kiloneie> yes
09:56:36narimiranyou can use it to exit double loop
09:56:40FromDiscord<Kiloneie> i know
09:56:53narimiranyou have `block outer: ....... break outer`
09:56:53FromDiscord<Kiloneie> but i can't figure out a good double loop example o,o
09:58:36narimiranhere is where i used it: https://github.com/narimiran/AdventOfCode2018/blob/master/nim/day03.nim
09:59:20narimiranbut i guess that won't make much sense if you don't see (part 2 of) that AoC task
10:00:02FromDiscord<Kiloneie> i gotta figure out, a good example for beginners, i used block statement only once so far xD
10:00:18narimiranheh, you have plenty of stuff there to use for some videos: templates, .inject., scanf, block, ... :)
10:00:21FromDiscord<Kiloneie> for Roman literals exercism exercise
10:00:46FromDiscord<Kiloneie> yeh i just did a to do list, because im kinda lost on what to do, so i picked tables for today
10:00:54FromDiscord<Kiloneie> they seem easy enough to explain
10:01:14narimiran"im kinda lost on what to do" lol, you don't plan in advance?
10:01:15FromDiscord<Kiloneie> especially since i did tuples, i can make a Godot like vector and use that as an example
10:01:23FromDiscord<Kiloneie> so far i really didn't...
10:01:41FromDiscord<Kiloneie> i just went with whatever i thought of and did, then looked back on what i did so far, and just did something xD
10:02:01FromDiscord<Kiloneie> it worked so far...
10:02:22FromDiscord<Kiloneie> didn't make anything too advanced, and made sure everything tied in nicely.
10:02:25narimiranand it will work forever, by induction :P
10:03:09FromDiscord<Kiloneie> i am 2 videos behind now, because i spent time experimenting when i should of just made a video xD... also yesterday was not my fault, i freaked out i had no internet D:
10:03:53FromDiscord<Kiloneie> woke up and no internet... O,O, you know your brain is gonna have a meltdown when you wake up and check your views, watch some youtube video when working out and then you can't...
10:05:23FromDiscord<Kiloneie> i might soon go into 5 videos per week mode.
10:05:53FromDiscord<Kiloneie> Real soon imma run out of easy stuff to teach, and will take way longer to make videos because i will have to spend time learning stuff myself xD
10:06:34*stefantalpalaru joined #nim
10:07:07narimiranand when i told you that you can record multiple videos in a day, but just don't publish them that frequently, so you have some backup for later, you just dismissed the idea....
10:07:26FromDiscord<Kiloneie> no i didn't
10:07:37FromDiscord<Kiloneie> i have to do that for today, and i don't think i can manage
10:07:49FromDiscord<Kiloneie> was supposed to do that yesterday too
10:07:59FromDiscord<Kiloneie> imma be hung over like hell on sunday
10:09:38FromDiscord<Kiloneie> The idea was to get the beginner stuff out fast, and i am doing that, but i kind of fell behind (my fault, got a bit lazy) then slow down a bit because it will take more time.
10:15:49*navinmistry quit (Remote host closed the connection)
10:19:51FromDiscord<Kiloneie> Is there any particular reason why Tables are not part of the System module ?
10:22:43FromDiscord<Kiloneie> Big enough to have it's own module ?
10:24:18PMunchalehander42, but that sorta breaks the auto-generating API thing
10:24:23PMunchIf you have to specify anyways :P
10:24:58FromGitter<alehander42> yeah :(
10:25:18FromGitter<alehander42> but otherwise in your code
10:25:25FromGitter<alehander42> you cant really see what errors might happen
10:25:27FromGitter<alehander42> only in your docs
10:25:30FromGitter<alehander42> which is also strange
10:25:41PMunchleorize, do you have an example of such a macro?
10:25:48PMuncherr, template
10:26:48FromGitter<alehander42> PMunch you're right
10:27:07FromGitter<alehander42> but for this to be solved i think you need to solve the general "generate inferred exceptions in nim docs"
10:27:24FromGitter<alehander42> and this would probably require nimdoc patching
10:27:28PMunchWell that already happens
10:27:36PMunchThe exceptions are put in the docs
10:27:58FromGitter<alehander42> hm, yeah, i see useEffectSystem
10:28:11FromGitter<alehander42> so in this case you can post process those docs
10:28:15FromGitter<alehander42> i cant really see other way
10:28:16PMunchAnd I could format the doc output with the output from `nim jsondoc`
10:28:32FromGitter<alehander42> oh thats great
10:28:37PMunchMhm
10:28:38FromGitter<alehander42> well in this case
10:29:03FromGitter<alehander42> you can generate functions with autogenerated name like repr_api_mylib_21 etc
10:29:19FromGitter<alehander42> so one can be sure that they are the same as in the docs
10:29:23FromGitter<alehander42> but actually does nimdoc
10:29:30FromGitter<alehander42> generate docstring for generated functions?
10:32:14*skoude joined #nim
10:33:02PMunchHmm, why do I get an "Invalid pragma" error when I use a custom pragma along with a macro?
10:33:38PMunchalehander42, yes, as long as they are exported
10:34:47PMunchIt could also use some clever checks to only generate them when you do nim jsondoc -d:generateAPIinfo
10:35:04PMunchWhich the tool could do
10:36:54leorizePMunch: https://play.nim-lang.org/#ix=1Yji
10:39:17*LargeEpsilon_ quit (Ping timeout: 252 seconds)
10:39:18PMunchThe invalid pragma struggle: https://play.nim-lang.org/#ix=1Yjj
10:39:37PMunchleorize, that is exactly what I tried!
10:39:41PMunchBut it didn't work :P
10:39:50PMunchI just went with the old getAst method instead
10:40:03leorizesounds like a bug to me :P
10:41:08PMunchYeah, it smells like a bug
10:41:27Zevvshoult it look like this then? https://play.nim-lang.org/#ix=1Yjk
10:45:53FromGitter<alehander42> https://play.nim-lang.org/#ix=1Yjj
10:46:09FromGitter<alehander42> no https://play.nim-lang.org/#ix=1Yjm
10:46:51FromGitter<alehander42> it works
10:47:00leorizeZevv: instruction unclear, crashed compiler instead: https://play.nim-lang.org/#ix=1Yjn
10:49:19Zevvha :)
10:50:22PMunchalehander42, but now it doesn't have a custom prama any longer..
10:50:25ZevvI once tried afl fuzzy lop on nim, but I think we need a few more years for that
10:52:50*alexander92 quit (Ping timeout: 276 seconds)
10:53:25*lritter quit (Remote host closed the connection)
10:54:14*LargeEpsilon_ joined #nim
10:55:05PMunchHmm, not even this works :S https://play.nim-lang.org/#ix=1Yjs
10:56:36*alexander92 joined #nim
10:59:45PMunchHmm, this works https://play.nim-lang.org/#ix=1Yju
11:00:08PMunchOf course I want to share that pragma across multiple procedures, so I can't generate it every time
11:01:12*encryptize[m] quit (Quit: 30 day idle timeout.)
11:03:36PMunchHmm, the thick plottens: https://play.nim-lang.org/#ix=1Yjw
11:04:01*gh0st[m] quit (Quit: 30 day idle timeout.)
11:04:02PMunchFor some reason it's fine to redefine the test pragma, but only the last instance of it will actually be detected..
11:05:09alexander92i debug it
11:06:07alexander92the problem is
11:06:13alexander92hasCustomPragma detects it as sym
11:06:15alexander92instead of ident
11:06:20alexander92sem*
11:07:42*jaens[m] quit (Quit: 30 day idle timeout.)
11:08:32alexander92i fixed it
11:08:37alexander92but not sure if my fix is good
11:11:08alexander92thank God, it seems to work
11:11:54PMunchHow did you fix it?
11:12:55alexander92https://github.com/nim-lang/Nim/pull/12414
11:13:08alexander92ops pushed additional file moment
11:13:56alexander92yep now should be there
11:14:06alexander92oh .. removing debug echo
11:14:49alexander92yes
11:16:18PMunchHmm, and what exactly does that do?
11:16:32alexander92it fixes your bug
11:16:43alexander92basically test came as nkSym
11:16:48alexander92in the last case
11:16:51PMunchHaha :P
11:16:51alexander92instead of nkIdent
11:16:59PMunchHmm
11:17:04alexander92probably when its defined or used
11:17:09alexander92not sure why this happens
11:17:18alexander92but your example works with it: needs review
11:17:45PMunchMaybe you should add my example to the PR, so it's obvious why this change is needed?
11:17:49alexander92yes, i did
11:17:58alexander92but yeah, as a test case?
11:18:05alexander92i'd see if the current tests pass
11:18:07alexander92first
11:20:20PMunchHave we gotten another pipeline it needs to run through now?
11:24:17*skoude quit (Ping timeout: 240 seconds)
11:24:50PMunchCan confirm that it works though when I pull the fix locally
11:25:07alexander92oh lunch
11:25:12alexander92hm, good
11:25:26*adeohluwa joined #nim
11:25:30alexander92what do you mean by popepline
11:25:35alexander92pipeline
11:26:03PMunchThe azure-pipeline stuff that now pops up for your commit
11:26:08narimiranyep
11:26:15*sagax quit (Ping timeout: 265 seconds)
11:26:21narimiranit is faster than both existing CI services
11:26:29narimiranand it will replace them after some more testing
11:26:32PMunchBut we still have all three :P
11:26:33PMunchAha
11:26:50PMunchDamn it, with your fix my code now works. But nimlsp complains..
11:26:58PMunchSo in the editor it still looks like a bug
11:31:36alexander92hmm
11:31:39alexander92why does it complain
11:31:47*sagax joined #nim
11:31:50*fanta1 joined #nim
11:32:02PMunchBecause it is built with 1.0.0
11:32:09PMunchAnd so does its checking with that
11:32:28alexander92well, you have to rebuild it :O
11:32:36PMunchI know
11:34:17PMunchThat's unfortunately easier said than done with nimlsp at the moment :P
11:35:34*skoude joined #nim
11:36:53alexander92i need to use it with a patched nim
11:37:00alexander92so i'll have to find out how :P
11:37:47PMunchWell, it should be as simple as changing your Nim version to the correct thing
11:38:07PMunchThen building it, and then when your editor invokes it point it at the correct install
11:46:02PMunchCfP for FOSDEM is out: https://forum.nim-lang.org/t/5330#33420
11:47:25FromDiscord<sealmove> Congrats!!
11:48:57*Jjp137 quit (Ping timeout: 250 seconds)
11:50:47PMunchThanks :) Now hopefully we will get some talk submissions :)
11:58:55*solitudesf joined #nim
12:06:17PMunchHmm, did the behaviour of hash of string change?
12:06:42PMunch!eval import hashes, strutils; echo hash("Hello world").toHex
12:06:45NimBot00000000AD91570C
12:11:05alexander92good
12:13:37*narimiran quit (Ping timeout: 265 seconds)
12:23:17*nsf quit (Quit: WeeChat 2.5)
12:23:42*rockcavera joined #nim
12:24:03*skoude quit (Ping timeout: 245 seconds)
12:25:09PMunchGood?
12:29:01PMunchDamn it, nimlsp is such a pain to debug
12:30:40*rockcavera quit (Read error: Connection reset by peer)
12:30:56*rockcavera joined #nim
12:30:56*rockcavera quit (Changing host)
12:30:56*rockcavera joined #nim
12:35:21PMunchIf someone is looking for Hacktober work: github.com/PMunch/nimlsp/issues/31
12:40:14FromDiscord<kodkuce> proc countDna*(input:string): CountTable=
12:40:14FromDiscord<kodkuce> result = input.toCountTable()
12:40:14FromDiscord<kodkuce>
12:40:14FromDiscord<kodkuce> Error: cannot instantiate 'CountTable[A]' inside of type definition: 'countDna'; Maybe generic arguments are missing?
12:40:35FromDiscord<kodkuce> how do i retourn a table am i doing soemthing wrong?
12:43:36FromGitter<Lecale> Do you answer beginner level questions here, or are you all superior beings?
12:47:54PMunchBeginner questions very welcome :)
12:48:36PMunchkodkuce, CountTable needs to define what type the key is
12:49:28FromGitter<Lecale> I wanted to try nim for some data science rubbish, tried nimdata, got stuck with compilation : Could not load zlib1.dll
12:49:47PMunchkodkuce, try to put CountTable[char] as the return type and I think it should work
12:50:11PMunchLecale, ah you're missing zlib
12:50:48*navinmistry joined #nim
12:51:19PMunchNot really sure how to install that on Windows though..
12:52:02FromGitter<Lecale> I can see that I have it in my file system. What is the way to see where the file is expected to be.
12:52:57PMunchWhere in your file system is it?
12:53:32FromDiscord<kodkuce> ty Pmucnh
12:53:38FromDiscord<kodkuce> *PMunch
12:54:09PMunchNo problem :)
12:56:03FromGitter<Lecale> It's one level up from where I am compiling the basic test program, in /bin
12:56:52PMunchHmm, try to copy it to the same level?
12:56:59*navinmistry quit (Ping timeout: 250 seconds)
12:57:02PMunchI don't really know where Windows go to look for dll files..
12:57:13PMunchProbably some global directory as well
12:58:23FromGitter<Lecale> Dropping it into the same level doesn't help :( I don't know where the compiler goes when it looks for dlls to load
12:58:45PMunchProbably some system directory
12:59:33PMunchhttps://lifehacker.com/install-a-dll-file-in-windows-269063
12:59:36PMunchMaybe that works
13:03:00FromGitter<Lecale> 64bit no like 32bit type error
13:03:31PMunchHuh?
13:08:12FromDiscord<kodkuce> test "add minutes":
13:08:12FromDiscord<kodkuce> check add((10, 0), 3).toStr == "10:03"
13:08:13FromDiscord<kodkuce>
13:08:13FromDiscord<kodkuce> proc add( (hour:int, minuts:int), add_minuts:int):string= <<< GETTING ERROR HERE, duno why for me it sounds legit
13:08:13FromDiscord<kodkuce> result = "sdsd"
13:08:13FromDiscord<kodkuce>
13:08:16FromDiscord<kodkuce> expression '(hour: int, minuts: int)' is of type 'tuple[hour: Error Type, minuts: Error Type]' and has to be discarded
13:08:25PMunchPlease don't paste code into discord
13:08:32*Vladar joined #nim
13:08:32PMunchIt comes across as spam on IRC
13:08:40PMunchUse a pastesite like ix.io instead
13:09:39PMunchOr better yet share your code through play.nim-lang.org
13:10:00FromGitter<zetashift> and gitter doesn't format it nicely so it's really hard to parse
13:10:17FromDiscord<kodkuce> https://play.nim-lang.org/#ix=1YjS
13:10:21lqdev[m]same with IRC
13:10:37FromDiscord<kodkuce> hmm it says it expects closing ) but duno if am blind or what
13:10:53*dddddd joined #nim
13:11:16FromDiscord<Rika> you didnt add an argname for the tuple
13:11:18FromDiscord<kodkuce> from what i see i have a good brackets 2 ( and 2 )
13:11:24FromDiscord<kodkuce> ohhhhhhhh
13:11:26PMunchhttps://play.nim-lang.org/#ix=1YjT
13:11:34FromGitter<zetashift> yeah ^
13:11:52FromDiscord<kodkuce> sorry 🙂
13:12:03FromGitter<zetashift> PMunch beat me to it, you don't define an argument as a tuple like that
13:12:17PMunchAnd by the way, toStr is usually `$` in Nim
13:12:27FromDiscord<Rika> also if you're not using this as a learning assignment and you're looking for something like that maybe try looking into times
13:12:38FromDiscord<Rika> times the module i mean
13:13:32PMunchkodkuce: https://play.nim-lang.org/#ix=1YjU
13:13:45PMunchThat is a more Nim way of doing it
13:13:53FromDiscord<kodkuce> hmm its writed like that on exercism
13:14:15PMunchLike what?
13:14:23FromDiscord<Rika> the code, prolly
13:14:37FromDiscord<Rika> the "solution code" or someone else's code
13:15:01FromDiscord<kodkuce> https://pastebin.com/TmXXn4j2
13:15:28FromDiscord<Rika> oh hey nice TIL the suite proc/template/macro
13:15:32FromDiscord<kodkuce> this is test part of it i cant change that, masters supply it like that
13:15:45FromDiscord<kodkuce> and i am not a master 🙂
13:16:31FromDiscord<kodkuce> PS i dont look solutions until i complete it solo
13:16:37FromDiscord<Rika> well it doesnt matter, we're just telling you that `$` is equal to `.toStr`
13:16:43FromDiscord<kodkuce> i know 🙂
13:16:49FromDiscord<Rika> and nim prefers `$` to `.toStr`
13:16:50FromDiscord<kodkuce> but ty anwyay
13:18:54FromDiscord<Rika> hmm maybe i should try exercism too, but i dont like the fact i have to use a client to upload the code
13:20:11PMunchHmm, how does the nim compiler know where to find the config file?
13:20:11FromDiscord<kodkuce> duno i dont think its any spywere thingy, just simple termianl tool
13:20:38PMunchLike how does it know this: "Hint: used config file '/home/peter/.choosenim/toolchains/nim-1.0.0/config/nim.cfg' [Conf]"
13:20:45FromDiscord<Rika> no i dont mean i dont trust it, i mean i prefer how hackerrank does it
13:24:17*adeohluwa quit (Remote host closed the connection)
13:31:33FromDiscord<kodkuce> duno newer used hackerrank i dont study hats xD
13:34:18leorizePMunch: the logic is probably in compiler.nim
13:34:22leorizeoptions.nim*
13:35:19leorizePMunch: https://github.com/nim-lang/Nim/blob/4becd5a2a8d67c7481af457d5007e1a313d454c8/compiler/nimconf.nim#L234
13:35:20FromDiscord<Lunar> https://pastebin.com/8tWBZnwu
13:35:22FromDiscord<Lunar> Error:
13:35:30FromDiscord<Lunar> Error: invalid pragma: exitAllBotChat() {.noconv.}
13:35:33FromDiscord<Lunar> ``Error: invalid pragma: exitAllBotChat() {.noconv.}``
13:35:46FromDiscord<Lunar> No matter where I put the pragma, it's always invalid
13:35:54leorizeput it next to the proc itself
13:35:58FromDiscord<Lunar> I did
13:36:01FromGitter<zetashift> @Rika makes supporting multiple languages hella easier than what hackerrank does
13:36:13FromGitter<zetashift> also you can use your favorite editor!
13:36:36FromDiscord<Lunar> https://pastebin.com/DqnHJMKC
13:36:40FromDiscord<Lunar> That's the multiline error
13:37:01leorizehttps://play.nim-lang.org/#ix=1Yk1
13:37:03leorizethere you go
13:37:11leorizeremove the paren from the proc
13:37:17leorizebecause with the paren it's a proc call
13:37:29FromDiscord<Lunar> That's... confusing
13:37:31FromDiscord<Lunar> Thank you
13:37:55leorizenot really :P
13:38:45FromDiscord<Lunar> I mean, you're calling the proc like a variable. Does any other language do that?
13:39:04leorizethat's the point
13:39:08leorizesetControlCHook
13:39:11leorizetake a proc
13:39:19leorizenot what came from the proc
13:39:27FromDiscord<Lunar> Ohhh
13:39:49FromDiscord<Lunar> So you're making setControlCHook a proc, copying the contents of another proc
13:40:01leorizeit's not copying the content
13:40:11leorizethis is called a pointer to a proc
13:40:53leorizewait, I think there's a good explaination somewhere in the manual
13:41:10leorizehttps://nim-lang.org/docs/manual.html#types-procedural-type
13:41:42FromDiscord<Lunar> Thanks Leo
13:42:01PMunchleorize, hmmm. Any way I can do that?
13:42:23leorizePMunch: wdym?
13:42:45PMunchI want to find the default config file in my program
13:43:35FromGitter<Lecale> I used choosenim to reinstall and my error evaporated like magic in an oven
13:44:17leorizePMunch: you can just import compiler/nimconf then use this: https://github.com/nim-lang/Nim/blob/4becd5a2a8d67c7481af457d5007e1a313d454c8/compiler/nimconf.nim#L225
13:44:34leorizethere's also a getUserConfigPath in there
13:47:23*traviss quit (Ping timeout: 245 seconds)
13:50:06PMunch"just"
13:50:15PMunchTell me when you have a playground example..
13:50:21PMunchI've been trying to do this for a while now
13:50:53leorizedo you have the compiler package in the playground?
13:52:10PMunchDoesn't look like it, I'll settle for a regular paste
13:54:58shashlickvariation - https://play.nim-lang.org/#ix=1Yk9
13:57:12PMunchshashlick, what black magic is that?
13:57:14leorizePMunch: http://ix.io/1Yka
13:58:21shashlickthat's @timotheecour's hack to find the nim compiler directory of the active nim
13:58:22PMunchleorize, that gives the wrong file
13:58:29PMunchHint: used config file '/home/peter/.choosenim/toolchains/nim-1.0.0/config/nim.cfg' [Conf]
13:58:43leorizewhat does it give you?
13:58:49shashlickwas trying to import nimconf from there instead of having to install compiler as a lib which can go out of sync with the running compiler
13:58:59PMunchFirst echo: /etc/nim/nim.cfg
13:59:05PMunchSecond echo: /home/peter/.config/nim/nim.cfg
13:59:17PMunchshashlick, that is exactly what I'm trying to do :P
13:59:34PMunchshashlick, but how does it work?
13:59:52shashlickit doesn't 😞
14:00:06leorizePMunch: add one more parentDir() to conf.prefixDir
14:00:18shashlickhe's using currentSourceFile in strformat so you get the location of strformat.nim
14:00:27shashlickfrom there he looks for the parent dir
14:00:40PMunchshashlick, what do you mean? It seems to work for me
14:01:04PMunchOooh, clever
14:01:04leorizehttp://ix.io/1Ykc
14:01:20shashlickYa you get the location but the import fails
14:01:54PMunchStill wrong leorize
14:02:07PMunchshashlick, oh that is a minor issue :P
14:02:13FromGitter<alehander42> why
14:02:17FromGitter<alehander42> do you need the compiler
14:02:31leorizePMunch: what's the output?
14:02:45PMunchhttp://ix.io/1Ykd
14:03:03PMunchAnd the config is still in /home/peter/.choosenim/toolchains/nim-1.0.0/config/nim.cfg
14:03:11PMunchalehander42, nimlsp
14:03:14PMunchIt uses nimsuggest
14:03:19PMunchAs a library
14:03:25leorizePMunch: I see the problem now...
14:03:40leorizechoosenim created shims to the nim executable
14:03:56leorizefindExe couldn't find the actual executable that was ran
14:04:00PMunchYup
14:05:09shashlickuse the strformat method then
14:05:15shashlickfindExe doesn't work at compile time
14:05:42shashlickor use https://github.com/nimterop/nimterop/blob/master/nimterop/build.nim#L50
14:06:34*adeohluwa joined #nim
14:08:09shashlickmaybe you can pull off the import with a macro
14:09:16leorizePMunch: well I'd say the only way to make compiler-based stuff works is to put them next to the compiler itself
14:10:25PMunchThat's what I'm doing now, and lets just say it's not great..
14:10:42shashlickthis works - http://ix.io/1Ykj
14:10:58leorizethat will only work at compile time
14:11:23leorizenimlsp needs to be able to find Nim's stdlib
14:12:05shashlickdoes nimlsp compile in the compiler?
14:12:09shashlickor call it externally
14:12:18leorizeit use it as a library
14:12:54shashlickso it is compiled in?
14:12:58shashlicklike nimble used to
14:13:00leorizeyea
14:13:38shashlickwell this same method can be used to get the path to the stdlib at compile time and just use that const at runtime
14:14:35leorizeit wouldn't work if say: someone compiled nimlsp on their machine and decided to share it
14:14:46leorizewhich probably wouldn't work even if we have this sorted out
14:15:11shashlickya that's why i'm wondering
14:16:38leorizetbh if you make stuff that uses the compiler as a library, it's better be a part of the compiler
14:16:53leorizeotherwise there wouldn't be anyway to make it work out of the box atm
14:17:04alexander92i dont agree, quite a lot of stuff can use it as a library
14:17:07shashlickwell, this method now does away with needing to use the compiler library installed from nimble
14:17:12alexander92e.g. all kinds of stuff that parse nim code
14:17:24shashlickyou can just use the compiler directly as it is already there
14:17:43alexander92but if i want to distribute a library which just uses the parser
14:17:53alexander92i just want to depend on it as nimble package
14:18:06shashlickthat approach doesn't work
14:18:11alexander92well it should
14:18:25leorizei don't think the compiler api support that atm
14:18:27shashlicksince the nim.exe and its stdlib can be different from the compiler library installed
14:18:38alexander92i used it iirc
14:18:58shashlickit works but causes issues for users who have the wrong compiler installed vs running
14:19:26shashlickwith http://ix.io/1Ykj method, you can just import the compiler directly and not have any dependencies
14:19:39shashlickyou can say nim >= xyz, that's enough to lock on a minimal version
14:19:46leorizeah, you can just write a custom pass to get the AST from the parser
14:20:04leorizeas long as you don't add sem in it should work (in theory)
14:20:21leorizeshashlick: if you just wanted to parse nim then you don't need the stdlib
14:20:51shashlicki'm importing the compiler code, not stdlib in that snippet
14:21:42alexander92forgive me, you're right
14:21:47alexander92it seems as a good way
14:22:19shashlickideally nim provides a way to just `import compiler/xyz` and it should know where to pull from
14:22:26shashlickbasically add compiler to search path
14:22:42shashlickthen you don't need a second compiler instance installed
14:23:05leorizeideally nimble would acknowledge the existance of a system-wide nimble folder
14:23:31leorizethen you can just package the compiler source as a nimble package as part of the compiler distribution
14:23:45leorizenimble would detects that and stop trying to install the compiler (again)
14:24:09*adeohluwa quit (Remote host closed the connection)
14:24:56leorizecurrently on Haiku I packaged the compiler source as a nimble package
14:25:21shashlickbut you can still run into incompatibilities
14:25:31leorizethen install it on a system-wide folder, and make the compiler acknowledge that
14:25:31shashlicknim 1.0.0 trying to build with 0.20.2 compiler lib
14:25:48leorizethe compiler can find the nimble package just fine
14:25:52shashlickand if you use choosenim and go back and forth, the compiler lib might not work
14:25:52leorizebut nimble doesn't support it at all
14:26:31leorizethat's why a global nimble dir would be nice
14:26:43shashlickmy point is that a compiler library is already present with any nim install so no need to install anything else
14:27:05leorizeI know, it's even a valid nimble package
14:27:49shashlickanyway, not sure if you are saying the same thing but am in a rush so probably not understanding correctly
14:27:51PMunchHmm, doesn't "before build" work in nimble?
14:28:01shashlickit does but it doesn't
14:28:15PMunchHaha, what's that supposed to mean?
14:28:28shashlickhttps://github.com/nim-lang/nimble/issues/549
14:28:35shashlickold problems, part of the reason nimgen died
14:30:21PMunchHuh, I don't quite get what the issue there is?
14:30:29PMunchFor me it just seems like before build doesn't run
14:31:18*Jjp137 joined #nim
14:31:42PMunchLike I add a simple before build: echo "Hello world"
14:31:47PMunchBut Hello world never shows up
14:33:32*fanta1 quit (Quit: fanta1)
14:38:11*doesntgolf joined #nim
14:41:39*fanta1 joined #nim
14:46:59*PMunch quit (Remote host closed the connection)
14:47:00*abm joined #nim
14:47:14*nsf joined #nim
14:47:36*skoude joined #nim
14:52:41*skoude quit (Ping timeout: 276 seconds)
14:58:55alexander92hm, has anybody written a spreadsheet engine
14:58:57alexander92in nim
15:00:18disruptekthat's an interesting idea.
15:02:48*ng0_ joined #nim
15:02:48disruptekwhen you're editing the spreadsheet, you're changing code by injecting macros. then you save it, it gets compiled, and now you have native execution against values.
15:04:12*ng0 quit (Ping timeout: 260 seconds)
15:04:18disrupteki think i'd rather just have a spreadsheet with lisp underneath, though.
15:07:26disrupteki guess you get this for free in org mode.
15:07:42disruptekhttps://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html
15:12:52*sealmove joined #nim
15:25:15*narimiran joined #nim
15:44:49*minierolls joined #nim
15:55:32leorizeAraq: is --newruntime still an on going effort?
15:55:51leorizeor are we going for --gc:destructors + araqsgc instead?
15:59:06*alexander92 quit (Read error: Connection reset by peer)
15:59:34FromDiscord<Rika> how do i export a certain `<` from a module?
15:59:53leorize```export module.`<`
15:59:57leorize```export module.`<````
16:00:08FromDiscord<Rika> the issue with that is there are multiple of `<`
16:00:27leorizenope, you can't cherry pick like that
16:00:28FromDiscord<Rika> how do i specify which type they accept is what i mean
16:00:30FromDiscord<Rika> ah
16:00:37FromDiscord<Rika> so it does all it finds?
16:00:38leorizewell there's a way
16:01:31leorizemake a `<` proc in the current module that accept the only signature that you want
16:02:04leorizelike this: ```proc `<`*(a, b: int): bool = system.`<`(a, b)```
16:02:24leorizethis is probably the best way
16:03:41Araqleorize: still both, but araqsgc is 100% backwards compatible so it has the better chances
16:04:43leorizewe are getting destructors-backed string/seqs either way, right?
16:05:45Araqyup
16:06:08Araqand araqsgc is opt-in
16:06:10Araqbbl
16:17:27*LargeEpsilon_ quit (Ping timeout: 264 seconds)
16:35:41*ng0_ is now known as ng0
16:36:03*skoude joined #nim
16:36:49*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:40:18*skoude quit (Ping timeout: 245 seconds)
16:41:59*crem joined #nim
16:57:15leorizeAraq: how hard is it in your opinion to make nimsuggest project-agnostic?
17:06:34*jmiven_ is now known as jmiven
17:08:16sealmovedoes anyone know how to combine junit files to produce 1 big junit file?
17:10:40*Hideki_ joined #nim
17:50:43FromGitter<SolitudeSF> x11 wrapper broke with todays devel. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ who is in the wrong lib or compiler? [https://gitter.im/nim-lang/Nim?at=5da0c0f257c2517c6aef3aba]
17:56:46jkenI am calling a c function (nim opengl function: glShaderSource) and one of the params it expects to be a cstringArray
17:56:56jkenHow do I convert a string to a cstringArray?
17:57:32leorizecstringArray is an array
17:57:39leorize:P
17:57:51leorizethere's a newCStringArray proc iirc
17:58:16leorizehttps://nim-lang.org/docs/system.html#allocCStringArray%2CopenArray%5Bstring%5D
17:58:18jkenoh, actually, [cstring(myString)]
17:58:23jkenseems to work
17:59:01jkenplus a cast
17:59:16leorizeuse the actual proc please :P
18:04:17*PMunch joined #nim
18:05:18FromGitter<awr1> @SolitudeSF is `TAtom` `distinct`?
18:05:29solitudesfnope
18:05:50FromGitter<awr1> well that would probably fix it
18:05:54solitudesfi fixed it by removing the overload
18:05:59FromGitter<awr1> or that.
18:06:16FromGitter<awr1> is it worth asking why that was even defined in the first place
18:06:46solitudesf¯\_(ツ)_/¯
18:07:20solitudesfwhy did it break tho, i thought procs defined on aliases should be preferred over base procs.
18:14:19FromGitter<awr1> it's not consistent, i've run into bugs with it before
18:14:21FromGitter<awr1> related https://github.com/nim-lang/RFCs/issues/139
18:14:57FromGitter<awr1> i thought it may have gotten fixed but i'm not so sure.
18:19:01FromGitter<awr1> now i'm rereading this and agreeing with krux, it shouldn't have been an RFC
18:19:20FromGitter<awr1> or well
18:19:21FromGitter<awr1> idk
18:20:34*uvegbot quit (Quit: Konversation terminated!)
18:21:24*Kaivo quit (Quit: WeeChat 2.6)
18:22:14*uvegbot joined #nim
18:24:21FromGitter<awr1> am i the only person that uses `&=`
18:24:33FromGitter<awr1> `add()` is too verbose for me...
18:24:50FromGitter<awr1> for being a common operation, anyway
18:28:20PMunchHmm, nim jsondoc isn't great is it..
18:28:46PMunchI mean, why is the `code` block here just a string.. http://ix.io/1YlI
18:29:21PMunchWould be so much better if the raises, pragmas, tags, input types, output types, etc. were actual fields that could be accessed..
18:29:54FromGitter<akavel> Hi! Is the Table's pairs iterator expected to return keys in sorted order? if not, is there some collection in Nim stdlib (or 3rdparty) that is known to be sorted by key?
18:30:34*LargeEpsilon_ joined #nim
18:34:10*Calinou quit (Quit: No Ping reply in 180 seconds.)
18:34:39FromGitter<akavel> Hmmm, right, there's critbits, I forgot about it; so probably that's what I need, when the keys happen to be strings... still, I'd be interested in a non-string-keys variant as well, to know for future...!
18:35:55PMunchakavel, well there is also OrderedTable in the tables module..
18:36:26FromGitter<akavel> PMunch: but it returns keys *in insertion order*, not in sorted order, no?
18:36:27FromGitter<awr1> OrderedTable is insertion order sensitive
18:36:31PMunchOh right
18:36:33FromGitter<awr1> it's not like
18:36:37FromGitter<awr1> `std::map` or w/e
18:36:42PMunchYou wanted them in lexicographical order
18:36:46FromGitter<akavel> yep
18:36:56FromGitter<akavel> or whatever `<` I define
18:37:21PMunchI'd guess you'd have to grab all the keys or pairs and sort them yourself
18:38:11*Calinou joined #nim
18:38:14FromGitter<akavel> Yeah, I know there are ways to do it on your own (actually I wrote a container like that myself already once), but I'm curious if there's something known that I'm missing :)
18:38:32FromGitter<akavel> I find it hard to believe there's none :P
18:39:17FromGitter<awr1> Nim needs a `SortedTable` probably
18:41:53FromGitter<akavel> Hm, I see there's even an issue for this at #11475
18:44:44PMunchHmm, is there an easy way to convert arbitrary objects to Json in Nim?
18:47:33FromGitter<awr1> @PMunch https://nim-lang.org/docs/marshal.html
18:48:13FromGitter<awr1> also, not JSON but nimyaml is also pretty good in this respect
18:49:40PMunchHuh, apparently just % from the JSON module does this
18:49:45PMunchAt least for some simple objects
18:50:00*Hideki_ quit (Remote host closed the connection)
18:50:44*Hideki_ joined #nim
18:50:48*Hideki_ quit (Remote host closed the connection)
18:51:27*Hideki_ joined #nim
18:52:05*Hideki_ quit (Remote host closed the connection)
18:53:38*Hideki_ joined #nim
18:53:40*Hideki_ quit (Remote host closed the connection)
18:56:57*Hideki_ joined #nim
19:01:14*Hideki_ quit (Ping timeout: 240 seconds)
19:03:52PMunchHmm, would it be possible to get the docstring for a specific instance of a generic procedure by only its name and the type?
19:08:40*traviss joined #nim
19:13:39PMunchHmm getImpl just seems to grab a random implementatino
19:14:19PMunchhttp://ix.io/1YlS/Nim
19:14:35PMunchBoth calls to getImpl there gives me the procedure for serialise(x: MyReturn)
19:21:34PMunchOkay, found a way..
19:38:23*Hideki joined #nim
19:38:37*sealmove quit (Quit: WeeChat 2.6)
19:51:47*seerix quit (Remote host closed the connection)
19:57:16FromDiscord<Kiloneie> Is there no "char" variant of hasKey, contains ?
19:58:45*fanta1 quit (Quit: fanta1)
19:58:59*abm quit (Quit: Leaving)
19:59:50*LargeEpsilon_ quit (Ping timeout: 246 seconds)
20:00:52*junland_ quit (Quit: %ZNC Disconnected%)
20:01:05*junland joined #nim
20:04:23*paxis quit (Quit: Client exiting)
20:14:24*alexander92 joined #nim
20:14:52FromGitter<alehander42> @awr1 noo
20:15:05FromGitter<alehander42> doesnt &= generate
20:15:07FromGitter<alehander42> a = a & b
20:15:11FromGitter<alehander42> this sounds bad
20:15:17FromGitter<alehander42> because i imagine it allocates new
20:15:19FromGitter<alehander42> string each time
20:15:22FromDiscord<Kiloneie> Ignore my last message, it seems that CountTables don't work with any of those procs.
20:15:28FromGitter<alehander42> which you dont want if you have add
20:16:09FromGitter<alehander42> hm "Appends in place to a string."
20:16:15FromGitter<alehander42> ok, so it seems normal sorry
20:16:35lqdev[m]@alehander42 the magic for them is the same `AppendStrStr`
20:16:44FromGitter<alehander42> `add` reminds to seq's add, so i prefer it
20:16:47FromGitter<alehander42> yeah i see
20:16:48FromGitter<alehander42> sorry
20:17:36*Hideki quit (Ping timeout: 240 seconds)
20:21:35*radsoc joined #nim
20:42:21*narimiran quit (Ping timeout: 268 seconds)
20:49:16*solitudesf quit (Ping timeout: 240 seconds)
20:52:10*PMunch quit (Remote host closed the connection)
20:56:06*shomodj joined #nim
20:58:18*shomodj quit (Client Quit)
21:05:46*alexander92 quit (Read error: Connection reset by peer)
21:15:17*Vladar quit (Remote host closed the connection)
21:26:58*LargeEpsilon_ joined #nim
21:27:39*Jesin quit (Read error: Connection reset by peer)
21:31:54*luis_ joined #nim
21:32:34*Jesin joined #nim
21:43:33*LargeEpsilon_ quit (Remote host closed the connection)
21:52:02*luis_ quit (Ping timeout: 240 seconds)
22:05:31FromDiscord<treeform> so I have `prettyPrint*(x: SomeInteger|SomeFloat)` and passing a `Timestamp* = distinct float64`
22:05:42FromDiscord<treeform> Is there a way to also pass it through?
22:06:41FromDiscord<treeform> getting `type mismatch: got <Timestamp> but expected one of: ... float64 ...`
22:06:42*radsoc quit (Quit: radsoc)
22:22:07disruptekyou can .borrow. or stamp.float64 it. otherwise, this is by design.
22:22:52*jmiven left #nim ("bye")
22:31:00*asymptotically quit (Quit: Leaving)
22:39:20*nsf quit (Quit: WeeChat 2.5)
22:39:24*stefantalpalaru quit (Quit: stefantalpalaru)
22:46:32FromDiscord<Kiloneie> This video took forever to make... and it's freakishly long too D:... couldn't make it shorter for this topic. https://youtu.be/5sYkUYx5LvA
22:54:08krux02Kiloneie
22:54:18krux02very cool, thanks for making a series like this.
22:55:40FromDiscord<Kiloneie> 🙂
22:57:02FromGitter<me7> Quick question, do Nim able to compile and run on raspberry pi?
22:57:37shashlickYes it does but just use the arm build instead of building on rpi
22:57:48shashlickElse will take a while
22:58:01*onionhammer quit (Quit: WeeChat 2.4)
23:00:38FromGitter<me7> Thank you :)
23:06:55FromGitter<mratsim> Yes it does, I had a talk at the biggest blockchain dev conf on Tuesday about running Ethereum on a raspberry Pi
23:10:27*Trustable quit (Remote host closed the connection)
23:26:28FromGitter<kayabaNerve> I'm having some really buggy behavior involving generics. Anyone have a few?
23:27:08FromGitter<me7> Thank @mratsim you have some link that I can start with?
23:28:13FromGitter<me7> I want to decode SENT protocol using Nim and raspberry pi but stunning where to start with
23:31:29*Hideki joined #nim
23:32:24*krux02_ joined #nim
23:35:27FromGitter<kayabaNerve> Never mind. It's an issue with a pragma I'm working with.
23:36:52*krux02 quit (Ping timeout: 268 seconds)
23:37:03*Hideki quit (Ping timeout: 265 seconds)
23:58:46*ng0 quit (Quit: Alexa, when is the end of world?)