basic in the new msx (Revival MSX Fora)MSX Resource Center PassionMSX MSX2 contest           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 128 gasten en 3 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Revival - basic in the new msx

Ga naar pagina ( Vorige pagina 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Volgende pagina )
Schrijver

basic in the new msx

AuroraMSX

msx master
Berichten: 1228
Geplaatst: 14 Juli 2005, 10:46   
Quote:

wolf_'s 'Advanced BASIC' exists already. It's called 'C'.


Hm. Actually, (standard, ANSII) C is a lot more limited than most BASIC dialects.
Most BASICs have a lot of features built in into the language definition. C has close to none; all features that make it possible to create an somewhat usable application, are packed into external libraries that are statically or dynamically linked to the application.

If you'd like to degrade BASIC to C's level, you'd need to take out everything except for the most basic control structures (if/else, while/do/until, for, switch/case, goto/break/ cont) and have everything else stuffed behind CMDs and CALLs


wolf_

msx legend
Berichten: 4658
Geplaatst: 14 Juli 2005, 10:47   
..and there we go again, Basic seems to be NOT allowed to expand *ever* ... hence one should jump over to Pascal or C..

Yes, let's keep Basic old and stupid then ... :S


ps. QBasic also has variable-structures .. that's not something purely made for C, you know ..
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 14 Juli 2005, 10:49   
Quote:

..and there we go again, Basic seems to be NOT allowed to expand *ever* ... hence one should jump over to Pascal or C...



That's why BASIC is called BASIC, y'know
wolf_

msx legend
Berichten: 4658
Geplaatst: 14 Juli 2005, 10:56   
C and Pascal also improved over the years.. got OOP and whatnot .. blasphemy!
Tanni
msx addict
Berichten: 302
Geplaatst: 14 Juli 2005, 15:19   
Quote:

..and there we go again, Basic seems to be NOT allowed to expand *ever* ... hence one should jump over to Pascal or C..



It is not a question of being allowed but of making sense. If there's something called BASIC, but looks almost like Pascal or some kind of other language, maybe with some minor rests of BASIC syntax and semantic, than it is some kind of false labelling!

Quote:

ps. QBasic also has variable-structures .. that's not something purely made for C, you know ..



As far as I know, correct me if I'm wrong, RECORDs where first introduced with Pascal besides an ingenious mechanism to construct complex data structures (lists, trees, etc., whatever you like) out of it. The idea was then also used in C, which lacks of it and many other as it was introduced. It was called ''struct'' there. This term is not very good, because a (complex) (data-)structure is that what you get if you combine record variables with pointers. Of course, arrays and records are sturctured data types as well.

That's the way C goes: Stealing good ideas and making the people believe to be a very good programmer as long as you just use C. The other way round is more correct: You at first must be a good programmer for succeed coding in C.

I don't know what you mean with ''variable-structures'' but Pascal has a RECORD variant called ''variant'' where you can select different components in different instances of the RECORD variable realized at the same place within the record. As far as I know, C lacks that kind of variant.

[D-Tail]

msx guru
Berichten: 2994
Geplaatst: 14 Juli 2005, 15:51   
Quote:

C and Pascal also improved over the years.. got OOP and whatnot .. blasphemy!

Dunno a heck about Pascal, but C has definately improved. The OOP part (mainly) caused the language called 'C' to advance into 'C++'

Wanna make BASIC++? Be my guest. This is a great start.
wolf_

msx legend
Berichten: 4658
Geplaatst: 14 Juli 2005, 15:55   
I meant a structure for variables, a TYPE in Qbasic. I esp. mentioned 'variables' to avoid any link with classes that can also have functions.

Quote:

than it is some kind of false labelling!


splendid! they can bill me..

seriously.. who carez? Ask Basic-programmers what they want, don't ask Pascal-programmers what they want Basic-programmers to do..

Besides, this:
Quote:

If there's something called BASIC, but looks almost like Pascal or some kind of other language, maybe with some minor rests of BASIC syntax and semantic


