RE: C interpreter

  • From: "DaShiell, Jude T. CIV NAVAIR 1490, 1, 26" <jude.dashiell@xxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 23 Jul 2010 09:24:48 -0400

That's right, a square of a number results when the number is multiplied by 
itself.  

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Øyvind Lode
Sent: Friday, July 23, 2010 9:12
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: C interpreter

Hi:

I just installed Ch and wrote a simple program.
And Ch interpreted it nicely.
I just did:

$ ch count.c

From my Cygwin shell and it ran my code nicely.
Yeah I compiled it the regular way as well and GCC did not complain either.

Code pasted below.
Please free free to comment my code <smile>
It's a very simple program but I guess I could write even more compact code.
I know while and do-while loops so that's not necessary to mention.
As you can see I chose a for loop in my program.

Code:

/* count.c
  * This program is supposed to count from 1 to 12.
  * And print the count and it's square for each count.
  * I'm not quite sure what is meant with "square",
  * but I'll multiply the count with itself and call it it's square.
  * Does that make sense?
  * If not, please tell me what's meant by "square".
*/

#include <stdio.h>

int main()
{
  int count, square;
  
  for (count = 1; count < 13; count++)
  {
    square = count * count;
    printf ("Count = %i and it's square = %i\n", count, square);
  }
  return 0;
}

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of DaShiell, Jude
T. CIV NAVAIR 1490, 1, 26
Sent: 23. juli 2010 13:27
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: C interpreter
Importance: Low

I'd add to that list:
Learn to write makefiles,
Learn to write Configure scripts,
Learn to write project files.
All of these when written well make installation of packages by others on
other systems easier.
Of course over-arching all of this is knowledge of how to use a revision
control system and using it for the project.  Makes stealing working code
from older versions so much easier.


-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Kerneels Roos
Sent: Friday, July 23, 2010 3:27
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: C interpreter

Hi. I can not imagine learning something like C by using an interpreter
similar to the Python interpretor for example. With Python it makes some
sense since Python has list comprehensions like:
[x for x in range(10) if x % 2 == 0]

which will produce a list of even numbers, and things like array / list
slices and even regular expressions.

To test these things  on the fly an interpreter makes sense, or even small
functions which you can just copy and paste into the interpreter and then
test them out there.

With C however the playing field is far less esoteric (to my knowledge). The
important concepts that an imperative language like C contributed to the
world of programming languages are, and hence what you want to learn from
studying C are things like:
variables and constatns
arrays
structs
the concept of functions
conditional statements
loop constructs
pointers
bit wise operations
input and output

To me it makes much more sense to make use of code files and a compile, run,
debug cycle to learn how al those work. Especially if one is learning to
program for the first time.

Some of those concepts require a bit of setup code first, so would one have
to type that into the interpreter then first every time?

I would advise you to stick to files and compiling and running your code --
that's how C works. Also, with an interpreter you can get way different
errors than with a compiler. At the end of the day your goal is to use a
compiler, why not start with that from square one?

Hope this helps.



On Thu, Jul 22, 2010 at 7:27 PM, Øyvind Lode <oyvind.lode@xxxxxxxxx> wrote:


        Ch is both a C and C++ interpreter apparently.
        I'll download it and have a look.
        

        -----Original Message-----
        From: programmingblind-bounce@xxxxxxxxxxxxx
        
        [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Arthur
Pirika
        Sent: 22. juli 2010 18:29
        To: programmingblind@xxxxxxxxxxxxx
        
        Subject: Re: C interpreter
        
        I've been meaning to try that, also. I've heard it's good though,
and
        wouldn't mind a c++ interpreter, if such a thing even exists? lol.
        
        Arthur
        ----- Original Message -----
        From: "Øyvind Lode" <oyvind.lode@xxxxxxxxx>
        To: <programmingblind@xxxxxxxxxxxxx>
        Sent: Friday, July 23, 2010 3:56 AM
        Subject: C interpreter
        
        
        > Hi all:
        >
        > Does someone know a good C interpreter?
        > I'm trying to learn C and I would like a C interpreter to assist
me.
        > It would be much faster to type some C statements in the
interpreter and
        > get
        > the output instantly...
        >
        > I know it is very important to also learn to know your compiler,
but for
        > fast testing of code I think an interpreter is useful.
        > I found one called Ch interpreter.
        > Have someone here used Ch?
        >
        > __________
        > View the list's information and change your settings at
        > //www.freelists.org/list/programmingblind
        >
        >
        
        __________
        View the list's information and change your settings at
        //www.freelists.org/list/programmingblind
        
        
        __________
        View the list's information and change your settings at
        //www.freelists.org/list/programmingblind
        
        




-- 
Kerneels Roos
Cell/SMS: +27 (0)82 309 1998
Skype: cornelis.roos





__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: