<<30-08-2012>>

00:06:59*XAMPP quit (Ping timeout: 272 seconds)
00:09:44*XAMPP joined #nimrod
00:14:41*Trix[a]r_za is now known as Trixar_za
00:18:08*Trixar_za is now known as Trix[a]r_za
01:40:52*q66 quit (Quit: Quit)
05:39:22*JStoker quit (Excess Flood)
05:50:11*JStoker joined #nimrod
10:46:07*Trix[a]r_za is now known as Trixar_za
10:47:42*Trixar_za is now known as Trix[a]r_za
11:00:47*q66 joined #nimrod
11:32:30*XAMPP quit (Read error: Connection reset by peer)
11:33:16*XAMPP joined #nimrod
11:33:16*XAMPP quit (Changing host)
11:33:16*XAMPP joined #nimrod
11:38:19*zahary joined #nimrod
14:54:17Araqhey dom96
14:54:20AraqI'm back :-)
14:54:24dom96Good.
14:54:33*dom96 is fighting with his new graphics card
14:55:08AraqI'm glad you couldn't be bothered to actually make aporia compile all these days
14:55:14Araqso we got bug #193
14:55:17Araqthanks
15:00:41*zahary quit (Quit: Leaving.)
15:01:41*zahary joined #nimrod
15:08:47Araqping zahary
15:09:21Araqwell dom96 I made macros use the same parameter passing mechanism as templates
15:09:31dom96cool
15:09:34Araqoverloading ': stmt' still is not implemented :P
15:09:55Araqand I've implemented term rewriting macros but they don't work yet ;-)
15:24:53*zahary quit (Read error: No route to host)
15:25:01*zahary joined #nimrod
15:36:43*q66 quit (*.net *.split)
15:36:43*Roin quit (*.net *.split)
15:40:31*q66 joined #nimrod
15:40:32*Roin joined #nimrod
16:18:09reactormonkAraq: term rewriting?
16:19:11Araqreactormonk: we've talked about this before
16:19:25Araqit's a way to introduce user defined optimizations
16:19:29Araqx+0 --> x
16:23:43reactormonknice
16:31:55*shevy2 joined #nimrod
16:32:54*shevy quit (Read error: Operation timed out)
17:05:34Araqping dom96
17:05:51AraqI'm having a hard time designing the syntax for the pattern matching feature
17:06:01Araqcurrently it's like this:
17:06:13Araqtemplate optZero(x: int): int =
17:06:14Araq as:
17:06:16Araq x+0
17:06:17Araq x
17:06:19dom96Pong :)
17:06:30Araqit used to be:
17:06:41Araqtemplate {x+0} (x: int): int = x
17:06:58Araqbut that's more work to implement :P
17:07:13Araqplus I dislike that you can't really name that transformation then anymore
17:07:30Araqand I know have other plans with the curlies in that position
17:07:50dom96What's wrong with the current syntax then?
17:08:00Araqwell, do you like it?
17:08:16dom96Sure.
17:08:19Araqcool
17:08:31AraqI'd prefer a "pattern" keyword instead of "as"
17:08:39Araqbut I figured "as" is already a keyword
17:08:47Araqand pattern is too useful to become a keyword
17:09:03dom96Well. Maybe we could use the pipe character :p
17:10:40dom96i.e. |
17:12:46Araqno
17:12:53Araqit *has* to be a keyword :P
17:13:01Araqor in a special position like instead of the name
17:13:02dom96how about "match"?
17:13:21Araqtoo useful too
17:13:33Araqit's after all, a rarely used feature
17:13:38Araqwell it'd better be
17:13:57Araqbecause it bloats compilation times
17:14:13dom96"optmatch"
17:14:15dom96?
17:14:23Araq"astex" ?
17:14:29Araqinstead of "regex"?
17:14:35Araqbecause that's what it is
17:14:40fowl=^_^=
17:14:55fowluse that as the keyword^^ :>
17:15:09dom96go with "astecs" heh
17:15:27Araqnah, "as" is good enough for 0.9.0
17:15:28dom96nah, in all seriousness "astex" sounds good.
17:15:37dom96No.
17:15:42dom96Don't use "as"
17:15:45Araqlol
17:15:48dom96Please :P
17:15:50Araqyou said you liked it :P
17:16:08dom96Well I was empowered by emotions of getting my graphics card to kind of work :P
17:16:14dom96I changed my mind.
17:16:17*zahary quit (Ping timeout: 245 seconds)
17:16:22Araqugh, I knew it
17:16:36Araqyour opinion can't be trusted :P
17:16:41dom96lol
17:16:52Araqso, fowl; what's your (serious) opinion?
17:18:24fowli dont know what use term rewriting macros are
17:18:27dom96Araq: Will it always be single lines, or can you have blocks of code?
17:18:32AraqI also played with "as in" and "written as"
17:18:40Araqdom96: blocks of code are possible too :D
17:18:54fowli would use `as` for something else, like `cint as bool` could be the equiv of bool32
17:19:05dom96yeah, I agree with fowl
17:19:13Araqthat's not prohibited by that at all :P
17:19:29AraqI want "cint as bool" too so I ensured it's still possible
17:20:27Araqfowl: best use case: everything where in C++ you'd use a template tree
17:20:43dom96"as" doesn't really seem to mean anything in that context. It's meant to be a shortened version of "astex" right?
17:21:22Araqer "expression template" it's called in C++
17:21:40Araqit's a shorthand of "written as" or "as in"
17:21:43Araqtemplate t() =
17:21:45Araq as in:
17:21:47Araq x + 0
17:24:18Araqbut nimrod doesn't use <keyword> <keyword> anywhere else
17:24:40Araqwell we could of course use "as_in" or "written_as" as keywords
17:36:06Araqwell?
17:36:15Araqany opinions?
17:43:42*zahary joined #nimrod
17:51:25dom96I still prefer "astex"
17:51:40dom96Also, cameCase is the convention in Nimrod, no? :P
17:51:44dom96*camelCase
17:51:51dom96So that would be "asIn"
17:51:58Araqwhatever
17:52:00fowlI like match/with block in the same for as case/of
17:52:10fowlform*
17:52:12dom96I like "optmatch" or "astmatch"
17:56:23Araqfowl: what?
17:56:33Araq match x+0
17:56:37Araq with x
17:56:38Araq?
17:57:05Araqneither optmatch nor astmatch are good enough as keywords ...
17:57:10fowli dunno, why would you do something + 0 anyways
17:58:39Araqas:
17:58:51Araq x = x.substr(0, 4)
17:59:04Araqx.setlen(5)
17:59:07Araq:P
17:59:29Araqthe +0 is simply the easiest example I came up with
18:02:09Araqoh well, I'll implement the original syntax I guess
18:02:24Araqit still makes the most sense anyway
18:03:04Araqit's kinda ugly for multiline patterns though
18:03:19Araqtemplate {
18:03:29Araq write f, x
18:03:32Araq write f, y
18:03:40Araq}(f: TFile, x, y: expr) =
18:03:45Araq write f, x, y
18:05:35fowli like that
18:06:39AraqI will also support
18:06:53Araqtemplate name{pattern}(...)
18:07:04Araqso that it can be named
18:10:16dom96how about that 'with'?
18:10:20dom96At the end of the template
18:10:23dom96hrm.
18:10:33dom96or what about:
18:10:45dom96template name() =
18:10:55dom96 optimizes:
18:10:58dom96 ...
18:11:41Araqtemplate name{pattern} also reflects how the AST looks like
18:12:03Araqso I'm going with that syntax
18:15:46dom96well alright]
18:16:20fowlis a full c++ wrapper possible
18:17:04fowlwith inheritance
18:19:32Araqfowl: dunno, the compiler uses C++ inheritance mechanism if you make it generate C++ code
18:21:52Araqand you can get as ugly as you want it with {.emit.}
19:00:53*zahary quit (Quit: Leaving.)
19:02:20*zahary joined #nimrod
19:21:39*zahary quit (Quit: Leaving.)
19:37:27Araqdom96: aporia doesn't know 'static' is a keyword :-(
20:11:01reactormonkAraq: is there a way to get the keywords from nimrod?
20:11:14Araqdoc/keywords.txt?
20:11:56Araqthis means "no", but the docs are up to date
20:14:13*shevy2 is now known as shevy
20:16:05dom96Araq: You know you have access to the repo too :P
20:16:24Araqdom96: yeah, so?
20:16:34Araqhave you been adding keywords to the language?
20:23:01Araqhrm, I just realized ... this pattern matching feature allows to overload '=' as a side effect :-)
20:24:16*EfTwelve joined #nimrod
20:24:29Araqhi EfTwelve
20:24:37EfTwelvehi
20:25:06dom96hello EfTwelve
20:25:21EfTwelvehello
20:28:57Araqtemplate disallowIf{
20:28:59Araq if cond:
20:29:01Araq action
20:29:02Araq}(cond: bool, action: stmt) {.error.} = action
20:29:07Araqif true:
20:29:08Araq echo "do it"
20:29:18Araqtemp2.nim(24, 2) Error: usage of 'disallowIf' is a user-defined error
20:29:23AraqXD
20:29:37dom96what 0_o
20:29:46Araqthis stuff is like crack
20:30:28Araqyou can redefine language constructs :P
20:30:38dom96oh, I think I get it.
20:30:46dom96Didn't notice the error pragma
20:30:52dom96that's pretty damn cool
20:31:34EfTwelvesneaky
20:32:18Araqyeah, someday you will be glad you can turn it off easily with --patterns:off
20:36:21EfTwelveim just starting with nimrod.
20:37:14EfTwelvethis seem strange, that there is an extra iteration.
20:37:19EfTwelvefor i in 0..len("abcd"): echo((st1[i]),"!")
20:37:25Araquse:
20:37:35Araqfor i in 0 .. <len("abcd")
20:37:36EfTwelveoops
20:38:00Araqotherwise it iterates over the terminating \0 too
20:38:08Araqwhich is unfortunate
20:38:28Araqfor arrays/seqs you would have triggered an index out of bounds error
20:38:36EfTwelvevery strange, len() is correnct, and the string is 0 based..
20:38:42EfTwelvewhy the extra iter?
20:38:55fowlEfTwelve: the .. is inclusive, for i in 0..10: will print out 0-10 not 0-9
20:39:26EfTwelveoh..
20:40:03Araqstrings are \0 terminated so that they can be passed to C without needing a concatenation
20:40:59EfTwelvei see. thanks
20:42:45Araqand I don't disallow accessing the \0 because it's incredibly handy for parsers
20:45:40EfTwelvebtw: thanks for making the language case-insensitive. ;)
20:46:03Araqlol why?
20:46:24EfTwelveits a big peev of mine
20:46:27AraqI thought I was some incredibly stupid noob who has never written any serious software because of that feature
20:47:05Araqand I eat babies for lunch and deserve to burn in hell
20:47:54Araq;-)
20:47:56EfTwelveyou've got a lot of negative feedback?
20:48:12fowlreddit isnt an authority on.. anything
20:50:15Araqin fact, if I would do it again, I would make it case sensitive and make the compile enforce a naming scheme
20:50:44Araqand the naming scheme would piss off *everybody* :P
20:50:50Araqincluding myself
20:52:02EfTwelvewell, at least put one checkmark in the pro:case-insensitive column from me.
20:52:19Araqalright ;-)
20:53:14fowlEfTwelve: what are your programming interests
20:56:37EfTwelvefor work I financial related stuff futures,commodities etc, other half of the time is game dev.
20:56:56EfTwelvei *do ..
20:59:12EfTwelvei stumbled on the nimrod page while google searching AST's
21:00:19fowli have a nimrod wrappers for sfml and chipmunk you might like :)
21:02:09dom96Araq: Remind me to restart the Windows builder :P
21:02:25Araq-.- I did
21:03:01Araqwe should find someone who has a windows server and is willing to deploy nimbuild
21:04:17EfTwelvesfml seems interesting, is the wrapper complete? and include all the raw opengl stuff?
21:05:36Araqoh btw, fowl, I broke all existing macros ;-)
21:07:41dom96Araq: oh btw. The GCC farm now has all bsd versions available I think.
21:08:08dom96So we won't be limited to netbsd anymore.
21:08:15Araqwell FreeBSD should work
21:08:31Araqthe bug apriori encountered wasn't bsd specific
21:08:52Araqmaybe even netbsd works
21:11:23dom96cool
21:11:35dom96I really wish we had a better Windows server
21:14:02Araqfowl: do you happen to have any representative templates lying around?
21:14:19*Araq doesn't trust the examples he looked at
21:17:47EfTwelvedoes nimrod have a runtime rnd() function?
21:18:06Araqmath.random
21:18:28AraqEfTwelve: are you using 0.8.14 or the github version?
21:18:51EfTwelvejust grabbed the windows installer from the webpage
21:19:11EfTwelve8.14
21:19:13Araqhttp://nimrod-code.org/theindex.html
21:19:15Araqfor 8.14
21:19:29Araqand http://build.nimrod-code.org/docs/theindex.html for the github version
21:23:05Araq0.8.14 is seriously outdated, but we're still not ready for 0.9.0 ...
21:25:52EfTwelveim just starting to learn the language, are there major syntax changes since 8.14?
21:26:56Araqthere are a few but only minor stuff
21:27:48Araqtemplates and macros changed significantly, but not their syntax
21:35:56EfTwelvearrays can only be declared under a type block with a fixed range? An array cannot just be declared as a var such as: var myarray:string[SIZE] ?
21:36:37Araqwell strings can't have a fixed size
21:36:38EfTwelvethere is only 1 reference to arrays in the tutorial that I can see
21:36:50EfTwelvebut an array of string..
21:37:02Araqvar myarray: array[0..3, string] # works
21:37:11Araqvar myseq: seq[string] # works too
21:37:32AraqT[] is no array declaration
21:37:51EfTwelvehmm. did i miss that in the tutorial?
21:38:08Araqdunno the tutorial is pretty weak, I know
22:20:51EfTwelvethe tutorial seems ambiguous about void functions. is {.discardable.} and a return type always required?
22:21:26Araqof course not
22:23:08Araqand the divmod example has no return type
22:24:19Araqugh, dom96, binding of []= does not work due to a *cough* unforeseen interaction of features
22:24:45dom96that's disappointing.
22:25:26dom96Is it a lot of work to fix?
22:25:41dom96Requiring an import of 'strtabs' for jester sucks.
22:27:19Araqwell there is an easy workaround:
22:27:42Araqproc myput(s: PStringTable, key, value: string) = s[key] = value
22:27:48Araqbind myput
22:28:17AraqI could make it work but then you really need to invoke it like this:
22:28:27Araq`[]=`(s, k, v)
22:30:37Araqhowever, are you sure all that needs to be done via templates?
22:30:51Araqwhy can't you use procs again?
22:31:57dom96Because then I don't have that nice `get "/": ...` syntax
22:33:42reactormonkaww
22:33:47Araqwell I'm about to implement:
22:33:54Araqp(a):
22:33:55Araq b
22:34:02Araqas a shortcut for
22:34:10Araqp(a, proc () = b)
22:34:20Araqwould that help?
22:34:30reactormonkAraq: welcome to ruby block syntax :D
22:34:50dom96Araq: Perhaps
22:35:00Araqhey, I invented that syntax for templates myself :P
22:35:11AraqI only figured out ruby does the same
22:35:13Araqlater
22:35:26dom96Don't worry, Ruby isn't Apple and you're not Samsung :P
22:38:05Araqugh is there actually an interesting talk of rich hickey?
22:42:48Araqok, I will implement the shortcut and you try it out
22:46:19EfTwelvemy first nimrod program. yay
22:47:05EfTwelvesimple genetic algorithm for matching strings. https://gist.github.com/3543656
22:48:25Araqcool
22:48:44Araqcreatepop doesn't need ':bool {.discardable.}' though
22:49:30Araqfindbest could use the implicit 'result' variable
22:50:43Araqs = s & chr() # inefficient, better use
22:50:45Araqs.add(chr(...))
22:51:00Araqand use the 'result' variable
22:51:10Araqnewbies never use 'result' :P
22:51:20EfTwelveahh.. i agree it's not very nimrod-y
22:51:49dom96Araq: Does any other language have something like 'result'?
22:52:06Araqdelphi and eiffel both have 'result'
22:52:14AraqGo has something similar
22:52:27Araqcan't remember about modula 3
22:52:57dom96interesting
22:53:53Araqthere are some other obscure programming languages that have it
22:54:02Araqbut I can't remember
22:54:06EfTwelveim impressed by the speed nimrod
22:54:30*Boscop quit (Quit: Boscop)
22:55:04Araqcompile times or runtime of your code?
22:55:48EfTwelveboth
22:56:09Araqgood :D
22:56:23EfTwelveruntime is impressive for how many string ops happening
22:58:58EfTwelveI think i might start porting some of my machine learning stuff to nimrod.
22:59:12Araqyay :D
22:59:13EfTwelveafter i learn the language of course
22:59:30Araqit's still has its rough edges
22:59:49Araqso please ask for help here :-)
23:00:03EfTwelvei just found it today. im impressed!
23:00:36EfTwelvethe tuts and examples are a little lacking, ill probably be coming here to bug you guys
23:00:49Araqthat's good
23:01:35Araqand yes we know 0.8.14 can't compile 0.8.15 ;-)
23:02:02Araqit's always that way, latest stable release can't compile newer versions
23:02:20Araqdevelopment is too fast *cough*
23:03:05*Boscop joined #nimrod
23:03:47EfTwelveare there any examples anywhere of the threading/actors and dll creation?
23:04:03EfTwelvenot those 2 together..
23:04:07Araqthreading works, actors are still quite broken
23:04:15EfTwelveexamples of each, i mean
23:04:44Araqhttp://nimrod-code.org/nimrodc.html#dll-generation
23:05:31Araqthread examples are in the tests directory
23:06:25AraqI'd simply use multiple processes and a database though
23:08:55AraqEfTwelve: are you using windows?
23:09:02EfTwelveyes
23:09:26AraqI hope you stay around here then, we need a new windows testing machine :D
23:09:55Araqit only has to be online often enough to run the test suite
23:10:20EfTwelveok
23:14:45AraqEfTwelve: check out aporia, a nimrod IDE written in nimrod
23:15:02EfTwelveok, i will.
23:15:10Araqdunno if it currently works on windows
23:15:14Araqdom96?
23:16:04dom96It does. Well, it's usable :P
23:16:13EfTwelvequestion: when using "{.compile: "myfile.cpp".}" does this work with .c files as well? and do i have to later declare the function(s) in nimrod?
23:16:28dom96Still has some rough edges that need to be worked out (mostly to do with launching aporia from explorer.exe)
23:16:29Araqyes it works with .c files too
23:16:52Araqbut beware the compiler caches the .obj files for you
23:17:06Araqso you might need to enforce recompilation with -f
23:17:21Araqand yeah you have to declare the function prototypes in nimrod
23:17:27Araqc2nim helps with that though
23:19:58EfTwelveya, i cant get that part to work. claims the implementations is expected
23:20:19EfTwelvemaybe because the c function is float and nimrod is double
23:20:40Araqwell use float32 for C's float
23:20:44Araqin fact
23:20:53Araqlearn to use c2nim
23:21:00Araqit often knows better ;-)
23:22:22Araqoh btw, dom96, there is indeed a bug with 'bind', fixing it may take a while
23:24:47EfTwelvec2nim seems to create malformed code though
23:26:13Araqin 0.8.14 yes
23:26:38Araqwell it creates stuff like cunsignedint
23:26:43Araqwhich doesn't exist
23:26:57Araqgithub version is better ;-)
23:27:06EfTwelvedoesnt handle unions
23:27:26Araqit does
23:27:43Araqbut not properly
23:28:31Araqwhat does it generate?
23:28:35EfTwelvehttps://gist.github.com/3544921
23:31:36Araqhey it's documented that way :P
23:31:45Araqnimrod doesn't have C's unchecked unions
23:32:08Araqso the best it can do is use the first branch of the union and hope for the best :D
23:35:00EfTwelveno worries, but i was thinking that it could be compiled and statically linked.
23:35:20EfTwelvebut the function definition seems to be the issue
23:40:05Araqwell ... you translated the C code completely to Nimrod
23:40:18Araqso there are 2 fastSqrt
23:40:23Araqwhich can't work
23:40:37Araq'inline' also doesn't help
23:41:00Araqyou need to do: float fastSqrt(const float x);
23:41:14Araqand translate that to a proper Nimrod header
23:41:28dom96good night guys
23:45:02Araqit can be imported like this:
23:45:39Araqproc fastSqrt(x: float32): float32 {.importc: "fastSqrt".}
23:45:46Araq{.compile: "myfile.c".}
23:46:02EfTwelveahha!
23:46:07EfTwelvethat works!
23:47:00EfTwelvetyvm
23:59:37Araqwell I have to sleep now
23:59:39Araqgood night