PluriBASIC 6.0, A new way to create 64 Bit Applications.

Started by Brian Alvarez, February 28, 2018, 08:55:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

 Well, here it is.  The engine is ready to roll. It can handle a lot of the PowerBASIC stuff and more can be added very easily.

This will make PowerBASIC development of 64 Bit applications possible.  This thing can handle very complex code and will not choke... hopefully.

There may be some bugs or crashes here and there but nothing that a bunch of Beta testers cannot find and report, bugs can be easily fixed! I could right now develop it in itself, but i am using PluriBASIC 5.0 to do so.

So, jump right in! If you want to try it, you will need to install a C++ compiler, and configure in PluriBASIC 6.0 beta.

Be aware that this is a tool in development in a relatively early stage, and it will require input from you and others. Please do not expect a finished product.
Although you will be able to compile simple apps, it will take a few more days until we can be a complex app compiling, like an SDK dialog or something.

Heres the status:


  • DDT is on its way too. It will be possible and emulated almost one to one.
  • MACROS are there, and removed some limitations of the PowerBASIC macros (like, not being able to use IF blocks in macrofunctions).
  • Assembly is there, just needs an expert to guide us.
  • UDTS and UNIONS are there.
  • The IDE is in an early stage but JK IDE will be compatible as well.
  • IF THEN SELECT FOR NEXT DO LOOP all those are there...
  • GOTO GOSUB RETURN ON / GOTO are there. (currently working on ON ERROR GOTO)
  • Pointers, yes, although everything needs testing.
  • COM classes will need an expert to guide me in emulating them in C++.
  • PREFIX is there too, kind of like a macro functions that expands every row.
  • The engine is acceptably fast at generating C++ code, sometimes as fast as PowerBASIC (The engine can parse its own code in 1.5 seconds), but it requires an extra step to compile it. (It is prepared to output machine code too)

There are more goodies than i can report here, but i will be working actively on the reports (after my day job) to fix them if possibly instantly.

The engine is prepared to generate code to complex statements, but the stock code is missing. For example, it can convert:

STDOUT "Hello World"

to:

PRINTR("Hello World", "")

However, the PRINTR function is missing (see Screenshot1). However, you can create it using the C++ definitions creator (see screenshot2), just enter the name on the top textbox, and click "New" the definition will be created and you will be able to enter the code for it (See screenshot3). The engine will include it automatically (See screenshot 4).

By the way, the engine does not include functions or UDT's unless they are used. Even user ones. :)

SO far i havent found many unsolvable issues, most are pretty easy to overcome. A couple ones, like UBOUND and LBOUND are a bit of a challenge, but i will tackle them. Also being able to dimension arrays with specific ranges, is a bit hard bit i can do it. Although maybe we should stick to the standards and allow arrays to be resized only with a base 0.

Anyway, any comments are welcome.







Patrice Terrier

QuoteA couple ones, like UBOUND and LBOUND are a bit of a challenge
Do you use vector or an array new/free combination?
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Brian Alvarez

For the moment it is using plain "new", but i was thinking of using someting else, like a class. What do you suggest? If you give me an example of th code that should be generated for DIM, REDIM and RESET i can make the engine generate whatever code you want.

However, i was thinking of compatibility with Existing PowerBASIC DLLs, if possible, i would like to reatain that.

Brian Alvarez

In fact, i will need all the C++ help and tips possible. My abilities with c++ are average.

Patrice Terrier

Using macro definition

For array new
#define UBOUND(T) (sizeof((T)) / sizeof((T[0]))-1)

For vector
#define UBOUND(T) (T.size())

A couple of helper functions based on the use of vector

wstring REPLACE(IN wstring MainString, IN wstring MatchString, IN wstring NewString) {
    size_t pos = 0;
    while((pos = MainString.find(MatchString, pos)) != std::wstring::npos) {
         MainString.replace(pos, MatchString.length(), NewString);
         pos += NewString.length();
    }
    return MainString;
}


long PARSECOUNT(IN wstring MainString, IN wstring MatchString) {
    long count = 0;
    size_t pos = 0;
    while((pos = MainString.find(MatchString, pos)) != std::wstring::npos) {
         ++count; ++pos;
    }
    return count;
}


long INSTR(IN long nIndex, IN wstring sMain, IN wstring sSearch) {
    long nRet = -1; // Not found
    long nLength = (long) (sMain.length());
    if (nLength && (sSearch.length())) {
        if (nIndex < 0) {
            nRet = (long) (sMain.rfind(sSearch, nLength + nIndex + 1)); }
        else {
            nRet = (long) (sMain.find(sSearch, nIndex));
        }
    }
    return nRet + 1;
}


wstring PARSE$(IN wstring sMain, IN wstring sDelim, IN long nIndex) {
    wstring sResult = $NULL;
    long nLength = (long) sDelim.length();
    if (nLength == 0) { sDelim = L","; ++nLength; } // Use comma "," as default delimiter
    sMain = RTRIM$(sMain, sDelim); sMain += sDelim;
    if (sMain.length() && nLength) {
        LONG_PTR prev_pos = 0, pos = 0, nCount = 0;
        while( (pos = sMain.find(sDelim, pos)) != std::wstring::npos ) {
            wstring substring(sMain.substr(prev_pos, pos - prev_pos));
            ++nCount;
            if (nCount == nIndex) { sResult = substring; break; }
            prev_pos = ++pos;
        }
    }
    return sResult;
}

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Brian Alvarez


