Why Python won't work on .net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derrick 'dman' Hudson

    #16
    Re: Why Python won't work on .net

    On Tue, 09 Dec 2003 03:24:48 GMT, Courageous wrote:[color=blue]
    >[color=green]
    >>Why is python incompatible with .net? Why can't python be coded in C#?[/color]
    >
    > It's not. The .net virtual machine is Turing Complete.[/color]

    Sure, you could create and run a python interpreter on the .NET
    runtime, but how is that better than running the C implementation?
    Presumably people who discuss .NET integration are looking for the
    sort of language-agnostic plug-and-play that .NET promises. This is a
    different scenario than simply re-implementing python on a new
    platform.

    -D

    --
    Contrary to popular belief, Unix is user friendly.
    It just happens to be selective about who it makes friends with.
    -- Dave Parnas

    www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyn dns.org

    Comment

    • Fredrik Lundh

      #17
      Re: Why Python won't work on .net

      "Courageous " wrote:
      [color=blue][color=green][color=darkred]
      > >> The main problem is that functions are first class objects in Python, but
      > >> not in the CLS.[/color][/color]
      >
      > Functions are only addresses in C, the (main) language Python is
      > implemented in.[/color]

      what parts of "The CLS does have pointers to methods, but the situations
      in which they can be used are limited by the code validator" and "in neither
      case can the function pointer come from a variable" did you have trouble
      understanding?

      </F>




      Comment

      • Duncan Booth

        #18
        Re: Why Python won't work on .net

        martin@v.loewis .de (Martin v. =?iso-8859-15?q?L=F6wis?=) wrote in
        news:m3y8tnw6wh .fsf@mira.infor matik.hu-berlin.de:
        [color=blue][color=green]
        >> The main problem is that functions are first class objects in Python,
        >> but not in the CLS. The CLS uses delegates to refer to functions, and
        >> a delegate encapsulates both an object and a pointer to a method.[/color]
        >
        > In addition, I think one problem is that in CLS, a class has a
        > pre-determined set of data attributes, whereas in Python, instances
        > grow new data attributes as they live.[/color]

        I don't believe that is too much of a problem. Even in Python many of the
        data types have a fixed set of attributes. Even user defined classes, if
        they use __slots__, might not allow you to add attributes.

        So, for .Net, some user defined classes might have a __dict__ attribute,
        but others don't. Attributes which are accessed through __dict__ won't be
        visible to non-Python code, but that shouldn't be a problem.
        [color=blue]
        >[color=green]
        >> I have been playing around with a variant on the managed Python
        >> compiler, and I think I have figured a way to implement Python which
        >> might just get around this bottleneck. Unfortunately it requires a
        >> lot of refactoring from the original model, and I'm only working on
        >> it occasionally in my spare time.[/color]
        >
        > Very interesting. Are you willing to share the intermediate results
        > that you get? Publish early, publish often :-)
        >[/color]
        I'm more than willing to share, but so far its been a massive refactoring
        job so I was waiting until things settled down a bit before releasing
        anything. I expect the main speed gains to come when I get the new model
        for functions and methods working and eliminate as far as possible calls
        the reflection apis.


        --
        Duncan Booth duncan@rcp.co.u k
        int month(char *p){return(1248 64/((p[0]+p[1]-p[2]&0x1f)+1)%12 )["\5\x8\3"
        "\6\7\xb\1\x9\x a\2\0\4"];} // Who said my code was obscure?

        Comment

        • John J. Lee

          #19
          Re: Why Python won't work on .net

          martin@v.loewis .de (Martin v. Löwis) writes:
          [color=blue]
          > allenabethea@ao l.com (Allenabethea) writes:
          >[color=green]
          > > Why is python incompatible with .net? Why can't python be coded in
          > > C#?[/color]
          >
          > Who says that it cannot be coded in C#. It is a matter of fact that it
          > currently isn't, but it would be possible to reimplement the Python
          > interpreter in C# (instead of implementing it in C).
          >
          > As for generating MSIL byte codes: This is also possible, and has been
          > demonstrated. It also has been demonstrated that an initial
          > implementation is likely to be *very* slow.[/color]

          The official home of the Python Programming Language


          """Jim Hugunin is at it again""":



          """I've been working off and on for the past couple of months on a new
          implementation of Python for the CLR called IronPython. It compiles Python
          programs into verifiable IL and then dynamically executes them."""

          Interestingly, many of the (micro-) benchmarks show that IronPython is
          *faster* than Python 2.3.

          [color=blue]
          > The question is whether a Python implementation for .NET would be CLS
          > compliant (CLS == Common Language Specification). The existing
          > implementation has shown that this is not possible without giving up
          > parts of the Python semantics.[/color]
          [...]

          Still true, I guess.


          John

          Comment

          • Douglas Crockford

            #20
            Re: Why Python won't work on .net

            > >Why is python incompatible with .net? Why can't python be coded in C#?[color=blue]
            >
            > It's not. The .net virtual machine is Turing Complete.[/color]

            The subject here is imprecise. The issue is that .net performs very poorly with
            dynamic languages. So, for example, Microsoft is adding static features to
            JScript in an attempt to improve its performance.

            ..net is having a homogenizing effect on programming languages. In the end, they
            may all become the same. And the ultimate .net language will not be Python.

            Comment

            • Courageous

              #21
              Re: Why Python won't work on .net

              [color=blue]
              >what parts of "The CLS does have pointers to methods, but the situations
              >in which they can be used are limited by the code validator" and "in neither
              >case can the function pointer come from a variable" did you have trouble
              >understandin g?[/color]

              Probably most of it. I was tired. :)

              C//

              Comment

              • Courageous

                #22
                Re: Why Python won't work on .net

                [color=blue][color=green]
                >> It's not. The .net virtual machine is Turing Complete.[/color]
                >
                >The subject here is imprecise. The issue is that .net performs very poorly with
                >dynamic languages.[/color]

                Yes, I agree. While it would be *possible* to implement most anything
                on .net, any language that isn't a close friend, thematically, to C#,
                really isn't at home there. The underlying framework is really a virtual
                machine designed to implement C#'s features.

                Moreover, and more to the point, any other programming language which
                does not use these primitives as intended (e.g., uses dynamic composition
                to achieve inheritance instead of the framework's primary primitives to
                achieve same) will be a second bastard child in the environment, with
                glaring warts that will be obvious the moment interoperation is attempted.

                Since the *main appeal* of .net is language interop, ...

                Well, perhaps that answers the OP's question.

                C//

                Comment

                • Tim Roberts

                  #23
                  Re: Why Python won't work on .net

                  Gustavo Campanelli <birdiepageANTI @SPAMciudad.FIL TERcom.ar> wrote:[color=blue]
                  >
                  >As far as I've learned so far, .net is good for client server but not
                  >that great for standalone because of the need for the .net runtime to
                  >run things, which creates a large overhead.[/color]

                  Disk space is cheap and getting cheaper. Overhead is just not the issue it
                  once was. Plus, the run-time only has to be installed once, and it will be
                  included in all future Microsoft operating systems.
                  [color=blue]
                  >Performance is an issue too, as everything compiles JIT.[/color]

                  This is less of an issue than you might think. As you say, everything is
                  compiled the first time it is encountered, so anything used more than one
                  is actually native code. I'm also dubious, but people I respect tell me
                  that .NET program performance is surprisingly good.

                  Plus, the standard library is quite outstanding. It rivals Python's, and
                  exceeds it in Microsoft-centric areas.
                  [color=blue]
                  >I think that's why although .net is a great
                  >idea, a lot of languages will remain language of choice for
                  >standalone/no runtimes/speed critical/cross platform aplications. I
                  >could be wrong, but I don't think I'm far from the truth.[/color]

                  There are rumors that the Windows release after Longhorn might be
                  restricted to CLR/.NET programs only. I don't know what that actually
                  means, nor what the sentencing guidelines are for violating the rule, but
                  there it is.
                  --
                  - Tim Roberts, timr@probo.com
                  Providenza & Boekelheide, Inc.

                  Comment

                  • Fernando Perez

                    #24
                    Re: Why Python won't work on .net

                    Allenabethea wrote:
                    [color=blue]
                    > Jython is 100% java coded python.
                    > Python objects work with javacompilers and Virtual machines.
                    >
                    > I am a hobby programmer so the technical reasons are probably beyond me...
                    > Why is python incompatible with .net? Why can't python be coded in C#?
                    >
                    > I see the the MONO project on linux/unix is advancing. .Net seems to be a
                    > juggernaut especially if programmers will be able to use their favorite(most
                    > productive) language to program in. (every language but python)
                    >
                    > I am a new python tinkerer. I love the language. But what is its future but
                    > as a legacy tool?
                    >
                    > allen[/color]

                    Some who I suspect know a thing or two about python and .NET seem to disagree:



                    Cheers,

                    f

                    Comment

                    • John Roth

                      #25
                      Re: Why Python won't work on .net


                      "Fernando Perez" <fperez528@yaho o.com> wrote in message
                      news:br8nop$t97 $1@peabody.colo rado.edu...[color=blue]
                      > Allenabethea wrote:
                      >[color=green]
                      > > Jython is 100% java coded python.
                      > > Python objects work with javacompilers and Virtual machines.
                      > >
                      > > I am a hobby programmer so the technical reasons are probably beyond[/color][/color]
                      me...[color=blue][color=green]
                      > > Why is python incompatible with .net? Why can't python be coded in C#?
                      > >
                      > > I see the the MONO project on linux/unix is advancing. .Net seems to be[/color][/color]
                      a[color=blue][color=green]
                      > > juggernaut especially if programmers will be able to use their[/color][/color]
                      favorite(most[color=blue][color=green]
                      > > productive) language to program in. (every language but python)
                      > >
                      > > I am a new python tinkerer. I love the language. But what is its future[/color][/color]
                      but[color=blue][color=green]
                      > > as a legacy tool?
                      > >
                      > > allen[/color]
                      >
                      > Some who I suspect know a thing or two about python and .NET seem to[/color]
                      disagree:[color=blue]
                      >
                      > http://primates.ximian.com/~miguel/activity-log.php[/color]

                      This is real good news, but the fact that it's only at 0.1 makes me
                      suspect that they might find some real issues later that will slow
                      things down. But then, I'm old and cynical.

                      John Roth[color=blue]
                      >
                      > Cheers,
                      >
                      > f[/color]


                      Comment

                      • Mike Rovner

                        #26
                        Re: Why Python won't work on .net

                        John Roth wrote:[color=blue][color=green]
                        >> Some who I suspect know a thing or two about python and .NET seem to
                        >> disagree:
                        >>
                        >> http://primates.ximian.com/~miguel/activity-log.php[/color][/color]

                        Read only that

                        [color=blue]
                        > This is real good news, but the fact that it's only at 0.1 makes me
                        > suspect that they might find some real issues later that will slow
                        > things down. But then, I'm old and cynical.[/color]
                        [color=blue]
                        >From that benchmark I conclude Iron shall be compared with psyco,[/color]
                        not CPython.

                        Mike




                        Comment

                        Working...