• Welcome to Jose's Read Only Forum 2023.
 

strange thoughts for fun discussion

Started by Kent Sarikaya, October 02, 2007, 09:05:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kent Sarikaya

I couldn't sleep and 2 strange thoughts came to me, so I got up to write them before I forget. I think they could be fun discussion subjects.

1. Imagine the next version of PowerBasic being sort of like c++, not in the bad way, but in the good way. It allows the option of using classes and object oriented programming. It also still supports procedural programming as we have now. So if you like things the way they are you will be happy, if you want OOP it will be there. Now the fun. If this were the case, then imagine also a directive option to compile to the common runtime language. Again this would be an option, but it would mean working in groups where others feel comfortable in other languages. It would mean being able to write and run apps on any platform Visual Studio can, like smartphones and other small devices. And the icing on the cake, it would open up developing in powerbasic in linux under Mono. I think this could be a neat move. What do you guys think?

2. Second idea is more of question. As an alternative to PowerBasic and perhaps using FreeBasic, have you guys thought about FreePascal? The syntax is very readable. Many libraries are available and it runs on so many platforms. It seems like there is a resurgence going on in Pascal with FreePascal. I think many are finding it is a nice alternative to c++ with some sanity to how OOP works. And of course what Java maybe promised, but it needs that runtime engine. Which seems to need new versions that keep piling up in the add and remove control panel. I thought it might be a nice alternative future language for migration and would love to hear your guys thoughts about it in case PowerBasic sort of stagnates away.

Charles Pegge


I totally agree with your point about PB adopting the good features of C++. It has, over the years assimilated many C features to be able to use the Windows API and other DLLs .  FreeBasic is moving very strongly in this direction and already rides on the back of GCC. The task for developers is to ensure that their software is well constructed enough to withstand being ported from one system to another without falling apart.

We are going to see many changes and a move away from proprietary software towards the open source model. After all, no one owns a language, and its long term development is in the hands of its users. This poses a major problem for companies who earn their daily bread from selling development software.

Charles Simonyi's  'Intentional Programming' may be the long-term future of programming, where development is done by defining the task and allowing the system to do most of  the coding, keeping erratic fingers well away from the code itself.

http://www.intentionalsoftware.com/

I can see this working well for business software, at least.

I never used Pascal but I had friends who used it on the Apple IIc in the 80s. It brings back memories of 20 minute compiles onto 5.25 inch floppies and the cat snoozing on top of the monitor.

In the same genre, ADA is another possibility.



Patrice Terrier

QuoteWe are going to see many changes and a move away from proprietary software towards the open source model.

It is one of the reason why I have always choosen SDK over any other propriatary syntax  8)

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

Patrice Terrier

#3
About OOP, well I have been forced to used it when I learned C#.

All I can say is that fortunatly I had the chance to have a good knowledge of the low level API to work around the managed limitations as soon as you want to fine tune things.

Also as a matter of comparison the C# Carousel version i wrote, is three time larger than the one I posted here, with less features and the obligation to install first the DotNET run time.

However I like C#, and it has many syntax facilities that I would like to see in PB.

For example:
- DIM sIsString AS STRING = "This is a string"
- or being able to assign a default value to the parameters passed to a procedure (into the procedure)

And what I hate in C#, is its garbage collector.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

#4
Interesting thoughts Kent,

I think .NETing PB would make PB authors crazy ( me too ).

First because it would definitely not fit in "smaller, faster" company motto
.NET is not small, speed I cannot comment as I did not work with NET languages so much. But I doubt inline assembly would fit in MS idea of "safe code" :)

Second, because it would be double work for them. PB would compile "as usual" ( optimized, tight, true machine code ) + it would have to work quite differentely when targeting .NET.

I would be happy to see PB on more platforms, but I am not sure if it is real.
PB/Linux is something like Duke Nukem Forever. I still wait for it, but I am not sure it will ever go out.

Regarding OOP as optional way of programming in PB, I think it would be nice.
I would probably not use those features, but I know quite a lot of users would appreciate it.
And it would finally stop university professors asking "why do you not use OOP language" :D


Petr

P.S. Patrice, how does garbage collection work in C# ?
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Kent Sarikaya

