added tools and web dirs

This commit is contained in:
Andreas Rumpf 2009-09-15 23:22:22 +02:00
commit 66a7e3d37c
489 changed files with 4593 additions and 9878 deletions

6
web/community.txt Executable file
View file

@ -0,0 +1,6 @@
Discuss Nimrod in our `forum <http://force7.de/heimdall>`_.
Visit our project page at Launchpad: https://launchpad.net/nimrod.
Bug reports: https://bugs.launchpad.net/nimrod.

1
web/documentation.txt Executable file
View file

@ -0,0 +1 @@
.. include:: ../doc/docs.txt

17
web/download.txt Executable file
View file

@ -0,0 +1,17 @@
There are two major products that come out of Berkeley: LSD and UNIX.
We don't believe this to be a coincidence. -- Jeremy S. Anderson.
Here you can download the latest version of the Nimrod Compiler.
Please choose your platform:
* source-based installation: `<download/nimrod_0.8.0.zip>`_
* installer for Windows XP/Vista (i386): `<download/nimrod_0.8.0.exe>`_
(includes GCC and everything else you need)
The source-based installation has been tested on these systems:
* Linux: i386, AMD64
* Mac OS X: i386
Other UNIX-based operating systems may work. An older version was tested on
FreeBSD (i386).
.. include:: ../install.txt

127
web/index.txt Executable file
View file

