<< 22-06-2017 >>

00:12:00eeproksAnyone using Nim on OpenBSD? Any gotchas to look for?
00:12:56*kier joined #nim
00:29:18*user0_ quit (Ping timeout: 276 seconds)
00:40:45*NotSpooky joined #nim
00:48:36*chrishel_ quit (Remote host closed the connection)
00:48:51*chrisheller joined #nim
00:49:14*chrisheller quit (Remote host closed the connection)
00:49:31*chrisheller joined #nim
00:50:20*chrisheller quit (Remote host closed the connection)
00:50:36*chrisheller joined #nim
00:51:14*chrisheller quit (Remote host closed the connection)
00:51:46*chrisheller joined #nim
00:52:05*chrisheller quit (Remote host closed the connection)
00:52:21*chrisheller joined #nim
01:07:24*onionhammer1 joined #nim
01:13:27*knockoutMice quit (Quit: Leaving)
01:35:30*chemist69 quit (Ping timeout: 240 seconds)
01:48:26*chemist69 joined #nim
02:24:59*def-pri-pub joined #nim
02:39:08*user0_ joined #nim
03:04:41*def-pri-pub quit (Quit: leaving)
03:26:00*NotSpooky quit (Quit: Leaving)
03:47:14*pilne quit (Quit: Quitting!)
04:06:42*aharlan joined #nim
04:14:17*alxf quit (Ping timeout: 246 seconds)
04:25:51*aharlan quit (Quit: I'm out.)
04:31:22*alxf joined #nim
04:36:32*xet7 joined #nim
04:53:40*aharlan joined #nim
04:53:47*aharlan left #nim (#nim)
04:53:49*aharlan joined #nim
04:59:17*aharlan quit (Quit: I'm out.)
05:00:46*yglukhov joined #nim
05:05:27*yglukhov quit (Ping timeout: 268 seconds)
05:24:18*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:34:15*vld joined #nim
05:50:47Araqeeproks: I know it was ported and should work out of the box but is not part of our CI
05:55:40*vld quit (Quit: Leaving)
05:57:22*vld joined #nim
06:02:18*gokr joined #nim
06:10:44*vld quit (Remote host closed the connection)
06:12:26*vld joined #nim
06:17:17*aerx quit (Quit: WeeChat 1.8)
06:28:08*nsf joined #nim
06:51:41*Vi- joined #nim
07:00:05*tankfeeder joined #nim
07:01:48*jinshil joined #nim
07:31:41*irrequietus joined #nim
07:38:11Araqeeproks: openBSD's GCC version doesn't support the atomics that Nim requires though, update your GCC
07:38:13*irrequietus quit ()
07:40:54tankfeedereeproks, pkg_add and new gcc will be egcc somewhere
07:42:48*Vi- quit (Ping timeout: 260 seconds)
07:53:43*yglukhov joined #nim
08:08:34*Arrrr joined #nim
08:08:35*Arrrr quit (Changing host)
08:08:35*Arrrr joined #nim
08:11:04*vld quit (Ping timeout: 268 seconds)
08:53:26euantorI've installed Nim on OpenBSD 6.1, but not really used it much. I basically just installed it and made sure my pledge wrapper worked correctly
09:03:17*jinshil quit (Quit: Good-bye!)
09:07:54*PMunch joined #nim
09:17:52*Matthias247 joined #nim
09:28:09*gokr quit (Ping timeout: 276 seconds)
09:30:08*yglukhov quit (Remote host closed the connection)
09:31:22*gokr joined #nim
09:48:01*couven92 joined #nim
09:49:53*Matthias247 quit (Read error: Connection reset by peer)
09:56:59Trioxinif only there was a pill that would let me stay awake for days and not feel like complete crap
09:59:37*user0 quit (Ping timeout: 246 seconds)
10:07:15*user0 joined #nim
10:17:06dom96Then everybody would be using it and we'd be back where we started
10:20:29*user02 joined #nim
10:20:30*user0 quit (Read error: Connection reset by peer)
10:53:24PMunchNot if we don't tell anyone
11:02:27*Snircle joined #nim
11:03:23*vld joined #nim
11:13:32flyxmore likely the users would soon be dead because just not feeling exhausted does not mean your body does not need any rest.
11:15:19PMunch and not feel like complete crap
11:15:30PMunchDead is pretty crap
11:15:41flyxyou don't feel anything when you're dead
11:19:03PMunchHaha, fair point
11:25:36ArrrrThat sounds heretical
11:29:24flyxwell, what doesn't in some belief system
11:45:41FromGitter<TiberiumN> Anyone have an advice for async? I need to run many async procs, but I don't want to run more than 50 at one moment
11:46:22FromGitter<TiberiumN> Currently I'm starting them via asyncCheck
11:47:31*Vladar joined #nim
12:15:19*Vi- joined #nim
12:39:09PMunchTiberiumN, a pool?
12:42:49*Arrrr quit (Quit: Leaving.)
12:48:48*huonw quit (Ping timeout: 240 seconds)
12:49:59*huonw joined #nim
12:51:26FromGitter<TiberiumN> @PMunch can you give any examples?
12:51:32PMunchOf a pool?
12:52:11PMunchhttps://nim-lang.org/docs/threadpool.html
12:53:58PMunchOr my own, generic pool implementation: http://ix.io/xVE
12:56:33FromGitter<TiberiumN> Hmm, how can I use it with async?
12:59:10PMunchSince you're using asyncCheck I assume you don't care about the return value of the invocations?
13:01:00FromGitter<TiberiumN> Yes
13:01:16*tankfeeder left #nim ("Leaving")
13:02:51PMunchIn that case you could probably just use a guarded couter
13:02:54PMunch*counter
13:05:31*yglukhov joined #nim
13:05:45PMunchThe most efficient way would probably be to create a guarded queue with the work you want done. Then create 50 worker threads, each reading a work item from the queue and completing it, repeating until the queue is empty.
13:07:31PMunchBut without specifics about what you are actually doing it's hard to say if there is a better way
13:09:00*Vi- quit (Ping timeout: 240 seconds)
13:09:04FromGitter<TiberiumN> I'm sending many HTTP requests
13:10:01PMunchTo a single IP, to different IPs? What does one "job" consist of?
13:10:15FromGitter<TiberiumN> singe IP, singe URL, different POST bodies
13:10:28FromGitter<TiberiumN> Just send Http post request with some JSON data, and check status code of the response
13:10:34FromGitter<TiberiumN> if it's 200 - echo response body
13:10:41PMunchOkay
13:13:08PMunchSo create a structure of your bodies
13:13:27PMunchWell, create one of these: https://nim-lang.org/docs/deques.html
13:13:55PMunchMark it with {.guard: postlock.}
13:14:14PMunchThen write a simple template like the one here: https://nim-lang.org/docs/manual.html#guards-and-the-locks-section-protecting-global-variables
13:14:26PMunchThe atomicRead one
13:14:46PMunchBut with a postBodyQueue.popFirst() for example
13:15:57PMunchThen write your thread proc which basically is a loop of sending statements and queue reads
13:16:03PMunchAnd start 50 of these threads
13:16:26FromGitter<TiberiumN> So I will need to have 50 http clients?
13:17:00PMunchUhm, yes I think so
13:17:13PMunchHaven't really used the HTTP stuff at this level
13:17:51PMunchAnd I'm not sure if you get any benefit from doing it this way compared to just hammering out requests with asyncdispatch..
13:17:55PMunchProbably not though
13:18:11PMunchYou know what
13:18:36FromGitter<TiberiumN> thanks anyway
13:19:11PMunchBut if you want to run 50 concurrent dispatches you could start a single asyncdispatch
13:19:35PMunchThen start 50, each with a callback of "pop an element from the queue and start a new one".
13:19:43PMunchThat way only 50 would be running at a time
13:24:00*Vladar quit (Remote host closed the connection)
13:31:40FromGitter<TiberiumN> Hmm, even with async if I try to use one http client for all requested - it throws an error "invalid headers"
13:31:50FromGitter<TiberiumN> and using ~50 asynchttp clients costs in 170mb ram
13:32:22PMunchNono, you use 1 asynchttp client. Then start 50 request, each with a callback to start a new one.
13:32:46FromGitter<TiberiumN> ah
13:33:44dom96To start 50 concurrent requests you need 50 http clients
13:34:26PMunchIsn't there an async version?
13:34:32dom96there is
13:34:43dom96TiberiumN: Why do you want 50 concurrent requests?
13:34:55PMunchBut it can't run asynchronous requests?
13:35:14dom96?
13:35:19FromGitter<TiberiumN> I mean I have a C# program which can send ~150 requests in one second
13:35:22FromGitter<TiberiumN> it's using threads
13:35:26FromGitter<TiberiumN> and some third-party http lib
13:35:36dom96You can't send concurrent requests over a single socket
13:36:03dom96You can't send "GET / HTTP/1.1" and "GET /blah HTTP/1.1" and expect two responses.
13:36:22dom96A single http client is a single socket
13:36:37PMunchAh, I misunderstood what the asynchttp thing did
13:36:47PMunchI thought it opened multiple sockets
13:36:52dom96I dunno, maybe it should do some magic like that.
13:37:55PMunchWould be nifty
13:40:19*PMunch quit (Quit: leaving)
13:42:56couven92dom96, In .NET we have a ServicePointManager which basically is a pool of sockets, and HttpWebRequest is directed to one particular ServicePoint from the Manager
13:44:15couven92We could introduce an HttpClientManager or sth like that... in .NET this architecture leads to the sockets being kept alive, allowing multiple HTTP requests to sent over the same socket
13:44:28couven92(after each other of course)
13:45:09subsetparkSeems like a pretty natural extension of a thread pool
13:45:23couven92it is
13:50:14*yglukhov quit (Remote host closed the connection)
13:58:03euantorIn C# these days you're recommended to use HttpClient: https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx
13:58:23euantorAnd it's advised to create 1 single HTTP client and use it for many (concurrent) requests
13:58:32euantorhttps://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
13:59:22euantorIt would be cool to have something like that in the stdlib for definite :)
14:02:19*rauss joined #nim
14:06:16*yglukhov joined #nim
14:07:14subsetparkdom96: I'm gonna open some feature request issues on Nimble - these are mostly to track for myself, so if you want to assign them directly to me that's cool
14:07:44dom96subsetpark: alright
14:15:51*NotSpooky joined #nim
14:18:07*aerx joined #nim
14:29:16*sakalli joined #nim
14:45:14dom96Can we get RAII? https://news.ycombinator.com/item?id=14612502
14:46:47*Vladar joined #nim
14:48:57*dexterk__ quit (Ping timeout: 240 seconds)
14:49:04*dexterk joined #nim
15:09:43*sakalli quit (Ping timeout: 255 seconds)
15:11:47Araqdom96: yes, we're slowly following C++'s footsteps
15:12:09Araqit's also highly connected with the ownership system I'm dreaming about
15:23:52*PMunch joined #nim
15:28:27*enthus1a1t quit (Ping timeout: 240 seconds)
15:30:35*enthus1ast joined #nim
15:37:39*Trustable joined #nim
15:39:08*nsf quit (Quit: WeeChat 1.7.1)
15:43:55shmupdoes choosenim win only install i386 versions?
15:44:01shmups/versions/builds
15:46:56euantorYes, at the minute: https://github.com/dom96/choosenim/issues/16
15:48:30shmupthanks euantor
16:07:29*enthus1ast quit (Ping timeout: 240 seconds)
16:08:48*ofelas joined #nim
16:26:15*yglukhov quit (Remote host closed the connection)
16:32:59*yglukhov joined #nim
16:36:38*pilne joined #nim
16:36:44*vld quit (Ping timeout: 268 seconds)
16:41:00*pilne is now known as CodeSnow
16:56:30*NotSpooky quit (Quit: Leaving)
17:01:26*Vi- joined #nim
17:07:40*couven92 quit (Ping timeout: 246 seconds)
17:08:08*arnetheduck quit (Ping timeout: 246 seconds)
17:14:13*aharlan joined #nim
17:15:15*aharlan quit (Client Quit)
17:18:35*Vi- quit (Ping timeout: 240 seconds)
17:25:43*Matthias247 joined #nim
17:27:48*PMunch quit (Quit: leaving)
17:33:15*Matthias247 quit (Ping timeout: 258 seconds)
17:36:16*Matthias247 joined #nim
17:38:02*yglukhov quit (Remote host closed the connection)
17:38:41*yglukhov joined #nim
17:44:33*rain1 joined #nim
17:44:39*smt quit (Read error: Connection reset by peer)
17:44:53*smt joined #nim
17:56:05*nsf joined #nim
18:01:02rain1hello
18:01:15rain1could anyone point me to where in the nim compiler code it checks array bounds?
18:14:55*salewski joined #nim
18:15:16*vld joined #nim
18:15:24Araqrain1: compiler/ccgexprs.nim and others
18:15:25salewskiproc main(x: string) =
18:15:32salewski GC_ref(x)
18:15:38salewskimain("compiles fine but crashes")
18:15:48salewskiIs that intended?
18:17:21*yglukhov quit (Remote host closed the connection)
18:22:17Araqyes
18:22:23Araqit is as you say
18:22:34Araqstring literals are not on the heap
18:23:00salewskiOK, thanks.
18:24:18demi-hmmm, part of me says that should be a compiler error/warning, and another part feels like if you cannot track that stuff then you have bigger problems with the code
18:26:45subsetparkAraq: in that case, when would it ever make sense to GC_ref something not on the heap?
18:27:12salewskiYes, I think I can catch that with something like "when compiles(x = x; GC_ref(x))"
18:27:38salewskiThat question was related to my last forum post, bye...
18:28:58*salewski quit (Quit: WeeChat 1.4)
18:48:42*Vi- joined #nim
18:50:48*Amrykid2 joined #nim
18:51:38*yglukhov joined #nim
18:54:30*cjh`_ quit (Ping timeout: 240 seconds)
19:13:25*Jesin quit (Quit: Leaving)
19:14:52*Jesin joined #nim
19:34:34*yglukhov quit ()
20:27:17*vld quit (Ping timeout: 246 seconds)
21:13:00*Trustable quit (Remote host closed the connection)
21:14:14*rauss quit (Quit: WeeChat 1.8)
21:14:27*ofelas quit (Quit: shutdown -h now)
21:16:17*Demos joined #nim
21:39:59*Vladar quit (Remote host closed the connection)
21:43:21*PMunch joined #nim
21:51:21subsetparkSo - I've got some nim code for work that I need reviewed... But it's a little more advanced than my coworkers understand nim. Luckily the repo is public. Anybody wanna do some code review for me??
21:55:18dom96subsetpark: Would love to!
21:55:34subsetparkhttps://github.com/makingspace/syphus-nim/pull/1 :D
22:03:46*nsf quit (Quit: WeeChat 1.7.1)
22:06:27*Vi- quit (Ping timeout: 240 seconds)
22:11:58*xet7 quit (Quit: Leaving)
22:15:20subsetparkBTW dom96 do you have access to comment on that pull request? I've never tried to do that before
22:16:47dom96hrm, I think so
22:17:01subsetparkneato.
22:17:06subsetparkthanks for the look!
22:18:23*onionhammer1 quit (Ping timeout: 260 seconds)
22:19:33dom96sorry, seems like I won't be able to finish the review.
22:19:53dom96One thing that stood out to me is 'TabuQueue*[T] = ref Deque[Tabu[T]]'
22:20:05*onionhammer1 joined #nim
22:20:18dom96Not really something I would ever use
22:20:23dom96But if it works I guess it's fine.
22:20:34*couven92 joined #nim
22:21:01PMunchNothing wrong with that dom96
22:21:23PMunchA convenience typedef
22:22:25subsetparkYeah, interested whyyou wouldn't use it dom96
22:23:22PMunchHow are scores defined?
22:23:41PMunchAny particular range? If so it might be nice to define a subrange of float for it
22:24:20dom96Well, why is a 'ref' needed?
22:25:47dom96I would either pass 'var Deque' to procs
22:26:01dom96or make the object that contains a Deque as a field a 'ref'
22:26:20dom96That way you don't need to litter your code with `[]` to dereference :)
22:27:00PMunchWell, that's fair
22:27:00*onionhammer1 quit (Ping timeout: 268 seconds)
22:27:25PMunchI thought you just didn't like the idea of having a specific type of Deque :P
22:27:40dom96nope, that's fine.
22:27:51dom96and type aliases are awesome too
22:28:06dom96but I put this in the same boat as defining a 'ref int'
22:28:12dom96It's just weird.
22:29:12PMunchWell, complex data types can take up a bit more memory than a simple int.. Haven't looked at the implementation of a deque in Nim though
22:29:36*Matthias247 quit (Read error: Connection reset by peer)
22:42:03*onionhammer1 joined #nim
22:50:26*onionhammer1 quit (Ping timeout: 268 seconds)
23:01:40*onionhammer1 joined #nim
23:07:23*onionhammer1 quit (Ping timeout: 260 seconds)
23:18:50*nhywyll joined #nim
23:20:41*onionhammer1 joined #nim
23:20:56*nhywyll quit (Client Quit)
23:21:18*nhywyll joined #nim
23:33:16*couven92 quit (Ping timeout: 255 seconds)
23:37:30*onionhammer1 quit (Read error: No route to host)
23:38:19*couven92 joined #nim
23:38:19*couven92 quit (Client Quit)
23:38:42*onionhammer1 joined #nim
23:40:33*oprypin quit (Quit: Bye)
23:41:23*oprypin joined #nim