<< 22-04-2016 >>

00:11:58*desophos quit (Remote host closed the connection)
00:21:08*fredrik92 quit (Read error: Connection reset by peer)
00:23:45*darkf joined #nim
00:49:36*shodan45 quit (Quit: Konversation terminated!)
01:43:11*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:44:29*ephja quit (Ping timeout: 276 seconds)
01:48:48*Varriount quit (Ping timeout: 246 seconds)
01:52:09*Varriount joined #nim
01:58:53*vendethiel joined #nim
02:03:49*desophos joined #nim
02:15:18*space-wizard joined #nim
02:23:48*desophos_ joined #nim
02:28:33*desophos_ quit (Ping timeout: 250 seconds)
02:35:44*brson quit (Quit: leaving)
02:43:17*marchelzo quit (Ping timeout: 260 seconds)
03:01:58*StarBrilliant quit (Ping timeout: 250 seconds)
03:03:07*vendethiel quit (Ping timeout: 260 seconds)
03:03:28*mtj_ quit (Ping timeout: 244 seconds)
03:25:30kingofozhello
03:25:39kingofozNim wrapper for Urho3D
03:25:53kingofozcan it support Urho3D 1.5 now?
03:31:33*mtj_ joined #nim
03:34:11*StarBrilliant joined #nim
03:40:07*marchelzo joined #nim
03:44:52*marchelzo quit (Ping timeout: 250 seconds)
03:54:51kingofozhello?
04:16:45*unixer joined #nim
04:29:56*unixer quit (Quit: Page closed)
04:40:49*marchelzo joined #nim
04:45:05*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:46:18*marchelzo quit (Ping timeout: 276 seconds)
04:49:01*space-wizard joined #nim
04:49:36*space-wizard quit (Max SendQ exceeded)
04:50:14*space-wizard joined #nim
04:50:49*space-wizard quit (Max SendQ exceeded)
04:51:27*space-wizard joined #nim
05:27:23*s4 joined #nim
05:43:07*marchelzo joined #nim
05:44:23*desophos quit (Read error: Connection reset by peer)
05:48:25*marchelzo quit (Ping timeout: 268 seconds)
05:53:40*fredrik92 joined #nim
06:00:08*StarBrilliant quit (Ping timeout: 268 seconds)
06:00:10*mtj_ quit (Ping timeout: 244 seconds)
06:01:43*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:05:02*vendethiel joined #nim
06:06:38*vendethiel quit (Client Quit)
06:10:49*mtj_ joined #nim
06:11:21*krux02 quit (Remote host closed the connection)
06:13:55*StarBrilliant joined #nim
06:15:33*Sonderblade quit (Ping timeout: 268 seconds)
06:18:31*m9dhatter joined #nim
06:19:14m9dhatterHello. How does one assign a variable of the same name from within a proc scope to the outer scope?
06:21:51*krux02 joined #nim
06:22:08kingofozit is so quiet today
06:22:17kingofozgokr, are you there?
06:22:34fredrik92probably too early in the morning (at least in Europe)
06:23:42*m9dhatter quit (Ping timeout: 250 seconds)
06:29:02kingofozguess so
06:29:42fredrik92I myself feel like I will fall asleep any second now... -.-
06:29:58fredrik92Solution: Lots and lots and lots of coffee!! :P
06:29:58*Sonderblade joined #nim
06:30:27kingofozwhere are you? US?
06:30:45fredrik92Norway...
06:31:03kingofozah, what is your time?
06:31:37fredrik9208:32 A.M.
06:32:08fredrik92WAY too early if you ask a student, like me... :P
06:32:47kingofoztime to wake up
06:32:50kingofoz:-)
06:33:15kingofozand learn Nim, fredrik92
06:33:59fredrik92actually, I'm working on one of my three presentations I have to hold today, the project was programmed in Nim!! :)
06:35:17kingofozwhat is the project?
06:35:59fredrik92Hierarchical schemas for flexible data structuring in database systems
06:37:37fredrik92Basically a layer on top of a relational DB to allow it to store data with variations in its schema
06:38:12kingofozI see
06:38:16kingofozsounds awesome
06:38:37fredrik92was pretty neat, yeah! :D
06:39:52kingofozwhy do you choose Nim?
06:40:52fredrik92Because a friend of mine wanted to explore Nim and we worked on this together
06:41:44fredrik92And we usually do programming in C up here in Tromsø...
06:43:50*marchelzo joined #nim
06:43:55kingofozI see
06:44:38fredrik92And... I kinda got stuck here in the channel since then... :P No, really, I like Nim! :D
06:46:43kingofozwhat stuck you?
06:47:20fredrik92#nim is really nice... always someone here talking about some interesting stuff!!!
06:48:52*marchelzo quit (Ping timeout: 260 seconds)
06:56:52kingofozok
06:56:56kingofoz:-)
07:17:50*krux02 quit (Remote host closed the connection)
07:28:35*yglukhov joined #nim
07:34:29*yglukhov quit (Ping timeout: 268 seconds)
07:44:33*marchelzo joined #nim
07:47:19*Trustable joined #nim
07:49:13*marchelzo quit (Ping timeout: 250 seconds)
07:56:43*yglukhov joined #nim
07:59:54IcyFoxyCan nim do Type -> Type lookups at compile time? For instance in Rust this would be done through traits. trait T { type Y; } impl T for Ty { type Y = Ty2; }, then <Ty as T>::Y yields Ty2
08:08:16*dorei joined #nim
08:11:21Araq_IcyFoxy: not sure what you mean. you can have a table of NimNodes to NimNodes representing types
08:11:42flyxIcyFoxy: https://gist.github.com/flyx/68e39b187c0fd90dbddac78f8375cb2a
08:14:37*gokr joined #nim
08:15:03Araq_this typedesc stuff is so powerful. thank you zahary :-)
08:16:54flyxif your code is not working, you did not use enough typedesc.
08:18:48*filcuc joined #nim
08:33:57*aziz joined #nim
08:36:18*ephja joined #nim
08:45:21*marchelzo joined #nim
08:49:43*StarBrilliant quit (Ping timeout: 268 seconds)
08:49:51*mtj_ quit (Ping timeout: 246 seconds)
08:49:53*marchelzo quit (Ping timeout: 250 seconds)
08:54:10*StarBrilliant joined #nim
08:54:56*mtj_ joined #nim
08:59:20*StarBrilliant quit (Ping timeout: 276 seconds)
09:00:12*mtj_ quit (Ping timeout: 268 seconds)
09:02:39*GangstaCat quit (Quit: Leaving)
09:10:41*StarBrilliant joined #nim
09:19:09*mtj_ joined #nim
09:20:41IcyFoxyThanks flyx
09:21:46IcyFoxyAraq_: flyx Solved as expected. Thanks anyway.
09:22:00IcyFoxyAraq_: Also not entirely sure what you're suggesting? Macro?
09:22:51Araq_IcyFoxy: yes
09:23:58IcyFoxyRight. Well I think I'll go with flyx' suggestion. :)
09:26:31*Demon_Fox quit (Quit: Leaving)
09:33:41IcyFoxyflyx: Can the templates easily deconstruct/reconsturct tuples? tuple[int, string] -> tuple[ptr int, ptr string] for instance.
09:34:24IcyFoxy(Of arbitrary length. In Rust this requires macros due to the inflexibility in describing tuples and arrays)
09:35:24flyxIcyFoxy: no, this would require variadic generics. you need macros for that.
09:35:30IcyFoxyOkay.
09:36:31IcyFoxyflyx: How about carrying a lifetime down in a type? Specifically these pointers are into a bytestream. That bytestream must remain present for the pointer to be valid. Or does the GC do this all for me here?
09:37:14*jck quit (Read error: Connection reset by peer)
09:37:34*jck joined #nim
09:38:56flyxIcyFoxy: you can model the pointer as object with a ref to the bytestream and an int offset. that way, the GC will assure that the bytstream lives as long as the pointer lives
09:39:41flyxif you use a ptr directly to a position in the bytestream, ensuring that the bytestream still exists is up to you
09:39:45IcyFoxyso, ref instead of ptr?
09:40:02IcyFoxyOkay. Thanks :)
09:40:55IcyFoxyBTW: I'm attempting to port a binary / type representation from Rust (also created by me) to nim to compare the required complexities in this task.
09:42:20IcyFoxyflyx: Do you think it would be possible to have ... 'magic type a = b' -> 'type a = magic b' -> 'type a = ref b', here I want the keyword to apply over all types. Macro because varidic?
09:42:53IcyFoxyvariadic *
09:44:19flyxyou can write a template that can be called with `magic(a, b)` and will yield `type a = ref b` if that's what you're after
09:45:07IcyFoxyflyx: Yes, but I want to have a list of types to be transformed so it 'looks' like the normal usage of 'type'.
09:45:51flyxthen you need a macro. also, I am not sure if that is a good idea from a readability perspective
09:45:58IcyFoxyIn Rust the closest without using a syntax extension is to wrap the structs/enums in a macro call. To my understanding of nim, the templates/macros are powerful enough to not need this.
09:46:00*marchelzo joined #nim
09:46:23flyxso, you're writing a kind of serialization library?
09:46:36IcyFoxyflyx: Yes.
09:47:29flyxyou might want to look at NimYAML, it also uses templates extensively to serialize native Nim types: http://flyx.github.io/NimYAML/index.html
09:47:47IcyFoxyflyx: And attempting to get the same concept applied in nim for language comparasion for this task. I want it to be seemless to the developer while the data describes the format itself.
09:50:52IcyFoxyflyx: Thanks for the link. Although I'm not serialising to the types exactly. Instead my serialisation works through pointers into the bytestream, and iterators for respective DST types. This design works on a transformation on the type defined so getters/setters work on the underlying data representing the type described when defining the serialised type.
09:50:55*marchelzo quit (Ping timeout: 252 seconds)
09:52:05flyxah, so you manipulate the original types and replace the fields with getters and setters
09:52:10IcyFoxyFor portability this also needs endian flipping where necessary.
09:52:13IcyFoxyYes
09:53:38IcyFoxyAlso my usecase also complicates things a little further with CoW memory mappings for a database defined by the types directly.
09:53:44flyxhow does a variable get linked to the bytstream when it's declared
09:54:04IcyFoxyflyx: What do you mean?
09:54:33flyxassuming you did wrap type A. when you have `var a: A`, how does a get a pointer to the bytstream to operate on?
09:55:10*krux02 joined #nim
09:55:14*krux02 quit (Remote host closed the connection)
09:57:20IcyFoxyvar a: A = cursor.lense # here cursor maintains the position in the bytestream and only goes forwards. If it fails along the way (size, doesn't fit, etc) - the cursor will invalidate and the children pointers shouldn't be used.
09:58:04IcyFoxyIn rust, this works with many calls to try!() checking that each call returned the desired pointer. And if any fail then the entire object is dropped.
10:00:00flyxdoes this have anything to do with Haskell's lens package?
10:06:29Araq_in Nim we have exceptions instead.
10:08:56flyxoh, Rust doesn't have exceptions?
10:09:25flyxah yes, it handles it with return values, I remember
10:10:16*marchelzo joined #nim
10:11:10Araq_there is this strange concept in computing, called "automation"
10:11:42Araq_so instead of writing try!f everywhere you can write f ;-)
10:11:49ephjawoohoo!
10:12:04ephjabit lazy though innit ;)
10:12:06flyxwe have come a long road to be able to do that ^^
10:12:35*fredrik92 quit (Quit: Leaving)
10:12:41gokrkingofoz: You can try it already, just get a 1.32 Urho and check out the samples :)
10:13:08kingofozwell, it is old
10:13:18kingofozI'd like 1.5
10:13:21kingofoz:-D
10:13:26gokrSure, but it should still work to just see the samples running.
10:13:56gokrAraq_: You had those scripts, right?
10:14:46Araq_not really. I have scripts to convert it, but did many manual changes. many of these are not necessary anymore.
10:14:53gokrAraq_: I might drum up some interest in doing this, since... it would be cool to make a sample with Spry and Urhonimo.
10:15:22Araq_I can do it ... tomorrow. want to play with it again too to check some C++ codegen changes
10:15:35gokrSounds super.
10:16:01*gokr wonders what is new in 1.5
10:16:10kingofozsounds good
10:16:20kingofozI am your user. :-)
10:16:28Araq_http://urho3d.github.io/releases/2015/11/11/urho3d-1.5-release.html gokr
10:16:39gokrYeah, I am looking at it. Long list.
10:17:15Araq_gokr: first step is to get my 1.4 patch cleaned up
10:17:41Araq_for 1.5 I will simply try to recompile then against a urho 1.5
10:18:03Araq_since urhonimo uses the C++ headers the C++ compiler will tell us about the differences :-)
10:18:51Araq_regenerating the wrapper is much more work. it wasn't until wxWidgets where I did cleanly enough to be able to do that.
10:20:10kingofozit should be ok to use vs 2015 to compile the source?
10:23:24Araq_yeah
10:25:43gokrSo did you publish the latest wx wrapper?
10:26:18Araq_yeah
10:27:21gokrIs that wxnim on github?
10:27:57gokrBtw, someone mentioned https://github.com/andlabs/libui - looks kinda... neat.
10:36:34*marchelzo quit (Ping timeout: 252 seconds)
10:49:58kingofozI have a little experience with wx. :-)
10:50:13kingofozwrite GUI by wxPython
10:50:18kingofozit is pretty terrible
10:51:49reactormonkkingofoz, I've had fun with tk
10:52:03reactormonknot sure how well it will translate into nim though
10:52:19kingofozok
11:00:11kingofozgokr, can I consider Spry as a REPL to Nim?
11:01:24gokrNot really
11:01:50gokrMore like a scripting lang
11:02:23kingofozok
11:05:50veganskawaykingofoz, did you try to use nrpl?
11:05:58*veganskaway is now known as vegansk
11:06:14kingofoznope
11:06:19kingofozwhat is that?
11:06:22veganskREPL
11:07:11kingofozREPL for nim?
11:08:12veganskyes
11:09:46kingofozcan you give me the link?
11:10:03veganskhttps://github.com/vegansk/nrpl
11:10:16veganskor nimble install nrpl
11:12:34IcyFoxyBack Sorry. flyx
11:13:07IcyFoxyflyx: Re Haskell's lens. Nothing at all. And the at the time accidental typo for 'lense' remains to not collide with Haskell's lens.
11:14:04veganskAraq, I found the workaround for https://github.com/nim-lang/Nim/issues/4079 - just adding {.closure.} to closures :-) But I can't understand why it works!
11:14:46veganskMaybe it can help to resolve the issue?
11:15:18IcyFoxyflyx: You look through the lense at the bytestream, to see the typed you were expecting. Here you're expecting to see types because you know the structure already. The format compacts booleans into bitvectors (and I guess nim's sets would apply too), and the order is maintained as defined, with padding applied if necessary.
11:17:52flyxIcyFoxy: it seems like in the end, it is an allocate-only heap
11:19:10IcyFoxyflyx: Kinda. You can provide it any backing cursor you want. And in the database usecase, it'll CoW to mutate and write - and re-use freed up space.
11:22:23*wuehlmaus joined #nim
11:24:03IcyFoxyflyx: The database usecase won't just allocate, it'll reuse when necessary. Although that does require extending the base, which is really just walking forward the cursor and accumulating pointers to aligned primitives. Which is simple and works with iterators for dynamically sized types.
11:24:16IcyFoxyAnd most importantly portable with minimal overheads.
11:25:54IcyFoxySomething that I haven't yet tried although see working is to have a lense-self describing. Specifically a lense, for runtime managed lenses. Slightly more overhead but shouldn't be expensive.
11:38:34*BitPuffin joined #nim
11:41:24*elrood joined #nim
11:43:58gokrkingofoz: So Spry is a completely different language, it just happens to be implemented in Nim - and can relatively easily call Nim stuff.
11:46:02*McSpiros joined #nim
11:49:56*enthus1ast joined #nim
11:50:40*enthus1ast quit (Client Quit)
12:07:56*vegansk is now known as veganskaway
13:07:58*def- quit (Ping timeout: 244 seconds)
13:09:27*ephja quit (Ping timeout: 250 seconds)
13:13:42*s4 quit (Quit: Konversation terminated!)
13:26:42*gokr quit (Ping timeout: 260 seconds)
13:27:03kingofozI see, gokr
13:27:19kingofozyou guys really do well
13:44:37*emery is now known as ehmry
13:49:36*ephja joined #nim
15:00:57*def- joined #nim
15:01:33Araq_kingofoz: 1.4 available as a PR to Urhonimo
15:01:40Araq_checking 1.5 now
15:01:47*Varriount quit (Ping timeout: 260 seconds)
15:03:13*Varriount joined #nim
15:06:54*McSpiros quit (Quit: Page closed)
15:20:35*dorei quit (Quit: Page closed)
15:35:17cheatfate_Araq_, i know function is represented internally like array with 2 fields, 1st field is address of function, but what mean second field?
15:35:58Araq_the so called "environment"
15:36:19Araq_which contains the data in the closure that is passed implicitly to the function
15:51:35cheatfate_ahh ok, not helps me much
15:51:42cheatfate_but thanks
15:53:26*space-wizard joined #nim
15:57:00*filcuc quit (Read error: Connection reset by peer)
15:58:19*darkf quit (Quit: Leaving)
16:02:27*Varriount quit (Ping timeout: 260 seconds)
16:05:57*Varriount joined #nim
16:16:07cheatfate_it looks like we need to implement queue for asyncdispatch callbacks, i dont see any other ways to omit stack overflow on windows and other platforms (only with connect())
16:16:54cheatfate_and this queue must be fast as possible and multithreading ready... any suggestions?
16:32:15*yglukhov quit (Ping timeout: 250 seconds)
16:48:17Araq_cheatfate_: procs without .closure calling convention don't have an environment and the function pointer is completely compatible with C
16:48:38Araq_channels are multithreading ready ...
16:53:28*alex_______ joined #nim
16:54:36*brson joined #nim
17:11:54*HmmThatsOdd joined #nim
17:15:17*dyce quit (Ping timeout: 276 seconds)
17:17:14*wh1t3r0s3 quit (Ping timeout: 276 seconds)
17:21:13*yglukhov joined #nim
17:22:25*wh1t3r0s3 joined #nim
17:25:33*yglukhov quit (Ping timeout: 250 seconds)
17:29:06*nchambers is now known as sillytime
17:30:51*pregressive joined #nim
17:43:46*dyce joined #nim
17:43:47*libman joined #nim
17:45:30dycenice --> https://glot.io/new/nim
17:48:27federico3ohh
17:49:44libmanAnyone use Facebook? Hope you share - https://www.facebook.com/software.libman.org/posts/498575080334476 ;-P
17:57:58cheatfate_Araq_, can i use channels in singlethreaded environment?
17:58:17Araq_cheatfate_: hmmmmm no.
17:58:28Araq_but we can patch the stdlib.
17:58:42Araq_so that they are always available.
18:00:17*kingofoz quit (Read error: Connection timed out)
18:01:00*kingofoz joined #nim
18:07:50*libman left #nim (#nim)
18:48:44*rok joined #nim
18:50:50Araq_kingofoz: ported it to urho 1.5, was a piece of cake
18:53:57dom96dyce: nice, but after a couple of runs: "fork/exec /usr/bin/nim: resource temporarily unavailable"
19:04:18*rok quit (Ping timeout: 276 seconds)
19:07:05*alex_______ quit (Quit: Page closed)
19:09:27*BitPuffin quit (Read error: Connection reset by peer)
19:09:47*aziz quit (Remote host closed the connection)
19:30:30*rok joined #nim
19:40:54*yglukhov joined #nim
19:46:03*yglukhov quit (Ping timeout: 240 seconds)
19:53:08*yglukhov joined #nim
20:06:26*rok quit (Quit: rok)
20:51:43*yglukhov quit (Remote host closed the connection)
21:15:11*tinAndi joined #nim
21:18:38*pregressive quit (Remote host closed the connection)
21:18:57*pregressive joined #nim
21:26:51*Jesin quit (Quit: Leaving)
21:32:06*desophos joined #nim
21:33:47*Jesin joined #nim
21:35:56*Jesin quit (Remote host closed the connection)
21:36:24*Varriount quit (Ping timeout: 276 seconds)
21:36:24*Matthias247 joined #nim
21:37:04*Varriount joined #nim
21:48:11*elrood quit (Remote host closed the connection)
21:50:05*saml quit (Remote host closed the connection)
21:52:13*yglukhov joined #nim
21:56:39*yglukhov quit (Ping timeout: 246 seconds)
21:56:52*Jesin joined #nim
21:57:38cheatfate_dom96, i think to add complete_soon() function to future so it callback call will be queued() and executed in context of pool() function, what do you think?
21:59:32cheatfate_then it will be possible to replace "immediate completion" ->complete() to ->complete_soon() and problem with stack and recursion will be resolved
22:00:30cheatfate_and this could not break existing projects which are using asyncdispatch
22:07:40*silven joined #nim
22:10:18*Matthias247 quit (Read error: Connection reset by peer)
22:20:07*gokr joined #nim
22:26:31*tinAndi quit (Quit: ChatZilla 0.9.92 [Firefox 45.0.2/20160407164938])
22:43:51*HmmThatsOdd quit (Quit: Leaving)
22:53:38*yglukhov joined #nim
22:59:47*yglukhov quit (Ping timeout: 276 seconds)
23:15:12*gokr quit (Ping timeout: 276 seconds)
23:19:10*pregressive quit (Remote host closed the connection)
23:28:45*darkf joined #nim
23:38:20*ephja quit (Ping timeout: 268 seconds)
23:43:03*space-wizard quit (Ping timeout: 246 seconds)
23:44:30*space-wizard joined #nim
23:47:05*Trustable quit (Remote host closed the connection)
23:52:34*space-wizard quit (Ping timeout: 250 seconds)
23:57:58*space-wizard joined #nim
23:59:11*Demon_Fox joined #nim