Thanks Patrice, thats kind of what i was thinking. However, I want to be as copatible with PowerBASIC as possible, can the UBOUND macro return the UBOUND of all the dimensions of the array?

Right now the engine converts:

UBOUND(Arr)   --- UBOUND(arr, 1)
UBOUND(Arr())   --- UBOUND(arr, 1)
UBOUND(Arr(1))   --- UBOUND(arr, 1)
UBOUND(Arr(2))   --- UBOUND(arr, 2)

LBOUND behaves similarly.... can something for such cases be done?

Brian Alvarez

Quote from: Mike Lobanovsky on March 01, 2018, 08:47:58 PMThen Brian I'm afraid your chances to create a functional competitor to industrial quality PowerBASIC are close to nil. Let alone lure people into paying hard cash for something that's never going to offer a fraction of functionality 32-bit PB offers OOTB.

Hello Mike, thanks for your input. :) Well, by average i am considering the rest professionals. :) That makes me a profesisonal but not exactly the best. There are some areas In which i need advise.

Quote from: Mike Lobanovsky on March 01, 2018, 08:47:58 PMWith all my due respect to prominent and professional PB programmers-members of this well established community, your public exchange with Patrice Terrier in this thread alone is sufficient for Drake Software to sue you to death for infringing upon their intellectual rights, and to wipe your PluriBASIC effort to oblivion at least on the entire US territory.

First of, i am in Mexico. Second, The U.S. has a precedent that a programming language cannot be copyrighted or something like that. Second and a half.... i am not basing my work on theirs, all the functions will be coded from scratch, not using the ones provided by PowerBASIC inc. Third, I would never compete with Drake software for the "market" of a programming community. In fact, i would like to offer them my work for a % of the income. The work i made is top notch, and up to the standards of PowerBASIC inc, but from that, to compete with them is beyond my imagination. Fourth... i am doing this promarily as a hobby, not as a bussiness, so, i can just keep it to myself and that is the end of it. :)

https://phys.org/news/2011-11-language-copyrighted-eu-court.html

Quote from: Mike Lobanovsky on March 01, 2018, 08:47:58 PMTake your time and re-read carefully what I wrote about clean room development on the OxygenBasic (Charles Pegge's) forum.

Will do, when i get some spare time. Thanks.

Quote from: Mike Lobanovsky on March 01, 2018, 08:47:58 PMPatrice my friend, what difference does it make? You've been a long time beta tester of Bob's products. Don't you know PB arrays are structurally incongruously more intricate than any of those crude C++ memory mongering primitives?

I think it could be possible, but franlky i see it very hard as well.


Brian. :)

Brian Alvarez

#7
Quote from: Mike Lobanovsky on March 02, 2018, 12:16:17 AMRe. your keeping your work to yourself, the big green "Buy now" knob on your pluribasic dot com page testifies to the contrary.

The green "Buy now" button, is for version 5.0 of PluriBASIC, which is released and compiles its executables by utilizing the PowerBASIC compiler exclusively, no unfair competition whatsoever. If anything, it is a plus to the PB community by enhancing the compiler's features. There is no other way of generating executables than PowerBASIC. In fact i got written permission from Bob Zale himself to work on PluriBASIC (formerly known as BasictoPHP). I dont know if the legalities of an ownership change, but i have no intention to violate any copyrights or anything. :)

Version 6.0, not yet released is the one being discussed here. Nobody has a copy of it except for me and my co-developer. Actually, a friend of mine suggested me to offer it to the current owner of PowerBASIC to be sold as part of the PowerBASIC arsenal of tools and i liked the idea, because i have no intention of promoting it myself.

Quote from: Mike Lobanovsky on March 02, 2018, 12:16:17 AM
Re. spare time, take my advice (I have never been a PB beta tester, hehe) and start reading up on the legal side of the matter a.s.a.p. not to get badly disappointed or disillusioned at some unfortunate future point in time. Not being able to sell your product on the world's largest and richest market is going to bury your business for good before it ever starts to look alive and kicking. PB customer businesses are mostly US resident, and European court cases are, alas, irrelevant on the US territory.

I dont mind. As i said, i do it mostly for fun. If i cant sell it, its not my loss. Believe me. I had so much fun doing it, that i already won. There is so much thought put into this!

Quote from: Mike Lobanovsky on March 02, 2018, 12:16:17 AMRe. coded from scratch, you're seeking advice from PB official beta testers who were made to sign NDA's with PB Inc. and whose advice in even minute matters of PB functionality is going to be regarded as unfair competition in every decent US court. Except, of course, if Drake Software's true intent was indeed ditch PB deep in the ground together with its adepts and they simply don't give a s...t about the whole matter.

Agreed. I withdraw my request. To be fair i didnt even knew Patrice was a beta tester and that he had to sign anything.  :)

It IS written from scratch. No advise from anybody so far, so, i might as well finish it and use it for myself. Lets see what the future brings. :) Who knows!

Brian.

Brian Alvarez


I got it working this weekend, It can now compile Android APPs too.

Brian Alvarez



Theo Gottwald

Hallo Brian, can it compile 64-bit Apps?
If so, i would like that you introduce the product.