@ -0,0 +1,127 @@
====
Home
====
The most important thing in the programming language is the name. A language
will not succeed without a good name. I have recently invented a very good
name and now I am looking for a suitable language.
-- D. E. Knuth
**This page is about the Nimrod programming language, which combines Lisp's
power with Python's readability and C's performance.**
Welcome to Nimrod
-----------------
.. container:: snippet
*Nimrod looks like this:*
.. code-block:: nimrod
# Filter key=value pairs
import regexprs
for x in lines("myfile.txt"):
if x =~ r"(\w+)=(.*)":
echo "Key: ", matches[1],
" Value: ", matches[2]
**Nimrod** is a new statically typed, imperative
programming language, that supports procedural, object oriented, functional
and generic programming styles while remaining simple and efficient.
A special feature that Nimrod inherited from Lisp is that Nimrod's abstract
syntax tree (*AST*) is part of the specification - this allows a powerful
macro system which allows domain specific languages.
Nimrod is a compiled, garbage-collected systems programming language
which has an excellent productivity/performance ratio. Nimrod's design
focuses on the 3E: efficiency, expressiveness, elegance (in the order of
priority).
Nimrod is efficient
===================
* Native code generation (currently via compilation to C), not dependant on a
virtual machine: **Nimrod produces small executables without dependencies
for easy redistribution.**
* A fast non-recursive incremental and generational garbage collector that
should be well suited for soft real-time systems (like games).
* System programming features: Ability to manage your own memory and access the
hardware directly. Pointers to garbage collected memory are distinguished
from pointers to manually managed memory.
* Zero-overhead iterators.
* Cross-module inlining.
* Compile time evaluation of user-defined functions.
* Whole program dead code elimination: Only *used functions* are included in
the executable.
* Value-based datatypes: For instance, objects and arrays can be allocated on
the stack.
Nimrod is expressive
====================
* Built-in high level datatypes: strings, sets, sequences, etc.
* Modern type system with local type inference, tuples, variants,
generics, etc.
* User-defineable operators; code with new operators is often easier to read
than code which overloads built-in operators. In the code snippet, the
``=~`` operator is defined in the ``regexprs`` module.
* Macros can modify the abstract syntax tree at compile time.
Nimrod is elegant
=================
* Macros cannot change Nimrod's syntax because there is no need for it.
Nimrod's syntax is flexible enough.
* Yet Nimrod can be parsed with an LL(1) parser.
* Statements are grouped by indentation but can span multiple lines.
Indentation must not contain tabulators so **the compiler always sees
the code the same way as you do**.
* Nimrod is a simple language that leads to simple programs. However,
the language is not crippled in the name of simplicity.
Nimrod plays nice with others
=============================
* The Nimrod Compiler runs on Windows, Linux, BSD and Mac OS X.
Porting to other platforms is easy.
* **There are bindings to GTK2, the Windows API, the POSIX API, OpenGL, SDL,
Cario, Python, Lua, TCL, X11, libzip, PRCE, ODBC, libcurl, mySQL and SQLite.**
New bindings are easily generated in a semi-automatic way.
* A Pascal to Nimrod conversion utility: A large subset of Object Pascal
can be translated to Nimrod automatically!
* Nimrod's documentation syntax is a subset of the wonderfully readable plaintext
markup syntax
`reStructuredText <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_.
**The documentation generator is very flexible; this website has been generated
with it!**
Roadmap to 1.0
==============
Version 0.8.4
* general expressions as generic parameters
* multimethods
Version 0.9.0
* closures and anonymous procs
* provide an API for object serialization
Version 1.0.0
* stress testing with a better test suite
* fix symbol files to make the compiler incremental
Planned features beyond 1.0
===========================
* Threading with a transactional memory modell (the type system may be
enhanced to support extensive compile-time checks for this)
* Recursive iterators/coroutines
* Other code generators: LLVM, EcmaScript

0
web/links.txt Executable file
View file

368
web/news.txt Executable file
View file

@ -0,0 +1,368 @@
====
News
====
2009-09-12 Date Version 0.8.0 released
======================================
Bugfixes
--------
- fixed a small bug that caused the compiler to not report unused
overloaded symbols
- fixed a small bug concerning symbol overloading
- fixed a typo: it's "ambiguous", not "ambigious" ;-)
- the compiler now detects recursive include files
- ``system.card`` should work again
- ``items`` for ``set[char]`` and ``array[char, T]`` should work now
Additions
---------
- implemented generic types and two phase symbol lookup in generic routines
- template parameters can now be real types
- implemented generalized raw string literals: ``ident"abc"`` is a shortcut for
``ident(r"abc")``
- in overloading resolution iterators are separated from procs; iterators now
can have the same name+signature as procs
- symbol lookup in templates can be affected by the new ``bind`` keyword
- the compiler now accepts a ``--no_main`` switch for better link
interoperability with other compiled languages
- implemented tuple unpacking in ``var`` sections
- the code generator emits ``default: __assume(0);`` for Visual C++
(for optimization)
- the compiler now checks if a proc has side effects; procs that are declared
to have no side effects are rejected if the compiler cannot verify this
- the format operator ``strutils.%`` now supports ``$#`` for automatic argument
counting
- implemented ``strutils.join``
Changes affecting backwards compability
---------------------------------------
- two phase symbol lookup is performed in generic routines
- ``bind`` is now a reserved word; ``exception`` is no reserved word anymore
- abstract types have been renamed to distinct types; thus
``distinct`` is now a reserved word; ``abstract`` is no reserved word anymore
- ``system.openFile`` deprecated: use ``system.open`` instead
- ``system.closeFile`` deprecated: use ``system.close`` instead
- ``strutils.replaceStr`` deprecated: use ``strutils.replace`` instead
- ``strutils.deleteStr`` deprecated: use ``strutils.delete`` instead
- ``strutils.splitSeq`` deprecated: use ``strutils.split`` instead
- ``strutils.splitLinesSeq`` deprecated: use ``strutils.splitLines`` instead
- ``strutils.parseFloat`` does not accept an additional ``start`` parameter
anymore
Documentation
-------------
- the manual has been improved
2009-06-08 Version 0.7.10 released
==================================
Nimrod version 0.7.10 has been released! Get it `here <./download.html>`_.
Bugfixes
--------
- fixed bug #374441, #376113
- the posix module works for Mac OS X again
- returning an array should now work
- fixed a serious bug in several parsers: the cached buf pointer
must be updated after a reallocation of the buffer
- fixed a CSS bug that kept Firefox from rendering parts of
the generated documentation properly
- fixed a bug concerning evaluation of command statements
- overloading of ``inc``, ``dec``, ``pred``, ``succ`` should now work
- ``removeDir`` now works as the documentation says: it even removes
directories that are not empty
Additions
---------
* zero argument templates/macros can now be invoked without ``()``,
because this is not ambiguous
* new modules in the library:
- ``dynlib``: load symbols from a shared library
- ``python``: wrapper for the Python programming language
- ``tcl``: wrapper for the TCL programming language
* added ``system.max``, ``system.min`` for open arrays
* added ``system.each`` built-in
* added ``os.getFilePermissions``, ``os.setFilePermissions``,
``os.inclFilePermissions``, ``os.exclFilePermissions``
* the ``dynlib`` import mechanism now supports a flexible versioning scheme:
.. code-block:: nimrod
proc Tcl_Eval(interp: pTcl_Interp, script: cstring): int {.cdecl,
importc, dynlib: "libtcl(8.5|8.4|8.3|8.2|8.1).so.(1|0)".}
* implemented ``abstract`` types
Changes affecting backwards compability
---------------------------------------
- the organization within the ``lib`` folder now reflects the documentation;
as a result old configuration files need to be updated
- ``abstract`` is now a reserved keyword
- ``echo`` is now a built-in macro that accepts a variable numer of
arguments of different types (and calls ``$`` for the arguments that need
it); as a result it cannot be overloaded anymore
- ``where`` is no keyword anymore
- installation on UNIX produces a release version of the compiler
2009-05-08 Version 0.7.8 released
=================================
Nimrod version 0.7.8 has been released!
Apart from bugfixes and added libraries the biggest change is that Nimrod
now has a new memory manager which:
- interacts much better with the GC
- uses less memory
- is faster than the old memory manager (``dlmalloc``)
- releases memory back to the operating system
Bugfixes
--------
- generics are now processed earlier in the pipeline; thus
generics can be used within macros
- changed bootstrapping in ``koch.py`` and ``boot.nim`` to fix
bug #369607
- the compiler now checks that ``yield`` is used inside a loop
- fixed a bug in the evaluation code for ``system.len``,
``system.setlen`` and ``system.newSeq``
- overflow checking for ``newSeq`` fixes a security issue
Additions
---------
- new module: ``parsecsv`` for parsing CSV files
- new module: ``xmlgen`` for generating XML or HTML
- new module: ``osproc`` for OS process communication
- added ``math.TRunningStat`` object and its methods
- added ``strutils.validIdentifier``
- the reStructuredText parser now supports the ``container`` directive that
translates to the HTML ``div`` element
- the ``cgi`` module registers a handler, so that stack traces contain the
HTML ``<br />`` element making CGI applications easier to debug
- added the ``cgi.decodeData`` iterator
- ``copy`` and ``newString`` can now be evaluated at compile time. As a
result more procedures from the ``strutils`` module can be evaluated at
compile time.
- ``macros.error`` now prints a stack trace
- Nimrod now supports the Boehm-Demers-Weiser conservative garbage collector:
The ``--gc:boehm`` command line switch activates it. However, the native
Nimrod collector is faster!
Documentation
-------------
- Nimrod's abstract syntax trees are now documented in the
`macros <macros.html>`_ module. Unfortunately the documentation is still
incomplete.
2009-04-22 Version 0.7.6 released
=================================
Nimrod version 0.7.6 has been released!
This is mostly a bugfix release. Some new features and libraries have
also been implemented.
Bugfixes
--------
- installation on Windows Vista may now work out of the box; please try!
- fixed a bug that kept the "recursive modules" example from working
- mixing named and unnamed parameters in a procedure call now works
- octal numbers with the prefix ``0c`` are now properly supported
- enumerations now may start with negative values
- ``parseInt``, ``ParseBiggestInt`` now throw an exception if the
string does not end after the parsed number
- the compiler now handles top-level statements correctly
- generated ``nimcache`` directory never ends in a slash
- ``createDir`` now works for global directories under UNIX ("/somepath/here")
- the compiler now executes the executable with a leading "./" under UNIX
- the compiler now supports constant arrays of procedure pointers
- ``elif`` in ``case`` statements now works
- iterators using an open array parameter now work
- fixed a bug where in some contexts ``$myEnum`` did not work
Additions
---------
- implemented the passing of a code-block to the last parameter of a
template/macro:
.. code-block:: nimrod
template withFile(f, filename, mode: expr,
actions: stmt): stmt =
block:
var f: TFile
if openFile(f, filename, mode):
try:
actions
finally:
closeFile(f)
else:
quit("cannot open: " & filename)
withFile(txt, "ttempl3.txt", fmWrite):
txt.writeln("line 1")
txt.writeln("line 2")
- new pragma ``deprecated`` can be used to mark deprecated identifiers
- added ``system.pop`` built-in for sequences
- added ``addf``, ``addSep`` and ``validEmailAddress`` to the
``strutils`` module
- nice ``=~`` template operator for the ``regexprs`` module
- the scoping rules for ``for``, ``while``, ``if``, ``case`` changed
in a subtle way to support the new ``=~`` template
- added common regular expressions for regexprs
- ``posix`` module now declares socket stuff
- new module: ``cgi`` for creating CGI applications
- new module: ``terminal`` for simple terminal output customization
- new module: ``parsexml`` for HTML/XML parsing with some support for
parsing *dirty* HTML
- new module: ``web`` for retrieving web pages
- new module: ``md5`` for computation of MD5 checksums
- new wrappers: ``mysql``, ``sqlite3``, ``libcurl``
Changes affecting backwards compability
---------------------------------------
- ``strutils.findSubStr``, ``strutils.findChars`` deprecated:
use ``strutils.find`` instead
Documentation
-------------
- The library is now divided into *pure libraries*, *impure libraries*
and *wrappers*.
2009-01-22 Forum added
======================
We now have a `forum <http://www.ethexor.com/heimdall>`_ where you can discuss
Nimrod.
2009-01-07 Version 0.7.4 released
=================================
Nimrod version 0.7.4 has been released!
Bugfixes
--------
- installation on Windows should work now if the directory contains spaces
- the documentation generator now only renders documentation comments
- ``\`` is allowed for operators as the manual says
- in rare cases, the index check has been optimized away, even though
it would have been necessary
- several bugfixes for tuple types
Additions
---------
- added an ``unicode`` module for UTF-8 handling
- added ``hostOS`` and ``hostCPU`` magics to the ``system`` module
- ``system.echo`` now accepts multiple arguments
- added optimization: in some cases inlining of iterators now produces
substantially better code
- added whole program dead code elimination
- the magic ``$`` operator now works for enumerations
- in ``const`` sections advanced compile time evaluation is done:
.. code-block:: nimrod
proc fac(n: int): int =
if n <= 1: return 1
else: return n*(fac(n-1))
const
z = fac(3) # computes 6 at compile time
Changes affecting backwards compability
---------------------------------------
- renamed ``in_Operator`` to ``contains``: ``in`` is now a template that
translates to ``contains``
- changed ``strutils.quoteIfSpaceExists`` to ``strutils.quoteIfContainsWhite``
- the parser is now much more picky about missings commas, etc. If this affects
your code too much, try to run your code through the pretty printer.
- the ``macros`` API is no longer part of the ``system`` module, to use this
API you now have to import the ``macros`` module
Documentation
-------------
- added a tutorial
2008-12-12 Version 0.7.2 released
=================================
Nimrod version 0.7.2 has been released! This is a bugfix release. This most
important fix is that Nimrod now works again on AMD64 (x86_64) processors. No
new features have been implemented.
2008-11-16 Version 0.7.0 released
=================================
Nimrod version 0.7.0 has been released!
Changes:
* various bug fixes, too many to list them here
* the installation for UNIX-based systems does not depend on Python any longer
* the ``koch.py`` script now works with older Python versions (including 1.5.2)
* changed integer operations and conversions rules
* added ``GC_ref`` and ``GC_unref`` procs
* sequences now need to be constructed with the ``@`` operator. This leads to
less ambiguities.
* the compiler now uses less memory and is much faster
* the GC is now much faster
* new bindings: zlib, SDL, Xlib, OpenGL, ODBC, Lua
* the generated C code is much faster to optimize with GCC
* new libraries: streams, zipfiles
* the Nimrod compiler has been ported to FreeBSD: it should work on
other BSD's too
2008-08-22 Version 0.6.0 released
=================================
Nimrod version 0.6.0 has been released!
**This is the first version of the compiler that is able to compile itself!**
A nice side-effect from this is that a source-based installation does not
depend on FreePascal any longer.
Changes:
* various bug fixes, too many to list them here
* cleaned up the type system: records are now superfluous and not
supported anymore
* improved the performance of the garbage collector
* new modules in the library:
- ``parseopt``: a simple to use command line parser
- ``hashes``: efficient computation of hash values
- ``strtabs``: efficient mapping from strings to strings
- ``parsecfg``: an efficient configuration file parser
* macros and compile-time evaluation implemented (however, still experimental)
* generics implemented (however, still experimental)