Thanks for the link Charles. I am going to watch the video interviews. I never seen or heard Mr. Simonyi, so this should be great. I didn't realize he was the space tourist to go up a little while ago!

Petr, the compiling to CRL would be optional. If you don't need to compile to CLR you wouldn't. But since most businesses are using Windows Server OS they have .net, Most of the programmers work in a Visual Studio language or Delphi. This would allow PowerBasic to be right there with them in the corporate development arena. The CLR in a way makes it an even field. Now any language developer can compile to the CLR and be useable in Visual Studio and be used anywhere on any device that it supports.

I don't know how the compiler works and how hard it would be to do, but since the powerbasic compiler is so good, it shows they know what they are doing. I am sure they can make one to compile to CLR too.

Garbage Collection sound like a good thing to me, but I don't know enough about it to judge if one Garbage Collector is good or not. Seeing how Patrice is in another league as many of the guys on this forum, I will take his word for it.

I put myself in Mr. Zale's position and there are so many directions that they can go. They also have a long time history with lots of customers over the years. So they need to go in steps not to upset their wishes. But change is hard to accept, and rightfully so on many levels.

PowerBasic is loved because of its C like power but with the nice syntax of Basic. If you put the time and effort you can write anything with it. But to new users, these methods are outdated and way out of pace with what is out there in the competitor's products. I think there is a huge market out there for something like C++, that can be OOP or Procedural. Can be compiled to a fast executeble and be used to develop any type of application necessary, but where the programmer feels in control and not forced down a cattle chute.

It would be awesome to sit in on the meetings going on at powerBasic headquarters in which direction they need to go and how quickly they can get there.

Patrice Terrier

