Re: DCT: D compiler as a collection of libraries

2012-05-20 Thread Roman D. Boiko
On Saturday, 19 May 2012 at 20:35:10 UTC, Marco Leise wrote: Am Fri, 11 May 2012 10:01:28 +0200 schrieb Roman D. Boiko r...@d-coding.com: There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review:

Re: DCT: D compiler as a collection of libraries

2012-05-20 Thread Marco Leise
Am Sun, 20 May 2012 10:09:34 +0200 schrieb Roman D. Boiko r...@d-coding.com: Could you name a few specific concerns? Mostly my own gut feeling, that things that sound great in my head turn out to bite me in the end. Things that one just doesn't think of because of the limited horizon everyone

Re: DCT: D compiler as a collection of libraries

2012-05-20 Thread Roman D. Boiko
On Sunday, 20 May 2012 at 17:42:59 UTC, Marco Leise wrote: There is one feature I remember caused some head-aches for Code::Blocks. They used a separate parser instance for every project in the IDE, which meant that all the standard include files would be parsed and kept in memory multiple

Re: DCT: D compiler as a collection of libraries

2012-05-20 Thread Marco Leise
Am Sun, 20 May 2012 20:37:07 +0200 schrieb Roman D. Boiko r...@d-coding.com: Since assembly code is usually small I just preallocate an array of sourceCode.length tokens and realloc it to the correct size when I'm done parsing. Nothing pretty, but simple and I am sure it won't get

Re: DCT: D compiler as a collection of libraries

2012-05-19 Thread Marco Leise
Am Fri, 11 May 2012 10:01:28 +0200 schrieb Roman D. Boiko r...@d-coding.com: There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review: https://github.com/roman-d-boiko/dct Lexer is based on Brian Schott's

Re: DCT: D compiler as a collection of libraries

2012-05-16 Thread deadalnix
Le 15/05/2012 21:59, Roman D. Boiko a écrit : On Tuesday, 15 May 2012 at 19:27:26 UTC, Timon Gehr wrote: On 05/14/2012 05:00 PM, Roman D. Boiko wrote: Currently I think about making token a class instead of struct. ... Could anybody suggest other pros and cons? Which option would you choose?

Re: DCT: D compiler as a collection of libraries

2012-05-15 Thread deadalnix
Le 14/05/2012 21:21, Roman D. Boiko a écrit : On Monday, 14 May 2012 at 19:13:39 UTC, Roman D. Boiko wrote: On Monday, 14 May 2012 at 19:04:20 UTC, Tove wrote: What if there were two different lex:er modes... with different struct:s. 1. For an IDE with on the fly lexing: Assumption, the error

Re: DCT: D compiler as a collection of libraries

2012-05-15 Thread Roman D. Boiko
On Tuesday, 15 May 2012 at 09:33:31 UTC, deadalnix wrote: Le 14/05/2012 21:21, Roman D. Boiko a écrit : Just to clarify: different modes in lexer in my view are like two different implementations combined in a non-trivial way (unless the difference is minor). So complexity goes from two

Re: DCT: D compiler as a collection of libraries

2012-05-15 Thread Timon Gehr
On 05/14/2012 05:00 PM, Roman D. Boiko wrote: On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: I think you are wasting much more memory and performance by storing all the tokens in the lexer. Imagine I want to implement a simple syntax highlighter: just highlight keywords. How can

Re: DCT: D compiler as a collection of libraries

2012-05-15 Thread Roman D. Boiko
On Tuesday, 15 May 2012 at 19:27:26 UTC, Timon Gehr wrote: On 05/14/2012 05:00 PM, Roman D. Boiko wrote: Currently I think about making token a class instead of struct. ... Could anybody suggest other pros and cons? Which option would you choose? Just use a circular buffer of value-type

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: I think you are wasting much more memory and performance by storing all the tokens in the lexer. Imagine I want to implement a simple syntax highlighter: just highlight keywords. How can I tell DCT to *not* store all tokens because

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 15:00:37 UTC, Roman D. Boiko wrote: Could anybody suggest other pros and cons? Which option would you choose? Further discussion on this topic (struct vs class) is at http://forum.dlang.org/thread/asdrqlaydzcdpqwsb...@forum.dlang.org

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 16:30:21 UTC, deadalnix wrote: Le 14/05/2012 17:00, Roman D. Boiko a écrit : Making it a class would give several benefits: * allow not to worry about allocating a big array of tokens. E.g., on 64-bit OS the largest module in Phobos (IIRC, the std.datetime) consumes

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Tove
On Monday, 14 May 2012 at 16:58:42 UTC, Roman D. Boiko wrote: You are over engineering the whole stuff. I'm trying to solve this and other tradeoffs. I'd like to simplify but satisfy my design goals. What if there were two different lex:er modes... with different struct:s. 1. For an IDE

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 19:04:20 UTC, Tove wrote: On Monday, 14 May 2012 at 16:58:42 UTC, Roman D. Boiko wrote: You are over engineering the whole stuff. I'm trying to solve this and other tradeoffs. I'd like to simplify but satisfy my design goals. What if there were two different lex:er

