digitalmars.D - Callout to DMD hackers
- Andrej Mitrovic (15/15) Mar 08 2014 Recently Vladimir Panteleev has ported the DMD Source Guide from
- Dicebot (2/2) Mar 08 2014 Thanks both to you and Vladimir for your effort! Some of those
- Suliman (5/5) Mar 08 2014 Few years ago I had read that Walter had add some print
- Andrej Mitrovic (9/14) Mar 08 2014 Not sure, but you can always do the following to e.g. avoid doing any im...
- Mike Parker (3/8) Mar 08 2014 IIRC C's printf was declared in object.d. But that was back in the early...
- Phillip Larkson (2/2) Mar 08 2014 Thanks for the information! I plan on playing around with the
- Asman01 (16/32) Mar 08 2014 Awesome! Thanks for the information. This part of article[1] was
- Andrej Mitrovic (2/4) Mar 08 2014 Uhm, haven't you heard of the LDC project? http://wiki.dlang.org/LDC
- Vladimir Panteleev (2/7) Mar 08 2014 He was quoting an ancient bit of the article :P
- Andrej Mitrovic (6/8) Mar 08 2014 See Module::parse() in module.c, it converts all non-UTF-8 formats to
- Asman01 (7/19) Mar 08 2014 Umm, why exactly? what approach will you be using instead of? I'm
- Timon Gehr (2/10) Mar 08 2014 How many actual D source files are not UTF-8?
- Andrej Mitrovic (3/4) Mar 08 2014 No idea. Maybe some Windows tools use UTF-16, although I can't think
- Asman01 (2/7) Mar 11 2014 VS do use UTF-16, IIRC.
- Brad Anderson (6/15) Mar 11 2014 You can change the file encoding but the default is codepage 1252
- Russel Winder (17/22) Mar 12 2014 I would have thought UTF-8 was the only sensible encoding of Unicode for
- Rainer Schuetze (3/7) Mar 12 2014 Visual D sets the default encoding for D files to UTF8, otherwise they
- Asman01 (2/18) Mar 08 2014 Also, where is root/async.c actually used?
- Andrej Mitrovic (2/3) Mar 08 2014 In mars.c, take a look at the "#if ASYNCREAD" section.
- Asman01 (2/5) Mar 08 2014 Thanks. I will check out.
- Asman01 (3/19) Mar 11 2014 Just for clarification, the parsing method which dmd use is a
- Nick Sabalausky (2/4) Mar 11 2014 Yes.
- Nick Sabalausky (8/13) Mar 11 2014 Wow, that page is hugely improved since last time I looked (quite a
Recently Vladimir Panteleev has ported the DMD Source Guide from the old wiki to the new one[1], and updated it with up-to-date information. I've added a "DMD Hacking Tips & Tricks" section[2], which should help people new to the codebase to start hacking on DMD-FE. I've only added a few tips that I know of. If you regularly hack on DMD and know some good tips for new DMD developers, please either post those tips in this thread and we'll add them to the wiki, or you can directly add them to the wiki. Everybody benefits from sharing knowledge about compiler internals. For example, GCC has pretty extensive documentation about its internals[3]. [1] : http://wiki.dlang.org/DMD_Source_Guide [2] : http://wiki.dlang.org/DMD_Source_Guide#DMD_Hacking_Tips_.26_Tricks [3] : http://gcc.gnu.org/onlinedocs/gccint/
Mar 08 2014
Thanks both to you and Vladimir for your effort! Some of those tips could have saved me a lot of time if read earlier :)
Mar 08 2014
Few years ago I had read that Walter had add some print instruction to Phobos, that allow to do print without importing std.stdio; It was needed to debugging phobos. Maybe it's not proper thread, but maybe someone of D hackers remember it, because I can't remember how it was done.
Mar 08 2014
On 3/8/14, Suliman <evermind live.ru> wrote:Few years ago I had read that Walter had add some print instruction to Phobos, that allow to do print without importing std.stdio; It was needed to debugging phobos. Maybe it's not proper thread, but maybe someone of D hackers remember it, because I can't remember how it was done.Not sure, but you can always do the following to e.g. avoid doing any imports: ----- extern(C) int printf(in char* format, ...); void main() { printf("hello\n"); } -----
Mar 08 2014
On 3/8/2014 11:21 PM, Suliman wrote:Few years ago I had read that Walter had add some print instruction to Phobos, that allow to do print without importing std.stdio; It was needed to debugging phobos. Maybe it's not proper thread, but maybe someone of D hackers remember it, because I can't remember how it was done.IIRC C's printf was declared in object.d. But that was back in the early D1 days.
Mar 08 2014
Thanks for the information! I plan on playing around with the compiler soon, and the more information the merrier.
Mar 08 2014
On Saturday, 8 March 2014 at 13:25:32 UTC, Andrej Mitrovic wrote:Recently Vladimir Panteleev has ported the DMD Source Guide from the old wiki to the new one[1], and updated it with up-to-date information. I've added a "DMD Hacking Tips & Tricks" section[2], which should help people new to the codebase to start hacking on DMD-FE. I've only added a few tips that I know of. If you regularly hack on DMD and know some good tips for new DMD developers, please either post those tips in this thread and we'll add them to the wiki, or you can directly add them to the wiki. Everybody benefits from sharing knowledge about compiler internals. For example, GCC has pretty extensive documentation about its internals[3]. [1] : http://wiki.dlang.org/DMD_Source_Guide [2] : http://wiki.dlang.org/DMD_Source_Guide#DMD_Hacking_Tips_.26_Tricks [3] : http://gcc.gnu.org/onlinedocs/gccint/Awesome! Thanks for the information. This part of article[1] was funny to add Walter as one of the people seem to have understood the DMD IR. Was not DMD IR implemented by Walter? also, me too. I don't got how DMD IR actually works or what is like. I don't understand this part "converted to UTF-8 when necessary" in [2]. What does it mean? I don't know much about UTF-8, just basics, unlike as should do, but shouldn't convert everything to UTF-8 and just handle the source code as UTF-8? [1]: I've been looking at trying to hook the DMD frontend up to LLVM (www.llvm.org), but I've been having some trouble. The LLVM IR (Intermediate Representation) is very well documented, but I'm having a rough time figuring out how DMD holds its IR. Since at least three people (David, Ben, and Walter) seem to have understand, I thought I'd ask for guidance.
Mar 08 2014
On 3/8/14, Asman01 <jckj33 gmail.com> wrote:[1]: I've been looking at trying to hook the DMD frontend up to LLVM (www.llvm.org)Uhm, haven't you heard of the LDC project? http://wiki.dlang.org/LDC
Mar 08 2014
On Saturday, 8 March 2014 at 21:07:52 UTC, Andrej Mitrovic wrote:On 3/8/14, Asman01 <jckj33 gmail.com> wrote:He was quoting an ancient bit of the article :P[1]: I've been looking at trying to hook the DMD frontend up to LLVM (www.llvm.org)Uhm, haven't you heard of the LDC project? http://wiki.dlang.org/LDC
Mar 08 2014
On 3/8/14, Asman01 <jckj33 gmail.com> wrote:I don't understand this part "converted to UTF-8 when necessary" in [1].See Module::parse() in module.c, it converts all non-UTF-8 formats to UTF-8 when reading a file. Actually thinking about this, this has to be extremely inefficient. Hopefully once the compiler is ported to D we won't have to do this sort of conversion.
Mar 08 2014
On Saturday, 8 March 2014 at 21:16:30 UTC, Andrej Mitrovic wrote:On 3/8/14, Asman01 <jckj33 gmail.com> wrote:Umm, why exactly? what approach will you be using instead of? I'm learning a bit more about compilers/programming languages at my free time. And if when the dmd in D port starts and I know at least enough about to be able to get involved with the project sure I will do. Of course I hope my poor english don't scare everybody in there but it's something I'm going to changeI don't understand this part "converted to UTF-8 when necessary" in [1].See Module::parse() in module.c, it converts all non-UTF-8 formats to UTF-8 when reading a file. Actually thinking about this, this has to be extremely inefficient. Hopefully once the compiler is ported to D we won't have to do this sort of conversion.
Mar 08 2014
On 03/08/2014 10:16 PM, Andrej Mitrovic wrote:On 3/8/14, Asman01 <jckj33 gmail.com> wrote:How many actual D source files are not UTF-8?I don't understand this part "converted to UTF-8 when necessary" in [1].See Module::parse() in module.c, it converts all non-UTF-8 formats to UTF-8 when reading a file. Actually thinking about this, this has to be extremely inefficient. Hopefully once the compiler is ported to D we won't have to do this sort of conversion.
Mar 08 2014
On 3/8/14, Timon Gehr <timon.gehr gmx.ch> wrote:How many actual D source files are not UTF-8?No idea. Maybe some Windows tools use UTF-16, although I can't think of any. VS uses UTF-8 right?
Mar 08 2014
On Saturday, 8 March 2014 at 22:20:50 UTC, Andrej Mitrovic wrote:On 3/8/14, Timon Gehr <timon.gehr gmx.ch> wrote:VS do use UTF-16, IIRC.How many actual D source files are not UTF-8?No idea. Maybe some Windows tools use UTF-16, although I can't think of any. VS uses UTF-8 right?
Mar 11 2014
On Wednesday, 12 March 2014 at 01:17:23 UTC, Asman01 wrote:On Saturday, 8 March 2014 at 22:20:50 UTC, Andrej Mitrovic wrote:You can change the file encoding but the default is codepage 1252 for me (I assume it changes based on your locale but I don't know that for certain). It's definitely not UTF-16 encoded. I don't recall ever seeing Windows VS source code encoded with anything other than 1252/8859-1 or (rarely) UTF-8.On 3/8/14, Timon Gehr <timon.gehr gmx.ch> wrote:VS do use UTF-16, IIRC.How many actual D source files are not UTF-8?No idea. Maybe some Windows tools use UTF-16, although I can't think of any. VS uses UTF-8 right?
Mar 11 2014
On Wed, 2014-03-12 at 02:14 +0000, Brad Anderson wrote: [=E2=80=A6]You can change the file encoding but the default is codepage 1252 for me (I assume it changes based on your locale but I don't know that for certain). It's definitely not UTF-16 encoded. I don't=20 recall ever seeing Windows VS source code encoded with anything=20 other than 1252/8859-1 or (rarely) UTF-8.I would have thought UTF-8 was the only sensible encoding of Unicode for general purposes. Windows is the reason for UTF-16LE and UTF-16BE because Microsoft implemented things differently to the rest of the planet, and what the standard said. So the standard got retrofitted. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 12 2014
On 08.03.2014 23:20, Andrej Mitrovic wrote:On 3/8/14, Timon Gehr <timon.gehr gmx.ch> wrote:Visual D sets the default encoding for D files to UTF8, otherwise they are Codepage 1252 "Western European" on my system, e.g. for C/C++ files.How many actual D source files are not UTF-8?No idea. Maybe some Windows tools use UTF-16, although I can't think of any. VS uses UTF-8 right?
Mar 12 2014
On Saturday, 8 March 2014 at 13:25:32 UTC, Andrej Mitrovic wrote:Recently Vladimir Panteleev has ported the DMD Source Guide from the old wiki to the new one[1], and updated it with up-to-date information. I've added a "DMD Hacking Tips & Tricks" section[2], which should help people new to the codebase to start hacking on DMD-FE. I've only added a few tips that I know of. If you regularly hack on DMD and know some good tips for new DMD developers, please either post those tips in this thread and we'll add them to the wiki, or you can directly add them to the wiki. Everybody benefits from sharing knowledge about compiler internals. For example, GCC has pretty extensive documentation about its internals[3]. [1] : http://wiki.dlang.org/DMD_Source_Guide [2] : http://wiki.dlang.org/DMD_Source_Guide#DMD_Hacking_Tips_.26_Tricks [3] : http://gcc.gnu.org/onlinedocs/gccint/Also, where is root/async.c actually used?
Mar 08 2014
On 3/8/14, Asman01 <jckj33 gmail.com> wrote:Also, where is root/async.c actually used?In mars.c, take a look at the "#if ASYNCREAD" section.
Mar 08 2014
On Saturday, 8 March 2014 at 21:09:14 UTC, Andrej Mitrovic wrote:On 3/8/14, Asman01 <jckj33 gmail.com> wrote:Thanks. I will check out.Also, where is root/async.c actually used?In mars.c, take a look at the "#if ASYNCREAD" section.
Mar 08 2014
On Saturday, 8 March 2014 at 13:25:32 UTC, Andrej Mitrovic wrote:Recently Vladimir Panteleev has ported the DMD Source Guide from the old wiki to the new one[1], and updated it with up-to-date information. I've added a "DMD Hacking Tips & Tricks" section[2], which should help people new to the codebase to start hacking on DMD-FE. I've only added a few tips that I know of. If you regularly hack on DMD and know some good tips for new DMD developers, please either post those tips in this thread and we'll add them to the wiki, or you can directly add them to the wiki. Everybody benefits from sharing knowledge about compiler internals. For example, GCC has pretty extensive documentation about its internals[3]. [1] : http://wiki.dlang.org/DMD_Source_Guide [2] : http://wiki.dlang.org/DMD_Source_Guide#DMD_Hacking_Tips_.26_Tricks [3] : http://gcc.gnu.org/onlinedocs/gccint/Just for clarification, the parsing method which dmd use is a recursive descent parser, right?
Mar 11 2014
On 3/11/2014 9:02 PM, Asman01 wrote:Just for clarification, the parsing method which dmd use is a recursive descent parser, right?Yes.
Mar 11 2014
On 3/8/2014 8:25 AM, Andrej Mitrovic wrote:Recently Vladimir Panteleev has ported the DMD Source Guide from the old wiki to the new one[1], and updated it with up-to-date information. I've added a "DMD Hacking Tips & Tricks" section[2], which should help people new to the codebase to start hacking on DMD-FE. I've only added a few tips that I know of.Wow, that page is hugely improved since last time I looked (quite a while ago, TBH). Cheers to all who contributed! One thing I'm still unclear on though (maybe someone in-the-know could add this info?): Last I looked at DMD's semantic code, there was a lot of stuff about "deferred" semantics. What's all that stuff about? It sounds like some sort of inverse of what the Wiki describes about handling forward references, but I don't know anything about it.
Mar 11 2014