00:06:23 | * | Trixar_za is now known as Trix[a]r_za |
00:28:00 | rgrinberg | fowl: the type annotations are optional i assume? |
00:30:22 | fowl | optional where they can be inferred, ie var x = someFunc() |
00:31:16 | rgrinberg | what is the type of + then? |
00:31:18 | dom96 | I believe you can have: var myfunc = proc(a, b): auto = a + b |
00:31:59 | rgrinberg | dom96: ya that looks better but it's a little ugly |
00:32:17 | rgrinberg | what is the inferred type for myfunc? |
00:32:21 | dom96 | rgrinberg: Better syntax for closures is planned ;) |
00:32:40 | fowl | dom96: cant use generics like that |
00:32:42 | rgrinberg | ha to me it's ugly because of "auto" which is a c++ ism |
00:33:56 | dom96 | interesting, it doesn't work when assigned to a var |
00:34:02 | dom96 | but works otherwise |
01:03:59 | dom96 | '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:13 | reactormonk | cstrigns may be stack-based, right? |
02:17:17 | fowl | var data: array[0.. <32, char]; var stackCstr = data[0].addr |
02:17:30 | reactormonk | I'm talking about the type cstring |
02:17:37 | fowl | that is cstring |
02:17:40 | fowl | *char |
02:17:49 | reactormonk | come again? |
02:17:59 | fowl | er char * |
02:18:09 | reactormonk | write out the full stuff |
02:18:16 | fowl | pointer to char? |
02:18:38 | reactormonk | so cstrings may be at most 32 chars? |
02:18:42 | fowl | you know, like a string, in c, a cstring, a pointer to a character, ended with '\0' |
02:18:55 | fowl | no, but that one is |
02:24:52 | reactormonk | fowl, so it may be both? |
02:25:07 | fowl | may be both what |
02:29:03 | reactormonk | heap & stack |
02:30:56 | * | q66 quit (Remote host closed the connection) |
02:31:18 | fowl | a cstring is c's string (char *) so its just a pointer to a character |
02:31:28 | fowl | the only difference is, is the pointer to the heap or stack |
02:34:17 | fowl | https://gist.github.com/fowlmouth/31d90fcc21decc03c3af |
02:38:00 | rgrinberg | fowl: that's interesting syntax var data: array[0.. <32, char] |
02:38:07 | rgrinberg | is that like in ada? |
02:38:26 | rgrinberg | so nimrod has these runtime checks? |
02:39:40 | fowl | rgrinberg: im not familiar with ada, i think its inspired by pascal though which uses a syntax like "array[0..5] of integer" |
02:40:05 | rgrinberg | but it is a runtime check basically? |
02:40:33 | reactormonk | rgrinberg, compiletime as well, if possible |
02:40:46 | fowl | no arrays are statically sized so bounds checking is done at compiletime |
02:41:07 | fowl | theres a check at runtime too |
02:41:31 | fowl | echo dat[10] ##compiletime check |
02:41:38 | fowl | var = 10; echo dat[i] ##runtime check |
02:45:23 | fowl | er what reactormonk said^ |
03:07:42 | rgrinberg | I see that's what i suspected |
03:10:26 | reactormonk | rgrinberg, what would you do? typecheck integer ranges? |
03:27:57 | * | ARCADIVS joined #nimrod |
03:48:05 | rgrinberg | reactormonk: no im aware its impossible to typecheck that without dependent types |
03:48:57 | rgrinberg | i always liked runtime checks actually |
03:49:29 | rgrinberg | but 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:05 | reactormonk | of 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:36 | zahary_ | 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:58 | dom96 | zahary_: I think it generates an incorrect AST. |
11:42:18 | zahary_ | not as far as I know. do you have an example? |
11:50:01 | dom96 | Here is the example fowl came up with: https://gist.github.com/fowlmouth/5605720 |
11:50:08 | dom96 | I'm not sure if Araq fixed it |
11:54:02 | * | amarsahinovic left #nimrod (#nimrod) |
12:03:47 | zahary_ | 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:41 | dom96 | Also, 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:56 | Araq | Raynes: 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:30 | Araq | btw "procedure" was the common term before the Unix guys decided to name it "function" for C :P |
16:11:55 | Araq | and 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:10 | rgrinberg | Araq: 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:58 | Araq | rgrinberg: that was the plan, but there is no "func" keyword in Nimrod :P |
17:08:01 | apotheon | I think Ruby might have gone with def in part because using meth as your method definition keyword is kinda sketchy. |
17:08:48 | Araq | reactormonk: varargs and openarray are not heap allocated either, only string/seq/ref are and the language definition would allow for only 'ref' |
17:10:07 | reactormonk | Araq, "and the language definition would allow for only 'ref'" <-? |
17:10:56 | apotheon | Python 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:03 | apotheon | I think. |
17:11:26 | apotheon | . . . plus, y'know, "proc" and "meth" still has the whole "Did they really name that after methamphetamines?" problem. |
17:11:54 | apotheon | Araq: 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:22 | Araq | reactormonk: yeah but for now strings and seqs are allocated on the GC'ed heap |
17:21:53 | * | Araq_ joined #nimrod |
17:24:22 | reactormonk | Araq, ah, you can only have reffed seqences |
17:24:55 | Araq | no? |
17:25:10 | reactormonk | then I didn't understand what you were saying. |
17:31:18 | Araq | meh, it's not that important |
17:35:19 | Araq | zahary_: "expandToAst" has the same problem as "quote" ... it's weird to perform semantic checking on the resulting trees |
17:38:59 | reactormonk | Araq, range? |
17:39:36 | Araq | a range is a subtype of a float or an ordinal type |
17:39:44 | Araq | so no heap either |
17:40:32 | * | Araq_ quit (Read error: Connection timed out) |
17:41:26 | reactormonk | slice? |
17:41:45 | Araq | no heap |
17:41:49 | reactormonk | figured so |
17:41:55 | * | Araq_ joined #nimrod |
17:43:40 | reactormonk | when defined(NimString): |
17:43:43 | reactormonk | # we are in system module: |
17:43:45 | reactormonk | ? |
17:45:41 | * | Araq_ quit (Client Quit) |
17:46:33 | reactormonk | that's not gonna work anymore. |
17:47:04 | Araq | reactormonk: http://en.wikipedia.org/wiki/Kludge |
17:47:23 | reactormonk | figured so |
17:48:20 | reactormonk | any way I can define an immutable `string` type? |
17:48:52 | Araq | not really, you can use 'const s = "abc"' |
17:48:58 | Araq | but keep asking that question |
17:49:44 | Araq | I'm sure the answer will keep surprising you |
17:50:28 | reactormonk | Well, I have the restriction that I can only allocate const strings. |
17:51:03 | Araq | Nimrod's const strings are translated to C's const |
18:02:42 | reactormonk | Araq, 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:08 | Raynes | Araq: I explicitly noted that I think Nimrod's naming scheme is fine. |
19:15:17 | Raynes | :) |
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:33 | reactormonk | Araq, I see, string_literal does some copying |
19:46:06 | reactormonk | no string literals on arduino then. Sad story. |
19:51:05 | Araq | ? |
19:52:53 | reactormonk | hm, wait |
19:53:05 | reactormonk | F("string literal") in C puts it into the flash |
19:53:26 | reactormonk | but it has to be a literal. |
19:53:44 | Raynes | Araq: So Nimrod has a concept of a pure function that is enforced, or that was an idea at some point? |
19:54:57 | fowl | Raynes: see the effect system http://build.nimrod-code.org/docs/manual.html#effect-system |
19:56:23 | Raynes | I'm a little hung over. What should I be looking at specifically here? |
19:56:39 | reactormonk | Raynes, a function without effects is a pure function. |
19:56:48 | Raynes | Yes. |
19:58:00 | Raynes | But 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:23 | reactormonk | Araq, how far down do I have to hack to get nimrod string represented that way in C code? |
20:04:05 | Araq | Raynes: 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:56 | Araq | it was planned that 'func f()' would be shortcut for 'proc f() {.noSideEffect.}' but I don't consider that syntactic sugar essential anymore |
20:17:32 | Raynes | Araq: Got it. Thanks for clarifying. |
20:19:41 | vegai | aw, that would've been a nifty sugar |
20:20:07 | Araq | ha, I knew it |
20:20:14 | vegai | :P |
20:20:19 | Araq | keep bothering me about it and you'll get it :P |
20:20:43 | vegai | shouldn't be a difficult addition, if it's merely sugar |
20:21:14 | vegai | ... one would imagine |
20:21:15 | fowl | vegai: there are enough keywords as it is |
20:21:17 | Raynes | I'm a fan of less sugar. |
20:21:19 | vegai | true |
20:21:36 | Raynes | But I'm a Lisper, so... |
20:21:45 | Raynes | I'd be a fan of more parentheses and no syntax. :D |
20:30:45 | fowl | there is a backend for adding new syntaxes |
20:30:45 | * | amarsahinovic joined #nimrod |
20:31:32 | fowl | Nimrod/compiler/syntaxes.nim |
20:58:39 | * | gradha joined #nimrod |
21:11:36 | dom96 | amarsahinovic: 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:48 | Raynes | Hi dom96. |
21:15:04 | dom96 | hi Raynes |
21:16:07 | amarsahinovic | I 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:16 | amarsahinovic | you can see what files I modified |
21:16:33 | amarsahinovic | https://github.com/amarsahinovic/FrameworkBenchmarks/#adding-frameworks also check this |
21:16:59 | amarsahinovic | you need to set up benchmark_config file and set url, server port |
21:17:55 | amarsahinovic | they use setup.py file for starting the processes (which calls setup.by on windows if that is important for you) |
21:18:25 | amarsahinovic | basically, in go case, it gets the beego package with "go get" command, compiles and runs the binary |
21:18:26 | dom96 | amarsahinovic: 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:47 | dom96 | I 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:17 | dom96 | The ones present in the repo seem to use unix file sockets to communicate with the web apps. |
21:22:00 | dom96 | Maybe I should just ask on their Google Groups thing. |
21:22:05 | amarsahinovic | well, 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:39 | amarsahinovic | basically 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:04 | dom96 | Yeah, writing a post now. |
21:25:39 | amarsahinovic | you 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:11 | gradha | rip tools/sunset.tmpl |
21:52:46 | gradha | hey, dom96, you frequent D newsgroups too? http://www.reddit.com/r/programming/comments/1epf5s/nimrod_092_released/ca38986 |
21:53:28 | dom96 | haha. Sadly, I can take no credit for that. |
21:54:53 | Raynes | https://thestrangeloop.com/preconf |
21:55:01 | Raynes | "Dao programming language for scripting and computing" |
21:55:11 | Raynes | Holy shit, a programming language for computing? Mind blowing. |
21:55:54 | gradha | I use nimrod to trim my garden |
21:57:01 | * | OrionPK joined #nimrod |
22:00:59 | Araq | I need to reply to that guy |
22:02:17 | Araq | I find it quite annoying, I made like 10 posts per 5 months in their D forum |
22:02:43 | gradha | that's a good thing, it means you made an everlasting impression on them |
22:03:04 | Araq | one which contains a solution for a memory safety problem that both D and Nimrod share. |
22:03:23 | Araq | of course this post was ignored until they later figured out the very same solution at the D conference |
22:03:31 | Raynes | Does Nimrod have a REPL? |
22:03:42 | fowl | nimrod -i |
22:04:57 | fowl | or nimrod i |
22:05:08 | fowl | ^ |
22:06:22 | Raynes | Looks like the homebrew formula for nimrod is broken. |
22:11:34 | fowl | Araq: i dont know what to make of this error https://gist.github.com/fowlmouth/09a23a18e4f6b9706603 :/ |
22:17:06 | Araq | proc newBBtree* (T: typedesc) : TBB_Tree[T] # looks suspicious |
22:17:11 | Araq | make that |
22:17:20 | Araq | proc newBBtree*[T]: TBB_Tree[T] |
22:17:48 | fowl | still errors |
22:18:08 | fowl | updated it |
22:21:44 | Araq | well uncomment the insert tree call then in line 122 |
22:21:48 | Araq | *comment |
22:22:05 | fowl | then it compiles |
22:23:49 | Araq | line 113: insertLeaf[T](tree, leaf) --> insertLeaf(tree, leaf) ? |
22:24:25 | Araq | same for insertSubTree in line 91 |
22:24:40 | Araq | (of course do report a bug anyway) |
22:26:54 | Araq | while(; n = n.parent; not n.isNil): refit # gah, wish this wouldn't be allowed :P |
22:27:38 | fowl | that should work right? :) |
22:28:20 | Araq | I think so but never tested it |
22:28:41 | fowl | while(; inc i; i < 100): echo i |
22:28:42 | fowl | works |
22:29:16 | Araq | that wasn't my intention when I designed the feature :P |
22:30:18 | fowl | i guess it does make more sense to do while not n.isNil: refit; n = n.parent |
22:30:36 | Araq | that is not the same |
22:30:47 | Araq | you need an intial n = n.parent then |
22:30:58 | fowl | no because there's a refit before the loop |
22:32:08 | Araq | what does that have to do with anything? |
22:32:27 | Araq | oh 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:09 | fowl | i thought i fixed it by taking the parent arg from newBBnode() but it only fixed one error |
23:04:06 | NimBot | nimrod-code/nimbuild 2441937 Dominik Picheta [+0 ±1 -0]: Builder: Added -dx flags to the 'git clean' command. |
23:13:18 | NimBot | nimrod-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) |