<<22-05-2013>>

00:06:23*Trixar_za is now known as Trix[a]r_za
00:28:00rgrinbergfowl: the type annotations are optional i assume?
00:30:22fowloptional where they can be inferred, ie var x = someFunc()
00:31:16rgrinbergwhat is the type of + then?
00:31:18dom96I believe you can have: var myfunc = proc(a, b): auto = a + b
00:31:59rgrinbergdom96: ya that looks better but it's a little ugly
00:32:17rgrinbergwhat is the inferred type for myfunc?
00:32:21dom96rgrinberg: Better syntax for closures is planned ;)
00:32:40fowldom96: cant use generics like that
00:32:42rgrinbergha to me it's ugly because of "auto" which is a c++ ism
00:33:56dom96interesting, it doesn't work when assigned to a var
00:34:02dom96but works otherwise
01:03:59dom96'night
01:25:53*fowl quit (Ping timeout: 248 seconds)
01:37:31*fowl joined #nimrod
01:51:06*Trix[a]r_za is now known as Trixar_za
02:16:13reactormonkcstrigns may be stack-based, right?
02:17:17fowlvar data: array[0.. <32, char]; var stackCstr = data[0].addr
02:17:30reactormonkI'm talking about the type cstring
02:17:37fowlthat is cstring
02:17:40fowl*char
02:17:49reactormonkcome again?
02:17:59fowler char *
02:18:09reactormonkwrite out the full stuff
02:18:16fowlpointer to char?
02:18:38reactormonkso cstrings may be at most 32 chars?
02:18:42fowlyou know, like a string, in c, a cstring, a pointer to a character, ended with '\0'
02:18:55fowlno, but that one is
02:24:52reactormonkfowl, so it may be both?
02:25:07fowlmay be both what
02:29:03reactormonkheap & stack
02:30:56*q66 quit (Remote host closed the connection)
02:31:18fowla cstring is c's string (char *) so its just a pointer to a character
02:31:28fowlthe only difference is, is the pointer to the heap or stack
02:34:17fowlhttps://gist.github.com/fowlmouth/31d90fcc21decc03c3af
02:38:00rgrinbergfowl: that's interesting syntax var data: array[0.. <32, char]
02:38:07rgrinbergis that like in ada?
02:38:26rgrinbergso nimrod has these runtime checks?
02:39:40fowlrgrinberg: im not familiar with ada, i think its inspired by pascal though which uses a syntax like "array[0..5] of integer"
02:40:05rgrinbergbut it is a runtime check basically?
02:40:33reactormonkrgrinberg, compiletime as well, if possible
02:40:46fowlno arrays are statically sized so bounds checking is done at compiletime
02:41:07fowltheres a check at runtime too
02:41:31fowlecho dat[10] ##compiletime check
02:41:38fowlvar = 10; echo dat[i] ##runtime check
02:45:23fowler what reactormonk said^
03:07:42rgrinbergI see that's what i suspected
03:10:26reactormonkrgrinberg, what would you do? typecheck integer ranges?
03:27:57*ARCADIVS joined #nimrod
03:48:05rgrinbergreactormonk: no im aware its impossible to typecheck that without dependent types
03:48:57rgrinbergi always liked runtime checks actually
03:49:29rgrinbergbut puritanical languages like haskell or ml would never have them
04:04:31*OrionPK quit (Quit: Leaving)
04:24:01*fowl quit (Ping timeout: 248 seconds)
04:29:05reactormonkof those, which are heap-based: range, array, openarray, varargs, set? range seems to be just two ints and some more, sets bitsets, which doesn't need a heap, same for array - but what about openarray and varargs?
04:37:21*fowl joined #nimrod
05:09:55*amarsahinovic joined #nimrod
05:28:45*amarsahinovic quit (Quit: Leaving.)
05:46:28*Endeg quit (Ping timeout: 256 seconds)
06:12:29*amarsahinovic joined #nimrod
06:13:59*amarsahinovic quit (Client Quit)
06:15:03*amarsahinovic joined #nimrod
06:23:14*Endeg joined #nimrod
06:28:53*XAMPP quit (Ping timeout: 245 seconds)
07:03:16*amarsahinovic quit (Quit: Leaving.)
07:19:50*amarsahinovic joined #nimrod
07:28:40*Araq_ joined #nimrod
08:05:43*Trixar_za is now known as Trix[a]r_za
08:14:47*fowl quit (Quit: Leaving)
08:22:26*Araq_ quit (Read error: Connection timed out)
08:23:54*Araq_ joined #nimrod
08:43:47*Araq_ quit (Read error: Connection timed out)
08:45:54*Araq_ joined #nimrod
10:24:36*q66 joined #nimrod
11:16:36zahary_Araq, btw, what's wrong with macros.quote? I can see that you and fowl suggested that it's broken, but didn't mention hoiw
11:36:02*ARCADIVS quit (Quit: WeeChat 0.3.8)
11:38:58dom96zahary_: I think it generates an incorrect AST.
11:42:18zahary_not as far as I know. do you have an example?
11:50:01dom96Here is the example fowl came up with: https://gist.github.com/fowlmouth/5605720
11:50:08dom96I'm not sure if Araq fixed it
11:54:02*amarsahinovic left #nimrod (#nimrod)
12:03:47zahary_so, the complaint is that quoted blocks don't produce a raw AST and are subjected to the symbol binding rules of hygienic templates. it's easy to add a flag to quote that controls the dirty-ness of the block
12:08:41dom96Also, I think you should put the 'quote' example into a .. code-block:: nimrod
13:17:46*Trix[a]r_za is now known as Trixar_za
15:15:14*Endy joined #nimrod
16:09:56AraqRaynes: the original plan was to have 'proc' for "procedure" which is in fact quite different from a mathematical function (it can have side effects for a start) and to use 'func' for a proc without side effects; however, the more fine granular effect system makes this quite questionable
16:10:30Araqbtw "procedure" was the common term before the Unix guys decided to name it "function" for C :P
16:11:55Araqand btw Python uses "def" for "define function" but "class" for "define class". I fail to see how this is any better than Nimrod's way of naming things
16:15:54*Trixar_za is now known as Trix[a]r_za
16:32:10rgrinbergAraq: so func should be used for pure functions and proc for everything else?
16:36:57*Araq_ quit (Read error: Operation timed out)
16:37:54*Araq_ joined #nimrod
16:42:12*Reisen is now known as Reiser
16:51:18*fowl joined #nimrod
16:57:55*Araq_ quit (Read error: Connection timed out)
16:58:57*Araq_ joined #nimrod
17:04:58Araqrgrinberg: that was the plan, but there is no "func" keyword in Nimrod :P
17:08:01apotheonI think Ruby might have gone with def in part because using meth as your method definition keyword is kinda sketchy.
17:08:48Araqreactormonk: varargs and openarray are not heap allocated either, only string/seq/ref are and the language definition would allow for only 'ref'
17:10:07reactormonkAraq, "and the language definition would allow for only 'ref'" <-?
17:10:56apotheonPython might have gone with def because while it has both functions (well, technically procedures) and methods, it's more context that determines which you've defined than any semantic conditions for which a separate keyword is needed.
17:11:03apotheonI think.
17:11:26apotheon. . . plus, y'know, "proc" and "meth" still has the whole "Did they really name that after methamphetamines?" problem.
17:11:54apotheonAraq: For the record, I think your use of proc is a good choice, by the way.
17:20:47*Araq_ quit (Read error: Connection timed out)
17:21:22Araqreactormonk: yeah but for now strings and seqs are allocated on the GC'ed heap
17:21:53*Araq_ joined #nimrod
17:24:22reactormonkAraq, ah, you can only have reffed seqences
17:24:55Araqno?
17:25:10reactormonkthen I didn't understand what you were saying.
17:31:18Araqmeh, it's not that important
17:35:19Araqzahary_: "expandToAst" has the same problem as "quote" ... it's weird to perform semantic checking on the resulting trees
17:38:59reactormonkAraq, range?
17:39:36Araqa range is a subtype of a float or an ordinal type
17:39:44Araqso no heap either
17:40:32*Araq_ quit (Read error: Connection timed out)
17:41:26reactormonkslice?
17:41:45Araqno heap
17:41:49reactormonkfigured so
17:41:55*Araq_ joined #nimrod
17:43:40reactormonkwhen defined(NimString):
17:43:43reactormonk # we are in system module:
17:43:45reactormonk?
17:45:41*Araq_ quit (Client Quit)
17:46:33reactormonkthat's not gonna work anymore.
17:47:04Araqreactormonk: http://en.wikipedia.org/wiki/Kludge
17:47:23reactormonkfigured so
17:48:20reactormonkany way I can define an immutable `string` type?
17:48:52Araqnot really, you can use 'const s = "abc"'
17:48:58Araqbut keep asking that question
17:49:44AraqI'm sure the answer will keep surprising you
17:50:28reactormonkWell, I have the restriction that I can only allocate const strings.
17:51:03AraqNimrod's const strings are translated to C's const
18:02:42reactormonkAraq, not enough. looks like I'll construct my own type flashString = distinct string {.progmem.} and disable any modification operations. Can I make that the default string literal?
19:00:55*Endy quit (Ping timeout: 260 seconds)
19:15:08RaynesAraq: I explicitly noted that I think Nimrod's naming scheme is fine.
19:15:17Raynes:)
19:35:42*apotheon_ joined #nimrod
19:41:51*Trixar_zb joined #nimrod
19:42:44*Trix[a]r_za quit (*.net *.split)
19:42:45*apotheon quit (*.net *.split)
19:44:33reactormonkAraq, I see, string_literal does some copying
19:46:06reactormonkno string literals on arduino then. Sad story.
19:51:05Araq?
19:52:53reactormonkhm, wait
19:53:05reactormonkF("string literal") in C puts it into the flash
19:53:26reactormonkbut it has to be a literal.
19:53:44RaynesAraq: So Nimrod has a concept of a pure function that is enforced, or that was an idea at some point?
19:54:57fowlRaynes: see the effect system http://build.nimrod-code.org/docs/manual.html#effect-system
19:56:23RaynesI'm a little hung over. What should I be looking at specifically here?
19:56:39reactormonkRaynes, a function without effects is a pure function.
19:56:48RaynesYes.
19:58:00RaynesBut it was implied there might be a way to enforce that, which is apparently related to this effects system, but this appears to be about exception handling.
19:59:59*apotheon_ is now known as apotheon
19:59:59*apotheon quit (Changing host)
19:59:59*apotheon joined #nimrod
20:01:23reactormonkAraq, how far down do I have to hack to get nimrod string represented that way in C code?
20:04:05AraqRaynes: Nimrod has the {.noSideEffect.} stuff since forever; new is the 'raises' and 'tags' stuff; the tags in particular distinguish between Read and Write IO operations
20:06:56Araqit was planned that 'func f()' would be shortcut for 'proc f() {.noSideEffect.}' but I don't consider that syntactic sugar essential anymore
20:17:32RaynesAraq: Got it. Thanks for clarifying.
20:19:41vegaiaw, that would've been a nifty sugar
20:20:07Araqha, I knew it
20:20:14vegai:P
20:20:19Araqkeep bothering me about it and you'll get it :P
20:20:43vegaishouldn't be a difficult addition, if it's merely sugar
20:21:14vegai... one would imagine
20:21:15fowlvegai: there are enough keywords as it is
20:21:17RaynesI'm a fan of less sugar.
20:21:19vegaitrue
20:21:36RaynesBut I'm a Lisper, so...
20:21:45RaynesI'd be a fan of more parentheses and no syntax. :D
20:30:45fowlthere is a backend for adding new syntaxes
20:30:45*amarsahinovic joined #nimrod
20:31:32fowlNimrod/compiler/syntaxes.nim
20:58:39*gradha joined #nimrod
21:11:36dom96amarsahinovic: I was looking into the FrameworkBenchmarks repo and i'm not entirely sure how to actually introduce a new language to it. Also the procedure on how to use nginx with my framework isn't documented, would you perhaps be able to give me some pointers?
21:14:48RaynesHi dom96.
21:15:04dom96hi Raynes
21:16:07amarsahinovicI just recently added a beego framework, I did that by copying web.go version, and changing the code in hello.go, this is my pull request content https://github.com/amarsahinovic/FrameworkBenchmarks/commit/48eb8b648a7986528b6298e917f801d69621d7d2
21:16:16amarsahinovicyou can see what files I modified
21:16:33amarsahinovichttps://github.com/amarsahinovic/FrameworkBenchmarks/#adding-frameworks also check this
21:16:59amarsahinovicyou need to set up benchmark_config file and set url, server port
21:17:55amarsahinovicthey use setup.py file for starting the processes (which calls setup.by on windows if that is important for you)
21:18:25amarsahinovicbasically, in go case, it gets the beego package with "go get" command, compiles and runs the binary
21:18:26dom96amarsahinovic: Yeah, already looked at that. It seems to focus mainly on frameworks and doesn't give any help at all on how to add a language.
21:19:47dom96I believe that installer.py file would need to be edited to add Nimrod support. But yeah, another issue is i'm not sure what nginx.conf file I should create.
21:20:17dom96The ones present in the repo seem to use unix file sockets to communicate with the web apps.
21:22:00dom96Maybe I should just ask on their Google Groups thing.
21:22:05amarsahinovicwell, I did not create a nginx.conf file, I assume they read the port form benchmark_config file and forward the requests to that, and as for the Nimrod support, I assume they will have to install the compiler on the server, just as they installed go/java/python compilers and interpreters
21:24:39amarsahinovicbasically all i did is write the go code, wrote a command to compile and run it from setup.py, and set the correct port and url in benchmark_config, that was enough to merge the pull request, but you should probably ask, it cant hurt :)
21:25:04dom96Yeah, writing a post now.
21:25:39amarsahinovicyou can probably get a long way with replacing "go run hello.go" with "nimrod c -r hello.nim" in setup.py or setup.bat if it runs on windows
21:43:02*amarsahinovic left #nimrod (#nimrod)
21:46:11gradharip tools/sunset.tmpl
21:52:46gradhahey, dom96, you frequent D newsgroups too? http://www.reddit.com/r/programming/comments/1epf5s/nimrod_092_released/ca38986
21:53:28dom96haha. Sadly, I can take no credit for that.
21:54:53Rayneshttps://thestrangeloop.com/preconf
21:55:01Raynes"Dao programming language for scripting and computing"
21:55:11RaynesHoly shit, a programming language for computing? Mind blowing.
21:55:54gradhaI use nimrod to trim my garden
21:57:01*OrionPK joined #nimrod
22:00:59AraqI need to reply to that guy
22:02:17AraqI find it quite annoying, I made like 10 posts per 5 months in their D forum
22:02:43gradhathat's a good thing, it means you made an everlasting impression on them
22:03:04Araqone which contains a solution for a memory safety problem that both D and Nimrod share.
22:03:23Araqof course this post was ignored until they later figured out the very same solution at the D conference
22:03:31RaynesDoes Nimrod have a REPL?
22:03:42fowlnimrod -i
22:04:57fowlor nimrod i
22:05:08fowl^
22:06:22RaynesLooks like the homebrew formula for nimrod is broken.
22:11:34fowlAraq: i dont know what to make of this error https://gist.github.com/fowlmouth/09a23a18e4f6b9706603 :/
22:17:06Araqproc newBBtree* (T: typedesc) : TBB_Tree[T] # looks suspicious
22:17:11Araqmake that
22:17:20Araqproc newBBtree*[T]: TBB_Tree[T]
22:17:48fowlstill errors
22:18:08fowlupdated it
22:21:44Araqwell uncomment the insert tree call then in line 122
22:21:48Araq*comment
22:22:05fowlthen it compiles
22:23:49Araqline 113: insertLeaf[T](tree, leaf) --> insertLeaf(tree, leaf) ?
22:24:25Araqsame for insertSubTree in line 91
22:24:40Araq(of course do report a bug anyway)
22:26:54Araq while(; n = n.parent; not n.isNil): refit # gah, wish this wouldn't be allowed :P
22:27:38fowlthat should work right? :)
22:28:20AraqI think so but never tested it
22:28:41fowlwhile(; inc i; i < 100): echo i
22:28:42fowlworks
22:29:16Araqthat wasn't my intention when I designed the feature :P
22:30:18fowli guess it does make more sense to do while not n.isNil: refit; n = n.parent
22:30:36Araqthat is not the same
22:30:47Araqyou need an intial n = n.parent then
22:30:58fowlno because there's a refit before the loop
22:32:08Araqwhat does that have to do with anything?
22:32:27Araqoh never mind, got it
22:44:48*gradha quit (Quit: bbl, have youtube videos to watch)
22:48:42*Zor quit (Remote host closed the connection)
22:51:34*alexrp joined #nimrod
22:51:58*alexrp is now known as Zor
23:00:09fowli thought i fixed it by taking the parent arg from newBBnode() but it only fixed one error
23:04:06NimBotnimrod-code/nimbuild 2441937 Dominik Picheta [+0 ±1 -0]: Builder: Added -dx flags to the 'git clean' command.
23:13:18NimBotnimrod-code/nimbuild 0f46e76 Dominik Picheta [+0 ±1 -0]: Builder: Clean only build/ dir, executes build.sh from csources.zip now.
23:30:36*Trixar_zb is now known as Trixar_za
23:55:54*fowl quit (Ping timeout: 264 seconds)