<< 28-10-2014 >>

00:00:41*darkf quit (Quit: Leaving)
00:03:56*darkf joined #nimrod
00:05:48*willwillson quit (Ping timeout: 250 seconds)
00:07:14ldleworkgokr1: does gradha ever come in here?
00:07:30gokr1Not sure
00:08:29gokr1I guess you saw: http://forum.nimrod-lang.org/t/141
00:11:07*Trustable quit (Quit: Leaving)
00:14:21ldleworkno
00:17:24Jehan_Nim has a destructor pragma.
00:17:36Jehan_Which handles stack allocations/deallocations.
00:18:09Jehan_Heap finalization is currently done using new(variable, finalizer).
00:18:20Jehan_I believe Araq mentioned he wanted to unify the approaches.
00:18:56Jehan_Personally, I think there's little need for RAII in any language that has automatic memory management and higher order functions.
00:20:50ldleworkJehan_: did you read my article?
00:21:20Jehan_Which article? I was mostly idle and there were a ton of URLs flying around ...
00:21:26Jehan_None of which I looked at.
00:21:34ldleworkblog.ldlework.com/a-cursory-look-at-meta-programming-in-nim/
00:21:38ldlework^
00:23:00Jehan_Neat. :)
00:23:21Jehan_I see you've discovered getAst() already.
00:23:49ldleworkI think will showed me that one
00:25:06gokr1ok, gnite
00:27:12ldleworko/
00:34:58*boydgreenfield quit (Quit: boydgreenfield)
00:35:22Varriountldlework: ping
00:35:28ldleworkhi
00:35:49Varriountldlework: You need to insert a comma on line 9, after the second word.
00:36:29VarriountI'd also suggest revising that sentence - while it's not a run-on, it's a bit long.
00:36:42ldleworkVarriount: heh ok
00:38:11Varriountldlework: Your nickname is interesting. I kept wondering why tab completion wasn't working for your nickname until I discovered that, in my client's font, uppercase I and lowercase l look the same
00:38:20ldleworkVarriount: ;)
00:40:17*xenagi quit (Quit: Leaving)
00:41:21*dapz joined #nimrod
00:42:59*boydgreenfield joined #nimrod
00:44:22*superfunc_ quit (Ping timeout: 246 seconds)
00:53:12*mko quit (Quit: Bye.)
01:10:40*BitPuffin joined #nimrod
01:15:10*brson quit (Quit: leaving)
01:15:38*brson joined #nimrod
01:24:47*BitPuffin quit (Ping timeout: 255 seconds)
01:32:25*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:35:58*Jehan_ quit (Quit: Leaving)
01:58:14*BitPuffin joined #nimrod
02:00:15*superfunc joined #nimrod
02:01:14Varriountgokr1: Oooh! I have an item for the 'Common Critisisms' page - Why Nimrod doesn't use wide character strings by default, or use utf-8 aware slicing
02:01:40VarriountThe only problem is that I don't know how to justify that design decision very well...
02:05:47*BitPuffin quit (Remote host closed the connection)
02:10:13*flaviu quit (Ping timeout: 258 seconds)
02:10:17*BitPuffin joined #nimrod
02:11:58*boydgreenfield quit (Quit: boydgreenfield)
02:14:11*____________Josh joined #nimrod
02:14:34*Jesin quit (Quit: Leaving)
02:15:01____________JoshI want to start hacking, basically on anything would like to know the lanauge to start off with and resources to learn from?
02:15:28Varriount____________Josh: Have you read the tutorials?
02:16:10*Jesin joined #nimrod
02:21:40____________Joshwhat tutorials ?
02:23:23superfunc____________Josh: http://nim-lang.org/tut1.html
02:23:35superfunchttp://nim-lang.org/tut2.html
02:23:54superfunc____________Josh: http://nimrod-by-example.github.io/ <-- Start with this one
02:24:16superfuncThen read the two other tutorials I linked
02:24:38Varriountsuperfunc saves the day yet again! :3
02:24:45superfuncAfter that, you could read the language manual if you like: http://nim-lang.org/manual.html
02:24:56superfuncI'm quite the secretary, I've been told
02:25:59*____________Josh quit (Ping timeout: 255 seconds)
02:26:39Varriountsuperfunc: I wouldn't mind developing Nim as a job. I quite like typing up tutorials, documentation, and the like.
02:27:01*____________Josh joined #nimrod
02:27:11VarriountThe only problem is that A: I can't develop Nim as a job, and B: I'm too meticulous to do anything quickly.
02:27:17____________Joshnever heard of the language before :s
02:28:18superfuncTell your friends
02:28:49superfuncVarriount: I don't mind doing it, I just need the initial kick to do it
02:29:08ldlework____________Josh: contribute to nim-by-example
02:29:14*BitPuffin quit (Ping timeout: 250 seconds)
02:29:38ldleworkor I mean Varriount
02:29:45____________JoshThank you and I will
02:30:17superfuncI was thinking about adding a section on Nimble to Nim by example, but I thought it may be too self-explanatory
02:30:54*Varriount is now known as Idlework
02:31:13IdleworkNow we're twins. :D
02:33:49*Idlework is now known as Varriount
02:35:17VarriountAraq: I've fixed the compiler configuration code when compiling to c++, however I think there may be some information missing for other C++ compilers in nim.cfg - I can only find default configuration options for c++
02:35:25VarriountI mean, for g++
02:38:18*____________Josh left #nimrod (#nimrod)
02:42:57ldleworksuperfunc: nothing is too self-explanatory
02:42:57VarriountAraq: Oh, and you'll be happy to know that the Nim compiler compiles succesfully into a c++ program.
02:47:18superfuncOk, when I finish the post I'm writing on the library I'm finishing up, I'll go ahead and do that
02:48:55superfuncI think I need to switch my blog to nim
02:49:05superfuncI'm so fucking sick of dependency hell in haskell
02:49:16VarriountI think we'll need a new and improved Jester first.
02:49:37superfuncWhat's the matter with it? or ipsum genera for that matter?
02:49:49Varriountsuperfunc: I dunno, I just hear... things
02:49:58Varriount>_>
02:50:01Varriount<_<
02:50:26Varriountsuperfunc: What are things like on the haskell side?
02:51:38superfunceven regarding the new stuff in the new-async branch?
02:51:46superfuncidk either way, just curious
02:53:22superfuncI use hakyll right now, which is similar to jekyll. The package itself is nice, but it causes a bunch of dependency issues with the packages I need for research work
03:08:13*superfunc quit (Ping timeout: 246 seconds)
03:11:41*fowl quit (Quit: Leaving)
03:13:59*johnsoft quit (Read error: Connection reset by peer)
03:35:03*kshlm joined #nimrod
03:37:46*brson quit (Ping timeout: 256 seconds)
03:46:40*kemet joined #nimrod
03:47:52*kemet quit (Client Quit)
03:48:22*kemet joined #nimrod
03:50:13*johnsoft joined #nimrod
03:51:31*kemet quit (Client Quit)
03:51:40*kshlm quit (Quit: Konversation terminated!)
03:51:58*kshlm joined #nimrod
03:52:24*kemet joined #nimrod
03:53:23*kemet quit (Client Quit)
03:54:15*kemet joined #nimrod
03:59:08*kemet quit (Remote host closed the connection)
03:59:33*kemet joined #nimrod
04:04:02*kemet quit (Ping timeout: 245 seconds)
04:12:19*boydgreenfield joined #nimrod
04:12:43boydgreenfieldDoes anyone get the following error with recent version of Babel (v0.4 installed on latest devel branch): `Cloning latest tagged version: expected SRV RR, found RR type 1`
04:12:52boydgreenfieldSome kind of git tag-related error, I believe
04:13:28Varriountboydgreenfield: Perhaps something wrong with github?
04:13:52boydgreenfieldVarriount: Weird, it’s intermittent. Some Googling reveals some kind of DNS or authorized hosts issue.
04:18:09boydgreenfieldVarriount: Intermittent, but still obnoxious. Does appear to be something GitHub-side though
05:23:59DemosDoes anyone know if one can write something like c++'s unique ptr in nimrod, I dont actually care about doing it but I am interested to see if it is possible to provide custom behavior for the addr and [] operators?
05:24:18VarriountDemos: What is C++ unique ptr?
05:25:07Demosjust a class that overrides operator&, operator*, and operator-> to do something to the enclosed pointer, and has special ownership semantics
05:25:21Demosactually it may not override operator&
05:25:52VarriountDemos: Well, you can already override []
05:26:12Demosbut can you override the no-param deref version
05:26:21Demosand you can override .
05:26:32VarriountHrm, I don't know...
05:48:29*boydgreenfield quit (Quit: boydgreenfield)
05:54:28*rpag quit (Ping timeout: 258 seconds)
06:11:54*kemet joined #nimrod
06:12:29*kemet quit (Client Quit)
06:16:07*darkf_ joined #nimrod
06:17:16*Demos quit (Quit: Leaving)
06:18:36*darkf quit (Ping timeout: 265 seconds)
06:18:44*darkf joined #nimrod
06:18:52*darkf quit (Changing host)
06:18:52*darkf joined #nimrod
06:21:26*darkf_ quit (Ping timeout: 265 seconds)
06:39:00*kshlm quit (Quit: Konversation terminated!)
06:40:48*kshlm joined #nimrod
07:47:28*johnsoft quit (Ping timeout: 265 seconds)
07:48:31*johnsoft joined #nimrod
08:00:02gokr1Morning folks
08:30:05*willwillson joined #nimrod
08:45:45*kaushal_ joined #nimrod
08:46:00*kshlm quit (Ping timeout: 244 seconds)
08:50:43*kaushal_ is now known as kshlm
09:14:53*Trustable joined #nimrod
09:20:58*[CBR]Unspoken quit (Quit: Leaving.)
09:21:16*[CBR]Unspoken joined #nimrod
09:50:17*khmm joined #nimrod
09:50:49*khmm_ joined #nimrod
10:02:08*kshlm quit (Remote host closed the connection)
10:02:35*kshlm joined #nimrod
11:39:20NimBotnimrod-code/packages master 4ae8798 Will Szumski [+0 ±1 -0]: add GNU GMP wrapper
11:39:20NimBotnimrod-code/packages master 3c124b9 Dominik Picheta [+0 ±1 -0]: Merge pull request #92 from cowboy-coders/master... 2 more lines
11:44:05gokr1It seems to a n00b like me that I can call a "super proc" by doing a type conversion of a parameter (to a base class) and then just call it. But... for methods I am kinda screwed, right?
11:48:15*parametaortho joined #nimrod
11:51:22*kshlm quit (Ping timeout: 240 seconds)
11:55:44*kemet joined #nimrod
12:00:25*untitaker quit (Ping timeout: 260 seconds)
12:06:33*untitaker joined #nimrod
12:24:07Varriountgokr1: Hm. I don't know, have you tried casting for methods as well?
12:24:16gokr1Yeah
12:25:43gokr1Didn't work. Endless recursion :)
12:26:12gokr1Its logical that it doesn't work, just not sure... what to do.
12:29:31VarriountWhat does C++ do in these cases?
12:36:20gokr1In C++ as far as I can remember you use the class name as a prefix to the method to call.
12:36:37gokr1So there is no "super" keyword as in Smalltalk - but you do MySuperClass::yadda(1)
12:37:21gokr1It was a long time since I used C++ :)
12:37:51willwillsoncouldn't you just put common functionality in a template or something?
12:41:30gokr1Mmmm, not sure, but... this feels like a missing piece.
12:41:40gokr1I may have missed some mechanism of course.
12:43:33*rpag joined #nimrod
12:46:07Varriountgokr1: I don't think so.
12:46:50gokr1You never felt the need to call "super"? :)
12:46:54Varriountgokr1: Multimethods (And OO) aren't as heavily integrated in Nim as in other languages.
12:47:04gokr1I know, which is why I am testing the "borders"
12:48:46Varriountgokr1: Thoe whole of the nimrod standard library only uses multimethods 3 times - and thats just in the logging module.
12:49:19VarriountWhat's usually done is something like what streams.nim does
12:49:20gokr1For a standard lib its not surprising.
12:49:34gokr1I mean, most stdlib stuff isn't that complicated.
12:49:52gokr1Ok, I will look there.
12:50:44Varriountgokr1: Essentially, the type has members which hold each of the overridable procs.
12:51:01Varriounter 'overridable'
12:54:44*dom96_ quit (Ping timeout: 244 seconds)
13:04:32*dom96_ joined #nimrod
13:09:33Varriountgokr1: You see what streams.nim does?
13:09:48gokr1Sorry, got distracted. And need to go :)
13:09:58gokr1But I suspect it attaches procs as members, right?
13:10:32VarriountYeah.
13:10:50*kemet quit (Quit: Instantbird 1.5 -- http://www.instantbird.com)
13:11:02gokr1I will look closer later
13:11:07VarriountI guess that's kinda like a vtable?
13:11:33*kshlm joined #nimrod
13:11:41VarriountHi kshlm
13:15:40Varriountgokr1: It's not very space efficient, so there's probably a better way of doing things.
13:16:16gokr1right
13:17:29gokr1I guess Andreas can actually add some kind of "super" thingy for methods - it doesn't sound like a very hard problem given that he already has dynamic lookup in methods.
13:18:02gokr1So that you could call like "mySuperMethod(super(this))"
13:18:36gokr1So "super(x)" would make sure that we try resolving mySuperMethod using the super type of this, instead of its type.
13:18:45gokr1Oh, well, gotta run for a few h.
13:19:46gokr1Another interesting corner case - i tried making a distinct type of a distinct type of int. That works fine. Borrowing though only works from int - in other words, it always borrows from the "base" type.
13:20:18gokr1Yes, crazy corner case - I just got curious :)
13:25:48Varriountgokr1: Actually, multimethods work via if statements
13:25:51*Araq0 joined #nimrod
13:26:07VarriountHi Araq, we were just talking about multimethods
13:26:20Araq0gokr1: it's a feature request that a type conversion inhibits dynamic binding
13:27:00Araq0but I'm not sure that's the way to provide this feature
13:27:36Varriountthere's also this -> http://forum.nimrod-lang.org/t/463
13:30:51Araq0too bad 'static mymethod(x,y)' already means something different, otherwise we could use that, but hrm
13:31:16Araq0we can do 'super mymethod(x, y)'
13:43:19willwillsonwhat if you wanted to invoke mymethod(x, super y)?
13:51:00dom96_what if you have a big hierarchy, will we end up with super super super mymethod?
13:53:12*darkf quit (Quit: Leaving)
13:54:24*dom96_ quit (Quit: Page closed)
13:56:13Araq0well 'super' is not the best name for it
13:56:37Araq0but the point is, the static types used to invoke mymethod are used for dispatching
13:57:03Araq0so, no there is no 'super super'
14:14:14*BitPuffin joined #nimrod
14:18:51*irrequietus joined #nimrod
14:18:53*irrequietus quit (Changing host)
14:18:53*irrequietus joined #nimrod
14:21:24*eigenlicht joined #nimrod
14:26:05*Demos joined #nimrod
14:36:02*dom96_ joined #nimrod
14:40:40*BitPuffin quit (Read error: Connection reset by peer)
14:42:27*BitPuffin joined #nimrod
14:51:57*saml_ joined #nimrod
15:10:05*mko joined #nimrod
15:12:23*willwillson quit (Ping timeout: 240 seconds)
15:15:33*kuzy000_ joined #nimrod
15:18:22*kuzy000_ quit (Read error: Connection reset by peer)
15:20:23*Demos quit (Quit: Leaving)
15:27:14*gokr joined #nimrod
15:49:04*kemet joined #nimrod
16:02:42*Fran__ is now known as Francisco
16:04:54*irrequietus quit ()
16:07:10*brson joined #nimrod
16:09:28*irrequietus joined #nimrod
16:13:40*kuzy000 joined #nimrod
16:14:21*kuzy000 quit (Read error: Connection reset by peer)
16:29:34*vissborg quit (Max SendQ exceeded)
16:32:15*vissborg joined #nimrod
16:33:20*kemet quit (Ping timeout: 256 seconds)
16:34:40*johnsoft quit (Ping timeout: 256 seconds)
16:35:02*dom96_ quit (Ping timeout: 256 seconds)
16:35:40*johnsoft joined #nimrod
16:36:10*Francisco quit (Ping timeout: 256 seconds)
16:49:28*will joined #nimrod
16:50:35gokr1Normally one do not skip classes in doing super calls, that is extremely rare.
16:50:41*irrequietus quit ()
16:51:21gokr1In Smalltalk you can't skip - in C++ you can, but, I would consider it extremely bad style.
16:52:44gokr1I will be here later, busy now. But... I would say a reasonably convenient super call is fairly important for "regular OO".
17:12:58*kshlm quit (Ping timeout: 258 seconds)
17:14:49NimBotnimrod-code/packages master c81b5dd Adam Chesak [+0 ±1 -0]: Changed name.
17:14:49NimBotnimrod-code/packages master 7e46927 Dominik Picheta [+0 ±1 -0]: Merge pull request #93 from achesak/master... 2 more lines
17:16:19*Francisco joined #nimrod
17:32:12*irrequietus joined #nimrod
17:33:09*parametaortho quit (Quit: zzzzzzzzzz)
17:44:03*rpag quit (Quit: Leaving)
17:44:20*dom96_ joined #nimrod
17:44:29*rpag joined #nimrod
17:45:12dom96_Varriount: When creating issues could you please give them labels?
17:54:32*Araq0 quit (Quit: Page closed)
18:00:01*dom96_ quit (Ping timeout: 246 seconds)
18:01:44*Francisco quit (Ping timeout: 256 seconds)
18:02:26*Francisco joined #nimrod
18:19:27*Matthias247 joined #nimrod
18:20:26*khmm quit (Ping timeout: 256 seconds)
18:21:03*khmm_ quit (Ping timeout: 244 seconds)
18:41:46*saml_ quit (Quit: Leaving)
18:49:15TrustableOT: What do you guys think about D (-lang) in comparison to Nim?
18:52:33Araqam I allowed to answer?
18:52:41TrustableMy opinion: Nim produces much smaller binaries (Hello World: 58 kB / 600 kB). I like the syntax of Nim much better. What more differences are there?
18:52:48TrustableAraq: yes please :)
18:53:23AraqD's template system is further developed than Nim's generics are (for now) and its slice features is worth copying
18:53:43ldleworkPlease copy good things from other languages
18:53:50ldleworkPlease be the opposite of Go
18:53:54ldleworkPlease please
18:54:10Araqits memory safety is however a bad joke, IMHO
18:54:29Araqand it relies on a particularly inefficient global stop the world GC
18:54:54Araqpartly caused by its semantics that are hostile to an efficient GC implementation
18:55:08Trustableah yes, in my understanding a reference counting is the better solution.
18:55:43Araqthere are lots of other minor things that would annoy me to no end
18:56:01Araqfor instance, length returns an unsigned number
18:56:36ldleworkhow is that annoying?
18:56:56Araqdidn't you read my rant about unsigned integers?
18:57:25rpagwhen i lasted look at D it had two competing standard libraries
18:57:33rpagwas kinda weird
18:57:40Araqrpag: they only have one now
18:57:41rpagbut thats so long ago, it may be "fixed"
18:57:55rpagAraq, which one won? :)
18:58:01Araqphobos of course
18:58:15Araqthey threw away tango. problem solved ;-)
18:58:35Trustablephobos was the original one, right?
18:58:43Araqyes
18:59:30TrustableAnother difference: D passes objects always by reference.
19:00:29*johnsoft quit (Read error: Connection reset by peer)
19:01:13*johnsoft joined #nimrod
19:04:32Araqldlework: we're copying from lots of other languages. however, stealing slices is not that easy and the language is already complex enough. our major focus is on stability now.
19:04:55ldleworkAraq: that's a good idea!
19:05:33ldleworkAraq: I mostly meant that when you point out to someone how like, maps are not extensible in Go they go "That's a great thing! It eliminates an entire class of problems!"
19:05:48ldleworkand you die a little inside
19:06:49rpaggo is super simple
19:08:12ldleworkyeah but the justification seems to be to keep the compiler simple too and therefore keep it fast
19:08:31ldleworkbut languages like Nim and Rust show that you don't need to have a language like Go to achieve at least the speed
19:08:38TrustableThe most annoying think in Go: The compiler does not allow you to have unused variables.
19:08:59Araqwell from a marketing pespective they are doing it completely right.
19:09:08ldleworkcreating a language that makes you work in ways that have been solved by better language design just to make the lives of the maintainers of the language easier seems a very bad way to go about it
19:09:16Araqstart super simple so that every programmer feels in full control
19:09:21ldleworkand they've somehow convinced users of Go that this premise is good for users of Go
19:09:31Araqand then bloat it in following decades
19:09:44Araqsee Java for another example
19:09:44ldleworkAraq: I doubt they will bloat it much
19:10:30AraqI cannot see how they will be able to avoid generics in the very long run
19:10:35ldleworkI think Go is a blip on the radar served by free limelight and its users will awaken in a few years disillusioned by their huge leap backwards when languages like Rust and Nim and friends keep popping up on their RSS feeds or whatever people use
19:12:06rpagi think its got a big enough foothold to be around for many years to come by now
19:12:24ldleworkyeah it has some big users now too
19:12:49Araqyup
19:12:57rpagbut everything becomes perl, sooner or later :D
19:13:02ldleworkheh
19:15:55Araqwhat do you mean? languages are all becoming perlish?
19:16:30ldleworkAraq: no they fall into obscurity
19:16:35rpagyeah
19:16:45Araqah lol, yeah
19:17:02ldleworkDo you guys like Rust?
19:17:04AraqI hope I copied enough from Lisp so that won't happen for Nim :P
19:17:23Araqwell Lisp is obscure too, I guess
19:17:37Araqbut it remained a good reputation
19:18:07rpagindeed
19:22:16Araqldlework: Rust is handicapped by paranoia
19:23:25Araqno exceptions, no flexible overloading
19:24:17Araqno courage to get rid of {} and semicolons
19:24:47ldleworkAraq: the last one doesn't bother me at all
19:24:58Araqexplicit 'unsafe' blocks where Nim's approach works much better
19:25:08ldleworkAraq: what is Nim's approach
19:25:39Araquse keywords 'addr' and 'cast' and ensure nothing else can break safety
19:25:58Araqwell a few corner cases crept into the language so that this doesn't hold
19:26:06Araqbut we're getting there
19:26:53ldleworkAraq: I don't understand how you're relating unsafe and Nim's addr and cast
19:27:03ldleworkbut I don't understand enough about Nim's data model yet
19:32:57gokr1ldlework: addrs gives you a ptr - thus unsafe shit can follow. cast forces bits to be available as "something else", pretty unsafe too.
19:33:06gokr1Right?
19:36:20gokr1In Smalltalk "super" is just a ref to "this" - but sending messages to that guy starts method lookup "one step higher" in the superclass chain.
19:37:31gokr1So... it felt pretty Nimmish to have some kind of "super(x)" that can be used for one or more args - thus making their dynamic type be "one step higher" in that call.
19:48:55*irrequietus quit ()
19:50:18Araqgokr1: meth(super(x), super(y), z) is weird though
19:50:41gokr1But you would quite seldomly use two supers.
19:50:46Araqstatic_call meth(x, y, z) is much easier to understand
19:51:04gokr1And... what does "static_call" do you mean?
19:51:29Araqso the call to 'meth' does not go via the dynamic dispatching mechanism
19:51:37gokr1Ok.
19:51:57Araqwell 'static_call' is not really sexy
19:52:13Araqbut 'static meth(...)' already exists and means something different
19:52:30gokr1So... static_call + a type conversion to a parent type - would cause the "super method" to be called?
19:52:41*nande joined #nimrod
19:52:45Araqyes
19:59:10*BlaXpirit joined #nimrod
19:59:17Araqas i said, there is a proposal that a type conversion within a method call inhibits dynamic dispatching
19:59:26Araqbut when:
19:59:32Araqm(Obj(a))
19:59:38Araqis different from:
19:59:49Araqlet x = Obj(a); m(x)
20:00:04Araqthat doesn't feel right
20:00:07gokr1I agree.
20:00:39gokr1It sounds like a "hack" solution. ;)
20:01:17gokr1Just read about static/semistatic
20:01:34Araqis semistatic still in the docs?
20:01:53gokr1Think so, nim-lang is the same site as nimrod-lang, right?
20:02:00gokr1I read at nim-lang.
20:02:02Araqright
20:02:10gokr1http://nim-lang.org/manual.html#static-statement-expression
20:03:09*Jehan_ joined #nimrod
20:04:41Jehan_In multi-method languages, there's generally a "next method" approach being used rather than some form of "super" call. In the case of single dispatch, of course, "next method" maps directly to calling the method on a superclass.
20:06:10gokr1Mmmm, I gotta check what slate does...
20:07:48AraqJehan_: I think 'next' is a weird name for it
20:08:02Araq'up' seems more intuitive
20:08:20Jehan_Araq: It's not necessarily "up", it can also be "sideways".
20:09:02Jehan_call-next-method in CLOS, next-method in Dylan, TryNextMethod() in GAP.
20:10:23Jehan_It's called this way because it's the next method in the ordering imposed by specificity.
20:11:05gokr1Slate calls it "resend"
20:11:09Jehan_That said, multiple dispatch is something that's seen so little practical use that there may be a better solution.
20:12:35gokr1In Slate I do know the params that are meant to participate in dynamic lookup are marked with a @. Nim resolves on all object types, right?
20:15:26Jehan_gokr1: Yes.
20:17:04Araqbtw we do de-virtualization. I recently discovered this. :-)
20:19:03Jehan_Devirtualization is just a fancy term that C++ introduced, but something that can happen pretty naturally in other languages.
20:21:21Jehan_Interestingly, while the dispatch mechanism could use improvement, it surprisingly seems to beat C++'s dispatch table approach for up to a fairly high number of subclasses.
20:21:57gokr1Araq: Interesting paper, check conclusion: http://homepages.mcs.vuw.ac.nz/~alex/files/MuscheviciPotaninTemperoNobleOOPSLA2008.pdf
20:22:15gokr1(about how much multidispatch is used in multidispatch langs)
20:23:32Jehan_Speaking of interesting papers, I recommend a look at: http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf
20:23:36gokr1I know its an impossible question - but how much slower is a method compared to a proc? And can anyone give some experience on mixing procs/methods in an OO Nim codebase?
20:23:41Jehan_It's essentially the Ur-OOP paper.
20:24:15Jehan_Interestingly enough, Hoare's original vision of object-oriented programming was much closer to ML than Simula or Smalltalk.
20:24:40Jehan_gokr1: It's largely a matter of branch prediction. Plus, inability to inline.
20:29:49Araqgokr1: "nimgame" uses methods heavily and so does some of fowl's stuff, afaik
20:30:40AraqJehan_: inlining is possible with link time optimizations. which every good C compiler does these days.
20:30:41gokr1I haven't programmed in any multimethod language - I do recall feeling "nausea" when trying to read Slate code - since it was more like a "sea of procedures" than more easily discerned objects with behavior.
20:31:21Jehan_Araq: That's not what I mean. If dispatch is truly dynamic, you cannot figure out which method to inline.
20:31:23gokr1But it does seem useful to be able to dispatch on at least one of the arguments - thus having overloaded methods in a "class" (sorry for using the term).
20:31:44Jehan_Unless you have very few candidates, that's usually prohibitive.
20:31:50gokr1("at least one of the arguments" in addition to the "receiver" I mean)
20:32:01TrustableSmall question: How can a method call the method of the parent class?
20:32:11Jehan_gokr1: Outside of Computer Algebra, I know few actual applications.
20:32:37gokr1Trustable: Its exactly what we are discussing - it can't. At least not easily. Araq posted in the forum on how to split out the code in a proc - and call that.
20:32:43Jehan_Applications that aren't just as easily handled by double dispatch, that is.
20:32:52Jehan_Or by parametric polymorphism.
20:33:13Jehan_As I keep pointing out, lots of people use subtyping polymorphism where parametric polymorphism is the superior choice.
20:33:15willwith the static_call idea, would you be able to get the super class in a generic method?
20:33:16gokr1Jehan_: Yes, double dispatch occurs relatively often in complex Smalltalk systems - so that's where I could see it being used.
20:33:38Jehan_gokr1: One of the problems with multi-methods is that they break encapsulation.
20:34:51TrustableIs it planned to add the feature to call parent method?
20:34:54gokr1As in, one can "hijack" calls by defining methods for a type from another module?
20:35:11gokr1Trustable: We are kinda discussing our options :)
20:35:48TrustableGood. In my opinion this feature would be important.
20:35:58gokr1will: Yes, the idea with that particular solution was to simply "bypass" dynamic dispatch and call a method "as it was a proc".
20:36:01Jehan_gokr1: Pretty much, introducing specializations that the original module didn't anticipate.
20:36:58gokr1I just read on lambda the ultimate that indeed one problem identified was how new code can "disrupt" old code in interesting ways that regular single dispatch OO code can't.,
20:37:29willgokr1: but how do you know what type you should convert a generic parameter to for static dispatch
20:37:33TrustableI would implement it like in PHP: "parent::MyMethod(this, ..)"
20:38:45Jehan_will: That's what I was wondering, too. It's not a problem if you have an implementation for every possible type signature, but if there are gaps in the coverage, you may not know what the actual type of an argument is.
20:38:52gokr1Trustable: There is no relation between a type "parent" and a method "MyMethod" in Nim, AFAIK. They are just free procedures - but with dynamic dispatch.
20:39:15gokr1will: Good point.
20:39:19Jehan_Trustable: Only works for single dispatch.
20:40:02Jehan_As I said, the conventional approach is a "next method" kind of thing.
20:40:03*madphage joined #nimrod
20:40:22gokr1Trustable: In other words, methods don't "belong" to a type, they just have one or more arguments that are objects - and their types are used for dispatch.
20:41:01madphagei like to think of traditional OO as a consistent bag of partially applied functions
20:41:12gokr1Jehan_: Can you elaborate on how you think parametric polymorphism (is that the term we use for generics?) "solves" this issue?
20:41:13madphageand I wish often for ad-hoc OO
20:41:15*Ven joined #nimrod
20:41:16Trustablegokr1: ok, I understand that. But is this a reason not to implement such a feature with static dispatch?
20:41:26gokr1Jehan_: Since I am not that well versed in how to apply those.
20:41:44Jehan_gokr1: That's not the term "we" use for generics, it's the usual term in the literature. :)
20:41:58Jehan_"Generics" is a bit more colloquial.
20:42:35gokr1Jehan_: I know, but... just curious if I need to look it up vs "generics"
20:42:41Jehan_gokr1: The thing is, if you don't need dynamic dispatch, parametric polymorphism can handle both single and multiple dispatch statically.
20:43:44Jehan_That's, e.g., what Haskell's type classes do.
20:44:08gokr1Jehan_: My simple minded perception is that parametric polymorphism causes a combinatorial explosion - and that... it feels like you would still end up holding a Banan in a "Fruit" variable.
20:44:33Jehan_More importantly, parametric polymorphism deals with constructors and the binary operator problem more cleanly where that approach is sufficient.
20:45:13Jehan_gokr1: Hmm, I'd say the latter is more something you could say about dynamic dispatch.
20:45:26Jehan_Combinatorial explosion is an implementation issue.
20:45:32Jehan_And how much you overuse it.
20:45:52madphagegokr1: most folks confuse parametric polymorphism with its code gen implications from c++, so e.g. if you have a template function that takes in two types, you have to gen a new version of that function for each pair of types
20:46:28Jehan_In principle, a polymorphic proc f[T1, …, Tn](…) only introduces a family of procedures, one for each actual type combinations being used. These can all be shared (see OCaml, Haskell, Ada).
20:46:40madphagebut its also possible to implement parametric polymorphism via generating a function that takes in virtual table style arguments, and hard codes the correct virtual tables at each call site
20:47:24Jehan_Even if you generate one for each set of type parameters, there's usually very little code explosion that happens.
20:47:56Jehan_C++ has a problem because it doesn't have a native metaprogramming model, so it abuses templates for metaprogramming.
20:48:02madphageyeah
20:48:29madphagethere's a role for virtual table implemented generics in addition to code gen ones
20:48:38Jehan_MLton, for example, also generates one instance for each and doesn't have the problems.
20:48:40madphagepost-hoc binary plugin loading being one
20:48:50Jehan_madphage: Aye.
20:49:25Jehan_It's still tricky to have both value and reference types in the same position.
20:49:42Jehan_Or, why OCaml encodes integers with having their lowest bit set to 1.
20:49:42*gokr1 notes PICs were discussed back in july...
20:50:10Jehan_… and boxes floats.
20:50:51gokr1OCaml does tagged small integers? Smalltalk too, interesting.
20:51:02madphageyeah, though I view generics as a potential solution to that issue
20:51:43Jehan_gokr1: Yeah, but for different reasons.
20:52:15madphagespecifically, if the compiler itself is late-bindable, you always have the option of specializing a function to the value type version of something
20:52:40madphagebut there's more complexity to ref vs. value than just that part
20:52:42Jehan_madphage: Yup, as I said, you can pick one or the other option.
20:53:55madphageso, I want to start playing with nimrod soon
20:54:12madphageis it in a lot of flux at the moment?
20:54:36madphagenot entirely clear from the website, seems like a name change and some backwards incompatible stuff is eminent
20:54:45*Varriount|Mobile joined #nimrod
20:55:16gokr1Personally I think its very playable.
20:55:18gokr1:)
20:55:24Varriount|MobileMeep
20:55:29TrustableI agree, no problem so far.
20:56:04gokr1madphage: If you want my experiences during the last ... week, its at: http://goran.krampe.se/category/nim
20:56:13madphagenice! thanks for the link
20:56:58gokr1I am currently trying to write down my ... exploration of the OO space in Nim - which is why I also bumped into the "can't call super methods" thing.
20:57:00Varriount|MobileAraq: Is there anything that can be done to fix the disparity in performance between multimethods, case statements, and vtables?
20:58:01AraqVarriount|Mobile: well in theory you can get them all to the speed of 'case' statements. but it's quite some work.
20:58:48Araqhi madphage welcome
21:00:19madphagehi Araq, I like your language values
21:01:01madphagelook forward to playing with nim soon
21:03:52AraqJehan_: I still think my algorithm of doing "polymorphic inline caches" is novel. ;-)
21:04:17Jehan_Araq: Hmm, which algorithm?
21:05:59Araqwell I mean my heuristic for "subtype checking"
21:06:13Araq"instanceof" checking
21:06:21Araqor whatever you wanna call it
21:10:16*Varriount|Mobile quit (Read error: Connection reset by peer)
21:12:48*comex is now known as ditzex
21:13:51Jehan_Hmm, I haven't looked at the actual algorithm, so I can't say much about it.
21:17:05Araqwell the new idea in it is to also cache the knowledge that A is *not* a subtype of B
21:17:36Trustablegokr1: I like your article http://goran.krampe.se/2014/10/20/i-missed-nim/
21:19:24*Varriount|Mobile joined #nimrod
21:20:35gokr1Trustable: Thanks :)
21:20:58Jehan_So, system() returns a 16-bit value, but exit() only uses 8 bits, and as a result, exit(system(…)) doesn't work as expected ...
21:25:38gokr1Araq: I think this page describes the PIC in Cog in fair detail, ctrl-F "Hölzle" to find the section: http://clementbera.wordpress.com/2013/08/09/the-cog-vm-lookup/
21:25:58*gokr quit (Ping timeout: 258 seconds)
21:26:02*superfunc joined #nimrod
21:26:11superfuncSup everyone
21:28:03Varriount|MobileHey superfunc
21:29:24superfuncHow goes it?
21:35:20*fowl joined #nimrod
21:36:04Varriount|MobileToo much work, not enough time.
21:36:29Varriount|MobileEspecially not enough time for Nim development
21:39:49fowlhrm
21:39:55Jehan_gokr1: The biggest problem with caching method lookup is that these days in a multi-threaded system, that requires thread-local caches.
21:39:57*madphage quit (Quit: Page closed)
21:40:07gokr1Don't be mad at me... but... non local return? Not in Nim, right?
21:40:12gokr1Jehan_: right
21:40:14Jehan_Which are not always fast to access, depending on your system.
21:40:23fowlmy external hd is not readable from windows now, but in linux ntfs3g said it was fixed (and it reads on linux)
21:40:28Jehan_*cough* Apple *cough*
21:40:34fowli guess it was my fault for using ntfs :<
21:46:51superfuncJehan_: I had a quick question. If I have a method returnig a Maybe[Thing] why can't it infer the type when I say result = nothing() in the method ?
21:47:01*BitPuffin quit (Ping timeout: 265 seconds)
21:47:29superfuncI can work around t by saying result = nothing[Thing]()
21:48:29Jehan_For the same reason the following doesn't work:
21:48:31Jehan_var s: seq[int]
21:48:31Jehan_s = newSeq()
21:48:54*betawaffle quit (Quit: Oh Noes! My ZNC!)
21:49:28Jehan_Basically, type inference is a fairly local thing.
21:50:03Jehan_You can work around it by having a special constant and a converter.
21:50:36Jehan_I think I posted an implementation a while ago on the forum, that one can be adapted accordingly.
21:50:49superfuncOk, I was working on some monads in nim for fun and I ran into that, thanks for explaining it. I'll go ahead and implement the workaround tonight when I can look yours up
21:50:54*Varriount|Mobile quit (Read error: Connection reset by peer)
21:51:17Jehan_http://forum.nimrod-lang.org/t/597 towards the end.
21:51:32Jehan_The hack is in the comment part.
21:51:46superfuncThanks, I appreciate it
21:52:00Jehan_Basically, you write a converter from NoType to Option[T] to get what you need.
21:52:59superfuncSimple enough, now to do some cooler monads
21:56:00*betawaffle joined #nimrod
22:00:29*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:03:44Araqgokr1: you can use exceptions for non-local returns
22:03:58AraqI'm not saying it's a good idea.
22:04:04gokr1Araq: Yeah, I started looking at that - just "for fun".
22:04:12gokr1But I dropped it :)
22:04:34Araqusually a template that has a return is a nicer workaround
22:04:37gokr1As you know - Smalltalk is full of it - but typically not something you use in app code when you have things like iterators, break etc
22:04:59gokr1Hey, this is slick: proc sick?(x: string): bool = x == "sick"
22:05:09gokr1Muuahaha!
22:05:26gokr1This works fine: echo(sick?("sick"))
22:06:08gokr1A so called "FULLWIDTH QUESTION MARK", U+FF1F
22:06:22Jehan_I was about to ask whether you used Unicode … :)
22:06:31Jehan_Yeah, sick alright … :)
22:06:39gokr1I kinda like the idea of boolean procs with "?" at the end, not something Smalltalk has - but I always think it looks nice in code.
22:09:18AraqI don't think ? in an identifier mixes all that well with userdefinable operators
22:09:42gokr1Mmm, dunno. Ruby does it, right?
22:13:57superfuncRuby also does monkey patching, ew
22:14:29gokr1I am not saying I like Ruby - but I don't think they "suffer" from being able to use "?" in method names.
22:15:13Jehan_Honestly, it depends on whether it results in reasonable lexical rules.
22:15:32Jehan_Dylan allows you to stuff a whole lot more than just question marks in identifiers without breaking stuff.
22:15:52Jehan_Mind you, you'll need more whitespace in Dylan, but it still works.
22:16:17*Mat3 joined #nimrod
22:16:20Mat3hi all
22:17:33TrustableHi
22:18:28Jehan_gokr1: By the way, what do you need non-local returns for?
22:18:36gokr1Need? :)
22:19:06gokr1Smalltalk uses them quite a lot - mainly for control structures etc.
22:19:51Mat3hello Trustable
22:20:43gokr1It also means you can (I would say) make closure based interfaces work more "natural". This ... as a Smalltalker I just don't even think about it anymore.
22:21:12Mat3gokr1: makes sense, because the classic Smalltalk approach was compiling to a stack based VM (where all arguments like return statements are global)
22:22:05gokr1"return statements are global"...
22:22:10gokr1Not sure I follow.
22:23:18Mat3references to at runtime generated objects which holding a value (and these references where 'visible' to all objects independent of there 'context')
22:28:38Jehan_Hmm, I eschew return in general.
22:30:18*BlaXpirit quit (Quit: Quit Konversation)
22:30:58Mat3anyhow; Is it save to assume, code which compiles for Nim 0.9.6 will also compile for 0.10 (which do not relate on specific libraries) ?
22:31:22Jehan_Mat3: Modulo renaming/case sensitivity issues.
22:31:35gokr1Only?
22:31:44gokr1I mean, no other big changes?
22:32:19VarriountThere might be some misc changes that slipped through.
22:33:36*xenagi joined #nimrod
22:34:07Varriountsuperfunc: Monkey patching is something that is - if not common practice - a readily available tool in sufficiently dynamic languages.
22:35:45superfuncVarriount: doesn't mean it doesn't make me uncomfortable lol
22:36:25gokr1Jehan_: Have you built any "substantial" OO code in Nim? Its an honest question - I would value any insight from such an experience, like... if you felt you never really needed methods etc.
22:38:17Varriountgokr1: You should talk with filwit - he's the one that's been doing a bunch of OO stuff in Nim.
22:38:30Jehan_gokr1: Actually, I've mostly not been using OO in Nim.
22:38:47Jehan_Been using more of an ML/CLU-like style.
22:38:58gokr1And is that because... you decided not to, or because you are used to not doing OO?
22:39:40Jehan_gokr1: Actually, I'm very used to doing OO.
22:39:53Jehan_It's more of a "when in Rome, do as the Romans do" thing.
22:40:21Jehan_OO support in Nim is fairly limited compared to the alternatives.
22:41:12gokr1I mean, both me and Ron are long time Smalltalkers - our minds are fairly wired - but more importantly, we have a HUGE system written in Smalltalk. This is why I want to see how Nim would fare if we start porting stuff over. We can of course adapt, but, you know.
22:41:40Jehan_For what it's worth, my Ph.D. thesis involved a concurrency model on top of Eiffel and involved writing an Eiffel compiler, so I'm fairly certain I have some OO experience. :)
22:41:53gokr1On the other hand Nim seems flexible enough to sort of "deal" with any issues.
22:42:11gokr1Jehan_: I never used Eiffel but a friend of mine was heavily into it.
22:43:02Jehan_gokr1: The thing I'd mostly be worried about is the speed of the dispatch mechanism.
22:43:03Mat3Jehan_: Which concurrency model ?
22:43:14Jehan_Mat3: The one I designed for my thesis? :)
22:43:56Mat3sure, what describes your approach best ?
22:44:35Jehan_Synchronization contracts.
22:44:59Jehan_Also, it's completely memory-safe. No data races possible.
22:45:16superfuncJehan_: if you don't mind me asking, what do you work on now?
22:45:23Jehan_Not that that's anything novel, but lots of language designers can't seem to hack that part.
22:45:38Jehan_superfunc: Computer Algebra systems and the parallelization thereof.
22:46:02superfuncSo, still in academia?
22:46:09*boydgreenfield joined #nimrod
22:46:20superfuncJust curious, as I'll have to make that decision in a few years
22:46:21Jehan_Kinda sorta.
22:46:23*flaviu joined #nimrod
22:46:35Jehan_I'm not on any tenure track career path.
22:46:58Jehan_I figured out years ago that a job where my main activity would be writing grant proposals wasn't for me. :)
22:47:39superfuncI'll bet lol
22:48:24superfuncI'll likely end up in industry of some sort, hopefully still working in the PL area
22:48:40Jehan_So, technically I'm in academia, but I'm working more like a software developer.
22:49:04Jehan_It's a pretty narrow niche, but few software developers have the background in math etc. to deal with what I'm doing.
22:49:13Mat3reads like some kind of Actor based model
22:49:24Jehan_Mat3: It isn't. It's a shared memory model.
22:50:57Mat3hmm
22:51:00superfuncJehan_: sounds like a nice middle ground
22:51:13gokr1Jehan_: So you work now or doing your thesis?
22:51:19Jehan_gokr1: Work.
22:51:36gokr1Contractor?
22:52:39Jehan_No. Technically, a research fellow as they'd say in the UK.
22:52:51Jehan_Until one year ago, I worked on this: http://www-circa.mcs.st-and.ac.uk/hpcgap.php
22:54:04Jehan_And yes, one of the people on that list is the original author of GHC. Scarily smart guy. :)
22:54:33*Trustable quit (Quit: Leaving)
22:54:54superfuncJehan_: heh, my advisor worked on ghc for his phd at Glasgow in the 90s
22:55:15boydgreenfieldHas anybody experienced this issue w/ Babel – would love help troubleshooting if so: https://github.com/nimrod-code/nimble/issues/64
22:55:21Jehan_superfunc: Just to be clear, I'm not a big fan of lazy functional programming languages.
22:55:34superfuncLol, duly noted
22:56:38superfuncMy jury is still out, need more data before I make an opinion
22:56:40Jehan_I still think experience with Haskell is a pretty essential part of a CS education, of course.
22:57:45superfuncAgreed
23:04:14*rpag_ joined #nimrod
23:04:38gokr1flaviu: What OS and CPU are you on? Just curious about that bench we did
23:07:01Jehan_boydgreenfield: That looks like a DNS problem.
23:07:38Mat3need some sleep, ciao
23:07:41*rpag_ quit (Client Quit)
23:07:48*rpag quit (Ping timeout: 265 seconds)
23:07:52*Mat3 quit (Quit: Verlassend)
23:13:23*boydgreenfield quit (Quit: boydgreenfield)
23:15:17flaviugokr1: Linux 3.17.1-1-ARCH x86_64 / Phenom(tm) II X4 965
23:16:23gokr1Perhaps you used a newer nodejs.
23:16:39flaviuv0.10.32
23:16:46gokr1Mmm, mine is 0.10.25
23:17:05gokr1Oh well, whatever.
23:17:23flaviulooks like I'm out of date too :P 0.10.33 is the latest
23:17:31*superfunc_ joined #nimrod
23:24:16*superfunc_ quit (Quit: Page closed)
23:25:01*Matthias247 quit (Read error: Connection reset by peer)
23:27:25superfuncflaviu: love the phenom 2, I built so many budget gaming pcs for my friends with those in high school
23:28:22flaviuYep. Still compatible $ per benchmark point with the latest cpus, although power is pretty shoddy
23:29:32flaviu*comparable
23:31:06*rpag joined #nimrod
23:32:36*BitPuffin joined #nimrod
23:32:58BitPuffinAraq: C89/90 does not have 64 bit ints afaik, how do you deal with that since that's what you're compiling to?
23:39:42Jehan_BitPuffin: C89 says nothing about integer sizes at all, except that the shorter types must be subsets of the bigger types?
23:40:43Jehan_stdint.h and minimum int sizes came with C99.
23:44:20fowlhola BitPuffin
23:52:33*boydgreenfield joined #nimrod