473,480 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Does any CVM [ C virtual Machine] exist?

Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks
--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in

What I can't create I can't understand -- Richard Feynman
Nov 13 '05 #1
43 8637
I would think that pretty much any virtual machine you can think of could be
implimented, if you wanted to and it didn't already exist. If you think
about it, there are tons of virtual machines out there. Emulators. I mean,
they have them for graphing calculators, video game systems, even old school
home computer system emulators, they're all virtual machines.

As for your specific question, there are none that I know of particularly,
but that certainly doesn't not mean that one does not exist.

Nic
"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks
--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in

What I can't create I can't understand -- Richard Feynman

Nov 13 '05 #2

"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
Hi there everybody, I was just wondering that too many people choose
to use
[snip]

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks


Yes, it is OT for clc. I did a google search and found

"Just-In-Time Means Run-It-Fast"
http://www.devx.com/Intel/Article/6960

It may be helpful for you.

--
Jeff
-je6543 at yahoo.com
Nov 13 '05 #3
In comp.programming Minti <mi************@yahoo.com> wrote:

<C virtual machine>

See here for attempts to support JVM in compilers for other languages:

http://www.itee.uq.edu.au/~cristina/uqbt.html#gcc-jvm
http://found.cs.nyu.edu/meyer/jasmin
Nov 13 '05 #4
j

"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks
--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in

What I can't create I can't understand -- Richard Feynman


The virtual machine in C's case is the machine that C defines for its
programs to operate within. i.e., the environment defined by the standard.
e.g., The ANSI/ISO C VM provides file-system access via fopen() and remove()
So your program runs in a machine which has these facilities.
Nov 13 '05 #5
mi************@yahoo.com (Minti) wrote in message news:<e8**************************@posting.google. com>...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks

search google for "c-flea"

goose,
posting from comp.programming
Nov 13 '05 #6
"j" <ja****@bellsouth.net> wrote in message news:<KR*****************@bignews2.bellsouth.net>. ..
"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks


The virtual machine in C's case is the machine that C defines for its
programs to operate within. i.e., the environment defined by the standard.
e.g., The ANSI/ISO C VM provides file-system access via fopen() and remove()
So your program runs in a machine which has these facilities.

I won't call the machine that is defined by the C standard to be any
form of a Virutal machine, It is just a definition of a language, If
we go by the rule book however we would be having

<quote>
The semantic descriptions in this International Standard describe the
behavior of an abstract machine in which issues of optimization are
irrelevant.
<unquote>

Thanks for the participation but I still have not been able to find as
to if a CVM exist or if it does not, should it exist?

Cross posts to other relevant groups welcome.

--
Imanpreet Singh Arora

imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #7
j

"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
"j" <ja****@bellsouth.net> wrote in message news:<KR*****************@bignews2.bellsouth.net>. ..
"Minti" <mi************@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks


The virtual machine in C's case is the machine that C defines for its
programs to operate within. i.e., the environment defined by the standard. e.g., The ANSI/ISO C VM provides file-system access via fopen() and remove() So your program runs in a machine which has these facilities.

I won't call the machine that is defined by the C standard to be any
form of a Virutal machine, It is just a definition of a language, If
we go by the rule book however we would be having

<quote>
The semantic descriptions in this International Standard describe the
behavior of an abstract machine in which issues of optimization are
irrelevant.
<unquote>


And what do you think the difference between ``abstract'' and ``virtual''
is?
Thanks for the participation but I still have not been able to find as
to if a CVM exist or if it does not, should it exist?

Cross posts to other relevant groups welcome.

--
Imanpreet Singh Arora

imanpreet_arora AT yahoo DOT co DOT in

Nov 13 '05 #8
"j" <ja****@bellsouth.net> wrote:

"Minti" <mi************@yahoo.com> wrote:
I won't call the machine that is defined by the C standard to be any
form of a Virutal machine, It is just a definition of a language, If
we go by the rule book however we would be having

<quote>
The semantic descriptions in this International Standard describe the
behavior of an abstract machine in which issues of optimization are
irrelevant.
<unquote>


And what do you think the difference between ``abstract'' and ``virtual''
is?


"virtual" means it does not physically exist, it is simulated by a computer.

"abstract" means it is described without reference to a specific instance,
that the description applies to a whole class of different objects.

--
Simon.
Nov 13 '05 #9
In comp.programming goose <ru**@webmail.co.za> wrote:
mi************@yahoo.com (Minti) wrote in message news:<e8**************************@posting.google. com>...
<C virtual machine>

search google for "c-flea"


http://www.bipom.com/cflea.htm

It's commercial so no fun. But it proves the point.
Nov 13 '05 #10
ru**@webmail.co.za (goose) wrote in message news:<ff*************************@posting.google.c om>...
mi************@yahoo.com (Minti) wrote in message news:<e8**************************@posting.google. com>...
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks

search google for "c-flea"


Thanks for the link goose, but from what little I have read about it,
it seems that it a virtual machine for implementing C program that can
run on CPU's that are not supported by C compilers, I am taling about
a thing like wherein the code is by itself converted to some
intermediate form like say byte code, because if it could be done we
could share and embed pretty much like the Java applets. We won't have
to share possibly virus infected executable files and also we won't
have to necessarily send the source code to the client computer.

--
Imanpreet Singh Arora

imanpreet_arora AT yahoo DOT co DOT in

