<< 27-02-2017 >>

00:14:00*Matthias247 quit (Read error: Connection reset by peer)
00:27:03*yglukhov joined #nim
00:27:37Nobabs27can you call proc in a try from within an except statement?
00:27:44Nobabs27call a*
00:29:08ftsf_Nobabs27, what do you expect to happen?
00:29:16ftsf_why are you using try?
00:29:40Nobabs27to handle an exception
00:29:53ftsf_you can't handle it without an except statement
00:29:55Nobabs27I expect the proc to be called and work
00:30:07Nobabs27...I have an except statement...
00:30:18ftsf_sorry... i misread your question =(
00:30:28Nobabs27lol k
00:30:33ftsf_i read within as without =)
00:30:40ftsf_and sure you can
00:30:51Nobabs27...hm then im not sure what my issue is
00:30:56ftsf_(pretty sure you can, i haven't tested it)
00:30:59ftsf_will test now
00:31:06ftsf_what's the issue?
00:31:07Nobabs27it says I cant call it at that line, (acting as though the proc was never defined)
00:31:17*yglukhov quit (Ping timeout: 255 seconds)
00:31:45PMunchAraq, any thoughts on the macro?
00:32:18PMunchI know the % syntax is a bit ugly.. But I'm not sure what else to do
00:32:35ftsf_Nobabs27, works for me. what's your code?
00:33:01AraqPMunch: nothing immediate comes to mind, but I'll come up with something better, no worries
00:33:28Nobabs27sec
00:33:48PMunchHaha, got the equivalent for WxWidgets working now as well
00:33:52Nobabs27except IndexError: evalargs(readLineFromStdin("args pls: "))
00:34:03PMunchBasically the same syntax but with the WxWidgets names instead
00:35:34Nobabs27http://pastebin.com/p88By2qm
00:35:38Nobabs27there full paste
00:37:03ftsf_Nobabs27, don't define the evalargs inside the try block
00:37:23ftsf_put proc evalargs outside try, you can call it in the try
00:37:54Nobabs27k lemme try that
00:39:49Nobabs27kk works thanks, I probably should have thought of that
00:39:53Nobabs27lol
01:02:18*PMunch quit (Quit: leaving)
01:05:48*rauss joined #nim
01:06:59subsetparkWhat's the cleanest way to get a random enum value?
01:07:19subsetparkJust make a list?
01:09:37subsetparki mean, seq...
01:13:10Araqsomething like E(random(E.high.int+1))
01:13:27Araqassuming the E is without holes and starts with 0
01:13:48Araqwhich it does when you have no other annotations
01:14:43subsetparkah, hm! interesting
01:49:49*krux02 quit (Ping timeout: 260 seconds)
01:55:32*zachcarter quit (Quit: zachcarter)
02:20:52ftsf_could you make a proc that takes a generic enum type?
02:21:01ftsf_I suspect it would require a template
02:32:20*chemist69 quit (Ping timeout: 255 seconds)
02:40:58*rauce quit (Ping timeout: 240 seconds)
02:41:16*rauce joined #nim
02:47:37*chemist69 joined #nim
03:29:18*yglukhov joined #nim
03:33:55*yglukhov quit (Ping timeout: 268 seconds)
04:11:34*shashlick quit (Ping timeout: 260 seconds)
04:16:01*shashlick joined #nim
04:30:50def-pri-pubI've been working on the RandomArt applicaiton I made in Nim a while back. I'm brining it up to real-time:
04:30:53def-pri-pubhttps://twitter.com/DefPriPub/status/836070267562704897
04:47:58*ofelas quit (Remote host closed the connection)
04:48:24*ofelas joined #nim
04:49:34*dddddd quit (Remote host closed the connection)
04:56:29*rauss quit (Quit: WeeChat 1.7)
04:57:49*krux02 joined #nim
05:00:36ftsf_def-pri-pub, cool =)
05:01:02ftsf_need to start porting some of my opengl stuff to nim
05:02:03shashlickjust submitted #5444 for a Nim hang in nre
05:08:52*Nobabs27 quit (Remote host closed the connection)
05:31:09*yglukhov joined #nim
05:35:49*yglukhov quit (Ping timeout: 260 seconds)
05:43:41*krux02 quit (Ping timeout: 240 seconds)
05:57:50*djellemah joined #nim
06:02:41*def-pri-pub quit (Quit: leaving)
06:09:59*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
06:15:52libmanMy lil archiver can submit Nim forum URLs to archive.IS just fine (ex. https://archive.is/vOB9K ) but archive.ORG gives "502 Bad Gateway"
06:17:11libmanex: http://web.archive.org/save/https://forum.nim-lang.org/t/671/9 - "Bummer. This url is not available on the live web or can not be archived." Although it is live.
06:22:03libmanWhen I request that page via browser, I get 200 and all is well (according to Chromium dev tools), but `curl -I https://forum.nim-lang.org/t/671/9 `starts with "HTTP/1.1 404 Not Found"
06:26:49libmanThis seems to apply to everything under https://nim-lang.org/
06:29:09*ftsf_ quit (Remote host closed the connection)
06:38:14*nsf joined #nim
07:10:44*yglukhov joined #nim
07:39:13*raiz left #nim ("EOF")
07:39:39*bjz joined #nim
07:48:26shashlickit might be looking at your user agent and ignoring stuff not from a traditional browser
07:48:51shashlicktry curl with -A and your Chrome browser's user agent to see if it works
08:04:58*yglukhov quit (Remote host closed the connection)
08:18:12*yglukhov joined #nim
08:26:13*Vladar joined #nim
08:27:13*Andris_zbx joined #nim
08:28:33*rokups joined #nim
08:29:02*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:37:22*bjz joined #nim
08:41:54libmanI hope that gets fixed, otherwise Nim will be unaccessible to different search engine spiders, etc.
08:43:39*djellemah quit (Disconnected by services)
08:43:42*djellemah_ is now known as djellemah
08:46:06*djellemah_ joined #nim
08:58:42Araqlibman: I have no idea what the problem is
09:01:11*bjz quit (Ping timeout: 240 seconds)
09:02:43*yglukhov quit (Remote host closed the connection)
09:07:28*bjz joined #nim
09:19:03*yglukhov joined #nim
09:33:21*couven92 joined #nim
10:00:12FromGitter<andreaferretti> this may be of interest https://probablydance.com/2017/02/26/i-wrote-the-fastest-hashtable/
10:09:05*tankfeeder joined #nim
10:19:36cheatfatei so like people which called articles like "i made the fastest xxx"
10:19:41cheatfate(sarcasm)
10:20:23cheatfatei think every new hashtable algorithm compares itself to google and boost and do not compare with others "fastest hashtables"...
10:22:36cheatfate"Without reallocation my flat container is the fastest in all benchmarks for large types." i think this must be marked as bold, and placed in title
10:31:39*yglukhov quit (Remote host closed the connection)
10:33:28*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:38:18*yglukhov joined #nim
10:40:27*arnetheduck joined #nim
10:42:53*yglukhov quit (Ping timeout: 260 seconds)
10:47:37*themagician joined #nim
10:50:45AraqI enjoyed the article fwiw
10:56:38*zachcarter joined #nim
11:02:01*yglukhov joined #nim
11:02:52*yglukhov quit (Remote host closed the connection)
11:03:26*yglukhov joined #nim
11:05:28*djellemah_ quit (Ping timeout: 240 seconds)
11:07:14*couven92 quit (Quit: Client disconnecting)
11:07:41*yglukhov quit (Ping timeout: 240 seconds)
11:17:43*yglukhov joined #nim
11:18:32*yglukhov quit (Remote host closed the connection)
11:19:13*tankfeeder quit (Quit: Leaving)
11:35:28*djellemah quit (Ping timeout: 240 seconds)
11:37:22*djellemah joined #nim
11:40:56*libman quit (Quit: Connection closed for inactivity)
11:50:15*Arrrr joined #nim
11:50:15*Arrrr quit (Changing host)
11:50:15*Arrrr joined #nim
11:50:16*djellemah_ joined #nim
11:50:26*djellemah_ quit (Remote host closed the connection)
11:53:09*djellemah_ joined #nim
11:54:05*sz0 joined #nim
11:59:53*Arrrr quit (Ping timeout: 260 seconds)
11:59:59*yglukhov joined #nim
12:02:39*Snircle joined #nim
12:04:28*yglukhov quit (Ping timeout: 240 seconds)
12:09:04*Arrrr joined #nim
12:09:05*Arrrr quit (Changing host)
12:09:05*Arrrr joined #nim
12:44:42*yglukhov joined #nim
12:56:29*gangstacat quit (Ping timeout: 255 seconds)
13:05:58*djellemah_ quit (Ping timeout: 240 seconds)
13:10:25*zachcarter quit (Read error: Connection reset by peer)
13:10:44*zachcarter joined #nim
13:17:11*zachcarter quit (Quit: zachcarter)
13:19:03*yglukhov quit (Remote host closed the connection)
13:19:39*yglukhov joined #nim
13:19:53*gangstacat joined #nim
13:23:45*yglukhov quit (Ping timeout: 240 seconds)
13:31:24*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:35:48*yglukhov joined #nim
13:37:19*byte512 joined #nim
13:49:26*bjz joined #nim
13:54:19*sz0 quit (Quit: Connection closed for inactivity)
13:55:43*jjido joined #nim
14:05:42*zachcarter joined #nim
14:16:08yglukhovAraq: hi, regarding [2/24/17, 10:55:59 AM] Yuriy Glukhov: https://github.com/nim-lang/Nim/issues/5241 . How should sameObjectTypes behave if a is generic instantiation and b is is the generic which a is instantiated from?
14:23:21*Vladar quit (Quit: Leaving)
14:26:38jjidoIt is a covariance question no?
14:33:22*yglukhov quit (Remote host closed the connection)
14:36:17*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:38:01*yglukhov joined #nim
14:40:15yglukhovjjido: err.. not sure..
14:44:10*Arrrr quit (Ping timeout: 240 seconds)
14:55:04*Ven joined #nim
14:59:45*rauss joined #nim
15:04:26Araqyglukhov: not the same objects then
15:05:11Araqbecause an uninstantiated generic object is not an object at all
15:06:01jjidoAraq does nim have no type erasure?
15:06:36Araqonly Java has type erasure
15:07:04jjidoOk
15:07:22jjidoMay be the wrong term
15:08:09jjidoIs the full type always known? You say there can't be an instance of a non-instantiated type
15:10:11yglukhovAraq: ok, so it looks like i need to add another check for isInstanceOfGeneric(t, f) inside the isObjectSubtype loop?
15:11:10yglukhovand isInstanceOfGeneric should somehow account for partial instantiations....
15:11:33yglukhovany hints? =)
15:13:38Araqwhat's a partial instantiation?
15:15:24yglukhovTMatrixNM*[M, N, T] = object; TMatrix2x2*[T] = TMatrixNM[range[0..1], range[0..1], T]
15:16:11yglukhovAraq: e.g. from tests/metatype/tmatrix1.nim
15:17:20yglukhovi kinda implemented a stupid version of isInstanceOfGeneric, which blindly accepts both cases from the tmatrix1.nim test =(
15:17:32yglukhovnow it needs to be more picky
15:46:53*yglukhov quit (Remote host closed the connection)
15:50:46*nsf quit (Quit: WeeChat 1.7)
15:51:14*yglukhov joined #nim
15:54:57*couven92 joined #nim
15:55:35*yglukhov quit (Ping timeout: 255 seconds)
16:04:23zachcarterdom96: for this guide I’m going to write about wrapping C libraries for nim, is there a desired format? Markdown? RST?
16:06:56*Arrrr joined #nim
16:06:56*Arrrr quit (Changing host)
16:06:56*Arrrr joined #nim
16:06:59FromGitter<dom96> zachcarter: hrm, markdown should be nice.
16:07:08zachcarterokay will do
16:08:26*couven92 quit (Quit: Leaving)
16:28:31*BitPuffin joined #nim
16:31:01*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:31:19*Ven joined #nim
16:43:04*Vladar joined #nim
16:47:20*xet7 joined #nim
16:51:10*Andris_zbx quit (Remote host closed the connection)
16:52:12zachcarterdom96: start of the guide : https://gist.github.com/zacharycarter/b238e2e6502f99b4acdfdcd96aec3545
16:55:33*EastByte quit (Ping timeout: 256 seconds)
16:58:35*Ven quit (Ping timeout: 255 seconds)
17:02:41*Ven joined #nim
17:04:30*libman joined #nim
17:10:27federico3zachcarter: you wight want to use the Nim wiki
17:10:55zachcarterfederico3: for what exactly?
17:11:13zachcarterah for posting the guide?
17:11:15federico3yep
17:11:26zachcarterI’m going to leave that up to dom / Araq
17:11:34zachcarterI’m just going to write the guide in MD
17:11:38zachcarterand let them do with it what they wil
17:12:52*AckZ quit ()
17:14:07dom96zachcarter: looks like a good start
17:14:15zachcartercool :)
17:19:54*EastByte joined #nim
17:30:11*yglukhov joined #nim
17:30:58*Trustable joined #nim
17:40:36*nsf joined #nim
17:44:43*Ven quit (Ping timeout: 260 seconds)
17:50:01*yglukhov quit (Remote host closed the connection)
17:54:57*yglukhov joined #nim
18:01:02*Ven joined #nim
18:03:39demi-ok, so using docker to run nim on CI was actually pretty easy
18:05:05*jjido quit (Ping timeout: 240 seconds)
18:06:19zachcarternice :)
18:06:59*Matthias247 joined #nim
18:08:19FromGitter<Varriount> "zachcarter's guide to wrapping arcane C libraries"
18:08:26zachcarter:P
18:13:46*yglukhov quit (Remote host closed the connection)
18:16:23*Ven quit (Read error: Connection reset by peer)
18:16:46*yglukhov joined #nim
18:21:07*Ven joined #nim
18:22:49*surge-protect joined #nim
18:23:59surge-protectcan C APIs be converted into Nim APIs?
18:26:59cheatfatesurge-protect, could you please be more specific
18:30:01*Ven quit (Ping timeout: 260 seconds)
18:31:46surge-protectcheatfate: there are quite a few programs written in C that have C APIs. Eg. LXC/LXD
18:33:22zachcartersurge-protect : converting C to nim is quite a different task than binding to C from nim
18:33:53zachcarterI’m not really sure how to answer your question - you can either call C from Nim or call Nim from C
18:34:15zachcarterconverting an API sounds like re-writing the C code as Nim
18:35:22*couven92 joined #nim
18:35:50surge-protecthow can I call a C API from Nim ?
18:37:58Vladarsurge-protect: https://nim-lang.org/docs/manual.html#foreign-function-interface
18:41:21*Ven joined #nim
18:44:02*Ven_ joined #nim
18:44:28*ofelas quit (Remote host closed the connection)
18:45:40*Ven quit (Ping timeout: 240 seconds)
18:46:16*ofelas joined #nim
18:48:03*yglukhov quit (Remote host closed the connection)
18:49:43zachcarterI’m working on a guide for binding to C code surge-protect
18:50:11surge-protectzachcarter: that is awesome. I look forward to reading it
18:51:34FromGitter<Varriount> surge-protect: And there's also C2Nim https://github.com/nim-lang/c2nim
18:51:46zachcartersurge-projtect: https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f
18:51:54zachcartervery heavily in flux but you can start reading
18:52:59zachcartersurge-protect*
18:54:14zachcarterby the time you get to where I start saying how to wrap soloud I may be done with that section
18:57:29*ofelas quit (Remote host closed the connection)
18:58:01*shashlick quit (Ping timeout: 260 seconds)
18:58:06*ofelas joined #nim
18:59:25*shashlick joined #nim
19:05:06*yglukhov joined #nim
19:09:32*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:14:33*ofelas quit (Read error: Connection reset by peer)
19:15:24*ofelas joined #nim
19:16:31*ofelas quit (Remote host closed the connection)
19:16:45*ofelas joined #nim
19:19:13surge-protectdom96: how do I bind to another IP instead of localhost in jester?
19:19:42dom96https://github.com/dom96/jester/blob/master/tests/alltest.nim#L8
19:30:43*surge-protect quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
19:36:33*surge-protect joined #nim
19:45:45surge-protectdom96: I get a 502 error when running the compiled program from here: https://github.com/dom96/nim-in-action-code/tree/master/Chapter7/Tweeter
19:46:20dom96what's the error?
19:47:25surge-protectdom96: https://www.zerobin.net/?0220a9c192ddd2e6#1RR2tCiA4q0ror9L7jXdkg1iHCGNdAqD//6yGgv+DG4=
19:48:00dom96Did you run createDatabase?
19:48:28*Arrrr quit (Read error: Connection reset by peer)
19:48:33*ofelas quit (Remote host closed the connection)
19:49:03surge-protectnim c createDatabase.nim ? yes, I have run that and have the executable of it
19:49:15*ofelas joined #nim
19:49:48dom96did you run the executable?
19:50:55*libman quit (Quit: Connection closed for inactivity)
19:51:57surge-protectI have now. interesting that it required 2 steps. is there a way to merge them into 1?
19:52:41demi-`--run`
19:56:10*Nobabs27 joined #nim
19:59:37*bjz joined #nim
20:01:36*Ven joined #nim
20:09:14federico3I'm creating a channel that should be used by 2 threads only. It works when it's defined as a global variable but not when I use an object attribute. Any hint?
20:10:18*surge-protect quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:10:57*elrood joined #nim
20:11:47dom96in what way is it not working?
20:12:15federico3the two threads appear not to be using the chan - specifically, the reader is finding it empty
20:12:17*rokups quit (Quit: Connection closed for inactivity)
20:12:55*zachcarter quit (Ping timeout: 268 seconds)
20:13:38Araqchannels are value based, you copy them around and stuff breaks
20:16:18federico3what's the clean solution? a global table of channels where each writer-reader pair [hopefully] look up the right channel?
20:17:44AraqI use channels as globals.
20:17:57Araqmuch easier to reason about
20:18:10Araqyou can also pass 'ptr Channel' around, but meh
20:18:58AraqI know many wrap the cannel in a ptr and use allocShared0 to create it. I don't see any advantages in doing so.
20:19:37federico3Araq: by passing the ptr around instead of using a global I'm creating a new, dedicated, channel for each writer-reader pair
20:20:24AraqI usually have a fixed amount of threads, not a dynamic number of them.
20:20:39federico3I see - thanks
20:21:26Araqotherwise 'spawn' is pretty effective too, no channels, just spawn a proc and get back a result.
20:23:06Araqbut that is not popular, most people are spoiled by concurrency when all they need is parallelism
20:34:35*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:55:06*yglukhov quit (Remote host closed the connection)
20:57:19*bjz joined #nim
21:02:16*elrood quit (Quit: Leaving)
21:02:56*zachcarter joined #nim
21:09:59*zachcarter quit (Ping timeout: 264 seconds)
21:11:29*zachcarter joined #nim
21:17:36*Calinou quit (Ping timeout: 240 seconds)
21:25:31*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:26:56*Calinou joined #nim
21:42:24*Calinou quit (Quit: No Ping reply in 180 seconds.)
21:46:24*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:46:33*Calinou joined #nim
21:47:04*BitPuffin quit (Read error: Connection reset by peer)
21:48:06*surge-protect joined #nim
21:50:23*Trustable quit (Remote host closed the connection)
21:57:04*Calinou quit (Remote host closed the connection)
22:00:59*surge-protect quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:11:37*Calinou joined #nim
22:17:17*Calinou quit (Ping timeout: 260 seconds)
22:22:13*rauss quit (Quit: WeeChat 1.7)
22:28:46*Calinou joined #nim
22:40:44*Kingsquee joined #nim
22:47:29*nsf quit (Quit: WeeChat 1.7)
22:47:49*Calinou quit (Remote host closed the connection)
23:04:15*Calinou joined #nim
23:12:41*Calinou quit (Quit: No Ping reply in 180 seconds.)
23:12:46zachcarterIf anyone has a windows or linux machine and would like to contribute to a guide I’m writing about wrapping libraries with nim, I could use some help (note I’d request you install and build a few libraries and then write up some instructions on doing so for me)
23:15:14*Calinou joined #nim
23:19:32*ftsf_ joined #nim
23:25:59*couven92 quit (Quit: Client Disconnecting)
23:26:33*arnetheduck quit (Ping timeout: 260 seconds)
23:32:47federico3fastest way to count newlines in a largish file? memfile.lines is going to copy stuff around
23:33:07federico3and memfiles don't seem to be accessible by index
23:38:02AraqreadBuffer call and manual iteration over the buffer
23:39:44ftsf_if speed is really important you could parallelise it
23:39:53*Calinou quit (Quit: No Ping reply in 180 seconds.)
23:41:17ftsf_basically do equivalent to `parallel --pipe --block <blocksize> grep \n < bigfile`
23:43:13*Calinou joined #nim
23:44:31*libman joined #nim