is like nearly everything is Pascal or C, and there's hardly anything left for Basic.

IF a=10 THEN PRINT"a=10"

I guess you don't have any problems with this being Basic?

and now this:

IF a=10 [THEN]
PRINT"a=10"
ENDIF

It's all Basic, the only thing that's 'new' is a slightly different programflow. But programflow is not really language-related.. because all languages have some sort of program-flow, mostly they all work the same.
Oh, if this all means that one needs to compile the whole, rather than on-the-fly interprete.. so be it.. I don't think anyone minds

I dunno if I should say the next thing: but I've the slight impression it's all about 'looking down' on Basic-programmers. In the early days one could argue that Basic-programmers made a crappy mess of their code (no wonder, with the Basics of back then!) which made pascal/C-programmers the superior coders naturally.. some sorta status. But when Basics get more cleaned-up and structured in terms of syntax, the horde of Basic-programmers might suddenly be a threat to the elitists in the 'better' languages. So what's a better solution than keeping the Basic-language stupid then?
But please tell me I'm wrong.

Find me an up2date/modern Basicprogrammers forum where they suggest oldstyle Basics, with line-numbers/limited program flow, etc. I'm not talking retro-ppl orso but a normal modern Basic-forum. Should all those ppl quit what they're doing and start using Pascal or C ?
Tanni
msx addict
Berichten: 302
Geplaatst: 14 Juli 2005, 16:55   
Quote:

I meant a structure for variables, a TYPE in Qbasic. I esp. mentioned 'variables' to avoid any link with classes that can also have functions.


I don't know QBASIC, but a TYPE never should be a structure for variables. Do you mean a data structure to store the BASIC variables or how complex varialbes like record variables are structured? Variables don't have functions!

Quote:

Quote:

than it is some kind of false labelling!


splendid! they can bill me..

seriously.. who carez? Ask Basic-programmers what they want, don't ask Pascal-programmers what they want Basic-programmers to do..


I started with BASIC on VZ200, I see myself as BASIC programmer as well, besides Pascal and a little MC! Many years ago, I thought the same way you do now: Every language can be upgraded, why not doing it to BASIC, too? I tried to answer this question in this thread. It seems that you didn't read it. Was I ever unfair to BASIC, eh? It has some advantages to have BASIC just the way it is on MSX!

Quote:

Besides, this:
Quote:

If there's something called BASIC, but looks almost like Pascal or some kind of other language, maybe with some minor rests of BASIC syntax and semantic


is like nearly everything is Pascal or C, and there's hardly anything left for Basic.

IF a=10 THEN PRINT"a=10"

I guess you don't have any problems with this being Basic?


Guessed right!

Quote:

and now this:

IF a=10 [THEN]
PRINT"a=10"
ENDIF

It's all Basic, the only thing that's 'new' is a slightly different programflow.


It's exactly the same program flow (better: control flow), it's just different syntax!

Quote:

But programflow is not really language-related..


Should be depending on the algorithm!

Quote:

because all languages have some sort of program-flow, mostly they all work the same.


You can't conclude that ''mostly all languages work the same'' form the fact that ''all languages have some sort of program-flow'', I think.

Quote:

Oh, if this all means that one needs to compile the whole, rather than on-the-fly interprete.. so be it.. I don't think anyone minds


Ok!

Quote:

I dunno if I should say the next thing: but I've the slight impression it's all about 'looking down' on Basic-programmers. In the early days one could argue that Basic-programmers made a crappy mess of their code (no wonder, with the Basics of back then!) which made pascal/C-programmers the superior coders naturally.. some sorta status. But when Basics get more cleaned-up and structured in terms of syntax, the horde of Basic-programmers might suddenly be a threat to the elitists in the 'better' languages. So what's a better solution than keeping the Basic-language stupid then?
But please tell me I'm wrong.