41
web/nimrod.ini Executable file
View file

@ -0,0 +1,41 @@
[Project]
Name: "Nimrod"
Title: "Nimrod Programming Language"
Logo: "efficient, expressive, elegant"
Authors: "Andreas Rumpf"
[Links]
GCC: "http://gcc.gnu.org"
LLVM: "http://llvm.org"
[Tabs]
# Menu entry: filename
home: index
news: news
docs: documentation
download: download
community: community
FAQ: question
[Ticker]
file: ticker
[Documentation]
doc: "endb;intern;lib;manual;tut1;tut2;nimrodc;overview"
srcdoc: "system.nim;pure/os;pure/strutils;pure/regexprs;pure/math"
srcdoc: "pure/complex;pure/times;pure/osproc"
srcdoc: "pure/parseopt;pure/hashes;pure/strtabs;pure/lexbase"
srcdoc: "pure/parsecfg;pure/parsexml;pure/parsecsv"
srcdoc: "pure/streams;pure/terminal;pure/cgi;impure/web;pure/unicode"
srcdoc: "impure/zipfiles;pure/xmlgen;pure/macros"
webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql"
webdoc: "wrappers/sqlite3;wrappers/python;wrappers/tcl"
webdoc: "posix/posix;wrappers/odbcsql;impure/dialogs"
webdoc: "wrappers/zip/zlib;wrappers/zip/libzip"
webdoc: "wrappers/cairo"
webdoc: "wrappers/gtk"
webdoc: "windows"
webdoc: "wrappers/x11;wrappers/opengl;wrappers/sdl;wrappers/lua"

