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


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

Re: is the java compiler written in c

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: is the java compiler written in c
Date Sat, 22 Aug 2015 17:55:32 +0000 (UTC)
Organization A noiseless patient Spider
Lines 43
Message-ID <mrad2k$468$1@dont-email.me> (permalink)
References <893a1a37-881c-4e59-a069-38386dd1b0fd@googlegroups.com> <mr2ngt$i1a$1@dont-email.me> <7b5d28de-2f30-4db7-aec7-03bd9ce81d00@googlegroups.com> <mr6j27$4et$1@dont-email.me> <mr8ni4$p8f$1@speranza.aioe.org> <mr9nqt$m9d$3@dont-email.me> <mr9oqe$mn$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Sat, 22 Aug 2015 17:55:32 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="4296"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DvQzMlvzghFgEaYEPm7ZQublAsooO3BE="
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
Cancel-Lock sha1:khkzO5KkxeW+pMrXFcOA50R+lkU=
Xref csiph.com comp.lang.java.programmer:32410

Show key headers only | View raw


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.

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.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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