00:00:26 | * | io2 quit () |
00:08:40 | * | jd^p is now known as jd^p|away |
00:25:09 | * | Yeri quit (Ping timeout: 248 seconds) |
00:55:41 | MFlamer | Oh, I was gone for a few. I don't see much documentation for tinySTM either. |
00:57:30 | MFlamer | I'm thinking of reading what I can then experiment with it in C++ for a bit to find my way around. Then look at how to Nimroderize it. |
00:58:38 | MFlamer | I'm hoping it can happily exist as a Nimrod library instead of being part of the compiler, but I haven't thought about it enough yet. |
00:59:17 | MFlamer | Maybe you have an opinion on that?<Araq> |
01:13:55 | * | DAddYE quit (Remote host closed the connection) |
01:14:30 | * | DAddYE joined #nimrod |
01:19:36 | * | DAddYE quit (Ping timeout: 276 seconds) |
01:34:08 | * | Associat0r joined #nimrod |
01:34:08 | * | Associat0r quit (Changing host) |
01:34:08 | * | Associat0r joined #nimrod |
01:44:22 | * | MFlamer quit (Quit: Page closed) |
01:51:13 | * | EXetoC quit (Quit: WeeChat 0.4.1) |
01:57:33 | * | sinistersnare joined #nimrod |
02:08:03 | * | q66 quit (Quit: Leaving) |
02:14:58 | * | DAddYE joined #nimrod |
02:22:14 | * | DAddYE quit (Ping timeout: 240 seconds) |
02:23:51 | * | jd^p|away quit (Quit: Bye!) |
02:24:17 | * | ltbarcly joined #nimrod |
02:29:32 | * | ltbarcly quit (Quit: Computer has gone to sleep.) |
02:50:05 | * | jd^p joined #nimrod |
02:50:05 | * | jd^p quit (Excess Flood) |
02:53:52 | * | Yeri joined #nimrod |
03:18:20 | * | DAddYE joined #nimrod |
03:25:03 | * | DAddYE quit (Ping timeout: 276 seconds) |
03:28:42 | * | sinistersnare quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
03:30:58 | * | jpoirier joined #nimrod |
03:50:01 | * | brson quit (Ping timeout: 245 seconds) |
04:00:18 | * | OrionPK quit (Read error: Connection reset by peer) |
04:02:08 | * | Yeri quit (Quit: Yeri) |
04:21:20 | * | DAddYE joined #nimrod |
04:27:50 | * | DAddYE quit (Ping timeout: 240 seconds) |
04:47:16 | * | Associat0r quit (Quit: Associat0r) |
05:24:24 | * | DAddYE joined #nimrod |
05:31:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
05:40:59 | * | ltbarcly joined #nimrod |
05:45:42 | * | ltbarcly quit (Ping timeout: 264 seconds) |
05:51:16 | * | ltbarcly joined #nimrod |
05:53:34 | * | brson joined #nimrod |
05:55:26 | * | ltbarcly quit (Ping timeout: 245 seconds) |
06:14:42 | * | brson quit (Quit: leaving) |
06:26:21 | * | brson joined #nimrod |
06:27:41 | * | DAddYE joined #nimrod |
06:30:10 | * | Endeg quit (Read error: Connection reset by peer) |
06:34:14 | * | DAddYE quit (Ping timeout: 240 seconds) |
07:07:13 | * | brson quit (Quit: leaving) |
07:09:26 | * | DAddYE joined #nimrod |
07:17:06 | * | jpoirier quit (Quit: Bye!) |
07:17:38 | * | jpoirier joined #nimrod |
07:18:46 | * | jpoirier quit (Client Quit) |
08:20:44 | * | orbitz joined #nimrod |
08:24:20 | * | Araq_ joined #nimrod |
08:25:06 | Araq_ | hi orbitz, welcome |
08:29:11 | * | BitPuffin quit (Ping timeout: 260 seconds) |
08:39:04 | * | DAddYE quit (Remote host closed the connection) |
08:39:35 | * | DAddYE joined #nimrod |
08:42:38 | * | BitPuffin joined #nimrod |
08:44:51 | * | DAddYE quit (Ping timeout: 276 seconds) |
09:40:02 | * | DAddYE joined #nimrod |
09:47:31 | * | DAddYE quit (Ping timeout: 245 seconds) |
09:54:07 | * | Associat0r joined #nimrod |
09:54:07 | * | Associat0r quit (Changing host) |
09:54:07 | * | Associat0r joined #nimrod |
10:02:46 | * | ltbarcly joined #nimrod |
10:07:02 | * | ltbarcly quit (Ping timeout: 240 seconds) |
10:13:12 | * | ltbarcly joined #nimrod |
10:17:32 | * | ltbarcly quit (Ping timeout: 256 seconds) |
10:22:37 | * | XAMPP-8 joined #nimrod |
10:44:20 | * | DAddYE joined #nimrod |
10:44:34 | * | q66 joined #nimrod |
10:49:36 | * | DAddYE quit (Ping timeout: 245 seconds) |
11:04:01 | * | Araq__ joined #nimrod |
11:05:16 | * | Araq_ quit (Ping timeout: 246 seconds) |
11:24:25 | * | Araq__ quit (Quit: ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]) |
11:46:24 | * | DAddYE joined #nimrod |
11:53:09 | * | DAddYE quit (Ping timeout: 248 seconds) |
12:28:24 | * | XAMPP_8 joined #nimrod |
12:28:32 | * | Associat0r quit (Quit: Associat0r) |
12:30:51 | * | XAMPP-8 quit (Ping timeout: 245 seconds) |
12:49:23 | * | DAddYE joined #nimrod |
12:53:26 | * | DAddYE quit (Ping timeout: 240 seconds) |
13:07:09 | * | XAMPP_8 quit (Read error: No route to host) |
13:15:37 | * | Yeri joined #nimrod |
13:16:41 | * | Yeri quit (Client Quit) |
13:50:04 | * | DAddYE joined #nimrod |
13:56:38 | * | DAddYE quit (Ping timeout: 240 seconds) |
14:24:40 | * | ltbarcly joined #nimrod |
14:29:11 | * | ltbarcly quit (Ping timeout: 245 seconds) |
14:35:00 | * | ltbarcly joined #nimrod |
14:39:45 | * | ltbarcly quit (Ping timeout: 276 seconds) |
14:53:08 | * | DAddYE joined #nimrod |
14:59:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
15:45:04 | * | ltbarcly joined #nimrod |
15:56:17 | * | DAddYE joined #nimrod |
16:02:38 | * | DAddYE quit (Ping timeout: 240 seconds) |
16:07:56 | * | Hannibal_Smith joined #nimrod |
16:13:08 | Hannibal_Smith | Hi, is better to download the 0.9.2 version of the compiler, or get it from git? |
16:14:44 | dom96 | the latter |
16:15:22 | Hannibal_Smith | Ok, thank you |
16:19:13 | Hannibal_Smith | Uhm...the method for building the compiler has changed? |
16:20:24 | dom96 | Kinda. Read the readme. |
16:20:59 | Hannibal_Smith | Ok, I was reading the "Getting started" wiki |
16:22:51 | Hannibal_Smith | Ah no, I didn't read |
16:22:53 | Hannibal_Smith | you need to extract build/csources.zip then you can bootstrap with: <- |
16:23:29 | dom96 | That's outdated |
16:23:32 | dom96 | Read the readme :P |
16:27:34 | * | Associat0r joined #nimrod |
16:27:34 | * | Associat0r quit (Changing host) |
16:27:34 | * | Associat0r joined #nimrod |
16:28:10 | dom96 | Hannibal_Smith: https://github.com/Araq/Nimrod#compiling |
16:29:18 | Hannibal_Smith | Yes, I'm here |
16:29:18 | Hannibal_Smith | Hint: operation successful (66943 lines compiled; 3.138 sec total; 199.203MB) [SuccessX] |
16:29:18 | Hannibal_Smith | executables are equal: SUCCESS! |
16:29:30 | dom96 | good |
16:29:30 | Hannibal_Smith | So...I think that now I have the compiler |
16:29:36 | dom96 | indeed |
16:29:43 | Hannibal_Smith | Thank you |
16:30:15 | Hannibal_Smith | bash-4.2$ ./nimrod |
16:30:16 | Hannibal_Smith | Nimrod Compiler Version 0.9.3 (2013-09-06) [Linux: amd64] |
16:31:29 | Hannibal_Smith | I think that there are any editor for Nimrod, it's right? |
16:31:36 | Hannibal_Smith | *aren't |
16:31:46 | dom96 | There is Aporia. |
16:32:31 | Hannibal_Smith | I'm missing so much informations, ok I will try Aporia |
16:44:55 | * | Mat2 joined #nimrod |
16:44:57 | Mat2 | hi all |
16:48:08 | dom96 | hi Mat2 |
16:51:50 | * | DAddYE joined #nimrod |
16:53:44 | Hannibal_Smith | How I can tell to the compiler, to use 64bit? |
16:54:00 | Mat2 | hi dom96 |
16:59:27 | dom96 | Hannibal_Smith: The compiler should know to use 64bit automatically |
16:59:43 | Hannibal_Smith | Yes, I was wrong... |
16:59:53 | Hannibal_Smith | bash-4.2$ ./aporia |
16:59:53 | Hannibal_Smith | could not load: libgtksourceview-2.0.so(|.0) |
17:01:53 | Hannibal_Smith | Sorry, I now understand where I was wrong |
17:02:01 | Hannibal_Smith | I installer gtksourceview1 |
17:02:06 | Hannibal_Smith | *installed |
17:02:39 | Hannibal_Smith | Ok, all working |
17:05:47 | Hannibal_Smith | Test |
17:05:47 | Hannibal_Smith | > Process terminated with exit code 0 |
17:06:00 | Hannibal_Smith | Classical first code |
17:15:16 | Mat2 | hello Mr. Smith |
17:15:39 | Hannibal_Smith | Hi Mat2 |
17:18:59 | * | Associ8or joined #nimrod |
17:18:59 | * | Associ8or quit (Changing host) |
17:18:59 | * | Associ8or joined #nimrod |
17:20:51 | * | Associat0r quit (Ping timeout: 256 seconds) |
17:23:59 | * | io2 joined #nimrod |
17:24:39 | Hannibal_Smith | How "private" is archived in Nimrod? |
17:25:09 | BitPuffin | Hannibal_Smith: private is the default |
17:25:19 | BitPuffin | Hannibal_Smith: if you mark something with * it is public |
17:25:29 | BitPuffin | Hannibal_Smith: there is no protected |
17:25:39 | Hannibal_Smith | Ok thank you, I missed it |
17:25:49 | BitPuffin | Hannibal_Smith: Maybe you should have a look at the tutorials + manual :) enjoy nimrod! |
17:26:10 | Hannibal_Smith | Yes I'm following the tutorial |
17:26:24 | BitPuffin | ah I see |
17:26:36 | BitPuffin | Well we are here to try to answer any questions you might have |
17:26:56 | Hannibal_Smith | Ok |
17:44:07 | Hannibal_Smith | type |
17:44:07 | Hannibal_Smith | TStack*[T] = object |
17:44:07 | Hannibal_Smith | base: array[0..100, T] |
17:44:07 | Hannibal_Smith | copy: ref seq[T] |
17:44:27 | Hannibal_Smith | Is it possible to parametrize the 0..100? |
17:58:13 | Araq | Hannibal_Smith: yes it is TStack*[T, Idx] = object ... |
17:58:26 | Hannibal_Smith | Ok thank you Araq |
17:58:31 | Araq | your "copy: ref seq[T]" looks suspicious |
17:58:46 | Araq | you likely want 'copy: seq[T]' instead |
17:59:22 | Hannibal_Smith | I'm a student, and I'm trying to implement data structure from "Advanced data structor" by Peter Brass |
17:59:40 | * | circ-user-ONUyt joined #nimrod |
17:59:56 | Hannibal_Smith | It's a variant of what Brass call "Shadow copy array" |
18:00:22 | Hannibal_Smith | It's something that I have to do in C++, but I'm curious about Nimrod |
18:00:40 | Hannibal_Smith | So I'm studing in both language |
18:01:19 | Hannibal_Smith | Ahhh, my English is really bad |
18:01:33 | Hannibal_Smith | *Advanced data structures |
18:02:17 | Hannibal_Smith | The idea is this: allocate a small array on the stack |
18:02:40 | Araq | I noticed :P |
18:02:43 | Hannibal_Smith | When an element is added, than check the current size |
18:03:08 | Araq | it's a standard implementation technique for the STL |
18:03:21 | Hannibal_Smith | Yes |
18:03:47 | Mat2 | hi Araq |
18:04:27 | Araq | hi mat2 |
18:22:37 | * | brson joined #nimrod |
18:38:29 | Mat2 | hi brson |
18:38:40 | * | Mat2 is now known as Mat2-bbl |
18:57:18 | * | Mat2-bbl is now known as Mat2 |
19:09:31 | Hannibal_Smith | proc left*[T](e: PTreeElement[T]): PTreeElement[T] {.inline.} = e.left <-Can the return value interfered? |
19:09:43 | Hannibal_Smith | *return type |
19:10:19 | dom96 | try replacing 'PTreeElement[T]' with 'auto' |
19:10:25 | Hannibal_Smith | Ok |
19:10:54 | Araq | btw it looks like an invalid recursion what you got there |
19:11:28 | Hannibal_Smith | Uhm...I didn't notice |
19:12:19 | Hannibal_Smith | Are there some namings convention? |
19:12:29 | Hannibal_Smith | Like get_left? |
19:12:50 | Araq | 'left' is fine, just name the field 'le' or whatever |
19:13:41 | Hannibal_Smith | In the C++ version I used left_, is it ok viewed from a Nimrod programmer? |
19:13:51 | Araq | yeah, it's fine |
19:13:55 | Hannibal_Smith | Ok |
19:13:57 | Araq | the compiler doesn't allow it anyway |
19:14:42 | Hannibal_Smith | So I can't name things like left_? |
19:14:54 | Araq | yep |
19:15:42 | Araq | btw I wouldn't write an accessor at all |
19:16:03 | Hannibal_Smith | Uhm...I think you are right |
19:16:32 | Hannibal_Smith | Ok, I will follow this style |
19:25:16 | Hannibal_Smith | Variant type can be handy in building a tree like Brass expose |
19:26:33 | Mat2 | variant types are also useful for defining union structures |
19:26:33 | Hannibal_Smith | There are some some mothive that Nimrod didn't use something like Haskell ADT for variant type? |
19:28:09 | Araq | sum types don't work well with mutability, so I chose object variants |
19:28:17 | Hannibal_Smith | Ok |
19:28:27 | Araq | turns out ... they don't work all that well with mutability either :P |
19:29:16 | Hannibal_Smith | The C convenction that the book present is that if left is NULL, than you have to cast right as the data type |
19:29:26 | Hannibal_Smith | Using a variant type, is a lot better |
19:29:46 | Hannibal_Smith | Ahhh |
19:29:53 | Hannibal_Smith | *if right is NULL |
19:30:04 | Araq | no, the NULL pointers is a classic and takes less space |
19:30:52 | Araq | a variant is "not a lot better" by any means |
19:31:15 | Hannibal_Smith | So you would follow the book's style? |
19:32:32 | Araq | I think so |
19:32:41 | Hannibal_Smith | Ok, thank your for the advice |
19:34:44 | Hannibal_Smith | You can use cast on ref object right? |
19:34:56 | Araq | you really shouldn't do that |
19:35:13 | Araq | cast and ref mixes very rarely |
19:35:18 | Hannibal_Smith | So I have to use a ptr? |
19:35:45 | Araq | quite likely, yes |
19:35:48 | Hannibal_Smith | Ok |
19:56:53 | * | shodan45 quit (Quit: Konversation terminated!) |
20:05:09 | * | Mat2 is now known as Mat2-bbl |
20:12:08 | Hannibal_Smith | Araq, talking about efficiency, I was viewing how the nimrod std handles cases like a non found value |
20:12:25 | Hannibal_Smith | If uses exceptions, did you find that exceptions don't degrade performance |
20:12:37 | Hannibal_Smith | Versus something like C++ STL? |
20:14:03 | Hannibal_Smith | I readed, now I don't remember where, that on Linux exceptions are "free" if you don't raise |
20:14:23 | Hannibal_Smith | (for C++) |
20:15:33 | Araq | yeah well they are close to be free on many architectures |
20:15:48 | * | Mat2-bbl is now known as Mat2 |
20:15:53 | Mat2 | get some sleep, ciao |
20:16:01 | * | Mat2 quit (Quit: Verlassend) |
20:16:28 | comex | fwiw, in that particular case, the cost of a single well-predicted branch is likely to be pretty negligible |
20:16:37 | comex | except in special circumstances |
20:16:48 | comex | and of course if you do raise, there is a relatively massive cost |
20:17:32 | Hannibal_Smith | I didn't write anything that was "realtime", but for normal code |
20:17:40 | Hannibal_Smith | IMHO, it's ok to raise |
20:17:55 | Hannibal_Smith | For example using STL, you have to check the return value |
20:18:07 | Hannibal_Smith | So, there is a cost |
20:18:33 | Hannibal_Smith | Using exception, you elide this checking |
20:18:37 | comex | yep, it's true |
20:18:57 | comex | though as i said, assuming that the thing is always found, the cost of a single always correctly predicted branch is very very small |
20:19:15 | Hannibal_Smith | Uhm...you are right |
20:19:35 | comex | considering that searching in a hash table is a fairly complex operation |
20:19:43 | comex | if you're using nimrod, i'd be more concerned about the cost of integer overflow checking |
20:20:25 | Hannibal_Smith | Yes I didn't think about that |
20:20:53 | Hannibal_Smith | But from the documentation I readed that you can disable checking on module based |
20:21:11 | Hannibal_Smith | But yes...you have to pay it in some others module |
20:22:31 | Araq | Hannibal_Smith: nimrod uses a setjmp based exception implementation when the target is C, and C++'s mechanism when the target is C++ |
20:23:07 | Hannibal_Smith | Did you find some advances when targeting C++? |
20:23:14 | Araq | and overflow checking is disabled on a global level in release mode |
20:23:30 | Araq | yeah ... more efficient exception handling :P |
20:23:40 | comex | oh, it is? i forgot about that |
20:23:44 | Hannibal_Smith | Ok, thank to both of you |
20:24:15 | Araq | the disadvantage is that the 'const' in C++ is an annoying pita when generating code |
20:25:52 | Araq | speaking about C++, how can I know whether 'a' in 'void a::b()' is a class or a namespace without a symbol table? |
20:27:19 | Hannibal_Smith | I don't know the context, but type trails? |
20:28:01 | comex | dunno, how can you know whether a in a[b] is an unchecked array, in which case bad b is unsafe, a checked array (vector), in which case bad b is bad but not a vulnerability, a hash table (map), in which case b can be anything, or something else, without a symbol table? |
20:28:05 | comex | oh wait, your language does that too ;) |
20:28:29 | Araq | that's not my point |
20:28:40 | Araq | I'm improving c2nim so that it can deal with C++ |
20:29:00 | Araq | so I'm looking for a nice heuristic |
20:29:04 | Araq | but I think there is none |
20:29:14 | comex | boy, trying to parse C++ without a symbol table sounds impossible |
20:29:25 | comex | sure you don't want to use libclang or something? |
20:29:28 | Araq | actually it looks quite simple |
20:29:39 | Araq | and yeah I'm sure |
20:30:06 | Araq | I don't need a full and complete and correct c++ parser |
20:30:14 | Araq | I need something that can transform header files |
20:30:28 | Araq | reasonably well |
20:30:45 | comex | yeah, but C++ header files can be very, very templately and complicated :p |
20:30:53 | comex | well, suppose most of them aren't |
20:32:54 | Araq | in fact parsing C without symbol table is already a PITA, C++ doesn't add much complexity here |
20:33:30 | Araq | t<a, b>(x, y) is not worse than a*b |
20:36:01 | comex | you mean (a) * b? :) |
20:36:31 | Araq | a*b is already ambiguous |
20:36:45 | Araq | (a)*b is worse though |
20:36:55 | comex | only if it's "a*b;" |
20:36:56 | comex | :p |
20:37:10 | comex | i mostly mean that while any C declaration translates straightforwardly into a nimrod one, i'd be surprised if templates had exactly the same semantics |
20:39:28 | Araq | yeah well I don't care; list<string> is perhaps translated into list[string] and then you need to ensure it makes sense :P |
20:40:13 | Araq | just like C's char** is translated to cstringArray which might be completely wrong |
20:40:32 | Araq | it could be a pointer to a pointer to a single char after all |
20:41:21 | Araq | C's type system is utter bullshit :-) |
20:42:40 | Araq | but hey, according to you it's "hard" to do better than C at what C does XD :P |
20:43:13 | comex | Araq: <3 |
20:44:17 | * | EXetoC joined #nimrod |
20:48:54 | Araq | comex: btw what's the alternative? a.unsafeAt(b), a.safeAt(b), etc for the poor souls that read code without keeping any context in mind whatsoever? |
20:49:39 | Araq | and good luck with writing generic code when everything has a dumped down unique verbose name |
20:49:53 | comex | well, perl has [] for arrays and {} for hashes |
20:50:02 | comex | i think that's not a bad idea |
20:51:50 | Araq | I think it's about time we stop caring about notepad users |
20:51:51 | * | circ-user-ONUyt quit (Remote host closed the connection) |
20:52:13 | comex | hey, if it can cause an experienced chrome engineer (not me) to get confused, I can complain about it :) |
21:00:10 | Araq | yeah but it could also be that the experienced chrome engineer didn't use proper tools :P |
21:01:10 | BitPuffin | Araq: but did the object variants work better than the other alternatives with mutability? |
21:01:23 | Araq | BitPuffin: I think so |
21:05:53 | BitPuffin | Araq: good :) |
21:07:37 | Hannibal_Smith | At the end, I'm using exception also in the C++ version, writing an interator for each data structure can be too much or impossible |
21:15:43 | Hannibal_Smith | Maybe not impossible, probably it's possible to write an interator for every type of data structure, not in a efficient way, but possible |
21:35:06 | * | shodan45 joined #nimrod |
21:35:47 | Hannibal_Smith | proc data[TKey, TData](e: TElement[TKey, TData]): ptr TData {.inline.} = cast[ptr TData](left) |
21:35:52 | Hannibal_Smith | Some questions |
21:35:59 | Hannibal_Smith | Is the cast ok? |
21:36:45 | Araq | what's Left? |
21:36:54 | Hannibal_Smith | And, do I have to write ptr, or I can simply cast to TData? |
21:37:03 | Hannibal_Smith | type |
21:37:03 | Hannibal_Smith | TElement[TKey, TData] = object |
21:37:04 | Hannibal_Smith | key: TKey |
21:37:04 | Hannibal_Smith | data: ref TData |
21:37:04 | Hannibal_Smith | left, right: ptr TElement[T] |
21:37:20 | Hannibal_Smith | Ahhh |
21:37:26 | Hannibal_Smith | I'm too tired maybe |
21:37:40 | Hannibal_Smith | type |
21:37:40 | Hannibal_Smith | TElement[TKey] = object |
21:37:40 | Hannibal_Smith | key: TKey |
21:37:40 | Hannibal_Smith | left, right: ptr TElement[T] |
21:37:55 | Araq | looks all very wrong to me :P |
21:38:03 | Hannibal_Smith | Yes |
21:38:07 | Hannibal_Smith | So, one moment |
21:39:55 | Hannibal_Smith | ---- |
21:39:56 | Hannibal_Smith | type |
21:39:56 | Hannibal_Smith | TElement[T] = object |
21:39:56 | Hannibal_Smith | key: T |
21:39:56 | Hannibal_Smith | left, right: ptr TElement[T] |
21:39:56 | Hannibal_Smith | |
21:39:58 | Hannibal_Smith | TTree[T] = distinct TElement[T] not nil |
21:40:00 | Hannibal_Smith | proc is_not_leaf[T](e: TElement[T]): bool {.inline.} = right == nil |
21:40:03 | reactormonk | Hannibal_Smith, pastebin. |
21:40:04 | Hannibal_Smith | proc has_data[T](e: TElement[T]): bool {.inline.} = left!= nil && right == nil |
21:40:06 | Hannibal_Smith | proc data[T](e: TElement[T]): ptr TData {.inline.} = cast[ptr TData](left) |
21:40:08 | Hannibal_Smith | --- |
21:40:33 | Hannibal_Smith | Ahhhh |
21:40:36 | Hannibal_Smith | So many errors |
21:41:00 | Hannibal_Smith | proc data[T, TData](e: TElement[T]): ptr TData {.inline.} = cast[ptr TData](left) |
21:41:02 | Hannibal_Smith | Sorry |
21:41:45 | Araq | it's 'and' and not '&&' |
21:41:53 | Hannibal_Smith | Ok |
21:42:53 | Araq | and how come the left node stores the data? that's stupid you should indeed use a 'case object' instead then |
21:43:14 | Araq | and then you can use 'ref' |
21:44:09 | Hannibal_Smith | typedef struct tr_n_t {key_t |
21:44:09 | Hannibal_Smith | key; |
21:44:09 | Hannibal_Smith | struct tr_n_t |
21:44:09 | Hannibal_Smith | *left; |
21:44:09 | Hannibal_Smith | struct tr_n_t *right; |
21:44:12 | Hannibal_Smith | } tree_node_t; |
21:44:21 | Hannibal_Smith | This is the C structure that the code define |
21:44:24 | BitPuffin | dom96: have you written nginx instructions yet for jester? |
21:44:33 | dom96 | BitPuffin: nope, sorry |
21:44:40 | BitPuffin | dom96: get you ass on it xD |
21:44:46 | BitPuffin | nah I'm just kidding |
21:44:50 | BitPuffin | but seriously |
21:44:52 | BitPuffin | do it |
21:44:54 | BitPuffin | :P |
21:44:55 | dom96 | lol |
21:45:08 | Hannibal_Smith | *that the book define |
21:45:16 | BitPuffin | dom96: is async fixed yet? |
21:45:25 | dom96 | BitPuffin: Has it been broken? |
21:45:31 | BitPuffin | dom96: optimized* |
21:45:43 | dom96 | no |
21:45:50 | BitPuffin | ah |
21:45:51 | BitPuffin | oh well |
21:45:51 | * | dom96 is busy with school again :| |
21:46:00 | BitPuffin | the framework performs pretty nicely still |
21:46:01 | BitPuffin | dom96: aw : |
21:46:03 | BitPuffin | ( |
21:46:13 | BitPuffin | dom96: write a software that does your homework? |
21:46:15 | BitPuffin | lol |
21:46:19 | BitPuffin | I miswrote first |
21:46:22 | BitPuffin | "homowork" |
21:46:28 | dom96 | haha. |
21:46:37 | dom96 | I wish it were that simple... |
21:46:51 | BitPuffin | that's what real programmers do :P |
21:46:56 | BitPuffin | aren't you a real programmer? |
21:47:09 | BitPuffin | so you are just a scriptkiddy huh? HUH? |
21:47:15 | Hannibal_Smith | Araq, returning to the problem |
21:47:16 | Hannibal_Smith | inline data_t& data() noexcept { |
21:47:16 | Hannibal_Smith | return reinterpret_cast<data_t>(left_); |
21:47:16 | Hannibal_Smith | } |
21:47:25 | dom96 | Araq: Help me, BitPuffin is bullying me :( |
21:47:26 | Hannibal_Smith | How can I do this in Nimrod? |
21:47:34 | BitPuffin | Araq: awesome that you are improving c2nim to support cpp headers btw |
21:47:47 | BitPuffin | dom96: sciipt kiddyyy scriiiiipt kiddyyy |
21:47:54 | Araq | BitPuffin: stop bullying my core devs |
21:48:44 | BitPuffin | Araq: sorry boss |
21:49:10 | dom96 | *cough* |
21:49:22 | dom96 | BitPuffin: What's that now? |
21:49:39 | BitPuffin | dom96: awshit he's got an @ sign! ;_; |
21:50:03 | BitPuffin | dom96: now who's the bully ;_; |
21:50:05 | BitPuffin | ;_____________; |
21:50:06 | dom96 | Respect ma authoritah. |
21:50:23 | Araq | Hannibal_Smith: it doesn't make sense to use generics AND cast |
21:50:23 | BitPuffin | yes sir ;_; |
21:50:30 | dom96 | good. |
21:50:35 | BitPuffin | SCRRRR |
21:50:37 | BitPuffin | nah just kidding |
21:50:39 | BitPuffin | :P |
21:50:46 | BitPuffin | anyways |
21:50:46 | dom96 | :P |
21:50:47 | Hannibal_Smith | Araq, ahh now I see your point |
21:51:04 | BitPuffin | dom96: what's the problem with the async btw? how can it be made to be faster? |
21:51:06 | Hannibal_Smith | Some advice? |
21:51:17 | dom96 | BitPuffin: epoll. |
21:51:33 | Hannibal_Smith | template <typename TKey, typename TData> |
21:51:33 | Hannibal_Smith | struct TreeElement { |
21:51:41 | Hannibal_Smith | This is in C++ |
21:51:41 | BitPuffin | dom96: does that work of freebsd? |
21:52:01 | dom96 | BitPuffin: I haven't really investigated it much. Bigger problem is scaling to multiple cores I guess. |
21:52:07 | * | dunpeal joined #nimrod |
21:52:10 | Hannibal_Smith | I pass as a template the data, than do a typedef |
21:52:16 | Araq | hi dunpeal, welcome |
21:52:27 | dom96 | BitPuffin: No, *bsd uses kqueues or something. |
21:52:29 | Hannibal_Smith | So this particoal TreeElement know it's types |
21:52:33 | Hannibal_Smith | *particular |
21:52:46 | Araq | Hannibal_Smith: yeah yeah, no need to be so verbose |
21:52:53 | BitPuffin | dom96: will you support that too? |
21:52:54 | dunpeal | thanks Araq |
21:53:04 | BitPuffin | dom96: because my site(s?) will be running on freebsd |
21:53:05 | BitPuffin | except one |
21:53:35 | dom96 | BitPuffin: Hopefully. I would like to get promises working first. Which is what I tried to do over the summer. |
21:53:44 | BitPuffin | dom96: promises? |
21:54:08 | dom96 | BitPuffin: futures? C#-like await async thingy. |
21:54:27 | * | BitPuffin doesn't use C# |
21:54:37 | BitPuffin | but I recognize future |
21:54:40 | BitPuffin | isn't that a haskell thing? |
21:54:47 | dom96 | it's a functional thing. |
21:54:58 | dom96 | It's basically the functional answer to async callbacks. |
21:55:15 | BitPuffin | I see |
21:55:19 | reactormonk | dom96, futures? |
21:55:25 | BitPuffin | what's the difference? |
21:55:34 | dom96 | People have been lately getting worked up over callbacks being the next goto. |
21:55:40 | reactormonk | BitPuffin, I think future is the superclass |
21:55:50 | reactormonk | dom96, if you pass functions along, why should it? |
21:55:52 | Hannibal_Smith | dom96, I think that they are right |
21:56:16 | comex | dom96: that is to say, unfairly maligned? ;) |
21:56:45 | Hannibal_Smith | Something like nodejs today, is worker than php IMHO |
21:56:48 | BitPuffin | reactormonk: doesn't clarify enough. So future is an object? |
21:56:51 | dom96 | Hannibal_Smith: I think callbacks are ok, as long as you don't nest them 50 times. |
21:57:05 | BitPuffin | reactormonk: sounds more like the OO answer to callbacks |
21:57:55 | Hannibal_Smith | *is worsen |
21:58:31 | Hannibal_Smith | BitPuffin, MS solution, it rewrite your code as a state machine |
21:58:35 | reactormonk | BitPuffin, nah, it's the functional one. you have something that doesn't respond yet, so you get a monad back. |
21:58:36 | Hannibal_Smith | Is not really OO |
21:59:20 | Hannibal_Smith | Sorry |
21:59:22 | dom96 | comex: Perhaps not unfairly, in some ways they are right. But they are going a bit overboard comparing it to 'goto' IMO. |
21:59:49 | Hannibal_Smith | I have misread BitPuffin |
22:00:17 | Araq | Hannibal_Smith: type NodeKind = enum inner, leaf |
22:00:28 | BitPuffin | goto is overhated |
22:00:36 | Araq | TNode[TKey, TData] = object |
22:00:45 | Araq | case kind: NodeKind |
22:00:52 | Araq | of inner: |
22:01:06 | Araq | le, ri: ref TNode[Tkey, TData] |
22:01:07 | dom96 | BitPuffin: It's basically a way to write code which is asynchronous in a synchronous fashion. |
22:01:18 | BitPuffin | dom96: does it make sense? |
22:01:21 | Araq | of leaf: |
22:01:32 | Araq | data: TData |
22:01:55 | Hannibal_Smith | Data has to be managed by the GC right? |
22:01:58 | dom96 | BitPuffin: of course it does. |
22:02:12 | Araq | if you use 'ref' then yes, Hannibal_Smith |
22:02:21 | BitPuffin | http://eradicus.blogsome.com/2009/10/07/linus-discussion-about-goto-statements/ |
22:02:30 | Hannibal_Smith | It makes more sense to move data on the GC |
22:02:34 | BitPuffin | dom96: but what happens? |
22:03:24 | Hannibal_Smith | Araq, another question, from what I can understand, GC in Nimrod i a malloc, slower |
22:03:28 | Hannibal_Smith | I'm right? |
22:03:50 | Hannibal_Smith | Uhm...maybe I said something without sense |
22:04:28 | Hannibal_Smith | I did read that the GC is activated on every allocation |
22:04:35 | dom96 | BitPuffin: Blocking calls will no longer block the whole program. |
22:04:56 | BitPuffin | dom96: but how does it return without a result? |
22:05:00 | Hannibal_Smith | Uhm...I must misread something |
22:05:06 | Araq | indeed |
22:05:49 | Araq | BitPuffin: this is a very poor statement from Linus and he doesn't know what he is talking about |
22:06:05 | Hannibal_Smith | The cost of allocation on the GC; is the same or is slower than using malloc? |
22:06:07 | BitPuffin | Araq: why is that? |
22:06:15 | dom96 | BitPuffin: The way I implemented it was using an iterator. If a blocking call happens you yield from the iterator. |
22:06:34 | Araq | I don't mind 'goto' either, but he's completely wrong |
22:06:38 | BitPuffin | Araq: I like how both you and him don't explain at all why someone is wrong. Just say he doesn't know what he's talking about :P |
22:07:38 | Araq | prove something with Hoard's logic to see why it's called "structured programming" and why it improves over goto |
22:08:02 | BitPuffin | Araq: I think the core of the point still stands which is that sometimes something is the wrong choice and you shouldn't use it and sometimes it is the right choice and you should |
22:08:14 | companion_cube | you mean Hoare logic? |
22:08:23 | Araq | yeah, sorry, typo |
22:08:44 | companion_cube | I think using goto is reasonable in C, if only for error handling |
22:09:42 | BitPuffin | does nimrod have goto? |
22:09:57 | reactormonk | BitPuffin, somewhat of. you can jump out of a block |
22:10:06 | BitPuffin | hmm yeah true |
22:10:12 | BitPuffin | you can name a block and break out of it |
22:10:20 | BitPuffin | that's very easy to read too |
22:10:41 | BitPuffin | dom96: I am gonna have to understand that some other day :P |
22:11:00 | Araq | it's also still structured programming according to a paper that I lost years ago |
22:11:09 | dom96 | Araq: Does c2nim not support newlines in param lists? |
22:11:15 | BitPuffin | Araq: what is? |
22:11:30 | BitPuffin | dom96: I think it does |
22:11:32 | BitPuffin | dom96: iirc |
22:11:49 | Araq | BitPuffin: nimrod's way of breaking out of 'block' and loops is still "structured" |
22:11:53 | dom96 | oh I see the problem nvm |
22:12:06 | BitPuffin | Araq: ah |
22:12:19 | BitPuffin | Araq: I don't see why it wouldn't be |
22:12:40 | BitPuffin | although I guess I don't really know the definition of structured in terms of programming. Just what it sounds like :P |
22:12:55 | dom96 | can I somehow translate CV_DEFAULT(x) into '= x' (i.e. default value for params)? |
22:13:11 | Araq | c2nim supports default values for params |
22:13:30 | Araq | #def CV_DEFAULT(x) = x |
22:13:33 | Araq | should do the job |
22:13:53 | dom96 | cool, thanks |
22:14:09 | BitPuffin | .cpisspiss |
22:14:35 | BitPuffin | what the cpp extension should have been hur hur |
22:18:26 | brson | Mat2: hi |
22:28:33 | * | Yeri joined #nimrod |
22:34:57 | * | MFlamer joined #nimrod |
22:35:19 | Araq | hi MFlamer |
22:35:38 | MFlamer | Hi Araq, how's it going? |
22:37:31 | Araq | fine I guess |
22:37:46 | Araq | how's progress on the STM front? |
22:38:03 | Araq | I know the article you linked to btw :-) |
22:38:13 | orbitz | does Nimrod 'compete' with Clay (seems to already have more traction at least) |
22:39:05 | Araq | I think we do compete, yes |
22:39:37 | MFlamer | Pretty good, I'm thinking tinySTM may not have some of the problems they encountered, I think they were object based instead of word based.... |
22:39:55 | orbitz | Also, are there any performance numbers for Nimrod out there? It's not in the language shootout yet. |
22:39:58 | MFlamer | on a manged platform, and were not using time based STM |
22:40:41 | MFlamer | I am going to try and work on getting the headers converted to .nim tonight |
22:42:09 | Hannibal_Smith | Simple tree find function: Nimrod version: http://ideone.com/qOBbwp || C++ version: http://ideone.com/zY7Fpc |
22:42:32 | Hannibal_Smith | Question type |
22:42:35 | MFlamer | I'm going to need to learn more about how our threads might interact with stm. I might have some questions for you...if you have time. Maybe I can send you an email, then you can answer at your leisure |
22:42:49 | Hannibal_Smith | What really happen when I write |
22:43:00 | Hannibal_Smith | mp_element = tmp_element.left <-? |
22:43:06 | Hannibal_Smith | "Copy constructor"? |
22:43:41 | Araq | MFlamer: you need to use allocShared for these things |
22:44:53 | Araq | orbitz: there are some old benchmarks somewhere and a recent one here: http://forum.nimrod-code.org/t/205 |
22:44:58 | MFlamer | Araq: ok. I'll look into that. I guess if we keep stm data isolated from threads local data, we shouldn't have to worry about GC |
22:46:06 | Araq | yeah; however I think more useful would be a concurrent lock free hash map in Nimrod |
22:47:09 | MFlamer | as opposed to stm? |
22:47:21 | Araq | I looked at Cliff Click's implementation for Java once, didn't look too hard to do |
22:48:11 | * | dunpeal left #nimrod (#nimrod) |
22:48:12 | Araq | yeah "as opposed to" or rather "should have priority over" |
22:48:30 | orbitz | Araq: thnks |
22:50:09 | MFlamer | ok, I'll take a look at that. |
22:51:04 | MFlamer | maybe something that could be implemented in native nimrod instead of linking to a lib |
22:51:27 | BitPuffin | what's clay? |
22:53:00 | Araq | MFlamer: yeah please in native nimrod; however I think STM is not hard to implement for custom data structures, the difficulty seems to come from the generic approach |
22:54:08 | Araq | I mean STM is not hard to do natively in Nimrod either, especially if you attach to a concrete data structure |
22:55:21 | BitPuffin | looks like it could be a neat language but it appears to be very much in its infancy |
23:00:51 | * | fowl joined #nimrod |
23:01:44 | Hannibal_Smith | Anybody? |
23:02:00 | fowl | hello nimrods |
23:02:09 | Hannibal_Smith | Hi |
23:03:05 | BitPuffin | ay fowl |
23:05:14 | * | circ-user-RaRzh joined #nimrod |
23:06:03 | Araq | hi circ-user-RaRzh, how many of you circ-users are there? |
23:07:23 | circ-user-RaRzh | hi, araq. i guess all of them are me:) i use circ client and it automatically assign me a new random name start with cric |
23:11:32 | circ-user-RaRzh | araq. a question. i also found claro gui to be quite interested and i want to do something with it. it seems to be quite elegant and simple. do you know of any reason why the original author drop it? also, i also saw its layout manager is quite unique (not so easy to understan:)) and you seems to drop it on the binding. do you have any thought on the layout manage? |
23:14:04 | Araq | I do not know anything about the original authors except that their C code is sometimes strange |
23:14:48 | Araq | I don't think I deliberately dropped their layout manager in my binding |
23:15:35 | BitPuffin | Araq can probably point out tons of things that are wrong with clay though haha |
23:16:03 | Araq | er ... for the record: we compete with pretty much every language that produces native code |
23:16:08 | * | EXetoC quit (Quit: WeeChat 0.4.1) |
23:16:19 | Araq | because that's the way people think |
23:16:38 | BitPuffin | Araq: possibly |
23:16:54 | dom96 | what about the languages which are interpreted? surely those too. |
23:17:05 | Araq | we would compete with Ruby and Python too if people would constantly compare us with them |
23:17:09 | BitPuffin | I think nimrod kind of stands up against most languages |
23:17:24 | BitPuffin | Araq: but they do lol |
23:17:44 | Hannibal_Smith | People don't because tooling and libs |
23:17:57 | Hannibal_Smith | And lack of a big name behind it |
23:22:16 | Araq | Hannibal_Smith: we're getting there. slowly but steadily |
23:23:30 | Hannibal_Smith | If people really like something like nodejs |
23:23:47 | Hannibal_Smith | Some "market" are really messed up |
23:24:23 | Hannibal_Smith | I find hilarous how, "today" people are sayng "js for high performance socket server" |
23:24:41 | Hannibal_Smith | So, people will trust anything that read...on Stackoverflow |
23:24:51 | Hannibal_Smith | And I don't know how many bloggers |
23:24:55 | Hannibal_Smith | "Hype" |
23:25:00 | circ-user-RaRzh | thanks. araq. i think you might know this project in some depth since you might be one of the very few people that interested in this project. i have not dig deep on this project. I run all the examples in linux and they seems to work quite well, which is quite for a project in its age. |
23:27:45 | fowl | circ-user-RaRzh, why not setup a nick name so you dont get a random one each time |
23:27:57 | Hannibal_Smith | Araq, if nodejs has risen so high with its offer, maybe it's all matter of finding what people "are searching" |
23:28:46 | Araq | Hannibal_Smith: that's not how open source works. You have to create what pleases yourself, otherwise it's not going to fly. |
23:29:28 | Hannibal_Smith | Araq, probably it's the fortune to make coincide what you like, and what other devs are searching |
23:29:48 | * | circ-user-RaRzh is now known as logosd |
23:30:01 | MFlamer | Araq: https://code.google.com/p/nbds/ this looks like what you were talking about |
23:30:10 | logosd | changed. thanks fowl |
23:30:19 | Hannibal_Smith | Unfortunately, quality don't really matters in this equation, IMHO |
23:31:08 | Hannibal_Smith | People will read on Stackoverflow that Javascript can be cast as C, and will trust this |
23:31:39 | Hannibal_Smith | So they will trust that doing callbacks it's how write a good performance socket server |
23:32:53 | Araq | MFlamer: that's a pre-alpha |
23:33:34 | Hannibal_Smith | concurrencykit, has some good data structures |
23:35:13 | Araq | ah never mind |
23:35:28 | Araq | they refer to Click's lock free hash table |
23:35:37 | Araq | so it might be good :-) |
23:36:13 | companion_cube | isn't nimrod's primary concurrency mechanism supposed to be message passing? |
23:36:43 | Araq | no, that's the only thing that works with thread local GCs |
23:36:54 | Araq | but I dislike it ;-) |
23:37:57 | companion_cube | oh |
23:38:36 | Hannibal_Smith | Araq, sorry if I insist, but http://ideone.com/RwxMXU |
23:39:00 | Hannibal_Smith | I have to repeat ref also in the function signature? |
23:39:55 | Araq | ideone likely hasn't updated to 0.9.2, 'raises' came with 0.9.2 |
23:40:44 | Araq | also yeah you have to repeat the 'ref' that's why most people introduce an alias PTree[TKey, TData] = ref TTree[TKey, TData] |
23:41:07 | Hannibal_Smith | Ok thank you, I think that that's all for today |
23:41:23 | Hannibal_Smith | I did appreciate your advice |
23:41:49 | Hannibal_Smith | Maybe only another question |
23:42:28 | Hannibal_Smith | There is something like reference passing like C++? |
23:42:41 | Araq | yeah: 'var' |
23:42:48 | Hannibal_Smith | Ok |
23:44:25 | Araq | good night |
23:46:00 | Hannibal_Smith | If you are "curious" this is the C++ version: http://ideone.com/wsqock |
23:46:17 | Hannibal_Smith | It uses less memory per node than the Nimrod version |
23:46:38 | Hannibal_Smith | And uses pointer for keeping track the current "element" |
23:46:56 | Hannibal_Smith | The bad, that is as anybody can see, more error prone |
23:47:01 | Hannibal_Smith | And less "visual" |
23:49:29 | Hannibal_Smith | Bye |
23:49:32 | * | Hannibal_Smith quit (Quit: Sto andando via) |