<< 29-01-2018 >>

00:21:44*MJCaley joined #nim
00:23:10*xkapastel quit (Quit: Connection closed for inactivity)
00:27:28*devdri quit ()
00:37:07FromGitter<Quelklef> `seq[A]` where `type A = ref object of B` is by identity, right?
00:37:45FromGitter<Quelklef> Wait, I can probably just test this, sorry
00:57:10*SitiSchu quit (Ping timeout: 260 seconds)
01:01:47*SitiSchu joined #nim
01:06:15*S1tiSchu joined #nim
01:07:12*SitiSchu quit (Ping timeout: 268 seconds)
01:46:17*xkapastel joined #nim
02:04:32*MJCaley quit (Quit: MJCaley)
02:09:22*MJCaley joined #nim
02:14:18*vivus quit (Quit: Leaving)
02:21:32*MJCaley quit (Quit: MJCaley)
02:25:26*S1t1Schu joined #nim
02:29:02*S1tiSchu quit (Ping timeout: 256 seconds)
02:29:27*zahary_ quit (Quit: Connection closed for inactivity)
02:35:36*MJCaley joined #nim
02:46:23*marenz quit (Ping timeout: 248 seconds)
02:47:12*chemist69 quit (Ping timeout: 246 seconds)
03:01:33*chemist69 joined #nim
03:31:22*couven92 quit (Ping timeout: 256 seconds)
03:47:21*MJCaley quit (Quit: MJCaley)
03:56:12*dddddd quit (Remote host closed the connection)
04:20:55*rockcavera joined #nim
04:33:10*xkapastel quit (Quit: Connection closed for inactivity)
04:38:24FromGitter<Varriount> @Quelklef it will compare the identity, yes.
04:39:51FromGitter<Quelklef> I have a very subtle bug then... :(
04:41:35FromGitter<RedBeard0531> can't you define a proc `==`(a, b: A): bool which would give value comparison rather than identity?
04:43:07FromGitter<Quelklef> Yes. I want it to compare by identity. If it's working as I expect, then the bug is somewhere else :/
04:43:47*arthurz quit ()
04:43:48FromGitter<RedBeard0531> The identity of the seq or of the elements?
04:44:00FromGitter<Quelklef> The elements
04:46:58FromGitter<RedBeard0531> To rule it out, try defining your own proc==(a, b:A) with identity semantics and see if the problem goes away
04:50:44*rauss quit (Quit: WeeChat 2.0.1)
04:52:06*rauss joined #nim
04:53:04*MJCaley joined #nim
04:56:31Araqif you want values, don't use 'ref'
04:59:30*rockcavera quit (Ping timeout: 252 seconds)
05:04:49*MJCaley quit (Quit: MJCaley)
05:34:26*endragor joined #nim
05:37:58*tinAndi joined #nim
05:43:10*tinAndi quit (Ping timeout: 240 seconds)
05:56:10*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
06:01:09*endragor quit (Remote host closed the connection)
06:02:56*endragor joined #nim
06:03:38FromGitter<Quelklef> But they're references to values
06:06:13*nsf joined #nim
06:24:10*wurui joined #nim
06:25:34Araqa[] == b[]
06:28:10*c0ntribut0r quit (Ping timeout: 256 seconds)
06:28:55*c0ntribut0r joined #nim
06:40:34*c0ntribut0r quit (Read error: Connection reset by peer)
06:41:30*c0ntribut0r joined #nim
06:45:42*radagast joined #nim
06:45:43*wurui quit (Read error: Connection reset by peer)
06:48:31*c0ntribut0r quit (Ping timeout: 248 seconds)
06:49:26*c0ntribut0r joined #nim
07:11:28*c0ntribut0r quit (Read error: Connection reset by peer)
07:16:53*c0ntribut0r joined #nim
07:34:19livcdI know that there's karax but does anyone use React with Nim ? (i also saw a reactjs binding lib for nim in github)
07:35:41*miran_ joined #nim
07:41:20*endragor_ joined #nim
07:44:40*endragor quit (Ping timeout: 256 seconds)
08:00:15*couven92 joined #nim
08:07:29*gokr joined #nim
08:22:34*endragor joined #nim
08:25:45*endragor_ quit (Ping timeout: 260 seconds)
09:03:27*gmpreussner quit (Ping timeout: 248 seconds)
09:05:25*gmpreussner joined #nim
09:06:58*obadz- joined #nim
09:07:40*obadz quit (Ping timeout: 240 seconds)
09:07:42*obadz- is now known as obadz
09:07:52*dddddd joined #nim
09:14:27*Arrrr joined #nim
09:14:27*Arrrr quit (Changing host)
09:14:27*Arrrr joined #nim
09:17:12*yglukhov joined #nim
09:18:17*PMunch joined #nim
09:20:53FromGitter<andreaferretti> it was an experiment of mine
09:21:11FromGitter<andreaferretti> it should work, but I don't guarantee anything :-)
09:21:26FromGitter<andreaferretti> it would be nice if someone tried doing something serious with it
09:21:30FromGitter<andreaferretti> and possibly update it
09:30:56livcdah :)
10:41:41*c0ntribut0r quit (Ping timeout: 276 seconds)
10:42:17*c0ntribut0r joined #nim
10:47:28*sendell joined #nim
11:00:35*c0ntribut0r quit (Read error: Connection reset by peer)
11:00:50*c0ntribut0r joined #nim
11:01:11*chemist69 quit (Ping timeout: 276 seconds)
11:15:10*chemist69 joined #nim
11:25:20*yglukhov quit ()
11:25:42*yglukhov joined #nim
11:28:54*arnetheduck joined #nim
11:37:21*marenz joined #nim
11:42:21*byte512_ quit (Ping timeout: 246 seconds)
11:45:12radagastHi, I have two questions. 1. Is there a quick and easy trick to generate link to the source code of a particular function in a documentation? For example, in Nim standard library documentation, there is always a nice hyperlink to the relevant source (in github) beside each functions. 2. I have this module https://gist.github.com/57fdcae0649edee8606269333b63145f while documenting it, both `nim doc` and `nim doc2` command fails for a
11:45:14radagast strange reason, it says "`" not found in line 20, which is a comment! Also, another question. How can I make nimble to generate documentation for each modules in the project?
11:46:41Araqyou can use nimscript in your nimble file to do that
11:47:03Araqnot a strange reason, the docgen uses RST, the comments have to be in RST format
11:48:03*Vladar joined #nim
11:48:44*floppydh joined #nim
11:49:00dom96it would be nice for the doc gen to support linking to specific functions
11:57:44*tinAndi joined #nim
11:59:00PMunchHmm, this auto type. Does it not work with closures?
11:59:04PMunchhttps://github.com/PMunch/combparser/blob/master/combparser.nim#L299
11:59:22PMunchTried to change the (proc(lhs: Node, rhs: Node): Node) return type to auto
12:01:03*marenz quit (Ping timeout: 248 seconds)
12:02:23*Snircle joined #nim
12:03:35*tinAndi quit (Ping timeout: 276 seconds)
12:08:01radagastNim's templates are a lot like D's template mixins.
12:24:41*byte512 joined #nim
12:26:28*chemist69 quit (Ping timeout: 252 seconds)
12:28:05*yglukhov_ joined #nim
12:28:05*yglukhov quit (Read error: Connection reset by peer)
12:31:58PMunchHmm, auto works in a simple case like this: http://ix.io/ESE/
12:32:10*yglukhov_ quit (Ping timeout: 240 seconds)
12:34:04PMunchhttp://ix.io/ESG/
12:34:11PMunchThat's the error I get for combparser
12:34:32PMunchThe only thing I can see between them is that the pragmas differ..
12:35:24PMunchAnd if I change both the parts of / to auto I get this http://ix.io/ESH/
12:35:46*yglukhov joined #nim
12:36:56*yglukhov quit (Remote host closed the connection)
12:37:28*yglukhov joined #nim
12:38:23*kunev quit (Ping timeout: 248 seconds)
12:38:52*chemist69 joined #nim
12:39:10*kunev joined #nim
12:41:52*yglukhov quit (Ping timeout: 252 seconds)
12:53:05AraqPMunch: you can't use 'auto' with forward declarations
12:57:01PMunchWhat do you mean? The stuff that is being auto-d isn't forward declared
13:01:41flyxradagast: for generating hyperlinks, use something like this: nim doc2 -o:docout/yaml.html --docSeeSrcUrl:https://github.com/flyx/NimYAML/blob/`git log -n 1 --format=%H` yaml
13:01:46flyx(substitute your URL)
13:02:32flyxit basically queries the current git commit and generates a hyperlink to that version of the file
13:02:55flyxyou can also use a branch name
13:07:05*arecaceae quit (Remote host closed the connection)
13:07:29*arecaceae joined #nim
13:15:20radagastHmm, thanks. I'll note that down.
13:21:33*yglukhov joined #nim
13:25:52*yglukhov quit (Ping timeout: 252 seconds)
13:35:34*yglukhov joined #nim
13:46:58*survivorm joined #nim
13:50:12*survivorm quit (Client Quit)
13:57:48*gokr quit (Ping timeout: 246 seconds)
14:03:40*fvs joined #nim
14:15:14skelettDoes anybody know, how I can get this `breaks` function running: http://ix.io/ET0 ? It seems to get called with the wrong call convention when I pass `varargs[string]`.
14:19:24dom96Seems like a possible bug
14:20:51skelettI tried various cdecl and nodecl things, but nothing worked so far
14:24:20flyxskelett: calling convention is not the problem I think. generated C code looks like this: `T1_ = printf(fmt->data, args);`
14:25:14flyxso instead of calling printf with elements from the varargs list, it gives a pointer to that list (args is a `NimStringDesc**`)
14:25:29flyxC tries to read that as string which is why you get garbage
14:26:08skelettActually, I get "garbage => fmt"
14:26:56skelettAs if this stack address would be loaded twice, once as parameter for printf and once as second string
14:27:22skelett* `garbage => %s => %s`
14:28:12flyxwell the thing is, iirc there is no way to pass an array to a varargs parameter in C. which means that interoperating with Nim's varargs probably won't work.
14:28:42*gokr joined #nim
14:29:28flyxyou can look at the generated C code and try to understand why you're getting the output you're getting, it's not that complex
14:30:51skelettAhh I see
14:34:35flyxalso, it'd say it's not a bug. Nim's manual says that „The compiler converts the list of arguments to an array implicitly“ for varargs parameters. so you are passing an array to printf instead of a list of parameters.
14:35:57flyxand using the template directly will substitute the varargs parameter's usage with the values you give, which is why it works
14:37:03skelettDo you know of a way to get this running with procedures (my actual use case is a bit more complex, so I'd rather use a `proc` than a template)
14:43:19*Yardanico joined #nim
14:46:45FromGitter<ZarsBranchkin> Hey, how do I route stdout out of startProcess to the stdout of the main program? poParentStreams doesn't seem to work, from source it seems that they are automatically disabled on POSIX
14:56:00flyxskelett: I would say it's impossible for the general case (i.e. you don't know the maximum number of arguments) with procedures, but you could define a macro that on each call generates a proc with the right number of arguments if none exists yet; and that proc then calls printf. I am pretty sure you need to replicate your printf call for each number of parameters in your code, because as I said before, C varargs does not take an array.
14:57:05*arnetheduck quit (Ping timeout: 240 seconds)
14:57:39skelettflyx: I would be happy about a pure nim version of formatted printing, too (I'm printing tables). Chances are high, I just did not see the right function
14:57:47flyxskelett: perhaps you can use vprintf instead which takes an explicit va_list parameters, but I have no idea how to handle that properly in Nim
14:59:08flyxskelett: you're searching for the % operator from strutils
14:59:46skelettI did not see there a way to specify a column width
14:59:48flyxskelett: https://nim-lang.org/docs/strutils.html#%,string,openArray[string]
15:00:07skelettsth like `%-30s` in c for example
15:01:10skelettand aligning every single argument is comparable verbose
15:02:40flyxah well. I guess strutils gives you all the basic capabilities you need to implement a formatter that does that yourself, but I don't know about an existing implementation
15:02:50flyxthough someone probably already has done this
15:04:21Araqskelett: nim devel has strformat.nim
15:04:28skelettthere are two libraries listed: stringinterpolation and strfmt. The last ist a dead link, the first is for me (as I'm a beginner) too obscure
15:05:29skelettAraq: Thx! I'll have a look at that!
15:06:14skelettOk thx flyx and Araq, that's what I'm searching for
15:06:31skelettinstalling devel now ^^
15:10:15*Arrrr quit (Ping timeout: 246 seconds)
15:12:21*obadz- joined #nim
15:14:06*obadz quit (Ping timeout: 246 seconds)
15:14:08*obadz- is now known as obadz
15:28:16*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
15:34:04*xkapastel joined #nim
15:55:13FromGitter<Quelklef> I have a question about the type system
15:55:23PMunchFire away :)
15:55:41FromGitter<Quelklef> I come from a Java background, so am largely thinking in terms of needing interfaces, which is where my issue is
15:55:45FromGitter<Quelklef> I wrote the following proc:
15:55:54FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6f440a98927d57454ee863]
15:56:29FromGitter<Quelklef> In what was does the compiler verify that `T` implements `==`?
15:56:46FromGitter<Quelklef> Does it check at the parameterization (?) of `allSame` each time?
15:57:23GitDisc<treeform> yes it would make sure you can `T == T` when you use it.
15:57:40FromGitter<Quelklef> But only on the line, like, `allSame(newSeqsomething ())`
15:57:40GitDisc<treeform> not when you define it like in java
15:57:44FromGitter<Quelklef> ahhhhh ok
15:57:52FromGitter<Quelklef> that's....
15:58:05FromGitter<Quelklef> Interesting. An approach I've never seen before. Seems more flexible
15:58:07FromGitter<Quelklef> Thanks : )
15:58:08GitDisc<treeform> well not at run time, when you put the T is known it will check.
15:58:14FromGitter<Quelklef> right
15:58:22FromGitter<Quelklef> When it becomes a concrete type (?)
15:58:46GitDisc<treeform> yes
15:58:52GitDisc<treeform> this is kind of related: https://en.wikipedia.org/wiki/Structural_type_system
15:58:53flyx== is actually an example in the spec: https://nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics
15:58:56PMunchYeah, the idea with T is that Nim will actually create a proc of that kind for each time you call the proc with a new type
15:59:07GitDisc<treeform> Java uses https://en.wikipedia.org/wiki/Nominal_type_system
15:59:13FromGitter<Quelklef> @PMuch that's why using `compiles` works then?
15:59:19PMunchAnd if the body isn't possible to compile with the new type it will throw an error
15:59:30FromGitter<Quelklef> @GitDisc thanks for the lniks
15:59:39PMunchQuelklef, what do you mean?
16:00:20FromGitter<Quelklef> Well, I was thinking if generics were done the Java way in terms of having one instance of the procedure and just verifying the types will check out then inserting casts
16:00:50FromGitter<Quelklef> Then how would `compiles` work? Like if a proc had `if compiles($val): ... else: ...` how would it do it since it can only compile to one proc
16:00:52GitDisc<treeform> yeah if stuff was done java way you would have to pass it an interface, an stuff would have to implement it
16:00:58FromGitter<Quelklef> But if you're saying it makes a new one for each instantiation that makes sene
16:01:01FromGitter<Quelklef> right
16:01:05GitDisc<treeform> but in nim they just have to "fit" to work
16:01:24PMunchYeah
16:01:47PMunchIf you look at something like the Stream type that is what an "interface" would look like in Nim
16:02:26FromGitter<Quelklef> ooh that looks dirty
16:02:33FromGitter<Quelklef> you mean the streams module right? cause thats what im looking at
16:02:41PMunchYeah
16:02:59PMunchA "Stream" is just an object that has various procedures assigned to it
16:03:04FromGitter<Quelklef> any reason it's done that way rather than using the typical typing methods?
16:03:19PMunchNo idea, ask Araq. He doesn't seem to like interfaces :P
16:03:25GitDisc<treeform> well this is typic in nim, you mean like in java?
16:03:40FromGitter<Quelklef> wait, but streams seems to take the "java way" rather than the nim way I mean
16:03:50FromGitter<Quelklef> it seems to diverge from the nim way by emulating an interface
16:04:50GitDisc<treeform> yeah streams is odd, it seems to do it kind of C++ way with a vtable like thing...
16:04:59Araqthe way streams.nim does it is one of the fastest all things considered
16:05:12*Trustable joined #nim
16:05:39GitDisc<treeform> so StreamObj has a bunch of pointers to function that implement the stream?
16:05:46FromGitter<Quelklef> Wym, Araq?
16:05:53GitDisc<treeform> and then a buch of higher level functions on top of that?
16:06:04PMunchtreeform, something like that yeah :)
16:06:06Araqtreeform: that's how it works, yes
16:06:48AraqQuelklef indirect branch without a C++ like VTable indirection
16:07:02Araqonly a direct branch would be faster
16:07:32GitDisc<treeform> How many stream types are there? Like 3, File, Socket, Buffer?
16:07:42PMunchString as well
16:07:49FromGitter<Quelklef> "direct/indrect branch"? "indirection"?
16:07:58FromGitter<Quelklef> We're moving towards unknown territory for me : P
16:07:59GitDisc<treeform> I would say string stream is a type of a buffer stream?
16:08:00PMunchQuelklef, don't worry about it :P
16:08:16GitDisc<treeform> Quelklef, I am a bit confused now
16:08:19FromGitter<Quelklef> Ok. You guys answered my original question anyway, thanks
16:08:29FromGitter<Quelklef> @treeform What's up
16:08:40GitDisc<treeform> no I mean about the streams vtable thingy
16:08:46Araqwell read about branch prediction on modern CPUs and caches, perhaps
16:09:25FromGitter<Quelklef> @treeform Oh, ask Araq about that
16:09:57Araqtreeform: C++ does it like self.vtable[methodOffset](self)
16:10:14Araqstreams do self.functionPointer(self)
16:11:35GitDisc<treeform> Araq, Why not have FileStream, SocketStream, and like BufferStream and just use [T] to pass them about? Would that produce direct branches? Why not have stream point to like class, right now each stream carts 8 pointers about that are probably identical anyways?
16:12:59GitDisc<treeform> so if you have like a million buffer streams most of memory would just be 8 of the same pointers?
16:13:43Araqyeah... I never have a million of these
16:13:50*Amun_Ra quit (Ping timeout: 276 seconds)
16:14:23Araqthe data duplication is what enables to us to avoid a memory load
16:15:10GitDisc<treeform> I just though that nim had enough meta programming stuff to fully quality run time code paths so that no dynamic type dispatch is needed.
16:16:11Araqthat's true but generics are viral and so not always the best option.
16:16:38Araqyou said it yourself, every stream based proc grows a [T] then
16:16:53GitDisc<treeform> by viral, you mean it can generate too many code paths and its acctually worse?
16:17:23Araqno, I mean viral.
16:17:35Araqaffecting everything which touches it.
16:17:47Araqtake an SQL parser for example
16:18:08Araqit parses from a Stream
16:18:27Araqif the stream is parametrized so should be the SQL parser
16:18:30*Amun_Ra joined #nim
16:18:54GitDisc<treeform> I see.
16:19:21Araqthe code bloat caused by these instantiations is a different problem
16:19:46Araqin theory the backend can merge identical machine code, removing the code bloat completely
16:20:48Araqin practice it never works out so well, but good enough that you need to look at specific examples before saying anything about it
16:20:57GitDisc<treeform> well you would have to use both FileStream and like StringStream, but if you only use one... no code bloat
16:21:08GitDisc<treeform> but having to type [T] everywhere would be a pain
16:21:20*BitPuffin joined #nim
16:21:26Araqactually, nim's "implicit generics" avoid the [T]
16:21:42Araqbut it's still a tradeoff
16:22:08Araqfor example you cannot create a heterogenous list of streams if they are not based on subtyping
16:22:15GitDisc<treeform> interesting
16:22:48Araqand your "but if you only use one... no code bloat" is spot on
16:23:14Araq"if you only use one ..." --- hard to enforce, very hard, libraries can use the stdlib in multiple ways
16:23:52GitDisc<treeform> But here if you use it at any time you still get to call the function pointers.
16:24:30GitDisc<treeform> Well I would file this under another tick I can use. I was just surpsied on how its implemented.
16:24:37Araqwith its 100% correctly predicated jump targets? ;-)
16:24:46Araq*predicted
16:24:57GitDisc<treeform> Yeah it probably does not matter in practise.
16:25:06Araqwhat is the overhead you're concerned about?
16:25:55GitDisc<treeform> Not really, i guess I am consuerned about some abstract form of "cleanleness"... and I guess not really concerned .. just trying to understand.
16:28:38*MJCaley joined #nim
16:29:43Araqwell streams predate methods, closures and (stable) generics ;-)
16:30:01Araqbut now that we have all these I would still do it the same way
16:32:24GitDisc<treeform> I been using the nim JS backend at work, and its working great. Thank you for that.
16:33:50Araqyou're welcome :-)
16:35:43*endragor quit (Remote host closed the connection)
16:36:17*endragor joined #nim
16:40:33*endragor quit (Ping timeout: 246 seconds)
16:47:12*tinAndi joined #nim
16:51:26*endragor joined #nim
16:55:22FromGitter<data-man> stb updated https://github.com/nothings/stb
16:56:38*endragor quit (Remote host closed the connection)
16:58:20*c0ntribut0r quit (Ping timeout: 255 seconds)
17:00:49*gokr quit (Ping timeout: 256 seconds)
17:05:21*PMunch quit (Quit: Leaving)
17:10:02*xet7 quit (Quit: Leaving)
17:17:14*xet7 joined #nim
17:17:56*c0ntribut0r joined #nim
17:22:58*yglukhov quit (Remote host closed the connection)
17:23:32*yglukhov joined #nim
17:23:56*Jesin joined #nim
17:25:14*yglukhov_ joined #nim
17:25:14*yglukhov quit (Read error: Connection reset by peer)
17:29:53*yglukhov_ quit (Ping timeout: 276 seconds)
17:33:11*Trustable quit (Remote host closed the connection)
17:36:30shashlickhey guys, needed some general help - if I don't do a blocking getch() on linux terminal, I lose the cursor - any ideas?
17:37:14*sendell quit (Remote host closed the connection)
17:37:36shashlickif I do the blocking getch() in a spawn'd thread, it doesn't help either
17:48:47*nsf quit (Quit: WeeChat 2.0.1)
17:49:46*couven92 quit (Quit: Client disconnecting)
17:54:00*MJCaley quit (Quit: MJCaley)
17:55:46*MJCaley joined #nim
17:59:28*floppydh quit (Quit: WeeChat 2.0.1)
18:19:03*yglukhov joined #nim
18:20:09*gokr joined #nim
18:23:18*yglukhov quit (Ping timeout: 240 seconds)
18:25:00*tinAndi quit (Ping timeout: 256 seconds)
18:25:14*yglukhov joined #nim
18:31:17yglukhovAraq: what do you think about refactoring nimsuggest a bit?
18:35:39Araqnothing.
18:36:04*skelett quit (Ping timeout: 252 seconds)
18:40:51shashlickI don't get it - if I spawn a thread then my cursor disappears on the terminal
18:41:36shashlickokay never mind, it is the same getch() issue
18:42:04shashlickif I run getch() in a background thread, it still doesn't give me a cursor
18:42:16shashlickso I have to have the getch() in my main thread and threadvar a whole bunch of vars :(
18:42:42shashlickany ideas on how to organize the code so that I don't have to threadvar every single global I have?
18:43:05Araqcertainly, run the getch() in a different thread
18:43:29Araqinstead of the main thread, a dedicated IO thread works for nimsuggest
18:43:44shashlickbut I don't get a cursor if I do that - let me verify again though
18:44:22Araqworks for nimsuggest and the examples in dom's book
18:45:36shashlickhow come when I change a single file in my project, recompile goes through every file? I'm not using -f
18:46:51Araqnim doesn't yet cache compilations
18:55:12shashlickokay cool
19:00:37shashlickno luck - moved getch() to a background thread and everything works but no cursor
19:01:19Araquse readline like the rest of us
19:01:34Araqor use some real UI library, the terminal is bullshit
19:02:00shashlicki'm writing an editor so cannot wait for a newline, and avoiding ncurses so getting tortured as expected
19:04:02shashlickhere's the code - check it out https://github.com/genotrance/snip
19:04:33shashlicki am trying to get the compile done in the background and that's working great but cannot update the UI since i'm blocked for user input
19:04:58shashlickthat's why want to move the getch() into a thread
19:07:52shashlicklooks like I'll have to go back to my old model of showing output only when you hit F5 instead of realtime
19:08:03shashlickregardless, it takes time to compile/execute and get the output so there will always be a delay
19:09:07Araqfork nimedit and make it awesome
19:10:59shashlickwill look into it Araq - snip is just a quick test tool, no plans for making it a fully competent editor
19:11:23shashlicklike snip https://gist.github.com/user/hash will load the gist, also looking into creating/updating gists
19:11:38*couven92 joined #nim
19:12:46*couven92 quit (Remote host closed the connection)
19:13:11*couven92 joined #nim
19:31:33shashlickgot it to work, needed to flush stdout
19:31:52*yglukhov quit (Remote host closed the connection)
19:31:53Araqinteresting, good to know
19:32:02Araqpatch the docs to mention that for 'getch'
19:32:23Araq(which should have gotten a real name btw, like readKey)
19:32:57*obadz quit (Ping timeout: 240 seconds)
19:35:28FromGitter<data-man> terminal should have getInputEvent (keyboard, mouse, changes of console size)
19:37:14*obadz joined #nim
19:37:54shashlickAraq: had to use conio.h for getch() and kbhit() on windows since terminal doesn't have kbhit and getch() eats up special chars
19:39:21shashlickfor Linux, again had to make up kbhit()
19:40:14shashlickmapping getch() values to actual keys is a separate nightmare
19:41:51FromGitter<data-man> @shashlick: See #6966
19:45:43*BitPuffin quit (Remote host closed the connection)
19:47:05shashlick@data-man: nice work, and recent too!
19:47:45shashlickcheck out my hodge podge around key detection https://github.com/genotrance/snip/blob/master/src/snip/key.nim#L22
19:48:12shashlickhttps://github.com/genotrance/snip/tree/master/src/snip/term
19:49:18*scriptum joined #nim
19:51:30FromGitter<data-man> @shashlick: I can't agree, not nice. There is a bugs.
19:55:11shashlickI'll bet - desperately need a good implementation
19:55:29shashlicktermbox is not supported on Windows so couldn't use that
20:01:00FromGitter<data-man> #7062 The more opinions and ideas, the closer the implementation. ;)
20:03:31shashlickI scavenged the net for days to find something useful, there's no consistency on key codes that I could see so you have to make a map for each OS/terminal
20:04:27shashlickterminfo/termcap also are not useful since they don't cover all keys and $TERM doesn't necessarily match what keys are sent by the terminal client
20:04:41shashlicksay putty which can change it's mappings but remote server still just says TERM=xterm or whatever
20:04:54*Snircle joined #nim
20:05:35*obadz quit (Ping timeout: 240 seconds)
20:06:29shashlickhappy to help in any way though
20:06:52shashlickthat's why you see this hodge podge (confused mess) for key mapping in snip :)
20:07:16*obadz joined #nim
20:14:20*obadz quit (Ping timeout: 276 seconds)
20:14:59*endragor joined #nim
20:16:31*yglukhov joined #nim
20:17:14*obadz joined #nim
20:19:11*endragor quit (Ping timeout: 248 seconds)
20:33:39*jxy quit (Quit: leaving)
20:33:58*jxy joined #nim
20:36:01*Yardanico quit (Remote host closed the connection)
20:42:08*marenz joined #nim
20:44:28*obadz- joined #nim
20:44:58*obadz quit (Ping timeout: 256 seconds)
20:45:00*obadz- is now known as obadz
20:59:12*rauss quit (Quit: WeeChat 2.0.1)
21:02:00*marenz quit (Remote host closed the connection)
21:03:01*rauss joined #nim
21:30:14*xet7_ joined #nim
21:31:29*xet7_ quit (Remote host closed the connection)
21:32:01*xet7_ joined #nim
21:32:15*xet7 quit (Ping timeout: 256 seconds)
21:33:07*xet7_ is now known as xet7
21:43:20*couven92 quit (Ping timeout: 256 seconds)
21:43:29*Vladar quit (Quit: Leaving)
21:55:40*MJCaley quit (Quit: MJCaley)
21:59:32*nsf joined #nim
22:09:18*endragor joined #nim
22:13:48*endragor quit (Ping timeout: 240 seconds)
22:18:46*Jesin quit (Quit: Leaving)
22:19:36*nsf quit (Quit: WeeChat 2.0.1)
22:55:39*couven92 joined #nim
23:02:11*MJCaley joined #nim
23:05:30*sz0 joined #nim
23:12:52*MJCaley quit (Quit: MJCaley)
23:15:14*endragor joined #nim
23:18:08FromGitter<Quelklef> So, I just fixed a bug that arose because I overrode the `==` operator for a `ref` type to compare data rather than identity... Araq, I'm so sorry. I regret all my sins.
23:18:19FromGitter<Quelklef> Is there a way to write a `==` comparing the underlying non-ref type?
23:18:37FromGitter<Quelklef> Or will I have to define `type A = ref object of B` and defined `==` for `B`?
23:19:00FromGitter<Quelklef> So that I can compare data via `first[] == second[]`
23:19:18*endragor quit (Ping timeout: 240 seconds)
23:21:30dom96Why don't you just define a non-ref type?
23:22:35FromGitter<Quelklef> That's what I was planning on doing, but I figure'd i'd ask in case there's a more elegant solution
23:22:43FromGitter<Quelklef> Writing a one-off type just feels gross
23:25:13FromGitter<Quelklef> Oh, also, it won't work, unfortunately
23:25:33FromGitter<Quelklef> wait ignore me
23:27:11FromGitter<Quelklef> Yeah, it won't. I'm using method and sub-types (?), and part of my equality test is that they're the same type (`first of second.type and second of first.type`)
23:27:26FromGitter<Quelklef> This means I can't define it for the non-ref type, because all the polymorphism happens on the level of the ref type
23:28:26FromGitter<Quelklef> And I can't define it for the ref type, because `==` should be for identity. The only remaining option is writing a second equality tester, say, `proc equiv`, which does the testing I want. Is this all just a manifestation of bad coding on my part?
23:35:03*gokr left #nim (#nim)
23:36:50dom96It might help if you explain what this type of yours is
23:43:20*MJCaley joined #nim
23:43:36FromGitter<Quelklef> A node on an AST. The base type is `Node` and each subtype is an actual node type, `Operator`, `FuncDef`, etc.
23:44:12FromGitter<Quelklef> I wanted to define special equality testing for these types which compared a subset of properties, because I wanted to ignore a few
23:44:22FromGitter<Quelklef> So I did, via `==`, and found out that was a terrible idea.
23:44:43FromGitter<Quelklef> If there were a dedicated comparison by identity operator my problem would be solved (is there? am I just ignorant?)
23:45:18dom96So you're using inheritance for an AST type?
23:45:40*CcxWrk quit (*.net *.split)
23:45:40*Shoozza quit (*.net *.split)
23:48:58*arecaceae quit (Remote host closed the connection)
23:49:21*arecaceae joined #nim
23:51:11*Shoozza joined #nim
23:51:11*CcxWrk joined #nim
23:56:18FromGitter<Quelklef> right
23:57:41*MJCaley quit (Quit: MJCaley)