Author Topic: C BASIC  (Read 72862 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: C BASIC
« Reply #105 on: November 04, 2013, 02:54:01 PM »
I think the minimal level of gcc Charles will accept with C BASIC is 4.7.x on ALL platforms.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: C BASIC
« Reply #106 on: November 04, 2013, 04:09:22 PM »
Gcc version doesn't really matter here, I think.

c99 should be as low as we go, if you want to go the std= route.

I generally don't bother though, because you do lose some gnu stuff when you specify that.  Just like you do when you specify gnu99 instead.

What we really need to talk about is what compiler we're going to standardize on.  I'm doing cross-platform stuff, so gcc/g++/clang/clang++ is what I'm prepared to use.  Since I'm on a Mac, and they all tie in to LLVM anyway, it's what I'd like to stick with.

A.

kryton9

  • Guest
Re: C BASIC
« Reply #107 on: November 04, 2013, 06:14:41 PM »
I know John said gcc and that is fine with me.

This is just for information.
But I just did some tests with PelleC (the most compliant free C compiler)  and all of our C codes fail.
I tried with the following options:
32 bit, C99
64 bit, C99
32 bit, C11
64 bit, C11
They have all the headers for all C99 and C11 plus what is below-- With these all enabled and disabled:
Private #include files
The #include files classified as private are not part of the ISO C11 standard. They are a mix of files from the Posix standard ("a useful selection"), Microsoft, and Pelle.

I will work in a vm linux distro from now on.



« Last Edit: November 04, 2013, 06:17:20 PM by kryton9 »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: C BASIC
« Reply #108 on: November 04, 2013, 07:11:45 PM »
That's the nature of the beast.

When I was working on the LinuxBC project, we tried backporting what we had created to that point to Windows and PellesC.  Epic Fail.  We would have had to basically rewrite a lot of what we had produced, and decided to not bother since BCX already ran on Windows.  Getting it to run under MinGW was a challenge, but it wasn't until later that it was actually done (Mostly by James Fuller, where you at son?)

Bottom line, PellesC is an excellent C compiler (and more) implementation, but it's not GNU C.  If you want to target the largest possible number of platforms, you really have no choice but to use GNU C/C++.  And there's a wealth of information/examples all over the net that you can tap as well.

A.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: C BASIC
« Reply #109 on: November 04, 2013, 07:21:52 PM »
Quote
Mostly by James Fuller, where you at son?

I was wondering that myself. James is already a member of the All BASIC forum and I would of thought as soon as you mentioned the C++ BASIC direction you were taking, James would have been jumping on board and helping with your effort. I hope James still likes us.  :-*
« Last Edit: November 04, 2013, 07:53:08 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
C BASIC - Overlay or Translator ?
« Reply #110 on: November 05, 2013, 02:54:20 AM »
I was chatting with Armando about his direction with C++ and using the more advanced features it offers over C. AIR has an advantage as he has done this before in a sense with the MBC. (fork of BCX) AIR made the comment that #define(s) and macros are just part of C BASIC and a parser will be needed. I wasn't sure what AIR meant and I had to go. After thinking about it for awhile I'm wondering if AIR is not only going to write a C BASIC overlay for C++ but creating a BASIC to C BASIC converter as well?

I thought the C BASIC project was using #define(s) and making C look more like BASIC. I wasn't prepared for a translator layer as part of this project. I can see a BASIC programmer taking his/her BASIC code and adapting it to C BASIC but with the full knowledge that portions of the BASIC code will need to be translated to C format.

I noticed Kent's last example and the multiple FOR definitions. C only has one format for FOR and I think we have done a good job making it look like BASIC.

Code: [Select]
FOR ( int i = 0 TO i < MAXENEMIES STEP INCR )
BEGIN_FOR
    IF ( Enemy[i].typ > 0 ) THEN_DO CALL KillEnemy(i);
NEXT

With the version of C BASIC I'm forging ahead with, I have no plans to go any further than what you see above as a BASIC like FOR/NEXT loop in C.
« Last Edit: November 05, 2013, 02:58:03 AM by John »

Offline Charles Pegge

  • BASIC Developer
  • Posts: 69
Re: C BASIC
« Reply #111 on: November 05, 2013, 07:13:33 AM »
Am I right in thinking that Pelles is confined to Windows (and windows Mobile)? I would still be interested to know what kinds of error it generates from GCC-compliant source code.

Compared to the lax ways of Basic, I find GCC nit-picking enough :)

