digitalmars.D.announce - [OT?] C compiler written form scratch in D
- Stefan Koch (13/13) Dec 07 2014 Hello,
- MattCoder (7/9) Dec 07 2014 Nice and some useful links:
- Stefan Koch (3/12) Dec 07 2014 Thanks for thoose links!
- Dan Cirnat (2/6) Dec 08 2014 I would be very interested in the videos, can't wait. :)
- Shriramana Sharma via Digitalmars-d-announce (15/17) Dec 07 2014 Please do post updates here. I think it would be a great show-casing of ...
- Stefan Koch (4/17) Dec 08 2014 I want to do a C backend first.
- Stefan Koch (5/5) Dec 08 2014 First two videos are up
- John Colvin (4/9) Dec 08 2014 The quality is completely shot for both audio and video. The text
- MattCoder (7/9) Dec 08 2014 I don't know... in 720p I can't complain about the text but on
- Stefan Koch (4/15) Dec 08 2014 The audio-input is very bad!
- John (4/20) Dec 08 2014 You may have to either pause when you need to cough and sneeze or
- Stefan Koch (7/12) Dec 08 2014 Sorry. I will shoot the next videos when I am healthy again.
- Iain Buclaw via Digitalmars-d-announce (9/17) Dec 08 2014 edit that out. I am interested in this topic but the horrible quality of
- Stefan Koch (5/38) Dec 09 2014 Well, I intended to extend the compiler later on.
- Iain Buclaw via Digitalmars-d-announce (15/34) Dec 08 2014 Yah, talking ad-lib is not fun, nor an easy thing to do.
- deadalnix (3/5) Dec 08 2014 There is already a very popular C to C compiler out there. It is
- Iain Buclaw via Digitalmars-d-announce (4/10) Dec 09 2014 Just so happens to be compatible for D to D compilation too. This tool ...
- Stefan Koch (3/18) Dec 09 2014 cat is the fastest transcompiler I have ever seen!
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (6/12) Dec 09 2014 Any link? I tried to google it but it's such a generic word etc. no luck...
- eles (4/8) Dec 09 2014 http://linux.die.net/man/1/cat
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (8/18) Dec 11 2014 :-) At least one you catched...
- deadalnix (4/18) Dec 09 2014 That was a joke.
- Shachar Shemesh (14/19) Dec 11 2014 I know it was meant as a joke, but I couldn't resist nitpicking.
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (7/10) Dec 09 2014 Hi, how about using PEG for parsing etc.? IMO that would be a very good
- Stefan Koch (4/15) Dec 09 2014 I will use a handwritten recursive decent parser.
- Tobias Pankrath (1/3) Dec 10 2014 Take a look at the std.lexer proposal first.
- Stefan Koch (6/10) Dec 10 2014 Thanks for your suggestion.
- Tobias Pankrath (4/15) Dec 11 2014 I didn't want to suggest to use std.lexer, but to showcase the
- Stefan Koch (6/9) Dec 11 2014 std.lexer is awesome, no doubt about it!
- Stefan Koch (4/4) Dec 11 2014 I will start uploading official videos at Monday.
- Stefan Koch (6/6) Dec 15 2014 New videos are online :)
- TiberiuGal (23/29) Dec 16 2014 Hi.
- Stefan Koch (2/2) Dec 16 2014 please tell me what concepts you would like to have explained.
- TiberiuGal (3/5) Dec 17 2014 I don't know. Maybe Q&A could be helpful - not sure if a live
- Stefan Koch (4/4) Dec 21 2014 New videos are comeing soon :)
- John (3/9) Dec 29 2014 I have watched the videos in speed 2 (double speed) and they look
- Andrei Alexandrescu (2/14) Dec 27 2014 Sounds like a really interesting idea. -- Andrei
Hello, I'd like to announce that I am going to be writing a C-compiler in D. Without flex or bison or anything like that. Just pure handwritten D. I will shoot videos of my progress, and I will explain how a compiler really works. If you think that is like HandmadeHero you are right! Caseys videos inspired my to do this. I hope that some of you will be watching this. Please tell me what you think if that announcement, and feel free to ask anything you like. Regards Stefan (Uplink_Coder).
Dec 07 2014
On Sunday, 7 December 2014 at 19:13:42 UTC, Stefan Koch wrote:Please tell me what you think if that announcement, and feel free to ask anything you like.Nice and some useful links: https://www.reddit.com/r/programming/comments/2latu2/c4_c_in_4_functions/ http://homepage.ntlworld.com/edmund.grimley-evans/cc500/ https://github.com/alexfru/SmallerC good luck, Matheus.
Dec 07 2014
On Sunday, 7 December 2014 at 20:17:30 UTC, MattCoder wrote:On Sunday, 7 December 2014 at 19:13:42 UTC, Stefan Koch wrote:Thanks for thoose links! Intresting stuff.Please tell me what you think if that announcement, and feel free to ask anything you like.Nice and some useful links: https://www.reddit.com/r/programming/comments/2latu2/c4_c_in_4_functions/ http://homepage.ntlworld.com/edmund.grimley-evans/cc500/ https://github.com/alexfru/SmallerC good luck, Matheus.
Dec 07 2014
On Sunday, 7 December 2014 at 19:13:42 UTC, Stefan Koch wrote:I'd like to announce that I am going to be writing a C-compiler in D. I will shoot videos of my progress, and I will explain how a compiler really works.I would be very interested in the videos, can't wait. :)
Dec 08 2014
On Monday, December 8, 2014, Stefan Koch via Digitalmars-d-announce < digitalmars-d-announce puremagic.com> wrote:Please tell me what you think if that announcement, and feel free to ask anything youPlease do post updates here. I think it would be a great show-casing of D's capabilities. Just a suggestion and I may be totally off mark here, but will you have it directly output machine code? Or just the front end? I keep hearing praises of LLVM back-end so if your compiler outputs the LLVM IR code then maybe you can have the rest of the benefit from LLVM. But of course, if this is a PoC that D Caen be used to write a full compiler to output machine code then LLVM's off... --=20 Shriramana Sharma =E0=AE=B6=E0=AF=8D=E0=AE=B0=E0=AF=80=E0=AE=B0=E0=AE=AE=E0= =AE=A3=E0=AE=B6=E0=AE=B0=E0=AF=8D=E0=AE=AE=E0=AE=BE =E0=A4=B6=E0=A5=8D=E0= =A4=B0=E0=A5=80=E0=A4=B0=E0=A4=AE=E0=A4=A3=E0=A4=B6=E0=A4=B0=E0=A5=8D=E0=A4= =AE=E0=A4=BE
Dec 07 2014
On Monday, 8 December 2014 at 11:08:36 UTC, Shriramana Sharma via Digitalmars-d-announce wrote:Please do post updates here. I think it would be a great show-casing of D's capabilities. Just a suggestion and I may be totally off mark here, but will you have it directly output machine code? Or just the front end? I keep hearing praises of LLVM back-end so if your compiler outputs the LLVM IR code then maybe you can have the rest of the benefit from LLVM. But of course, if this is a PoC that D Caen be used to write a full compiler to output machine code then LLVM's off...I want to do a C backend first. Building an LLVM Backand out of that is a small step.
Dec 08 2014
First two videos are up think of them as beta quality! https://www.youtube.com/watch?v=aeBSsuCCRFo and https://www.youtube.com/watch?v=crQk929crCE
Dec 08 2014
On Monday, 8 December 2014 at 16:28:24 UTC, Stefan Koch wrote:First two videos are up think of them as beta quality! https://www.youtube.com/watch?v=aeBSsuCCRFo and https://www.youtube.com/watch?v=crQk929crCEThe quality is completely shot for both audio and video. The text is very fuzzy even in 720p and the audio has been subject to some extreme lossy compression.
Dec 08 2014
On Monday, 8 December 2014 at 17:26:59 UTC, John Colvin wrote:...The text is very fuzzy even in 720p and the audio has been subject to some extreme lossy compression.I don't know... in 720p I can't complain about the text but on the otherwise in 480 is really a bit fuzzy. Well as a suggestion I think you could expand the window where you are writing the code. Or even focus entire on it. I'm waiting for more videos. :) Matheus.
Dec 08 2014
On Monday, 8 December 2014 at 17:26:59 UTC, John Colvin wrote:On Monday, 8 December 2014 at 16:28:24 UTC, Stefan Koch wrote:The audio-input is very bad! what you are hearing are not compression artifacts it's the noise filter hard at work.First two videos are up think of them as beta quality! https://www.youtube.com/watch?v=aeBSsuCCRFo and https://www.youtube.com/watch?v=crQk929crCEThe quality is completely shot for both audio and video. The text is very fuzzy even in 720p and the audio has been subject to some extreme lossy compression.
Dec 08 2014
On Monday, 8 December 2014 at 19:35:54 UTC, Stefan Koch wrote:On Monday, 8 December 2014 at 17:26:59 UTC, John Colvin wrote:You may have to either pause when you need to cough and sneeze or just edit that out. I am interested in this topic but the horrible quality of audio video made me puke.On Monday, 8 December 2014 at 16:28:24 UTC, Stefan Koch wrote:The audio-input is very bad! what you are hearing are not compression artifacts it's the noise filter hard at work.First two videos are up think of them as beta quality! https://www.youtube.com/watch?v=aeBSsuCCRFo and https://www.youtube.com/watch?v=crQk929crCEThe quality is completely shot for both audio and video. The text is very fuzzy even in 720p and the audio has been subject to some extreme lossy compression.
Dec 08 2014
On Monday, 8 December 2014 at 21:04:17 UTC, John wrote:On Monday, 8 December 2014 at 19:35:54 UTC, Stefan Koch wrote:think of them as beta quality!You may have to either pause when you need to cough and sneeze or just edit that out. I am interested in this topic but the horrible quality of audio video made me puke.Sorry. I will shoot the next videos when I am healthy again. I thought about writing the code beforehand, and then just go through and explain it. What do you think of that ? ibuclaw You did not misshear, I really said that :( . I was referring I to the fact, that I do not parse uppercase letters atm. Probably should edit out such non-sense.
Dec 08 2014
On 9 Dec 2014 07:00, "Stefan Koch via Digitalmars-d-announce" < digitalmars-d-announce puremagic.com> wrote:On Monday, 8 December 2014 at 21:04:17 UTC, John wrote:edit that out. I am interested in this topic but the horrible quality of audio video made me puke.On Monday, 8 December 2014 at 19:35:54 UTC, Stefan Koch wrote:think of them as beta quality!You may have to either pause when you need to cough and sneeze or justSorry. I will shoot the next videos when I am healthy again. I thought about writing the code beforehand, and then just go through andexplain it. What do you think of that ?ibuclaw You did not misshear, I really said that :( . I was referring Ito the fact, that I do not parse uppercase letters atm. Probably should edit out such non-sense. Yah, my next question would have been: How do you intend to have a self hosted C compiler handwritten in pure D? :)
Dec 08 2014
On Tuesday, 9 December 2014 at 07:58:51 UTC, Iain Buclaw via Digitalmars-d-announce wrote:On 9 Dec 2014 07:00, "Stefan Koch via Digitalmars-d-announce" < digitalmars-d-announce puremagic.com> wrote:Well, I intended to extend the compiler later on. So I can compile C+x where the X is whatever is needed to get it self-hosting.On Monday, 8 December 2014 at 21:04:17 UTC, John wrote:edit that out. I am interested in this topic but the horrible quality of audio video made me puke.On Monday, 8 December 2014 at 19:35:54 UTC, Stefan Koch wrote:think of them as beta quality!You may have to either pause when you need to cough and sneeze or justSorry. I will shoot the next videos when I am healthy again. I thought about writing the code beforehand, and then just go through andexplain it. What do you think of that ?ibuclaw You did not misshear, I really said that :( . I was referring Ito the fact, that I do not parse uppercase letters atm. Probably should edit out such non-sense. Yah, my next question would have been: How do you intend to have a self hosted C compiler handwritten in pure D? :)
Dec 09 2014
On 8 December 2014 at 19:35, Stefan Koch via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:On Monday, 8 December 2014 at 17:26:59 UTC, John Colvin wrote:Yah, talking ad-lib is not fun, nor an easy thing to do. 1) Script your presentation, making notes of the time it will take for you to talk through each section. 2) Screencast without audio, following the script to your timings. 3) Get yourself a Zoom H1, and record the audio over the video. It *is* the season to be sick and bunged in. But that's not a good excuse for spending 15 minutes sneezing and coughing your way through a pre-recorded talk. :-) By the way, on a more technical note, I was confused by some of your comments, such as not using camel casing and D's foreach because it makes self hosting difficult? Maybe I misheard, but it seems absurd to my ears, but then what do I know. :-) Iain.On Monday, 8 December 2014 at 16:28:24 UTC, Stefan Koch wrote:The audio-input is very bad! what you are hearing are not compression artifacts it's the noise filter hard at work.First two videos are up think of them as beta quality! https://www.youtube.com/watch?v=aeBSsuCCRFo and https://www.youtube.com/watch?v=crQk929crCEThe quality is completely shot for both audio and video. The text is very fuzzy even in 720p and the audio has been subject to some extreme lossy compression.
Dec 08 2014
On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:I want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 08 2014
On 9 Dec 2014 00:50, "deadalnix via Digitalmars-d-announce" < digitalmars-d-announce puremagic.com> wrote:On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Just so happens to be compatible for D to D compilation too. This tool is awesome!=C2=BF?=C2=A1I want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 09 2014
On Tuesday, 9 December 2014 at 08:10:14 UTC, Iain Buclaw via Digitalmars-d-announce wrote:On 9 Dec 2014 00:50, "deadalnix via Digitalmars-d-announce" < digitalmars-d-announce puremagic.com> wrote:cat is the fastest transcompiler I have ever seen!On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Just so happens to be compatible for D to D compilation too. This tool is awesome!¿?¡I want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 09 2014
On 2014-12-09 00:45:41 +0000, deadalnix said:On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Any link? I tried to google it but it's such a generic word etc. no luck. -- Robert M. Münch http://www.saphirion.com smarter | better | fasterI want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 09 2014
On Tuesday, 9 December 2014 at 10:54:22 UTC, Robert M. Münch wrote:On 2014-12-09 00:45:41 +0000, deadalnix said:On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Any link? I tried to google it but it's such a generic word etc. no luck.http://linux.die.net/man/1/cat It was a joke. Could also say "notepad" on Windows.
Dec 09 2014
On 2014-12-09 11:15:19 +0000, eles said:On Tuesday, 9 December 2014 at 10:54:22 UTC, Robert M. Münch wrote::-) At least one you catched... I was wondering... but you know, there are so many strange names etc. used... who knows. Better to check. -- Robert M. Münch http://www.saphirion.com smarter | better | fasterOn 2014-12-09 00:45:41 +0000, deadalnix said:On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Any link? I tried to google it but it's such a generic word etc. no luck.http://linux.die.net/man/1/cat It was a joke. Could also say "notepad" on Windows.
Dec 11 2014
On Tuesday, 9 December 2014 at 10:54:22 UTC, Robert M. Münch wrote:On 2014-12-09 00:45:41 +0000, deadalnix said:That was a joke. http://unixhelp.ed.ac.uk/CGI/man-cgi?catOn Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:Any link? I tried to google it but it's such a generic word etc. no luck. -- Robert M. Münch http://www.saphirion.com smarter | better | fasterI want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 09 2014
On 09/12/14 02:45, deadalnix wrote:On Monday, 8 December 2014 at 15:44:55 UTC, Stefan Koch wrote:I know it was meant as a joke, but I couldn't resist nitpicking. When Stroustrup started out with an OO successor to C, he wrote a preprocessor that would convert his new syntax to C, to be passed to a C compiler. When the language started to evolve, that proved insufficient, and he wrote CFront, a C++ to C compiler. He defines the difference between a preprocessor and a compiler along these lines: With a compiler, any and all compilation errors need to be caught by the front end. If the front end accepted your program, and the back end fails to compile it, it is, by definition, a compiler bug. As such, cat (nor its close neighbor, "tac | tac"), are not a compiler, since it does not catch compilation errors. Sorry for the nitpick. ShacharI want to do a C backend first. Building an LLVM Backand out of that is a small step.There is already a very popular C to C compiler out there. It is called cat, and come out of the box with any UNIX like system.
Dec 11 2014
On 2014-12-07 19:13:41 +0000, Stefan Koch said:I'd like to announce that I am going to be writing a C-compiler in D. Without flex or bison or anything like that. Just pure handwritten D.Hi, how about using PEG for parsing etc.? IMO that would be a very good showcase for the power of PEG And D. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Dec 09 2014
On Tuesday, 9 December 2014 at 10:55:24 UTC, Robert M. Münch wrote:On 2014-12-07 19:13:41 +0000, Stefan Koch said:I will use a handwritten recursive decent parser. Since that is what I deem the easiest thing to do.I'd like to announce that I am going to be writing a C-compiler in D. Without flex or bison or anything like that. Just pure handwritten D.Hi, how about using PEG for parsing etc.? IMO that would be a very good showcase for the power of PEG And D. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Dec 09 2014
I will use a handwritten recursive decent parser. Since that is what I deem the easiest thing to do.Take a look at the std.lexer proposal first.
Dec 10 2014
On Wednesday, 10 December 2014 at 13:02:43 UTC, Tobias Pankrath wrote:Thanks for your suggestion. In fact, I know and like std.lexer. But this is an educational project to showcase compiler construction. So everything will be written from scratch.I will use a handwritten recursive decent parser. Since that is what I deem the easiest thing to do.Take a look at the std.lexer proposal first.
Dec 10 2014
On Wednesday, 10 December 2014 at 17:19:28 UTC, Stefan Koch wrote:On Wednesday, 10 December 2014 at 13:02:43 UTC, Tobias Pankrath wrote:I didn't want to suggest to use std.lexer, but to showcase the nice compile time tricks it employs, e.g. the generation of a Trie at compile time.Thanks for your suggestion. In fact, I know and like std.lexer. But this is an educational project to showcase compiler construction. So everything will be written from scratch.I will use a handwritten recursive decent parser. Since that is what I deem the easiest thing to do.Take a look at the std.lexer proposal first.
Dec 11 2014
On Thursday, 11 December 2014 at 15:02:02 UTC, Tobias Pankrath wrote:I didn't want to suggest to use std.lexer, but to showcase the nice compile time tricks it employs, e.g. the generation of a Trie at compile time.std.lexer is awesome, no doubt about it! But it is not in the scope of building a dead simple compiler. I am still about a way to simplify parsing. It is still not dead simple :(
Dec 11 2014
I will start uploading official videos at Monday. If you are interested in qcc please join me in irc. server : irc.freenode.net channel : #qcc
Dec 11 2014
New videos are online :) part 1: https://www.youtube.com/watch?v=_YAUfd41URA part 2: https://www.youtube.com/watch?v=RGLgiPhwskM please give me feedback in this thread
Dec 15 2014
On Monday, 15 December 2014 at 12:37:18 UTC, Stefan Koch wrote:New videos are online :) part 1: https://www.youtube.com/watch?v=_YAUfd41URA part 2: https://www.youtube.com/watch?v=RGLgiPhwskM please give me feedback in this threadHi. I'm an intermediate level programmer and I'm interested in learning about compilers, so I was very exited when I red your post, and I hope you'll continue. A few suggestions I have: 1. maybe you should pick your target audience, and only talk to that audience. I don't think you need to explain while loops to people who want to learn compilers and you can't teach compilers to people who don't get while loops. 2. talk more about concepts and decision making instead of source - we can follow the source, but there is no obvious answer to "why". So, for example, you go through the source for the lexer, but maybe you should talk instead about the lexer concept- What is it, How will it work, What's the input and output?! 3. it was already mentioned, but it's worth stressing: you should script your recordings. 4. There are a few easy tricks to achieve good quality audio with standard microphones. Maybe if you script your video, and provide the script , the audio will not matter that much. 5. remove the long pauses. we can pause the video if we need more time to process. So, I'm waiting for the next videos, thank you
Dec 16 2014
please tell me what concepts you would like to have explained. perhaps I should do a live-stream for Q&A maybe ?
Dec 16 2014
On Tuesday, 16 December 2014 at 10:01:58 UTC, Stefan Koch wrote:please tell me what concepts you would like to have explained. perhaps I should do a live-stream for Q&A maybe ?I don't know. Maybe Q&A could be helpful - not sure if a live stream is necessary ...
Dec 17 2014
New videos are comeing soon :) Topics : Intro to compilers Parseing and the AsT Identifier-resolution and scope
Dec 21 2014
On Monday, 15 December 2014 at 12:37:18 UTC, Stefan Koch wrote:New videos are online :) part 1: https://www.youtube.com/watch?v=_YAUfd41URA part 2: https://www.youtube.com/watch?v=RGLgiPhwskM please give me feedback in this threadI have watched the videos in speed 2 (double speed) and they look pretty good, thanks.
Dec 29 2014
On 12/7/14 11:13 AM, Stefan Koch wrote:Hello, I'd like to announce that I am going to be writing a C-compiler in D. Without flex or bison or anything like that. Just pure handwritten D. I will shoot videos of my progress, and I will explain how a compiler really works. If you think that is like HandmadeHero you are right! Caseys videos inspired my to do this. I hope that some of you will be watching this. Please tell me what you think if that announcement, and feel free to ask anything you like. Regards Stefan (Uplink_Coder).Sounds like a really interesting idea. -- Andrei
Dec 27 2014