<< 20-10-2017 >>

00:01:08*gmpreussner joined #nim
00:02:58skrylarnetsplits :b
00:03:47*skrylar quit (Remote host closed the connection)
00:08:35*avsej quit (Ping timeout: 258 seconds)
00:08:49*oprypin quit (Quit: Bye)
00:09:31*oprypin joined #nim
00:09:44*FromGitter quit (Ping timeout: 246 seconds)
00:10:44*FromGitter joined #nim
00:13:48*avsej joined #nim
00:13:48*avsej quit (Changing host)
00:13:48*avsej joined #nim
00:16:01*gmpreussner quit (Quit: kthxbye)
00:16:49*gmpreussner joined #nim
00:33:07*Jesin quit (Quit: Leaving)
00:35:55*Jesin joined #nim
00:45:02*Jesin quit (Quit: Leaving)
00:46:43libmanhttps://dubst3pp4.github.io/post/2017-10-03-why-i-use-object-pascal/
00:47:19*Jesin joined #nim
00:47:20*darkn0de joined #nim
00:47:57darkn0deI'm trying to get TLS to fail on a bad host certificate... but it doesn't look like it ever will.
00:48:05*guelosk quit (Ping timeout: 260 seconds)
00:48:30darkn0deLooking carefully at openssl.nim, it appears that a lot of openssl symbols are not ex(im)ported
00:48:54darkn0degetting net.nim to properly verify certs is going to be challenging...
00:50:08darkn0deI'll be back in in an hour... but have a couple of interesting things though: http://bradconte.com/using-load_verify_locations https://github.com/nim-lang/Nim/issues/782 https://wiki.openssl.org/index.php/Manual:SSL_CTX_load_verify_locations(3) https://wiki.openssl.org/index.php/Manual:SSL_CTX_set_verify(3)
00:50:28darkn0dein short.. think we're doing it wrong. :)
00:57:54*NimBot joined #nim
01:05:02*Snircle quit (Ping timeout: 246 seconds)
01:07:29*ipjk quit (Quit: Leaving)
01:24:47*Snircle joined #nim
01:48:13*voiceftp quit (Ping timeout: 255 seconds)
02:08:02*dhalinar quit (Ping timeout: 246 seconds)
02:10:24*JappleAck quit (Quit: Leaving)
02:10:32*endragor_ joined #nim
02:40:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:47:40*Nobabs27 quit (Quit: Leaving)
02:58:47*libman quit (Quit: Connection closed for inactivity)
03:10:01*smt quit (Ping timeout: 240 seconds)
03:30:02*koranza joined #nim
05:22:20*voiceftp joined #nim
05:43:28*Kingsquee joined #nim
06:01:02*rakish joined #nim
06:01:08*rakish left #nim ("Leaving")
06:02:44*claudiuinberlin joined #nim
06:02:57*claudiuinberlin quit (Client Quit)
06:11:06*PMunch joined #nim
06:15:56*nsf joined #nim
06:23:48*vlad1777d joined #nim
06:29:31*Laon joined #nim
06:34:55*gokr joined #nim
06:35:55*Arrrr joined #nim
06:35:55*Arrrr quit (Changing host)
06:35:55*Arrrr joined #nim
06:49:03*Trustable joined #nim
06:49:29*dddddd quit (Remote host closed the connection)
06:52:58*Ven joined #nim
06:53:21FromGitter<Varriount> Yardanico: Your English is way better than my German.
06:53:21*Ven is now known as Guest65906
06:54:21FromGitter<Varriount> If you talk even half as well as you write, you'll be quite understandable.
06:56:22PMunchHuh, the reddit topic for yesterdays stream had ~20 upvotes when I went to bed. Now it's >70
06:58:58ArrrrWhat did you learn from the stream?
07:14:05*miran joined #nim
07:17:59*claudiuinberlin joined #nim
07:26:44*Guest65906 quit (Read error: No route to host)
07:27:21*Ven_ joined #nim
07:35:03FromGitter<dom96> Araq's destructors blog post is on HN front page ⭕
07:35:13FromGitter<dom96> *:o
07:39:24PMunchNice!
07:39:33PMunchIt was an interesting read
07:42:25livcdwhere is the video from araq about destructors ? i can't seem to find it
07:44:28FromGitter<mratsim> Waiting for edits
07:44:46Arrrr"we get a much nicer state len == 0 that is not as prone to crashes as nil" what is index out of bounds
07:45:09livcddom96 is it ? not in my feedly....
07:46:15PMunchArrrr, true but with "for x in y" it would simply skip if it had len == 0
07:46:44Arrrrmmm, that's right. Not that it solves every problem
07:50:35Arrrris sink implemented?
07:51:43ArrrrI don't see the reason to use sink in the provided example
07:54:02Arrrr"return values tend to be bad for high performance code" wtf
07:54:24PMunchYup
07:54:53PMunchI don't think sink is implemented, he mentions that there really isn't a need for it at the end of the article
07:56:54*Andris_zbx joined #nim
07:58:53ArrrrBut you have to replace procs with templates
08:02:43ArrrrInteresting article, there should be more documentation on what moves generates garbage
08:02:49*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:03:05*Ven joined #nim
08:03:28*Ven is now known as Guest16823
08:10:02*Arrrr quit (Read error: Connection reset by peer)
08:10:32miranmost of the discussion on that link is about c++ as far as i could tell from briefly going trough comments....
08:11:50gokrHe, interesting: https://github.com/Microsoft/napajs
08:12:41gokrFreaking js is seeping in everywhere.
08:14:30PMunchIt's so strange
08:14:44PMunchI don't really understand what makes people so obsessed with JS
08:15:40euantorLots of documentation that is easy for beginners to understand. Lots of tools to aid development and to aid learning. Lots of people know the language already so can help others learn.
08:16:03PMunchMaybe it has something to do with accessibility? And I think most programmers have at some point taken a look at JS if they wanted to do something on a web-page so it's a lot of exposure as well..
08:16:13euantorit has its quirks, but it sure is easy to dive in and get something working
08:16:22PMuncheuantor, yeah now that's true. But how did that all start?
08:16:52euantorMostly because it is/was the _only_ choice for writing an interactive web page. As the web has grown, so too has JS
08:17:02PMunchIt's not that long ago that JS was just a horrible cross-platform mess for browsers to scrape by on
08:17:32euantorthen v8 came along and web developers realised they could start writing the same code for both backend and frontend
08:17:41PMunchYeah, I guess it was just a case of everyone knowing it since it was the only choice for web, then it just spiraled from there
08:20:53*Arrrr joined #nim
08:24:49euantorYep, and now we have desktop apps running inside Chrome instances wasting memory
08:26:43PMunchHoorah
08:29:01Arrrrall your apps are belong to us
08:32:03FromGitter<dandevelo> So is Nim moving to a no-GC world?
08:32:18*JappleAck joined #nim
08:33:42cremThat's a nice world.
08:34:30FromGitter<dandevelo> I was hoping for a "Yes" answer :D
08:34:48FromGitter<dandevelo> Now looking for the "when" answer
08:36:27euantorIt's a while off yet
08:38:00Arrrri hope gc is still supported in the future
08:39:03*Laon quit ()
08:41:13euantorRegarding the earlier > "return values tend to be bad for high performance code" wtf
08:42:14euantorIsn't `result` currently a way to get around that? I seem to remember that it's allocated in the caller's stack frame or something
08:42:42euantorI remember it being mentioned here a while back anyway, but can't remember what was actually said
08:43:23Araqdandevelop: it's moving into this direction but it's in the "early prototype" stage. I think we should release v1 by the end of this year and then do more experiments
08:43:34Araqthe perfect is the enemy of the good or something like that
08:44:22Araqeuantor, read my blog. the problem is that the semantics are different, you cannot optimize semantic differences ;-)
08:44:45euantorCurrently reading it now, only just got to that sentence :)
08:47:34ArrrrCan't you move it?
08:52:24FromGitter<dom96> @Araq please start answering questions here https://news.ycombinator.com/item?id=15512249
08:55:44*rebellis quit (Ping timeout: 260 seconds)
08:57:10miranAraq: so this is something for v2.0?
08:59:33*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:06:01Araqmiran, I think so.
09:07:19Araqthough most users that have big Nim projects out there do not really care about the version, they want the language to evolve and do not mind code breakages that much. ymmv.
09:08:09PMunchHmm, in a macro is it possible to get the actual type of a distinct int from a typed argument
09:08:25PMunchgetType only gives me distinct int
09:08:39miranlearn from python2/python3 language evolution :D
09:08:39AraqPMunch, getTypeImpl
09:08:53PMunchThanks :)
09:12:52PMunchHmm, that didn't seem to work
09:13:17PMunchgetTypeInst seems to work though
09:19:04suswombat__Hey everyone
09:19:41*Guest16823 quit (Ping timeout: 240 seconds)
09:20:45Arrrrhello my friend
09:37:35*zolk3ri joined #nim
09:38:15miranhttps://news.ycombinator.com/item?id=15512249 still has the most comments about other programming languages, rather than nim :(
09:40:44livcdAraq: maybe that's just because these are not serious projects or "we invested money/effort" projects. I would say code breakage is painful :S
09:42:22Araqlivcd, er excuse me? they definitely invested good money
09:44:09livcdah ok
09:44:31livcdi thought you were talking in general
09:45:17livcdso you are saying the big projects that use Nim do not mind code breakages that much because they have the resources to deal with them
09:48:26*claudiuinberlin joined #nim
09:48:42FromGitter<andreaferretti> @Araq there is a inherent bias. The big projects that exist *right now* are more likely to accept breakage because the possible big project that do not accept it are not started until a stable v1 comes out
09:49:04FromGitter<andreaferretti> You also have to look at the projects that do not exist :-)
09:49:18FromGitter<andreaferretti> Exactly because of this reason
09:49:34suswombat__Naive noob question. What code is going to break?
09:53:23FromGitter<Yardanico> No code is going to break now
09:53:23federico3yours
09:53:40suswombat__federico3, damn :/ :D
09:53:44federico3suswombat__: sorry, I couldn't resist :D
09:54:17suswombat__federico3, no worries it was propably a dumb question anyways :)
09:56:03*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:56:12federico3breakage is not a binary thing. If code breaks with a deprecation warning and a clear hint on how to fix it it's a small nuisance. If it breaks in silent, subtle ways it's really bad.
09:57:36livcdsure i mean how many changes and breaks there have been for swift ? :)
10:01:04*Ven joined #nim
10:01:06*claudiuinberlin joined #nim
10:01:27*Ven is now known as Guest83993
10:01:56*Guest83993 quit (Client Quit)
10:02:09euantorput it this way: each time there's a new Swift release there's also a new Swift code migration tool release ;)
10:02:30euantorTHe fact they have to provide such a tool to migrate code to a new verison shows that BC is clearly not a priority
10:04:47FromGitter<MartinPercossi_twitter> hi everyone
10:06:21FromGitter<MartinPercossi_twitter> I saw araq's post about manual mem management on HN. Super excited about this. I gave nim a spin a couple of years back and liked what I saw, but for me GC is an issue because a) I'm a c++ dev and memory management is not that hard once you know what you're doing and b) because I'm an audio dev (my company: https://zenaud.io ) and GC is something that I need to circumvent.
10:09:27FromGitter<mratsim> @euantor it's true return values are "much" slower for ref type (if in hot path), due to multiple call to the GenericReset, Memset 0, checkNil. There are ways around that: templates, using result, using {.noInit.}
10:09:45PMunchHi Martin, yeah the new GC less features will open a couple doors for Nim I think
10:11:02FromGitter<mratsim> Hi Martin, it's not hard to avoid GC, I just use `type Foo = ptr object` or `type Foo = ptr UncheckedArray[int]`
10:12:22FromGitter<mratsim> I'm writing a high performance tensor library in Nim and you sometimes I just want no GC array or no GC objects, sometimes I want the GC and there are some tricks to make it behave
10:14:06Araqmratsim: Not sure if that's not simply a codegen bug though, I wouldn't draw theoretical conclusions from this
10:14:32suswombat__Anyone in here using vscode for nim and can tell me how much memory the nimsuggest processes spawned by the nim extension use?
10:14:40*suswombat__ is now known as suswombat
10:14:56Araqsuswombat, too much, omg :-)
10:15:06FromGitter<mratsim> @Araq yes probably, I think they are all reported
10:15:27FromGitter<Yardanico> Suswombat: nimsuggest usually uses 100-300mb
10:15:32suswombatAraq, was that a sarcastic answer? not sure sry
10:15:32FromGitter<Yardanico> But sometimes can leak
10:15:36PMunchWhat!?
10:15:39PMunchThat's crazy
10:15:50FromGitter<mratsim> @suswombat__ the issue is the number of nimsuggests that are spawned ... And the CPU eaten
10:16:31suswombatso this is normal? https://i.imgur.com/qaKGCHb.png
10:16:53FromGitter<MartinPercossi_twitter> My two cents: there's a once-in-a-generation opportunity for a language to become "the next C++". This is because C++ has acquired so much baggage that it is very difficult for noobs to learn. In addition, the pace of change of the project is relatively slow due to design-by-committee. To my mind, the race is on for some language to offer similar performance characteristics ("leave no space below"), and
10:16:53FromGitter... indeed several languages, like C2, Zig, and not the least, Rust, have emerged in a bid to claim that space. When you look at the popularity of python, it is due to a number of factors but the intuitive syntax is a clear selling point. And nim is very similar in this regard. Now I realize that GC is a very useful te ... [https://gitter.im/nim-lang/Nim?at=59e9cd15f7299e8f530ea77f]
10:16:58Arrrris `return "String"` optimized to "result = "String" ?
10:17:34FromGitter<Yardanico> No
10:17:42FromGitter<Yardanico> But I may be wrong
10:19:10FromGitter<Yardanico> @MartinPercossi_twitter Nim's GC is more performant than Java or C# or Go
10:19:16AraqArrrr, pretty much, it is
10:19:40FromGitter<Yardanico> And there's no stop the world
10:19:54FromGitter<Yardanico> Also you can use realtime gc
10:19:54Araqdom96, I see interesting comments but no questions I should answer
10:20:18ArrrrFine then
10:20:37dom96Araq: Engage with them.
10:20:41dom96There really are questions though...
10:20:43dom96https://news.ycombinator.com/item?id=15514374
10:20:48FromGitter<mratsim> Just say hi, "We want you, Nim recruits"
10:21:39dom96Better yet, write a top-level comment saying "Author of the article here, thank you for submitting it. Feel free to AMA."
10:22:41ArrrrThis
10:23:14ArrrrYou need more exposition Araq, is for the good of this community
10:23:50*Ven_ joined #nim
10:24:12FromGitter<mratsim> @MartinPercossi_twitter It's probably not advertised enough but Nim GC is easily deactivated AND there are 4 implementations: deferred RC, Mark and Sweep, Memory Region, Real-time (max pause tunable) and you can directly access Nim memory allocator/free.
10:25:03FromGitter<Yardanico> Also boehm gc
10:25:17FromGitter<Yardanico> And Go a
10:25:24FromGitter<Yardanico> Go GC :D
10:25:30FromGitter<mratsim> There is a huge stigma with GC but it doesn't have to be that way, as evidenced by the number of game programmer (and game framework bindings). Stopping the game due to GC is a big no-no.
10:25:48FromGitter<mratsim> Ah forgot about Boehm
10:27:52*Vladar joined #nim
10:28:14FromGitter<GooRoo> Hi guys. Sorry that I'm interrupting your discussion, but have a small off-topic question: is there anything like Either from Haskell or std::variant from C++ in Nim's standard library?
10:29:15ArrrrNope, only Option. I'd like to see Either in the stblib
10:29:42FromGitter<GooRoo> I see... okay then :) thanks
10:29:46FromGitter<Yardanico> You can implement your own though :P
10:29:47FromGitter<MartinPercossi_twitter> @mratsim - as I mentioned, I realize that there are merits to GC for certain types of tasks. And I agree that some of the stigma against them is unwarranted. That said: GC is a well-researched topic. I'm sceptical that Nim provides some new "special sauce" that makes it much more performant than other, more mature, implementations. In addition, the advances in C++, Rust, and Swift show that using smart
10:29:47FromGitter... pointers along with RAII can alleviate much of the cognitive burden imposed by manually tracking memory. So my feeling is that the tide is turning against GC, and with the increased importance of low-power-consumption, it seems likely that this trend could continue for some time.
10:30:12PMunchThere is this Either, from nimfp: https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim
10:30:26PMunchGooRoo ^
10:30:36FromGitter<MartinPercossi_twitter> Therefore I would prefer that the language sticks more to value semantics, and abandons GC :) But again, just my two cents and I realize I'm not really a contributing member of this community so feel free to ignore my comments! :)
10:30:48FromGitter<GooRoo> @Yardanico I can implement my own one in Haskell as well, but it's still present in standard library though ;)
10:31:45PMunchMacrtinPercossi_twitter, all comments are welcome :) Just as important to hear what "outsiders" mean
10:32:21PMunchGooRoo, often you see the kind pattern used in eg. the Json module
10:32:33FromGitter<Yardanico> @GooRoo well Nim is not a functional language. It has some functional features, but still.
10:32:44FromGitter<MartinPercossi_twitter> @mratsim - realtime GC -- I'm guessing this is not stop-the-world. What happens if I have multiple threads? Can memory be shared across them? Or am I restricted to message-passing/channel type mechanism?
10:32:54*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:33:10FromGitter<Yardanico> You can share memory with raw pointers
10:33:19PMunchGooRoo, this: https://nim-lang.org/docs/json.html#JsonNodeObj
10:33:26FromGitter<MartinPercossi_twitter> @Yardanico cool
10:33:28FromGitter<Yardanico> Or channels/spawn
10:34:04dom96@GooRoo: if you create a PR to add an Either type to the stdlib then I'll be happy to accept it :)
10:34:07FromGitter<MartinPercossi_twitter> Yeah most people are doing it with channels nowadays, which makes sense because they make certain types of comm elegant.
10:34:31FromGitter<MartinPercossi_twitter> If I use channels can I guarantee that a realtime thread will never call malloc?
10:35:22FromGitter<Yardanico> I don't think you can use different GC for different channels
10:35:33FromGitter<Yardanico> *threads
10:35:47FromGitter<MartinPercossi_twitter> In c++ how I handle this is I have a ring buffer with max msg size, each entry is an inplace_function, this allows a task framework (see Sean Parent's work) but in a RT scenario.
10:36:06FromGitter<mratsim> @MartinPercossi_twitter I use OpenMP in my tensor library with shared memory
10:36:14FromGitter<MartinPercossi_twitter> I would expect you can't use different GC on different threads.
10:36:43FromGitter<MartinPercossi_twitter> @mratsim right but my guess is that tensor lib cares about throughput but not so much about latency.
10:36:55FromGitter<GooRoo> @Yardanico Do std::variant, QVariant, or raw union after all belong to functional programming? It's just a data structure
10:37:17FromGitter<GooRoo> @PMunch, thanks, I use exactly the same approach
10:37:21dom96@MartinPercossi_twitter: Thank you for joining to give us your opinion. Personally I wouldn't have started using Nim without a GC. I definitely want the support for no GC to be expanded, I don't mind how that is done as long as I can continue to use the GC as I do now.
10:37:34FromGitter<GooRoo> @dom96, I'll think about it -)
10:37:35dom96But let's not get rid of GC completely :)
10:38:31euantorI think no GC in the stdlib would be really nice, then leave consumers to decide if they want/need a GC
10:38:46euantorI believe that is the direction that D is trying to ehad in too
10:38:49euantor*head
10:39:09FromGitter<mratsim> @MartinPercossi_twitter Indeed, in any case, I had to drop to very low-level memory management, with shared memory because it’s the only way to do parallelism on 1GB~8GB tensor objects so it’s possible. And for latency better to ask all the game devs in the Nim community ;)
10:39:20FromGitter<MartinPercossi_twitter> Thanks for the warm welcome, @dom96 ! I agree that there's no need to remove it, my feeling is that you can simply add a nice set of value types that exist outside of its operation.
10:40:04FromGitter<MartinPercossi_twitter> @euantorano - I second your opinion of no GC in stdlib.
10:40:21FromGitter<mratsim> @MartinPercossi_twitter you might be interested in my article about low level memory management in Nim: https://andre-ratsimbazafy.com/high-performance-tensor-library-in-nim/#how-low-level-memory-management-in-nim
10:40:22FromGitter<MartinPercossi_twitter> Dlang is a cautionary tale here ;)
10:40:57FromGitter<MartinPercossi_twitter> I already read it a few days ago, @mratsim -- really interesting article and nice job!
10:40:58FromGitter<Yardanico> @MartinPercossi_twitter what do you mean by value types? Simple Nim objects don't need GC
10:41:21FromGitter<Yardanico> Floats, ints, etc work without GC
10:41:42FromGitter<MartinPercossi_twitter> @Araq 's article mentions making e.g. containers behave like value types. This is a IMHO a good idea.
10:41:43dom96Yardanico: that is what value types are
10:41:44FromGitter<Yardanico> Strings and sequences will work without GC in the near future
10:43:28FromGitter<MartinPercossi_twitter> I personally prefer everything to be value types, by which I mean, I'
10:44:06FromGitter<MartinPercossi_twitter> I'm not a huge fan of hybrid type systems where there are some "reference" objects (classes) and then there are "structs" which obey value semantics, have destructors, etc.
10:44:29FromGitter<MartinPercossi_twitter> Because then the question invariably arises "should my Foo be a class or a struct"?
10:45:18FromGitter<MartinPercossi_twitter> And usually you end up going for a class, and then everything becomes a big object salad like in Java. The gravitational pull of reference semantics is extremely strong for some reason.
10:45:28ArrrrIn nim the question usually is "Object or Tuple?"
10:46:00FromGitter<Yardanico> They're the same if no object inheritance is used
10:46:09FromGitter<Yardanico> I mean the same in memory layout
10:46:47FromGitter<MartinPercossi_twitter> Right but what about constructors/destructors? Objects allocated with GC will typically not have destructors invoked (at least not using scopes, i.e. deterministically)
10:46:52dom96Arrrr: I don't think that's true
10:49:16FromGitter<MartinPercossi_twitter> At the risk of being rude: is there any time-frame with regard to @Araq 's proposed changes? Any design documents? I would be love to take a look at anything that's there.
10:51:25euantorWell the destructors work has been commited to the repository and I believe @Araq was going to add a Wiki page
10:51:46euantorhttps://github.com/nim-lang/Nim/commit/35c8b5e3bcc13ade6441f1b53ee8d3acacffded3
10:51:50euantorhttps://github.com/nim-lang/Nim/commit/7b8c8f3e482e3b22cd1eeaa67ee6f5cb71ae84e1
10:51:54euantor(and several others)
10:52:24FromGitter<mratsim> There is no classes in Nim so no gravitational pull ;). However what is asked recurrently is “How to do an interface in Nim?"
10:52:51euantorAnd it doesn't look like the Wiki page is up yet. That blog post is probably the closest there is to a design document/specification
10:53:07euantorTime frame is not this year - the plan this year is for v1 as far as I understand
10:53:35dom96https://news.ycombinator.com/item?id=15514806
10:53:50dom96Araq: Keep an eye out and answer questions :)
10:53:59dom96bbl, lecture time
10:57:36FromGitter<Yardanico> @mratsim as Araq says (and that's true) - interface is just an array of closures
10:58:46FromGitter<Yardanico> And there are libraries for Nim which can autogenerate these for you
10:58:58AraqMartinPercossi_twitter: plans are constantly changing but I expect the destructor feature to be useful within weeks, making it replace the GC within years :-) but what makes this discussion really hard is that the terms are so fuzzy
11:00:32*sleepyqt joined #nim
11:00:38Araqstrings and seqs mostly change in the implementation, it's not much of a breaking change and 'ref' could become an atomic RC'ed pointer with "trial deletion" for cycle detection
11:01:01Araqsame language, completely different runtime profile
11:01:22*Ven joined #nim
11:01:45*Ven is now known as Guest21513
11:01:47Araqmy educated guess, "slower but works with the outside world and much more helpful for multi threading things"
11:02:09*Ven_ quit (Read error: Connection reset by peer)
11:02:12*Snircle joined #nim
11:03:14FromGitter<mratsim> I think the move/sink would bring speed in my use case. And I would love to have a fast tensor library with value semantics, even on GPU.
11:03:48Araq"And usually you end up going for a class, and then everything becomes a big object salad like in Java. The gravitational pull of reference semantics is extremely strong for some reason." excellent remark, I agree completely
11:07:05*endrago__ joined #nim
11:07:45*endragor_ quit (Ping timeout: 248 seconds)
11:09:42FromGitter<MartinPercossi_twitter> @Araq - thanks for the time estimate, I realize that for big projects such estimates are hard to give. Your changes sound extremely attractive, as I said I find the language very elegant and powerful, and would love to see these additions in due time.
11:11:43Araqwell additions are easy, it's the replacement of the existing runtime with a different one that causes stomach ache
11:12:31AraqI can see "ok, I can write my own seqs now, that's all I really need" working out for many people but eventually new stuff should replace old stuff
11:20:26FromGitter<Yardanico> Araq: Btw, will opt type will be available before 1.0?
11:20:38FromGitter<Yardanico> *type be
11:21:35FromGitter<edubart> @Araq in the destructors post, I liked the idea of having `result` as a var in the last parameter of a proc instead of the traditional way of returning, this would generate much more optimized C code as I've noticed that few days ago. I thought of redoing my procs like that, but would make the code not so readable, so instead of using result as a var param everywhere, or not using, I ended up with a mix where I needed
11:21:35FromGitter... more performance, and using lots of `{.noInit.}` where I used the traditional result
11:22:46*Yardanico joined #nim
11:23:36FromGitter<MartinPercossi_twitter> Completely unrelated question: can the community recommend a command-line parsing library? commandeer and cligen look interesting, if anyone has experiences with these libs I
11:23:40FromGitter<MartinPercossi_twitter> I'd be happy to hear.
11:24:17Yardanicothere's also docopt
11:25:01Yardanicohttps://github.com/docopt/docopt.nim
11:26:02FromGitter<MartinPercossi_twitter> @Yardanico thanks
11:26:36FromGitter<dandevelo> How can I generate a string with the parameter name from a parameter passed to a template?
11:27:28FromGitter<dandevelo> template(SOMETHING) = echo "You passed " & ? what ? should be in order to output "You passed SOMETHING"
11:29:56FromGitter<mratsim> @dandevelo astToStr
11:30:54*sleepyqt quit (Quit: WeeChat 1.9.1)
11:32:38*sleepyqt joined #nim
11:34:39*claudiuinberlin joined #nim
11:36:41*claudiuinberlin quit (Client Quit)
11:41:41FromGitter<dandevelo> Thanks @mratsim! That's what I needed
11:42:37Yardanicomratsim: didn't knew about that one, thanks too :D
11:43:27FromGitter<mratsim> You write too much macros and not enough templates ;)
11:43:30ArrrrSome comments on reddit too about the blog post
11:43:38Yardanicomratsim: probably
11:45:02FromGitter<mratsim> wow people are aggressive @Arrrr
11:45:16*PMunch_ joined #nim
11:45:38*PMunch quit (Disconnected by services)
11:45:42*PMunch_ is now known as PMunch
11:45:51YardanicoArrrr, where?
11:45:54*claudiuinberlin joined #nim
11:46:05Yardanicooh wait, someone shared araq blog post on programming?
11:46:15Yardanicooh, I see
11:46:20Arrrrhttps://www.reddit.com/r/programming/comments/77ko76/nim_pointer_free_programming/
11:46:28Yardanicoyeah, I found it
11:46:44ArrrrThe return thing probably is because ignores the existance of result
11:47:04Arrrr*existence
11:48:17Yardanicoguys
11:48:24FromGitter<mratsim> The poster thought it was “harmful for everyone"
11:48:36Yardanicowe have two nim related posts on /r/programming in the top 15
11:48:40FromGitter<mratsim> (not Nim limited)
11:48:50Yardanicoaraq's stream - 14, blog post - 7
11:48:56Yardanico:P
11:52:16*dddddd joined #nim
11:57:16*Guest21513 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:05:33*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:07:57*suswombat quit (Ping timeout: 240 seconds)
12:08:52*FromGitter quit (Ping timeout: 258 seconds)
12:12:43*claudiuinberlin joined #nim
12:14:03*couven92 joined #nim
12:14:15*Ven joined #nim
12:14:38*Ven is now known as Guest72916
12:19:27*arecaceae joined #nim
12:19:37*Arrrr quit (Read error: Connection reset by peer)
12:24:44Yardanicodom96, will you need a twitch-relay enabled for your channel?
12:24:51Yardanicoon today's stream
12:25:00dom96sure
12:25:39Yardanicodom96, just do "/mod FromIRC" so we won't hit message rate limit :P
12:25:48YardanicoI'll start it now
12:26:39dom96Yardanico: done
12:26:43*FromTwitch joined #nim
12:26:45dom96Araq: Can you autohost my channel?
12:26:55Yardanicodom96, I've enabled it
12:27:29dom96Yardanico: thx
12:27:55PMunchShould we put it in a separate room this time?
12:28:26YardanicoAraq, dom96 asks you to host his channel - go to https://www.twitch.tv/settings/channel, there's "Host List" - add d0m96 here
12:28:32PMunchNot saying that I think we should, but maybe?
12:28:45YardanicoPMunch, what about gitter ? :(
12:28:53arecaceaedoes async come with an impl. for subprocesses ? - like I'm trying to run always 5 subprocess at a time from a bigger list of things, so I want to block as long as 5 subprocesses are running but once one finishes I want to start the next one, any pointers?
12:29:07PMunchAh right, we'll miss those..
12:29:15Yardanicoarecaceae, you can use https://github.com/cheatfate/asynctools
12:29:20Yardanicothere's asyncproc
12:29:23dom96arecaceae: there are a couple async osproc implementations that you can use
12:29:38dom96I'm happy to keep the relay in this channel
12:29:41Yardanicodom96, , Ideally I would like if we would create a new gitter room and connect it to #nim-offtopic
12:29:51dom96Araq: Once you do what Yardanico instructed, make sure to enable "Auto host" as well
12:30:04*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:30:30arecaceaedom96: can recommend any specific one?
12:30:37arecaceaeYardanico: thanks
12:30:43dom96arecaceae: the one Yardanico linked seems good
12:31:07arecaceaedom96: thanks
12:34:25Yardanicoeh, I think I should start new reddit account :)
12:34:38Yardanicobecause you can't change nickname on reddit
12:34:55Yardanicodom96, also can you please change Tiberium to Yardanico on nim forum? if that's possible
12:35:32dom96I can, but I have to edit the DB which is a pain :\
12:36:28Yardanicodom96, ok, that's really not a problem
12:36:36YardanicoI'll change the avatar on gravatar though
12:36:47couven92yaih, I'm back! :) Was the stream good yesterday?
12:37:06Yardanicocouven92, yes, but it was a bit too short :P
12:37:17Yardanicocouven92, we got 70 upvotes on stream announcement on /r/programming
12:37:27couven92nice!
12:37:38Yardanicoalso we got 160 upvotes on araq's blog post on HN
12:37:45Yardanicohttps://news.ycombinator.com/item?id=15512249
12:38:05arecaceaedom96: whats your stance on putting something like the asyncproc implementation in the stdlib?
12:39:25couven92Oooh... I see it is on YT! :)
12:39:44dom96arecaceae: if it's a mature implementation then I'm open to it
12:39:47Yardanicocouven92, wait, already?
12:39:52*Jesin quit (Quit: Leaving)
12:39:55couven92https://www.youtube.com/watch?v=KNUDGZuqfQM
12:39:56YardanicoI didn't knew that Araq has uploaded it
12:40:02Yardanicowow
12:40:12arecaceaedom96: I see, thanks
12:45:19*claudiuinberlin joined #nim
12:54:21dom96hah, somebody submitted the Nim community survey results to Reddit too
12:59:10*arecaceae quit (Remote host closed the connection)
12:59:28*arecaceae joined #nim
13:02:30mirandom96: seems like 'fixing stdlib bugs' is a theme for your today's stream. could you tell us a bit more what can we expect?
13:08:58zolk3riyeah, expect stdlib bugs to be fixed
13:09:02zolk3ri:p
13:09:33zolk3rior rather, have no expectations, so you won't feel disappointed when you find that there are no stdlib bugs fixed!
13:10:40dom96hehe
13:10:54zolk3ri(because there are simply no bugs in the stdlib)
13:11:04dom96I'll be looking through the list of bugs tagged "stdlib" and seeing what I can fix.
13:11:20*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
13:15:47miranjust checked 186 of those issues currently :) hopefully after the stream, the number will not go up :D
13:16:35Yardanicomiran, xd
13:17:18*nhywyll joined #nim
13:17:33Yardanicodom96, maybe you can also fix documentation bugs :)
13:20:17miranYardanico: are there some "low hanging fruits" in the documentation that a nim beginner could help?
13:20:47Yardanicomiran, you can check yourself:) https://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3Adocumentation
13:21:01Yardanicofor example https://github.com/nim-lang/Nim/issues/5914
13:21:22miranok, i'll see what i can do - i would really like to get that hacktoberfest t-shirt :)
13:23:15*endrago__ quit (Remote host closed the connection)
13:23:29dom96oh damn, I need to remember to make some more PRs for Hacktoberfest too
13:25:25Yardanicodom96, https://github.com/AliceWonderland/hacktoberfest :D
13:25:43Yardanicothere's a lot of stuff like
13:25:44Yardanicohttps://github.com/Cutwell/Hacktoberfest-Census
13:25:45Yardanicohttps://github.com/Nguyen17/Hacktoberfest-Sign-In
13:26:00Yardanicooh wait
13:26:08YardanicoYou don't need to have a MERGED PR
13:26:14Yardanicoopen PRs count too
13:26:28dom96Unfortunately people like that will likely cause them to stop this :(
13:26:32Yardanicoyeah
13:27:46miranPR doesn't have to be merged?! this changes everything!
13:28:15*Guest72916 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:28:35Yardanicomiran, https://hacktoberfest.digitalocean.com/stats/Yardanico
13:28:46YardanicoMy PRs to songbw/admin-server and nimble aren't merged
13:28:49Yardanicobut they count too 0_0
13:30:08dom96yeah, they don't need to be merged
13:30:51miranwell i guess this will be a productive weekend for me....
13:33:44PMunchHmm, what's proxyexe.nim?
13:34:01YardanicoPMunch, it's a proxy exe for choosenim
13:34:08Yardanicochoosenim creates "fake" nim binaries
13:34:21Yardanicoso it intercepts all nim calls and executes needed nim version
13:34:53PMunchHmm
13:34:53*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:35:20*claudiuinberlin joined #nim
13:35:28PMunchWhen I try to compile my project it locks up and Ctrl-C shows the trace coming from that file. But I guess that's just because it started the compiler
13:38:21dom96hrm, is that just for your project?
13:38:54dom96You can try running the compiler directly, it's in ~/.choosenim/toolchains/nim-ver/bin/nim (replace `ver`)
13:39:55*claudiuinberlin quit (Client Quit)
13:40:16*claudiuinberlin joined #nim
13:40:54dom96(if you run `choosenim show` it will show you the path)
13:41:12PMunchStill freezes, but there's no trace this time
13:41:26PMunchSo it wasn't caused by choosenim at least
13:42:06YardanicoAraq, is there any particular reason why renderer doesn't handle unicode?
13:42:17Yardanicoit's needed for things like this: https://github.com/nim-lang/Nim/issues/3056
13:42:52*Ven joined #nim
13:43:04YardanicomakeNimString in renderer.nim is responsible for this
13:43:11Yardanicobut it handles only ASCII chars via toNimChar
13:43:15*Ven is now known as Guest33067
13:43:25Yardaniconot ASCII chars are embedded into the string as-is
13:54:53*TjYoco joined #nim
13:55:25*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:56:58miranthe thread at HN has just hit 100 comments (and approx. 5 comments about nim :D)
13:57:02*couven92 quit (Quit: Client disconnecting)
13:58:23dom96I offered to answer questions and not a single question, just nice messages :)
13:59:12mirandom96: you offered that several hours too late, when whole thread went in c++ direction and passed the point of no return :)
13:59:28zolk3rieww
14:00:21dom96hehe
14:00:22dom96true
14:01:32*claudiuinberlin joined #nim
14:03:23*PMunch quit (Quit: Leaving)
14:03:59*Viktor joined #nim
14:05:58*PMunch joined #nim
14:06:11ViktorHey Guys. I was wondering what's the story behind the Nim logo. "King of the programming languages"?
14:06:28*PMunch quit (Client Quit)
14:06:40*PMunch joined #nim
14:06:51PMunchNim is named after king Nimrod
14:07:01PMunchThat's why it has a crown
14:07:20PMunchNot entirely sure why it is named after said king though
14:07:28dom96Because that was the first king
14:07:41PMunchThe first?
14:07:47*Guest33067 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:07:59YardanicoPMunch, yes
14:08:16Yardanicohttps://en.wikipedia.org/wiki/Nimrod
14:08:23Yardanico"He was allegedly the first king to wear a crown. "
14:08:38YardanicoThe Syriac Cave of Treasures (ca. 350) contains an account of Nimrod very similar to that in the Kitab al-Magall, except that Nisibis, Edessa and Harran are said to be built by Nimrod when Reu was 50, and that he began his reign as the first king when Reu was 130.
14:09:04Viktoralright, good to know!
14:09:12YardanicoViktor, I think it's a good logo :P
14:09:37dom96Something to add to our FAQ
14:09:43ViktorYes , it is true, I was just wondering what it means, but now I know. :)
14:09:55Yardanicohttps://en.wikipedia.org/wiki/Nimrod
14:10:01PMunchHowever: Attempts to match Nimrod with historically attested figures have failed.
14:10:10Yardanicoyes
14:10:26federico3therefore a repository of Nimble packages should be called "The Syriac Cave of Treasures"
14:10:45PMunchA bit long though..
14:11:19PMunchOh wait
14:11:29PMunchNever mind
14:11:31PMunchI'm tired
14:11:34PMunchTime to head home
14:11:51PMunchhttps://github.com/PMunch/genui/blob/master/examples/test2.nim#L50
14:12:05PMunchAnyone knows why that would make the compiler spin infinitely by the way?
14:12:23dom96federico3: awesome idea :)
14:12:29PMunchhttps://github.com/PMunch/genui/blob/master/genui/widgets.nim#L54
14:12:34PMunchDefined there
14:13:05PMunchIt's not really doing much more than storing a proc in a table, yet it just fails to do anything. Not ever the echo statement is executed
14:13:24dom96might want to grab a debug Nim compiler and see what happens with that
14:14:24cremIs there any SDL-based ui library for nim? Or native ui library, but should work under win,linux and macos. Or html renderer is also fine. :)
14:14:33Yardanicocrem, yep
14:14:46cremWhich of three is yep?
14:14:47Yardanicocrem, best one - https://github.com/yglukhov/nimx
14:15:04Yardanicosdl, but it aims to have native UIs in the future
14:15:13Yardanicosupport win, linux, macos, webgl, android, ios
14:15:19Yardanico*supports
14:18:03PMunchdom96, yeah I'll look into that when I get home. Does choosenim have a debug option?
14:18:04cremHm.. actually maybe native is not that good for my use case. I'm planning to redo a client for games database site.. Similar to itch.io app (or steam app). itch.io has it in node/electron. I hate javascript, but still seems to be the most viable option.
14:18:13dom96PMunch: afraid not
14:18:48Yardanicocrem, SDL is a lot better than electron though
14:18:54Yardanicocrem, I mean performance-wise
14:19:29*PMunch quit (Quit: Leaving)
14:19:38cremWhat about development velocity-wise?
14:19:56*SusWombat joined #nim
14:20:00*Jesin joined #nim
14:20:00Yardanicocrem, there are electron bindings for nim
14:20:09Yardanicohttps://github.com/PMunch/nim-electron
14:20:11cremHm.
14:20:31Yardanicobut it's mostly a PoC I think
14:20:41Yardanicoyou can ask PMunch about it though
14:21:57cremnim+electros is too much to learn at once. What about UI libs on top of SDL, are there?
14:22:08Yardanicocrem, NimX as I said
14:22:22YardanicoIt's built on top of SDL
14:22:26Yardanicohttps://github.com/yglukhov/nimx
14:22:29cremah, ok.
14:23:00Yardanicocrem, Nimx officially supports Linux, MacOS, Windows, Android, iOS, Javascript (with Nim JS backend) and Asm.js (with Nim C backend and Emscripten).
14:23:25*Ven_ joined #nim
14:24:53*miran left #nim (#nim)
14:25:54zolk3riYardanico: oh nice to hear about it
14:27:10YardanicoIf anyone missed: dom96 is streaming at 16:00 UTC (4 PM)
14:27:13Yardanico1.5 hours from now!
14:27:26zolk3ri18+?
14:27:36Yardanicozolk3ri, I don't think so xD
14:27:44Yardanicoit's 0+
14:27:44zolk3rishiet
14:27:46zolk3ri:p
14:27:51Yardanicozolk3ri, how old are u ?
14:27:55zolk3ri23
14:28:05Yardanicodom96, almost 60 votes on strawpoll
14:29:36zolk3riYardanico: what's that "FPS: 1"? xD
14:29:47Yardanicozolk3ri, it's actually very good
14:29:56Yardanicoit means that GUI doesn't update if there's no events
14:30:03*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:30:03Yardanicothat means that CPU and GPU aren't wasted
14:30:08zolk3riah right
14:30:21Yardanicothere's webgl demo: http://yglukhov.github.io/nimx/livedemo/main.html
14:30:30*claudiuinberlin joined #nim
14:30:51*claudiuinberlin quit (Client Quit)
14:31:11dom96Yardanico: yay, nice
14:31:29Yardanicozolk3ri, pure-nim, as you can see: http://yglukhov.github.io/nimx/livedemo/main.js
14:31:52zolk3riYardanico: yeah I think I will use this, my friend wanted me to write an app for Tesco that he could use on his phone, and if I write it, it will become popular in poland tescos!
14:33:04Yardanicodom96, nim community seems to be very hard-core :P
14:33:07Yardanicoonly low-level(ish) stuff
14:33:16Yardanicostdlib/compiler/destructors
14:33:37dom96zolk3ri: ooh, what's the app?
14:33:44dom96(or is top secret? :))
14:34:26dom96*is it
14:36:37zolk3ridom96: it's really easy, just need a properly designed UI to find products and their EAN-13... and possibly even generate it, it should prioritize frequently viewed products and whatnot, have a photo gallery, etc. I will have to fetch the products from ezakupy.tesco.pl before though :P
14:36:47zolk3riwhat they currently have is apparently a nightmare
14:37:03zolk3riand takes lots of time to navigate through, and buggy
14:37:55dom96Cool. Will it work with the UK tesco? :)
14:38:17zolk3ripossibly :P
14:39:03*TjYoco quit (Quit: Leaving)
14:44:37*claudiuinberlin joined #nim
14:52:50Araqhas dom96 started already?
14:53:04YardanicoAraq, no
14:53:12dom96in a little over an hour
14:53:22YardanicoAraq, yeah, he'll fix stdlib bugs :P
14:53:30Araqer huh? shouldn't it be in 7 minutes?
14:53:33YardanicoAraq, http://www.strawpoll.me/14185591
14:53:36YardanicoAraq, no
14:53:38Yardanico16:00 UTC
14:53:47Yardanico4pm
14:57:39*d10n-work joined #nim
14:57:40dom96Araq: Did you set up auto hosting?
14:58:18Araqwhat's that?
14:58:41*zolk3ri quit (Ping timeout: 248 seconds)
14:58:54dom96When I go live and you're not live then your channel will automatically host my livestream
14:59:00dom96I set it up for your channel on mine
14:59:03*zolk3ri joined #nim
15:00:00YardanicoAraq, go to https://www.twitch.tv/settings/channel, there's "Host List" - add d0m96 here and enable "Auto host"
15:00:32zolk3riwhen it begins, can I have a link so I can watch? :P
15:00:32*PMunch joined #nim
15:01:02Yardanicozolk3ri, https://go.twitch.tv/d0m96
15:01:06AraqYardanico, ok thanks
15:01:07gokrHum, gitter all quiet. But here its a party.
15:01:10zolk3rithanks
15:01:25Araqgokr, uh oh, did the bridge die?
15:01:34gokrIt must have.
15:01:37Yardanicoyeah
15:01:46dom96oprypin: bridge seems to be dead
15:02:01Yardanico* FromGitter has quit (Ping timeout: 258 seconds) it happened 15:08 my time, 12:08 UTC
15:02:07Yardanicolol
15:02:17dom96:\
15:02:19zolk3rioh
15:02:32*miran joined #nim
15:02:50gokrBut it can't be written in Nim then, right? :)
15:03:35dom96indeed
15:03:39dom96Time to rewrite in Nim
15:03:47zolk3riit should be easy!
15:04:07Yardanicoif gitter has an API - yes
15:04:16dom96Just port oprypin's code
15:04:17Yardanicohttps://developer.gitter.im/docs/welcome
15:04:19dom96Should be trivial
15:04:22Yardanicodom96, ?
15:04:47dom96https://github.com/oprypin/critter
15:07:11*solitudesf joined #nim
15:08:17*nsf quit (Quit: WeeChat 1.9)
15:08:31gokrPMunch: About genui and DSL for UIs, did you look at Red? Since they are all about DSLs, might have some good input. Also, how does genui relate to Nimui?
15:08:33livcdfromgitter is in which language ?
15:08:42*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:08:44Yardanicolivcd, crystal
15:09:33Yardanicoprobably I would port it to Nim :P
15:09:47livcdawww lets not bash crystal :P
15:09:52gokrPMunch: I mean... not Nimui, Nigui
15:10:00Yardanicolivcd, nah!
15:10:06Yardanicowe need our own critter
15:10:10Yardanico"girelay"
15:10:24YardanicoG(it)I(RC)relay
15:10:29YardanicoG(itter)I(RC)relay
15:10:32livcdcall it
15:10:34livcdNimoy
15:10:36YardanicoLOL
15:10:43Yardanicodo you know what does it mean in russian?
15:11:02livcdnope but i was referring to leonard nimoy
15:11:02livcdheh
15:11:09PMunchgokr, Yeah I did have a look at red a while back
15:11:23Yardanico"nimoy" is like "nemoy", it means "voiceless"
15:11:27Yardanico"немой"
15:11:28PMunchMight have too look at it more closely
15:11:48*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:11:58Yardanicoor it means "mute"
15:12:08livcdYardanico: ah i am a slavic speaker myself but i would not make that connection
15:12:09livcd:)
15:12:13Yardanicolivcd, well why? : )
15:12:23gokrPMunch: I only know Red ... from perusing Rebol/Red as inspiration for Spry in some areas. Some stuff in there looks darn nice at least.
15:12:37Yardanicolivcd, and believe it or not
15:12:39Yardanicolivcd, https://github.com/evacchi/nimoy
15:12:49livcdYardanico: i guess because the root of the word would be for me "NEM" :D
15:13:38miran"nemoj" in croatian would mean "don't"
15:13:38zolk3riYardanico: I bet you are coding in nim wearing full adidas tracksuit, aren't you?!
15:13:50Yardanicozolk3ri, xd
15:14:07Yardanicozolk3ri, I'm not a gopnik
15:14:30zolk3ri:P
15:14:36YardanicoLOL, there's a wiki page
15:14:37Yardanicohttps://en.wikipedia.org/wiki/Gopnik
15:15:25livcdzolk3ri: yes and just like perelman he would refuse a 1m$ because he understands the universe :P
15:15:32PMunchAnd how do they relate is a bit involved. I first created a macro for wxnim called genui. It had a simple DSL for creating wxWidgets Nim code. Then I figured that wxWidgets was a bit clumsy to use for Linux only applications and I made genui for Gtk2 and Gtk3. Then NiGui appeared and I decided that I wanted to try and get first-class support for genui into it as it wasn't always that easy to create the DSL after the fact. Through doing all this I kept thinking
15:15:32PMunchthat maybe there's another way and that's what I'm trying to achieve with the currently (and very confusingly named) genui project. It will focus on creating native GUI code with very little abstraction so that you can still implement special features in platform specific code if you want to. All this of course while focusing on having a good clean DSL.
15:15:46PMunchWhoops, didn't realise how much I typed..
15:21:00*Andris_zbx left #nim ("Leaving")
15:28:15*Guest17 joined #nim
15:28:58*Guest17 left #nim (#nim)
15:29:43*zenAudio joined #nim
15:32:25gokrPMunch: :)
15:33:05*nhywyll quit (Quit: nhywyll)
15:33:22*nhywyll joined #nim
15:34:11*couven92 joined #nim
15:35:46AraqPMunch, want some DSL advice?
15:35:54PMunchAlways :)
15:36:25Araquses karax's DLS :-)
15:36:33Araq*DSL
15:36:46Araqwhat's wrong with it? I spent some time designing it
15:37:14Araqit's really a DSL for tree construction and UIs are widget trees, so to speak
15:37:24PMunchHmm, good point
15:37:32PMunchThe Karax DSL is pretty good
15:38:16gokrSeveral cross platform abstractions in the Smalltalk community has used an "internal" tree representation, and then used platform specific "builders" that take that tree as input.
15:38:38PMunchAnd I do wonder how you do the mix between your widgets and Nim code
15:39:32*Arrrr joined #nim
15:39:32*Arrrr quit (Changing host)
15:39:32*Arrrr joined #nim
15:39:57Araqit's called "fairy dust"
15:40:43PMunchThat's what I feared :P
15:40:56PMunchAt least it's not Vodoo
15:41:06PMunchVoodoo*
15:41:39Araqwell I got a PR fixing a bug in it so that's proof others can understand it
15:42:39PMunchHaha, good point
15:42:51*dandevelo joined #nim
15:49:21couven92how far along is parallel testament?
15:49:50YardanicoAraq, yeah, add parallel testament to your next topic list
15:49:59ArrrrWhat do you think https://www.reddit.com/r/programming/comments/77ko76/nim_pointer_free_programming/domzpon/
15:50:20Yardanicorust is even harder at this lol
15:50:44couven92Yardanico, I actually have a quite substatial PR for testament coming up... I am considering of just doing parallel testament
15:51:20Yardanicocouven92, there's already a PR for parallel testament
15:51:29Arrrri guess we always have crystal for GC
15:51:31couven92Yeah, I know...
15:51:31Araqcouven92, oh yeah thanks for reminding me
15:51:32zolk3rirust is way more difficult, I agree
15:51:46zolk3ribut calling nim difficult? I don't know...
15:52:05dom96I actually agree with shevegen's point.
15:52:27dom96My main opposition to Araq's plan is that Nim may become more difficult.
15:52:40zolk3riyeah, I'm not up to date with these plans anyway
15:52:41couven92Araq, yeah but my PR is still waiting for me to do the HTML output using templates as dom96 suggested... it's in my backlog, I just haven't gotten around to doing that... I was planning on doing that now...
15:53:07livcddom96: i agree and disagree at the same time
15:53:26Araqcouven92, go ahead and do not wait for parallel testament
15:53:45couven92maybe do parallel testament afterwards! :P
15:53:48couven92?
15:53:50Araqthat other PR uses the wrong solution
15:53:54Araq(sorry!)
15:54:05dom96https://go.twitch.tv/d0m96
15:54:07couven92yeah, I also had something else in mind
15:54:07Araqit's much easier to parallelize testament anyway
15:54:08dom96Stream is starting soon
15:54:25Araqexcept it's blocked by a bug in osproc that I need to fix first
15:54:35Yardanicodom96, dat chat
15:54:37Yardanico:D
15:54:47dom96Beautiful am I right?
15:54:53Yardanicoyeah,
15:55:59couven92Araq, I was thinking of doing a lock on the output json file by just doing a line append. then the parallel SQL acces won't be an issue anymore, and then we'd rid ourselves from the SQLite DB
15:56:24Araqjust remove the Sqlite code already, it's not hard
15:56:34couven92Yeah will do
15:56:38dom96weird that the view counter is at 0
15:56:41couven92:) templates first though
15:56:51dom96and just as I say it, it changes :)
15:57:01couven92dom96, in my window it says 325
15:57:23dom96That's past viewers I guess?
15:57:32couven92ah, sorry that was the total view count
15:57:45livcdi see 4 viewers
15:58:05federico3perhaps the time of the day is not ideal?
15:58:24livcdit's still US business hours no ?
15:58:24dom96oh? Why not?
15:58:45dom96oh well, too late to change now :)
15:58:49livcdah yeah
15:58:55livcdit's too early for US
15:59:29couven92dom96, yeah, we know that you're based in the UK, we can deal, always possible to rewatch on YT later
15:59:42Yardanicomy time is already 17:00
15:59:53Yardanicosorry
15:59:54Yardanico19:00
15:59:57Arrrrlol
16:00:09FromTwitch<couven92> here it's 18:00
16:00:11FromTwitch<couven92> :)
16:00:13livcdyou thought 7 pm right ? :)
16:00:24Yardanicoeuropean part of russia
16:00:32FromTwitch<araq4k> it is
16:02:05FromTwitch<araq4k> can I send some issues here?
16:03:11FromTwitch<araq4k> https://github.com/nim-lang/Nim/issues/782
16:03:37FromTwitch<araq4k> https://github.com/nim-lang/Nim/issues/4405
16:03:58FromTwitch<araq4k> ok, sorry
16:04:21FromTwitch<araq4k> https://github.com/nim-lang/Nim/issues/6386
16:05:00FromTwitch<araq4k> https://github.com/nim-lang/Nim/pull/6514
16:06:00FromTwitch<araq4k> +1
16:07:08FromTwitch<araq4k> keep in mind the tester uses re.nim, so you probably need to update it too
16:07:10mirandom96: zoom in please (Ctrl+=), my traditional request
16:07:33FromTwitch<araq4k> what 're' uses + reExtended
16:07:41miranmuch better, thanks!
16:08:32FromTwitch<araq4k> I misunderstood your question then
16:08:37FromTwitch<araq4k> yes!
16:08:40*claudiuinberlin joined #nim
16:08:54FromTwitch<araq4k> yes
16:10:00FromTwitch<araq4k> result = re(s, flags) # implementation
16:11:04FromTwitch<araq4k> keep in mind the tester uses re.nim , so you probably need to update it too
16:11:09*zenAudio quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:11:25couven92Araq, why do you like the explicit result-assignment better? Just curious (I have no real preference)
16:12:00FromTwitch<araq4k> @couven92 lag here, I proposed this code before he typed it
16:12:10couven92ah?
16:12:14couven92I see :)
16:12:26*claudiuinberlin quit (Client Quit)
16:13:25FromTwitch<araq4k> ok, never mind, the tester is ok
16:13:32livcdaraq4k: but you still prefer your way no ?
16:13:52couven92Yardanico, because of your bridge, I can log out of the Twitch IRC, right?
16:14:39couven92because I'm annoyingly getting highlighted there all the time :P
16:15:07couven92dom96, yeah he answered the question
16:15:28FromTwitch<araq4k> @livcd: not sure, 'result' predates implicit returns and my style hasn't kept up
16:15:30Viktordoes anyone know if the postgres module is supporting JSON fields in query response?
16:15:36PMunchcouven92, yeah you can only be in this room if you like :)
16:16:10couven92yaih
16:16:22*kafke quit ()
16:16:42dandeveloIs there any way to detect a value is not part of an enum?
16:17:23FromTwitch<araq4k> @viktor: the db_postgre module supports every datatype but returns it as string
16:17:38*claudiuinberlin joined #nim
16:17:39*claudiuinberlin quit (Client Quit)
16:18:08federico3that's really unexpected tho
16:18:20couven92dom96, only react to the stuff where you get highlighted so that you can concentrate on the stream
16:18:24federico3dom96: I am
16:18:27Viktorhmm ok, so I will have to manually convert it, ok!
16:18:35*derlafff quit (Remote host closed the connection)
16:18:47FromTwitch<araq4k> shouldn't it raise an OS error?
16:19:15federico3dom96: say you want to expand `~`, log out what you get and then go and create a file
16:19:29federico3that's a pretty typical usecase
16:19:33couven92dandevelo, you can easily find out by assigning it to an enum variable
16:20:09dandevelocouven92 how would the check look like?
16:20:51federico3dom96: nah you are expanding "../myconfigfile.json" or "~/conf.json"
16:21:05*Arrrr quit (Ping timeout: 240 seconds)
16:21:38FromTwitch<yardanico> I'm finally here
16:22:21couven92dandevelo: https://gist.github.com/53539056cc3a02eaca4086c644ca14af
16:22:32FromTwitch<yardanico> LOL
16:22:34FromTwitch<yardanico> Aporia!?
16:23:16couven92dom96, you can run F5 in vscode
16:23:32FromTwitch<yardanico> F6
16:23:43FromTwitch<yardanico> @d0m96 you can use F6 to compile & run current nim file in vscode btw
16:23:52couven92(you just have to create a launch.json and set the file to execute to ${file})
16:24:06FromTwitch<yardanico> you don't need to edit launch.json
16:24:12FromTwitch<yardanico> it works without it
16:24:27dandevelocouven92: agree that blows up but how do you detect that in order to report it back to another function?
16:24:32FromTwitch<yardanico> I use F6 0_0
16:24:54couven92dom96, yes
16:25:07couven92dandevelo, try, catch block
16:25:29*Viktor quit (Ping timeout: 260 seconds)
16:25:46FromTwitch<araq4k> dom96: I agree, that file "save as " dialog is super annoying, stupid osx
16:25:49mirancan't you just run it with ctrl+alt+n? (if you have code runner plugin)
16:25:53couven92dom96, I'll do a feature request for that in the vscode nim extension
16:26:26FromTwitch<manterolat> You might need to tell VSCode it's a Nim file, rather than Plain Text (bottom right)?
16:26:28couven92the Python extension does that, I agree it would be nice to have for Nim
16:26:33zolk3ridom96: just use emacs or vim
16:26:35zolk3ri:P
16:27:44*kobi7 joined #nim
16:27:49livcdguys dont make him context switch too much
16:28:19dandevelocouven92: try, catch block does not seem to work
16:28:41couven92dandevelo, I am sorry? You want to not blow up? You know assigning two toally disperate types won't and SHOULD never work!
16:29:01couven92numeric and enum types are totally disperate!
16:29:47dandevelocouven92: just saying that try except does not have any effect
16:29:54dandeveloexcept never gets called
16:30:08*FromGitter joined #nim
16:30:15FromTwitch<pyloor> in vscode open new file (Untitled-1), paste your code, switch to "Nim" on bottom right and then press F6. Works for me. It creates a /tmp/vscodenimdirty.nim file and then compile+runs it.
16:30:16couven92yeah I know, it does not compile
16:30:42couven92dandevelo: ^
16:31:09FromTwitch<yardanico> she wants to learn nim
16:31:30couven92:D
16:31:43FromTwitch<araq4k> no
16:31:49FromTwitch<yardanico> use dirty one
16:31:50FromGitter<mratsim> @Yardanico, did you workaround the Gitter<->IRC issue with your twitch bot? it’s really weird on Gitter
16:32:01Yardanicowhat do you mean?
16:32:22darkn0de$150 bounty posted on https://github.com/nim-lang/Nim/issues/782
16:32:27FromGitter<mratsim> ah no, we just get “fromTwitch"
16:32:37gokrdandevelo: You need to distinguish between compilation error and runtime exceptions.
16:32:47couven92Araq, can you explain what immediate and dirty do?
16:32:49couven92:O
16:33:14Araqcouven92, not now.
16:33:27couven92okay, I'll look it up later
16:33:52*Viktor joined #nim
16:34:32zolk3riwhich issue is he trying to fix?
16:35:09zolk3rithanks!
16:35:19darkn0dezolk3ri, what do you mean. I think both cert and name verifications
16:35:43zolk3ridarkn0de: meant this: https://github.com/nim-lang/Nim/issues/6386
16:35:48FromTwitch<yardanico> he's talking with dom96 on stream :)
16:35:49darkn0deI think CN verifications might already be in there (probably need tests)
16:35:55Yardanicodarkn0de, https://go.twitch.tv/d0m96
16:35:58darkn0dezolk3ri, ah :) sorry
16:36:03couven92zolk3ri, https://github.com/nim-lang/Nim/issues/6386
16:36:54darkn0deYardanico, thank you!
16:37:04FromGitter<Yardanico> @mratsim well I can't fix now until I'll create Gitter-IRC-Twitch bridge myself :P
16:37:12couven92dom96, you want to do whatever the client wants you to do, meaning evaluate the Connection request header
16:37:41FromGitter<mratsim> I think that should be tagged RFC: https://github.com/nim-lang/Nim/issues/6538
16:37:52Yardanicoone sec
16:38:06Yardanicobut we all know what would happen to that issue :P
16:38:14dandevelo@gokr: maybe this link gives you an idea on what I am trying to accomplish: https://www.pastiebin.com/59ea264f91fa1
16:38:18FromGitter<mratsim> :D
16:38:59couven92dom96, yes you're right HTTP 1.1 is keep-alive by default when the COnnection header is missing
16:39:25miranYardanico: can you put 'bounty' label on #782?
16:39:36federico3dom96: netcat is your friend
16:39:40Yardanicomiran, yep
16:39:40*Arrrr joined #nim
16:39:40*Arrrr quit (Changing host)
16:39:40*Arrrr joined #nim
16:39:59couven92dom96, google closed the connection because it did not encounter an HTTP version
16:40:18couven92so try google with an invalid ULR
16:40:18dandevelocouven92 is this what you had in mind with the try/except? https://www.pastiebin.com/59ea264f91fa1
16:40:59FromTwitch<araq4k> btw I'm away
16:41:25couven92dandevelo, ah! You want to parse a string into an enum?
16:41:32couven92or rather tryParse?
16:41:51Yardanicoenum to string it seems
16:42:34FromGitter<mratsim> @dandevelo, wow you’ve been on this for 4 hours? Shouldn’t this be a runtime exception: https://play.nim-lang.org/?gist=1a4ab384324fcadcdcd1d946f158a23c
16:42:41Yardanicoit is
16:42:44Yardanicoonly in debug mode
16:42:49Yardanicoin release it would pass
16:43:41Yardanicoand result would contain !(invalid data)
16:43:45Yardanicoe.g. invalid enum value
16:43:48darkn0deMiran, Yardanico looks complex
16:44:11*SunDwarf is now known as abc
16:44:13*abc is now known as SunDwarf
16:44:19dandeveloYep, that is the output: 3 (invalid data!)
16:44:25couven92dom96 teaching HTTP at UiT
16:44:31couven92for the last three years
16:44:34couven92:P
16:45:07dandevelocouvent92: more like...trying to see if an uint32 value is part of an enum
16:45:12FromTwitch<lorymaster> Just so you know, every browser does whatever it wants in response to http messages, so it probably is not that big of a deal if you do whatever you want
16:45:14Arrrryou can do this: Create a const set with every value in your enum then check with "is v in set"
16:45:19federico3why closing the connection tho?
16:45:37couven92Yes dom96! Always keep-alive by default (unless 500 status code)
16:45:54Yardanicomaybe we should add "contains" for enums?
16:46:09Yardanicoand make it a compiler magic :P
16:46:15couven92the reason why google closed the connection was that you did not do an HTTP reuqest at all!
16:46:19federico3most servers and client have been ignoring HTTP RFCs and keeping connection opens more aggressively
16:46:37dandeveloYardanico: that would be great :)
16:46:37couven92try Google with a syntactically correct but invalid request for example
16:46:50Arrrrmm no it doesn't work ...
16:46:58ArrrrYEs, there should be a contains for enums, and len too
16:47:12federico3dom96: BTW telnet injects extra character while netcat does not
16:47:33PMunchFrom RFC 2616: "A significant difference between HTTP/1.1 and earlier versions of HTTP is that persistent connections are the default behavior of any HTTP connection. That is, unless otherwise indicated, the client SHOULD assume that the server will maintain a persistent connection, even after error responses from the server."
16:47:44PMunchSo basically it should persist if it is able to
16:47:55PMunchObviously if the server crashes there isn't much to be done
16:47:56zolk3riif the "Connection" is close, then you close, and if it's keep-alive, you don't, and HTTP/1.1 defaults to persistent connections, allowing multiple requests and responses to be carried over a single connection
16:48:09zolk3rihttps://tools.ietf.org/html/rfc7230#section-6.3
16:48:17zolk3rihttps://tools.ietf.org/html/rfc7230#page-79
16:48:30FromTwitch<yardanico> maybe we need to change the title to "fixing asynchttpserver bugs" ? :)
16:49:03couven92PMunch, yes I didn't feel for quoting, but that was exactly the text that went through my head :P
16:49:10FromTwitch<yardanico> @d0m96 why you don't have an extension for indentation lines?
16:49:40*bkerin joined #nim
16:49:42FromTwitch<yardanico> to show indent levels
16:50:01couven92years of teaching INF2301 have caused me to basically memorize the HTTP RFC :P
16:50:34*derlafff joined #nim
16:51:51dandevelo@mratsim: yep, after 4 hours it looks like the answer is: not possible yet
16:52:32miranYardanico: you don't need extension for that, just enable it in vscode options
16:52:40Yardanicomiran, yeah I actually know
16:52:45YardanicoI forgot it's a vscode feature :P
16:52:51PMunchcouven92, I just have mad Google-fu :P
16:54:17FromTwitch<meebhus> hi! what language are we working with?
16:54:32Yardanicomeebhus: Nim
16:54:40Yardanicohttps://nim-lang.org
16:55:10FromTwitch<meebhus> thanks 
16:55:25*JappleAck quit (Quit: Leaving)
16:55:40couven92dom96, you SHOULD evaluate the "Connection" Request header!!!!
16:55:51couven92to decide whether to close or not!!
16:56:08zolk3riyeah, and if it's not present, default to keep-alive if it's HTTP/1.1
16:56:43*Viktor82 joined #nim
16:57:04couven92very good dom96! I am appeased! :)
16:57:57*Viktor82_ joined #nim
16:58:20federico3we need a confcall instead of twitch
16:58:44Yardanicoskype?
16:58:48Yardanicodiscord?
16:58:53federico3mumble?
16:58:57*Viktor quit (Ping timeout: 260 seconds)
17:00:57*Viktor82 quit (Ping timeout: 240 seconds)
17:01:12*bkerin quit (Quit: ircII EPIC5-1.1.10 -- Are we there yet?)
17:03:15FromTwitch<yardanico> oh wait
17:03:25FromTwitch<yardanico> c-c-c-converter in stdlib ?! :)
17:04:44federico3we don't
17:04:57*Viktor82_ quit (Ping timeout: 240 seconds)
17:10:08*bkerin joined #nim
17:10:31kobi7hi
17:11:27*TjYoco joined #nim
17:12:14*cynofox joined #nim
17:13:56FromTwitch<yardanico> @d0m96 you already use waitFor here
17:14:01FromTwitch<yardanico> yeah
17:14:21FromTwitch<yardanico> resp.body needs to be awaited (or waitFor'ed) too
17:16:20*bkerin quit (Quit: "Woman with bleached blonde hair have black hair by cracky.")
17:16:56kobi7Hi Yardanico
17:17:00Yardanicokobi7, hi
17:17:50kobi7I am not sure how it works, as I haven't done much low level coding:
17:18:19kobi7I wonder if I can get the memory bytes of a variable holding some object.
17:18:48kobi7most of my experience is with c#
17:18:54*bkerin joined #nim
17:19:06Yardanicokobi7, you can do that
17:19:32kobi7for example, for deep clone, or deep equal. instead of using reflection, I want to get the bytes, then sort of cast them to that type
17:19:57Yardanicokobi7, you don't need bytes for that
17:20:10Yardanicolet mynewobj = cast[MyNewObject](myoldobjectvar)
17:20:24*bkerin quit (Client Quit)
17:20:34Yardanicokobi7, for equal you can just overwrite ==
17:20:34kobi7but that just changes the reference type
17:20:44*bkerin joined #nim
17:21:30Yardanicokobi7, so why would you need to get raw object bytes?
17:22:15kobi7actually my thinking is wrong, as I'd need new variables to point to that copied data
17:22:33kobi7an object with complex fields inside, clone it fully.
17:22:52Yardaniconim already has value semantics for simple objects
17:23:11Yardanicoif you have ref object, you can access its' object like that "myvar[]"
17:24:14kobi7myvar[] ?
17:24:33FromTwitch<bad_hombres> the only issue I have is that it's not done in go
17:24:40Yardanicoyes, you would dereference your reference with that
17:24:49Yardanicoso you would access it's data
17:25:08kobi7I see.
17:25:31kobi7but the variables it has inside it, would still be ref objects
17:25:48kobi7and I'd need to mimic the structure. so again working recursively ...
17:25:51FromTwitch<bad_hombres> because go rules and other languages drool
17:25:59kobi7in c# it'd be done with reflection but that is really awful to do
17:25:59FromTwitch<bad_hombres> and it's easy to read
17:26:20FromTwitch<bad_hombres> see, it's infallible logic
17:26:31FromTwitch<bad_hombres> you can't argue with it
17:27:22Yardanicowell nim is faster than go :)
17:27:47FromTwitch<bad_hombres> premature performance optimization is the root of all evil
17:27:48FromTwitch<boys_in_the_hod> what are you programming?
17:28:09Yardanicobad_hombres: and nim is compiled to efficient native binaries
17:28:34FromTwitch<bad_hombres> same with go
17:28:50kobi7we congratulate you, and hope to cooperate by porting go libs to nim :)
17:28:57FromTwitch<bad_hombres> I'm also just a huge shit talker
17:29:09federico3this is really off topic to the streaming and not productive
17:29:12Yardanicobad_hombres: let's not go into offtopic too much
17:29:13kobi7there is no competition here
17:29:14FromTwitch<bad_hombres> ppsshhh generics
17:29:24FromTwitch<bad_hombres> who needs them
17:29:35zolk3rilol go
17:29:44kobi7oh, am i disturbing some twitch time?
17:30:01*Guest17 joined #nim
17:30:17kobi7federico3: where can I watch the streaming?
17:30:27federico3kobi7: https://go.twitch.tv/d0m96
17:30:29FromTwitch<boys_in_the_hod> what is in your opinion the easiest language to learn for beginners?
17:30:39Yardanicopython
17:30:43kobi7ah, sorry didn't know
17:30:47FromTwitch<bad_hombres> I'm serious here, I actually hate exceptions
17:31:00FromTwitch<yardanico> @bad_hombres we all already know that you're just a troll :P
17:31:02FromTwitch<bad_hombres> it's just a frustrating thing for me, I don't like try/catch
17:31:40FromTwitch<bad_hombres> and then you have to wrap the code in a try catch and that indents your code more
17:31:58*Guest17 quit (Client Quit)
17:32:02FromTwitch<yardanico> and with go you need to have a shit-ton of these ugly if data, ok = ...
17:32:22FromTwitch<bad_hombres> yeah I don't have an issue with that
17:32:27zolk3ri19:30:39 < Yardanico> python
17:32:29FromTwitch<bad_hombres> not saying exceptions are wrong
17:32:30zolk3rinot anymore, it's nim
17:32:31zolk3rishh
17:32:32FromTwitch<bad_hombres> just that I don't like it
17:32:43FromTwitch<bad_hombres> entirely subjective
17:32:47kobi7improve error messages?
17:32:48*Viktor joined #nim
17:32:49FromTwitch<yardanico> @bad_hombres well this stream is about nim :)
17:33:01miranzolk3ri: let's not exaggerate that much ;)
17:33:26zolk3riwell, I wouldn't want anyone to start with python, tbh
17:33:32zolk3ristart with C :p
17:33:47YardanicoI've started with python
17:33:50Arrrrstart with the geeks
17:33:51Yardanicoafter that nim
17:34:05FromTwitch<bad_hombres> just start programming
17:34:17FromTwitch<bad_hombres> once you learn a few languages its easy to pick up another
17:34:25zolk3riI've started working on an ioquake3 game, that's how I got into programming
17:34:42miranzolk3ri: why don't you think people should start with python? what has changed?
17:34:50FromTwitch<bad_hombres> all languages are hard with little experience
17:35:14FromGitter<mratsim> @dandevelo use tables it will work, they have the `contains`or `haskey` procs
17:35:17couven92dom96, review https://github.com/nim-lang/Nim/pull/6051
17:35:20zolk3ribad_hombres, well, depends... even if you know C, Haskell might not seem too intuitive :P
17:35:20couven92:P
17:36:05zolk3rimiran: Oh they can start with any language they would like, I don't mind :) Personally I just dislike Python.
17:36:23miranzolk3ri: ok, but why do you dislike it?
17:36:29FromTwitch<bad_hombres> of course there are exceptions, it's more of a general statement
17:37:07FromTwitch<bad_hombres> I guess I should have wrapped my previous statement in a try/catch
17:37:16Arrrrlol
17:37:34FromTwitch<yardanico> @bad_hombres one gott thing with try/except: you don't have to wrap EVERY call which can throw an error into a try/catch
17:37:56FromTwitch<yardanico> *good
17:39:16couven92that one was SIMPLE! :)
17:39:48bkerineveryone should start with C
17:39:50FromTwitch<yardanico> @d0m96 there's already a PR to fix that
17:39:56FromTwitch<yardanico> @d0m96 check the issue again
17:39:58bkerinthen they actually know what other languages are doing
17:40:12*Guest17 joined #nim
17:40:15FromTwitch<bad_hombres> bkerin by that logic, everyone should start with assembly
17:40:16FromGitter<mratsim> everyone should start with Haskell @bkering ;)
17:40:20bkerinnah
17:40:21FromTwitch<bad_hombres> then they'll know what C is doing
17:40:22zolk3rimiran: performance, dynamic typing, indentation significant syntax, too many ways supported to do a thing, but i gotta run brb
17:40:29bkerinC is close enough to assembly its easy to see the map
17:40:46bkerinshould know what assembly is and look at once but no need to program in
17:41:08FromGitter<RSDuck> I think it depends on what you want to do
17:41:21FromTwitch<bad_hombres> i don't think everyone needs to know what assembly is doing
17:41:28FromTwitch<bad_hombres> there are just so many layers these days
17:41:33FromTwitch<bad_hombres> front end devs for example
17:42:59FromTwitch<yardanico> @d0m96 maybe you've pasted these lines and client sent them one-by-one?
17:43:17FromTwitch<yardanico> ok
17:43:27*Viktor quit (Ping timeout: 248 seconds)
17:43:54bkerinwell I started with eiffel first weirdly, and thinking objects were magic was bad overall I think
17:45:30couven92Araq, Yardanico maybe open and reserve #nim-stream for streams in the future?
17:45:38Yardanicocouven92, yeah I was talking about that too
17:45:43Yardanicobut gitter is a problem
17:46:04couven92dom96, there is no RFC limit on Content-Length
17:46:26couven92because that is ALWAYS very specific to your sever and application!
17:46:33*Viktor joined #nim
17:46:48FromTwitch<yardanico> default limit for PHP is 8388608
17:47:04FromTwitch<yardanico> it can be more though
17:47:48couven92also be careful! I can put non-numeric or larger than 64-bit int values into Content-Length!
17:49:17*smt joined #nim
17:49:44FromTwitch<yardanico> @d0m96 probably we would need to split processRequest into separate procs/templates so one proc will parse http version, other one will parse path etc...
17:49:50FromTwitch<yardanico> because it's TOO large
17:49:59FromTwitch<yardanico> like god methods in java
17:50:08FromTwitch<yardanico> or in every other language
17:50:26FromTwitch<yardanico> @d0m96 use templates :P
17:51:23*Viktor quit (Remote host closed the connection)
17:52:25FromTwitch<yardanico> @d0m96 try it with very big int
17:52:29FromTwitch<yardanico> @d0m96 like 121929512951929512951929512951925912
17:52:32FromTwitch<yardanico> would it still error?
17:53:15FromTwitch<yardanico> xD
17:53:31oprypinYardanico, gitter is a problem only from having two bots going at once, the messages going there from twitch look atrocious with the double prefix
17:53:44oprypinbut if u want another bridge pair, that's very easy
17:54:01Yardanicooprypin, I've added a special case for FromGitter on Twitch btw
17:54:22Yardanicooprypin, yeah, can you please also forward all gitter messages to #nim-stream ? :)
17:54:53oprypinwait how does that work, wouldn't you need a separate gitter room as well?
17:55:24*bkerin quit (Quit: Visit http://lice.muppetz.com)
17:55:46oprypinyou'd get out of context messages all the time
17:55:50Yardanicooprypin, well yeah we need to ask dom96
17:56:04FromTwitch<yardanico> @d0m96 can you please create another room in nim-lang gitter?
17:56:06FromTwitch<yardanico> for streams
17:57:09*TjYoco quit (Quit: Leaving)
17:57:51FromTwitch<yardanico> mget
17:58:04oprypinyardanico, is twitch just IRC or what
17:58:11Yardanicooprypin, just irc
17:58:17Yardanicooprypin, https://github.com/Yardanico/twitchrelay
18:00:16*Trustable quit (Remote host closed the connection)
18:00:39*Guest17 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:02:03*Guest17 joined #nim
18:03:58*Guest17 quit (Client Quit)
18:04:43*Guest17 joined #nim
18:06:20*cynofox_ joined #nim
18:06:41*kobi7 quit (Ping timeout: 240 seconds)
18:09:12*cynofox quit (Ping timeout: 258 seconds)
18:10:48*cynofox_ quit (Ping timeout: 246 seconds)
18:11:48*nhywyll quit (Quit: nhywyll)
18:12:22*cynofox__ joined #nim
18:14:39*JappleAck joined #nim
18:17:33*Guest17 quit (Quit: Textual IRC Client: www.textualapp.com)
18:21:51*endragor quit (Ping timeout: 258 seconds)
18:22:23couven92I cannot export procs in a templ file?
18:23:13couven92why does nim say: "testamenthtml.templ(13, 25) Error: 'export' is only allowed at top level" :(
18:23:28Yardanicocouven92, :(
18:24:03Yardanicoand I'm making gitter-irc bridge in nim :P
18:24:20Yardanicothankfully gitter has a very nice streaming api (like long polling)
18:24:39oprypinyou dont know what you're signing up for
18:24:48Yardanicooprypin, I know it's not easy
18:24:52Yardanicoall these corner cases
18:25:04Yardanicooprypin, does your crystal bot uses async or threads?
18:25:07oprypinyou think my bot fails for no reason
18:25:16Yardanicooprypin, let me guess
18:25:19Yardanicogitter api ?
18:25:21oprypinlike once in 3 months a new kind of weird socket error comes up
18:25:26Yardanicooh
18:25:36YardanicoI had a lot of issues like that with VK long polling
18:25:38oprypingitter goes down sometimes
18:25:43Yardanicohere: https://github.com/VKBots/VBot
18:25:51Yardanico(I don't develop it anymore)
18:25:57oprypinand like not fully down but some different error every time
18:30:32*zolk3ri quit (Ping timeout: 260 seconds)
18:31:40*zolk3ri joined #nim
18:47:19*claudiuinberlin joined #nim
18:53:07Yardanicodom96, eh, we can't do this with our current httpclient :( https://github.com/oprypin/critter/blob/master/gitter.cr#L110
18:53:33Yardanicobasically our httpclient just reads ALL available data until request is complete
18:53:43dom96nope, it doesn't
18:53:54dom96This is where .bodyStream comes in
18:53:58Yardanicoyeah I've tried it
18:54:00dom96See how `body` is implemented
18:54:17dom96if using that doesn't work then we have a bug on our hands :)
18:54:43couven92can someone who knows Source Code filters (templating files) help me: https://github.com/couven92/Nim/tree/testament-devel/tests/testament
18:55:08couven92I have created the testamenthtml.templ and including it in htmlgen.nim
18:55:39couven92but nim complains that I am calling the proc in testamenthtml.templ
18:55:57couven92> htmlgen.nim(27, 10) Error: attempting to call undeclared routine: 'generateHtmlTabListItem'
18:58:03*sleepyqt quit (Quit: Leaving)
18:58:15dom96Where is the endproc for generateHtmlTabListBegin? (https://github.com/couven92/Nim/blob/testament-devel/tests/testament/testamenthtml.templ#L146 just above)
18:58:32Yardanicoyeah
18:58:39Yardanicothese templates aren't indentation based
18:58:44couven92dom96, endproc?????
18:58:45Yardanicodocs mention this
18:58:47Yardanicocouven92, yes
18:58:51dom96#endproc
18:58:58couven92ah!
18:59:07couven92okay, let me try
18:59:08Yardanico Because indentation-based parsing is not suited for a templating engine, control flow statements need end X delimiters
18:59:31Yardanicoand you can even use export then
18:59:34Yardanico*
18:59:52couven92hmm... https://nim-lang.org/docs/filters.html did say that :(
18:59:57Yardanicoyes
19:02:37Yardanicodom96, so I firstly use "request" and then read bodyStream?
19:03:15dom96Yardanico: yeah, that should work.
19:03:23dom96Never tried it though so it might not :)
19:03:27couven92dom96, Yardanico: now I get `testamenthtml.templ(144, 5) Error: undeclared identifier: 'endproc'`
19:03:37dom96couven92: #end proc (maybe)
19:03:45Yardanicocouven92, yeah^
19:03:48Yardanicoas docs say, end X
19:03:50Yardaniconot endX
19:04:35Yardanicodom96, it doesn't work it seems :(
19:04:57*Arrrr quit (Read error: Connection reset by peer)
19:05:50*bkerin joined #nim
19:06:28Yardanicomaybe I'm doing it wrong, IDK
19:07:29couven92Yardanico, dom96: end proc works, but does not do anything. I still get the original error in htmlgen.nim
19:07:34Yardanicohmm
19:07:50dom96maybe you're missing some more #end proc
19:07:52couven92and exporting with * does not work at all
19:07:53dom96or some other #end x
19:08:05dom96Yardanico: Up for investigating the problem? :)
19:08:10Yardanicodom96, yeah I'm trying to
19:08:19dom96great
19:09:59Yardanicodom96, basically while true loop in httpclient.nim at line 991 doesn't break
19:10:12Yardanicobecause gitter sends message in json and \r
19:10:16*cynofox joined #nim
19:10:16Yardaniconot \c\L
19:11:49dom96it should reach line 1042, where it reads the body
19:11:57*cynofox__ quit (Ping timeout: 240 seconds)
19:12:10dom96What does Gitter actually send?
19:12:13dom96Like all the content
19:12:47oprypinhttp keepalive with \r-separated jsons
19:13:11Yardanicodom96, https://developer.gitter.im/docs/streaming-api
19:13:15YardanicoThe JSON stream returns messages as JSON objects that are delimited by carriage return (\r). Newline characters (\n) may occur in messages, but carriage returns should not.
19:13:46dom96Yeah, but tell me the raw data that the Gitter servers send once you send a HTTP request to whatever the URL is
19:14:26oprypin{"a": "b"}\r{"a": "b"}\r\r\r{"a": "c"}
19:14:37oprypinwith variable waits after each \r
19:14:54Yardanicoso firstly it just sends some http stuff
19:14:55dom96You're just giving me the body
19:15:00dom96I'm interested in the HTTP headers
19:15:07Yardanicook
19:15:12oprypini dont have them ready but i never use those
19:15:30Yardanicodom96, https://gist.github.com/Yardanico/7a042bf55895a7cb763a03c72ebd52b6
19:16:13*Vladar quit (Remote host closed the connection)
19:16:15oprypini mean i dont exactly feel great about my bot being replaced for no reason but whatever
19:16:32Yardanicowell I don't really want to replace it
19:16:35Yardanicoat least I want to write it :P
19:17:06dom96and then presumably after that it sends \c\l\c\l, right?
19:17:26Yardanicoyeah, it sends one \13\10 which is \c\l (AFAIK)
19:17:31dom96or well, just an empty line
19:17:43dom96so httpclient should break at line 1003
19:17:47dom96Is it really not doing that?
19:18:21Yardanicoyeah it did it, but then it still runs
19:18:21Yardanicohmm
19:18:36dom96That's impossible since it breaks :)
19:22:03Yardanicodom96, so if I ctrl+c it shows that it's running parseChunks at line 903
19:22:34dom96that's probably where the bug is
19:22:44dom96echo chunkSizeStr
19:23:35Yardanicodom96, so if gitter answers with some event - it's something like 219 or 211, if there's no events - 2
19:23:57Yardanicodom96, but still
19:24:17YardanicoparseChunks will run until they parse ALL response body, no?
19:24:28dom96nope, it's async
19:24:33dom96What's your code?
19:24:48Yardanicowell I've tried async firstly, and then sync one
19:24:52YardanicoI'm using sync one
19:24:59Yardanicoand basically client.request doesn't return at all
19:25:07dom96well... use async one
19:25:12Yardanicoit would be the same, no?
19:25:15dom96no
19:25:33Yardanicodom96, should I await client.request?
19:25:38dom96although hrm
19:25:48YardanicoI will need to await or read it anyway
19:26:12dom96Try changing line 1042: 'await' -> 'asyncCheck'
19:27:12Yardanicodom96, compile-time error: got (void), but expected one of: proc asyncCheck[T](future: Future[T])
19:27:22Yardanicoand yes, I'm using async version now
19:27:31Yardanicoah
19:28:12couven92okay dom96, Yardanico, got it to work :) https://github.com/nim-lang/Nim/pull/6058 is now ready to merge and will bring beatiful testament HTML :)
19:28:24dom96Yardanico: might need a when in there
19:28:35Yardanicodom96, yeah I've added asyncCheck to "else" after when statement
19:31:06*zayu joined #nim
19:31:07*cynofox quit (Read error: Connection reset by peer)
19:31:37zayuHi, quick and simple question: I have an old version of the nim compiler and want to update it. How do I do that?
19:31:48*cynofox joined #nim
19:31:59PMunchzayu, uninstall and install choosenim
19:32:13PMunchAfter that you can use it to switch between versions :)
19:32:16zayuI see, thanks
19:32:18dom96(or if you've installed Nim via choosenim just run `choosenim update stable`)
19:32:33zayuNo I cloned it
19:32:34PMunchYeah of course
19:32:54PMunchWhat version by the way?
19:32:56PMunchJust for fun
19:33:11zayuSec will check
19:33:14Yardanicodom96, well should I set a callback to bodyStream to receive data?
19:33:42zayunim version 0.15.3
19:33:55Yardanicozayu, cd yournimrepodir
19:33:56Yardanicogit pull
19:33:59Yardaniconim c koch
19:34:01PMunchOh wow, yeah that's pretty old
19:34:04Yardanico./koch boot -d:release
19:34:08Yardanico./koch tools
19:34:10zayuVery old!
19:34:10Yardanicobut this may fail
19:34:24zayuIt's all good, I'll go for choosenim
19:34:41zayuSeems like stack for Haskell which is quite nice
19:34:48zayuThanks for the input guys, much appreciated!
19:34:55PMunchNo problem :)
19:35:04Yardanicozayu, but remove your existing nim installation first
19:35:11Yardanicootherwise you may encounter some very strange issues
19:35:27zayuYeah, no worries. I'll remove it from path and stuff
19:36:01Yardanicodom96, I'll give you the code now
19:36:24dom96do it the same as `body`
19:36:29dom96bbl
19:37:47*RPG joined #nim
19:38:11*RPG is now known as Guest58559
19:40:00Yardanicodom96, yeah, indeed asyncCheck solves this problem
19:50:14Yardanicodom96, but I don't think it should work that way anyway
19:50:26Yardanicobecause sync code wouldn't for example be able to read bodystream at all
19:50:33Yardanicosince parseBody will still block it
19:50:36*dandevelo quit (Remote host closed the connection)
19:51:03*themagician joined #nim
20:07:32*zayu quit (Quit: Page closed)
20:07:37dom96yes, well, for sync code you'd need to use another thread anyway
20:08:12bkerinhi guys
20:08:37bkerinsomewhere in docs I ran accross a list of different gc options you could specify but I don't remember where and now can't find
20:10:00Yardanicobkerin, one sec
20:10:11Yardanicodom96, it's strange though
20:10:20Yardanicoruby allows you to do that in one thread it seems
20:10:37Yardanicodom96, https://github.com/gitterHQ/gitter-ruby-stream/blob/master/gitter-stream.rb
20:10:54Yardanicoprobably it's because they use third-party package :P
20:11:08bkerinah theres a --gc option in the compiler manual
20:11:18bkerinkinda mysterious what the options mean though
20:11:24Yardanicobkerin, why?
20:11:30Yardanicoyou just choose needed GC
20:12:08bkerinwell not sure what v2 go regions mean for example, and the other ones are not too specific about what goes on either
20:12:24Yardanicobkerin, well then just use default gc :)
20:12:54bkerinwhat I'm actually wondering is if there's a way to make gc immediate, st when var goes out of scope its destructor runs right away
20:13:15Yardanicobkerin, hmm, IDK about that, you can ask Araq
20:14:16bkerinseems like nim has almost all needed to do db-backed types pretty easily, but requiring .delete() or something whenever anything goes out of scope or accepting that db gets out of sync both seem somewhat undesirable
20:17:10Araqbkerin, you can use a withDb template for that
20:18:24Araqor do what all the cool kids are doing, use experimental features (destructors) and complain when it doesn't work ;-)
20:18:51bkerinnot sure what you mean by withDb template
20:19:55bkerinI'm inclined towards destructors but like I said it would be nice if they ran immediately when a var goes out of scope, so accessible vars and existing db rows stay in sync for a db-backed type
20:21:57Yardanicobkerin, they will
20:22:01Yardanicowith new destructors :)
20:22:24Yardanicobecause destroyer compiler pass will inject destructor calls into AST
20:22:39bkerino nice
20:22:53bkerinso no need even to pick markAndSweep collector in particular
20:22:58bkeriner
20:23:02bkerinref counting i mean
20:23:04Yardanicobkerin, https://nim-lang.org/araq/destructors.html
20:23:42AraqYardanico, well let's not sell an unfinished feature yet.
20:25:00YardanicoAraq, but you'll finish it, wouldn't you ? :)
20:25:22YardanicoI think these destructors can be actually useful in many contexts
20:25:38bkerinyah please im in kind of a hurry here :)
20:26:06Yardanicobkerin, you can already *try* new destructors, but it's very-very-very experimental
20:26:36Yardanicobkerin, https://github.com/nim-lang/Nim/blob/devel/tests/destructor/tcustomseqs.nim
20:26:42bkerinfair warning thx
20:27:15bkerinAraq i'm curious what you envision by withDb() if a brief summary is possible?
20:29:03*MadHatter_ joined #nim
20:29:44Araqhttps://nim-lang.org/docs/tut2.html#templates
20:29:53Araqtemplate withFile example
20:30:48couven92Araq, here you go: https://github.com/nim-lang/Nim/pull/6058
20:31:02couven92nice pretty testament HTML noe done! :)
20:31:14couven92s/noe/now/^
20:31:23Yardanicocouven92, how does it look ?:)
20:31:26Yardaniconow
20:31:37*cynofox quit (Quit: -a- IRC for Android 2.1.35)
20:31:43Yardanicoah, the same?
20:31:51Yardanicoyou just reworked it to use filters?
20:31:57MadHatter_Hi guys! How it goes?
20:32:01couven92Yardanico, yes
20:32:07YardanicoMadHatter_, hi!
20:32:09couven92MadHatter_: Hi there! :)
20:33:15MadHatter_I'm a bit in trouble here :(
20:33:35MadHatter_I'm pretty sure someone got into this before, but I didn't find solution yet
20:33:42YardanicoMadHatter_, what's your problem?
20:33:57MadHatter_postgres C api connect just hangs and does nothing when it cannot find database host
20:34:51YardanicoMadHatter_, are you about https://github.com/nim-lang/Nim/blob/master/lib/impure/db_postgres.nim#L503 ?
20:34:57MadHatter_I think I need to wrap db connect into async procedure and wait for timeout, but can't figure out what this proc would need to get work
20:35:24MadHatter_Yardanico, yep and low-level too
20:35:41YardanicoMadHatter_, well this proc will throw an error if it can't connect
20:36:25*nitely joined #nim
20:36:35couven92what does `^1` do again?
20:36:51miransimilar to python's -1
20:37:01miranindexing from the right side
20:37:29couven92okay, so Mystring[^1] gives me the last character?
20:37:32MadHatter_Yardanico, unfortunately it doesn't, because low-level API hangs
20:37:37mirancouven92: yep
20:37:45YardanicoMadHatter_, well there's no way to solve that
20:37:55Yardanicoyou wouldn't be able to solve it using async
20:38:01Yardanicobecause this call will just block forever
20:38:04Yardanicoif C api hangs
20:38:12Yardanicoyou should probably try updating your postgresql
20:38:19Yardanicobecause it's a bug in postgresql then
20:39:44MadHatter_well this is bad news, because it's freshly installed libpq for alpine
20:40:53YardanicoMadHatter_, but really you can't solve that, because it's not an issue from nim side. you can however try to connect in another thread, and wait if it successes in the main thread
20:41:00Yardanicobut this would be a hack
20:41:39*nitely quit (Quit: Page closed)
20:42:28*HoloIRCUser3 joined #nim
20:43:01*HoloIRCUser3 is now known as nitely
20:44:01MadHatter_agreed, but this is also a solution
20:44:50*miran quit (Ping timeout: 255 seconds)
20:46:25Yardanicodom96, merge https://github.com/nim-lang/Nim/pull/6051 ? :) couven92 explained why ^1 can't be used here
20:47:32*gokr quit (Ping timeout: 255 seconds)
20:48:07Araqthese align* procs all need to move to unicode.nim
20:48:23couven92Araq, ah, right, I remember :P
20:48:28Araq(and be made utf-8 aware)
20:48:45couven92that was why I went on this unicode crusade last time :D
20:50:11couven92Araq, so https://github.com/nim-lang/Nim/pull/6301 then?
20:51:48*gokr joined #nim
20:52:17Araqcouven92, clean up this PR please
20:52:26Araqonly the unicode related changes please
20:53:09YardanicoAraq, what about https://github.com/nim-lang/Nim/issues/3056? the problem is that renderer.nim doesn't handle unicode at all
20:54:03AraqYardanico, easy to fix, just make it escape only \0..\31 as well as invalid UTF-8
20:54:12YardanicoAraq, ok
20:55:06couven92Araq, I don't understand waht you mean... do you mean the strutils changes? sure, I can remove them out of this
20:55:17Araqyes
20:57:19YardanicoAraq, wait, then "for i in countup(0, len(s)-1): add(result, toNimChar(s[i]))" needs to be changed to user utf8 iterator, right?
20:57:27Yardanicohm, I'll try without it first
20:58:07Araqthat iterator likely doesn't do what you want
20:58:33YardanicoAraq, ah, yeah, I don't need it probably
21:00:00*PMunch quit (Quit: leaving)
21:00:27*gokr quit (Ping timeout: 240 seconds)
21:01:24*MadHatter_ quit (Ping timeout: 260 seconds)
21:02:08shashlickAraq's live streams are not getting archived on twitch
21:02:23Yardanicoshashlick, yes
21:02:24*oky joined #nim
21:02:28Yardanicothey're on youtube
21:02:33couven92Araq, okay cleaned up as you asked. CI running
21:02:35shashlickTiming just doesn't work from the US to watch live
21:02:39shashlickOh that's great
21:02:50Yardanicoshashlick, https://www.youtube.com/channel/UCAIXKsgiEkRjwlNgduABgmw
21:02:59couven92Yardanico, yeah I subscribed and belled Araq's YT :)
21:03:52shashlickYardanico: thanks!
21:04:11YardanicoAraq, should I import unicode module and check if result string is invalid in makeNimString? because if I would do validateUtf8 on stringified char in toNimChar - it's going to fail
21:08:46Yardanicoah nvm
21:08:57Araqcopy the algorithm from validateUtf8 and adapt it to your needs
21:09:45Araqlibraries are overrated, diy works better :P
21:10:33YardanicoAraq, well I can embed validateUtf8 into makeNimString
21:10:45Araqyes
21:11:41*gokr joined #nim
21:13:08dom96Yardanico: Did you get it working?
21:13:16Yardanicodom96, yes, I did
21:13:20Yardanicoare you about gitter?
21:13:26dom96yeah
21:13:31Yardanicobut I couldn't figure a way to run it without "while true" loop :P
21:13:40Yardanicocallbacks are hell here
21:13:45dom96Show me the code :)
21:14:03Yardanicodom96, working one or with callbacks?
21:14:49dom96I want to help you with the callbacks
21:17:45*MadHatter_ joined #nim
21:18:56MadHatter_Hi guys again, my problem with libpq is somewhat resolved by switching on ubuntu. So this is definitely a bug with alpine's libpq
21:19:57*solitudesf quit (Ping timeout: 240 seconds)
21:21:35dom96Yardanico: So you're trying to avoid 'while true' by using callbacks?
21:21:41Yardanicodom96, yes
21:21:47dom96You don't need to go so far, one callback is fine
21:22:03dom96But you can make it '{.async.}' and use 'await' inside it.
21:22:17dom96let final = await streamFut.read()
21:22:34*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:22:52dom96Also, I don't think you need to check for 'finished'
21:23:59Yardanicodom96, it seems I can't use {.async.} here :(
21:24:15dom96why?
21:24:23Yardanicomaybe you didn't notice - I'm setting a callback for a FutureStream, not for a Future
21:27:37dom96You'll need the while true then
21:27:58dom96sadly
21:28:15*NimBot joined #nim
21:28:38dom96It would be nice if we could get an iterator for FutureStream
21:28:55*MadHatter_ quit (Quit: Page closed)
21:29:11Yardanico!eval #?braces\r\necho "hi"
21:29:12NimBotCompile failed: Error: invalid directive: '\'
21:30:58dom96bah, I need to learn how to deal with journalctl
21:32:10federico3dom96: -f to follow, -u <unit> to filter by unit, --identifier <id..> to filter by name...
21:32:42dom96federico3: What's the easiest way to find output around where the process terminated?
21:33:26federico3do you know the name of the process?
21:33:46dom96yep
21:33:59federico3start with sudo journalctl --since today | grep fooo -C10 just to take a look
21:34:26FromGitter<Yardanico> asdasd
21:34:31Yardanicooh, wrong chat, sry
21:34:36dom96federico3: That gave a lot of output
21:35:04dom96but it did narrow it down
21:35:06federico3sudo journalctl --since today will run in a pager, type '/' to search
21:35:18dom96didn't run in a pager :)
21:35:28federico3it should
21:35:42federico3without '| grep ..'
21:35:58dom96oh, that's what you mean
21:36:05dom96yeah, well I found it anyway
21:36:09dom96"out of memory" :\
21:36:16Yardanicodom96, lol
21:36:24FromGitter<watzon> Hmm question. While digging through the code in another repo I found this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ What does `magic` do and why can't I find any documentation for it? [https://gitter.im/nim-lang/Nim?at=59ea6c5832e080696e070ace]
21:36:26Yardanicobtw it can happen if you've casted something wrongly
21:36:43Yardanicowatzon: it means that this magic is implemented in this repo
21:36:47Yardanicoor in library it uses
21:36:51Yardanicodo you have the link?
21:37:00Yardanicothis "magic" is probably a macro
21:37:02Yardanicoor a template
21:37:57FromGitter<watzon> Here's a link to the version I forked. The original version doesn't build with nimble so I had to fix it https://github.com/watzon/telebot.nim/blob/master/private/api.nim
21:38:22Yardanicowatzon: https://github.com/watzon/telebot.nim/blob/master/private/utils.nim#L155
21:38:57FromGitter<watzon> I found it
21:39:05FromGitter<watzon> I thought it might have been built in
21:39:07dom96Yardanico: Pretty sure it's a GC issue :\
21:39:11*nsf joined #nim
21:39:14Yardanicodom96, gc safety?
21:39:24dom96no, the GC is leaking memory
21:39:33dom96either that or an async bug
21:39:38Yardanicowatzon: you can inspect the resulting output of this macro
21:39:47Yardanicojust add "echo result.toStrLit" at the end of it
21:40:06FromGitter<watzon> Thank you for that Yardanico
21:41:29*NimBot joined #nim
21:42:12dom96yeah, that's pretty bad
21:42:21dom96It rises every time I refresh IRC logs
21:43:05Araqdom96, there are no known GC leaks. there is apparently an issue with memory fragmentation
21:43:51dom96I'm going to see if I can reproduce locally
21:43:59Araqbut that's the memory allocator, not the GC :P
21:44:05watzonFollow up question, this time from IRC because Gitter annoys me. I am getting the error `unhandled exception: SSL support is not available. Cannot connect over SSL.`. Do I have to do something special to rebuild Nim with SSL support? I may have not had openSSL installed when I built it
21:44:17dom96watzon: yep, rebuild with -d:ssl
21:44:26Yardanicowatzon, add -d:ssl to compiler command
21:44:29watzonThanks :)
21:44:42Yardanicoand also you need openssl lib (not dev version)
21:44:49Yardanicowell dev will work too
21:44:58couven92Araq, I am venturing further into testament source code... I suggest replacing the SQLite database with an append-only JSON file
21:45:14couven92that will be much easier to deal with for parallel testament
21:46:27darkn0dehi couven92, which project is this? and how to you plan to do json as append only?
21:47:09darkn0desqlite does lock for writes (but not reads), but append-only might end up with partial writes-while-reading with multiple readers
21:47:27Araqcouven92, too complex just create different .json files
21:47:49couven92ah, a new one for each run
21:48:05darkn0denever mind :)
21:48:08couven92darkn0de, this is testament, the Nim Tester
21:48:12darkn0deoh cool.
21:48:37darkn0dei wish there was a good way to do appends to json without rewriting the whole file.
21:48:46darkn0deyou can do it with log files, csv files.. why not json
21:49:05couven92darkn0de, It's the thing that makes the GitHub CI builds turn red from time to time, mostly because running it causes build timeouts
21:49:21darkn0deahh I see
21:49:26couven92darkn0de, yeah I know how to do parallel log dumping
21:49:28dom96darkn0de: why can't you do it with json?
21:49:33bkerinbye guys thx for help
21:49:50*NimBot1 quit (Remote host closed the connection)
21:49:51darkn0dedom96, i'm saying you can't really append to a json file after writing it.
21:49:55*bkerin quit (Quit: Confucius say: Man who lay woman on hill not on level.)
21:50:11darkn0dedom96, you really just have to write a new file and atomically rename
21:50:11dom96darkn0de: You can have a file which contains multiple json objects, one per line :)
21:50:28darkn0dedom96, that's not a single json doc anymore then
21:50:42couven92dom96, darkn0de, Araq: point is: with JSON if you have an array at the roor, you can just blindly remove the last character (the closing bracket) and replace it with new array items
21:51:07couven92s/roor/root/^
21:51:28darkn0decouven92, agreed, but that's kinda blindly writing. if you do two writes at same time, bad things happen ;)
21:51:38darkn0decouven92, you could od it easily with yaml though
21:51:48darkn0debecause there's no closing characters
21:52:36Araqjson is better than xml. but still pretty bad :-
21:52:52couven92darkn0de, yeah, the system uses a global variable for the db right now... in theory there's no real difference to my approach. But I remember that Araq wanted to rid testament of the SQLite dependency
21:52:53darkn0dedefinitely
21:53:06darkn0decouven92, that makes sense
21:53:32darkn0debut sqlite does give you nice write lock guarantees. of course, if you don't have multiple writers, then it doesn't really matter.
21:54:17darkn0deanyway sorry for taking the convo off track ;)
21:54:49*Trustable joined #nim
21:55:12couven92Araq, what did you mean by just creating different json files? A new one for each time I run testament?
21:55:30dom96Araq: Yep, I can reproduce it. How do I investigate?
21:59:17Yardanicodarkn0de, that's fine
21:59:26Yardanicoon-topic off-topic is acceptable here :P
21:59:33Yardanico*relevant off-topic
22:00:06darkn0decool ;)
22:02:59watzonIs there a good way to include a local package as a dependency for testing? Something like npm's link option
22:03:17Yardanicowatzon, yeah
22:03:21Yardanicorun "nimble develop"
22:03:28Yardanicoin the folder with the package
22:03:47Yardanicoso if you import your package somewhere, version from this dir will be used
22:04:05watzonAh perfect
22:04:18watzonThanks again Yardanico. You the real MVP
22:05:03couven92Yardanico, that is actually imensly helpful! :O
22:05:06couven92Nice! :)
22:06:14Yardanicocouven92, well I just keep an eye on new libraries/changes in nim ecosystem :P
22:06:22couven92:)
22:07:02*d10n-work quit (Quit: Connection closed for inactivity)
22:07:33darkn0deYardanico, that's awesome - does that make sense if you're compiling a static binary as well, or not really matter since they'll get embedded anyway?
22:08:45Yardanicodarkn0de, are you about OpenSSL ?
22:09:04Yardanicoit doesn't statically link by default, but you can do it of course
22:09:07Yardanico*linked
22:14:28*Jesin quit (Quit: Leaving)
22:14:30dom96Sounds like Nim could use a "This week/month in Nim" newsletter :)
22:14:36*themagician quit ()
22:17:59gokrdom96: Random question - can Jester do long polls?
22:18:23dom96gokr: yes, but I haven't tested it extensively
22:18:48gokrOk, because I have a need for that in Arduinobot.
22:19:27gokrClients submit compilation jobs - and right now, they have to poll on a URL for the compilation result to get done.
22:19:29*Trustable quit (Remote host closed the connection)
22:20:42gokrThe MQTT API that Arduinobot also has is better in that regard, you "emulate" a request/response by having the client subscribe to a specific result topic, where the server will publish the result. So no polling needed.
22:21:12gokrBut it would be neat perhaps to try a long request for the HTTP endpoint.-
22:21:45watzonAny easy way to take an Object and turn it into a JsonNode?
22:21:50gokrdom96: Also, I do share the "fear" around Nim dropping the GC.
22:21:55Yardanicowatzon, what object?
22:22:13dom96gokr: good, don't worry I'll keep fighting for it :)
22:22:55Yardanicowatzon, nim is not really dynamic, so you'll need to create a json like that
22:23:01watzonYardanico: an `object of RootObj` object called `TelegramObject*`
22:23:09Yardanicowatzon, well, you would need to do it manually
22:23:15watzonDamn
22:23:16Yardanicolike
22:23:20watzonOk haha
22:23:35Yardanicolet mydata = %*{"field": 1, "data": [1, 2, 3, 4]}
22:23:44Yardanico%* is a macro from json.nim which lets you write your json like this
22:23:57Yardanicolet mydata = %*{"field": obj.myfield, "data": obj.mydata}
22:24:14watzonWell that's cool
22:24:39gokrwatzon: You also have module marshal with the $$ proc
22:24:53Yardanicowell but marshal shouldn't be generally used for APIs
22:25:04Yardanico(here it's telegram api)
22:25:07gokrsure, agree
22:25:12Yardanicoand I think marshal should finally change
22:25:14watzonSo I'm guessing there's not a pretty_print method of some kind that would allow you to print an object to the console in a readable way?
22:25:26Yardanicowatzon, hmm, no
22:25:35Yardanicobut this would be not that hard to create :P
22:25:44gokrFor just dumping to console - why not $$ ?
22:25:45Yardanicowell it would be quite hard
22:25:47watzonOh well. That would be kinda nice to have built in though
22:25:54Yardanicowatzon, well, yeah, as gokr said
22:25:55watzonI use it extensively in ruby and crystal
22:25:59Yardanicoyou can just
22:26:06Yardanicoecho ($$myobj).pretty
22:26:10Yardanico$$ is from marshal module
22:26:14Yardanicoah wait
22:26:15Yardanicowrong
22:26:15watzonWould that work?
22:26:20watzonI'll try that
22:26:41Yardanicowatzon, parseJson($$myobj).pretty
22:26:54YardanicoparseJson and pretty are from json
22:26:56Yardanico$$ is from marshal
22:28:35watzonWell it worked lol
22:28:43watzonI had to do this `echo(pretty(parseJson($$(update))))`
22:28:49Yardanicowhy?
22:28:54Yardanicoyou don't need to do that
22:29:11Yardanicoecho parseJson($$myobj).pretty()
22:29:13Yardanicoshould work
22:29:51watzonYou're right
22:29:51Yardanicoyeah it does work
22:29:53watzonThat worked
22:29:59YardanicoUFCS :P
22:30:11watzonNow I just need to write it to a file instead of using echo. That object is huge
22:30:32YardanicowriteFile("myfile", parseJson($$myobj).pretty())
22:31:01watzonYardanico: well aren't you on fire today
22:31:08watzonSaved me having to look it up in the api
22:31:10watzonLol
22:31:30Yardanicowell you still can open a file, write to it, close it
22:31:35Yardanicobut it's 3 lines! :P
22:31:50YardanicowriteFile basically does the same
22:32:04watzonYeah I'm all about less lines
22:32:39gokrecho pretty(%*myobj)
22:32:47gokrMay also work, worked for an object for me.
22:33:10Yardanicolol it works
22:33:11Yardanicohow?)
22:33:25YardanicoI didn't knew that it also works
22:33:32YardanicoConvert an expression to a JsonNode directly, without having to specify
22:33:38Yardanicowatzon, so you don't need marshal
22:33:43gokrright
22:33:49YardanicowriteFile("myfile", pretty(%*myobj))
22:35:18watzonHmm not working for mine
22:35:19gokrThat's one of those things I like in Nim stdlib. Reading or writing a file - single call. Simple. Filenames and paths are strings. Simple.
22:35:22*ipjk joined #nim
22:35:26watzonI'm getting `undeclared field`
22:35:46watzonBut that is really nice
22:35:52Yardanicowatzon, well it probably wouldn't work for all possible objects
22:36:02Yardanicogokr, also don't forget "my" / "file" / "path" :)
22:36:21*couven92 quit (Quit: Client Disconnecting)
22:39:02gokrWho made th play.nim-lang.org btw?
22:39:09dom96zacharycarter
22:39:10Yardanicogokr, zacharycarter
22:39:17Yardanicodom96, ah, you're faster to type :P
22:39:36Yardanicogokr, https://github.com/zacharycarter/nim-playground
22:39:40Yardanicoit's not that much lines
22:39:44gokrOne neat thing would be to put the src as a base64 url param, that way one could share a code snippet.
22:39:50Yardanicogokr, you can share it
22:39:51Yardanicovia gist
22:40:00Yardanicothere's "create gist" button
22:40:01gokrOh, well, but... then you can't run it anymore.
22:40:08Yardanicowhat do you mean?
22:40:22Yardanicogokr, https://play.nim-lang.org/?gist=cb47b9af98aa2382483bb1532e136d78
22:40:24gokrWell, perhaps I misunderstood
22:40:28gokrah, ok
22:40:46Yardanicoyou just press "create gist" after you've written some code
22:40:51Yardanicoand it will create an anonymous gist
22:40:59Yardanicoand give you gist/playground links
22:41:03gokrneat, ok, forget what I said then :)
22:45:28Yardaniconim: you have many ways to do one thing, but only one of them is idiomatic, and others are for fp/python/c programmers :P
22:46:59Yardanicobut sometimes idiomatic way = python's way
22:47:07Yardanicoor c way
22:47:21Yardaniconim allows much more freedom than other languages
22:49:25Yardanicosyntax skins (I know that's probably gonna be removed, but who knows), identifier equality, UFCS, different backends, different GCs
22:49:56darkn0deis there like a dir() command as from python
22:49:59*zolk3ri quit (Quit: Lost terminal)
22:50:02Yardanicodarkn0de, yep!
22:50:09Yardanicoah
22:50:11Yardanicosorry
22:50:26Yardanicothere's no :P but it can be done with a macro, I'll probably try to do it today or tomorrow
22:50:39Yardanicodarkn0de, why do you need dir anyway?
22:50:42darkn0deAWESOME :) is there an easy way to just find out the keys of an object
22:50:45Yardanicoall fields are known at compile-time
22:50:47darkn0detrying to inspect things like response
22:50:56darkn0dejust to avoid looking at docs ;)
22:51:01Yardanicowell use "go to definition"
22:51:03Yardanicowhat's your editor?
22:51:06darkn0devim
22:51:09Yardanicoah
22:51:20Yardanicovscode just has vscode-nim extension, and it supports nimsuggest
22:51:27darkn0deah neat :)
22:51:41Yardanicoso you just ctrl+click and you can see the source file with that type/variable/something else
22:51:54Yardanicodarkn0de, https://nim-lang.org/docs/asynchttpserver.html#Request
22:51:55darkn0dethat's cool.
22:52:25darkn0deyeah I was going to look :) just something I miss (like an interpreter)
22:52:26watzon+1 for the vscode-nim extension
22:52:30Yardanicodarkn0de, nim secret
22:52:37Yardanicoit's a command
22:52:39darkn0decan't import stuff though right?
22:52:42Yardanicoyou can
22:52:46darkn0deoh!
22:52:48Yardanicobut only stuff that doesn't use C libraries
22:52:53Yardanicoe.g. times module wouldn't work
22:52:53darkn0deoh ok
22:52:59darkn0deor net + openssl?
22:53:05Yardanicoyeah that wouldn't work too
22:53:13darkn0destill cool though.
22:53:26Yardanicoso it's called secret so people don't complain about it :P
22:53:31darkn0deand actually i was trying to play with times in it , so you're right
22:53:37darkn0dei guessed that part ;)
22:53:40Yardanicoit uses tiny C compiler
22:53:47darkn0decool
22:53:48Yardanicoit's located directly in the Nim repo
22:53:52Yardanico(tinyc directory)
22:53:56darkn0denice!!
22:54:39darkn0delike I'm getting 'undeclared field: body' on a response object that was just workign fine with it
22:54:49darkn0dedir(response) would be perfect ;)
22:55:01FromGitter<stisa> Yardanico are you sure about tinyc? I thought `secret` used the vm
22:55:06Yardanicostisa: oh
22:55:10YardanicoI may be wrong, yeah
22:55:12Yardanicoit probably uses VM
22:55:29Yardanicodarkn0de, nim has a virtual machine for running compile-time Nim code/macros/templates
22:55:52Araqdir(response) is actually a pretty weird solution
22:55:56darkn0devery cool.
22:56:18darkn0deAraq, how so? I just want it for debugging
22:56:18darkn0deto see what's in response
22:56:39darkn0dejust not a while lot of data on why response is there (http response object) and not otherwise
22:57:25darkn0deas it turns out it was either i needed import tables
22:57:28Araqcould use 'repr' instead
22:57:37darkn0degreat point!
22:57:58Araqwell firstly, 'dir' is an obscure name for this feature
22:58:03YardanicoAraq, fields ?
22:58:15Araqsecondly, it's conflating runtime and compiletime aspects
22:58:17darkn0defields is kind of like .items() in python yes?
22:58:23darkn0deAraq, very true.
22:58:24Yardanicodarkn0de, I'm about name :)
22:58:37darkn0de:)
22:59:07darkn0deAraq, well, in Python it makes sense, because runtime is more or less compiletime
22:59:31Yardanicodarkn0de, items() is actually a kinda-neccessary name in nim: if you name your iterator (for your object) "items()", it will for with for loop like that: "for item in myobj"
22:59:37darkn0debut here, I agree, but why not just show what attrs are in an object at compiletime
22:59:48darkn0deinteresting
23:01:58Yardanicodarkn0de, it's easy to get type definition of a type at compile-time
23:05:11Yardanicodarkn0de, import macros
23:05:12Yardanicomacro echoType(x: typed): untyped = echo toStrLit(x.symbol.getImpl())
23:05:22Yardanicoand then you can use it like echoType(MyObjectType)
23:05:47Yardanicowell you can use it on stdlib types as well
23:07:59*nsf quit (Quit: WeeChat 1.9)
23:15:06darkn0deYardanico, very awesome
23:15:11darkn0deI will try that thank you!
23:16:01Yardanicodarkn0de, but don't forget that it would be printed at compile time
23:16:17Yardanicoso after between "processing" stuff
23:16:55darkn0deYardanico, I see that :) echoType(response) prints request(client, url, post_body, nil) ;)
23:17:02Yardanicowell it's a variable
23:17:09darkn0denot exactly what the runtime result of response.body is
23:17:10darkn0deright
23:17:11Yardanicoyou should run it at Request
23:17:18Yardanicosorry
23:17:19Yardanicoat Response
23:17:33darkn0deI did..
23:18:00darkn0dei printed after doing the request.
23:18:03Yardanicodarkn0de, are you sure?
23:18:04Yardanicohmm
23:18:12YardanicoechoType(Response) works if I import httpclient
23:18:13darkn0debut since it's run as a compiler macro, it ran before CC: ... lines
23:18:33darkn0depositive
23:18:41Yardanicodarkn0de, are you using jester?
23:19:02darkn0desince i don't know what jester is, doubtful :)
23:19:55darkn0dehere's what I see: Hint: ... (lots), request(...), Hint: [Link], operation successful [SuccessX], then output
23:20:07darkn0dein other words, it's actually before some compiling and linking.
23:20:11Yardanicodarkn0de, yeah it's fine
23:20:12Yardanicodarkn0de, I mean
23:20:13darkn0depretty cool anyway.
23:20:18Yardanicowhat module you're using?
23:20:22darkn0dehttpclient
23:20:35Yardanicowell echoType(Response) would actually print a type definition
23:20:51Yardanicoyou should call this echoType on a type
23:20:57Yardanicoyeah, I can add so you can call it at variables
23:21:01Yardanicobut it's not one line anymore
23:21:02Yardanicoor wait
23:21:26darkn0dehttps://pastebin.com/2VuD6FfS
23:21:51Yardanicodarkn0de, this macro is meant to echo fields of a type, not fields of a variable :)
23:22:01Yardanicolike "body: string"
23:22:06Yardanico"statusCode: int"
23:22:29darkn0deYardanico, right :) https://pastebin.com/q5rdW2rv
23:22:51Yardanicodarkn0de, sooo, you shouldn't call it on "response"
23:22:55darkn0deexactly.. but the Response object fields should be already known to the compiler at compile time, right?
23:23:08Yardanicoyes, but there's no macro like that in stdlib
23:23:12Yardanicoit can be done though
23:23:13darkn0deso in other words, I'm just looking to know what fields are in that object. (i.e., status, body, etc)
23:23:23darkn0deah no worries :)
23:23:24Yardanicodarkn0de, you need values or types?
23:23:37darkn0detypes. well, attribute names :)
23:23:43Yardanicomy macro does that
23:23:45Yardanicoas I said
23:23:51darkn0dethe echoType one?
23:23:55Yardanicoyou DON'T need to call it on a variable, yes!
23:23:58darkn0deah :)
23:24:05Yardanicoyou should call it on a type
23:24:16YardanicoI'll make it work for variables now
23:24:16darkn0deok! :)
23:24:20darkn0deawesome!!
23:24:30darkn0degotta run to dinner but brilliant macro
23:24:34darkn0deok cya
23:31:43*Kingsquee joined #nim
23:33:17Yardanicodarkn0de, didn't test it extensively, but still: https://gist.github.com/Yardanico/7b961cbeb5c8d797e5f4ecf80ff639b0