What I can't create I can't understand -> Richard Feynman
Nov 13 '05 #11
Hi,
Interesting question! I am not sure if there is any
implementation of CVM anywhere. But I would like to discuss whether such
a machine is really required. All these are my own opinions and I am not
saying they are true, but I am only putting forth what seems logical to
me. Guys out there are welcome to refute me and educate further about
these matters.
The reason Java has a VM is that it is a high level language.
High level languages are supposed to be lot more abstract and their
details are not supposed to depend on platform. Hence, if I write a
program in a high level language (not only Java), I would like to it to
compile without code changes on any platform where I can find a
compiler/interpreter.
Java takes this even further. It makes even the output of
compilation (the byte code) platform independant. So basically all this
assumes that we will have a VM for all platforms where we will be able
to run the byte code. And it is for platform dependant languages like C
to provide that VM. These language should map the properties of VM onto
the capabilities offered by a particular platform.
So I believe that C and Java offer solution to two different
problems. The mechanism used by Java to solve its set of problems will
be misfit if applied to C to solve problems in C's domain. It is not
that you cannot have a CVM, but its by design that we have VM for Java
and use C to implement that VM.
Looking in a different way, if you have a VM for C, then you
would need another language, say 'D' to implement that CVM for each
platform. Then would you think it appropriate to have a VM for D also?
Ultimately you need some way to come down to a language which implements
VM for a platform, rather than needing its own VM.

Regards
Marmagya

Minti wrote:
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks


Nov 13 '05 #12
Hi group,
I correct myself:

Marmagya wrote:
Hi,
Interesting question! I am not sure if there is any implementation
of CVM anywhere. But I would like to discuss whether such a machine is
really required. All these are my own opinions and I am not saying they
are true, but I am only putting forth what seems logical to me. Guys out
there are welcome to refute me and educate me further about these matters
The reason Java has a VM is that it is a high level language. High Being a high level language does not mean that the langiage has a VM, I
wrongly worded this, my apologies. I should had simply written "Java is
a high level language". level languages are supposed to be lot more abstract and their details
are not supposed to depend on platform. Hence, if I write a program in a
high level language (not only Java), I would like to it to compile
without code changes on any platform where I can find a
compiler/interpreter.
Java takes this even further. It makes even the output of
compilation (the byte code) platform independant. So basically all this
assumes that we will have a VM for all platforms where we will be able
to run the byte code. And it is for platform dependant languages like C
to provide that VM. These language should map the properties of VM onto
the capabilities offered by a particular platform.
So I believe that C and Java offer solution to two different
problems. The mechanism used by Java to solve its set of problems will
be misfit if applied to C to solve problems in C's domain. It is not
that you cannot have a CVM, but its by design that we have VM for Java
and use C to implement that VM.
Looking in a different way, if you have a VM for C, then you would
need another language, say 'D' to implement that CVM for each platform.
Then would you think it appropriate to have a VM for D also? Ultimately
you need some way to come down to a language which implements VM for a
platform, rather than needing its own VM.

Regards
Marmagya

Minti wrote:
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?
OT for c.l.c but I was just curious. Thanks


Nov 13 '05 #13
search google for "c-flea"
Thanks for the link goose, but from what little I have read about it,
it seems that it a virtual machine for implementing C program that can
run on CPU's that are not supported by C compilers, I am taling about
a thing like wherein the code is by itself converted to some
intermediate form like say byte code, because if it could be done we
could share and embed pretty much like the Java applets. We won't have
to share possibly virus infected executable files and also we won't
have to necessarily send the source code to the client computer.


(I am the creator of C-FLEA)

C-FLEA uses a "virtual instruction set", which is essentially a byte code.
The ability to run code on a CPU without a native C compiler is only one
application - it is equally valid to use this tool to create single binaries
which run an vastly different target systems (I've used it for this purpose
in a number of applications).

Unlike JAVA, C-FLEA does not have a standard set of predefined user
interface functionality, however as long as you define an identical set of
virtual I/O devices and access functions on each target, you can accomplish
a similar target independance.

The point I'm trying to make is that within the concept of a virtual machine,
you have flexibility to implement pretty much any environment and features
that you wish - not just what one particular vendor may advocate.

Here's a clip from my FAQ on "what is C-FLEA":

- You can use C on ANY target system, even if a native code C compiler
is not available for it. All you have to do is to get a C-FLEA VM up
and running, and all of the C-FLEA tools and libraries will work.

- C-FLEA code is portable and platform independent. You can implement
C-FLEA VM's with similar I/O features on multiple (different) hardware
platforms, and then compile a single C-FLEA program which can be run
on all of them without requiring any changes or recompilation.

- Since you "write" the C-FLEA CPU, you can provide functionality that
cannot be achieved in a conventional system. Here are some ideas:
- Execute from non-standard memory (eg: serial)
- Encrypted memory and other Advanced security / protection schemes
- Specialized peripherals appearing as I/O ports
- Add your own instructions!
- Multitasking support right in the CPU
- Debug tracing, event traps, specialized breakpoints etc.

- C-FLEA code is very space efficient. The C-FLEA instruction set was
designed from the beginning to be ideal for a C implementation, and
as a result, you can pack a lot of C code into a fairly small image.
In most cases, programs compiled for C-FLEA will be SMALLER than the
same program compiled for a native CPU (Note: Since there is a memory
overhead for the C-FLEA VM code, the total memory required will only
be less for larger programs).

Regards,

--
Dunfield Development Systems http://www.dunfield.com
Low cost software development tools for embedded systems
Software/firmware development services Fax:613-256-5821

Nov 13 '05 #14
Marmagya wrote:

<snip>
So I believe that C and Java offer solution to two different
problems. The mechanism used by Java to solve its set of problems will
be misfit if applied to C to solve problems in C's domain. It is not
that you cannot have a CVM, but its by design that we have VM for Java
and use C to implement that VM.
In theory, yes. C and Java are targetted at different audiences. In
practice however, they both get used for a lot of things that they're
not exactly suited for... more often in C than Java.
Looking in a different way, if you have a VM for C, then you would
need another language, say 'D' to implement that CVM for each platform.
Then would you think it appropriate to have a VM for D also? Ultimately
you need some way to come down to a language which implements VM for a
platform, rather than needing its own VM.


There's no reason why you couldn't implement the VM in C using a
compiler that targets a specific platform.

A CVM would be an interesting thing in that it would provide a
cross-platform target for C compilation. Whether it would be /used/
though is a different question :)

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

Nov 13 '05 #15
mi************@yahoo.com (Minti) wrote:
now my question is that can't there be a C Virtual machine,
which would run the C byte code, wherein C byte code is the
sort of a "compiled" and "intermediate" code before it can be
run on any particular machine.


