Tuesday November 28, 2006
Farewell After John Kline recently left the company for new ventures, it is now my turn to move on as well. It was a lot of fun to work on Project Semplice.
If you have any questions or comments regarding Project Semplice, please don't hesitate to send them to semplice-public-feedback-AT-sun-DOT-com
Good luck!
Herbert C
Technorati Tags: Project Semplice
Posted by herbertc ( Nov 28 2006, 10:00:32 AM PST ) Permalink Comments [3]Project Semplice and ActiveX controls The idea behind Project Semplice is to take existing VB6 applications and run them ontop of the Java platform. One of the caveats was that we said that we would not support any ActiveX controls. The thinking behind this is that ActiveX controls are not very portable and don't run on all the architectures that the Java platform runs on. And then of course there are some security concerns about ActiveX controls.
After looking at some serious, real-world VB application we realized that they are using lots of 3rd party controls. Of course this would mean that people trying to give Project Semplice a try by compiling their existing VB application would fail to make them work. When I try a new product and the first thing I do fails, I am usally very disappointed.
The solution that we have come up with is to supply a simple COM server for Java that would allow connecting to ActiveX controls with Project Semplice applications. That way people can more easily try their existing applications on Project Semplice. Of course the long term goal would still be to replace the ActiveX controls with controls from the Java world, but at least this is an easy way to get started.
Let's look at an example. Say we have a VB6 application and with an ActiveX movie player control on a form. Then we import the application into Netbeans and compile the imported application. First the compiler tries to look on the classpath to resolve any form components found in the project. Otherwise it will generate code for starting the COM server and some adapter classes so that the ActiveX control can be displayed in the Java/Project Semplice form.
When we try to execute the compiled application and we are on a non-Windows platform then the application will start up with a message box warning you that some of the controls are not available on the platform you are running. On the forms of the application there will be a special icon in place of the ActiveX control indicating missing functionalty. When you are running on a Windows platform on the other hand, then the COM server will be started and the application will execute and look just like the original VB6 application. With one difference. We will open a message box warning you that you are about to execute an ActiveX control. This is to alert you that there are some safety concerns about ActiveX (which uses a quite different security model than Java).
Please let us know what you think about this!
Technorati Tags: VB, Visual Basic, Java, Project Semplice
Posted by herbertc ( Oct 30 2006, 02:40:00 PM PST ) Permalink Comments [0]Project Semplice - Update Just to show you that we are still working hard on Project Semplice, here is quick status update.
Recently we got another sample application from the original VisualBasic 6 distribution working. The Optimize application is a little benchmark application demonstrating the execution speed of VisualBasic. So far there wasn't really anything you could compare the results against, but now we can run it with Project Semplice and compare it against the original. Lower numbers are better and, as you can see, the results are encouraging. The VB6 application is compiled (not interpreted!), everything else would be unfair, obviously, since the Project Semplice code is compiled by the Java Virtual Machine as well.
First, the original VB6 application screenshot:
And finally, the Project Semplice application screenshot (there is some more UI work needed in our libraries as can easily be seen):
Technorati Tags: VB, Visual Basic, Java, Project Semplice
Posted by herbertc ( Oct 09 2006, 02:33:00 PM PDT ) Permalink Comments [1]Semplice Feedback Email Address We now have an email address for any feedback you have regarding Project Semplice:
semplice-public-feedback-AT-sun-DOT-com
Even if we don't have time to respond to all emails directly, we are reading all of them and appreciate any comments and suggestions!
Technorati Tags: VB, Visual Basic, Java, Project Semplice
Posted by herbertc ( Jul 30 2006, 01:30:00 PM PDT ) Permalink Comments [2]Project Semplice - Q&A First of all, thank you for all your comments. Here is a little Q&A based on those comments (from the blog and our demos). Please keep in mind that all answers are subject to change without warning as we are in the very early stages of development.
Q: Are you converting VB source files into Java source files?
No. This is a true VB source to class file compiler. It should be possible though to run a decompiler on the generated class files to convert them into Java source code. But you would loose any comments from your source files that way though.
Q: Isn't it a little bit too late for a VB6 compatible project?
According to our information there are still a lot of companies out there with substantial investments in VB6 code. VB6 was a great programming language for non-professional and casual programmers. VB.Net has a much higher learning curve for these programmers.
Q: Do you have plans to support VB.Net?
We are investigating support for VB.Net. We already added some VB.Net inspired language features such as namespaces and imports as well as single inheritance which we use to better interface with Java applications and class libraries. For the VB6 programmer all these new features are optional. You do not have to use them but may choose to whenever you feel comfortable with them.
Full VB.Net support is difficult to do for various reasons. To pick just a selected few: The generics model for VB.Net is similar to that of C++ where a type instantiation results in the creation of a new type at runtime. Java Generics, on the other hand, are about type reuse. The short story is that type information is checked at compile time. Another problem are delegates (or to call them by a simpler name: function pointers) for which there is also no equivalent in the Java world as of now. And of course there is the ever growing CLR.
How important is VB.Net support for you? Do you just want the language or a subset of it? Do you also want CLR support?
Q: Will there be support for Web Applications?
Tor Norbye showed creating a web application at Graham Hamilton's keynote. We are looking into making it really easy to create Web Applications. But we just started working on this. So, sorry, that I can't give anymore details on this currently.
Q: Will you support the 'Edit&Continue' debugging feature?
Yes, we are planning on.
Q: Is this project Open Source?
This is currently being investigated but no decision has been made.
Q: Is there a time scale on availabilty?
Without any promises: We hope to have some early access available by the end of the year and hopefully be finished for next years JavaOne. But as I said earlier, everything is subject to change...
Please continue to send us your comments, questions and suggestions. Thanks and happy programming!
Technorati Tags: VB, Visual Basic, Java, Project Semplice
Posted by herbertc ( May 23 2006, 09:07:00 AM PDT ) Permalink Comments [7]Project Semplice - Visual Basic for the Java Platform Yesterday we - that is Tor Norbye, John "Get a blog" Kline and I - presented our project at JavaOne in session TS-3576 under the deceptively unexciting title "Visual Basic and the Java Platform". Well, it actually is "Visual Basic for the Java Platform"!
We are in the early stages of development for a compiler and tools for writing Visual Basic (VB) programs for the Java Platform. That means we will compile VB source code into Java class files that will run on the Java Virtual Machine. Even better, you will be able to import existing VB6 applications into any of the Netbeans family of tools and continue to work on them. Of course I must add a word of caution at this point. If your existing VB6 application contains any calls to the Windows 32 API, we will not be able to emulate all these entry points. We will also not be able to handle any OCX controls that you don't have the sources for. That said, let me show you some of the stuff we demoed yesterday in our session. The slides of the session are also available on the JavaOne website.
Importing and Maintaining an Existing VB6 Application
Our first demo was to import one of the sample applications that comes with VB. We imported the Calculator project, compiled and ran it. Next we made a modification to the Calculator by changing the 'X' character on the button for the multiplication operator to the '*' character. This also required a modification to the source code as well because it checks for 'X' and now needed to check for '*'. We then recompiled and ran the Calculator again and voila, we could use '*' as the multiplication operator!
Creating an new VB Application from Scratch
The next demo was to write a Celsius to Fahrenheit temperature conversion application from scratch. We used the Netbeans GUI builder to create the form and then added an event handler for the conversion button. In the event handler, we take the contents of the Celsius textbox, apply the conversion formula and output the result into the Fahrenheit label. Note that in Basic you do not need to worry about type conversions as you need to in Java. Note also that we are taking advantage of default properties in this example.
Creating an new VB Application that interfaces with a Java Class
An important thing for us is to allow VB programmers access to the all the existing Java Beans and libraries. Therefore, we wrote a VB application that called a Java class for our next example. The application finds all prime numbers in the range from 1 to 8192 using the Sieve algorithm by Eratosthenes. The application has a UI written in VB from which we can call the Java version of the algorithm as well as a VB version of the same algorithm. Note that the runtime of the Java version is slightly faster because the VB version uses non-zero-based arrays, which causes a slight overhead at execution time. We will try to make some improvements here in the future. Disregarding the aforementioned non-zero-based arrays, the performance for VB compiled and Java compiled applications is very similar.
Calling VB Classes from a Java Application
In the previous example, we showed how to call into Java classes from a VB application. In the next example, we will call a VB class from a Java application. We will take the Sieve algorithm again, except this time we are writing a Java UI and call the Java version and the VB version from there. Also this time we are going to deploy the application to the SavaJe Jasper S20 cell phone. Yes, that means that VB is running on a cell phone! Note again that the VB version of the algorithm is slower because of non-zero-based arrays.
A Fractal Application
For our last demo we downloaded a VB application that computes a fractal (similar to the famous Mandelbrot fractal). We also obtained a version of the example that was compiled into native code with the VB6 compiler. As you can see in the screenshot (the upper left corner of the fractal shows a label with the time it took to compute the fractal), the Java version performs significantly better than the natively compiled original. Be aware though that a performance of this magnitude cannot be expected for all applications.
What's next?
We would like to hear from you! Is this a project that you could use, either yourself or in your company? Do you prefer VB6 or VB.Net? Are there any extensions to the VB language you would like to see?
Looking forward to your comments and happy programming!
Technorati Tags: VB, Visual Basic, Java, JavaOne, Project Semplice
Posted by herbertc ( May 19 2006, 01:55:00 PM PDT ) Permalink Comments [72]