As well as strings, I'm also working on lexing and parsing units and who knows; may be the rest of OxygenBasic will follow. But these should stand on their own as detachable layers.

It's too early to make any posting to GIThub - there would be far too many revisions, but I can maintain a zip here, as a separate thread.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: C BASIC
« Reply #112 on: November 05, 2013, 10:06:15 AM »
It's too early to make any posting to GIThub - there would be far too many revisions, but I can maintain a zip here, as a separate thread.

I've done a total of 17 check-ins in the last 24hrs. Doing so makes it easy to go back to something if I need to.  It also allows one to see the evolution of the "product".

Even a single check-in a day (like at the end of your daily coding session) would be preferable to trying to keep track of which zip file is the most current in the forum.

But of course it's your call...

A.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: C BASIC
« Reply #113 on: November 05, 2013, 10:12:37 AM »
Thanks Charles for the update. At this early stage I would say working with us on Coud9 IDE so we can all benefit as you go would be great. It would also give you a 64 bit Linux to test on. The site is non-public and we aren't pushing anything to git from there. I would still like to schedule a time where we can all get together on chat and talk about issues and goals.


kryton9

  • Guest
Re: C BASIC
« Reply #114 on: November 05, 2013, 01:09:35 PM »
Just my opinion here, but what Charles has done in terms of look and feel in OxygenBASIC is the Language of the future. And all of this yet without a proper IDE and all it can bring.
It has clean syntax and lots power and very small footprint. Has a very nice Object Oriented Programming Syntax.

The problem, and again this is just my opinion, is that it should have been written in C++ to take advantage of all the power it has and bring things quicker into OxygenBASIC. Also this would allow other developers to join into the core development.

I think between all of us we could tap into what c++ offers without all the crappy syntax. I think if Charles is willing is to move OxyenBasic towards a foundation written in C++11.
OxygenBasic already has very powerful string capabilities, perhaps that could just be compiled to an obj file and just linked into the new c++?

Modern languages need:
Templating
Operator Overloading
Support for Advanced Data Structures and Algorithms

We just need to make it so much more elegant and pleasant than C++ makes it.

Also mingw supports c++11 pretty well, so we could all work in gcc/g++ on platform of choice and be up to date and Standards Compliant as much as possible as of today.

kryton9

  • Guest
Re: C BASIC
« Reply #115 on: November 05, 2013, 02:04:31 PM »
Quote
Mostly by James Fuller, where you at son?

I was wondering that myself. James is already a member of the All BASIC forum and I would of thought as soon as you mentioned the C++ BASIC direction you were taking, James would have been jumping on board and helping with your effort. I hope James still likes us.  :-*

Found him here:
http://forum.basicprogramming.org/index.php/topic,3103.0.html

kryton9

  • Guest
Re: C BASIC
« Reply #116 on: November 05, 2013, 02:06:19 PM »
Am I right in thinking that Pelles is confined to Windows (and windows Mobile)? I would still be interested to know what kinds of error it generates from GCC-compliant source code.

Compared to the lax ways of Basic, I find GCC nit-picking enough :)

As well as strings, I'm also working on lexing and parsing units and who knows; may be the rest of OxygenBasic will follow. But these should stand on their own as detachable layers.

It's too early to make any posting to GIThub - there would be far too many revisions, but I can maintain a zip here, as a separate thread.

It is limited platforms Charles, so I wouldn't bother. At least with GCC you can find help for any problem.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: C BASIC
« Reply #117 on: November 05, 2013, 03:34:02 PM »
Modern languages need:
Templating
Operator Overloading
Support for Advanced Data Structures and Algorithms

We just need to make it so much more elegant and pleasant than C++ makes it.

Sounds like you should take another look at Nimrod.

kryton9

  • Guest
Re: C BASIC
« Reply #118 on: November 05, 2013, 04:53:50 PM »
I agree Nimrod is really cool and takes the pressure off here. But I think this project if we can get some of the great developers out there to join in, I know we can come up with a game changer.
I know John has been trying for awhile to bring all the talent together, this project could be it.

I installed Manjaro Linux for the third time in a VirtualBox. The reason being, it would let me create a root account, but then it wouldn't let me use it at log in. So I thought, perhaps in my sleepy state I did something wrong-- so I tried it again, and still the same thing. Third time was the charm, normal user install, no root. Now to install the development environment on it. It is based on Arch Linux, so I should never have to install it again. It uses running updates.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: C BASIC
« Reply #119 on: November 05, 2013, 06:42:48 PM »
I think anyone willing to learn a new high level language should consider Nimrod.