See:

http://ivm.sourceforge.net/

From the website:

Build One Program ? Run It Everywhere Compile your programs to
run on any platform supporting The Internet Virtual Machine.

You can have the real thing. Why program in proprietary
languages, such as Java and C-Sharp that are incompatible
derivatives of C++? Tried and tested standards, C and C++ are the
most widely used programming languages worldwide. With the
Internet Virtual Machine, they come with runtime portability.

www.softintegration.com/company/press/

From the website:

About SoftIntegration -- C interpreter for C/C++ developers ...
toolkit. This toolkit adds new graphics and animation
capabilities to Chr --- a cross-platform C virtual machine with
classes. ...
Additionally, I believe there is a byte-code back-end for LCC,
and there is also a small-C that produces byte-code.
Nov 13 '05 #16
j

"Simon Biber" <sb****@optushome.com.au> wrote in message
news:3f**********************@news.optusnet.com.au ...
"j" <ja****@bellsouth.net> wrote:

"Minti" <mi************@yahoo.com> wrote:
I won't call the machine that is defined by the C standard to be any
form of a Virutal machine, It is just a definition of a language, If
we go by the rule book however we would be having

<quote>
The semantic descriptions in this International Standard describe the
behavior of an abstract machine in which issues of optimization are
irrelevant.
<unquote>
And what do you think the difference between ``abstract'' and ``virtual'' is?


"virtual" means it does not physically exist, it is simulated by a

computer.
"abstract" means it is described without reference to a specific instance,
that the description applies to a whole class of different objects.

I apologize. I posted this right before I went to bed and didn't mean to ask
what the difference is between ``abstract'' and ``virtual'' but rather
between ``abstract machine'' and ``virtual machine''

Though, something which is abstract is something that was drawn out while
something virtual is of virtue. Virtual isn't all that meaningful by itself.

Consider this, what can you draw out of the observation that a bee you saw
spent most of its time sitting on various flowers? Well, you might
hypothesize that it was gathering pollen and then draw out of that
observation that bees generally spend their time doing that. i.e., once you
have abstracted, you have taken some virtue from something, which you may
use elsewhere. That is what you have ``drawn out'' of it.

Now, a standard is generally supposed to be an encoding of these drawn out
properties. The abstraction produces the virtues that we want. A virtual
machine is comprised of those virtues. There is no requirement that a
virtual machine be implemented. Consider that you can run a C program with
just your understanding of the specification/standard.. is that a virtual
machine?

Once we do something with the specification we have produced a machine of
some kind, even if that is imagining how a program should work.

--
Simon.

Nov 13 '05 #17
Marmagya <marmagya@eNOpatra_SPAM.com> wrote in message news:<q5*************@news.oracle.com>...
<snip intro>
The reason Java has a VM is that it is a high level language.
High level languages are supposed to be lot more abstract and their
details are not supposed to depend on platform. Hence, if I write a
program in a high level language (not only Java), I would like to it to
compile without code changes on any platform where I can find a
compiler/interpreter.
Java takes this even further. It makes even the output of
compilation (the byte code) platform independant. So basically all this
assumes that we will have a VM for all platforms where we will be able
to run the byte code. And it is for platform dependant languages like C
to provide that VM. These language should map the properties of VM onto
the capabilities offered by a particular platform.
As a matter of fact it is possible to implement a JVM within Java
itself only.
So I believe that C and Java offer solution to two different
problems. The mechanism used by Java to solve its set of problems will
be misfit if applied to C to solve problems in C's domain. It is not
that you cannot have a CVM, but its by design that we have VM for Java
and use C to implement that VM.
Read above, obviously C seems to be better choice for doing a stuff
like creating compliers but Java can do that stuff also, cosider
The Jalapeño Virtual Machine
at

http://www-124.ibm.com/developerwork...nfo/pubs.shtml

Looking in a different way, if you have a VM for C, then you
would need another language, say 'D' to implement that CVM for each
platform.
Would you belive me that you can write a C compiler using C language,
or do you think that assembly language was written in binary, if we
follow the language hierarchy. ;-).
Then would you think it appropriate to have a VM for D also?
Ultimately you need some way to come down to a language which implements
VM for a platform, rather than needing its own VM.

Regards
Marmagya


<snip my origninal post>

--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #18
Marmagya <marmagya@eNOpatra_SPAM.com> wrote:
Hi, <SNIP> Looking in a different way, if you have a VM for C, then you
would need another language, say 'D' to implement that CVM for each
platform. Then would you think it appropriate to have a VM for D also?
Ultimately you need some way to come down to a language which implements
VM for a platform, rather than needing its own VM.

Cross-Platform-Development is your friend.

<SNIP>
--
Close your eyes and press escape three times.
Nov 13 '05 #19
Irrwahn Grausewitz <ir*****@freenet.de> wrote in message news:<qm********************************@4ax.com>. ..

<snip>

...............

Close your eyes and press escape three times.


Nothing happened do I need to try harder, could you specify some
specific platform or even as to if the system has to be switched on,
assuming you are taling about keyboards.

Or as a matter of fact nothing is supposed to happen. ;-)

--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #20
Minti <mi************@yahoo.com> scribbled the following
on comp.lang.c:
Irrwahn Grausewitz <ir*****@freenet.de> wrote in message news:<qm********************************@4ax.com>. ..
Close your eyes and press escape three times.
Nothing happened do I need to try harder, could you specify some
specific platform or even as to if the system has to be switched on,
assuming you are taling about keyboards. Or as a matter of fact nothing is supposed to happen. ;-)


On GNU Emacs, Esc Esc Esc is the universal keyboard signal for "No, I
don't want to do that after all".

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"To err is human. To really louse things up takes a computer."
- Anon
Nov 13 '05 #21
> Would you belive me that you can write a C compiler using C language,
or do you think that assembly language was written in binary, if we
follow the language hierarchy. ;-).


