mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-31 02:43:41 +00:00
too many changes to list
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
"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 for Unix (including MacOS X): `<download/nimrod_unix_0.5.1.zip>`_
|
||||
* binary and source for Windows (95, 98, XP): `<download/nimrod_windows_0.5.1.zip>`_
|
||||
(includes LLVM and everything else you need)
|
||||
|
||||
.. include:: ../install.txt
|
||||
"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 for Linux (i386): `<download/nimrod_linux_i386_0.6.0.zip>`_
|
||||
* source for Linux (amd64): `<download/nimrod_linux_amd64_0.6.0.zip>`_
|
||||
* source for Linux (sparc, untested!): `<download/nimrod_linux_sparc_0.6.0.zip>`_
|
||||
* source for Mac OS X (i386): `<download/nimrod_macosx_i386_0.6.0.zip>`_
|
||||
* source for Mac OS X (amd64, untested!): `<download/nimrod_macosx_amd64_0.6.0.zip>`_
|
||||
* source for Solaris (i386, untested!): `<download/nimrod_solaris_i386_0.6.0.zip>`_
|
||||
* source for Solaris (amd64, untested!): `<download/nimrod_solaris_amd64_0.6.0.zip>`_
|
||||
* source for Solaris (sparc, untested!): `<download/nimrod_solaris_sparc_0.6.0.zip>`_
|
||||
* source for Windows (i386): `<download/nimrod_windows_i386_0.6.0.zip>`_
|
||||
* source for Windows (amd64, untested!): `<download/nimrod_windows_amd64_0.6.0.zip>`_
|
||||
* installer for Windows (i386): `<download/nimrod_windows_0.6.0.exe>`_
|
||||
(includes LLVM and everything else you need)
|
||||
|
||||
.. include:: ../install.txt
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Generates the beautiful webpage.
|
||||
# (c) 2007 Andreas Rumpf
|
||||
|
||||
TABS = [ # Our tabs: (Menu entry, filename)
|
||||
("home", "index"),
|
||||
("documentation", "documentation"),
|
||||
("download", "download"),
|
||||
("Q&A", "question"),
|
||||
("links", "links")
|
||||
]
|
||||
|
||||
TEMPLATE_FILE = "sunset.tmpl"
|
||||
|
||||
import sys, string, re, glob, os
|
||||
from Cheetah.Template import Template
|
||||
from time import gmtime, strftime
|
||||
|
||||
def Exec(cmd):
|
||||
print cmd
|
||||
return os.system(cmd) == 0
|
||||
|
||||
def Remove(f):
|
||||
try:
|
||||
os.remove(f)
|
||||
except OSError:
|
||||
Warn("could not remove: %s" % f)
|
||||
|
||||
def main():
|
||||
CMD = "rst2html.py --template=docutils.tmpl %s.txt %s.temp "
|
||||
if not Exec(CMD % ("news","news")): return
|
||||
newsText = file("news.temp").read()
|
||||
for t in TABS:
|
||||
if not Exec(CMD % (t[1],t[1]) ): return
|
||||
|
||||
tmpl = Template(file=TEMPLATE_FILE)
|
||||
tmpl.content = file(t[1] + ".temp").read()
|
||||
tmpl.news = newsText
|
||||
tmpl.tab = t[1]
|
||||
tmpl.tabs = TABS
|
||||
tmpl.lastupdate = strftime("%Y-%m-%d %X", gmtime())
|
||||
f = file(t[1] + ".html", "w+")
|
||||
f.write(str(tmpl))
|
||||
f.close()
|
||||
# remove temporaries:
|
||||
Remove("news.temp")
|
||||
for t in TABS:
|
||||
Remove(t[1] + ".temp")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -6,24 +6,24 @@ Home
|
||||
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 the Nimrod programming language
|
||||
------------------------------------------
|
||||
|
||||
**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
|
||||
**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
|
||||
(*AST*) is part of the specification - this allows a powerful macro system which
|
||||
can be used to create 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 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).
|
||||
|
||||
|
||||
Some more of Nimrod's highlights:
|
||||
@@ -34,24 +34,29 @@ Some more of Nimrod's highlights:
|
||||
Porting to other platforms is easy.
|
||||
* System programming features: Ability to manage your own memory and access the
|
||||
hardware directly. You will never have to use C/C++ for that again!
|
||||
* Closures and iterators.
|
||||
* Exceptions.
|
||||
* Zero-overhead iterators.
|
||||
* Modern type system with local type inference, tuples, variants, etc.
|
||||
* User-defineable operators; new operators often easier to read than overloaded
|
||||
ones.
|
||||
* User-defineable operators; new operators often easier to read than
|
||||
overloaded ones.
|
||||
* High level datatypes: strings, sets, sequences, etc.
|
||||
* Compile time evaluation without resorting to meta-programming facilities.
|
||||
* *Forward* compability: If later versions of the language introduce new
|
||||
* Forward compability: If later versions of the language introduce new
|
||||
keywords old code won't break!
|
||||
* Bindings to GTK2, the Windows API, the POSIX API. New bindings are
|
||||
easily generated in a semi-atomatic way.
|
||||
* A plugable parser system: If you don't like Nimrod's syntax, you can plug in
|
||||
a parser and a source renderer for your own syntax!
|
||||
* Bindings to GTK2, the Windows API, the POSIX API. New bindings are easily
|
||||
generated in a semi-atomatic way.
|
||||
* A plugable parser system: If you don't like Nimrod's syntax, you can plug
|
||||
in a parser and a source renderer for your own syntax!
|
||||
* A documentation generator with an internal reStructuredText parser: This
|
||||
can also be used to write documentation that is not embedded into the
|
||||
source code. This makes documentation writing a joy (well, almost).
|
||||
* A Pascal to Nimrod conversion utility: This is particularly useful for
|
||||
generating bindings to any library which has a Pascal binding
|
||||
(these are many!).
|
||||
|
||||
..
|
||||
..
|
||||
The Zen of Nimrod
|
||||
-----------------
|
||||
|
||||
|
||||
* Faster computers are for solving bigger problems, not wasting cycles.
|
||||
* Static is better than dynamic: More efficient, more understandable,
|
||||
better verifyable.
|
||||
|
||||
39
web/news.txt
39
web/news.txt
@@ -1,8 +1,31 @@
|
||||
| `2008-06-23`:newsdate:
|
||||
| Nimrod version |nimrodversion| has been released!
|
||||
Get it `here <./download.html>`_.
|
||||
|
||||
|
||||
| `2008-06-22`:newsdate:
|
||||
| This page is finally online!
|
||||
|
||||
====
|
||||
News
|
||||
====
|
||||
|
||||
Developers needed
|
||||
=================
|
||||
Yes, this is nothing new. If you are interested to help designing and
|
||||
implementing the new programming language Nimrod, visit our project page at
|
||||
Launchpad: https://launchpad.net/nimrod and contact me.
|
||||
|
||||
|
||||
2008-08-22 Version 0.6.0 released
|
||||
=================================
|
||||
|
||||
Nimrod version 0.6.0 has been released! Get it `here <./download.html>`_.
|
||||
**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)
|
||||
|
||||
242
web/question.txt
242
web/question.txt
@@ -1,112 +1,138 @@
|
||||
===========================================
|
||||
Questions and Answers
|
||||
===========================================
|
||||
|
||||
`How is Nimrod licensed?`:Q:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
`Why is compilation so slow?`:Q:
|
||||
|
||||
*Compilation* is fast. The problem is that Nimrod always
|
||||
recompiles **everything**. In the next version, only modules that
|
||||
have changed will be recompiled.
|
||||
|
||||
Another issue may be that the C compiler that is called by Nimrod is slow.
|
||||
Especially GCC's compile times are a bad joke. On Linux you may be able to get
|
||||
`Tiny C <http://fabrice.bellard.free.fr/tcc/>`_ to work. TCC has excellent
|
||||
compile times. You should not use TCC for producing the release version
|
||||
though, as it has no optimizer.
|
||||
|
||||
An experimental feature is the *C file cache*. It is not
|
||||
activated. To activate, add to your ``nimrod.cfg`` file the following
|
||||
line::
|
||||
|
||||
--c_file_cache:on
|
||||
|
||||
|
||||
`Which version of Freepascal is needed to compile Nimrod?`:Q:
|
||||
|
||||
Version 2.0.0 or later. Earlier development versions like 1.9.6 may work,
|
||||
but 1.0.10 won't. Note that I have never compiled Nimrod with FPC's
|
||||
optimizer turned on; it may break things due to bugs in FPC.
|
||||
|
||||
|
||||
`How do I build a shared library?`:Q:
|
||||
|
||||
This is currently not supported. The GC that makes trouble.
|
||||
|
||||
|
||||
`How do I use a different C compiler than the default one?`:Q:
|
||||
|
||||
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++
|
||||
``bcc`` Borland C++ (including Borland C++Builder)
|
||||
``vcc`` Microsoft's Visual C++
|
||||
``gcc`` Gnu C
|
||||
``pcc`` Pelles C
|
||||
``lcc`` Lcc-win32
|
||||
``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 you have to edit the ``extccomp``
|
||||
module to add support for it and recompile the compiler. Please
|
||||
contribute a patch in this case.
|
||||
===========================================
|
||||
Questions and Answers
|
||||
===========================================
|
||||
|
||||
General
|
||||
=======
|
||||
|
||||
`What is Nimrod?`:Q:
|
||||
**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.
|
||||
|
||||
`How is Nimrod licensed?`:Q:
|
||||
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.
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
`Is bootstrapping without Python possible?`:Q:
|
||||
Yes. You then have to compile by hand. It is not difficult (but it is not
|
||||
easy either). Please read the code in the ``koch.py`` script how this is can
|
||||
be accomplished (look for the ``cmd_boot`` routine).
|
||||
|
||||
|
||||
`A source-based download depending on the platform?`:Q:
|
||||
The reason is that the C code *generated* by Nimrod is not
|
||||
portable (the compiler itself is, of course!). The generated C
|
||||
code is used for the installation, so you have to pick the right package.
|
||||
|
||||
|
||||
`Why is compilation so slow?`:Q:
|
||||
|
||||
*Compilation* is fast. The problem is that Nimrod always
|
||||
recompiles **everything**. In the next version, only modules that
|
||||
have changed will be recompiled.
|
||||
|
||||
Another issue may be that the C compiler that is called by Nimrod is slow.
|
||||
Especially GCC's compile times are a bad joke. On Linux you may be able to get
|
||||
`Tiny C <http://fabrice.bellard.free.fr/tcc/>`_ to work. TCC has excellent
|
||||
compile times. You should not use TCC for producing the release version
|
||||
though, as it has no optimizer.
|
||||
|
||||
|
||||
`Which version of Freepascal is needed to compile Nimrod?`:Q:
|
||||
|
||||
Version 2.0.0 or later. Earlier development versions like 1.9.6 may work,
|
||||
but 1.0.10 won't. Note that I have never compiled Nimrod with FPC's
|
||||
optimizer turned on; it may break things due to bugs in FPC (yes, this has
|
||||
happend!).
|
||||
|
||||
|
||||
`How do I build a shared library?`:Q:
|
||||
|
||||
This is currently not supported.
|
||||
|
||||
|
||||
`How do I use a different C compiler than the default one?`:Q:
|
||||
|
||||
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++ (including Borland C++Builder)
|
||||
``vcc`` Microsoft's Visual C++
|
||||
``gcc`` Gnu C
|
||||
``pcc`` Pelles C (now unsupported!)
|
||||
``lcc`` Lcc-win32 (now unsupported!)
|
||||
``tcc`` Tiny C (now unsupported!)
|
||||
``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.
|
||||
|
||||
`The linker outputs strange errors about missing symbols`:Q:
|
||||
|
||||
I have seen this bug only with the GNU linker. The reason for this unknown.
|
||||
I have seen this bug only with the GNU linker. The reason for this unknown.
|
||||
Try recompiling your code with the ``--c_file_cache:off`` command line switch.
|
||||
|
||||
|
||||
`Calling the C compiler fails - what's wrong?`:Q:
|
||||
|
||||
Many C compilers need special environment variables to work
|
||||
properly. Although Nimrod tries hard to set them correctly (see
|
||||
``extccomp.pas`` for details), this may fail if you use a
|
||||
different version of the C compiler. The solution is to
|
||||
ensure that all environment variables are set correctly.
|
||||
|
||||
You can set environment variables temporarily by using the
|
||||
``@putenv "key" "val"`` directive in the ``config/nimrod.cfg``
|
||||
configuration file. There are also ``@append_env`` and
|
||||
``@prepend_env`` directives for appending or prepending
|
||||
to environment variables.
|
||||
|
||||
|
||||
`Calling the C compiler still fails`:Q:
|
||||
|
||||
Try to call the C compiler directly by doing the following::
|
||||
|
||||
nimrod --compile_only --gen_script your_path/your_file
|
||||
sh ./your_path/rod_gen/compile_your_file.sh
|
||||
|
||||
|
||||
`How to overload the ``in`` operator?`:Q:
|
||||
|
||||
The ``in`` and ``not_in`` operators are implemented as templates. The reason is
|
||||
that these operators need a reverse unification algorithm (don't ask). See the
|
||||
``system.nim`` module for a deeper explanation. The solution is to implement a
|
||||
simple ``in_Operator`` proc where the arguments are the other way round::
|
||||
|
||||
proc in_operator(s: string, c: char): bool =
|
||||
for x in items(s):
|
||||
if x == c: return True
|
||||
return False
|
||||
|
||||
writeln(stdout, 'z' in "abcdz") # now works!
|
||||
|
||||
|
||||
`Calling the C compiler fails - what's wrong?`:Q:
|
||||
|
||||
First try to edit the path to your C compiler in the
|
||||
``config/nimrod.cfg`` file. For the Windows version bundled with
|
||||
LLVM search for the line containing ``llvm_gcc.path``. Set this
|
||||
variable to the ``bin`` directory of LLVM.
|
||||
|
||||
Many C compilers need special environment variables to work
|
||||
properly. Although Nimrod tries hard to set them correctly (see
|
||||
``extccomp.pas`` for details), this may fail if you use a
|
||||
different version of the C compiler. The solution is to
|
||||
ensure that all environment variables are set correctly.
|
||||
|
||||
You can set environment variables temporarily by using the
|
||||
``@putenv "key" "val"`` directive in the ``config/nimrod.cfg``
|
||||
configuration file. There are also ``@append_env`` and
|
||||
``@prepend_env`` directives for appending or prepending
|
||||
to environment variables.
|
||||
|
||||
|
||||
`Calling the C compiler still fails`:Q:
|
||||
|
||||
Try to call the C compiler directly by doing the following::
|
||||
|
||||
nimrod --compile_only --gen_script your_path/your_file
|
||||
sh ./your_path/rod_gen/compile_your_file.sh
|
||||
|
||||
|
||||
Questions about the Nimrod language
|
||||
===================================
|
||||
|
||||
`How to overload the ``in`` operator?`:Q:
|
||||
|
||||
The ``in`` and ``not_in`` operators are implemented as templates. The reason is
|
||||
that these operators need a reverse unification algorithm (don't ask). See the
|
||||
``system.nim`` module for a deeper explanation. The solution is to implement a
|
||||
simple ``in_Operator`` proc where the arguments are the other way round::
|
||||
|
||||
proc in_operator(s: string, c: char): bool =
|
||||
for x in items(s):
|
||||
if x == c: return True
|
||||
return False
|
||||
|
||||
writeln(stdout, 'z' in "abcdz") # now works!
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<h1>latest news</h1>
|
||||
</div>
|
||||
<div class="sbicontent">
|
||||
$news
|
||||
$ticker
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebaritem">
|
||||
|
||||
Reference in New Issue
Block a user