summary refs log blame commit diff stats
path: root/tools/downloader.nim
blob: 37811b273ea031b90efcbf3800dd1738ecfe4d21 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                           

      
                                                                       











                                                   



                                      






                                                                        
                                                                              
                   



                                                                      
 

                                               
                                     

                                     
















                                                                  



                       
                                                          






















































                                                                
## Helper that is run after Nim's installation.

## We download mirror'ed mingw packages. The originals came from:
##
## https://sourceforge.net/projects/mingw-w64/files/Toolchains%20
##   targetting%20Win32/Personal%20Builds/mingw-builds/6.3.0/threads-win32/
##   dwarf/i686-6.3.0-release-win32-dwarf-rt_v5-rev1.7z/download
## https://sourceforge.net/projects/mingw-w64/files/Toolchains%20
##   targetting%20Win64/Personal%20Builds/mingw-builds/6.3.0/threads-win32/
##   seh/x86_64-6.3.0-release-win32-seh-rt_v5-rev1.7z/download
##


import
  ui, asyncdispatch, httpclient, os, finish, registry, strutils, osproc

type
  Actions = object
    addToPath, startMenu, mingw, aporia: bool
  Controls = object
    apply: Button
    bar: ProgressBar
    lab: Label

const arch = $(sizeof(int)*8)

proc download(pkg: string; c: Controls) {.async.} =
  let z = r"..\dist" / pkg & ".7z"
  if fileExists(z):
    c.lab.text = z & " already exists"
    return
  c.bar.value = 0
  var client = newAsyncHttpClient()
  proc onProgressChanged(total, progress, speed: BiggestInt) {.async.} =
    c.lab.text = "Downloading " & pkg & " " & $(speed div 1000) & "kb/s"
    c.bar.value = clamp(int(progress*100 div total), 0, 100)

  client.onProgressChanged = onProgressChanged
  await client.downloadFile("https://nim-lang.org/download/" & pkg & ".7z", z)
  c.bar.value = 100
  let p = osproc.startProcess("7zG.exe", getCurrentDir() / r"..\dist",
                              ["x", pkg & ".7z"])
  if p.waitForExit != 0:
    c.lab.text = "Unpacking failed: " & z

proc apply(a: Actions; c: Controls) {.async.} =
  if a.mingw:
    await download("mingw" & arch, c)
  if a.aporia:
    await download("aporia-0.4.0", c)

  if a.addToPath:
    let desiredPath = expandFilename(getCurrentDir() / "bin")
    let p = getUnicodeValue(r"Environment", "Path",
      HKEY_CURRENT_USER)
    var alreadyInPath = false
    for x in p.split(';'):
      if x.len == 0: continue
      let y = try: expandFilename(if x[0] == '"' and x[^1] == '"':
                                    substr(x, 1, x.len-2) else: x)
              except: ""
      if y == desiredPath: alreadyInPath = true
    if not alreadyInPath:
      addToPathEnv(desiredPath)

  if a.startMenu:
    createStartMenuEntry()

  c.apply.text = "Quit"

proc main() =
  var mainwin = newWindow("Nim installer", 640, 280, true)
  mainwin.margined = true
  mainwin.onClosing = (proc (): bool = return true)

  let box = newVerticalBox(true)
  mainwin.setChild(box)

  var groupA = newGroup("Actions", true)
  box.add(groupA, false)
  var innerA = newVerticalBox(true)
  groupA.child = innerA

  let cbAddToPath = newCheckbox("Add Nim to PATH")
  innerA.add cbAddToPath
  let cbStartMenu = newCheckbox("Create start menu entry")
  innerA.add cbStartMenu

  var groupB = newGroup("Optional Components", true)
  box.add(groupB, false)
  var innerB = newVerticalBox(true)
  groupB.child = innerB

  let cbMingw = newCheckbox("Download Mingw")
  innerB.add cbMingw

  let cbAporia = newCheckbox("Download Aporia")
  innerB.add cbAporia

  var c = Controls(
    apply: newButton("Apply"),
    bar: newProgressBar(),
    lab: newLabel(""))

  innerB.add c.apply
  innerB.add c.bar
  innerB.add c.lab

  proc apply() =
    c.apply.text = "Abort"
    asyncCheck apply(Actions(addToPath: cbAddToPath.checked,
                  startMenu: cbStartMenu.checked,
                  mingw: cbMingw.checked,
                  aporia: cbAporia.checked), c)

    c.apply.onclick = proc () =
      ui.quit()
      system.quit()

  c.apply.onclick = apply

  show(mainwin)
  pollingMainLoop((proc (timeout: int) =
    if hasPendingOperations(): asyncdispatch.poll(timeout)), 10)

