473,410 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Subject: C to JVM compiler (AMPC)

Axiomatic Solutions Sdn Bhd announces the availability of AMPC version 1.2.
You can purchase AMPC online now at:
http://www.axiomsol.com/hedesu/shopping/index.php

Major Changes
-------------
Version 1.2 supports the MS Windows XP platform, beside Linux x86 and
Mac OSX. It also supports the DOUBLE floating point type. Please see the
README file for details on DOUBLE floating point type.

AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode). The resulting .class executables will be
able to run on any Java Virtual Machine (tm). AMPC enables programmers
to write/port applications using C targeting the JVM, thus, opening up a
whole new market dimension vis-a-vis JVM-enabled devices such as desktop
systems, PDAs, cell-phones, game consoles, set-top boxes, automotive systems
(GPS based displays, OnStar, Satellite radio systems, etc), and so forth.
AMPC can also be used to turn legacy applications written in C into JVM
applications, with a single source base to manage. Use existing C skill sets
instead of learning new Java skill sets.

AMPC includes a Graphical User Interface (GUI) as part of the Integrated
Development Environment (IDE) for fast and organized software
development.

AMPC is based upon the American National Standards Institute C (ANSI C),
X3.159-1989. There are however a few differences between AMPC and a
fully compliant ANSI C compiler. The differences of AMPC with a fully
compliant ANSI C compiler are described in AMPC's product description.

JNI (JVM Native Interface) support is available for the purpose of
calling native C or C++ functions from AMPC.

AMPC can also generate assembly code for the Jasmin assembler using the
asm() directive.

It also can call most Java classes using the functions INT_java(),
FLOAT_java(), DOUBLE_java(), and so forth.

Hardware Requirements:
- Any x86 compatible computer running MS Windows XP
- Any Macintosh computer running Mac OSX
- Any x86 compatible computer running Linux
- 128MB RAM minimum

Software Requirements:
- Java SDK 1.4.2 or newer (JDK 1.5 recommended).

More info on AMPC can be found at http://www.axiomsol.com

Thank you and best regards.

--
Axiomatic Solutions Sdn Bhd
http://www.axiomsol.com

--
http://www.axiomsol.com
http://www.cs.indiana.edu/hyplan/napi.html
Jul 23 '05 #1
25 3886
Mohd Hanafiah Abdullah wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


C is a procedural language and as far as I know JVM is an OO framework. How can C code
create class definitions, inheritance, use objects etc? May you provide a hello world
example in C by using the JVM facilities?

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #2
Ioannis Vranos wrote:
C is a procedural language and as far as I know JVM is an OO framework. How can C code create class definitions, inheritance, use objects etc? May you provide a hello world example in C by using the JVM facilities?


This is easy. Use only static functions in Java. The hard thing (which
cannot be reached directly) is to map the low level functions (memmove,
....) to Java.

R.C.

Jul 23 '05 #3
Rapscallion wrote:
This is easy. Use only static functions in Java. The hard thing (which
cannot be reached directly) is to map the low level functions (memmove,
...) to Java.


I have no JVM experience, but I have .NET experience, which is a CLI VM platform.

In .NET, in most (perhaps all) cases, static methods are more run-time expensive than
usual methods which do the same operations, and are used either for-do-something-only-once
(having the same cost as the initial call of the equivalent method of an object of the
class) since it doesn't make sense to create an object of the class for doing something
only once - an example is a file operation -, or thread safety (the same resource being
shared by more than one threads, and thus additional checks and locks) or other reasons.

Also many static methods return objects by themselves.

I suppose these are also the case for the JVM. So how does C code can handle returned
objects of a static/non-static method?
memmove etc are more applicable to native code and not VM code.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #4
Ioannis Vranos wrote:
Mohd Hanafiah Abdullah wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).

C is a procedural language and as far as I know JVM is an OO
framework. How can C code create class definitions, inheritance, use
objects etc? May you provide a hello world example in C by using the
JVM facilities?

