Loading ...
Sorry, an error occurred while loading the content.
 

Re: [cc2-dev-l] CC2 and PHP??!

Expand Messages
  • Bryce Harrington
    ... If the core application can expose an API via .h files, or through some IPC mechanism like COM, CORBA, SOAP, etc. then there are methods in each of those
    Message 1 of 26 , Sep 10, 2003
      On Wed, 10 Sep 2003, Gregory Simkins wrote:
      > As to scripting languages, I would love to see something along the lines of
      > perl, python or tcl.

      If the core application can expose an API via .h files, or through some
      IPC mechanism like COM, CORBA, SOAP, etc. then there are methods in each
      of those languages to create scripting bindings. For example, Perl has
      h2xs. I know python has a similar capability. Other languages, such as
      VBA, may also work in this fashion. I've never done this so don't know
      precisely how hard it is, but it appears to be a feasible solution.

      The other approach is to embed the scripting system in the application.
      This is more intimate and powerful but I don't think it can be
      generalized in the above fashion, and you'd have to pick a single
      language. I have done this approach, and it's straightforward to do,
      however getting everyone to decide on a single scripting language sounds
      like a real challenge. ;-) FWIW, while I'm a Perl zealot, we found
      Python to be the best language for embedded scripting capabilities, due
      to its ease-of-learning.

      Bryce
    • Christopher Golden
      ... I second the motion for using Tcl/Tk as the scripting language. It s cross-platform, versatile, and includes features such as the ability to run untrusted
      Message 2 of 26 , Sep 10, 2003
        Gregory Simkins wrote:

        > As to scripting languages, I would love to see something along the lines of
        > perl, python or tcl.

        I second the motion for using Tcl/Tk as the scripting language.
        It's cross-platform, versatile, and includes features such as
        the ability to run untrusted scripts in a "safe Tcl" space, if
        that's important.

        I've used Tcl/Tk extensively for both work and pleasure, and
        have many times wished that I could write my CC2 scripts this
        way as well.

        Christopher Golden
        golden@...
      • Ken Snellings
        yes. What Chris said. :o) ... From: Christopher Golden To: Sent: Wednesday, September 10, 2003 9:28 PM
        Message 3 of 26 , Sep 10, 2003
          yes. What Chris said. :o)

          ----- Original Message -----
          From: "Christopher Golden" <golden@...>
          To: <cc2-dev-l@yahoogroups.com>
          Sent: Wednesday, September 10, 2003 9:28 PM
          Subject: Re: [cc2-dev-l] CC2 and PHP??!


          > Gregory Simkins wrote:
          >
          > > As to scripting languages, I would love to see something along the lines
          of
          > > perl, python or tcl.
          >
          > I second the motion for using Tcl/Tk as the scripting language.
          > It's cross-platform, versatile, and includes features such as
          > the ability to run untrusted scripts in a "safe Tcl" space, if
          > that's important.
          >
          > I've used Tcl/Tk extensively for both work and pleasure, and
          > have many times wished that I could write my CC2 scripts this
          > way as well.
          >
          > Christopher Golden
          > golden@...
          >
          >
          >
          > To Post a message, send it to: cc2-dev-l@...
          > To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >
          >
          >
        • Keith Mann
          Not to in any way detract from the excellent comments posted so far on this topic, but much (not all) of what I ve read seems to be along the lines of X would
          Message 4 of 26 , Sep 10, 2003
            Not to in any way detract from the excellent comments posted so far on this
            topic, but much (not all) of what I've read seems to be along the lines of
            "X would make a good (bad) application scripting language because..." rather
            than "X would make a good (bad) CC2 scripting language because...". I know
            the difference is subtle but I think it's important. Are there any
            particular aspects of [insert your scripting language of choice here] that
            make it particularly well-suited to CC2?

            Keith Mann
          • Simon Rogers
            The main purpose of the scripting language is to be an alternative to macros and the dev toolkit. It must be an approachable language, whatever it is. If it is
            Message 5 of 26 , Sep 11, 2003
              The main purpose of the scripting language is to be an alternative to macros
              and the dev toolkit. It must be an approachable language, whatever it is. If
              it is as difficult to use as C, then there is no point in implementing it.

              Simon
            • L. Lee Saunders
              Peter, I m just not sure how usefull it would be. The main power of a scripting language like PHP is for HTML generation. And it mostly is used on Unix
              Message 6 of 26 , Sep 11, 2003
                Peter,

                I'm just not sure how usefull it would be. The main power of a scripting
                language like PHP is for HTML generation. And it mostly is used on Unix
                platforms (I'm not saying that it does not run on Windows, because it does
                and does it well).

                I would think that the most powerfull extensions to CC2 would be:
                A) A server side renderer to GIF, JPG or PNG. If you could use PHP to
                generate 'on the fly' views of a map and server it to the requesting client,
                that would be great!
                B) TCP enabled applications that intergrated with CC2. If a group of users
                could connect to 'chat' and share a common CC2 map so that if one person
                changed anything then the change propagated to all the others would be
                enable a whole new world in CC2 usage.
                C) Limit element movement. If a PHP or any other language could limit
                movement based on scripted rules then CC2 could be extended to be used as an
                electronic gameboard. Imagine a checkers board drawn in CC2. If it was
                reds turn then the only pieced that could be moved would be the red ones and
                then they could only be moved to the open squares (like the way snap cursor
                only allows movement to certain points)

                If all three could be accomplished then I could easily see custom made
                online board games and rpg's using CC2 as the graphic engine.

                L. Lee Saunders

                >Hi!
                >
                >Any opinions on using PHP as a script language to CC2?
                >My idea was to use CC2 as a server much like the PHP <-> MySQL
                >interface works.
                >
                >Are there better alternatives?
                >Anyone with experience from writing extensions to PHP?
                >
                >Would a PHP interface be used?
                >What are the advantages compared with a regular macro/script?
                >For what kind of applications would this be used?
                >
                >Peter

                _________________________________________________________________
                Need more e-mail storage? Get 10MB with Hotmail Extra Storage.
                http://join.msn.com/?PAGE=features/es
              • Jeff Cuscutis
                One good language would be Python. http://www.python.org It is easily embeddable and many applications use it. One example is Caligari TrueSpace
                Message 7 of 26 , Sep 11, 2003
                  One good language would be Python. http://www.python.org
                  It is easily embeddable and many applications use it. One example is
                  Caligari TrueSpace http://www.caligari.com
                  It is an easy language to learn and has much online support.

                  Jeff Cuscutis

                  ----- Original Message -----
                  From: "Simon Rogers" <simon@...>
                  To: <cc2-dev-l@yahoogroups.com>
                  Sent: Wednesday, September 10, 2003 7:21 AM
                  Subject: RE: [cc2-dev-l] CC2 and PHP??!


                  > We certainly are looking for a new script language for version 8 - one for
                  > version 6 would also be great. I'm not familiar enough with PHP to say
                  > whether that's the one to go for. Does anyone else have an opinion?
                  > Simon
                  >
                • Jeff Osborn
                  Python programs are also easier to read than, say Perl. Perl is practically illegible to anyone but the original author. How about creating an Java JNI
                  Message 8 of 26 , Sep 11, 2003
                    Python programs are also easier to read than, say Perl. Perl is practically
                    illegible to anyone but the original author.

                    How about creating an Java JNI library interface to the existing API so that
                    people can write Java (portable) applications for CC2?

                    Java and Javascript are more approachable and have a lot of books that
                    people
                    can get their hands on to understand it. The one fault of Python is that it
                    can be hard to pick up (although it is readable).

                    -----Original Message-----
                    From: Jeff Cuscutis [mailto:cuscutis@...]
                    Sent: Thursday, September 11, 2003 8:56 PM
                    To: cc2-dev-l@yahoogroups.com
                    Subject: Re: [cc2-dev-l] CC2 and PHP??!


                    One good language would be Python. http://www.python.org
                    It is easily embeddable and many applications use it. One example is
                    Caligari TrueSpace http://www.caligari.com
                    It is an easy language to learn and has much online support.

                    Jeff Cuscutis

                    ----- Original Message -----
                    From: "Simon Rogers" <simon@...>
                    To: <cc2-dev-l@yahoogroups.com>
                    Sent: Wednesday, September 10, 2003 7:21 AM
                    Subject: RE: [cc2-dev-l] CC2 and PHP??!


                    > We certainly are looking for a new script language for version 8 - one for
                    > version 6 would also be great. I'm not familiar enough with PHP to say
                    > whether that's the one to go for. Does anyone else have an opinion?
                    > Simon
                    >



                    To Post a message, send it to: cc2-dev-l@...
                    To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

                    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  • Gregory Simkins
                    ... From: Jeff Osborn ... practically ... This is really a programmer problem not a problem of the language. The language allows users
                    Message 9 of 26 , Sep 14, 2003
                      ----- Original Message -----
                      From: "Jeff Osborn" <twajjo@...>
                      > Python programs are also easier to read than, say Perl. Perl is
                      practically
                      > illegible to anyone but the original author.

                      This is really a programmer problem not a problem of the language. The
                      language allows users to _quickly_ prototype. Sadly, many programmers take
                      that to mean they can do it _sloppily_. Perl allows users to write in a
                      variety of styles so that people from all programming niches can readily get
                      up to speed using it.
                      Well written code by a good programmer in any language is always easy to
                      read and poor programmers can generate spagetti code out of the strictest
                      languages.

                      Just a side note: java and javascript share this problem of often sloppy
                      code with perl - though not to as great of a degree - unless people use the
                      instant code generators for web/cgi - in which case the effect is often much
                      worse.

                      -Greg, greg@... - http://www.fwpro.org
                    • Gregory Simkins
                      ... I noted in one of my previous messages exactly what I would like in a scripting language (net/db/text processing....) and how they were important to me -
                      Message 10 of 26 , Sep 14, 2003
                        > the difference is subtle but I think it's important. Are there any
                        > particular aspects of [insert your scripting language of choice here] that
                        > make it particularly well-suited to CC2?
                        >
                        > Keith Mann

                        I noted in one of my previous messages exactly what I would like in a
                        scripting language (net/db/text processing....) and how they were important
                        to me - let me see if I can make those more direct to CC2
                        features/functions - and tie them to Python, Tcl, Perl

                        As to exact cc2 things I would like
                        -> Obviously: access to all the features provided by the current and
                        soon to be replaced macro system. (Python, Tcl, Perl)

                        -> Control over symbols, this would be most accessible if the symbols
                        were called by name as objects. By control I mean movement, scale, rotation
                        as well as properties such as color and text attributes. (Python, Tcl, Perl)

                        -> Control over layers and sheets (which we mostly already have with the
                        current macro system) (Python, Tcl, Perl)

                        -> Access to GUI for creation/display of zoom windows and map notes. To
                        allow dynamic/interactive atlas features. Would also be a first step in
                        making cc2 a much more useful piece of in-game software rather than just
                        pre-game. (Tcl shines here- python & perl both use Tcl's tk controls )

                        -> Access to external data sources (using current DBI standards this
                        could be anywhere - local drive or cross the world) so that map info could
                        be stored in a more useful manner - also brings back some underdeveloped
                        ideas from the old CM and the CoreRules Encounter generator. (Perl out
                        shines others here mostly from the numerous reusable DBI interfaces already
                        available)

                        -> Searching and manipulation of text within map and map notes to
                        include regular expressions - this tied in with the above GUI control makes
                        for full utility in interactive in-game maps. (Again Perl, nothing else -
                        well SED and AWK perhaps, comes close to perl in text manipulations)

                        Perl, Python and Tcl are really the major players with the most support.
                        Javascript lacks the power of true scripting languages as it is really made
                        mostly for the web and not application scripting. VBscript/VBA is out for
                        previously mentioned reasons (cost and multi-platform being key)

                        -Greg, greg@... - http://www.fwpro.org
                      • Peter Olsson
                        ... My initial idea on using PHP was not because of its web capabilities. Most of the standard PHP library is of no use with CC2. However I find it fairly easy
                        Message 11 of 26 , Sep 15, 2003
                          > As to scripting languages, I would love to see something along the
                          > lines of perl, python or tcl. I would not recommend PHP as a
                          > general purpose scripting language, I love it for what it does, but
                          > it's really not the kind of swissarmy knife I would want in a
                          > application scripting language. Javascript is also in this category
                          > with PHP (and VBscript as well I suppose)

                          My initial idea on using PHP was not because of its web capabilities.
                          Most of the standard PHP library is of no use with CC2. However I
                          find it fairly easy to learn and with a few additional libraries I
                          think it could work well with CC2. Anyway I have dropped the PHP idea
                          now...

                          There has been several suggestions of alternatives. I'm only vaguely
                          familiar with some of them and some I haven't heard of before (Lua
                          and ECMA Script). To me Python seems one of the strongest candidates
                          (it beats PHP :-)). From your arguments and a quick look at the web
                          site:

                          - Fairly common (at least many of you have suggested it)
                          - Free license
                          - Well documented on embedding and extending the language

                          The main point in all this is probably:
                          - Is Python easy enough to learn?

                          Lua looks like it could be a strong candidate as well, but the web
                          site gives the impression that it is a small project that might be
                          discontinued with a short notice. To me many languages seem too
                          complex for non-programmers to pick up or has problem with licensing
                          or embedding/installing. Right or wrong?

                          Peter
                        • Simon Rogers
                          What about Javascript/Java? That s free, cross platform and reasonably well known Simon ... From: Peter Olsson [mailto:peter@pkdata.se] Sent: 15 September 2003
                          Message 12 of 26 , Sep 16, 2003
                            What about Javascript/Java? That's free, cross platform and reasonably well
                            known
                            Simon

                            -----Original Message-----
                            From: Peter Olsson [mailto:peter@...]
                            Sent: 15 September 2003 22:10
                            To: cc2-dev-l@yahoogroups.com
                            Subject: Re: [cc2-dev-l] CC2 and PHP??!


                            > As to scripting languages, I would love to see something along the
                            > lines of perl, python or tcl. I would not recommend PHP as a
                            > general purpose scripting language, I love it for what it does, but
                            > it's really not the kind of swissarmy knife I would want in a
                            > application scripting language. Javascript is also in this category
                            > with PHP (and VBscript as well I suppose)

                            My initial idea on using PHP was not because of its web capabilities.
                            Most of the standard PHP library is of no use with CC2. However I
                            find it fairly easy to learn and with a few additional libraries I
                            think it could work well with CC2. Anyway I have dropped the PHP idea
                            now...

                            There has been several suggestions of alternatives. I'm only vaguely
                            familiar with some of them and some I haven't heard of before (Lua
                            and ECMA Script). To me Python seems one of the strongest candidates
                            (it beats PHP :-)). From your arguments and a quick look at the web
                            site:

                            - Fairly common (at least many of you have suggested it)
                            - Free license
                            - Well documented on embedding and extending the language

                            The main point in all this is probably:
                            - Is Python easy enough to learn?

                            Lua looks like it could be a strong candidate as well, but the web
                            site gives the impression that it is a small project that might be
                            discontinued with a short notice. To me many languages seem too
                            complex for non-programmers to pick up or has problem with licensing
                            or embedding/installing. Right or wrong?

                            Peter



                            To Post a message, send it to: cc2-dev-l@...
                            To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

                            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                          • Sam Robinson
                            In my opinion, if we have an automation interface, then any of the mentioned choices is fine. I suggested Javascript way back in the beginning of this
                            Message 13 of 26 , Sep 16, 2003
                              In my opinion, if we have an automation interface, then any of the mentioned
                              choices is fine. I suggested Javascript 'way back in the beginning of this
                              discussion. I've been thinking about the uses of scripting, and am fairly
                              excited about the possibilities.

                              My feeling is that many of the mentioned choices are a bit obscure.
                              Javascript and VB Script are fairly common in the windows world, and java
                              script is common everywhere. It makes a compelling case for javascript in my
                              mind.

                              In other words, yes javascript is a fine first choice.

                              Sam Robinson

                              -----Original Message-----
                              From: Simon Rogers [mailto:simon@...]
                              Sent: Tuesday, September 16, 2003 5:18 AM
                              To: cc2-dev-l@yahoogroups.com
                              Subject: RE: [cc2-dev-l] CC2 and PHP??!


                              What about Javascript/Java? That's free, cross platform and reasonably well
                              known
                              Simon

                              [...]
                            • Bruce A. Carson
                              I disagree. JavaScript is a HORRIBLE language. It is not strongly typed so every function call that you try to integrate with would have to attempt to
                              Message 14 of 26 , Sep 16, 2003
                                I disagree. JavaScript is a HORRIBLE language. It is not strongly typed so
                                every function call that you try to integrate with would have to attempt to
                                convert variable types both on the way into the function and on the way out.
                                The syntax is unclear and the implementations that I have seen the compilers
                                can't seem to determine where errors lie in the code.

                                Java is a better choice, but I don't think that it is any easier to learn
                                than C++. One of the targets in the original e-mail was to open up the
                                programming to less experienced coders and Java just won't do that.

                                Bruce

                                ----- Original Message -----
                                From: "Sam Robinson" <sam@...>
                                To: <cc2-dev-l@yahoogroups.com>
                                Sent: Tuesday, September 16, 2003 5:59 AM
                                Subject: RE: [cc2-dev-l] CC2 and PHP??!


                                > In my opinion, if we have an automation interface, then any of the
                                mentioned
                                > choices is fine. I suggested Javascript 'way back in the beginning of this
                                > discussion. I've been thinking about the uses of scripting, and am fairly
                                > excited about the possibilities.
                                >
                                > My feeling is that many of the mentioned choices are a bit obscure.
                                > Javascript and VB Script are fairly common in the windows world, and java
                                > script is common everywhere. It makes a compelling case for javascript in
                                my
                                > mind.
                                >
                                > In other words, yes javascript is a fine first choice.
                                >
                                > Sam Robinson
                                >
                                > -----Original Message-----
                                > From: Simon Rogers [mailto:simon@...]
                                > Sent: Tuesday, September 16, 2003 5:18 AM
                                > To: cc2-dev-l@yahoogroups.com
                                > Subject: RE: [cc2-dev-l] CC2 and PHP??!
                                >
                                >
                                > What about Javascript/Java? That's free, cross platform and reasonably
                                well
                                > known
                                > Simon
                                >
                                > [...]
                                >
                                >
                                >
                                >
                                > To Post a message, send it to: cc2-dev-l@...
                                > To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
                                >
                                > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                >
                                >
                              • Sam
                                Most scripting languages are pretty horrible, from a language purist s viewpoint. First, they are typically interpreted, rather than compiled. You are correct,
                                Message 15 of 26 , Sep 16, 2003
                                  Most scripting languages are pretty horrible, from a language purist's viewpoint. First, they are typically interpreted, rather than compiled. You are correct, they tend to have weak typing (because the user community for them prefers ease of coding to ease of maintenance) I'm curious about your experience with Javascript compilers, as this is not a thing I've ever seen. I certainly would expect this particular version to be an interpreted script engine, rather than a JIT engine.

                                  Having said that, this is the reason that I want an automation interface. If you prefer <language of your choice here> I would like for you to be able to implement it and give it to the rest of us. If it's truely that much better, then none of use would _want_ to use anything else.

                                  But as a company, I suspect that Profantasy, or any other company, would prefer to implement a standard widely recognised language, something that most of the potential buyers would know about, even if they didn't know it personally.

                                  Given that many of us are using C, C++, or assembler to do XPs I think that your comments about horrible languages might need to be reconsidered. Have you seen the kind of havoc that a bug in an assmbley level dll can cause? Any scripting language is safer than that!

                                  I'm not looking for perfect here, just good enough.

                                  Sam Robinson


                                  > I disagree. JavaScript is a HORRIBLE language. It is not strongly typed so
                                  > every function call that you try to integrate with would have to attempt to
                                  > convert variable types both on the way into the function and on the way out.
                                  > The syntax is unclear and the implementations that I have seen the compilers
                                  > can't seem to determine where errors lie in the code.
                                  >
                                  > Java is a better choice, but I don't think that it is any easier to learn
                                  > than C++. One of the targets in the original e-mail was to open up the
                                  > programming to less experienced coders and Java just won't do that.
                                  >
                                  > Bruce
                                  >
                                  > ----- Original Message -----
                                  > From: "Sam Robinson" <sam@...>
                                  > To: <cc2-dev-l@yahoogroups.com>
                                  > Sent: Tuesday, September 16, 2003 5:59 AM
                                  > Subject: RE: [cc2-dev-l] CC2 and PHP??!
                                  >
                                  >
                                  > > In my opinion, if we have an automation interface, then any of the
                                  > mentioned
                                  > > choices is fine. I suggested Javascript 'way back in the beginning of this
                                  > > discussion. I've been thinking about the uses of scripting, and am fairly
                                  > > excited about the possibilities.
                                  > >
                                  [...]
                                • Gregory Simkins
                                  ... well ... JavaScript doesn t seem robust enough to handle the job, also it lacks some basic scripting needs such as being embeddable and creation of gui
                                  Message 16 of 26 , Sep 19, 2003
                                    > What about JavaScript/Java? That's free, cross platform and reasonably
                                    well
                                    > known
                                    > Simon

                                    JavaScript doesn't seem robust enough to handle the job, also it lacks some
                                    basic scripting needs such as being embeddable and creation of gui elements
                                    in all os environments - there are platform specific libraries that
                                    'supposedly' handle this, but I've seen very limited success on this in
                                    anything but X Window systems - and there it uses a tcl/Tk extension to do
                                    the work.

                                    Java, while certainly robust enough, isn't really a scripting language.
                                    Also as languages go, it isn't really any easier to teach or learn than
                                    C/C++.

                                    Side note:
                                    Just happened across this between classes today (amazing what you can do
                                    with a minute of searching while kids change classes :)

                                    http://www.tcl.tk/advocacy/ <- it is unfortunately a biased page, but does
                                    have a fairly accurate comparison chart of features (of course like all
                                    'advocacy' charts they only list features inherit to tcl/Tk)

                                    -Greg, greg@... - http://www.fwpro.org
                                  • Simon Rogers
                                    Whatever programming language we use, the FastCAD core will be doing the GUI work. Almost all code will be function calls to FastCAD. Simon ... well ...
                                    Message 17 of 26 , Sep 22, 2003
                                      Whatever programming language we use, the FastCAD core will be doing the GUI
                                      work. Almost all code will be function calls to FastCAD.
                                      Simon

                                      > What about JavaScript/Java? That's free, cross platform and reasonably
                                      well
                                      > known
                                      > Simon

                                      JavaScript doesn't seem robust enough to handle the job, also it lacks some
                                      basic scripting needs such as being embeddable and creation of gui elements
                                      in all os environments - there are platform specific libraries that
                                      'supposedly' handle this, but I've seen very limited success on this in
                                      anything but X Window systems - and there it uses a tcl/Tk extension to do
                                      the work.

                                      Java, while certainly robust enough, isn't really a scripting language.
                                      Also as languages go, it isn't really any easier to teach or learn than
                                      C/C++.

                                      Side note:
                                      Just happened across this between classes today (amazing what you can do
                                      with a minute of searching while kids change classes :)

                                      http://www.tcl.tk/advocacy/ <- it is unfortunately a biased page, but does
                                      have a fairly accurate comparison chart of features (of course like all
                                      'advocacy' charts they only list features inherit to tcl/Tk)

                                      -Greg, greg@... - http://www.fwpro.org







                                      To Post a message, send it to: cc2-dev-l@...
                                      To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

                                      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                    • Simon Rogers
                                      Mike? Peter? What do you think? Which language appeals? Simon
                                      Message 18 of 26 , Sep 23, 2003
                                        Mike? Peter? What do you think? Which language appeals?
                                        Simon
                                      Your message has been successfully submitted and would be delivered to recipients shortly.