<<20-08-2012>>

02:06:40*q66 quit (Quit: Quit)
02:27:24*Boscop quit (Quit: Boscop)
03:47:17*reactormonk_ joined #nimrod
03:47:51*reactormonk_ is now known as reactormonk
04:07:09*reactormonk quit (Ping timeout: 276 seconds)
04:31:42*reactormonk joined #nimrod
04:50:42*reactormonk quit (Ping timeout: 276 seconds)
05:02:22*reactormonk joined #nimrod
05:28:17*reactormonk quit (Read error: Operation timed out)
05:35:59*freak1 joined #nimrod
05:36:29*freak1 is now known as reactormonk
06:35:48*Boscop joined #nimrod
09:06:17fowlmacro `?`(a: expr): expr = result = newNimNode(nnkCharLit) result.intval= ($a[1].ident)[0].ord
09:06:25fowl:p
10:27:22*q66 joined #nimrod
12:34:58*Trix[a]r_za is now known as Trixar_za
12:43:57*Araq_ joined #nimrod
12:46:03*Araq_ quit (Client Quit)
14:22:51*Trixar_za is now known as Trix[a]r_za
15:19:21fowldom96: i put an output on recvFrom() to dump the port incoming, RECVFROM: 127.0.0.1 (58042) thats the port i need to save so i can write to it
15:30:38*dom96_and joined #nimrod
15:30:57dom96_andfowl: how did you get the port?
15:35:02fowldom96_and: the tsockaddr_in that the address came from
15:35:04*dom96_and quit (Ping timeout: 240 seconds)
15:35:20fowlsockaddress.sin_port
16:00:16*dom96_and joined #nimrod
16:00:41dom96_andfowl: so sending to that port works?
16:02:06dom96_andIf it's useful then recvFrom should return it.
16:06:07*dom96_and quit (Ping timeout: 240 seconds)
16:09:47*shevy quit (Ping timeout: 240 seconds)
16:10:29*dom96_and joined #nimrod
16:13:40fowlto be honest i didnt try it that much but i know thats how recvfrom works in python/ruby
16:14:44*dom96_and quit (Ping timeout: 252 seconds)
16:21:48*shevy joined #nimrod
16:30:08*reactormonk quit (Ping timeout: 245 seconds)
16:41:46fowli need either htons or ntohs for the
16:41:47fowlport
16:42:30*reactormonk joined #nimrod
16:42:35Araqfowl: these exist in sockets.nim afaik, but maybe they're not exported
16:43:02fowlthey're in posix.nim im just not sure which one i need
17:14:02dom96hello
17:15:10fowlhello
17:15:35dom96htons and ntohs is in sockets.nim
17:18:40fowldom96: this is working for me https://gist.github.com/3405921
17:19:29fowlpossible conflict with the flags var though
17:19:55dom96fowl: Make a pull request :D
17:20:08dom96huh? I don't see a conflict?
17:22:23*Trix[a]r_za is now known as Trixar_za
17:22:51fowlwell its not a problem with the original func gone
17:24:52dom96yeah, just get rid of the original.
17:25:44dom96This is only useful with UDP, and in most cases you want the address and port anyway
17:28:14Araqit's inefficient
17:28:28Araqdata = newString(length) --> setLen(data, length)
17:28:39Araqreuse the buffer if it's passed as 'var'
17:29:03Trixar_zaAnybody here like addictive books with obscure gaming/film references with a weird cyberpunk feel to them?
17:29:27Trixar_zaAnd who may want to win a DeLorean modeled to look like the one in Back from the Future
17:29:52dom96Trixar_za: tell me more :P
17:30:02AraqTrixar_za: tell me you're not misusing this channel to sell stuff
17:30:20Araqccssnet was that desperate too once
17:30:28Trixar_zaNo
17:30:36Araqand now look what we did to him
17:30:45Araqhe barely speaks anymore :P
17:30:52Trixar_zaI just want to find that damn easter egg in a book about finding an easter egg
17:31:00Trixar_zaIt's completely geek
17:31:51Trixar_zahttp://en.wikipedia.org/wiki/Ernest_Cline#Fiction
17:32:09Trixar_zaAnd yes, I actually finished the book :/
17:32:17dom96Araq: I take full responsibility for that inefficiency
17:32:20Trixar_zaDidn't see any reference to a meta-egg inside it
17:32:50fowlAraq: the buffer isnt passed in
17:33:03fowlo wait yes it is *dur*
17:33:18dom96So... who's going to participate in the upcoming Ludum Dare?
17:33:32fowli dont like working under pressure :p
17:33:33Trixar_zaI figured it's something Araq would like considering how he uses obscure music and gaming references
17:33:51dom96fowl: hehe. But Notch does it! That's why it's cool!
17:34:00AraqSystem Shock 2 is not obscure!
17:34:04Araqit's a classic
17:34:07Araqbest game ever
17:34:15dom96Araq: Portal 2 is way better
17:34:38Araqnope
17:34:47Araqnothing can beat nostalgia
17:34:52dom96true.
17:34:55Trixar_zaYou referred to a line from System Shock 1
17:35:01dom96In that case for me: GTA Vice City is the best
17:35:13Trixar_zaAnd Have you tried running SS2 these days? (I actually have a copy)
17:35:13Trixar_za:P
17:35:34AraqI got the original :P
17:35:43Trixar_zaBest game ever
17:35:45Araqand the quote is from SS2 too
17:36:01Trixar_zaBut It keeps killing me with my own damn bomb
17:36:16fowlhmm should i change to address.add($inet_ntoa(sockAddress..))?
17:36:42fowlinstead of address = ..
17:37:16AraqTrixar_za: be glad I don't try to run SS2 these days
17:37:24Araqwould be very bad for my productivity
17:37:43Trixar_zaI couldn't get it to run on my XP system
17:37:45Trixar_za:(
17:38:44Araqit doesn't like multicore at all
17:38:52fowlwine probably outperforms xp now
17:39:36Trixar_zaMind you, I couldn't get SS1 to run either. It runs BADLY in DosBox
17:39:39Trixar_zaWhich is a known issue
17:40:03Trixar_zaI should fix up the old PII and load up Windows 98 on it or something
17:41:01Araqso, dom96, I'm working on changing the default binding rules for templates
17:41:48dom96ok
17:41:57dom96You want my input on something?
17:42:08Araqwhich means old style templates need to become:
17:42:26Araqtemplate t() {.dirty, mixin, immediate.}
17:42:28Araq:D
17:42:40ccssneteh what?
17:43:04Araqccssnet: I was kidding
17:43:31ccssneto i got it now
17:43:42ccssnetspeaking of which you should go look at my listings :)
17:44:21Araqdo you still sell the shakira porn?
17:44:22dom96lol
17:44:51dom96Araq: wait what?
17:45:06dom96Well I suppose I will just adjust my templates to be new-styled
17:45:57Araqwell dom96 I think jester won't need many changes anyway
17:46:03Araqit'll simply work better ;-)
17:46:09dom96great
17:46:23dom96This reminds me.
17:46:32dom96I need to document jester more before I forget how to use it myself haha
17:46:39Araqindeed
17:46:50Araqyou don't even have copyright headers
17:46:55dom96pff.
17:47:14dom96I should come up with some cool license.
17:47:19ccssneteh what?
17:47:54dom96"If you want to use this software you must send me 5 beers per week to sustain my thirst."
17:48:00Araqccssnet: too bad :P
17:48:07ccssnetAraq: my listings have never contained porn...
17:48:20*ccssnet googles shakira
17:48:21Araqtoo bad
17:48:35dom96ccssnet: You got any Graphics cards?
17:52:28ccssnetdom96: ya
17:52:37dom96ccssnet: show me
17:52:54ccssnetpm
17:54:16ccssnethttp://atccss.net/pc/new-pc.jpg
17:54:16dom96k
17:54:19ccssnetthose ^
17:55:00dom96crossfire hrm
17:55:43shevyhmm
17:56:17shevygtk is useable in nimrod right? i.e. I can make commandline tools in nimrod for bio-science related things, and then build a GUI on top of that right?
17:56:32dom96shevy: Of course
17:56:38dom96shevy: Aporia is written in Nimrod
17:56:45Araqbut it may be easier with IUP ;-)
17:59:18dom96Real men use GTK :P
17:59:52Trixar_zabbl
18:00:24*Trixar_za is now known as Trix[a]r_za
18:03:18shevyIUP?
18:04:11Araqshevy: http://www.tecgraf.puc-rio.br/iup/
18:04:18Araqbut I never used it ;-)
18:09:53shevyhttp://www.tecgraf.puc-rio.br/iup/en/screenshots.html
18:10:09shevywell with gtk I don't aim for beauty
18:10:12shevyI only aim for BUTTONS.
18:10:30Araqiup runs on the big 3 oses
18:10:37Araqnatively
18:12:07shevyhmm,
18:12:35Araqer
18:12:51Araqstill no native macosx support
18:12:54Araqhm
18:14:36fowlshevy: check it out :> https://gist.github.com/3342882 now it also generates constructor funcs, you can even supply default parameters in the type def :D
18:15:09shevythis looks very alien to me
18:15:28shevyquestion
18:15:28shevy PNimrodNode {.compileTime.} =
18:15:33shevywhat means the part with the {}
18:16:58fowlpragma, compiletime says that proc is only useful at compiletime (because it deals with the ast)
18:18:45dom96shevy: It's extra information about types/functions/etc for the compiler.
18:19:14dom96I think we might need some nicer syntax for creating PNimrodNodes
18:19:15Araqer, fowl, does that code work?
18:19:27shevyhehe
18:20:00fowlAraq: yes, the default params are only used in the constructor, for the type i filter them out
18:20:05dom96Araq: I still have that dsl module I made.
18:20:10dom96Araq: Do we want that in the stdlib?
18:20:23Araqnever heard of it
18:20:26fowldom96: how does it compare to mine
18:20:52dom96Araq: Remember my crazy dynamic function macro? :P
18:20:56dom96(Which I never got working)
18:21:14dom96fowl: The dsl module just provides some convenience functions, like newProcNode etc.
18:21:30Araqof course we want something like that
18:21:56fowli want to see it
18:21:59AraqI always wondered why nobody does a pull request
18:22:15dom96https://gist.github.com/cf86763b154cc3bdb673
18:23:23dom96It's not much hehe
18:23:33fowlmine's better
18:24:55dom96oh you made a dsl module too
18:25:09fowlinfix(10.lit, "*", 6.lit) ## way more readable than infixnode(newidentnode("*"), newintlitnode(10), newintlitnode(6))
18:25:17Araqdom96's name is better ;-)
18:25:51Araqfowl: try the new varargs[t, converterHere] ;-)
18:26:07Araqinfix(10, "*", 6) # should be possible
18:26:30dom96Araq: So why does: https://gist.github.com/194e8e2d719e6c8f482d
18:26:37dom96Fail with: dynamic.nim(6, 5) Error: macro requires one parameter
18:26:47dom96?
18:26:52fowlAraq: "*" has to be an identnode not a literal
18:27:10Araqbecause I haven't unified templates and macros yet, dom96
18:27:26Araqa macro always gets only 1 param which is the invokation AST
18:27:32dom96I see.
18:27:38Araqit's planned they'll behave like templates though
18:27:59Araqand there will be a magic "callsite" proc to get the invokation AST
18:28:15*dom96 wants a cool dynamic macro like that just to show off what Nimrod can do
18:28:27Araqfowl: think again, it all ends up being a PNimrodNode
18:28:52Araqbut yeah
18:29:06fowlyes but if its a strlit when it should be an identnode thats bad sauce
18:29:08Araqyou'd have !"*" then
18:29:08fowlright?
18:29:37Araqright, the code would become: infix(10, !"*", 6)
18:30:36Araqdom96: TDynamic doesn't need macros, it only needs converters
18:31:01Araqexcept for your 'def' macro
18:31:11Araqwhich was your point I guess, he he
18:31:16dom96indeed
18:32:43Araqshevy: don't learn about macros before you got the type system ;-)
18:37:22fowlthat was easier than i expected
18:42:13*Araq loves the varargs feature
18:42:38*dom96 loves the comment toggling feature
18:42:54Araqoh right
18:43:07AraqI should try to compile aporia with the new compiler
18:43:41dom96yep
18:47:59Araqfowl: do the templates you write rely on the definition scope or the instantiation scope?
18:48:42fowlinstantiation
18:49:45Araqwell would they work with definition scope as well?
18:50:23Araqbecause I'm about to change it ;-)
18:54:08dom96brb
18:55:08fowlill adapt
18:55:14fowlthose are simple templates
19:19:44dom96back
19:31:07*JStoker quit (Excess Flood)
19:50:19Araqok, beware
19:50:25AraqI'm gonna break lots of tests :P
19:51:34dom96Don't, there is a bomb! And it will blow up if test success percentages go below 90%.
19:51:54*dom96 is very silly today
19:55:07*JStoker joined #nimrod
20:01:54Araqfowl: port should be of type TPort
20:02:19Araqotherwise the patch is fine if dom96 agrees
20:02:50AraqI have to go, see you later or tomorrow
20:02:59fowlok
20:03:02fowlpeace
20:06:07dom96hrm, I just got an idea.
20:06:14dom96optional var params?
20:06:34dom96Araq: Let me know what you think when you come back :)
20:06:58fowloptional var params? what does that mean
20:07:28Araqhrm sounds fishy
20:07:34Araqbut I know what you mean
20:07:42dom96In the case of recvFrom, if you made 'port' optional, you pass `nil` or maybe `_` and then the proc wouldn't set it
20:08:01dom96Araq: Why does it sound fishy?
20:08:23dom96I suppose the same could be achieved with an overload
20:08:32dom96This would be a nice convenience though
20:08:34Araqnot 'nil' and not '_', instead you declare it to be optional and the compiler inserts a dummy var for ya
20:08:49dom96yeah, sure.
20:09:04Araqsounds indeed like a nice feature but I'm already overwhelmed with work
20:09:43dom96Well... I could try implementing it. But you know how that goes for me :P
20:10:56dom96fowl: Your changes look fine to me. But yeah, do what Araq says.
20:12:10Araqdom96: I don't feel like rewriting your compiler changes :P
20:13:43dom96Now that's just mean :(
20:14:22dom96But hey, if you don't want my help... :P
20:16:07fowlok, i didnt have to have to update the pull request o_O i just pushed and it updated
20:16:08Araqimplement that branch support for nimbuild please
20:16:23Araqgithub's awesome
20:16:28Araqbye
20:40:00fowldom96: where is babel? Im not seeing it on github
20:40:19dom96The nimrod-code organization
20:42:25fowlcool
20:43:12*JStoker quit (Excess Flood)
20:58:51dom96fowl: You should change your git real name heh
21:00:46fowlis that a github setting
21:02:58dom96git config --global user.name "Your Name Here"
21:03:03dom96https://help.github.com/articles/set-up-git
21:05:07*JStoker joined #nimrod
21:05:09fowlalright. I am now fowlmouth AKA Billingsly Wetherfordshire
21:07:29dom96:)
21:43:32Araqugh
21:43:49Araqjogging at 24degrees sucks
22:25:44*zahary joined #nimrod
22:26:24Araqhey zahary!
22:26:30zaharyhi
22:26:44AraqI've implemented hygienic templates :-)
22:27:08zaharykudos
22:27:28zaharydid you finish varargs too? nimrod 0.9 is getting pretty close
22:27:52zaharyI have a new PC that boots the compiler in 1.1 second :)
22:28:04Araqafaict varargs are done, yes
22:28:12Araqwtf? 1.1s? o.O
22:28:20Araqwhat CPU?
22:28:36zaharycore [email protected]
22:28:52fowlooo
22:29:04dom96wow, that is impressive
22:29:21dom96And now I need to sleep. Good night :)
22:29:29fowlg'night
22:29:36AraqI have holidays next week and then 0.9 will be released
22:29:39zaharygood night
22:29:52Araqbye, dom96
22:34:10Araqso zahary we need to talk about symbol capturing in templates again
22:34:46AraqI think 'mixin' is the wrong default
22:34:58Araqand 'bind' should be the default instead
22:35:03zaharymixin being the old "inject" here?
22:35:10Araq(mixin = instantation scope)
22:35:17Araq(bind = definition scope)
22:35:40Araq'inject' vs. 'gensym' is a different matter which I solved as follows:
22:36:06Araq'inject' is default for vars, lets, consts and types, 'gensym' for routines
22:36:35zaharyisn't it the other way around?
22:36:37Araqbut it can be done explicitely via the 'inject' and 'gensym' pragmas
22:36:43Araqer, yeah
22:36:49Araqthe other way round :D
22:37:03Araqbrb
22:37:09zaharyok, I remember, I was just about to remind you about this idea
22:39:36*zahary left #nimrod (#nimrod)
22:39:37*zahary joined #nimrod
22:42:28*XAMPP quit (Quit: Leaving)
22:46:40Araqback
22:46:50Araqwell the inject/gensym stuff is implemented
22:47:01Araq'bind' is still the same
22:47:21Araqyou can get unhygienic templates back with a 'dirty' pragma
22:47:43Araqso to get 0.8.14 styled templates that would be:
22:48:02Araqtemplate t() {.immediate, dirty, mixin.}
22:48:35AraqI'm flirting with the idea to conflate 'mixin' and 'dirty' ...
22:51:25Araqfyi, http://existentialtype.wordpress.com/2012/08/11/extensionality-intensionality-and-brouwers-dictum/
22:51:41Araqbut I don't understand it ;-)
22:55:23zaharyso what's this second axis? mixin vs bind?
22:55:31Araqyes
22:56:14zaharyah, you can now say that you want all names to be locally bind
22:56:21zahary* bound *
22:56:25Araqyep
22:56:30zaharyI see
22:57:23Araqtbh part of the reason 'bind' ended up the way it is now is because I lacked a word for 'mixin' :-)
22:57:43zaharyif you remember there was also the minor macro problem where you want to return locally bound identifier
22:58:13Araqyeah but this can be solved with a better API
22:59:03Araqand it's not a minor problem, I think it's quite severe
23:01:40Araqif you look at tables.nim there is some interesting code:
23:02:00Araqproc put[T](....) = putImpl()
23:02:23Araqwhich I consider common
23:02:37Araqnow if we have a mixin lookup like:
23:03:06Araqif (mixin `==`)(key, t.key): # only this == is "open"
23:03:27Araqas opposed to say some == for an integer count
23:03:37Araqin the same putImpl()
23:03:54Araqwell ugh
23:03:57zaharyhmm, I guess this only applies for generic procs?
23:04:30Araqtrue but it's often the same for templates, isn't it?
23:04:51Araqwell my point is: if we have 'mixin' for both templates and generics for consistency
23:04:57zaharyI would expect it for templates and anything that's inlined
23:05:24zaharyfor generic procs it's less clear what the user will expect
23:05:41Araqwell I'm thinking about making symbol lookup rules consistent between templates and generics
23:06:17zaharyinlining is the defining criteria for me
23:06:34zaharygenerics are cached between modules so they are a bit different
23:06:48Araqyes sure
23:06:58AraqI don't want to get rid of one of them
23:07:11Araqbut symbol lookup rules could be the same
23:07:11zaharyyes, they are both nice
23:08:08Araqwell my point is:
23:08:09zaharysure, but you probably should produce the conflicting definitions errors for generics
23:08:33zaharywhen 2 scopes use different "mixed-in" symbols
23:08:54Araqhrm I haven't though of that
23:09:02Araqbut let me go on please ;-)
23:09:24Araqso, if the lookup rules are the same and we have that 'mixin' feature
23:09:46zaharyI also like the controversial idea of allowing redefinition of inlined symbols in the same scope - my assertion_failed example if you remember
23:10:04Araqargh, yes
23:10:04zahary… I am listening
23:10:07AraqI broke it :P
23:10:12AraqI think
23:10:32Araqwell the point is you can't copy&paste the generics implementation into a template then anymore
23:10:46Araqbecause 'mixin' changes its meaning in a subtle way
23:11:04Araqbecause it then refers to the template context
23:11:16Araqand not to the generic's
23:11:26*XAMPP joined #nimrod
23:12:26zaharyyou mean you can't copy/paste because the generic is bind by default and the template is mixin by default?
23:12:47Araqno
23:13:25Araqwell it's a general problem
23:13:33Araqso I'll come up with a different example:
23:13:48Araq'bind x' has a meaning in a generic
23:13:55Araqand in a template
23:14:33Araqyou can't cut&paste it into a template without changing its semantics subtly
23:14:44Araqor consider nested templates
23:15:11Araqtemplate outer =
23:15:15Araq template inner =
23:15:30Araq bind x # obviously refers to 'inner'
23:16:19Araqwhich means you can't put 'bind' in a template to abstract it
23:16:31zaharyhmm, that would just say that there is a symbol named x somewhere up the scopes?
23:16:43Araqtemplate mybind(x: expr) = bind x
23:16:49Araqtemplate t =
23:16:58Araq mybind abc # can't work
23:17:21Araq'bind' is not "first class"
23:17:53Araq'mixin' has the same problems
23:18:13zaharywell, sure, but I wouldn't expect it as it just controls lexical scoping (something that's statically determined in the structure of the program text)
23:18:45Araqwell sorry if it was obvious but I wonder if this can cause problems
23:19:28Araqthe hygienic macro papers all consider the problem: what happens if 'let' is redefined?
23:19:50Araqin nimrod you can't do that
23:19:52zaharythe let keyword itself?
23:20:03Araqyes
23:20:42Araqand we have the same issue:
23:21:11zaharywell, I got thinking about this user_defined_bind - in the end, it's related to the macro problem I mentioned earlier
23:21:25Araqtemplate declare(x: expr) {.dirty, immediate.} = var x: int
23:21:30Araqtemplate t =
23:21:41zaharythere must be a way to return a bound identifier as a node - either as a flag attached to nkIdent or as another node
23:21:43Araq declare(y) # no gensym magic
23:22:06Araqa bound identifier is called "nkSym"
23:22:10zaharyso custom_bind is then also possible - it will just return such "bound" identifiers
23:22:27Araquse "nkSymChoice" for a "mixin"
23:23:46Araqbtw I noticed nkSymChoice is broken
23:24:04Araqwe need "nkSymChoice" which is a fixed set of overloaded symbols
23:24:30Araqand some "nkMixin" which consists of a set of overloaded symbols which are however
23:24:36Araqenriched by the current scope
23:24:55Araqopen vs. closed nkSymChoice
23:25:06zaharyI see
23:25:40Araqcurrently we sometimes treat it as open and sometimes as closed
23:26:25zaharywell, for symChoice itself (what I called superposition) I expect the closed behavior
23:26:48zaharybut I see what you mean by the mixin (open) symbol set
23:27:15zaharyI'm still wondering isn't this just a flag for nkIdent
23:27:31zaharythe lookup is always through an identifier?
23:28:00Araqno, it can also be `x`, or x.y
23:28:33Araqthe `` allow weirder stuff like `x % y`
23:28:55Araqbut it's only a concatenation so it ends up being an nkIdent
23:30:37Araqoh and we really need that symbol "snooping" that you mention for immediate templates
23:30:50zaharywhat's the rule right now? if symchoice's children are all nkSym, then it's closed set. if there is other types of nodes such as nkIdent, nkAccent, nkDot then it might be either mixin or bind (with a lookup through the owner)?
23:31:07Araqoh sorry, I misread
23:31:18AraqnkSymChoice is a list of nkSym only
23:31:31Araqbut in lookups.nim we also consider the "open" set
23:32:10Araqhowever in sigmatch.nim we treat it as a closed set (which makes sense though)
23:55:58Araqgood night
23:57:17*reactormonk quit (Ping timeout: 265 seconds)
23:58:36zaharygood night
23:59:48*reactormonk joined #nimrod