Page 2 of 2

Re: Platform independant applications

Posted: Tue Dec 07, 2010 5:19 pm
by NickJohnson
How do you address differences in integer size across architectures in C code? Or is everything strictly 32 or 64 bit?

Re: Platform independant applications

Posted: Tue Dec 07, 2010 5:39 pm
by lybredyne
at the moment, it's all 32bit.

I have been playing with moving it to all be 64bit, and emulating the 64bit when on 32bit systems.

You have any suggestions on for a better solution?

Re: Platform independant applications

Posted: Tue Dec 07, 2010 6:08 pm
by lybredyne
berkus wrote: But what is it capable of? Dalvik, for example, is a Java VM with JIT and full support for the whole Java range of applications. And it's still fairly compact.
No argument there, java is a grate beast.
berkus wrote: I understand you do not want to compare raw LLVM with VCMI, fair, but let's take Horizon - project based entirely on LLVM, including JIT, managed bytecode execution etc. How VCMI is more capable than Horizon? What additional benefits would it provide (let's imagine for a moment that you quickly wrote a decent cross-platform JIT for VCMI)? Again, Horizon at the moment doesn't specify exact interfaces, it merely provides a mechanism to run different components in a colocated address space safely and efficiently. You can tack interfaces on top rather easily - just specify them and adhere to them. Provided that LLVM can generate bitcode from a variety of languages, plus the fact that the JIT is capable of pretty nice optimizatins based on more information available in the bitcode - it will just blow the dust out of VCMI on any real test as I see it.
How much work would it be for os developer x to take one of these bitcode programs written for horizon and allow it to run under there toy os.?

With vcmi, its simple, one source file for the vm core, and a source file providing hooks into the system calls that there os has.
berkus wrote: Can you provide objective metrics which make VCMI better for running portable applications than for instance LLVM?
No, can you provide objective metrics comparing an apple to an Orange?
berkus wrote: I do not see a specified interfaces to the VCMI either, which means there can be different implementations? Which means it is inherently non-portable?
Of course you have not seen them. That does not mean they dont exist.
I have never seen france, it must not be real.

There is a common interface, it's based on posix and gtk for the gui.

I made the offer so that persons working on there toy os' could share applications between them with little to no effort.

I thought a common solution allowing me to run an application from your os on mine would be kinda cool.

But hey, your right, no one will want that.

Re: Platform independant applications

Posted: Wed Dec 08, 2010 3:14 am
by Solar
Come on. You wanted feedback. No-one is attacking you personally. But if you want to place a new product, you have to point out very clearly how your new product compares to existing products, where it has its strengths, and where the weaknesses are.

The more defensive you get about this, the less your product will appear feasible.

The best thing you could do is a website detailing the technology used. Take care not to do advertising, but detailing. People get wary when a technology is presented as the best invention since sliced bread, no downsides (because there always are). Being honest about it is about the only way not to get delusions as to what you can and cannot do.

Oh, and include a comparison table including readily available, mature technologies, like LLVM and Java. You may list "planned" features for your technology in addition to "implemented" ones, but again, be honest with it.

I think no-one here dismissed your project. But you have to live with some level of distrust when a single person comes up claiming to have done this really cool thing, because nine times out of ten it's more facade or wishful thinking than thought-through architecture. It's up to you to prove your product is genuine.

Re: Platform independant applications

Posted: Wed Dec 08, 2010 9:33 am
by lybredyne
Your attitude, well LLVM does it better.
Does that mean I shouldn't even try?

If thats the case, Windows, Linux, and Mac do it better, why are your writing your own OS.
You think your better than all those who wrote Windows, Linux, and Mac OS's.

Your level of arrogance has me nearly speechless.
You dont know me, you have no idea what I am capable of doing.

Before copping an attitude at some one and completely dismissing there projects, why dont you do some research.

If your os is missing the ability to easly translate the calls for opening files and allocating memory, etc... that VCMI uses, then chances are, your os is unable to run any type of applications.
Further more, if your going to have to write tons of glue code to support VCMI, the you will have to do the same for any api.

You have asked high level questions about VCMI, you have asked how it compares to a different compiler, have you thought to ask to see some of it's code.

Here are some of the headers used by the programs being complied by VCMI

stdio.h:

Code: Select all