Your question makes no sense to me. The product is a C --> Java
compiler, not a Java --> C compiler. The point of the product is to use
C skillsets and not learn Java. C programmers don't do class
definitions, inheritance, etc. If they wanted to do all of that in
Java, they'd do Java. Presumably their "hello world" is going to be
written in C, although I do think it's an interesting question if the C
standard libraries are available and output JVM bytecode.

--
Cheers, www.indiegamedesign.com
Brandon Van Every Seattle, WA

"We live in a world of very bright people building
crappy software with total shit for tools and process."
- Ed McKenzie
Jul 23 '05 #5
Brandon J. Van Every wrote:
Your question makes no sense to me. The product is a C --> Java
compiler, not a Java --> C compiler. The point of the product is to use
C skillsets and not learn Java. C programmers don't do class
definitions, inheritance, etc. If they wanted to do all of that in
Java, they'd do Java. Presumably their "hello world" is going to be
written in C, although I do think it's an interesting question if the C
standard libraries are available and output JVM bytecode.

From my .NET experience, I do not think it is easy (and in some cases even possible) to
provide managed versions of C standard library.

Again from this experience of mine, the main difference between a native machine and a VM
is that the assembly language of a VM is more high level than the assembly of a native
machine. Having C++ in mind here, for example the assembly language of CLI standard (.NET
is a CLI compliant VM) has also the concepts of class, enumeration, etc which have some
(perhaps minor but existent) differences compared with C++ native ones. That's why in C++
case (and perhaps in other platform neutral languages), CLI features are provided
*separately* from the native features (currently in "managed extensions" and in the
upcoming C++/CLI).

Regarding C things should be even more difficult since it lacks the built-in concept of
OO, I can't understand how C programs can interact with the JVM APIs. Unless you can't do
anything else under JVM apart from ISO C code, which doesn't make much sense and which is
not possible under its entirety (GC is moving objects around and thus you can't rely on
pointer arithmetic, or compare two pointers to see if they point to the same object
(memory area), memmove etc. You could pin them (I do not know if JVM permits object
pinning), but this implies additional run-time cost, forgetting pinned objects which will
not be garbage collected possibly resulting in memory leaks, etc).

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6
Ioannis Vranos wrote:
From my .NET experience, I do not think it is easy (and in some cases
even possible) to provide managed versions of C standard library.

Again from this experience of mine, the main difference between a native
machine and a VM is that the assembly language of a VM is more high
level than the assembly of a native machine. Having C++ in mind here,
for example the assembly language of CLI standard (.NET is a CLI
compliant VM) has also the concepts of class, enumeration, etc which
have some (perhaps minor but existent) differences compared with C++
native ones. That's why in C++ case (and perhaps in other platform
neutral languages), CLI features are provided *separately* from the
native features (currently in "managed extensions" and in the upcoming
C++/CLI).

Regarding C things should be even more difficult since it lacks the
built-in concept of OO, I can't understand how C programs can interact
with the JVM APIs. Unless you can't do anything else under JVM apart
from ISO C code, which doesn't make much sense and which is not possible
under its entirety (GC is moving objects around and thus you can't rely
on pointer arithmetic, or compare two pointers to see if they point to
the same object (memory area), memmove etc. You could pin them (I do not
know if JVM permits object pinning), but this implies additional
run-time cost, forgetting pinned objects which will not be garbage
collected possibly resulting in memory leaks, etc).