Most of the homecomputer fans in this forum are BASIC programmers as well! You also can have confusing code in other languages! If you accept the limitations of MSX-BASIC, as is -- besides others -- the slow execution time due to the interpreter, and therefore you only use BASIC if you have to code small to medium sized programs with no need of being fast, you can have very good structured code in BASIC as well.

Quote:

Find me an up2date/modern Basicprogrammers forum where they suggest oldstyle Basics, with line-numbers/limited program flow, etc. I'm not talking retro-ppl orso but a normal modern Basic-forum. Should all those ppl quit what they're doing and start using Pascal or C ?


It's the classic BASIC style which fascinates most, as was already mentioned by snout on July 7th, 13:19 in this thread.

These people are free to do what they like!
wolf_

msx legend
Berichten: 4658
Geplaatst: 14 Juli 2005, 17:22   
Quote:

I don't know QBASIC


Which Basics, newer than MSX-Basic, do you know anyway?

Quote:

but a TYPE never should be a structure for variables. Do you mean a data structure to store the BASIC variables or how complex varialbes like record variables are structured? Variables don't have functions!



TYPE is just the name here .. in Pascal it's Record, in C it's Struct, in C++ it's Struct or Class, in Blitzbasic it's Type again... all of them are structures for variables (and functions, in case of classes)

In QBasic it was: (iirc)
TYPE
field a!
field b$
field c#
END TYPE

and after assigning to a var you could access them with the '.'


Quote:

Every language can be upgraded, why not doing it to BASIC, too? I tried to answer this question in this thread.



Visual Basic, Darkbasic, Blitzbasic2d, Blitzbasic3d, Blitzplus, Blitzmax (OOP!) etc. etc. They managed to be an upgraded basic.. while still being Basic in some way .. at least appealing to Basicprogrammers.. So, can you summarize in a nutshell why these highly popular *and commercially used* languages are failures?


Quote:

You can't conclude that ''mostly all languages work the same'' form the fact that ''all languages have some sort of program-flow'', I think.



I didn't say that 'languages work the same', I said that programflow works ~ the same. Because as far as I know Pascal, C(++) and Basic have common ways to do the same things. (IF-ENDIF, SELECT-CASE-END SELECT, WHILE-WEND, DO-WHILE, FOR etc.)


Quote:

It's the classic BASIC style which fascinates most, as was already mentioned in that thread.
These people are free to do what they like!



And can you also list the disadvantages, rather than only the advantages?
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 14 Juli 2005, 17:57   
Quote:

I didn't say that 'languages work the same', I said that programflow works ~ the same. Because as far as I know Pascal, C(++) and Basic have common ways to do the same things. (IF-ENDIF, SELECT-CASE-END SELECT, WHILE-WEND, DO-WHILE, FOR etc.)



Because they're all procedural languages - one big happy familiy. Even the most popular OO languages of today - C++, C#, Java - are still procedural.

Want something completely different? Then you should move to e.g. the LISP (Lots-a Stupid Instant Parentheses) family; or functional languages like Clean, Haskell and Miranda; or PROLOG. But those languages are way less intuitive for people who just start to program.
Tanni
msx addict
Berichten: 302
Geplaatst: 14 Juli 2005, 18:31   
Quote:

Quote:

I don't know QBASIC


Which Basics, newer than MSX-Basic, do you know anyway?


Isn't MSX-BASIC the newest one? (Just a joke!) I admit, I don't know! In the mid of the 80th, I left BASIC because I got Turbo Pascal! It is as interactive as MSX-BASIC, much faster, more structured, you can code bigger programs ... And, unfortunatly, there's only limited time, so I can't keep on on many different things.

Quote:

TYPE is just the name here .. in Pascal it's Record, in C it's Struct, in C++ it's Struct or Class, in Blitzbasic it's Type again... all of them are structures for variables (and functions, in case of classes)

In QBasic it was: (iirc)
TYPE
field a!
field b$
field c#
END TYPE

and after assigning to a var you could access them with the '.'


Ok, TYPE is the keyword for a QBASIC record definition. A record (or TYPE, if you like) is a means for building structured variables consisting of other variables, and the dot is the selector.

