Version 0.8.14 released
2012年02月09日 Andreas Rumpf
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
EIOexception was raised for the end of file for text files that do not end with a newline. - Bugfix c2nim, c2pas: the
--outoption 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.validEmailAddresstomatchers.validEmailAddress. - The pointer dereference operator
^has been removed, so that^can now be a user-defined operator. impliesis no keyword anymore.- The
isoperator is now theofoperator. - The
isoperator is now used to check type equivalence in generic code. - The
purepragma for procs has been renamed tonoStackFrame. - The threading API has been completely redesigned.
- The
unidecodemodule is now thread-safe and its interface has changed. - The
bindexpression is deprecated, use abinddeclaration instead. system.raiseHookis now split intosystem.localRaiseHookandsystem.globalRaiseHookto distinguish between thread local and global raise hooks.- Changed exception handling/error reporting for
os.removeFileandos.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
TStreamhave been renamed to have anImplsuffix because they should not be used directly anymore. Wrapper procs have been created that should be used instead. exportis now a keyword.assertis now implemented in pure Nimrod as a template; it’s easy to implement your own assertion templates withsystem.astToStr.
Language Additions
- Added new
isandofoperators. - The built-in type
voidcan be used to denote the absence of any type. This is useful in generic code. - Return types may be of the type
var Tto 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
discardablepragma that can be used to mark a routine so that its result can be discarded implicitly. - Added a new
noinitpragma 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
letstatement. - Iterators named
itemsandpairsare implicitly invoked when an explicit iterator is missing. - The slice assignment
a[i..j] = bwhereais 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
importcppandimportobjcmake interfacing with C++ and Objective C somewhat easier. - Added a new pragma
incompleteStructto deal with incomplete C struct definitions. - Added a
--nimcache:PATHconfiguration option for control over the output directory for generated code. - The
--genScriptoption now produces different compilation scripts which do not contain absolute paths. - Added
--cincludes:dir,--clibdir:libconfiguration options for modifying the C compiler’s header/library search path in cross-platform way. - Added
--clib:libconfiguration option for specifying additional C libraries to be linked. - Added
--mainmodule:fileconfiguration options for specifying the main project file. This is intended to be used in project configuration files to allow commands likenimrod cornimrod checkto be executed anywhere within the project’s directory structure. - Added a
--app:staticliboption for creating static libraries. - Added a
--tlsEmulation:on|offswitch for control over thread local storage emulation. - The compiler and standard library now support a taint mode. Input strings
are declared with the
TaintedStringstring 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:fileand--include:fileconfiguration options for specifying modules that will be automatically imported/incluced. nimrod ican 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
boolforon|offswitches in pragmas. In order to not break existing code,onandoffare now aliases fortrueandfalseand 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
matchersmodule for email address etc. matching. - Added
strutils.unindent,strutils.countLines,strutils.replaceWord. - Added
system.slurpfor easy resource embedding. - Added
system.runningfor 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
lockscore module for more flexible locking support. - Added
ircmodule. - Added
ftpclientmodule. - Added
memfilesmodule. - Added
subexesmodule. - Added
critbitsmodule. - Added
asynciomodule. - Added
actorsmodule. - Added
algorithmmodule for genericsort,reverseetc. operations. - Added
osproc.startCmd,osproc.execCmdEx. - The
osprocmodule now usesposix_spawninstead offorkandexecon Posix systems. Define the symboluseForkto revert to the old implementation. - Added
intsets.assign. - Added
system.astToStrandsystem.rand,system.doAssert. - Added
system.pairsfor built-in types like arrays and strings.