home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / acorn / programmer < prev   
Encoding:
Internet Message Format  |  2004-05-07  |  20.9 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!npeer.de.kpn-eurorings.net!newsfeed.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed2.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news2.euro.net!kibo.news.demon.net!news.demon.co.uk!demon!aether.demon.co.uk%faq
  2. From: faq@aether.demon.co.uk (Matthew Hambley)
  3. Newsgroups: comp.sys.acorn.programmer,comp.sys.acorn.announce,comp.answers,news.answers
  4. Subject: The comp.sys.acorn.programmer FAQ
  5. Followup-To: comp.sys.acorn.programmer
  6. Date: Wed, 05 May 2004 21:55:10 +0100
  7. Lines: 514
  8. Approved: news-answers-request@MIT.EDU
  9. Message-ID: <377e7eaa4c.faq@aether.demon.co.uk>
  10. NNTP-Posting-Host: aether.demon.co.uk
  11. X-Trace: news.demon.co.uk 1083863176 21760 158.152.186.18 (6 May 2004 17:06:16 GMT)
  12. X-Complaints-To: abuse@demon.net
  13. NNTP-Posting-Date: Thu, 6 May 2004 17:06:16 +0000 (UTC)
  14. Summary: This is the FAQ for the comp.sys.acorn.programmer news group. It gives answers to many often asked questions and some not so often asked questions.  It should be read by anyone considering posting to this group before they do so.
  15. Xref: senator-bedfellow.mit.edu comp.sys.acorn.programmer:72678 comp.sys.acorn.announce:8583 comp.answers:57096 news.answers:270970
  16.  
  17. Archive-name: acorn/programmer
  18. Posting-Frequency: monthly (approximately)
  19. Last-modified: 5th May 2004
  20. Version: 1.36
  21. Maintainer: Matthew Hambley (faq@aether.demon.co.uk)
  22. Disclaimer: Approval for *.answers is based on form, not content.
  23.  
  24. -----BEGIN PGP SIGNED MESSAGE-----
  25. Hash: SHA1
  26.  
  27.                      The comp.sys.acorn.programmer FAQ
  28.  
  29.                             1.36 - 5th May 2004
  30.  
  31. There are a number of questions which crop up time and again in the
  32. comp.sys.acorn.programmer newsgroup. This FAQ hopes to answer these in an
  33. attempt to keep the signal to noise ratio on the group high. It also covers
  34. a number of points concerning the nature of the news group itself.
  35.  
  36. Please be aware that this FAQ does not hope to be a comprehensive resource
  37. for programmers. Rather it is intended to be what it claims to be, an
  38. answer to some frequently asked questions. If you don't like this, please
  39. feel free to write and maintain your own.
  40.  
  41. Furthermore note that due to the depressingly large amounts of spam which
  42. afflict my FAQ e-mail address I automatically delete all mail which does
  43. not have the word "FAQ" in the subject line. Simply replying to this post
  44. is OK otherwise make sure you include "FAQ" somewhere in the subject.
  45.  
  46. Current maintainer: Matthew Hambley <faq@aether.demon.co.uk>
  47. Web version: <http://www.aether.demon.co.uk/faqs/programmer.html>
  48.  
  49. Revision History
  50. ================
  51.  
  52. Only the 3 most recent releases are given here. Should you wish to view the
  53. complete history, visit: <>
  54.  
  55.     v1.36 (5th May 2004)
  56.         * Added more languages
  57.         * Removed C-learning service
  58.         * Many changes to library deatails
  59.         * Updated GCC information
  60.         * Re-worded to clarify the status of this document
  61.         * Re-wrote 32-bit processor section
  62.  
  63.     v1.35 (15th April 2004)
  64.         * Spelling mistakes and typo squashing session
  65.         * Added Bob to the languages list
  66.         * Added Weave to the languages list
  67.  
  68.     v1.34 (5th October 2003)
  69.         * Removed Dynamite from the library list as it is no longer easily
  70.           available
  71.         * Some random tidying up
  72.  
  73. Questions and Answers
  74. =====================
  75.  
  76. 1. Concerning the news group itself
  77.  
  78.     1.1. What is comp.sys.acorn.programmer?
  79.  
  80.         Comp.sys.acorn.programmer is a newsgroup for discussion regarding
  81.         programming RISC OS computer systems. Its remit is wide covering
  82.         everything from novice programmers to assembly hackers.
  83.  
  84.         You are encouraged to ask any programming questions but be aware
  85.         that you may find people more knowledgeable in a specific area of
  86.         programming (e.g. 3D graphics) on a group dedicated to that
  87.         subject.
  88.  
  89.     1.2. Are there any matters of netiquette of which I should be aware?
  90.  
  91.         First, a reminder of basic netiquette. Before posting a question
  92.         check that it is not in this FAQ. Then check that it has not been
  93.         discussed before. Google[1] may be used for this last task.
  94.  
  95.         You may also find an answer to your question in either a RISC OS
  96.         specific web site (try Acorn Search[2]) or a generic programming
  97.         resource such as Wotsit [3].
  98.  
  99.         Finally consider whether your question is appropriate to
  100.         comp.sys.acorn.programmer. In particular bear in mind that although
  101.         you are writing your program on a RISC OS machine your question may
  102.         not be RISC OS specific. In these cases there may be a more
  103.         appropriate group available.
  104.  
  105.         Having said all that don't be put off posting. As long as the
  106.         denizens of the group think you have employed due diligence in
  107.         searching for an answer they will be happy to try and help.
  108.  
  109.         One last thought. Do not end your message with "Please reply by
  110.         private e-mail as I do not read this group." This is considered
  111.         exceptionaly rude and exploitative. If you can not be bothered to
  112.         participate in the group, even for the life span of your query,
  113.         then the regulars can not be bothered to help you.
  114.  
  115.         [1] http://groups.google.com/
  116.         [2] http://www.drobe.co.uk/search?launched=yes&type=pages&term=none
  117.         [3] http://www.wotsit.org
  118.  
  119.     1.3. What are the rules regarding code fragments?
  120.  
  121.         It is often a good idea to include a code fragment when asking a
  122.         question as it is often much easier to sort out the problem from
  123.         the code than from a hand-wavey discription. The golden rule is
  124.         "Keep it short and relevant ".
  125.  
  126.         Another trick to make potential helpers' lives easier and increase
  127.         the likelyhood of you getting a useful reply is to include as much
  128.         error information as you can. Also outline your debugging effort to
  129.         date: What you have tried and what did and didn't work.
  130.  
  131.         Code fragments should be included in-line rather than being
  132.         attached with uucode or MIME. It is also not acceptable to attach
  133.         binary files to your posts. If you feel that a binary will make
  134.         matters clearer then upload it to a web site and provide a link to
  135.         it.
  136.  
  137. 2. On the matter of languages and libraries
  138.  
  139.     2.1. Which programming languages are available?
  140.  
  141.         The most obvious languages are BASIC with its built in assembler as
  142.         these are provided "for free" with the operating system. There are
  143.         a number of C/C++ products as outlined in a following question. The
  144.         Acorn C/C++ package also comes with the ObjAsm assembly language
  145.         development application. Other languages which have received ports
  146.         over the years include:
  147.  
  148.         Ada
  149.  
  150.         AWK <http://awk.riscos.org.uk/>
  151.  
  152.         Bob last known version 4 <http://www.wra1th.plus.com/prog.html>
  153.  
  154.             This language is derived from Bob 1.5, an experimental
  155.             object-oriented language with a C-like syntax by David Betz and
  156.             the subject of an article in Dr Dobbs Journal in September
  157.             1991. Betz is the author of XLisp and later became programming
  158.             language consultant for Apple; NewtonScript has strong
  159.             resemblances to Bob.
  160.  
  161.             ArmBob is a Risc OS extension of Bob. You can write wimp
  162.             programs with it.
  163.  
  164.         Forth <ftp://ftp.taygeta.com/pub/Forth/Reviewed/forthmacs.arc>
  165.  
  166.         Fortran
  167.  
  168.             From Intellegent Interfaces.
  169.  
  170.         Foger
  171.  
  172.         Haskell
  173.  
  174.         Icon
  175.  
  176.         Java
  177.  
  178.         Lisp <http://www.users.dircon.co.uk/~arcangel/files/>
  179.  
  180.         Lua <http://lua.riscos.org.uk/>
  181.  
  182.         Pascal
  183.  
  184.         Perl
  185.  
  186.         PHP <http://www.php.alexwaugh.com/>
  187.  
  188.         Python <http://www.schwertberger.de/>
  189.  
  190.         Sather
  191.  
  192.         Smalltalk <http://sumeru.stanford.edu/tim/pooters/squeak.html>
  193.  
  194.         Weave <http://weave.riscos.org.uk/>
  195.  
  196.             This is a programming language specialised for constructing web
  197.             sites. It is a full programming language with variables,
  198.             functions etc, in which the names of HTML tags become strings,
  199.             functions or functionals.
  200.  
  201.     2.2. Are there any libraries or similar to ease BASIC programming?
  202.  
  203.         There certainly are:
  204.  
  205.         DrWimp (freeware) last known version 3.81
  206.         <http://www.argonet.co.uk/users/rayfavre/drwimp.html>
  207.  
  208.             A highly regarded set of resources including not only a library
  209.             but also a skeleton application to ease matters further.
  210.  
  211.         AppBasic last known version 0.02
  212.         <http://www.jettons.co.uk/riscos/toolbox/>
  213.  
  214.             The aim of this package is to offer a Visual BASIC style
  215.             environment whereby WIMP applications may be developed quickly.
  216.             It utilises the Toolbox modules and replaces EasyB by the same
  217.             author.
  218.  
  219.         JFShared last known version 2.54
  220.         <http://www.movspclr.co.uk/jfshared.html>
  221.  
  222.             A collection of BASIC libraries which come with a few templates
  223.             to get you started. This library was written by Justin Fletcher
  224.             for his own use so your mileage may vary.
  225.  
  226.         SharedBLib (GPL)
  227.  
  228.             In the vein of SharedCLib a set of BASIC libraries which exist
  229.             only once in memory. Supports both CLI and WIMP interfaces and
  230.             networking.
  231.  
  232.         WimpBASIC2
  233.  
  234.             A commercial development environment from APDL.
  235.  
  236.         WimpWorks (ukp35)
  237.         <http://www.jaffasoft.co.uk/product/wimpworks.html>
  238.  
  239.             A commercial development environment from Jaffa Software.
  240.  
  241.     2.3. I want to work in C/C++, what is available?
  242.  
  243.         Acorn C/C++ (ukp125)
  244.  
  245.             Includes the toolbox bits and a pile of other utilities.
  246.  
  247.             The C compiler (often refered to as Norcroft) is very capable
  248.             however the C++ compiler is based on CFront and as such is
  249.             showing its age.
  250.  
  251.         Easy C/C++ (ukp30)
  252.  
  253.             Originally produced by Beebug, now sold by ProAction/APDL. It
  254.             aims to be a good basic C and C++ compiler. It is a little
  255.             dated now and some doubt has been case as to its reliability on
  256.             newer machines. However it is cheap and therefore ideal for
  257.             people who are just learning or who are dabbling and don't want
  258.             to muck about with command lines as in GCC.
  259.  
  260.         GCC (free) last known version 2.95.4
  261.         <http://hard-mofo.dsvr.net/gcc/>
  262.  
  263.             The GNU Compiler Collection ported to RISC OS. Comes with C,
  264.             C++ and Fortran77/Fortran90 compilers. Requires a shed load of
  265.             memory to run so not really suitable for people with 4MB
  266.             machines. Includes a linker.
  267.  
  268.             A competent compiler with good optimisation capabilities.
  269.  
  270.         GCC last known version 3.3.3 <http://hard-mofo.dsvr.net/gcc/>
  271.  
  272.             The latest version of the GNU Compiler Collection ported to
  273.             RISC OS. Still in pre-release state but already being used "for
  274.             real". Offers more features than previous versions but is also
  275.             slower and a bigger resource hog.
  276.  
  277.         LCC (free) last known version 4.20 <http://www.riscos.info/lcc/>
  278.  
  279.             This C compiler is designed to be light-weight. As such it does
  280.             not support the various extensions which GCC has added. Nor
  281.             does it include a C++ compiler.
  282.  
  283.         There was also a C interpreter, is that still available? I think it
  284.         was written by Hugo Fiennes and came on a magazine cover disc. We
  285.         have a vote for Acorn User, February 1994.
  286.  
  287.         CMunge
  288.         <http://support.riscos.com/Support/Resources/Libraries/StubsG/>
  289.  
  290.             Generates a code skeleton to allow the programming of
  291.             relocatable modules in C. Similar to CMHG which comes with the
  292.             Acorn C/C++ environment but, according to advocates, better.
  293.             May be found in the stubsg collection.
  294.  
  295.         conio.h
  296.  
  297.             Port of "the most abhorrent M$ lib/header file".
  298.  
  299.         ChoX11 last known version 0.14 <http://www.riscos.info/xlib/>
  300.  
  301.             An X client library produced as part of the authors Unix
  302.             Porting Project.
  303.  
  304.         Curses
  305.  
  306.             Port of the Unix command line cursor control system.
  307.  
  308.         DeskLib <http://www.riscos.info/desklib/>
  309.  
  310.             The library from which Desk is a fork.
  311.  
  312.         Desk last known version 3.24
  313.         <http://www.philipnet.com/libraries/desk.php>
  314.  
  315.             A fork of DeskLib.
  316.  
  317.         Dreamscape
  318.  
  319.             This C++ class library was last updated in June 1998 and an
  320.             archive of it could not be found at the time of writing. It
  321.             wraps up the various toolbox modules in an object oriented
  322.             fashion.
  323.  
  324.         FlexLib
  325.  
  326.             Memory manager
  327.  
  328.         JSLib
  329.  
  330.             Mozilla JavaScript library. Allows applications to support JS
  331.             scripting.
  332.  
  333.         Mesa <http://www-solar.mcs.st-and.ac.uk/~davidb/Mesa/>
  334.  
  335.             A port of this OpenGL based 3D graphics library. David is keen
  336.             that others get involved with using and developing this
  337.             library.
  338.  
  339.         OSLib (GPL) last known version 6.50
  340.         <http://ro-oslib.sourceforge.net/>
  341.  
  342.             Well thought of and nigh on comprehensive set of libraries. A
  343.             recent revision introduced 26/32-bit agnostic code and support
  344.             for RISC OS 5 and Select API's.
  345.  
  346.         RiscXLib <http://www.beyondthought.co.uk/RISCOS/index.html>
  347.  
  348.             A set of X client libraries to complement the authors XServer
  349.             for RISC OS.
  350.  
  351.         StubsG last known version 0.04
  352.         <http://support.riscos.com/Support/Resources/Libraries/StubsG/>
  353.  
  354.             The full gammet of libraries supplied by RISC OS Ltd. Not only
  355.             does this include the stubs library for use with the shared C
  356.             library but also libraries for the toolbox modules, tcp/ip and
  357.             memory allocation.
  358.  
  359.         UnixLib <http://hard-mofo.dsvr.net/gcc/>
  360.  
  361.             Provides all the functions required for GCC but can also be
  362.             used with Acorn C. Very useful for porting Unix applications.
  363.  
  364.         ylib
  365.  
  366.             For machines with floating point hardware. Provides faster
  367.             versions of the maths functions.
  368.  
  369.     2.4. Where can I get an update to the Java virtual machine?
  370.  
  371.         If you have version 0.76 then you can't, that's the most recent
  372.         there is.
  373.  
  374.     2.5. What is available in the way of Java tools?
  375.  
  376.         There is a web site at which further information[4] may be found.
  377.  
  378.           Virtual Machines
  379.         There is currently one complete Java Virtual Machine (JVM)
  380.         available for RISC OS machines. Called RiscCafe it was written by
  381.         Acorn and is therefore not currently supported. It supports applets
  382.         written to the 1.0.2 standard. If you want a copy keep your eyes on
  383.         the charity stalls at shows or the small ads in magazines.
  384.  
  385.         A coding group called eQ R&D gas recently released an alpha test
  386.         version of their JVM, Zhaba[5]
  387.  
  388.         A third JVM, called Chockcino, is currently under development. As
  389.         yet no release date is known.
  390.  
  391.           Compilers
  392.         Two Java compilers exist for RISC OS. The first, guavac, compiles
  393.         to the 1.1 version of the Java run-time environment. It can be used
  394.         in conjuction with the libraries supplied with RiscCafe or version
  395.         1.1 libraries are available for it. Guavac support has been dropped
  396.         in favour of Jikes.
  397.  
  398.         The second compiler is a port of Jikes from IBM. It's newer,
  399.         faster, leaner and smells of peppermint.
  400.  
  401.         [4] http://www.chocky.org/java/
  402.         [5] http://www.eqrd.net/english/riscos/index.html
  403.  
  404. 3. Programming RISC OS
  405.  
  406.     3.1. How do I get started?
  407.  
  408.         In my experience the best way to learn programming is to do it
  409.         however some tutorials and reference material can be invaliable.
  410.  
  411.         The various Acorn/RISC OS magazines have covered this topic
  412.         (generally some time ago so you will have to seek out back issues)
  413.         and I can particularly recomend some of the series run in <<Risc
  414.         User>>. The book <<Wimp Programming for All>> is based on these
  415.         articles and is available on the "RISC User in a Nutshell" CD-ROM.
  416.  
  417.         You may also be interested in Paul Vigays "RISC OS Academy"
  418.         initiative. This is an on-line correspondence course which is to
  419.         cover BASIC programming as well as a number of other topics
  420.         including HTML coding. Details[6] of the syllabus and subscription
  421.         rates are available.
  422.  
  423.         [6] http://www.vigay.com/academy/
  424.  
  425.     3.2. I need manuals and other technical information. Where can I get
  426.          it?
  427.  
  428.         As part of their Select scheme RISC OS Ltd are building up a
  429.         comprehensively revised and updated set of PRMs. This is available
  430.         in electronic form from the Select members private site. This is
  431.         going to be a definitive reference for many things and is another
  432.         good reason for joining the Select scheme. (I also give excelent
  433.         false witness, price list is available on request)
  434.  
  435.         There is also a wealth of information for C programmers at
  436.         riscos.info[7].
  437.  
  438.         [7] http://www.riscos.info
  439.  
  440. 4. Technical issues of import
  441.  
  442.     4.1. What's all this about '32-bit' code?
  443.  
  444.         It relates to the underlying ARM hardware; the simplest explanation
  445.         is that the earliest ARM CPUs used a combined program
  446.         counter/processor status register. This limited the effective
  447.         address range to 64MB ("26-bit" code). Later ARM CPUs provide
  448.         26-bit compatibility along with extra modes that have separate
  449.         program counter and status registers ("32-bit" code).
  450.  
  451.         Some ARM CPUs - such as the one used in the Castle Iyonix - lack
  452.         the 26-bit compatibility modes. For one thing 26-bit mode is
  453.         incompatible with the "Thumb" instruction set provided by some ARM
  454.         processors.
  455.  
  456.         There is a longer disertation[8] on this topic should you wish some
  457.         further reading.
  458.  
  459.         [8] http://www.riscos.info/32bit/
  460.  
  461.     4.2. Fine, but what C/C++ stuff is 32-bit compatible?
  462.  
  463.         Castle sell an improved version of the Norcroft compiler, tools and
  464.         libraries which includes an addressing scheme agnostic (i.e. it
  465.         works for both 26 and 32 bit addressing modes) version of the
  466.         shared C library.
  467.  
  468.         GCC also offers 32-bit addressing mode support as does LCC.
  469.  
  470.         As far as libraries are concerned most have now been updated but
  471.         check with the original distribution site before assuming that the
  472.         one you use has.
  473.  
  474. 5. Gotchas of which to be aware
  475.  
  476.     5.1. My BASIC IF...ENDIF block doesn't appear to be working properly
  477.  
  478.         Chances are you have a space after the THEN. In these cases BASIC
  479.         will assume that it is dealing with a single line IF. Thus it will
  480.         execute the rest of the block regardless of the state of the
  481.         condition.
  482.  
  483.         There are a number of ways of avoiding this problem in the future.
  484.         Both Zap and StrongEd provide a means whereby trailing spaces may
  485.         be automatically stripped on file save. Alternatively you can use
  486.         the BASIC command CRUNCH to perform a number of size reducing
  487.         operations including the removal of trailing spaces.
  488.  
  489.     5.2. When I try to run another program from within my BASIC application
  490.          something weird happens.
  491.  
  492.         Performing this task is a little trickier than you might at first
  493.         think. It is not simply a matter of *RUNing the new program as
  494.         doing this will replace the currently executing code with the new
  495.         stuff. Hence when the new program finishes executing it will exit
  496.         but the original program is no longer in existence to return to.
  497.  
  498.         There are a number of ways to achieve the desired goal. The
  499.         hardest, most prone to errors and least recommended method is to
  500.         fiddle around, a lot, to set up a new environment in which the new
  501.         program may run.
  502.  
  503.         If you are looking for an easier and less nasty way there are
  504.         several. There is *WimpTask which will work inside and outside the
  505.         WIMP. Be warned though that you have to be careful keeping track of
  506.         which task is swapped in at any given time. If you try to include
  507.         arguments to the new program by placing them in memory which is
  508.         then swapped out you can suffer crashes.
  509.  
  510.         There is also the BASICShell module which is part of the SharedBLib
  511.         library. This module may have trouble if another has claimed
  512.         certain vectors.
  513.  
  514.         Finally you can try hacking the code which provides this function
  515.         out of the SlideShow application.
  516.  
  517. -----BEGIN PGP SIGNATURE-----
  518. Version: GnuPG v1.2.4-sb1 (RISC OS)
  519.  
  520. iEYEARECAAYFAkCZUZYACgkQMrwdKMmRE3v5/ACeIbozKYV1b8B5gaC/PRKSRWtk
  521. X3kAoIHtt1sOmzkqP5OKNGCXro1rwh2C
  522. =AdRx
  523. -----END PGP SIGNATURE-----
  524.  
  525. -- 
  526.                           (\/)atthew )-(ambley
  527.      Maintainer of the comp.sys.acorn.games and programmer FAQ lists
  528. E-mail : faq@aether.demon.co.uk                    Public key ID : C991137B
  529.                    http://www.aether.demon.co.uk/faqs/
  530.  
  531.