Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Ads

Discussion Groups

Discussion Groups | Comp.Arch.Embedded | Shall I move from C to Java?

There are 35 messages in this thread.

You are currently looking at messages 20 to 30.

Re: Shall I move from C to Java? - larwe - 19:38 14-08-07

On Aug 14, 1:07 am, dick <dick_12345...@hotmail.com> wrote:

> Can I access HW registers in Java? Or can I call C function from Java
> program?

Not directly, and yes, respectively.

There is an implementation of a JVM for AVR; I've seen it mentioned
briefly in c.a.e in response to a thread I posted asking something
related.

There is ALSO an implementation of a JVM for the Commodore 64 (a 1MHz
6502-family device, for those who don't know this).

The real question is, do you understand what Java will provide for
you, and what it will cost you (in terms of resources, performance
etc). I had very specific reasons for wanting to use Java in my
project (it was the PC UI side of an embedded system).




Re: Shall I move from C to Java? - Tim Wescott - 20:31 14-08-07

On Tue, 14 Aug 2007 10:00:47 -0700, dick wrote:

> Hans-Bernhard Brker wrote:
>> [X-post lacked a F'up2; reduced to one group]
>>
>> dick wrote:
>>
>> > I am planning to learn Java.
>>
>> Why, given you clearly don't know if it's going to do you any good?
>>
>> > Can I access HW registers in Java? Or can I call C function from Java
>> > program?
>>
>> If you must ask, that strongly implies it's a bad idea for you to learn
>> Java at this point.  You have to analyze what it means to use Java
>> instead of C first.
> 
> Is there any C syntax extension that support multi-thread like Java
> syntax?
> or how can I use  C Macro to hide the OS routine call in C program?
> 
> I don't like the style:
> fun(...)
> {
> p();
> .
> .
> .
> v();
> }
> 
> I want to use
> syn fun(...)
> {
> .
> .
> .
> }
> 

So, you're saying you want to redefine C such that experienced C
programmers won't be able to read your code?

Just who are you planning on hiring to work on this?

> 
> another question is how to disable "goto", can I write #define goto
> error("no goto")

Well, why not just refrain from using "goto"?  I've been coding in C for
nearly 20 years and have yet to use it myself (yes, I know it's good for
exception handling).  Were I to see one in a code review I'd be
scrutinizing it closely, and probably trying to suggest realistic
alternatives.

If you're trying to control developers by putting it in some universal
header file they'll get around you one way or another; if you're trying to
avoid using it yourself -- just avoid it.

-- 
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Re: Shall I move from C to Java? - dick - 22:49 14-08-07

Tim Wescott wrote:
> On Tue, 14 Aug 2007 10:00:47 -0700, dick wrote:
>
> > Hans-Bernhard Brker wrote:
> >> [X-post lacked a F'up2; reduced to one group]
> >>
> >> dick wrote:
> >>
> >> > I am planning to learn Java.
> >>
> >> Why, given you clearly don't know if it's going to do you any good?
> >>
> >> > Can I access HW registers in Java? Or can I call C function from Java
> >> > program?
> >>
> >> If you must ask, that strongly implies it's a bad idea for you to learn
> >> Java at this point.  You have to analyze what it means to use Java
> >> instead of C first.
> >
> > Is there any C syntax extension that support multi-thread like Java
> > syntax?
> > or how can I use  C Macro to hide the OS routine call in C program?
> >
> > I don't like the style:
> > fun(...)
> > {
> > p();
> > .
> > .
> > .
> > v();
> > }
> >
> > I want to use
> > syn fun(...)
> > {
> > .
> > .
> > .
> > }
> >
>
> So, you're saying you want to redefine C such that experienced C
> programmers won't be able to read your code?
>
> Just who are you planning on hiring to work on this?

how do you think

p();
if(xxx=yyy)
goto L1;
else
{
do_something();
v();
}

if the language support multi-thread, the debug time will be less.

a save language should not let user see the OS.


>
> >
> > another question is how to disable "goto", can I write #define goto
> > error("no goto")
>
> Well, why not just refrain from using "goto"?  I've been coding in C for
> nearly 20 years and have yet to use it myself (yes, I know it's good for
> exception handling).  Were I to see one in a code review I'd be
> scrutinizing it closely, and probably trying to suggest realistic
> alternatives.
>
> If you're trying to control developers by putting it in some universal
> header file they'll get around you one way or another; if you're trying to
> avoid using it yourself -- just avoid it.
>
> --
> Tim Wescott
> Control systems and communications consulting
> http://www.wescottdesign.com
>
> Need to learn how to apply control theory in your embedded system?
> "Applied Control Theory for Embedded Systems" by Tim Wescott
> Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html


Re: Shall I move from C to Java? - Andrew Reilly - 02:22 15-08-07

On Tue, 14 Aug 2007 19:49:12 -0700, dick wrote:

> if the language support multi-thread, the debug time will be less.
> 
> a save language should not let user see the OS.

If you want a "safe" language that was designed to operate in a
multithreaded environment and do systems/embedded programming, then there
are approximately two answers, that I know of: Ada and Modula-3.  There
are certainly groups of people with extended versions of Java and C# doing
approximately that too, though.  Eiffel might fit the bill, and
generally compiles through C, which might help.

Most practitioners just use C or assembly, and leave the safety and
threading to higher-level tools (such as static checkers or code review
processes) and operating systems.

If you want state of the art type safety, you might want to investigate
erlang, ocaml, sml and hascall, but I don't know that anyone is using them
for embedded work, unless you count telephone exchanges (quite a few of
which run erlang) as embedded systems, which they probably are...

-- 
Andrew


Re: Shall I move from C to Java? - Colin Paul Gloster - 08:20 15-08-07

In news:1...@k79g2000hse.googlegroups.com
timestamped Tue, 14 Aug 2007 10:00:47 -0700,
dick <d...@hotmail.com> posted:
|-------------------------------------------------------------------------|
|"[..]                                                                    |
|                                                                         |
|another question is how to disable "goto", can I write #define goto      |
|error("no goto")"                                                        |
|-------------------------------------------------------------------------|

Yes, but someone else can simply type
#undef goto

Re: Shall I move from C to Java? - Vladimir Vassilevsky - 10:23 15-08-07


larwe wrote:

> On Aug 14, 4:15 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
> wrote:
> 
>>dick wrote:
>>
>>>Hi everyone,
>>
>>>I am planning to learn Java.
>>
>>http://www.microsoft.com/mspress/books/10457.aspx
> 
> 
> What has Microsoft's proprietary closed nonsense got to do with Java?
> Or, for that matter, embedded programming?
> 

Stupid questions deserve equaly stupid answers.

VLV


Re: Shall I move from C to Java? - rickman - 12:26 15-08-07

On Aug 15, 10:23 am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> larwe wrote:
> > On Aug 14, 4:15 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
> > wrote:
>
> >>dick wrote:
>
> >>>Hi everyone,
>
> >>>I am planning to learn Java.
>
> >>http://www.microsoft.com/mspress/books/10457.aspx
>
> > What has Microsoft's proprietary closed nonsense got to do with Java?
> > Or, for that matter, embedded programming?
>
> Stupid questions deserve equaly stupid answers.
>
> VLV

And you are always there to oblige, right?   ;^)

Sorry, I couldn't resist...



Re: Shall I move from C to Java? - larwe - 12:34 15-08-07

On Aug 15, 10:23 am, Vladimir Vassilevsky

> Stupid questions deserve equaly stupid answers.

The question may have been ill-formed but I do not have enough
information to judge that its intent was stupid.


Re: Shall I move from C to Java? - dick - 13:47 15-08-07

Andrew Reilly wrote:
> On Tue, 14 Aug 2007 19:49:12 -0700, dick wrote:
>
> > if the language support multi-thread, the debug time will be less.
> >
> > a save language should not let user see the OS.
>
> If you want a "safe" language that was designed to operate in a
> multithreaded environment and do systems/embedded programming, then there
> are approximately two answers, that I know of: Ada and Modula-3.  There
> are certainly groups of people with extended versions of Java and C# doing
> approximately that too, though.  Eiffel might fit the bill, and
> generally compiles through C, which might help.
>
> Most practitioners just use C or assembly, and leave the safety and
> threading to higher-level tools (such as static checkers or code review
> processes) and operating systems.
>
> If you want state of the art type safety, you might want to investigate
> erlang, ocaml, sml and hascall, but I don't know that anyone is using them
> for embedded work, unless you count telephone exchanges (quite a few of
> which run erlang) as embedded systems, which they probably are...
>

Is there any Macro can hide the OS routine?

I believe that C syntax extension is a cheaper solution than a new
language.

Actually in Embedded world, C has a lot syntax extension such as
"interrupt fun()"...

So can we have "exclusive fun()" or "exclusive {...}"?




> --
> Andrew


Re: Shall I move from C to Java? - Robert Adsett - 19:00 15-08-07

In article <1...@d55g2000hsg.googlegroups.com>, dick 
says...
> 
> Andrew Reilly wrote:
> > On Tue, 14 Aug 2007 19:49:12 -0700, dick wrote:
> >
> > > if the language support multi-thread, the debug time will be less.
> > >
> > > a save language should not let user see the OS.
> >
> > If you want a "safe" language that was designed to operate in a
> > multithreaded environment and do systems/embedded programming, then there
> > are approximately two answers, that I know of: Ada and Modula-3.  There
> > are certainly groups of people with extended versions of Java and C# doing
> > approximately that too, though.  Eiffel might fit the bill, and
> > generally compiles through C, which might help.
> >
> > Most practitioners just use C or assembly, and leave the safety and
> > threading to higher-level tools (such as static checkers or code review
> > processes) and operating systems.
> >
> > If you want state of the art type safety, you might want to investigate
> > erlang, ocaml, sml and hascall, but I don't know that anyone is using them
> > for embedded work, unless you count telephone exchanges (quite a few of
> > which run erlang) as embedded systems, which they probably are...
> >
> 
> Is there any Macro can hide the OS routine?

What OS routine are you referring to?

> I believe that C syntax extension is a cheaper solution than a new
> language.

Are you planning on writing a compiler for only your use?
 
> Actually in Embedded world, C has a lot syntax extension such as
> "interrupt fun()"...

Which a don't use (or trust come to that).  Although others certainly 
do.  The syntax varies considerably as well.

> So can we have "exclusive fun()" or "exclusive {...}"?

And these would do what exactly?

Robert

-- 
Posted via a free Usenet account from http://www.teranews.com


previous | 1 | 2 | 3 | 4 | next