Page 1 of 2

A Question for Fred

Posted: Fri Jun 04, 2010 12:40 pm
by swhite
Hi

Since much of PureBasic is written in C I was wondering why create PureBasic in the first place. Anyone capable of producing PureBasic from C has to be a skilled C programmer so why not just create the various libraries in C for C and not bother with creating PureBasic. I am wondering what the motivation was to develop PureBasic when you had to use C to do so.

Thanks,
Simon

Re: A Question for Fred

Posted: Fri Jun 04, 2010 1:09 pm
by Mr Coder
swhite wrote:why create PureBasic in the first place
Um, because he made a language for people who don't know how to code in C... isn't that plainly obvious?

Re: A Question for Fred

Posted: Fri Jun 04, 2010 1:10 pm
by srod
By that logic, my question would be, why create c compilers when ASM could be used instead?

I for one am glad that Fred created Purebasic. Much more fun than using C... and a damn site easier!

Mine is not to wonder why Fred created PB, I am just thankful that he did. Do I even care why he even created it? Does it really matter?

Compilers come and go. Many people create them just for the shear hell of it; lots of fun, lots of challenges to overcome... If the resulting product earns a few bucks, then that is even better.

If you can really see little point in PB's existence, then I would suggest that you are perhaps using the wrong tool! :wink:

Re: A Question for Fred

Posted: Fri Jun 04, 2010 1:11 pm
by Mr Coder
Simon, now go and email Microsoft and ask why they wrote Visual Basic.NET when it's written in C, too. :roll:

Yoo dude, wake up . . .

Posted: Fri Jun 04, 2010 2:58 pm
by codewalker
By that logic, my question would be, why create c compilers when ASM could be used instead?
+1

Makes you wonder doesn't it , why do all those basic interpreters/compilers out there exist anyway, right ?
PB = (clean syntax+(same speed+power as c++)) = creating your project with 10 times less code.
cw

Re: A Question for Fred

Posted: Fri Jun 04, 2010 4:04 pm
by Thorium
But another interessting question is: Why not write PB with PB? ^^

Re: A Question for Fred

Posted: Fri Jun 04, 2010 5:07 pm
by Fluid Byte
Thorium wrote:But another interessting question is: Why not write PB with PB? ^^
Hah! You laugh! Fred is so awesome I bet he could accomplish that!

Re: A Question for Fred

Posted: Fri Jun 04, 2010 5:39 pm
by freak
swhite wrote:I am wondering what the motivation was to develop PureBasic when you had to use C to do so.
Because its fun! :P
Thorium wrote:But another interessting question is: Why not write PB with PB? ^^
Because it makes porting to new platforms more difficult.

Re: A Question for Fred

Posted: Fri Jun 04, 2010 7:06 pm
by USCode
swhite wrote:Since much of PureBasic is written in C I was wondering why create PureBasic in the first place. Anyone capable of producing PureBasic from C has to be a skilled C programmer so why not just create the various libraries in C for C and not bother with creating PureBasic. I am wondering what the motivation was to develop PureBasic when you had to use C to do so.
Clearly PB is an easier system all around to deal with in building applications but to build on Simon's question;
How much effort would be involved to take what has been done so far and package it as a cross-platform C framework?
All those handy C-based libraries that have been created for PB could make building cross-platform C applications much easier???

Re: A Question for Fred

Posted: Sat Jun 05, 2010 4:35 pm
by swhite
Mr Coder wrote:
swhite wrote:why create PureBasic in the first place
Um, because he made a language for people who don't know how to code in C... isn't that plainly obvious?
The reason I was wondering is that I have been having discussions with some other programmers saying that it would be smarter just to use C because:

1) It has a standard that is well established
2) It is not owned by some big company and subject to their whims about whether it will be around in 20 years etc.
3) It is available on all platforms
4) Most tools for other languages are already written in C.
5) The language is small in terms of the basic commands and syntax.
6) It produces compact and fast executables.

So I also wonder like someone else mentioned why a Cross Platform C framework was not created. I like PureBasic but just wondered why another language needed to be created instead of just building on C.

Simon

Re: A Question for Fred

Posted: Sat Jun 05, 2010 4:46 pm
by srod
Again, you are essentially asking a pointless question in a way; though you have touched on a good point regarding PB's long term future. That is my only concern with this product since I love it to bits and would be very sad to see it's demise before my own! Though that might be sooner rather than later if I don't start driving properly! :wink:

