Announcement

Collapse
No announcement yet.

How much would you pay for a tool that converts VB to PB (or C to PB)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How much would you pay for a tool that converts VB to PB (or C to PB)?

    If there were a tool to convert from Visual Basic to PowerBASIC, how much would you be willing to pay for it? Dacorbi Pattern Search is designed to perform all kinds of conversions. I envision that it should also be able to convert from one language to another. The download includes a sample module that converts a limited subset of Delphi code to BASIC, with the idea that you can add more and more conversion rules to make it capable of converting a wider variety of code. I was hoping that others could take the idea and maybe try a VB to PB converter with it. This hasn't happened yet. I may have to start this myself. It would be challenging and take some time, so I want to know if there is sufficient interest first. There are certain kinds of things, which perhaps might not be directly translatable, but I think overall it can be done.

    Below are before/after screenshots of a sample conversion from Delphi to BASIC:

    Before (Delphi source code):


    After (code converted to BASIC)


    Dacorbi Pattern Search can be downloaded from www.ucalc.com/dacorbi.html
    Daniel Corbier
    uCalc Fast Math Parser
    uCalc Language Builder
    sigpic

  • #2
    Daniel,

    I've been messing around with a VB to PB converter using PB's new objects to help in the conversion process. My tests with PB objects so far have produced results that have been most gratifying and definitely cut through a lot of the conversion headaches by essentially keeping most of the VB code as is.

    That being said there are a couple of problems, first, some method needs to be implemented to convert the VB .FRM file into PB. Most of the third party softwares that permit the functionality of importing the VB form file stop short in placing VB container controls on a PB form, think the VB SSTab control. IMO, the PB form layout and functionality is just as important as the conversion of the module level code and is a logical place to start the conversion process.

    Second, and this may be a matter of coding style, or personal preference, it may be wise to provide a source code layout that roughly emulates the VB events for form(s) and control(s). I am not advocating creating a conversion runtime .DLL or anything of the sort as it would be overkill and a maintenance headache. Instead the event emulator would give the new PB user source code they are already familiar with. Perhaps this could be a user defined option a PB coding style vs. a VB coding style. From my personal observations with my own VB to PB conversion efforts the biggest problem I had was understanding Windows messages, bar none. Even with the Win32 help file it is still a daunting task to me.

    Third, some sort of interactive conversion IDE should be developed so the user can see the conversions as they occur and provide an undo capability.
    Later...

    JR

    "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

    Comment


    • #3
      Sorry for not responding sooner.

      I went ahead and created a VB to PB conversion module with Dacorbi Pattern Search (DPS). The FRM to PB conversion is actually relatively straightforward with DPS. The download includes a sample VB frm file, which DPS can convert to a fully equivalent working PB program. This includes form layout and source code with control events and all. This is a startup. You can add to it to make it handle even more advanced VB programs. I'm hoping that others here can pitch in.

      It works using a series of advanced Find and Replace patterns as in the illustration below (you'll have to navigate with the arrows in the actual program to see the rest).



      Dacorbi Pattern Search page: http://www.dacorbi.com
      VB to PB module: http://www.ucalc.com/vbtopb/vbtopb.zip
      Sample VB frm file: http://www.ucalc.com/vbtopb/vbform.txt

      Although the title of this thread asks how much you would pay, I'd like to ask if others here would be interested in building on this as some kind of open source project.
      Daniel Corbier
      uCalc Fast Math Parser
      uCalc Language Builder
      sigpic

      Comment


      • #4
        There are a few tools to do various VB-to-PB conversions, just search through POFFS for 'convert VB'. One I made is called FRM2DDT which simply converts the controls on a form into a PB-compatible DDT form.

        It doesn't do general code conversions though like yours does, and there aren't many that do.

        The hardest thing when manually converting VB to PB is when you're new to PB and not aware of its nuances, the usually subtle differences between VB and PB. And because VB code is still in a BASIC syntax it's generally fairly simple to port over to PB, but not always. Converting from C is usually a bit trickier.

        But because VB and PB aren't a direct brother and sister of each other they both have a lot of unique aspects to them that would be very, very difficult for a converter to achieve, especially for a 'grep'-style search-and-replace converter like yours. Just the way the controls are interfaced with for example is very different, so I think if you want to make a serious VB-to-PB converter people would pay for you'll need to do a lot more than the current grep-style replacing.

        Cheers
        -

        Comment


        • #5
          I don't think I would pay!

          I have converted both VB6 and PL1 programs the same way just by cutting and pasting the code into PBWin IDE and correcting the errors as they are shown - depending on how fast you are you can get a working program within a couple of days. I then optimise for PB after I know that the basic (small b) code is OK.

          However I am currently transferring a large VB6 COM program to PB - that is painful and I don't believe a Converter would be able to help very much.

          Bob

          Comment


          • #6
            Conversions are worthless since within each 2-3 years you may better think of rewriting the lesser parts of your program anyway.

            Or for example.. do we want more administration applications with DOS-appearance.. say "no"

            Note that i have helper code (includes) i never have to change, this is not code which applies to the user interface/experiance which is imo always subject to change.
            hellobasic

            Comment


            • #7
              The problem with these converters is, that nobody believes that theey realy produce code that will make sense.

              If - at the end - you still need to make changes "by hand" then you may often be faster do to it alltogether without a converter.

              If you really have a converter that can even convert big VB Projects without changes into reliable PB Code, you should show examples and talk to those people who sell already stuff for PB, including PB INC and present your Tool.

              As said the difference between a 95% Tool and a 100% Tool for such Jobs is that if it only trnalates 95% then you mayb be better doing it without that tool. Because as a human you may just use a quite different system.

              Comment


              • #8
                The problem with these converters is, that nobody believes that theey realy produce code that will make sense.
                The other problem, Theo, is the best any automated converter can do is provide "lowest common denominator" code. If the PB compiler offers features which could do things better than what is available in the source language, you don't get that benefit. (Unless you have a REALLY brilliant converter).
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  I'd like to thank everyone for the responses so far.

                  Apparently, the consensus is that it would be very difficult (if even possible at all) to create a good VB to PB converter that is worth using. However, I'm here to say that it can be done, and I now have an actual implementation. It is no longer just an idea. Can I please ask the kind folks here to download what I've done so far, and give it a try? You just might be surprised. The static picture I posted here along with a one-sentence explanation does not give a sufficient idea of how it works.

                  Wayne, it might indeed be difficult to create a converter using a grep-style method. But my tool isn't a kind of grep utility. Please try DPS to see how it's different from what you might have had in mind. And if you know of another tool I should look at (I looked at PB/Forms, and your FRM2DDT code, but I also want to know about code conversion beyond just forms & control layouts), please let me know.

                  Robert, I couldn't use your copy/paste-modify-recompile method with the sample form-based code, although I can see how that would work for other kinds of source code. I believe that DPS would be ideal for the VB COM conversion you are trying to do. What I posted now works for code related to forms and controls. However, if you understand how that part was done, you should be able to extend it so that it converts COM code as well. After you've tried what I've got so far, I'd be happy to help with improvements if there is sufficient interest.

                  Theo, you have a valid concern. Please give it a try, and you will find that the output code that is produced is not something cryptic. It will look much like the output of a manually produced conversion. And you have full control over what the output should look like.

                  Michael, you don't have to rely on a "lowest common denominator". In fact, what I have uploaded is just a sample converter module that works with DPS. Once you understand how it works, you can either customize the converter module, or create your own, which will produce an output in the style of your choice. I believe that anything that can be translated manually can be translated with Dacorbi Pattern Search.
                  Daniel Corbier
                  uCalc Fast Math Parser
                  uCalc Language Builder
                  sigpic

                  Comment


                  • #10
                    Has anyone had a chance to try Dacorbi Pattern Search yet?

                    Translating source code is just one of the kinds of projects it can handle. DPS comes with a helpful demo that will walk you through many of the various things you can do with it. Please give it a try.

                    Visit: http://www.ucalc.com/dacorbi.html
                    Daniel Corbier
                    uCalc Fast Math Parser
                    uCalc Language Builder
                    sigpic

                    Comment

                    Working...
                    X