I checked their web site (I guess I should have done this since the beginning), and saw
that they provide their own APIs (probably have encapsulated JVMs APIs to functions). In
this way I guess it is possible to do JVM programming (this must have been a real pain for
them though). :-)

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #7
In article <1116096955.568188@athnrd02>,
Ioannis Vranos <iv*@remove.this.grad.com> wrote:
Regarding C things should be even more difficult since it lacks the built-in
concept of
OO, I can't understand how C programs can interact with the JVM APIs. Unless
you can't do
anything else under JVM apart from ISO C code, which doesn't make much sense
and which is
not possible under its entirety (GC is moving objects around and thus you
can't rely on
pointer arithmetic, or compare two pointers to see if they point to the same
object
(memory area), memmove etc. You could pin them (I do not know if JVM permits
object
pinning), but this implies additional run-time cost, forgetting pinned
objects which will
not be garbage collected possibly resulting in memory leaks, etc).


You are confusing "pointers" and "memory addresses". They are the same
in many C implementations (depending on what you mean exactly with
"memory address"), but in a JVM based C compiler they would most
definitely not be the same. Most likely a C pointer would be implemented
as a pair (object, offset); possibly (array of byte, index into array).
Jul 23 '05 #8
"Brandon J. Van Every" <my*******************@mycompanyname.com> writes:
Ioannis Vranos wrote:
Mohd Hanafiah Abdullah wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


C is a procedural language and as far as I know JVM is an OO
framework. How can C code create class definitions, inheritance, use
objects etc? May you provide a hello world example in C by using the
JVM facilities?

Your question makes no sense to me. The product is a C --> Java
compiler, not a Java --> C compiler. The point of the product is to
use C skillsets and not learn Java. C programmers don't do class
definitions, inheritance, etc. If they wanted to do all of that in
Java, they'd do Java. Presumably their "hello world" is going to be
written in C, although I do think it's an interesting question if the
C standard libraries are available and output JVM bytecode.


According to the initial description, it's not a C --> Java compiler,
it's a C --> Java Bytecode compiler. Java is a high-level language; a
C --> Java compiler would generate Java source code from C source
code.

There's an unfortunate tendency to fail to distinguish between Java
(the high-level language) and Java bytecode (a low-level intermediate
or interpreted form). They were designed together, but they aren't
necessarily logically linked -- and many of the concepts in Java
bytecode predate Java the language. It's entirely possible to compile
languages other than Java to Java bytecode (for example, there's at
least one Ada compiler that generates Java bytecode). It's also
entirely possible to compile Java to machine language.

C presents some interesting challenges, because its freewheeling use
of pointers is difficult to express in Java bytecode. I suspect that
a lot of constructs that invoke undefined behavior but happen to work
perfectly well with a traditional C compiler will actually fail with a
C --> JVM compiler. That's probably a good thing; it provides a way
to weed out non-portable constructs in C code that's intended to be
portable. Perhaps the C --> JVM compiler can serve the purpose of the
DS9000 (a mythical machine with a C implementation that behaves as
perversely as possible without actually violating the standard).

--
Keith Thompson (The_Other_Keith) ks***@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.
Jul 23 '05 #9

"Ioannis Vranos" <iv*@remove.this.grad.com> wrote
C is a procedural language and as far as I know JVM is an OO framework.
How can C code create class definitions, inheritance, use objects etc? May
you > provide a hello world example in C by using the JVM facilities?

The program takes as input the text

#include <stdio.h>

