Results 1 to 3 of 3

Thread: Looking for Information of building a compiler

  1. #1

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    693

    Question Looking for Information of building a compiler

    Hi, I recently been reading a few things on writing compilers and had a go at just writing my own little VMs just toy ones and read few compiler books I recenly brought the Dragon book, but I am looking for something where I can build like a toy language that targets the .NET framework and compiles down to a exe, I came across this page.

    https://learn.microsoft.com/en-us/ar...k-using-csharp

    it looks quite good the only thing I find frustrating is all the same code snippets are all on one line pretty stupid really, I am looking for a small project I can learn from a tutor or a book that teaches you how to make languages for the .net framework, I did come across this book

    https://www.amazon.co.uk/Build-Langu.../dp/1590591348

    But from the comments and other ones I read it seems a pretty rubbish book any other books you can suggest or suggestions to where I can start or maybe some tutors on Reflection.Emit and were to get started.



    Hope someone can help any ideas or info will be help full
    Thanks.
    Last edited by BenJones; Jun 12th, 2024 at 04:51 PM.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,881

    Re: Looking for Information of building a compiler

    I went down this path a while back too and got a ton of pushback on the forum for some reason.

    A good "jumping point" would probably be to build a domain specific language (aka DSL): https://en.wikipedia.org/wiki/Domain-specific_language

    The advantages of building a DSL is that it still requires the basics of a compiler only on a significantly smaller scale.

    Here are some book suggestions:


    I personally read the former but I cannot vouch for the latter.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    693

    Re: Looking for Information of building a compiler

    Thanks for the info dday9 very helpful, you think there be more info about building compilers for the .net framework but there is not much about. there seems to be more for building compiled languages I got A few books here, but some seem way over my head and don't really produce a working compiler at the end of the book.
    It did find this today so I am going to have a read tonight
    https://www.codeproject.com/Articles...e-NET-Compiler

    I think if someone made a book about it it whould get a lot of coverage maybe someone will write one one day.
    Last edited by BenJones; Jun 13th, 2024 at 12:53 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width