<< 06-09-2013 >>

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:41MFlamerOh, I was gone for a few. I don't see much documentation for tinySTM either.
00:57:30MFlamerI'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:38MFlamerI'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:17MFlamerMaybe 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:06Araq_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:08Hannibal_SmithHi, is better to download the 0.9.2 version of the compiler, or get it from git?
16:14:44dom96the latter
16:15:22Hannibal_SmithOk, thank you
16:19:13Hannibal_SmithUhm...the method for building the compiler has changed?
16:20:24dom96Kinda. Read the readme.
16:20:59Hannibal_SmithOk, I was reading the "Getting started" wiki
16:22:51Hannibal_SmithAh no, I didn't read
16:22:53Hannibal_Smithyou need to extract build/csources.zip then you can bootstrap with: <-
16:23:29dom96That's outdated
16:23:32dom96Read the readme :P
16:27:34*Associat0r joined #nimrod
16:27:34*Associat0r quit (Changing host)
16:27:34*Associat0r joined #nimrod
16:28:10dom96Hannibal_Smith: https://github.com/Araq/Nimrod#compiling
16:29:18Hannibal_SmithYes, I'm here
16:29:18Hannibal_SmithHint: operation successful (66943 lines compiled; 3.138 sec total; 199.203MB) [SuccessX]
16:29:18Hannibal_Smithexecutables are equal: SUCCESS!
16:29:30dom96good
16:29:30Hannibal_SmithSo...I think that now I have the compiler
16:29:36dom96indeed
16:29:43Hannibal_SmithThank you
16:30:15Hannibal_Smithbash-4.2$ ./nimrod
16:30:16Hannibal_SmithNimrod Compiler Version 0.9.3 (2013-09-06) [Linux: amd64]
16:31:29Hannibal_SmithI think that there are any editor for Nimrod, it's right?
16:31:36Hannibal_Smith*aren't
16:31:46dom96There is Aporia.
16:32:31Hannibal_SmithI'm missing so much informations, ok I will try Aporia
16:44:55*Mat2 joined #nimrod
16:44:57Mat2hi all
16:48:08dom96hi Mat2
16:51:50*DAddYE joined #nimrod
16:53:44Hannibal_SmithHow I can tell to the compiler, to use 64bit?
16:54:00Mat2hi dom96
16:59:27dom96Hannibal_Smith: The compiler should know to use 64bit automatically
16:59:43Hannibal_SmithYes, I was wrong...
16:59:53Hannibal_Smithbash-4.2$ ./aporia
16:59:53Hannibal_Smithcould not load: libgtksourceview-2.0.so(|.0)
17:01:53Hannibal_SmithSorry, I now understand where I was wrong
17:02:01Hannibal_SmithI installer gtksourceview1
17:02:06Hannibal_Smith*installed
17:02:39Hannibal_SmithOk, all working
17:05:47Hannibal_SmithTest
17:05:47Hannibal_Smith> Process terminated with exit code 0
17:06:00Hannibal_SmithClassical first code
17:15:16Mat2hello Mr. Smith
17:15:39Hannibal_SmithHi 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:39Hannibal_SmithHow "private" is archived in Nimrod?
17:25:09BitPuffinHannibal_Smith: private is the default
17:25:19BitPuffinHannibal_Smith: if you mark something with * it is public
17:25:29BitPuffinHannibal_Smith: there is no protected
17:25:39Hannibal_SmithOk thank you, I missed it
17:25:49BitPuffinHannibal_Smith: Maybe you should have a look at the tutorials + manual :) enjoy nimrod!
17:26:10Hannibal_SmithYes I'm following the tutorial
17:26:24BitPuffinah I see
17:26:36BitPuffinWell we are here to try to answer any questions you might have
17:26:56Hannibal_SmithOk
17:44:07Hannibal_Smithtype
17:44:07Hannibal_Smith TStack*[T] = object
17:44:07Hannibal_Smith base: array[0..100, T]
17:44:07Hannibal_Smith copy: ref seq[T]
17:44:27Hannibal_SmithIs it possible to parametrize the 0..100?
17:58:13AraqHannibal_Smith: yes it is TStack*[T, Idx] = object ...
17:58:26Hannibal_SmithOk thank you Araq
17:58:31Araqyour "copy: ref seq[T]" looks suspicious
17:58:46Araqyou likely want 'copy: seq[T]' instead
17:59:22Hannibal_SmithI'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:56Hannibal_SmithIt's a variant of what Brass call "Shadow copy array"
18:00:22Hannibal_SmithIt's something that I have to do in C++, but I'm curious about Nimrod
18:00:40Hannibal_SmithSo I'm studing in both language
18:01:19Hannibal_SmithAhhh, my English is really bad
18:01:33Hannibal_Smith*Advanced data structures
18:02:17Hannibal_SmithThe idea is this: allocate a small array on the stack
18:02:40AraqI noticed :P
18:02:43Hannibal_SmithWhen an element is added, than check the current size
18:03:08Araqit's a standard implementation technique for the STL
18:03:21Hannibal_SmithYes
18:03:47Mat2hi Araq
18:04:27Araqhi mat2
18:22:37*brson joined #nimrod
18:38:29Mat2hi brson
18:38:40*Mat2 is now known as Mat2-bbl
18:57:18*Mat2-bbl is now known as Mat2
19:09:31Hannibal_Smithproc left*[T](e: PTreeElement[T]): PTreeElement[T] {.inline.} = e.left <-Can the return value interfered?
19:09:43Hannibal_Smith*return type
19:10:19dom96try replacing 'PTreeElement[T]' with 'auto'
19:10:25Hannibal_SmithOk
19:10:54Araqbtw it looks like an invalid recursion what you got there
19:11:28Hannibal_SmithUhm...I didn't notice
19:12:19Hannibal_SmithAre there some namings convention?
19:12:29Hannibal_SmithLike get_left?
19:12:50Araq'left' is fine, just name the field 'le' or whatever
19:13:41Hannibal_SmithIn the C++ version I used left_, is it ok viewed from a Nimrod programmer?
19:13:51Araqyeah, it's fine
19:13:55Hannibal_SmithOk
19:13:57Araqthe compiler doesn't allow it anyway
19:14:42Hannibal_SmithSo I can't name things like left_?
19:14:54Araqyep
19:15:42Araqbtw I wouldn't write an accessor at all
19:16:03Hannibal_SmithUhm...I think you are right
19:16:32Hannibal_SmithOk, I will follow this style
19:25:16Hannibal_SmithVariant type can be handy in building a tree like Brass expose
19:26:33Mat2variant types are also useful for defining union structures
19:26:33Hannibal_SmithThere are some some mothive that Nimrod didn't use something like Haskell ADT for variant type?
19:28:09Araqsum types don't work well with mutability, so I chose object variants
19:28:17Hannibal_SmithOk
19:28:27Araqturns out ... they don't work all that well with mutability either :P
19:29:16Hannibal_SmithThe C convenction that the book present is that if left is NULL, than you have to cast right as the data type
19:29:26Hannibal_SmithUsing a variant type, is a lot better
19:29:46Hannibal_SmithAhhh
19:29:53Hannibal_Smith*if right is NULL
19:30:04Araqno, the NULL pointers is a classic and takes less space
19:30:52Araqa variant is "not a lot better" by any means
19:31:15Hannibal_SmithSo you would follow the book's style?
19:32:32AraqI think so
19:32:41Hannibal_SmithOk, thank your for the advice
19:34:44Hannibal_SmithYou can use cast on ref object right?
19:34:56Araqyou really shouldn't do that
19:35:13Araqcast and ref mixes very rarely
19:35:18Hannibal_SmithSo I have to use a ptr?
19:35:45Araqquite likely, yes
19:35:48Hannibal_SmithOk
19:56:53*shodan45 quit (Quit: Konversation terminated!)
20:05:09*Mat2 is now known as Mat2-bbl
20:12:08Hannibal_SmithAraq, talking about efficiency, I was viewing how the nimrod std handles cases like a non found value
20:12:25Hannibal_SmithIf uses exceptions, did you find that exceptions don't degrade performance
20:12:37Hannibal_SmithVersus something like C++ STL?
20:14:03Hannibal_SmithI readed, now I don't remember where, that on Linux exceptions are "free" if you don't raise
20:14:23Hannibal_Smith(for C++)
20:15:33Araqyeah well they are close to be free on many architectures
20:15:48*Mat2-bbl is now known as Mat2
20:15:53Mat2get some sleep, ciao
20:16:01*Mat2 quit (Quit: Verlassend)
20:16:28comexfwiw, in that particular case, the cost of a single well-predicted branch is likely to be pretty negligible
20:16:37comexexcept in special circumstances
20:16:48comexand of course if you do raise, there is a relatively massive cost
20:17:32Hannibal_SmithI didn't write anything that was "realtime", but for normal code
20:17:40Hannibal_SmithIMHO, it's ok to raise
20:17:55Hannibal_SmithFor example using STL, you have to check the return value
20:18:07Hannibal_SmithSo, there is a cost
20:18:33Hannibal_SmithUsing exception, you elide this checking
20:18:37comexyep, it's true
20:18:57comexthough 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:15Hannibal_SmithUhm...you are right
20:19:35comexconsidering that searching in a hash table is a fairly complex operation
20:19:43comexif you're using nimrod, i'd be more concerned about the cost of integer overflow checking
20:20:25Hannibal_SmithYes I didn't think about that
20:20:53Hannibal_SmithBut from the documentation I readed that you can disable checking on module based
20:21:11Hannibal_SmithBut yes...you have to pay it in some others module
20:22:31AraqHannibal_Smith: nimrod uses a setjmp based exception implementation when the target is C, and C++'s mechanism when the target is C++
20:23:07Hannibal_SmithDid you find some advances when targeting C++?
20:23:14Araqand overflow checking is disabled on a global level in release mode
20:23:30Araqyeah ... more efficient exception handling :P
20:23:40comexoh, it is? i forgot about that
20:23:44Hannibal_SmithOk, thank to both of you
20:24:15Araqthe disadvantage is that the 'const' in C++ is an annoying pita when generating code
20:25:52Araqspeaking about C++, how can I know whether 'a' in 'void a::b()' is a class or a namespace without a symbol table?
20:27:19Hannibal_SmithI don't know the context, but type trails?
20:28:01comexdunno, 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:05comexoh wait, your language does that too ;)
20:28:29Araqthat's not my point
20:28:40AraqI'm improving c2nim so that it can deal with C++
20:29:00Araqso I'm looking for a nice heuristic
20:29:04Araqbut I think there is none
20:29:14comexboy, trying to parse C++ without a symbol table sounds impossible
20:29:25comexsure you don't want to use libclang or something?
20:29:28Araqactually it looks quite simple
20:29:39Araqand yeah I'm sure
20:30:06AraqI don't need a full and complete and correct c++ parser
20:30:14AraqI need something that can transform header files
20:30:28Araqreasonably well
20:30:45comexyeah, but C++ header files can be very, very templately and complicated :p
20:30:53comexwell, suppose most of them aren't
20:32:54Araqin fact parsing C without symbol table is already a PITA, C++ doesn't add much complexity here
20:33:30Araqt<a, b>(x, y) is not worse than a*b
20:36:01comexyou mean (a) * b? :)
20:36:31Araqa*b is already ambiguous
20:36:45Araq(a)*b is worse though
20:36:55comexonly if it's "a*b;"
20:36:56comex:p
20:37:10comexi 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:28Araqyeah 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:13Araqjust like C's char** is translated to cstringArray which might be completely wrong
20:40:32Araqit could be a pointer to a pointer to a single char after all
20:41:21AraqC's type system is utter bullshit :-)
20:42:40Araqbut hey, according to you it's "hard" to do better than C at what C does XD :P
20:43:13comexAraq: <3
20:44:17*EXetoC joined #nimrod
20:48:54Araqcomex: 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:39Araqand good luck with writing generic code when everything has a dumped down unique verbose name
20:49:53comexwell, perl has [] for arrays and {} for hashes
20:50:02comexi think that's not a bad idea
20:51:50AraqI 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:13comexhey, if it can cause an experienced chrome engineer (not me) to get confused, I can complain about it :)
21:00:10Araqyeah but it could also be that the experienced chrome engineer didn't use proper tools :P
21:01:10BitPuffinAraq: but did the object variants work better than the other alternatives with mutability?
21:01:23AraqBitPuffin: I think so
21:05:53BitPuffinAraq: good :)
21:07:37Hannibal_SmithAt 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:43Hannibal_SmithMaybe 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:47Hannibal_Smithproc data[TKey, TData](e: TElement[TKey, TData]): ptr TData {.inline.} = cast[ptr TData](left)
21:35:52Hannibal_SmithSome questions
21:35:59Hannibal_SmithIs the cast ok?
21:36:45Araqwhat's Left?
21:36:54Hannibal_SmithAnd, do I have to write ptr, or I can simply cast to TData?
21:37:03Hannibal_Smithtype
21:37:03Hannibal_Smith TElement[TKey, TData] = object
21:37:04Hannibal_Smith key: TKey
21:37:04Hannibal_Smith data: ref TData
21:37:04Hannibal_Smith left, right: ptr TElement[T]
21:37:20Hannibal_SmithAhhh
21:37:26Hannibal_SmithI'm too tired maybe
21:37:40Hannibal_Smithtype
21:37:40Hannibal_Smith TElement[TKey] = object
21:37:40Hannibal_Smith key: TKey
21:37:40Hannibal_Smith left, right: ptr TElement[T]
21:37:55Araqlooks all very wrong to me :P
21:38:03Hannibal_SmithYes
21:38:07Hannibal_SmithSo, one moment
21:39:55Hannibal_Smith----
21:39:56Hannibal_Smithtype
21:39:56Hannibal_Smith TElement[T] = object
21:39:56Hannibal_Smith key: T
21:39:56Hannibal_Smith left, right: ptr TElement[T]
21:39:56Hannibal_Smith
21:39:58Hannibal_Smith TTree[T] = distinct TElement[T] not nil
21:40:00Hannibal_Smithproc is_not_leaf[T](e: TElement[T]): bool {.inline.} = right == nil
21:40:03reactormonkHannibal_Smith, pastebin.
21:40:04Hannibal_Smithproc has_data[T](e: TElement[T]): bool {.inline.} = left!= nil && right == nil
21:40:06Hannibal_Smithproc data[T](e: TElement[T]): ptr TData {.inline.} = cast[ptr TData](left)
21:40:08Hannibal_Smith---
21:40:33Hannibal_SmithAhhhh
21:40:36Hannibal_SmithSo many errors
21:41:00Hannibal_Smithproc data[T, TData](e: TElement[T]): ptr TData {.inline.} = cast[ptr TData](left)
21:41:02Hannibal_SmithSorry
21:41:45Araqit's 'and' and not '&&'
21:41:53Hannibal_SmithOk
21:42:53Araqand how come the left node stores the data? that's stupid you should indeed use a 'case object' instead then
21:43:14Araqand then you can use 'ref'
21:44:09Hannibal_Smithtypedef struct tr_n_t {key_t
21:44:09Hannibal_Smithkey;
21:44:09Hannibal_Smithstruct tr_n_t
21:44:09Hannibal_Smith*left;
21:44:09Hannibal_Smithstruct tr_n_t *right;
21:44:12Hannibal_Smith} tree_node_t;
21:44:21Hannibal_SmithThis is the C structure that the code define
21:44:24BitPuffindom96: have you written nginx instructions yet for jester?
21:44:33dom96BitPuffin: nope, sorry
21:44:40BitPuffindom96: get you ass on it xD
21:44:46BitPuffinnah I'm just kidding
21:44:50BitPuffinbut seriously
21:44:52BitPuffindo it
21:44:54BitPuffin:P
21:44:55dom96lol
21:45:08Hannibal_Smith*that the book define
21:45:16BitPuffindom96: is async fixed yet?
21:45:25dom96BitPuffin: Has it been broken?
21:45:31BitPuffindom96: optimized*
21:45:43dom96no
21:45:50BitPuffinah
21:45:51BitPuffinoh well
21:45:51*dom96 is busy with school again :|
21:46:00BitPuffinthe framework performs pretty nicely still
21:46:01BitPuffindom96: aw :
21:46:03BitPuffin(
21:46:13BitPuffindom96: write a software that does your homework?
21:46:15BitPuffinlol
21:46:19BitPuffinI miswrote first
21:46:22BitPuffin"homowork"
21:46:28dom96haha.
21:46:37dom96I wish it were that simple...
21:46:51BitPuffinthat's what real programmers do :P
21:46:56BitPuffinaren't you a real programmer?
21:47:09BitPuffinso you are just a scriptkiddy huh? HUH?
21:47:15Hannibal_SmithAraq, returning to the problem
21:47:16Hannibal_Smith inline data_t& data() noexcept {
21:47:16Hannibal_Smith return reinterpret_cast<data_t>(left_);
21:47:16Hannibal_Smith }
21:47:25dom96Araq: Help me, BitPuffin is bullying me :(
21:47:26Hannibal_SmithHow can I do this in Nimrod?
21:47:34BitPuffinAraq: awesome that you are improving c2nim to support cpp headers btw
21:47:47BitPuffindom96: sciipt kiddyyy scriiiiipt kiddyyy
21:47:54AraqBitPuffin: stop bullying my core devs
21:48:44BitPuffinAraq: sorry boss
21:49:10dom96*cough*
21:49:22dom96BitPuffin: What's that now?
21:49:39BitPuffindom96: awshit he's got an @ sign! ;_;
21:50:03BitPuffindom96: now who's the bully ;_;
21:50:05BitPuffin;_____________;
21:50:06dom96Respect ma authoritah.
21:50:23AraqHannibal_Smith: it doesn't make sense to use generics AND cast
21:50:23BitPuffinyes sir ;_;
21:50:30dom96good.
21:50:35BitPuffinSCRRRR
21:50:37BitPuffinnah just kidding
21:50:39BitPuffin:P
21:50:46BitPuffinanyways
21:50:46dom96:P
21:50:47Hannibal_SmithAraq, ahh now I see your point
21:51:04BitPuffindom96: what's the problem with the async btw? how can it be made to be faster?
21:51:06Hannibal_SmithSome advice?
21:51:17dom96BitPuffin: epoll.
21:51:33Hannibal_Smithtemplate <typename TKey, typename TData>
21:51:33Hannibal_Smithstruct TreeElement {
21:51:41Hannibal_SmithThis is in C++
21:51:41BitPuffindom96: does that work of freebsd?
21:52:01dom96BitPuffin: I haven't really investigated it much. Bigger problem is scaling to multiple cores I guess.
21:52:07*dunpeal joined #nimrod
21:52:10Hannibal_SmithI pass as a template the data, than do a typedef
21:52:16Araqhi dunpeal, welcome
21:52:27dom96BitPuffin: No, *bsd uses kqueues or something.
21:52:29Hannibal_SmithSo this particoal TreeElement know it's types
21:52:33Hannibal_Smith*particular
21:52:46AraqHannibal_Smith: yeah yeah, no need to be so verbose
21:52:53BitPuffindom96: will you support that too?
21:52:54dunpealthanks Araq
21:53:04BitPuffindom96: because my site(s?) will be running on freebsd
21:53:05BitPuffinexcept one
21:53:35dom96BitPuffin: Hopefully. I would like to get promises working first. Which is what I tried to do over the summer.
21:53:44BitPuffindom96: promises?
21:54:08dom96BitPuffin: futures? C#-like await async thingy.
21:54:27*BitPuffin doesn't use C#
21:54:37BitPuffinbut I recognize future
21:54:40BitPuffinisn't that a haskell thing?
21:54:47dom96it's a functional thing.
21:54:58dom96It's basically the functional answer to async callbacks.
21:55:15BitPuffinI see
21:55:19reactormonkdom96, futures?
21:55:25BitPuffinwhat's the difference?
21:55:34dom96People have been lately getting worked up over callbacks being the next goto.
21:55:40reactormonkBitPuffin, I think future is the superclass
21:55:50reactormonkdom96, if you pass functions along, why should it?
21:55:52Hannibal_Smithdom96, I think that they are right
21:56:16comexdom96: that is to say, unfairly maligned? ;)
21:56:45Hannibal_SmithSomething like nodejs today, is worker than php IMHO
21:56:48BitPuffinreactormonk: doesn't clarify enough. So future is an object?
21:56:51dom96Hannibal_Smith: I think callbacks are ok, as long as you don't nest them 50 times.
21:57:05BitPuffinreactormonk: sounds more like the OO answer to callbacks
21:57:55Hannibal_Smith*is worsen
21:58:31Hannibal_SmithBitPuffin, MS solution, it rewrite your code as a state machine
21:58:35reactormonkBitPuffin, nah, it's the functional one. you have something that doesn't respond yet, so you get a monad back.
21:58:36Hannibal_SmithIs not really OO
21:59:20Hannibal_SmithSorry
21:59:22dom96comex: Perhaps not unfairly, in some ways they are right. But they are going a bit overboard comparing it to 'goto' IMO.
21:59:49Hannibal_SmithI have misread BitPuffin
22:00:17AraqHannibal_Smith: type NodeKind = enum inner, leaf
22:00:28BitPuffingoto is overhated
22:00:36Araq TNode[TKey, TData] = object
22:00:45Araq case kind: NodeKind
22:00:52Araq of inner:
22:01:06Araq le, ri: ref TNode[Tkey, TData]
22:01:07dom96BitPuffin: It's basically a way to write code which is asynchronous in a synchronous fashion.
22:01:18BitPuffindom96: does it make sense?
22:01:21Araq of leaf:
22:01:32Araq data: TData
22:01:55Hannibal_SmithData has to be managed by the GC right?
22:01:58dom96BitPuffin: of course it does.
22:02:12Araqif you use 'ref' then yes, Hannibal_Smith
22:02:21BitPuffinhttp://eradicus.blogsome.com/2009/10/07/linus-discussion-about-goto-statements/
22:02:30Hannibal_SmithIt makes more sense to move data on the GC
22:02:34BitPuffindom96: but what happens?
22:03:24Hannibal_SmithAraq, another question, from what I can understand, GC in Nimrod i a malloc, slower
22:03:28Hannibal_SmithI'm right?
22:03:50Hannibal_SmithUhm...maybe I said something without sense
22:04:28Hannibal_SmithI did read that the GC is activated on every allocation
22:04:35dom96BitPuffin: Blocking calls will no longer block the whole program.
22:04:56BitPuffindom96: but how does it return without a result?
22:05:00Hannibal_SmithUhm...I must misread something
22:05:06Araqindeed
22:05:49AraqBitPuffin: this is a very poor statement from Linus and he doesn't know what he is talking about
22:06:05Hannibal_SmithThe cost of allocation on the GC; is the same or is slower than using malloc?
22:06:07BitPuffinAraq: why is that?
22:06:15dom96BitPuffin: The way I implemented it was using an iterator. If a blocking call happens you yield from the iterator.
22:06:34AraqI don't mind 'goto' either, but he's completely wrong
22:06:38BitPuffinAraq: 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:38Araqprove something with Hoard's logic to see why it's called "structured programming" and why it improves over goto
22:08:02BitPuffinAraq: 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:14companion_cubeyou mean Hoare logic?
22:08:23Araqyeah, sorry, typo
22:08:44companion_cubeI think using goto is reasonable in C, if only for error handling
22:09:42BitPuffindoes nimrod have goto?
22:09:57reactormonkBitPuffin, somewhat of. you can jump out of a block
22:10:06BitPuffinhmm yeah true
22:10:12BitPuffinyou can name a block and break out of it
22:10:20BitPuffinthat's very easy to read too
22:10:41BitPuffindom96: I am gonna have to understand that some other day :P
22:11:00Araqit's also still structured programming according to a paper that I lost years ago
22:11:09dom96Araq: Does c2nim not support newlines in param lists?
22:11:15BitPuffinAraq: what is?
22:11:30BitPuffindom96: I think it does
22:11:32BitPuffindom96: iirc
22:11:49AraqBitPuffin: nimrod's way of breaking out of 'block' and loops is still "structured"
22:11:53dom96oh I see the problem nvm
22:12:06BitPuffinAraq: ah
22:12:19BitPuffinAraq: I don't see why it wouldn't be
22:12:40BitPuffinalthough I guess I don't really know the definition of structured in terms of programming. Just what it sounds like :P
22:12:55dom96can I somehow translate CV_DEFAULT(x) into '= x' (i.e. default value for params)?
22:13:11Araqc2nim supports default values for params
22:13:30Araq#def CV_DEFAULT(x) = x
22:13:33Araqshould do the job
22:13:53dom96cool, thanks
22:14:09BitPuffin.cpisspiss
22:14:35BitPuffinwhat the cpp extension should have been hur hur
22:18:26brsonMat2: hi
22:28:33*Yeri joined #nimrod
22:34:57*MFlamer joined #nimrod
22:35:19Araqhi MFlamer
22:35:38MFlamerHi Araq, how's it going?
22:37:31Araqfine I guess
22:37:46Araqhow's progress on the STM front?
22:38:03AraqI know the article you linked to btw :-)
22:38:13orbitzdoes Nimrod 'compete' with Clay (seems to already have more traction at least)
22:39:05AraqI think we do compete, yes
22:39:37MFlamerPretty 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:55orbitzAlso, are there any performance numbers for Nimrod out there? It's not in the language shootout yet.
22:39:58MFlameron a manged platform, and were not using time based STM
22:40:41MFlamerI am going to try and work on getting the headers converted to .nim tonight
22:42:09Hannibal_SmithSimple tree find function: Nimrod version: http://ideone.com/qOBbwp || C++ version: http://ideone.com/zY7Fpc
22:42:32Hannibal_SmithQuestion type
22:42:35MFlamerI'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:49Hannibal_SmithWhat really happen when I write
22:43:00Hannibal_Smithmp_element = tmp_element.left <-?
22:43:06Hannibal_Smith"Copy constructor"?
22:43:41AraqMFlamer: you need to use allocShared for these things
22:44:53Araqorbitz: there are some old benchmarks somewhere and a recent one here: http://forum.nimrod-code.org/t/205
22:44:58MFlamerAraq: 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:06Araqyeah; however I think more useful would be a concurrent lock free hash map in Nimrod
22:47:09MFlameras opposed to stm?
22:47:21AraqI 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:12Araqyeah "as opposed to" or rather "should have priority over"
22:48:30orbitzAraq: thnks
22:50:09MFlamerok, I'll take a look at that.
22:51:04MFlamermaybe something that could be implemented in native nimrod instead of linking to a lib
22:51:27BitPuffinwhat's clay?
22:53:00AraqMFlamer: 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:08AraqI mean STM is not hard to do natively in Nimrod either, especially if you attach to a concrete data structure
22:55:21BitPuffinlooks 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:44Hannibal_SmithAnybody?
23:02:00fowlhello nimrods
23:02:09Hannibal_SmithHi
23:03:05BitPuffinay fowl
23:05:14*circ-user-RaRzh joined #nimrod
23:06:03Araqhi circ-user-RaRzh, how many of you circ-users are there?
23:07:23circ-user-RaRzhhi, 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:32circ-user-RaRzharaq. 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:04AraqI do not know anything about the original authors except that their C code is sometimes strange
23:14:48AraqI don't think I deliberately dropped their layout manager in my binding
23:15:35BitPuffinAraq can probably point out tons of things that are wrong with clay though haha
23:16:03Araqer ... 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:19Araqbecause that's the way people think
23:16:38BitPuffinAraq: possibly
23:16:54dom96what about the languages which are interpreted? surely those too.
23:17:05Araqwe would compete with Ruby and Python too if people would constantly compare us with them
23:17:09BitPuffinI think nimrod kind of stands up against most languages
23:17:24BitPuffinAraq: but they do lol
23:17:44Hannibal_SmithPeople don't because tooling and libs
23:17:57Hannibal_SmithAnd lack of a big name behind it
23:22:16AraqHannibal_Smith: we're getting there. slowly but steadily
23:23:30Hannibal_SmithIf people really like something like nodejs
23:23:47Hannibal_SmithSome "market" are really messed up
23:24:23Hannibal_SmithI find hilarous how, "today" people are sayng "js for high performance socket server"
23:24:41Hannibal_SmithSo, people will trust anything that read...on Stackoverflow
23:24:51Hannibal_SmithAnd I don't know how many bloggers
23:24:55Hannibal_Smith"Hype"
23:25:00circ-user-RaRzhthanks. 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:45fowlcirc-user-RaRzh, why not setup a nick name so you dont get a random one each time
23:27:57Hannibal_SmithAraq, if nodejs has risen so high with its offer, maybe it's all matter of finding what people "are searching"
23:28:46AraqHannibal_Smith: that's not how open source works. You have to create what pleases yourself, otherwise it's not going to fly.
23:29:28Hannibal_SmithAraq, 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:01MFlamerAraq: https://code.google.com/p/nbds/ this looks like what you were talking about
23:30:10logosdchanged. thanks fowl
23:30:19Hannibal_SmithUnfortunately, quality don't really matters in this equation, IMHO
23:31:08Hannibal_SmithPeople will read on Stackoverflow that Javascript can be cast as C, and will trust this
23:31:39Hannibal_SmithSo they will trust that doing callbacks it's how write a good performance socket server
23:32:53AraqMFlamer: that's a pre-alpha
23:33:34Hannibal_Smithconcurrencykit, has some good data structures
23:35:13Araqah never mind
23:35:28Araqthey refer to Click's lock free hash table
23:35:37Araqso it might be good :-)
23:36:13companion_cubeisn't nimrod's primary concurrency mechanism supposed to be message passing?
23:36:43Araqno, that's the only thing that works with thread local GCs
23:36:54Araqbut I dislike it ;-)
23:37:57companion_cubeoh
23:38:36Hannibal_SmithAraq, sorry if I insist, but http://ideone.com/RwxMXU
23:39:00Hannibal_SmithI have to repeat ref also in the function signature?
23:39:55Araqideone likely hasn't updated to 0.9.2, 'raises' came with 0.9.2
23:40:44Araqalso yeah you have to repeat the 'ref' that's why most people introduce an alias PTree[TKey, TData] = ref TTree[TKey, TData]
23:41:07Hannibal_SmithOk thank you, I think that that's all for today
23:41:23Hannibal_SmithI did appreciate your advice
23:41:49Hannibal_SmithMaybe only another question
23:42:28Hannibal_SmithThere is something like reference passing like C++?
23:42:41Araqyeah: 'var'
23:42:48Hannibal_SmithOk
23:44:25Araqgood night
23:46:00Hannibal_SmithIf you are "curious" this is the C++ version: http://ideone.com/wsqock
23:46:17Hannibal_SmithIt uses less memory per node than the Nimrod version
23:46:38Hannibal_SmithAnd uses pointer for keeping track the current "element"
23:46:56Hannibal_SmithThe bad, that is as anybody can see, more error prone
23:47:01Hannibal_SmithAnd less "visual"
23:49:29Hannibal_SmithBye
23:49:32*Hannibal_Smith quit (Quit: Sto andando via)