What can C do and Basic V2 not?

R

Ralf Dieholt

I still don´t get it - what is the advantage of C ?

I can program anything in BASIC V2 on a C64, does C have any
advantages over BASIC V2 ?

Seems to be more cryptic than BASIC to me.
 
P

Peter Pichler

Ralf Dieholt said:
I still don´t get it - what is the advantage of C ?

Portability, efficiency, readability, in that order.
I can program anything in BASIC V2 on a C64, does C have any
advantages over BASIC V2 ?
Yes.

Seems to be more cryptic than BASIC to me.

Then use BASIC if you wish. Or learn C. Every new language looks more
cryptic than the one you already know. This applies to natural just as well
as programming languages.
 
K

Kurt Watzka

Ralf said:
I still don?t get it - what is the advantage of C ?

I can program anything in BASIC V2 on a C64, does C have any
advantages over BASIC V2 ?

Seems to be more cryptic than BASIC to me.

Please don't feed this troll.

Kurt Watzka
 
R

Richard Heathfield

Ralf said:
I still don't get it - what is the advantage of C ?

It's crunchy, courteous, and corrugated.
I can program anything in BASIC V2 on a C64,
Fabulous!

does C have any
advantages over BASIC V2 ?

No. There are some programs you can't write in C (such as, for example, a
program that can detect, for any input program, whether that program
halts). Since you can program anything in BASIC V2, I guess you have the
edge.
Seems to be more cryptic than BASIC to me.

Yeah, it's to keep the cabal happy. Don't tell anyone.
 
M

Malcolm

Ralf Dieholt said:
I still don´t get it - what is the advantage of C ?
It is efficient and it is expressive.
I can program anything in BASIC V2 on a C64, does C have any
advantages over BASIC V2 ?
All major programming languages are Turing equivalent, which means that
given enough memory you can emulate any with any other. It follows that you
can write a C interpreter in BASIC. However you will find a BASIC
interpreter in C runs faster and is easier to code.
Seems to be more cryptic than BASIC to me.
This is a very valid criticism. BASIC is designed to allow people who are
not full-time programmers to do some programming, and it is very good at
that job. C is designed with professionals in mind, and operations such as
indirection are very concise, because a professional computer programmer can
be presumed to understand them.
 
M

Mark McIntyre

I still don´t get it - what is the advantage of C ?

Thats like asking whats the advantage of a truck, when you already have a
mini.
I can program anything in BASIC V2 on a C64,

what, /everything/ ?
A relational database capable of storing 4GB of data?
A settlement system for government bonds?
A real-life-speed jumbo-jet-sized 3d flight simulator?

Its probable that you can program many many things in Basic, but not all of
them efficiently, and not all of them well. This is true of most languages.
C for example is not good for object oriented programming, compared to C++.
does C have any advantages over BASIC V2 ?

Will your Basic V2 work on a Vax, PC or Sparc? I suspect not.
Your (ISO compliant) C will work on all three, plus many more.

There are many other reasons, but really, its an exercise for hte reader to
work out why language Z is more useful than language Q for some things.
Seems to be more cryptic than BASIC to me.

Basic is a high level language, C is a lower level one.
 
S

Stephen Mayes

Mark McIntyre said:
On 22 Feb 2004 03:28:56 -0800, in comp.lang.c , (e-mail address removed) (Ralf
Dieholt) wrote:

Will your Basic V2 work on a Vax, PC or Sparc? I suspect not.
Your (ISO compliant) C will work on all three, plus many more.

I am not a professional and don't know much, but I am curious.
I assume this is only because there have been C compilers written for these
and the "many more."
When a chip company designs a new processor, is a C compiler usually
provided for programmers by the company? What about other languages? Who
is "normally" responsible for these things?
 
A

August Derleth

Stephen said:
I am not a professional and don't know much, but I am curious.
Good.

I assume this is only because there have been C compilers written for these
and the "many more."

Halfway true. The other half is that the ISO standard exists to
guarantee the behavior of C programs compiled with a conformant compiler
/regardless/ of what machine the program is compiled on or for. This
standard dictates a certain group of behaviors programmers can rely
upon, whether they are writing new programs or compiling a pre-written
program for a new machine.
When a chip company designs a new processor, is a C compiler usually
provided for programmers by the company? What about other languages? Who
is "normally" responsible for these things?

The chipmaker might design a compiler for their chips, as Intel has, but
they don't always. The group "normally" responsible for these things is
whoever wants a C compiler for that machine.

The GNU Project has done a good job of porting their gcc (GNU Compiler
Collection) compiler suite to different architectures, and as the gcc
suite can act as a conformant C compiler (up to the C89 standard, I
believe), any machine for which a version of gcc exists has a conformant
C compiler.

In any case, it isn't difficult to create a compiler for a new machine
if you already have a compiler for an existing machine you can examine
the source code of. Especially if that compiler has a modular design, as
gcc does, with a language-specific front-end (which emits RTL (Register
Transfer Language)) and a machine-specific backend (which emits assembly
language). Then the problem is reduced to writing a backend.
 
M

Mark McIntyre

I am not a professional and don't know much, but I am curious.
I assume this is only because there have been C compilers written for these
and the "many more."

Partly. Its because C is governed by an ISO standard, and that core of C is
guaranteed to work on all platforms for which a C compiler exists. On the
other hand I've yet to find a variant of basic that worked on any other
platform without massive alterations, and I suspect that "Basic V2" is the
same.
When a chip company designs a new processor, is a C compiler usually
provided for programmers by the company?

Thats entirely up to them,
What about other languages?
ditto

Who is "normally" responsible for these things?

whoever believes there's a commercial need for the language tools, or in
some cases whoever wants one.
 
M

Malcolm

Stephen Mayes said:
When a chip company designs a new processor, is a C compiler
usually provided for programmers by the company? What about
other languages? Who is "normally" responsible for these things?
C is such a widely-used language that often chips are designed so that C
compilers are easy to optimise. Generally a chip manufacturer will provide a
C compiler to kick-start the chip, show how it can be done, and because C is
relatively easy to implement. Other languages will usually be provided by
specialists in that language, if there is a demand for them. However these
aren't hard and fast rules. If the chip is used in a general-purpose
computer, for example, the chip company won't usually be interested in
providing libraries for the operating system, and a company that provides
development systems will often implement a compiler whilst they are at it.
 
D

Dan Pop

In said:
I still don´t get it - what is the advantage of C ?

I can program anything in BASIC V2 on a C64, does C have any
advantages over BASIC V2 ?

Write an Unix-like operating system in BASIC V2 and you might get an idea.
Don't come back until finishing the project!

Dan
 
S

Sebastian Spandauer

Write an Unix-like operating system in BASIC V2 and you might get an idea.

where is the problem ...

10 print "This is UNIX"
20 goto 10

UNIX-like, isn't it?

Greets
S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top