int main(void)
{
printf("Hello world\n);
return 0;
}

The C to JVM compiler then creates a class called something (probably based
on the name of the C source file)

class hello_c
{
static void main()
{
system.out.println("Hello world");
}
}

It has the intelligence to know that the call to printf() can be relaced by
a call to System.out.println() if you remove the trailing newline.

This file then gets fed to a Java complier, which produces a Java .class
file.

In practise it wouldn't bother creating an intermediate human-readable Java
file and the Java compiler would be integrated into the C to JVM compiler.
But that's just a detail. Also it would have to generate lots of fancy Java
code to handle more complicated printf() calls.
Jul 23 '05 #10
Ioannis Vranos wrote:

Regarding C things should be even more difficult since it lacks the
built-in concept of OO, I can't understand how C programs can interact
with the JVM APIs. Unless you can't do anything else under JVM apart
from ISO C code, which doesn't make much sense
Sure it does. The product is aimed at the embedded market. A lot of
that "other Java stuff" is not needed. Customers may also wish to
bridge legacy code from C to the JVM, given that Java is also used in
the embedded market. I think the problem here is you're envisioning
some kind of "do everything a Java applications developer would want to
do" sort of package, which is what actually doesn't make sense. The
target audience is embedded C developers, who want to retarget their
code to the JVM.
and which is not possible under its entirety (GC is moving objects
around and thus you can't rely on pointer arithmetic, or compare two
pointers to see if they point to the same object (memory area),
memmove etc.


Well, it would be interesting to see what subset of C possibility the
JVM could support. Those are intelligent questions for the vendor, if
you're interested.

--
Cheers, www.indiegamedesign.com
Brandon Van Every Seattle, WA

"We live in a world of very bright people building
crappy software with total shit for tools and process."
- Ed McKenzie
Jul 23 '05 #11
Keith Thompson wrote:

According to the initial description, it's not a C --> Java compiler,
it's a C --> Java Bytecode compiler. Java is a high-level language; a
C --> Java compiler would generate Java source code from C source
code.

Eh, semantics. Java, bytecode, whatever. The point is, it goes C
Universe --> Java Universe, and not in the other direction. This
implies certain usage patterns and not others.
It's entirely possible to compile
languages other than Java to Java bytecode (for example, there's at
least one Ada compiler that generates Java bytecode).
Indeed the Bigloo and Kawa Scheme compilers can produce Java bytecode.
I'm not sure how well. The Eclipse Schemeway plugin developer is big
into Kawa though. http://schemeway.sourceforge.net/
C presents some interesting challenges, because its freewheeling use
of pointers is difficult to express in Java bytecode. I suspect that
a lot of constructs that invoke undefined behavior but happen to work
perfectly well with a traditional C compiler will actually fail with a
C --> JVM compiler. That's probably a good thing; it provides a way
to weed out non-portable constructs in C code that's intended to be
portable.
Sure, and as an aide de port it may be a valid business model.
Perhaps the C --> JVM compiler can serve the purpose of the
DS9000 (a mythical machine with a C implementation that behaves as
perversely as possible without actually violating the standard).

Is DS9000 an acronym? Any relation to HAL9000?

--
Cheers, www.indiegamedesign.com
Brandon Van Every Seattle, WA

"We live in a world of very bright people building
crappy software with total shit for tools and process."
- Ed McKenzie
Jul 23 '05 #12
"Brandon J. Van Every" <my*******************@mycompanyname.com> writes:
Keith Thompson wrote:

[...]
Perhaps the C --> JVM compiler can serve the purpose of the
DS9000 (a mythical machine with a C implementation that behaves as
perversely as possible without actually violating the standard).

Is DS9000 an acronym? Any relation to HAL9000?


DS stands for DeathStation. The 9000 was probably inspired by HAL.

It goes along with the idea that a permitted consequence of undefined
behavior in C is that the implementation makes demons fly out your
nose (often abbreviated to "nasal demons").

--
Keith Thompson (The_Other_Keith) ks***@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.
Jul 23 '05 #13
In comp.lang.c++ Mohd Hanafiah Abdullah <na**@cs.indiana.edu> wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


I wonder if this, combined with the Comeau compiler, would allow one
to run C++ programs on a JVM?

C++ source -> Comeau -> C source -> AMPC -> JVM
Jul 23 '05 #14
Mohd Hanafiah Abdullah wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode). The resulting .class executables will be
able to run on any Java Virtual Machine (tm). AMPC enables programmers
to write/port applications using C targeting the JVM, thus, opening up a
whole new market dimension vis-a-vis JVM-enabled devices such as desktop
systems, PDAs, cell-phones, game consoles, set-top boxes, automotive systems
(GPS based displays, OnStar, Satellite radio systems, etc), and so forth.
AMPC can also be used to turn legacy applications written in C
into JVM applications, with a single source base to manage.
Use existing C skill sets instead of learning new Java skill sets.


This is, of course, a great idea.
Have you got customers?
A user base?
Jul 23 '05 #15
Brandon J. Van Every wrote:
Is DS9000 an acronym? Any relation to HAL9000?

A DS9000 is a comp.lang.c imaginary machine, that you do not want to write code with
undefined behaviour and run on it. :-)
I just searched google to find out who thought it up, and the interesting thing is that
there are a few real DS 9000 machines:

