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:17 | Araq | hey dom96 |
14:54:20 | Araq | I'm back :-) |
14:54:24 | dom96 | Good. |
14:54:33 | * | dom96 is fighting with his new graphics card |
14:55:08 | Araq | I'm glad you couldn't be bothered to actually make aporia compile all these days |
14:55:14 | Araq | so we got bug #193 |
14:55:17 | Araq | thanks |
15:00:41 | * | zahary quit (Quit: Leaving.) |
15:01:41 | * | zahary joined #nimrod |
15:08:47 | Araq | ping zahary |
15:09:21 | Araq | well dom96 I made macros use the same parameter passing mechanism as templates |
15:09:31 | dom96 | cool |
15:09:34 | Araq | overloading ': stmt' still is not implemented :P |
15:09:55 | Araq | and 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:09 | reactormonk | Araq: term rewriting? |
16:19:11 | Araq | reactormonk: we've talked about this before |
16:19:25 | Araq | it's a way to introduce user defined optimizations |
16:19:29 | Araq | x+0 --> x |
16:23:43 | reactormonk | nice |
16:31:55 | * | shevy2 joined #nimrod |
16:32:54 | * | shevy quit (Read error: Operation timed out) |
17:05:34 | Araq | ping dom96 |
17:05:51 | Araq | I'm having a hard time designing the syntax for the pattern matching feature |
17:06:01 | Araq | currently it's like this: |
17:06:13 | Araq | template optZero(x: int): int = |
17:06:14 | Araq | as: |
17:06:16 | Araq | x+0 |
17:06:17 | Araq | x |
17:06:19 | dom96 | Pong :) |
17:06:30 | Araq | it used to be: |
17:06:41 | Araq | template {x+0} (x: int): int = x |
17:06:58 | Araq | but that's more work to implement :P |
17:07:13 | Araq | plus I dislike that you can't really name that transformation then anymore |
17:07:30 | Araq | and I know have other plans with the curlies in that position |
17:07:50 | dom96 | What's wrong with the current syntax then? |
17:08:00 | Araq | well, do you like it? |
17:08:16 | dom96 | Sure. |
17:08:19 | Araq | cool |
17:08:31 | Araq | I'd prefer a "pattern" keyword instead of "as" |
17:08:39 | Araq | but I figured "as" is already a keyword |
17:08:47 | Araq | and pattern is too useful to become a keyword |
17:09:03 | dom96 | Well. Maybe we could use the pipe character :p |
17:10:40 | dom96 | i.e. | |
17:12:46 | Araq | no |
17:12:53 | Araq | it *has* to be a keyword :P |
17:13:01 | Araq | or in a special position like instead of the name |
17:13:02 | dom96 | how about "match"? |
17:13:21 | Araq | too useful too |
17:13:33 | Araq | it's after all, a rarely used feature |
17:13:38 | Araq | well it'd better be |
17:13:57 | Araq | because it bloats compilation times |
17:14:13 | dom96 | "optmatch" |
17:14:15 | dom96 | ? |
17:14:23 | Araq | "astex" ? |
17:14:29 | Araq | instead of "regex"? |
17:14:35 | Araq | because that's what it is |
17:14:40 | fowl | =^_^= |
17:14:55 | fowl | use that as the keyword^^ :> |
17:15:09 | dom96 | go with "astecs" heh |
17:15:27 | Araq | nah, "as" is good enough for 0.9.0 |
17:15:28 | dom96 | nah, in all seriousness "astex" sounds good. |
17:15:37 | dom96 | No. |
17:15:42 | dom96 | Don't use "as" |
17:15:45 | Araq | lol |
17:15:48 | dom96 | Please :P |
17:15:50 | Araq | you said you liked it :P |
17:16:08 | dom96 | Well I was empowered by emotions of getting my graphics card to kind of work :P |
17:16:14 | dom96 | I changed my mind. |
17:16:17 | * | zahary quit (Ping timeout: 245 seconds) |
17:16:22 | Araq | ugh, I knew it |
17:16:36 | Araq | your opinion can't be trusted :P |
17:16:41 | dom96 | lol |
17:16:52 | Araq | so, fowl; what's your (serious) opinion? |
17:18:24 | fowl | i dont know what use term rewriting macros are |
17:18:27 | dom96 | Araq: Will it always be single lines, or can you have blocks of code? |
17:18:32 | Araq | I also played with "as in" and "written as" |
17:18:40 | Araq | dom96: blocks of code are possible too :D |
17:18:54 | fowl | i would use `as` for something else, like `cint as bool` could be the equiv of bool32 |
17:19:05 | dom96 | yeah, I agree with fowl |
17:19:13 | Araq | that's not prohibited by that at all :P |
17:19:29 | Araq | I want "cint as bool" too so I ensured it's still possible |
17:20:27 | Araq | fowl: best use case: everything where in C++ you'd use a template tree |
17:20:43 | dom96 | "as" doesn't really seem to mean anything in that context. It's meant to be a shortened version of "astex" right? |
17:21:22 | Araq | er "expression template" it's called in C++ |
17:21:40 | Araq | it's a shorthand of "written as" or "as in" |
17:21:43 | Araq | template t() = |
17:21:45 | Araq | as in: |
17:21:47 | Araq | x + 0 |
17:24:18 | Araq | but nimrod doesn't use <keyword> <keyword> anywhere else |
17:24:40 | Araq | well we could of course use "as_in" or "written_as" as keywords |
17:36:06 | Araq | well? |
17:36:15 | Araq | any opinions? |
17:43:42 | * | zahary joined #nimrod |
17:51:25 | dom96 | I still prefer "astex" |
17:51:40 | dom96 | Also, cameCase is the convention in Nimrod, no? :P |
17:51:44 | dom96 | *camelCase |
17:51:51 | dom96 | So that would be "asIn" |
17:51:58 | Araq | whatever |
17:52:00 | fowl | I like match/with block in the same for as case/of |
17:52:10 | fowl | form* |
17:52:12 | dom96 | I like "optmatch" or "astmatch" |
17:56:23 | Araq | fowl: what? |
17:56:33 | Araq | match x+0 |
17:56:37 | Araq | with x |
17:56:38 | Araq | ? |
17:57:05 | Araq | neither optmatch nor astmatch are good enough as keywords ... |
17:57:10 | fowl | i dunno, why would you do something + 0 anyways |
17:58:39 | Araq | as: |
17:58:51 | Araq | x = x.substr(0, 4) |
17:59:04 | Araq | x.setlen(5) |
17:59:07 | Araq | :P |
17:59:29 | Araq | the +0 is simply the easiest example I came up with |
18:02:09 | Araq | oh well, I'll implement the original syntax I guess |
18:02:24 | Araq | it still makes the most sense anyway |
18:03:04 | Araq | it's kinda ugly for multiline patterns though |
18:03:19 | Araq | template { |
18:03:29 | Araq | write f, x |
18:03:32 | Araq | write f, y |
18:03:40 | Araq | }(f: TFile, x, y: expr) = |
18:03:45 | Araq | write f, x, y |
18:05:35 | fowl | i like that |
18:06:39 | Araq | I will also support |
18:06:53 | Araq | template name{pattern}(...) |
18:07:04 | Araq | so that it can be named |
18:10:16 | dom96 | how about that 'with'? |
18:10:20 | dom96 | At the end of the template |
18:10:23 | dom96 | hrm. |
18:10:33 | dom96 | or what about: |
18:10:45 | dom96 | template name() = |
18:10:55 | dom96 | optimizes: |
18:10:58 | dom96 | ... |
18:11:41 | Araq | template name{pattern} also reflects how the AST looks like |
18:12:03 | Araq | so I'm going with that syntax |
18:15:46 | dom96 | well alright] |
18:16:20 | fowl | is a full c++ wrapper possible |
18:17:04 | fowl | with inheritance |
18:19:32 | Araq | fowl: dunno, the compiler uses C++ inheritance mechanism if you make it generate C++ code |
18:21:52 | Araq | and 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:27 | Araq | dom96: aporia doesn't know 'static' is a keyword :-( |
20:11:01 | reactormonk | Araq: is there a way to get the keywords from nimrod? |
20:11:14 | Araq | doc/keywords.txt? |
20:11:56 | Araq | this means "no", but the docs are up to date |
20:14:13 | * | shevy2 is now known as shevy |
20:16:05 | dom96 | Araq: You know you have access to the repo too :P |
20:16:24 | Araq | dom96: yeah, so? |
20:16:34 | Araq | have you been adding keywords to the language? |
20:23:01 | Araq | hrm, I just realized ... this pattern matching feature allows to overload '=' as a side effect :-) |
20:24:16 | * | EfTwelve joined #nimrod |
20:24:29 | Araq | hi EfTwelve |
20:24:37 | EfTwelve | hi |
20:25:06 | dom96 | hello EfTwelve |
20:25:21 | EfTwelve | hello |
20:28:57 | Araq | template disallowIf{ |
20:28:59 | Araq | if cond: |
20:29:01 | Araq | action |
20:29:02 | Araq | }(cond: bool, action: stmt) {.error.} = action |
20:29:07 | Araq | if true: |
20:29:08 | Araq | echo "do it" |
20:29:18 | Araq | temp2.nim(24, 2) Error: usage of 'disallowIf' is a user-defined error |
20:29:23 | Araq | XD |
20:29:37 | dom96 | what 0_o |
20:29:46 | Araq | this stuff is like crack |
20:30:28 | Araq | you can redefine language constructs :P |
20:30:38 | dom96 | oh, I think I get it. |
20:30:46 | dom96 | Didn't notice the error pragma |
20:30:52 | dom96 | that's pretty damn cool |
20:31:34 | EfTwelve | sneaky |
20:32:18 | Araq | yeah, someday you will be glad you can turn it off easily with --patterns:off |
20:36:21 | EfTwelve | im just starting with nimrod. |
20:37:14 | EfTwelve | this seem strange, that there is an extra iteration. |
20:37:19 | EfTwelve | for i in 0..len("abcd"): echo((st1[i]),"!") |
20:37:25 | Araq | use: |
20:37:35 | Araq | for i in 0 .. <len("abcd") |
20:37:36 | EfTwelve | oops |
20:38:00 | Araq | otherwise it iterates over the terminating \0 too |
20:38:08 | Araq | which is unfortunate |
20:38:28 | Araq | for arrays/seqs you would have triggered an index out of bounds error |
20:38:36 | EfTwelve | very strange, len() is correnct, and the string is 0 based.. |
20:38:42 | EfTwelve | why the extra iter? |
20:38:55 | fowl | EfTwelve: the .. is inclusive, for i in 0..10: will print out 0-10 not 0-9 |
20:39:26 | EfTwelve | oh.. |
20:40:03 | Araq | strings are \0 terminated so that they can be passed to C without needing a concatenation |
20:40:59 | EfTwelve | i see. thanks |
20:42:45 | Araq | and I don't disallow accessing the \0 because it's incredibly handy for parsers |
20:45:40 | EfTwelve | btw: thanks for making the language case-insensitive. ;) |
20:46:03 | Araq | lol why? |
20:46:24 | EfTwelve | its a big peev of mine |
20:46:27 | Araq | I thought I was some incredibly stupid noob who has never written any serious software because of that feature |
20:47:05 | Araq | and I eat babies for lunch and deserve to burn in hell |
20:47:54 | Araq | ;-) |
20:47:56 | EfTwelve | you've got a lot of negative feedback? |
20:48:12 | fowl | reddit isnt an authority on.. anything |
20:50:15 | Araq | in fact, if I would do it again, I would make it case sensitive and make the compile enforce a naming scheme |
20:50:44 | Araq | and the naming scheme would piss off *everybody* :P |
20:50:50 | Araq | including myself |
20:52:02 | EfTwelve | well, at least put one checkmark in the pro:case-insensitive column from me. |
20:52:19 | Araq | alright ;-) |
20:53:14 | fowl | EfTwelve: what are your programming interests |
20:56:37 | EfTwelve | for work I financial related stuff futures,commodities etc, other half of the time is game dev. |
20:56:56 | EfTwelve | i *do .. |
20:59:12 | EfTwelve | i stumbled on the nimrod page while google searching AST's |
21:00:19 | fowl | i have a nimrod wrappers for sfml and chipmunk you might like :) |
21:02:09 | dom96 | Araq: Remind me to restart the Windows builder :P |
21:02:25 | Araq | -.- I did |
21:03:01 | Araq | we should find someone who has a windows server and is willing to deploy nimbuild |
21:04:17 | EfTwelve | sfml seems interesting, is the wrapper complete? and include all the raw opengl stuff? |
21:05:36 | Araq | oh btw, fowl, I broke all existing macros ;-) |
21:07:41 | dom96 | Araq: oh btw. The GCC farm now has all bsd versions available I think. |
21:08:08 | dom96 | So we won't be limited to netbsd anymore. |
21:08:15 | Araq | well FreeBSD should work |
21:08:31 | Araq | the bug apriori encountered wasn't bsd specific |
21:08:52 | Araq | maybe even netbsd works |
21:11:23 | dom96 | cool |
21:11:35 | dom96 | I really wish we had a better Windows server |
21:14:02 | Araq | fowl: do you happen to have any representative templates lying around? |
21:14:19 | * | Araq doesn't trust the examples he looked at |
21:17:47 | EfTwelve | does nimrod have a runtime rnd() function? |
21:18:06 | Araq | math.random |
21:18:28 | Araq | EfTwelve: are you using 0.8.14 or the github version? |
21:18:51 | EfTwelve | just grabbed the windows installer from the webpage |
21:19:11 | EfTwelve | 8.14 |
21:19:13 | Araq | http://nimrod-code.org/theindex.html |
21:19:15 | Araq | for 8.14 |
21:19:29 | Araq | and http://build.nimrod-code.org/docs/theindex.html for the github version |
21:23:05 | Araq | 0.8.14 is seriously outdated, but we're still not ready for 0.9.0 ... |
21:25:52 | EfTwelve | im just starting to learn the language, are there major syntax changes since 8.14? |
21:26:56 | Araq | there are a few but only minor stuff |
21:27:48 | Araq | templates and macros changed significantly, but not their syntax |
21:35:56 | EfTwelve | arrays 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:37 | Araq | well strings can't have a fixed size |
21:36:38 | EfTwelve | there is only 1 reference to arrays in the tutorial that I can see |
21:36:50 | EfTwelve | but an array of string.. |
21:37:02 | Araq | var myarray: array[0..3, string] # works |
21:37:11 | Araq | var myseq: seq[string] # works too |
21:37:32 | Araq | T[] is no array declaration |
21:37:51 | EfTwelve | hmm. did i miss that in the tutorial? |
21:38:08 | Araq | dunno the tutorial is pretty weak, I know |
22:20:51 | EfTwelve | the tutorial seems ambiguous about void functions. is {.discardable.} and a return type always required? |
22:21:26 | Araq | of course not |
22:23:08 | Araq | and the divmod example has no return type |
22:24:19 | Araq | ugh, dom96, binding of []= does not work due to a *cough* unforeseen interaction of features |
22:24:45 | dom96 | that's disappointing. |
22:25:26 | dom96 | Is it a lot of work to fix? |
22:25:41 | dom96 | Requiring an import of 'strtabs' for jester sucks. |
22:27:19 | Araq | well there is an easy workaround: |
22:27:42 | Araq | proc myput(s: PStringTable, key, value: string) = s[key] = value |
22:27:48 | Araq | bind myput |
22:28:17 | Araq | I could make it work but then you really need to invoke it like this: |
22:28:27 | Araq | `[]=`(s, k, v) |
22:30:37 | Araq | however, are you sure all that needs to be done via templates? |
22:30:51 | Araq | why can't you use procs again? |
22:31:57 | dom96 | Because then I don't have that nice `get "/": ...` syntax |
22:33:42 | reactormonk | aww |
22:33:47 | Araq | well I'm about to implement: |
22:33:54 | Araq | p(a): |
22:33:55 | Araq | b |
22:34:02 | Araq | as a shortcut for |
22:34:10 | Araq | p(a, proc () = b) |
22:34:20 | Araq | would that help? |
22:34:30 | reactormonk | Araq: welcome to ruby block syntax :D |
22:34:50 | dom96 | Araq: Perhaps |
22:35:00 | Araq | hey, I invented that syntax for templates myself :P |
22:35:11 | Araq | I only figured out ruby does the same |
22:35:13 | Araq | later |
22:35:26 | dom96 | Don't worry, Ruby isn't Apple and you're not Samsung :P |
22:38:05 | Araq | ugh is there actually an interesting talk of rich hickey? |
22:42:48 | Araq | ok, I will implement the shortcut and you try it out |
22:46:19 | EfTwelve | my first nimrod program. yay |
22:47:05 | EfTwelve | simple genetic algorithm for matching strings. https://gist.github.com/3543656 |
22:48:25 | Araq | cool |
22:48:44 | Araq | createpop doesn't need ':bool {.discardable.}' though |
22:49:30 | Araq | findbest could use the implicit 'result' variable |
22:50:43 | Araq | s = s & chr() # inefficient, better use |
22:50:45 | Araq | s.add(chr(...)) |
22:51:00 | Araq | and use the 'result' variable |
22:51:10 | Araq | newbies never use 'result' :P |
22:51:20 | EfTwelve | ahh.. i agree it's not very nimrod-y |
22:51:49 | dom96 | Araq: Does any other language have something like 'result'? |
22:52:06 | Araq | delphi and eiffel both have 'result' |
22:52:14 | Araq | Go has something similar |
22:52:27 | Araq | can't remember about modula 3 |
22:52:57 | dom96 | interesting |
22:53:53 | Araq | there are some other obscure programming languages that have it |
22:54:02 | Araq | but I can't remember |
22:54:06 | EfTwelve | im impressed by the speed nimrod |
22:54:30 | * | Boscop quit (Quit: Boscop) |
22:55:04 | Araq | compile times or runtime of your code? |
22:55:48 | EfTwelve | both |
22:56:09 | Araq | good :D |
22:56:23 | EfTwelve | runtime is impressive for how many string ops happening |
22:58:58 | EfTwelve | I think i might start porting some of my machine learning stuff to nimrod. |
22:59:12 | Araq | yay :D |
22:59:13 | EfTwelve | after i learn the language of course |
22:59:30 | Araq | it's still has its rough edges |
22:59:49 | Araq | so please ask for help here :-) |
23:00:03 | EfTwelve | i just found it today. im impressed! |
23:00:36 | EfTwelve | the tuts and examples are a little lacking, ill probably be coming here to bug you guys |
23:00:49 | Araq | that's good |
23:01:35 | Araq | and yes we know 0.8.14 can't compile 0.8.15 ;-) |
23:02:02 | Araq | it's always that way, latest stable release can't compile newer versions |
23:02:20 | Araq | development is too fast *cough* |
23:03:05 | * | Boscop joined #nimrod |
23:03:47 | EfTwelve | are there any examples anywhere of the threading/actors and dll creation? |
23:04:03 | EfTwelve | not those 2 together.. |
23:04:07 | Araq | threading works, actors are still quite broken |
23:04:15 | EfTwelve | examples of each, i mean |
23:04:44 | Araq | http://nimrod-code.org/nimrodc.html#dll-generation |
23:05:31 | Araq | thread examples are in the tests directory |
23:06:25 | Araq | I'd simply use multiple processes and a database though |
23:08:55 | Araq | EfTwelve: are you using windows? |
23:09:02 | EfTwelve | yes |
23:09:26 | Araq | I hope you stay around here then, we need a new windows testing machine :D |
23:09:55 | Araq | it only has to be online often enough to run the test suite |
23:10:20 | EfTwelve | ok |
23:14:45 | Araq | EfTwelve: check out aporia, a nimrod IDE written in nimrod |
23:15:02 | EfTwelve | ok, i will. |
23:15:10 | Araq | dunno if it currently works on windows |
23:15:14 | Araq | dom96? |
23:16:04 | dom96 | It does. Well, it's usable :P |
23:16:13 | EfTwelve | question: 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:28 | dom96 | Still has some rough edges that need to be worked out (mostly to do with launching aporia from explorer.exe) |
23:16:29 | Araq | yes it works with .c files too |
23:16:52 | Araq | but beware the compiler caches the .obj files for you |
23:17:06 | Araq | so you might need to enforce recompilation with -f |
23:17:21 | Araq | and yeah you have to declare the function prototypes in nimrod |
23:17:27 | Araq | c2nim helps with that though |
23:19:58 | EfTwelve | ya, i cant get that part to work. claims the implementations is expected |
23:20:19 | EfTwelve | maybe because the c function is float and nimrod is double |
23:20:40 | Araq | well use float32 for C's float |
23:20:44 | Araq | in fact |
23:20:53 | Araq | learn to use c2nim |
23:21:00 | Araq | it often knows better ;-) |
23:22:22 | Araq | oh btw, dom96, there is indeed a bug with 'bind', fixing it may take a while |
23:24:47 | EfTwelve | c2nim seems to create malformed code though |
23:26:13 | Araq | in 0.8.14 yes |
23:26:38 | Araq | well it creates stuff like cunsignedint |
23:26:43 | Araq | which doesn't exist |
23:26:57 | Araq | github version is better ;-) |
23:27:06 | EfTwelve | doesnt handle unions |
23:27:26 | Araq | it does |
23:27:43 | Araq | but not properly |
23:28:31 | Araq | what does it generate? |
23:28:35 | EfTwelve | https://gist.github.com/3544921 |
23:31:36 | Araq | hey it's documented that way :P |
23:31:45 | Araq | nimrod doesn't have C's unchecked unions |
23:32:08 | Araq | so the best it can do is use the first branch of the union and hope for the best :D |
23:35:00 | EfTwelve | no worries, but i was thinking that it could be compiled and statically linked. |
23:35:20 | EfTwelve | but the function definition seems to be the issue |
23:40:05 | Araq | well ... you translated the C code completely to Nimrod |
23:40:18 | Araq | so there are 2 fastSqrt |
23:40:23 | Araq | which can't work |
23:40:37 | Araq | 'inline' also doesn't help |
23:41:00 | Araq | you need to do: float fastSqrt(const float x); |
23:41:14 | Araq | and translate that to a proper Nimrod header |
23:41:28 | dom96 | good night guys |
23:45:02 | Araq | it can be imported like this: |
23:45:39 | Araq | proc fastSqrt(x: float32): float32 {.importc: "fastSqrt".} |
23:45:46 | Araq | {.compile: "myfile.c".} |
23:46:02 | EfTwelve | ahha! |
23:46:07 | EfTwelve | that works! |
23:47:00 | EfTwelve | tyvm |
23:59:37 | Araq | well I have to sleep now |
23:59:39 | Araq | good night |