<< 30-08-2018 >>

00:00:15FromGitter<rayman22201> The good thing going for Nim in your case is the excellent FFI with C/C++ and Javascript. A strong argument you can make is that you can make Nim talk to code that you have already written very easily, and that you don't need to rewrite all of the code that the company has invested in. You can gradually migrate.
00:01:19FromGitter<rayman22201> Rust has made a lot of inroads using that exact approach.
00:02:15*ftsf joined #nim
00:25:47shashlickI can think of two easy arguments going from Nim: one is - oh see how quickly I did this compared to C/C++ and the other one is: oh see how quickly this runs compared to python
00:26:35shashlickI cannot think of other quick foot in the door advantages but these two are compelling
00:27:26*darithorn quit (Quit: WeeChat 2.2)
00:33:10FromGitter<gogolxdong> Our company is sticking with Nim,by far we have built our backend in Nim,waiting a window to migrate frontend to Karax,which I have got it done by half I think.
00:34:38FromGitter<gogolxdong> avoided go,nodejs,python,PHP,etc.
00:36:20FromGitter<rayman22201> I like that you used the word "avoided". Very funny lol
00:41:56FromGitter<gogolxdong> because I am not good at English?lol
00:43:14*ftsf quit (Remote host closed the connection)
00:43:35*ftsf joined #nim
00:43:55zachcartergogolxdong: I'm planning on / working on authoring an alternative to karax that uses html template strings instead of VDOM | DOM diffing
00:44:17zachcartersomething like - https://github.com/WebReflection/hyperHTML | https://github.com/Polymer/lit-html
00:44:19FromGitter<rayman22201> No! It is good English! It's funny because it pokes fun at those other languages
00:45:29zachcarterrayman22201: we don't have much existing C/C++ code - but the fact that Nim could bind to react and basically do anything that we use Typescript | Flow for in our JS|NodeJS projects - means potentially reducing the amount of varying technology we're using in our solution
00:45:49zachcartermost of Carfax's code was written in Coldfusion before I arrive and then there was a lot of Java / Groovy development going on
00:46:07zachcarterwhich resulted in my disdain for Java and the JVM and made me seek out Nim
00:46:37zachcarterbut convincing a bunch of people that know nothing other than JS | Java - that Nim offers a better way - isn't easy.
00:47:06FromGitter<rayman22201> Yeah.... the JVM is rough... I'm not a fan either, but it's so en-grained in corporate culture.
00:47:27zachcarterespecially when the average membver of your audience has never written any C/C++ before or known anything else but the heat that accumlates from their laptop when running their application on the JVM
00:47:42FromGitter<gogolxdong> Aren't you working on WASM?IIRC. production see https://www.bafang.cloud
00:47:49zachcarterYeah - but I'm trying to change that - we already were able to convince folks to start using Go
00:48:21zachcarterand Nim has inherent advantages over Go - so I think it will work out well - presuming the intial experiment is a success
00:48:49zachcartergogolxdong: well - I ran into issues passing closures b/w Nim (c-target) and JS via emscripten and maintaing GC references
00:49:02zachcarterso this made event handling and removing event handlers virtually impossible
00:50:05*NimBot joined #nim
00:50:06zachcartergogolxdong: is it okay if I share this website with my peers / managers?
00:51:32FromGitter<gogolxdong> sure, I can make a read only account for you to look through.
00:52:23zachcartergogolxdong - if you have spare cycles - that would be awesome :) but please, if you're busy don't worry about it - I think just being able to say the backend to your site is written in Nim will be enough firepower for me
00:59:18FromGitter<gogolxdong> don't worry I can make it by myself.
00:59:23zachcarter:D
01:00:11zachcarterthank you! - I'm need to run out of my house for a few minutes to take care of an errand, but as soon as I am back and I've recieved the credentials - I will check out the site :D
01:00:24zachcarterIt's so cool to see such a great looking site - and know that the backend is Nim powered :)
01:00:42FromGitter<gogolxdong> thanks
01:06:08*arecaceae quit (Remote host closed the connection)
01:28:18*arecaceae joined #nim
01:39:56*darithorn joined #nim
01:57:38FromGitter<timotheecour> @zachcarter @gogolxdong regarding WASM, do you have a link pointing to what you tried and issues you were having? also see https://github.com/nim-lang/Nim/pull/8738 ; I’m curious about wasm support in Nim, what works and what doesn’t today
02:00:41*vivus joined #nim
02:01:47FromDiscord<awr> that's a WIP i need to work on
02:01:59vivusanybody using geany?
02:02:02zachcartertimotheecour: so - I was using emscripten and JSBind - https://github.com/yglukhov/jsbind - to create an expriment where I was having karax target webassembly
02:02:25zachcarterI've done quite a bit w/ Nim and WASM - but it's all been via emscripten
02:02:49FromDiscord<awr> tbh I think emscripten support is important b/c aren't moving to the clang wasm backend in droves
02:03:05FromDiscord<awr> i don't think clang has anything like the EM_ASM intrinsics/macros
02:03:37zachcarterCan't you just override the nim module that provides that setting and add them yourself?
02:03:51FromDiscord<awr> i don't know if asm.js has a future (probably not)
02:03:52zachcarterThere's a way to override / add to Nim modules in a project locally
02:04:05zachcarterwho's still using asm.js anyway?
02:04:28zachcarterwasn't that just an experiment that lead to wasm?
02:04:36FromDiscord<awr> everything that was using it before and has since yet to move to wasm
02:04:52FromDiscord<awr> asm.js is supported by all the major browsers
02:04:56FromDiscord<awr> iirc
02:05:12zachcarteryes - but considering WASM is vastly improved over asm.js - I imagine it'd be to the benefit of users of said libraries to find a WASM replacement
02:05:27FromDiscord<awr> asm.js is less important i agree
02:05:27zachcarterI don't find much reason to support legacy targets that are bound to disappear
02:05:56zachcarterI think there is a compromise here - find some way to patch that config file and turn it into a nimble library that can be included in projects using emscripten to target asm
02:06:22zachcarterI've suggested this change long before you - and yuriy probably before me I magine
02:06:34FromDiscord<awr> i may get rid of it but that brings up the question of should we get rid of stuff like the CPU options for, say, the DEC alpha, m68k, ppc32
02:06:59zachcarterwell - I imagine as Nim matures, decisions like that will be easier to make
02:07:14zachcarterespecially once there is enough time to develop analytics around Nim's usage
02:07:18FromDiscord<awr> and the atari and amiga compilation plats
02:07:33zachcarterwhich I imagine Araq / Nim haven't had much time for besides the survey and the analytics Dom bundled w/ choosenim
02:07:57zachcarterwell - part of the appeal of Nim is being able to target a variety of different systems - pretty much any system
02:08:07zachcarteremscripten is a compiler - not a target
02:08:12FromDiscord<awr> by virtue of C yes
02:08:49FromDiscord<awr> yeah which is why i consider wasm32/64 a CPU
02:08:51zachcarterI'm not the one that needs convincing anyway - I undestand both sides of the argument, but I think there are reasonable alternatives.
02:10:23zachcarterI'd argue it's more of a chore to install emscripten and get the paths correct than it is to write a .cfg file for Nim to target emscripten
02:10:31zachcarterit's literally like 15 lines
02:10:55FromDiscord<awr> who exactly *is* hacking on m68k nowadays besides like...sega genesis homebrew games and obscure microcontroller platforms
02:11:04FromGitter<gogolxdong> @zachcarter [email protected]/readonly
02:11:27zachcarterhere's how you can patch Nim modules - https://github.com/zacharycarter/zapp/blob/master/src/zapp.nims
02:11:48zachcarterand here's how you can cfg Nim to use wasm via emscripten fairly easily - https://github.com/zacharycarter/zapp/blob/master/nim.cfg
02:11:56zachcartergogolxdong: thank you!
02:12:45FromDiscord<awr> i might take a look at that. i don't know if my local build of emscripten is just broken or what but the wasm generation is just not behaving
02:14:30zachcarterplease do - and if you have questions, please ask me - there are a few community members (yuriy is the only one I can remember off the top of my head, but if you look up Nim wasm projects on github, it's easy to figure out) - that are familiar w/ wasm and emscripten
02:14:34zachcarteralso - https://github.com/Feneric/nim-wasm-helpers
02:14:59zachcarterI haven't used that before, and I just found out about that (and this related blog post - https://www.spiria.com/en/blog/web-applications/webassembly-nim) - but they may be useful to you
02:15:26FromDiscord<awr> i'm more familiar with asmjs than i am with wasm but i've been poring over the docs
02:16:00FromDiscord<awr> lack of setjmp/longjmp()/zero cost exceptions in wasm is a little...hm
02:16:16zachcarterit's relatively simple to target via emscripten - I'm not sure what your endgame is with WASM, but if you look at this project - https://github.com/zacharycarter/zapp - it has a lot of WASM stuff going on in it
02:16:57FromDiscord<awr> i kinda want to make sure the standard library behaves in a reasonable manner with wasm
02:17:41FromDiscord<awr> to a large extent emscripten/clang already make that happen by giving the C interface a large degree of POSIX-ness
02:17:46zachcarterhttps://github.com/zacharycarter/zengine - I compiled that to WASM - the example you see in the topmost gif (via emscripten)
02:18:33zachcarterhttps://twitter.com/Hahaitsfunny/status/913526506139332613
02:19:23FromDiscord<awr> cool stuff
02:19:58zachcarterthanks!
02:20:10FromGitter<gogolxdong> found some bugs when create user with RBAC ,fixed.
02:20:14FromDiscord<awr> i think wasm (i.e. wasm itself, not your project) needs some enhancements to better suit hosting a game engine
02:20:23FromDiscord<awr> [cough cough] SIMD types [cough cough]
02:20:29zachcarterthat'd be nice
02:21:31zachcarterI'm finding git subtrees to be amazing
02:21:40zachcarteras far as git goes anyway - which it's not so amazing
02:22:06FromGitter<gogolxdong> Go will support WASM in next release.
02:22:28zachcarterit still won't have generics
02:22:44zachcarterand I really think Go is going to have the same problem Python 2|3 does
02:22:49zachcarterbut we shall see
02:23:14zachcarteralso - I bet that lunatic that won't get go of dep - is still going to be bitching about Go's package management
02:24:30zachcarterthe only thing Go has going for it I think - is it's ecosystem and stdlib - both are very rich at this point
02:24:47zachcarterotherwise, I think there are better alternatives a.k.a. Nim
02:24:59FromDiscord<awr> go as a language is just reactionary IMO
02:25:56zachcarterwell - I think there was a need for a more productive systems programming language that could be an alternative to all the C++ they were probably writing at Google
02:25:59FromGitter<gogolxdong> Agreed, Go is promoted significantly by Chinese community and developer , like what I did.
02:26:21FromDiscord<awr> "i hate writing code C++ it sucks so much therefore i'm going to make a language in the complete opposite direction of C++"
02:26:22zachcarterbut - I don't think they hit the sweet spot of productivity vs friction - and I imagine a lot of that blame lies with Rob Pike and other language designers
02:26:42FromGitter<gogolxdong> I am trying to do the same in Nim.
02:26:51zachcartergo is not terse at all and isn't very DRY in certain regards - and the metaprogramming it does offer is extremely limited
02:27:06zachcarteroften times when I'm writing go - I'm asking myself why I'm not just writing in C
02:27:08FromDiscord<awr> https://twitter.com/tpflug/status/1034754076523851776
02:27:11FromDiscord<awr> highly relevant
02:27:56zachcarteryeah - that is a great comment / tweet
02:28:16FromGitter<gogolxdong> We can see where go ends.
02:29:24FromDiscord<awr> i think nim recognizes that a lot (not all) of C++'s high level goals are reasonable, but that C++ is the wrong implementation
02:31:29FromGitter<gogolxdong> but let folks choose, they are historic process.
02:32:52zachcarterawr: I agree - probably ditching a lot of the OOP features though
02:33:00zachcarterbesides dynamic dispatch and single inheritance
02:33:17zachcarterbut - I think that's a good thing - if people want these things they can extend the language to implement them
02:33:28zachcarteras has been done for interfaces and other OOP constructs
02:33:54zachcarterLately at work - everyone thinks they're a functional programmer
02:33:56FromDiscord<awr> i think the OOP ditching stuff is reasonable for the most part. it's not that OOP is complete and utter sin but it's way too easy to get out of control
02:34:10FromGitter<gogolxdong> the only thing Nim need is more wathching, issues vanish and robustness boosts.
02:34:11zachcarteryet none of them have ever written a line of Scheme | Lisp | Haskell | Clojure
02:34:16FromDiscord<awr> languages with forced OOP constructs like java/C#
02:34:17FromDiscord<awr> ugh
02:34:27zachcarterI guess one guy has written some Haskell and Elm - but he is now trying to push functional typescript on everyone
02:35:13zachcartergogolxdong: yes - but I think that will come in time w/ more community members and development on the language (which the partnership w/ status.im hopefully benefits)
02:35:50zachcarterthe thing is - none of these peers understand why FP was the hotness for a while and why languages like Scheme / Lisp are barely used anymore
02:36:22zachcarterthey just think they're being cool by spending 2x as long writing their code to not have any side effects
02:36:35zachcarterand they probably still aren't doing FP right
02:36:48zachcarterhell - most of them don't even know what a REPL is I imagine
02:36:50FromGitter<gogolxdong> You know a company named HuaWei in China? Every project it joins would be promoted to V1.0 very fast.
02:36:51FromDiscord<awr> i like to use FP constructs where it's convinient
02:36:55zachcarterI often have to fully explain the acronym
02:37:22FromDiscord<awr> mapIt()/applyIt() for instance might be quicker than a for loop
02:37:41zachcarterawr: I don't disagree - but people think that things like that are the essence of FP
02:37:42FromDiscord<awr> (not in terms of execution time, more like code-writing time)
02:37:56zachcarterwhen in reality they don't know what tail recursion is
02:37:58zachcarteror a monad
02:38:00zachcarteretc
02:38:16zachcarterand then they try to tell you why FP is so great and why imperative programmming is shit
02:38:39zachcarteractually - they probably don't know what imperative programming means - they will just bash Nim and then say they want to check out Rust for whatever asanine reason
02:38:51FromDiscord<awr> a healthy dose of FP can help but yeah there's a reason almost no one is doing haskell or lisp or w/e outside of universities
02:39:23zachcarternaughtydog is the only place I can think of - but I don't even know if they're using racket anymore or not
02:39:32FromDiscord<awr> they aren't
02:39:35FromDiscord<awr> well
02:39:38FromDiscord<awr> they use it for data
02:39:53zachcartermeh - I mean - you can write a GD game engine in forth if you want to
02:39:55FromDiscord<awr> they used to use GOAL for their engine stuff
02:40:09FromDiscord<awr> (their own systems programming lisp variant)
02:40:15zachcarterI don't care so much that they like FP - it's that they act like it's the holy grail, and they've never really used a functional language before
02:40:26zachcarterinteresting
02:40:39FromDiscord<awr> i personally find programming in rust annoying but i really appreciate what people are doing in that sphere
02:41:01zachcarteralso - any functional language that comes out (which is almost every week) - it gets shared because it's functional
02:41:08FromDiscord<awr> rust community is very cool
02:41:11zachcarteryeah - rust is great - but it's too much like coding in C++ for me
02:41:29zachcartermmm I don't know - the whole riir thing go told quick - I think the community is a mixed bag
02:41:44FromDiscord<awr> RIIR?
02:41:46zachcarterbut I do know some very nice and talented rustaceans
02:41:49zachcarterrewrite it in rust
02:41:57FromDiscord<awr> oh
02:42:08zachcarterwhich people would just randomly post over and over again in github repos as issues
02:42:15zachcarterwhy don't you rewrite this in rust?
02:42:23zachcarterit was memelike for a while
02:42:31FromDiscord<awr> i think i know what you're talking about
02:43:15zachcarterI think it suffers the same problem that any large community does - you're going to attract kids and sycophants who will annoy the fuq out of everyone in order to get attention
02:43:53FromDiscord<awr> "RIIR" as an acronym sounds like some obscure C++ feature you've never heard of but is making the waves for C++21
02:43:56zachcarterit's like Godot - I don't like the engine to begin with and alot of the decisions the authors of the engine have made - but the community is intolerable
02:44:04zachcarterlol it might be
02:44:44zachcarterI love Nim's community - it's full of extremely intelligent talented people who love the language and want to see it and its contributors / users succeed
02:45:04FromDiscord<awr> godot is interesting i guess but i don't know too much about it except that it uses a python-not-python scripting language
02:45:33zachcarterand I love the language - it's the language I've learned the most from, as you can start from a very high level of understanding, but at the same time dive down into a very low level set of features that you wouldn't encounter / find useful in other higher level languages
02:46:06zachcarterand it's pluggable - you don't want the default GC? use boehm. you don't want a GC at all? don't use one!
02:46:36zachcarterand even if you want to deal with the default memory model and the thread-local heap - there is the shared heap to assuage that issue
02:47:21FromDiscord<awr> listennnnnn uh here microsoft your operating system i think you call it "windows" pretty cool stuff, but what if you rewrote it entirely in Nim
02:47:31zachcarter:P
02:47:44zachcarteractually - I was reading this earlier - it's extremely on point and interesting
02:48:00FromDiscord<awr> i wonder if Redox will go anywhere
02:48:04zachcarterhttps://cr.yp.to/bib/1995/wirth.pdf
02:49:36FromDiscord<awr> "What Andy giveth, Bill taketh away"
02:49:47zachcarterawr: regarding redox - I don't think so
02:50:16zachcarter:P
02:51:25zachcarteralso - Nim drew some (not sure how much) inspiration from Oberon - so that pdf is also highly relevant :)
02:56:27FromGitter<gogolxdong> Have you read a science fiction named Three Body which won the Hugo Award in 2014?
02:58:11FromGitter<timotheecour> @zachcarter thanks for the links regarding wasm! will take a look later
03:00:42FromGitter<gogolxdong> There is a concept named dimensionality reduction strike(not guaranteed translation, it has English version), it draws an analogy between Nim and many other languages.
03:01:35zachcartertimotheecour: np!
03:02:08zachcartergogolxdong: https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel) ?
03:02:39FromGitter<gogolxdong> yep.
03:03:24zachcarterI haven't - but I see there's an english translation - I will check it out :) thanks for the suggestion!
03:03:35zachcarterI love science-fiction
03:04:42FromGitter<gogolxdong> you're welcome.
03:04:56FromDiscord<awr> anyone who cares about {.reorder.} pragma - does this look like correct behavior: https://github.com/nim-lang/Nim/pull/8806#issuecomment-417139912
03:08:33FromGitter<Quelklef> @awr I'm not "in" on the {.reorder.} pragma but that seems iffy
03:09:10FromGitter<Quelklef> Depends on whether "declared" means "syntactically declared" or "accessible"/"referrable to"
03:10:15FromDiscord<awr> i haven't looked into the reorder impl but from what i understand it reorders code wholesale, not just generating hidden forward decls
03:11:01FromGitter<Quelklef> yeah
03:11:15FromGitter<Quelklef> I'm just pointing out that there's no correct answer, depending on what `declared` means conceptually
03:11:53FromDiscord<awr> does macro expansion influence `declared()`?
03:11:53FromGitter<Quelklef> looks like an interesting pragma tho
03:11:59FromGitter<Quelklef> this language continues to surprise me
03:12:24FromGitter<Quelklef> @awr Depends on what you mean by "influence"
03:12:38FromGitter<Quelklef> Example?
03:13:07zachcarterI think hyperHTML is a good library (in terms of feature accomplishment - not necessarily code quality) - but it infuriates me to no end when JS developers do shit like this -
03:13:19zachcarterhttps://github.com/WebReflection/hyperHTML/blob/master/index.js#L1416-L1418 - WHYYYYYY?
03:13:21FromDiscord<awr> say a new top-level symbol is generated from a macro, then we check that symbol against `declared()` - what does it return, true or false
03:13:51FromGitter<Quelklef> In the case of e.g. ⏎ ⏎ ```declaresX() ⏎ echo(declared(x))``` [https://gitter.im/nim-lang/Nim?at=5b8760efcff55e56177ded6c]
03:13:58FromGitter<Quelklef> Im 99% sure it'll be declared
03:14:01FromGitter<Quelklef> but we can find out!
03:14:26FromGitter<Quelklef> !eval (template declaresX() = var x: int); declaresX(); echo(declared(x))
03:14:27NimBotCompile failed: in.nim(1, 2) Error: expression expected, but found 'keyword template'
03:14:31FromGitter<Quelklef> sigh
03:15:03FromDiscord<awr> it may not work with a multi-liner, try inject pragma
03:15:46zachcarterit doesn't work
03:15:47FromGitter<Quelklef> I ended up with
03:15:49FromGitter<Quelklef> ``````
03:16:04FromGitter<Quelklef> And it outputs `true`
03:17:33FromDiscord<awr> yup hm
03:17:36FromGitter<Quelklef> IMO, having `declared(x)` be false in the github example would probably be much less useful than having it be true, so it should be considered a bug
03:17:46FromDiscord<awr> this may as well be a problem
03:17:47FromDiscord<awr> i agree
03:17:52FromGitter<rayman22201> @awr just to pipe in about obscure platforms, I hacked together Nim support for ppc32 AIX a while ago for work (old banking infrastructure), and it was super nice... I never got a chance to clean it up and push it though.... one of these days maybe....
03:18:07FromDiscord<awr> lol that's awesome
03:18:21FromDiscord<awr> part of me wishes that PPC was still relevant
03:18:56FromGitter<rayman22201> It was fine... I hate AIX though... it's mostly POSIX, until it's not, and then you want to kill yourself lol
03:19:18FromDiscord<awr> there's a fork of unreal engine 4 running on ppc64le
03:19:19FromDiscord<awr> https://www.youtube.com/watch?v=05NNFJj3Mrw
03:19:24FromGitter<rayman22201> PPC has some interesting features as an architecture though.
03:21:16FromGitter<rayman22201> lol, the unreal thing is awesome
03:36:28FromGitter<gogolxdong> hi
03:37:27FromGitter<gogolxdong> testing connection
03:37:28FromGitter<gogolxdong> familiar with nginx upload reverse proxy configuration?
03:38:22FromGitter<gogolxdong> seems unstable.
03:38:39FromGitter<gogolxdong> familiar with nginx upload reverse proxy configuration?
03:40:31*skrylar joined #nim
03:41:28*skrylar quit (Client Quit)
03:42:53*skrylar joined #nim
03:48:22*endragor joined #nim
03:55:08*nsf joined #nim
03:59:56*dddddd quit (Read error: Connection reset by peer)
04:10:42zachcarterlol for once - I'm thankful for babel
04:11:15zachcarterit turned that one liner into - https://gist.github.com/zacharycarter/69857eb7d647efbdfc635ce7100295c3
04:12:15zachcarterwhy the original authors decided it was a good idea to one-liner that expression is beyond me
04:15:37zachcartererr I guess it's a statement
04:15:55zachcarterI don't know - that entire line confuses me - I can't understand what it's doing until it's broken down into multiple lines - too many ternary operators
04:20:11FromGitter<dlutton> is there an easy way to parse form-data from a req-body?
04:25:20zachcarterdlutton: https://github.com/dom96/jester/blob/ecb12433e7fd4b7e3ad8a381925d4097ef0d40cb/jester/request.nim#L105
04:25:44zachcarterhttps://github.com/dom96/jester/blob/master/jester/request.nim#L105 - is probably a better link
04:25:57FromGitter<dlutton> great thank you!
04:26:52zachcartersure thing!
04:28:21FromGitter<dlutton> I take it I have to use the jester package
04:28:29zachcarterwell - you have a few options
04:29:08zachcarteryou can copy pasta that code into whatever you're working on - or you could potentially write a library for doing such - and then ask dom (the author of nimble) to incorporate it into nimble - so it could be reused
04:29:18zachcarterI don't know what you're working on / building
04:30:34zachcarterthere's also - https://github.com/tulayang/httpform - but that looks very old so I'm not sure it will compile with whatever version of Nim you're using - if you want to use that you may have to fix newly introduced errors
04:31:32zachcarteroften, I find doing things like this - https://github.com/search?l=&q=formdata+language%3ANim&type=Code - the easiest way to find what I'm looking to do when it comes to Nim code - generally someone's already done it or turned it into a library
04:32:03zachcarteryou may need to fork / pr the library to make it work w/ the latest Nim - but that's to be somewhat expected w/ a maturing language
04:32:24zachcarteror you can just copy the code from Jester and put it into your project :) I think it's just a few procedures
04:32:47FromGitter<dlutton> okay great. I'm just learning/messing around with nim by building a slack bot, so I need to parse form-data.
04:32:53FromGitter<dlutton> yea I noticed it's a couple of procs
04:33:12zachcartergotcha
04:34:17zachcarterbtw - cool idea for learning / experimenting with Nim :) As much as I don't like slack (forced to use it at work) - I think that kind of application is great onramp for learning a new language
04:34:36zachcarteryou can just play around with syntax / language features and build something very trivial yet potentially useful at the same time
04:35:18zachcarterand there's a ready to consume API at your fingertips
04:36:20FromGitter<dlutton> yep exactly. it's just going to be a simple bot for a espn fantasy football league I'm in to send scores based on the week # you give it. I always try to think of a useful small project to learn a new language.
04:39:31zachcarternice! sounds fun!
04:39:36zachcarterperfect timing too :D
04:39:53zachcarterseason starts in like 11 days or something?
04:40:58zachcarterif you have any other questions - please feel free to ping me / others - we love spreading Nim knowledge :)
04:42:26FromGitter<dlutton> I appreciate it
04:45:35*vivus quit (Remote host closed the connection)
05:10:21zachcarterdlutton: well - the reverse hope is that you enjoy using Nim, and continue to use it :)
05:13:06FromGitter<dlutton> @zacharycarter I plan on using it for a while and contributing once I gain more knowledge on the language. :)
05:30:10*darithorn quit (Quit: WeeChat 2.2)
05:52:53zachcarterawesome :D
05:56:47*gibril quit (Remote host closed the connection)
06:01:20*sz0 joined #nim
06:33:58*Lord_Nightmare quit (Ping timeout: 252 seconds)
06:37:51*skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
06:55:06*Lord_Nightmare joined #nim
07:21:52FromGitter<tim-st> how can I free a string that I dont use anymore, so it doesnt need to be gc'ed?
07:22:24FromGitter<gogolxdong> I am concerned too.
07:22:43FromGitter<gogolxdong> good catch.
07:25:34FromGitter<tim-st> @ephja yes, you're right, the `stream_buffer_bound` is the "worst encoded size", I will try if it works with setLen, though it's a bit problematic that so much memory is reserved
07:26:09leorizetim-st: you can't free a string
07:26:57FromGitter<ephja> you could optionally pre-allocate or use a smaller value and hope for the best
07:27:13FromGitter<tim-st> leorize: thanks
07:27:56FromGitter<tim-st> @ephja I will add two procs, one for `var string`, I then use as few memory as possible, create a new string that copies to the real size and hope that the old big memory is freed quickly
07:29:05FromGitter<tim-st> I think because of this they have the "stream compression" that uses likely much less memory
07:29:22FromGitter<tim-st> but I'm ok with string for now :)
07:34:30FromGitter<tim-st> I assume setLen doesnt touch the internally memory and just sets the int size?
07:34:49FromGitter<tim-st> (if setLen is smaller than before)
07:48:54FromGitter<Araq> true
07:55:41*Vladar joined #nim
08:01:15FromGitter<tim-st> ok, then my idea from above is good I think, for example if I create result = newStringOfCap(1000); result.setLen(1); the returned string will always have the huge memory as long it's alive, and using my way it will only have the small memory, but one extra copy
08:02:35FromGitter<tim-st> another question: does nim free gc'ed typed in a local scope without gc when it's clear that they dont leave the scope?
08:03:15FromGitter<tim-st> gc'ed memory types I meant
08:03:45*flyx|znc joined #nim
08:03:49*gmpreussner joined #nim
08:04:34*gmpreussner_ quit (Ping timeout: 250 seconds)
08:07:27FromGitter<tim-st> ok, now I read I can use `alloc` and `dealloc` I think this is what I need for the temp string
08:10:00FromGitter<gogolxdong> I don't think you can alloc and dealloc string.
08:10:29*flyx quit (Ping timeout: 264 seconds)
08:10:32FromGitter<tim-st> but I can alloc and dealloc `UncheckedArray[char]` or not?
08:10:33*nif quit (Ping timeout: 268 seconds)
08:11:33*PMunch joined #nim
08:12:19leorizetim-st: you can
08:12:29FromGitter<tim-st> https://forum.nim-lang.org/t/3158
08:12:35leorizebut why would you want to manually free string?
08:12:45FromGitter<gogolxdong> it's the underlying structure of string, I think you can do that.
08:13:20FromGitter<tim-st> leorize: because it's a temp where I only use like 10% of the size, but as long it's used all the 100% is in memory
08:13:45FromGitter<tim-st> instead I want to copy the used 10% to a real string and delete the temp after that
08:13:56*nif joined #nim
08:14:02leorizethen it should be collected when the temp gone out of scope
08:14:54FromGitter<tim-st> so the manual way wouldnt be faster?
08:15:08FromGitter<gogolxdong> what I need is avoiding string copy in stdlib, such as httpclient. since string is value type in Nim.
08:17:04FromGitter<tim-st> I tried zero copying with strings but the data was corrupted somehow...
08:17:25FromGitter<gogolxdong> response from cloud provider is large enough , it doubles or triples in memory at assignment.
08:17:28leorizefor aliasing strings, use `ref string`
08:18:17leorizetim-st: no, but only benchmarks can prove it
08:18:39FromGitter<tim-st> leorize: ok, sounds good, then I leave it^^
08:21:28FromGitter<gogolxdong> proivders like Azure and AWS, the response is insanely large, and we have to handle them concurrently to reduce processing time from 4 hours down to 4 mins.
08:21:34FromGitter<timotheecour> hi @Araq is https://github.com/nim-lang/Nim/pull/8682 ok now?
08:22:19leorizetimotheecour: you don't have to ping Araq every now and then
08:22:45leorizeit will appears on his github notification and mail, and he will review it when he have time
08:24:01*abm joined #nim
08:24:46FromGitter<gogolxdong> it runs out of 8GB memory for now in 2 mins.
08:26:39FromGitter<gogolxdong> take care of value type when you are working with high workload.
08:28:13leorizenew runtime will introduce proper move schematic for seqs and strings :)
08:30:00FromGitter<gogolxdong> yes, he said Nim will move most strings though soon, though don't know how to use it now.\\
08:30:57leorizehttps://github.com/nim-lang/Nim/issues/7041
08:31:01leorizeshould be there by v1 :P
08:33:22FromGitter<gogolxdong> then the problem gone without having to anything. :)
08:41:45*cspar joined #nim
08:56:24*vqrs quit (Ping timeout: 252 seconds)
08:58:42*vqrs joined #nim
09:11:33*Vladar quit (Remote host closed the connection)
09:12:09*Vladar joined #nim
09:27:00FromGitter<tim-st> @ephja I got a high level wrapper for compression and decompression working for the types `seq[uint8]`, `seq[char]`, `string`, just one problem: while I get the worst length for the compression proc, I dont get the worst length for the decompression proc, currently I use uncompressed*1000 :\
09:27:33FromGitter<tim-st> (worst theoretically length)
09:34:01FromGitter<tim-st> ok, the decompression proc requires a ptr to "allocator" to get this working, dont know how this works
09:44:31FromGitter<ephja> then that must mean that the default allocator allocates too much
09:45:40FromGitter<ephja> or are you using anything other than lzma_stream_buffer_decode?
10:05:25FromGitter<tim-st> no, but it's obvious that this doesnt work without an allocator, since the compressed length is in no relation to the uncompressed length. the allocator object type is defined in `lzma\private\base` as `allocator` and expects two procs
10:06:36*seni joined #nim
10:06:37FromGitter<tim-st> the `compress` does work without an allocator, but also here in allocator would be better to save memory
10:16:56*kapil___ joined #nim
10:20:17*endragor quit (Remote host closed the connection)
10:35:50FromGitter<timotheecour> How do I find a needle in a haystack (ie strstr) with UF8/unicode ?
10:52:29*nsf quit (Quit: WeeChat 2.2)
10:54:09*xet7 joined #nim
10:55:04PMunchtimotheecour, find?
10:56:51FromGitter<timotheecour> Oh, right, i suppose no UTF8 decoding is needed for that, ok I’ll try that, thx!
11:15:28*cspar quit (Ping timeout: 245 seconds)
11:21:59*noonien joined #nim
11:23:10*krux02 joined #nim
11:24:46*SenasOzys quit (Ping timeout: 250 seconds)
11:24:49*cspar joined #nim
11:29:19*SenasOzys joined #nim
11:35:21*zachcarter quit (Ping timeout: 252 seconds)
11:47:38*endragor joined #nim
11:52:14FromGitter<xmonader> is there a public proc for `sendCommand` in redis package?
11:52:19*endragor quit (Ping timeout: 252 seconds)
11:55:43*PMunch quit (Quit: Leaving)
11:57:49*PMunch joined #nim
12:04:13*dddddd joined #nim
12:08:33*opi_ quit (Quit: ZNC - http://znc.in)
12:09:17*opi_ joined #nim
12:30:51*PMunch quit (Quit: Leaving)
12:31:00*PMunch joined #nim
13:02:14PMunchI asked about this yesterday but I don't think anyone answered. Should we try to get a Nim talk in at FOSDEM this year?
13:02:19PMunchEven just a lightning talk
13:02:39PMunchI remember we talked about doing it last year
13:02:50FromGitter<tim-st> can I add a number to a `addr` to get a new `addr`? I'm porting a c++ code it's done there
13:06:02FromGitter<tim-st> ok, solved this, just indexed the char at the incremented position and used this addr
13:10:03FromGitter<ephja> cast to an array ptr type or cast to int, increment and cast back
13:11:37FromGitter<mratsim> just use ptr UncheckedArray type
13:18:30FromGitter<Varriount> PMunch: Depends, does anyone have a talk prepared?
13:22:43*abm quit (Read error: Connection reset by peer)
13:27:15FromGitter<tim-st> @ephja I have it working, I ported this c++ code line by line: https://ptspts.blogspot.com/2011/11/how-to-simply-compress-c-string-with.html
13:27:38FromGitter<tim-st> will make some tests to see if all work, and then make a PR
13:29:46*Vladar quit (Remote host closed the connection)
13:31:03FromGitter<tim-st> I think `strutils` should support `"abc" * 1000` like python as a short form of repeat
13:32:11PMunchVarriount, well I could probably whip up a lightning talk by February :P
13:32:40PMunchFor such a short talk though you really need to narrow down what you want to talk about though
13:32:54PMunchs/though$//
13:32:57*ftsf quit (Quit: Leaving)
13:34:32PMunchFor anything longer I think they require us to create a full developer room
13:34:42PMunchWhich probably isn't easy
13:34:51PMunchAnd requires a lot more content
13:35:05FromGitter<narimiran> @PMunch: yes, we should get nim talk at fosdem
13:35:52FromGitter<mratsim> Nim for scientific computing :P
13:38:17PMunchTry to get 5 back to back lighting talks about Nim for different things :P
13:38:42FromGitter<ephja> lol
13:41:17FromGitter<kaushalmodi> "Nim for CLI apps"
13:47:58*nsf joined #nim
13:48:44federico3PMunch: you probably need a large enough crowd to get a devroom at FOSDEM
13:49:26PMunchYeah, I don't think that's feasible for us
13:49:32PMunchPlus it would mean a lot of work
13:49:42PMunchBut I definitely think we should try and get a lighting talk
13:51:36*Vladar joined #nim
14:03:27FromGitter<narimiran> @mratsim are we scientists yet? :)
14:04:30FromGitter<xmonader> @PMunch totally should do that!
14:12:41FromGitter<xmonader> Current problem ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b87fb594be56c5918b94ac2]
14:13:43FromGitter<xmonader> this endpoint playground.hub.grid.tf 9910 is publicly available if anyone wants to try
14:16:07FromGitter<mratsim> @miran check out nimtorch btw
14:16:22FromGitter<ephja> @tim-st great
14:16:40FromGitter<ephja> 1) is only used for addition, so maybe * should only be used for multiplication
14:25:28FromGitter<ephja> for those who aren't on gitter: 1) should be +
14:25:58*coft joined #nim
14:26:29FromGitter<narimiran> i haven't used torch, but that looks quite promising from what i can tell
14:40:44*norok2 quit (Remote host closed the connection)
14:48:14*norok2 joined #nim
14:48:21*norok2 quit (Client Quit)
15:10:11*Perkol joined #nim
15:15:22*tripleslash23 joined #nim
15:16:12*tripleslash23 quit (Killed (Sigyn (Spam is off topic on freenode.)))
15:23:20*miran joined #nim
15:24:18*biberao14 joined #nim
15:28:56*nsf quit (Quit: WeeChat 2.2)
15:30:16*biberao14 quit (Ping timeout: 246 seconds)
15:36:32*coft quit (Quit: Page closed)
15:39:45FromGitter<kaushalmodi> Trying to understand why pairs iter doesn't work in json for me
15:39:56FromGitter<kaushalmodi> from the code in json.nim: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b880fccc2bd5d117af52f6c]
15:40:19FromGitter<kaushalmodi> the node type is `JsonNode` but the assertion is `node.kind == JObject`
15:41:16FromGitter<kaushalmodi> Here ( https://github.com/kaushalmodi/ntodo/blob/298530659596ed77e3f56fe40a67f70d82099a20/src/ntodopkg/projects.nim#L4-L27 ), jsonObj is a value returned by `parseJson` internally
15:41:28FromGitter<kaushalmodi> so it is of type `JsonNode`.
15:41:39FromGitter<kaushalmodi> So I am unable to use the `pairs` iter in that snippet
15:48:57FromGitter<kaushalmodi> Looks like we can add this to json.nim? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8811e8f5402f32aab31d29]
15:49:30FromGitter<kaushalmodi> It works.. though I cannot understand how both that and the original: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ co-exist [https://gitter.im/nim-lang/Nim?at=5b88120acff55e5617820c60]
15:49:43*Trustable joined #nim
15:50:02FromGitter<kaushalmodi> both have the same parameter type JsonNode.. what prevents the assertion failure in the JObject version?
15:52:27*Guest42469 joined #nim
15:54:55FromGitter<kaushalmodi> I have open https://github.com/nim-lang/Nim/issues/8818 regarding pairs iter for JArray if anyone is interested in commenting on that.
15:54:58FromGitter<mratsim> the kind can be a Jstring or a Jint
15:55:01FromGitter<kaushalmodi> s/open/opened
15:56:10FromGitter<mratsim> can you add `assert node.kind == JObject, &“Error kind was {node.kind}, expected a Object}”`?
15:56:23FromGitter<mratsim> Object*
15:56:29FromGitter<mratsim> JObject
15:57:12*Guest42469 quit (Remote host closed the connection)
16:02:02FromGitter<Vindaar> Isn't that `pairs` iterator going to be ambiguous with the current `pairs` iterator? They both accept `JsonNode` and the kind is only known at run time. I guess that's why there's only the `JObject` one
16:02:45FromGitter<kaushalmodi> @Vindaar exactly.. that's my confusion too: "both have the same parameter type JsonNode.. what prevents the assertion failure in the JObject version?"
16:03:37FromGitter<kaushalmodi> Shouldn't there be just one `pairs` for `JsonNode` and then have a case statement for JObject, JArray, etc in there?
16:03:57FromGitter<Vindaar> If I include your `pairs` and run it, for me it always uses the `JArray` one, which then does fail for `JObject`
16:04:30FromGitter<Vindaar> One could case on `JsonNode.kind`, but the issue is that you'd want a `tuple[string, JsonNode]` as return value in one case and `tuple[int, JsonNode]` in the other. But there's no return type overloading in Nim
16:05:23FromGitter<Vindaar> `int`s can be returned as `string` of course, but that's kinda hacky
16:05:35FromGitter<kaushalmodi> hmm
16:06:03FromGitter<kaushalmodi> May be JObject etc should have been types and not kinds
16:06:28FromGitter<kaushalmodi> So.. what's a good fix?
16:06:29FromGitter<mratsim> but those are known only at run time
16:06:40FromGitter<kaushalmodi> *nods head*
16:07:21FromGitter<mratsim> runtime types = variants/kinds or ref inherited objects
16:10:24FromGitter<Vindaar> Personally I'd probably just define my own iterator with a different name for this case. But one could also make use of that `enumerate` macro, no?
16:10:40FromGitter<kaushalmodi> @mratsim ⏎ ⏎ > but those are known only at run time ⏎ ⏎ But have a case statement in the pairs should still work right? [https://gitter.im/nim-lang/Nim?at=5b881700c2bd5d117af55f7a]
16:11:29FromGitter<kaushalmodi> no wait, sorry, because as @Vindaar pointed out, the return types would be different
16:11:55FromGitter<kaushalmodi> I haven't use enumerate macro.. how would I use it with a JArray case?
16:13:28FromGitter<Vindaar> I think Araq just posted it as a snippet somewhere once, using the experimental `forLoopStmt`
16:15:10FromGitter<Vindaar> Ah, it's in the manual nowadays (though not in v0.18.0 yet)
16:15:47FromGitter<Vindaar> from the manual: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b88183311227d711def576b]
16:17:21FromGitter<kaushalmodi> I get: "Error: attempting to call undeclared routine: 'items'"
16:17:30*cspar quit (Ping timeout: 252 seconds)
16:17:31FromGitter<Vindaar> yeah, me too :S
16:18:13FromGitter<kaushalmodi> and if I comment out that first loop: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8818c4d457a1406c84eb93]
16:18:24FromGitter<Vindaar> oh
16:18:50FromGitter<kaushalmodi> Araq: Any help with the above ^ ?
16:22:11FromGitter<mratsim> don’t forget to add {.experimental:”ForLoopMacros”.}
16:22:25FromGitter<Vindaar> ahh, that's the syntax!
16:22:55FromGitter<Vindaar> or not?
16:22:58FromGitter<mratsim> forLoopStmt is the syntax, but the pragma is ForLoopMacros
16:23:06FromGitter<kaushalmodi> @mratsim Where do I put that pragma?
16:23:12FromGitter<mratsim> anywhere in the file
16:23:29FromGitter<mratsim> or pass —experimental:ForLoopMacros in the compilation command line
16:23:40FromGitter<kaushalmodi> got it
16:23:52FromGitter<Vindaar> I remembered something like this (hence my "oh" above), but thought it was either just `{.experimental.}` or `{.forLoopMacros.}` :D
16:23:53FromGitter<kaushalmodi> copy/pasting doesn't help @Vindaar if you too did that :P
16:24:03FromGitter<Vindaar> yeah, I saw those nasty wrong "
16:24:04FromGitter<Vindaar> :D
16:24:40*savoir-faire14 joined #nim
16:25:02FromGitter<kaushalmodi> ok, so I just added `{.experimental:"ForLoopMacros".}` below `import macros` in @Vindaar 's original snippet.. and it works!
16:25:06FromGitter<kaushalmodi> now what :)
16:25:31FromGitter<kaushalmodi> I guess I can put in a JArray instead of that int array.. trying out ..
16:27:33FromGitter<kaushalmodi> interesting.. this gives "redefinition error"
16:27:40FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b881afc60f9ee7aa4b3298a]
16:27:44*savoir-faire14 quit (Remote host closed the connection)
16:27:48FromGitter<Vindaar> ah, that's because of how the macro works
16:27:54FromGitter<kaushalmodi> wouldn't a2, b2 be locals?
16:27:59FromGitter<Vindaar> the `a2` and `b2` are actually defined variables
16:28:21FromGitter<mratsim> the enumerate macro doesn’t open a new scope
16:28:22FromGitter<Vindaar> the macro just rewrites the for loop by first declaring these vars and then incrementing the counter
16:28:38FromGitter<mratsim> it should create a block
16:29:06FromGitter<mratsim> tbh it’s just a copy-paste from the test suite ;)
16:29:11FromGitter<kaushalmodi> yes, it would be common to reused var names like `idx`, `val` etc in pairs
16:29:34FromGitter<kaushalmodi> we cannot keep on appending numbers to these to uniquify them
16:30:35FromGitter<mratsim> add the end just add ⏎ ⏎ ```result = quote do: block `result```` [https://gitter.im/nim-lang/Nim?at=5b881babe5b40332ab1e38b1]
16:30:41FromGitter<mratsim> at*
16:31:58FromGitter<Vindaar> need to write it like so ⏎ ⏎ ``` result = quote do: ⏎ block: `result```` [https://gitter.im/nim-lang/Nim?at=5b881bfee5b40332ab1e3afc]
16:32:11FromGitter<Vindaar> otherwise complains about indentation
16:32:35Demos[m]Are there any useres of —genDeps
16:32:54Demos[m]Is there any way to use genDeps and also actually compile the program
16:33:36FromGitter<kaushalmodi> Thanks @mratsim @Vindaar so this finally works!
16:33:40FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b881c64e5b40332ab1e3d6e]
16:34:12FromGitter<kaushalmodi> @Vindaar @mratsim Do you want to send a PR to fix this?
16:34:39FromGitter<mratsim> feel free, I dealt too much with forloopMacros issues last week
16:35:15FromGitter<mratsim> well, more like “experimental” issues, because the forLoopMacros were working perfectly
16:37:33FromGitter<Vindaar> You can create the PR if you wish
16:38:21FromGitter<kaushalmodi> It won't be write morally.. I just copy/pasted what you guys suggested.. I don't understand that code
16:40:26FromGitter<Vindaar> I really don't mind (not like I did a whole lot more than copy pasting from the manual ;) ), but I can do it if it makes you feel better :)
16:44:28*cottongin18 joined #nim
16:44:38FromGitter<kaushalmodi> Yes please (because I still haven't got to learning macros)
16:46:00*Guest26133 joined #nim
16:46:43*cottongin18 quit (Remote host closed the connection)
16:48:20*Guest26133 quit (Remote host closed the connection)
16:48:21*sielicki joined #nim
16:49:04*sielicki quit (Remote host closed the connection)
16:49:48*cspar joined #nim
16:51:34*jjido joined #nim
16:53:17*Fridtjof16 joined #nim
16:54:07*Fridtjof16 quit (Remote host closed the connection)
16:57:48*Guest32616 joined #nim
16:59:20*raynold joined #nim
16:59:48*Guest32616 quit (Remote host closed the connection)
17:03:18FromGitter<Vindaar> all done: https://github.com/nim-lang/Nim/pull/8819/files
17:07:34*raynold quit (Ping timeout: 246 seconds)
17:09:42*Vladar quit (Remote host closed the connection)
17:13:01FromGitter<Araq> ah good catch, hmm
17:18:00*SenasOzys quit (Ping timeout: 252 seconds)
17:22:45*nuxdie_ quit (Quit: WeeChat 2.1)
17:22:59*nuxdie joined #nim
17:24:45*PMunch quit (Quit: Leaving)
17:29:16*SenasOzys joined #nim
17:35:33*Vladar joined #nim
17:41:43*jjido quit (Ping timeout: 245 seconds)
17:50:34*Trustable quit (Remote host closed the connection)
17:59:59*floppydh quit (Quit: WeeChat 2.2)
18:07:51*rockcavera quit (Remote host closed the connection)
18:11:59*seym0ur joined #nim
18:12:33*seym0ur left #nim ("+++++++++++++++++++++++++++++++++")
18:16:06*thomasross quit (Remote host closed the connection)
18:16:32*thomasross joined #nim
18:17:21*vegax87 quit (Changing host)
18:17:21*vegax87 joined #nim
18:17:21*vegax87 quit (Changing host)
18:17:21*vegax87 joined #nim
18:34:01*cspar quit (Ping timeout: 246 seconds)
18:39:02*rockcavera joined #nim
18:41:38*Vladar quit (Remote host closed the connection)
18:42:07*Vladar joined #nim
18:46:00*kapil___ quit (Quit: Connection closed for inactivity)
18:51:49FromGitter<kaushalmodi> Given few handful str vars, how would you make sure that only one of them in non-empty (not "")
18:51:50FromGitter<kaushalmodi> ?
19:07:48FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b884084f86b741b05e6c500]
19:07:51FromGitter<kayabaNerve> @kaushalmodi
19:13:37FromGitter<Quelklef> `@[s1, s2, s3, s4].filter(s => s != "").len == 1`
19:13:57FromGitter<kayabaNerve> You could also verify the string is in the seq, yet the lengths are the same when you deduplicate
19:22:50FromGitter<mratsim> wow the manual takes so long to load on github
19:23:52FromGitter<timotheecour> what was this line supposed to do in older .travis.yml? ⏎ `- ( ! grep -F '..code-block' -l -r --include '*.html' --exclude contributing.html --exclude docgen.html --exclude tut2.html )`
19:24:18FromGitter<kaushalmodi> Awesome! Thank you @kayabaNerve and @Quelklef !
19:24:49FromGitter<Quelklef> @kaushalmodi go for kayba's solution for speed and mine for terseness
19:25:44*nsf joined #nim
19:25:53FromGitter<mratsim> @Quelklef ig you use filterIt it should be as fast as Kayaba's
19:25:58FromGitter<mratsim> if*
19:26:13FromGitter<mratsim> ah no, you still need to allcoate the result seq
19:27:14FromGitter<Quelklef> and then do an attribute lookup
19:27:22FromGitter<Quelklef> and allocate the literal seq
19:27:28FromGitter<kayabaNerve> Deduplicate would be worse than Quelklefs. The for loop would be faster. Quelklef's looks the best/shows the most 'mastery'.
19:27:58FromGitter<kayabaNerve> I think deduplicate would be the same/slightly better actually. Anyways. Use the for loop or Quellie's
19:35:18FromGitter<Araq> @timotheecour detect illformed code-blocks that RST stupidly parses as commented out sections
19:36:08FromGitter<timotheecour> o i see, and then you’d use the return code of grep to error in case smthg found, ok
19:38:41*Perkol quit (Quit: Leaving)
19:43:19*Some_Person11 joined #nim
19:43:48*threeFifths joined #nim
19:44:18FromGitter<kaushalmodi> @Quelklef I just went for succintness for now https://github.com/kaushalmodi/ntodo/commit/461a92cc568d4960c5a68b60de674c993b7e67c3 Thanks! :)
19:45:09*Some_Person11 quit (Remote host closed the connection)
19:45:36*threeFifths quit (Remote host closed the connection)
19:47:56*rockcavera quit (Remote host closed the connection)
19:48:14FromGitter<Quelklef> yup!
19:49:40FromGitter<Araq> just as I feared
19:49:56FromGitter<Araq> with the nimsuggest tests travis is now timing out way more often :-/
19:59:15*masterdonx joined #nim
20:03:31FromGitter<arnetheduck> `ccache`?
20:12:50FromGitter<mratsim> but you can only ccache the csources basically
20:13:07FromGitter<arnetheduck> no, all the generated c code as well
20:13:45FromGitter<arnetheduck> well, not all the generated c code, but lots
20:21:57*Trustable joined #nim
20:23:41*rockcavera joined #nim
20:35:13*Vladar quit (Remote host closed the connection)
20:39:26*smt joined #nim
20:41:31*jxy joined #nim
20:42:22*jxy quit (Client Quit)
20:43:51*seni quit (Quit: Leaving)
20:50:27*jxy joined #nim
20:53:08*jxy quit (Client Quit)
20:53:42*soahccc joined #nim
20:54:39*soahccc quit (Remote host closed the connection)
20:55:34*miran quit (Ping timeout: 240 seconds)
20:55:48*nsf quit (Quit: WeeChat 2.2)
20:56:03*jxy joined #nim
20:58:53*Trustable quit (Remote host closed the connection)
21:06:04*stoner1910 joined #nim
21:08:39*stoner1910 quit (Remote host closed the connection)
21:10:17FromGitter<bung87> does the nimsuggest just response and quite?or as a long running process?
21:10:52FromGitter<timotheecour> it can be used as a server
21:12:59FromGitter<bung87> I'm trying to add some patch support more feature https://github.com/bung87/vscode-nim but it always response and quite, runs on emacs epc mode
21:14:43FromGitter<bung87> add a nim version switch at status bar, works but may needs a long running process for ensure always can send query
21:15:34*Guest43987 joined #nim
21:15:39FromGitter<mratsim> the vscode-nim plugin from pragmagic is not using nimsuggest properly, it spawns a process for each nim file instead of reusing the same
21:17:05FromGitter<bung87> yeah I see that and ```Usage: ⏎ nimsuggest [options] projectfile.nim``` this makes me confusing .. if it as a server why need specify a nim file
21:18:47FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/s695/Screen-Shot-2018-08-31-at-5.18.02-AM.png)
21:20:11FromGitter<bung87> but better than before now,I can easily switch nim version now as vscode-python does
21:23:04*Guest43987 quit (Ping timeout: 246 seconds)
21:23:27FromGitter<imdaveho> @shashlick your lib for snip, what's the reason you had to rewrite getch and why did you implement it that way? is that the official C implementation from conio?
21:24:02FromGitter<Araq> there is no `conio` in C's standard the last time I checked.
21:24:33FromGitter<imdaveho> right but looking around the internet, the implementations for getch differs from the way that shashlick implemented it in his library...
21:24:44FromGitter<Araq> @bung87 because nimsuggest needs to know the entry point.
21:25:25FromGitter<imdaveho> I might just try to make a similar implmentation that termbox-go does with nim natively and read from stdout
21:26:01FromGitter<imdaveho> but I want to know if there is some what to leverage existing work instead of going the route of doing something from scratch
21:28:58FromGitter<imdaveho> @araq is it on the roadmap to implement mouse detection using this method? https://stackoverflow.com/questions/51909557/mouse-events-in-terminal-emulator ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8861994be56c5918bbd3da]
21:29:00FromGitter<bung87> @Araq thanks! I checked on command line ,it is long running process.
21:35:48*submain joined #nim
21:38:18*submain quit (Remote host closed the connection)
21:49:42*vivus joined #nim
21:50:22vivusdoes anybody use autocomplete with your editor for nim? which editor?
21:50:53*Maven_ joined #nim
21:51:50FromGitter<Araq> VSCode
21:52:02*Maven_ quit (Remote host closed the connection)
21:52:28FromGitter<Araq> though I generally consider navigation ("goto definition") more useful than completions
21:52:46FromGitter<Araq> completions always race with my fast typing skills :-)
22:00:35AlexMaxHrm, is there nice way to take a ptr/len buffer from a wrapped C library and just stuff it into a seq or something?
22:02:06AlexMaxI was hoping that maybe I could copymem it straight into addr myseq[0] or something
22:02:27AlexMaxafter ensuring the seq is the correct size, of course
22:05:42*avelardi22 joined #nim
22:08:10*avelardi22 quit (Remote host closed the connection)
22:09:06FromGitter<Araq> the seq owns its data, so not possible
22:09:27FromGitter<Araq> you can map it to an openArray though via `toOpenArray` (new in devel)
22:09:45AlexMaxYeah I saw that, but I'm on 0.18
22:10:24AlexMaxThe seq would be of primitive type - floating point numbers.
22:10:45AlexMaxand I would destroy the original buffer once copied.
22:18:20FromGitter<Araq> none of these things matter, a seq has its own idea of where to get memory
22:21:35*endragor joined #nim
22:25:38shashlick@imdaveho: it was a royal pain to get the actual key typed in a cross platform way
22:25:47*endragor quit (Ping timeout: 240 seconds)
22:25:57krux02there is nothing wrong with a seq that is isitialized with a ptr length pair. Actually std::vector in c++ has a constructor for that
22:26:05shashlickI looked at all implementations and it's all a mess
22:26:38shashlickI wanted to avoid ncurses but I was still cursing
22:27:22shashlickSince I was working on a console editor, I needed actual key combo typed
22:28:32krux02shashlick what kind of editor?
22:28:35krux02text editor
22:28:46krux02?
22:29:55FromGitter<Araq> krux02: the std::vector copies the ptr's contents, iirc
22:30:59krux02Araq: yes
22:31:06krux02but that was what was asked for
22:32:22FromGitter<imdaveho> @shashlick yeah I see that, I also need the key combo, but also wanted mouse support... so the implementation of getch you made is not the same as the implementation in conio, rather written that way so it could get the key in an cross plat way? well for the time being, ill use your implementation...
22:32:54vivus@Araq ty
22:37:46*steven9 joined #nim
22:40:17*steven9 quit (Remote host closed the connection)
22:48:10*SenasOzys quit (Remote host closed the connection)
22:48:41*SenasOzys joined #nim
23:05:51*SenasOzys quit (Remote host closed the connection)
23:07:43*gangstacat quit (Quit: Ĝis!)
23:09:29*SenasOzys joined #nim
23:11:50*gangstacat joined #nim
23:12:27*gangstacat quit (Client Quit)
23:12:41*xet7 quit (Quit: Leaving)
23:13:51*gangstacat joined #nim
23:17:08*Jesin quit (Quit: Leaving)
23:17:58shashlickkrux02: yep nim snippet editor https://github.com/genotrance/snip
23:18:48shashlick@imdaveho : it's not cross platform, conio on windows, custom C code in Linux
23:19:22*zachcarter joined #nim
23:34:15krux02shashlick, are you writing snippet as a learning project?
23:34:38krux02Because I don't think it is very useful for anyone. Not even for you.
23:34:52krux02There are enough text editors out there, ever light weight text editors
23:35:06krux02there is no need to write a custom text editor just for "snippets" whatever that is.
23:35:14AlexMaxman, mutually recursive data structures are horrible
23:36:20krux02AlexMax, you mean graphs?
23:36:22vivusis anybody using nim.vim ?
23:36:53krux02sorry I am an emacs guy
23:37:38krux02but don't assume the grass is green over here.
23:37:49krux02nim-mode in emacs is poor quality
23:38:04krux02I just don't have the competence in emacs yet to replace it.
23:41:27AlexMaxkrux02: I've got four types of objects
23:41:42AlexMaxand the objects need to be accessible top down _and_ bottom up
23:42:47AlexMaxhttps://paste.ee/p/us2ed
23:43:13AlexMaxRight now I have pointers going one way, but I think I need pointers going both ways
23:43:58AlexMaxAnd many of these relationships are one-to-many
23:44:11*rdococ18 joined #nim
23:45:56*rdococ18 quit (Remote host closed the connection)
23:51:39*Jesin joined #nim
23:55:00shashlickkrux02: I'll encourage you to try it out, it's good for simple tests, works for me
23:55:17shashlickNo reason to compete with established editors