http://groups.google.com/groups?q=%2...uwm.edu&rnum=1

http://groups.google.com/groups?q=%2...tel.com&rnum=6
I found who thought it, and he explains some of its naming:

http://groups.google.com/groups?hl=e...FootPrints.net
--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #16
Malcolm wrote:
The program takes as input the text

#include <stdio.h>

int main(void)
{
printf("Hello world\n);
return 0;
}

The C to JVM compiler then creates a class called something (probably based
on the name of the C source file)

class hello_c
{
static void main()
{
system.out.println("Hello world");
}
}

It has the intelligence to know that the call to printf() can be relaced by
a call to System.out.println() if you remove the trailing newline.

This file then gets fed to a Java complier, which produces a Java .class
file.

In practise it wouldn't bother creating an intermediate human-readable Java
file and the Java compiler would be integrated into the C to JVM compiler.
But that's just a detail. Also it would have to generate lots of fancy Java
code to handle more complicated printf() calls.

Yes, C and any language can be used to produce java bytecode. I had two misconceptions.
The first that it somehow enabled the developer to access the OO API of JVM directly, and
secondly that it was aimed to PCs and not toward to embedded devices only.
The answer to the first is that they created a procedural API and the second is embedded
devices of course and thus a smaller pain than what it would be to wrap the entire JVM API
to procedural. It is something like the case of .NET framework vs .NET compact framework.
Still the wrapping must have been a pain, unless they have not wrapped everything.
In any case, it can be done. However I imagine (since I do not know JVM API), mapping all
C structures, libraries and abilities to JVM bytecode, can't be that easy or even
possible, when we are talking about *maintaining the C semantics*.
Anyway, I am not personally interested in JVM. :-)

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #17
In article <11*************@corp.supernews.com>,
Ed Jensen <ej*****@visi.com> wrote:
In comp.lang.c++ Mohd Hanafiah Abdullah <na**@cs.indiana.edu> wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


I wonder if this, combined with the Comeau compiler, would allow one
to run C++ programs on a JVM?

C++ source -> Comeau -> C source -> AMPC -> JVM


I asked for a price quote from EDG for a C++ to C translator and the price was
prohibitive as far as we were concerned. So, for now we are sticking with
C only since most embedded applications are C centric.

Maybe Comeau is the other option. But it needs to generate ANSI C 1989 code
only and not C99.

Napi
--
http://www.axiomsol.com
http://www.cs.indiana.edu/hyplan/napi.html
Jul 23 '05 #18
In article <d6**********@nntp1.jpl.nasa.gov>,
E. Robert Tisdale <E.**************@jpl.nasa.gov> wrote:
Mohd Hanafiah Abdullah wrote:
AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode). The resulting .class executables will be
able to run on any Java Virtual Machine (tm). AMPC enables programmers
to write/port applications using C targeting the JVM, thus, opening up a
whole new market dimension vis-a-vis JVM-enabled devices such as desktop
systems, PDAs, cell-phones, game consoles, set-top boxes, automotive systems
(GPS based displays, OnStar, Satellite radio systems, etc), and so forth.
AMPC can also be used to turn legacy applications written in C
into JVM applications, with a single source base to manage.
Use existing C skill sets instead of learning new Java skill sets.


This is, of course, a great idea.
Have you got customers?
A user base?