But who is to say that Purebasic will not be around, in some form, in 50 years time? 'Basic' has already been around 46 years or so and many said it wouldn't see out the 80's! :) And how long has C been around? (Okay, 38 years isn't bad either! :) )

I know one thing for a fact : there are a number of people who now program either as a hobby or comercially (or both in my own case) who would otherwise not be programming if Purebasic did not exist. And that surely must be justification enough for having created Purebasic in the first place.

Aye, Fred and co. have done a mighty fine job indeed.

As for using C over PB for those reason you have outlined... yes, fair enough. No one I think would argue with you because, when it comes right down to it, we are really talking about personal preference here. Even those who look first to use PB when starting a new project (like myself) will still use C when the situation warrants it. You've heard it before, and you're about to hear it again,... use the right tool for the right job!

For me, 9 times out of 10, PB is that tool! But that is my preference and my choice. I don't look for others to tell me which tool to use - such is the luxury of working for myself! :wink:

Re: A Question for Fred

Posted: Sat Jun 05, 2010 6:50 pm
by swhite
Hi

I do not think my question is pointless. It is a question for Fred as I am interested to know why he created PB. I use it and like it but still wondered why a person as skilled in C as Fred would create PB as opposed to a C framework. I am interested to know if it was due to a weakness in C from his point of view or was it just an interesting challenge etc.

As for those who think I should ask Microsoft why they create their languages I think the answer is obvious they want to control developers and focus them on Windows. Once you start using MS tools it gets difficult to move elsewhere and you are at the mercy of their corporate philosophy. It has precious little to do with the technical merits it is all about control and driving MS revenue.

Simon

Re: A Question for Fred

Posted: Sun Jun 06, 2010 12:37 am
by Fred
You know, PB was created at first in assembly 680x0 for the AmigaOS, with the main compiler written in Basic. I didn't know C at all at that time. So, as you can see your question "As Fred is a C guru.." is actually not relevant back to the PureBasic creation. Now, it's intesting to answer the "Why not a C framework instead". Well, why not. Would it be successful ? I have serious doubt about it. Remember than the C language is all but easy. You seem to think than BASIC and C code would be equivalent and only the libraries makes PureBasic different than C. I greatly disagree here.

- You will have to be familiar to C to use them (ie: have a C compiler installed, IDE setup, know about to link external libs, external header includes), which is the opposite of the PureBasic zero setup philosophy.
- String manipulation would be clunky, as you can't override the + operand, nor string comparison operand etc. Basically, we would need a whole setup of commands like strcmp(), strccat() etc.).
- Code will be not managed: when you create a local string, complex structure etc, you will have to free it when you leave the procedure. That's one thing than only a dedicated compiler can solve correctly.
- You will miss build-in functionnality (interfaces, pseudotype, foreach, ...). As you said, C is simple in synatx, but it's actually a bit to simple for today use.
- You will miss realtime debugger runcheck
- You will have to cast a lot to use structured array, list, map as no current element would be available
- PB generates structure info to do automatic initialization and more important release for structure with string, map, list, etc.. Again, you will need to call the init/free routine by hand, leaving room to potential errors (memory leak, double free, etc.)
- And the list can go on, there is numberous subtilities which makes PB programs much easier to code and to read than straight C.

Re: A Question for Fred

Posted: Sun Jun 06, 2010 3:33 am
by netmaestro
C, while immensely powerful, is too granular to be RAD. My take on this is that Fred has taken the power of C and ASM (even more granular) and used them as building blocks to create a tool that is, remarkably, both granular and RAD, as you choose to use it. Truly, hats off. Absolutely brilliant result. PureBasic is programming done right, and just too cool for words. If Frederic Laboureur had been there to take part in Microsoft's birth, the computing world today would just make sense. Oh, What might have been!

Like Fred already mentioned

Posted: Sun Jun 06, 2010 10:27 am
by codewalker
Like Fred already mentioned : PB frees a C coder from a lot of overhead. But this is obvious because any higher programming language is doing this. The good thing about PB however, is that it's level of abstraction is still close to C. (with a very clear basic syntax) Maybe it would be a good idea to add some of the points Fred mentioned in this thread, to the feature list of PB on the homepage.
cw