<< 27-02-2016 >>

00:00:14*PMunch joined #nim
00:08:22*nsf quit (Quit: WeeChat 1.4)
00:18:20*darkf joined #nim
00:42:19*Matthias247 quit (Quit: Matthias247)
00:45:02*toaoMgeorge quit (Quit: Bye)
00:57:30*jamesp joined #nim
00:58:10jamespHi! Is there a way to control to influence memory layout? I'd like to force an object to be cache aligned and fit inside one cache line
00:59:29*kulelu88 left #nim ("Leaving")
00:59:45Araqjamesp: yeah, add padding
00:59:54Araqthat's what I do.
01:00:59jamespSo I read this C code that was hyper-optimized by a super-expert guy. He did three things: padding, cache align, and static asserts the size was <=64
01:01:12jamespEven with padding can't an object occur in two cache lines?
01:01:16jamesplike get split between the two
01:03:32jamespcache align means making sure the indices line up
01:08:20*yglukhov_ quit (Remote host closed the connection)
01:13:59*jaco60 quit (Ping timeout: 240 seconds)
01:15:41Demosso if it's aligned on the size of a cache line than it should be in just one
01:15:46Araqignoring some non-standard #pragmas you can do the very same in Nim
01:16:27Araqand c2nim can tell you how to translate the C code to Nim
01:18:52jamespAraq: is padding sufficient to ensure the object will be aligned?
01:26:07*arnetheduck joined #nim
01:31:14Araqjamesp: no, you have to know a few more low level details, but it's not hard
01:31:28jamespHow do you specify those in nim?
01:31:48jamespOr do you specify them in C and use C2nim
01:34:53Araqdepends. but usually you can get away with only the padding
01:35:07Araqand trust the compiler it aligns things properly
01:36:55jamespok. what happens if you don't trust it haha
01:37:08jamespis there a nim way or do you go with c2nim?
01:40:59*miko__ quit (Ping timeout: 244 seconds)
01:43:42Araqyou're misunderstanding me.
01:44:50Araqc2nim cannot do anything that Nim can't.
01:46:50jamespoh ok
01:46:59jamespis there a way to force nim to align the struct?
01:47:01jamespdirectly
01:47:51jamespor do you have to use ffi
01:49:07Araqtrust.
01:49:09Araqthe.
01:49:12Araqcompiler.
01:49:32jamespoh ok
01:49:42jamespand how do you do the padding?
01:49:43*arnetheduck quit (Ping timeout: 244 seconds)
01:49:47jamespin nim
01:50:09*arnetheduck joined #nim
01:51:22AraqI do it like so: https://gist.github.com/Araq/5c1db2d505a9094e185d
01:52:20Araqhave to sleep now, see you tomorrow
01:52:55jamespnice
01:52:56jamespty
01:52:58jamespnight
01:53:08*jamesp quit (Quit: Page closed)
01:57:31*ozra_ quit (Ping timeout: 244 seconds)
01:59:21*mrkishi quit (Quit: bye)
02:04:40*mat4-bbl quit (Quit: Leaving)
02:07:47*desophos joined #nim
02:08:59*Demos quit (Ping timeout: 240 seconds)
02:09:10*mrkishi joined #nim
02:11:23*mrkishi quit (Client Quit)
02:11:40*Kingsquee quit (Read error: Connection reset by peer)
02:11:55*Kingsquee joined #nim
02:22:54*mrkishi joined #nim
02:34:17*lxdong joined #nim
03:00:14*mahasamoot quit (Remote host closed the connection)
03:17:07*PMunch quit (Quit: leaving)
03:29:55*mahasamoot joined #nim
03:36:38*aligator joined #nim
03:36:48aligatorhello. i'm trying to use the marshal module but having trouble :(
03:36:57*OnwardEuler quit (Read error: Connection reset by peer)
03:37:00aligatorimport marshal
03:37:07aligatortype Person = ref object of RootObj
03:37:12aligator height: float
03:37:19aligatorlet json_string = "{\"height\": 6.3}"
03:37:25aligatorecho $$to[Person](json_string)
03:38:10aligatorError: unhandled exception: unknown file(1, 1) Error: int for pointer type expected expected [JsonParsingError]
03:38:11Varriountaligator: Please use gist or a snippet service, IRC formatting is horrid
03:38:26aligatorsorry
03:38:56aligatoranyway that's all the code
03:39:20Varriountaligator: You might want to first observe what the output of such an object is for the marshal module.
03:39:25*brson quit (Ping timeout: 255 seconds)
03:39:31aligatoryeah so it's
03:39:43aligatorsomething like this:
03:39:44aligator[4336877648, {"height": 38.0}]
03:39:44Varriountaligator: The marshal module serializes references, which your type is.
03:40:01aligatorso can you construct a new object from this?
03:40:17aligatorlike given a json i want to make a new object of some type
03:42:09aligatorI'd like to use the deserialize part of the module
03:42:36Varriountaligator: Making your type an object will get rid of the pointer issue, to produce {"data": 4.5}
03:43:15VarriountEr, data is height, that's what I named the member in my local test
03:43:16aligatorhow do i do that?
03:43:48Varriountaligator: https://gist.github.com/Varriount/1a0400c9ae1897747cc9
03:44:07aligatori'm trying to use the to method
03:44:10aligatornot the $$ method
03:44:25aligator$$ is just to see what it looks like
03:44:40aligatorThe error I get is from calling to[Person](json_string)
03:46:35Varriountaligator: https://gist.github.com/Varriount/1a0400c9ae1897747cc9
03:46:40VarriountI've updated it.
03:47:03aligatorthat's not getting at my question
03:47:08aligatorwhen you do $$
03:47:12aligatorit includes a number
03:47:16aligatorand a json string
03:47:23aligatori'd like to get the object just from the json string
03:47:25Varriountaligator: Do you know what references/pointers are, compared to regular objects/structs?
03:47:35aligatorin C land, yes
03:47:50VarriountNim's references are comparable to C pointers.
03:48:01aligatorOK so to deserialize a json string
03:48:13aligatori need to provide a reference to a pre-existing object?
03:48:28VarriountWhen declaring a type, the 'object of' says that the type is a value type, the 'ref object of' says that the type is a reference type.
03:49:02VarriountIf you tell marshal to serialize a reference type, it needs to create a representation of that reference, hence why you get that integer.
03:49:06aligatoroh i see
03:49:16aligatorso with these raw objects
03:49:20aligatorthat aren't ref objects
03:49:23Varriountaligator: This is so circular references and such work properly.
03:49:28aligatorcan i make one that inherits?
03:49:35Varriountaligator: Yes.
03:49:38aligatorhow?
03:49:42Varriountaligator: One moment, let me write up a snippet.
03:49:57aligatorso I want the concrete class to not be a ref
03:50:01aligatorso that I can deserialize it
03:51:52aligatorhttp://nim-lang.org/docs/tut2.html#object-oriented-programming-objects
03:52:01aligator"Ref objects should be used whenever inheritance is used. "
03:52:32aligator"Ref objects should be used whenever inheritance is used. It isn't strictly necessary, but with non-ref objects assignments such as let person: Person = Student(id: 123) will truncate subclass fields."
03:52:35aligatorwhat does this mean?
03:53:26Varriountaligator: https://gist.github.com/Varriount/31ff05ace2efc3762a0b
03:54:25aligatorso in terms of base class, concrete class there are four possibilities for ref/no ref combos
03:54:26aligatorwhich are bad?
03:54:54Varriountaligator: Well, you don't usually want to create an object type that extends a reference type.
03:55:03aligatorWhy?
03:55:14Varriountaligator: That gist shows, the first part of the type declaration defines whether the type is an object or reference type, the second defines the base layout of the type.
03:55:41aligatorAnd what about an object that extends a regular object?
03:55:55Varriountaligator: Well, nothing bad.
03:56:09aligatorso what exactly is the difference here between the two?
03:56:10Varriountaligator: Parameter passing semantics work like in C
03:56:49aligatorok
03:56:56aligatorand with these type signatures
03:57:00aligatorcan you pass them around?
03:57:07aligatori'd like to make a map from strings to type signatures
03:57:25VarriountType signatures?
03:57:32aligatorI have say obj A, obj B of A, obj C of A
03:57:43aligatorI want to use the to function to get a C or a B
03:57:50aligatorand I want to specify which one with a string
03:57:56aligatorthat is either "B" or "C"
03:58:40Varriountaligator: Hm. The problem with that is that the marshal object doesn't store the type information as part of the data.
03:59:02aligatoryeah i know
03:59:12Varriountaligator: The best way, I think, would be to either make some marker, or use a variant object.
03:59:15aligatorbut I'll provide that
03:59:23Varriountaligator: One moment.
03:59:26aligatorsome marker?
04:05:18Varriountaligator: Like, an int or a string that tells you at runtime what type is being serialized/desarialized.
04:05:30aligatoryeah say i have a string
04:05:35VarriountOr you could just go with object variants.
04:05:36aligatorhow do i turn that into a type
04:05:48aligatorI have a string that is either "B" or "C"
04:05:58aligatorand I want to turn that into the function to[B] or to[C]
04:06:42Varriountaligator: http://nim-lang.org/docs/typetraits.html#arity,typedesc
04:07:25Varriountaligator: You'll have to have a switch somewhere deciding which type to choose though.
04:07:33aligatoryeah so i loop through several types
04:07:38aligatorand check if they are equal to my string
04:07:39aligatorright/
04:07:40aligator?
04:08:00*mrkishi quit (Quit: bye)
04:08:04Varriountaligator: Well, more like a case statement.
04:08:22aligatori don't know all the types ahead of time
04:08:30aligatorlike there will be a bunch
04:09:00aligatorand when i initialize a type the super class will add it to the list of types
04:09:25aligatoris there an easy way to do this?
04:09:46aligatorforce a class that inherits from a set base class to add itself to a list of classes
04:10:21Varriountaligator: The best way I can think of is to use a table which maps type names to unserialization procedures.
04:10:54aligatormhm
04:11:05aligatoris there a decentralized way to construct this table?
04:11:42aligatorso any type that inherits from class A automatically adds itself to the table
04:11:49aligatorthrough doing something in super or something
04:12:20Varriountaligator: What is the overall goal?
04:12:46aligatorhave a library of indicators and specify which indicator to use via a text file
04:13:09aligatorand then do statistics to assess the quality of this indicator at predicting a signal
04:13:30aligatorit needs to be text for a recursive feedback loop, so that you don't hard code in the details of the indicator
04:14:01Varriountaligator: Why not just have an 'unserialize' method for each class then?
04:14:09VarriountOr rather, type.
04:14:12aligatorhaha lots of classes
04:14:21aligatorthat's a lot of boiler plate
04:14:28Varriountaligator: Well, the thing is that Nim doesn't have classes.
04:14:28aligatorlike imagine i have 30 of these
04:14:33Varriountaligator: Templates.
04:14:40VarriountAnd generics.
04:14:47aligatoryeah the objects are good enough
04:14:50aligatoras classes
04:14:51aligatorI think
04:14:57VarriountActually, all you need is one, I think.
04:15:05aligatorhow so?
04:15:09aligatorI need one abstract
04:15:12aligatorand a lot of implementing ones
04:16:23Varriountaligator: I think I might actually have a real-world example.
04:16:30aligatorsure
04:17:25Varriountaligator: https://github.com/nim-lang/nimsuggest/blob/major-restructure/nimsuggest.nim
04:18:10Varriountaligator: That program works as a sort of IDE tool - it can be used to get suggestions and information from a nim file, for use by an IDE
04:18:30aligatorwhich idea is this an example of?
04:18:35VarriountAnyway, the part of it that would interest you is how modes are done.
04:18:54VarriountThe tool can output information through various means (socket, stdout, etc)
04:19:12VarriountEach mode has a method, and an object
04:19:39aligatormhm
04:19:54Varriountaligator: See line 42 and 71
04:20:08VarriountOh, and line 74
04:20:25*mrkishi joined #nim
04:20:41aligatorah interesting
04:21:25aligatori think to get exactly what i want i also have to write my own version of marshal
04:21:29Varriountaligator: On line 202, the procedure is retrieved from the table.
04:21:51Varriountaligator: I don't know, I'll see if I can come up with something.
04:22:17aligatorcause i want to have composure of these indicators that extend the base object
04:22:21aligatorhaha so deserialization is hard
04:22:35aligatoryou have to recursively go through the tree
04:24:10Varriountaligator: Now you see what serialization frameworks have to do.
04:24:28aligatoryeah i have to write a custom one haha
04:24:29aligatornot easy
04:25:13aligatorWhen you want to combine nim and c code and specify how to make in a makefile
04:25:20aligatoris there anything special you have to do in the linking etc?
04:25:48Varriountaligator: Not really. You need to make sure that all the generated files are linked though.
04:26:01aligatorhow do you make sure of that?
04:26:13aligatori mean some nim and some C through ffi
04:26:14Varriountaligator: Use the --verbosity:3 option to see all the compiler invokations
04:26:26aligatorok
04:26:36Varriountaligator: People usually just use dynamic libraries.
04:26:38aligatorbut like how do i make sure the binary will include the C ffi files?
04:26:43aligatoris that a nim thing
04:26:46aligatoror a compiler thing
04:26:49Varriountaligator: Huh?
04:27:01Varriountaligator: You've lost me.
04:27:08aligatorso i have nim code
04:27:12aligatorand someone else wrote c code
04:27:15aligatorand i want to use ffi
04:27:24aligatorand make sure the nim code knows where to find the c code
04:28:14*filwit quit (Quit: Leaving)
04:28:16Varriountaligator: Bing http://nim-lang.org/docs/manual.html#implementation-specific-pragmas-link-pragma
04:28:48aligatoris that necessary when you're doing ffi?
04:29:05Varriountaligator: Depends. Is this C code a dynamic library, or a set of source files?
04:29:17aligatorset of source files
04:30:06VarriountThen have your makefile compile all the C code into an object file, preferably creating and outputting it into the nimcache directory of the main Nim file.
04:30:16VarriountThen have it invoke Nim
04:31:05VarriountThen, in the main Nim file, use the link pragma with 'nimcache/MyObjectFile.o'
04:31:10aligatoroh ok
04:31:13aligatorgot it!
04:31:17aligatorthanks for helping me
04:31:31*mrkishi quit (Quit: bye)
04:32:03Varriountaligator: Results may vary. #nim is not responsible for any damage that may occur while performing any given advice.
04:32:21aligatorheh
04:32:25*mrkishi joined #nim
04:32:46Varriountaligator: I've never used the link pragma myself, however based on the similar mechanisms, that's how I would go about it.
04:32:57aligatorthanks
04:33:25Varriountaligator: If you make a serializer that takes run-time type information into account, be sure to tell us!
04:33:59aligatorok
04:34:16aligatormy plan is to have part of the json have the obj name
04:34:47aligatorso like a json will have a field {class: "B", {data: 5}}
04:34:53aligatorwill make a B with the field 5
04:35:35aligatorbut i need a good way to register B
04:35:51aligatorwould be cool if there were a big list of all the objects that could be created
04:36:20Varriountaligator: Like, a global type table?
04:36:26aligatoryeah
04:36:51aligatorcause then i can use "B" and http://nim-lang.org/docs/typetraits.html#name,typedesc
04:37:33aligatorso a list of typedesc's needs to be made
04:49:18Varriountaligator: Also, note that there's a... flaw in typetraits, if you ever use it.
04:49:36VarriountIt's not likely to come up, but you should still be aware of it.
04:49:46aligatorwhat is the flaw?
04:50:19VarriountBasically, two modules can have types of the same name, typetraits.name only returns the type name, so there can be ambiguity.
04:50:41VarriountSay, two modules implement a Node type.
04:51:00Varriounttypetraits.name will return 'Node' for both.
04:51:20VarriountThis is why Java uses serialization ID's, and Python uses... something else.
04:53:01aligatorwhy doesn't it qualify the name with the module?
04:53:42Varriountaligator: I don't know exactly why.
04:53:52aligatorah
04:53:55aligatorok
04:53:58aligatorthanks
05:05:42*aligator quit (Quit: Page closed)
05:28:18VarriountAraq: How complicated would 'program local data' be (that is, global data automatically shared across DLL's)
05:30:45VarriountFailing that, would it be possible for a module to automatically make itself a DLL?
05:32:59*lompik quit (Ping timeout: 240 seconds)
06:04:26*brson joined #nim
07:46:46*yglukhov joined #nim
08:15:54*desophos quit (Read error: Connection reset by peer)
08:20:15*nsf joined #nim
08:28:33*yglukhov quit (Remote host closed the connection)
08:41:04*shodan45 quit (Ping timeout: 252 seconds)
08:42:26*yglukhov joined #nim
08:45:15*yglukhov quit (Remote host closed the connection)
08:46:17*brson quit (Quit: leaving)
08:48:20*Kingsquee quit (Read error: Connection reset by peer)
08:48:48*Kingsquee joined #nim
08:53:09*vendethiel quit (Ping timeout: 246 seconds)
09:10:42*Arrrr joined #nim
09:39:06*yglukhov joined #nim
10:06:56*miko__ joined #nim
10:20:04*Matthias247 joined #nim
10:25:12*yglukhov quit (Remote host closed the connection)
10:50:34*vendethiel joined #nim
11:00:17*yglukhov joined #nim
11:23:53*cheatfate joined #nim
11:24:14*jaco60 joined #nim
11:31:40cheatfateIts so quiet...
11:31:48cheatfatedom96 are you here?
11:32:27dom96yes, but just about to leave :)
11:34:24dom96will be back soon though
11:35:02cheatfateok i will wait
11:35:29cheatfatecould you please just ping me when you come online again
11:43:42*arnetheduck quit (Ping timeout: 276 seconds)
11:44:07*arnetheduck joined #nim
12:04:24*yglukhov quit (Remote host closed the connection)
12:14:33*vendethiel quit (Ping timeout: 240 seconds)
12:17:21flyxsince the update of the JSON module in stdlib, my NimYAML benchmark crashes (it compares loading JSON with json.nim against NimYAML's performance)
12:17:33flyxI haven't deduced what exactly the error is
12:18:06flyxbut an IndexError is raised somewhere in tableimpl
12:18:19*vendethiel joined #nim
12:21:33flyxadd() of tables.nim shouldn't even be able to raise an IndexError, should it?
12:25:25Araqflyx: I think the tables impl cannot deal with tables initialized with size 4 reliably
12:28:31AraqVarriount: no idea what you mean. globals do that?
12:34:48flyxwhat's the difference between calling a task defined in config.nims and calling the nim command specified there with all the same params from command line?
12:35:16flyxthe task from config.nims works, but when I enter it manually on the command line, I get "Error: undeclared identifier: 'JsonNode'"
12:35:23flyxeven though json is imported
12:39:31*vendethiel quit (Ping timeout: 248 seconds)
12:54:21*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
12:55:51*vendethiel joined #nim
13:02:11dom96back
13:07:46*Cresonhtyx joined #nim
13:08:02*Cresonhtyx left #nim ("Leaving")
13:08:35Araqflyx: do you use JsonNode in NimScript? o.O
13:08:48flyxAraq: no, in the source code I compile
13:09:15flyxand it compiles when I compile it with a task defined in config.nims, but not when I enter the command with the same arguments at the command line
13:10:50*lompik joined #nim
13:12:23*Arrrrr joined #nim
13:13:30flyxah, found the problem. the issue is that my file is named bench/json.nim. it imports "../yaml", which imports json. when I call it from the command line, the json import there seems to backlink to bench/json.nim instead of Nim's json module
13:14:12*Arrrr quit (Ping timeout: 248 seconds)
13:14:22flyxso it probably sets "bench" as working dir while the task in config.nims does not
13:14:53flyxI guess I'll rename the file
13:19:07cheatfatedom96: could you please watch on https://github.com/nim-lang/Nim/issues/3909
13:19:48*lxdong quit (Ping timeout: 252 seconds)
13:21:56dom96cheatfate: replied
13:23:10flyxseems like I need to initialize JsonNode's fields table with 1024 to make my code work
13:23:28cheatfateheh
13:23:32cheatfateok i will try
13:24:23dom96cheatfate: thanks
13:26:40cheatfatedom96: but i saw async module based on libuv on github, is current async will be replaced with this libuv one (when it will be ready)?
13:28:06dom96Maybe. But there are no current plans to do that.
13:28:59*lokien quit (Ping timeout: 240 seconds)
13:31:14flyxhmm, it seems to be a problem of tables' add(). if I use `[]=`, everything works
13:33:13*lokien joined #nim
13:49:29*lokien quit (Ping timeout: 260 seconds)
13:51:12*lokien joined #nim
13:54:44r-kuany idea if there is a way for macro to get all exported things from a module?
14:00:32*Matthias247 quit (Read error: Connection reset by peer)
14:08:31cheatfatedom96: sorry, but i have linux only as VM so if you want i can run under it
14:08:40dom96cheatfate: sure
14:08:54dom96use wrk, it should give good benchmark results
14:09:42cheatfatewrk?
14:10:15dom96https://github.com/wg/wrk
14:58:14*yglukhov joined #nim
15:05:55cheatfatedom96: done
15:21:22*sora joined #nim
15:36:42cheatfatedom96: i think for timers i will use timerfd for epoll based selectors, EVFILT_TIMER for kqueue based selectors and RegisterWaitForSingleObject for Windows' IOCP, but i dont have any ideas what to do with all others...
15:40:05*irrequietus joined #nim
15:51:10*cnu- quit (Ping timeout: 268 seconds)
15:54:14*toddpratt left #nim (#nim)
15:54:34Araqdef-: can you export `$` for tables from json please?
15:54:41Araq*in json
15:58:14*clone1018_ joined #nim
16:00:32*cnu- joined #nim
16:17:36*jaco60 quit (Quit: Leaving)
16:17:56*jaco60 joined #nim
16:27:02*darkf quit (Quit: Leaving)
16:29:33*arnetheduck quit (Ping timeout: 246 seconds)
16:37:03*sora quit (Ping timeout: 240 seconds)
16:47:57*yglukhov quit (Remote host closed the connection)
17:02:09*Matthias247 joined #nim
17:04:06*jaco60 quit (Remote host closed the connection)
17:06:30*jaco60 joined #nim
17:15:53*faqu joined #nim
17:18:25*faqu left #nim (#nim)
17:19:10*sorakun joined #nim
17:19:26*Ven joined #nim
17:30:55*desophos joined #nim
17:48:26*yglukhov joined #nim
17:52:50*yglukhov quit (Ping timeout: 244 seconds)
17:57:31*Varriount quit (Disconnected by services)
17:57:31*Varriount_ joined #nim
17:59:00*Matthias247 quit (Read error: Connection reset by peer)
18:10:01*Jesin quit (Quit: Leaving)
18:19:12gmpreussnercan someone tell me what's wrong with this? https://gist.github.com/gmpreussner/5ed8d0e4b921564f7e1d
18:19:29gmpreussneri'm trying to parameterize the array type in /tests/metatype/tstatic_ones.nim
18:19:43gmpreussnercan't find a working syntax for the call to ones()
18:23:03Araqgmpreussner: hmm good question
18:27:58dom96are 'nim.cfg' files no longer read by the compiler?
18:28:30*GangstaCat quit (Read error: Connection reset by peer)
18:30:38*dorei joined #nim
18:30:43ldleworkdom96: supposed to use config.nims right?
18:32:45gmpreussnerAraq: it seems to work if all parameters are inferred by the compiler (check my new comment)
18:33:05dom96Araq: What is the correct way to achieve the same with .nims?
18:33:47dom96ldlework: doesn't seem to work
18:36:03dom96module_name.nims doesn't either
18:36:13dom96(where module_name is the name of the file I am compiling
18:36:14dom96)
18:36:31gmpreussnerpackage.nims ?
18:36:58gmpreussnerwhere package is the name of the package
18:42:21*GangstaCat joined #nim
19:09:06*Salewski joined #nim
19:12:34SalewskiFrom tutorial II: "Note: Composition (has-a relation) is often preferable to inheritance (is-a relation)". I know that is-a-relation can be used with the OF keyword, but how is has-a relation used in Nim. Never seen, and can*t find in manual?
19:14:59dom96Salewski: Just Foo = object\n otherObj: Bar (I think)
19:17:23SalewskiHope you will explain that in more detail in you book :-)
19:18:05SalewskiDo you have an idea what "let person: Person = Student(id: 123) will truncate subclass fields." means in tutorial II. How it is truncated?
19:18:34dom96That's how composition works in every language though
19:19:31dom96Possibly that if you then convert the type back to Student that its fields won't be preserved.
19:19:36dom96But i'm not sure
19:20:59SalewskiOK thanks, will read it in your book soon :-) Bye...
19:21:04*Salewski quit ()
19:27:25*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:34:01*yglukhov joined #nim
19:45:54*Ven joined #nim
19:47:43*toaoMgeorge joined #nim
20:00:31*yglukhov quit (Remote host closed the connection)
20:09:22*Arrrrr left #nim ("WeeChat 1.2")
20:15:27wuehlmaushow can i write to less in a pipe? i am almost there but the program quits before i can see anything piped to less. when i use sleep i can use less for the slept time but that's not what i want
20:16:00wuehlmausi use popen from the posix module.
20:25:12*yglukhov joined #nim
20:25:12*yglukhov quit (Remote host closed the connection)
20:25:29*yglukhov joined #nim
20:28:09flyxwuehlmaus: less should stay open after the original command quits
20:28:54flyxwait, you call less *within* your application?
20:29:30wuehlmausi do
20:29:41wuehlmauslike i said it almost works :)
20:32:26flyxdo you call pclose?
20:32:27*gokr joined #nim
20:32:38flyxthat should wait for the called process to exit
20:35:01wuehlmausflyx: you are right, i missed to include that line
20:35:14wuehlmausit works
20:36:07wuehlmausi should have known better really
20:37:06flyxwell, now you know
20:37:18flyxjust out of curiosity, what's the use-case for that?
20:37:19wuehlmausindeed :)
20:37:46wuehlmausi just wanted to know how pipes are done ,not a real use case 'til now
20:39:12*Ven quit (Read error: Connection reset by peer)
20:40:58dom96wuehlmaus: that sounds like a cool way to learn. I don't suppose osproc supports working with pipes very well, maybe you could improve it so that it does? :)
20:41:27wuehlmaus:)
20:43:51*brson joined #nim
20:44:49*Ven joined #nim
20:46:06*gokr quit (Quit: Leaving.)
20:54:45*Ven quit (Read error: Connection reset by peer)
20:56:10*Ven joined #nim
21:33:55*Varriount joined #nim
21:44:17*M-max quit (Ping timeout: 244 seconds)
21:44:17*vqrs_ quit (Ping timeout: 244 seconds)
21:44:21*brson quit (*.net *.split)
21:44:21*GangstaCat quit (*.net *.split)
21:44:21*desophos quit (*.net *.split)
21:44:21*clone1018_ quit (*.net *.split)
21:44:21*irrequietus quit (*.net *.split)
21:44:21*mrkishi quit (*.net *.split)
21:44:22*rinukkusu quit (*.net *.split)
21:44:22*avsej quit (*.net *.split)
21:44:22*fold3 quit (*.net *.split)
21:44:23*jackv quit (*.net *.split)
21:44:23*silven quit (*.net *.split)
21:44:24*jck quit (*.net *.split)
21:44:24*ldlework quit (*.net *.split)
21:44:24*Ven quit (*.net *.split)
21:44:25*nsf quit (*.net *.split)
21:44:25*Varriount quit (*.net *.split)
21:44:25*yglukhov quit (*.net *.split)
21:44:25*sorakun quit (*.net *.split)
21:44:26*mtj_ quit (*.net *.split)
21:44:26*ekarlso- quit (*.net *.split)
21:44:26*Amrykid quit (*.net *.split)
21:44:26*def- quit (*.net *.split)
21:44:27*pandada8 quit (*.net *.split)
21:44:27*jeffc_ quit (*.net *.split)
21:44:27*kier_ quit (*.net *.split)
21:44:27*Araq quit (*.net *.split)
21:44:27*cheatfate quit (*.net *.split)
21:44:27*mnemonikk quit (*.net *.split)
21:44:28*zxtx quit (*.net *.split)
21:44:28*delian66 quit (*.net *.split)
21:44:28*nim-buildbot quit (*.net *.split)
21:44:30*mahasamoot quit (*.net *.split)
21:44:30*MyMind quit (*.net *.split)
21:44:30*mlitwiniuk quit (*.net *.split)
21:44:30*beatmox quit (*.net *.split)
21:44:30*miko__ quit (*.net *.split)
21:44:30*[CBR]Unspoken quit (*.net *.split)
21:44:31*allan0 quit (*.net *.split)
21:44:31*Amun_Ra quit (*.net *.split)
21:44:31*vegansk quit (*.net *.split)
21:44:32*GaveUp quit (*.net *.split)
21:44:32*asdf quit (*.net *.split)
21:44:32*toaoMgeorge quit (*.net *.split)
21:44:32*so quit (*.net *.split)
21:44:33*zepolen quit (*.net *.split)
21:44:33*jaco60 quit (*.net *.split)
21:44:33*lokien quit (*.net *.split)
21:44:34*cyraxjoe quit (*.net *.split)
21:44:34*zielmicha quit (*.net *.split)
21:44:34*OmIkRoNiXz quit (*.net *.split)
21:44:34*nchambers quit (*.net *.split)
21:44:35*DecoPerson quit (*.net *.split)
21:44:35*dyce_ quit (*.net *.split)
21:44:35*Xe quit (*.net *.split)
21:44:36*huonw quit (*.net *.split)
21:44:36*mal`` quit (*.net *.split)
21:44:36*EastByte_ quit (*.net *.split)
21:44:36*Guest79881 quit (*.net *.split)
21:44:38*JStoker quit (*.net *.split)
21:44:38*Roin quit (*.net *.split)
21:44:38*bbl_ quit (*.net *.split)
21:44:38*joebo quit (*.net *.split)
21:44:38*tstm quit (*.net *.split)
21:44:39*federico3 quit (*.net *.split)
21:44:39*SianaGearz quit (*.net *.split)
21:44:39*OnO quit (*.net *.split)
21:44:39*Senketsu quit (*.net *.split)
21:44:39*gsingh93 quit (*.net *.split)
21:44:39*zaquest quit (*.net *.split)
21:44:40*heinrich5991 quit (*.net *.split)
21:44:40*sarlalian quit (*.net *.split)
21:44:41*onionhammer quit (*.net *.split)
21:44:41*Vivek quit (*.net *.split)
21:44:41*_stowa quit (*.net *.split)
21:44:41*biscarch_ quit (*.net *.split)
21:44:41*BlaXpirit quit (*.net *.split)
21:44:41*apotheon quit (*.net *.split)
21:44:41*themagician_v quit (*.net *.split)
21:44:41*exebook quit (*.net *.split)
21:44:41*reactormonk quit (*.net *.split)
21:44:41*pleiosaur quit (*.net *.split)
21:44:42*lenstr quit (*.net *.split)
21:44:43*Varriount_ quit (*.net *.split)
21:44:43*cnu- quit (*.net *.split)
21:44:43*dorei quit (*.net *.split)
21:44:43*lompik quit (*.net *.split)
21:44:43*boopsiesisaway quit (*.net *.split)
21:44:44*nkr quit (*.net *.split)
21:44:44*clone1018 quit (*.net *.split)
21:44:45*StarBrilliant quit (*.net *.split)
21:44:45*cncl quit (*.net *.split)
21:44:45*\u quit (*.net *.split)
21:44:46*RushPL quit (*.net *.split)
21:44:47*alexsystemf quit (*.net *.split)
21:44:47*SirCmpwn quit (*.net *.split)
21:44:47*askatasuna quit (*.net *.split)
21:44:48*pigmej quit (*.net *.split)
21:44:48*devn quit (*.net *.split)
21:44:49*Learath2 quit (*.net *.split)
21:44:49*flyx quit (*.net *.split)
21:44:49*someplace quit (*.net *.split)
21:44:49*NhanH quit (*.net *.split)
21:44:49*CARAM__ quit (*.net *.split)
21:44:49*Gonzih quit (*.net *.split)
21:44:50*dom96 quit (*.net *.split)
21:44:50*r-ku quit (*.net *.split)
21:44:50*vendethiel quit (*.net *.split)
21:44:51*mog quit (*.net *.split)
21:44:51*thotypous quit (*.net *.split)
21:44:52*dthrvr quit (*.net *.split)
21:44:52*niv quit (*.net *.split)
21:44:52*ludocode quit (*.net *.split)
21:45:32*thotypous joined #nim
21:45:42*thotypous quit (Client Quit)
21:51:04*mnemonikk_ joined #nim
21:51:04*jackv joined #nim
21:51:04*MightyJoe joined #nim
21:51:04*[BNC]lokien joined #nim
21:51:04*thotypous joined #nim
21:51:04*Guest48054 joined #nim
21:51:04*dom96 joined #nim
21:51:04*rinukkusu joined #nim
21:51:04*Guest76595 joined #nim
21:51:04*askatasuna joined #nim
21:51:04*dorei joined #nim
21:51:04*silven_ joined #nim
21:51:04*huonw_ joined #nim
21:51:04*vqrs joined #nim
21:51:04*irrequietus_ joined #nim
21:51:04*avsej joined #nim
21:51:04*M-max1 joined #nim
21:51:04*delian66_ joined #nim
21:51:04*brson_ joined #nim
21:51:04*Varriount joined #nim
21:51:04*Ven joined #nim
21:51:04*yglukhov joined #nim
21:51:04*toaoMgeorge joined #nim
21:51:04*sorakun joined #nim
21:51:04*cnu- joined #nim
21:51:04*lompik joined #nim
21:51:04*cheatfate joined #nim
21:51:04*miko__ joined #nim
21:51:04*nsf joined #nim
21:51:04*zepolen joined #nim
21:51:04*MyMind joined #nim
21:51:04*Vivek joined #nim
21:51:04*[CBR]Unspoken joined #nim
21:51:04*ekarlso- joined #nim
21:51:04*mtj_ joined #nim
21:51:04*onionhammer joined #nim
21:51:04*Amrykid joined #nim
21:51:04*_stowa joined #nim
21:51:04*biscarch_ joined #nim
21:51:04*BlaXpirit joined #nim
21:51:04*apotheon joined #nim
21:51:04*allan0 joined #nim
21:51:04*def- joined #nim
21:51:04*themagician_v joined #nim
21:51:04*alexsystemf joined #nim
21:51:04*exebook joined #nim
21:51:04*reactormonk joined #nim
21:51:04*SirCmpwn joined #nim
21:51:04*pleiosaur joined #nim
21:51:04*pandada8 joined #nim
21:51:04*jeffc_ joined #nim
21:51:04*Amun_Ra joined #nim
21:51:04*vegansk joined #nim
21:51:04*so joined #nim
21:51:04*asdf joined #nim
21:51:04*GaveUp joined #nim
21:51:04*pigmej joined #nim
21:51:04*kier_ joined #nim
21:51:04*Araq joined #nim
21:51:04*mlitwiniuk joined #nim
21:51:04*beatmox joined #nim
21:51:04*sarlalian joined #nim
21:51:04*heinrich5991 joined #nim
21:51:04*zaquest joined #nim
21:51:04*gsingh93 joined #nim
21:51:04*Senketsu joined #nim
21:51:04*OnO joined #nim
21:51:04*SianaGearz joined #nim
21:51:04*federico3 joined #nim
21:51:04*tstm joined #nim
21:51:04*joebo joined #nim
21:51:04*bbl_ joined #nim
21:51:04*Roin joined #nim
21:51:04*JStoker joined #nim
21:51:04*lenstr joined #nim
21:51:04*Gonzih joined #nim
21:51:04*CARAM__ joined #nim
21:51:04*NhanH joined #nim
21:51:04*Learath2 joined #nim
21:51:04*someplace joined #nim
21:51:04*flyx joined #nim
21:51:04*devn joined #nim
21:51:04*clone1018 joined #nim
21:51:04*nkr joined #nim
21:51:04*StarBrilliant joined #nim
21:51:11*vendethiel joined #nim
21:51:11*mog joined #nim
21:51:11*dthrvr joined #nim
21:51:11*niv joined #nim
21:51:11*ludocode joined #nim
21:51:16*OmIkRoNiXz joined #nim
21:51:17*nchambers joined #nim
21:51:17*Xe joined #nim
21:51:20*mahasamoot joined #nim
21:51:20*cncl joined #nim
21:51:22*RushPL joined #nim
21:51:28*ldlework joined #nim
21:51:55*mrkishi joined #nim
21:51:57*desophos joined #nim
21:51:59*GangstaCat joined #nim
21:52:04*fold3 joined #nim
21:53:06*jck joined #nim
21:55:03*r-ku joined #nim
21:56:59*dyce_ joined #nim
22:02:05*yglukhov_ joined #nim
22:02:05*yglukhov quit (Read error: Connection reset by peer)
22:03:47cheatfatedom96: are you still online?
22:04:21dom96cheatfate: Please just ask even if you're unsure whether I'm here
22:04:27dom96I always read the IRC lgs
22:04:28dom96*logs
22:05:01cheatfatedom96: i have implemented timerfd for linux and it working good but it has a problem
22:05:28*biscarch joined #nim
22:05:57cheatfatewhen i do something like "await future or sleepAsync()" when future completed sleepAsync() timerfd is not closing
22:06:05cheatfatei need something like future.close()
22:06:18cheatfateto close pending timerfd descriptors
22:06:22*themagician joined #nim
22:06:34cheatfatebecause there only 1024 can be opened
22:06:41cheatfateby default
22:07:13cheatfateso its more architecture question
22:07:20*sorakun quit (Remote host closed the connection)
22:07:40cheatfatei need to close this timerfd file descriptors if they not needed anymore
22:07:43*lenstr quit (Ping timeout: 276 seconds)
22:07:43*nchambers quit (Ping timeout: 276 seconds)
22:07:43*onionhammer quit (Ping timeout: 276 seconds)
22:07:44*_stowa quit (Ping timeout: 276 seconds)
22:07:44*biscarch_ quit (Ping timeout: 276 seconds)
22:07:45*LeNsTR|away joined #nim
22:07:58*onionhammer joined #nim
22:08:08*RushPL quit (Read error: Connection reset by peer)
22:08:10*BlaXpirit_ joined #nim
22:08:17*BlaXpirit quit (Read error: Connection reset by peer)
22:08:22*Vivek quit (Ping timeout: 276 seconds)
22:08:22*apotheon quit (Ping timeout: 276 seconds)
22:08:22*themagician_v quit (Ping timeout: 276 seconds)
22:08:22*exebook quit (Ping timeout: 276 seconds)
22:08:22*pleiosaur quit (Ping timeout: 276 seconds)
22:08:29*pleiosaur joined #nim
22:08:37*apotheon joined #nim
22:08:56*BlaXpirit_ is now known as BlaXpirit
22:09:02*exebook joined #nim
22:09:13dom96cheatfate: I see. Adding a `cancel` proc for futures is on my to do list
22:09:17dom96Maybe you could implement that?
22:09:36dom96cancelling futures which wait on a recv(), send() etc may be tricky though
22:10:05cheatfateyeah, its why i asking you to do it :)
22:10:56cheatfatebecause i'm not so pro as you in async arch
22:10:58*RushPL joined #nim
22:11:12dom96cheatfate: hehe. Will be a while before I get the time to do it
22:11:25dom96But please go ahead and create a PR for the stuff that you have
22:11:29dom96Just mention that it's not ready
22:11:48*mahasamoot quit (Ping timeout: 248 seconds)
22:12:41cheatfateOk, i will try to implement cancel() but could you point me on some underwater rocks that i can meet?
22:12:47*mahasamoot joined #nim
22:12:53*nchambers joined #nim
22:14:50*_stowa joined #nim
22:20:47*NimBot joined #nim
22:21:15dom96Python's asyncio may be of help, but you may find it difficult adapting it to asyncdispatch's architecture.
22:21:45dom96Would be interesting to hear how they do it nonetheless though
22:22:32*ekarlso- quit (Ping timeout: 244 seconds)
22:23:10*jamesp joined #nim
22:23:36*r-ku joined #nim
22:23:39jamespIf you have a type instrument_seq[T] = distinct seq[T] and an instance of such called x, how do you access the underlying sequence?
22:24:08*nsf quit (Ping timeout: 261 seconds)
22:24:46*apotheon quit (*.net *.split)
22:24:46*yglukhov_ quit (*.net *.split)
22:24:46*dorei quit (*.net *.split)
22:24:46*miko__ quit (*.net *.split)
22:24:47*[CBR]Unspoken quit (*.net *.split)
22:24:47*allan0 quit (*.net *.split)
22:24:47*Amun_Ra quit (*.net *.split)
22:24:47*vegansk quit (*.net *.split)
22:24:47*GaveUp quit (*.net *.split)
22:24:47*asdf quit (*.net *.split)
22:25:22*wh1t3r0s3 joined #nim
22:25:47*gmpreussner joined #nim
22:25:54*regtools quit (Ping timeout: 276 seconds)
22:26:23*zama joined #nim
22:26:33*LeNsTR|away quit (Ping timeout: 240 seconds)
22:26:34*vendethiel quit (Ping timeout: 240 seconds)
22:27:16*vendethiel joined #nim
22:27:20*Varriount_ joined #nim
22:27:20*Varriount quit (Disconnected by services)
22:27:34*cncl quit (Ping timeout: 240 seconds)
22:27:38*boopsiesisaway joined #nim
22:27:44*apotheon_ is now known as apotheon
22:28:05*mog quit (Ping timeout: 240 seconds)
22:28:07*dthrvr quit (Ping timeout: 240 seconds)
22:28:07*niv quit (Ping timeout: 240 seconds)
22:28:07*ludocode quit (Ping timeout: 240 seconds)
22:28:18*jaco60 joined #nim
22:28:18*zielmicha joined #nim
22:28:18*DecoPerson joined #nim
22:28:18*mal`` joined #nim
22:28:18*EastByte_ joined #nim
22:28:22*apotheon quit (Changing host)
22:28:22*apotheon joined #nim
22:28:28*emery joined #nim
22:29:03gmpreussnerAraq: it seems the problem is that static[T] parameters don't work for proc calls. for type declarations its fine.
22:29:14*kier_ quit (Ping timeout: 244 seconds)
22:29:34*dom96 quit (Excess Flood)
22:29:44*LeNsTR joined #nim
22:29:54*nsf joined #nim
22:30:04*ludocode joined #nim
22:31:15*rektide joined #nim
22:31:34gmpreussnerperhaps the type resolution of overloaded procs is not fully static[T] aware. it doesn't accept static[T] tokens ("type required")
22:31:38gmpreussnerugh... did my previous message make it through? IRC client acting up... lemme repost
22:31:38gmpreussnerAraq: it seems the problem is that static[T] parameters don't work for proc calls. for type declarations its fine.
22:31:57*onionhammer joined #nim
22:32:09*huonw_ quit (Ping timeout: 260 seconds)
22:32:20*regtools joined #nim
22:32:55*lyro joined #nim
22:33:01*dom96 joined #nim
22:33:22*pleiosaur quit (Ping timeout: 244 seconds)
22:34:21*pleiosaur joined #nim
22:35:43*huonw joined #nim
22:36:15*niv joined #nim
22:37:08*wuehlmaus joined #nim
22:37:11*mog joined #nim
22:37:32*wuehlmaus is now known as Guest1727
22:38:32*desophos_ quit (Ping timeout: 244 seconds)
22:38:48*Varriount joined #nim
22:39:03*brson_ quit (Ping timeout: 244 seconds)
22:39:19*brson joined #nim
22:39:32*allan0 joined #nim
22:39:57*fold3 quit (Ping timeout: 402 seconds)
22:40:31*jaco60 quit (*.net *.split)
22:40:31*zielmicha quit (*.net *.split)
22:40:31*DecoPerson quit (*.net *.split)
22:40:32*mal`` quit (*.net *.split)
22:40:32*EastByte_ quit (*.net *.split)
22:41:13*Amun_Ra joined #nim
22:41:38*Varriount_ quit (Ping timeout: 244 seconds)
22:42:41*DecoPerson joined #nim
22:43:23*GaveUp joined #nim
22:45:11*mog quit (Read error: Connection timed out)
22:46:26*mog joined #nim
22:46:52*mal`` joined #nim
22:47:39*EastByte_ joined #nim
22:48:37*fold4 joined #nim
22:48:53*MyMind quit (Excess Flood)
22:49:52*jaco60 joined #nim
22:49:57*MyMind joined #nim
22:51:03*zielmicha joined #nim
22:52:21*clone1018 quit (Ping timeout: 268 seconds)
22:53:52*nchambers quit (Max SendQ exceeded)
22:56:37*jaco60 quit (Read error: Connection reset by peer)
22:56:54*nchambers joined #nim
22:57:09*jaco60 joined #nim
22:58:00*Vivek joined #nim
22:58:24*Vivek is now known as Guest29888
23:00:22*lompik quit (Ping timeout: 268 seconds)
23:02:25*clone1018 joined #nim
23:03:27*Amun_Ra quit (Ping timeout: 268 seconds)
23:03:27*gmpreussner quit (Ping timeout: 268 seconds)
23:05:27*Amun_Ra joined #nim
23:07:48*gmpreussner joined #nim
23:07:51*Jesin joined #nim
23:08:21*lompik joined #nim
23:09:13*zxtx quit (*.net *.split)
23:09:28*dthrvr joined #nim
23:10:22*francisl joined #nim
23:15:47*StarBrilliant quit (Ping timeout: 268 seconds)
23:19:52*nchambers quit (Ping timeout: 244 seconds)
23:23:30*StarBrilliant joined #nim
23:23:54*nchambers joined #nim
23:24:23*Kingsquee joined #nim
23:31:24*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:38:22*jamesp quit (Ping timeout: 252 seconds)
23:42:12*Jesin quit (Quit: Leaving)
23:51:43*xaoz_ quit ()
23:53:00*vendethiel quit (Ping timeout: 276 seconds)