#include <stdlib.h>
#include <stdarg.h>

#ifndef _STDIO_H
#define _STDIO_H

#define EOF (-1)

typedef struct _FILE FILE;

extern FILE *stdin,*stdout,*stderr;

int vsprintf(char *buf, const char *fmt, va_list args);
int sprintf(char * buf, const char *fmt, ...);

void vfprintf(FILE *f,const char *fmt,va_list args);
void fprintf(FILE *,const char *fmt,...);

void printf(const char *fmt, ...);

FILE *fopen(char *,char *);
int fclose(FILE *);
int fwrite(void *,size_t,size_t,FILE *);
int fread(void *,size_t,size_t,FILE *);
int fgetc(FILE *);
int fputc(int,FILE *);
int ferror(FILE *);

#define getc(f) fgetc(f)
#define putchar(c) fputc(c,stdout)
#define getchar() fgetc(stdin)
#endif
Nothing here that shouldn't be to hard to glue

stdlib.h:

Code: Select all

/* stdlib.h */

#ifndef _STDLIB_H
#define _STDLIB_H

#define NULL ((void *)0)

#define long int
typedef int size_t;

void *malloc(int);
void free(void *);
void exit(int);
void *realloc(void *,size_t);
char *getenv(const char *name);
int atoi(char *s);

#define alloca malloc

#endif
I am not dismissing you with grudged tone. I am saying you are dismissing me because my project doesn't sound interesting to you.
Thats not to mean that some one else may be interested.

and as far as your comment
So far I see easier ways to share applications between two arbitrary OSes - one can just plainly emulate the whole 2nd OS API and be done with it.
ever heard of this thing called WINE, how many years have they been trying to do just that.
easier is not the word I would choose.
furthermore, I dont know about you, but I have found bugs in my api before and had to change it, there by breaking the emulation layer anyone had done.

VCMI is deigned to run on disparate systems.
This is why it runs on OS/X ( ppc & x86 ), Windows, Linux, Haiku, and solaris.

Come back when you have a real argument, not just FUD.

Re: Platform independant applications

Posted: Wed Dec 08, 2010 1:09 pm
by NickJohnson
But none of those headers include anything about graphics or anything platform-dependent (which is C's problem in the first place: it's standard library is tiny.) You will have to add much much more glue to get anything out of your VM other than command line output.

Also, WINE took a long time to make because it was completely reverse engineered. If Windows' API were completely open/documented, it would have taken a heck of a lot less time than 15 years.

Re: Platform independant applications

Posted: Wed Dec 08, 2010 2:35 pm
by lybredyne
NickJohnson wrote:But none of those headers include anything about graphics or anything platform-dependent (which is C's problem in the first place: it's standard library is tiny.) You will have to add much much more glue to get anything out of your VM other than command line output.
There are more headers, but the point I was making was that the posix layer is NOT dependent on a posix os.
NickJohnson wrote:Also, WINE took a long time to make because it was completely reverse engineered. If Windows' API were completely open/documented, it would have taken a heck of a lot less time than 15 years.
You have a good point there, but if windows were open, i would be linux. :D

I will make an announcement when we release the code early next year ( Jan or Feb ) and we will see if any one is interested.

The reason I made this initial announcement was to let people know it was coming.
Not to cause an argument.

Re: Platform independant applications

Posted: Thu Dec 09, 2010 12:27 am
by inx
lybredyne wrote:I will make an announcement when we release the code early next year ( Jan or Feb ) and we will see if any one is interested.

The reason I made this initial announcement was to let people know it was coming.
Not to cause an argument.
Not trying to criticize or offend, simply to inform, but this alone is setting yourself up for a hearty round of criticism.
The software industry as a whole is plagued with vaporware announcements, and with hobbyist projects, OSDev especially,
they're more the rule than the exception. Any planned specifications, even with stunning design and forethought, are
pretty much worthless in the veterans' eyes. All of us have seen far too many. Really, there's not much point announcing
something that doesn't exist anyway, other than (sort of) tooting your own horn or looking for reassurance in whether
anyone will value the work if you do it.

The latter point is especially poignant. If you need the reassurance before you commit the time and (metaphorical) sweat,
this is not the hobby for you. We will not value your plans, only your results, and even then, you're more likely to get
brotherly criticism than a parade. This is not a bad thing, it's just how things are.