Quote:


Quote:

Every language can be upgraded, why not doing it to BASIC, too? I tried to answer this question in this thread.



Visual Basic, Darkbasic, Blitzbasic2d, Blitzbasic3d, Blitzplus, Blitzmax (OOP!) etc. etc. They managed to be an upgraded basic.. while still being Basic in some way .. at least appealing to Basicprogrammers.. So, can you summarize in a nutshell why these highly popular *and commercially used* languages are failures?


Impressive list! DarkBASIC sounds interesting.

But ''while still being BASIC in some way'' is the problem! There're obviously more than one way or the ways aren't clearly spezified. I never claimed that they're a failure! It'll be difficult to just be expert in at least a few of them. There's too much dialectal variation. This causes costs if a company needs to train people in the dialect they want to use. And it'll cause costs if all of the code must be migrated to another version of BASIC (or another language) some day!

Quote:


Quote:

You can't conclude that ''mostly all languages work the same'' form the fact that ''all languages have some sort of program-flow'', I think.


I didn't say that 'languages work the same', I said that programflow works ~ the same. Because as far as I know Pascal, C(++) and Basic have common ways to do the same things. (IF-ENDIF, SELECT-CASE-END SELECT, WHILE-WEND, DO-WHILE, FOR etc.)



Shortened it a bit! Does mean the same, I hope! Pascal has CASE and C has SELECT statement. It seems to be the same, but after a closer look, you'll recognice, that it isn't the same. They are implemented a different way. The pascalian way is syntactically more flexible, the C way results in a faster code, but imposes some restrictions. DO-WHILE doesn't exist in Pascal, even so UNTIL doesn't exist in C. FOR loop exists in all of the three languages, but syntax and semantic differ dramatically, at least in C, from the others. Even in one and the same language, e.g. Pascal, e.g. parameter passing mechanism may vary due to the different processors the language is implemented for. (Not to be confused with the call by value and call by name parameter passing methods implemented in Pascal.) This should not affect the execution results, but will very likely do affect future improvements to this particular language implementation. And there are some languages with very different control flow, e.g. Lisp or Scheme. There's no FOR, no WHILE, no DO-WHILE, no UNTIL, 'caus these things are considered as syntactical suggar just causing semicolon caries. In Scheme, there's no need for semicolon like in Pascal or colon like in BASIC. The whole Scheme program is just a nested function call. The Scheme ''orthography'' is very easy, you can learn it in about a few minutes. In BASIC, also an experienced programmer must consult the manual sometimes. In these languages, loops are typically implemented by recursion. Recursion is available in Pascal, too, but not in classical BASIC. In Forth, many things are different, too. Your argumentation may be valid for a certain class of programming languages, the imperative language (I don't know the exact english term.), but not for all classes of programming languages.

Quote:


Quote:

It's the classic BASIC style which fascinates most, as was already mentioned in that thread.
These people are free to do what they like!



And can you also list the disadvantages, rather than only the advantages?


Lack of recursion, e.g.! Maybe available in modern BASICS, but then, they aren't basic -- and
probably BASIC -- anymore.
wolf_

msx legend
Berichten: 4658
Geplaatst: 14 Juli 2005, 18:50   
Quote:

Lack of recursion, e.g.! Maybe available in modern BASICS, but then, they aren't basic -- and
probably BASIC -- anymore.



You're really persistant in NOT mentioning the means to create a mass-chaos regarding structure and reusability eh
I won't even remotely *think* about progamming Polka in MSX-Basic even if I have a 1ghz MSX with the fastest videochip at my disposal !

My solution is not: "use Pascal or C", my solution is: "improve Basic, and ignore what BASIC-purists will say about that". Ofcourse I speak for myself, but I doubt someone is happy with the old unstructured MSX-Basic when he tries to make bigger apps.

