scripting language

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Andersson

    #1

    scripting language

    Hi!
    I'm writing a small game engine in c# and I'm in great
    need of a scripting language. Does anyone know of such a
    language?

    Would it be possible to use the VSA in some way to do this?

    Best regards,
    /Michael
  • Michael Andersson

    #2
    Re: scripting language

    Hi Ron,
    If it's possible to C# thats OK... all I need is a
    scripting language so that I can write particle system
    effects etc. without having to use subclassing. Runtime
    recomping i just fine.

    Do you know of any good documentation on how to use the
    System.CodeDom. Compiler?

    Best regards,
    /Michael
    [color=blue]
    >-----Original Message-----
    >Michael,
    >
    >Why not use C#? (See namespaces System.CodeDom. Compiler[/color]
    how to compile C#[color=blue]
    >source to Assembly and System.Reflecti on and System how[/color]
    to create types of[color=blue]
    >objects from the Assembly).
    >
    >
    >Ron
    >"Michael Andersson" <a98mican@nospa m.ida.his.se> wrote in[/color]
    message[color=blue]
    >news:013401c34 ef7$05d8d190$a1 01280a@phx.gbl. ..[color=green]
    >> Hi!
    >> I'm writing a small game engine in c# and I'm in great
    >> need of a scripting language. Does anyone know of such a
    >> language?
    >>
    >> Would it be possible to use the VSA in some way to do[/color][/color]
    this?[color=blue][color=green]
    >>
    >> Best regards,
    >> /Michael[/color]
    >
    >
    >.
    >[/color]

    Comment

    • Dmand

      #3
      Re: scripting language

      This is something I've recently engaged upon myself, and let me tell you,
      it's no small effort. I'm probably about a third of the way there (I'm
      currently building a parse tree). Mind you I haven't looked at the
      System.CodeDom. Compiler namespace though I now intend to - it's the first
      I've heard about it.

      Here is a good tutorial on one way to go about it,



      That uses the old Lex/Yacc tools, or at least their win32 counterparts and
      implements it in C/C++. Those tools still only get you about half way and
      learning to use them again requires a bit of effort. Personally I've read up
      on compiler theory and design and am coding everything from the start
      myself. So far so good I just need to dedicate more hours (days/weeks) to
      the job.

      BTW, the basic constituents of any scripting engine are the

      Lexer -> Abstract Syntax Tree/Parse Tree -> Byte Code Generator -> Virtual
      Machine

      The Tree can be optional but it avails you a nice structure for analysing
      the code (debugging etc) and probably simplifies the process of getting from
      token stream to byte code.

      As for C# generating compiler tools there is
      http://www.scifac.ru.ac.za/coco/. All the tools require you to learn a bit
      about compiler theory (grammars and BNF notation etc) so you can specify
      your language and also of course there own usage and in the end they only
      get part of the job done, hence of chosen to avoid them.

      That said if I can get System.CodeDom. Compiler to do it for me I will be
      taking a new route.


      "Michael Andersson" <a98mican@nospa m.ida.his.se> wrote in message
      news:013401c34e f7$05d8d190$a10 1280a@phx.gbl.. .[color=blue]
      > Hi!
      > I'm writing a small game engine in c# and I'm in great
      > need of a scripting language. Does anyone know of such a
      > language?
      >
      > Would it be possible to use the VSA in some way to do this?
      >
      > Best regards,
      > /Michael[/color]


      Comment

      • Dmand

        #4
        Re: scripting language

        This MS knowledgebase article appears to be a good start

        HOWTO: Programmaticall y Compile Code Using C# Compiler
        http://support.microsoft.com/default...b;en-us;304655



        "Dmand" <dandersonnospa m@imxsoftware.c om> wrote in message
        news:%23DKX69xT DHA.2480@tk2msf tngp13.phx.gbl. ..[color=blue]
        > This is something I've recently engaged upon myself, and let me tell you,
        > it's no small effort. I'm probably about a third of the way there (I'm
        > currently building a parse tree). Mind you I haven't looked at the
        > System.CodeDom. Compiler namespace though I now intend to - it's the first
        > I've heard about it.
        >
        > Here is a good tutorial on one way to go about it,
        >
        > http://www.flipcode.com/tutorials/tut_scr01.shtml
        >
        > That uses the old Lex/Yacc tools, or at least their win32 counterparts and
        > implements it in C/C++. Those tools still only get you about half way and
        > learning to use them again requires a bit of effort. Personally I've read[/color]
        up[color=blue]
        > on compiler theory and design and am coding everything from the start
        > myself. So far so good I just need to dedicate more hours (days/weeks) to
        > the job.
        >
        > BTW, the basic constituents of any scripting engine are the
        >
        > Lexer -> Abstract Syntax Tree/Parse Tree -> Byte Code Generator -> Virtual
        > Machine
        >
        > The Tree can be optional but it avails you a nice structure for analysing
        > the code (debugging etc) and probably simplifies the process of getting[/color]
        from[color=blue]
        > token stream to byte code.
        >
        > As for C# generating compiler tools there is
        > http://www.scifac.ru.ac.za/coco/. All the tools require you to learn a bit
        > about compiler theory (grammars and BNF notation etc) so you can specify
        > your language and also of course there own usage and in the end they only
        > get part of the job done, hence of chosen to avoid them.
        >
        > That said if I can get System.CodeDom. Compiler to do it for me I will be
        > taking a new route.
        >
        >
        > "Michael Andersson" <a98mican@nospa m.ida.his.se> wrote in message
        > news:013401c34e f7$05d8d190$a10 1280a@phx.gbl.. .[color=green]
        > > Hi!
        > > I'm writing a small game engine in c# and I'm in great
        > > need of a scripting language. Does anyone know of such a
        > > language?
        > >
        > > Would it be possible to use the VSA in some way to do this?
        > >
        > > Best regards,
        > > /Michael[/color]
        >
        >[/color]


        Comment

        • Dmand

          #5
          Re: scripting language

          Thanks Ron, I've briefly looked into the features that the framework has to
          assist in this kind of thing and now expect that I will be using them
          instead of my own code. I too am building a scripting engine and C# or VB
          will be quite sufficient as a language to implement it. Great tip I should
          have posted here first!

          "Ron Bullman" <ron.bulman@mai l.com> wrote in message
          news:eZXkpw5TDH A.1624@TK2MSFTN GP11.phx.gbl...[color=blue]
          > Dmand,
          >
          > Yes, it's a huge job to write a parser, but the question is if that's
          > needed. If you are creatinga new programming language then surely you need
          > to write a parser otherwise why should you write a parser? See namespace
          > System.CodeDom for alternative way to create AST.
          >
          > If I understod correctly the OP's requirements we are just discussing[/color]
          about[color=blue]
          > a few hours programming task. The framework do have all the goodies[/color]
          needed.[color=blue]
          > Just stich them together. _No_ third party tools needed!
          >
          >
          > Ron
          > "Dmand" <dandersonnospa m@imxsoftware.c om> wrote in message
          > news:#DKX69xTDH A.2480@tk2msftn gp13.phx.gbl...[color=green]
          > > This is something I've recently engaged upon myself, and let me tell[/color][/color]
          you,[color=blue][color=green]
          > > it's no small effort. I'm probably about a third of the way there (I'm
          > > currently building a parse tree). Mind you I haven't looked at the
          > > System.CodeDom. Compiler namespace though I now intend to - it's the[/color][/color]
          first[color=blue][color=green]
          > > I've heard about it.
          > >
          > > Here is a good tutorial on one way to go about it,
          > >
          > > http://www.flipcode.com/tutorials/tut_scr01.shtml
          > >
          > > That uses the old Lex/Yacc tools, or at least their win32 counterparts[/color][/color]
          and[color=blue][color=green]
          > > implements it in C/C++. Those tools still only get you about half way[/color][/color]
          and[color=blue][color=green]
          > > learning to use them again requires a bit of effort. Personally I've[/color][/color]
          read[color=blue]
          > up[color=green]
          > > on compiler theory and design and am coding everything from the start
          > > myself. So far so good I just need to dedicate more hours (days/weeks)[/color][/color]
          to[color=blue][color=green]
          > > the job.
          > >
          > > BTW, the basic constituents of any scripting engine are the
          > >
          > > Lexer -> Abstract Syntax Tree/Parse Tree -> Byte Code Generator ->[/color][/color]
          Virtual[color=blue][color=green]
          > > Machine
          > >
          > > The Tree can be optional but it avails you a nice structure for[/color][/color]
          analysing[color=blue][color=green]
          > > the code (debugging etc) and probably simplifies the process of getting[/color]
          > from[color=green]
          > > token stream to byte code.
          > >
          > > As for C# generating compiler tools there is
          > > http://www.scifac.ru.ac.za/coco/. All the tools require you to learn a[/color][/color]
          bit[color=blue][color=green]
          > > about compiler theory (grammars and BNF notation etc) so you can specify
          > > your language and also of course there own usage and in the end they[/color][/color]
          only[color=blue][color=green]
          > > get part of the job done, hence of chosen to avoid them.
          > >
          > > That said if I can get System.CodeDom. Compiler to do it for me I will be
          > > taking a new route.
          > >
          > >
          > > "Michael Andersson" <a98mican@nospa m.ida.his.se> wrote in message
          > > news:013401c34e f7$05d8d190$a10 1280a@phx.gbl.. .[color=darkred]
          > > > Hi!
          > > > I'm writing a small game engine in c# and I'm in great
          > > > need of a scripting language. Does anyone know of such a
          > > > language?
          > > >
          > > > Would it be possible to use the VSA in some way to do this?
          > > >
          > > > Best regards,
          > > > /Michael[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...