Basic idea
We create a simple, common virtual machine format and separately produce compilers into it from various programming languages.
Please put your notes on the fledgeling format on the VirtualMachineFormat page.
Interested Persons
MarkusB (currently away)
Chit-chat
The 'Compilers for different languages into a common virtual machine format'-theme sounds pretty interesting. I've been thinking about writing a compiler/vm for a "scripting language" for a while. ("Scripting language" as in "something you embed in other applications"). If anyone else is interested, I can give some details about what I had in mind. -- MarkusB
I've thought a little more about this idea, and it's incredible. Being able to write your code in a variety of languages, but using common libraries, and in the end having your SchemeLanguage code run in the same VM as code from CLanguage, is just amazing. Why hasn't anyone already done this? -- MikeNolan
It's done and it's called .NET: C#, VB.NET, Managed C++, Fortran, Forth, COBOL, Scheme, F#, SML.NET, Smalltalk, J# (Java syntax with .NET classes), Haskell, Mondrian, Logo, etc. These are the ones I could remember. .NET implementations of those language all run with the same set of classes. It can also run on Linux and *BSD with Mono. Now if only it wasn't from Microsoft, it would have a better reputation. -- FrancoisDenisGonthier
It would also have a better reputation if it weren't designed fundamentally around C# and VB, with any other language implementation that works coming about as a result of luck or ugly hacks to fit an inappropriate program model. -- AdamChlipala
That's a computer scientist's opinion which I respect, but many uninformed people simply think ".NET is from Microsoft => It's Evil". And I was only replying to Mike's "Why hasn't anyone already done this?" question: it has been done with .NET. If it doesn't fit the functional programming model very well it probably does better than Java at it. -- FrancoisDenisGonthier
AdamChlipala, it seems as if you're a bit misinformed about .NET. It's designed to be a language neutral environment. Indeed, the VM includes such FP-oriented niceties as a tail-call instruction. Take a look at http://arstechnica.com/paedia/n/net/net-1.html to learn more. Anyway, as for the general idea, it seems good. I'd be most interested in the VM or board game idea. It seems like most people are interested in the VM. Anyway, I'll be keeping an eye on this page to see what other people think; this could be very interesting. -- CharlesKrohn
No, I stand by what I said. Other languages that work well with .NET are very close to C# and/or VB. The .NET developers simply weren't thinking about anything but imperative, object-oriented languages when they developed it. You can hardly call a tail-call instruction FP-oriented when gcc has done tail-call optimizations forever. -- AdamChlipala
I'm very interested in virtual machines and think this is a great project idea. I suggest that we design a virtual machine that permits good JIT compilation. In order to do this, the code must be specified in discrete chunks. Self-modifying programs would have to use a VM function to "load" code chunks and make them ready for jumping into. Programs that uncompress themselves would be considered self-modifying. What do you all think? -- MikeLeonhard
I'd recommend trying to make your own implementation of a Java or .NET VM. This way, you can make use of existing compilers and classes to test your implementation, and you have a good specification to work toward. If you write the VM in Java and make it a Java VM (okay, kinda pedantic), you can use the BCEL library to get past the annoying part of loading up .class files. -- JoshuaTauberer
The Java VM has too much object-oriented cruft for my taste. For those who don't know, all programs must be phrased as collections of classes, even if they originated with code in a non-object-oriented language. -- AdamChlipala
Well, looks like I'm not the only one interested
Anyway, I'd suggest that we design a vm more or less from scratch - java vm's for instance have too much overhead for my liking (memory wise). I haven't looked that much at the internals, but I'd also hate to be forced to use javas way of allocating object (i.e. you can only allocate object on the heap with new or similar constructs). As said, "my goal" (egoistic isn't it?) would be a vm that can easily embedded into other applications.
I'm going to be away a few days (vacation & [^http://www.tekkno.cc/index_im.php?t=ENERGY&view_id=3703&lang_id=3 party]), so if you don't hear anything from me, it's because I'm not here (duh!) -- MarkusB
Are we going to worry about language yet or just design and planning? A functional language would be good, and I don't think Adam would want to use anything else (correct me if I'm mistaken). I've been working on thinking functionally, but slowly, and I don't know if everyone else is good with them, either. So that could be a problem. -- MikeNolan
Adam said on IRC he wasn't taking part in the project so you should not be concerned about what he thinks. For the language choice, it would sure be nice to use a functionnal language but you'll have to choose a language that everybody is fluent with otherwise barely anything will get done. Depending on the size on the project, it should be possible to rewrite it in another language in a near future. Remember than you will need compilers for the future VM. -- FrancoisDenisGonthier
Hey! Actually, I think it would be even better if there were 2 VMs: one written in a functionnal language, the other in C/C++ or whatever. That would require more time but the would help the member learn about functionnal languages. Comparing the 2 VMs would also be interresting. -- FrancoisDenisGonthier
Do different programming paradigms even require different virtual machines? After all, all kinds of programs will run on an x86 computer. I'd say stick with a relatively simple register machine; that way everyone can write for it. -- CharlesKrohn
Sorry. I did not made myself clear: 2 VMs, 1 architecture. 1 VM implemented in C/C++/whatever, the other in AFL (Any Functionnal Language). I think this would be a good way for members of this group to learn. -- FrancoisDenisGonthier
Eww, not C! Just kidding, I get your idea. Will this be cross platform? If so, wouldn't we want to use a cross-platform language? -- MikeNolan
C is cross-platform if you take care. Most people in HProg are running *NIX and Windows users can always use Cygwin. The people that decides to use C most work with the cross-platform issues. That's part of the 'game'. I personally don't want to be greatly involved in this project since I won't have much but as a Windows users, I can make sure the VMs work in Windows and fix the issues if there are any. That is if you care about Windows
-- FrancoisDenisGonthier
I think that all of this talk about implementation is premature. Implementing a VM is easy. Designing one is hard. Writing a compiler for one is much harder. If we design a VM, document it properly, and create test programs then the VM implementations will be pretty easy. -- MikeLeonhard
This is a pretty good way to ensure nothing gets done. They need to get going working quickly, even if it means screwing up the first implementation. There is no deadline about the final product, but the current motivation on doing something has a deadline, and it doesn't give much time. -- FrancoisDenisGonthier
I don't mean to tell anyone interested in this idea what projects he should undertake, but this is departing from my original ProgrammingGroup proposal and sounding more and more like another of the dozens of proposed "projects" that lead to nothing. The key difference in my proposal is that things must be set up so that people write their own code that does not depend on code written by others, with the exception of up to 2 (or some other small number) of others working on a small group project. This prevents any one person from ruining the whole thing from losing interest, and it also has the beneficial effect of scaring off the usual layabouts who just want to talk about working on something to feel like they're part of a group, but don't have any motivation to follow through on their words. These people are free to talk to themselves all they want, but their lazyness cannot infect the group.
As far as my original idea, think of it as being more like a school assignment than the stereotypical Internet coding project. -- AdamChlipala
In short, everyone should shut up and start coding if I understand well? If I do, then I agree. But I won't be part of that. -- FDG
Just so no one is confused about my status, I think I'll keep to my own small project for the time being. -- CharlesKrohn
I decided to check into reality. I spend too much time in this group for a beginner, and I really need to be coding rather than chatting. I'm taking time away from the Internet to use the little time I have left in my summer break to learn as much as I can. I will be continuing my study of VMs and working on projects I've neglected in the past. Good luck with the community! -- MikeNolan