It would be nice to see a frontpage poll about that btw.. what should a new compiled MSX-Basic for the 1cm look like:
- Exactly like MSX-Basic with only some newly added commands for audio/video, but the same programflow/style, linenumbers etc.
- Like QBasic (PC), a full procedural language that looks like MSX-Basic a lot
- Like modern Basics (Blitz, Dark etc.) which are Basic/C hybrids and sometimes event-based! They are easy accessable for Basic-users, but they might have to learn a handful new commands.. tho I (as composer even) can confirm that it's piece o' cake to learn.
Tanni
msx addict
Berichten: 302
Geplaatst: 14 Juli 2005, 18:51   
Quote:

Quote:

I didn't say that 'languages work the same', I said that programflow works ~ the same. Because as far as I know Pascal, C(++) and Basic have common ways to do the same things. (IF-ENDIF, SELECT-CASE-END SELECT, WHILE-WEND, DO-WHILE, FOR etc.)



Because they're all procedural languages - one big happy familiy. Even the most popular OO languages of today - C++, C#, Java - are still procedural.

Want something completely different? Then you should move to e.g. the LISP (Lots-a Stupid Instant Parentheses) family; or functional languages like Clean, Haskell and Miranda; or PROLOG. But those languages are way less intuitive for people who just start to program.



They are probably less intuitive for people starting with it after having already learnt a procedural language. In some sense, they are at a much higher level than procedural languages.
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 15 Juli 2005, 09:51   
Quote:

DO-WHILE doesn't exist in Pascal, even so UNTIL doesn't exist in C.



#define until(x) while(!(x)) 
#define hell 1
#define frozen 0

int main() {
  do {
    ...anything useful...
  } until(hell == frozen);
}


There ya go

Tanni
msx addict
Berichten: 302
Geplaatst: 15 Juli 2005, 11:19   
Quote:

Quote:

DO-WHILE doesn't exist in Pascal, even so UNTIL doesn't exist in C.



#define until(x) while(!(x)) 
#define hell 1
#define frozen 0

int main() {
  do {
    ...anything useful...
  } until(hell == frozen);
}


There ya go



Yes, in C you always can do such things. But this source must be preprocessed before compiled, if it would be given to the compiler without preprocessing, the compiler would complain. So it's not really C! The preprocessor is, as for as I know, an important but no integral part of C.

You also can have Pascal's REPEAT UNTIL-loop behaving like C's DO WHILE-loop by just inverting the expression after the UNTIL keyword. For C, they wanted to have as few keywords as possible, even if it forces the programmer to think in an unusual way. To my mind, this cannot be the right way. A language should't force the programmer to think in an unusual way, this causes avoidable errors, especially to beginners! So C is a language you wast to much precious time to unnecessary debugging. The parameter passing is odd to, just call by value and with a very cumbersomely syntax. (Maybe they changed it in ANSI C, but then, that would be incompatible to former C definitions.)

As you state by yourself

Quote:


Quote:
wolf_'s 'Advanced BASIC' exists already. It's called 'C'.

Hm. Actually, (standard, ANSII) C is a lot more limited than most BASIC dialects.
Most BASICs have a lot of features built in into the language definition. C has close to none; all features that make it possible to create an somewhat usable application, are packed into external libraries that are statically or dynamically linked to the application.

If you'd like to degrade BASIC to C's level, you'd need to take out everything except for the most basic control structures (if/else, while/do/until, for, switch/case, goto/break/ cont) and have everything else stuffed behind CMDs and CALLs



actually (standard,ANSII) C is a more limited than most BASIC dialects. This even holds to Pascal dialects, I think. C was designed to be just a frame for easy portability. That's why you must have lots of libraries to include even the most common stuff! C uses the preprocessor to get much of the convenience other languages have. But, to my mind, thats only a trick, 'cause for really porting a language to another system, it doesn't suffice to just port the kernal of the language, but also the libraries, even if they're written in the language and just need to be compiled. But that is not true, because there must be changes in the libraries to accommodate to the new system.



 
Ga naar pagina ( Vorige pagina 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Volgende pagina )
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.