<< 21-05-2018 >>

00:05:32*CodeVance quit (Read error: Connection reset by peer)
00:10:59PMunchHi, data-man
00:11:11PMunchDid you see my PR in the parsetoml repo?
00:14:44FromDiscord<Aearnus> Holy crap, I just saw how my discord message was formatted in the Gitter. That's _awful_ -- does Gitter not support multiline messages?
00:14:49FromDiscord<Aearnus> Also I won't do that again haha
00:15:08PMunchYeah, not looking too good over here on IRC either
00:15:27PMunchI think the issue is that the gitter bot grabs it's input from IRC
00:16:05PMunchThe gitter bot automatically creates a paste of multiline could though
00:16:09FromGitter<data-man> @PMunch: Hello! Not yet. Feel free to merge. :)
00:16:33PMunchdata-man, it's not quite merge-ready. Just wanted to see if it was something we wanted to have for TOML
00:16:44PMunchBasically makes TOML as easy to work with as JSON
00:18:39FromGitter<data-man> I don't use TOML yet, so I cann't say anything.
00:22:20*NimBot joined #nim
00:27:57*gokr quit (Ping timeout: 240 seconds)
00:31:49PMunchHmm, can I have a generic type with a static array of a size given at compile-time?
00:39:52*Pisuke joined #nim
00:39:59FromGitter<data-man> @PMunch: It's nice additions! I propose ```%t``` instead of ```%*```. ⏎ Maybe ```%j``` for json and ```%y``` for NimYAML. :)
00:41:09*MyMind quit (Ping timeout: 264 seconds)
00:41:42PMunchIs that even possible?
00:41:51PMunchI think they have to be an operator
00:42:31FromGitter<data-man> Why isn't possible?
00:44:10PMunchhttps://nim-lang.org/docs/manual.html#lexical-analysis-operators
00:44:22PMunchOtherwise you would need to call it with `%t`:
00:57:44FromGitter<data-man> My bad :( ⏎ !echo import macros; macro `toml`*(x: untyped): untyped = newCall(bindSym"echo", x); toml @[123]
00:58:32FromGitter<data-man> !eval import macros; macro toml*(x: untyped): untyped = newCall(bindSym"echo", x); toml @[123]
00:58:33NimBotCompile failed: in.nim(1, 58) Error: expression 'newCall(bindSymecho, [x])' is of type 'NimNode' and has to be discarded
01:00:01PMunchhmm, yeah I guess with command syntax it could work
01:00:11PMunchNot entirely sure if you can pass blocks like that though..
01:00:21FromGitter<data-man> Huh, locally it's works. Silly NimBot. :)
01:04:34*cavariux joined #nim
01:06:36FromGitter<data-man> @PMunch: So will you move your parsing-repos to a new address? ;)
01:07:37*cavariux quit (Client Quit)
01:07:57PMunchNot before I know what the purpose of the org is :P
01:08:10PMunchIs it all parsers, or parser for specific formats
01:08:23FromGitter<kayabaNerve> The purpose of my org is buying an island
01:08:38FromGitter<kayabaNerve> I want an island. Plain and simple
01:10:02*cavariux joined #nim
01:10:30*cavariux quit (Client Quit)
01:10:45*cavariux joined #nim
01:13:18*cavariux quit (Client Quit)
01:13:31*cavariux joined #nim
01:13:56FromGitter<data-man> @PMunch: Just created https://github.com/flyx/NimYAML/issues/57
01:26:46*leorize joined #nim
01:37:52FromGitter<Varriount> Aernus: There's an options module
01:38:24FromGitter<Varriount> For other needs, you normally just use object variants
01:45:22FromDiscord<Aearnus> Varriount: I use options quite a bit
01:46:04FromDiscord<Aearnus> but what do you mean by object variants?
01:46:56FromDiscord<Aearnus> either way, `Either` gives you free monadic definitions & it allows higher level abstractions
01:47:13FromDiscord<citycide> your `Either` actually is an object variant already
01:57:49FromGitter<arnetheduck> @Aearnus @Varriount @citycide https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim or what I started playing around with, https://github.com/arnetheduck/nim-result/pull/1
02:00:36*PMunch quit (Quit: leaving)
02:04:21*skrzyp quit (Ping timeout: 240 seconds)
02:05:23FromDiscord<Aearnus> ah! I didn't know that those type level case statements were object variants
02:05:42*skrzyp joined #nim
02:06:28FromDiscord<Aearnus> hmm, I guess that Nim just has language level support for `Either`-ish types
02:06:52FromDiscord<Aearnus> that's pretty cool, if not bizarre
02:14:23*rockcavera joined #nim
02:23:20FromGitter<arnetheduck> bizarre / cool? it's not exactly a new thing: https://en.wikipedia.org/wiki/Tagged_union
02:33:12FromDiscord<Aearnus> https://hastebin.com/alekiloxuc.rb ?
02:33:19FromDiscord<Aearnus> that's a bit of a strange error
02:33:32FromDiscord<Aearnus> i gave it the perms it needed
02:33:42FromDiscord<Aearnus> eh, maybe I messed up and clicked the wrong perms
02:35:44FromGitter<Varriount> @zacharycarter Just got signed URL queries working. That will help with S3 integration.
02:37:37FromGitter<Varriount> gogolxdong: ^
02:39:02FromDiscord<Aearnus> Do I need to make a git repo for my package before I nimble publish?
02:39:35FromGitter<Varriount> Yes. Nimble uses git (and possibly mercurial)
02:39:48FromGitter<Varriount> Though, you might be able to install locally from a path.
02:41:49FromGitter<Varriount> @arnetheduck `import ... boost.types'`?!
02:43:47FromGitter<arnetheduck> @Varriount https://github.com/vegansk/nimboost
02:44:04FromGitter<Varriount> What heresy is this. O_O
02:44:19FromGitter<Varriount> Oh, it's not the C++ boost. Good
02:52:01*dddddd quit (Remote host closed the connection)
03:06:25FromGitter<gogolxdong> @Varriount Good to know, and have you fixed the cmp implementation?
03:07:29FromGitter<gogolxdong> Will you use other services except EC2 and S3?
03:08:24FromGitter<gogolxdong> We have difficulties in issuing Price List service requests.
03:12:52*endragor joined #nim
03:16:14FromGitter<Varriount> The cmp implementation is fixed, I just need to upload the changes.
03:18:09FromGitter<Varriount> @gogolxdong Regarding the price list API, I don't see what is stopping you from using it.
03:19:33FromGitter<Varriount> The test client code assumes a certain URI format, which doesn't work with the pricing API, but that is why it is test code - it's meant to serve as an example.
03:44:19*endragor_ joined #nim
03:46:52*endrago__ joined #nim
03:47:10*endragor quit (Ping timeout: 252 seconds)
03:48:45FromDiscord<awr> anyone familiar with the nim-mode plugin for emacs
03:48:52FromDiscord<awr> how do i turn off the auto-indent on paste
03:49:27*endragor_ quit (Ping timeout: 240 seconds)
03:49:33FromDiscord<awr> disabling electric-indent-mode does nothing
03:53:35*smt` is now known as smt
03:57:48FromDiscord<awr> fixed it, it was a spacemacs problem. fixed by adding ` (add-to-list 'spacemacs-indent-sensitive-modes 'nim-mode)` to user-config
04:09:59FromDiscord<citycide> y'all want a pure `glob` library 😉 https://github.com/citycide/glob
04:17:11*cavariux quit (Quit: WeeChat 2.1)
04:20:35FromDiscord<Aearnus> Aw hell yeah
04:23:35FromGitter<Varriount> citycide: Does the 'glob' function require filesystem access?
04:24:07FromGitter<Varriount> Or can this be used as a general string matching library?
04:34:32FromDiscord<citycide> the `regexer` submodule parses globs into regexes which can be used without the filesystem
04:35:27FromDiscord<citycide> https://citycide.github.io/glob/glob/regexer.html
04:36:40FromDiscord<citycide> that's the raw proc, the main middle re-exports it though and has some wrapper functions
04:36:52FromDiscord<citycide> Main module*
04:43:33FromDiscord<citycide> bottom line is, if you just do `"foo.nim".matches("*.nim")` there's no I/O. Only when you use `walkGlob` or `listGlob`
04:46:54FromDiscord<Aearnus> Ooh, purity
04:49:31FromGitter<Varriount> citycide: Nice!
04:49:43*leorize quit (Quit: WeeChat 2.1)
04:49:59FromGitter<Varriount> I've had a few occasions where I needed glob-style matching, but wasn't working with files.
04:51:28FromDiscord<Aearnus> Why not just use a regex in a situation like that?
04:51:45FromDiscord<citycide> globs are much nicer imo
04:52:00FromDiscord<citycide> for file matching anyway
04:55:16FromGitter<data-man> @citycide: Thanks! ⏎ Also see https://github.com/nim-lang/Nim/pull/7836 :)
05:01:11FromGitter<data-man> Maybe use pegs instead of regex (optional)? For remove dependency.
05:04:31FromDiscord<citycide> @data-man I thought about it but I don't have much experience with pegs. that would probably be cool to add though
05:06:54*nsf joined #nim
05:07:06FromGitter<data-man> Or even to use scanf (compile-only patterns) :-D
05:09:46FromGitter<data-man> *compile-time
05:20:33*gokr joined #nim
05:25:50FromDiscord<Aearnus> yeah, I can't get nimble publish to work
05:26:15FromDiscord<Aearnus> what perms does it need? does it require you to have previously forked packages?
05:31:27FromGitter<Varriount> Is it giving you an error?
05:31:43*seabee joined #nim
05:33:46FromDiscord<Aearnus> Varriount: yeah
05:33:53FromDiscord<Aearnus> no matter what I change, it still gives me that same error
05:35:17FromDiscord<Aearnus> ah
05:35:35FromDiscord<Aearnus> I have to use a keypair with github to use nimble publish
05:35:38FromDiscord<Aearnus> that's... a pain
05:36:05FromGitter<Varriount> Do you use some other hosting service?
05:36:31FromDiscord<Aearnus> no, no, it just never told me I had to do that
05:36:39FromDiscord<Aearnus> it never even hinted at it
05:36:48FromDiscord<Aearnus> in the instructions, at least
05:37:38FromGitter<Varriount> Likely a documentation oversight.
05:37:51FromDiscord<Aearnus> ¯\_(ツ)_/¯
05:40:46FromGitter<Varriount> You could put up a pull request with that note
05:40:54FromGitter<Varriount> Or an issue at least
05:41:49*seabee quit (Quit: leaving)
05:47:24FromDiscord<Aearnus> https://github.com/nim-lang/nimble/pull/494
05:48:47*leorize joined #nim
05:50:33FromGitter<Varriount> Aearnus: Thanks!
05:51:02*SenasOzys quit (Ping timeout: 256 seconds)
05:56:52*leorize quit (Ping timeout: 245 seconds)
05:58:22FromGitter<Varriount> Aearnus: By the way, you might be interested in this: https://gist.github.com/Varriount/9f7e140cc34850a898256f731a4094c2
06:01:59FromDiscord<Aearnus> i am indeed
06:02:13FromDiscord<Aearnus> ya learn more every day. thanks!
06:15:55FromDiscord<Aearnus> there, I published my little library. that's the first thing i've published onto any sort of repos
06:19:35*leorize joined #nim
06:26:35*leorize quit (Quit: WeeChat 2.1)
06:29:05*xkapastel quit (Quit: Connection closed for inactivity)
06:35:22*uran[m] joined #nim
06:40:48*uran[m] is now known as uran[m]1
06:41:03*uran[m]1 is now known as yglukhov1
06:41:49*yglukhov quit ()
06:42:03*yglukhov[i] joined #nim
06:42:13*yglukhov1 is now known as yglukhov
06:44:14*yglukhov[i] quit (Client Quit)
07:51:09AraqIMO Nimble should search github too automatically
07:51:34Araq'nimble publish' is often forgotten :P
07:51:46FromDiscord<Aearnus> hey, what does the `interface` keyword do?
07:52:00Araqnothing, it's reserved for the future
07:52:28FromDiscord<Aearnus> ah, got it
07:52:50FromDiscord<Aearnus> is the `constraint` keyword mature enough to use in real code?
07:53:13Araqthere is no such keyword, do you mean 'concept'?
07:53:23FromDiscord<Aearnus> er, yeah
07:53:23FromDiscord<Aearnus> sorryu
07:54:13Araqwell, expect concept to land into .experimental
07:54:28Araqbut sure, you can use it.
07:54:47Araqits syntax will likely change, but the feature itself will remain
07:57:20FromDiscord<Aearnus> alright, thanks!
07:59:41*CodeVance joined #nim
08:02:50*Vladar joined #nim
08:03:13FromDiscord<Aearnus> how do you specify that a certain type follows a concept at compile time?
08:03:41Araqstatic: doAssert Foo is MyConcept ?
08:04:53*gmpreussner quit (Ping timeout: 256 seconds)
08:05:38*gmpreussner joined #nim
08:06:51FromDiscord<Aearnus> so is there no way to do it within the type specification itself? like haskell has the `instance` declarations and all that
08:07:32Araqwe don't bind procs to types so we can't check it at the type declaration site ;-)
08:08:32Araqalso, usually the point is that types match implicitly, so that you don't have to edit system to proclaim system.array matches your Iterable concept
08:09:22FromDiscord<Aearnus> that makes sense. does the compiler detect when a non-concept-matching type gets passed to a function that takes a certain concept?
08:10:15Araqsure, what else would be the point of concept...
08:10:40FromDiscord<Aearnus> I was just afraid of runtime errors ¯\_(ツ)_/¯
08:11:19FromDiscord<Aearnus> I think I got this all figured out now though. thanks a ton!
08:48:48FromGitter<data-man> @Araq: checking for sideEffects can't be disabled? Something like --sideEffectChecks:off This would be useful for debugging.
08:49:08Araquse debugEcho instead of echo
08:49:25FromGitter<data-man> Great! Thanks!
08:56:43*sz0 quit (Quit: Connection closed for inactivity)
09:05:58*mrshu2 is now known as mrshu
09:08:40*FuntDobra joined #nim
09:15:13*skrylar joined #nim
09:21:44FromGitter<mratsim> @Aearnus: if you want Haskell Instances in Nim here you go: https://github.com/nigredo-tori/classy
09:27:49*Vladar quit (Quit: Leaving)
09:31:04FromDiscord<Aearnus> mratsim: noted
09:31:22FromDiscord<Aearnus> i was reading through some of that lib's example code though and i saw this line: `proc fmap[A, B](fa: Option[A], g: A -> B): Option[B] =`
09:31:46FromDiscord<Aearnus> is that `A -> B` standard syntax? or is it part of some macro they wrote or something
09:32:19*Vladar joined #nim
09:37:00skrylarmratsim: do you have an issue on your arch box where -lOpenCL doesn't seem to exist even with the drivers installed?
09:38:02FromGitter<ephja> so the exe trying to load libui.dll gives me this: "could not load: libui.dll" and process monitor shows this: "main.exe QueryOpen ...\libui.dll SUCCESS"
09:40:12*FuntDobra quit (Ping timeout: 245 seconds)
09:41:06FromGitter<ephja> but it's opening, memory mapping and closing the same path twice (with success) and then it proceeds to look for the dll in other locations
09:41:50*xkapastel joined #nim
09:42:37FromGitter<ephja> well I'm gonna try it with loadLib directly
09:46:40FromGitter<mratsim> @skrylar, trying
09:46:52*ARCADIVS quit (Ping timeout: 245 seconds)
09:49:07*ARCADIVS joined #nim
09:50:45FromGitter<mratsim> I have some openblas linking issue :/ I upgraded my whole datascience stack last weekend.
09:50:53*FuntDobra joined #nim
09:52:19*Trustable joined #nim
09:53:04FromGitter<mratsim> OpenCL is working fine for me
09:54:11cremI'm writing app, which at the same time: waits for input from stdin, waits for input from subprocess'es stdout, waits http request to complite, waits for timer. dom96 pointed to this https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39 code, but how exactly would it be best to work?. spawn evertyhing in subtread and do a busy wait of all thread's isReady()?
09:55:11skrylarweird. i wonder why i don't have an opencl lib
09:55:43dom96crem: I would do it like this: use thread only for stdin, use async for the rest on the main thread. cheatfate has a package which has an 'asyncproc' module that you can use
09:59:12FromGitter<ephja> SDL2.dll can be loaded so now I'm trying hard to detect system call differences :p
09:59:30cremOk, went to read about async. :) Read it many times, also for C++ and javascript, but somehow doesn't stick to my mind if I don't use it.
10:01:18FromDiscord<Aearnus> wait a second -- I have a type defined as `Money = ref object of GameResource` but the operator `proc `$`(x: GameResource): string` refuses to take it
10:01:30FromDiscord<Aearnus> what's going on here?
10:04:36FromDiscord<Aearnus> Damn, I have to use a concept as well don't I. I thought I could get away with plain inheretence
10:08:13dom96crem: feel free to ask questions
10:14:02skrylarah its the ocl-icd package
10:24:14FromGitter<ephja> might there be issues with vs 15 dll's? I'm gonna try it with an earlier version
10:30:03CodeVanceAearnus. Check how system module does it
10:32:46FromGitter<mratsim> @Aernus the -> operator and => comes from the sugar module in stdlib (previously future)
10:32:53FromGitter<mratsim> @Aearnus*
10:33:49FromGitter<mratsim> @Aearnus you don’t need concept.
10:34:41FromGitter<mratsim> is your GameResource a ref object? Everything must be ref for inheritance, do you have a short snippet? It hsould work.
10:44:15*ARCADIVS quit (Quit: WeeChat 2.0.1)
10:44:40cremIf await blocks until data is ready, why not just call the proc synchronously?..
10:45:10cremIs it possible to await several things whatever finishes first?..
10:47:24dom96await blocks *the current async procedure*
10:47:27cremAlso, here: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39 if line 37 is not blocking, how is it guaranteed that connect() finishes before socket.send() starts?..
10:47:29dom96it doesn't block your whole program
10:48:11dom96Indeed, there is no guarantee
10:48:22cremBut I thought my mainloop should be async procedure if it calls await. And for me that means that it blocks main loop.
10:48:52dom96That's a known bug in this code sadly. But it's unlikely to come up in practice, unless you start sending messages really fast
10:49:52cremIt may take long to create connection. Especially if connect resolves DNS names inside, but even if it doesn't, one packet lost and there is 1 second delay.
10:50:57dom96Yes, it may. It's an oversight that failed to catch before publishing my book.
10:51:09dom96*that I
10:51:57cremBut that's fine, I still don't understand how can I use await to spawn "wait for input from stdin", "wait for input from subprocess" and "wait for http request to be ready" and process whatever finishes first in a main loop..
10:52:32cremplus timeout. :)
10:53:48cremI can understand how to use three spawns though.. With busywait. But is there "wait for multiple flowvar" proc?
10:53:57cremawaitAny, see it
10:54:12dom96You should only have one spawn though
10:54:17dom96Busywait on it
10:54:25dom96and use futures + await/async for the rest
10:55:01cremI should use spawn for "read from stdin", right?..
10:55:41cremFor "read from subprocess" (also line by line).. await?.
10:55:58cremBut to do that, main loop should be .async. too, right?..
10:56:19cremUh, that modern multithreading confusing.
10:56:22cremis
10:57:59cremBook says async returns Future[T], while docs say await accepts FlowVarBase. But book also mentioned FlowVar[T] somewhere too..
10:58:23cremWhat's the difference between Future[T] and FlowVar[T]?
10:59:52FromGitter<abijahm> @crem FlowVar[T] is for spawned procedure in a thread and Future[T] is for async procedures
11:00:14cremAnd you await both?
11:00:51dom96That's really needlessly confusing
11:01:05dom96threadpool shouldn't have a 'await' unless it works just like the async await *sigh*
11:01:40dom96'await' in an async procedure accepts futures
11:01:46dom96don't use the threadpool await
11:01:49dom96it will block your program
11:01:51cremAwait (for async) is not a proc but a keyword? Docs only show await in threadpool module.
11:02:35dom96yes
11:03:17dom96I'm going to make a PR now to change the name of this 'await'
11:03:52*Snircle joined #nim
11:05:59*xet7 joined #nim
11:06:45cremis there any doc about async/await? I do have a book, but i'd like a more formal description
11:07:02cremhttps://nim-lang.org/docs/manual.html has nothhing..
11:07:06dom96https://nim-lang.org/docs/asyncdispatch.html
11:07:33cremthanks
11:08:50cremshould be probably more discoverable
11:14:20dom96agreed
11:19:16cremBook says "await keyword can only be used inside procedures marked with {. async .} pragma". Is it so? I'd think this pragma is needed for functions which are called with "await" but not for the calling function.
11:19:46dom96it is so
11:20:21cremHmm...
11:20:22dom96'await' is transformed to a 'yield'
11:20:27dom96You can't have a yield inside a procedure
11:20:40dom96You need a coroutine (closure iterator in Nim) and that is what the 'async' macro creates
11:20:48dom96btw I added a note here: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L37
11:20:50dom96Hope it helps
11:21:11cremIt also forces function to return Future[T]. If I need a function that does async magic inside but then return normal result, what do I do?
11:22:23*athenot joined #nim
11:23:13Araqcall: waitFor theAsyncProc()
11:25:32dom96That's true, that's another solution. I should add that to my post.
11:25:33cremIf proc f() returns Future[] anyway, what's the difrerence between var x = f() and var x = await f()? First one will just run it synchronously?
11:27:02Araq'await' means "stop execution and come back later"
11:27:17Araqthen the result is wrapped into another Future for you.
11:27:18cremMaybe "await" word is what adds confusion. It feels that it means wait, i.e. it will block. But instead it means "launch asyncronously and not wait".
11:27:24cremSo await does block?
11:27:31Araqit blocks your "task"
11:27:33*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:27:34dom96it blocks *the current async proc*
11:27:58Araqit doesn't block your program, but your asyncronous task/proc
11:28:12cremit does block, ok...
11:28:13Araqbecause you declared "halt! wait for this result first, can't work without out"
11:28:27cremWhat I need it to wait for whatever returns first.
11:28:50Araqthat's the `or` operator or awaitAny
11:30:03cremBut dom96 said that awaitAny is about threadpool/FlowVar and is nothing to do with async/Future. (as far as I understood)
11:30:46Araqjust the 'or' operator then
11:31:32cremAnd how can I get the resulting value? (resulting return Future[] are of different types).
11:32:13FromGitter<xmonader> I'm happy! a colleague at work decided to do nim days in rust and that's his first day project https://github.com/andrewayoub/dmidecoder
11:32:46cremHm, it seems that async is pretty useless for my case. Will do good old manual thread management.
11:32:54cremOr I don't understand it.
11:33:13Araq'or' takes 2 futures and returns a future that is completed if A *or* B is completed
11:33:26Araqwhich is exactly what you were asking for, no?
11:33:35Araqyou can 'await' the 'or'
11:34:00cremYes, but I need to use the resulting value and know from where it came.
11:34:27Araqyou can copy&adapt the stdlib's or. I have done that in the past too.
11:34:47Araqit's a very interesting piece of code.
11:36:02cremI need that to be done by today's evening.. Probably makes sense to do in C++ instead. Maybe more lines of code but at least I know what to do.
11:39:03Araqproc `or`*[T, Y](fut1: Future[T], fut2: Future[Y]): Future[void] =
11:39:03Araq ## Returns a future which will complete once either ``fut1`` or ``fut2``
11:39:03Araq ## complete.
11:39:03Araq var retFuture = newFuture[void]("asyncdispatch.`or`")
11:39:03Araq proc cb[X](fut: Future[X]) =
11:39:04Araq if fut.failed: retFuture.fail(fut.error)
11:39:06Araq if not retFuture.finished: retFuture.complete()
11:39:08Araq fut1.callback = cb[T]
11:39:10Araq fut2.callback = cb[Y]
11:39:14Araq return retFuture
11:42:59*Vladar quit (Quit: Leaving)
11:44:24cremYeah, using threads with callbacks would probably be a way to go.
11:44:43*athenot joined #nim
11:47:03dom96what? Adapt or?
11:47:17dom96var fut1 = futProc(); var fut2 = futProc2(); await fut1 or fut2
11:47:29dom96if fut1.finished: ...; if fut2.finished: ...;
11:51:30crembook says that I cannot stdin.readLine in async procedure. Can I myproc.outputStream.readLine() in async proc?
11:54:11enthus1astcrem it got a reasonable performant async readline working with a thread (which readlines) and a asynctools/asyncpipe (which delivers the readline result to the main)
11:54:25dom96...no. That's why you use 'spawn' for the stdin.readLine
11:54:46enthus1astthe spawn readline is very slow
11:54:52enthus1astat least for me
11:55:23dom96what are you using it for?
11:55:47cremme?
11:55:55dom96if it's interactivity for your process then I don't see why it would be slow
11:55:56dom96no
11:56:19Araqdom96, oh good point, forgot about the 'finished' accessor that indeed can just be used
11:56:21Araqmy bad.
12:04:02enthus1astdom96: i've build a small shell in it, it was working but the response was way to slow.
12:05:13dom96poll timeout too low? :)
12:05:22dom96in the long run we need 'await' to work with FlowVar
12:05:27dom96plz Araq
12:06:49enthus1astasyncdispatch.poll()?
12:07:00dom96or I should say "too high"
12:07:24dom96yes, if you call it like that then you will get 500ms
12:07:58enthus1astdom96: can you explain what this timeout really means? :)
12:08:15dom96when you call `poll` it waits for events for the timeout you specify
12:08:48dom96so your spawned flowvar will only be checked every 500ms at worst
12:09:45enthus1astmhh let me check if it gets better with a smaller timeout
12:11:59enthus1astyeah ok, the flowvar way is also fast :)
12:16:52*CodeVance quit (Read error: Connection reset by peer)
12:29:16*PMunch joined #nim
12:38:52cremSo if I cannot do myproc.outputStream.readLine() in async.. how can I wait for two Future[]s and two FlowVar[]s at the same time?
12:39:00cremsigh...
12:41:27cremWhat does await/async offer extra/simplify relative to threadPool+spawn?
12:42:05dom96Why do you need two FlowVars?
12:43:05dom96`spawn` won't let you spawn an unlimited amount of threads (it's bound to the number of cores IIRC)
12:43:06cremTo read from stdin (for user input), and to read from subprocess'es stdout (subprocess periodically updates it's status).
12:43:14dom96but if you're more comfortable with threads then just use them
12:43:37cremI'd like to use async, but just it doesn't seem to support my use case.
12:43:42*Vladar joined #nim
12:44:39crem"user input" is actually waiting user to press 'q' to quit, It's getch() rather than reading stdin. Maybe that's supported in async?
12:46:24*fvs joined #nim
12:46:28dom96nope
12:46:41*Sembei joined #nim
12:47:22*SenasOzys joined #nim
12:47:39*Pisuke quit (Ping timeout: 260 seconds)
12:50:50cremIt does look like overkill to spawn process to read one char, but there's no other way. Even threadPool turned out not to be an option, as it's not guaranteed to run 5 threads in parallel.
12:51:19crems/process/thread
12:51:58cremgoroutines could do that easily :-)
12:57:12Araqsure, whatever, my servers usually don't read from stdin though
13:02:32FromGitter<Varriount> crem: Instead of a process, what about a thread + channel?
13:02:43dom96spawn process?
13:02:46dom96oh
13:03:07dom96Spawn can do that easily too
13:03:23dom96There is a highly commented example that shows exactly how to do it
13:03:28dom96I'm not sure what else I can offer
13:03:47FromGitter<Varriount> dom96: Where is the example?
13:04:19dom96https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim
13:06:11FromGitter<Varriount> Doesn't
13:06:55FromGitter<Varriount> That won't work for long running tasks though...
13:06:57cremIt's not server. It's a client for lczero. Which runs subprocess, which does all the work, and when subprocess has data ready to send to server, subprocess issues "dataready <filename>" into it's stdout, and code has to upload that. Meanwhile it also shows dashboard with stats, and listens for user to press 'q'. That's it.
13:09:00FromGitter<Varriount> The Windows API thread pool has this problem too. It was solved by adding a "spawn long running task" procedure.
13:09:06cremdom96: but you said that spawn doesn't guarantee to start execution, instead it can just enqueue it.
13:09:17cremSo threadpool/spawn doesn't work.
13:09:21cremfor my case.
13:09:43dom96Yes, if you spawn more than `x` threads
13:09:44cremFor async IO, threadpools should not be used, they are for computation.
13:09:45dom96but you won't
13:09:48dom96You only need one or two
13:10:18dom96You only really need one if you use cheatfate's asynctools package like I suggested
13:10:21cremthat's fragile. Will it work on single core machine? Is main thread counted?
13:10:49dom96Good question
13:12:06cremit seems that async is really for IO, but it doesn't support IO ops like reading from stdin or subprocess.
13:12:38dom96it supports the latter outside the stdlib
13:13:18Araqour lack of knowledge does not make it "fragile"
13:13:33*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:13:36dom96looking at the docs for threadpool it looks like it spawns up to MaxThreadPoolSize, depending on what you set: https://nim-lang.org/docs/threadpool.html#setMaxPoolSize,range[]
13:13:43dom96Araq: Is that correct?
13:13:50Araqwhy wouldn't it work on a single core machine.
13:15:21Araqdom96, sure, also, work is on-going to make 'spawn' guaranteed non-blocking
13:15:25Araqwhatever that means.
13:15:45dom96yeah, yglukhov is working on that IIRC
13:16:18*athenot joined #nim
13:19:42shashlickaraq, dom96: csources has build.sh which does arch detection, but separate build.bat and build64.bat for Windows which doesn't do arch detection
13:20:02shashlickdo you think it is possible to enhance the batch file to do this detection or is .bat too dumb to pull it off
13:20:15*gokr quit (Ping timeout: 245 seconds)
13:20:16*FuntDobra quit (Ping timeout: 252 seconds)
13:21:06*FuntDobra joined #nim
13:21:38Araqno idea. seems easy enough to do
13:22:42dom96It shouldn't be done though
13:22:50dom96Windows users should have the choice
13:23:38*leorize joined #nim
13:23:41shashlickso on linux you cannot have 32-bit gcc on a 64-bit OS?
13:24:21dom9632-bit is practically nonexistent AFAIK
13:25:44skrylar32-bit can be done on linux although many distros have dumped or relegated such things
13:26:19leorizeis there any reason why StringStream is not available for the js backend?
13:26:20shashlickokay, so i'm not a fan of finish or choosenim installing a C compiler but given that's in place, there should be a flag to specify arch on install
13:26:55skrylarleorize, can't do pointer magic on js
13:27:58skrylari get the impression stringstream is not so much a string builder analogue as it is for testing streams or composing packets, so it probably doesn't have edge cases for JS backends?
13:29:20leorizemost of the parsers within the stdlib depends on StringStream, so they can't be used with js :(
13:35:11shashlickdom96: what OS is choosenim supported on
13:35:44Yardanicoall major ones
13:36:06Yardanicowindows/macos/linux
13:36:30shashlickokay how do you detect os arch in nim
13:37:10Yardanicoos? well, when you compile your binaries you know which OS is the target
13:37:15Yardanicoand about architecture - same
13:44:06Calinouin the GamingOnLinux survey of last year, 32-bit Linux was used by 3 respondents out of 2,300+
14:02:27*SenasOzys quit (Ping timeout: 240 seconds)
14:03:33*SenasOzys joined #nim
14:03:53*leorize quit (Ping timeout: 260 seconds)
14:06:29FromGitter<qqtop> Just today installed Nim devel on an Samsung N150 32 bit with parrotOs linux on it and compiled some stuff, works great .
14:08:26*FuntDobra quit (Ping timeout: 268 seconds)
14:13:24*SenasOzys quit (Ping timeout: 260 seconds)
14:14:38*SenasOzys joined #nim
14:16:49*BitPuffin joined #nim
14:17:36*leorize joined #nim
14:18:27*PMunch quit (Quit: leaving)
14:20:47FromGitter<zetashift> @Calinou, don't know if that survey targeted gamers, but gamers in general don't mess with 32bit nowdays
14:24:05shashlickYardanico: if you distribute app as source, you have to know at compile time what OS it is, how do you find out
14:24:39Yardanicowell, you can write os-specific code via when defined(windows) or when defined(linux)
14:25:14shashlickyep :D
14:27:16*Vladar quit (Quit: Leaving)
14:33:38*dddddd joined #nim
14:38:32*Vladar joined #nim
14:41:01FromGitter<data-man> Oh, http://manning.com "This site can’t be reached manning.com refused to connect" for me. :( Opened through Tor.
14:42:11FromGitter<zetashift> I guess manning doesn't accept tor as a client?
14:43:07FromGitter<data-man> Sorry. Can't be opened without Tor.
14:45:25shashlickis build.bat for csources generated by niminst
14:45:58FromGitter<zetashift> @data-man weird works fine for me here
14:46:26FromGitter<data-man> It's written in it comments :)
14:47:42FromGitter<data-man> @zetashift: From what country? :)
14:48:08FromGitter<zetashift> The Netherlands
14:49:18*endrago__ quit (Remote host closed the connection)
14:52:02FromGitter<data-man> Well, if Manning blocks Russian IP addresses then it's sadly.
14:52:48*endragor joined #nim
14:55:50federico3data-man: just change circuit
14:57:26*endragor quit (Ping timeout: 252 seconds)
14:58:59shashlickaraq: is build.bat for csources still generated from niminst? I see changes in build.sh in csources not in niminst build.sh template
15:00:02*CodeVance joined #nim
15:00:58FromGitter<data-man> @federico3: Thanks. But I'm a novice *nix user, and don't know how to do this and I'm sorry to waste time for this. So I'm just use Tor. :)
15:01:52federico3data-man: ctrl+shift+L in tor browser
15:02:11federico3look at the menu on the onion button
15:04:46Araqshashlick: yeah it is still generated
15:05:15*endragor joined #nim
15:08:16FromGitter<data-man> @federico3: Doesn't work in Opera. Never mind, sorry for noise.
15:09:25*endragor quit (Ping timeout: 245 seconds)
15:13:49shashlickaraq: I don't see this in the build.sh template https://github.com/nim-lang/csources/blame/da97f857af6f85990c4677a30f889b9184e38568/build.sh#L176
15:18:29Araqmy buildsh.tmpl contains logic for 'android'
15:18:47Araqnote that niminst is in the compiler, the nimble package is not used for it
15:19:20shashlickI don't see it here: https://github.com/nim-lang/niminst/blob/master/buildsh.tmpl
15:19:21*leorize quit (Quit: WeeChat 2.1)
15:19:47shashlickoh okay, a sec
15:20:28shashlickmight be worth deleting this niminst repo if it is unused
15:20:54shashlickor even a note stating its new location
15:28:43*gokr joined #nim
15:38:22*Trustable quit (Remote host closed the connection)
15:48:02shashlickis it possible to compile csources with vc++?
15:48:18*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:51:27*gokr quit (Ping timeout: 245 seconds)
15:55:34*nsf quit (Quit: WeeChat 2.1)
15:57:20*gokr joined #nim
15:57:26AraqI doubt it...
16:13:58*FuntDobra joined #nim
16:17:00*athenot joined #nim
16:28:12*sz0 joined #nim
16:29:02shashlickaraq: I remember you mentioned gcc -dumpmachine isn't reliable - I just want to know if gcc is 32-bit or 64-bit version, is -dumpmachine not good enough for that?
16:29:28*FuntDobra quit (Ping timeout: 252 seconds)
16:29:30shashlicklooking to detect gcc in build.bat, nim isn't compiled yet
16:37:31Araqwell you read finish.nim's source code so I don't understand why you ask.
16:37:52Araqto detect the architecture reliably, do what finish.nim does
16:41:44*FuntDobra joined #nim
16:51:53*gokr quit (Quit: Leaving.)
16:52:04*gokr joined #nim
16:57:37*arecaceae quit (Remote host closed the connection)
16:58:01*arecaceae joined #nim
17:01:13*gokr quit (Ping timeout: 260 seconds)
17:18:58*skrylar quit (Remote host closed the connection)
17:19:20*FuntDobra quit (Ping timeout: 252 seconds)
17:29:20*yglukhov[i] joined #nim
17:29:33*yglukhov[i] quit (Client Quit)
17:29:54*yglukhov[i] joined #nim
17:30:36*yglukhov[i] quit (Client Quit)
17:43:15shashlickaraq: there's a bug in stdtmpl
17:43:33shashlickif you have a single line with just ) in it, that gets omitted from the output
17:43:35*athenot quit (Ping timeout: 245 seconds)
17:45:41*athenot joined #nim
17:46:01shashlickdata-man: unsure if this broke when you pushed https://github.com/nim-lang/Nim/commit/27631b1112bb10e4a7ca43b611c2d3bde2ba320f
17:46:38shashlickif you do koch csource, the generated build.bat is missing ) if it is the only char on the line, so generated bat file doesn't work
17:46:44shashlickjust tested on win and lin
17:46:55*FuntDobra joined #nim
17:47:34*Ven`` joined #nim
17:49:22*heitzmann quit (Quit: WeeChat 2.1)
17:51:30*FuntDobra quit (Ping timeout: 245 seconds)
17:52:12*Ven` joined #nim
17:52:17*Ven`` quit (Read error: Connection reset by peer)
17:55:25*Vladar quit (Quit: Leaving)
17:58:02*elrood joined #nim
18:06:38*max3 joined #nim
18:15:57*yglukhov[i] joined #nim
18:16:27*SenasOzys quit (Ping timeout: 245 seconds)
18:19:16shashlickaraq: I've gotten build.bat working to build with correct arch, are we good with deleting build64.bat or should I create a dummy that simply calls build.bat, or should I force 64-bit build
18:22:48shashlickI think creating dummy build64.bat with "call build.bat" is the best thing to do
18:28:54*gmpreussner quit (Ping timeout: 260 seconds)
18:30:00*gmpreussner joined #nim
18:32:05AraqI think there should be build.bat for auto detection
18:32:26Araqand build32.bat and build64.bat for the explicit archs
18:33:14shashlickso just assume that user knows what he's doing when he calls buildXX.bat?
18:41:43Araqyeah...
18:41:54shashlickok so opened new issue: https://github.com/nim-lang/Nim/issues/7855
18:44:07FromGitter<data-man> @Araq: Let's merge it, as is? #7836 ⏎ @shashlick: It's new candidate for you :) (for nimscript )
18:45:31FromGitter<genotrance> nice
18:52:55*nsf joined #nim
18:58:40*Ven` quit (Read error: Connection reset by peer)
18:59:00*Ven`` joined #nim
19:05:31*PMunch joined #nim
19:11:06*SenasOzys joined #nim
19:12:31*nsf quit (Quit: WeeChat 2.1)
19:15:15*yglukhov[i] quit (Ping timeout: 245 seconds)
19:16:05*SenasOzys quit (Ping timeout: 260 seconds)
19:22:44PMunchHmm, should I report the compileTime thing?
19:23:33*yglukhov[i] joined #nim
19:29:34FromGitter<data-man> @PMunch: what's wrong?
19:31:48PMunchI was trying to do the "completely unscientific benchmark" on compile-time, only echoing at runtime.
19:31:49PMunchhttp://ix.io/1aZJ
19:31:53PMunchThat's the code I've got
19:32:10PMunchIt runs both with and without the {.compileTime.} pragma, but returns different answers
19:32:29Araqwell a smaller test program is welcome
19:32:33Araqin the bug report
19:32:46PMunchYeah that's part of the problem. I have no idea what could go wrong..
19:37:45*dkncgtik6mr0 quit (Quit: WeeChat 2.1)
19:41:11FromGitter<data-man> @PMunch: Good that you are here. validator can't parse all examples from toml-lang. :(
19:41:32PMunchReally?
19:42:37FromGitter<data-man> Yeah. I pushed new validator. We can add tests from toml-lang.
19:44:39PMunchA new one?
19:44:46PMunchWhat was wrong with the old one?
19:46:04FromGitter<data-man> Nothing. I added more convenient version. :)
19:46:32PMunchAnd what is failing now?
19:49:51*xkapastel quit (Quit: Connection closed for inactivity)
19:50:27FromGitter<data-man> example-v0.3.0.toml - unknown escape sequence "\T" ⏎ example-v0.4.0.toml - unknown escape sequence "\T" ⏎ example.toml - passed ⏎ fruit.toml - passed ⏎ hard_example.toml - passed ... [https://gitter.im/nim-lang/Nim?at=5b0323035a1d895fae5a0a35]
19:50:50PMunchWhere are those from?
19:51:38PMunchI've validated against all these tests: https://github.com/BurntSushi/toml-test
19:52:31*Trustable joined #nim
19:52:33FromGitter<data-man> https://github.com/toml-lang/toml
19:52:56PMunchI found that one here by the way: https://github.com/toml-lang/toml/wiki#language-agnostic-test-suite-for-toml-decoders-and-encoders
19:53:13PMunchOh, it's just all the examples on that page?
19:53:58*FuntDobra joined #nim
19:54:40FromGitter<data-man> https://github.com/toml-lang/toml/tree/master/exampleshttps://github.com/toml-lang/toml/tree/master/tests
19:56:47shashlickaraq: https://github.com/nim-lang/Nim/pull/7856
19:58:48shashlickdata-man: not sure if your recent change in filters broke this - https://github.com/nim-lang/Nim/issues/7855
20:02:45*FuntDobra quit (Ping timeout: 245 seconds)
20:03:05FromGitter<data-man> @shashlick: check on 0.18 please
20:06:19shashlicki'm on #head
20:06:26shashlickoh you mean release
20:06:36FromGitter<data-man> Yes
20:08:02FromGitter<data-man> If I broke it, I'll not fall asleep today. :)
20:08:47shashlick:)
20:10:07FromGitter<kayabaNerve> @data-man Can't break code if you don't write any
20:12:05*gokr joined #nim
20:12:06shashlickworks on 0.17.2 and 0.18.0
20:12:43FromGitter<data-man> :(
20:14:58FromGitter<kayabaNerve> I never write any code
20:15:37FromGitter<kayabaNerve> All my recent questions have been about code my computer randomly generated
20:15:45FromGitter<kayabaNerve> No wonder it needed me to ask questions
20:17:15Araqshashlick: smart solution, I like it
20:17:45shashlickawesome
20:17:49shashlickguess where I got it :P
20:18:35FromGitter<alehander42> As a
20:18:59shashlickdata-man: tried on #head from 5/08 and that failed too
20:24:11*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:25:49*FuntDobra joined #nim
20:26:43FromGitter<data-man> :) BTW self-assigned
20:29:46FromGitter<data-man> Thanks for check!
20:30:22shashlickI think I have a guess
20:30:42shashlickhttps://github.com/nim-lang/Nim/pull/7763/commits/91e54e18f5abac2707b1e9e40e1eff7a46412cbb#diff-542c6941dcdbb1b75c8f3f0b4dd3d4acR68
20:30:42*nsf joined #nim
20:30:55shashlicklen-1 == 0 means 1 char
20:31:38*BitPuffin quit (Remote host closed the connection)
20:31:59*elrood quit (Quit: Leaving)
20:38:14*nsf quit (Quit: WeeChat 2.1)
20:42:34FromGitter<data-man> Sure, fixed. Thanks again!
20:44:01shashlickawesome
20:50:04shashlickverified
20:51:08FromGitter<data-man> I checked before commit. :)
20:51:40*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:52:14shashlicknift
20:54:04FromGitter<data-man> This? :) https://nift.ac.in
20:54:53shashlickaraq: can we check in the updated bat files into csources? I understand we cannot impact older releases but at least any new git clones of csources (and choosenim) will get the newer batch files
20:55:45shashlicki can then continue to fix stuff from your choosenim wishlist
21:02:06FromGitter<kayabaNerve> @mratsim Update on NUInt the div/mod functions are to slow to be usable. RIP. Fixing them now by subtracting value * 2 until value * 2 > subtractor
21:02:54FromGitter<kayabaNerve> I couldn't even convert a UNIX timestamp to Hex
21:13:48Araqshashlick: well we will do it for 0.19
21:14:13shashlickis that soon?
21:15:33FromGitter<data-man> This summer. :)
21:19:35Araqhttps://travis-ci.org/nim-lang/Nim/jobs/381787857
21:20:14Araq clang-5.0: error: unable to execute command: Segmentation fault (core dumped)
21:20:14Araqclang-5.0: error: clang frontend command failed due to signal (use -v to see invocation)
21:20:14Araqclang version 5.0.0 (tags/RELEASE_500/final)
21:20:29Araq^ any hints would be welcome
21:21:49*zszf6cefj5iz joined #nim
21:25:12*yglukhov[i] quit (Ping timeout: 245 seconds)
21:26:21PMunchdata-man, I just pushed some fixes to parsetoml
21:26:31PMunchIt should now work with the example for 0.4.0
21:26:40PMunchAnd pass all the same tests in the validation suite
21:26:58*yglukhov[i] joined #nim
21:30:09*FuntDobra quit (Ping timeout: 252 seconds)
21:31:05*yglukhov[i] quit (Ping timeout: 245 seconds)
21:32:41FromGitter<data-man> @PMunch: Cool!
21:34:13FromGitter<Varriount> Araq: That crashed Clang?
21:38:49*nolanv quit (Read error: Connection reset by peer)
21:39:18Araqapparently
21:39:58*yglukhov[i] joined #nim
21:42:14FromGitter<data-man> update to clang 6.0? ⏎ I'm testing now, but not in Ubuntu
21:45:16*nolanv joined #nim
21:53:13FromGitter<data-man> Tests passed without crash. clang 6.0, ArchLinux
21:54:46FromGitter<mratsim> @kayabaNerve well string operations are slow ;)
21:58:37shashlick.bat is probably the crappiest language on the planet
22:01:02FromGitter<data-man> No. There are esoteric langs. :)
22:01:57FromGitter<kayabaNerve> @mratsim That's not the issue
22:02:02FromGitter<kayabaNerve> I don't think at least
22:02:12FromGitter<kayabaNerve> How can I invert a bool? !bool failed
22:02:26PMunchnot bool
22:03:02FromGitter<kayabaNerve> Thanks
22:03:24FromGitter<kayabaNerve> I knew it was something simple. I was about to write != true
22:08:21FromGitter<data-man> @PMunch: Is ```validator hard_example_unicode.toml``` also passed for you?
22:09:18PMunchhard_example_unicode?
22:09:54PMunchOh
22:09:56FromGitter<data-man> https://github.com/toml-lang/toml/blob/master/tests/hard_example_unicode.toml
22:09:56PMunchThere are more
22:10:42PMunchHmm, it appears to just hang
22:11:03FromGitter<data-man> Yes, same for me.
22:12:27PMunchHmm, the parser reads char by char..
22:12:39*xkapastel joined #nim
22:12:49*xet7 quit (Remote host closed the connection)
22:12:51PMunchSo it probably messes up with Unicode
22:12:52FromDiscord<Kayaba> @mratsim What I meant to say, is I don't do any string operations besides &
22:13:07FromDiscord<Kayaba> That shifts the entire array, of course, which is slow
22:13:34FromDiscord<Kayaba> But the rest is digit by digit. I just subtract the ascii base from the digit and process it
22:13:53FromDiscord<Kayaba> In this case, the case is 0
22:13:58FromGitter<data-man> PMunch: I think so.
22:14:07FromDiscord<Kayaba> *base
22:14:32FromDiscord<Kayaba> For base 58, there's 6 bases. For base 16, it's 0 and A (+an offset)
22:14:51PMunchdata-man, hmm. There's no readRune in the streams or unicode module..
22:17:10shashlicksizof(void *) randomly gives me a value of 3, instead of 4
22:17:14shashlickwhat on earth
22:17:46shashlickaraq ^^
22:18:10FromGitter<mratsim> you’re not on Earth actually, that’s why
22:18:20FromGitter<data-man> :)
22:18:42FromGitter<mratsim> but sizeof(void *) should be 8 on any x86_64 machine no?
22:19:21shashlicki'm getting a value of 3 randomly
22:19:30shashlickboth on 32-bit and 64-bit GCC
22:19:41FromGitter<mratsim> even in pure C?
22:19:47shashlickyep
22:20:02*nolanv quit (Read error: Connection reset by peer)
22:22:57FromGitter<data-man> @PMunch: Maybe we need fastRuneAt for openarray[byte|char]
22:23:15PMunchIt reads from a stream though
22:23:23PMunchSo we would need a readRune
22:23:30PMunchor readUtf8 in streams
22:23:33PMunchOr anywhere really
22:24:40shashlickcan someone try this on windows a few times?
22:25:20shashlickecho int main^(^) { return sizeof^(void *^); } | gcc -o archtest -xc - && archtest
22:26:38*nolanv joined #nim
22:26:51PMunchI'm only getting 8's on my Linux machine
22:27:51FromGitter<data-man> No, not readRune in unicode. This module is free from imports. :)
22:28:19PMunchIn streams then
22:30:18FromGitter<data-man> Ok.
22:32:44*Trustable quit (Remote host closed the connection)
22:36:08*nolanv quit (Quit: WeeChat 2.0.1)
22:36:27*yglukhov[i] quit (Ping timeout: 245 seconds)
22:38:05PMunchSomething like this: http://ix.io/1b1a
22:40:28*skellock joined #nim
22:40:53FromGitter<data-man> I would prefer to read a block of data from a file in a parser. And implement fastRuneAt for openarrays.
22:41:07*yglukhov[i] joined #nim
22:42:20PMunchWhy?
22:42:38PMunchA stream is just an "interface"
22:43:18PMunchSo implement an OpenArrayStream and voilá, now readRune works for openarrays as well
22:43:37PMunchWell, openarray might not work, but you get the point :P
22:43:38FromGitter<data-man> Code duplication in streams. Even better to implement utf8stream
22:44:42PMunchAh you don't want to have the readRune which is basically a copy of fastRuneAt
22:44:52FromGitter<data-man> Yes
22:44:59PMunchThat's a fair point..
22:45:09PMunchNim should have some sort of conditional definition
22:45:21PMunch"if you have imported streams, create this procedure"
22:48:09*PMunch quit (Quit: leaving)
22:48:35FromGitter<data-man> Is ```when declared(...)``` not worked?
23:34:04*leorize joined #nim
23:38:32*yglukhov[i] quit (Ping timeout: 245 seconds)
23:49:03*skellock quit (Read error: Connection reset by peer)
23:57:08*skellock joined #nim