<< 04-09-2015 >>

00:09:43*boopsiesisaway is now known as boopsies
00:10:16*boopsies is now known as boopsiesisaway
00:12:03*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:12:49*irrequietus quit ()
00:19:17*wuehlmaus quit (Ping timeout: 256 seconds)
00:20:43*wuehlmaus joined #nim
00:21:07*wuehlmaus is now known as Guest74945
00:29:43*yglukhov joined #nim
00:34:13*yglukhov quit (Ping timeout: 252 seconds)
00:48:40*brson quit (Read error: Connection reset by peer)
01:02:10*bendiken quit ()
01:03:46*saml_ joined #nim
01:10:52*drewsrem quit (Quit: Leaving)
01:15:23*askatasuna quit (Ping timeout: 256 seconds)
01:15:37*gmpreussner|work quit (Read error: Connection reset by peer)
01:16:05*gmpreussner|work joined #nim
01:55:01*chemist69_ joined #nim
01:57:55*chemist69 quit (Ping timeout: 246 seconds)
02:08:06*infinity0 quit (Ping timeout: 240 seconds)
02:13:19*NimBot joined #nim
02:19:35*infinity0 joined #nim
02:21:19*Demon_Fox quit (Quit: Leaving)
02:26:52*stomplop` joined #nim
02:29:47*stomplopster quit (Ping timeout: 265 seconds)
02:40:14*DeerGod is now known as nchambers
02:44:28*Kingsquee quit (Ping timeout: 246 seconds)
02:57:04*stomplop` quit (Ping timeout: 246 seconds)
03:04:36*saml_ quit (Quit: Leaving)
03:09:34*ohmibod_ joined #nim
03:09:40*ohmibod_ quit (Remote host closed the connection)
03:10:44*Kingsquee joined #nim
03:18:39*yglukhov joined #nim
03:23:03*yglukhov quit (Ping timeout: 255 seconds)
03:28:34*jck quit (Ping timeout: 246 seconds)
03:28:55*Xe quit (Ping timeout: 246 seconds)
03:31:41*jck joined #nim
03:34:51*Xe joined #nim
03:35:53*vega_nsk joined #nim
03:49:58vega_nskHow can i convert varargs[T] to seq[T]?
03:50:47*askatasuna joined #nim
04:03:51*ohmibod_ joined #nim
04:04:48*ohmibod_ quit (Remote host closed the connection)
04:13:03*Demon_Fox joined #nim
04:14:10*ohmibod joined #nim
04:17:22*darkf joined #nim
04:17:56Varriountvega_nsk: Well, you could create a new sequence and copy the arguments into it.
04:18:11Varriountvega_nsk: Why do you need to do that?
04:18:14*askatasuna quit (Quit: WeeChat 1.2)
04:19:54VarriountAraq: Remind me again why we use NSIS?
04:21:30vega_nskVarriount, I need to make recursive call of varargs function with lesser arguments count
04:21:55Varriountvega_nsk: You're asking for trouble that way. Canyou show me the source code?
04:26:20vega_nskVarriount, I'm porting the exercises from "Functional programming in scala" to nim. So recursive call with some rest of arguments - it's quite common thing here. Wait a minute, I'll make a minimal example
04:31:42vega_nskVarriount, here it is: https://gist.github.com/vegansk/ac3b44e85ac5d2c50f0f
04:32:44Varriountvega_nsk: Is that... a linked list?
04:33:33Varriountvega_nsk: Also, I'm assuming you're not using a 'for' loop because of reasons?
04:35:44*endragor joined #nim
04:36:29*endragor_ joined #nim
04:38:52vega_nskVarriount, yes and yes. The reason is to show my friends, scala programmers, that nim can do almost the same things as scala in functional programming, so I'm trying to do it as close as possible to scala code
04:39:29Varriountvega_nsk: Hm. What kind of balance do you want regarding efficiency VS scala-ness?
04:39:53*endragor quit (Ping timeout: 244 seconds)
04:39:53Varriountvega_nsk: Because creating a new sequence on the heap for each node in the list is not going to be pretty.
04:41:12vega_nskVarriount, it's not about efficiency for now. I imagine all the problems of this approach :-)
04:41:53Varriountvega_nsk: Ok, but don't say I didn't warn you. I'm not responsible for any core meltdowns or power outages the solution may cause.
04:43:18vega_nskVarriount, shure, my electric generator is full of gasoline :-)
04:46:55Varriountvega_nsk: The thing is, Nim doesn't have an 'expansion' operator for sequences. varargs computation is done at compile-time.
04:48:30*endragor_ quit ()
04:50:11vega_nskVarriount, ok. Seems that solution is to use seq[T] as initList parameter type. It would be nice to describe this moment in the documentation.
04:51:26Varriountvega_nsk: Here's the most efficient way, while still using recursion: https://gist.github.com/Varriount/cc34b4c5b77c8fab4d0c
04:52:23VarriountI don't know how to do it with only one procedure. It would probably require casting.
04:54:38vega_nskVarriount, wow. It's what I need. Thanks!
04:58:11Varriountvega_nsk: Personally, I dislike using recursion unless the situation requires it (think AST traversal or tree walking)
05:03:13vega_nskVarriount, I'm totally agree with you. But it's not production, it's just for fun. And maybe it will result in the creation of jvm backend for nim, and then rewriting some scala code to nim (dreams :-) )
05:05:15vega_nskpigmej, what can you say about https://github.com/nim-lang/nim-mode/pull/61 ?
05:17:52*gsingh93_ joined #nim
05:34:50AraqVarriount: because it's the best installer software out there
05:57:15*Miruya joined #nim
06:04:09Araqhi Miruya welcome
06:04:46MiruyaHello and thanks
06:24:42*vendethiel joined #nim
06:36:03*NimBot joined #nim
06:44:59*Guest74945 is now known as wuehlmaus
06:46:15Araqer ... is it too late to change the definition of os.ExeExt to include a dot?
06:47:01Araqoh well, yes it is
06:52:00*jszymanski joined #nim
07:01:31*irrequietus joined #nim
07:09:13*filcuc joined #nim
07:09:13gokr1Good morning!
07:09:23Araqhey
07:09:26*gokr1 is now known as gokr
07:09:49AraqI added NimScript support to Nimble and testing it with my lexim project
07:10:10gokrSo... NimScript I think I grok - its ... basically Nim VM running scripts, right?
07:10:16Araqyup
07:10:19gokrAs in - I don't have to compile.
07:10:23Araqyup
07:10:27gokrAny other specific differences?
07:10:45gokrIts neat not having to compile of course, just wondering.
07:10:50Araqthere is an extension to system.nim for scripting support
07:11:04gokrAh, you mean, for using it in Nim programs.
07:11:17Araqno, for Nim scripts
07:11:24gokrAh, oh.
07:11:28gokrFiles etc, right.
07:11:36Araqright and tasks
07:11:42Araqtask tests:
07:11:44keylehow fast is the exec?
07:11:56keyleis it jitted or interpreted?
07:12:14Araqit uses Nim's register based bytecode VM
07:12:15gokrSo... people were quite excited about NimScript - but... am I missing some other obvious cool aspect of it?
07:13:32AraqUnfortunately, no one can be told what NimScript is. You have to see it for yourself.
07:13:55Araq;-)
07:14:04gokrBut... can it do something I can't do with Nim? I mean, I can do "nim c blabla && ./c" right?
07:14:24gokrAnd if its meant to do build scripts - I need to have a C compiler around anyway.
07:15:05gokrYou know I am definitely not an enemy of VMs - I just wanted to see if I am missing something.
07:15:17Araqit replaces:
07:15:28Araq* Nim's traditional .cfg configuration file system.
07:15:33Araq* Nimble files.
07:15:49Araq* makefiles or similar.
07:15:53*^aurora^ joined #nim
07:16:13Araq* bat or sh files for building
07:16:25gokrOk, so... this is basically the "Let's just use code instead of various document formats" approach - which I of course 100% support - being a Smalltalker its natural.
07:16:54gokrSame drive can be seen in many interpreted language communities, like say Ruby.
07:17:15gokrWhile language communities like Java and C++ go overboard on the XML/JSON train.
07:17:16Araqyes, we're not doing anything new really
07:17:40Araqexcept that I always wanted static typing for scripting ;-)
07:17:52gokrBut I like the fact that *you* like the "lets use code instead".
07:18:24AraqNim definitely took some lessons from more dynamic languages :-)
07:18:30gokrIts yet another step towards the live coding world of Smalltalk ;)
07:18:43gokrAlthough of course - with the specific Nim characteristics.
07:18:55VarriountAraq: Well, did you know that nsis has a c plugin interface?
07:19:09gokrVarriount: Hey man, long time no see.
07:19:28VarriountHi gokr.
07:19:50gokrWhich reminds me my Linux 32 bit build slave is in a bag next to my feet...
07:19:55Varriountgokr: Sorry, between burglaries, school, and family events, I've not had much time to chat on IRC.
07:20:13gokrNo need to be sorry, just nice to see you again! :)
07:20:16gokrBurglary? Ouch.
07:20:23Araqin fact, I like to argue that static checking is even more useful in a scripting setting since you usually have no tests for your scripts
07:20:44gokrIf it doesn't slow you down in whipping it up - sure.
07:20:44keylethis is exciting
07:20:55keylejust not sure why, the compiler is so fast
07:21:01keyleand tells me I've done something stupid
07:21:06keylewhy find out at runtime?
07:21:20gokrAs Alan Kay always said - "its not that I don't like static type systems. They just still suck too much." - well, he said something like that.
07:21:40gokrkeyle: Its not that simple.
07:21:50VarriountI must admit, lack of static typing is something of a burden in Python too.
07:22:12Araqkeyle: when I develop the compiler, if it's not tested, it's wrong, static typing doesn't help much tbh.
07:22:31gokrIMHO the major downpoints of static typing is a) Gets in your way of exploratory design or larger refactorings, slows you down and b) Truly kills the 100% live coding experience.
07:22:40AraqHaving said that, it still helps to produce efficient code and maintainability.
07:22:49gokrIf you can make a static type system that handles those two - then you are golden.
07:23:37gokrRight, lots of studies show that "classic" static typing only finds a certain limited set of bugs.
07:23:50AraqVarriount: so how much of the new Win wrapper has been lost?
07:23:52gokrNim can of course do a bit more - effects system being very promising I guess.
07:25:18gokrkeyle: Just as to explain what I mean - currently I am fixing bugs in our 3D virtual world system. I am running it live and I am at the same time modifying code while its running, and can see effects immediately without doing anything. 3D objects "jump into the right spot" etc in front of me.
07:26:21VarriountAraq: All of it.
07:26:39Araqno chance of getting your laptop back? :-(
07:26:50gokrAlmost all game engines use script languages in order to be able to do this, because otherwise productivity would simply be insanely low. Since making games (and 3D worlds) involve a lot iterative adjustments.
07:26:58VarriountWell, I'm looking at local listings
07:27:18gokrYou lost a laptop and code on it? Shit.
07:28:20AraqVarriount: well we can make the best out of it and give c2nim better preprocessing support
07:28:45Araqso that if you do it again, at least you don't have to mess with 300char regexes
07:29:24gokrkeyle: Our current architecture is Smalltalk calling out to a Nim layer that in turn uses Urho3D. 90% of our coding is currently done in Smalltalk, and... well, lets just say I am very interested in solutions to get the similar liveness when our codebase moves more and more to Nim.
07:30:29Miruya300char regex? I think I would cry
07:30:43gokrkeyle: Whenever I need to modify the Nim/Urhonimo/Urho3D layer, I need to shutdown and restart - which takes a bit of time. Its a client server system so ... I need to login, get a new session blabla, get into the world, find the stuff I was doing or redo it etc etc.
07:31:20VarriountMiruya: Most of it was static characters.
07:32:18VarriountMiruya: The... interesting part was using recursion and subroutines
07:32:40MiruyaVarriount: That sounds..."fun"
07:34:11VarriountMiruya: Basically, large parts of the Windows API are generated by the MIDL compiler, which generates sections of C & C++ code.
07:34:43VarriountAnyway, goodnight.
07:36:34VarriountMiruya: To make creation of a Windows API wrapper feasable, c2nim needs to have a way to statically skip sections of #ifdef statements
07:37:22MiruyaVarriount: Ah, alright thanks. Good night
07:49:50*vendethiel quit (Ping timeout: 240 seconds)
07:54:27*gsingh93_ quit (Quit: Connection closed for inactivity)
08:08:08*aziz joined #nim
08:08:51*xcombelle joined #nim
08:21:19*filcuc_ joined #nim
08:21:59*yglukhov joined #nim
08:23:45*filcuc quit (Ping timeout: 240 seconds)
08:24:50*yglukhov quit (Remote host closed the connection)
08:25:13*yglukhov joined #nim
08:33:05*filcuc_ quit (Ping timeout: 240 seconds)
08:37:23*yglukhov quit (Remote host closed the connection)
08:41:39*yglukhov joined #nim
08:46:20*gmpreussner|work quit (Read error: Connection reset by peer)
08:46:23*yglukhov quit (Ping timeout: 264 seconds)
08:47:08*gmpreussner|work joined #nim
08:54:05*Arrrr joined #nim
08:56:56Araqhrm if Nim reads nimble/nims files it can detect check the Nim version requirements and adapt
08:57:47Araqso stuff written for 0.11.x can continue to work even if we change the language. I wonder how feasible this is.
08:58:07*Ven joined #nim
08:58:53*aziz quit (Remote host closed the connection)
08:58:55OnOgokr: Unity which I believe is most popular nowadays use C#, which is statically types and not a scripting lang, but I understand that being able to "hotfix" game logic without restarting game is really cool thing
08:59:35*Trustable joined #nim
08:59:54gokrOnO: Sure, I know. They embed mono. But most engines use Lua or do other dynamic reloading tricks.
09:00:25ArrrrIt is possible to "connect" nimscript to nim?
09:00:36gokrWe considered Mono and I looked at several game engines using C#. NeoAxis was the most interesting one, but we eventually decided not to go into C# - and here we are :)
09:00:52OnOgokr: Most engines, does not mean most games, I think these engines are niche
09:01:44AraqOnO: as far as I can tell most games build upon on one of the big existing engines
09:01:48OnOgokr: but in fact you may keep your game logic in a DLL, C4 does that and its C++, it can reload the logic without killing the app
09:02:20OnOAraq: this is what I am trying to say, and Unity is far most popular using C# and mono
09:02:24gokrYes, I know. And we are considering to use similar approaches with Nim - which can even be non destructive since we can split out procs/methods in our own dlls.
09:02:48*BitPuffin|osx quit (Ping timeout: 255 seconds)
09:03:04gokrSo in theory we could preserve objects, as long as we don't mess up their structure.
09:03:13OnOgokr: only thing that DLL approach can handle is changing class/type layout, as long you change only the code/methods its fine
09:03:22OnO:)
09:03:49gokrI know. In Smalltalk we can modify anything though :)
09:04:45OnOErlang too, but honestly it is always deal between performance/flexibility
09:05:07OnOSmalltalk is such a holy grail, but noone uses it in real applications
09:05:32gokrWe do :)
09:06:08gokrOnO: Also, Bitsquid (now bought up by... the AutoCad guys) went 100% all in on Lua: https://www.kth.se/social/upload/5289cb3ff276542440dd668c/bitsquid-behind-the-scenes.pdf
09:06:56gokrI even checked with the Bitsquid guys if their engine could be licensed for a ... non astronomical price, but not at that time. Then they were bought :)
09:07:35*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:09:37gokrOnO: And all that "noone uses it in real applications" is bs. Sure, its much less common these days - but it was quite big and there is nothing inherent in Smalltalk making it non suitable.
09:10:55gokrUnfortunately though the commercial players buckled under the pressure of Sun (Java) and the open source alternatives weren't evolved enough to pick up those existing customers.
09:11:09OnOthis is Lua, not Smalltalk, do you know some present app/game using Smalltalk
09:11:19OnObtw. the slides are pretty interesting
09:11:23gokrOur system is written in Smalltalk.
09:12:19gokrYes, Bitsquid is an interesting engine, but it was swallowed by Autodesk.
09:12:43gokrhttp://www.cgchannel.com/2014/06/autodesk-buys-bitsquid-game-engine/
09:13:19OnOokay granted, probably I miss part of the conversation, what system?
09:13:35gokrTerf
09:14:10gokrhttp://3dicc.com
09:14:29gokrAlthough our new website is not there yet - our current is soo... ugly :)
09:16:10gokrMight be nicer to watch: https://www.youtube.com/watch?v=yNFwF13yBIg
09:16:11ohmibod[3D ICC Terf Short Movie for New HUD Vendor Wearality Kickstarter (00:00:57)]
09:16:20gokrYeah.
09:16:26gokrWe have too few good movies out there.
09:16:40Araqwe have an ohmibod? o.O
09:16:48OnOheh
09:17:01gokrThe product is an evolution of Teleplace - and one can find more movies searching for "Teleplace".
09:17:46OnOgokr: probably it would deserve some explanation, why you've chosen Smalltalk, and how it is goes so far, etc. etc.
09:18:08OnOhonestly I dunno what's the current status on Smalltalk VMs, how do they perform comparing to other
09:18:18gokrWell, I have worked with Smalltalk since 1994 approximately. So I can tell you all you want to know.
09:18:38Araqok, but we can move this to #nim-offtopic ?
09:18:43gokrOops, sorry
09:19:26gokrOnO: Join offtopic and I can tell you a bit
09:19:27OnOsome of my Smalltalk encounters were during my studies around 2000 :), anyway Q is if you would choose Smalltalk again if you were do remake this project from scratch
09:19:52OnOokay going to #nim-offtopic
09:21:44*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:30:53*yglukhov joined #nim
09:30:59*yglukhov quit (Remote host closed the connection)
09:31:14*yglukhov joined #nim
09:31:18*yglukhov quit (Remote host closed the connection)
09:31:52*yglukhov joined #nim
09:32:54*NimBot joined #nim
09:37:48yglukhovAraq, I've been thinking about nimvm. And I find my solution more clumsy than previously. Allowing only "when nimvm" construct may lead to duplication of code. Even considering my changes to seq.delete and add, there will be code duplication.
09:42:33ekarlsoyou guys adding lua support for vim ?
09:42:58yglukhovno
09:43:27ekarlsoyglukhov: what you working on then ?
09:45:01yglukhovekarlso: https://github.com/nim-lang/Nim/pull/3286
09:45:52Araqyglukhov: it's not like there are many alternatives to this solution
09:45:53vega_nskAraq, Is there any plans to support tail call optimisation in nim compiler, or it's up to backend?
09:46:16Araqup to backend
09:46:30Araqfor the foreseeable future
09:47:48*NimBot joined #nim
09:49:34yglukhovAraq: how about the following statement: "nimvm may be used only in when expression, i.e. visually". if nimvm is used in a function that is a part of when expression, it's an error.
09:49:49yglukhovis it possible to do such check?
09:50:06Araqsure
09:50:15Araqand it's not hard either
09:50:51yglukhovcool, then it would be much more flexible than my initial solution
09:50:54Araqsemmagic: of mNimvm: localError(n.info, "illegal context for 'nimvm' magic")
09:51:18Araqand you check for mNimvm much like you currently check for the "nimvm" identifier
09:54:33yglukhovok, i'll try that
09:55:54*yglukhov quit (Remote host closed the connection)
10:02:56*NimBot joined #nim
10:07:34*X67r joined #nim
10:11:40*gokr quit (Quit: Leaving.)
10:11:48*yglukhov joined #nim
10:12:25*^aurora^ joined #nim
10:16:31*gokr joined #nim
10:18:07yglukhovAraq: do I have to define nimvm as a const in system.nim?
10:18:19yglukhovand give it a magic pragma?
10:18:25Araqyeah
10:18:35Araqyou also need to add the magic to ast.nim
10:18:56yglukhovok
10:23:44NimBotnim-lang/Nim devel 178275f Araq [+1 ±5 -0]: split os into os and ospaths parts; ospaths is available for NimScript; better NimScript support
10:44:11*Ven joined #nim
11:02:35*NimBot joined #nim
11:22:46*NimBot joined #nim
11:29:06*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:30:12*yglukhov quit (Remote host closed the connection)
11:31:14*BitPuffin joined #nim
11:32:14*Kingsquee quit (Quit: http://i.imgur.com/EsXzoum.png)
11:35:27*^aurora^ joined #nim
11:49:08*vega_nsk quit (Quit: Ухожу я от вас (xchat 2.4.5 или старше))
11:50:49*yglukhov joined #nim
11:55:13*yglukhov quit (Ping timeout: 250 seconds)
12:10:33*yglukhov joined #nim
12:12:58*Ven quit (Read error: Connection reset by peer)
12:13:33*Ven joined #nim
12:17:49keyleany doco/tuto on nimscript?
12:18:59reactormonkkeyle, it runs on the nim vm, so no ffi, otherwise it's just good old nim
12:19:14*yglukhov quit (Remote host closed the connection)
12:24:34*yglukhov joined #nim
12:25:08*golak joined #nim
12:30:49*xcombelle quit (Remote host closed the connection)
12:34:01*xet7_ quit (Ping timeout: 246 seconds)
12:35:02*raza joined #nim
12:51:24*FedeOmoto quit (Ping timeout: 255 seconds)
13:03:45*Ven quit (Disconnected by services)
13:20:25*Sembei joined #nim
13:23:40*keyle quit (Quit: http://twitter.com/keyle/)
13:41:40*matkuki joined #nim
13:41:47*Ven_ joined #nim
13:41:59*yglukhov quit (Remote host closed the connection)
13:52:02*yglukhov joined #nim
13:55:29*matkuki quit (Quit: ChatZilla 0.9.92 [Firefox 40.0.3/20150826023504])
13:56:22*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:11:44*yglukhov quit (Remote host closed the connection)
14:12:26*yglukhov joined #nim
14:12:35*Ven_ joined #nim
14:14:33*matkuki joined #nim
14:31:12matkukiAraq: Got time for a question?
14:31:22Araqshoot
14:32:54Araqmatkuki: that means "yes"
14:33:13matkukigot it, thanks. just writing the code.
14:33:46*yglukhov_ joined #nim
14:34:40matkukihttps://bpaste.net/show/497eb64af4dd
14:34:41matkukiWhy is it that when the last attribute in the 'Line' type is added(line 9), the code gets 50% slower?
14:34:43matkukiThe New_Line proc is used a couple of hundred times in a cycle.
14:34:44*yglukhov_ quit (Read error: Connection reset by peer)
14:35:20reactormonkmatkuki, because otherwise it's fixed size, so the compiler can align it - just a random guess
14:36:26matkukireactormonk: Oh. Araq, is this correct?
14:36:42*yglukhov quit (Ping timeout: 255 seconds)
14:37:49Araqno.
14:38:27matkukiBtw, if the New_Line proc is replaced with just 'Line(point_from:x, point_to:y, ...)', the performance stays the same even when adding the attribute.
14:38:44Araqyour Line object without 'locked_objects' has no GC'ed data types and so the compiler can generate memcpy etc
14:39:14Araqwith a GC'ed datatype it uses the slower assignments with write barriers etc
14:39:30Araqand yes if you inline the newline away, things can get back up to speed
14:39:55Araqthat said, the compiler isn't yet as smart as it should be when it comes to move vs copy
14:40:30Araqso eventually it will make no difference
14:42:06matkukiAraq: Thank you. It's been eating at me for days.
14:44:12Araqmatkuki: you can make New_Line a template in the meantime, that enforces inlining too
14:44:51matkukiAraq: Already did a few days ago. I found that during experimentation, thanks.
14:45:14Araqcould have asked me earlier :P
14:46:16matkukiI tried, but everytime I came here, you were away. Had a fun discussion with dom96, though.
14:47:10*xcombelle joined #nim
14:48:43matkukiAraq: Another question: Types in different type block cannot reference each other, is there a way to 'merge' all type blocks in a module?
14:49:05matkukisorry, 'different type blocks'.
14:49:14Araqyeah, but it needs to be top level type blocks
14:49:32matkukiCan you give me an example?
14:49:38Araq{.noforward: on.}
14:49:47Araqtype Foo = Bar
14:49:50Araqtype Bar = int
14:49:54matkukiCool, let me try.
14:50:12Araqit's fragile, for example:
14:50:27Araqconst X = 10 # must come before the .noforward
14:50:43Araq{.noforward: on.}
14:50:45Araqtype A = array[X, int]
14:51:18Araqthe type sections can also be in include files btw
14:51:32Araqbut again, the include statement must be toplevel for this to work
14:51:41Araqso the following doesn't work:
14:51:44Araqwhen true:
14:51:54Araq include file_with_typesection
14:52:32Araqalso, you're only allowed to use it when you create a PR which documents this thing :P
14:54:08matkuki:) Got it.
14:54:09matkukiDoes it work if new type blocks are created with a macro? Like flaviut's OOP macro, for example.
14:54:34Araqnope
14:55:20Araqsad, I know, this noforward is mostly a hack to play with how it could work out eventually
14:56:10*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:56:36matkukiSo it a future feature. Good to know.
14:57:07Araqwell with the current limitations it's still useful today
14:57:39*NimBot joined #nim
14:59:10*Ven_ joined #nim
15:00:05ArrrrWhat is the reason of locklevel warnings and how can i solve them?
15:00:30AraqArrrr: related to methods?
15:00:35ArrrrYes
15:00:56Araqjust disable it {.warning[LockLevel]: off.} or similar
15:01:08ArrrrOk
15:01:15ArrrrThanks
15:01:32matkukiAraq: I also have a request. When there will be a version 2 of Nim, it has to be called 'nimm2'!
15:01:54Araqha ha ha, a good one
15:02:06matkukiSaw the commercial a couple of weeks ago :)
15:02:28Araqit's a very old product here in Germany
15:04:02matkukiNow everytime I walk by the candy section in SPAR, I think of Nim.
15:04:12Araqthat's good
15:04:40AraqArrrr: I'm about to fix methods. and preference of what the new pragma should be called?
15:04:50AraqI am thinking of either:
15:04:53Araq.anchor
15:04:55Araq.disp
15:04:58Araq.dispatcher
15:05:08ArrrrWhat is that pragma going to do
15:05:16Araqthe idea is that you need to annotate the base method explicitly
15:05:26Araqsomething like:
15:05:42*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:06:11Araqmethod m(x: RootRef) {.anchor.} = ...
15:06:27Araqmethod m(x: Subtype) = ...
15:06:42ArrrrSo, if you dont use this pragma, it cannot work with threads?
15:06:43*^aurora^ joined #nim
15:07:00Araqhrm? has not much to do with threads
15:07:18Araqbut the anchor needs to specify the effects for all overriding methods
15:07:46ArrrrI thought locklevel warnings was related to threads
15:07:54Araqyes it is
15:08:07Araqbut lock levels are just an effect
15:08:17Araqthe problem exists for all effects
15:08:50*allan0 quit (Ping timeout: 240 seconds)
15:10:32ArrrrI don't know, im not familiarized with them. In fact, i have to say it is not common for me to use inheritance. So maybe im missing a lot of stuff about methods
15:13:00*darkf quit (Quit: Leaving)
15:15:06OnOAraq: stupid question - why `not nil` isn't default? and we have `optional` expressing that ref can be nil
15:15:27OnOdon't we deal with refs/ptrs that cannot be nil more often?
15:15:52Araqthat's a complex topic
15:15:59OnOlooking at Nim's stdlib `not nil` isn't really used often
15:16:11Araqthat's for historic reasons
15:16:14OnOhave a look at this PR https://github.com/nim-lang/Nim/pull/3261 I really do NOT like to be merged
15:16:37*jszymanski quit (Quit: computer sleeps...)
15:16:40OnOits about implicit string -> cstring when string is nil the PR wants to convert it to NULL (extra check)
15:17:34OnOAraq: would you consider deprecating `not nil` at all and making all refs not nil unless `optional` (or some other keyword eg. `or nil`)
15:18:01Araqyeah
15:18:20Araqthere is at least 1 serious bug with the "not nil" prover
15:18:30Araqbut I guess that shouldn't stop us
15:19:50OnOokay that's cool, honestly I really like Swift optionals I think bringing them not Nim as `or nil` would be great
15:20:21Araqhowever, in theory, a not nil ref shouldn't be as common as in -say- Java which value based datatypes
15:20:28Araq*which lacks
15:20:49OnOwe may have also this if let xNotNil = xOrNil:
15:21:01OnOor even if let x = x:
15:21:08Araqwe have flow typing instead
15:22:28*allan0 joined #nim
15:22:36*brson joined #nim
15:22:38Araqalso there is still the problem with setLen
15:22:57Araqvar s: seq[ref T not nil]
15:23:06AraqnewSeq(s, 10) # congrats
15:23:41Araqfor i in 0..s.high: s[i] = foo() # you just created a type checking mess
15:24:56OnOyeah, I see... heh, default constructors or initializers, nightmare
15:25:12Araq'nil' gives us the axiom of choice
15:28:06Araqthis null problem is totally overblown, caused by languages where everything is a pointer/reference
15:29:05Araqnull actually makes language definitions much simpler with a reasonable price in type unsafety
15:30:22*yglukhov joined #nim
15:30:38OnOsure thing, doing calling: someFunThatGetsNonNil( otherFunThatMayReturnNil() ) should be catched by compiler
15:30:53OnOand this is what swift does
15:31:12OnOit just forces you to do checks when they are necessary
15:33:01*NimBot joined #nim
15:33:43Araqwhat's your opinion on the .anchor pragma?
15:35:18OnOI am not aware of it, is it some PR?
15:35:36Araqno, it's my attempt to fix Nim's methods
15:37:01Araqit also makes things much clearer, cause the .anchor method needs all these effect annotations
15:38:03OnOdo you have doc about that idea? I'd gladly read about that
15:38:24Araqno, sorry
15:39:10Araqbut the basic problem is this:
15:39:31Araqm() # which effects to infer here? we don't know which 'm' is called since its dynamically bound
15:39:39federico3how can a library detect (at compile time) if it's being used in an async loop?
15:40:04Araqso we use m's *anchor* definition for the effects
15:40:27Araqand every m that overrides the anchor must adhere to these effects
15:41:16yglukhovAraq, this nimvm is constantly driving my brain into endless recursion. My latest conclusion is that when nodes are just wrong for this stuff. Depending on nimvm forces when semantics up until codegen. Moreover, semantics can actually be run for different branches of when. So, problem #1. Calling semantics from codegen i could not do yet, because of forwarding restrictions. Problem #2. Code following after when may depend on when semantics.
15:41:55yglukhov* s/forces/defers
15:42:25Araqfederico3: async doesn't produce an effect, so you have no chance of detecting that. why?
15:43:16Araqyglukhov: cannot follow. you solved this problem already in your PR yesterday
15:43:51yglukhovno, it's wrong.
15:44:12Araqwhy?
15:44:32yglukhovwhen nimvm:
15:44:39yglukhov var i = 0
15:44:41yglukhovelse:
15:44:45yglukhov var i = 123
15:44:47yglukhovinc i
15:45:10Araqthat's a totally reasonable limitation
15:45:30Araq'when nimvm' is a new construct in the language
15:45:44Araqwhich doesn't use a keyword cause it's so rarely needed
15:46:08yglukhovok, that was problem #2. what about #1?
15:46:44yglukhovwhen nimvm and someOtherStuff: ...
15:46:54*Arrrr quit (Quit: WeeChat 1.2)
15:46:56Araq#1 makes no sense, the sem'check is simply following both branches
15:47:12Araqand the codegen doesn't have to call semcheck
15:48:04yglukhovnimvm-dependant whens defer expression evaluation to codegen.
15:48:28yglukhovevery codegen should evaluate test expression to chose the correct branch
15:50:34yglukhovam i right here?
15:50:59Araqno, and you don't do this in your PR either
15:52:02yglukhovBut that's what i'm trying to do now.
15:52:28yglukhovbecause otherwise when nimvm code will not be DRY, you know ;)
15:52:46Araqwet is better anyway
15:53:27yglukhovthats disappointing.
15:53:49Araqwell you can make it smarter
15:54:04yglukhovactually, i think i've got an alternative approach. like in D =)
15:55:35Araqyou only need to ensure that nimvm isn't folded at all, and then you need to transform the when into an 'if' and ... do ... something smart in the backends
15:59:05*Araq likes .anchor best
16:01:37yglukhovAraq, thats basically what D does, except D doesnt pretend that it's a when. in D you should use it in if
16:02:42yglukhovand then backends can gen nimvm to true/false. and they might (or not) do some optimization on if nimvm nodes.
16:04:26yglukhovhow can i restrict folding of const? =)
16:05:51Araqdeclare it a 'let' in system.nim
16:06:11yglukhovoh ok
16:06:33yglukhovbut do you like the idea in general?
16:06:51Araqnot really but why not
16:07:30yglukhovwell, me neither, but now i can't see anything better.
16:07:56AraqI don't see your DRY problem
16:08:27Araqyou can always put the same branches in a template and minimize the amount of repetions
16:08:56Araqand as you said, we're talking about a niche feature here
16:09:54*yglukhov quit (Remote host closed the connection)
16:11:43*yglukhov joined #nim
16:12:41yglukhovdo you suggest i just leave as it is?
16:12:51yglukhovexcept for the magic part, of course
16:13:19Araqyeah
16:14:03Araqit's a nasty problem with only nasty solutions
16:15:04yglukhovok then
16:20:08*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:25:38*Jehan_ joined #nim
16:29:32yglukhovAraq, pr updated.
16:30:59*enquora joined #nim
16:39:19Araqyglukhov: that's a very lazy update :P
16:39:48yglukhovoh come on, it wasnt intended to be the final one :P
16:41:06Araqoh, then don't ping me please
16:41:38*boopsiesisaway is now known as boopsies
16:42:30*Ven_ quit (Ping timeout: 240 seconds)
16:42:47*^aurora^ joined #nim
16:47:34Araqyglukhov: does https://github.com/nim-lang/Nim/pull/3283 fix http://forum.nim-lang.org/t/1610 ?
16:49:09yglukhovyeah, it seems realated. will test it as soon as come up fith final nimvm version.
17:01:35*kilon joined #nim
17:07:46yglukhovAraq. Can I check for ident magic before I run semantics on it?
17:15:05*yglukhov quit (Remote host closed the connection)
17:15:46*yglukhov joined #nim
17:15:48Araqnope, you need to check after semantics
17:23:14*xet7_ joined #nim
17:25:03yglukhovok, another question. vmgen handled nkWhen node before my changes. why?
17:25:49yglukhovcan i assume, that nkWhen was never a case there?
17:41:15Araqdunno
17:45:56*repax quit (Read error: Connection reset by peer)
17:58:42*saml quit (Quit: Leaving)
17:58:50*jszymanski joined #nim
18:01:14*jaco60 joined #nim
18:07:43*Sembei quit (Quit: WeeChat 1.4-dev)
18:10:41yglukhovAraq, my vm fix doesn't fix that bug with write to object. The problem is somewhere with global vm vars. There's no problem if this code is in a block.
18:14:09Araqyeah globals a a pain to support
18:17:18*yglukhov quit (Remote host closed the connection)
18:23:16*Matthias247 joined #nim
18:28:38*BitPuffin quit (Ping timeout: 244 seconds)
18:31:42*golak quit (Quit: leaving)
18:32:14*yglukhov joined #nim
18:34:09*ehaliewicz joined #nim
18:37:10*irrequietus quit (Ping timeout: 246 seconds)
18:47:03*NimBot joined #nim
18:54:33*ehaliewicz left #nim ("ERC Version 5.3 (IRC client for Emacs)")
19:02:54*irrequietus joined #nim
19:19:36*jszymanski quit (Quit: computer sleeps...)
19:19:42NimBotnim-lang/Nim devel a9f114c Adam Strzelecki [+0 ±1 -0]: osproc: Define and select spawn/fork same way... 7 more lines
19:19:42NimBotnim-lang/Nim devel 538fc04 Dominik Picheta [+0 ±1 -0]: Merge pull request #3285 from nanoant/patch/lib-pure-osproc-spawn-vs-fork-simplify... 2 more lines
19:22:56Araqdom96: any opinion on .anchor?
19:23:45dom96Araq: link to discussion?
19:24:00Araqread today's history please
19:24:31dom96IRC logs?
19:24:39Araqyes
19:30:24yglukhovAraq, isn't it better to mark overrides?
19:30:27*kilon quit ()
19:30:41yglukhovand consider non-overrides the anchor ones
19:31:02Araqyglukhov: but that would mean more annotations?
19:32:11yglukhovyes, but that would reduce the number of problems when changing base method wihtout changing all subclass methods gets unnoticed
19:32:45dom96hrm
19:33:00Araqhrm? the effect system would catch these things
19:33:02dom96Couldn't the compiler force all methods to have the same effects?
19:33:31dom96or more specifically all methods that are bound to a specific object inheritance hierarchy?
19:33:43Araqit tries to do that but there is also bugs caused by:
19:33:52Araqmethod m(x: Subtype) = ...
19:34:24Araqmethod m(x: RootRef) = ... # subtype's m is not attached to this, because the order is wrong
19:34:42Araqit's hard to fix but with .anchor we could easily produce an error at least
19:34:56Araq"method m has no anchor"
19:35:25dom96if you're creating a method like that second one
19:35:56dom96then surely the first m should have the same effects as the second one
19:36:09dom96because Subtype inherits from RootRef
19:36:40dom96which means that every other `m` whose `x` parameter is of type which inherits from RootRef has to have the same effects
19:36:48dom96Maybe that's too constrained
19:37:05dom96I never use methods though
19:40:19dom96if the order of the method declaration is the problem then surely this will be solved once we finally remove the need for forward declarations?
19:41:01Araqno, the problem also exists for cross-module method groups
19:46:55*Jesin quit (Quit: Leaving)
19:49:14dom96ok, anchor sounds good then
19:49:47dom96Might be worth asking on the forum what others think as well.
19:55:41*tankfeeder joined #nim
19:55:50tankfeederhi all
19:55:51Jehan_anchor, dispatch, dispatcher sound all good. I'd also offer up base as a possible alternative.
19:56:30Jehan_I don't think the name is terribly important, as long as it makes sense once you have read up on it.
19:58:06*brson quit (Ping timeout: 240 seconds)
19:58:35*Jesin joined #nim
19:58:35Araqhi tankfeeder
19:58:57*enamex joined #nim
19:59:56*xcombelle quit (Remote host closed the connection)
20:01:04*NimBot joined #nim
20:01:08dom96let's not use dispatch/dispatcher
20:01:25dom96might confuse people when dealing with asyncdispatch/asyncdispatcher
20:01:30dom96hello tankfeeder
20:03:05Jehan_dom96: True.
20:03:27*Mat4 joined #nim
20:06:55Araqhi Mat4
20:10:06Mat4hi Araq, it's some time. What's new ?
20:11:05*NimBot joined #nim
20:15:18*heinrich5991 quit (Ping timeout: 244 seconds)
20:15:18*Araq quit (Ping timeout: 244 seconds)
20:15:18*gmpreussner|work quit (Read error: Connection reset by peer)
20:15:18*mahlon quit (Read error: Connection reset by peer)
20:15:18*gmpreussner|work joined #nim
20:15:19*renesac quit (Ping timeout: 244 seconds)
20:15:34*johnsoft quit (Ping timeout: 244 seconds)
20:15:39*renesac joined #nim
20:16:08*Miruya quit (Ping timeout: 246 seconds)
20:16:09*mahlon_ joined #nim
20:16:10*Miruya joined #nim
20:16:19*heinrich5991 joined #nim
20:16:25*Araq joined #nim
20:17:15*chernozem joined #nim
20:17:33chernozemhi
20:17:49dom96hello chernozem
20:17:54chernozemwhat wrong with
20:17:57chernozem@[1, 2, 3, 4].each(echo)
20:18:16chernozemi got "Error: type mismatch"
20:20:29*yglukhov quit (Remote host closed the connection)
20:21:21AraqMat4: sorry I'm too tired to answer, plenty of new stuff
20:22:14dom96chernozem: The `each` procedure needs a closure proc.
20:22:28Mat4Araq: no problem
20:22:43*zeph quit (Quit: ZNC - http://znc.in)
20:23:13dom96chernozem: This closure proc also needs to return a value.
20:23:27dom96chernozem: `echo` is not a closure nor does it return a value
20:23:28dom96http://nim-lang.org/docs/system.html#each,openArray[T],proc%28T%29
20:23:45dom96`each` is also deprecated, you should use `map`
20:24:11dom96https://gist.github.com/dom96/291fe9d06669a025342c
20:24:14dom96That works.
20:24:20dom96But you're honestly better off just using a for loop.
20:25:13MiruyaAfter rebuilding from source a few times to make sure my changes weren't breaking anything... is the test suite breaking for anyone else on "/tests/testament/htmlgen.nim(141, 12) Error: undeclared identifier: 'writeLine'"?
20:25:37NimBotnim-lang/Nim devel 619ab0b Doran [+0 ±1 -0]: Include port in host header as expected
20:25:37NimBotnim-lang/Nim devel 37fe21b Dominik Picheta [+0 ±1 -0]: Merge pull request #3288 from Snowie/devel... 2 more lines
20:26:53*victor-rene joined #nim
20:27:10chernozemdom96, tnx a lot!
20:28:07AraqMiruya: old nim in your path?
20:28:24MiruyaWill check
20:28:40federico3Araq: could you please check if you received an email on [email protected] to subscribe to the nim-dev mlist?
20:29:30federico3hm, I just got a bounce: undeliverable address: unknown user: "[email protected]"
20:30:37dom96Araq: Can you login to namecheap account and see where the emails are forwarded for [email protected]?
20:30:44dom96*to your
20:31:13dom96wow, our analytics graph shows a clear dip in visitor numbers every weekend
20:31:24federico3Araq, dom96: they aren't being forwarded. I got a bounce when sending from my email address as well.
20:31:54federico3dom96: it would be nice to publish the charts if there's an easy way to do so
20:32:20dom96Don't think there is
20:32:24MiruyaAraq: Yep. I think I just need to get a vm when working on things because of how often that happens to me
20:32:26dom96I can give access to individual users though
20:33:07AraqMiruya: our instructions tell you to not copy it to /usr/bin :P
20:33:19federico3apparently google is trying to prevent people from doing that
20:33:44MiruyaI don't think I did? (unless my package manager did)
20:37:01OnOcan anyone remind me how do I make nim forum threads land in my mailbox?
20:37:08OnOsubscribing nim-dev?
20:38:18AraqOnO: I think so
20:41:03OnOthnx
20:41:18AraqOnO: I know I will regret this but ... what's the reason we don't allow you to fix every trailing whitespace in Nim again?
20:41:19OnOso far I was using some cron script turning RSS into mails
20:41:45MiruyaAraq: found my issue. the tests proc in koch was doing exec("nim cc --taintMode:on tests/testament/tester") instead of exec(findNim() & " cc --taintMode:on tests/testament/tester")
20:43:23OnOAraq: don't remember :> I think it was lost in the translation, I think the original issue is still there somewhere
20:43:34federico3OnO: we are still working at fixing the mailing list.
20:44:09OnOI've learnt to live with seeing commits containing numerous whitespace changes
20:44:17dom96Araq: breaks blame
20:44:50Araqjust add ?/w=0 to the github url
20:44:58OnOdom96: in fact there's -w in blame
20:45:54OnObut still it is just f.. annoying to just ignore what and put ?w=0 seeing some PR with whitespace changes
20:46:10OnOjust trim that everywhere commit and case solved
20:46:18dom96doing it file by file is fine IMO
20:46:36MiruyaI wonder if there is a chrome addon to add ?1=0 to github diff links automatically...
20:46:46Miruya?w=1, even.. if only I could type
20:46:54federico3dom96: is there any plan to add a compile time symbol for async?
20:46:57Araqnot if OnO tells our precious contributors to do it in separate commits and stuff
20:47:18dom96federico3: no
20:47:30dom96federico3: I don't quite understand why this is needed
20:49:19OnOAraq: telling to squash 3 commits, where 2 last are fixups for 1st one is bad too?
20:49:25federico3dom96: to write libraries that can leverage multithreanding and/or async based on what is enabled at compile time? Or I am missing something?
20:50:18dom96async will use multithreading some day
20:50:42OnOAraq: you know when I was kid I wanted to be cleaner :P
20:51:05AraqOnO: we disagree on git commit policies and that's fine, we'll find a compromise
20:51:58Jehan_There are about 2k lines in 80 files with CRLF line endings, but only one in lib and compiler each. Most of the offenders are tests. I'm assuming that's what you're talking about?
20:53:42OnOAraq: and as you may notice, I asked just to separate cleanup commit from the actually subject commit, because it was "Adding X Y functionality and meantime fixing some trailing whitespace"
20:54:09OnOso in fact my problem was that the PR was mixing two subjects in one commit
20:54:25OnOI had no problem with fixing whitespace or not fixing it.. honestly I don't care
20:54:37Araqno, in fact I did not notice
20:54:45OnObut for f.. sake one commit = one subject
20:54:47Araqcause I even less than you do :P
20:54:52Araq*I care
20:55:46dom96OnO: It's not trivial to separate these when editors strip them automatically
20:56:12OnOdom96: git add -p
20:57:22dom96what if there is trailing whitespace on a line that is part of my edit?
20:57:34Araqalso I'm not blaming you, just want you all to be happy and not concerned with irrelevant stuff
20:58:00OnOdom96: see no problem with that
20:58:17OnOmy only problem is line changes irrevelant to the commit subject
20:58:28*tankfeeder quit (Quit: Leaving)
20:58:34OnOand need to ?w=1 just to see relevant stuff
20:58:51Araqyeah and that's fine, really.
20:59:18*raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:59:37OnOmaybe it if there was a checkbox in GH so I can turn on ?w=1 for Nim that would be fine too
21:00:45Araqjust fix the whitespace and make a big cleaning commit
21:01:17Araqwe don't need git blame anyway, when something goes wrong, I'm to blame
21:01:25dom96if you do that, set up travis or circle ci to check PRs for trailing whitespace
21:01:53Araqwhy? the diff shows it per default?
21:02:21*yglukhov joined #nim
21:03:55*Ven joined #nim
21:04:44dom96it's whitespace
21:04:49dom96it's easy to miss
21:07:02*NimBot joined #nim
21:07:10*gsingh93 quit (Ping timeout: 250 seconds)
21:11:07*M-max quit (Ping timeout: 265 seconds)
21:11:13*yomiel joined #nim
21:12:01Jehan_This is interesting, --gc:boehm outperforming --gc:refc on a very large heap (because of parallel marking). Of course, amortized performance only, not counting pause times.
21:13:45*gsingh93 joined #nim
21:16:16OnOhere you go https://github.com/nim-lang/Nim/pull/3289
21:16:35*M-max joined #nim
21:18:10*NimBot joined #nim
21:18:11dom96A little unicode fix there too I see: https://github.com/nim-lang/Nim/pull/3289/files?w=1
21:19:02Araqwoher willst du denn wissen, dass der nicht R?dseth heißt?
21:19:43AraqJehan_: what is a very large heap for you?
21:20:40OnOdom96: so the subject says "Convert contributors to UTF-8"
21:21:04OnOunless you want garbage to be shown on GH :P
21:21:41OnOthe reason I did this UTF conversion is that sed was getting crazy on this file, heh
21:21:49*chernozem quit (Quit: Page closed)
21:23:22*tinAndi joined #nim
21:24:03*matkuki quit (Quit: ChatZilla 0.9.92 [Firefox 40.0.3/20150826023504])
21:28:58*enamex left #nim (#nim)
21:30:09*yglukhov quit (Remote host closed the connection)
21:30:38*yglukhov joined #nim
21:32:40*yglukhov quit (Remote host closed the connection)
21:35:22Jehan_Araq: A few GB.
21:35:50Jehan_Mind you, we're talking pause times of up to .5 seconds.
21:38:11*yglukhov joined #nim
21:41:09*Kingsquee joined #nim
21:43:04Jehan_And if I turn off parallel marking, it's about 2.5 times slower (quadcore mit turboboost).
21:44:19Jehan_This also means that if you're actually running multiple threads, then refc can also exploit multiple cores and will be correspondingly faster.
21:45:29Mat4does refc stand for reference counting ?
21:45:43*tinAndi quit (Quit: ChatZilla 0.9.92 [Firefox 40.0.3/20150826023504])
21:46:16AraqI'm working on making the refc a pure refcounting GC with optimizations that optimize stack RC ops away
21:46:41AraqMat4: yeah, but it's a deferrent refcounting GC
21:47:24*BitPuffin|osx joined #nim
21:49:05Jehan_Araq: Neat. :) As an option, I hope?
21:50:15*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:50:59Araqsure. until it's stable and beats the old GC consistently
21:51:21Jehan_I don't think it can, at least not always.
21:52:59Mat4I hope the algorithm is able to exclude or detect reference cycles
21:53:00Jehan_But regardless of speed, it'll be valuable for providing precise GC.
21:53:32Araqprecise GC, hard realtime, 'shared ref'
21:53:49Jehan_Mat4: Well, dealing with reference cycles is an old hat.
21:54:36*boopsies is now known as boopsiesisaway
21:55:42*Ven joined #nim
21:59:22Jehan_For what it's worth, shared ref can be tricky. Naive implementations of shared reference counting have nasty race conditions.
22:01:25Mat4I think all kinds of GC share some nasty to handle conditions in one way or another, it's all depend on the implementation effort in my opinion
22:04:50Jehan_Mat4: The underlying problem is that reading or writing a pointer while updating its reference count is not an atomic operation, even if both parts are individually atomic.
22:06:57Jehan_On the other hand, you are going to need some logic for access to a shared memory location containing a pointer anyway, just in order to have sane semantics. So it's solvable.
22:09:36Mat4ok
22:11:14OnOhttp://www.drdobbs.com/atomic-reference-counting-pointers/184401888
22:11:29OnOI guess interlocked dec/inc helps a lot
22:11:59Mat4yes, that's what I suggested
22:12:34*enamex joined #nim
22:14:20Mat4however it seems, for this implementation it seems that memory access is or can be done beside the reference-count update if I understand correctly
22:15:54*Mat4 wonders about automatic text duplication
22:16:00OnOhttp://www.opensource.apple.com/source/objc4/objc4-647/runtime/ is interesting lecture
22:16:25OnOMat4: you mean reading the object in same time as other thread is releasing it?
22:16:48OnObut I think you need to hold the reference in order to read an object
22:17:49Mat4^yes
22:20:26Mat4I don't know implementations where the counter update isn't atomic, so are not sure to undestand the problem right
22:22:42Mat4to citate the article you have posted:" For example, consider the following function that atomically increments a counter. It is thread-safe because the locks ensure that only one thread increments the counter at a time"
22:23:23Mat4i know this procedere as 'serialisation'
22:23:32*yglukhov quit (Read error: Connection reset by peer)
22:24:07*yglukhov joined #nim
22:24:37*yglukhov quit (Remote host closed the connection)
22:27:06*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:28:35Mat4using some special cpu instructions for this, it is even save in case of asynchron interruptions (the articel explain this for the PowerPC ISA)
22:28:37*Matthias247 quit (Read error: Connection reset by peer)
22:29:02Mat4so again, I don't think to understand the problem
22:29:03Jehan_OnO: One problem with this approach is that it's pretty expensive.
22:29:13*yglukhov joined #nim
22:29:35*yglukhov quit (Remote host closed the connection)
22:30:10Jehan_And without other constraints, you need to do it even every time you read a pointer from a heap. Think about traversing a linked list or a binary tree.
22:31:51Jehan_But if you know, for example, that you have even a readlock on the underlying object, you may be able to omit the operation entirely.
22:33:21Mat4yes, that is needed for every access. However the disadvantage result from the memory organisation used so this is only a question of design I think
22:34:49Jehan_There are a lot of tradeoffs (I'm working on this problem for my day job, for what it's worth).
22:39:33*yglukhov joined #nim
22:40:07Jehan_My biggest problem is that I have to do it in C++, so using dataflow optimizations is not an option for me. But there are workarounds to basically do the dataflow optimization manually and have checks that verify that you did it right.
22:40:42Jehan_Plus, lots of templates involved. :)
22:44:08Mat4reads like a frustrating work
22:44:10*irrequietus quit ()
22:49:04Mat4ciao
22:49:10*Mat4 left #nim ("Konversation terminated!")
22:57:38*yglukhov quit (Remote host closed the connection)
23:12:34*pregressive joined #nim
23:16:04*Jehan_ quit (Quit: Leaving)
23:26:48*strcmp1 quit (Ping timeout: 255 seconds)
23:28:42*strcmp1 joined #nim
23:43:43*rollo joined #nim
23:50:50*enamex quit (Quit: Page closed)
23:58:17*yglukhov joined #nim