<< 26-08-2018 >>

00:04:19FromGitter<bung87> `E: daemon: a package by that name already exists.` when I create a PR to nim packages, should I rename my file names or just change the name in package.json?
01:05:58FromGitter<gogolxdong> You won't believe how different our nginx configuration it is with all others I have seen to make it work with frontend, my students worked it out. Proud of them!
01:07:27FromGitter<gogolxdong> and backend, because of a trailing /cmpprotocol
01:11:39FromGitter<gogolxdong> like there is 1/14000605 odds to get the only way.
01:12:19*abm quit (Quit: Leaving)
01:19:44*leorize joined #nim
01:20:37*tyler569 joined #nim
01:27:33*zachk quit (Quit: Leaving)
01:44:28*randojoe joined #nim
02:07:32*dddddd quit (Remote host closed the connection)
02:24:31*sz0 joined #nim
03:00:13*SenasOzys quit (Remote host closed the connection)
03:00:34*SenasOzys joined #nim
03:04:06*kapil___ joined #nim
03:30:15FromGitter<jots_twitter> How can we unpack seq in nim? like: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ would like tt to be "a" and rr to be "b" [https://gitter.im/nim-lang/Nim?at=5b821ec6e5b40332abfc55c0]
04:33:15*sz0 quit (Quit: Connection closed for inactivity)
04:38:58FromGitter<kaushalmodi> `var (rr, tt, _) = "a b c".split()`
04:47:48*randojoe quit (Ping timeout: 252 seconds)
04:49:02FromGitter<jots_twitter> ```var (rr, tt, _) = "a b c".split() ⏎ Error: 'tuple' expected``` [https://gitter.im/nim-lang/Nim?at=5b82313de5b40332abfca92f]
04:54:08FromGitter<rayman22201> iirc that kind of unpacking isn't supported in Nim. That syntax is from python correct?
04:54:51FromGitter<jots_twitter> i'm coming from ruby, but maybe python too?
04:57:24FromGitter<rayman22201> It's been discussed but araq and the core devs aren't fans. That being said, macros let you do anything lol.
04:58:44FromGitter<kayabaNerve> Seq to tuple?.🤔
04:59:31FromGitter<rayman22201> I think it might be easier to just split the string and assign each part one at a time.
05:01:48FromGitter<rayman22201> Seq to tuple will do extra unnecessary allocation
05:07:29FromGitter<kaushalmodi> sorry, typed from "bad" memory
05:07:46FromGitter<kaushalmodi> and hasty reading
05:26:05FromGitter<jots_twitter> no prob. looks like it can't work without macro, so reading about macros...
05:34:24FromGitter<timotheecour> `Seq to tuple` is impossible unless the seq is known at CT, because tuple length is known at CT
05:41:24FromDiscord_<emekoi> is there a way to extern a proc?
05:50:33*nsf joined #nim
06:08:22FromGitter<timotheecour> u mean exportc ?
06:12:59*nsf quit (Quit: WeeChat 2.2)
06:26:52*Trustable joined #nim
06:40:45*skrylar quit (Remote host closed the connection)
07:13:09*kapil___ quit (Quit: Connection closed for inactivity)
07:18:59*Trustable quit (Remote host closed the connection)
08:03:52*gmpreussner_ joined #nim
08:04:33*gmpreussner quit (Ping timeout: 252 seconds)
08:13:23*ttess joined #nim
08:26:18*zachcarter quit (Ping timeout: 264 seconds)
08:32:11FromGitter<tim-st> tuple unpacking doesnt work with `const`? `const (rr, tt, _) = (1,2,3)` but `var (rr, tt, _) = (1,2,3)` works
08:33:15FromGitter<tim-st> I think this should work too: `let (rr, tt, _) = [1,2,3]`
08:34:26FromGitter<mratsim> @timotheecour you can use `proc foo(x: int{call})` to match an int that results from a proc. Not sure it can match a template
08:34:45FromGitter<mratsim> useful to fuse ops.
08:35:30*ttess quit (Ping timeout: 252 seconds)
08:35:39FromGitter<mratsim> @tim-st you can hack your way with `var foo {.compileTime.}` maybe
08:37:07FromGitter<tim-st> @jots_twitter I think tuple unpacking could work for `seq` too, because it's known at compile time it's known what types are inside the seq and which size is needed. The only thing which is unknown is, if the seq has enough elements, and if not it could generate default types at runtime, so tuple unpacking for `var seq` could work for var unacked types and `const seq` for all;
08:37:39FromGitter<tim-st> @mratsim ok, thanks, I dont use tuple unpacking just tried the example above to see if it works consistent
08:54:33*stefanos82 joined #nim
09:12:41*dfgg13 joined #nim
09:14:11*dfgg13 quit (Remote host closed the connection)
09:16:54*krux02 joined #nim
09:18:50*SenasOzys quit (Ping timeout: 272 seconds)
09:21:21*kapil___ joined #nim
09:26:44*Vladar joined #nim
09:59:13*zachcarter joined #nim
10:11:33*nsf joined #nim
10:24:31*gb00s joined #nim
10:40:48*SenasOzys joined #nim
10:42:10*SenasOzys quit (Remote host closed the connection)
10:42:33*SenasOzys joined #nim
10:53:42*dorelix joined #nim
10:54:43*SenasOzys quit (Remote host closed the connection)
10:56:28*SenasOzys joined #nim
10:57:11*SenasOzys quit (Remote host closed the connection)
10:57:36*SenasOzys joined #nim
11:08:48*SenasOzys quit (Remote host closed the connection)
11:11:11*SenasOzys joined #nim
11:13:25*dorelix quit (Remote host closed the connection)
11:21:33*dddddd joined #nim
11:24:23*wildlander quit (Quit: Konversation terminated!)
11:33:58*SenasOzys quit (Remote host closed the connection)
11:35:32*SenasOzys joined #nim
11:38:16*SenasOzys quit (Remote host closed the connection)
11:41:10*SenasOzys joined #nim
11:49:26*kobi7 joined #nim
11:50:20*kapil___ quit (Quit: Connection closed for inactivity)
11:59:57*kobi7 quit (Ping timeout: 252 seconds)
12:02:42*kobi7 joined #nim
12:46:07*kobi7 quit (Remote host closed the connection)
13:05:26*dorelix joined #nim
13:11:23FromGitter<mratsim> Disco is broken on Gitter
14:16:02*stefanos82 quit (Quit: Quitting for now...)
14:21:28*nepeckman joined #nim
14:43:10*Jesin quit (Quit: Leaving)
14:56:45ehmryhow do I force C++ compilation? I updated to the latest devel and now I seem to be back in C mode
14:57:42FromGitter<Vindaar> just call `nim cpp` instead of `nim c`. Or am I misunderstanding you?
14:59:09ehmryI'm calling `nimble cpp` but I see "Commandline for C compiler:" in my generated sources
14:59:33ehmryI guess I need to back up from devel
15:00:45FromGitter<Vindaar> I never use nimble to call the nim compiler, so no clue what's going on there
15:01:10leorizecheck the nimcache
15:01:20leorizeif it have cpp files, then it's C++ :P
15:01:30krux02Vindaar: when I am correct, nimble is like nim, but it sets the paths more constrainde to the project definitons.
15:02:11leorizeehmry: or you could set the `backend` variable to cpp https://github.com/nim-lang/nimble#optional
15:18:04FromGitter<Vindaar> ehmry: just fyi I just updated both nimble and nim to latest devel and `nimble cpp` says and does produce C++
15:18:32FromGitter<Vindaar> @krux02: just took a short glance at the code, and yes that seems to be what it's doing :)
15:19:31ehmryVindaar, yep I get the same
15:23:38ehmryI'm doing too much wacky cross-compiling stuff here, thats why I'm having problems
15:25:48*nepeckman quit (Ping timeout: 252 seconds)
15:27:01ehmryyea, setting the backend in .nimble and using the 'build' rather than 'cpp' command fixes this
15:37:14FromGitter<Araq> is that a Nimble regression?
15:38:44ehmryidk, now I see c in nimcache instead of cpp again
15:40:02*edcragg quit (Quit: ZNC - http://znc.in)
15:40:05FromGitter<Araq> https://github.com/nim-lang/Nim/issues/8781 nice one to get you started into Nim compiler development
15:40:25*edcragg joined #nim
15:47:56*craigger quit (Quit: bye)
15:53:27ehmryarrggg, I was copying an external nimcache into my build directory from a script, ignore me
16:06:47*craigger joined #nim
16:57:18*zachcarter quit (Quit: Lost terminal)
16:58:18*zachcarter joined #nim
16:58:57*zachcarter quit (Client Quit)
17:05:44*zachcarter joined #nim
17:05:55*zachcarter quit (Client Quit)
17:08:31*zachcarter joined #nim
17:09:14zachcarterhoping this irc connection is working now
17:09:39zachcarteryay! I see my mesage in irc logs! :D
17:09:48zachcarterI finally figured out how to use channels + shared heap :D - https://gist.github.com/zacharycarter/240ffb2269c988ebe069e67e6c679e73
17:15:00*elrood joined #nim
17:17:55FromGitter<Vindaar> @Araq if you're still around, what do you propose as a fix for #8781? I'm just poking around. Checking for 'U' suffix in `ccgtypes.mangleField` and appending another works, but is probably not the idea here :D
17:24:40*Trustable joined #nim
17:52:22FromGitter<Quelklef> Is there a baked-in way to tersely instantiate a variant type?
17:53:45FromGitter<ephja> @Quelklef no, but have a look at this library https://github.com/andreaferretti/patty
17:54:20FromGitter<Quelklef> ooh this is cool
17:54:55FromGitter<Quelklef> oh this is fantastic
17:54:56FromGitter<Quelklef> thank you
17:55:08FromGitter<Quelklef> and thank you @andreaferretti
17:55:52FromGitter<ephja> np. yeah it's pretty great
17:59:49FromGitter<bung87> looks very useful
18:09:42FromGitter<Araq> @Vindaar the name mangling ensures that no '_' is kept, so the fix should be to replace the 'U' with '_U'
18:10:41FromGitter<Vindaar> oh, that's easy :) will create the PR. What's the meaning of the 'U' in the first place though?
18:12:15FromGitter<Araq> "stuff we need for the Union"
18:12:27FromGitter<Araq> it has no meaning really
18:17:28FromDiscord_<emekoi> timotheecour, no i mean get nim to generate code with an extern, like`extern void foo()`
18:18:00FromGitter<Vindaar> ah, I see! done
18:28:15FromGitter<ephja> compile-time XML schema construction would be nice
18:40:50*kapil___ joined #nim
19:02:44*nsf quit (Quit: WeeChat 2.2)
19:44:31*hendi joined #nim
19:47:18FromGitter<tim-st> Should this match?
19:47:27FromGitter<tim-st> ```proc test123(a = 123, b = "123") = discard ⏎ test123("cba")``` [https://gitter.im/nim-lang/Nim?at=5b8303cff86b741b05c81b58]
19:47:36FromGitter<Araq> no.
19:51:12FromGitter<tim-st> hm, but this one should? https://github.com/nim-lang/Nim/issues/8683#issuecomment-416064637
19:53:43FromGitter<tim-st> ok, it's basically the same, but then the latest changes to default parameters dont really help
19:54:19FromGitter<Araq> it's really not hard, you cannot skip parameters with default values unless they are at the end or the ambiguity is resolved by using named arguments
19:54:36FromGitter<Araq> pretty much the same as in Python, C#, ...
19:56:04FromGitter<tim-st> ok, I understand, thanks
20:05:53zachcarterdoes every thread get its own dispatcher?
20:06:07zachcarterin other words - if I create a future in thread A can I read it in the main thread later?
20:10:25*jdc_ joined #nim
20:14:51dom96zachcarter: You can't
20:17:58*jdc_ quit (Quit: Page closed)
20:27:24*elrood quit (Quit: Leaving)
20:49:07*Vladar quit (Remote host closed the connection)
20:55:34dom96zachcarter: What are you working on?
21:08:11zachcarterdom96: I need to make several thousand http requests for work - this is the first Nim code I'm writing for work so I want to do a good job.
21:08:40zachcarterI'm not sure what the best pattern is - I want to limit the number of concurrent requests - but I also want to use all the CPUs I can for dispatching them - if that makes sense
21:08:42dom96several thousand per second?
21:08:45zachcarterno
21:08:49zachcarterjust several thousand in total
21:08:59zachcarterlike 44 thousand right now for this month
21:09:28dom96I would try the "naive" way first then
21:09:36dom96It may be fast enough
21:09:49*kapil___ quit (Quit: Connection closed for inactivity)
21:10:16zachcarterokay -
21:15:45dom96To be clear, that means: use a single thread and create multiple AsyncHttpClients
21:16:51zachcarteryeah - Im just not sure of exactly how to limit the number of requests I'm creating pers econd atm
21:17:41zachcarterI guess I could use a semaphore?
21:18:00zachcarterwell that doesn't make sense for a single thread
21:18:08dom96why limit it?
21:18:14dom96just run as fast as you can
21:19:17zachcarterI'm worried about the web server I'm issuing the requests to
21:20:33zachcarteroh - I understand I think
21:21:18dom96Is it a server that has logic which would ban a client from requesting too fast?
21:21:22zachcartersince I'll be awaiting all the futures that are returned - the http server will just process them as fast as it can
21:21:56zachcarterwell it does sit behind a f5 that has rules to rate limit - but I'm not sure if the payload I'm sending is high enough to trigger that
21:22:05zachcarterI guess I'll give it a shot and see what happens
21:24:41FromDiscord_<emekoi> is there a way to use a template with arguments to genrate an inline asm statement that uses that uses the arguments?
21:25:46*couven92 quit (Read error: Connection reset by peer)
21:26:06FromGitter<Quelklef> you don't need a template
21:26:10FromGitter<Quelklef> @emekoi https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
21:26:21FromGitter<Quelklef> Use backticks to interpolate nim values
21:26:49*zachcart1r joined #nim
21:27:13FromDiscord_<emekoi> i know but the asm i'm generating is really repetive and i need 32 instances of it so i thought using templates would be easier.
21:27:33*zachcarter quit (Ping timeout: 252 seconds)
21:27:35*couven92 joined #nim
21:27:36FromGitter<Quelklef> Oh, hm
21:27:40FromGitter<Quelklef> Use a macro is my bet
21:27:50FromGitter<Quelklef> but I don't quite understand your situation so I'm not sure that'd work
21:29:17FromDiscord_<emekoi> here's the code https://github.com/emekoi/nimkernel/blob/master/src/kernel/descriptor/interupts.nim
21:30:37FromGitter<Quelklef> Yeah, I'd use a macro
21:32:17FromGitter<Quelklef> some macro `generateFunctions` which accepts a list of two-tuples
21:32:41FromGitter<Quelklef> where the tuples describe the data: `isErrCode` or `isNoErrCode`, and `Interrupt.X`
21:36:23FromDiscord_<emekoi> that's a good idea
21:38:02dom96ooh a proper kernel in Nim :O
21:49:01*Trustable quit (Remote host closed the connection)
21:49:25FromDiscord_<emekoi> i wouldn't say proper...
22:18:18*flyx quit (Quit: ZNC - http://znc.in)
22:18:35*flyx joined #nim
22:25:01FromDiscord_<emekoi> can you call proc that exist at compile time but not runtime?
22:45:09FromGitter<Quelklef> ...?
22:45:25FromGitter<Quelklef> you mean `{.compileTime.}` procs?
22:45:28FromGitter<Quelklef> you can call them at compile time
22:49:43FromDiscord_<emekoi> no, i don't have an allocator yet so i can't create new strings so things like substr don't work; however the macros module needs substr to work.
23:38:30*krux02 quit (Remote host closed the connection)
23:46:58*ftsf joined #nim
23:49:45*smitop joined #nim
23:49:53*smitop left #nim (#nim)
23:55:59*abm joined #nim