docs/100812: [UPDATE] zh_TW: Update developers-handbook/tools to SVN#900 !
chinsan
chinsan.tw at gmail.com
Tue Jul 25 17:10:17 UTC 2006
>Number: 100812
>Category: docs
>Synopsis: [UPDATE] zh_TW: Update developers-handbook/tools to SVN#900 !
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Jul 25 17:10:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: chinsan
>Release: FreeBSD 6.1-STABLE i386
>Organization:
FreeBSD Taiwan
>Environment:
System: FreeBSD chinsan2.twbbs.org 6.1-STABLE FreeBSD 6.1-STABLE #1: Fri Jun 2 16:44:35 CST 2006 root at chinsan2.twbbs.org:/usr/obj/usr/src/sys/GENERIC i386
>Description:
- Update developers-handbook/tools to SVN#900 !
patch URL http://chinsan2.twbbs.org/chinsan/zh_TW.Big5.20060725.developers-handbook3.diff
- ChangeLog(Trac Timeline)
https://opensvn.csie.org/traccgi/freebsddoc/timeline
- Original translator: kevinblue
Revised by chinsan
>How-To-Repeat:
>Fix:
--- zh_TW.Big5.20060725.developers-handbook3.diff begins here ---
--- zh_TW.Big5/books/developers-handbook.orig/tools/chapter.sgml Wed Jul 26 00:52:45 2006
+++ zh_TW.Big5/books/developers-handbook/tools/chapter.sgml Wed Jul 26 00:53:23 2006
@@ -1,7 +1,8 @@
<!--
The FreeBSD Documentation Project
- $FreeBSD: doc/zh_TW.Big5/books/developers-handbook/tools/chapter.sgml,v 1.1 2006/06/17 10:22:44 vanilla Exp $
+ $FreeBSD$
+ Original revision: 1.46
-->
<chapter id="tools">
@@ -19,127 +20,111 @@
</authorgroup>
</chapterinfo>
- <title>Programming Tools</title>
- <sect1 id="tools-synopsis"><title>Synopsis</title>
+ <title>µ{¦¡¶}µo¤u¨ã</title>
+ <sect1 id="tools-synopsis"><title>·§±Ô</title>
- <para>This chapter is an introduction to using some of the
- programming tools supplied with FreeBSD, although much of it
- will be applicable to many other versions of &unix;. It does
- <emphasis>not</emphasis> attempt to describe coding in any
- detail. Most of the chapter assumes little or no previous
- programming knowledge, although it is hoped that most
- programmers will find something of value in it.</para>
+ <para>
+ ¥»³¹±N¤¶²Ð¦p¦ó¨Ï¥Î¤@¨Ç FreeBSD ©Ò´£¨Ñªºµ{¦¡¶}µo¤u¨ã(programing tools)¡A
+ ¥»³¹©Ò¤¶²Ðªº¤u¨ãµ{¦¡¦b¨ä¥Lª©¥»ªº &unix; ¤W¤]¥i¨Ï¥Î¡A
+ ¦b¦¹ <emphasis>¨Ã¤£·|</emphasis> ¹Á¸Õ´yz¼gµ{¦¡®Éªº¨CÓ²Ó¸`¡A
+ ¥»³¹¤j³¡¤À½g´T³£¬O°²³]§A¥H«e¨S¦³©Î¥u¦³¤Ö¼Æªº¼gµ{¦¡¸gÅç¡A
+ ¤£¹L¡AÁÙ¬O§Æ±æ¤j¦h¼Æªºµ{¦¡¶}µo¤Hû³£¯à±q¤¤«·s±o¨ì¤@¨Ç±Òµo¡C
+ </para>
</sect1>
- <sect1 id="tools-intro"><title>Introduction</title>
+ <sect1 id="tools-intro"><title>²¤¶</title>
- <para>FreeBSD offers an excellent development environment.
- Compilers for C, C++, and Fortran and an assembler come with the
- basic system, not to mention a Perl interpreter and classic &unix;
- tools such as <command>sed</command> and <command>awk</command>.
- If that is not enough, there are many more compilers and
- interpreters in the Ports collection. FreeBSD is very
- compatible with standards such as <acronym>&posix;</acronym> and
- <acronym>ANSI</acronym> C, as well with its own BSD heritage, so
- it is possible to write applications that will compile and run
- with little or no modification on a wide range of
- platforms.</para>
-
- <para>However, all this power can be rather overwhelming at first
- if you have never written programs on a &unix; platform before.
- This document aims to help you get up and running, without
- getting too deeply into more advanced topics. The intention is
- that this document should give you enough of the basics to be
- able to make some sense of the documentation.</para>
-
- <para>Most of the document requires little or no knowledge of
- programming, although it does assume a basic competence with
- using &unix; and a willingness to learn!</para>
+ <para>
+ FreeBSD ´£¨Ñ¤@Ó«D±`´Îªº¶}µoÀô¹Ò¡A
+ ¤ñ¦p»¡¹³¬O C¡BC++¡BFortran ©M assembler(²Õ¦X»y¨¥)ªº½sĶ¾¹(compiler),
+ ¦b FreeBSD ¤¤³£¤w¸g¥]§t¦b°ò¥»ªº¨t²Î¤¤¤F
+ §ó§O´£ Perl ©M¨ä¥L¼Ð·Ç &unix; ¤u¨ã¡A¹³¬O<command>sed</command> ¥H¤Î <command>awk</command>¡A
+ ¦pªG§AÁÙ¬Oı±o¤£°÷¡AFreeBSD¦b Ports collection ¤¤ÁÙ´£¨Ñ¨ä¥Lªº½sĶ¾¹©Mª½Ä¶¾¹(interpreter),
+ FreeBSD ¬Û®e³\¦h¼Ð·Ç¡A¹³¬O <acronym>&posix;</acronym> ©M <acronym>ANSI</acronym> C¡A
+ ·íµMÁÙ¦³¥¦©ÒÄ~©Óªº BSD ¶Ç²Î¡C
+ ©Ò¥H¦b FreeBSD ¤W¼gªºµ{¦¡¤£»Ýקï©Î³»¦hµy·Lקï¡A´N¥i¥H¦b³\¦h¥¥x¤W½sĶ¡B°õ¦æ¡C
+ </para>
+
+ <para>
+ µL½×¦p¦ó¡A´Nºâ§A±q¨Ó¨S¦b &unix; ¥¥x¤W¼g¹Lµ{¦¡¡A¤]¥i¥H¹ý©³·P¨ü¨ìFreeBSD ¥O¤HµLªk§Ü©Úªº°g¤HÅ]¤O¡C
+ ¥»³¹ªº¥Ø¼Ð´N¬O¨ó§U§A§Ö³t¤W¤â¡A¦Ó¼È®É¤£»Ý²`¤J¤Ó¦h¶i¶¥¥DÃD¡A
+ ¨Ã¥BÁ¿¸Ñ¤@¨Ç°ò¦·§©À¡A¥HÅý§A¥i¥HÁA¸Ñ§Ú̦bÁ¿¨Ç¤°»ò¡C
+ </para>
+
+ <para>
+ ¥»³¹¤º®e¨Ã¤£n¨D§A±o¦³µ{¦¡¶}µo¸gÅç¡A©ÎªÌ§A¥u¦³¤@ÂIÂIªº¸gÅç¦Ó¤w¡C
+ ¤£¹L¡A§ÚÌ°²³]§A¤w¸g·| &unix; ¨t²Îªº°ò¥»¾Þ§@¡A
+ ¦Ó¥B§ó«nªº¬O¡A½Ð«O«ù¼Ö©ó¾Ç²ßªº¤ßºA¡I
+ </para>
</sect1>
<sect1 id="tools-programming">
- <title>Introduction to Programming</title>
+ <title>Programming ·§©À</title>
- <para>A program is a set of instructions that tell the computer to
- do various things; sometimes the instruction it has to perform
- depends on what happened when it performed a previous
- instruction. This section gives an overview of the two main
- ways in which you can give these instructions, or
- <quote>commands</quote> as they are usually called. One way
- uses an <firstterm>interpreter</firstterm>, the other a
- <firstterm>compiler</firstterm>. As human languages are too
- difficult for a computer to understand in an unambiguous way,
- commands are usually written in one or other languages specially
- designed for the purpose.</para>
+ <para>
+ ²³æªº»¡¡Aµ{¦¡¥u¬O¤@°ï«ü¥Oªº¶°¦XÅé¡F¦Ó³o¨Ç«ü¥O¬O¥Î¨Ó§i¶D¹q¸£À³¸Ón§@¨º¨Ç¨Æ±¡¡C
+ ¦³®ÉÔ¡A«ü¥Oªº°õ¦æ¨ú¨M©ó«e¤@Ó«ü¥Oªºµ²ªG¦Ó©w¡C
+ ¥»³¹±N·|§i¶D§A¦³ 2 Ó¥Dnªº¤èªk¡AÅý§A¥i¥H¹ï¹q¸£¤U¹F³o¨Ç«ü¥Ü(instruction) ©Î <quote>©R¥O(commands)</quote>¡C
+ ²Ä¤@Ó¤èªk´N¬O <firstterm>ª½Ä¶¾¹(interpreter)</firstterm>¡A
+ ¦Ó²Ä¤GÓ¤èªk¬O <firstterm>½sĶ¾¹(compiler)</firstterm>¡C
+ ¥Ñ©ó¹ï©ó¹q¸£¦Ó¨¥¡A¤HÃþ»y¨¥ªº»y·N¹L©ó¼Ò½k¦Ó¤ÓÃø²z¸Ñ¡A
+ ¦]¦¹©R¥O(commands)´N±`·|¥H¤@ºØ(©Î¦hºØ)µ{¦¡»y¨¥¼g¦¨¡A¥Î¨Ó«ü¥Ü¹q¸£©Òn°õ¦æªº¯S©w°Ê§@¬°¦ó¡C
+ </para>
<sect2>
- <title>Interpreters</title>
+ <title>ª½Ä¶¾¹</title>
- <para>With an interpreter, the language comes as an environment,
- where you type in commands at a prompt and the environment
- executes them for you. For more complicated programs, you can
- type the commands into a file and get the interpreter to load
- the file and execute the commands in it. If anything goes
- wrong, many interpreters will drop you into a debugger to help
- you track down the problem.</para>
-
- <para>The advantage of this is that you can see the results of
- your commands immediately, and mistakes can be corrected
- readily. The biggest disadvantage comes when you want to
- share your programs with someone. They must have the same
- interpreter, or you must have some way of giving it to them,
- and they need to understand how to use it. Also users may not
- appreciate being thrown into a debugger if they press the
- wrong key! From a performance point of view, interpreters can
- use up a lot of memory, and generally do not generate code as
- efficiently as compilers.</para>
-
- <para>In my opinion, interpreted languages are the best way to
- start if you have not done any programming before. This kind
- of environment is typically found with languages like Lisp,
- Smalltalk, Perl and Basic. It could also be argued that the
- &unix; shell (<command>sh</command>, <command>csh</command>) is itself an
- interpreter, and many people do in fact write shell
- <quote>scripts</quote> to help with various
- <quote>housekeeping</quote> tasks on their machine. Indeed, part
- of the original &unix; philosophy was to provide lots of small
- utility programs that could be linked together in shell
- scripts to perform useful tasks.</para>
+ <para>
+ ¨Ï¥Îª½Ä¶¾¹®É¡A©Ò¨Ï¥Îªºµ{¦¡»y¨¥´N¹³Åܦ¨¤@Ó·|©M§A¤¬°ÊªºÀô¹Ò¡C
+ ·í¦b©R¥O´£¥Ü¦C¤W¥´¤W©R¥O®É¡Aª½Ä¶¾¹·|§Y®É°õ¦æ¸Ó©R¥O¡C
+ ¦b¤ñ¸û½ÆÂøªºµ{¦¡¤¤¡A¥i¥H§â©Ò¦³·Q¤U¹Fªº©R¥O²Î²Î¿é¤J¨ì¬YÀɮ׸̱¥h¡A
+ µM«á©I¥sª½Ä¶¾¹¥hŪ¨ú¸ÓÀɮסA¨Ã¥B°õ¦æ§A¼g¦b³oÓÀɮפ¤ªº«ü¥O¡C
+ ¦pªG©Ò¤Uªº«ü¥O¦³¿ù»~²£¥Í¡A¤j¦h¼Æªºª½Ä¶¾¹·|¶i¤J°»¿ù¼Ò¦¡(debugger)¡A
+ ¨Ã¥BÅã¥Ü¬ÛÃö¿ù»~°T®§¡A¥H«K¹ïµ{¦¡°£¿ù¡C
+ </para>
+
+ <para>
+ ³oºØ¤è¦¡¦n³B¦b©ó¡G¥i¥H¥ß¨è¬Ý¨ì«ü¥Oªº°õ¦æµ²ªG¡A¥H¤Î¿ù»~¤]¥i¨³³t×¥¿¡C
+ ¬Û¹ïªº¡A³Ì¤jªºÃa³B«K¬O·í§A·Q§â§A¼gªºµ{¦¡¤À¨Éµ¹¨ä¥L¤H®É¡A³o¨Ç¤H¥²¶·n¦³¸ò§A¤@¼Ëªºª½Ä¶¾¹¡C
+ ¦Ó¥B§O§Ñ¤F¡A¥L̤]n·|¨Ï¥Îª½Ä¶¾¹ª½Ä¶µ{¦¡¤~¦æ¡C
+ ·íµM¨Ï¥ÎªÌ¤]¤£§Æ±æ¤£¤p¤ß«ö¿ùÁä¡A´N¶i¤J°»¿ù¼Ò¦¡¦Ó¤£ª¾©Ò±¹¡C
+ ´N°õ¦æ®Ä²v¦Ó¨¥¡Aª½Ä¶¾¹·|¨Ï¥Î¨ì«Ü¦hªº°O¾ÐÅé¡A
+ ¦Ó¥B³oÃþª½Ä¶¦¡µ{¦¡¡A³q±`¨Ã¤£·|¤ñ½sĶ¾¹©Ò½sĶªºµ{¦¡ªº§ó¦³®Ä²v¡C
+ </para>
+
+ <para>
+ µ§ªÌÓ¤H»{¬°¡A¦pªG§A¤§«e¨S¦³¾Ç¹L¥ô¦óµ{¦¡»y¨¥¡A³Ì¦n¥ý¾Ç¾Ç²ßª½Ä¶¦¡»y¨¥(interpreted languages)¡A
+ ¹³¬O Lisp¡ASmalltalk¡APerl ©M Basic ³£¬O¡A&unix; ªº shell ¹³¬O <command>sh</command> ©M <command>csh</command>
+ ¥¦Ì¥»¨´N¬Oª½Ä¶¾¹¡A¨Æ¹ê¤W¡A«Ü¦h¤H³£¦b¥¦Ì¦Û¤v¾÷¾¹¤W¼¶¼g¦U¦¡ªº shell <quote>script</quote>¡A
+ ¨Ó¶¶§Q§¹¦¨¦U¶µ <quote>housekeeping(ºûÅ@)</quote> ¥ô°È¡C
+ &unix; ¨Ï¥Îõ¾Ç¤§¤@´N¬O´£¨Ñ¤j¶qªº¤p¤u¨ã¡A
+ ¨Ã¨Ï¥Î shell script ¨Ó²Õ¦X¹B¥Î³o¨Ç¤p¤u¨ã¡A¥H«K¤u§@§ó¦³®Ä²v¡C
</sect2>
<sect2>
- <title>Interpreters available with FreeBSD</title>
+ <title>FreeBSD ´£¨Ñªºª½Ä¶¾¹</title>
- <para>Here is a list of interpreters that are available from
- the &os; Ports Collection, with a brief discussion of
- some of the more popular interpreted languages.</para>
-
- <para>Instructions on how to get and install applications
- from the Ports Collection can be found in the
- <ulink url="&url.books.handbook;/ports-using.html">
- Ports section</ulink> of the handbook.
+ <para>
+ ¤U±³oÃ䦳¥÷ &os; Ports Collection ©Ò´£¨Ñªºª½Ä¶¾¹²M³æ¡AÁÙ¦³°Q½×¤@¨Ç¤ñ¸û¨üÅwªïªºª½Ä¶¦¡»y¨¥</para>
+ <para>
+ ¦Ü©ó¦p¦ó¨Ï¥Î Ports Collection ¦w¸Ëªº»¡©ú¡A¥i°Ñ¾\ FreeBSD Handbook ¤¤ªº
+ <ulink url="&url.books.handbook;/ports-using.html">Ports³¹¸`</ulink>¡C
<variablelist>
<varlistentry>
<term><acronym>BASIC</acronym></term>
<listitem>
- <para>Short for Beginner's All-purpose Symbolic
- Instruction Code. Developed in the 1950s for teaching
- University students to program and provided with every
- self-respecting personal computer in the 1980s,
- <acronym>BASIC</acronym> has been the first programming
- language for many programmers. It is also the foundation
- for Visual Basic.</para>
-
- <para>The Bywater Basic Interpreter can be found in the
- Ports Collection as
- <filename role="package">lang/bwbasic</filename>
- and the Phil Cockroft's Basic Interpreter
- (formerly Rabbit Basic) is available as
- <filename role="package">lang/pbasic</filename>.</para>
+ <para>BASIC ¬O Beginner's ALL-purpose Symbolic Instruction Code ªºÁY¼g¡C
+ BASIC ©ó 1950 ¦~¥N¶}©lµo®i¡A³Ìªì¶}µo³o®M»y¨¥ªº¥Øªº¬O¬°¤F±Ð¾É·í®Éªº¤j¾Ç¾Ç¥Í¦p¦ó¼gµ{¦¡¡C
+ ¨ì¤F 1980¡A<acronym>BASIC</acronym>¤w¸g¬O«Ü¦h programmer ²Ä¤@ӾDzߪºµ{¦¡»y¨¥¤F¡C
+ ¦¹¥~¡ABASIC ¤]¬O Visual Basic ªº°ò¦¡C</para>
+
+ <para>FreeBSD Ports Collection ¤]¦³¦¬¿ý¬ÛÃöªº BASIC ª½Ä¶¾¹¡C
+ Bywater Basic ª½Ä¶¾¹©ñ¦b <filename role="package">lang/bwbasic</filename>¡C
+ ¦Ó Phil Cockroft's Basic ª½Ä¶¾¹(¦´Á¤]¥s Rabbit Basic)©ñ¦b <filename role="package">lang/pbasic</filename>¡C
</listitem>
</varlistentry>
@@ -147,29 +132,22 @@
<term>Lisp</term>
<listitem>
- <para>A language that was developed in the late 1950s as
- an alternative to the <quote>number-crunching</quote>
- languages that were popular at the time. Instead of
- being based on numbers, Lisp is based on lists; in fact
- the name is short for <quote>List Processing</quote>.
- Very popular in <acronym>AI</acronym> (Artificial Intelligence)
- circles.</para>
-
- <para>Lisp is an extremely powerful and sophisticated
- language, but can be rather large and unwieldy.</para>
-
- <para>Various implementations of Lisp that can run on &unix;
- systems are available in the Ports Collection for &os;.
- GNU Common Lisp can be found as
- <filename role="package">lang/gcl</filename>. CLISP
- by Bruno Haible and Michael Stoll is available as
- <filename role="package">lang/clisp</filename>.
- For CMUCL, which includes a highly-optimizing compiler too, or
- simpler Lisp implementations like SLisp, which implements most
- of the Common Lisp constructs in a few hundred lines of C code,
- <filename role="package">lang/cmucl</filename> and
- <filename role="package">lang/slisp</filename> are available
- respectively.</para>
+ <para>LISP ¬O¦b 1950 ¦~¥N¶}©lµo®iªº¤@Óª½Ä¶¦¡»y¨¥¡A¦Ó¥B LISP ´N¬O¤@ºØ
+ <quote>number-crunching</quote> languages(¨³³t¶i¦æ¤j¶q¹Bºâªºµ{¦¡»y¨¥)¡A¦b·í®Éºâ¬O¤@Ó´¶¹Mªºµ{¦¡»y¨¥¡C
+ LISP ªºªí¹F¤£¬O°ò©ó¼Æ¦r(numbers)¡A¦Ó¬O°ò©óªí(lists)¡C
+ ¦Ó³Ì¯àªí¥Ü¥X LISP ¯S¦âªº¦a¤è´N¦b©ó¡G LISP ¬O <quote>List Processing</quote> ªºÁY¼g¡C
+ ¦b<acronym>¤H¤u´¼¼z(Artificial Intelligence, AI)</acronym>»â°ì¤W LISP ªº¦U¦¡À³¥Î«D±`´¶¹M¡C</para>
+
+ <para>LISP ¬O«D±`±j®«¥B½ÆÂøªºµ{¦¡»y¨¥¡A¦ý¬O¯ÊÂI¬Oµ{¦¡½X·|«D±`¤j¦Ó¥BÃø¥H¾Þ§@¡C</para>
+
+ <para>µ´¤j³¡¤Àªº LISP ª½Ä¶¾¹³£¥i¥H¦b &unix; ¨t²Î¤W¹B§@¡A·íµM &os; ªº Ports Collection ¤]¦³¦¬¿ý¡C
+ GNU Common Lisp ¦¬¿ý¦b <filename role="package">lang/gcl</filename>¡A
+ Bruno Haible ©M Michael Stoll ªº CLISP ¦¬¿ý¦b <filename role="package">lang/clisp</filename>
+ ¡A¦¹¥~ CMUCL(¥]§t¤@Ó¤w¸g³Ì¨Î¤Æªº½sĶ¾¹)¡A
+ ¥H¤Î¨ä¥L²¤Æª©ªº LISP ª½Ä¶¾¹(¤ñ¦p¥H C »y¨¥¼gªº SLisp¡A¥u¥Î´X¦Ê¦æµ{¦¡½X´N¹ê§@¤j¦h¼Æ Common Lisp ªº¥\¯à)
+ «h¬O¤À§O¦¬¿ý¦b <filename role="package">lang/cmucl</filename> ¥H¤Î
+ <filename role="package">lang/slisp</filename>¡C
+ </para>
</listitem>
</varlistentry>
@@ -177,14 +155,11 @@
<term>Perl</term>
<listitem>
- <para>Very popular with system administrators for writing
- scripts; also often used on World Wide Web servers for
- writing <acronym>CGI</acronym> scripts.</para>
-
- <para>Perl is available in the Ports Collection as
- <filename role="package">lang/perl5</filename> for all
- &os; releases, and is installed as <command>/usr/bin/perl</command>
- in the base system 4.X releases.</para>
+ <para>¹ï¨t²ÎºÞ²zªÌ¦Ó¨¥¡A³Ì·R¥Î perl ¨Ó¼¶¼g scripts ¥HºÞ²z¥D¾÷¡A
+ ¦P®É¤]¸g±`¥Î¨Ó¼g WWW ¥D¾÷¤Wªº <acronym>CGI</acronym> Script µ{¦¡¡C</para>
+
+ <para>Perl ¦b Ports Collection ¤ºªº <filename role="package">lang/perl5</filename>¡C
+ ¦Ó &os; 4.X «h¬O§â Perl ¸Ë¦b <command>/usr/bin/perl</command>¡C</para>
</listitem>
</varlistentry>
@@ -192,19 +167,15 @@
<term>Scheme</term>
<listitem>
- <para>A dialect of Lisp that is rather more compact and
- cleaner than Common Lisp. Popular in Universities as it
- is simple enough to teach to undergraduates as a first
- language, while it has a high enough level of
- abstraction to be used in research work.</para>
-
- <para>Scheme is available from the Ports Collection as
- <filename role="package">lang/elk</filename> for the
- Elk Scheme Interpreter. The MIT Scheme Interpreter
- can be found in
- <filename role="package">lang/mit-scheme</filename>
- and the SCM Scheme Interpreter in
- <filename role="package">lang/scm</filename>.</para>
+ <para>Scheme ¬O LISP ªº¥t¤@¤À¤ä¡AScheme ªº¯SÂI´N¬O¤ñ Common LISP ÁÙn²¼ä¦³¤O¡C
+ ¥Ñ©ó Scheme ²³æ¡A©Ò¥H«Ü¦h¤j¾Ç®³¨Ó·í§@²Ä¤@°óµ{¦¡»y¨¥±Ð¾Ç±Ð§÷¡C
+ ¦Ó¥B¹ï©ó¬ã¨s¤Hû¨Ó»¡¤]¥i¥H§Ö³tªº¶}µo¥LÌ©Ò»Ýnªºµ{¦¡¡C
+ </para>
+
+ <para>Scheme ¦¬¿ý¦b <filename role="package">lang/elk</filename>¡A
+ Elk Scheme ª½Ä¶¾¹(¥Ñ³Â¬Ù²z¤u¾Ç°|©Òµo®iªº Scheme ª½Ä¶¾¹)¦¬¿ý¦b
+ <filename role="package">lang/mit-scheme</filename>¡A
+ SCM Scheme Interpreter ¦¬¿ý¦b <filename role="package">lang/scm</filename>¡C</para>
</listitem>
</varlistentry>
@@ -212,11 +183,9 @@
<term>Icon</term>
<listitem>
- <para>Icon is a high-level language with extensive
- facilities for processing strings and structures.
- The version of Icon for &os; can be found in the
- Ports Collection as
- <filename role="package">lang/icon</filename>.</para>
+ <para>Icon ÄÝ°ª¶¥µ{¦¡»y¨¥¡AIcon ¨ã¦³±j¤jªº¦r¦ê(String)©Mµ²ºc(Structure)³B²z¯à¤O¡C
+ &os; Ports Collection ©Ò¦¬¿ýªº Icon ª½Ä¶¾¹ª©¥»«h¬O©ñ¦b
+ <filename role="package">lang/icon</filename>¡C</para>
</listitem>
</varlistentry>
@@ -224,16 +193,11 @@
<term>Logo</term>
<listitem>
- <para>Logo is a language that is easy to learn, and has
- been used as an introductory programming language in
- various courses. It is an excellent tool to work with
- when teaching programming in small ages, as it makes the
- creation of elaborate geometric shapes an easy task even
- for very small children.</para>
-
- <para>The lastest version of Logo for &os; is available from
- the Ports Collection in
- <filename role="package">lang/logo</filename>.</para>
+ <para>Logo ¬OºØ®e©ö¾Ç²ßªºµ{¦¡»y¨¥¡A³Ì±`¦b¤@¨Ç±Ð¾Ç½Òµ{¤¤³Q®³¨Ó·í§@¶}ÀY½d¨Ò¡C
+ ¦pªGnµ¹¤pªB¤Í¶}©l¤Wµ{¦¡»y¨¥½Òªº¸Ü¡ALogo ¬O¬Û·í¤£¿ùªº¿ï¾Ü¡C
+ ¦]¬°¡A§Y¨Ï¹ï¤pªB¤Í¨Ó»¡¡An¥Î Logo ¨Ó¨q¥X½ÆÂø¦hÃä§Î¹Ï§Î¬O¬Û·í»´ÃP®e©öªº¡C</para>
+
+ <para>Logo ¦b &os; Ports Collection ªº³Ì·sª©«h¬O©ñ¦b <filename role="package">lang/logo</filename>¡C</para>
</listitem>
</varlistentry>
@@ -241,17 +205,13 @@
<term>Python</term>
<listitem>
- <para>Python is an Object-Oriented, interpreted language.
- Its advocates argue that it is one of the best languages
- to start programming with, since it is relatively easy
- to start with, but is not limited in comparison to other
- popular interpreted languages that are used for the
- development of large, complex applications (Perl and
- Tcl are two other languages that are popular for such tasks).</para>
-
- <para>The latest version of Python is available from the
- Ports Collection in
- <filename role="package">lang/python</filename>.</para>
+ <para>Python ¬Oª«¥ó¾É¦Vªºª½Ä¶¦¡»y¨¥¡A
+ Python ªº¾ÖÅ@ªÌÁ`¬O«ÅºÙ Python ¬O³Ì¦n¤Jªùªºµ{¦¡»y¨¥¡C
+ ÁöµM Python ¥i¥H«Ü²³æªº¶}©l¡A¦ý¬O¤£¥Nªí¥¦´N·|¿éµ¹¨ä¥Lª½Ä¶¦¡»y¨¥(¹³¬O Perl ©M Tcl)¡A
+ ¨Æ¹êÃÒ©ú Python ¤]¥i¥H®³¨Ó¶}µo¤j«¬¡B½ÆÂøªºÀ³¥Îµ{¦¡¡C
+ </para>
+
+ <para>&os; Ports Collection ¦¬¿ý¦b <filename role="package">lang/python</filename>¡C</para>
</listitem>
</varlistentry>
@@ -259,14 +219,11 @@
<term>Ruby</term>
<listitem>
- <para>Ruby is an interpreter, pure object-oriented programming
- language. It has become widely popular because of its easy
- to understand syntax, flexibility when writing code, and the
- ability to easily develop and maintain large, complex
- programs.</para>
+ <para>Ruby ¬O¯Âª«¥ó¾É¦Vªºª½Ä¶¦¡»y¨¥¡C
+ Ruby ¥Ø«e«D±`¬y¦æ¡Aì¦]¦b©ó¥L©öÀ´ªºµ{¦¡»yªkµ²ºc¡A¦b¼¶¼gµ{¦¡®Éªº¼u©Ê¡A
+ ¥H¤Î¤Ñ¥Í¨ã¦³»´©öªºµo®iºûÅ@¤j«¬±M®×ªº¯à¤O¡C</para>
- <para>Ruby is available from the Ports Collection as
- <filename role="package">lang/ruby18</filename>.</para>
+ <para>&os; Ports Collection ¦¬¿ý¦b <filename role="package">lang/ruby8</filename>¡C</para>
</listitem>
</varlistentry>
@@ -274,70 +231,50 @@
<term>Tcl and Tk</term>
<listitem>
- <para>Tcl is an embeddable, interpreted language, that has
- become widely used and became popular mostly because of its portability to many
- platforms. It can be used both for quickly writing
- small, prototype applications, or (when combined with
- Tk, a GUI toolkit) fully-fledged, featureful
- programs.</para>
-
- <para>Various versions of Tcl are available as ports
- for &os;. The latest version, Tcl 8.4, can be found in
- <filename role="package">lang/tcl84</filename>.</para>
+ <para>Tcl ¬O¤º´O¦¡ªºª½Ä¶¦¡»y¨¥¡AÅý Tcl ¥i¥H¦p¦¹¼sªx¹B¥Îªºì¦]¬O Tcl ªº²¾´Ó©Ê¡C
+ Tcl ¤]¥i¥H§Ö³tµo®i¤@Ó²³æ¦ý¬O¨ã¦³Âú«¬ªºµ{¦¡©ÎªÌ¨ã¦³§¹¾ã¥\¯àªºµ{¦¡¡C</para>
+
+ <para>Tcl ³\¦hªºª©¥»³£¥i¦b &os; ¤W¹B§@¡A¦Ó³Ì·sªº Tcl ª©¥»¬° Tcl 8.4¡A
+ &os; Ports Collection ¦¬¿ý¦b <filename role="package">lang/tcl84</filename>¡C</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
- <title>Compilers</title>
-
- <para>Compilers are rather different. First of all, you write
- your code in a file (or files) using an editor. You then run
- the compiler and see if it accepts your program. If it did
- not compile, grit your teeth and go back to the editor; if it
- did compile and gave you a program, you can run it either at a
- shell command prompt or in a debugger to see if it works
- properly.
+ <title>½sĶ¾¹</title>
+ <para>½sĶ¾¹©Mª½Ä¶¾¹¨âªÌ¬Û¤ñªº¸Ü¡A¦³¨Ç¤£¦P¡Aº¥ý´N¬O¥²¶·¥ý§âµ{¦¡½X²Î²Î¼g¤J¨ìÀɮ׸̱¡A
+ µM«á¥²¶·°õ¦æ½sĶ¾¹¨Ó¸ÕµÛ½sĶµ{¦¡¡A¦pªG½sĶ¾¹¤£±µ¨ü©Ò¼gªºµ{¦¡¡A¨º´N¥²¶·¤@ª½×§ïµ{¦¡¡A
+ ª½¨ì½sĶ¾¹±µ¨ü¥B§â§Aªºµ{¦¡½sĶ¦¨°õ¦æÀÉ¡C
+ ¦¹¥~¡A¤]¥i¥H¦b´£¥Ü©R¥O¦C¡A©Î¦b°£¿ù¾¹¤¤°õ¦æ§A½sĶ¦nªºµ{¦¡¬Ý¬Ý¥¦¬O§_¥i¥H¹B§@¡C
<footnote>
- <para>If you run it in the shell, you may get a core
- dump.</para>
+ <para>¦pªG¦b´£¥Ü©R¥O¦C¤U°õ¦æ¡A¨º»ò¦³¥i¯à·|²£¥Í core dump¡C</para>
</footnote></para>
- <para>Obviously, this is not quite as direct as using an
- interpreter. However it allows you to do a lot of things
- which are very difficult or even impossible with an
- interpreter, such as writing code which interacts closely with
- the operating system—or even writing your own operating
- system! It is also useful if you need to write very efficient
- code, as the compiler can take its time and optimize the code,
- which would not be acceptable in an interpreter. Moreover,
- distributing a program written for a compiler is usually more
- straightforward than one written for an interpreter—you
- can just give them a copy of the executable, assuming they
- have the same operating system as you.</para>
-
- <para>Compiled languages include Pascal, C and C++. C and C++
- are rather unforgiving languages, and best suited to more
- experienced programmers; Pascal, on the other hand, was
- designed as an educational language, and is quite a good
- language to start with. FreeBSD does not include Pascal
- support in the base system, but both GNU Pascal Compiler (GPC)
- and the Free Pascal Compiler
- are available in the ports collection as
- <filename role="package">lang/gpc</filename> and
- <filename role="package">lang/fpc</filename>.</para>
-
- <para>As the edit-compile-run-debug cycle is rather tedious when
- using separate programs, many commercial compiler makers have
- produced Integrated Development Environments
- (<acronym>IDE</acronym>s for short). FreeBSD does not include
- an IDE in the base system, but <filename role="package">devel/kdevelop</filename> is
- available in the ports tree and many use
- <application>Emacs</application> for this purpose. Using
- <application>Emacs</application> as an IDE is discussed in
- <xref linkend="emacs">.</para>
+ <para>«Ü©úÅ㪺¡A¨Ï¥Î½sĶ¾¹¨Ã¤£¹³ª½Ä¶¾¹¯ë¥i¥H°¨¤W±o¨ìµ²ªG¡C
+ ¤£ºÞ¦p¦ó¡A½sĶ¾¹¤¹³\§A§@«Ü¦hª½Ä¶¾¹¤£¥i¯à©ÎªÌ¬O«ÜÃø¹F¨ìªº¨Æ±¡¡C
+ ¨Ò¦p¡G¼¶¼g©M§@·~¨t²Î±K¤Á¤¬°Êªºµ{¦¡¡A¬Æ¦Ü¬O§A¦Û¤v¼gªº§@·~¨t²Î¡I
+ ·í§A·Qn¼g¥X°ª®Ä²vªºµ{¦¡®É¡A½sĶ¾¹«K¬£¤W¥Î³õ¤F¡C
+ ½sĶ¾¹¥i¥H¦b½sĶ®É¶¶«K³Ì¨Î¤Æ§Aªºµ{¦¡¡A¦ý¬Oª½Ä¶¾¹«o¤£¦æ¡C
+ ¦Ó½sĶ¾¹»Pª½Ä¶¾¹³Ì¤jªº®t§O¦b©ó¡G·í§A·Q§â§A¼g¦nªºµ{¦¡®³¨ì¥t¥~¤@¥x¾÷¾¹¤W¶]®É¡A
+ §A¥un±N½sĶ¾¹½sĶ¥X¨Óªº¥i°õ¦æÀÉ¡A®³¨ì·s¾÷¾¹¤W«K¥i¥H°õ¦æ¡A
+ ¦Óª½Ä¶¾¹«h¥²¶·n¨D·s¾÷¾¹¤W¡A¥²¶·n¦³¸ò¥t¤@¥x¾÷¾¹¤W¬Û¦Pªºª½Ä¶¾¹¡A
+ ¤~¯à²ÕĶ°õ¦æ§Aªºµ{¦¡¡I
+ </para>
+
+ <para>½sĶ¦¡ªºµ{¦¡»y¨¥¥]§t Pascal¡BC ©M C++¡A
+ C ©M C++ ¤£¬O¤@Ó¿Ë©M¤O¤Q¨¬ªº»y¨¥¡A¦ý¬O«Ü¾A¦X¨ã¦³¸gÅ窺 Programmer¡C
+ Pascal ¨ä¹ê¬O¤@Ó³]p¥Î¨Ó±Ð¾Ç¥Îªºµ{¦¡»y¨¥¡A¦Ó¥B¤]«Ü¾A¦X¥Î¨Ó¤Jªù¡A
+ &os; ¹w³]¨Ã¨S¦³§â Pascal ¾ã¦X¶i base system ¤¤¡A
+ ¦ý¬O GNU Pascal Compiler ©M Free Pascal Compiler ³£¥i¤À§O¦b
+ <filename role="package">lang/gpc</filename> ©M <filename role="package">lang/fpc</filename> ¤¤§ä¨ì¡C</para>
+
+ <para>¦pªG§A¥Î¤£¦Pªºµ{¦¡¨Ó¼g½sĶ¦¡µ{¦¡¡A¨º»ò¤£Â_¦a½s¿è-½sĶ-°õ¦æ-°£¿ùªº³oÓ´`ÀôªÖ©w·|«Ü·Ð¤H¡A
+ ¬°¤F§ó²¤Æ¡B¤è«Kµ{¦¡¶}µo¬yµ{¡A«Ü¦h°Ó·~½sĶ¾¹¼t°Ó¶}©lµo®i©Ò¿×ªº <acronym>IDE</acronym>(Integrated Development Environments) ¶}µoÀô¹Ò¡A
+ FreeBSD ¹w³]¨Ã¨S¦³§â IDE ¾ã¦X¶i base system ¤¤¡A¦ý¬O§A¥i³z¹L <filename role="package">devel/kdevelop</filename> ¦w¸Ë kdevelop
+ ©Î¨Ï¥Î <application>Emacs</application> ¨ÓÅéÅç IDE ¶}µoÀô¹Ò¡C
+ ¦b«á±ªº <xref linkend="emacs"> ±MÃD±N¤¶²Ð¡A¦p¦ó¥H <application>Emacs</application> ¨Ó§@¬° IDE ¶}µoÀô¹Ò¡C</para>
</sect2>
@@ -345,127 +282,95 @@
<sect1 id="tools-compiling">
- <title>Compiling with <command>cc</command></title>
+ <title>¥Î <command>cc</command> ¨Ó½sĶµ{¦¡</title>
+
+ <para>¥»³¹½d¨Ò¥u¦³°w¹ï GNU C compiler ©M GNU C++ compiler §@»¡©ú¡A
+ ³o¨âÓ¦b FreeBSD base system ¤¤´N¦³¤F¡A
+ ª½±µ¥´ <command>cc</command> ©Î <command>gcc</command> ´N¥i¥H°õ¦æ¡C
+ ¦Ü©ó¡A¦p¦ó¥Îª½Ä¶¾¹²£¥Íµ{¦¡ªº»¡©ú¡A³q±`¥i¦bª½Ä¶¾¹ªº¤å¥ó©Î½u¤W¤å¥ó§ä¨ì»¡©ú¡A¦]¦¹¤£¦AÂØz¡C</para>
- <para>This section deals only with the GNU compiler for C and C++,
- since that comes with the base FreeBSD system. It can be
- invoked by either <command>cc</command> or <command>gcc</command>. The
- details of producing a program with an interpreter vary
- considerably between interpreters, and are usually well covered
- in the documentation and on-line help for the
- interpreter.</para>
-
- <para>Once you have written your masterpiece, the next step is to
- convert it into something that will (hopefully!) run on FreeBSD.
- This usually involves several steps, each of which is done by a
- separate program.</para>
+ <para>·í§A¼g§¹§Aªº³Ç§@«á¡A±µ¤U¨Ó«K¬OÅý³oÓµ{¦¡¥i¥H¦b FreeBSD ¤W°õ¦æ¡A
+ ³q±`³o¨Çn¤@¨Ç¨BÆJ¤~¯à§¹¦¨¡A¦³¨Ç¨BÆJ«h»Ýn¤£¦Pµ{¦¡¨Ó§¹¦¨¡C</para>
<procedure>
<step>
- <para>Pre-process your source code to remove comments and do
- other tricks like expanding macros in C.</para>
+ <para>¹w¥ý³B²z(Pre-process)§Aªºµ{¦¡½X¡A²¾°£µ{¦¡¤ºªºµù¸Ñ¡A©M¨ä¥L§Þ¥©¡A
+ ¹³¬O expanding(ÂX¤j) C ªº marco¡C</para>
</step>
<step>
- <para>Check the syntax of your code to see if you have obeyed
- the rules of the language. If you have not, it will
- complain!</para>
+ <para>½T»{§Aªºµ{¦¡»yªk¬O§_½T¹ê¿í·Ó C/C++ ªº³W©w¡A¦pªG¨S¦³²Å¦Xªº¸Ü¡A½sĶ¾¹·|¥X²{ĵ§i¡C</para>
</step>
<step>
- <para>Convert the source code into assembly
- language—this is very close to machine code, but still
- understandable by humans. Allegedly.
-
+ <para>±Nì©l½XÂন²Õ¦X»y¨¥ — ¥¦¸ò¾÷¾¹»y¨¥(machine code)«D±`¬Ûªñ¡A¦ý¤´¦b¤HÃþ¥i²z¸Ñªº½d³ò¤º(¾Ú»¡À³¸Ó¬O³o¼Ë)¡C
<footnote>
- <para>To be strictly accurate, <command>cc</command> converts the
- source code into its own, machine-independent
- <firstterm>p-code</firstterm> instead of assembly language at
- this stage.</para>
+ <para>ÄY®æ»¡°_¨Ó¡A¦b³oÓ¶¥¬q <command>cc</command> ¨Ã¤£¬O¯uªº§âì©lµ{¦¡Âন²Õ¦X»y¨¥¡A
+ ¦Ó¬OÂର machine-independent ªº <firstterm>p-code</firstterm>¡C</para>
</footnote></para>
</step>
<step>
- <para>Convert the assembly language into machine
- code—yep, we are talking bits and bytes, ones and
- zeros here.</para>
+ <para>§â²Õ¦X»y¨¥Âন¾÷¾¹»y¨¥ — ¬Oªº¡A³o¸Ì»¡ªº¾÷¾¹»y¨¥´N¬O±`´£¨ìªº bit ©M byte¡A¤]´N¬O 1 ©M 0¡C</para>
</step>
<step>
- <para>Check that you have used things like functions and
- global variables in a consistent way. For example, if you
- have called a non-existent function, it will
- complain.</para>
+ <para>½T»{µ{¦¡¤¤¥Î¨ìªº¨ç¦¡©I¥s¡B¥þ°ìÅܼƬO§_¥¿½T¡AÁ|¨Ò¨Ó»¡¡G¦pY©I¥s¤F¤£¦s¦bªº¨ç¦¡¡A½sĶ¾¹·|Åã¥Üĵ§i¡C</para>
</step>
<step>
- <para>If you are trying to produce an executable from several
- source code files, work out how to fit them all
- together.</para>
+ <para>¦pªGµ{¦¡¬O¥Ñµ{¦¡½XÀɮרӽsĶ¡A½sĶ¾¹·|¾ã¦X°_¨Ó¡C</para>
</step>
<step>
- <para>Work out how to produce something that the system's
- run-time loader will be able to load into memory and
- run.</para>
+ <para>½sĶ¾¹·|t³d²£¥ÍªF¦è¡AÅý¨t²Î¤Wªº run-time loader ¥i¥H§âµ{¦¡¸ü¤J°O¾ÐÅ餺°õ¦æ¡C</para>
</step>
<step>
- <para>Finally, write the executable on the filesystem.</para>
+ <para>³Ì«á·|§â½sĶ§¹ªº°õ¦æÀɦs¦bµwºÐ¤W¡C</para>
</step>
</procedure>
- <para>The word <firstterm>compiling</firstterm> is often used to refer to
- just steps 1 to 4—the others are referred to as
- <firstterm>linking</firstterm>. Sometimes step 1 is referred to as
- <firstterm>pre-processing</firstterm> and steps 3-4 as
- <firstterm>assembling</firstterm>.</para>
-
- <para>Fortunately, almost all this detail is hidden from you, as
- <command>cc</command> is a front end that manages calling all these
- programs with the right arguments for you; simply typing</para>
-
+ <para>³q±` <firstterm>½sĶ(compiling)</firstterm> ¬O«ü²Ä 1 ¨ì²Ä 4 Ó¨BÆJ¡C
+ — ¨ä¥L¨BÆJ«hºÙ¬° <firstterm>³sµ²(linking)</firstterm>¡A
+ ¦³®ÉÔ¨BÆJ 1 ¤]¥i¥H¬O«ü <firstterm>¹w¥ý³B²z(pre-processing)</firstterm>¡A
+ ¦Ó¨BÆJ 3 ¨ì¨BÆJ 4 «h¬O <firstterm>²ÕĶ(assembling)</firstterm>¡C</para>
+
+ <para>©¯¹Bªº¬O¡A§A¥i¥H¤£¥Î²z·|¥H¤W²Ó¸`¡A½sĶ¾¹³£·|¦Û°Ê§¹¦¨¡C
+ ¦]¬° <command>cc</command> ¥u¬O¬OÓ«eºÝµ{¦¡(front end)¡A¥¦·|¨Ì·Ó¥¿½Tªº°Ñ¼Æ¨Ó©I¥s¬ÛÃöµ{¦¡À°§A³B²z¡C
+ ¥u»Ý¥´¡G
<screen>&prompt.user; <userinput>cc foobar.c</userinput></screen>
- <para>will cause <filename>foobar.c</filename> to be compiled by all the
- steps above. If you have more than one file to compile, just do
- something like</para>
+ <para>¤Wz«ü¥O·|§â <filename>foobar.c</filename> ¶}©l½sĶ¡A¨Ã§¹¦¨¤Wz°Ê§@¡C
+ ¦pªG§A¦³³\¦hÀÉ®×»Ýn½sĶ¡A¨º½Ð¥´Ãþ¦ü¤U¦C«ü¥O§Y¥i¡G</para>
<screen>&prompt.user; <userinput>cc foo.c bar.c</userinput></screen>
- <para>Note that the syntax checking is just that—checking
- the syntax. It will not check for any logical mistakes you may
- have made, like putting the program into an infinite loop, or
- using a bubble sort when you meant to use a binary
- sort.
-
+ <para>°O¦í»yªk¿ù»~Àˬd´N¬O — ¯ÂºéÀˬd»yªk¿ù»~»P§_¡A
+ ¦Ó¤£·|À°§AÀË´ú¥ô¦óÅÞ¿è¿ù»~¡A¤ñ¦p¡GµL°j°é¡A©Î¬O±Æ§Ç¤è¦¡·Q¥Î binary sort «o§Ë¦¨ bubble sort¡C
<footnote>
- <para>In case you did not know, a binary sort is an efficient
- way of sorting things into order and a bubble sort
- is not.</para>
+ <para>è©Ò»¡ªº binary sort ©M bubble sort °ÝÃD¡A
+ ¦b¤w±Æ§Ç¦nªº§Ç¦C¤¤¡Abinary sort ·j¯Á®Ä²v·|¤ñ bubble sort ¦n¡C</para>
</footnote></para>
- <para>There are lots and lots of options for <command>cc</command>, which
- are all in the manual page. Here are a few of the most important
- ones, with examples of how to use them.</para>
+ <para><command>cc</command> ¦³«D±`¦hªº¿ï¶µ¡A³£¥i³z¹L½u¤W¤â¥U¨Ó¬d¡C
+ ¤U±¥u´£¤@¨Ç¥²n¥B«nªº¿ï¶µ¡A¥H§@¬°¨Ò¤l¡C</para>
<variablelist>
<varlistentry>
- <term><option>-o <replaceable>filename</replaceable></option></term>
+ <term><option>-o <replaceable>ÀɦW</replaceable></option></term>
<listitem>
- <para>The output name of the file. If you do not use this
- option, <command>cc</command> will produce an executable called
- <filename>a.out</filename>.
+ <para><option>-o</option> ½sĶ«áªº°õ¦æÀÉÀɦW¡A¦pªG¨S¦³¨Ï¥Î³o¿ï¶µªº¸Ü¡A
+ ½sĶ¦nªºµ{¦¡¹w³]ÀɦW±N·|¬O <filename>a.out</filename>
<footnote>
- <para>The reasons for this are buried in the mists of
- history.</para>
+ <para>¦Ü©ó <option>-o</option> ªºì¦]¡A«h¬O¤@¹Î¾ú¥v°gÃú¤F¡C</para>
</footnote></para>
<informalexample>
- <screen>&prompt.user; <userinput>cc foobar.c</userinput> <lineannotation>executable is <filename>a.out</filename></lineannotation>
-&prompt.user; <userinput>cc -o foobar foobar.c</userinput> <lineannotation>executable is <filename>foobar</filename></lineannotation>
+ <screen>&prompt.user; <userinput>cc foobar.c</userinput> <lineannotation>°õ¦æÀÉ´N¬O <filename>a.out</filename></lineannotation>
+&prompt.user; <userinput>cc -o foobar foobar.c</userinput> <lineannotation>°õ¦æÀÉ´N¬O <filename>foobar</filename></lineannotation>
</screen>
</informalexample>
</listitem>
@@ -475,19 +380,17 @@
<term><option>-c</option></term>
<listitem>
- <para>Just compile the file, do not link it. Useful for toy
- programs where you just want to check the syntax, or if
- you are using a <filename>Makefile</filename>.</para>
+ <para>¨Ï¥Î <option>-c</option> ®É¡A¥u·|½sĶì©l½X¡A¦Ó¤£§@³sµ²(linking)¡C
+ ·í¥u·Q½T»{»yªk¬O§_¥¿½T©Î¨Ï¥Î Makefile ¨Ó½sĶµ{¦¡®É¡A³oӿﶵ«D±`¦³¥Î¡C</para>
<informalexample>
- <screen>&prompt.user; <userinput>cc -c foobar.c</userinput>
+ <screen>
+ &prompt.user; <userinput>cc -c foobar.c</userinput>
</screen>
</informalexample>
- <para>This will produce an <firstterm>object file</firstterm> (not an
- executable) called <filename>foobar.o</filename>. This
- can be linked together with other object files into an
- executable.</para>
+ <para>³o·|²£¥Í¥s°µ <filename>foobar</filename> ªº <firstterm>object file</firstterm>(«D°õ¦æÀÉ)¡C
+ ³oÀÉ¥i¥H»P¨ä¥Lªº object file ³sµ²¦b¤@°_¡A¦Ó¦¨°õ¦æÀÉ¡C</para>
</listitem>
</varlistentry>
@@ -495,33 +398,25 @@
<term><option>-g</option></term>
<listitem>
- <para>Create a debug version of the executable. This makes
- the compiler put information into the executable about
- which line of which source file corresponds to which
- function call. A debugger can use this information to show
- the source code as you step through the program, which is
- <emphasis>very</emphasis> useful; the disadvantage is that
- all this extra information makes the program much bigger.
- Normally, you compile with <option>-g</option> while you
- are developing a program and then compile a <quote>release
- version</quote> without <option>-g</option> when you are
- satisfied it works properly.</para>
+ <para>
+ <option>-g</option> ±N·|§â¤@¨Çµ¹ gdb ¥Îªº°£¿ù°T®§¥]¶i¥h°õ¦æÀɸ̱¡A©Ò¿×ªº°£¿ù°T®§¨Ò¦p¡G
+ µ{¦¡¦b²Ä´X¦æ¥X¿ù¡B¨ºÓµ{¦¡²Ä´X¦æ°µ¤°»ò¨ç¦¡©I¥sµ¥µ¥¡C°£¿ù¸ê°T<emphasis>«D±`</emphasis>¦n¥Î¡C
+ ¦ý¯ÊÂI´N¬O¡G¹ï©óµ{¦¡¨Ó»¡¡AÃB¥~ªº°£¿ù°T®§·|Åý½sĶ¥X¨Óªºµ{¦¡¤ñ¸ûªÎ¨Ç¡C
+ <option>-g</option> ªº¾A¥Î®É¾÷¦b©ó¡G·íµ{¦¡ÁÙ¦b¶}µo®É¨Ï¥Î´N¦n¡A
+ ¦Ó·í§AnÄÀ¥X§Aªº <quote>µo¦æª©¥»(release version)</quote>
+ ©ÎªÌ½T»{µ{¦¡¥i¹B§@¥¿±`ªº¸Ü¡A´N¤£¥²¥Î <option>-g</option> ³o¿ï¶µ¤F¡C</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -g foobar.c</userinput>
</screen>
</informalexample>
- <para>This will produce a debug version of the
- program.
-
+ <para>³o°Ê§@·|²£¥Í¦³§t°£¿ù°T®§ªº°õ¦æÀÉ¡C
<footnote>
- <para>Note, we did not use the <option>-o</option> flag
- to specify the executable name, so we will get an
- executable called <filename>a.out</filename>.
- Producing a debug version called
- <filename>foobar</filename> is left as an exercise for
- the reader!</para>
+ <para>½Ðª`·N¡A¦]¬°¤W¨Ò¨S¥Î <option>-o</option> ¥H«ü©w°õ¦æÀɦWºÙ¡A
+ ©Ò¥H°õ¦æÀÉ·|¬O <filename>a.out</filename> ³oÀÉ¡C
+ ¨º»ò¡An¦p¦ó²£¥Í <filename>foobar</filename> ªº°õ¦æÀɨ产t°£¿ù°T®§¡A
+ ³o´N¯d«Ý¬Ý¾Ì½m²ß¤@¤UÅo¡C</para>
</footnote></para>
</listitem>
</varlistentry>
@@ -530,45 +425,38 @@
<term><option>-O</option></term>
<listitem>
- <para>Create an optimized version of the executable. The
- compiler performs various clever tricks to try to produce
- an executable that runs faster than normal. You can add a
- number after the <option>-O</option> to specify a higher
- level of optimization, but this often exposes bugs in the
- compiler's optimizer. For instance, the version of
- <command>cc</command> that comes with the 2.1.0 release of
- FreeBSD is known to produce bad code with the
- <option>-O2</option> option in some circumstances.</para>
+ <para><option>-O</option> ·|²£¥Í³Ì¨Î¤Æªº°õ¦æÀÉ¡A
+ ½sĶ¾¹·|¨Ï¥Î¤@¨Ç§Þ¥©¡A¨ÓÅýµ{¦¡¥i¥H¶]ªº¤ñ¥¼¸g³Ì¨Î¤Æªºµ{¦¡ÁÙ§Ö¡A
+ §A¥i¥H¦b¤j¼g O «á±¥[¤W¼Æ¦r¨Ó«ü©ú§A·Qnªº³Ì¨Î¤Æ¼h¯Å¡C
+ ¦ý¬O³Ì¨Î¤ÆÁÙ¬O·|¦³¤@¨Ç¿ù»~¡AÁ|¨Ò¨Ó»¡¦b·í¦b FreeBSD 2.10 release ¤¤¨Ï¥Î <command>cc</command>
+ ¨Ã¥B«ü©w <option>-O2</option> ®É¡A¦b¬Y¨Ç±¡§Î¤U·|²£¥Í¿ù»~ªº°õ¦æÀÉ¡C</para>
- <para>Optimization is usually only turned on when compiling
- a release version.</para>
+ <para>¥u¦³·ínÄÀ¥Xµo¦æª©¥»¡B©ÎªÌ¥[³tµ{¦¡®É¡A¤~»Ýn¨Ï¥Î³Ì¨Î¤Æ¿ï¶µ¡C
+ </para>
<informalexample>
<screen>&prompt.user; <userinput>cc -O -o foobar foobar.c</userinput>
</screen>
</informalexample>
- <para>This will produce an optimized version of
- <filename>foobar</filename>.</para>
+ <para>³o·|²£¥Í <filename>foobar</filename> °õ¦æÀɪº³Ì¨Î¤Æª©¥»¡C</para>
</listitem>
</varlistentry>
</variablelist>
- <para>The following three flags will force <command>cc</command>
- to check that your code complies to the relevant international
- standard, often referred to as the <acronym>ANSI</acronym>
- standard, though strictly speaking it is an
- <acronym>ISO</acronym> standard.</para>
+ <para>
+ ¥H¤U¤TӰѼƱN·|±j¢ <command>cc</command> ½T»{µ{¦¡½X¬O§_²Å¦X¤@¨Ç°ê»Ú¼Ð·Çªº³W½d¡A
+ ¤]´N¬O³q±`»¡ªº <acronym>ANSI</acronym> ¼Ð·Ç¡A
+ ¦Ó <acronym>ANSI</acronym> ÄY®æ¨ÓÁ¿ÄÝ <acronym>ISO</acronym> ¼Ð·Ç¡C
+ </para>
<variablelist>
<varlistentry>
<term><option>-Wall</option></term>
<listitem>
- <para>Enable all the warnings which the authors of
- <command>cc</command> believe are worthwhile. Despite the
- name, it will not enable all the warnings
- <command>cc</command> is capable of.</para>
+ <para><option>-Wall</option> Åã¥Ü <command>cc</command> ºûÅ@ªÌ©Ò»{¬°È±oª`·Nªº©Ò¦³Äµ§i°T®§¡C
+ ¤£¹L³o¦W¦r¥i¯à·|³y¦¨»~¸Ñ¡A¨Æ¹ê¤W¥¦¨Ã¥¼§¹¥þÅã¥Ü <command>cc</command> ©Ò¯àª`·N¨ìªº¦U¶µÄµ§i°T®§¡C</para>
</listitem>
</varlistentry>
@@ -576,11 +464,8 @@
<term><option>-ansi</option></term>
<listitem>
- <para>Turn off most, but not all, of the
- non-<acronym>ANSI</acronym> C features provided by
- <command>cc</command>. Despite the name, it does not
- guarantee strictly that your code will comply to the
- standard.</para>
+ <para><option>-ansi</option> Ãö³¬ <command>cc</command> ¯S¦³ªº¬Y¨Ç¯S®í«D ANSI C ¼Ð·Ç¥\¯à¡C
+ ¤£¹L³o¦W¦r¥i¯à·|³y¦¨»~¸Ñ¡A¨Æ¹ê¤W¥¦¨Ã¤£«OÃÒ§Aªºµ{¦¡·|§¹¥þ²Å¦X ANSI ¼Ð·Ç¡C</para>
</listitem>
</varlistentry>
@@ -588,74 +473,57 @@
<term><option>-pedantic</option></term>
<listitem>
- <para>Turn off <emphasis>all</emphasis>
- <command>cc</command>'s non-<acronym>ANSI</acronym> C
- features.</para>
+ <para>¥þ±Ãö³¬ <command>cc</command> ©Ò¯S¦³ªº«D <acronym>ANSI</acronym> C ¼Ð·Ç¥\¯à¡C</para>
</listitem>
</varlistentry>
</variablelist>
- <para>Without these flags, <command>cc</command> will allow you to
- use some of its non-standard extensions to the standard. Some
- of these are very useful, but will not work with other
- compilers—in fact, one of the main aims of the standard is
- to allow people to write code that will work with any compiler
- on any system. This is known as <firstterm>portable
- code</firstterm>.</para>
-
- <para>Generally, you should try to make your code as portable as
- possible, as otherwise you may have to completely rewrite the
- program later to get it to work somewhere else—and who
- knows what you may be using in a few years time?</para>
+ <para>°£¤F³o¨Ç°Ñ¼Æ¡A<command>cc</command> ÁÙ¤¹³\§A¨Ï¥Î¤@¨ÇÃB¥~ªº°Ñ¼Æ¨ú¥N¼Ð·Ç°Ñ¼Æ¡A¦³¨ÇÃB¥~°Ñ¼Æ«D±`¦³¥Î¡A
+ ¦ý¬O¹ê»Ú¤W¨Ã¤£¬O©Ò¦³ªº½sĶ¾¹³£¦³´£¨Ñ³o¨Ç°Ñ¼Æ¡C
+ ·Ó¼Ð·Ç¨Ó¼gµ{¦¡ªº³Ì¥Dn¥Øªº´N¬O¡A§Æ±æ§A¼g¥X¨Óªºµ{¦¡¥i¥H¦b©Ò¦³½sĶ¾¹¤W½sĶ¡B°õ¦æµL»~¡A
+ ·íµ{¦¡¥i¥H¹F¦¨¤Wz¥Øªº®É¡A´NºÙ¬° <firstterm>portable code(²¾´Ó©Ê¨}¦nªºµ{¦¡½X)</firstterm>¡C</para>
+
+ <para>¤@¯ë¨Ó»¡¡A¦b¼¶¼gµ{¦¡®É´NÀ³nª`·N¡y²¾´Ó©Ê¡z¡C
+ §_«h¡C·í·Q§âµ{¦¡®³¨ì¥t¥~¤@¥x¾÷¾¹¤W¶]ªº®ÉÔ¡A´N¥i¯à±o»Ýn«¼gµ{¦¡¡C</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -Wall -ansi -pedantic -o foobar foobar.c</userinput></screen>
</informalexample>
- <para>This will produce an executable <filename>foobar</filename>
- after checking <filename>foobar.c</filename> for standard
- compliance.</para>
+ <para>¤Wz«ü¥O·|½T»{ <filename>foobar.c</filename> ¤ºªº»yªk¬O§_²Å¦X¼Ð·Ç¡A
+ ¨Ã¥B²£¥Í¦W¬° <filename>foobar</filename> ªº°õ¦æÀÉ¡C</para>
<variablelist>
<varlistentry>
<term><option>-l<replaceable>library</replaceable></option></term>
<listitem>
- <para>Specify a function library to be used at link time.</para>
+ <para>§i¶D gcc ¦b³sµ²(linking)µ{¦¡®É§A»Ýn¥Î¨ìªº¨ç¦¡®w¦WºÙ¡C</para>
- <para>The most common example of this is when compiling a
- program that uses some of the mathematical functions in C.
- Unlike most other platforms, these are in a separate
- library from the standard C one and you have to tell the
- compiler to add it.</para>
-
- <para>The rule is that if the library is called
- <filename>lib<replaceable>something</replaceable>.a</filename>,
- you give <command>cc</command> the argument
- <option>-l<replaceable>something</replaceable></option>.
- For example, the math library is
- <filename>libm.a</filename>, so you give
- <command>cc</command> the argument <option>-lm</option>.
- A common <quote>gotcha</quote> with the math library is
- that it has to be the last library on the command
- line.</para>
+ <para>³Ì±`¨£ªº±¡ªp´N¬O¡A·í§A¦bµ{¦¡¤¤¨Ï¥Î¤F C ¼Æ¾Ç¨ç¦¡®w¡A
+ ¸ò¨ä¥L§@·~¥¥x¤£¤@¼Ëªº¬O¡A³o¨Ç¼Æ¾Ç¨ç¦¡³£¤£¦b¼Ð·Ç¨ç¦¡®w(library)¤¤¡A
+ ¦]¦¹½sĶ¾¹¨Ã¤£ª¾¹D³o¨ç¦¡®w¦WºÙ¡A§A¥²¶·§i¶D½sĶ¾¹n¥[¤W¥¦¤~¦æ¡C</para>
+
+ <para>³o³W«h«Ü²³æ¡A¦pªG¦³Ó¨ç¦¡®w¥s°µ <filename>lib<replaceable>something</replaceable>/a</filename>¡A
+ ´N¥²¶·¦b½sĶ®É¥[¤W°Ñ¼Æ <option>-l<replaceable>something</replaceable></option> ¤~¦æ¡C
+ Á|¨Ò¨Ó»¡¡A¼Æ¾Ç¨ç¦¡®w¥s°µ <filename>libm.a</filename>¡A
+ ©Ò¥H§A¥²¶·µ¹ <command>cc</command> ªº°Ñ¼Æ´N¬O <option>-lm</option>¡C
+ ¤@¯ë±¡ªp¤U¡A³q±`·|§â³o°Ñ¼Æ¥²¶·©ñ¦b«ü¥Oªº³Ì«á¡C
+ </para>
<informalexample>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput>
</screen>
</informalexample>
- <para>This will link the math library functions into
- <filename>foobar</filename>.</para>
+ <para>¤W±³o«ü¥O·|Åý gcc ¸ò¼Æ¾Ç¨ç¦¡®w§@³sµ²¡A¥H«K§Aªºµ{¦¡¥i¥H©I¥s¨ç¦¡®w¤º§tªº¼Æ¾Ç¨ç¦¡¡C</para>
- <para>If you are compiling C++ code, you need to add
- <option>-lg++</option>, or <option>-lstdc++</option> if
- you are using FreeBSD 2.2 or later, to the command line
- argument to link the C++ library functions.
- Alternatively, you can run <command>c++</command> instead
- of <command>cc</command>, which does this for you.
- <command>c++</command> can also be invoked as
- <command>g++</command> on FreeBSD.</para>
+ <para>¦pªG§A¥¿¦b½sĶªºµ{¦¡¬O C++ µ{¦¡½X¡A§AÁÙ¥²¶·ÃB¥~«ü©w <option>-lg++</option> ©ÎªÌ¬O
+ <option>-lstdc++</option>¡C
+ ¦pªG§Aªº FreeBSD ¬O 2.2(§t)¥H«áª©¥»¡A
+ §A¥i¥H¥Î«ü¥O <command>c++</command> ¨Ó¨ú¥N <command>cc</command>¡C
+ ¦b FreeBSD ¤W <command>c++</command> ¤]¥i¥H¥Î <command>g++</command> ¨ú¥N¡C
+ </para>
<informalexample>
<screen>&prompt.user; <userinput>cc -o foobar foobar.cc -lg++</userinput> <lineannotation>For FreeBSD 2.1.6 and earlier</lineannotation>
--- zh_TW.Big5.20060725.developers-handbook3.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list