Consider the following case. You are creating a new language, say 'D'.
You have not compiler for D, though you have specifications of the (as
of now, hypothetical) language D. So you know the control statements etc
and other details of the language. Now you set out to write a compiler
for this language. I believe you do need to write a minimalist compiler
written in something like an assembly language which will provide
compilation for an essential subset of D. Now, using this essential
subset, you can write an enhanced version of the first compiler that
will support the rest of the language. But I think at least for the
initial subset, you do need to use the assembly language.

I think that using the language to write its own compiler is analogous
to recursion. Ultimately you do need a termination condition.

Thanks a lot for bringing up this topic and please forgive me for being
argumentative, but I find it worth all the trouble to understand the issue.

Regards
Marmagya

Nov 13 '05 #22
Minti wrote:
Hi there everybody, I was just wondering that too many people choose
to use

language like Java because of its architecture independence, this AI
is

achieved because Java is as such a platform indeed, the code is
converted to

a byte code and this byte code can be run on any machine which has
Java

Virtual Machine or the Java Platform is installed, now my question is
that can't there be a C

Virtual machine, which would run the C byte code, wherein C byte code
is the

sort of a "compiled" and "intermediate" code before it can be run on
any

particular machine. Are there any shorcomings in this approach? I
guess

practicaly we can have a Virtual machine for every language.
Has anybody done this? Should anybody do this?

OT for c.l.c but I was just curious. Thanks


Isn't Microsoft .net a virtual machine running bytecode? Can't Visual
C++.net target the Common Language Runtime, instead of machine code?

Of course, this is hardly write once, run anywhere, but wait until Mono
(an open-source .net clone) gets finished... (http://www.go-mono.com/)
and eventually gcc might target the Mono/Commmon Language Runtime.

Which begs the question: how durable is Microsoft's .NET architecture?
I heard that they were gambling the company on it, so they obviously
think it's a really good idea that will last. Will it?

Calum

Nov 13 '05 #23
Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<bk**********@oravannahka.helsinki.fi>...
Minti <mi************@yahoo.com> scribbled the following
on comp.lang.c:
Irrwahn Grausewitz <ir*****@freenet.de> wrote in message news:<qm********************************@4ax.com>. ..
Close your eyes and press escape three times.

Nothing happened do I need to try harder, could you specify some
specific platform or even as to if the system has to be switched on,
assuming you are taling about keyboards.

Or as a matter of fact nothing is supposed to happen. ;-)


On GNU Emacs, Esc Esc Esc is the universal keyboard signal for "No, I
don't want to do that after all".


Thanks for the enlightenment.

--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #24
Marmagya <marmagya@eNOpatra_SPAM.com> wrote in message news:<zy************@news.oracle.com>...
Would you belive me that you can write a C compiler using C language,
or do you think that assembly language was written in binary, if we
follow the language hierarchy. ;-).
Consider the following case. You are creating a new language, say 'D'.
You have not compiler for D, though you have specifications of the (as
of now, hypothetical) language D. So you know the control statements etc
and other details of the language. Now you set out to write a compiler
for this language. I believe you do need to write a minimalist compiler
written in something like an assembly language which will provide
compilation for an essential subset of D.

Now, using this essential
subset, you can write an enhanced version of the first compiler that
will support the rest of the language. But I think at least for the
initial subset, you do need to use the assembly language.

Well we DO indeed for quite a lot of purposes, but if we were to write
every part of this "initial subset" only in assembly, don't you think
it would be unfair on C. I mean you can do the stuff by using C [
Hell C was made to be as a sort of abstraction layer above assembly ]
there is little point in doing that through Assembly, except if you
are *confident* you can write better assembly by yourself.
I think that using the language to write its own compiler is analogous
to recursion. Ultimately you do need a termination condition.
Well the process is called boot strapping and the termination
condition does indeed exist, and it is happens when the creator of the
language has reason to believe that there is no need to add any
feature to the already existent part of the language, consider the
recent improvements through the C standard, most of these I guess can
be implemented through C, now 5 years down the line the C standard
commitee says that Ok enough of C lets just finsh adding any more
feature because the current feature are enough for any possible
application of C, that my dear friend is a termination condition. This
is a poor lazy attempt ot highlight the point, but I hope it clears
up.

BASIC I belive has reached the termination condition.
Thanks a lot for bringing up this topic and please forgive me for being
argumentative, but I find it worth all the trouble to understand the issue.


Hey never mind. Being argumentative is good in many cases and this is
one of them. Just don't be argumentative with politicans and religious
leaders.

HTH
--
Imanpreet Singh Arora

imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #25
In comp.programming Marmagya <marmagya@enopatra_spam.com> wrote:
But I think at least for the
initial subset, you do need to use the assembly language.


Ever heard of cross-compiling?
Nov 13 '05 #26
> Ever heard of cross-compiling?

Okay, so let me say that you are implementing the compiler for language
D by cross compiling and you are using language Z (on a different
platform) for this. Now how did you get the compiler/cross compiler for
Z in the first place? Even if you keep on cross compiling things, in the
end you will have to come to a lower level language like assembly to
create a minimalist compiler/cross compiler, and then you can continue
with cross compiling or creating compiler for a language using the
language itself.

Ultimately all the instructions have to be in machine language for a
processor to execute them. So all the high level programs have to be
ultimately converted into machine instructions. You cannot avoid this.
And that cannot avoid this means that utlimately you do need something
like an assembly language to create those machine instructions down the
line. Things like cross compiling etc can only make this conversion
indirect, but cannot eliminate this.

My point is that you cannot keep on using non-low level language to
implement things like VMs and compilers endlessly. You will come to a
low level language like assembly in the end to provide the 'last mile'.

Please forgive me for not agreeing with you outright, I am like this
unless I feel that my attitude will offend others.

Regards
Marmagya

Nov 13 '05 #27
Marmagya wrote:
I believe you do need to write a minimalist compiler written in
something like an assembly language which will provide compilation
for an essential subset of D.


Actually, you can write a compiler--minimal or otherwise--in any
language that lends itself to writing a compiler.

