473,698 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3929
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.568 188@athnrd02>,
Ioannis Vranos <iv*@remove.thi s.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************ *******@mycompa nyname.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_Keit h) 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.thi s.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.prin tln("Hello world");
}
}

It has the intelligence to know that the call to printf() can be relaced by
a call to System.out.prin tln() 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

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

Similar topics

27
511
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 ------------- 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.
0
1429
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 can be found at: http://www.axiomsol.com Project description: Axiomatic Multi-Platform C (AMPC) is a C to Java class file compiler suite for the development of platform independent applications. AMPC
6
2250
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 Write Once Run Anywhere (WORA) with C. "Platform independence with C. Integrate C and Java." Detailed info can be found at:
87
3777
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 allowed in assignments, and I would like the compiler to check for C syntax instead of C++ syntax. Besides that, ease of use for a beginner and basic debugging capabilities are important. Suggestions are welcome.
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7716
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4365
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.