It's a relatively new product which has gone through the beta period and
we are marketing it. Beside being downloaded for free for the last 6 months,
we have interests from Telekom Malaysia's R&D and Universiti Teknologi
Petronas here in Malaysia.

Napi
--
http://www.axiomsol.com
http://www.cs.indiana.edu/hyplan/napi.html
Jul 23 '05 #19
Ioannis Vranos wrote:
I found who thought it, and he explains some of its naming:

http://groups.google.com/groups?hl=e...FootPrints.net


Ouch. As an ex-DEC employee, that hurts! Well, some of the DEC Alpha
workstations were great, and others were pieces of junk. Some idiot
decided to ship a 533 MHz machine without much of anything in the way of
memory cache. I forget when this super cheapass memory controller was
supposed to actually be justifiable / not harmful, but talk about
pigeonholeing the applicability of your hardware! We had a 533 MHz box
like that in our lab, and it was regularly getting whipped by our 300
MHz machines that had proper caches. We nicknamed the sucker "the Yugo"
and put a photo of that ignoble automobile on it as the desktop background.

--
Cheers, www.indiegamedesign.com
Brandon Van Every Seattle, WA
Jul 23 '05 #20
Ed Jensen wrote:
In comp.lang.c++ Mohd Hanafiah Abdullah <na**@cs.indiana.edu> wrote:

AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


I wonder if this, combined with the Comeau compiler, would allow one
to run C++ programs on a JVM?

C++ source -> Comeau -> C source -> AMPC -> JVM

Are you saying Comeau is a C++ source --> C source translator? I had
not heard of such perverse beasts before. I'm aware of things like
SWIG, but they don't do that. Whether Comeau does this or not, are
there other products that do?

--
Cheers, www.indiegamedesign.com
Brandon Van Every Seattle, WA

"We live in a world of very bright people building
crappy software with total shit for tools and process."
- Ed McKenzie
Jul 23 '05 #21
Brandon J. Van Every wrote:
Ouch. As an ex-DEC employee, that hurts! Well, some of the DEC Alpha
workstations were great, and others were pieces of junk. Some idiot
decided to ship a 533 MHz machine without much of anything in the way of
memory cache. I forget when this super cheapass memory controller was
supposed to actually be justifiable / not harmful, but talk about
pigeonholeing the applicability of your hardware! We had a 533 MHz box
like that in our lab, and it was regularly getting whipped by our 300
MHz machines that had proper caches. We nicknamed the sucker "the Yugo"
and put a photo of that ignoble automobile on it as the desktop background.

Interesting. This also makes his explanation more clear. :-)

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #22
Brandon J. Van Every wrote:

[ ... ]
Are you saying Comeau is a C++ source --> C source translator? I had not heard of such perverse beasts before. I'm aware of things like
SWIG, but they don't do that. Whether Comeau does this or not, are
there other products that do?


Yes, Comeau translates C++ to C, though this fact is normally pretty
well hidden, other than a switch to tell it what C compiler to use as
its back end.

The original C++ compiler (cfront) also translated C++ to C. Quite a
few of the other early C++ compilers (e.g. Oregon and Glockenspiel,
IIRC) were ports of cfront that worked essentially the same way.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 23 '05 #23
In article <oG*****************@newsread3.news.atl.earthlink. net>,
Brandon J. Van Every <my*******************@mycompanyname.com> wrote:
Ed Jensen wrote:
In comp.lang.c++ Mohd Hanafiah Abdullah <na**@cs.indiana.edu> wrote:

AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


I wonder if this, combined with the Comeau compiler, would allow one
to run C++ programs on a JVM?

C++ source -> Comeau -> C source -> AMPC -> JVM

Are you saying Comeau is a C++ source --> C source translator? I had
not heard of such perverse beasts before. I'm aware of things like
SWIG, but they don't do that. Whether Comeau does this or not, are
there other products that do?


Check out http://www.edg.com. It sells among others C++ to C converter.
Apparently, Comeau also uses the C++ to C converter from EDG.