107
web/question.txt Executable file
View file

@ -0,0 +1,107 @@
===========================================
Questions and Answers
===========================================
General
=======
What is Nimrod?
---------------
Nimrod is a new statically typed, imperative
programming language, that supports procedural, functional, object oriented and
generic programming styles while remaining simple and efficient. A special
feature that Nimrod inherited from Lisp is that Nimrod's abstract syntax tree
(*AST*) is part of the specification - this allows a powerful macro system which
can be used to create domain specific languages. Nimrod does not sacrifice
flexibility for speed. You get both.
How is Nimrod licensed?
-----------------------
The Nimrod compiler is GPL licensed, the runtime library is LGPL licensed.
This means that you can use any license for your own programs developed with
Nimrod. If I receive enough requests with good arguments, I may change the
license of Nimrod to the BSD license.
How stable is Nimrod?
---------------------
The compiler is in development and some important features are still missing.
However, the compiler is quite stable already: It is able to compile itself
and a substantial body of other code. Until version 1.0.0 is released, slight
incompabilities with older versions of the compiler may be introduced.
Compilation
===========
Execution of GCC fails (Windows)
--------------------------------
On Windows the configuration file ``config\nimrod.cfg`` assumes that GCC is in
``$nimrod\dist\mingw\bin``: This is where the Windows installer puts GCC.
If you delete the line ``gcc.path = r"$nimrod\dist\mingw\bin"``, Nimrod uses
the GCC from your ``PATH`` environment variable.
If you cannot modify ``$nimrod\config\nimrod.cfg``, copy
``$nimrod\config\nimrod.cfg`` to ``$APPDATA\nimrod.cfg`` and modify
``$APPDATA\nimrod.cfg`` instead. To determine what ``$APPDATA`` means for your
Windows account, use the shell command::
echo %APPDATA%
How do I use a different C compiler than the default one?
---------------------------------------------------------
Edit the ``config/nimrod.cfg`` file.
Change the value of the ``cc`` variable to one of the following:
============== ============================================
Abbreviation C/C++ Compiler
============== ============================================
``dmc`` Digital Mars C++
``wcc`` Watcom C++ (now unsupported!)
``bcc`` Borland C++ (now unsupported!)
``vcc`` Microsoft's Visual C++
``gcc`` Gnu C
``pcc`` Pelles C (now unsupported!)
``lcc`` Lcc-win32 (now unsupported!)
``tcc`` Tiny C
``llvm_gcc`` LLVM-GCC compiler
``icc`` Intel C++ compiler
``ucc`` Generic UNIX C compiler
============== ============================================
If your C compiler is not in the above list, try using the
*generic UNIX C compiler* (``ucc``). If the C compiler needs
different command line arguments try the ``--passc`` and ``--passl`` switches.
Unsupported compilers contain serious bugs that keep them from bootstrapping
Nimrod.
The linker outputs strange errors about missing symbols
-------------------------------------------------------
I have seen this bug only with the GNU linker. The reason for this unknown.
Try recompiling your code with the ``--force_build`` command line switch.
Why is compilation so slow?
---------------------------
There are two reasons for this:
(1) Nimrod always recompiles **everything** (but only calls the C compiler for
modules that changed). In a future version, only modules that have changed
will be recompiled.
(2) The C compiler that is called by Nimrod may be slow.
Especially GCC's compile times are not very heady. On Linux you may be able
to get `Tiny C <http://bellard.org/tcc/>`_ to work. TCC has excellent
compile times. You should not use TCC for producing the release version
though, as it has no optimizer.
Note that from version 0.7.10 onwards the default build produces an optimized
binary.

4
web/snippets/snippet1.nim Executable file
View file

@ -0,0 +1,4 @@
import strutils
echo "Give a list of integers (separated by spaces): ",
stdin.readLine.splitSeq.each(parseInt).max,
" is the maximum!"

31
web/ticker.txt Executable file
View file

@ -0,0 +1,31 @@
| `2009-09-12`:newsdate:
| Nimrod version 0.8.0 has been released!
Get it `here <./download.html>`_.
| `2009-06-08`:newsdate:
| Nimrod version 0.7.10 has been released!
| `2009-05-08`:newsdate:
| Nimrod version 0.7.8 has been released!
| `2009-04-22`:newsdate:
| Nimrod version 0.7.6 has been released!
| `2009-01-22`:newsdate:
| Forum added!
| `2009-01-07`:newsdate:
| Nimrod version 0.7.4 has been released!
| `2008-12-12`:newsdate:
| Nimrod version 0.7.2 has been released!
| `2008-11-16`:newsdate:
| Nimrod version 0.7.0 has been released!
| `2008-08-22`:newsdate:
| Nimrod version 0.6.0 has been released!
| `2008-06-22`:newsdate:
| This page is finally online!