<< 23-11-2013 >>

00:03:43C0C0I assume channels can be used in a one to many sending way?
00:03:49*brson quit (Quit: leaving)
00:04:01C0C0e.G. the organizer publishes in one channel and all the threads try to read from the same channel?
00:04:04*brson joined #nimrod
00:04:39C0C0is there a GO-like select operation for multiple channels?
00:05:02fowlC0C0, i believe channels.recv removes the message from the queue
00:05:36C0C0e.G. multiple threads can listen the same channel but only one gets the message?
00:05:50fowlyea
00:06:38C0C0ok thats good
00:14:43*shodan45 quit (Ping timeout: 245 seconds)
00:16:59Araqyeah please report the GC crash though I'm sure it's due to you using it wrong :P
00:17:27C0C0me too :)
00:17:39C0C0currently trying to use channels
00:17:58C0C0thing is: its hard to break down the crash into a small failing example I'm afraid
00:18:20C0C0so we could upload a few hundret lines of path tracer code
00:18:52C0C0is there a primer on how to use channels somewhere?
00:19:00C0C0a little example code?
00:19:20Araqno. nowbody knows how to use them
00:19:29fowllol
00:19:45C0C0^^
00:20:22leexwhat does the compiler want to tell me if it says: Error: for a 'var' type a variable needs to be passed
00:20:41leexC0C0 and I have been getting this a couple of times now
00:20:58leexnow when we do: channel.recv()
00:21:07fowlthat you're trying to pass it a variable that you declared with let
00:21:28C0C0hmm no let anywhere^^
00:21:35dom96or that you're trying to pass it a literal
00:21:44C0C0nope
00:21:51fowlC0C0, bet?
00:21:59C0C0fowl: maybe implicitly
00:22:08C0C0but no let is written anywhere
00:22:09*BitPuffin quit (Ping timeout: 272 seconds)
00:22:14dom96what does the code look like then?
00:23:10leexdom96, fowl http://pastebin.com/yUYRXyi4
00:24:01C0C0so we are creating some threads, passing the channels as arguments
00:24:02dom96where does the error happen?
00:24:14C0C0line 9 used to read
00:24:17leexthreads.nim(9, 12) Error: for a 'var' type a variable needs to be passed
00:24:28C0C0var i = channels.incoming.read()
00:24:52C0C0(but as leex said this is irrelevant to the error)
00:25:04fowlno it isnt
00:25:20C0C0well either way the error is the same
00:25:30fowlnimrod passes arguments as const unless you specify it as var T
00:25:52fowlyou shouldnt be passing the channels in the thread argument
00:26:04C0C0how should the thread access them?
00:26:06C0C0globals?
00:26:09fowlyes
00:26:31C0C0ok
00:26:36C0C0gonna try that
00:27:01C0C0(it might seem we are ranting a lot here, but we acctually enjoy nimrod quite a bit)
00:27:26C0C0a littel to few stackoverflow questions to finde when googeling for problems though
00:27:46C0C0^^
00:30:37Araqdon't ever pass TChannel around
00:30:44Araquse ptr TChannel for that
00:30:49Araqand yes. ptr not ref
00:30:59leexhttp://sprunge.us/eGWK and http://sprunge.us/jfYY
00:31:20C0C0ok
00:33:49fowlActor support for Nimrod. An actor is implemented as a thread with a channel as its inbox.
00:33:59fowlmaybe?
00:34:24C0C0Araq: how do we get a ptr to a channel?
00:35:06C0C0var a = TChannel[int]() ; channel_ptr = addr(a) doesnt seem to work
00:35:49Araqwell you need to create the channel differently
00:36:11C0C0is there docu for that anywhere?
00:36:20C0C0(less wasting your time)
00:36:34Araqhttp://nimrod-lang.org/channels.html
00:36:38Araqopen
00:37:36C0C0but open neither takes a ptr nor returns one ?
00:38:46fowlC0C0, when you create the thread pass it result.addr and job.addr
00:39:20C0C0öhm ok this is the direct opposite of what araq just said?
00:39:31fowlno
00:39:47fowlyou do also need to open() the channel before you use it
00:40:07C0C0ah
00:42:01fowlhttp://pastebin.com/VsZuudpF
00:42:27C0C0cool thx
00:42:42C0C0that was what we where currently trying^^
00:44:10C0C0nice
00:44:14leexfowl: thanks
00:44:14C0C0this works as expected
00:44:17C0C0thanks a lot :)
00:45:05leexout of memory :D maybe we shouldn't send so much 3's to the channel :D
00:47:53Araqa TChannel really should be a global
00:48:29Araqin fact, globals are Nimrod's way to do thread communication
00:52:27*faassen left #nimrod (#nimrod)
00:52:45C0C0nice this seems to work quite fine
00:59:15*MFlamer quit (Ping timeout: 272 seconds)
01:16:21*shodan45 joined #nimrod
01:16:27*shodan45 quit (Client Quit)
01:18:02*DAddYE quit (Remote host closed the connection)
01:21:35C0C0Araq: but the GC is still broken
01:21:51C0C0since we are programming a pathtracer we have a scene object
01:22:23C0C0we don't really want to suply every thread with a complete copy of this scene object
01:22:38C0C0(however threads should only read from the scene)
01:22:51C0C0I guess the right way is to use a ptr to scene?
01:23:00C0C0and pass this to the treads?
01:24:01*DAddYE joined #nimrod
01:24:16C0C0but then what about all the objects that are GC'd in the thread heaps
01:25:26fowlptrs are not gc'd
01:26:01fowlif you want to get a pointer to the scene data (that's a ref) do scenedata[].addr
01:26:05C0C0fowl but we create new objects that may hold references to objects obtained via a pointer
01:27:11C0C0e.g. an intersection object that stores the scene object that caused the intersection
01:27:20C0C0now the intersection object ist GC'd
01:27:28C0C0but intersection.obj is not
01:27:54fowlidk
01:28:37*DAddYE quit (Ping timeout: 248 seconds)
01:41:29*ics joined #nimrod
01:56:16*brson quit (Ping timeout: 264 seconds)
02:00:50C0C0thanks for all the help
02:01:02C0C0leex will paste a nice little picture for tonights work
02:03:40*EXetoC quit (Quit: WeeChat 0.4.2)
02:06:33*familiar125 joined #nimrod
02:08:12leexhttp://i.imgur.com/IDxzTP8.png
02:12:54Varriountleex, C0C0 , ooh, shiny
02:20:12familiar125another Nimrod ray tracer?
03:12:31*Demos joined #nimrod
03:28:24*DAddYE joined #nimrod
03:33:31*DAddYE quit (Ping timeout: 272 seconds)
03:36:13*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:37:42*familiar125 left #nimrod (#nimrod)
03:41:40*ics joined #nimrod
04:03:00*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
04:04:12*ics joined #nimrod
04:30:10*DAddYE joined #nimrod
04:34:57*DAddYE quit (Ping timeout: 272 seconds)
05:20:55*Demos quit (Quit: Leaving)
05:31:35*DAddYE joined #nimrod
05:35:58*DAddYE quit (Ping timeout: 245 seconds)
06:09:21*OrionPK quit (Quit: Leaving)
06:32:56*DAddYE joined #nimrod
06:37:02*DAddYE quit (Ping timeout: 240 seconds)
07:29:47*ics quit (Ping timeout: 252 seconds)
07:34:18*DAddYE joined #nimrod
07:39:09*DAddYE quit (Ping timeout: 272 seconds)
07:45:49*zahary joined #nimrod
08:35:40*DAddYE joined #nimrod
08:39:50*DAddYE quit (Ping timeout: 240 seconds)
09:14:34*Jackneill joined #nimrod
09:35:53*p0nce left #nimrod (#nimrod)
09:37:01*DAddYE joined #nimrod
09:41:45*DAddYE quit (Ping timeout: 272 seconds)
10:09:50AraqC0C0: indeed you should pass a "ptr"
10:21:28C0C0Araq: does that include all objects that hold refs to objects from the other heap?
10:21:59C0C0(e.g. intersection holds a ptr to the sceneobject)
10:38:18*DAddYE joined #nimrod
10:38:20C0C0(also: is there a way to construct a const ptr e.g. one where the underlaying object must not be changed)?
10:42:55*DAddYE quit (Ping timeout: 272 seconds)
10:59:52C0C0anyone around?
11:06:34fowlC0C0, no there isnt
11:10:31C0C0cool
11:10:57C0C0mind to enlighten me about the nimrod memory modell?
11:13:52fowleh?
11:14:30C0C0I just don't get how to implement a shared data structure
11:14:37C0C0(in my case the scene tree)
11:14:41AraqC0C0: well what you should do is to GC_ref your 'ref' so that it can't be collected, cast it to ptr and then GC_unref when the threads are done with it
11:15:06C0C0Araq: e.G. the entire scene tree consist of ptrs
11:15:25Araqwell it really depends on what the threads do
11:15:30C0C0read
11:15:32C0C0and iterate
11:15:40C0C0nothing else
11:15:42Araqthat's fine with the approach I suggested
11:16:07C0C0e.G. I only have to pass the root node as pointer?
11:16:12Araqyes
11:16:23C0C0ok thx
11:17:17C0C0if I create new datastructures in the threads that hold refs to elements of the tree is that ok as well?
11:17:24C0C0sorry forgot to mention that
11:17:47Araqdepends on if the datastructure lasts longer than the thread
11:17:56C0C0nope
11:17:59C0C0a lot shorter
11:18:02Araqremember that 'new' allocates on a thread local heap
11:18:16C0C0yeah sure
11:18:34C0C0but how does the GC free a local structure that holds a ref to a foreign heap?
11:19:15Araqgood point, you must not do this
11:19:23Araqyou have to use 'ptr' for these
11:19:46C0C0ok
11:19:55Araqit's all pretty complex and unsafe :-/
11:20:11C0C0yeah and for a noob like me completely intransparent
11:20:20Araqbut hey, we'll get a better memory model "soon"
11:20:25C0C0:)
11:20:37C0C0also let me say that coding nimrod is quite fun
11:20:52Araqthanks
11:21:01C0C0(modulo having to as the channel for pretty much every littel detail)
11:21:21Araqwell feel free to improve the implementation
11:21:46Araqit's very hard though :P
11:21:52Araqbbl
11:22:12C0C0(I was more considering improving documentation)
11:27:30C0C0if i have a ptr to a baseclass poiting to subclass are methods still resolved correctly?
11:35:01C0C0Araq: when I pass a member of the tree to a function that expects a ref is that valid?
11:35:10C0C0or do I always have to pass ptrs?
11:39:24fowlC0C0, method's dynamic dispatch works with ptr and ref, yes
11:39:43*DAddYE joined #nimrod
11:39:48C0C0hmm
11:39:50C0C0strange
11:42:32*EXetoC joined #nimrod
11:43:28AraqC0C0: methods should still be resolved properly, yes
11:43:55Araq'ref' can never point to members
11:44:15C0C0?
11:44:23Araq'ref' is an owning pointer
11:44:53*DAddYE quit (Ping timeout: 272 seconds)
11:44:58C0C0oh member was to be taken mir liberally
11:45:21C0C0the tree nodes contain seq of refs to objects or refs to objects
11:46:47Araqwell it depends ... I would rather change the proc to take a ptr in the first place
11:47:19C0C0yeah did that allready
11:47:39C0C0but now it seems that method resolving doesn't work anymore
11:48:00Araqhmm that could be a bug
11:48:19fowli disagree because i just tested methods with ptrs
11:48:25C0C0let me try to build a minimal example
11:48:30C0C0then we can talk better^^
11:48:57Araqand while we're at it ... I plan to replace allocShared's implementation to use a lock free memory allocator
11:49:16Araqthere is some paper which claims to have an implementation too somewhere
11:50:52*Associat0r quit (Quit: Associat0r)
12:09:29C0C0funny I found a bug in the codegen
12:10:32C0C0http://sprunge.us/fBgQ <- minimal failing example
12:11:00C0C0if I use line 17 correct method lookup fails
12:11:07C0C0if i use line 18 codegen fails
12:11:38*BitPuffin joined #nimrod
12:12:54fowlC0C0, one method wants ptr ref T, the other one wants ptr T
12:13:06fowlin this case they are normal functions
12:13:48C0C0aah
12:15:03C0C0then the typchecker complains that w[0].addr is ptr ref T... so I have to use w[0][].ptr
12:15:20C0C0does that avoid the garbage collectors anger?
12:15:25fowlw[0][].addr
12:15:48fowlit should
12:17:08C0C0e.G. w[0][].addr does not preduce a reference cound modefication on the foreign heap object?
12:17:52fowlno it doesnt
12:18:07fowlits the lazy way to cast to pointer
12:19:45C0C0ok
12:21:40*BitPuffin quit (Ping timeout: 245 seconds)
12:22:30C0C0Araq: you might want to look into the code gen stuff anyway
12:23:27C0C0also there seems to be a problem with the assigning seq[A] created by the literal @[A()] to a variable of type set[B] if A is an instance of B
12:24:20fowlC0C0, try giving the seq a type
12:24:42C0C0yeah that should work
12:25:02C0C0(I don'T really have the problem, just stumbled uppon it during construction of the minimal sample)
12:25:40*BitPuffin joined #nimrod
12:27:11AraqC0C0: I'm quite sure it's already reported
12:27:14C0C0ok
12:27:20C0C0sorry then
12:27:26Araqnp
12:29:27C0C0thanks for all the support guys
12:29:32C0C0working fine now
12:29:43C0C0now we can render images with less noise^^
12:41:03*DAddYE joined #nimrod
12:45:25*DAddYE quit (Ping timeout: 248 seconds)
12:46:45BitPuffinhave you guys been discussing this the whole night? o.O
12:47:22C0C0BitPuffin: nope, went to bed at around 4am local time, started working at 11am again :P
12:47:30dom96hello
12:47:48C0C0hi
12:48:36BitPuffinhaha :D
12:48:37BitPuffinnice
12:48:41BitPuffinhey dom96
12:49:11C0C0BitPuffin: weekend => I can work on fun stuff^^
12:49:13dom96hey BitPuffin
12:49:34BitPuffinC0C0: hehe :D
12:49:40BitPuffindom96: sup?
12:50:29C0C0BitPuffin: not that my masters thesis wouldn't be fun from a theoretical point of view but unfortunately I have to depend on a 1 Million line Java codebase written by 10 generations of more or less incapable students...
12:52:32AraqC0C0: seems like your code would make the base for a really nice article about nimrod's concurrency model. please do it.
12:53:28*CarpNet joined #nimrod
12:53:34Araqit will take some time until that information becomes outdated for better or worse
12:53:48C0C0^^
12:54:27C0C0not sure that I understood nimrods concurrency model at all
12:56:01BitPuffinC0C0: sounds awesome lol :P
12:56:26C0C0BitPuffin: in principle its quite cool stuff really, but fixin other peoples bugs is not so much fun
12:56:35BitPuffinC0C0: what is it about?
12:56:52C0C0termination analysis for LLVM bytecode
12:57:14BitPuffincool!
12:57:21BitPuffinwhat's that got to do with java though?
12:57:22C0C0or in my case more "proving memory correctness of llvm bytecode"
12:57:37C0C0BitPuffin: the chair has this pet project
12:57:39C0C0called aprove
12:57:54C0C0http://aprove.informatik.rwth-aachen.de/
12:58:13C0C0where AProVE was the most powerful tool for termination of TRSs in 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 and 2012.
12:58:17BitPuffinah
12:58:19C0C0to quote there website
12:58:24C0C0aprove is written in java
12:58:42C0C0and I'm working on a new frontend for llvm
12:59:21BitPuffininteresting
12:59:26BitPuffinfor verifying llvm code?
12:59:28BitPuffinwith aprove
13:00:06C0C0yeah
13:00:18BitPuffincool
13:01:06C0C0"or how I stoped worrying and lerned to love the java"
13:01:28BitPuffinhehe
13:01:36BitPuffinwell Java is bad, but it works
13:03:49C0C0its not even that bad If you don't see it from the "what can I do it" point of view but from the "what can all the 50 people before me do wrong" view
13:04:33BitPuffinwell it is suitable for some things
13:05:14C0C0yeah for "not fucking up everything" for example :P
13:05:44EXetoCverbosity overload
13:06:09BitPuffinC0C0: you mean like in C++ :P
13:06:25C0C0EXetoC: fun fact: wehenever I read a new piece of code, I copy it into a new editor and strip all type declarations
13:06:36C0C0BitPuffin: *cough*
13:07:21BitPuffinI don't really know why people are so scared of verbosity
13:07:40BitPuffinThe important thing is not that it is quick to type
13:07:49C0C0last project I worked on was a little smaller, but C++ written BY one really capable guy with WAY to much fun with templates + hordes of students
13:08:01BitPuffinit's that you can read and understand the code without having to go look at its definitions and so on
13:08:20C0C0BitPuffin: well I really need more time to read the code with types then without
13:08:35C0C0a = new Set()
13:08:42C0C0a[tuple] = 4
13:08:49BitPuffinC0C0: but nimrod has types
13:08:54C0C0is nearly as understandabel as
13:09:28BitPuffinwell sure with constructors etc it is really stupidly obvious
13:09:45BitPuffinbut what about something where you pass in a string and get like a helicopter back
13:09:48C0C0HashSet<ImmutablePair<AbstractState,AbstractState>,LLVMReference> = new HashSet<ImmutbalePair<AbstractState,AbstractState>, LLVMRefercen>()
13:10:02BitPuffinhaha
13:10:32C0C0BitPuffin: well if that hapens the compiler tells me anyway
13:10:36BitPuffinbut yeah you shouldn't need to specify two things twice
13:10:37C0C0(or the IDE for the matter of fact)
13:10:55C0C0I whish I could just not display that crap in each and every line
13:10:55BitPuffinwell then we are not discussing language anymore
13:11:01BitPuffinthen we are discussing tools
13:11:02fowlauto foo = hash<t1, t2>()
13:11:07fowl;
13:11:25C0C0fowl: what is that supposed to say?
13:11:50fowlauto is a c++11 thing
13:11:52C0C0BitPuffin: true that, anyway I find ruby code a lot easier to read then java code
13:11:54BitPuffinC0C0: that in c++ you have the auto keyword
13:11:58C0C0fowl: I know
13:12:04BitPuffinC0C0: same here
13:12:08C0C0but still t1, t2 is cheating :P
13:12:17C0C0now I know you could typedef in C++
13:12:19BitPuffinC0C0: I like langages where you don't need an IDE to know what's going on
13:12:21fowlwell i didnt feel like typing all that you typed lol
13:12:27C0C0:P
13:12:51C0C0BitPuffin: I don't really thing that explicit type annotations are helping reading code
13:13:00C0C0maybe a function argument level
13:13:06BitPuffinC0C0: I think it totally depends
13:13:26BitPuffinI mean in the case of newVector()
13:13:38BitPuffinyou don't really need an annotation to know that you get a vector back
13:13:45C0C0yeah
13:13:57Araqthe "what can all the 50 people before me do wrong" view is fundamentally flawed imho
13:14:05C0C0most of the time I acctually don't really care about the type (especially when reading code)
13:14:08EXetoCBitPuffin: isn't some of the verbosity in java for example unecessary? Anyway, I'm trying to be a little more verbose when I'm writing Nimrod code
13:14:22BitPuffinEXetoC: a lot of it is unnecessary
13:14:32C0C0BitPuffin: typedefs would be sooo very nice
13:14:35dom96looks like the strangeloop talks are being released ... slowly.
13:14:45BitPuffinI didn't say that having to repeat everything twice per line was good
13:14:50BitPuffinI just mean verbosity isn't bad
13:14:52BitPuffinjust repetition
13:15:04BitPuffindom96: is Araq's out?
13:15:15dom96I don't think so.
13:15:16C0C0BitPuffin: bad thing is that stuff like this is not the exception but nearly every variable I touch
13:15:24C0C0I was considering subclassing Hashmap
13:15:37BitPuffinC0C0: yeah and that's where it is bad
13:15:41C0C0just so I can write new MapRangeToRef()
13:15:45C0C0or something
13:15:52BitPuffinit should (like in nimrod) be optional to annotate the type
13:15:57EXetoCBitPuffin: ok repetition then
13:16:13BitPuffinand when it's really not clear from the name of the procs you are calling what you get back then you should consider annotating
13:16:32C0C0BitPuffin: big pluss for nimrod
13:18:15BitPuffinEXetoC: With verbosity I mean things like keywords or variables that are shortened in order to save one character and suddenly that word can be read as multiple different words
13:18:21BitPuffincausing ambiguity
13:19:10AraqI often wonder what the Java equivalent of math would look like
13:19:24Araq"we don't let you write integrals they can be hard to understand"
13:19:39*Amrykid quit (Changing host)
13:19:39*Amrykid joined #nimrod
13:19:40Araq"you can easily use a lim of a infinite sum instead"
13:19:57Araq"but we don't let you write infinite sums either. they can be hard to understand"
13:20:00BitPuffineverything has to be a polynomial
13:20:13EXetoCok
13:20:17C0C0linear plz
13:20:23Araq"just use baby talk with ... to imply infinite repetition"
13:20:39C0C0don't use infinity in first place
13:20:48Araqyeah it's too hard
13:20:58Araqdon't calculate this properly
13:20:59C0C0difference between math and java
13:21:05Araquse your thumb instead
13:21:08C0C0is that java was designed to be used by trained monkeys
13:21:27C0C0(and it does that job quite ok I think)
13:21:41Araqnot really. Java fails spectacularly for this too
13:22:02Araqbecause the paradigm to embrace is then plain old procedural programming, not OO
13:22:14Araqprocedural is much easier to get right
13:22:22C0C0hmm lets not go to java+OO
13:22:25C0C0thats a bad place
13:23:38C0C0I mean nimrod is a more "OOP" language then java
13:23:49BitPuffinoh shit
13:23:53BitPuffinC0C0 take cover
13:25:01C0C0why?
13:25:31Araqinteresting. I consider Nimrod to be anti OO in lots of ways
13:25:40BitPuffinthere
13:25:44EXetoCRussel Winder said in one of his talks that Java didn't have "true" OO until Java 8 IIRC
13:26:00C0C0Araq: and still its more OO then java :P
13:26:14BitPuffinthen wtf is java
13:26:27C0C0at leat in nimrod I can define methods for (int) and put a int into Container
13:26:44BitPuffinah
13:26:46BitPuffingotcha
13:27:01C0C0I mean WTF?
13:27:09C0C0they force you to create a Main class
13:27:12BitPuffindoes nimrod have multiple inheritance? can't remember lol
13:27:21C0C0BitPuffin: mutliple inheritance != OO
13:27:24BitPuffinC0C0: there is an integer class though xD
13:27:26BitPuffinno I know
13:27:31BitPuffinbut it just came to mind
13:27:45C0C0BitPuffin: Imho Multiple inheritance is an extreamly bad Idea
13:27:47AraqEXetoC: Russel Winder is full of ridiculous claims
13:28:10C0C0golangs's anonymous structures are way more to my liking
13:28:11EXetoCok..
13:28:17BitPuffinC0C0: haha a main class
13:28:23C0C0traits/mixins ftw
13:28:23BitPuffinthat's not the only class they force you to create
13:28:31BitPuffinthey force you to put everything in a class
13:28:38BitPuffinand that's really where the shit hits the fan for me
13:28:50C0C0BitPuffin: like: you have to have a fucking main class that does absofuckinglutely nothing but call main
13:29:02C0C0but ooohhh... lets not make ints objects...
13:29:08BitPuffinhahaha
13:29:48C0C0and well lets add generics
13:29:54C0C0so we can have Set<T>
13:30:09C0C0now what happens if you have a = new Set<Foo>()
13:30:20BitPuffinor better, new Set<int>
13:30:26BitPuffin();
13:30:28C0C0a.contains(new SomethingThatDoesntHaveToDoanythingwithFoo)
13:30:31C0C0?
13:30:37C0C0type error?
13:30:40C0C0runtime error?
13:30:47fowlyes?
13:30:58BitPuffincomputer what happened
13:30:58C0C0no
13:31:01C0C0nothing
13:31:05C0C0returns null
13:31:12fowllol!
13:31:17C0C0same btw for get(wrong_typed_value)
13:31:53C0C0took me 3 day finding that bug after some massive refactoring trusting the fucking type checker
13:32:04fowlmultiple dynamic dispatch is way better than bound methods anyways
13:32:11EXetoCAraq: are you saying that's wrong? I've heard several people claim that the original meaning of OO is very different from the kind of OO that we get with the very common class keyword
13:32:16fowlway more useful i should say
13:32:44C0C0fowl: throw in a little pattern matching :)
13:33:30BitPuffinC0C0: but I like that you can't even create generics of the primitive type
13:33:49C0C0BitPuffin: yeah right? totaly OOP
13:33:52BitPuffinsuch a lovely wart
13:34:11fowli didnt realize java had generics
13:34:18fowlwhy is ArrayList still used
13:34:18C0C0^^
13:34:23BitPuffinC0C0: seems like you have a lot of java talk to get off your chest lol
13:34:24C0C0fowl: its not
13:34:37AraqEXetoC: I claim Alan Kay changed the meaning of OO in order to not be blamed for the crap that resulted from it
13:34:37BitPuffinit is
13:34:44fowli only read java, sometimes, i still see it used
13:34:48BitPuffinwe used it a lot when learning java in school
13:35:01C0C0BitPuffin: °_o
13:35:03fowlType x = (Type)someArrayList[i];
13:35:21EXetoC:E
13:35:27C0C0if thats in your codebase => run and hide
13:35:30Araqmore seriously Alan Kay's definition of OO makes Smalltalk not OO, but Erlang
13:35:46Araqso ... it's bs all the way down
13:36:12BitPuffinC0C0: it is! although I don't touch that codebase anymore
13:36:15BitPuffinI'm liberated
13:36:17BitPuffinI'm nimerated
13:36:22C0C0^^
13:36:37fowleiffel looks interesting
13:36:52fowlit wouldnt compile for me though so i moved on
13:36:55BitPuffinhonestly it is a great reason that I won't go to university
13:37:04C0C0?
13:37:07BitPuffinusing java causes me to burn out xD
13:37:31C0C0thats why I spend the whole weekend building stuff against the burning
13:38:00BitPuffinI guess, but I feel like school depresses you so much that you don't even have that energy when the weekend comes
13:38:09AraqIn my not so humble opinion, programming by relying heavily on message passing has never worked and never will
13:38:09BitPuffinespecially when you do java
13:38:41BitPuffinAraq: isn't that the best concurrency thing we have in nimrod atm though?
13:38:50C0C0Araq: I find ruby quite working & enyojable
13:38:59BitPuffinoh no
13:39:02BitPuffinC0C0 take cover!!
13:39:09C0C0BitPuffin: you keep saying that
13:39:20BitPuffinI do
13:39:27C0C0but I like a good flamewar
13:39:38fowli came from ruby
13:39:45AraqC0C0: ruby is not OO by Kay's definition either
13:39:45BitPuffinI came from everything
13:40:02C0C0Araq: I don't really care about Kay's definition^^
13:40:18Araq;-)
13:40:34C0C0Araq: ruby is pretty much second only to smalltalk imho (At least sampled from the langauges I know)
13:40:44C0C0(with respect to "how OO is the langauge")
13:41:33BitPuffinI think ruby is great for hacking on small projects
13:41:38BitPuffinit's a much better perl
13:41:47fowl^
13:41:50Araqwell I keep hearing good things about Ruby. I never used it. Python was my last dynamically typed language. ever.
13:42:00C0C0^^
13:42:24*DAddYE joined #nimrod
13:42:32C0C0BitPuffin: I really whish ruby had optional static typing + pattern matching
13:42:42fowli hit the OO-wall A LOT in ruby
13:42:48C0C0fowl: ?
13:42:56C0C0what is the OO-wall?
13:43:19BitPuffinhasn't everyone experienced the oo-wall?
13:43:42fowlwhere your hierarchy becomes too specialized, you have classes for Actor, NPC, Player, Bat, Dog, etc and want to share functionality between them, end up repeating code
13:44:06C0C0fowl: don't use a hierarchy?
13:44:07AraqBitPuffin: nimrod lacks multiple inheritance (MI) but I have nothing against MI. But it's lots of work to implement.
13:44:25BitPuffinAraq: so do you think we will ever have it?
13:44:27C0C0fowl: I think I never used hierarchies with depth > 2
13:44:33C0C0Araq: pleas don't
13:44:35Araqin fact, I rather have MI than single inheritance + interfaces
13:44:42BitPuffinC0C0: you don't have to use it
13:45:08AraqSI + interfaces means you have 2 hierarchies instead of 1. I don't see how that simplifies things.
13:45:17BitPuffinwell sure but what's left when you don't have the hierchy
13:45:20BitPuffinachur,hy
13:45:22BitPuffinyou know that word
13:45:24BitPuffinthat spells
13:45:34BitPuffinhierarchy
13:46:08Araqand the last time I thought about it, MI is more efficient than SI+interfaces
13:46:16BitPuffinand powerful
13:46:18C0C0mixins/traits is imho far superior to MI
13:46:27C0C0as in "more powerfull"
13:46:38*DAddYE quit (Ping timeout: 240 seconds)
13:46:48BitPuffindoesn't that have a much different usecase though
13:47:00C0C0BitPuffin: not really afaik
13:47:06BitPuffininheritance/interfaces/MI is used for polymorphism
13:47:15AraqC0C0: I don't know your definition of mixins/traits to comment
13:47:16EXetoCAraq: dynamic languages are often used for game logic etc, but Nimrod would be fine also, don't you think? with proper dynamic loading etc
13:47:22EXetoCmaybe having a complete VM will help too
13:47:46BitPuffinI'm gonna use nimrod as a scripting lang for my games
13:47:53BitPuffin"scripting"
13:47:56BitPuffinlogic
13:48:02EXetoCbut I don't know, maybe you'd have to bundle some things then. I'm not exactly an expert at this
13:48:05fowlEXetoC, what is dynamic loading
13:48:05bastian_is there any way to tell the compiler to link with another object file?
13:48:27Araqbastian_: {.link: "foo.o".} iirc
13:48:29BitPuffinall you do is that you compile the logic into a dynamic lib and load it
13:48:52BitPuffinwell heh
13:48:55BitPuffin"all" you do
13:48:58C0C0Araq: basically fixes the diamond of death by inserting the "inherited classses" virtually in the hierarchy
13:49:10bastian_Araq: thanks, didn't know this is a pragma
13:50:09AraqC0C0: c++ has 'virtual' inheritance for this afaik
13:50:14EXetoCBitPuffin: it might be simple eventually
13:50:28C0C0Araq: hmm don't know about virtual inheritance in C++
13:50:35BitPuffinEXetoC: it is already rather simple I think
13:50:43BitPuffinof course I haven't tried it yet
13:50:49BitPuffinbut I don't see why it'd be difficult
13:50:56C0C0Araq: boils down to this: you have a class A that inherrits from B and extends traits C,D
13:51:10EXetoCBitPuffin: we could give it a go some time
13:51:17BitPuffinEXetoC: sure
13:51:24BitPuffinI'm not doing it for my december project probably
13:51:30C0C0then you create a virtual hierachy A < C' < D' < B
13:52:06C0C0so wher C' is identical to C except that it inherits from D'
13:52:14EXetoCBitPuffin: so you didn't want help from me with the game? I thought we discussed it briefly when you asked dom96 about it, but yesterday you seemed unaware of that
13:52:57BitPuffinEXetoC: I don't know what you are talking about :(
13:53:03fowlEXetoC, i would just use something like lua, python, tcl, perl, lisp, scheme, you know, any of the scripting languages that are for scripting
13:53:17BitPuffindo you mean the potential open source game project we discussed like a week back?
13:54:05EXetoCyep
13:54:17C0C0Araq: that fixes the "OO-wall" that was described earlier, replaces multiple inheritance quite nicely and makes interfaces obsolete
13:54:27EXetoCfowl: ok, maybe it sucks less compared to writing all the code in one of those languages :-)
13:54:38BitPuffinAh well that wasn't really a project I started or wanted help with, just something we could all do together to have something nice to show off in nimrod
13:57:06BitPuffinwell what I mean is, it was not "my" project
13:57:35EXetoCyeah ok
13:58:13AraqC0C0: alright but then maybe "row polymorphism" does the same :P it's hard to evaluate all the newer OO'ish language features and decide what to put into in a systems programming language
13:59:13C0C0Araq: don't really know what row polymorphism is
13:59:23Araqsee?
13:59:25C0C0^^
13:59:41C0C0Araq: I was just saying that traits are better then MI / Interfaces
14:00:03Araqyeah and now I have to look up various definitions and code examples to see if you're right
14:00:22Araqor you prepare an article for me :P
14:00:30BitPuffinyeah it feels like mixins have different meanings in every language if I'm gonna be honest
14:00:41C0C0BitPuffin: yeah thats true
14:01:10Araqso ... that's the way to get a new OO'ish feature. don't make me work.
14:01:42C0C0Araq: honestly I havent even checked wether nimrod cannot emulate this stuff allready :P
14:01:43BitPuffinAraq: how do we get you to give us competitive concurrency? :D
14:02:46AraqBitPuffin: pay me so I can live from Nimrod development. Then I'll show you the true meaning of perfection. :P
14:05:58C0C0Araq: http://blog.safaribooksonline.com/2013/05/30/traits-how-scala-tames-multiple-inheritance/ <- I finde this article quit good and short
14:10:53BitPuffinAraq: I already plan to donate a percentage from what I make on nimrod to nimrod :P
14:13:13AraqBitPuffin: thanks. Well the current problem I'm facing is that my new design is too complex and reintroduces "modes" what the write tracking tries to avoid
14:13:43BitPuffinAraq: you mean in for the concurrency?
14:13:49BitPuffins/in//
14:13:54Araqyes
14:14:22BitPuffinmodes as in when you open a file for example and specify if you are gonna read, write, or both etc?
14:14:35Araqmodes as explained in my article
14:14:56BitPuffinon the blog?
14:15:07BitPuffinI'll go ahead and read it
14:15:27BitPuffinI'm not getting any response from irc.mozilla.org #identiy anyway
14:15:56fowlwhere's the blog again
14:16:48BitPuffinhttp://nimrod-lang.org/blog
14:16:55fowlty
14:17:04BitPuffinno problemos!
14:17:27BitPuffineller som man säger i götet, nemas problemas änna dåva
14:17:37fowlik het van jaaaar
14:17:39fowljajaja
14:18:01fowlsry i dont know swedish, only pig dutch
14:18:17BitPuffinhaha :P
14:18:29BitPuffinEXetoC: translate
14:28:41Araqin fact, I fear the current concurrency model is already quite nice with the safety vs efficiency trade-off it provides. When you want shared memory efficiency you need an ownership model in your head and might as well do manual memory management then.
14:29:10C0C0Araq is there a way to get a const ptr?
14:29:19Araqno
14:31:33Araqperhaps you can try to make a 'distinct' pointer and provide only a read-access deref operation
14:32:24Araqdunno if that's feasible
14:32:32C0C0Araq: its not really importand
14:32:46C0C0I would just sleep better if my shared memory was read only :P
14:33:10C0C0(and would have been an interessting fact for an multithreading article)
14:37:30Araqusually "const" is a feeling good feature only as mutable aliases are allowed to the same memory
14:37:57Araqnimrod's planned write tracking doesn't have this problem
14:38:04C0C0nice
14:41:39Araqwhat's a polynimial part like 3*x^2 called in english?
14:43:19C0C0I'd guess term of degree 2
14:43:48*DAddYE joined #nimrod
14:45:46BitPuffinwhat the prettiest way to construct a json object in nimrod
14:45:59dom96Using `%`
14:46:18BitPuffinyeah but how do I use that
14:46:37BitPuffinvar p: PJsonNode = %[???]
14:46:38dom96var obj = @{"field": %56}
14:46:44dom96er
14:46:46EXetoCBitPuffin: I don't even
14:46:48dom96s/@/%/
14:46:53BitPuffinah
14:47:00Araqactually we should make that a macro
14:47:07Araqso only 1 % is necessary
14:48:01dom96indeed
14:48:07*DAddYE quit (Ping timeout: 246 seconds)
14:49:24BitPuffinIs there a module to parse x-www-form-urlencoded?
14:50:26dom96cgi.urldecode perhaps
14:51:24BitPuffindoesn't seam right
14:51:28BitPuffinbasiaclly this:
14:51:48BitPuffinassertion=blablablab&audience=http://foo.com:8383
14:52:10BitPuffinso that I could parse that and get something that I could get form[assertion]
14:52:15BitPuffinerr
14:52:17BitPuffin"assertion"
14:52:33Araqcgi can do that
14:53:29BitPuffinhow?
14:53:50Araqdunno, look at its docs
14:53:56BitPuffinI am -_-
14:54:31Araqiterator decodeData
14:55:44BitPuffinisn't that actually the same format as cookies?
14:55:59BitPuffinso I could actually do data.getCookie("assertion")
14:57:02Araqno, it's similar but not the same
14:57:14BitPuffinah
14:57:23BitPuffinwell okay so I have to loop?
14:57:34BitPuffinsince it is an iterator
14:57:46Araqyou can loop and store it in a PStringTable
14:58:06Araqunfortunately cgi misses that for input strings
14:58:16BitPuffinhmm
14:58:28Araqand only provides one which reads from stdin or environment var
14:58:33BitPuffinmaybe for what I'm doing maybe just substrining away assertion= from the start of the string is sufficient
14:58:46Araqdon't do that
14:59:03Araqthis way is prone to bugs
14:59:04BitPuffinwhy? all I am getting in anyways is a string with "assertion=blabla"
14:59:23Araqnot using a real parser tends to be buggy
14:59:44*OrionPK joined #nimrod
14:59:44Araqespecially in the long run
14:59:59BitPuffinworst thing that could happen is that someone sends a request that says "assertion=blabla&blabla=bleble" and that tries to get verified at persona and fails
15:00:01BitPuffinbut hmm
15:00:07dom96just write your own parser, it's not that hard.
15:00:08BitPuffinthere is a potential issue I guess
15:00:21Araquse parseCookies at least
15:00:28Araqthis is easy to fix then
15:00:56BitPuffinyou mean getCookie?
15:01:08dom96BitPuffin: Aren't you using jester?
15:01:10Araqor getCookie
15:01:31BitPuffindom96: I am
15:01:36Araqin fact, add a proper 'readData' overload to cgi.nim and make a pull request
15:01:44dom96BitPuffin: Then doesn't it parse it for you?
15:01:46Araqit's trivial to add
15:01:59BitPuffindom96: it's not a cookie
15:02:04BitPuffinit's in the body of a request
15:02:38dom96Yeah, jester parses that.
15:02:51BitPuffinsay whut
15:03:07BitPuffinbody is just a string
15:03:16dom96Look at request.params.
15:03:21dom96It's in there.
15:03:40BitPuffinu srs
15:04:03dom96yes.
15:07:47AraqC0C0: the designer of that new java makes a convincing argument that lambdas are more appropriate than structural typing
15:08:13BitPuffinlet data: PJsonNode = %{"assertion": ass, "audience": hostname & ":" & $port}
15:08:19BitPuffinI'm doing it wrong
15:08:39dom96You need a % in front of each value
15:08:55C0C0Araq: I'm afraid I don't understand
15:09:09BitPuffindom96: say what
15:09:55BitPuffinlooks like that fixed it :s
15:09:57BitPuffinI don't know why
15:10:20dom96because % converts your string into a PJsonNode
15:10:21OrionPK% tells it to make a PJsonNode
15:11:00BitPuffinyeah I figured it out
15:14:27BitPuffin let ass = request.params["assertion"]
15:14:31BitPuffindom96: that gives me ""
15:15:08dom96Why don't you echo the params and check what's actually in it?
15:18:32BitPuffindom96: apparently nothing
15:18:46dom96what's the content-type?
15:19:53BitPuffindom96: is that in request?
15:19:55BitPuffinobj
15:20:12dom96yes, in headers
15:21:01BitPuffinapplication/x-www-form-urlencoded; charset=UTF-8
15:21:19dom96ahh, that's a bug then hah
15:21:45dom96sec
15:23:57NimBotdom96/jester master 1a66a53 Dominik Picheta [+0 ±1 -0]: Fixes content-type detection problems.
15:24:01dom96try now
15:24:26Araqdom96: impressive bug fixing speed
15:24:40dom96thank you :P
15:24:51Araqping zahary
15:26:27zaharyhi
15:26:34zaharyI gotta go out in 5 minutes
15:26:50Araqok, that's enough to get you thinking about a serious problem:
15:26:55BitPuffindom96: alright sec
15:27:29BitPuffindom96: what's the command to update though? just babel install jester again?
15:28:00OrionPKyes
15:28:06OrionPKit asks you if u want to overwrite
15:28:10BitPuffinye
15:28:12Araqx.shallowCopy(y) where x is a string and y is a string literal happens to work iff 'x' is a local as that doesn't invoke the wirte barrier
15:28:44BitPuffindom96: looks like it worked
15:29:37dom96good
15:30:21Araqbut in general can't work and there is a case where it works but fails at the second assignment because then there is no header to decref
15:30:37Araqhowever I fail to come up with a concrete scenario for this right now
15:31:38zaharywhat does shadow copy do? just replicates the pointer without increasing the ref count?
15:31:43AraqI'm quite sure though that's the bug that plagues nimbuild
15:31:56Araqshadow copy is the nkFastAsgn node
15:32:11Araqit performs the assignment as if the 'string' were a 'ref'
15:32:31Araqso in other words it checks x's location and decides which write barrier to invoke
15:32:50Araqfor a stack location nothing is done except pointer assignment
15:33:03zaharyI think it's ok to reuse the buffer, but you have to increase the refcount
15:33:26Araqthere is no refcount for string literals
15:33:29zaharyah, yes - you are saying just that
15:33:33Araqthough we could add one
15:34:34zaharygotta go, we'll get back to this latesr
15:34:42Araqalright
15:45:06*DAddYE joined #nimrod
15:49:26*DAddYE quit (Ping timeout: 240 seconds)
16:21:20*Associat0r joined #nimrod
16:21:20*Associat0r quit (Changing host)
16:21:20*Associat0r joined #nimrod
16:37:21*xenagi joined #nimrod
16:46:25*DAddYE joined #nimrod
16:50:38*DAddYE quit (Ping timeout: 240 seconds)
17:26:24*OrionPK is now known as OrionPKN
17:27:06*OrionPKN is now known as OrionPK
17:32:10*OrionPK is now known as OrionPKN
17:32:23*OrionPKN is now known as OrionPK
17:47:48*DAddYE joined #nimrod
17:51:50*DAddYE quit (Ping timeout: 240 seconds)
17:52:28*OrionPK is now known as OrionPKN
17:58:41bastian_Araq: is there any way to make the path in the link pragma relative to the source's file instead of where the compiler is invoked from?
18:01:26bastian_the C compiler is invoked with the relative name, instead of an absolute one
18:14:10*OrionPKN is now known as OrionPK
18:16:22BitPuffinEXetoC: I think I'm gonna fix linagl now :P
18:16:27BitPuffinhold on to your horse
18:18:17Araqbastian_: iirc you can do "$projectdir/foo.o"
18:18:39*noam_ joined #nimrod
18:21:43*noam quit (Ping timeout: 252 seconds)
18:22:46bastian_Araq: ah, so it's just passing this as a literal, i see
18:31:33Araqactually ... looking at the code ... $projectdir needs to $projectpath and even that is not supported but instead the compiler tries to find the file in your Path
18:32:09Araqso .. it should just work
18:38:53BitPuffinError: internal error: invalid kind for last(tyGenericParam) err
18:39:15BitPuffinat least have the courtecy to tell me where it happened :(
18:39:33Araqit's usually some invokation of 'high'
18:39:39Araqor 'len'
18:40:58BitPuffinAraq: yeah it might be that
18:41:25BitPuffinhttps://gist.github.com/BitPuffin/7618340
18:41:29BitPuffinI suspect that one
18:42:52BitPuffinIt would be really cool if I didn't have to work around my workaround
18:43:05Araqseriously?
18:43:15BitPuffinAraq: what?
18:43:24Araqhow often are you gonna attempt C.high when C is a generic param?
18:43:37BitPuffinC is a range
18:43:48BitPuffinbut I can't do that because I can't say that it is a range
18:43:52BitPuffinbecause of a compiler bug
18:44:04Araqwell even if you tell it that doesn't help
18:44:23Araqthat requires yet another notion of partial generic instantation to work
18:44:54Araqno yes. it should work. but it's not surprising that it doesn't
18:45:43BitPuffinI guess I could work around it by doing some vodoo of extracting the row and column and running low and high on that
18:45:44Araqand TMatrix[T, R.low..R.high-1, C.low..C.high-1] seems to be the same as
18:45:47BitPuffinpretty ridiculous but yeah
18:45:53BitPuffinoh yeah
18:45:56AraqTMatrix[T, R, C] anyway
18:45:58BitPuffindoesn't solve that part though
18:46:10BitPuffinAraq: okay well that should be -2 then :P
18:47:10Araqah ok
18:47:18Araqit's not the same because of the -1
18:47:32BitPuffinit deletes a row and a column from the matrix
18:47:43BitPuffinif you read the ducks
18:48:28Araqwhy should I read the docs? they don't trigger the compiler bug
18:48:45Araqalso keep in mind that currently 'r' and 'R' is the same identifier
18:48:56Araqso ... that would be the next problem
18:49:06BitPuffinAraq: well to understand what the desired effect is
18:49:08*DAddYE joined #nimrod
18:49:08BitPuffinright true
18:49:21BitPuffinI wrote this at first as an ideal way where there wasn't any bugs
18:49:26BitPuffinand couldn't test compile it
18:49:29BitPuffin:P
18:50:49BitPuffinunfortunately I can still not fix the signature :(
18:51:22Araqyeah sorry, seems hard to workaround
18:51:42BitPuffinzahary: did you fix the :range annotations to generic params? Because it doesn't appear to be failing at least. Although I don't remember the error
18:51:48BitPuffinright he's not here
18:51:55BitPuffinAraq: gah :(
18:52:10BitPuffinfrustrating
18:52:14*Araq wonders how ML deals with a partially constructed array types
18:52:33BitPuffinThis project has a deadline for december
18:53:26*DAddYE quit (Ping timeout: 240 seconds)
18:54:32AraqBitPuffin: well you can always use a 'seq' instead and do the y*m+x address computation yourself
18:54:35BitPuffinI guess I'm gonna have to hardcode the type of matrices I need currently
18:54:58Araqugly but you can patch over it with overloaded [] operators
18:55:24BitPuffinis overloading of [] supported though?
18:55:33Araqwith latest github version yes
18:55:37BitPuffinnice!
18:55:44Araqoverloading of [] for seqs should work
18:55:51BitPuffinbut arrays?
18:55:58Araqfor arrays too
18:56:00BitPuffincool
18:56:08BitPuffinHmm yeah I guess that's doable
18:56:16BitPuffinreally ugly like you say but it would work around it
18:57:08Araqof course ML doesn't have that problem to begin with: http://www.standardml.org/Basis/array.html
18:57:28BitPuffinAraq: however doesn't seqs have different literals?
18:57:32BitPuffinthat would kind of break it :/
18:58:04Araqreally. why? is @[] so much harder to type than []?
19:01:58BitPuffinAraq: the hard to type thing is not a factor
19:02:02*OrionPK is now known as OrionPKM
19:02:05BitPuffinAraq: it's about changing the API
19:02:10*OrionPKM is now known as OrionPK
19:02:19BitPuffinand I don't want to change the API to something I am gonna change later anyways
19:02:41Araqunderstandable but misguided :-)
19:03:12Araqit's better to let APIs evolve and make people update their code for some time
19:03:53*OrionPK is now known as OrionPKM
19:03:56*OrionPKM is now known as OrionPK
19:04:00BitPuffinAraq: well sure, I draw the line when it's about changing the api to something worse, if I know that something is a big improvement that will of course change
19:04:04BitPuffinor if it is necessary
19:04:17BitPuffinbut this is kind of changing the API in the name of a temporary workaround
19:04:41Araqno it's in the name of a still evolving language
19:04:47BitPuffinsure
19:05:04Araqand you have every right to use nicer features once they become available
19:05:13OrionPKjeez nimrod takes a long time to build on RBPI :D
19:05:22BitPuffinbut I think API wise, even though it is quite annoying to have to do it, working aronud it by hardcoding it for certain types seems preferrable to changing the API
19:05:57*familiar125 joined #nimrod
19:06:15BitPuffinI can just temporarily when false: out the current ideal implementation and add an else: and implement the hardcoded ones
19:06:36Araqok if you prefer it this way, sure go ahead
19:06:39BitPuffinwell actually else is not even needed
19:06:55BitPuffinsince it isn't that bad to keep the hardcoded ones for performance reasons probably
19:07:10Araqin fact
19:07:34Araqthe hardcoded ones are way easier to map to CUDA or something like that
19:07:42BitPuffinyup
19:08:09AraqOrionPK: are you familiar125 ?
19:09:00BitPuffinyeah I think I'll do that
19:09:56BitPuffinAraq: does it matter if the hardcoded ones appear before or after the generic one?
19:10:00BitPuffinin the source file
19:10:08familiar125yes araq
19:10:24Araqno, overloading resolution is not dependent on declaration order
19:10:32BitPuffinAraq: okay! Good :D
19:12:23BitPuffinhe is testing his new epic irc client
19:15:13Araqhmm explaining a pattern matching macro in a tutorial-like article might not have been my best idea ...
19:15:42Araqoh well. People can handle it, right?
19:16:00familiar125I was. now I'm just using it
19:16:19BitPuffinfamiliar125: so it's done?
19:16:30Araq"this is a case statement. And this is how to implement pattern matching without unification."
19:20:01familiar125no
19:20:08familiar125it's not done
19:27:57BitPuffinis there an array like type that is not homogenus?
19:29:41EXetoCsum type elements?
19:30:06Araqa tuple?
19:30:24BitPuffinAraq: a tuple isn't really array like, well I guess I'm asking about seq like really
19:30:42Araqwell tup[0] works fwiw
19:34:12BitPuffinthat's resizable?
19:34:21Araqno
19:35:24EXetoCobject variants
19:36:21BitPuffinEXetoC: well then you might as well say subtypes
19:36:26BitPuffinhmm
19:36:57BitPuffinin the hard coded ones above 2x2 matrices, should I loop or do a huge wall of if statements...
19:37:02BitPuffinconvenience over performance
19:37:47Araquse a loop
19:38:30BitPuffinAraq: I considered unrolling them but that would become huge
19:38:35BitPuffinsince it's two loops
19:38:48Araqunrolling them is stupid
19:39:00Araqlet the optimizer do its job
19:39:06BitPuffinlol okay
19:39:09BitPuffin:D
19:41:24Araqbut if you really feel like it, iterators and templates make unrolling very easy to do
19:42:21BitPuffinnah
19:42:31BitPuffinI'll leave it as it is
19:43:19Araqwrite an article about an 'unroll' iterator and spam hacker news and reddit
19:44:01Araqextra points if you can write it Rich-style so everybody thinks you have invented something new
19:44:11BitPuffinmatrix.nim(156, 10) Error: ambiguous call; both matrix.{}(m: TMatrix[T, range 0..1(int), range 0..1(int)], n: range 10..99(int)): T and matrix.{}(M: TMatrix[T, range 0..2(int), range 0..2(int)], n: range 10..99(int)): TMatrix[T, range 0..1(int), range 0..1(int)] match for: (Array constructor[0..1, Array constructor[0..1, int]], int literal(10))
19:44:34BitPuffinAraq: Rich Hickey?
19:44:45Araqyes
19:44:48BitPuffinlol
19:44:59BitPuffinhe pretends he invented something new? lol
19:45:08Araqno that would be unfair
19:45:18Araqbut he surely knows how to market things
19:45:26BitPuffinyou mean understating it
19:46:05Araqwhat?
19:46:11Araqunderstate it?
19:46:30BitPuffinyeah that he's pretending he invented something
19:47:03AraqI'm not saying that
19:47:40BitPuffinseriously is this a bug or what
19:47:47BitPuffinhow can that be an ambiguous call
19:47:52BitPuffinuouououos
19:48:16AraqI fixed that bug once
19:48:23Araqno idea why it pops up again
19:48:29BitPuffinhttps://gist.github.com/BitPuffin/7619079#file-gistfile1-nim-L48
19:49:26BitPuffinoh so you mean unfair then. You mean that people are acting like he invented it because he markets it cleverly
19:50:02AraqI mean it would be unfair of me to say that
19:50:23*DAddYE joined #nimrod
19:50:30BitPuffinyou mean it is too much to say it?
19:50:43Araqyes
19:50:49BitPuffingotcha
19:50:52BitPuffinweird bug
19:50:59BitPuffinespecially if you have fixed it before
19:53:22BitPuffinAraq: ah it's an inference thing
19:53:38BitPuffinAraq: If I am specific about its type it works
19:53:46BitPuffinalthough that should not really be necessary I think but yeah
19:54:33BitPuffinat least it's not a fatal bug
19:54:43*DAddYE quit (Ping timeout: 245 seconds)
19:56:36familiar125araq so hard would it be to implement a linq like feature in nimrod
19:56:50BitPuffinit would be so hard?
19:56:51familiar125how'
19:56:57Araqnot hard
19:57:05familiar125sorry. on my phone
19:57:09Araqmacros easily can do it
19:57:18familiar125cool
19:57:23Araqbut in my article I'm showing pattern matching
19:57:38Araqso ... currying and Linq have to wait
19:58:00BitPuffinI'll add currying next year
20:00:03EXetoCnom
20:04:20BitPuffinmatrix.nim(129, 0) Error: redefinition of '{}'
20:04:23BitPuffinI BEG TO DIFFER
20:04:37BitPuffinAraq: same bug I reckon?
20:05:27Araqquite possible though I don't remember adding a check for that
20:05:47BitPuffinif not that would be amazing
20:06:02BitPuffinbecause then it would work xD
20:10:08AraqBitPuffin: wanna fix that bug?
20:10:30BitPuffinAraq: Yeah
20:10:34BitPuffinI'll have to
20:10:39BitPuffinor else this project won't get done :P
20:11:50BitPuffinAraq: but first a bug report is needed
20:11:56BitPuffinto mark the progress etc
20:13:22Araqwell tell me when you're ready
20:13:38BitPuffinsure
20:13:43BitPuffinjust gonna eat dinner now!
20:13:46BitPuffinI've been bbqcodin
20:21:44*ack006 joined #nimrod
20:22:39Araqhi ack006 welcome back
20:23:58BitPuffinwe should program NimBot to keey track of who's been here before and who hasn't and greet the newcomers with a welcoming message
20:24:22BitPuffinAraq simply doesn't scale the way a bot can xD, now back to eating
20:26:07Araqhey I scale quite well.
20:26:27Araqhi Kristina welcome
20:27:06BitPuffinI din't say you scale bad
20:27:10KristinaHi.
20:27:12BitPuffinbut not as good as a bot
20:28:55*ics joined #nimrod
20:30:18C0C0how do I create a sequence literal @[A(),A()] whith type seq[B] (where B is parent of A)?
20:30:40Araq@[B(A()), A()]
20:30:47C0C0ah ok :)
20:51:50*DAddYE joined #nimrod
20:52:07BitPuffinAraq: https://github.com/Araq/Nimrod/issues/686 good enough?
20:53:21Araqsure. now fix it
20:53:28BitPuffinyes
20:54:35BitPuffinAraq: would an acceptable solution be to find the place where it fails and just check if the type is a generic and then look if the params are different?
20:55:05Araq1) use a debug build of the compiler
20:55:15Araq2) invoke the compiler with --verbosity:3
20:55:21Araq3) pastebin the stack trace please
20:55:37BitPuffinsure thing
20:55:46BitPuffinjust a sec ;D
20:56:14*DAddYE quit (Ping timeout: 240 seconds)
21:03:32*Jackneill quit (Remote host closed the connection)
21:12:43BitPuffinAraq: https://gist.github.com/BitPuffin/7620016
21:14:05*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:18:38BitPuffinholy koch that's a big proc
21:18:54Araqit's also irrelevant
21:19:12BitPuffin(semProcAux)
21:19:20BitPuffinis it? okay, I was just going up the trace one by one
21:19:28Araqthe problem is that procfind.SearchForProc returns not nil even though it should
21:19:38Araqas the header clearly differs
21:20:06Araqand this seems to be caused by equalGenericParams returning true
21:20:33Araqwhich is caused by sameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}) returning true
21:20:57BitPuffinyou are quick sir
21:23:25Araqin procfind.equalGenericParams
21:23:44Araqinsert in line 30
21:24:34Araq if procA.info ?? "poop.nim":
21:24:50Araq debug(a.typ)
21:24:56Araq debug(b.typ)
21:25:13Araqand see what it says
21:25:21BitPuffinshould it really be ?? and not ==?
21:26:08Araqyes. it's really ??
21:27:50BitPuffinalright, what does that do? extract filename of a proc?
21:28:22Araqyes
21:28:25*filwit joined #nimrod
21:28:53filwithey folks
21:28:58Araqhi filwit
21:29:20filwitis there any proc in the macros lib that gets the name of a node without the '*' mark?
21:29:28Araqyes
21:29:28filwitor do i need to strip that out manually?
21:29:36BitPuffinAraq: I'm not actually sure it says anything
21:29:54filwitAraq: great!
21:30:46filwitAraq: mind given me a hint as to what it's called ? :P
21:31:16filwitstrVal?
21:31:22Araqbasename
21:31:33filwithmmm.. thought i tried that one...
21:31:38filwitlet me try again
21:32:00AraqsomeProc.name.basename
21:32:07Araqshould do it
21:32:07BitPuffinhttps://gist.github.com/BitPuffin/7620204
21:32:51filwitAraq: awesome, it worked. Thanks
21:33:02BitPuffinoops some weird pasting action going on, ignore that
21:33:09BitPuffinread from line 16
21:33:29AraqBitPuffin: sorry
21:33:37Araqline 30 but not in that 'if'
21:33:44Araqbut still in the 'for'
21:33:53BitPuffinah
21:34:19BitPuffinso on line 29 then
21:36:38BitPuffinAraq: tyGenericParam T
21:36:41BitPuffintyGenericParam T
21:38:24Araqwell that makes sense
21:38:33Araqindeed those are equal
21:39:57BitPuffinyup
21:40:03Araqmy bad
21:40:12Araqgoto line 51
21:40:16Araqshould be "return"
21:40:48Araqinsert before the retturn (same indentation)
21:40:54BitPuffinmaster line 51 or mine :P
21:41:05Araqmaster
21:41:11BitPuffincool
21:41:15Araqand you may remove the change already
21:41:28BitPuffinofc!
21:41:38Araq if fn.info ?? "poop.nim":
21:41:47BitPuffinyup
21:42:09Araq debug result.ast.sons[paramsPos]
21:42:17Araq debug fn.ast.sons[paramsPos]
21:43:02Araqand insert into line 54
21:43:15Araq(now 57 I guess since you added 3 lines of code)
21:43:19bastian_Araq: ah, so it's just passing this as a literal, i see
21:43:39Araqbastian_: already told you I was wrong
21:44:12AraqBitPuffin: if fn.info ?? "poop.nim": echo "WTF?"
21:46:14bastian_Araq: sorry, accidentally reposted from history. wanted to ask about memset: the system module seem to have (zero|copy|move)Mem, but not set
21:46:51Araqwell you can easily wrap it yourself and I've yet to see a memset that is not a zeroMem
21:47:15Araqmemset(s, sizeof(s), 0) is a common bug
21:47:25Araqso Nimrod tries to improve on that
21:47:37bastian_i'm aware it's a one-liner to import, but maybe for consistency
21:47:52Araq(or was it memset(s, 0, sizeof(s)) ? ;-) )
21:47:56bastian_well, i'm trying to set all buckets of a bitset to true
21:48:34Araqfair enough but then how do we make it not as error prone?
21:50:02bastian_didn't even think about this. really like your API design approach of preventing potential misuse
21:50:05BitPuffinAraq: alright compiling
21:50:24bastian_not sure, maybe then it shouldn't be in system
21:52:41filwitAraq: i may have asked this before, but is there an easy way to remove a single Pragma from the Pragmas of a PNimNode through Macros?
21:52:43BitPuffinAraq: https://gist.github.com/BitPuffin/7620412
21:53:12*DAddYE joined #nimrod
21:54:14AraqBitPuffin: and here we have the bug :-)
21:54:48Araqthe range[0..2] thing is transformed to an AnonType
21:55:10Araqwhich then compares equal ...
21:55:33BitPuffinthat's strange
21:55:41BitPuffinwell not that they compare equal in that case
21:55:45BitPuffinbut that it is AnonType
21:57:26*DAddYE quit (Ping timeout: 240 seconds)
21:59:17Araqmeh this is zahary's code which I don't understand
21:59:26BitPuffinlol :(
21:59:40BitPuffinwhat does one chant to summon zahary
22:00:00Araqno idea why he needs to do 'semConv(c, n, symFromType(destType, n.info))'
22:00:35BitPuffinis c and n (cnn lololol) context and node?
22:00:36Araqand btw the reason is not that we use 1 letter variables :P
22:01:17AraqI don't know *why* he needs to do this, *what* he does is obvious enough :P
22:01:52BitPuffinwell I know but I'm only looking at one line that you pasted, so it's impossible to look up what the 1 letter variable name is in this case, with the full source it is a bit more trivial lol
22:01:58BitPuffinGuess I can ack my way to your line
22:02:14Araqand sure c is the context, n is node
22:02:25BitPuffinyay, I guessed it ;D
22:02:45BitPuffinsee people, they aren't THAT horrible :P
22:03:56Araqwell in any case using ExprStructuralEquivalent to compare parameter lists is a hack
22:03:58BitPuffinhmm, semConv, is that just to convert a symbol into a node?
22:04:16AraqsemConv # semantic checking of a type conversion node
22:04:54Araq'sem' is always "semantic checking"
22:05:08BitPuffinI see
22:05:43BitPuffinand that checks whether the semantics are legal?
22:05:55Araqyes
22:06:01BitPuffingotcha
22:06:10BitPuffinbut what's a type conversion node?
22:06:11Araqit also transforms things if necessary
22:06:16BitPuffinand possible
22:06:21AraqT(a) where T ia a type
22:06:31BitPuffinah
22:06:32BitPuffinright
22:06:36BitPuffinI've used those :P
22:07:48BitPuffinhmm, if one were to write a book on nimrod they should try to somehow sneak a node way of thinking about your code as you write it
22:08:01BitPuffinthat way when you start looking at the compiler things make a lot of sense
22:08:17BitPuffinwell they do make sense but it takes a while to settle :P
22:08:43Araqactually many things don't make any sense
22:08:51Araqthose are the bugfixes
22:09:06BitPuffinthe things that don't make sense?
22:09:39Araqhttp://www.joelonsoftware.com/articles/fog0000000069.html
22:10:01Araq"Back to that two page function. Yes, I know, it's just a simple function to display a window, but it has grown little hairs and stuff on it and nobody knows why. Well, I'll tell you why: those are bug fixes."
22:11:09BitPuffin:)
22:11:41BitPuffinWell in general when you write code that does not make sense it is generally good to add a comment
22:12:16BitPuffinI think for regular code comments are usually not necessary
22:12:20BitPuffinbut for bug fixes etc
22:12:37BitPuffinit's nice with a comment like # to fix #8493
22:12:46Araqyeah and I try to do that now.
22:12:49Araq;-)
22:13:05BitPuffingood!
22:13:07Araqbut even better than fix #89 is a small example program
22:13:13BitPuffinI've actually read that article a long while ago
22:13:23Araqotherwise I need to lookup bug #89 ...
22:13:28BitPuffinhehe true
22:13:55BitPuffinbut I should read it again. Not like I have anything to do really with all these bugs :P
22:14:37BitPuffinambigous sentence
22:15:06BitPuffinI meant in the sense of things I can do while they exist, not in the way with being responsible for them
22:15:15BitPuffinalthough I guess I'm not that either but you get the point
22:16:43Araqfilwit: I don't know, ask fowl
22:17:11filwitAraq: k. then no, cause i think i did and he didn't know
22:22:41AraqBitPuffin: try the following fix please
22:22:54Araqsemtypes.nim:232
22:23:32Araqadd a "modifyNode: bool" parameter to semTypeIdent
22:24:16Araqin line 946 pass 'false' to it, and in line 963 pass true
22:24:28BitPuffinsure
22:24:44Araqand modify line 263 to:
22:24:58Araq if result.typ.kind != tyGenericParam and modifyNode:
22:25:23Araqleave the debug stuff that you added
22:25:32Araqthat's it.
22:25:44BitPuffin... right after I ran a git reset --hard HEAD
22:26:22BitPuffinluckly I can just grab from the paste
22:34:19BitPuffinAraq: are the lines adjusted to how they shift?
22:34:37*ics joined #nimrod
22:35:13BitPuffinwell I'll probably see it
22:35:16Araqthere is no shifting
22:35:23BitPuffinyeah true lol
22:35:34*BitPuffin is not the brightest one in the room
22:36:07BitPuffinAraq: do you want a default parameter value for modifyNode?
22:36:37Araqno
22:36:51Araqotherwise I would have told you so :P
22:37:02BitPuffinalright, just wanted to make sure :P
22:37:20Araqdefault values ensure that you don't consider every invokation site
22:37:33Araqwhich is the opposite of bug fixing
22:38:09BitPuffinyeah I guess that's reasonable to say
22:38:40BitPuffindid you mean line 945?
22:39:27BitPuffinand 962?
22:39:45Araquse your brain please
22:40:03Araqit's obvious what I meant even if I got the numbers wrong
22:40:07BitPuffinI'm gonna assume yes
22:40:10BitPuffin:P
22:46:40BitPuffinhttps://gist.github.com/BitPuffin/7620980
22:46:42BitPuffinAraq: ^
22:48:09EXetoCBitPuffin: have you memorized the compiler yet?
22:48:54BitPuffinEXetoC: hell noe
22:49:19BitPuffinbut at least I know what sem always stands for :P
22:49:52EXetoCcool
22:51:05Araqyou guys should read Luajit's source code. Or FPC's.
22:51:27filwitsee what i'm saying tho..
22:52:00BitPuffinwhy? And what's FPC?
22:52:11Araqfilwit: and yet you have no alternative. Or do you honestly suggest I write 5000 times 'semanticCheckingOfX' ?
22:52:36filwitsemanticCheckX sounds fine to me really
22:52:41BitPuffinyeah me too
22:52:46BitPuffinwe are programmers
22:52:48BitPuffinwe type rather fast
22:53:07Araqyeah. we all like 200 column wide lines
22:53:34BitPuffinat least if you don't have to decrypt them
22:53:47Araqand we all like to have no overview over what the algorithm does
22:53:49filwitabbreviation isn't a problem.. it's over-abbreviation on top of a challenging domain
22:54:12filwitand i'm not criticizing your code really
22:54:22filwitonly saying that for groups, it's best to be clear
22:54:27*DAddYE joined #nimrod
22:54:28BitPuffinI have such a small font anyway so i don't care much about the width of lines until they reach real extremes
22:54:54BitPuffinofc that doesn't mean I don't try to keep it within 80 or so
22:55:12BitPuffinbecause thanks to the font I can have a lot of files on screen at the same time
22:55:30BitPuffinand screen resolutions are increasing and monitors get bigger etc
22:55:52Araqit's really easy: you ask "what? where is this defined? what's the type here? what does that abbrev mean?"
22:56:11AraqI ask "what's the used algorithm and why does it fail for this case?"
22:56:44BitPuffinit's hard to know why the algorithm fails though if you don't know what something does
22:57:01BitPuffinsure sometimes even without abbrew you need to have a look at the code behind that proc
22:57:29BitPuffinand like filwit says, abbrev is not a problem, over abbrev is
22:58:38*DAddYE quit (Ping timeout: 240 seconds)
22:58:39filwitAraq: how you approach problems isn't the issue. It's how clear the algorithm is to read and understand coming in, since, one large code bases you're often jumping around a lot. It's like the rule "you should comment your code".. sometimes that just slows things down.. but it helps others understand what you where doing
22:59:29Araqfilwit: the problem is that as soon as you have my experience you stop disagreeing with me.
22:59:52Araqsorry to be blunt but seriously tell Mike Pall his Luajit is hard because he uses L instead of "context"
23:00:03Araqit's absurd
23:00:41Araqsystem.collections.table.put!(t, k, math.saturated.add(system.collections.table.get(t, k), 1))
23:00:44Araqvs
23:00:51Araq t[k] = t[k] +! 1
23:01:34BitPuffinwell that's not a fair comparison
23:01:40BitPuffinoperators are usually clear what they mean
23:01:49filwitAraq: i still disagree with somethings Nimrod does, i just don't complain about issues I know wont change. Not to say you have not changed my mind on some things as well.
23:01:52BitPuffinwell maybe not +! in that case
23:02:30filwitAraq: you comparison is completely unrealistic
23:02:33BitPuffinL instead of context is in fact quite terrible
23:03:00filwitAraq: if you want to really demonstrate how your way is better, don't try and cheat by making the alternative way worse than real life
23:03:08BitPuffinswitch to dvorak, buy a mechanical keyboard, and learn to type faster
23:03:35EXetoCI don't know if L stands for anything particular, but it seems like a common convention in the lua world, so that's alright then. I wouldn't mind typing "context" though
23:03:59Araqit's not about typing
23:04:10EXetoCmechanical keyboards? but those cost more than $20 :>
23:04:35AraqI don't want to *read* semanticCheck when 'sem' means the same and is used consistently in a 67K line code base
23:04:36BitPuffinEXetoC: well maybe if it's commonly used in lua it is fine, but it's still not really good
23:05:03BitPuffinwhy is reading that even a problem
23:05:11filwitAraq: i actually *kinda* agree with you about the 'sem' thing...
23:05:12BitPuffinit's not like you dissect it character by character
23:05:18BitPuffinyou just look at the word and it's stored
23:05:18Araqskimming the code is faster when there is less code
23:05:36Araqno, word length is important for skimming
23:05:36filwitAraq: it really just needs very clear-cut documentation, and 'sem' isn't really a problem
23:06:04filwitAraq: it's things like 'n' for 'node' that i think fall under 'over abbreviated'
23:06:12BitPuffinin fact reasonably elaborated names distinguish themselves so they actually help skimming
23:06:23Araqand filwit my example is not even overblown
23:06:37Araqpeople always come here and want ! to denote side effects
23:06:47Araqand path.to.module.access everywhere
23:07:26Araqit's just that they are not serious because if they were they would love Java *cough*
23:07:43Araqwell they are not honest to themselves
23:07:50BitPuffinI don't really find the problem with java to be that you type too much
23:07:51filwitpeople don't like Java for other reasons
23:08:14Araqoh really? how come verbosity is always listed as a reason?
23:08:16filwitand Java doesn't have operators, or things that *do help*
23:08:27C0C0Araq: the reason is that you have to read too much
23:08:42filwitand actually Araq, i agree, Java is too verbose
23:08:44BitPuffinAraq: yeah but people who complain about its verbosity are quite frankly stupid
23:08:57filwiti think C# is too verbose too
23:08:58BitPuffinother than int in = new int int int int(); int ()
23:09:08filwiti think D is pretty clean though (in many ways)
23:09:24BitPuffinjava could do the same as D and C++ and add auto
23:09:35BitPuffinand it would eliminate the over verbosity
23:12:50Araqfilwit: name 1 example where c# is verbose where D is not
23:13:16filwitoverride foo()
23:13:26filwitimmutable x = 0;
23:13:44Araqvar x = 0; // c# has no immutable
23:14:02filwitstatic x = 0; // this then...
23:14:08BitPuffinhttp://www.youtube.com/watch?feature=player_detailpage&v=21qzNbsGlbQ#t=2858
23:14:14BitPuffinrelevant^
23:14:33filwitand for the record, i think Nimrod has some very clean syntax as well
23:14:45EXetoCI only use 1-2 letter identifiers when it's really obvious what's going on. I get easily confused otherwise
23:14:55EXetoCI think my ability to keep track of stuff is below average though
23:15:13filwitit's alien, but works well once you get used to it, and i kinda like the non-case-sensitivity
23:15:26filwit(alien to me i mean, not to everyone)
23:16:11*noam_ is now known as noam
23:16:29filwitEXetoC: i always make my tool's function names long, and local vars abbreviated
23:16:51filwitEXetoC: and by "long" i mostly mean "clear"..
23:18:04EXetoCright
23:18:11filwitsee really, i think Nimrod's code, even it's internals are pretty clean. I have my gripes about 'newSeq', but even 'seq' is starting to grow on me.
23:18:26BitPuffinEXetoC: yeah like proc `+`*(theOperandOnTheLeftSide, theOperandOnTheRightSide: TNumber): TNumber = ... is obviously overdoing it
23:18:35BitPuffinthere a and b would be stupid to not use :P
23:19:26EXetoCBitPuffin: woah I was just typing proc "`+`(x, y....".
23:20:50filwitBitPuffin: yup
23:21:14EXetoCfilwit: what kind of gripes?
23:22:13filwitjust some gripes. i've made these arguments before, but ultimately it's not very important at the moment
23:22:59EXetoCook
23:24:29filwiti like interfaces to be standard, so when i can't do something like seq[int].new(...) where i can do that on other types, it feels off to me.
23:25:06Araqyou can't do 44.new() either and yet it never bothered you
23:25:13filwitnote that i said "fee's off to me", so it's not a big issue, i just think it's easier to get people involved when things are consistent
23:25:31Araqit's all completely arbitrary imho
23:25:33filwitAraq: 44 is not a reference type
23:25:38Araqneither is 'seq'
23:25:42filwit??
23:25:48filwitah, right..
23:25:53EXetoCI'm not sure I follow. I know there's the 'new' prefix convention for when receiving a reference and 'init' for value types
23:26:11Araqyeah but newSeq predates that convention ...
23:26:18filwitAraq: was it once a ref type?
23:26:22Araqno
23:26:54filwiti could have sworn i rand into an issue because newSeq() wasn't called before add before...
23:27:21Araqyeah seqs are a bit hybrid
23:27:33filwityeah i see
23:27:41Araqjust like strings they have 'nil'
23:28:07Araqbut are value types for the most part until you start playing with shallowCopy or .shallow for performance
23:28:33filwiteither way, i maintain that's it's better for advertising in general to minimize common interfaces, and 'newSeq' kinda breaks that.. but mostly i think that can't be fixed until overload by return type where in place anyways.
23:29:05BitPuffinAraq: by the way did you see the paste?
23:29:30AraqBitPuffin: yeah, I'm still thinking
23:29:53filwitthat's why i don't think this kind of thing is important too. It's not important right now (we need more applications than language features ATM), and it can always be addressed later.
23:30:40BitPuffinAraq: alrighty, sorry, just wanted to check so it didn't slip by
23:31:02filwitNimrod is very capable right now, i've ran into some bugs, but it's a shit ton better than where D was a few years ago, and look how much D has grown in the last little bit
23:31:42EXetoCfilwit: so you want the signature to change? got an example?
23:31:55EXetoChypothetical or not
23:31:58filwitEXetoC: i'm not sure what you're asking?
23:32:07filwitsignature for seq?
23:32:30filwitif so, then: var s = seq[int].new(0, 1, 2, 3)
23:32:56filwitbut actually, that might not be good...
23:33:05EXetoCtypedesc?
23:33:10EXetoCok..
23:33:43filwithypothetically, once Nimrod (sometime after 1.0) can do overload-by-return-type, then the syntax could be this:
23:33:54filwitvar s: seq[int] = new(1, 2, 3)
23:34:07filwitwhich i think is even more consistent with the rest of the language
23:34:33Araqseq[int](1, 2, 3) would be consistent with the new object constructors
23:34:45Araqwhich came later, after newSeq ...
23:34:55Araqhistory surely can explain things
23:35:19BitPuffinahh, var s: TType = new(...) is nice syntax I think
23:35:27filwiti've tried the new object constructor before, but it has limitations right?
23:35:42Araqonly that it can't infer generic types
23:35:55Araqthere have been bugs but they have all been fixed afaict
23:36:33filwitno, i mean that you must explicitly provide the data to the constructor..
23:36:53filwitin the case of seq, that's fine, and i think the syntax looks good
23:37:01filwitdoes that work right now by any chance?
23:37:14Araqdepends on whether the type is marked as "needs explicit initialization"
23:37:25filwithow is that marking set?
23:37:42Araqneeds to be documented, sorry
23:37:51Araqthings evolve too quickly
23:37:56filwitokay, np
23:38:00Araqit's hard to keep the manual up to date
23:38:10filwitlimited manpower
23:38:14Araqyep
23:38:14filwitno worries
23:38:27Araqand no, seq[int](1, 2, 3) doesn't work, however @[1, 2, 3] does
23:38:28BitPuffinlimited energy and motivation when the funs is in the code
23:38:42Araqand is consistent with array constructors [1, 2, 3]
23:38:52filwitAraq: yeah i know about @[] (and i use it over newSeq)
23:39:00Araqso ... you're always unfair :P
23:39:14filwitno, i don't like the '@'
23:39:19filwiti wish it was not there
23:39:24filwitpersonally...
23:39:30Araqultimate consistency leads to Lisp's syntax
23:39:46Araqwhich I can't stand personally
23:39:51filwitlol, true, but that's why these things are a religion
23:40:10Araqand even Lisp needs to cheat with , '
23:40:24Araqbecause it's just unfeasible
23:41:26Araqfilwit: early versions used [1, 2, 3] for seqs
23:41:38Araqturned out to be too ambiguous
23:42:41filwityeah, although i almost wish it was still like that.. only because i'm (completely guessing) anonymous seq's will be passed around more often in code
23:43:02filwitand then use the @[] thing for arrays...
23:43:06BitPuffinwhaat lisp has awesome syntax :D
23:43:17filwitbut honestly, that's completely irrelevant, lol
23:43:29filwiteither way is pretty much fine, especially for now
23:43:33Araqactually if you have [...] in your code you have a fixed number of them, so it can be made into an array which is more efficient
23:43:55Araqand "foo" % [a, b, c] is common
23:44:06filwitwhat does that do?
23:44:17BitPuffinformat the string?
23:44:26filwitahh, right, right
23:44:26EXetoChow would that seq construction syntax work? with the help of compiler magic? or will we eventually get actual constructor functions that are tied to types?
23:45:11AraqEXetoC: with compiler magic I guess. but we got constructor functions tied to types with the Typ(field: bar) notation
23:45:40EXetoCI meant actual procs, but ok
23:47:29filwitEXetoC: in my code, i run everything through my own OOP-style macro, and then i use a {.init.} pragma to denote a initilizer (it makes a proc attached to both the typedesc and instance)
23:48:41filwitthat's the real beauty of Nimrod's macros i think. I have all sort of plans for how Hymn will eventually be able to render code and you'll have Light-Table type abilities because I just compile the OOP parts really dynamically and wire them up to editor events..
23:49:19EXetoCdoes this macro need to be applied to the actual type?
23:49:34filwitit builds a type
23:49:41filwitone sec
23:51:40filwithttps://gist.github.com/PhilipWitte/7621555
23:52:59Araqfilwit: it may surprise you but I really like it :-)
23:53:03filwitalso, my Kate color highlighting is nice and highlights an "someProc a, b" situation look nice, so 'part Person' looks like it's built-in, which is cool
23:53:13filwitAraq: awesome :)
23:53:19Araqhowever
23:53:22Araqone nitpick:
23:53:54AraqI went through some pains so that @ can be used for 'this.'
23:54:00Araqso:
23:54:04Araq @name = name
23:54:09Araqinstead of:
23:54:15Araq this.name = name
23:54:30filwitwill that work automatically?
23:54:32EXetoCneato
23:54:46filwit(right now there's a bug, so i can't try it out)
23:55:03Araqwell you need template `@`(field): expr = this.field
23:55:12Araqbut that's all
23:55:23filwitokay i see. That's Ruby right?
23:55:33Araqright
23:55:51filwithmm... well i will consider it, if just to keep consistency
23:55:53*DAddYE joined #nimrod
23:56:04filwitone thing i don't like is it's not the best to type on American keyboards
23:56:18filwitbut it's not the worst either
23:56:33Araqlol it sucks completely on a german keyboard
23:56:43filwitthen why use that?
23:57:06Araqwell I don't
23:57:21Araqbut I thought it would fit right into your design
23:57:23filwit'me' might be better than 'this'
23:57:36AraqI considered 'my'
23:57:40Araqmy.name = name
23:57:51filwitnot bad either..
23:58:02EXetoCyeah
23:58:46filwitmy idea was that i was going to define a template for each field, but in a sub-block or something so that only the proc's definitions could see it
23:58:57filwitthen you wouldn't have to use 'this' or anything (it would be optional)
23:59:14Araqalso to repeat myself: I'm not that concerned about typing things. I don't want to read things. ;-)
23:59:30filwiti see