C to Java Byte Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Lutus

    #31
    Re: C to Java Byte Code

    Alex Fraser wrote:
    [color=blue]
    > "Paul Lutus" <nospam@nosite. zzz> wrote in message
    > news:10nqmt2okb 8hnec@corp.supe rnews.com...
    > [snip][color=green]
    >> If the compiler is ANSI C compliant, my example program will compile on
    >> that compiler and run on that plartform. Unions are supported by C, they
    >> are not supported by Java, and they are not supported by the program
    >> under discussion.[/color]
    >
    > From these statements, I infer that you have an example program which
    > demonstrates that unions are not supported. Is this correct? And if so,
    > what is this example program?[/color]

    1. The OP, unhappy with the original thread and eager to get some additional
    free publicity for his commercial product, created a new thread. The old
    thread has the same name and starts here:

    <a9083a87.04101 41937.1a7d4e1d@ posting.google. com>

    2. Java does not support the mapping of one variable type onto another.

    3. The product in question solves this problem by turning everything into a
    32-bit word, this making the "union" issue moot, since there is no point
    creating a union betweeen a thing and itself.

    The basic issue is that the disparate data types that can be mapped using
    "union" in C, cannot be mapped at all in Java (because of the latter's
    strong data typing). The OP solved this problem by making all data into
    32-bit words.
    [color=blue]
    >
    > Do you have any other evidence on which you base the claim above?[/color]

    Please take the time to read this and the prior thread before raising closed
    issues.
    [color=blue]
    > And if
    > so, what is it?[/color]

    *sigh*

    <cl7gbh$7th$1@h ood.uits.indian a.edu>

    *************** *************** *************** *************** *******

    "The size of each char, int, long, or float is 1 word (32 bits long).
    So, sizeof(int) is 1, sizeof(char) is 1, sizeof(float) is also 1,
    you got the idea.  Using a large array of int to mimic addressable memory is
    the cause for this.  The indexes to this large array are treated as
    addresses.  This memory is word-addressable and not byte-addressable.
    And programs that assume a byte-addressable architecture will need to be
    modified to suit the one used by MPC.  Unions are supported."

    *************** *************** *************** *************** *******

    If, as the OP claims, all data are 32-bit words, then the claim that unions
    are supported is false, since (1) Java will not allow disparate data types
    to be overlaid in memory, and (2) a union's purpose is the mapping of
    disparate data types, and there aren't any disparate data types.

    BTW there is also no support for anything that requires fewer or more than
    32 bits, e.g no support for typical doubles as just one example.

    --
    Paul Lutus
    A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


    Comment

    • Paul Lutus

      #32
      Re: C to Java Byte Code

      Dave Vandervies wrote:
      [color=blue]
      > In article <10nqq7cnnsv852 5@corp.supernew s.com>,
      > Paul Lutus <nospam@nosite. zzz> wrote:[/color]

      / ...
      [color=blue][color=green]
      >>When you are ready to address the topic of this thread, post again.[/color]
      >
      > I'm attempting to address the suitability of using an array of 32-bit
      > values to store values of varying types and use a union to convert
      > between the values stored there.[/color]

      That is not the topic, and you need to find out what "thread drift" refers
      to. You are always free to start any thread, on any topic, in any suitable
      newsgroup. For this thread, a thread originated and cross-posted to four
      nearly unrelated newsgroups by an unscrupulous commercial vendor eager for
      free publicity, you have limited options other than addressing the topic.
      [color=blue]
      > Since that's obviously not what you think the topic of this thread is,[/color]

      I did not start this thread, cross-post it, or choose its topic.
      [color=blue]
      > there's not much point in me continuing.[/color]

      There is not much point in your continuing.
      [color=blue]
      > This thread is going in the killfile as soon as I post this article.[/color]

      Why not before?
      [color=blue]
      > This means you can claim I'm wrong,[/color]

      Post the quote of the statement you falsely claim I made, or retract your
      false claim. Never invent statements for other people. I never said what
      you claim, the ball is in your court, we won't hold our breath.

      grep "wrong" (this thread) || echo "No evidence, no argument."
      [color=blue]
      > accuse me of onanism, and refuse to
      > accept that you might not know everything all you want,[/color]

      "Everything all you want"? I was right, your brain really is offline.
      [color=blue]
      > and I promise
      > not to reply unless somebody changes the subject line.[/color]

      We'll see.

      --
      Paul Lutus
      A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


      Comment

      • Mohd Hanafiah Abdullah

        #33
        Re: C to Java Byte Code

        In article <10nqamhfej8qqf 5@corp.supernew s.com>,
        Paul Lutus <nospam@nosite. zzz> wrote:[color=blue]
        >
        >Since unions are not supported in the product being discussed, their
        >ubiquity is not the issue, and your argument is just that, nothing more.
        >Also, the only "union" supported in the product is to make two or more
        >references to the same integer-sized variable (language provided by Mr.
        >Abdullah). Therefore, in point of fact, the product cannot map two
        >distinct, same-size entities onto one another, which is what a "union"
        >should be capable of doing. This means that Mr. Abdullah's claims in this
        >specific regard are, like so many others, not correct.[/color]

        Excuse me, but unions are supported in the product being discussed.

        Napi
        --

        Comment

        • Mohd Hanafiah Abdullah

          #34
          Re: C to Java Byte Code

          In article <10nqefd36j5pod 2@corp.supernew s.com>,
          Paul Lutus <nospam@nosite. zzz> wrote:[color=blue]
          >Dave Vandervies wrote:
          >[color=green]
          >> In article <10nqamhfej8qqf 5@corp.supernew s.com>,
          >> Paul Lutus <nospam@nosite. zzz> wrote:[color=darkred]
          >>>Gerry Quinn wrote:[/color]
          >>[color=darkred]
          >>>> As I understand it, this issue only affects incompetent programmers who
          >>>> write code that assumes that bytes have eight bits.
          >>>
          >>>No, the original prohibition to which I refer was provided by Mr.
          >>>Abdullah, who said:
          >>>
          >>><cl7gbh$7th$ 1@hood.uits.ind iana.edu>
          >>>
          >>>************ *************** *************** ***********
          >>>
          >>>" ... programs that assume a byte-addressable architecture will need to be
          >>>modified to suit the one used by MPC."
          >>>
          >>>************ *************** *************** ***********
          >>>
          >>>Care to retract your argument now, or later?[/color]
          >>
          >> ...So it doesn't provide a byte-addressable memory model.
          >>
          >> Care to provide a reference to support your claim that C requires a
          >> byte-addressable memory model?[/color]
          >
          >Before you try to shift the burden of evidence, care to find where I made
          >this claim? Please do not drift the tread -- this is the easiest imaginable
          >activity, but it sheds no light on anyting.
          >[color=green][color=darkred]
          >>>Since unions are not supported in the product being discussed, their
          >>>ubiquity is not the issue, and your argument is just that, nothing more.
          >>>Also, the only "union" supported in the product is to make two or more
          >>>references to the same integer-sized variable (language provided by Mr.
          >>>Abdullah). Therefore, in point of fact, the product cannot map two
          >>>distinct, same-size entities onto one another, which is what a "union"
          >>>should be capable of doing. This means that Mr. Abdullah's claims in this
          >>>specific regard are, like so many others, not correct.[/color]
          >>
          >> I haven't been following this thread too closely, but if I'm not mistaken,
          >> union support was never claimed to be this limited (except by you).[/color]
          >
          >The OP eventually admitted that all variables are mapped to Java native
          >integers -- all of them. This means there is no support for the property of
          >unions that they can conjoin two unrelated data types so long as their size
          >is adjusted to be the same.[/color]

          All variables are located in the large array of int. As a result of
          register allocation several of the variables end up cached in Java native
          variables of int type or float type. But, their home locations are always
          in the large array of int. And again, unions and structs are supported.

          Napi

          --

          Comment

          • Mohd Hanafiah Abdullah

            #35
            Re: C to Java Byte Code

            In article <10nqnnc7nau6m7 3@corp.supernew s.com>,
            Paul Lutus <nospam@nosite. zzz> wrote:[color=blue]
            >Dave Vandervies wrote:
            >[color=green]
            >> In article <10nqefd36j5pod 2@corp.supernew s.com>,
            >> Paul Lutus <nospam@nosite. zzz> wrote:[color=darkred]
            >>>Dave Vandervies wrote:[/color][/color]
            >
            >/ ...
            >[color=green][color=darkred]
            >>>> Care to provide a reference to support your claim that C requires a
            >>>> byte-addressable memory model?
            >>>
            >>>Before you try to shift the burden of evidence, care to find where I made
            >>>this claim? Please do not drift the tread -- this is the easiest
            >>>imaginable activity, but it sheds no light on anyting.[/color]
            >>[/color][/color]
            ....[color=blue][color=green]
            >> It does NOT invalidate the claim that this is a C implementation targeting
            >> the JVM, with runtime code that treats a large array of Java integers
            >> as a word-addressable memory space.[/color]
            >
            >Ther OP made false claims both here and on his Web site. I said the claims
            >were false. At which point did you lose track of the topic?[/color]

            Actually neither I here nor the website ever claimed this is a conversion from
            C to Java, but a conversion from C to Java Byte Code, and that's a big
            difference. Please read carefully.

            Napi

            --

            Comment

            • Paul Lutus

              #36
              Re: C to Java Byte Code

              Mohd Hanafiah Abdullah wrote:
              [color=blue]
              > In article <10nqamhfej8qqf 5@corp.supernew s.com>,
              > Paul Lutus <nospam@nosite. zzz> wrote:[color=green]
              >>
              >>Since unions are not supported in the product being discussed, their
              >>ubiquity is not the issue, and your argument is just that, nothing more.
              >>Also, the only "union" supported in the product is to make two or more
              >>references to the same integer-sized variable (language provided by Mr.
              >>Abdullah). Therefore, in point of fact, the product cannot map two
              >>distinct, same-size entities onto one another, which is what a "union"
              >>should be capable of doing. This means that Mr. Abdullah's claims in this
              >>specific regard are, like so many others, not correct.[/color]
              >
              > Excuse me, but unions are supported in the product being discussed.[/color]

              Post the byte code in which a Java float is united with a Java integer. Or
              retract your statement.

              Unions are not supported in your product. A C union is a joining of two or
              more distinct variable types with simultaneous access to both, e.g. it is
              an example of a memory block shared between data types. This is not allowed
              in Java because of strong typing.

              You have arranged to create a single 32-bit word datatype to represent
              everything, so there is no distinction between one kind of variable and
              another. Therefore there are no disparate data types, therefore there are
              no unions as that term is understood.

              But, as I say above, prove me wrong. Post the Java bytecode that unites a
              Java float and a Java integer in the same address space, something not
              allowed in Java.

              --
              Paul Lutus
              A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


              Comment

              • Paul Lutus

                #37
                Re: C to Java Byte Code

                Mohd Hanafiah Abdullah wrote:
                [color=blue]
                > In article <10nqefd36j5pod 2@corp.supernew s.com>,
                > Paul Lutus <nospam@nosite. zzz> wrote:[/color]

                / ...
                [color=blue][color=green]
                >>The OP eventually admitted that all variables are mapped to Java native
                >>integers -- all of them. This means there is no support for the property
                >>of unions that they can conjoin two unrelated data types so long as their
                >>size is adjusted to be the same.[/color]
                >
                > All variables are located in the large array of int. As a result of
                > register allocation several of the variables end up cached in Java native
                > variables of int type or float type.[/color]

                Please explain how you have used "register allocation" to circumvent Java's
                strong data typing. Or are you talking about native code called by Java?
                [color=blue]
                > But, their home locations are always
                > in the large array of int. And again, unions and structs are supported.[/color]

                Show us the bytecode that overlays a Java float and a Java integer into the
                same memory space. That is what a union is. Show us the Java bytecode that
                allows one to manipulate individual bits of a Java float datatype, as a C
                union allows.

                If you use the obvious approach of translating the float using
                Float.floatToIn tBits() and the reverse method, it wil be interesting to se
                how you handle simultanous changes to both forms. In any case, it is not a
                union. Java doesn't allow this.

                --
                Paul Lutus
                A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


                Comment

                • Paul Lutus

                  #38
                  Re: C to Java Byte Code

                  Mohd Hanafiah Abdullah wrote:
                  [color=blue]
                  > In article <10nqnnc7nau6m7 3@corp.supernew s.com>,
                  > Paul Lutus <nospam@nosite. zzz> wrote:[/color]

                  / ...
                  [color=blue][color=green]
                  >>Ther OP made false claims both here and on his Web site. I said the claims
                  >>were false. At which point did you lose track of the topic?[/color]
                  >
                  > Actually neither I here nor the website ever claimed this is a conversion
                  > from C to Java, but a conversion from C to Java Byte Code, and that's a
                  > big difference.[/color]

                  No, it is not a difference at all. This is because of "javap" and similar
                  tools, which allow one to acquire a rudimentary source file from any Java
                  bytecode file.

                  Or are you claiming that you have created Java bytecode that cannot be
                  rendered into human-readable form by "javap" and other similar tools? I am
                  sure Sun Microsystems will be very interested to hear of this development.
                  [color=blue]
                  > Please read carefully.[/color]

                  Please check your facts before posting. In any case, as anyone can see by
                  reading this and the thread you abandoned, the objections are not about
                  whether Java source or bytecode is generated, but whether the statements
                  made are valid claims or marketing hype.

                  --
                  Paul Lutus
                  A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


                  Comment

                  • Mohd Hanafiah Abdullah

                    #39
                    Re: C to Java Byte Code

                    In article <10nre1ja02ulld c@corp.supernew s.com>,
                    Paul Lutus <nospam@nosite. zzz> wrote:[color=blue]
                    >Mohd Hanafiah Abdullah wrote:
                    >[color=green]
                    >> In article <10nqamhfej8qqf 5@corp.supernew s.com>,
                    >> Paul Lutus <nospam@nosite. zzz> wrote:[color=darkred]
                    >>>
                    >>>Since unions are not supported in the product being discussed, their
                    >>>ubiquity is not the issue, and your argument is just that, nothing more.
                    >>>Also, the only "union" supported in the product is to make two or more
                    >>>references to the same integer-sized variable (language provided by Mr.
                    >>>Abdullah). Therefore, in point of fact, the product cannot map two
                    >>>distinct, same-size entities onto one another, which is what a "union"
                    >>>should be capable of doing. This means that Mr. Abdullah's claims in this
                    >>>specific regard are, like so many others, not correct.[/color]
                    >>
                    >> Excuse me, but unions are supported in the product being discussed.[/color]
                    >
                    >Post the byte code in which a Java float is united with a Java integer. Or
                    >retract your statement.
                    >
                    >Unions are not supported in your product. A C union is a joining of two or
                    >more distinct variable types with simultaneous access to both, e.g. it is
                    >an example of a memory block shared between data types. This is not allowed
                    >in Java because of strong typing.
                    >
                    >You have arranged to create a single 32-bit word datatype to represent
                    >everything, so there is no distinction between one kind of variable and
                    >another. Therefore there are no disparate data types, therefore there are
                    >no unions as that term is understood.
                    >
                    >But, as I say above, prove me wrong. Post the Java bytecode that unites a
                    >Java float and a Java integer in the same address space, something not
                    >allowed in Java.[/color]

                    Here's an example:

                    #include <stdio.h>

                    typedef union abc
                    { int x;
                    float y;
                    } a_union;

                    main()
                    { a_union z;

                    z.x = 1078531719;
                    printf("int val = %d\n", z.x);
                    printf("float val = %f\n", z.y);

                    z.y = 3.142;
                    printf("int val = %d\n", z.x);
                    printf("float val = %f\n", z.y);
                    }

                    MPC produced:
                    int val = 1078531719
                    float val = 3.142
                    int val = 1078531719
                    float val = 3.142

                    gcc produced:
                    int val = 1078531719
                    float val = 3.142000
                    int val = 1078531719
                    float val = 3.142000


                    Napi

                    --

                    Comment

                    • CBFalconer

                      #40
                      Re: C to Java Byte Code

                      Paul Lutus wrote:[color=blue]
                      > Willem wrote:
                      >[/color]
                      .... snip ...[color=blue]
                      >[color=green]
                      >> ) But if they are both Java native integers, no mapping is taking
                      >> place. If ) there are two accesses to a simple integer value, the
                      >> term "mapping" is not ) appropriate, but if a C union is provided
                      >> and two different data types are ) mapped/conjoined, the term in[/color]
                      >
                      > You really need to set up your newsreader properly. Use this post
                      > as an example of standard quoting style.[/color]

                      His problem is extremely simple - stop using a non-standard quote
                      character. The standard is '>', not ')'.

                      --
                      Chuck F (cbfalconer@yah oo.com) (cbfalconer@wor ldnet.att.net)
                      Available for consulting/temporary embedded and systems.
                      <http://cbfalconer.home .att.net> USE worldnet address!


                      Comment

                      • Paul Lutus

                        #41
                        Re: C to Java Byte Code

                        Mohd Hanafiah Abdullah wrote:

                        / ...
                        [color=blue][color=green]
                        >>But, as I say above, prove me wrong. Post the Java bytecode that unites a
                        >>Java float and a Java integer in the same address space, something not
                        >>allowed in Java.[/color]
                        >
                        > Here's an example:
                        >
                        > #include <stdio.h>
                        >
                        > typedef union abc
                        > { int x;
                        > float y;
                        > } a_union;
                        >
                        > main()
                        > { a_union z;
                        >
                        > z.x = 1078531719;
                        > printf("int val = %d\n", z.x);
                        > printf("float val = %f\n", z.y);
                        >
                        > z.y = 3.142;
                        > printf("int val = %d\n", z.x);
                        > printf("float val = %f\n", z.y);
                        > }
                        >
                        > MPC produced:
                        > int val = 1078531719
                        > float val = 3.142
                        > int val = 1078531719
                        > float val = 3.142[/color]

                        1. This doesn't reply to my post's request.

                        2. This is not a union, it it two instances of the same variable. Again, to
                        reply to my post, you need to provide the Java bytecode that unites a Java
                        float and a Java integer in the same address space, something that is not
                        allowed in Java.

                        I would ask that you post an example of two data types of innately different
                        sizes, but you have already designed your way out of that possibility,
                        along with any support for doubles and other data types larger or smaller
                        than 32 bits.

                        To summarize, this is a commercial exploitation of Usenet for private gain,
                        an attempt to market a product with hype rather than truth. The description
                        of the product in the thread by Mr. Abdullah directly, and on his Website,
                        simply does not correspond to the truth.

                        According to Mr. Abdullah, a little "tweaking" will make a typical C program
                        compatible with his product. But in tests and in the few moments of candor
                        from these threads, this turns out not to be true for several reasons.
                        Interested readers can read this thread and the one Mr. Abdullah abandoned
                        to assemble a more accurate picture.

                        I call on Mr. Abdullah to release review copies of his product to
                        professional reviewers, rather than try to construct set pieces that have
                        little to do with the information requested, while valiantly trying to
                        exploit Usenet for private gain.

                        --
                        Paul Lutus
                        A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


                        Comment

                        • Keith Thompson

                          #42
                          Re: C to Java Byte Code

                          Paul Lutus <nospam@nosite. zzz> writes:[color=blue]
                          > Mohd Hanafiah Abdullah wrote:[color=green][color=darkred]
                          >>>But, as I say above, prove me wrong. Post the Java bytecode that unites a
                          >>>Java float and a Java integer in the same address space, something not
                          >>>allowed in Java.[/color]
                          >>
                          >> Here's an example:
                          >>
                          >> #include <stdio.h>
                          >>
                          >> typedef union abc
                          >> { int x;
                          >> float y;
                          >> } a_union;
                          >>
                          >> main()
                          >> { a_union z;
                          >>
                          >> z.x = 1078531719;
                          >> printf("int val = %d\n", z.x);
                          >> printf("float val = %f\n", z.y);
                          >>
                          >> z.y = 3.142;
                          >> printf("int val = %d\n", z.x);
                          >> printf("float val = %f\n", z.y);
                          >> }
                          >>
                          >> MPC produced:
                          >> int val = 1078531719
                          >> float val = 3.142
                          >> int val = 1078531719
                          >> float val = 3.142[/color]
                          >
                          > 1. This doesn't reply to my post's request.
                          >
                          > 2. This is not a union, it it two instances of the same variable. Again, to
                          > reply to my post, you need to provide the Java bytecode that unites a Java
                          > float and a Java integer in the same address space, something that is not
                          > allowed in Java.[/color]

                          How is this not a union? What do you think a union is, anyway?

                          --
                          Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
                          San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
                          We must do something. This is something. Therefore, we must do this.

                          Comment

                          • Paul Lutus

                            #43
                            Re: C to Java Byte Code

                            Keith Thompson wrote:
                            [color=blue]
                            > Paul Lutus <nospam@nosite. zzz> writes:[/color]

                            / ...
                            [color=blue][color=green]
                            >> 1. This doesn't reply to my post's request.
                            >>
                            >> 2. This is not a union, it it two instances of the same variable. Again,
                            >> to reply to my post, you need to provide the Java bytecode that unites a
                            >> Java float and a Java integer in the same address space, something that
                            >> is not allowed in Java.[/color]
                            >
                            > How is this not a union? What do you think a union is, anyway?[/color]

                            A union is two or more disparate variable types that share the same memory
                            space. Because of its strong data typing, Java simply doesn't allow this.
                            As a result, the program in question has to jump through hoops to pretend
                            to support a union such as is imagined to exist in the above examples and
                            those I provided earlier.

                            This is why I asked to see the Java bytecode, and this is why Mr. Abdullah
                            refused my request.

                            --
                            Paul Lutus
                            A site for people who think. Intellectual resources, programming, astronomy, science, mathematics, Java/JavaScript applets, programming instruction, home of Arachnophilia.


                            Comment

                            • Richard Herring

                              #44
                              Re: C to Java Byte Code

                              In message <10nre1ja02ulld c@corp.supernew s.com>, Paul Lutus
                              <nospam@nosite. zzz> writes

                              [too much]

                              You don't appear to be discussing C++ here, so please remove
                              comp.lang.c++ from the newsgroups list in your future postings.

                              Followups set.

                              A study of BCPL 's type system might shed more light, in any case ;-)
                              --
                              Richard Herring

                              Comment

                              • CBFalconer

                                #45
                                Re: C to Java Byte Code

                                Mohd Hanafiah Abdullah wrote:[color=blue]
                                >[/color]
                                .... snip ...[color=blue]
                                >
                                > Here's an example:
                                >
                                > #include <stdio.h>
                                >
                                > typedef union abc
                                > { int x;
                                > float y;
                                > } a_union;
                                >
                                > main()
                                > { a_union z;
                                >
                                > z.x = 1078531719;
                                > printf("int val = %d\n", z.x);
                                > printf("float val = %f\n", z.y);[/color]

                                illegal statement here. You cannot access a field of a union as a
                                type other than what you last wrote into it.
                                [color=blue]
                                >
                                > z.y = 3.142;
                                > printf("int val = %d\n", z.x);
                                > printf("float val = %f\n", z.y);[/color]

                                Same thing here.
                                [color=blue]
                                > }
                                >
                                > MPC produced:[/color]

                                Meaningless. This is undefined behavior.


                                --
                                Chuck F (cbfalconer@yah oo.com) (cbfalconer@wor ldnet.att.net)
                                Available for consulting/temporary embedded and systems.
                                <http://cbfalconer.home .att.net> USE worldnet address!


                                Comment

                                Working...