<<10-06-2012>>

01:58:21*shevy quit (Ping timeout: 252 seconds)
02:11:27*shevy joined #nimrod
03:12:20*Psyclonic quit (Quit: Leaving)
03:30:44*avenidadebelgica joined #nimrod
07:00:28*llm joined #nimrod
08:04:18*Araq_ quit (Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725])
08:08:44Araqllm: so my point was basically: "eval" is nice, but you can hack around with "include" + recompilations
08:09:02Araqand gain all sorts of static checks
10:19:49*zahary joined #nimrod
10:43:01llmAraq, but isn't it that i was talking about days ago?
10:45:16llmAraq, an runtime-compilation based eval
10:50:32Araqllm: perhaps, but 'include' exists today and provides a workaround
10:51:02Araqping zahary
10:52:52llmwhat does mean include here excatly - using code beeing on harddisk - or?
10:53:27AraqI'll only skimmed your changes and dislike your "optimizations with globals", I prefer to keep it readable and make the compiler perform the hoisting instead; transformations dealing with destructors should hardly become a speed issue anyway.
10:54:20Araqand every global requires a complex data flow analysis for the incremental compilation feature
10:54:56Araqllm: yes, very much like C's #include
10:55:02Araqbrb
10:56:09llmbut string based "inclusion" will come later?
11:11:20zaharyhi Araq
11:13:34Araqllm: what do you mean "string based inclusion"? you can do that with a macro today
11:13:37Araqhi zahary
11:14:15Araqllm: but the string has to be a compile-time value ;-)
11:14:49llmAraq, why can't it be a runtime-value, if the compiler works as an service
11:15:20llmAraq, maybe i just don't get what you want to archiv
11:17:17Araqwe talked about it already, an 'eval' feature requires scope injection
11:17:45Araqif you have a 'compile(string)' in the stdlib that's only 50% of the solution
11:18:32Araqeval supports: 'var x, y: int; compile("x + y")'
11:20:04Araqin fact, if you implement a plugin feature, you provide an API for a plugin to use
11:20:34Araqand this API needs to be provided in some way; scope injection is one solution
11:26:59Araqso zahary, do we want a 'hoist' pragma
11:27:19Araqor do we want to wait until the term rewriting macros are ready?
11:28:22zaharywith the global pragma and gensymed consts produced from templates I don't see much need for specialized hoist pragma
11:29:45zaharywe both understand hoist as "move the computation out of the function (at program startup)" and not "move it out of the loop", right?
11:30:40Araqright
11:30:54Araqif the arguments are constant
11:31:27AraqI'd argue the optimization is common enough to warrant a special pragma
11:31:45Araqespecially since the compiler already does the "is arg const?" analysis already
11:34:22zaharymaybe if we had the active pragmas, hoist could be a library helper that just rewrites to the lower level idiom. I like the DIY approach, because it's using the more orthogonal basic building blocks that can be used in other situations too and thus they are something the users should know how to use
11:35:56zaharyproc re(p: expr{string} or string) is not much longer than proc re(p: string {.hoist.})
11:36:27Araqproc re(p: expr{string} or string) is bizarre ...
11:36:31zaharyI and would argue it reads better too
11:36:55Araqit's confusing even for me :P
11:36:57zaharystatic{string} or string ?
11:37:34Araqbetter
11:37:42Araqbut doesn't make sense
11:38:04Araqif it's either or static{string} or a string ...
11:38:14Araq*either a static string or a string ...
11:38:24zaharyyes, that's what it means
11:38:32Araqand how would I look it up what it means?
11:38:44Araq'hoist' is easy to lookup
11:39:12Araqin fact
11:39:17Araqyou'd need:
11:39:40Araqproc re(p: static{string}): TRegex = ... optimized version ...
11:39:51zaharywell, my point is that people should be comfortable with static params - this is something that's important part of the language
11:39:53Araqproc re(p: string): TRegex = ... ordinary version ...
11:40:07Araqright?
11:40:39zaharynot necessarily, because you can still use a when clause inside the proc if the difference between them is very minor
11:40:47Araqok
11:40:54zaharyif they are very different, then 2 overloads make more sense
11:41:05Araqbut if you use a macro you can inspect the argument
11:41:14Araqand don't mention this fact in the header
11:42:24zaharyit's true, you are giving up part of overload resolution then as the macro won't play nice with other overloads
11:42:27Araqstatic{string} is a subset of string
11:42:44zaharymore specific, yes
11:42:54Araqso it's strange to write it as
11:43:01Araqstatic{string} or string
11:47:13zaharywell, If you find it weird, they you find it weird and I probably can't convince you, but I personally like it much better than a specialized pragma with just a single purpose - the constraints with this approach can be arbitrary and it's much more general. it's also possible to say: type hoisted[T] = static{T} or T
11:47:43zahary*, then you find it weird *
11:47:52Araqalright
11:51:26Araq'type hoisted[T] = static{T} or T' is not bad
11:53:36AraqI stil prefer a hoist pragma though as it's easy to implement and can easily merge different occurances of re"[abc]"
11:54:27Araqbut yes you can do the same in a macro
11:56:51Araqon the other hand, if you have re(pattern, flags) your solution starts to win
11:57:10Araq;-)
11:58:15zaharywhy so? I the hoist pragma still would have been applied to the param?
11:58:40Araqno in my mind it belongs to the proc
11:58:51Araqnot to a single param
11:59:35zaharyI see. then yes, per param gives some additional value
11:59:53Araqhm
12:00:21Araqbut you can't hoist re("static", variable)
12:00:50zaharywith my approach?
12:01:02Araqno in principle
12:01:40Araqso it's a property of the proc, not of the param
12:02:24zaharydepends on the "re" library writer. If he figures out that there is some regular expression processing that's not affected by the variable, then he can still apply some optimizations
12:03:14Araqthat's true
12:03:27Araqbut it's a very specialized hoist operation then
12:03:37Araqin fact, I thought you meant:
12:04:05Araqmacro hoist() = ... # general optimization
12:04:13Araqproc p {.hoist.} = ...
12:04:29Araqand in fact, macros as pragmas are planned
12:04:48zaharyI suggested them after all :)
12:05:03Araqyes, but I always had them in mind :P
12:06:03zaharybut I had some doubts whether we need them after all, because they are easily mappable to
12:06:03zaharypragma:
12:06:03zahary affected defs
12:06:03zahary ….
12:06:18Araqso it's only a small difference wether the macro hoist exists in system.nim or wether it's in the compiler
12:06:58Araqyes they are easily mappable, but needed for consistency
12:07:05zaharywell, if it's in the compiler I strongly suggest that it just remaps the param to static{T} or T
12:07:16zaharyno need for multiple paths in the compiler doing the same thing
12:07:46Araqtrue, but the code generator already has a "constant data merge" operation we could make use of
12:08:34zaharythat's not the most important part of the implementation. it's caching the "instantiations" of the proc for each unique compile-time value
13:17:38*llm quit (Quit: ChatZilla 0.9.88.2 [Firefox 13.0/20120601045813])
13:41:59*apriori_ joined #nimrod
14:47:04*filwit joined #nimrod
14:47:54filwithi guys
14:48:06Araqhi filwit
14:48:33Araqzahary: I forgot to ask: can we use your destructor lifting for '=' too? cause that was my plan
14:48:58filwitso last night I found time to make a couple Nimrod logos
14:49:28filwitthere's still sorta rough, but I'm happy with the overall design direction. want to see?
14:49:36Araqsure
14:49:40filwitlet me load them to the web
14:52:21zaharyyes, I was thinking how to handle = too. one difference is that you can have multiple overloaded procs for = with different "copy-from" types.
14:53:32filwithttp://reign-studios.com/nimrod/logo-mock1.png
14:53:50zaharyso, there is a small difference in the first part of the algorithm "is there a destructor/operator = defined by the user?", but it's not much of a problem
14:54:49Araqhm but if you have multiple "copy-from" types that shouldn't be lifted
14:55:02Araqthere is a canonical '='(x: var T, y: T)
14:55:35Araqand only that is to be lifted
14:56:10AraqI don't think the other '=' should be lifted
14:56:57Araqfilwit: it's nice but I prefer some gold :-)
14:57:44zaharyyes, I know, my plan was to keep this canonical assign in a TType field just like a destructor, but you still have to run overload resolution first (or at least check that it's needed)
14:57:48filwitbtw, every time I build Nimrod, do I need to re-extract the csources?
14:58:36filwitAraq: the thoughts behind the colors are: purple=regal, blue=clinical (code). but I will try one with Gold in it
14:58:54filwitAraq: usually Gold and purple go well with each other
14:59:35Araqmeh, I don't like purple :-)
14:59:53Araqgold and blue could work ...
15:00:09filwityou don't like the purple that's there at all?
15:00:41AraqI don't like purple. anywhere. ;-)
15:00:48filwitlol, okay
15:00:56filwitI'll try without gold instead
15:01:16Araqgood, also try *with* gold ;-)
15:01:37filwit;-P
15:02:17filwitI don't need to re-extract csources after pulling Nimrod do I?
15:02:30filwit(before building Nimrod)
15:02:42Araqfilwit: no, not in general
15:02:58Araqsometimes the older version can't compile the newer one
15:03:06Araqand then it's needed to go through the C step
15:03:18filwitI see
15:03:39Araqzahary: I'd check at definition time of '=' wether it's (var T, T)
15:04:14Araqdunno why you need to run overload resolution on it
15:04:26zaharyI meant at call sites
15:04:38filwitbtw, zahary, you closed the case/of issue on github but I still get a "invalid indentation" error when I try to compile with 'of' tabbed out
15:04:52filwithas that code not been merged to master yet?
15:05:18zaharyfilwit, hmm, can you provide exact example?
15:05:26filwitone sec
15:05:32zaharyit's merged in the latest head
15:06:40filwitwell I just pulled and rebuilt, and have a case/of/else (else is tabbed as well) in a simple file and it fails
15:06:58filwitthe case/of is in a 'proc main ='
15:07:44filwitbasically the full code looks like:
15:07:49filwittype Day = enum
15:07:54filwit Mon, Tue, Wed, Thu, Fri, Sat, Sun
15:08:00filwitproc main =
15:08:07filwit var d = Wed
15:08:12filwit case d:
15:08:20filwit of mon, tue: echo "life sux" # error here
15:08:26filwit of wed, thu: echo "life's ok"
15:08:31filwit else: echo "life rox"
15:08:38filwit.. that's it
15:09:39dom96filwit: holy wow, those logos are beautiful!
15:09:41zaharyI've just tried it and it works for me
15:10:01filwitdom96, :-)
15:10:33filwitzahary, :S, there's a couple other things in the file, let me clear and try again
15:10:54filwitnope
15:11:09Araqfilwit: you need to bootstrap again
15:11:17filwitcsources?
15:11:21zaharyare you sure the correct nimrod is in your path?
15:11:34filwityes I have it softlinked
15:11:42filwitto the directory I build to
15:11:56filwitlet me relink
15:12:03Araqwell check what 'nimrod's output is
15:12:13filwitcommand?
15:12:24dom96nimrod -v
15:12:25Araqjust 'nimrod'
15:12:45filwitversion 0.8.15
15:12:50Araqmine says: Nimrod Compiler Version 0.8.15 (2012-06-02) [Linux: amd64]
15:12:54Araqcheck the date
15:13:07Araqevery development version is 0.8.15 ...
15:13:12filwitah, mine says 2012-04-21
15:14:48Araqbtw the symlink works strangely at least on mac os x
15:15:02AraqI now advise against symlinking
15:15:15Araqand to edit your $PATH instead
15:15:59filwitI'm no Linux expert, so I'm not sure how to do that correctly. syslink has worked well before, but I'll look up the alternative later
15:16:25Araqedit your ~/bash.rc
15:16:44filwitapparently it's not the syslink, the new built version still says the same date
15:17:01filwitmaybe I'm not pulling correctly?
15:17:02Araqwell building from C sources is not enough
15:17:17Araqyou need to do 'koch boot -d:release' to get a recent version
15:17:30Araqthe C sources are only a fallback mechanism
15:18:03Araqhttps://github.com/Araq/Nimrod/wiki/Bootstrapping
15:18:11filwitk
15:20:27filwitis 'koch' a common linux command?
15:20:35filwitor did you mean: nimrod koch ...
15:20:47dom96koch is a nimrod application
15:21:00filwitah, right
15:21:01dom96You compile it by running 'nimrod c koch'
15:21:08filwitokay
15:23:33filwitso after I pull I always run koch?
15:24:02filwitthere we go, now I have the right version
15:24:05dom96yep
15:24:21filwitso koch just builds the compiler?
15:24:30filwit(correctly)
15:25:09dom96It compiles the compiler, and the compiles the compiler again with the newly compiled compiler to make sure that it compiled correctly.
15:25:25dom96What a nice sentence heh
15:25:31dom96*and then
15:25:44filwitduude, where's my car?
15:26:13filwitsorry, lol, odd reference
15:26:52filwityou just reminded me of that part with the drive-through guy going "and theeennnnn....?"
15:27:06filwitwell the case/of stuff builds correctly now :)
15:27:10dom96heh, I remember that scene.
15:27:40zaharyAraq, I'm about to add support for unsigned integers. looking at what needs to be done, there are several possible paths:
15:27:40zahary1) add unsigned literals and unsigned node kinds and doesn't allow any implicit signed -> unsigned conversion (thus making them uglier on purpose)
15:27:40zahary2) allow implicit conversion only for literals that are positive
15:27:40zahary3) allow more freely implicit conversions (like in C)
15:27:40zaharyany preferences?
15:29:23filwitI would like implicit conversion between strings and unsigned ints (specifically)
15:29:39filwitso, 10 + "50" == 60
15:29:45zaharythe horror :)
15:29:48filwithahaha
15:32:38Araq1)
15:33:29zaharyok, 12'u will be the suffix
15:34:36Araqyeah good, we also need 'u8, 'u16 etc.
15:35:05Araqwell I also want tyInt + typ.node to denote an integer literal
15:35:19Araqthat is compatible with tyInt* and tyUInt if it fits
15:35:42AraqI mean if the encoded value fits
15:37:30zaharyvar x: uint = 10 should be ok?
15:37:37*JStoker quit (Excess Flood)
15:46:04*JStoker joined #nimrod
15:47:47Araqzahary: yes
15:48:54Araqthough it may be preferable to change sigmatch finally and get rid of the distance based approach
15:49:03Araqand use the "partial order" approach instead
15:49:13Araqor perhaps keep the distance for speed reasons
15:49:25Araqand only use the partial order if ambiguous
15:49:45Araqcurrently for instance inheritance depth is not considered in sigmatch and that sucks
15:50:28AraqI'm a bit worried if every integer literal ends up allocating a new TType ...
15:51:03Araqbut we can always optimize it with a lookup array [-10..100, PType]
15:56:30zaharywhy would that happen? (each literals would get its own PType). Right now, with destructors I'm having trouble that if a type is copied, the compiler may incorrectly decide that it doesn't have a destructor even when the user defined one (because multiple TType instances get created for a single type in the program). I don't what to revert to solution where hashmap with type ID is used to store the destructor, so instead I want to eliminate most of the copies
15:59:25Araqeliminating copies is a worthy goal
16:00:27Araqmy lookup array is only for speed reasons
16:06:16filwitbtw, why can 'case' be used without ':'?
16:06:48filwitis that so that variance types don't conflict?
16:08:04Araqbecause it's consistent
16:08:16Araqafter 'case expr' no statement follows
16:08:33Araq'if x:' <-- statement follows
16:08:51Araqbut for consistency with macro syntax the colon is needed
16:08:57Araqso I made it optional
16:09:10filwitokay
16:18:17filwitokay, one last question before I head off
16:18:38filwitwhy isn't there a `++`, `--` operator defined for common types?
16:18:55filwityou just don't like those operators?
16:20:03AraqI couldn't care less about them, but they have the problem that i-- and --i are different and nimrod can't support that
16:20:18Araqin fact, nimrod only supports prefix operators
16:20:43Araqwell
16:21:04Araqthey are ugly because they modify and return at the same time
16:21:18filwiti see
16:21:32dom96It isn't that hard to become accustomed to '.inc' and '.dec'
16:22:21filwitokay folks, I've gotta run
16:22:26filwittalk to you later
16:22:28Araqalright
16:22:33Araqthanks for the images
16:22:36Araqbye
16:22:46filwitnp, I'll play with the colors
16:23:14filwitand in a few days I hope to have time to pick up on Aporia again
16:23:17filwitbye!
16:23:19*filwit quit (Quit: Leaving)
17:11:35shevy:)
22:08:22dom96You know what filwit's logos would look good on? A t-shirt ;)
22:12:54Araqhm perhaps
22:13:06Araqyes.
22:15:00dom96:D
22:25:02dom96good night
22:25:24Araqnight