00:12:00 | eeproks | Anyone 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:47 | Araq | eeproks: 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:11 | Araq | eeproks: openBSD's GCC version doesn't support the atomics that Nim requires though, update your GCC |
07:38:13 | * | irrequietus quit () |
07:40:54 | tankfeeder | eeproks, 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:26 | euantor | I'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:59 | Trioxin | if 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:06 | dom96 | Then 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:24 | PMunch | Not if we don't tell anyone |
11:02:27 | * | Snircle joined #nim |
11:03:23 | * | vld joined #nim |
11:13:32 | flyx | more likely the users would soon be dead because just not feeling exhausted does not mean your body does not need any rest. |
11:15:19 | PMunch | and not feel like complete crap |
11:15:30 | PMunch | Dead is pretty crap |
11:15:41 | flyx | you don't feel anything when you're dead |
11:19:03 | PMunch | Haha, fair point |
11:25:36 | Arrrr | That sounds heretical |
11:29:24 | flyx | well, what doesn't in some belief system |
11:45:41 | FromGitter | <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:22 | FromGitter | <TiberiumN> Currently I'm starting them via asyncCheck |
11:47:31 | * | Vladar joined #nim |
12:15:19 | * | Vi- joined #nim |
12:39:09 | PMunch | TiberiumN, 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:26 | FromGitter | <TiberiumN> @PMunch can you give any examples? |
12:51:32 | PMunch | Of a pool? |
12:52:11 | PMunch | https://nim-lang.org/docs/threadpool.html |
12:53:58 | PMunch | Or my own, generic pool implementation: http://ix.io/xVE |
12:56:33 | FromGitter | <TiberiumN> Hmm, how can I use it with async? |
12:59:10 | PMunch | Since you're using asyncCheck I assume you don't care about the return value of the invocations? |
13:01:00 | FromGitter | <TiberiumN> Yes |
13:01:16 | * | tankfeeder left #nim ("Leaving") |
13:02:51 | PMunch | In that case you could probably just use a guarded couter |
13:02:54 | PMunch | *counter |
13:05:31 | * | yglukhov joined #nim |
13:05:45 | PMunch | The 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:31 | PMunch | But 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:04 | FromGitter | <TiberiumN> I'm sending many HTTP requests |
13:10:01 | PMunch | To a single IP, to different IPs? What does one "job" consist of? |
13:10:15 | FromGitter | <TiberiumN> singe IP, singe URL, different POST bodies |
13:10:28 | FromGitter | <TiberiumN> Just send Http post request with some JSON data, and check status code of the response |
13:10:34 | FromGitter | <TiberiumN> if it's 200 - echo response body |
13:10:41 | PMunch | Okay |
13:13:08 | PMunch | So create a structure of your bodies |
13:13:27 | PMunch | Well, create one of these: https://nim-lang.org/docs/deques.html |
13:13:55 | PMunch | Mark it with {.guard: postlock.} |
13:14:14 | PMunch | Then 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:26 | PMunch | The atomicRead one |
13:14:46 | PMunch | But with a postBodyQueue.popFirst() for example |
13:15:57 | PMunch | Then write your thread proc which basically is a loop of sending statements and queue reads |
13:16:03 | PMunch | And start 50 of these threads |
13:16:26 | FromGitter | <TiberiumN> So I will need to have 50 http clients? |
13:17:00 | PMunch | Uhm, yes I think so |
13:17:13 | PMunch | Haven't really used the HTTP stuff at this level |
13:17:51 | PMunch | And I'm not sure if you get any benefit from doing it this way compared to just hammering out requests with asyncdispatch.. |
13:17:55 | PMunch | Probably not though |
13:18:11 | PMunch | You know what |
13:18:36 | FromGitter | <TiberiumN> thanks anyway |
13:19:11 | PMunch | But if you want to run 50 concurrent dispatches you could start a single asyncdispatch |
13:19:35 | PMunch | Then start 50, each with a callback of "pop an element from the queue and start a new one". |
13:19:43 | PMunch | That way only 50 would be running at a time |
13:24:00 | * | Vladar quit (Remote host closed the connection) |
13:31:40 | FromGitter | <TiberiumN> Hmm, even with async if I try to use one http client for all requested - it throws an error "invalid headers" |
13:31:50 | FromGitter | <TiberiumN> and using ~50 asynchttp clients costs in 170mb ram |
13:32:22 | PMunch | Nono, you use 1 asynchttp client. Then start 50 request, each with a callback to start a new one. |
13:32:46 | FromGitter | <TiberiumN> ah |
13:33:44 | dom96 | To start 50 concurrent requests you need 50 http clients |
13:34:26 | PMunch | Isn't there an async version? |
13:34:32 | dom96 | there is |
13:34:43 | dom96 | TiberiumN: Why do you want 50 concurrent requests? |
13:34:55 | PMunch | But it can't run asynchronous requests? |
13:35:14 | dom96 | ? |
13:35:19 | FromGitter | <TiberiumN> I mean I have a C# program which can send ~150 requests in one second |
13:35:22 | FromGitter | <TiberiumN> it's using threads |
13:35:26 | FromGitter | <TiberiumN> and some third-party http lib |
13:35:36 | dom96 | You can't send concurrent requests over a single socket |
13:36:03 | dom96 | You can't send "GET / HTTP/1.1" and "GET /blah HTTP/1.1" and expect two responses. |
13:36:22 | dom96 | A single http client is a single socket |
13:36:37 | PMunch | Ah, I misunderstood what the asynchttp thing did |
13:36:47 | PMunch | I thought it opened multiple sockets |
13:36:52 | dom96 | I dunno, maybe it should do some magic like that. |
13:37:55 | PMunch | Would be nifty |
13:40:19 | * | PMunch quit (Quit: leaving) |
13:42:56 | couven92 | dom96, 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:15 | couven92 | We 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:28 | couven92 | (after each other of course) |
13:45:09 | subsetpark | Seems like a pretty natural extension of a thread pool |
13:45:23 | couven92 | it is |
13:50:14 | * | yglukhov quit (Remote host closed the connection) |
13:58:03 | euantor | In 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:23 | euantor | And it's advised to create 1 single HTTP client and use it for many (concurrent) requests |
13:58:32 | euantor | https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ |
13:59:22 | euantor | It 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:14 | subsetpark | dom96: 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:44 | dom96 | subsetpark: alright |
14:15:51 | * | NotSpooky joined #nim |
14:18:07 | * | aerx joined #nim |
14:29:16 | * | sakalli joined #nim |
14:45:14 | dom96 | Can 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:47 | Araq | dom96: yes, we're slowly following C++'s footsteps |
15:12:09 | Araq | it'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:55 | shmup | does choosenim win only install i386 versions? |
15:44:01 | shmup | s/versions/builds |
15:46:56 | euantor | Yes, at the minute: https://github.com/dom96/choosenim/issues/16 |
15:48:30 | shmup | thanks 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:02 | rain1 | hello |
18:01:15 | rain1 | could 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:24 | Araq | rain1: compiler/ccgexprs.nim and others |
18:15:25 | salewski | proc main(x: string) = |
18:15:32 | salewski | GC_ref(x) |
18:15:38 | salewski | main("compiles fine but crashes") |
18:15:48 | salewski | Is that intended? |
18:17:21 | * | yglukhov quit (Remote host closed the connection) |
18:22:17 | Araq | yes |
18:22:23 | Araq | it is as you say |
18:22:34 | Araq | string literals are not on the heap |
18:23:00 | salewski | OK, thanks. |
18:24:18 | demi- | 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:45 | subsetpark | Araq: in that case, when would it ever make sense to GC_ref something not on the heap? |
18:27:12 | salewski | Yes, I think I can catch that with something like "when compiles(x = x; GC_ref(x))" |
18:27:38 | salewski | That 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:21 | subsetpark | So - 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:18 | dom96 | subsetpark: Would love to! |
21:55:34 | subsetpark | https://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:20 | subsetpark | BTW dom96 do you have access to comment on that pull request? I've never tried to do that before |
22:16:47 | dom96 | hrm, I think so |
22:17:01 | subsetpark | neato. |
22:17:06 | subsetpark | thanks for the look! |
22:18:23 | * | onionhammer1 quit (Ping timeout: 260 seconds) |
22:19:33 | dom96 | sorry, seems like I won't be able to finish the review. |
22:19:53 | dom96 | One thing that stood out to me is 'TabuQueue*[T] = ref Deque[Tabu[T]]' |
22:20:05 | * | onionhammer1 joined #nim |
22:20:18 | dom96 | Not really something I would ever use |
22:20:23 | dom96 | But if it works I guess it's fine. |
22:20:34 | * | couven92 joined #nim |
22:21:01 | PMunch | Nothing wrong with that dom96 |
22:21:23 | PMunch | A convenience typedef |
22:22:25 | subsetpark | Yeah, interested whyyou wouldn't use it dom96 |
22:23:22 | PMunch | How are scores defined? |
22:23:41 | PMunch | Any particular range? If so it might be nice to define a subrange of float for it |
22:24:20 | dom96 | Well, why is a 'ref' needed? |
22:25:47 | dom96 | I would either pass 'var Deque' to procs |
22:26:01 | dom96 | or make the object that contains a Deque as a field a 'ref' |
22:26:20 | dom96 | That way you don't need to litter your code with `[]` to dereference :) |
22:27:00 | PMunch | Well, that's fair |
22:27:00 | * | onionhammer1 quit (Ping timeout: 268 seconds) |
22:27:25 | PMunch | I thought you just didn't like the idea of having a specific type of Deque :P |
22:27:40 | dom96 | nope, that's fine. |
22:27:51 | dom96 | and type aliases are awesome too |
22:28:06 | dom96 | but I put this in the same boat as defining a 'ref int' |
22:28:12 | dom96 | It's just weird. |
22:29:12 | PMunch | Well, 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 |