Re: programming in linux
- From: Dances With Crows <danSPANceswitTRAPhcrows@xxxxxxxxx>
- Date: Thu, 16 Mar 2006 13:42:59 -0600
On Thu, 16 Mar 2006 13:11:13 -0500, J. Clarke staggered into the Black
Sun and said:
stewart_bristol@xxxxxxxxxxxxx wrote:
I used to do a fair amount of C programming on Unix/Linux. Over theOn the C side, you may find C++ to be a bit more friendly to get
last few years, I have ditched it all for IDL which is a
scientific/matrix/visualisation language (at 2.5k for a license). I
would like to do some spare time programming on linux without the
proprietary software and would like some advice as to what is the
easiest/best thing to get started on.
started with without sacrificing any capability.
YMMV on this, but I found C a lot less complicated than its ++ variant.
Objects are not a cure-all, and too many C++ tutorials cram objects down
their readers' throats before making sure they know how to do stuff
without them. Also, stewart_bristol has programmed in C before, so he
isn't flying blind.
stewart_bristol, if you don't have a decent book on C (or C++, or
whatever) then it'd be an excellent idea to get one.
but after looking at a C tutorial, I can see why I find IDL so much
easier (especially input/output). I want to start simple, with
reading/writing files and some number crunching, but eventually move
on and read the ports.
File I/O in C under Unix-like OSes is simple. fopen(), fgets(),
fread(), fprintf(), fwrite(), fseek(), fclose(). The place where C
falls down is that it doesn't have nice regular expression parsing
functions ~= Perl, but there's always libpcre. (If your needs include
parsing a lot of text data, you may find that it's easier and faster to
write in Perl than in C, but you'll probably have to find that out for
yourself.)
EXPN "read the ports"? If you meant "use ioperm() or iopl() to request
access to a port range, then use inb() and outb() to read and write I/O
ports on the x86", that can get tricky rather quickly from userspace.
Especially if you have precise timing requirements. If you meant "read
data from a device file", that's a bit easier, since then the kernel
handles the I/O port reading for you. Of course, then you have to read
up on all the ioctl()s you can do to your specific device file and use
them properly.
Might also want to take a look at APL. Sharp APL is free for personal
use and Dyalog, although they don't say so clearly on their Web site,
The APL that had all the Greek letters in it? I hope they've modernized
it a bit--that old thing was much more unfriendly than a modern C is.
Oh well, HTH,
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
.
- References:
- programming in linux
- From: stewart_bristol
- Re: programming in linux
- From: J. Clarke
- programming in linux
- Prev by Date: Re: redirect stderr passes as parameter
- Next by Date: Re: programming in linux
- Previous by thread: Re: programming in linux
- Next by thread: Re: programming in linux
- Index(es):
Relevant Pages
|