Just a question.....

Cordula's Web cpghost at cordula.ws
Thu Dec 18 06:23:12 PST 2003


soultrax at verizon.net wrote:
> What programming languages do you use for interacting with 
> freebsd( the kernel,ports)? 

FreeBSD and most other third-party applications are written in C.
You can also program in other languages if you like: just have
a look at the huge collection of compilers and interpreters in
/usr/ports/lang

> Where can i get more information on how make programs for 
> freebsd? 

The easiest way to learn how to program, is to look at existing
source code. FreeBSD itself (kernel and the base system, minus
the ports) comes with full source code under /usr/src. When you
install a port, the source code for that port (the tar ball) is
stored in /usr/ports/distfiles, so you can have a look too.

Unless you plan to write kernel modules, programming for FreeBSD
is the same as programming for other Unices, e.g. Linux. Actually,
most open source programs written for Linux also can be (and are)
compiled under FreeBSD. The reason for this lies in the Unix C
library (and other libraries), which provides a fairly standard
interface to the kernel.

> I plan on going to college to study computer science but i 
> dont want to waste my time studying programming languages 
> like visual basic, even though it wouldnt hurt. I want you 
> to guide me so i wont make a mistake.  i know ms software 
> dictates most things in the market because of their business 
> practices but i dont want to get stuck with it.  Freebsd is 
> my choice and i want it to be a meaningfull choice in my 
> future career.   

Most popular programming languages are C, C++, Java, and Perl.
If you learn one of them (and I'd suggest that you concentrate
on C), it is fairly easy to learn the others. VB is not that
good, because it is restricted to the MS platform (and it is
a _terrible_ language). A portable C, C++, Java and Perl program
would run on nearly any platform.

FreeBSD comes with gcc, which can compile C and C++ code. Perl
and Java can be added by installing the appropriate ports in
/usr/ports/lang. As an example, you may want to start with the
canonical simple hello-world program below, and build more
complex programs on top of that:

/* File: hello.c */

#include <stdio.h>

int
main (int argc, char *argv[])
{
	printf ("Hello World!\n");
	return 0;
}

-------------------------------------
Compile with:

$ cc -o hello hello.c

Run:

$ ./hello
Hello World!

> Thats all i ask for now.  with your help in two to four 
> years from now ( or less if possible) you`ll hear from me 
> with what i can provide to you or the freebsd community. 
>  

Have fun and happy hacking!

> Regards,  
> Luis Sime 

-- 
Cordula's Web. http://www.cordula.ws/



More information about the freebsd-questions mailing list