<< 26-06-2019 >>

00:20:04*sagax joined #nim
00:21:15*krux02_ quit (Remote host closed the connection)
00:33:20*laaron joined #nim
01:32:19*laaron quit (Remote host closed the connection)
01:32:40*laaron joined #nim
01:36:37*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:42:49*theelous3_ quit (Quit: is outty)
01:52:55*theelous3_ joined #nim
01:53:48*theelous3 quit (Ping timeout: 272 seconds)
01:56:36leorizeAraq: hard code the knowledge about /home? what does that mean?
02:18:31leorizenarimiran: I think nim-lang.org should promote some useful nimble packages. Some of them provide features that a lot of people are asking for (sum types, pattern matching, etc.) and could be a good way to promote how flexible Nim can be
02:18:53FromDiscord_<lmariscal> leorize, the issue is that we don't really have a package registry atm
02:19:01leorizewe do
02:19:04leorizenimble.directory
02:19:15FromDiscord_<lmariscal> sure, a json file
02:19:25leorizeworks well enough :p
02:19:30FromDiscord_<lmariscal> nimble.directory is a mirror of that same json file
02:19:50leorizewith search and docs, really useful :)
02:20:36FromDiscord_<lmariscal> most of the modules I use don't work well with nimble.directory T_T
02:20:46FromDiscord_<lmariscal> they never finish loading haha
02:21:11leorizefederico3 would probably be interested in that :p
02:21:31leorizethey're nimble.directory creator/maintainer
02:22:44FromDiscord_<lmariscal> yeah, I should open an issue in the github repo
02:45:02*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
02:46:33FromGitter<matrixbot> `meff` does Nim have a libfuse wrapper?
02:46:39*laaron joined #nim
02:49:09FromGitter<matrixbot> `meff` I see https://github.com/akiradeveloper/nim-fuse but it looks like it hasn't been touched in years
03:05:33leorizemeff: you should use the freenode bridge instead of gitter :p
03:06:08FromGitter<matrixbot> `meff` I'm actually using Matrix; surprised that it shows up as Gitter lol
03:06:50leorizejoin #freenode_#nim:matrix.org room instead :)
03:08:07leorizehttps://github.com/nimterop/nimterop should be able to wrap libfuse rather easily
03:08:27*meff[m] joined #nim
03:09:03meff[m]yeah I can totally wrap it myself, was just wondering if anyone had wrapped it already, but cool
03:09:15meff[m]also, does Nim have an established way of doing async yet?
03:09:32*theelous3_ quit (Remote host closed the connection)
03:09:41meff[m]I see this https://nim-lang.org/docs/asyncdispatch.html is this it?
03:09:54leorizeyep
03:09:55*theelous3_ joined #nim
03:10:07meff[m]gotcha, thanks!
03:22:07*Voltist joined #nim
03:23:53*Voltist quit (Client Quit)
03:24:24*XFPlus joined #nim
03:43:24*fjellfras joined #nim
03:44:51*XFPlus quit (Remote host closed the connection)
03:52:25*fjellfras quit (Remote host closed the connection)
04:16:15*disruptek quit (Ping timeout: 258 seconds)
04:20:18*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:20:19*laaron joined #nim
04:21:55*dddddd quit (Remote host closed the connection)
04:23:52*nsf joined #nim
04:41:46*fjellfras joined #nim
04:54:47*disruptek joined #nim
05:00:14*narimiran joined #nim
05:09:34*Voltist joined #nim
05:20:19leorizenarimiran: in case you missed https://irclogs.nim-lang.org/26-06-2019.html#02:18:31
05:21:12*leorize quit (Quit: WeeChat 2.3)
05:22:00narimiranok, where/how? under 'featured projects'?
05:25:11*fjellfras quit (Quit: Leaving)
05:26:33VoltistNice of them to leave immediately after prompting a discussion
05:31:09leorize[m]not really :)
05:32:09leorize[m]narimiran: featured projects is a rather small space though
05:32:26VoltistHuh, odd. "leorize has left (Quit: WeeChat 2.3)". Anyway, I think the idea of adding featured projects is call.
05:32:37VoltistCool*
05:37:32*Trustable joined #nim
05:43:55leorize[m]I have more than one handle, with [m] stands for mobile
05:45:03VoltistThat's a great idea
05:50:20leorize[m]narimiran: maybe a dedicated page for featured projects?
05:51:29VoltistYeah, linked in the navbar maybe
05:51:57leorize[m]a few lines to highlight their features should be fine enough
05:54:13VoltistIndeed
05:55:27*leorize joined #nim
05:55:43FromGitter<Varriount> Araq: How do var parameters interact with aliasing? For example, if a have a procedure `proc foo(sequence: var seq[string], str: var string)`, and `str` is an element of `sequence`, can memory be corrupted by modifying the sequence or string parameters?
05:56:00FromGitter<Varriount> (For example, if the sequence's length is set to 0)
05:57:40leorizethere's only one way to find out :p
05:59:10leorize@Varriount: got out of bounds error
06:00:36leorizehttp://ix.io/1MOG
06:04:55*dwdv joined #nim
06:06:18*solitudesf joined #nim
06:25:52rayman22201Haven't been able to write nim code, but I'm working on this while I wait for CI tests to complete at my job lol. Thoughts? @narimiran, @dom96 https://github.com/rayman22201/Nim/blob/async_tutorial/doc/tut4.rst
06:26:58narimiranrayman22201: yes yes yes! we need this!
06:27:33*jjido joined #nim
06:28:29*PMunch joined #nim
06:30:22*jjido quit (Client Quit)
06:30:29Zevvrayman22201: yess, great stuff! I started once but stalled. You want my draft?
06:31:02rayman22201@Zevv, yeah sure.
06:31:10Zevvhttp://ix.io/1MOO
06:31:28Zevvit's only a few paragraphs but maybe it fits somewhere
06:31:49rayman22201Cool. I'll take a look
06:31:56ZevvHm I now see I never got to the async part even :)
06:31:57Zevvhehe
06:32:59rayman22201lol
06:33:39Zevvmy plan was to start bottom up: first berkeley socket basics, then futures, then the async macro
06:33:53rayman22201Yeah. I am going in the opposite order.
06:35:31rayman22201Reason being, most people probably just want to use existing async libraries. They generally don't need to implement their own.
06:35:57rayman22201good example non the less.
06:36:39rayman22201@narimiran. Yay. Thanks. hopefully I don't stall :-P
06:36:45ZevvI guess it also depends on reader knowledge&experience. If you've ever seen and used async somewhere, which is likely with js and all, it's probably better to start top down
06:37:03ZevvI stall a lot
06:37:08ZevvI probably just start too much
06:38:28AraqVarriount: there is a section about it in manual_experimental
06:38:44Araq"An "output parameter" is a parameter of type ``var T``, an input
06:38:45Araqparameter is any parameter that is not of type ``var``.
06:38:47Araq1. Two output parameters should never be aliased."
06:41:22*solitudesf quit (Ping timeout: 252 seconds)
06:41:45PMunchHmm, `resp` in Jester can take a json node and sets the Content-Type header, but not if you also pass it a HTTP code
06:43:40*Phhere joined #nim
06:58:05lqdev[m]leorize: [m] stands for matrix, not mobile
06:59:47leorizefor my usage, it's mobile :p
06:59:58leorizealso you can change that nick if you want
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:39*krux02 joined #nim
07:04:49*gmpreussner joined #nim
07:05:18VoltistHow would I get a seq of all the keys in a JSON object?
07:05:37VoltistIt doesn't seem to be well documented, if at all
07:10:23leorizeyou can't, sadly
07:10:39leorizewe would need a `keys` iterator for JsonNode then
07:12:00FromGitter<survivorm> @dom96 here?
07:12:10VoltistWould that be hard to implement, do you think?
07:12:27leorizenot at all
07:13:07VoltistWell, this could be my first proper contribution to Nim then!
07:14:05leorizecopy the pairs iterator then modify it to use OrderedTable `keys` iterator and you're set :p
07:14:49VoltistI'll have it done by the hour :]
07:16:34VoltistWell, then there is documentation...
07:17:09leorizepairs() documentation is one line
07:17:54VoltistWere is that found?
07:18:47leorizethe json module
07:18:50leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L776
07:19:00VoltistThanks
07:25:16VoltistSo would we want to the output to be a seq, or a tuple or what?
07:25:58leorizemake the iterator output only strings
07:26:12leorizeuse the keys iterator of orderedtable directly
07:26:26leorizeif anyone wanted a seq they can pass the iterator to sequtils.toSeq
07:26:47VoltistYeah I guess so
07:27:12leorizeyou might want to read up on iterators in the manual :p
07:27:53VoltistI have just recently, but I suppose I just had a slip of the mind
07:28:22VoltistIt's late here, and my brain must have been thinking in terms of procs not iterators
07:29:15leorizeget some rest :)
07:29:43VoltistEventually
07:32:19vegaidid I understood correctly that current Nim doesn't have the concept of destructors?
07:32:27vegaiand only newruntime will fix that?
07:33:18leorizeNim does have the concept of destructors
07:33:21leorizeit's experimental
07:33:50leorizenewruntime on the other hand is an another memory management system built on destructors
07:40:05*stefanos82 joined #nim
07:40:27vegaiok
07:40:52Voltisthttps://github.com/nim-lang/Nim/pull/11597
07:40:59*Vladar joined #nim
07:41:04VoltistAll done :]
07:42:30livcdthis fmt"{interpolation}" works only with echo ?
07:42:58livcdwhat can I do in raise newException(UglyException,"Something ugly happened {here}?")
07:43:22leorizefmt"Something ugly happened {here}?"
07:43:29leorizethe keyword is `fmt`
07:44:42ZevvI like `&` better
07:45:56vegaihttp://ix.io/1MPb/nim
07:46:20vegaithis tells me "Error: signature for '=destroy' must be proc[T: object](x: var T)"
07:46:28vegaiisn't it? :) this is on 0.20
07:47:29*couven92 joined #nim
07:47:45vegaioh wait that's silly
07:47:50vegaiit should've obviously been proc `=destroy`(x: var MyObj) =
07:48:10vegaiasking stupid questions publically: almost guaranteed success
07:48:30vegaithe error message was a bit wonky still
07:48:47leorizeyou shouldn't need {.experimental.} for destructors on 0.20
07:49:07vegaiyeah, that seems so
07:49:19vegaiI took that from a year old forum post
07:50:21vegaiso with the classic GC-based nim, that destructor gets called when the GC decides to do its magic
07:51:12leorizenope
07:51:23leorizewell, only if it's a `ref` type
07:51:25vegaishould I be worried that it might never get called? In my case, I'm thinking about building a DB pool, and that destructor would be responsible of freeing a db connection
07:51:42leorizeAraq has changed the rules since
07:51:45vegaiso it would be rather if calling the destructor is delayed
07:52:01vegaiyeah, I tried to read the 2nd edition of destructors, but it's a bit concise
07:52:51vegaiit would be rather bad*
07:53:33vegaiI guess my tests should cover such cases anyway so
07:54:12leorizeif you're not using a `ref object` (and probably shouldn't), then destructors can handle this with GC deterministicly
08:03:04*solitudesf joined #nim
08:13:09livcdleorize: ahh you are right /O thanks
08:16:26vegaileorize: hmm, if I'm handing out DB connections from a common pool to arbitrary threads, doesn't those have to be refs?
08:18:00*brakmic joined #nim
08:18:05leorizeno, and in fact, they shouldn't be `refs`
08:18:28leorizeunless boehm gc is used (which is kinda broken in 0.20 afaik), gc's memory is thread-local
08:18:58Araqhand out a 'distinct int' type that is an index into your seq
08:19:11Araqthe distinct int type can have a destructor, problem solved
08:20:39vegaileorize: I'd be using allocShared, the pool would be shared memory between threads
08:21:08vegaiAraq: ah, that sounds good
08:21:11vegaithanks
08:21:14leorizeallocShared returns a ptr...
08:21:17ZevvWhat happened to the plan to make --threads:on the default?
08:21:37vegaileorize: doh. Yes. I shouldn't have been talking about references there
08:21:37AraqZevv, blocked by an issue I have to look into
08:21:42narimiranZevv: there are some problems on windows
08:21:54Zevvah ok
08:25:29*dwdv quit (Quit: quit)
08:27:44*Voltist quit (Remote host closed the connection)
08:28:24*abm joined #nim
08:30:33*brakmic left #nim (#nim)
08:33:38*floppydh joined #nim
08:48:10*leorize quit (Quit: WeeChat 2.3)
08:51:10*theelous3_ quit (Ping timeout: 252 seconds)
08:57:57*fredrik92 joined #nim
08:58:21*couven92 quit (Disconnected by services)
08:58:26*fredrik92 is now known as couven92
08:58:47*fredrik92 joined #nim
08:59:00*fredrik92 quit (Remote host closed the connection)
09:07:33FromGitter<mratsim> @krux02 I'm around
09:11:58*fredrik92 joined #nim
09:12:21*couven92 quit (Disconnected by services)
09:12:27*fredrik92 is now known as couven92
09:19:12krux02hi
09:19:52krux02@mratsim: yesterday you mentioned something about by pr to change ``shr``
09:20:01krux02I would like to explain my reasoning
09:20:23FromGitter<mratsim> listening
09:20:26krux02ok
09:21:00krux02In C: (x >> y) is undefined behavior if y is negative or bigger than the amount of bits in x.
09:21:35krux02undefined behavior really is undefined behavior, the program doesn't even need to be consistent about it's result.
09:22:22krux02the test had something like (1'u64 shr 64)
09:22:31krux02this was compiled to the >> in C
09:22:45krux02and then the optimizer of c threw away the bitshift
09:23:02krux02sorry I mean shl and <<
09:23:09FromGitter<mratsim> yeah I figured
09:23:32krux02the test was wrong in that respect
09:24:00krux02what I changed is, I applied the bitmask to the right operand, so that the operation won't trigger undefined behavior anymore.
09:24:42krux02this is btw also what other languages do like Java and if I remembor correctly C# as well.
09:25:26FromGitter<mratsim> Ok, I don't mind but I really need the same behaviour at runtime and compile-time
09:26:25FromGitter<mratsim> also I guess shl behaviour should be documented in the manual if defined behaviour is part of Nim specs
09:27:41*Voltist joined #nim
09:31:36krux02yes the bitmasking is done identically at runtime and compiletime.
09:32:10FromGitter<mratsim> Ok well I've removed my request changes review
09:32:11krux02good point the PR needs a proper update in the documentation as well
09:37:39FromGitter<alehander42> http://lists.llvm.org/pipermail/llvm-dev/2019-June/133308.html
09:37:49FromGitter<alehander42> google want to create their own libc and add it to llvm
09:37:56FromGitter<alehander42> interesting
09:38:38FromGitter<mratsim> > Second, corporate development teams are uniquely qualified to utterly ⏎ botch a libc, yet still push it into widespread use, and the cost is ⏎ painful compatibility hacks in all applications. Apple did this with ⏎ their fork of BSD libc code. Google has done it once already with ⏎ their fork of musl in Fuchsia -- a project which I contributed ... [https://gitter.im/nim-lang/Nim?at=5d133d1eddc34e0f13e78d58]
09:40:06FromGitter<mratsim> > So, in summary: ⏎ > ⏎ > Point 1 is why making a libc for real-world use is not to be taken ⏎ lightly. ⏎ > ... [https://gitter.im/nim-lang/Nim?at=5d133d76ddc34e0f13e790bd]
09:41:05*Voltist quit (Quit: Quit)
09:41:51FromGitter<alehander42> seems reasonable
10:21:57*dddddd joined #nim
10:33:17AraqI thought C was this mystical language without a runtime :P
10:33:48Araqsecondly, it's silly, clang is a C implementation, of course it can target its own libc.
10:34:01*deech joined #nim
10:34:20Araqlibc is not part of the OS kernel
10:35:55FromDiscord_<Núkley> is that in response to me or somebody else?
10:37:01Araqto http://lists.llvm.org/pipermail/llvm-dev/2019-June/133308.html
10:40:03FromDiscord_<Núkley> uh, ok?
10:40:12FromDiscord_<Núkley> alittle confused
10:40:41Araqmaybe my IRC client messed up
10:40:48FromDiscord_<Núkley> i am just starting c++ and i was having trouble getting the compiler working correctly
10:41:18*deech quit (Ping timeout: 245 seconds)
10:52:06FromDiscord_<Skaruts> A little question:
10:52:32FromDiscord_<Skaruts> I defined two types -- `Rect = ref object of RootObj`, and `House = ref object of Rect` -- in two separate files -- `geometry.nim` and `house_gen.nim`. Rect has a `method intersects(self, other:Rect):bool`
10:52:51FromDiscord_<Skaruts> When I create an instance of House in a third file which imports `house_gen.nim` it doesn't recognize the `intersects` method
10:53:08FromDiscord_<Skaruts> ("error attempting to call undeclared routine")
10:53:14narimiranwild guess: missing export marker? (`*`)
10:53:23FromDiscord_<Skaruts> yes
10:54:07FromDiscord_<Skaruts> I was gonna ask if that's the prefered solution
10:54:45FromDiscord_<Skaruts> the alternative would be to import geometry on all files that need access to the parent type's methods
10:57:10FromGitter<rokups> in order to use something you must mark it with `*` and you must import module that something is in
10:57:14FromDiscord_<Skaruts> oh wait, I misunderstood you, no actually the export markers are all there, problem is that house_gen doesn't have "export geometry" in it (besides "import geometry")
10:59:19FromDiscord_<Skaruts> I mean, I suppose that's what I should do?
11:01:00FromDiscord_<Skaruts> actually it doesn't work that way
11:01:08FromDiscord_<Skaruts> `map_gen\house_gen.nim(4, 8) Error: cannot export: ../geometry`
11:01:57FromGitter<alehander42> you can export
11:02:38FromDiscord_<Skaruts> it's not letting me...
11:02:43FromGitter<rokups> is there `export geometry.*` syntax? docs only say it works for individual symbols
11:03:27FromDiscord_<Skaruts> it works for full files, I'm using that elsewhere, but maybe not in this case, let me see
11:03:53narimiranhow does your `export ...` line look like?
11:04:08FromDiscord_<Skaruts> export ../geometry
11:04:26narimiranremove `../`
11:04:35FromDiscord_<Skaruts> it's in the parent folder
11:04:41narimiranremove `../`
11:05:01FromDiscord_<Skaruts> oh the export doesn't need that!
11:05:10FromDiscord_<Skaruts> I see...
11:05:14FromDiscord_<Skaruts> thanks
11:05:25FromDiscord_<Skaruts> it all works now
11:09:54FromGitter<alehander42> :P
11:10:05FromGitter<alehander42> ops you can export modules
11:11:24*theelous3 joined #nim
11:20:40FromGitter<juancarlospaco> Hi
11:24:05PMunchHmm, anyone knows how I can do closure capture in Karax?
11:24:19PMunchI loop over some items and want to set up a callback for each link
11:24:47PMunchBut currently they all point to the last of the addresses
11:30:11FromGitter<alehander42> hi juan
11:30:18FromGitter<alehander42> ugh
11:30:35FromGitter<alehander42> i think its easiest to
11:30:38FromGitter<alehander42> create a new view
11:30:41FromGitter<alehander42> (function)
11:30:47FromGitter<alehander42> for each and set the callback there
11:31:10FromGitter<alehander42> thats what i do with my karax callback
11:31:20*lritter joined #nim
11:31:21FromGitter<alehander42> and collections iirc
11:31:48FromDiscord_<djazz> Man, defer is awesome!
11:32:06FromDiscord_<djazz> Simple cleanup!
11:32:38FromGitter<alehander42> if you dont forget to write one
11:34:50*crem quit (Ping timeout: 258 seconds)
11:37:08*crem joined #nim
11:37:31livcdquerying windows registry is not part of the stdlib right ? I need to find a pkg for this
11:48:22FromGitter<mohamedmoussa89> Any ideas why this doesn't compile
11:48:23FromGitter<mohamedmoussa89> https://pastebin.com/raw/yp0gatVV
11:49:06FromGitter<mohamedmoussa89> I guess it has to match the A first before A.T?
11:54:02livcdahhh finish.exe uses it. import registry it is
11:59:40AraqPMunch, system.closureScope
12:01:37*Phhere quit (Ping timeout: 258 seconds)
12:01:57*tjmac joined #nim
12:02:24PMunchThat didn't work inside the Karax DSL
12:02:41Araqinteresting
12:02:51Araqwe might want to special-case that one then
12:08:49FromGitter<kindlychung> who do you parse a variable number of arguments with parseopt?
12:09:13*Vladar quit (Remote host closed the connection)
12:15:58PMunchHmm, it seems that Karax simply removed the node entirely: http://ix.io/1MQ2
12:20:36*theelous3_ joined #nim
12:22:10*Vladar joined #nim
12:23:34livcdbtw weird problem
12:23:40FromGitter<rokups> can we make bindings for js libs same way we do for c/++?
12:23:51Araqrokups: yeah
12:24:02Araqfor some definition of "same way"
12:24:18FromGitter<rokups> thats awesome. maybe someone will eventually make bindings for vuejs ^_^
12:24:19Araqwe even re-use the importc/importcpp names for it :-/
12:24:37Araqthat's offensive.
12:24:52*theelous3_ quit (Remote host closed the connection)
12:25:13FromGitter<rokups> really? i think thats lazy. other people doing the work so i dont have to is always an advantage in my book :D
12:25:20*theelous3_ joined #nim
12:25:25Araq<insert vue.js rant here>
12:25:43AraqI used it extensively before writing Karax
12:26:16FromGitter<alehander42> hm Araq what is closureScope
12:26:39FromGitter<alehander42> ahh i see
12:27:54FromGitter<rokups> Araq come on... this right here is the reason why nim after more than a decade is not v1.0. you are a mind-blowing engineer, but there is just one of you and you cant write software for every usecase in the world, make it good and maintain it after
12:27:57*theelous3_ quit (Remote host closed the connection)
12:28:29Araqtrue but I got paid to develop Karax and now it already exists
12:28:44FromGitter<alehander42> closureScope invokes a anonimous handler
12:28:45AraqI didn't get paid to make v1 back then
12:28:53FromGitter<alehander42> usually doesnt matter for the javascript backend tho
12:28:57FromGitter<alehander42> in perf
12:29:36FromGitter<rokups> ok karax's existence redeemed then :D
12:30:27*theelous3_ joined #nim
12:31:12FromGitter<deech> 2nd hand experience report: someone I met a conference moved away from Nim for their microcontroller project because the GC had issues cleaning up thread-local heaps in their async code. I have no further details.
12:31:14FromGitter<rokups> i hope to try it eventually too. now that function hooking with newruntime/destructors is very viable nim became very attractive to me for netsec developments. having frontend + agent + scripting all in the same language is *very* appealing
12:31:23livcdso my program ends with discard readline(stdin) -> when i open it in cmd and close the window of i get a this program has stopped working. This does not happen when I do the same with just discard readline(stdin) in the program
12:31:54*acidx quit (Ping timeout: 258 seconds)
12:32:06livcdwhy would this happen ? oO
12:35:06Araqdeech: Thank you for the report.
12:46:08*theelous3_ quit (Ping timeout: 272 seconds)
12:54:24*acidx joined #nim
12:59:16*NimBot joined #nim
13:00:21FromGitter<kaushalmodi> We need a wiki page to list all the Nim playgrounds :)
13:00:34FromGitter<kaushalmodi> ^ https://github.com/nim-lang/Nim/issues/11599, https://nim.ide.judge0.com/
13:14:26*rockcavera quit (Remote host closed the connection)
13:17:25*rockcavera joined #nim
13:18:08*laaron quit (Remote host closed the connection)
13:21:20Araqwhat do we do with https://github.com/nim-lang/Nim/pull/11485 ?
13:21:25*laaron joined #nim
13:21:28Araqmerge it and then deprecate travis/appveyor?
13:24:43*nsf quit (Quit: WeeChat 2.4)
13:26:19FromGitter<rokups> microsoft offers all that for free too?
13:31:19Araqnarimiran ?
13:32:45narimiranAraq: i/we need to enable azure first, see https://irclogs.nim-lang.org/21-06-2019.html#10:03:21
13:34:26Araqok
13:46:14FromGitter<mratsim> @deech but why were they relying on the GC for a microcontroller
13:53:30Araqbecaues they could :P
13:57:57noonienis there documentation on concepts? i remember find it somewhere but i can't seem to anymore
13:58:48narimirannoonien: https://nim-lang.github.io/Nim/manual_experimental.html#concepts
13:59:11noonienah, great, thanks!
13:59:54FromGitter<kaushalmodi> narimiran: should the theindex page index the experimental stuff too?
14:00:10narimirani don't know
14:00:37FromGitter<kaushalmodi> At one point, that was *the* page to search for anything in Mind
14:00:45FromGitter<kaushalmodi> *Nim
14:00:54FromGitter<kaushalmodi> Funny how autocorrect works
14:03:16FromGitter<juancarlospaco> experimental_manual is on TheIndex. Not the individual contents of itself tho.
14:05:35FromGitter<mratsim> @PMunch: https://github.com/nim-lang/Nim/issues/11601
14:09:49*gangstacat quit (Ping timeout: 252 seconds)
14:17:14*leorize joined #nim
14:23:34*seni joined #nim
14:28:59*gangstacat joined #nim
14:32:12*tjmac quit (Quit: -bye)
14:53:15*floppydh quit (Quit: WeeChat 2.5)
14:57:11*dwdv joined #nim
15:05:47lqdev[m]I'm getting this strange warning since 0.20.0: `Warning: method has lock level <unknown>, but another method has 0 [LockLevel]`
15:05:52lqdev[m]it appears when I use methods
15:06:05lqdev[m]anything I can do about it?
15:07:57*couven92 quit (Quit: Client disconnecting)
15:09:36*lf-araujo joined #nim
15:14:20*lf-araujo quit (Ping timeout: 252 seconds)
15:19:12*sz0 quit (Quit: Connection closed for inactivity)
15:20:07vegailqdev[m]: here's some thread with similar problems from 4 years ago: https://forum.nim-lang.org/t/1394
15:24:43lqdev[m]how can I do `--warning[LockLevel]:off` from NimScript?
15:25:20lqdev[m]I'm trying to do `switch("warning[LockLevel]", "off")`, but I get a warning telling me it isn't a valid command line option
15:26:18*Snircle joined #nim
15:32:02FromDiscord_<djazz> `Error: Sorry, your platform (linux_arm) is not supported by choosenim.` 😦
15:34:44FromDiscord_<djazz> alright alright, I'll compile (Raspberry Pi btw)
15:34:56FromDiscord_<djazz> nim 0.16.0 is in Raspbian repo
15:38:49Araqwarning("LockLevel", off)
15:41:52*couven92 joined #nim
15:49:29*CcxWrk quit (Quit: ZNC 1.7.1 - https://znc.in)
15:57:00federico3djazz: you can pull the Debian package instead
15:57:18FromDiscord_<djazz> but i want 0.20.0
15:57:27FromDiscord_<djazz> upcoming debian buster has 0.19.4
15:57:46FromDiscord_<djazz> https://packages.debian.org/buster/nim
15:58:10federico3djazz: https://packages.debian.org/sid/nim 0.20.0-2 from Sid
16:13:00*sagax quit (Ping timeout: 252 seconds)
16:20:06PMunchnarimiran, yeah still waiting for sudo back.. And I've had a hackathon running at job, so been busy these past two days :P
16:22:08FromGitter<alehander42> hey did
16:22:13FromGitter<alehander42> you see the other playground
16:22:34FromGitter<alehander42> i'd really love to see the finished tours
16:22:42FromGitter<alehander42> we might even publish some on HN etc
16:23:15*sagax joined #nim
16:28:56FromDiscord_<djazz> federico3: thanks, that worked 😃
16:31:28disrupteknarimiran: #11603 lol :+1:
16:33:05narimirandisruptek: :)
16:44:34*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
16:48:30*couven92 quit (Read error: Connection reset by peer)
16:48:49*laaron joined #nim
16:52:17*lritter quit (Ping timeout: 248 seconds)
16:56:59narimiranleorize: are you here maybe?
17:01:03*lritter joined #nim
17:02:07FromGitter<Varriount> Araq: Yes, but that situation isn't exactly aliasing. The string's data and the sequence's data don't overlap.
17:02:22Araqwhat do you mean?
17:02:45leorize[m]narimiran: yes?
17:03:30FromGitter<Varriount> Araq: The string's data is separate from the sequence's. Both blocks of data are located at different addresses.
17:04:56Araqwell then there is no aliasing. I don't understand you.
17:05:08Araqaliasing and "overlapping" are one and the same.
17:06:50narimiranleorize[m]: PM sent
17:07:22FromGitter<Varriount> Araq: https://gist.github.com/Varriount/d58c689e5ed5e4235ba944506d149903
17:09:15Araq(s, s[^1]) is overlapping
17:11:40*laaron quit (Remote host closed the connection)
17:45:34*nsf joined #nim
17:47:34*Trustable quit (Remote host closed the connection)
17:48:44*nif joined #nim
17:49:48*zestyr_ joined #nim
17:50:53*Jesin joined #nim
17:53:45*nif_ quit (Ping timeout: 258 seconds)
17:53:45*zestyr quit (Ping timeout: 258 seconds)
17:53:45*stefanos82 quit (Ping timeout: 258 seconds)
17:55:26*stefanos82 joined #nim
17:55:42*brakmic joined #nim
17:56:32*stefanos82 quit (Client Quit)
17:56:49*stefanos82 joined #nim
18:03:05*brakmic quit (Ping timeout: 258 seconds)
18:36:19*stefanos82 quit (Quit: Quitting for now...)
18:44:25*jjido joined #nim
18:47:57*narimiran_ joined #nim
18:48:19*narimiran quit (Ping timeout: 258 seconds)
18:48:39shashlick_does onThreadDestruction() still work? I don't see it being called and i'm waiting for my threads to exit
18:52:05*sz0 joined #nim
18:55:56FromDiscord_<Skaruts> can I make an object nil?
18:56:43FromDiscord_<Skaruts> type Foo = ref object
18:56:47FromDiscord_<Skaruts> proc `$`(f:Foo):string = "fooings"
18:56:50FromDiscord_<Skaruts> var g:Foo = nil
18:56:54FromDiscord_<Skaruts> echo g # >>> fooings
18:57:30FromDiscord_<Skaruts> I'm having the confusings
18:58:55*narimiran_ is now known as narimiran
18:59:23narimiran1. in future use some pasting site so we can easily paste your code. 2. what is confusing you?
18:59:54FromDiscord_<Skaruts> the variable isn't nil though I assigned nil to it
19:00:04Araqit is nil.
19:00:14narimiranwhy do you think it is not nil?
19:00:54FromDiscord_<Skaruts> because echo is calling it's type's `$` proc
19:01:15FromGitter<JasperJenkins> being nil doesn't effect something be called. try`$f.isNil` instead
19:01:58Araqshashlick_: it does work afaict. but how do you exit your threads?
19:02:27FromDiscord_<Skaruts> ah yes, isNil returns true
19:02:44FromDiscord_<Skaruts> didn't know about isNil()
19:03:27*Senketsu quit (Quit: WeeChat 2.5)
19:03:31FromDiscord_<Skaruts> thanks
19:03:43Araqyou can also use x == nil like in many other langs
19:04:38*Senketsu joined #nim
19:04:54narimiran...but the original confusion comes from your `$` proc, which will print "fooings" regardless of nil-ness of `f`
19:05:32FromDiscord_<Skaruts> how didn't I think of that...
19:05:40FromDiscord_<Skaruts> facepalm
19:08:07shashlick_never mind, i'm an idiot
19:10:14FromDiscord_<Skaruts> is there any performance advantage between using "var" and "let"?
19:10:37FromDiscord_<Skaruts> or does it benefit compile times?
19:19:31Araq'let' can be faster but that's an implementation bug
19:19:45Araq'let' is the better style though
19:20:25zestyr_Araq: I've read a few times `isNil()` is faster, is this true? writing `not obj.isNil()` is uglier than `obj != nil`
19:27:16Araqit's not true
19:27:55AraqisNil produced smaller code for strings and seqs but for these 'nil' doesn't exist anymore :-)
19:31:30*krux02 quit (Remote host closed the connection)
19:39:18FromGitter<Varriount> I really like the fact that I don't have to explicitly initialize strings and sequences
19:45:09*elrood joined #nim
19:48:04FromDiscord_<treeform> ^ I whish that was expanded to tables.
19:57:39Araqit was!
19:57:45Araquse 0.20
20:03:31WilhelmVonWeinerThe docs give a "page not found" error on Source for at least the io page
20:03:35WilhelmVonWeinerhttps://nim-lang.org/docs/io.html
20:05:02Araqagain? :-/
20:05:28Araqah it's fixed on devel, I think
20:08:16FromDiscord_<Skaruts> proc new_bsp_leaf*(x, y, w, h:int):BspLeaf =
20:08:18FromDiscord_<Skaruts> result.x = x # <-- SIGSEGV: Illegal storage access. (Attempt to read from nil?)
20:08:31FromDiscord_<Skaruts> What could cause this?
20:10:28solitudesfif BspLeaf a ref type?
20:10:40solitudesf*is
20:11:04solitudesfi guess yes, you shoud call `new result` before assigning
20:13:36*nsf quit (Quit: WeeChat 2.4)
20:16:01*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:20:15*deech joined #nim
20:20:51Zevvisnt that something nim could figure out at compile time? its a common mistake
20:21:32FromGitter<deech> @mratsim Not sure why they're relying on GC for a microcontroller but it seems required if you're doing async.
20:25:54Araqyup
20:26:20FromGitter<kaushalmodi> is there a compile time equivalent of for loop?
20:26:46FromGitter<kaushalmodi> the `cImport` from nimterop requires a static string
20:26:58FromGitter<kaushalmodi> so was trying to do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d13d512dbd46e037d85a99b]
20:27:02FromGitter<kaushalmodi> but that doesn't work
20:27:43FromGitter<kaushalmodi> ^ above `hFiles` is a `const` too
20:27:57noonienwhat type is a slice of a seq?
20:28:05*jjido joined #nim
20:28:08FromGitter<kaushalmodi> I basically need to derive one const array from another const array, loop through that at compile time and pass that to `cImport`
20:28:18nooniendoes it keep a reference to the data of the initial seq? or does it alloc and copy?
20:28:40shashlick_@kaushalmodi - it's a bit of a challenge
20:28:46Araqit copies but toOpenArray doesn't, noonien
20:29:30noonienOH, nice
20:29:42Araqkaushalmodi: use a macro for that
20:29:42noonienso basically seqVar.toOpenArray(first, last)
20:30:26FromGitter<kaushalmodi> shashlick_: thought so :)
20:30:40shashlick_why does it have to be a const - just use var right
20:30:47FromGitter<kaushalmodi> Araq: looks like I'll need to dig into macros eventually
20:30:56FromGitter<kaushalmodi> shashlick_: cimport requires static string
20:31:03FromGitter<kaushalmodi> so I thought I'd need to use const
20:32:18FromGitter<kaushalmodi> stashlick_: If I use let instead of const in that snippet, I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d13d652aacbfb5fb7d32139]
20:33:29FromDiscord_<Skaruts> @solitudesf oh crap I forgot the call new result
20:33:31FromDiscord_<Skaruts> thanks
20:33:39FromDiscord_<Skaruts> I should get some sleep...
20:35:39shashlick_@kaushalmodi - probably use a compiletime proc or macro - https://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L290
20:36:09shashlick_if you can run cSearchPath() return value can be used, it should be possible
20:37:10shashlick_I had similar challenges in nimdeps - https://github.com/genotrance/nimdeps/blob/master/nimdeps.nim
20:37:53FromGitter<kaushalmodi> shashlick_: thanks! that might work
20:41:03AraqZevv: the compiler could detect it but it's discouraged, use object constructors
20:43:45Zevvok, but even if it is discouraged - would generating a compile time error indicating just that not be better then a runtime error?
20:45:20shashlick_how do i copy a seq into shared memory?
20:45:57shashlick_or even a string for that matter - is there a memcpy
20:46:17shashlick_meh - copyMem
20:46:26ZevvcopyMem
20:46:28Zevvright
20:48:10Araqbe my guest
20:48:18AraqI can tell you how to implement it
20:48:57Zevvplease do, I might give it a try
20:49:23ZevvI never got to doing compiler stuff, although I planned to
20:49:59*dwdv quit (Quit: quit)
20:53:15Zevvand now that I think properly about it, its not so esay of course. how to handle conditional stuff then? Generate a warning only saying "result *might* be uninitialized"?
20:54:38noonienis there anything in the stdlib for creating a stream out of an openArray?
20:55:02*narimiran quit (Ping timeout: 245 seconds)
20:55:23Araqnoonien: there is only StringStream
20:55:44noonieni see, and i'm guessing there's no way to slice a string without an alloc
20:55:47AraqZevv: it is easy because we have the infrastructure
20:56:04Araqbut you're right, we would only detect a couple of simple cases
20:56:27Araqnoonien: that's true but a dedicated Stream could do it easily
20:56:48*Vladar quit (Remote host closed the connection)
20:57:15*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:57:39noonieni'm unsure what to use for networking, i'm used to using seqs or arrays of bytes, and it's what some libraries use, but the stdlib seems to focus on strings, should i be switching to strings?
20:58:13Zevvnoonien: you can stil take a pointer and a length from a string
20:58:22Zevvif you are willing to give up safety
20:58:58Zevvand there is something quite new doing some kind of sliceing, but I forgot what and Im currently traveling so cant lookup
20:59:17AraqtoOpenArray, I told him
20:59:18*couven92 joined #nim
20:59:43Araqnoonien: probably.
21:00:32Zevvah right that one
21:00:50shashlick_are string and seq stored sequentially in mem?
21:00:53noonienAraq, Zevv: thanks!
21:00:59Araqshashlick_: yes, always
21:03:16shashlick_i'm thinking shared memory across threads - so am wondering if I can assume that the memory is safe to copy as is
21:03:35shashlick_string, sure but for seq, seems like it could contain pointers to stuff elsewhere which wouldn't be shared
21:03:36Zevvnot without a mutex, afaik
21:05:20Zevvno guarentees that both threads see the same thing if you don't lock. numa, caches, etc
21:05:28*stefanos82 joined #nim
21:07:41shashlick_agree
21:09:30Zevvhm browsing through sharedstring I see just copyMems. Must be missing something
21:09:48shashlick_where is that?
21:10:15Zevvlib/pure/collectios
21:10:41*brakmic joined #nim
21:12:36shashlick_why am i reimplementing it?
21:12:45shashlick_gosh i thought we only had sharedlist and sharedtables
21:14:12Zevvhaha
21:14:22Zevvbut then again, why does this work?
21:14:37Araqsharedstring was never finished
21:14:56Araqeventually I figured these things work better with destructors...
21:18:59*Kaivo quit (Quit: WeeChat 2.5)
21:29:46*couven92 quit (Read error: Connection reset by peer)
21:31:22*deech_ joined #nim
21:36:14*deech_ quit (Ping timeout: 272 seconds)
21:36:50FromDiscord_<Skaruts> adding items to a sequence during a `for item in seq` loop gives an error?
21:36:53*elrood quit (Remote host closed the connection)
21:37:47FromDiscord_<Skaruts> adding with seq.add(item)
21:39:28Araqlike in most sane languages
21:39:35FromDiscord_<Skaruts> lol
21:40:24FromDiscord_<Skaruts> porting python code
21:40:36*solitudesf quit (Ping timeout: 268 seconds)
21:40:50Araqhuh, I thought it errors in Python too
21:41:08FromDiscord_<Skaruts> wait, actually no, I'm porting GDScript code
21:41:32FromDiscord_<Skaruts> it's a handy feature though
21:48:09FromDiscord_<Skaruts> if there a handy function to merge two sequences? Or I have to iterate and add?
21:48:28lqdev[m]there's `add`
21:48:46FromDiscord_<Skaruts> can add take a sequence?
21:48:54FromDiscord_<Skaruts> seq1.add(seq2) ?
21:48:59lqdev[m]yes
21:49:03FromDiscord_<Skaruts> oh cool
21:54:57*brakmic quit ()
22:35:26*deech quit (Ping timeout: 252 seconds)
22:42:03*deech joined #nim
22:57:07*PrimHelios_ quit (Ping timeout: 245 seconds)
23:00:00*abm quit (Ping timeout: 252 seconds)
23:06:41*deech quit (Ping timeout: 248 seconds)
23:43:23*deech joined #nim