init()
main()
names of tuples anymore. This had to be changed as the old behaviour never produced consistent results. - Deprecated the ``ssl`` module. - Deprecated ``nimrod pretty`` as it never worked good enough and has some inherent problems. - The integer promotion rules changed; the compiler is now less picky in some situations and more picky in other situations: In particular implicit conversions from ``int`` to ``int32`` are now forbidden. - ``system.byte`` is now an alias for ``uint8``; it used to be an alias to ``int8``. - ``bind`` expressions in templates are not properly supported anymore. Use the declarative ``bind`` statement instead. - The default calling convention for a procedural **type** is now ``closure``, for procs it remains ``nimcall`` (which is compatible to ``closure``). Activate the warning ``ImplicitClosure`` to make the compiler list the occurances of proc types which are affected. - The Nimrod type system now distinguishes ``openarray`` from ``varargs``. - Templates are now ``hygienic``. Use the ``dirty`` pragma to get the old behaviour. - Objects that have no ancestor are now implicitly ``final``. Use the ``inheritable`` pragma to introduce new object roots apart from ``TObject``. - Macros now receive parameters like templates do; use the ``callsite`` builtin to gain access to the invocation AST. - Symbol lookup rules in generics have become stricter to catch more errors. Compiler Additions ------------------ - Win64 is now an officially supported target. - The Nimrod compiler works on BSD again, but has some issues as ``os.getAppFilename`` and ``os.getAppDir`` cannot work reliably on BSD. - The compiler can detect and evaluate calls that can be evaluated at compile time for optimization purposes with the ``--implicitStatic`` command line option or pragma. - The compiler now generates marker procs that the GC can use instead of RTTI. This speeds up the GC quite a bit. - The compiler now includes a new advanced documentation generator via the ``doc2`` command. This new generator uses all of the semantic passes of the compiler and can thus generate documentation for symbols hiding in macros. - The compiler now supports the ``dynlib`` pragma for variables. - The compiler now supports ``bycopy`` and ``byref`` pragmas that affect how objects/tuples are passed. - The embedded profiler became a stack trace profiler and has been documented. Language Additions ------------------ - Added explicit ``static`` sections for enforced compile time evaluation. - Added an alternative notation for lambdas with ``do``. - ``addr`` is now treated like a prefix operator syntactically. - Added ``global`` pragma that can be used to introduce new global variables from within procs. - ``when`` expressions are now allowed just like ``if`` expressions. - The precedence for operators starting with ``@`` is different now allowing for *sigil-like* operators. - Stand-alone ``finally`` and ``except`` blocks are now supported. - Macros and templates can now be invoked as pragmas. - The apostrophe in type suffixes for numerical literals is now optional. - Unsigned integer types have been added. - The integer promotion rules changed. - Nimrod now tracks proper intervals for ``range`` over some built-in operators. - In parameter lists a semicolon instead of a comma can be used to improve readability: ``proc divmod(a, b: int; resA, resB: var int)``. - A semicolon can now be used to have multiple simple statements on a single line: ``inc i; inc j``. - ``bind`` supports overloaded symbols and operators. - A ``distinct`` type can now borrow from generic procs. - Added the pragmas ``gensym``, ``inject`` and ``dirty`` for hygiene in templates. - Comments can be continued with a backslash continuation character so that comment pieces don't have to align on the same column. - Enums can be annotated with ``pure`` so that their field names do not pollute the current scope. - A proc body can consist of an expression that has a type. This is rewritten to ``result = expression`` then. - Term rewriting macros (see `trmacros <http://nimrod-code.org/trmacros.html>`_) have been implemented but are still in alpha. 2012-02-09 Version 0.8.14 released ================================== Version 0.8.14 has been released! Bugfixes -------- - Fixed a serious memory corruption concerning message passing. - Fixed a serious bug concerning different instantiations of a generic proc. - Fixed a newly introduced bug where a wrong ``EIO`` exception was raised for the end of file for text files that do not end with a newline. - Bugfix c2nim, c2pas: the ``--out`` option has never worked properly. - Bugfix: forwarding of generic procs never worked. - Some more bugfixes for macros and compile-time evaluation. - The GC now takes into account interior pointers on the stack which may be introduced by aggressive C optimizers. - Nimrod's native allocator/GC now works on PowerPC. - Lots of other bugfixes: Too many to list them all. Changes affecting backwards compatibility ----------------------------------------- - Removed deprecated ``os.AppendFileExt``, ``os.executeShellCommand``, ``os.iterOverEnvironment``, ``os.pcDirectory``, ``os.pcLinkToDirectory``, ``os.SplitPath``, ``os.extractDir``, ``os.SplitFilename``, ``os.extractFileTrunk``, ``os.extractFileExt``, ``osproc.executeProcess``, ``osproc.executeCommand``. - Removed deprecated ``parseopt.init``, ``parseopt.getRestOfCommandLine``. - Moved ``strutils.validEmailAddress`` to ``matchers.validEmailAddress``. - The pointer dereference operator ``^`` has been removed, so that ``^`` can now be a user-defined operator. - ``implies`` is no keyword anymore. - The ``is`` operator is now the ``of`` operator. - The ``is`` operator is now used to check type equivalence in generic code. - The ``pure`` pragma for procs has been renamed to ``noStackFrame``. - The threading API has been completely redesigned. - The ``unidecode`` module is now thread-safe and its interface has changed. - The ``bind`` expression is deprecated, use a ``bind`` declaration instead. - ``system.raiseHook`` is now split into ``system.localRaiseHook`` and ``system.globalRaiseHook`` to distinguish between thread local and global raise hooks. - Changed exception handling/error reporting for ``os.removeFile`` and ``os.removeDir``. - The algorithm for searching and loading configuration files has been changed. - Operators now have diffent precedence rules: Assignment-like operators (like ``*=``) are now special-cased. - The fields in ``TStream`` have been renamed to have an ``Impl`` suffix because they should not be used directly anymore. Wrapper procs have been created that should be used instead. - ``export`` is now a keyword. - ``assert`` is now implemented in pure Nimrod as a template; it's easy to implement your own assertion templates with ``system.astToStr``. Language Additions ------------------ - Added new ``is`` and ``of`` operators. - The built-in type ``void`` can be used to denote the absense of any type. This is useful in generic code. - Return types may be of the type ``var T`` to return an l-value. - The error pragma can now be used to mark symbols whose *usage* should trigger a compile-time error. - There is a new ``discardable`` pragma that can be used to mark a routine so that its result can be discarded implicitly. - Added a new ``noinit`` pragma to prevent automatic initialization to zero of variables. - Constants can now have the type ``seq``. - There is a new user-definable syntactic construct ``a{i, ...}`` that has no semantics yet for built-in types and so can be overloaded to your heart's content. - ``bind`` (used for symbol binding in templates and generics) is now a declarative statement. - Nimrod now supports single assignment variables via the ``let`` statement. - Iterators named ``items`` and ``pairs`` are implicitly invoked when an explicit iterator is missing. - The slice assignment ``a[i..j] = b`` where ``a`` is a sequence or string now supports *splicing*. Compiler Additions ------------------ - The compiler can generate C++ code for easier interfacing with C++. - The compiler can generate Objective C code for easier interfacing with Objective C. - The new pragmas ``importcpp`` and ``importobjc`` make interfacing with C++ and Objective C somewhat easier. - Added a new pragma ``incompleteStruct`` to deal with incomplete C struct definitions. - Added a ``--nimcache:PATH`` configuration option for control over the output directory for generated code. - The ``--genScript`` option now produces different compilation scripts which do not contain absolute paths. - Added ``--cincludes:dir``, ``--clibdir:lib`` configuration options for modifying the C compiler's header/library search path in cross-platform way. - Added ``--clib:lib`` configuration option for specifying additional C libraries to be linked. - Added ``--mainmodule:file`` configuration options for specifying the main project file. This is intended to be used in project configuration files to allow commands like ``nimrod c`` or ``nimrod check`` to be executed anywhere within the project's directory structure. - Added a ``--app:staticlib`` option for creating static libraries. - Added a ``--tlsEmulation:on|off`` switch for control over thread local storage emulation. - The compiler and standard library now support a *taint mode*. Input strings are declared with the ``TaintedString`` string type. If the taint mode is turned on it is a distinct string type which helps to detect input validation errors. - The compiler now supports the compilation cache via ``--symbolFiles:on``. This potentially speeds up compilations by an order of magnitude, but is still highly experimental! - Added ``--import:file`` and ``--include:file`` configuration options for specifying modules that will be automatically imported/incluced. - ``nimrod i`` can now optionally be given a module to execute. - The compiler now performs a simple alias analysis to generate better code. - The compiler and ENDB now support *watchpoints*. - The compiler now supports proper compile time expressions of type ``bool`` for ``on|off`` switches in pragmas. In order to not break existing code, ``on`` and ``off`` are now aliases for ``true`` and ``false`` and declared in the system module. - The compiler finally supports **closures**. This is a preliminary implementation, which does not yet support nestings deeper than 1 level and still has many known bugs. Library Additions ----------------- - Added ``system.allocShared``, ``system.allocShared0``, ``system.deallocShared``, ``system.reallocShared``. - Slicing as implemented by the system module now supports *splicing*. - Added explicit channels for thread communication. - Added ``matchers`` module for email address etc. matching. - Added ``strutils.unindent``, ``strutils.countLines``, ``strutils.replaceWord``. - Added ``system.slurp`` for easy resource embedding. - Added ``system.running`` for threads. - Added ``system.programResult``. - Added ``xmltree.innerText``. - Added ``os.isAbsolute``, ``os.dynLibFormat``, ``os.isRootDir``, ``os.parentDirs``. - Added ``parseutils.interpolatedFragments``. - Added ``macros.treeRepr``, ``macros.lispRepr``, ``macros.dumpTree``, ``macros.dumpLisp``, ``macros.parseExpr``, ``macros.parseStmt``, ``macros.getAst``. - Added ``locks`` core module for more flexible locking support. - Added ``irc`` module. - Added ``ftpclient`` module. - Added ``memfiles`` module. - Added ``subexes`` module. - Added ``critbits`` module. - Added ``asyncio`` module. - Added ``actors`` module. - Added ``algorithm`` module for generic ``sort``, ``reverse`` etc. operations. - Added ``osproc.startCmd``, ``osproc.execCmdEx``. - The ``osproc`` module now uses ``posix_spawn`` instead of ``fork`` and ``exec`` on Posix systems. Define the symbol ``useFork`` to revert to the old implementation. - Added ``intsets.assign``. - Added ``system.astToStr`` and ``system.rand``, ``system.doAssert``. - Added ``system.pairs`` for built-in types like arrays and strings. 2011-07-10 Version 0.8.12 released ================================== Bugfixes -------- - Bugfix: ``httpclient`` correct passes the path starting with ``/``. - Bugfixes for the ``htmlparser`` module. - Bugfix: ``pegs.find`` did not respect ``start`` parameter. - Bugfix: ``dialogs.ChooseFilesToOpen`` did not work if only one file is selected. - Bugfix: niminst: ``nimrod`` is not default dir for *every* project. - Bugfix: Multiple yield statements in iterators did not cause local vars to be copied. - Bugfix: The compiler does not emit very inaccurate floating point literals anymore. - Bugfix: Subclasses are taken into account for ``try except`` matching. - Bugfix: Generics and macros are more stable. There are still known bugs left though. - Bugfix: Generated type information for tuples was sometimes wrong, causing random crashes. - Lots of other bugfixes: Too many to list them all. Changes affecting backwards compatibility ----------------------------------------- - Operators starting with ``^`` are now right-associative and have the highest priority. - Deprecated ``os.getApplicationFilename``: Use ``os.getAppFilename`` instead. - Deprecated ``os.getApplicationDir``: Use ``os.getAppDir`` instead. - Deprecated ``system.copy``: Use ``substr`` or string slicing instead. - Changed and documented how generalized string literals work: The syntax ``module.re"abc"`` is now supported. - Changed the behaviour of ``strutils.%``, ``ropes.%`` if both notations ``$#`` and ``$i`` are involved. - The ``pegs`` and ``re`` modules distinguish between ``replace`` and ``replacef`` operations. - The pointer dereference operation ``p^`` is deprecated and might become ``^p`` in later versions or be dropped entirely since it is rarely used. Use the new notation ``p[]`` in the rare cases where you need to dereference a pointer explicitly. - ``system.readFile`` does not return ``nil`` anymore but raises an ``EIO`` exception instead. - Unsound co-/contravariance for procvars has been removed. Language Additions ------------------ - Source code filters are now documented. - Added the ``linearScanEnd``, ``unroll``, ``shallow`` pragmas. - Added ``emit`` pragma for direct code generator control. - Case statement branches support constant sets for programming convenience. - Tuple unpacking is not enforced in ``for`` loops anymore. - The compiler now supports array, sequence and string slicing. - A field in an ``enum`` may be given an explicit string representation. This yields more maintainable code than using a constant ``array[TMyEnum, string]`` mapping. - Indices in array literals may be explicitly given, enhancing readability: ``[enumValueA: "a", enumValueB: "b"]``. - Added thread support via the ``threads`` core module and the ``--threads:on`` command line switch. - The built-in iterators ``system.fields`` and ``system.fieldPairs`` can be used to iterate over any field of a tuple. With this mechanism operations like ``==`` and ``hash`` are lifted to tuples. - The slice ``..`` is now a first-class operator, allowing code like: ``x in 1000..100_000``. Compiler Additions ------------------ - The compiler supports IDEs via the new group of ``idetools`` command line options. - The *interactive mode* (REPL) has been improved and documented for the first time. - The compiler now might use hashing for string case statements depending on the number of string literals in the case statement. Library Additions ----------------- - Added ``lists`` module which contains generic linked lists. - Added ``sets`` module which contains generic hash sets. - Added ``tables`` module which contains generic hash tables. - Added ``queues`` module which contains generic sequence based queues. - Added ``intsets`` module which contains a specialized int set data type. - Added ``scgi`` module. - Added ``smtp`` module. - Added ``encodings`` module. - Added ``re.findAll``, ``pegs.findAll``. - Added ``os.findExe``. - Added ``parseutils.parseUntil`` and ``parseutils.parseWhile``. - Added ``strutils.align``, ``strutils.tokenize``, ``strutils.wordWrap``. - Pegs support a *captured search loop operator* ``{@}``. - Pegs support new built-ins: ``\letter``, ``\upper``, ``\lower``, ``\title``, ``\white``. - Pegs support the new built-in ``\skip`` operation. - Pegs support the ``$`` and ``^`` anchors. - Additional operations were added to the ``complex`` module. - Added ``strutils.formatFloat``, ``strutils.formatBiggestFloat``. - Added unary ``<`` for nice looking excluding upper bounds in ranges. - Added ``math.floor``. - Added ``system.reset`` and a version of ``system.open`` that returns a ``TFile`` and raises an exception in case of an error. - Added a wrapper for ``redis``. - Added a wrapper for ``0mq`` via the ``zmq`` module. - Added a wrapper for ``sphinx``. - Added ``system.newStringOfCap``. - Added ``system.raiseHook`` and ``system.outOfMemHook``. - Added ``system.writeFile``. - Added ``system.shallowCopy``. - ``system.echo`` is guaranteed to be thread-safe. - Added ``prelude`` include file for scripting convenience. - Added ``typeinfo`` core module for access to runtime type information. - Added ``marshal`` module for JSON serialization. 2010-10-20 Version 0.8.10 released ================================== Bugfixes -------- - Bugfix: Command line parsing on Windows and ``os.parseCmdLine`` now adheres to the same parsing rules as Microsoft's C/C++ startup code. - Bugfix: Passing a ``ref`` pointer to the untyped ``pointer`` type is invalid. - Bugfix: Updated ``keyval`` example. - Bugfix: ``system.splitChunk`` still contained code for debug output. - Bugfix: ``dialogs.ChooseFileToSave`` uses ``STOCK_SAVE`` instead of ``STOCK_OPEN`` for the GTK backend. - Bugfix: Various bugs concerning exception handling fixed. - Bugfix: ``low(somestring)`` crashed the compiler. - Bugfix: ``strutils.endsWith`` lacked range checking. - Bugfix: Better detection for AMD64 on Mac OS X. Changes affecting backwards compatibility ----------------------------------------- - Reversed parameter order for ``os.copyFile`` and ``os.moveFile``!!! - Procs not marked as ``procvar`` cannot only be passed to a procvar anymore, unless they are used in the same module. - Deprecated ``times.getStartMilsecs``: Use ``epochTime`` or ``cpuTime`` instead. - Removed ``system.OpenFile``. - Removed ``system.CloseFile``. - Removed ``strutils.replaceStr``. - Removed ``strutils.deleteStr``. - Removed ``strutils.splitLinesSeq``. - Removed ``strutils.splitSeq``. - Removed ``strutils.toString``. - If a DLL cannot be loaded (via the ``dynlib`` pragma) ``EInvalidLibrary`` is not raised anymore. Instead ``system.quit()`` is called. This is because raising an exception requires heap allocations. However the memory manager might be contained in the DLL that failed to load. - The ``re`` module (and the ``pcre`` wrapper) now depend on the pcre dll. Additions --------- - The ``{.compile: "file.c".}`` pragma uses a CRC check to see if the file needs to be recompiled. - Added ``system.reopen``. - Added ``system.getCurrentException``. - Added ``system.appType``. - Added ``system.compileOption``. - Added ``times.epochTime`` and ``times.cpuTime``. - Implemented explicit type arguments for generics. - Implemented ``{.size: sizeof(cint).}`` pragma for enum types. This is useful for interfacing with C. - Implemented ``{.pragma.}`` pragma for user defined pragmas. - Implemented ``{.extern.}`` pragma for better control of name mangling. - The ``importc`` and ``exportc`` pragmas support format strings: ``proc p{.exportc: "nim_$1".}`` exports ``p`` as ``nim_p``. This is useful for user defined pragmas. - The standard library can be built as a DLL. Generating DLLs has been improved. - Added ``expat`` module. - Added ``json`` module. - Added support for a *Tiny C* backend. Currently this only works on Linux. You need to bootstrap with ``-d:tinyc`` to enable Tiny C support. Nimrod can then execute code directly via ``nimrod run myfile``. 2010-03-14 Version 0.8.8 released ================================= Bugfixes -------- - The Posix version of ``os.copyFile`` has better error handling. - Fixed bug #502670 (underscores in identifiers). - Fixed a bug in the ``parsexml`` module concerning the parsing of ``<tag attr="value" />``. - Fixed a bug in the ``parsexml`` module concerning the parsing of enities like ``&ltXX``. - ``system.write(f: TFile, s: string)`` now works even if ``s`` contains binary zeros. - Fixed a bug in ``os.setFilePermissions`` for Windows. - An overloadable symbol can now have the same name as an imported module. - Fixed a serious bug in ``strutils.cmpIgnoreCase``. - Fixed ``unicode.toUTF8``. - The compiler now rejects ``'\n'`` (use ``"\n"`` instead). - ``times.getStartMilsecs()`` now works on Mac OS X. - Fixed a bug in ``pegs.match`` concerning start offsets. - Lots of other little bugfixes. Additions --------- - Added ``system.cstringArrayToSeq``. - Added ``system.lines(f: TFile)`` iterator. - Added ``system.delete``, ``system.del`` and ``system.insert`` for sequences. - Added ``system./`` for int. - Exported ``system.newException`` template. - Added ``cgi.decodeData(data: string): tuple[key, value: string]``. - Added ``strutils.insertSep``. - Added ``math.trunc``. - Added ``ropes`` module. - Added ``sockets`` module. - Added ``browsers`` module. - Added ``httpserver`` module. - Added ``httpclient`` module. - Added ``parseutils`` module. - Added ``unidecode`` module. - Added ``xmldom`` module. - Added ``xmldomparser`` module. - Added ``xmltree`` module. - Added ``xmlparser`` module. - Added ``htmlparser`` module. - Added ``re`` module. - Added ``graphics`` module. - Added ``colors`` module. - Many wrappers now do not contain redundant name prefixes (like ``GTK_``, ``lua``). The old wrappers are still available in ``lib/oldwrappers``. You can change your configuration file to use these. - Triple quoted strings allow for ``"`` in more contexts. - ``""`` within raw string literals stands for a single quotation mark. - Arguments to ``openArray`` parameters can be left out. - More extensive subscript operator overloading. (To be documented.) - The documentation generator supports the ``.. raw:: html`` directive. - The Pegs module supports back references via the notation ``$capture_index``. Changes affecting backwards compatibility ----------------------------------------- - Overloading of the subscript operator only works if the type does not provide a built-in one. - The search order for libraries which is affected by the ``path`` option has been reversed, so that the project's path is searched before the standard library's path. - The compiler does not include a Pascal parser for bootstrapping purposes any more. Instead there is a ``pas2nim`` tool that contains the old functionality. - The procs ``os.copyFile`` and ``os.moveFile`` have been deprecated temporarily, so that the compiler warns about their usage. Use them with named arguments only, because the parameter order will change the next version! - ``atomic`` and ``let`` are now keywords. - The ``\w`` character class for pegs now includes the digits ``'0'..'9'``. - Many wrappers now do not contain redundant name prefixes (like ``GTK_``, ``lua``) anymore. - Arguments to ``openArray`` parameters can be left out. 2009-12-21 Version 0.8.6 released ================================= The version jump from 0.8.2 to 0.8.6 acknowledges the fact that all development of the compiler is now done in Nimrod. Bugfixes -------- - The pragmas ``hint[X]:off`` and ``warning[X]:off`` now work. - Method call syntax for iterators works again (``for x in lines.split()``). - Fixed a typo in ``removeDir`` for POSIX that lead to an infinite recursion. - The compiler now checks that module filenames are valid identifiers. - Empty patterns for the ``dynlib`` pragma are now possible. - ``os.parseCmdLine`` returned wrong results for trailing whitespace. - Inconsequent tuple usage (using the same tuple with and without named fields) does not crash the code generator anymore. - A better error message is provided when the loading of a proc within a dynamic lib fails. Additions --------- - Added ``system.contains`` for open arrays. - The PEG module now supports the *search loop operator* ``@``. - Grammar/parser: ``SAD|IND`` is allowed before any kind of closing bracket. This allows for more flexible source code formating. - The compiler now uses a *bind* table for symbol lookup within a ``bind`` context. (See `<manual.html#templates>`_ for details.) - ``discard """my long comment"""`` is now optimized away. - New ``--floatChecks: on|off`` switches and pragmas for better debugging of floating point operations. (See `<manual.html#pre-defined-floating-point-types>`_ for details.) - The manual has been improved. (Many thanks to Philippe Lhoste!) Changes affecting backwards compatibility ----------------------------------------- - The compiler does not skip the linking step anymore even if no file has changed. - ``os.splitFile(".xyz")`` now returns ``("", ".xyz", "")`` instead of ``("", "", ".xyz")``. So filenames starting with a dot are handled differently. - ``strutils.split(s: string, seps: set[char])`` never yields the empty string anymore. This behaviour is probably more appropriate for whitespace splitting. - The compiler now stops after the ``--version`` command line switch. - Removed support for enum inheritance in the parser; enum inheritance has never been documented anyway. - The ``msg`` field of ``system.E_base`` has now the type ``string``, instead of ``cstring``. This improves memory safety. 2009-10-21 Version 0.8.2 released ================================= 2009-09-12 Version 0.8.0 released ================================= 2009-06-08 Version 0.7.10 released ================================== 2009-05-08 Version 0.7.8 released ================================= 2009-04-22 Version 0.7.6 released ================================= 2008-11-16 Version 0.7.0 released ================================= 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!**