Re: Platform independant applications

Posted: Thu Dec 09, 2010 2:42 pm
by lybredyne
inx wrote: Not trying to criticize or offend, simply to inform, but this alone is setting yourself up for a hearty round of criticism.
The software industry as a whole is plagued with vaporware announcements, and with hobbyist projects, OSDev especially,
they're more the rule than the exception.
No offense taken. What we are releasing is something we have been using in-house for about a couple of years now.
We like it, and think others will to. ( in fact, our primary firewall at our office, and one of our web servers is written in VCMI. )

The decision to release the code was made last month. The only reason I have yet to post a URL, is that we need to make sure there are no regression errors from removing the parts that are proprietary and not being released.
inx wrote: The latter point is especially poignant. If you need the reassurance before you commit the time and (metaphorical) sweat,
this is not the hobby for you. We will not value your plans, only your results, and even then, you're more likely to get
brotherly criticism than a parade. This is not a bad thing, it's just how things are.
I know that one, I have been working on things like this for a long time. I know that most people will look at my work and go meh.
berkus wrote: As far as I see you didn't even study the existing field of platform abstraction techniques and just jumped in to do something. It may be brave, but this is software development, not pirate plunder. I've no idea what you are capable of doing, but you could've started with thinking first
This is not some Oh hey I want to do this type of thing.
This is an active product, produced by the company I own.

And as far as the existing field of platform abstraction techniques I have been working in that field for several years now. As has my company.

Re: Platform independant applications

Posted: Fri Dec 10, 2010 4:56 am
by Creature
I like the idea of having applications that are (almost) fully cross-platform, but I'm always weary of the possible overhead it involves. Do you have any plans to add other languages such as C++?

Re: Platform independant applications

Posted: Fri Dec 10, 2010 10:46 am
by lybredyne
Creature wrote:I like the idea of having applications that are (almost) fully cross-platform, but I'm always weary of the possible overhead it involves. Do you have any plans to add other languages such as C++?
Yes, the plan is to add C++ support.
Altho, we are looking at the best way to do that.
The three main ideas we have been tossing around are:

1) Write our own C++ compiler
2) Add support for VCMI to binutils and there fore gcc
3) Add support to LLVM.

With the killer progress LLVM is making, we will probably go that route, but first we want to get the initial public release finished.

Any opinions on that one?

As for performance, we have worked real hard to keep the performance of the core VM as close to native as is possible.
We are also working on a JIT for it, but again, first public release comes first.

Re: Platform independant applications

Posted: Fri Dec 10, 2010 1:07 pm
by fronty
How well does your C compiler compare to other compilers? It won't be very useful if the virtual machine is fast if compilers can't generate proper code for it.

Re: Platform independant applications

Posted: Fri Dec 10, 2010 5:17 pm
by lybredyne
berkus wrote:Can I see the benchmarks? Like Horizon has at least a minimal benchmark, can you run the same on yours and post the results?
Don't have any at the moment to release.
The ones we do have will be available on the wiki as soon as we bring it online in about a week.
I like there idea of using quick sort as a benchmark, we will probably add that one to the list.
fronty wrote:How well does your C compiler compare to other compilers? It won't be very useful if the virtual machine is fast if compilers can't generate proper code for it.
The compiler we wrote is mostly C99 compliant.
The compiler is not self hosting.

We are reviewing adding support for VCMI as a target to either gcc/binutils or LLVM.

Re: Platform independant applications

Posted: Fri Dec 10, 2010 5:56 pm
by fronty
lybredyne wrote:The compiler we wrote is mostly C99 compliant.
The compiler is not self hosting.
Is it not self hosting because of it's not compliant enough or it uses some extensions to the language not supported by it?

But what I /meant/ was how optimized code does it generate.

Re: Platform independant applications

Posted: Sat Dec 11, 2010 2:08 am
by lybredyne
The code the compiler/assembler creates is optimized for the VCMI platform. I am sure it could do more optimizations, however.

The main reason the compiler ,and by compiler, i mean the entire set of programs responsible for creating the VCMI binaries, is not self hosting is the linker.

To be specific, the linker we wrote sucks.

I did manage to get the trac site up today, it's empty as of this moment, but it's up.

http://trac.lybredyne.net/

I will start loading it with content within the next week.