I was also informed that the LLVM group at U of Illinois modified gcc 3.4
that has a back-end that emits portable C code. This is their website:
http://llvm.cs.uiuc.edu/

Napi
--
http://www.axiomsol.com
http://www.cs.indiana.edu/hyplan/napi.html
Jul 23 '05 #24
[fu-t set]

in comp.lang.c i read:
AMPC is based upon the American National Standards Institute C (ANSI C),
X3.159-1989. There are however a few differences between AMPC and a
fully compliant ANSI C compiler. The differences of AMPC with a fully
compliant ANSI C compiler are described in AMPC's product description.
would a summary really have been too difficult to include?

language: no bit-fields and cannot goto across blocks. elsewhere it is
mentioned that argc and argv are predeclared -- which makes me guess that
using my own identifiers will fail.

tools (not specified by the standard anyway): no debugger.

some limitations are not limitations (jni support), while others are
incorrect (static -- which is now supported -- is not a type).

some are a little hard to grasp just from the list, e.g., i think that one
must arrange to compile the (automatically created?) _touch_files.c and/or
_pointable_funcs.c files if file scoped objects and/or function pointers
are used (respectively).

there is no mention of long double or wide-characters. a lack of wide-
character support is not a tragedy as c89 itself is woeful. since you
target the jvm you should consider supporting amd1 in the future.
Hardware Requirements:
- Any x86 compatible computer running MS Windows XP
- Any Macintosh computer running Mac OSX
- Any x86 compatible computer running Linux


i hope the only reason for these is that you merely have not yet compiled
ampc using ampc, which would reduce the requirements to: a conforming jdk
and sufficient disk space. your own code (even if never released) should
be *the* prime example of how useful it is to target the jvm.

though i did not read it extensively i noticed some other oddities in the
manual, e.g., it is noted that strcoll and strxfrm are not c89 functions
(they are), and i hope that the second example in section 4.1 fails to
compile (even if one accepts the pre-declaration of argc and argv -- which
i find quite annoying -- it still leaves cnt and count undeclared, and has
an invalid escape in the string literal argument to the first printf):

| #include <stdio.h>
|
| main ()
| {
| printf("%i parameters entered \.",argc);
|
| for (cnt = 0; cnt <= argc -1; cnt++)
| {
| printf("Parameter %d is %s\n",count, argv[cnt]);
| }
| }

--
a signature
Jul 23 '05 #25
in comp.lang.c++ i read:
In comp.lang.c++ Mohd Hanafiah Abdullah <na**@cs.indiana.edu> wrote:

AMPC (Axiomatic Multi-Platform C) is a C compiler/IDE targeting the JVM
(generates Java Bytecode).


I wonder if this, combined with the Comeau compiler, would allow one
to run C++ programs on a JVM?

C++ source -> Comeau -> C source -> AMPC -> JVM


only if comeau produces an ampc target -- the source that comeau produces
is tightly targeted to specific native compilers.

--
a signature
Jul 23 '05 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Mohd Hanafiah Abdullah | last post by:
Axiomatic Solutions Sdn Bhd announces the availability of AMPC version 1.2. You can purchase AMPC online now at: http://www.axiomsol.com/hedesu/shopping/index.php Major Changes -------------...
0
by: napi | last post by:
We are pleased to announce the release of version '1.5.0' of AMPC (Axiomatic Multi-Platform C) C to Java class files compiler suite. It is Write Once Run Anywhere (WORA) with C. Detailed info...
6
by: napi | last post by:
C to Java Class Files ------------------------------- We are pleased to announce the release of version '1.5.1' of AMPC (Axiomatic Multi-Platform C) C to Java class files compiler suite. It is...
87
by: H. | last post by:
I am a student taking a machine structures class in a university, which includes learning C. I am looking for a good freeware or shareware compiler which can be used in a "C only" mode. C++ isn't...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.