<< 08-09-2018 >>

00:03:14*SenasOzys quit (Remote host closed the connection)
00:07:22*SenasOzys joined #nim
00:12:28*SenasOzys quit (Remote host closed the connection)
00:28:20*SenasOzys joined #nim
00:30:39*SenasOzys quit (Remote host closed the connection)
00:35:10FromGitter<bung87> anyone tried `options ` module? when I call `result.get` I get `attempting to call undeclared routine: 'get'`
00:36:37leorizecan you give us a snippet?
00:36:42leorizelast time I tried it worked fine
00:37:49FromGitter<bung87> oh sorry , forget import options in test file
00:42:16*martinium joined #nim
00:46:27*leorize quit (Quit: WeeChat 2.2)
00:55:15FromGitter<bung87> https://github.com/python/cpython/blob/9835696ec4c57a9a30f1c11cfb4c5d3e121bf97c/Lib/sched.py#L148 the non-blocking is designed for future usage with multi-thread ?
02:21:50*leorize joined #nim
02:52:48*leorize quit (Quit: WeeChat 2.2)
02:56:07*leorize joined #nim
02:57:46*leorize quit (Client Quit)
02:57:56*leorize joined #nim
03:04:10*tefter joined #nim
03:17:43*endragor joined #nim
03:33:44*kapil___ joined #nim
03:51:00*endragor quit (Ping timeout: 252 seconds)
03:57:49*leorize quit (Quit: WeeChat 2.2)
04:07:39FromGitter<codenoid> hi @Araq
04:12:09*shashlick quit (Remote host closed the connection)
04:12:26*shashlick joined #nim
04:24:18*dddddd quit (Remote host closed the connection)
04:44:52*endragor joined #nim
05:14:27*miran joined #nim
05:39:09*endragor quit (Ping timeout: 272 seconds)
06:12:33*martinium quit (Ping timeout: 245 seconds)
06:29:59*leorize joined #nim
06:41:29*RushPL quit (Ping timeout: 252 seconds)
06:41:30*RushPL joined #nim
06:53:30*leorize quit (Quit: WeeChat 2.2)
07:06:36*endragor joined #nim
07:07:48*nsf joined #nim
07:14:18*zachcarter quit (Ping timeout: 252 seconds)
07:22:49FromDiscord<2vg> non-blocking socket ?
07:23:04*endragor quit (Quit: Leaving)
07:24:33FromGitter<bung87> not as I known, seems the sched like some queued task lib in other language.
07:26:34FromGitter<bung87> no idea about why he just return a delay time that break the loop.
07:29:39*TheLemonMan joined #nim
07:40:42*nsf quit (Ping timeout: 252 seconds)
07:43:29*cspar joined #nim
07:52:28*stefanos82 joined #nim
07:58:15TheLemonManAraq, why JS strings had a terminating nul?
08:03:15*gmpreussner quit (Ping timeout: 252 seconds)
08:03:44*gmpreussner joined #nim
08:07:52*nsf joined #nim
08:15:16*gangstacat quit (Ping timeout: 252 seconds)
08:22:01*tefter quit (Remote host closed the connection)
08:22:58*cspar quit (Ping timeout: 245 seconds)
08:36:49*cspar joined #nim
08:38:38*stefanos82 quit (Quit: Quitting for now...)
08:53:29*leorize joined #nim
08:58:20*cspar quit (Ping timeout: 244 seconds)
09:00:10*ftsf joined #nim
09:00:54*ftsf quit (Client Quit)
09:01:20*ftsf joined #nim
09:01:29*cspar joined #nim
09:04:47*nsf quit (Quit: WeeChat 2.2)
09:07:02*Vladar joined #nim
09:07:15*gb00s quit (Remote host closed the connection)
09:09:46*gangstacat joined #nim
09:32:57*echotangoecho joined #nim
09:44:54*gb00s joined #nim
10:02:11FromGitter<Clyybber> TheLemonMan Why did you close https://github.com/nim-lang/Nim/pull/8864?
10:02:14FromGitter<Clyybber> ?
10:02:48TheLemonManfound a couple of edge cases
10:03:13FromGitter<Clyybber> Ah ok
10:28:06*SenasOzys joined #nim
10:37:19FromGitter<tim-st> is there a reason why a var is not transfered by default to a `threadvar` when it's needed?
10:40:17FromGitter<alehander42> why can't i add a custom pragma to my top level as ⏎ ⏎ `{.example.}`
10:40:29FromGitter<alehander42> get 'cant attach custom pragma to module'
10:48:21TheLemonManalehander42, what kind of custom pragma are we talking about?
11:11:35FromGitter<alehander42> A pragma defined by me
11:12:24TheLemonMansnippet please
11:18:21FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b93affdf59e0c1555c97139]
11:18:38FromGitter<alehander42> at least that's similar to how i define a proc pragma
11:20:55TheLemonManoh, macro pragmas are reserved for procs only
11:21:24*kapil___ quit (Quit: Connection closed for inactivity)
11:24:40FromGitter<alehander42> i just wanted to see how can i do https://github.com/alehander42/new-order
11:24:44FromGitter<alehander42> but proc is fine
11:24:48FromGitter<alehander42> is there a reason tho
11:24:57FromGitter<alehander42> hm makes sense
11:27:33TheLemonManoh, I love New Order heh
11:27:54*stefanos82 joined #nim
11:46:18*SenasOzys quit (Ping timeout: 245 seconds)
11:47:36FromGitter<alehander42> yeah actually joy div are my fav band but it surprised me I still like new order too
11:47:44*ftsf quit (Ping timeout: 272 seconds)
11:56:50*ftsf joined #nim
12:03:56*SenasOzys joined #nim
12:27:41*abm joined #nim
12:28:14FromGitter<tim-st> what's the best way to cast array[size, char] to cstring?
12:28:24FromGitter<tim-st> or how does it work
12:29:01FromGitter<tim-st> https://github.com/nim-lang/Nim/issues/6350#issuecomment-335442216
12:39:57FromGitter<tim-st> ended up using just string...
12:43:18*kapil___ joined #nim
12:48:10*xet7 joined #nim
12:48:17FromGitter<Bennyelg> https://github.com/Bennyelg/csvql - now it looks good.
12:52:46*miran quit (Quit: Konversation terminated!)
13:02:03*smt` quit (Remote host closed the connection)
13:07:48*echotangoecho quit (Read error: Connection reset by peer)
13:09:16FromGitter<bung87> cool like mysql-cli
13:10:32FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/GlXt/Screen-Shot-2018-09-08-at-9.09.59-PM.png)
13:10:48FromGitter<bung87> found issue with logo
13:11:13FromGitter<Bennyelg> :D
13:12:42*nsf joined #nim
13:14:38*zachcarter joined #nim
13:15:57*Vladar quit (Remote host closed the connection)
13:16:19*Vladar joined #nim
13:21:02*Tanger quit (Ping timeout: 268 seconds)
13:35:47FromGitter<Bennyelg> cligen library anyone faimiliar ?
13:57:15*echotangoecho joined #nim
14:06:12*SenasOzys quit (Remote host closed the connection)
14:06:30*SenasOzys joined #nim
14:11:06*zachcarter quit (Quit: Lost terminal)
14:11:20*zachcarter joined #nim
14:12:42zachcarterhttps://about.sourcegraph.com/go/gophercon-2018-go-says-wat/#wat-16
14:12:43zachcarterhrmmm
14:22:07*smt joined #nim
14:25:13dom96possible in Nim too :)
14:25:52*Trustable joined #nim
14:26:22zachcarterbut is it that easy?
14:26:47zachcarteroh yes it is apparently
14:26:47zachcarterwow
14:34:15zachcarteris that really desired?
14:34:46FromGitter<zetashift> Why would you ever want to do that?
14:35:34zachcartermy thoughts as well
14:42:17FromGitter<mratsim> To win the Go code obfuscation challenge
14:42:38FromGitter<mratsim> @Bennyelg ping @shashlick
14:43:02zachcarterlol
14:43:12FromGitter<kaushalmodi> @Bennyelg I use cligen. It's awesome!
14:43:25zachcarterI do as well
14:43:30zachcarterit is a great lib!
14:43:50FromGitter<Bennyelg> I know it's awesome. But I found an annoying but or I dont know how to use it
14:43:59FromGitter<Bennyelg> when I pass seq[char] for example
14:44:24FromGitter<Bennyelg> I can't pass something like this: -d=';', ',' ⏎ I try escaping but it's not working.
14:44:33FromGitter<Bennyelg> -d=';','~' will work just fine.
14:45:31FromGitter<mratsim> and "';',’,’"?
14:46:53FromGitter<Bennyelg> nop
14:46:55FromGitter<mratsim> 50 years that we have escape hell and still not solved :P. I have horror stories with Excel quote interpolation btw (because since the escape character is quote in Excel you need to triple or quadruple your quotes ¯_(ツ)_/¯)
14:49:37zachcarteryeah
14:49:42zachcarterthat shit is a nightmare
14:49:51zachcarteralthough I heard excel was getting Python as as scripting language soon
14:49:57ldleworklol really?
14:50:02FromGitter<mratsim> yes
14:50:03zachcarterso I wonder if all of the built in formulas will improve
14:50:14zachcarteryeah - I think they're trying to get off VB Macros
14:50:23zachcarteror at least give users more options
14:50:27FromGitter<mratsim> it has JS script too, because JS scripting is the only thing that works in Excel Online
14:50:46ldleworkI wonder what version of Python they'll go with
14:50:50FromGitter<mratsim> though I raised a big last year because their intro example didn’t work xD
14:50:56FromGitter<mratsim> a bug*
14:51:08*Trustable quit (Remote host closed the connection)
14:57:39shashlick@mratsim: not me right?
15:06:18FromGitter<codenoid> @Bennyelg can i get example of .csv file
15:06:28FromGitter<codenoid> i still don't understant, what inside that .csv file
15:08:28FromGitter<mratsim> @shashlick @Bennyelg had parsing issues with quote in nimgen
15:10:02FromGitter<mratsim> @codenoid https://github.com/mratsim/Arraymancer/blob/master/tests/manual_checks/iris_numeric.csv
15:10:09FromGitter<mratsim> check the raw version as well
15:10:37FromGitter<codenoid> 👍
15:12:23FromGitter<mratsim> parsing CSVs is one of the most hellish task though. ⏎ ⏎ for example, instead of transforming newline into \n, Excel will add a quote and go to the next line.
15:12:50FromGitter<mratsim> the quote format changes depending on your localization in Excel, as does the comma vs semi)colon
15:13:04FromGitter<mratsim> and people sometimes use tabs for separation in CSVs
15:13:18FromGitter<kayabaNerve> ... what
15:13:18FromGitter<Bennyelg> @codenoid the problem is not in the csv
15:13:31FromGitter<Bennyelg> the problem is passing delimiter ',' with -d= param (cligen)
15:13:34FromGitter<mratsim> you can’t encode the locale as well so French, Chinese will produce weird characters
15:14:07FromGitter<codenoid> i just want to ask, what's inside .csv :D @Bennyelg
15:14:23FromGitter<Bennyelg> just a random csv
15:14:29FromGitter<Bennyelg> nothing special , bullshit data.
15:14:32FromGitter<codenoid> i want make crystal version for that xD
15:15:43FromGitter<mratsim> http://thomasburette.com/blog/2014/05/25/so-you-want-to-write-your-own-CSV-code/ and http://www.secretgeek.net/csv_trouble
15:19:07*Jesin quit (Quit: Leaving)
15:19:20dom96It's what happens when a format isn't standardised
15:19:55FromGitter<codenoid> i had same problem with plain text delimiter, sometime i change comma with something uniq, (but with my own csv builder, :/)
15:22:59*Jesin joined #nim
15:23:10*Jesin quit (Client Quit)
15:25:01shashlick@Bennyelg: what issue did you see with nimgen?
15:30:33zachcarterif I have a block macro, and then in the block I have procedures with pragma macros attached to them
15:30:54zachcarteris there anyway, with a reference to the proc node with the pragma macro attached, to execute to the pragma macro from within the block macro?
15:32:57*Jesin joined #nim
15:36:27zachcarter`result.add(getAst(constructor(cn)))` worked
15:50:07*SenasOzys quit (Ping timeout: 244 seconds)
16:08:30*echotangoecho quit (Quit: Lost terminal)
16:09:16*cspar quit (Ping timeout: 246 seconds)
16:14:30*cspar joined #nim
16:14:41FromDiscord<ZeetNickel> Potentially stupid beginner question here, but is there in Nim any way to get a ref to a non-ref object, or are pointers the only way to go?
16:15:31FromGitter<Bennyelg> @shashlick not parsing well
16:16:04FromGitter<Bennyelg> try to pass an argument which it's seq[string] or seq[char] and pass ',' or "," as an element
16:17:50zachcarterZeetNickel - `proc box[T](x: T): ref T =
16:17:53zachcarter new(result); result[] = x`
16:18:33FromDiscord<ZeetNickel> Alright, thank you <zachcarter>, I'll try that
16:18:41zachcarternp
16:19:50shashlickI'm not sure, are you talking of cligen or nimgen
16:25:14*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
16:32:16FromGitter<Bennyelg> cligen
16:32:51FromGitter<Bennyelg> added new keyword ⏎ proc main(name: string, delimiters: seq[char])
16:32:56FromGitter<Bennyelg> try to pass delimiter ','
16:33:00FromGitter<Bennyelg> from the command line
16:33:47*cspar quit (Ping timeout: 240 seconds)
16:34:43zachcarterhttps://gist.github.com/zacharycarter/ed7f584a3acf2aa77d0a397cca11e100 - es2015 classes and getters / setters working now
16:36:20*SenasOzys joined #nim
16:37:27FromGitter<codenoid> is nim has sublime plugin with auto-indent feature
16:37:47FromGitter<Bennyelg> detch sublime use vs-code
16:38:38zachcarterhttps://github.com/Varriount/NimLime
16:39:15*cspar joined #nim
16:40:11FromGitter<codenoid> sorry, i don't use browser for coding
16:42:37FromGitter<codenoid> my computer ram is 2GB, i think vs-code not for me
16:52:30FromGitter<mratsim> ah @Bennyelg @shashlick, sorry i mixed up nimgen and cligen authors :/
16:55:31shashlick😉
16:55:45FromGitter<Bennyelg> lol hehe
16:55:48FromGitter<Bennyelg> who worte cligen
16:55:56FromGitter<Bennyelg> wrote*
17:01:01dom96ZeetNickel: You're better off defining your types as refs everywhere than boxing them IMO
17:09:44FromDiscord<ZeetNickel> But if I do that they get heap allocated no? I'm struggling with some basic concepts of Nim memory management here.
17:09:44FromDiscord<ZeetNickel> What I have is a sequence (or some other arbitrarily complex structure) of data, and then I want to refer to that data and pass it on to a proc that modifies it. I do not want a sequence of references to data that lives some other place in the heap. But maybe that isn't what it would mean to use a ref type...?
17:12:43FromDiscord<ZeetNickel> Here is a small test to illustrate my confusion: https://pastebin.com/FmauD5Cs
17:13:31FromDiscord<ZeetNickel> Second example does what I want. First example i show I would want to organize it. Third example crashes because I din't know what I'm doing
17:15:18FromDiscord<Generic> you can't just take a ref object out of a seq
17:15:32FromDiscord<Generic> `result[] = data[0]` this line is the problem
17:15:51FromDiscord<ZeetNickel> Alright, thanks
17:16:07FromDiscord<Generic> a ref object has to be allocated in a special way and then is tracked by the GC
17:16:30FromDiscord<Generic> but what you can do is using a raw pointer instead
17:17:01FromDiscord<Generic> change the return type to ptr int and use addr data[0] to get the pointer
17:17:41FromDiscord<ZeetNickel> So returning addr(data[0]), and then de-refing when passing it to the proc that modifies it?
17:18:39FromDiscord<Generic> yes, because you're taking a pointer to the address where data[0] is stored
17:19:02FromDiscord<Generic> you have to be careful that the pointer doesn't outlive the object it's coming from
17:19:38FromDiscord<Generic> the memory might be already used for something else, you probably can imagine what happens if you now read/write from/to it
17:21:17FromGitter<Bennyelg> newbie question
17:21:25FromGitter<Bennyelg> how do i initialize something like this? ⏎ var results: seq[Table[string, int]] = @[]
17:21:38FromGitter<Bennyelg> apparently it`s not enough
17:22:09FromDiscord<Generic> Bennyelg: [] creates an array and the @ operator turns it into a seq
17:22:12FromDiscord<ZeetNickel> Thanks Generic. I'm reasonably well versed in C++, I'm just struggling when trying to implement it in nim. I'm still "thinking in C++" when coding nim, so the issue might actually be that I'm trying to do things the wrong way.
17:22:38FromGitter<Bennyelg> so seq of Table
17:22:40FromGitter<Bennyelg> it's fine
17:22:45FromDiscord<Generic> ah, sorry
17:22:48FromGitter<Bennyelg> but the table need to be initialize ot
17:22:50FromGitter<Bennyelg> to*
17:22:50FromDiscord<Generic> I misread it
17:24:08FromDiscord<Generic> you initialise the tables when adding you're adding elements to the sequence
17:24:42FromDiscord<Generic> so results.add(initTable[string, int]()) or results.add({"key": 42}.toTable)
17:24:43*FromGitter quit (Remote host closed the connection)
17:24:59*FromGitter joined #nim
17:35:20FromGitter<Bennyelg> find max element in seq by key any implementation or i need to implement it ?
17:37:29FromDiscord<Generic> well the fastest way would be to just write it using a loop
17:38:05FromDiscord<Generic> the most elegant way would be to import sequtils and then write max(results.mapIt(it["key"]))
17:44:24dom96Generic: A pointer should be considered an escape hatch in Nim
17:44:38dom96And should only be used when absolutely necessary (FFI)
17:46:33FromDiscord<Generic> dom96: I saw them a lot in examples of the new destructor system
17:47:07dom96Link?
17:47:14FromDiscord<Generic> https://nim-lang.org/araq/writetracking.html
17:47:27FromDiscord<Generic> also the tests of the new destructor system
17:47:58Demos[m]hmm anyone heard of pointer free programming
17:48:00Demos[m]like parasail
17:48:18Demos[m]where by avoiding pointers you construct a language where each subexpression can be evaluated in parallel
17:48:34dom96ZeetNickel: What you should do in your case is pass the seq + an index
17:48:45dom96and modify the item that way
17:49:32dom96Generic: I don't see a single mention of 'ptr' there
17:50:03FromDiscord<Generic> sorry, wrong article
17:50:54FromDiscord<Generic> https://nim-lang.org/araq/destructors.html
17:53:02FromDiscord<Generic> it's also mentioned at the end of the post that it's problem atm that there's no safe way to get a mutable reference to an element of a container
17:54:23FromDiscord<Generic> and from my experience I can really say that's not a rare situation
17:54:48dom96Indeed. Also, this is "Araq's musings". It shouldn't be misconstrued as "Use ptr for everything because this article about a feature that hasn't been implemented yet uses them"
17:54:59FromDiscord<Generic> of course
18:09:30FromGitter<Bennyelg> https://github.com/Bennyelg/csvql -> Now support auto guess for the csv delimiter. so no need to specify :D
18:43:52zachcarterBennyelg: that library is pretty cool - but I wish it was combined with NimData
18:44:21FromGitter<Bennyelg> They are not in the same spot
18:44:39zachcarterwell, let me clarify -
18:44:54FromGitter<Bennyelg> they do different things.
18:45:54zachcarterI'm using NimData in a cli tool at work. I need to read in a CSV file with an undetermined number of rows, filter out rows I don't, drop some columns from the CSV etc, and then execute an async http request for every row in the dataframe.
18:46:31zachcarterI realize that - I'm simply suggesting, it'd be nice if the interface for interacting with a dataframe was the same as in your library for interacting with a csv
18:46:54zachcarterwhere you could use AnsiSQL to get results from the dataframe
18:47:32zachcarterI understand your tool has its own use cases
18:47:36zachcarterapart from NimData
18:47:37FromGitter<Bennyelg> I got you, well it's doable it will make NimData sparky
18:47:50FromGitter<Bennyelg> apache-spark but without the distribution
18:48:01zachcarterah - well unfortunately I think NimData has been abandoned
18:48:07zachcarteror is at least in hiatus mode
18:48:19zachcarterI issued a PR to fix the code for 0.18.1 - but the author hasn't responded
18:48:51FromGitter<Bennyelg> we can always fork it
18:49:00zachcarteryup!
18:49:22zachcarterlately my nights and weekends have consisted of writing macros and libraries in prepartion for building web components with Nim for a project at work
18:51:51FromGitter<Bennyelg> since I am coming from python I still don't know when I should think of writing Macro
18:52:09FromGitter<Bennyelg> it's pretty hard concept for me "interact with the AST"
18:52:36zachcarterwell - for instance, Nim's JS backend compiles to like V2 of the JS spec
18:53:03zachcarterso a lot of things that are in newer iterations of ECMAScript (like Classes for instance - defined in ES2015)
18:53:56FromGitter<Bennyelg> you have some written code ?
18:54:00zachcarterso I'm using a macro which lets users declare ES2015 classes - and what the macro does is it generates a Nim type for the class, along with a new proc, and procs for getters and setters
18:54:04zachcarteryes
18:54:04zachcarterone second
18:54:10FromGitter<Bennyelg> I would like to brush my eyes a bit
18:54:21*halirc joined #nim
18:54:31FromGitter<Bennyelg> wonderful but its hard work
18:54:33FromGitter<Bennyelg> I guess
18:56:06zachcarterone sec - I got a snake to deal with in my basement - dog just freaked out and I found it
18:56:26halircGood evening. If I want to move all the files in a directory (a few hundred files) is there a better/faster way than to use walkFiles and moveFile?
19:00:17FromGitter<Bennyelg> OMG sanke lol
19:00:23FromGitter<Bennyelg> be carful
19:04:34zachcarterwas like a 4ft black or rat snake
19:04:45zachcarterwhichever one starts stinking real bad when they get scared
19:04:58zachcarterhe was just a lil noodle trying to hang out with us
19:05:00FromGitter<Bennyelg> so You killed it ?
19:05:02zachcarteror a big noodle I guess
19:05:03zachcarternah
19:05:14zachcarterI grabbed him with a set of fireplace tongs and stuck him in a garbage bag
19:05:15FromGitter<Bennyelg> so what did you do
19:05:16zachcarterand let him loose outside
19:05:17*smt` joined #nim
19:05:22FromGitter<Bennyelg> lol
19:05:35zachcarterwell I just threw the garbage bag outside but it wasn't tied shut
19:05:36zachcarterso he could get out
19:05:43FromGitter<Bennyelg> not a venom one
19:05:51zachcarternah they're harmless and good for killing rodents
19:05:56zachcarterscared the crap out of me though
19:06:01FromGitter<Bennyelg> where are you from ?
19:06:08zachcarterVirginia
19:06:25FromGitter<Bennyelg> Oah My dream
19:06:41zachcarterhaha
19:07:06FromGitter<Bennyelg> Im from Israel. wish to go USA soon
19:07:15zachcarteroh cool!
19:08:00zachcarterwell - the US is alright - I'd go elsewhere if I could find a decent job and make a good living, but I've also been in Virginia my entire life, so it's all I really know.
19:08:08dom96halirc: moveDir?
19:08:13zachcarterI'm not especially fond of Virginia, it's a bit backwords law-wise
19:08:16zachcarteranyway back on topic
19:08:30FromGitter<Bennyelg> yea post me samples
19:08:37FromGitter<Bennyelg> how old are ya ? 25 ?
19:08:58dom96Speaking of the US, I'll be there in two weeks :)
19:09:04dom96San Francisco to be exact
19:09:10*smt quit (Ping timeout: 272 seconds)
19:09:15FromGitter<Bennyelg> ?
19:09:15zachcarter@dom96: nice!
19:09:19FromGitter<Bennyelg> Apache-spark summit ?
19:09:21zachcarterBennyelg: https://gist.github.com/zacharycarter/e499ec2015278cc42ab3ac8632569af5
19:09:29zachcarterBennyelg: 33
19:09:58FromGitter<Bennyelg> I was visited in Miami , Olrando, Key west, Vegas
19:10:03FromGitter<Bennyelg> yet to come of course
19:10:20zachcarterI need to clarify with work what the legality around us posting Carfax sourecode publicly is.
19:10:48zachcarterI think this nim ecmascript library would be the first open source library carfax would have ever published
19:10:51zachcarterfor public consumption
19:11:11zachcarterso right now it's living in our private SCM - until I get that clarification
19:11:22halircdom96, thanks dom, I think moveDir does not do what I want in this case. I want to move all files from a directory into an existing dir where there are already other files. I just ran it with the walkFiles and moveFile and it's very fast, I don't notice a delay. So that should be ok.
19:14:23halircdom96, by the way, did you have an idea about the nimble segfault in the travis build of docopt.nim?
19:14:28FromGitter<Bennyelg> @zacharycarter its looks very very complicted and very hard work
19:14:50zachcarterit's not
19:14:51dom96halirc: nope. I need to figure out how to reproduce it.
19:15:18dom96In case I forget, can you create an issue about it? https://github.com/nim-lang/nimble/issues
19:15:21zachcartermacros are relatively easy to write with Nim - you just need to learn how to use dumpTree and dumpAstGen
19:15:55zachcarterdumpTree lets you figure out what the incoming abstract syntax looks like when a macro is invoked
19:16:08halircdom96, sure. Thank you!
19:16:21zachcarterand then dumpAstGen - when supplied with the code you want to create - lets you know the abstract syntax you need to create inside the macro
19:17:01zachcarteralot of the output of those two helper macros, you can copy and paste
19:17:14FromGitter<Bennyelg> @zacharycarter Yea I know, so basically you worte someting in ES and compile it into nim code ?
19:17:17zachcarteronce you learn how to write macros - extending Nim to do things it currently isn't capable of - is quite easy
19:17:42zachcarterno - I just define a syntax for the user to use to define ES2015 classes
19:17:47zachcarterand then a macro proceses that
19:17:57zachcarterand creates JS for a ES2015 class using the emit pragma
19:18:15FromGitter<Bennyelg> I c so exactly the opposite
19:18:16zachcarterand creates Nim types / procedures that bind to the JS classe's functions
19:18:33FromGitter<Bennyelg> you wrote in pure nim and get JS compitable to ES2015
19:19:05zachcarterwell - the macro takes in an untyped parameter - meaning the code under the `class` block isn't going to go through any type checking - so it doesn't have to be Nim code
19:19:22zachcarterthat's why I can do things like - `this.width = width` in the constructor proc
19:19:29zachcarteror the proc tagged with the constructor pragma
19:19:31FromGitter<Bennyelg> yea
19:19:35zachcarterthat's not valid Nim
19:19:36FromGitter<Bennyelg> I wonder what this is
19:20:01zachcarterbut the idea is - just define a constructor proc with Nim, and the parameters to the constructor become fields on the Nim type
19:20:11zachcarterand then the body underneath you write as you would in normal JS
19:20:17zachcarterand that becomes the body of the JS constructor that gets generated
19:20:26FromGitter<Bennyelg> pretty cool
19:20:38zachcarterwell - we need to write this widget at work that we can embed on third party websites
19:20:52zachcarterand I dont want to use IFrames so we're going with web components
19:21:01zachcarterand thusly we need some ES constructs
19:21:14FromGitter<Bennyelg> at you work they use nim?
19:21:26zachcarterI just convinced my director / manager to let us start using it
19:21:30zachcartera week or two ago
19:21:40FromGitter<Bennyelg> I tried to introduce nim in my work
19:21:42zachcarterwe've writen a CLI tool with it - for enriching email marketing CSVs
19:21:48FromGitter<Bennyelg> but they stick to Go :/
19:21:55zachcarterand now we're writing the frontend of this widget with Nim
19:22:08zachcarterwe're using Go too - but I plan to replace Go with Nim on our project
19:22:23FromGitter<Bennyelg> I wishh
19:22:30zachcarterWe have a lot of Go detractors at work - not really any Nim detractors, but Rust fanbois to deal with who have never written a line of Rust
19:22:48zachcarterit took me probably two years of evangalizing Nim at work, to get the green light.
19:22:48FromGitter<Bennyelg> lol
19:23:27zachcarterbut I'm pair programming with the other guy I maintain this product with, and I'm teaching him how Nim macros work - and I'm letting him help me write this one
19:23:36zachcarterso the learning has begun!
19:23:43FromGitter<Bennyelg> Cool!
19:23:58FromGitter<Bennyelg> it will worth it evantualy
19:24:07zachcarterbtw - this widget is going to be potentially embedded on thousands of websites
19:24:18zachcarterand it will be written entirely in Nim
19:24:23zachcarterat least the presentation layer
19:24:34FromGitter<Bennyelg> how's the performance ?
19:24:50zachcarterwell I ported hyperHTML to Nim so we didn't need to use react
19:25:00zachcarterso we're going to use that for our dom diffing / rendering library
19:25:29zachcarterit should perform well I imagine
19:25:43FromGitter<Bennyelg> Oo, cool
19:25:50zachcarterwe're staying light on / avoiding if we can all together any frameworks
19:25:56zachcarterand just using small libraries to do what we need
19:26:22zachcarterand we're writing as much pure Nim code as possible - though we will be relying on some JS libraries
19:26:56FromGitter<Bennyelg> yea Nim is not yet flawless with libraries
19:28:26zachcarteryeah - but that's where FFI comes in :)
19:28:43FromGitter<Bennyelg> yea
19:28:44FromGitter<Bennyelg> :)
19:31:31zachcarterwhen I showed macros to my co-worker, he was like - I had no idea programming languages could do this.
19:31:57FromGitter<Bennyelg> :D
19:31:57zachcarterI think most of the people I work with haven't really been exposed to how great metaprogramming can be.
19:32:22zachcarterespecially with a language that has as many targets as Nim does
19:32:37FromGitter<Bennyelg> Agree
19:35:21FromGitter<mratsim> @Generic @ZeetNickel if you need to return a mutable reference use a var int `proc get_data_ref(data : var seq[int], index: int) : var int = data[index]`
19:35:53FromGitter<mratsim> but `[]` already exist for that
19:36:36FromGitter<tim-st> When I would use a nim created dll in another program (e.g. a webserver written in go) would this be possible regarding gc and would the performance go down much?
19:37:16FromGitter<tim-st> e.g. many requests per second would call to the dll
19:37:18FromGitter<mratsim> same perf, but you need to call NimMain or something
19:37:49FromGitter<mratsim> it’s like calling a C dll, except that you need to initialize the runtime at the beginning
19:38:07FromGitter<mratsim> then once it’s warm in your CPU cache it works like say libjpeg
19:38:28FromGitter<tim-st> ok, would I need to boot up the runtime once or once per request?
19:39:40FromGitter<tim-st> I want to bypass the async this way like having the complete backend logic in nim and just a small server in go that calls each request to nim exported proc `proc worker(input: string): string`
19:41:39FromGitter<mratsim> only when the Nim library is dlopened I think
19:42:24*kapil___ quit (Quit: Connection closed for inactivity)
19:42:52FromGitter<tim-st> hm, I saw that nims asynchttpserver has real problems with memory leaks I hope I could solve this by using a go webserver, am I overseeing some problems maybe?
19:43:04FromGitter<mratsim> you should pass and return ptr char in the FFI
19:43:47FromGitter<mratsim> make sure that either Nim manage the memory or go. Don’t mix and match within the same type.
19:45:07*kungtotte joined #nim
19:45:10FromGitter<tim-st> ok, thanks, I try to wrap my nim program and test if memory goes down
19:45:17FromGitter<tim-st> when called from go
19:47:13dom96tim-st: The memory leaks really aren't that much of a problem
19:47:17dom96and they will be fixed eventually
19:47:31dom96You're better off just using Nim and not bothering integrating it into Go
19:47:42FromGitter<tim-st> dom96: you can test it here: https://github.com/tim-st/nim-zim
19:49:22*Trustable joined #nim
19:49:48FromGitter<tim-st> maybe I just need to close something, espcially when a file is sent the memory stays in ram
19:52:50FromGitter<mratsim> oh, zim, it’s been a while since I’ve used it
19:53:18FromGitter<tim-st> yeah, me too, but I need nlp resources for automated grammar learning
19:53:56FromGitter<mratsim> hopefully I get RNNs working this weekend in Arraymancer and I can add some NLP capabilities using neural networks
19:54:09zachcarter:D
19:54:10FromGitter<mratsim> but tokenizing text is a pain >_>
19:54:11zachcarterthat'd be awesome
19:54:23FromGitter<mratsim> I want to be able to write a shakespear RNN
19:54:34FromGitter<tim-st> @mratsim I implement complete "understanding" of the language
19:54:38FromGitter<mratsim> or a “Haiku” RNN to produce Japanese Haikus
19:56:33FromGitter<mratsim> @tim-st you’re leaking because your ZimFile is in a global context not in a proc so it’s never garbage collected: https://github.com/tim-st/nim-zim/blob/master/zim.nim#L393. ⏎ ⏎ Add a `main()` proc
19:57:38FromGitter<tim-st> lol, if this is all that would be interesting, good idea, will try it, btw do you think `threadvar` is needed if I dont have `--threads:on`?
19:58:28FromGitter<mratsim> it’s not. threadvar is a global with one instance per thread.
19:58:45FromGitter<mratsim> in single threaded mode threadvar = global
19:58:53FromGitter<mratsim> because you only have one thread
19:58:54FromGitter<tim-st> but if I doesnt use it, it complaints that's not "gcsafe"
19:59:01FromGitter<tim-st> and doesnt compile
20:00:13dom96mratsim: You should grab this channel's IRC logs and create an Araq RNN :D
20:00:36FromGitter<mratsim> It could start with “I know you will say consistency"
20:00:48dom96:D
20:01:10FromGitter<mratsim> btw @tim-st I think likely and unlikely shouldn’t be used except for exceptional failures: https://github.com/tim-st/nim-zim/blob/master/zim.nim#L454
20:01:24FromGitter<mratsim> network disconnection is happen often.
20:02:57FromGitter<tim-st> @mratsim wow I think the main procs really changes things... Now compiler doesnt complain on missing `threadvar` will check if the leaking is gone
20:03:15FromGitter<tim-st> I use likely and unlikely mainly for the code reader to "document" my code
20:05:39*smt joined #nim
20:06:21FromGitter<tim-st> it's not gone :(
20:06:51FromGitter<tim-st> goes from 20 mb to 80 in one second and stays although transfer is finished
20:07:19FromGitter<mratsim> for likely/unlikely read the following: http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html
20:07:47FromGitter<tim-st> ok thanks
20:07:56FromGitter<mratsim> on the micro benchmark, code is slow down by 2x if you expect the wrong value
20:08:13FromGitter<mratsim> so unless that’s true more than 80% of the time it’s not worth it.
20:08:52FromGitter<tim-st> yes, I only use it when I expect more than 90% correctness
20:09:14FromGitter<tim-st> but maybe I'm wrong at the place where you mentioned the disconnection^^
20:09:15*smt` quit (Ping timeout: 252 seconds)
20:09:56FromGitter<tim-st> it's interesting that the code now compiles without threadvar, I think it's nim bug, because the compiler could easily make a main proc around local vars
20:10:01FromGitter<tim-st> to get it working
20:10:40FromGitter<tim-st> ram is still at 80mb without new connection...
20:10:50FromGitter<tim-st> (I'm on windows)
20:12:20FromGitter<tim-st> now it stays at 80mb, maybe it's "reserved memory mapped" data; i will look at the advanced task manager
20:12:23FromGitter<mratsim> well I never played that much with async yet, but all async procs use the GC/closure iterator behind the scenes so
20:12:55FromGitter<mratsim> all the proc {.async.} are reserving heap memory and maybe are not deallocated.
20:14:20FromGitter<tim-st> 82/88mb is really used
20:16:53FromGitter<mratsim> well maybe it’s the async memory bug dom mentionned then
20:18:37FromGitter<tim-st> from what I read in forum and github issues it's not really known what causes the bug and where, I thought about giving every single proc inside `asyncdispatch.nim` a getOffcupiedMemory so I can findout after which call memory gets high
20:20:30FromGitter<tim-st> but maybe it's normal that a webserver stays at high memory because of cached open tcp connection or something, I will try the zim implmentatins in go and python and see if their servers also stay at high ram amount
20:31:47*martinium joined #nim
20:47:49*stefanos82 quit (Quit: Quitting for now...)
20:52:12FromGitter<tim-st> I just tried the python zim implementation with the same pdf file it stays at the same size like when I didnt click a link :\
21:02:46dom96The memory usage is certainly not normal
21:03:00dom96Anything you can figure out about the cause would be very helpful
21:03:26dom96That said, something you're doing might make it worse
21:03:35dom96The forum doesn't go to 80MB straight away
21:03:43dom96Only gradually over many days
21:05:16FromGitter<tim-st> ok, I'm currently trying it on archlinux
21:17:39FromGitter<tim-st> lol, the same code works different on linux... :\
21:22:10*nsf quit (Quit: WeeChat 2.2)
21:35:48*Senketsu quit (Ping timeout: 252 seconds)
21:36:12*Trustable quit (Remote host closed the connection)
21:36:52*Senketsu joined #nim
21:52:03FromGitter<mratsim> were you on Windows or Mac before (or Haiku :P)
21:52:11*SenasOzys quit (Remote host closed the connection)
21:52:25FromGitter<tim-st> win7x64
21:52:55FromGitter<tim-st> now on linux I always get the else branch :(
21:54:52FromGitter<mratsim> that’s “unlikely” (pun intended :P)
21:55:34FromGitter<tim-st> yes, it's really hard to debug now on vm, but at least all other code works and compilation too
21:56:14FromGitter<tim-st> I cannot test memory usage on linux because I cant open large files it always redirects to same page
21:58:25*SenasOzys joined #nim
21:58:57*SenasOzys quit (Remote host closed the connection)
21:59:23*SenasOzys joined #nim
22:05:33FromGitter<kayabaNerve> I'm not missing something here, right?
22:05:40FromGitter<kayabaNerve> https://github.com/nim-lang/Nim/issues/8922
22:07:02FromGitter<mratsim> not a bug, working as intended
22:07:46*Senketsu quit (Remote host closed the connection)
22:08:11*Senketsu joined #nim
22:08:56FromGitter<mratsim> convention is to use CamelCase for enums like Red, Blue, AquaMarine or a prefix + camelCase like clrRed, clrBlue, clrAquaMarine
22:09:32FromGitter<kayabaNerve> @mratsim But the pure pragma is what's supposed to enable this behavior
22:09:56FromGitter<kayabaNerve> I didn't want a prefix. I wanted enum name \`.\` val.
22:10:05FromGitter<mratsim> not, pure was supposed to force prefixing
22:10:21FromGitter<mratsim> but that was removed in June
22:10:42FromGitter<kayabaNerve> You're right; misread
22:10:49FromGitter<kayabaNerve> I had the same behavior with .pure. though
22:10:57FromGitter<kayabaNerve> So it's impossible now/
22:11:14FromGitter<mratsim> you can’t force but you can use it.
22:11:27FromGitter<mratsim> you always could
22:11:29FromGitter<kayabaNerve> But I have an object named the same as the enum value
22:11:43FromGitter<mratsim> ah. It should say ambiguous stuff then
22:13:04*Vladar quit (Remote host closed the connection)
22:13:09FromGitter<kayabaNerve> Eh. Works fine.
22:13:15halircI just noticed that expandFilename works differently on windows and linux. On windows it can be used to get the absolute path of a non existing file, on linux it raises an error in that case.
22:13:20FromGitter<kayabaNerve> I need to prefix the enum but I don't need to prefix when I use var x: type
22:14:39halircI used it to get rid of '/../' in paths for example, thats why I call it on files or paths that do not exist.
22:17:55FromGitter<mratsim> @halirc, probably relevant: https://irclogs.nim-lang.org/06-09-2018.html#14:17:36 but yeah raise a bug.
22:23:21halircmratsim, looks like I'm just using the wrong proc for the job? There seems to be an os.absolutePath that does what I'm looking for https://github.com/nim-lang/Nim/issues/8174
22:24:21halircI don't see that one in the documentation of the os module though. Perhaps it is not yet in the 0.18.0 release
22:25:30*SenasOzys quit (Read error: Connection reset by peer)
22:28:15FromGitter<mratsim> it’s from July 5
22:39:19*cspar quit (Ping timeout: 244 seconds)
22:45:00FromGitter<mratsim> also relevant: https://github.com/nim-lang/Nim/issues/8780
22:45:43*seni joined #nim
22:46:54FromGitter<tim-st> streams.nim should work the very same on windows and linux?
22:50:49halircmratsim, thanks, I'll make a workaround for now for my project
22:50:56*halirc quit (Quit: Leaving)
22:51:50FromGitter<tim-st> I think I have a bug regarding big endian / little endian, streams doesnt work out of the box the same on windows and linux
22:55:10FromGitter<mratsim> I used them on both and didn’t see an issue in my CI
22:58:25FromGitter<tim-st> I cannot imagine another bug, it seems only compressed data works fine and raw data doesnt, I think the pointer is read from stream different on windows and linux will test tomorrow
22:59:01FromGitter<tim-st> (pointer is here just an integer using s.readInt64)
23:00:22FromGitter<mratsim> FileStream and GzStream work exactly the same
23:00:39FromGitter<tim-st> I have lzma stream
23:00:45FromGitter<tim-st> and FileStream
23:00:45FromGitter<mratsim> if it’s coming from a socket/network I suppose it’s always big endian as well
23:01:10FromGitter<mratsim> didn’t try a lzma stream
23:01:14FromGitter<tim-st> ok, then I will do tests without network first
23:01:37FromGitter<tim-st> lzma works, the lib is very strict on erros and I see all html in browser
23:01:46FromGitter<tim-st> just the files dont work, they arent compressed
23:02:42FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/io/io_npy.nim#L167 ⏎ ⏎ ^ no issue here, CI on Linux, Mac, Windows
23:03:27FromGitter<tim-st> this is writeMode
23:03:34FromGitter<mratsim> sorry the read is here: https://github.com/mratsim/Arraymancer/blob/master/src/io/io_npy.nim#L80
23:04:32FromGitter<tim-st> oh: stream.readUInt16LE.int
23:04:42FromGitter<tim-st> maybe I need something like this too
23:04:50FromGitter<tim-st> :\
23:04:55FromGitter<tim-st> thanks
23:05:48*cspar joined #nim
23:05:50FromGitter<mratsim> they are defined here: https://github.com/mratsim/Arraymancer/blob/master/src/io/io_stream_readers.nim
23:06:24FromGitter<tim-st> so you have your own procs for this not directly from stdlib?
23:06:48FromGitter<tim-st> ah I see: https://nim-lang.org/docs/endians.html
23:07:14FromGitter<mratsim> endianness is defined in a schema in the file I’m reading and it can be a lot fo thing: https://github.com/mratsim/Arraymancer/blob/master/src/io/io_npy.nim#L23-L36
23:07:43*abm quit (Read error: Connection reset by peer)
23:07:56FromGitter<mratsim> The spec is there for reference: https://docs.scipy.org/doc/numpy-1.14.0/neps/npy-format.html#format-specification-version-1-0
23:08:20FromGitter<tim-st> ok, thanks, that's a good point, I imagine that endianess thing can fix it
23:09:20FromGitter<tim-st> "all types are little-endian" it says
23:09:59FromGitter<tim-st> so I just need appropriate littleEndian16|32|64 proc around?
23:10:35FromGitter<mratsim> yes probably
23:10:43FromGitter<tim-st> ok, thanks!
23:11:15FromGitter<mratsim> to give you some convention: consumer computers are little-endian.
23:11:22FromGitter<mratsim> networking is big endian
23:11:54FromGitter<tim-st> does it mean I have to convert once again :O
23:12:00FromGitter<tim-st> on windows everything worked
23:12:06FromGitter<mratsim> and then for compression, it should be defined in the spec
23:12:31FromGitter<mratsim> maybe the LZMA reader doesn’t work
23:12:56*xet7 quit (Quit: Leaving)
23:12:58FromGitter<tim-st> lzma works for sure
23:13:00FromGitter<mratsim> compress a file on linux, read the stream, compare with windows
23:13:16FromGitter<mratsim> anyway, going to sleep. Good luck
23:13:25FromGitter<tim-st> I will try tomorrow, thanks for the help
23:13:36FromGitter<mratsim> something helpful is to dump the hex
23:13:42FromGitter<kayabaNerve> Endians suck
23:13:47FromGitter<tim-st> ^^
23:14:08FromGitter<mratsim> feel free to use byteutils: https://github.com/status-im/nim-byteutils/blob/master/byteutils.nim#L103
23:14:20FromGitter<kayabaNerve> Why did you link the file over the package?
23:14:23FromGitter<tim-st> thanks
23:14:37FromGitter<mratsim> debugging endianness in cryptography was a super pain, and I failed back in February :P
23:15:12FromGitter<tim-st> I didnt even knew that I have to recognize this in nim :\
23:15:14FromGitter<kayabaNerve> @mratsim Flip it. Parse both. Use whichever works.
23:15:25FromGitter<mratsim> tough luck on a 1GB file ;)
23:18:12*SenasOzys joined #nim
23:19:49*SenasOzys quit (Remote host closed the connection)
23:21:22FromGitter<kayabaNerve> @mratsim Upgrade your CPU n00b
23:21:23*SenasOzys joined #nim
23:24:09FromGitter<mratsim> look at this bad boy
23:24:16FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/r4cH/2018-09-07_15-48-11.png)
23:25:27FromGitter<kayabaNerve> The i9 sucks
23:26:09FromGitter<mratsim> Well I also prefer threadripper but that was the only water cooled build with 4x RTX2080ti I could find on the web
23:26:43dom96This is pre-built, no?
23:26:54FromGitter<mratsim> well, not technically true, there is this monster as well: https://www.nvidia.com/en-us/data-center/dgx-station/
23:27:03*dom96 wonders if you're actually buying an £11k PC 0_0
23:27:22FromGitter<mratsim> @dom96 you can build it yourself: https://www.scan.co.uk/3xs/enterprise/deep-learning/training
23:28:17FromGitter<mratsim> but over €10k with watercooling and all the weird failure mode that can take away all GPUs :/ no I won’t :P
23:28:32FromGitter<mratsim> but I had good dreams :P
23:30:08FromGitter<Aaron-JM> Damnnn
23:31:41FromGitter<mratsim> @dom96, look at what some Kagglers are using for competitions: https://arxiv.org/abs/1809.00778 ⏎ ⏎ > 2nd Place Solution to Open Images Challenge 2018 Object Detection ⏎ > Our system enables training with huge datasets using 512 GPUs [https://gitter.im/nim-lang/Nim?at=5b945bddcddb292dff459cd7]
23:32:31dom96People have too much money :P
23:33:17FromGitter<mratsim> Or they were mining :P
23:34:30FromGitter<bung87> `TimeInterval` how to make sure only one field is filled?
23:37:02FromGitter<bung87> I want do something like `every 3.hours`
23:37:24FromGitter<mratsim> I think you should use the new Duration (but it’s only on devel)
23:40:48*cspar quit (Ping timeout: 244 seconds)
23:41:20FromGitter<bung87> ah It haven't documented yet
23:46:10FromGitter<bung87> also `proc minutes*(dur: Duration)` accept Duration not like TimeInterval