If you are imagining yourself stranded on a desert island with
only some hardware and no compiler at all, then, yes, you would
have to create a barebones one "from scratch".

--
|_ CJSonnack <Ch***@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|
Nov 13 '05 #28
Calum wrote:
Isn't Microsoft .net a virtual machine running bytecode?
(I just started learning C# and .net, so caveat reader....) It's
not exactly bytecode, AIUI, but "IL"--Intermediate Language, and
all their .net languages compile down to the same IL. One benefit
they tout is that you can define a class in VB.net and use it in
C# (or vice versa).

The author of the book I'm reading (Programming C#, 3rd Ed.) has
shown several IL dumps, so I'm guessing you can actually examine
this IL code.
Can't Visual C++.net target the Common Language Runtime, instead
of machine code?
I think that's ALL it does??? Or MAINLY what it does??? MS says
that the CLR can run over any OS, so it looks like they're trying
to sneak into the unices world. Apparently, any .net IL program
can run on any platform with the CLR.
Which begs the question: how durable is Microsoft's .NET
architecture?
[grin] Time will tell. MS-DOS was suprisingly durable (for some
definition of durable) despite being a pretty "kiddie" OS.
I heard that they were gambling the company on it, so they
obviously think it's a really good idea that will last.


IIRC, the author mentions they're spending 80% of their R&D on .net!

We're strictly an MS shop here, so .net is clearly in my future
(hence the book! :-).

--
|_ CJSonnack <Ch***@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|
Nov 13 '05 #29
Marmagya wrote:

<snip>
My point is that you cannot keep on using non-low level language to
implement things like VMs and compilers endlessly. You will come to a
low level language like assembly in the end to provide the 'last mile'.


You've got it backwards. The whole thing /started/ where you're ending.
Assemblers were created many years ago because people didn't want to
work in machine code anymore. Compilers were built, initially on top of
those assemblers, later by earlier models of themselves or by compilers
for other languages.

If you really wanted to you could trace the ancestry of any particular
language through the root languages used to produce it. There's no real
point to doing so however, since it has no real bearing on /modern/
compiler implementation. Take a language [A] that you're familiar with,
write a compiler for language [b] - or a functional subset - in [A]. If
your [b] compiler is capable enough, you might like to use it to write a
[b] compiler.

Hell, if you like you can progress backwards down the tree. Implement
an assembler in C.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

Nov 13 '05 #30
Programmer Dude wrote:
Calum wrote:

Isn't Microsoft .net a virtual machine running bytecode?

(I just started learning C# and .net, so caveat reader....) It's
not exactly bytecode, AIUI, but "IL"--Intermediate Language, and
all their .net languages compile down to the same IL. One benefit
they tout is that you can define a class in VB.net and use it in
C# (or vice versa).


I'm not sure what the exact difference is between a bytecode and an
intermediate language... Perhaps Sun uses bytecode (TM) so Microsoft has
to call it something else?

But, seeing how machine code is just a language, surely you could write
an emulator for that machine code to run anywhere. Which would probably
be just as quick as a bytecode/CLR to execute. But that would be
exposed as a pretty dumb way of doing things, so why are virtual
machines so widely accepted? Can't you just get decent binary
compatibility (it works with C++, but early implementations were
incompatible with each other), and make your OS provide a sandbox?

Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?
The author of the book I'm reading (Programming C#, 3rd Ed.) has
shown several IL dumps, so I'm guessing you can actually examine
this IL code.

Can't Visual C++.net target the Common Language Runtime, instead
of machine code?

I think that's ALL it does??? Or MAINLY what it does??? MS says
that the CLR can run over any OS, so it looks like they're trying
to sneak into the unices world. Apparently, any .net IL program
can run on any platform with the CLR.


My Visual C++.net also targets native machine code, which is the way I
use it, plus it's a nice editor. In fact, unless someone actually held
a gun to my head, why on earth would I want to interface to Visual
Basic? (Okay, there are legitimate reasons for doing this)
Which begs the question: how durable is Microsoft's .NET
architecture?

[grin] Time will tell. MS-DOS was suprisingly durable (for some
definition of durable) despite being a pretty "kiddie" OS.

I heard that they were gambling the company on it, so they
obviously think it's a really good idea that will last.

IIRC, the author mentions they're spending 80% of their R&D on .net!


Go Objects!!!
We're strictly an MS shop here, so .net is clearly in my future
(hence the book! :-).


No no no, programming's supposed to be difficult mutter mutter... ;-)

Nov 13 '05 #31
Calum wrote:
But, seeing how machine code is just a language, surely you could write
an emulator for that machine code to run anywhere. Which would probably
be just as quick as a bytecode/CLR to execute. But that would be
exposed as a pretty dumb way of doing things, so why are virtual
machines so widely accepted? Can't you just get decent binary
compatibility (it works with C++, but early implementations were
incompatible with each other), and make your OS provide a sandbox?
You're expecting binary compatability between, say, an ARM, an x86,
and a Power PC? The point of a VM is that the code is portable,
and each implementation makes its own arrangements for executing it.
Including, but not limited to:

* write an interpreter for the VM code
* write a compiler for VM code -> native code
* mix: write an interpreter that compiles often-used code
* write a *microcode* interpreter for the VM code
* use gets() for nasal demons, enslave them, have them run the code
Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?


No. [It might, but that doesn't mean it will.]

--
Chris "electric hedgehog" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgrou...mp.lang.c.html
C welcome: http://www.angelfire.com/ms3/bchambl...me_to_clc.html
Nov 13 '05 #32
Chris Dollin <ke**@hpl.hp.com> wrote:
Calum wrote:
But, seeing how machine code is just a language, surely you could write
an emulator for that machine code to run anywhere. Which would probably
be just as quick as a bytecode/CLR to execute. But that would be
exposed as a pretty dumb way of doing things, so why are virtual
machines so widely accepted? Can't you just get decent binary
compatibility (it works with C++, but early implementations were
incompatible with each other), and make your OS provide a sandbox?


You're expecting binary compatability between, say, an ARM, an x86,
and a Power PC? The point of a VM is that the code is portable,
and each implementation makes its own arrangements for executing it.
Including, but not limited to:

* write an interpreter for the VM code
* write a compiler for VM code -> native code
* mix: write an interpreter that compiles often-used code
* write a *microcode* interpreter for the VM code
* use gets() for nasal demons, enslave them, have them run the code

*lol* :)

Anyway, one addition:
The VM code may actually be identical to a specific native machine code.
IIRC there's a virtual machine called "Virtual PC" for the Mac which is
able to execute native x86 code, possibly generated by some C compiler.

<SNIP>

Regards

Irrwahn
--
Computer: a million morons working at the speed of light.
Nov 13 '05 #33
In article <10***************@radsrv1.tranzpeer.net>, Corey Murtagh <em***@slingshot.co.nz.no.uce> wrote:
Marmagya wrote:
So I believe that C and Java offer solution to two different
problems. The mechanism used by Java to solve its set of problems will
be misfit if applied to C to solve problems in C's domain. It is not
that you cannot have a CVM, but its by design that we have VM for Java
and use C to implement that VM.


In theory, yes. C and Java are targetted at different audiences. In
practice however, they both get used for a lot of things that they're
not exactly suited for... more often in C than Java.


That's because they are both general purpose languages. I.E. they are
particularly intended for the purpose of being used for purposes they
are not particularly intended for ;-)

Gerry Quinn
--
http://bindweed.com
Kaleidoscopic Screensavers and Games for Windows
Download free trial versions
New screensaver: "Hypercurve"
Nov 13 '05 #34
Chris Dollin wrote:
Calum wrote:

But, seeing how machine code is just a language, surely you could write
an emulator for that machine code to run anywhere. Which would probably
be just as quick as a bytecode/CLR to execute. But that would be
exposed as a pretty dumb way of doing things, so why are virtual
machines so widely accepted? Can't you just get decent binary
compatibility (it works with C++, but early implementations were
incompatible with each other), and make your OS provide a sandbox?

You're expecting binary compatability between, say, an ARM, an x86,
and a Power PC? The point of a VM is that the code is portable,
and each implementation makes its own arrangements for executing it.
Including, but not limited to:

* write an interpreter for the VM code
* write a compiler for VM code -> native code
* mix: write an interpreter that compiles often-used code
* write a *microcode* interpreter for the VM code
* use gets() for nasal demons, enslave them, have them run the code

Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?

No. [It might, but that doesn't mean it will.]


I think my main objection was when CLR etc was interpreted. You're
absolutely right, if you have local translation to native code, my
objection evaporates.

Advantages of VM
- Portability
- Safety

Disadvantages
- Slower
- Requires more memory
- Reverse engineering easier

After getting all my photos wiped by a VB script (yes I did have a
backup), I'm not sure I trust a Microsoft VM to be "safe". And I'm
surprised that Microsoft, who have traditionally done everything to
obstruct portability, would cite that as an advantage. Why not just
harden their operating system, and sandbox programs that way?

Calum

Nov 13 '05 #35
Calum wrote:
I'm not sure what the exact difference is between a bytecode and an
intermediate language...
You know, I have no idea. Maybe it is very similar. I got the
impression (from the dump displays in the book) it was assembly-like.
Can Java bytecode be "disassembled"?

But, seeing how machine code is just a language, surely you could
write an emulator for that machine code to run anywhere.
Sure. A friend has a Commodore64 emulator for his PC. Weird to
see those old programs running on the latest hardware! (-:
Which would probably be just as quick as a bytecode/CLR to execute.
Well, what apparently happens is that the CLR uses JIT compiling to
translate the IL to real machine code at runtime, and ONLY when a
function is called. Once a function is compiled and put in memory,
the CLR "remembers" it and references it from then on. Thus you
only pay a translation penalty the first time you call any given
function.
...so why are virtual machines so widely accepted?
Because the bytecode/IL/PCode/whatever can--in principle--be
completely cross-platform. You need only implement the VM.
Can't you just get decent binary compatibility, and make your OS
provide a sandbox?
Direct machine code *always* runs faster, and each CPU has their
own machine code. Some are *vastly* different, other less so,
but 6502 code just ain't gonna run on a MIPS. (-:
Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?
[shrug] No idea. Java supposedly was designed with a Java CPU as
a consideration, but it doesn't seem to have taken the world by
storm. Are there ANY Java CPUs in the commercial world?

In fact, unless someone actually held a gun to my head, why on
earth would I want to interface to Visual Basic? (Okay, there
are legitimate reasons for doing this)


Yes, there are. VB and I have done some nice things together!

--
|_ CJSonnack <Ch***@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|
Nov 13 '05 #36
[followups set to comp.programming, since this has nothing to do with
the C language]

Calum wrote:
Programmer Dude wrote:
Calum wrote:

Isn't Microsoft .net a virtual machine running bytecode?
(I just started learning C# and .net, so caveat reader....) It's
not exactly bytecode, AIUI, but "IL"--Intermediate Language, and
all their .net languages compile down to the same IL. One benefit
they tout is that you can define a class in VB.net and use it in
C# (or vice versa).


I'm not sure what the exact difference is between a bytecode and an
intermediate language... Perhaps Sun uses bytecode (TM) so Microsoft has
to call it something else?


The difference is subtle, and probably not important anymore. For the
most part .NET's 'intermediate language' and Java's 'bytecode' are
equivalent concepts.

Back when Java was young, bytecode was appropriate because the original
JVMs ran it directly (ie: it was their machine code). These days Java
bytecode is more often than not treated as an intermediate language, and
JIT compiling is used to translate that into native code for execution.

The way I understand it, .NET was designed from the bottom up to do JIT
compiling on CIL code. As such it's more correct (for certain values of
'correct') to call it an intermediate language.
But, seeing how machine code is just a language, surely you could write
an emulator for that machine code to run anywhere. Which would probably
be just as quick as a bytecode/CLR to execute.
And people have written emulators for various platforms. In effect a
JVM is an emulator of the Java platform, .NET and the MONO project are
emulators for the .NET platform, etc.
But that would be
exposed as a pretty dumb way of doing things, so why are virtual
machines so widely accepted? Can't you just get decent binary
compatibility (it works with C++, but early implementations were
incompatible with each other), and make your OS provide a sandbox?
C++ doesn't have binary compatibility between platforms. Never has.

The problem is that each platform has a number of major differences in
executable formats, different available APIs for doing the same thing,
various APIs that are available on one platform but not others, possibly
different CPUs with their own native machine code...

Creating a cross-platform standard for executables isn't going to
happen. Instead, Sun created a platform called Java, and provided
emulators for it to run on various platforms.
Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?


There was talk a few years ago about Sun creating a Java CPU which could
be used to create an actual hardware+os implementation of the Java
platform. I don't know what became of it, but so far it has failed to
become a reality as far as I can see. Perhaps it was rendered pointless
by the vast improvements in JVMs.

I doubt that we'll see a .NET cpu any time soon.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

Nov 13 '05 #37
Programmer Dude <Ch***@Sonnack.com> wrote in message news:<3F***************@Sonnack.com>...
Calum wrote:
I'm not sure what the exact difference is between a bytecode and an
intermediate language...
You know, I have no idea. Maybe it is very similar. I got the
impression (from the dump displays in the book) it was assembly-like.
Can Java bytecode be "disassembled"?


Yup! I am new to Java but I know it can be done, and that is one of
the bad things about java, java Decompilation is FAST really fast, I
don't know why programmers don't just send their .java files instead
of .class when they know their code can be decompiled easily.

Check out.

http://members.fortunecity.com/neshkov/dj.html


But, seeing how machine code is just a language, surely you could
write an emulator for that machine code to run anywhere.
Sure. A friend has a Commodore64 emulator for his PC. Weird to
see those old programs running on the latest hardware! (-:


Looking at the direction of your smily, I was just wondering if you
wrote that whole line R->L.
Which would probably be just as quick as a bytecode/CLR to execute.
Well, what apparently happens is that the CLR uses JIT compiling to
translate the IL to real machine code at runtime, and ONLY when a
function is called. Once a function is compiled and put in memory,
the CLR "remembers" it and references it from then on. Thus you
only pay a translation penalty the first time you call any given
function.
...so why are virtual machines so widely accepted?


Because the bytecode/IL/PCode/whatever can--in principle--be
completely cross-platform. You need only implement the VM.
Can't you just get decent binary compatibility, and make your OS
provide a sandbox?


Direct machine code *always* runs faster, and each CPU has their
own machine code. Some are *vastly* different, other less so,
but 6502 code just ain't gonna run on a MIPS. (-:
Does this mean a processor will eventually be able to execute CLR
instructions, if the whole world has to go .net?


[shrug] No idea. Java supposedly was designed with a Java CPU as
a consideration, but it doesn't seem to have taken the world by
storm. Are there ANY Java CPUs in the commercial world?

IIRC picoJava is the thing you want. I have very little about it, but
I think it is a Java CPU.

In fact, unless someone actually held a gun to my head, why on
earth would I want to interface to Visual Basic? (Okay, there
are legitimate reasons for doing this)


Yes, there are. VB and I have done some nice things together!


--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in

"Good artists copy, great artists steal."
Pablo Picasso
Nov 13 '05 #38
Marmagya <marmagya@eNOpatra_SPAM.com> wrote in message news:<Wv**************@news.oracle.com>...
Ever heard of cross-compiling?
Okay, so let me say that you are implementing the compiler for language
D by cross compiling and you are using language Z (on a different
platform) for this. Now how did you get the compiler/cross compiler for
Z in the first place?


Hmmmm, the question is quite similar to "In which language was early C
designed or maybe the first high level language designed?"

Well without a shadow of doubt the first high/middle level language
was designed in assembly itself only, but I believe that the usage
would have been limited to a minimalist set.

Even if you keep on cross compiling things, in the
end you will have to come to a lower level language like assembly to
create a minimalist compiler/cross compiler, and then you can continue
with cross compiling or creating compiler for a language using the
language itself.
Your above example try to go "histrically down" but this argument
"historically up", say what you wanna say.


Ultimately all the instructions have to be in machine language for a
processor to execute them. So all the high level programs have to be
ultimately converted into machine instructions. You cannot avoid this.
Certainly.
And that cannot avoid this means that utlimately you do need something
like an assembly language to create those machine instructions down the
line. Things like cross compiling etc can only make this conversion
indirect, but cannot eliminate this.

Nopes assembly might not be needed, I mean these binary instructions
are their in your executable file right now open your executable file
and you would see some weird text,

Now if I write a high level block

that puts in those characters in some file, I don't think you need
assembly my friend, I mean one of the aims of programming is to use
abstractions that are available.

You are however welcome to make clarifications.
My point is that you cannot keep on using non-low level language to
implement things like VMs and compilers endlessly. You will come to a
low level language like assembly in the end to provide the 'last mile'.

Please forgive me for not agreeing with you outright, I am like this
unless I feel that my attitude will offend others.


Forgiven ;-). But welcomed to make the same mistake.
HTH.
--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #39
Da***********@use.techsupport.link.on.my.website (Dave Dunfield) wrote in message news:<w7****************@tor-nn1.netcom.ca>...
search google for "c-flea"
Thanks for the link goose, but from what little I have read about it,
it seems that it a virtual machine for implementing C program that can
run on CPU's that are not supported by C compilers, I am taling about
a thing like wherein the code is by itself converted to some
intermediate form like say byte code, because if it could be done we
could share and embed pretty much like the Java applets. We won't have
to share possibly virus infected executable files and also we won't
have to necessarily send the source code to the client computer.


(I am the creator of C-FLEA)

C-FLEA uses a "virtual instruction set", which is essentially a byte code.
The ability to run code on a CPU without a native C compiler is only one
application - it is equally valid to use this tool to create single binaries
which run an vastly different target systems (I've used it for this purpose
in a number of applications).

Unlike JAVA, C-FLEA does not have a standard set of predefined user
interface functionality, however as long as you define an identical set of
virtual I/O devices and access functions on each target, you can accomplish
a similar target independance.

Could you plese elucidate this point
The point I'm trying to make is that within the concept of a virtual machine,
you have flexibility to implement pretty much any environment and features
that you wish - not just what one particular vendor may advocate.
And this one too.
Here's a clip from my FAQ on "what is C-FLEA":

- You can use C on ANY target system, even if a native code C compiler
is not available for it. All you have to do is to get a C-FLEA VM up
and running, and all of the C-FLEA tools and libraries will work.

- C-FLEA code is portable and platform independent. You can implement
C-FLEA VM's with similar I/O features on multiple (different) hardware
platforms, and then compile a single C-FLEA program which can be run
on all of them without requiring any changes or recompilation.

- Since you "write" the C-FLEA CPU, you can provide functionality that
cannot be achieved in a conventional system. Here are some ideas:
- Execute from non-standard memory (eg: serial)
- Encrypted memory and other Advanced security / protection schemes
- Specialized peripherals appearing as I/O ports
- Add your own instructions!
- Multitasking support right in the CPU
- Debug tracing, event traps, specialized breakpoints etc.

- C-FLEA code is very space efficient. I see that, your website mentions that the VM is of about 1 kb
only.
The C-FLEA instruction set was
designed from the beginning to be ideal for a C implementation, and
as a result, you can pack a lot of C code into a fairly small image.
In most cases, programs compiled for C-FLEA will be SMALLER than the
same program compiled for a native CPU (Note: Since there is a memory
overhead for the C-FLEA VM code, the total memory required will only
be less for larger programs).


Thanks but I have one query bursting my brain, I don't know how to put
but try must I, "Why don't we have more of C-flea" why don't people
just share currently the C-Flea byte code like the Java byte code, It
is obvious to me that a CVM would be on any given day would be faster
than the JVM, so why sir may I ask of you why? Ok it is not only about
speed, people prefer OO for many reasons but there are a lot of people
of like C, and won't mind sharing .Cbytecode files. I mean if we have
speed, safety and stability of a CVM who in the world needs JVM, OO is
one reason but I mean we am talking about speed. Would you prefer to
sit on an "supercar" that required hard work but runs at the speed of
light[3*10^8 m/s] than a "car" that runs at 3*10^8 m/hr.

Too many question I guess.

I however apologize to the C gurus for me taking this discussion Way
off topic, but I don't know any other group where I could talk about

--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in
Nov 13 '05 #40
In comp.lang.c Programmer Dude <Ch***@sonnack.com> wrote:
Calum wrote:

[...]
But, seeing how machine code is just a language, surely you could
write an emulator for that machine code to run anywhere.


Sure. A friend has a Commodore64 emulator for his PC. Weird to
see those old programs running on the latest hardware! (-:


What's weirder / funnier is that it requires a blazingly fast gigahertz
clocked machine to fully emulate my old A500 at 1:1 speed... :)

- Kevin.

Nov 13 '05 #41
Minti wrote:
(-:


Looking at the direction of your smily,...


I've been informed that the overuse of smilies on internet has
caused a world-wide shortage of right parentheses. I'm just
trying to balance the equation and not contribute to the shortage.

:-0

--
|_ CJSonnack <Ch***@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|
Nov 13 '05 #42
Kevin Easton wrote:
Sure. A friend has a Commodore64 emulator for his PC. Weird to
see those old programs running on the latest hardware! (-:


What's weirder / funnier is that it requires a blazingly fast
gigahertz clocked machine to fully emulate my old A500 at 1:1
speed... :)


Yeah. It wasn't until my friend bought his latest machine that the
simulation seemed to run like the old 64.

--
|_ CJSonnack <Ch***@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|___ ____________________|
Nov 13 '05 #43
Kevin Easton wrote:
In comp.lang.c Programmer Dude <Ch***@sonnack.com> wrote:
Calum wrote:


[...]
But, seeing how machine code is just a language, surely you could
write an emulator for that machine code to run anywhere.


Sure. A friend has a Commodore64 emulator for his PC. Weird to
see those old programs running on the latest hardware! (-:


What's weirder / funnier is that it requires a blazingly fast gigahertz
clocked machine to fully emulate my old A500 at 1:1 speed... :)


The old A500 was an interesting machine. Emulating the various
coprocessors on a PC takes quite a bit of work, and a damn fast video
card to get it looking just right. The sound hardware is maybe a wee
bit easier to emulate, but the architecture itself takes some work to
get just right (fast and slow memory? eek!).

And then there's the 68000 to emulate... :>

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

Nov 13 '05 #44

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

Similar topics

7
6776
by: middletree | last post by:
I'm on an Intranet, and our Intranet server is on the same domain as the users. I have one place where I wanted to create a clickable link which would take the user to the directory for that...
58
30154
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
4
370
by: geodev | last post by:
I have developed a small application using ASP.NET and VB.NET on my development machine it works great. When I copy across the files manually to my test machine and create a Virtual Directory all...
1
8479
by: Dave | last post by:
I am getting te following error in a ASP.Net app that is running on Win XP Pro (SP2): Server cannot access application directory 'C:\Documents and Settings\dave\My Documents\My Visual Studio...
8
16267
by: William LaMartin | last post by:
I just received my Visual Studio upgrade to 2005 and tried to create a new web site via File | New Web Site with location http. Unfortunately I received the following error: "Visual Web...
3
2131
by: CharlesA | last post by:
Hi folks, I'll try and keep this as short as I can and have it still make sense. I'm working on a corporate locked down copy of XP, I'm not allowed to have IIS on this machine. this makes it...
3
1709
by: gdubois | last post by:
Hi!! I am trying for the first time to put on our intranet a really basic ASP.NET page, using VS2003 and C#. It's a page reading some info from an ACCESS database, using one dataset...
0
6904
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
7034
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,...
0
6886
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
5324
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,...
0
4472
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...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.