Re: DCT: D compiler as a collection of libraries

2012-05-14 Thread Roman D. Boiko
On Monday, 14 May 2012 at 19:13:39 UTC, Roman D. Boiko wrote: On Monday, 14 May 2012 at 19:04:20 UTC, Tove wrote: What if there were two different lex:er modes... with different struct:s. 1. For an IDE with on the fly lexing: Assumption, the error rate is high.(need to keep much info) 2.

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 05:41:16 UTC, Jonathan M Davis wrote: It's great that you're working on this. We definitely need more of this sort of stuff. However, I would point out that I'm not sure that it will be acceptable for Phobos (it _may_ be, but it's not quite what we've been looking

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Ary Manzana
On 5/12/12 12:17 PM, Roman D. Boiko wrote: On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: As deadalnix says, I think you are over-complicating things. I mean, to store the column and line information it's just: if (isNewLine(c)) { line++; column = 0; } else { column++; } (I

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread deadalnix
Le 11/05/2012 13:50, Ary Manzana a écrit : On 5/11/12 4:22 PM, Roman D. Boiko wrote: What about line and column information? Indices of the first code unit of each line are stored inside lexer and a function will compute Location (line number, column number, file specification) for any index.

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 13:24:11 UTC, deadalnix wrote: Le 11/05/2012 13:50, Ary Manzana a écrit : Usually tokens are used and discarded. I mean, somebody that uses the lexer asks tokens, process them (for example to highlight code or to build an AST) and then discards them. So you can

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 20:28:34 UTC, Tobias Pankrath wrote: 1. If a struct is a field of heap allocated object, it will be allocated and garbage collected. Only if it only exists on stack (i.e., in method body), GC is not used. As far as I can tell, it won't be allocated on it's own,

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Timon Gehr
On 05/12/2012 11:08 PM, Roman D. Boiko wrote: On Saturday, 12 May 2012 at 20:28:34 UTC, Tobias Pankrath wrote: 1. If a struct is a field of heap allocated object, it will be allocated and garbage collected. Only if it only exists on stack (i.e., in method body), GC is not used. As far as I

Re: DCT: D compiler as a collection of libraries

2012-05-12 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 22:19:55 UTC, Timon Gehr wrote: On 05/12/2012 11:08 PM, Roman D. Boiko wrote: On Saturday, 12 May 2012 at 20:28:34 UTC, Tobias Pankrath wrote: 1. If a struct is a field of heap allocated object, it will be allocated and garbage collected. Only if it only exists on

DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review: https://github.com/roman-d-boiko/dct Lexer is based on Brian Schott's project https://github.com/Hackerpilot/Dscanner, but it has been refactored and

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 10:01, Roman D. Boiko wrote: There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review: https://github.com/roman-d-boiko/dct Lexer is based on Brian Schott's project

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 08:38:36 UTC, Jacob Carlborg wrote: (Re-posting here) A couple of questions: * What's the sate of the lexer I consider it a draft state, because it has got several rewrites recently and I plan to do more, especially based on community feedback. However, implementation

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 10:01, Roman D. Boiko wrote: There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review: https://github.com/roman-d-boiko/dct Lexer is based on Brian Schott's project

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 10:58, Roman D. Boiko wrote: On Friday, 11 May 2012 at 08:38:36 UTC, Jacob Carlborg wrote: (Re-posting here) A couple of questions: * What's the sate of the lexer I consider it a draft state, because it has got several rewrites recently and I plan to do more, especially based on

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread dennis luehring
Am 11.05.2012 11:02, schrieb Jacob Carlborg: For this to happen, for Walter to start using this, I think there would be a greater change if the frontend was a port of the DMD frontend and not changed too much. or a pure D version of it with the features: -very fast in parsing/lexing - there

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 09:08:24 UTC, Jacob Carlborg wrote: On 2012-05-11 10:58, Roman D. Boiko wrote: Each token contains: * start index (position in the original encoding, 0 corresponds to the first code unit after BOM), * token value encoded as UTF-8 string, * token kind (e.g., token.kind

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread dennis luehring
Am 11.05.2012 11:23, schrieb Roman D. Boiko: On Friday, 11 May 2012 at 09:19:07 UTC, dennis luehring wrote: does the parser/lexer allow half-finished syntax parsing? for being useable in an IDE for syntax-highlighting while coding? That's planned, but I would like to see your usage scenarios

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 09:02:12 UTC, Jacob Carlborg wrote: If think that the end goal of a project like this, putting a D frontend in Phobos, should be that the compiler should be built using this library. This would result in the compiler and library always being in sync and having the

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 09:21:29 UTC, dennis luehring wrote: Am 11.05.2012 11:02, schrieb Jacob Carlborg: For this to happen, for Walter to start using this, I think there would be a greater change if the frontend was a port of the DMD frontend and not changed too much. or a pure D

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 11:22, Roman D. Boiko wrote: What about line and column information? Indices of the first code unit of each line are stored inside lexer and a function will compute Location (line number, column number, file specification) for any index. This way size of Token instance is reduced

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 11:31, Roman D. Boiko wrote: My plan is to create frontend that would be much better than existing, both in design and implementation. I decided to work on this full time for several months. That's good news. Front end will not produce the same data as DMD front end does, so

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 11:23, Roman D. Boiko wrote: On Friday, 11 May 2012 at 09:19:07 UTC, dennis luehring wrote: does the parser/lexer allow half-finished syntax parsing? for being useable in an IDE for syntax-highlighting while coding? That's planned, but I would like to see your usage scenarios

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread dennis luehring
Am 11.05.2012 11:33, schrieb Roman D. Boiko: -very fast in parsing/lexing - there need to be a benchmark enviroment from the very start Will add that to May roadmap. are using slices for prevent coping everything around? the parser/lexer need to be as fast as the original one - maybe even

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 09:28:36 UTC, dennis luehring wrote: Am 11.05.2012 11:23, schrieb Roman D. Boiko: On Friday, 11 May 2012 at 09:19:07 UTC, dennis luehring wrote: does the parser/lexer allow half-finished syntax parsing? for being useable in an IDE for syntax-highlighting while coding?

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 09:36:28 UTC, Jacob Carlborg wrote: On 2012-05-11 11:22, Roman D. Boiko wrote: Locations will possible to calculate both taking into account special token sequences (e.g., #line 3 ab/c.d), or discarding them. Aha, clever. As long as I can get out the information I'm

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread alex
On Friday, 11 May 2012 at 10:40:43 UTC, Roman D. Boiko wrote: On Friday, 11 May 2012 at 10:01:17 UTC, dennis luehring wrote: Am 11.05.2012 11:33, schrieb Roman D. Boiko: -very fast in parsing/lexing - there need to be a benchmark enviroment from the very start Will add that to May roadmap.

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 11:31, Roman D. Boiko a écrit : On Friday, 11 May 2012 at 09:02:12 UTC, Jacob Carlborg wrote: If think that the end goal of a project like this, putting a D frontend in Phobos, should be that the compiler should be built using this library. This would result in the compiler and

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 12:01, dennis luehring a écrit : Am 11.05.2012 11:33, schrieb Roman D. Boiko: -very fast in parsing/lexing - there need to be a benchmark enviroment from the very start Will add that to May roadmap. are using slices for prevent coping everything around? the parser/lexer need

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Ary Manzana
On 5/11/12 4:22 PM, Roman D. Boiko wrote: What about line and column information? Indices of the first code unit of each line are stored inside lexer and a function will compute Location (line number, column number, file specification) for any index. This way size of Token instance is reduced

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 11:41:34 UTC, alex wrote: Ever thought of asking the VisualD developer to integrate your library into his IDE extension? Might be cool to do so because of extended completion abilities etc. (lol I'm the Mono-D dev -- but why not? ;D) Didn't think about that yet,

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 11:50:14 UTC, deadalnix wrote: Le 11/05/2012 11:31, Roman D. Boiko a écrit : My plan is to create frontend that would be much better than existing, both in design and implementation. I decided to work on this full time for several months. I this is your plan, I'm

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 11:49:23 UTC, Jacob Carlborg wrote: On 2012-05-11 12:35, Roman D. Boiko wrote: On Friday, 11 May 2012 at 09:36:28 UTC, Jacob Carlborg wrote: Aha, clever. As long as I can get out the information I'm happy :) How about adding properties for this in the token struct?

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 14:04, Roman D. Boiko a écrit : That makes sense. Is it possible to switch SDC to the Boost license? I'm trying to keep it for all DCT code. Let me do a clean package of my code this week end. For now it is mixed with SDC source code, which was enough as I was working alone,

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread dennis luehring
Am 11.05.2012 13:50, schrieb Ary Manzana: On 5/11/12 4:22 PM, Roman D. Boiko wrote: What about line and column information? Indices of the first code unit of each line are stored inside lexer and a function will compute Location (line number, column number, file specification) for any

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread alex
On Friday, 11 May 2012 at 11:55:47 UTC, Roman D. Boiko wrote: On Friday, 11 May 2012 at 11:41:34 UTC, alex wrote: Ever thought of asking the VisualD developer to integrate your library into his IDE extension? Might be cool to do so because of extended completion abilities etc. (lol I'm the

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 11:47:18 UTC, deadalnix wrote: From the beginning, I'm think AST macro using CTFE. Could you please elaborate? I plan to strictly follow published D specification. Exceptions from this rule are possible provided either of the following is true: * new functionality

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 12:13:53 UTC, alex wrote: Mono-D is written in C#, VisualD uses D -- so it actually should be easier to integrate into the second one :) Sorry, I meant D-IDE. But there might exist the reason to consume D implementation from C# also. I would happily collaborate to

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 14:14, Roman D. Boiko a écrit : On Friday, 11 May 2012 at 11:47:18 UTC, deadalnix wrote: From the beginning, I'm think AST macro using CTFE. Could you please elaborate? I plan to strictly follow published D specification. Exceptions from this rule are possible provided either of

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 11:50:29 UTC, Ary Manzana wrote: On 5/11/12 4:22 PM, Roman D. Boiko wrote: What about line and column information? Indices of the first code unit of each line are stored inside lexer and a function will compute Location (line number, column number, file

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 12:30:01 UTC, deadalnix wrote: Your 3 points seem reasonable. Mine were : * Implement something that can parse D as it is currently defined/implemented (if dmd's behavior and spec differs, it is handled on a per case basis). All differences should be documented. *

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 14:07, Roman D. Boiko wrote: On Friday, 11 May 2012 at 11:49:23 UTC, Jacob Carlborg wrote: Found it now, calculateFor. It not sure if it's the most intuitive name though. I get the feeling: calculate what?. calculateLocation was original name, but I don't like repeating

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 12:55:58 UTC, Jacob Carlborg wrote: On 2012-05-11 14:07, Roman D. Boiko wrote: On Friday, 11 May 2012 at 11:49:23 UTC, Jacob Carlborg wrote: Found it now, calculateFor. It not sure if it's the most intuitive name though. I get the feeling: calculate what?.

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 14:14, Roman D. Boiko wrote: On Friday, 11 May 2012 at 11:47:18 UTC, deadalnix wrote: From the beginning, I'm think AST macro using CTFE. Could you please elaborate? I plan to strictly follow published D specification. That won't be easy, nobody know what the specification is

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 15:01, Roman D. Boiko wrote: What about the following signature: Location locate(size_t index)? Or even better: alias size_t CodeUnitIndex; Location locateFor(CodeUnitIndex position); That is better although I would prefer to pass in a token (assuming that is where index is

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 15:01, Roman D. Boiko a écrit : On Friday, 11 May 2012 at 12:55:58 UTC, Jacob Carlborg wrote: On 2012-05-11 14:07, Roman D. Boiko wrote: On Friday, 11 May 2012 at 11:49:23 UTC, Jacob Carlborg wrote: Found it now, calculateFor. It not sure if it's the most intuitive name

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Rory McGuire
? my guess is that the spec is TDPL + TDPL errata. dlang.org should be updated as people notice inaccuracies. This project would be an ideal time to update dlang.org as people notice its not in sync with TDPL. If TDPL doesn't cover it then the community should review it. On Fri, May 11, 2012 at

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 13:28:21 UTC, deadalnix wrote: Le 11/05/2012 15:01, Roman D. Boiko a écrit : The problem with placing it in Token is that Token should not know anything about source as a whole. I don't really see the benefit of this. You are trading a O(1) operation to an

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 13:25:53 UTC, Jacob Carlborg wrote: On 2012-05-11 15:01, Roman D. Boiko wrote: What about the following signature: Location locate(size_t index)? Or even better: alias size_t CodeUnitIndex; Location locateFor(CodeUnitIndex position); That is better although I would

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 13:30:49 UTC, Rory McGuire wrote: ? my guess is that the spec is TDPL + TDPL errata. dlang.org should be updated as people notice inaccuracies. This project would be an ideal time to update dlang.org as people notice its not in sync with TDPL. If TDPL doesn't cover

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 13:28:21 UTC, deadalnix wrote: Le 11/05/2012 15:01, Roman D. Boiko a écrit : The problem with placing it in Token is that Token should not know anything about source as a whole. I don't really see the benefit of this. You are trading a O(1) operation to an

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 12:20:27 UTC, Roman D. Boiko wrote: On Friday, 11 May 2012 at 12:13:53 UTC, alex wrote: Mono-D is written in C#, VisualD uses D -- so it actually should be easier to integrate into the second one :) Sorry, I meant D-IDE. But there might exist the reason to consume D

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jacob Carlborg
On 2012-05-11 15:30, Rory McGuire wrote: ? my guess is that the spec is TDPL + TDPL errata. dlang.org http://dlang.org should be updated as people notice inaccuracies. This project would be an ideal time to update dlang.org http://dlang.org as people notice its not in sync with TDPL. If TDPL

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread deadalnix
Le 11/05/2012 16:02, Roman D. Boiko a écrit : On Friday, 11 May 2012 at 13:28:21 UTC, deadalnix wrote: Le 11/05/2012 15:01, Roman D. Boiko a écrit : The problem with placing it in Token is that Token should not know anything about source as a whole. I don't really see the benefit of this.

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 14:45:45 UTC, Jacob Carlborg wrote: On 2012-05-11 15:30, Rory McGuire wrote: ? my guess is that the spec is TDPL + TDPL errata. dlang.org http://dlang.org should be updated as people notice inaccuracies. This project would be an ideal time to update dlang.org

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Friday, 11 May 2012 at 15:05:19 UTC, deadalnix wrote: Le 11/05/2012 16:02, Roman D. Boiko a écrit : Technically, I'm trading N*0(1) operations needed to track line and column while consuming each character to M*0(log(n)) operations when calculating them on demand. N = number of characters,

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Rory McGuire
yip, but TDPL still has to take precedence because that is the one that walter + andrei + community put the most focused effort into. On Fri, May 11, 2012 at 4:45 PM, Jacob Carlborg d...@me.com wrote: On 2012-05-11 15:30, Rory McGuire wrote: ? my guess is that the spec is TDPL + TDPL errata.

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jonathan M Davis
On Friday, May 11, 2012 23:00:15 Rory McGuire wrote: yip, but TDPL still has to take precedence because that is the one that walter + andrei + community put the most focused effort into. It doesn't necessarily. Each place that they differ is examined individually and decided on its own merits.

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Ary Manzana
On 5/11/12 10:14 PM, Roman D. Boiko wrote: On Friday, 11 May 2012 at 15:05:19 UTC, deadalnix wrote: Le 11/05/2012 16:02, Roman D. Boiko a écrit : Technically, I'm trading N*0(1) operations needed to track line and column while consuming each character to M*0(log(n)) operations when calculating

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: As deadalnix says, I think you are over-complicating things. I mean, to store the column and line information it's just: if (isNewLine(c)) { line++; column = 0; } else { column++; } (I think you need to add that to the

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Roman D. Boiko
On Saturday, 12 May 2012 at 03:32:20 UTC, Ary Manzana wrote: As deadalnix says, I think you are over-complicating things. I mean, to store the column and line information it's just: if (isNewLine(c)) { line++; column = 0; } else { column++; } (I think you need to add that to the

Re: DCT: D compiler as a collection of libraries

2012-05-11 Thread Jonathan M Davis
On Friday, May 11, 2012 10:01:28 Roman D. Boiko wrote: There were several discussions about the need for a D compiler library. I propose my draft implementation of lexer for community review: https://github.com/roman-d-boiko/dct Lexer is based on Brian Schott's project