00:05:19 | * | flaviu1 quit (Quit: Leaving.) |
00:06:27 | * | flaviu1 joined #nimrod |
00:07:04 | * | aboutGod joined #nimrod |
00:12:10 | * | aboutGod left #nimrod (#nimrod) |
01:06:20 | dom96 | Aww. We didn't get to hear aboutGod. |
01:06:44 | Araq | he'll return |
01:07:20 | * | dom96 was going for a pun there |
01:09:02 | Araq | well you failed |
01:09:49 | dom96 | Araq: shhhh |
01:10:13 | dom96 | Araq: Just sleep |
01:11:03 | flaviu1 | \me applies chloroform |
01:11:08 | * | flaviu1 applies chloroform |
01:16:52 | Araq | good night |
01:19:16 | flaviu1 | night |
01:37:49 | * | Kazimuth joined #nimrod |
01:39:48 | Varriount | Hi Kazimuth |
01:40:29 | Kazimuth | halloo |
01:49:24 | Varriount | Hm. Should 'ptr void' be allowed? Or should the 'pointer' datatype be enforced? |
02:05:30 | fowl | not allowed |
02:13:35 | * | caioariede joined #nimrod |
02:55:17 | * | flaviu1 quit (Ping timeout: 252 seconds) |
02:55:54 | Varriount | Hi caioariede |
03:00:08 | * | epsylon quit (Ping timeout: 252 seconds) |
03:07:47 | * | superfunc joined #nimrod |
03:14:02 | * | brson joined #nimrod |
04:18:49 | * | boydgreenfield joined #nimrod |
04:19:23 | * | Demos__ quit (Read error: Connection reset by peer) |
04:22:54 | * | Jesin joined #nimrod |
04:23:10 | * | Kazimuth quit (Remote host closed the connection) |
05:00:40 | * | boydgreenfield quit (Quit: boydgreenfield) |
05:09:29 | * | brson quit (Quit: leaving) |
05:38:35 | Varriount | Araq: Do you have any plans to document the compiler internals, so newcomers will be able to more easily contribute to bug fixes? |
05:41:59 | fowl | Varriount, ptr T should dereference to T, you can't dereference void |
05:42:16 | fowl | thats my rationale |
05:42:21 | fowl | that was in the buffer for a long time |
05:42:31 | Varriount | fowl: Yes, and I agree |
06:05:01 | * | bjz quit (Ping timeout: 240 seconds) |
06:05:45 | * | bjz joined #nimrod |
06:41:04 | * | hoverbear quit () |
06:46:06 | * | boydgreenfield joined #nimrod |
07:46:41 | * | superfunc quit (Ping timeout: 252 seconds) |
08:24:35 | * | bjz quit (Ping timeout: 276 seconds) |
08:31:18 | Araq | "ptr void" is not a valid type in nimrod |
08:31:30 | Araq | the compiler needs to enforce that, that's all |
09:03:46 | * | Varriount|Mobile joined #nimrod |
09:05:17 | Varriount|Mobile | Araq: Where would the compiler enforce not using 'ptr void'? Somewhere in the semantic checking process I presume? |
09:05:31 | Araq | Varriount|Mobile: people don't read the docs we already have about the compiler's internals |
09:06:10 | Araq | I'm not sure more docs would help |
09:06:35 | Varriount|Mobile | Araq: There's no way to know that. |
09:06:53 | Araq | also it seems to me everybody needs to make the first hand experience that changes break things |
09:07:45 | Varriount|Mobile | Araq: I'm talking about documenting the procedures, constants, and variables in the compiler source code, so people have some idea what proc X does, and why it's used |
09:08:12 | Araq | most of these are in ast.nim and documented |
09:08:24 | Varriount|Mobile | Otherwise people have no idea how to go about fixing a compiler bug. |
09:08:42 | Araq | usage tracking is always trivial, we ensure nimgrep finds everything |
09:08:52 | Araq | we don't do crazy reflection stuff |
09:09:19 | Varriount|Mobile | Araq: And what of procedures? 90% of the procedures in the compiler's source code are undocumented. |
09:09:49 | Varriount|Mobile | I'm not talking about reflection.. |
09:11:22 | Varriount|Mobile | Let me put it this way: The Rust compiler code is documented very well, so it is no surprise that more than one or two people actually contribute to the compiler code. |
09:11:53 | Araq | ok then let's add docs *shrug* |
09:12:10 | Araq | The Rust compiler also has a team of professionals working on it ... |
09:12:41 | Araq | you know ... people that might even be paid to do it ... |
09:13:06 | Araq | iirc the Rust team is bigger than the Go team |
09:13:38 | Varriount|Mobile | Araq: Which I've been doing. Unfortunately, just like a newcomer, I don't know what most of the compiler procedures are for, exactly. |
09:13:39 | Araq | but that's no wonder really, they are doing language design by brute force |
09:14:18 | Araq | I'm glad they finally seem to have got a decent design though |
09:14:32 | * | Jesin quit (Remote host closed the connection) |
09:14:35 | Varriount|Mobile | Araq: Yes, but Rust is open source - They also have people *outside* that official team contributing |
09:15:33 | * | Jehan_ joined #nimrod |
09:16:12 | Varriount|Mobile | Araq: What I'm asking is that, after you've finished with your current parallelization stuff, could you please spend some time documenting the compiler internals? |
09:17:39 | Varriount|Mobile | And by documenting, I mean giving procedures doc-comments which explain what they do and what they are used for. |
09:17:43 | Araq | Varriount|Mobile: I'd rather skype with you and explain things and make you document them |
09:17:54 | Jehan_ | Heh. :) |
09:18:27 | Varriount|Mobile | Araq: If that is what is takes, I'm willing to do that. |
09:19:06 | Jehan_ | Varriount|Mobile: Since I have you here, I think the fix that you applied to queues.nim doesn't actually fix the underlying issue. |
09:19:22 | Araq | oh yeah ... Jehan_ is right |
09:19:42 | Araq | the problem is that the compiler's source code only accepts a single "friend" module |
09:20:33 | Araq | and now that exported templates are allowed to access hidden fields that overwrites the friend |
09:21:50 | Araq | hmm lets see "friend" is not a visible concept in the language |
09:22:28 | Araq | better we document it in the compiler. I'm sure people will find that comment in 75_000+ lines of code :P |
09:23:04 | Jehan_ | Araq: Somewhat unrelated, I'm also afraid that I don't have an easy solution to offer for the parseFloat issue. I still thought it was worthwhile getting the ball rolling. |
09:23:35 | Araq | Jehan_: well you did. parseFloat needs to become a builtin |
09:24:38 | Jehan_ | If you want, I can also rewrite it to remove the dependency on locale.h. |
09:24:57 | Varriount|Mobile | Araq: I'm sure someone would look in the area of procedures that deal with module exportation, if they actually knew what those procedures were. |
09:25:27 | Jehan_ | Araq: But getting around using strtod() or equivalent functionality (e.g., sscanf()), would be a major undertaking. |
09:27:35 | Araq | Varriount|Mobile: compiler/importer.nim |
09:28:02 | Araq | that's however not at all where the "friend" concept is used |
09:29:05 | Araq | Jehan_: iirc Ruby copied and adapted the code from GNU's code, but ok let's use strtod() |
09:29:38 | Araq | no idea how they could make that locale dependent though, it's a braindead design |
09:29:42 | Jehan_ | Hmm, afaik the Ruby strtod() is broken also. At least the last time I looked at it. |
09:29:49 | Jehan_ | And has nothing to do with the GNU version. |
09:29:57 | Araq | but then .NET does the same ... |
09:31:03 | Jehan_ | Don't get me started on the performance issues of StartsWith() in C# with the standard culture ... |
09:32:46 | Araq | Varriount|Mobile: I'd rather vastly improve doc/intern.txt and not document single procs |
09:33:16 | Araq | but instead give a decent overview about the things that don't change much |
09:33:28 | Varriount|Mobile | Araq: But that provides only a high level overview of the compiler architecture |
09:33:38 | Jehan_ | Now that I look at it, Ruby's current version actually uses David M. Gay's dtoa.c. |
09:34:08 | Jehan_ | Varriount|Mobile: Personally, that kind of bird's-eye view is what I'd be looking for most of the time. |
09:34:33 | Jehan_ | I can generally figure out what a piece of code does, but not necessarily how the various modules work together. |
09:35:02 | Varriount|Mobile | Araq: A lower level, more detailed set of information is needed for things like fixing bugs. |
09:36:24 | Varriount|Mobile | Jehan_: Great, tell me how I should go about fixing genRepr so that it supports generating a string description of types. |
09:36:34 | * | Matthias247 joined #nimrod |
09:37:33 | Jehan_ | Varriount|Mobile: Fair point, in an ideal world everything would be documented everywhere (and organically grown code tidied up). But with limited resources, that's what I'd like to see prioritized. |
09:38:00 | Varriount | Jehan_: Why? |
09:38:24 | Varriount | Jehan_: What does the high-level overview provide in terms of helping other's contribute to nimrod? |
09:39:08 | Jehan_ | Varriount: Because non-local properties are the aspects of any software system that are the most difficult to derive by yourself. |
09:41:31 | Varriount | Jehan_: I'm not sure I understand that statement. Could you please clarify? |
09:43:02 | Jehan_ | Varriount: Figuring out what a procedure does is generally a matter of a combination of inspecting the code plus printing its state during a few trial runs. It's a fairly straightforward procedure with limited time investment. |
09:43:32 | Jehan_ | Figuring out global (i.e., cross-module) properties and invariants is comparatively harder. |
09:44:03 | Varriount | Except when the code consists of 50-200 lines, or does something fairly generic to a node datatype. |
09:44:48 | Jehan_ | Incidentally, what I'd like to see more information on is how to effectively display parts of the compiler's internal state. |
09:45:21 | Jehan_ | Varriount: I don't disagree, but I'm talking about priorities, not an absolute either-or situation. |
09:45:40 | Varriount | Jehan_: And you are right, however your argument also supports documenting compiler procedures. |
09:45:42 | Jehan_ | Yes, you want to document unintuitive code, too (or rewrite it so that it's easier to understand). |
09:46:35 | Jehan_ | I'm talking about how to allocate finite development resources, and I don't mean to spend them exclusively on the big picture. |
09:46:42 | Araq | Jehan_: there is 'debug' for PType, PSym and PNode and 'renderTree' for PNode |
09:46:52 | Jehan_ | But that's where my priorities would lie. |
09:46:54 | Araq | and typeToString for PType |
09:47:28 | Araq | 'debug' often is overwhelming |
09:47:35 | Jehan_ | Araq: Great, we should add that information to the documentation. :) |
09:47:55 | Varriount | Jehan_: There are many compiler procedures where it is possible to see what is being done, but why it is being done and what external effects the procedure has are unclear. |
09:48:33 | Jehan_ | Varriount: Yes, and I'm not saying that this stuff shouldn't be documented. In fact, it probably should. The question is: Where do you get started? |
09:48:52 | fowl | Jehan_, the github wiki is severely underused imo |
09:49:15 | Varriount | Jehan_: By documenting procedure's as they are being changed. |
09:49:41 | Jehan_ | fowl: Probably. I have to admit, part of my problem is that I'm not a big fan of Github (yeah, I know, burn me at a stake :) ). |
09:50:17 | Varriount | Jehan_: For example, zahary and Araq could add reasonable doc-comments to each compiler procedure they touch whilst in the course of adding features, fixing bugs, etc. |
09:51:29 | Varriount | Araq, Jehan_: I have talked with people who want to use Nimrod for various projects, but have been stopped due to some bug or other. They would be willing to try and fix the bug, however they don't know where to start. |
09:52:53 | Varriount | At best they have a stack trace to follow, and are dumped into an undocumented area of the compiler source code. At worst, they know what is wrong, but have no idea how to go about fixing the bug. |
09:53:07 | Jehan_ | Varriount: Yeah, I completely sympathize. That's also a problem I run into myself often enough. |
09:53:24 | Varriount | The latter situation, I must admit, is something that a higher level explanation would help with. |
09:53:37 | fowl | better errors would be nice |
09:53:57 | fowl | i want to know what line caused the compiler to segfault so i can fix it :D |
09:54:03 | fowl | my line |
09:54:13 | Varriount | fowl: koch boot --stackTrace:on |
09:54:26 | Jehan_ | Varriount: My biggest problem has always been being able to inspect the compiler's state for that. |
09:54:28 | fowl | Varriount, *my line* |
09:54:54 | Jehan_ | fowl: That information is not always easy to extract. |
09:55:00 | Varriount | fowl: Then print out the info of the node, type, or piece of program ast nearest to the segfault. |
09:56:18 | Jehan_ | fowl: You can get the lineinfo out of the AST (which is a tree of PNode/TNode in ast.nim). |
09:56:27 | fowl | segfault might require that, i should get line info from internalasserts though |
09:57:16 | EXetoC | --stackTrace:on is the default I think. anyway, I use 'koch temp' when debugging |
09:58:15 | EXetoC | which generates bin/nimrod_temp |
10:00:46 | Varriount | Here's what I've been using, I'm sure there's a bash equivalent: " (koch temp -d:debug) && (.\bin\nimrod_temp.exe c --run testcase.nim) " |
10:03:36 | Araq | alright will document things |
10:03:55 | Araq | let's see if it helps |
10:04:04 | Araq | need to go see you later |
10:06:09 | EXetoC | Varriount: I don't think 'debug' is used for anything, but you are indeed omitting release |
10:06:53 | Varriount | EXetoC: debug makes the compiler output a stacktrace when a regular error is thrown (like a syntax error) |
10:08:16 | EXetoC | gonna see if that's mentioned anywhere. couldn't find anything with grep |
10:08:34 | Varriount | EXetoC: msgs.nim |
10:09:23 | Varriount | Line 729 |
10:10:05 | EXetoC | my search was to specific. I expected 'when' to be used |
10:20:24 | * | ehaliewicz quit (Remote host closed the connection) |
10:24:24 | fowl | what is defined while bootstapping? Is it `bootstrapping`? |
10:24:50 | Varriount | I think it's 'booting' |
10:25:51 | * | silven joined #nimrod |
10:34:05 | dom96 | 'morning |
10:34:28 | Varriount | dom96: Morning. Want to chat on the VNUG? |
10:35:11 | dom96 | Varriount: Sure, but give me a couple of minutes, need to grab some food |
10:36:50 | Varriount | Hi silven |
11:09:37 | silven | yo |
11:35:41 | Varriount | Araq: How should I go about allowing or disallowing repr to accept typedesc? |
11:51:11 | Jehan_ | Varriount: Out of curiosity, what do you want repr() to output for types? More than typetraits.name? |
11:51:54 | Varriount | Jehan_: Probably the type name, plus the underlying value of the type (an int?) |
11:53:10 | Jehan_ | Varriount: I was mostly curious about the use case you had in mind and why you needed more than overload repr with proc repr(t: typedesc): string = t.name |
11:53:14 | Varriount | Jehan_: Also, part of the reason 1.type.repr fails also causes type(int) to fail |
11:53:42 | Jehan_ | Ah, I see. |
11:53:46 | Varriount | Jehan_: I don't have any use case in mind, other than preventing a compiler error and providing a more user-friendly experience. |
11:55:20 | Jehan_ | Well, the above would give you an implementation for repr(), but doesn't fix the error with type(int). |
11:56:13 | Varriount | Jehan_: Yes, but the above implementation is a userspace fix. Shouldn't this kind of fix be part of the compiler code? |
11:56:14 | EXetoC | aren't both the same typedesc? |
11:56:32 | EXetoC | nvm |
11:56:51 | Jehan_ | I'd have to check, but in principle I think it could be stuffed in system.nim (yeah, I know). |
11:57:20 | EXetoC | int.type is typedesc[int] |
11:57:39 | Varriount | EXetoC: How do you know that? |
11:58:21 | EXetoC | Varriount: because I'm assuming that the error message when passing it to echo is correct |
11:58:44 | EXetoC | and, int.type is 1.type |
11:59:06 | Varriount | EXetoC: Try echo(type(int)) |
11:59:40 | EXetoC | that's what I meant. Error: type mismatch: got (typedesc[int]) |
12:00:10 | Varriount | EXetoC: The error is erroneous |
12:00:22 | EXetoC | and echo(int.type is 1.type)? |
12:01:06 | Varriount | EXetoC: The compiler is only checking the 'int' part for some reason. If you change it to echo(type(int)), you get an internal error. |
12:03:32 | EXetoC | I tried that like I said; it prints true |
12:04:20 | EXetoC | ehm |
12:04:59 | EXetoC | I was confusing the two. it gives me the error that I just showed you |
12:05:34 | Jehan_ | The following seems to work: proc `type`(t: typedesc): typedesc = typedesc[t] |
12:05:55 | Jehan_ | Not sure if overloading `type` like that doesn't break something else, though. |
12:06:23 | Varriount | Jehan_: Again, it's a question of, should these things be in 'userspace', as part of the standard library, or 'compilerspace'? |
12:06:56 | Jehan_ | Varriount: If it doesn't make a difference, I'm not sure it matters. |
12:07:27 | Jehan_ | I'm more worried about overloading type or repr breaking something in a very subtle fashion. |
12:07:38 | EXetoC | Jehan_: type(int) works for me as I said. can you show me what it is that fails? |
12:08:15 | EXetoC | Jehan_: you could at least run the test suite. unfortunately it's hard to keep track of things since so many tests fail already |
12:08:46 | Jehan_ | EXetoC: No idea, I was simply accepting that it broke. |
12:09:06 | Jehan_ | And this is something where I wouldn't blindly rely on the test suite. |
12:09:47 | Jehan_ | Hmm, "var t = int.type" does break, but that looks more like the type inference algorithm getting confused. |
12:10:27 | Jehan_ | Speaking of which, "internal error: GetUniqueType" happens in a lot of places if you use templates. |
12:10:46 | Jehan_ | Is it really an internal error or something that should be promoted to a proper error? |
12:11:00 | EXetoC | it does. testing things with echo is a little quirky |
12:11:58 | Jehan_ | Almost everytime I've gotten it, it means that the compiler couldn't infer a type, and that's normally possible. But an internal error doesn't help you locating where things go wrong in your source code. |
12:12:08 | Varriount | Anyone know what GetUniqueType is actually supposed to do? |
12:12:22 | * | untitaker quit (Ping timeout: 245 seconds) |
12:12:46 | EXetoC | yeah and all internal errors are bugs |
12:14:43 | Jehan_ | EXetoC: In theory, yes, but I'm wondering if that one actually is a bug. |
12:14:59 | Jehan_ | As far as I can tell, it's hardly a "this can't happen" thing. |
12:15:28 | EXetoC | right |
12:16:39 | Jehan_ | Well, it may be one in some subcases. |
12:17:10 | Jehan_ | I'm looking at the code right now, and it seems to be something that can be both an internal error and a real error. |
12:17:23 | Jehan_ | I suspect that reporting it as a real error would still be preferable. |
12:17:39 | Jehan_ | Now to figure out how the compiler generates error reports … :) |
12:18:01 | Varriount | Jehan_: As far as I can tell, parts of the C codegen use getUniqueType to get a C type |
12:18:34 | Jehan_ | Varriount: Yup. As I said, it seems like it can be both. |
12:18:37 | * | untitaker joined #nimrod |
12:24:35 | Jehan_ | Anyhow, I'll have to look at this later. See you around. :) |
12:24:38 | * | Jehan_ quit (Quit: Leaving) |
12:31:36 | * | darkf quit (Quit: Leaving) |
12:44:54 | * | boydgreenfield quit (Quit: boydgreenfield) |
12:50:32 | NimBot | nimrod-code/csources master 0a6e575 Dominik Picheta [+0 ±35 -0]: Rebuilt for powerpc at Araq/Nimrod@b3a39524eef |
12:52:27 | NimBot | Araq/Nimrod devel b386d38 Dominik Picheta [+0 ±1 -0]: Add asyncdispatch.unregister. |
12:52:27 | NimBot | Araq/Nimrod devel d54b902 Dominik Picheta [+0 ±1 -0]: Modified future behaviour when completing with an exception.... 3 more lines |
12:52:27 | NimBot | Araq/Nimrod devel b436636 Dominik Picheta [+0 ±1 -0]: Clean createVar template. |
12:52:27 | NimBot | Araq/Nimrod devel 225d4f4 Dominik Picheta [+0 ±1 -0]: Added powerpc to the list of CPUs that C sources are built for. |
13:14:58 | * | silven quit (Remote host closed the connection) |
14:00:44 | * | flaviu1 joined #nimrod |
14:18:41 | * | flaviu1 quit (Quit: Leaving.) |
14:18:52 | * | flaviu1 joined #nimrod |
14:20:14 | * | flaviu1 quit (Remote host closed the connection) |
14:20:28 | * | flaviu1 joined #nimrod |
14:23:59 | * | flaviu1 quit (Client Quit) |
14:30:36 | * | flaviu1 joined #nimrod |
14:37:31 | * | Varriount|Mobile quit (Read error: Connection reset by peer) |
14:44:14 | * | q66 joined #nimrod |
14:44:27 | * | q66 quit (Changing host) |
14:44:27 | * | q66 joined #nimrod |
15:13:19 | * | xenagi joined #nimrod |
15:34:19 | * | kunev joined #nimrod |
15:35:12 | NimBot | Araq/Nimrod devel f10f9c4 Varriount [+0 ±1 -0]: Update selectors.nim... 2 more lines |
15:53:30 | * | silven joined #nimrod |
15:55:52 | Varriount | Araq: ping |
16:00:01 | * | hoverbear joined #nimrod |
16:14:57 | BitPuffin | Varriount: it ain't gonna happen |
16:19:50 | * | caioariede quit (Ping timeout: 252 seconds) |
16:20:24 | NimBot | Araq/Nimrod devel 1d6c05e Varriount [+0 ±1 -0]: Update selectors.nim |
16:30:10 | * | caioariede joined #nimrod |
16:34:47 | * | wan quit (Quit: WeeChat 1.0-dev) |
16:40:59 | Araq | flaviu1: octal and hex parsing should also not raise overflows ... it makes no sense to use the same algorithm for all these |
16:44:25 | * | flaviu1 quit (Ping timeout: 276 seconds) |
16:48:37 | Araq | Varriount: the rename of considerAcc to considerAccent is poor, sorry |
16:48:55 | Araq | rename it to considerQuotedIdent |
16:57:41 | * | Jehan_ joined #nimrod |
16:59:37 | Araq | Jehan_: getUniqueType computes a unique type so that tuple[a, b: int] and tuple[x,y: int] produce the same C struct |
17:00:01 | Jehan_ | Araq: Yeah, I saw that part. |
17:00:17 | Araq | we have no line info here so we bail out with an internal error |
17:01:18 | Araq | the compiler used to prevent crazy things like 'var foo = int' but then zahary decided it's good to allow everything everywhere for some poor misguided C++ developer who wants to perform arbitrary computations on types |
17:03:16 | Araq | same thing for "ptr void" |
17:03:31 | Araq | oh and proc (int, int) |
17:03:46 | Jehan_ | I see. |
17:04:13 | Jehan_ | Yeah, I was looking at how to figure out the line info and couldn't find any good way to do it. |
17:17:12 | EXetoC | Araq: it behaves like a normal var? |
17:19:27 | EXetoC | a typedesc var does indeed seem like a strange concept. are typedesc parameters different? |
17:21:45 | * | Demos_ joined #nimrod |
17:23:16 | Araq | EXetoC: it's a var of type typedesc[int] then |
17:23:25 | Araq | and shouldn't end up in the codegen |
17:23:32 | Araq | guess what ... it alsways does |
17:26:15 | EXetoC | ok.. |
17:26:48 | EXetoC | yeah but does it behave like one? assigning to one seems pointless |
17:28:08 | Araq | oh it's not check the manual for an example |
17:28:20 | Araq | it implements a typesafe printf |
17:28:50 | Araq | it's however a misfeature for all the people who confuse : and = |
17:28:59 | Araq | of which we have a lot |
17:33:35 | * | vendethiel quit (Quit: q+) |
17:36:45 | EXetoC | right |
17:37:04 | EXetoC | type foo = ...? |
17:42:05 | Araq | you're so inconsistent |
17:42:29 | Araq | I asked my mum and she doesn't know what "type" means |
17:42:44 | EXetoC | #_# |
17:44:15 | EXetoC | but that depends on whether or not assignments should work in addition to initializations |
17:44:35 | * | ehaliewicz joined #nimrod |
17:45:38 | * | flaviu1 joined #nimrod |
17:50:35 | flaviu1 | Araq: I disagree about it not making sense to use the same code for variable radix parsing, but other than that, the point of raising overflows is to let the compiler deal with it so that my code isn't obfuscated by overflow checking. |
17:51:43 | * | vendethiel joined #nimrod |
17:52:27 | EXetoC | ok enough with the speculation. anyway, we're still not at 1.0 so fix the inconsistencies. just pull of the band-aid quickly :p |
17:55:48 | * | vendethiel quit (Client Quit) |
17:59:51 | * | silven quit (Remote host closed the connection) |
18:02:07 | * | silven joined #nimrod |
18:08:56 | dom96 | Araq: Is 4K the optimal buf size? https://github.com/Araq/Nimrod/pull/1221 |
18:11:16 | Araq | dom96: depends |
18:11:42 | Araq | it's just that an exact multiple of 4096 is pretty bad for the allocator |
18:11:53 | Araq | that loses a full page due to alignment |
18:12:05 | Araq | if you don't use alloc it doesn't matter much |
18:12:26 | dom96 | yeah, that's what I remembered. |
18:16:36 | dom96 | Araq: Rewrite this using your fancy spawn: http://play.golang.org/p/RdbPXQcZHi |
18:20:12 | Araq | dom96: easy |
18:20:27 | Araq | and I don't have to use continuation passing style to do it |
18:20:31 | dom96 | Good, we should add that code sample to the site |
18:21:16 | * | flaviu1 quit (Ping timeout: 276 seconds) |
18:22:26 | dom96 | Is spawn ready for such code? |
18:22:36 | Araq | yes |
18:22:45 | Araq | well I just renamed everything :P |
18:22:48 | Araq | but yes |
18:24:26 | dom96 | cool cool |
18:46:03 | * | kunev quit (Ping timeout: 252 seconds) |
18:48:05 | Jehan_ | dom96: This example is pretty trivial even if you were to use raw POSIX threads. |
18:49:07 | dom96 | I'm sure it is. Trivial examples make good showcases. |
18:50:09 | Jehan_ | And I'm still struggling with the idea that Go managed to sell people on its extremely primitive channels as a novel concurrency model. |
18:54:24 | Jehan_ | You could get 90% of the functionality in C++ by wrapping a deque in a mutex + condition variable. I.e., roughly five minutes of coding involved. |
18:55:05 | vegai | Jehan_: marketing. |
18:55:37 | Jehan_ | vegai: You misspelled "snake oil". :) |
18:57:07 | dom96 | I think that for most people it's not about the language, it's about the fact that Google made it and thus it must be great. |
18:57:51 | Jehan_ | dom96: Then why isn't Dart getting more attention? |
18:58:01 | vegai | because Dart sucks while Go does not? :) |
18:58:15 | Jehan_ | Eh, it doesn't? |
18:58:37 | Jehan_ | It's not designed for the same use cases, of course. |
18:58:37 | dom96 | Dart certainly gets attention. |
18:58:56 | dom96 | Notch uses it for example |
18:59:18 | Jehan_ | My point was that from a language design and implementation perspective, Dart is by far the more interesting and ambitious project. |
18:59:25 | Araq | Jehan_: people think Clojure and Go will "easily run" on GPUs because of their "great" concurrency models |
18:59:27 | EXetoC | dom96: do you think nimrod_init in gtk2 is a good name? overloading init seems fine |
18:59:44 | Araq | EXetoC: please keep the name |
18:59:55 | dom96 | EXetoC: It's fine, changing it now will break lots of code. |
19:00:18 | Jehan_ | Araq: Well, Clojure actually does novel things. |
19:00:37 | Jehan_ | I'm not a huge fan of LISP syntax, but that's personal preference. |
19:01:00 | vegai | novel things do not a successful language make |
19:01:16 | Araq | Jehan_: like what? |
19:01:35 | Jehan_ | vegai: True. But it means that the language is at least worth looking at. |
19:02:23 | Jehan_ | Araq: Like trying to get STM to work. I don't think it'll work out in a meaningful way, but I may be wrong, and at least they're trying to push the envelope. |
19:02:57 | Jehan_ | Whereas Go has a concurrency model that was outdated when Occam-2 was designed. |
19:03:46 | Jehan_ | I wouldn't have a problem if Go, say, actually did CSP right. Simple is often good. But it doesn't even rise to that level. |
19:04:45 | vegai | might it have been intended? Go isn't Rob Pike's first concurrent language after all |
19:05:03 | vegai | I think Limbo had an identical mechanism |
19:05:11 | Jehan_ | When you send a reference through a Go channel, the underlying object doesn't get copied. |
19:05:12 | vegai | and then there was newsqueak |
19:05:49 | Jehan_ | Which means that you're exposing yourself to race conditions, the exact thing you usually use channels to avoid. |
19:06:21 | Araq | Jehan_: I argued with STM doesn't solve anything :P |
19:06:24 | Araq | *that |
19:06:52 | Jehan_ | vegai: The problem isn't using channels to communicate. That's a fine model with many desirable properties. The problem is having a broken implementation of channels. |
19:08:12 | Jehan_ | Araq: I don't necessarily disagree (and note that I've published a few papers on STM). That doesn't mean that I can be certain I'm right, which is why I happy that people keep experimenting with it even though I don't think it's currently workable. |
19:10:31 | EXetoC | dom96: ok but there are alternatives |
19:10:33 | Jehan_ | I think that the Clojure people may be making a mistake by experimenting with a mix of way too many concurrency paradigms rather than picking one and perfecting it. But again, that's something that I can't be certain about. |
19:11:12 | Matthias247 | I think that Go sucks while Dart is cool ;) |
19:12:00 | Araq | the Clojure guys assume that a perfect shared memory GC is possible and built everything onto that. Incidentically they are right. :P |
19:12:13 | Araq | *upon that |
19:12:46 | EXetoC | dom96: remove, deprecate or keep forever |
19:13:02 | Jehan_ | Araq: It's definitely possible. If you have the developer resources IBM has, that is. :) |
19:13:32 | Araq | OrionPK: your template system now works for me, let me push my fix |
19:14:34 | Jehan_ | And you can get a pretty decent shared memory GC with much less if you aren't too demanding on your real time requirements. |
19:17:03 | Jehan_ | Interesting, the Unity people are writing a CIL->C++ compiler. |
19:17:33 | dom96 | EXetoC: just keep it |
19:19:42 | Araq | now if only I could find the bug number ... |
19:21:39 | BitPuffin | go is fine it's just not really relevant |
19:24:46 | NimBot | Araq/Nimrod devel b230303 Araq [+3 ±1 -0]: fixes the bug that keeps the template engine package from working |
19:24:46 | NimBot | Araq/Nimrod devel 04a1555 Araq [+1 ±30 -1]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel |
19:24:55 | * | askatasuna joined #nimrod |
19:32:42 | EXetoC | dom96: not that it's an intrusive change, but ok.. |
19:33:00 | EXetoC | now to figure out how to expand the text view but not the input widget below |
19:36:23 | * | Kazimuth joined #nimrod |
19:40:06 | EXetoC | homogenous = false |
19:40:44 | dom96 | what are you writing? |
19:41:09 | EXetoC | who knows |
19:43:43 | EXetoC | have you thought some more about other widget engines? we should decide which one is worthy of a high level interface |
19:44:52 | * | ehaliewicz quit (Ping timeout: 245 seconds) |
19:46:57 | * | flaviu1 joined #nimrod |
19:52:29 | flaviu1 | Araq: I agree that that patch wasn't very good, but do you have any idea why it worked when it shouldn't have? |
19:53:09 | Araq | no |
19:53:16 | Araq | I think you're wrong |
19:53:37 | Araq | and you had some old version of the compiler lying around or something |
19:53:39 | * | vendethiel joined #nimrod |
19:54:11 | NimBot | Araq/Nimrod devel ab5f227 Araq [+0 ±1 -0]: pdcurses wrapper compiles again |
19:56:45 | flaviu1 | Araq: I just pulled the freshest version, it fails without that patch and succeeds with it. |
19:58:03 | Araq | flaviu1: what's the original diff again? |
19:58:17 | Araq | I mean the patch you applied to get `1/2` to work |
19:59:05 | flaviu1 | Araq: https://github.com/flaviut/Nimrod/commit/a568c6102fdc29074ddd7309544c0487dfecb25c |
20:01:01 | Araq | ah I see |
20:01:15 | Araq | if name[0] in 'a'..'z': might indeed trigger some unknown bug |
20:01:28 | Araq | if name[0] in {'a'..'z'}: shouldn't |
20:02:03 | Araq | bah, toLower |
20:02:15 | Araq | when you already know it's an upper cased letter |
20:02:28 | Araq | the old version was much better |
20:02:36 | Araq | it teaches people how to program |
20:03:05 | flaviu1 | Araq: Yeah, I overlooked that I could have just done toUpper instead of checking the range |
20:04:12 | Araq | what's wrong with c - 'a' + 'A' anyway, it's a natural solution |
20:04:40 | Araq | could have masked the 7th bit instead |
20:04:45 | flaviu1 | It isn't very readable and it also becomes obfuscated with the ords mixed in |
20:04:49 | Araq | that would be obfuscation :P |
20:05:16 | * | Jehan_ quit (Quit: Leaving) |
20:05:24 | flaviu1 | The compiler probably optimizes it down to that anyway |
20:05:45 | Araq | yeah sure |
20:07:43 | Araq | btw don't you dare to use pegs in strutils, we try to avoid unnecessary dependencies |
20:08:00 | Araq | also efficiency is a concern in a *standard* library |
20:08:15 | Araq | and yes. it is MORE important than "clean" code |
20:09:30 | flaviu1 | Araq: Where did I mention pegs? I can't remember |
20:09:41 | Araq | in some commit message perhaps |
20:12:34 | flaviu1 | Araq: I see; yes, that would probably be overkill unless pegs had an amazing optimizer |
20:13:57 | Araq | flaviu1: even it gains an amazing compile-time optimizer, the user pays for it with increased compile times |
20:14:15 | Araq | in the long run we'll get that and also compiler caching so that it doesn't matter |
20:14:30 | Araq | but in the long run we're also all dead |
20:15:06 | Araq | hmm variations of |
20:15:10 | Araq | var d = 'z' |
20:15:11 | Araq | echo d in 'a'..'z' |
20:15:15 | Araq | all work for me |
20:18:48 | flaviu1 | Araq: What about `if d in 'a'..'z':`? |
20:20:06 | Araq | works in an 'if' too |
20:25:31 | flaviu1 | I've copied the methods out exactly, I can't reproduce it anywhere but in the compiler |
20:27:31 | Araq | check the generated C code please then |
20:28:43 | caioariede | hey guys, what's the best approach to inspect the content of a variable? |
20:28:57 | EXetoC | repr? |
20:29:18 | caioariede | var x: typedesc = int; echo(repr(x)) ? |
20:30:00 | caioariede | I'm getting -- Error: internal error: GetUniqueType |
20:30:06 | EXetoC | doesn't work with typedesc |
20:30:18 | EXetoC | see typetraits.name |
20:32:50 | flaviu1 | Araq: https://gist.github.com/flaviut/c34396eab67a83a99546 |
20:35:06 | Araq | flaviu1: well it looks correct to me |
20:35:08 | flaviu1 | The generated code looks fine |
20:39:30 | Araq | flaviu1: check out tslice475623's definition please |
20:40:19 | flaviu1 | Araq: Its correct |
20:40:31 | flaviu1 | but refresh the page anyway |
20:42:25 | flaviu1 | Araq: I got it to reproduce |
20:42:38 | * | njoejoe` joined #nimrod |
20:42:51 | Araq | well? |
20:43:19 | flaviu1 | https://gist.github.com/flaviut/2d97efdc99ee97528ba7 |
20:43:49 | * | njoejoe quit (Ping timeout: 240 seconds) |
20:44:04 | flaviu1 | It works fine on 'auto', but it fails on 'Union' |
20:44:27 | Demos_ | does it fail for union as well? |
20:44:34 | flaviu1 | Demos_: Nope |
20:44:42 | Demos_ | WTAF |
20:44:54 | flaviu1 | If it starts uppercase, it gets lowecased somehow |
20:45:05 | caioariede | I'm trying to use the module tables to store some generic values but I'm getting some errors. I'm missing something? -- https://gist.github.com/caioariede/9986786099eef53e093a |
20:45:12 | flaviu1 | if its lowercase, it gets uppercased |
20:46:07 | Araq | flaviu1: well the code works as you wrote it |
20:46:11 | flaviu1 | caioariede: ContextValue doesn't have a T |
20:46:16 | flaviu1 | on line 16 |
20:46:33 | flaviu1 | err 17 |
20:46:35 | Araq | you check *name* and not *result* after all |
20:46:49 | caioariede | it should be initTable[string, ContextValue[T]]() ? |
20:47:38 | flaviu1 | caioariede: You can't get a T out of thin air, try TObject |
20:48:21 | Araq | flaviu1: your code with if name[0] in {'a'..'z'}: produces the same output |
20:49:07 | flaviu1 | Araq: I really failed there :facepalm: |
20:51:19 | flaviu1 | Wow, really sorry about that |
20:51:36 | caioariede | flaviu1: yeah.. it worked, but then it's not generic anymore. Look, I updated the example: https://gist.github.com/caioariede/9986786099eef53e093a |
20:52:22 | caioariede | I think I'm not in the right path, maybe I need to use something different than the tables module :( |
20:52:39 | Araq | flaviu1: don't worry, you can always blame the 1 letter variables or the fact that the 3 line implementation of 'mangleField' has no comments |
20:52:48 | Araq | sorry... I'm still pissed |
20:53:29 | * | xenagi quit (Quit: Leaving) |
20:55:07 | flaviu1 | Araq: I've already stopped mentioning 1 letter variables, but that was really embarrassing. Really sorry for wasting your time |
20:56:51 | Araq | flaviu1: you didn't waste it, we found the bug quickly. |
20:57:23 | EXetoC | :p |
20:57:48 | Araq | annoying is that people blame me for their very own incompentence |
20:58:10 | Araq | sorry to be harsh, but in lots of respects nimrod pushes the state of the art |
20:58:21 | Araq | and all I get back is "ooh this in confusing" |
20:58:34 | Araq | and "ooh, I don't understand it, so it must be your fault" |
20:59:18 | * | bjz joined #nimrod |
20:59:24 | Araq | take lambda lifting for example |
20:59:31 | Araq | yes the code IS really complex |
20:59:41 | Araq | there have been books written about it though |
20:59:56 | Araq | maybe it's an inherently complex problem then? |
21:13:58 | flaviu1 | caioariede: You can't make something with variable sized elements |
21:15:07 | flaviu1 | You could make it a table of pointers, although I think you would need some ugly casting |
21:15:23 | caioariede | flaviu1: yeah.. I'm close to this |
21:15:25 | caioariede | https://gist.github.com/caioariede/9986786099eef53e093a |
21:15:48 | EXetoC | you can have heterogenous types with fixed sizes. variants we call it |
21:15:54 | caioariede | is it possible to store the type of the object? |
21:15:59 | caioariede | look line 7 |
21:16:54 | caioariede | for example: ContextValue(value: "bar", kind: string) -- is it possible to store "string" in a field for later type casting? |
21:17:31 | Araq | caioariede: what do you really want to achieve? a "context" is not really a meaningful name |
21:18:00 | Araq | (yeah the compiler uses it everywhere too, spare me) |
21:18:10 | EXetoC | caioariede: http://build.nimrod-lang.org/docs/manual.html#object-variants |
21:18:17 | flaviu1 | caioariede: http://build.nimrod-lang.org/docs/typeinfo.html , the compiler stores the type information already |
21:18:30 | flaviu1 | but I'm not sure of practicality. |
21:18:46 | Araq | flaviu1: marshal.nim uses typeinfo |
21:19:43 | caioariede | Araq: I'm trying to create a key-value dictionary where the values are from different types (int, string, objects, etc...) |
21:20:10 | dom96 | Araq: What plans are there, if any, for making stack traces nicer when using macros? |
21:20:19 | flaviu1 | caioariede: Are the types you need to support open-ended? |
21:20:44 | flaviu1 | Ex, does client code need to be able to use types that haven't been already added? |
21:20:50 | Araq | dom96: well I am still not sure what the real problem is |
21:20:51 | dom96 | caioariede: You could use the json module for this |
21:20:59 | Araq | dom96: I think it's simply a bug somewhere |
21:21:42 | dom96 | Araq: There are possibly two different problems. |
21:22:08 | dom96 | Araq: One is likely a bug, but the other is the repetition of 'cb' in the stack trace. |
21:22:24 | flaviu1 | caioariede: https://gist.github.com/95b7b7cfcc318135e45f works, very ugly though |
21:23:17 | dom96 | flaviu1: You shouldn't need a cast there |
21:23:23 | dom96 | type conversion should suffice |
21:23:42 | flaviu1 | variant types combined with the typeinfo module should get you want you want |
21:24:00 | flaviu1 | dom96: Shouldn't and don't are different things :P |
21:24:37 | caioariede | yeah... my only concern is that then, I'll need to know which types I'll need to cast to |
21:25:39 | dom96 | I think using PJsonNode or creating something similar to it should be enough for your needs |
21:27:41 | flaviu1 | dom96's suggestion is the best, you'll just end up reinventing PJsonNode otherwise |
21:28:18 | caioariede | I'm looking to it, thank you guys. |
21:29:44 | flaviu1 | Araq: Keep in mind that people don't tend to feel strongly enough about the things they like to mention it, but feel very strongly against things they don't like |
21:34:19 | * | bjz quit (Ping timeout: 240 seconds) |
21:39:01 | caioariede | dom96: flaviu1: yeah.. PJsonNode doesn't fit my needs.. I need to store object references too, not just strings and integers :( |
21:41:38 | dom96 | caioariede: Copy the implementation and add an ObjRef kind |
21:42:28 | caioariede | dom96: look my current implementation: https://gist.github.com/caioariede/9986786099eef53e093a |
21:42:38 | caioariede | is it possible to store the type of the value? |
21:42:43 | caioariede | for example, kind: typedesc |
21:42:57 | caioariede | then later I know to which type to cast |
21:43:05 | dom96 | I don't think so |
21:43:16 | dom96 | You can't store type descs at runtime IIRC |
21:43:31 | EXetoC | enumerators won't do? |
21:46:35 | Araq | well you know ... TAny already exists, caioariede |
21:46:55 | Araq | which does what you're after |
21:57:44 | flaviu1 | caioariede: I think the best you can do is throw an error when the client code gets the types wrong |
22:00:34 | flaviu1 | It seems that the GC stores the type information in a way that isn't suitable for your purposes, maybe a macro that stores the type information a runtime as a hash? |
22:01:11 | Araq | or maybe read what the nimrod's creator has to say about this topic |
22:01:29 | Araq | "well you know ... TAny already exists, caioariede |
22:01:33 | Araq | which does what you're after" |
22:02:15 | Araq | nimrod has RTTI and TAny makes use of it |
22:03:13 | flaviu1 | Araq: For my own use, is there any way to get some sort of unique identifier for a type at runtime? |
22:04:22 | Araq | system.getTypeInfo returns a pointer |
22:04:52 | Araq | some people say you can cast a pointer to an 'int' and get an ID-like value |
22:05:51 | caioariede | Araq: it worked quite well! :) https://gist.github.com/caioariede/9986786099eef53e093a |
22:06:09 | caioariede | I can retrieve strings and ints using getString and getInt (after checking the type with akString and akInt) |
22:06:22 | caioariede | is there a way to get an object? It seems there's no getObject proc |
22:06:40 | flaviu1 | I thought that each object had its own copy of the TypeInfo, but its much more useful if its global. |
22:07:53 | flaviu1 | Thanks |
22:09:00 | Araq | caioariede: you can iterate over all the fields in an object with the API |
22:09:46 | caioariede | is the getObject proc really missing or it's proposital? |
22:12:27 | NimBot | Araq/Nimrod devel 1d0175e Grzegorz Adam Hankiewicz [+0 ±2 -0]: Adds explicit titles to documentation index. |
22:12:27 | NimBot | Araq/Nimrod devel d33edd2 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds documentation sections to the index. |
22:12:27 | NimBot | Araq/Nimrod devel 400dd20 Grzegorz Adam Hankiewicz [+0 ±2 -0]: Splits index into documents and APIs. |
22:12:27 | NimBot | Araq/Nimrod devel 5962119 Grzegorz Adam Hankiewicz [+0 ±2 -0]: Moves TOC index entry generation to rstgen module.... 3 more lines |
22:12:27 | NimBot | 20 more commits. |
22:12:54 | Araq | caioariede: what should a getObject return? |
22:13:38 | Araq | what type should that object have then? keep in mind inheriting from TObject is optional |
22:14:15 | caioariede | k |
22:14:51 | * | ehaliewicz joined #nimrod |
22:15:53 | OrionPK | araq it looks like some of my template code is working btw |
22:16:02 | OrionPK | just the tests in the lib itself aren't working |
22:16:14 | * | ehaliewicz quit (Remote host closed the connection) |
22:16:22 | Araq | OrionPK: well look at my commit, I added your tests to the test suite |
22:16:42 | OrionPK | I havent even gotten latest yet, running off a couple weeks back I think |
22:16:59 | Araq | well I fixed it today |
22:17:16 | OrionPK | getting latest again |
22:17:24 | OrionPK | cool! good to hear |
22:17:28 | Araq | ping Varriount |
22:18:31 | OrionPK | araq yep, passed! thanks :) |
22:18:54 | Araq | OrionPK: well look at how I fixed it |
22:19:01 | OrionPK | Im going to work on a babel release as I have time |
22:19:07 | OrionPK | hmm? |
22:19:13 | Araq | a suprising oversight |
22:19:15 | OrionPK | which commit? |
22:19:33 | Araq | simply forget to add 'tyChar' to the list of things that are kept in a VM register |
22:19:37 | OrionPK | well, hopefully my tests help things stay robust as the vm evolves |
22:19:37 | Araq | *forgot |
22:20:19 | OrionPK | oops |
22:33:52 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:40:59 | * | boydgreenfield joined #nimrod |
22:44:54 | Araq | good night |
22:46:34 | NimBot | Araq/Nimrod new_spawn 030eac8 Araq [+0 ±7 -0]: bugfix: regionized pointers in a generic context; renamed 'Future' to 'Promise' |
22:58:50 | * | ehaliewicz joined #nimrod |
22:59:49 | Varriount | Araq: Any other issues that I could possibly fix? |
23:03:06 | OrionPK | how does the delegator syntax work now? |
23:04:15 | OrionPK | nevermind.. |
23:21:57 | OrionPK | dom96 https://github.com/nimrod-code/packages/pull/59 |
23:22:05 | * | darkf joined #nimrod |
23:22:08 | * | superfunc joined #nimrod |
23:22:20 | dom96 | OrionPK: Missing comma |
23:23:34 | OrionPK | doh |
23:24:14 | OrionPK | added |
23:25:41 | NimBot | nimrod-code/packages master de81fb7 onionhammer [+0 ±1 -0]: Added nimrod templates module |
23:25:41 | NimBot | nimrod-code/packages master ed49d1a onionhammer [+0 ±1 -0]: Fixed missing comma |
23:25:41 | NimBot | nimrod-code/packages master 4f55954 Dominik Picheta [+0 ±1 -0]: Merge pull request #59 from onionhammer/patch-2... 2 more lines |
23:27:44 | OrionPK | thanks |