#6
See my comment below in the C# Carousel source code



        // Very important the call back must be static
        // to prevent from access violation during garbage collection.
        // Search for <<Callback Functions>>
        static CallBack UseCallBack = null;



        protected override void WndProc(ref Message m)
        {

            // We monitor the GDImage events from there
            // And we are doing it from there to protect us from the infamous
            // CallbackOnCollectedDelegate
            // (rappel effectué sur un délégué par le garbage collector)
            MonitorGDImageEvents();

            switch (m.Msg)
            {
                case Api.WM_SIZE:




        private void MonitorGDImageEvents()
        {
            UseCallBack = new CallBack(GDImageCallBack);

            // We use a callback to monitor the GDImage control messages
            // Create a %WM_LBUTTONDOWN event
            GI.ZI_EventMessage(GDImageCallBack, Api.WM_LBUTTONDOWN, true);
            // Create a WM_RBUTTONDOWN event
            GI.ZI_EventMessage(GDImageCallBack, Api.WM_RBUTTONDOWN, true);
            // Create a WM_KEYDOWN event
            GI.ZI_EventMessage(GDImageCallBack, Api.WM_KEYDOWN, true);
            // Create a WM_MOUSEMOVE event
            GI.ZI_EventMessage(GDImageCallBack, Api.WM_MOUSEMOVE, true);

            GC.KeepAlive(UseCallBack);
        }


From time to time the garbage collector lost the address of my CallBack, I get there:

UseCallBack = new CallBack(GDImageCallBack);

The solution is to move all the code that must rely on a fixed address into an unmanaged DLL.

This is because pointers are considered unsafe, that's ridiculous!
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

José Roca

#7
 
Quote
Petr, the compiling to CRL would be optional. If you don't need to compile to CLR you wouldn't.

Well. Things aren't so easy. You can't write an application using unmanaged code, the Windows API and/or COM and expect that the compiler will compile it to .NET using managed code and the CLR runtime. PB will have to add support for managed code, assemblies, .NET classes, etc., and you will have to write the application using this new support.

What is more feasible is to be able to host the CLR and call .NET classes and assemblies from you PB unmanaged code using COM (please, notice that this is not the same that making a COM callable wrapper; I'm talking of hosting the CLR, that is nothing but a COM server). I have done it with some classes. Need to do more research to load assemblies.

Regarding Linux, currently there is not market for a PB console compiler, in my opinion. To invest lots of time and resources to just sell a few copies will be foolish.

Kent Sarikaya

I can't say which OS will come out, but just being tied to Microsoft platforms I think can be dangerous. I think we are on the edge of a major change to portable devices. Even laptops will seem big compared to what can truly be carried around These devices need to be lower priced as being out and about so much they need to be replaced often just from exposure to danger.

We are seeing the next step to the GUI with touch controls as in the iphone and other products coming out. Can you imagine a touch screen that could take the finger print oils, absorb it  so it auto cleans the screen and this nutrient is then used as added energy to go into powering the screen or go into the battery :)

I am reading blogs now where programmers are writing simple apps and games, equivalent to developing in the 1980's, for smartphones and making decent extra income.
For individual hobby programmers it is hard to develop killer apps for the desktop alone anymore. But this new emerging market could be the next boom for single hobby programmers to make a name and some extra money from their hobby.

Maybe I should ask... How long can powerBasic survive staying as it is with only few changes or new commands and charge as it does now? They are in a difficult position to decide which way to go.

Edwin Knoppert

Who would gain anything from some kind of PB 'compiler' doing .NET?
Any language in Visual Studio calls it's compiler to compile MSIL.
That means: at the end all code is the same, VB.NET c# and so on.. it's all the same.
Therefore there is no real market for a PB.NET unless you like the syntax but that would not make it a real compiler.

>This is because pointers are considered unsafe, that's ridiculous!
Can be but imo it's just a matter of time you'll use the 'native' .net functions instead of your current o-so-easy to reuse dll.
I've seen weird object stuff for ordinary windows message processing and i just have to adjust to that.

The comment about mono is very viable, only your .net managed code will run on that..
So better prepare..
(And no, i don't think i'll see the day me doing a win32 lookalike in .net, me not 'adjusted' yet :) )

PS, what's wrong with the garbage collector?
What do you care if a var is destroyed when out of scope or some time after getting out of scope?
Some objects need to be unset manually, implement the Dispose interface and to make it easy on you use the using(){} syntax.

using( Class1WithIDispose c = new Class1WithIDispose() )
{
} // auto destruct here..



Charles Pegge

One of the issues which preoccupies me is how to safeguard and carry your intellectual assets ie your programs from one system or language to another. I have lost a number of programs in the past because the machines which ran them became obsolete and the tape/disc formats were incompatible/ With the Web this wont happen, but the software technologies are evolving so rapidly that it is too easy to leave old systems stranded, and uneconomic to maintain.

Vista has made a number of PC and programs inoperable, so that should be a warning sign to us all, not to be totally dependent on one familiar system. Not to mention the stealth installations that MS carried out this Summer, without disclosing to us.

I hope we will be able to conserve the essentials of all the hard work that José, Patrice and all the other contributors have put in here, in a form which will enable them, to be deployed on other systems and devices when they come along.


Kent Sarikaya

Did you guys see the C# changes coming for 2008 on the intentional software site? Do you think it is some kind of joke, but the author is Charles Petzold.
What is funny is, if this is not a joke, is taunting coding in xml like syntax. But if you watch one of the video presentations, the lecturer is talking about how everything is being to xml'ized.
That things could be written cleaner etc. So funny seeing 2 diverse views in a way.

http://www.charlespetzold.com/etc/CSAML.html

Patrice Terrier

VISTA instroduce a new concept in programming, that will split the making of new softwares into two parts:

1 - The interface that would be done by designers using WPF and XML to create the graphic chart (like in web design).
2 - The core programming for logic flow and application's features, that's what you are doing right now.

And part 1, will soon become the most important part...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

X3D is an example of an XML language. I generated X3D scripts for the dome models. I have to say that while it does the job, it is not a very elegant language, and its predecessor, VRML , with its curly braces syntax looks a lot better.

Fortunately there are 3d browsers that will accept either syntax, so for future projects I think I will go for VRML, which has the added advantage of being a recognised MIME type (.WRL files) and most servers will delivers these files correctly, for use directly in web pages.

http://www.web3d.org/

XML is supposed to be both human-friendly and concise, but it can so easily lose both objectives, especially if there is a committee driving the development.


Petr Schreiber

Kent,

that Petzolds article is joke for sure, check the date of creation - "© Charles Petzold, April 1, 2006" :)


Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com