Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32412

Re: is the java compiler written in c

From Eternal Hope <laughingspam99@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: is the java compiler written in c
Date 2015-08-22 19:59 +0100
Organization A noiseless patient Spider
Message-ID <mragmv$o00$1@dont-email.me> (permalink)
References (3 earlier) <mr6j27$4et$1@dont-email.me> <mr8ni4$p8f$1@speranza.aioe.org> <mr9nqt$m9d$3@dont-email.me> <mr9oqe$mn$1@dont-email.me> <mrad2k$468$1@dont-email.me>

Show all headers | View raw


On 22/08/2015 18:55, Martin Gregorie wrote:
> On Sat, 22 Aug 2015 13:11:41 +0100, Eternal Hope wrote:
>
>> On 22/08/2015 12:53, Martin Gregorie wrote:
>>> On Fri, 21 Aug 2015 22:42:11 -0400, Arne Vajhøj wrote:
>>>
>>>> To write an OS you need to get real close to the hardware and allow a
>>>> lot of funky stuff.
>>>>
>>> Hardware emulation too. I started to write a 6809 emulator in Java, but
>>> moved the project to C when I discovered what a pain it was going to be
>>> to emulate the registers (8 or 16 bit unsigned arithmetic but with the
>>> option to treat the LHS bit as the sign) It was *much* easier to simply
>>> declare the registers as 'unsigned short'  or 'unsigned byte' than it
>>> was to fight with Java's insistence on signed arithmetic.
>>
>>
>> https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html
>>
>> unsigned ops agogo
>
> Integer is a bit too long for what I need: all the 6809 registers are 8
> or 16 bits. Byte and Short are the obvious Java classes to use but, then
> again, Integer,Byte and Short all only do a subset of unsigned
> arithmetic. Since none of them do unsigned addition or subtraction and
> none of them have any facilities for treating the MSB as a sign or
> reporting overflow - all of which are needed to emulate the registers, it
> remains much easier to do it in C.
>
> This is just an observation that Java is unsuitable for some
> applications, not a criticism.

Heh heh, no problem here, criticise away, just put your tin hat on and 
avoid the shrapnel, although I don't think anyone would say that Java is 
perfect ... I mean *how many* classes in the latest distro. I preferred 
it when you had to include jars to get extended functionality. Made it 
more geeky some how :-)

Also Java doesn't seem to inspire people to starry eyed zealotry in the 
same way that C seems to.

> Yeah, I know I could use native code for this sort of stuff but, as much
> of the reason for using Java was to make the emulator fully portable,
> dropping bits of native C into the mix would probably have impacted that
> aim.
>
> Meanwhile C fits the bill very nicely.
>
>


-- 
Laughing Spam Fritter

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

is the java compiler written in c gdotone@gmail.com - 2015-08-19 12:41 -0700
  Re: is the java compiler written in c Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-08-19 16:06 -0400
    Re: is the java compiler written in c gdotone@gmail.com - 2015-08-19 16:12 -0700
      Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-20 11:08 +0000
        Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-20 20:34 -0400
      Re: is the java compiler written in c Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-08-20 07:44 -0400
      Re: is the java compiler written in c e.d.programmer@gmail.com - 2015-08-20 06:36 -0700
        Re: is the java compiler written in c gdotone@gmail.com - 2015-08-20 18:58 -0700
          Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-20 22:13 -0400
            Re: is the java compiler written in c g g <gdotone@gmail.com> - 2015-08-20 19:57 -0700
              Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-21 21:25 -0400
      Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-21 08:15 +0100
        Re: is the java compiler written in c e.d.programmer@gmail.com - 2015-08-21 06:56 -0700
          Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-21 15:32 +0100
        Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-21 16:51 -0500
          Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-21 23:32 +0000
            Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-21 23:35 -0500
          Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-21 22:39 -0400
            Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-21 22:42 -0500
              Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-22 11:41 +0000
                Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-22 10:03 -0500
              Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-30 22:03 -0400
                Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-31 01:09 -0500
                Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-09-03 20:46 -0400
                Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-09-04 10:01 -0500
            Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-22 11:37 +0000
              Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-22 12:56 +0100
                Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-22 18:04 +0000
                Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-22 14:27 -0500
              Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-30 22:06 -0400
          Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-22 10:31 +0100
            Re: is the java compiler written in c BGB <cr88192@hotmail.com> - 2015-08-23 01:31 -0500
        Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-21 22:42 -0400
          Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-22 11:53 +0000
            Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-22 13:11 +0100
              Re: is the java compiler written in c Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-22 17:55 +0000
                Re: is the java compiler written in c Eternal Hope <laughingspam99@gmail.com> - 2015-08-22 19:59 +0100
            Re: is the java compiler written in c Gene Wirchenko <genew@telus.net> - 2015-08-26 09:44 -0700
              Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-30 22:11 -0400
  Re: is the java compiler written in c Arne Vajhøj <arne@vajhoej.dk> - 2015-08-19 19:35 -0400

csiph-web