release of 0.10.2

This commit is contained in:
Araq 2014-12-29 10:32:00 +01:00
commit 27f1743793
12 changed files with 224 additions and 232 deletions

View file

@ -927,17 +927,18 @@ proc readTypeParameter(c: PContext, typ: PType,
paramName: PIdent, info: TLineInfo): PNode = paramName: PIdent, info: TLineInfo): PNode =
let ty = if typ.kind == tyGenericInst: typ.skipGenericAlias let ty = if typ.kind == tyGenericInst: typ.skipGenericAlias
else: (internalAssert(typ.kind == tyCompositeTypeClass); typ.sons[1]) else: (internalAssert(typ.kind == tyCompositeTypeClass); typ.sons[1])
#debug ty
let tbody = ty.sons[0] let tbody = ty.sons[0]
for s in countup(0, tbody.len-2): for s in countup(0, tbody.len-2):
let tParam = tbody.sons[s] let tParam = tbody.sons[s]
if tParam.sym.name == paramName: if tParam.sym.name.id == paramName.id:
let rawTyp = ty.sons[s + 1] let rawTyp = ty.sons[s + 1]
if rawTyp.kind == tyStatic: if rawTyp.kind == tyStatic:
return rawTyp.n return rawTyp.n
else: else:
let foundTyp = makeTypeDesc(c, rawTyp) let foundTyp = makeTypeDesc(c, rawTyp)
return newSymNode(copySym(tParam.sym).linkTo(foundTyp), info) return newSymNode(copySym(tParam.sym).linkTo(foundTyp), info)
#echo "came here: returned nil"
proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
## returns nil if it's not a built-in field access ## returns nil if it's not a built-in field access

View file

@ -1083,6 +1083,11 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
arg: PNode): PNode = arg: PNode): PNode =
# arg.typ can be nil in 'suggest': # arg.typ can be nil in 'suggest':
if isNil(arg.typ): return nil if isNil(arg.typ): return nil
# sem'checking for 'echo' needs to be re-entrant:
# XXX we will revisit this issue after 0.10.2 is released
if f == arg.typ and arg.kind == nkHiddenStdConv: return arg
var call = newNodeI(nkCall, arg.info) var call = newNodeI(nkCall, arg.info)
call.add(f.n.copyTree) call.add(f.n.copyTree)
call.add(arg.copyTree) call.add(arg.copyTree)

View file

@ -154,8 +154,8 @@ Generic Operating System Services
* `streams <streams.html>`_ * `streams <streams.html>`_
This module provides a stream interface and two implementations thereof: This module provides a stream interface and two implementations thereof:
the `PFileStream` and the `PStringStream` which implement the stream the `FileStream` and the `StringStream` which implement the stream
interface for Nim file objects (`TFile`) and strings. Other modules interface for Nim file objects (`File`) and strings. Other modules
may provide other implementations for this standard stream interface. may provide other implementations for this standard stream interface.
* `marshal <marshal.html>`_ * `marshal <marshal.html>`_

View file

@ -1516,7 +1516,7 @@ const
NimMinor*: int = 10 NimMinor*: int = 10
## is the minor number of Nim's version. ## is the minor number of Nim's version.
NimPatch*: int = 1 NimPatch*: int = 2
## is the patch number of Nim's version. ## is the patch number of Nim's version.
NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch

View file

@ -58,7 +58,7 @@ proc TestLoops() =
break break
break break
while True: while true:
break break
@ -73,7 +73,7 @@ proc main() =
res: int res: int
s: string s: string
#write(stdout, mymax(23, 45)) #write(stdout, mymax(23, 45))
write(stdout, "Hallo! Wie heißt du? ") write(stdout, "Hallo! Wie heisst du? ")
s = readLine(stdin) s = readLine(stdin)
# test the case statement # test the case statement
case s case s

View file

@ -1,3 +0,0 @@
import strutils
echo ParseFloat("5000") / ParseFloat("10")

View file

@ -397,7 +397,7 @@ proc esc(c: char, reserved = {'\0'..'\255'}): string =
elif c in reserved: result = '\\' & c elif c in reserved: result = '\\' & c
else: result = $c else: result = $c
proc singleQuoteEsc(c: Char): string = return "'" & esc(c, {'\''}) & "'" proc singleQuoteEsc(c: char): string = return "'" & esc(c, {'\''}) & "'"
proc singleQuoteEsc(str: string): string = proc singleQuoteEsc(str: string): string =
result = "'" result = "'"
@ -421,11 +421,11 @@ proc charSetEscAux(cc: set[char]): string =
c1 = c2 c1 = c2
inc(c1) inc(c1)
proc CharSetEsc(cc: set[char]): string = proc charSetEsc(cc: set[char]): string =
if card(cc) >= 128+64: if card(cc) >= 128+64:
result = "[^" & CharSetEscAux({'\1'..'\xFF'} - cc) & ']' result = "[^" & charSetEscAux({'\1'..'\xFF'} - cc) & ']'
else: else:
result = '[' & CharSetEscAux(cc) & ']' result = '[' & charSetEscAux(cc) & ']'
proc toStrAux(r: TPeg, res: var string) = proc toStrAux(r: TPeg, res: var string) =
case r.kind case r.kind
@ -522,12 +522,12 @@ proc `$` *(r: TPeg): string {.rtl, extern: "npegsToString".} =
type type
TCaptures* {.final.} = object ## contains the captured substrings. TCaptures* {.final.} = object ## contains the captured substrings.
matches: array[0..maxSubpatterns-1, tuple[first, last: int]] matches: array[0..MaxSubpatterns-1, tuple[first, last: int]]
ml: int ml: int
origStart: int origStart: int
proc bounds*(c: TCaptures, proc bounds*(c: TCaptures,
i: range[0..maxSubpatterns-1]): tuple[first, last: int] = i: range[0..MaxSubpatterns-1]): tuple[first, last: int] =
## returns the bounds ``[first..last]`` of the `i`'th capture. ## returns the bounds ``[first..last]`` of the `i`'th capture.
result = c.matches[i] result = c.matches[i]
@ -695,7 +695,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {.
while start+result < s.len: while start+result < s.len:
var x = rawMatch(s, p.sons[0], start+result, c) var x = rawMatch(s, p.sons[0], start+result, c)
if x >= 0: if x >= 0:
if idx < maxSubpatterns: if idx < MaxSubpatterns:
c.matches[idx] = (start, start+result-1) c.matches[idx] = (start, start+result-1)
#else: silently ignore the capture #else: silently ignore the capture
inc(result, x) inc(result, x)
@ -739,7 +739,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {.
inc(c.ml) inc(c.ml)
result = rawMatch(s, p.sons[0], start, c) result = rawMatch(s, p.sons[0], start, c)
if result >= 0: if result >= 0:
if idx < maxSubpatterns: if idx < MaxSubpatterns:
c.matches[idx] = (start, start+result-1) c.matches[idx] = (start, start+result-1)
#else: silently ignore the capture #else: silently ignore the capture
else: else:
@ -836,7 +836,7 @@ iterator findAll*(s: string, pattern: TPeg, start = 0): string =
while i < s.len: while i < s.len:
var L = matchLen(s, pattern, matches, i) var L = matchLen(s, pattern, matches, i)
if L < 0: break if L < 0: break
for k in 0..maxSubPatterns-1: for k in 0..MaxSubPatterns-1:
if isNil(matches[k]): break if isNil(matches[k]): break
yield matches[k] yield matches[k]
inc(i, L) inc(i, L)
@ -866,7 +866,7 @@ template `=~`*(s: string, pattern: TPeg): expr =
## echo("syntax error") ## echo("syntax error")
## ##
when not definedInScope(matches): when not definedInScope(matches):
var matches {.inject.}: array[0..maxSubpatterns-1, string] var matches {.inject.}: array[0..MaxSubpatterns-1, string]
match(s, pattern, matches) match(s, pattern, matches)
# ------------------------- more string handling ------------------------------ # ------------------------- more string handling ------------------------------
@ -907,7 +907,7 @@ proc replacef*(s: string, sub: TPeg, by: string): string {.
## "var1<-keykey; val2<-key2key2" ## "var1<-keykey; val2<-key2key2"
result = "" result = ""
var i = 0 var i = 0
var caps: array[0..maxSubpatterns-1, string] var caps: array[0..MaxSubpatterns-1, string]
while i < s.len: while i < s.len:
var x = matchLen(s, sub, caps, i) var x = matchLen(s, sub, caps, i)
if x <= 0: if x <= 0:
@ -924,7 +924,7 @@ proc replace*(s: string, sub: TPeg, by = ""): string {.
## in `by`. ## in `by`.
result = "" result = ""
var i = 0 var i = 0
var caps: array[0..maxSubpatterns-1, string] var caps: array[0..MaxSubpatterns-1, string]
while i < s.len: while i < s.len:
var x = matchLen(s, sub, caps, i) var x = matchLen(s, sub, caps, i)
if x <= 0: if x <= 0:
@ -942,7 +942,7 @@ proc parallelReplace*(s: string, subs: varargs[
## applied in parallel. ## applied in parallel.
result = "" result = ""
var i = 0 var i = 0
var caps: array[0..maxSubpatterns-1, string] var caps: array[0..MaxSubpatterns-1, string]
while i < s.len: while i < s.len:
block searchSubs: block searchSubs:
for j in 0..high(subs): for j in 0..high(subs):
@ -1055,7 +1055,7 @@ type
TPegLexer {.inheritable.} = object ## the lexer object. TPegLexer {.inheritable.} = object ## the lexer object.
bufpos: int ## the current position within the buffer bufpos: int ## the current position within the buffer
buf: cstring ## the buffer itself buf: cstring ## the buffer itself
LineNumber: int ## the current line number lineNumber: int ## the current line number
lineStart: int ## index of last line start in buffer lineStart: int ## index of last line start in buffer
colOffset: int ## column to add colOffset: int ## column to add
filename: string filename: string
@ -1118,38 +1118,38 @@ proc getEscapedChar(c: var TPegLexer, tok: var TToken) =
case c.buf[c.bufpos] case c.buf[c.bufpos]
of 'r', 'R', 'c', 'C': of 'r', 'R', 'c', 'C':
add(tok.literal, '\c') add(tok.literal, '\c')
Inc(c.bufpos) inc(c.bufpos)
of 'l', 'L': of 'l', 'L':
add(tok.literal, '\L') add(tok.literal, '\L')
Inc(c.bufpos) inc(c.bufpos)
of 'f', 'F': of 'f', 'F':
add(tok.literal, '\f') add(tok.literal, '\f')
inc(c.bufpos) inc(c.bufpos)
of 'e', 'E': of 'e', 'E':
add(tok.literal, '\e') add(tok.literal, '\e')
Inc(c.bufpos) inc(c.bufpos)
of 'a', 'A': of 'a', 'A':
add(tok.literal, '\a') add(tok.literal, '\a')
Inc(c.bufpos) inc(c.bufpos)
of 'b', 'B': of 'b', 'B':
add(tok.literal, '\b') add(tok.literal, '\b')
Inc(c.bufpos) inc(c.bufpos)
of 'v', 'V': of 'v', 'V':
add(tok.literal, '\v') add(tok.literal, '\v')
Inc(c.bufpos) inc(c.bufpos)
of 't', 'T': of 't', 'T':
add(tok.literal, '\t') add(tok.literal, '\t')
Inc(c.bufpos) inc(c.bufpos)
of 'x', 'X': of 'x', 'X':
inc(c.bufpos) inc(c.bufpos)
var xi = 0 var xi = 0
handleHexChar(c, xi) handleHexChar(c, xi)
handleHexChar(c, xi) handleHexChar(c, xi)
if xi == 0: tok.kind = tkInvalid if xi == 0: tok.kind = tkInvalid
else: add(tok.literal, Chr(xi)) else: add(tok.literal, chr(xi))
of '0'..'9': of '0'..'9':
var val = ord(c.buf[c.bufpos]) - ord('0') var val = ord(c.buf[c.bufpos]) - ord('0')
Inc(c.bufpos) inc(c.bufpos)
var i = 1 var i = 1
while (i <= 3) and (c.buf[c.bufpos] in {'0'..'9'}): while (i <= 3) and (c.buf[c.bufpos] in {'0'..'9'}):
val = val * 10 + ord(c.buf[c.bufpos]) - ord('0') val = val * 10 + ord(c.buf[c.bufpos]) - ord('0')
@ -1159,11 +1159,11 @@ proc getEscapedChar(c: var TPegLexer, tok: var TToken) =
else: tok.kind = tkInvalid else: tok.kind = tkInvalid
of '\0'..'\31': of '\0'..'\31':
tok.kind = tkInvalid tok.kind = tkInvalid
elif c.buf[c.bufpos] in strutils.letters: elif c.buf[c.bufpos] in strutils.Letters:
tok.kind = tkInvalid tok.kind = tkInvalid
else: else:
add(tok.literal, c.buf[c.bufpos]) add(tok.literal, c.buf[c.bufpos])
Inc(c.bufpos) inc(c.bufpos)
proc skip(c: var TPegLexer) = proc skip(c: var TPegLexer) =
var pos = c.bufpos var pos = c.bufpos
@ -1171,7 +1171,7 @@ proc skip(c: var TPegLexer) =
while true: while true:
case buf[pos] case buf[pos]
of ' ', '\t': of ' ', '\t':
Inc(pos) inc(pos)
of '#': of '#':
while not (buf[pos] in {'\c', '\L', '\0'}): inc(pos) while not (buf[pos] in {'\c', '\L', '\0'}): inc(pos)
of '\c': of '\c':
@ -1203,7 +1203,7 @@ proc getString(c: var TPegLexer, tok: var TToken) =
break break
else: else:
add(tok.literal, buf[pos]) add(tok.literal, buf[pos])
Inc(pos) inc(pos)
c.bufpos = pos c.bufpos = pos
proc getDollar(c: var TPegLexer, tok: var TToken) = proc getDollar(c: var TPegLexer, tok: var TToken) =
@ -1244,7 +1244,7 @@ proc getCharSet(c: var TPegLexer, tok: var TToken) =
break break
else: else:
ch = buf[pos] ch = buf[pos]
Inc(pos) inc(pos)
incl(tok.charset, ch) incl(tok.charset, ch)
if buf[pos] == '-': if buf[pos] == '-':
if buf[pos+1] == ']': if buf[pos+1] == ']':
@ -1264,7 +1264,7 @@ proc getCharSet(c: var TPegLexer, tok: var TToken) =
break break
else: else:
ch2 = buf[pos] ch2 = buf[pos]
Inc(pos) inc(pos)
for i in ord(ch)+1 .. ord(ch2): for i in ord(ch)+1 .. ord(ch2):
incl(tok.charset, chr(i)) incl(tok.charset, chr(i))
c.bufpos = pos c.bufpos = pos
@ -1275,7 +1275,7 @@ proc getSymbol(c: var TPegLexer, tok: var TToken) =
var buf = c.buf var buf = c.buf
while true: while true:
add(tok.literal, buf[pos]) add(tok.literal, buf[pos])
Inc(pos) inc(pos)
if buf[pos] notin strutils.IdentChars: break if buf[pos] notin strutils.IdentChars: break
c.bufpos = pos c.bufpos = pos
tok.kind = tkIdentifier tok.kind = tkIdentifier
@ -1312,11 +1312,11 @@ proc getTok(c: var TPegLexer, tok: var TToken) =
getCharset(c, tok) getCharset(c, tok)
of '(': of '(':
tok.kind = tkParLe tok.kind = tkParLe
Inc(c.bufpos) inc(c.bufpos)
add(tok.literal, '(') add(tok.literal, '(')
of ')': of ')':
tok.kind = tkParRi tok.kind = tkParRi
Inc(c.bufpos) inc(c.bufpos)
add(tok.literal, ')') add(tok.literal, ')')
of '.': of '.':
tok.kind = tkAny tok.kind = tkAny

View file

@ -1,12 +0,0 @@
import sockets, os
var s: TSocket
s = socket()
if s == InvalidSocket: osError(osLastError())
s.connect("www.google.com", TPort(80))
var data: string = ""
s.readLine(data)
echo(data)

View file

@ -1,6 +1,6 @@
You can download the latest version of the Nimrod compiler here. You can download the latest version of the Nim compiler here.
**Note:** The Nimrod compiler requires a C compiler to compile software. On **Note:** The Nim compiler requires a C compiler to compile software. On
Windows we recommend that you use Windows we recommend that you use
`Mingw-w64 <http://mingw-w64.sourceforge.net/>`_. GCC is recommended on Linux `Mingw-w64 <http://mingw-w64.sourceforge.net/>`_. GCC is recommended on Linux
and clang on Mac OS X. and clang on Mac OS X.
@ -9,10 +9,12 @@ and clang on Mac OS X.
Binaries Binaries
======== ========
Unfortunately for now we only provide builds for Windows. Unfortunately for now we provide no binary builds.
* 32 bit: `nimrod_0.9.6.exe <download/nimrod_0.9.6.exe>`_ ..
* 64 bit: `nimrod_0.9.6_x64.exe <download/nimrod_0.9.6_x64.exe>`_ Unfortunately for now we only provide builds for Windows.
* 32 bit: `nim_0.10.2.exe <download/nim_0.10.2.exe>`_
* 64 bit: `nim_0.10.2_x64.exe <download/nim_0.10.2_x64.exe>`_
Installation based on generated C code Installation based on generated C code
@ -22,13 +24,13 @@ This installation method is the preferred way for Linux, Mac OS X, and other Uni
like systems. Binary packages may be provided later. like systems. Binary packages may be provided later.
Download `nimrod_0.9.6.zip <download/nimrod_0.9.6.zip>`_, extract it and follow Download `nim_0.10.2.zip <download/nim_0.10.2.zip>`_, extract it and follow
these instructions: these instructions:
* sh build.sh * sh build.sh
* Add ``$your_install_dir/bin`` to your PATH. * Add ``$your_install_dir/bin`` to your PATH.
There are other ways to install Nimrod (like using the ``install.sh`` script), There are other ways to install Nim (like using the ``install.sh`` script),
but these tend to cause more problems. but these tend to cause more problems.

View file

@ -2,198 +2,197 @@
News News
==== ====
.. 2014-12-29 Version 0.10.2 released
2014-10-21 Version 0.10.2 released ==================================
==================================
This release marks the completion of a very important change to the project: This release marks the completion of a very important change to the project:
the official renaming from Nimrod to Nim. Version 0.10.2 contains many language the official renaming from Nimrod to Nim. Version 0.10.2 contains many language
changes, some of which may break your existing code. For your convenience, we changes, some of which may break your existing code. For your convenience, we
added a new tool called `nimfix <nimfix.html>`_ that will help you convert your added a new tool called `nimfix <nimfix.html>`_ that will help you convert your
existing projects so that it works with the latest version of the compiler. existing projects so that it works with the latest version of the compiler.
Progress towards version 1.0 Progress towards version 1.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Although Nim is still pre-1.0, we were able to keep the number of breaking Although Nim is still pre-1.0, we were able to keep the number of breaking
changes to a minimum so far. Starting with version 1.0, we will not introduce changes to a minimum so far. Starting with version 1.0, we will not introduce
any breaking changes between major release versions. any breaking changes between major release versions.
One of Nim's goals is to ensure that the compiler is as efficient as possible. One of Nim's goals is to ensure that the compiler is as efficient as possible.
Take a look at the Take a look at the
`latest benchmarks <https://github.com/logicchains/LPATHBench/blob/master/writeup.md>`_, `latest benchmarks <https://github.com/logicchains/LPATHBench/blob/master/writeup.md>`_,
which show that Nim is consistently near which show that Nim is consistently near
the top and already nearly as fast as C and C++. Recent developments, such as the top and already nearly as fast as C and C++. Recent developments, such as
the new ``asyncdispatch`` module will allow you to write efficient web server the new ``asyncdispatch`` module will allow you to write efficient web server
applications using non-blocking code. Nim now also has a built-in thread pool applications using non-blocking code. Nim now also has a built-in thread pool
for lightweight threading through the use of ``spawn``. for lightweight threading through the use of ``spawn``.
The unpopular "T" and "P" prefixes on types have been deprecated. Nim also The unpopular "T" and "P" prefixes on types have been deprecated. Nim also
became more expressive by weakening the distinction between statements and became more expressive by weakening the distinction between statements and
epxressions. We also added new and searchable forums, a new website, and our epxressions. We also added a new and searchable forum, a new website, and our
documentation generator ``docgen`` has seen major improvements. documentation generator ``docgen`` has seen major improvements.
What's left to be done What's left to be done
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
The 1.0 release is actually very close. Apart from bug fixes, there are The 1.0 release is actually very close. Apart from bug fixes, there are
two major features missing or incomplete: two major features missing or incomplete:
* ``static[T]`` needs to be defined precisely and the bugs in the * ``static[T]`` needs to be defined precisely and the bugs in the
implementation need to be fixed. implementation need to be fixed.
* Overloading of the assignment operator is required for some generic * Overloading of the assignment operator is required for some generic
containers and needs to be implemented. containers and needs to be implemented.
This means that fancy matrix libraries will finally start to work, which used This means that fancy matrix libraries will finally start to work, which used
to be a major point of pain in the language. to be a major point of pain in the language.
Nimble and other Nim tools Nimble and other Nim tools
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Outside of the language and the compiler itself many Nim tools have seen Outside of the language and the compiler itself many Nim tools have seen
considerable improvements. considerable improvements.
Babel the Nim package manager has been renamed to Nimble. Nimble's purpose Babel the Nim package manager has been renamed to Nimble. Nimble's purpose
is the installation of packages containing libraries and/or applications is the installation of packages containing libraries and/or applications
written in Nim. written in Nim.
Even though Nimble is still very young it already is very Even though Nimble is still very young it already is very
functional. It can install packages by name, it does so by accessing a functional. It can install packages by name, it does so by accessing a
packages repository which is hosted on a Github repo. Packages can also be packages repository which is hosted on a Github repo. Packages can also be
installed via a Git repo URL or Mercurial repo URL. The package repository installed via a Git repo URL or Mercurial repo URL. The package repository
is searchable through Nimble. Anyone is free to add their own packages to is searchable through Nimble. Anyone is free to add their own packages to
the package repository by forking the the package repository by forking the
`nim-lang/packages <https://github.com/nim-lang/packages>`_ repo and creating `nim-lang/packages <https://github.com/nim-lang/packages>`_ repo and creating
a pull request. Nimble is fully cross-platform and should be fully functional a pull request. Nimble is fully cross-platform and should be fully functional
on all major operating systems. on all major operating systems.
It is of course completely written in Nim. It is of course completely written in Nim.
Changelog Changelog
~~~~~~~~~ ~~~~~~~~~
Changes affecting backwards compatibility Changes affecting backwards compatibility
----------------------------------------- -----------------------------------------
- **The language has been renamed from Nimrod to Nim.** The name of the - **The language has been renamed from Nimrod to Nim.** The name of the
compiler changed from ``nimrod`` to ``nim`` too. compiler changed from ``nimrod`` to ``nim`` too.
- ``system.fileHandle`` has been renamed to ``system.getFileHandle`` to - ``system.fileHandle`` has been renamed to ``system.getFileHandle`` to
prevent name conflicts with the new type ``FileHandle``. prevent name conflicts with the new type ``FileHandle``.
- Comments are now not part of the AST anymore, as such you cannot use them - Comments are now not part of the AST anymore, as such you cannot use them
in place of ``discard``. in place of ``discard``.
- Large parts of the stdlib got rid of the T/P type prefixes. Instead most - Large parts of the stdlib got rid of the T/P type prefixes. Instead most
types now simply start with an uppercased letter. The types now simply start with an uppercased letter. The
so called "partial case sensitivity" rule is now active allowing for code so called "partial case sensitivity" rule is now active allowing for code
like ``var foo: Foo`` in more contexts. like ``var foo: Foo`` in more contexts.
- String case (or any non-ordinal case) statements - String case (or any non-ordinal case) statements
without 'else' are deprecated. without 'else' are deprecated.
- Recursive tuple types are not allowed anymore. Use ``object`` instead. - Recursive tuple types are not allowed anymore. Use ``object`` instead.
- The PEGS module returns ``nil`` instead of ``""`` when an optional capture - The PEGS module returns ``nil`` instead of ``""`` when an optional capture
fails to match. fails to match.
- The re module returns ``nil`` instead of ``""`` when an optional capture - The re module returns ``nil`` instead of ``""`` when an optional capture
fails to match. fails to match.
- The "symmetric set difference" operator (``-+-``) never worked and has been - The "symmetric set difference" operator (``-+-``) never worked and has been
removed. removed.
- ``defer`` is a keyword now. - ``defer`` is a keyword now.
- ``func`` is a keyword now. - ``func`` is a keyword now.
- The ``using`` language feature now needs to be activated via the new - The ``using`` language feature now needs to be activated via the new
``{.experimental.}`` pragma that enables experimental language features. ``{.experimental.}`` pragma that enables experimental language features.
- Destructors are now officially *experimental*. - Destructors are now officially *experimental*.
- Standalone ``except`` and ``finally`` statements are deprecated now. - Standalone ``except`` and ``finally`` statements are deprecated now.
The standalone ``finally`` can be replaced with ``defer``, The standalone ``finally`` can be replaced with ``defer``,
standalone ``except`` requires an explicit ``try``. standalone ``except`` requires an explicit ``try``.
- Operators ending in ``>`` are considered as "arrow like" and have their - Operators ending in ``>`` are considered as "arrow like" and have their
own priority level and are right associative. This means that own priority level and are right associative. This means that
the ``=>`` and ``->`` operators from the `future <future.html>`_ module the ``=>`` and ``->`` operators from the `future <future.html>`_ module
work better. work better.
- Field names in tuples are now ignored for type comparisons. This allows - Field names in tuples are now ignored for type comparisons. This allows
for greater interoperability between different modules. for greater interoperability between different modules.
- Statement lists are not converted to an implicit ``do`` block anymore. This - Statement lists are not converted to an implicit ``do`` block anymore. This
means the confusing ``nnkDo`` nodes when working with macros are gone for means the confusing ``nnkDo`` nodes when working with macros are gone for
good. good.
Language Additions Language Additions
------------------ ------------------
- The new concurrency model has been implemented including ``locks`` sections, - The new concurrency model has been implemented including ``locks`` sections,
lock levels and object field ``guards``. lock levels and object field ``guards``.
- The ``parallel`` statement has been implemented. - The ``parallel`` statement has been implemented.
- ``deepCopy`` has been added to the language. - ``deepCopy`` has been added to the language.
- The builtin ``procCall`` can be used to get ``super``-like functionality - The builtin ``procCall`` can be used to get ``super``-like functionality
for multi methods. for multi methods.
- There is a new pragma ``{.experimental.}`` that enables experimental - There is a new pragma ``{.experimental.}`` that enables experimental
language features per module, or you can enable this features on a global language features per module, or you can enable this features on a global
level with the ``--experimental`` command line option. level with the ``--experimental`` command line option.
Compiler Additions Compiler Additions
------------------ ------------------
- The compiler now supports *mixed* Objective C / C++ / C code generation: - The compiler now supports *mixed* Objective C / C++ / C code generation:
The modules that use ``importCpp`` or ``importObjc`` are compiled to C++ The modules that use ``importCpp`` or ``importObjc`` are compiled to C++
or Objective C code, any other module is compiled to C code. This or Objective C code, any other module is compiled to C code. This
improves interoperability. improves interoperability.
- There is a new ``parallel`` statement for safe fork&join parallel computing. - There is a new ``parallel`` statement for safe fork&join parallel computing.
- ``guard`` and ``lock`` pragmas have been implemented to support safer - ``guard`` and ``lock`` pragmas have been implemented to support safer
concurrent programming. concurrent programming.
- The following procs are now available at compile-time:: - The following procs are now available at compile-time::
math.sqrt, math.ln, math.log10, math.log2, math.exp, math.round, math.sqrt, math.ln, math.log10, math.log2, math.exp, math.round,
math.arccos, math.arcsin, math.arctan, math.arctan2, math.cos, math.cosh, math.arccos, math.arcsin, math.arctan, math.arctan2, math.cos, math.cosh,
math.hypot, math.sinh, math.sin, math.tan, math.tanh, math.pow, math.hypot, math.sinh, math.sin, math.tan, math.tanh, math.pow,
math.trunc, math.floor, math.ceil, math.fmod, math.trunc, math.floor, math.ceil, math.fmod,
os.getEnv, os.existsEnv, os.dirExists, os.fileExists, os.getEnv, os.existsEnv, os.dirExists, os.fileExists,
system.writeFile system.writeFile
- Two backticks now produce a single backtick within an ``emit`` or ``asm`` - Two backticks now produce a single backtick within an ``emit`` or ``asm``
statement. statement.
- There is a new tool, `nimfix <nimfix.html>`_ to help you in updating your - There is a new tool, `nimfix <nimfix.html>`_ to help you in updating your
code from Nimrod to Nim. code from Nimrod to Nim.
- The compiler's output has been prettified. - The compiler's output has been prettified.
Library Additions Library Additions
----------------- -----------------
- Added module ``fenv`` to control the handling of floating-point rounding and - Added module ``fenv`` to control the handling of floating-point rounding and
exceptions (overflow, division by zero, etc.). exceptions (overflow, division by zero, etc.).
- ``system.setupForeignThreadGc`` can be used for better interaction with - ``system.setupForeignThreadGc`` can be used for better interaction with
foreign libraries that create threads and run a Nim callback from these foreign libraries that create threads and run a Nim callback from these
foreign threads. foreign threads.
- List comprehensions have been implemented as a macro in the ``future`` - List comprehensions have been implemented as a macro in the ``future``
module. module.
- The new Async module (``asyncnet``) now supports SSL. - The new Async module (``asyncnet``) now supports SSL.
- The ``smtp`` module now has an async implementation. - The ``smtp`` module now has an async implementation.
- Added module ``asyncfile`` which implements asynchronous file reading - Added module ``asyncfile`` which implements asynchronous file reading
and writing. and writing.
- ``osproc.kill`` has been added. - ``osproc.kill`` has been added.
- ``asyncnet`` and ``asynchttpserver`` now support ``SO_REUSEADDR``. - ``asyncnet`` and ``asynchttpserver`` now support ``SO_REUSEADDR``.
Bugfixes Bugfixes
-------- --------
- ``nil`` and ``NULL`` are now preserved between Nim and databases in the - ``nil`` and ``NULL`` are now preserved between Nim and databases in the
``db_*`` modules. ``db_*`` modules.
- Fixed issue with OS module in non-unicode mode on Windows. - Fixed issue with OS module in non-unicode mode on Windows.
- Fixed issue with ``x.low`` - Fixed issue with ``x.low``
(`#1366 <https://github.com/Araq/Nim/issues/1366>`_). (`#1366 <https://github.com/Araq/Nim/issues/1366>`_).
- Fixed tuple unpacking issue inside closure iterators - Fixed tuple unpacking issue inside closure iterators
(`#1067 <https://github.com/Araq/Nim/issues/1067>`_). (`#1067 <https://github.com/Araq/Nim/issues/1067>`_).
- Fixed ENDB compilation issues. - Fixed ENDB compilation issues.
- Many ``asynchttpserver`` fixes. - Many ``asynchttpserver`` fixes.
- Macros can now keep global state across macro calls - Macros can now keep global state across macro calls
(`#903 <https://github.com/Araq/Nim/issues/903>`_). (`#903 <https://github.com/Araq/Nim/issues/903>`_).
- ``osproc`` fixes on Windows. - ``osproc`` fixes on Windows.
- ``osproc.terminate`` fixed. - ``osproc.terminate`` fixed.
- Improvements to exception handling in async procedures. - Improvements to exception handling in async procedures.
(`#1487 <https://github.com/Araq/Nim/issues/1487>`_). (`#1487 <https://github.com/Araq/Nim/issues/1487>`_).
- ``try`` now works at compile-time. - ``try`` now works at compile-time.
- Fixes ``T = ref T`` to be an illegal recursive type. - Fixes ``T = ref T`` to be an illegal recursive type.
- Self imports are now disallowed. - Self imports are now disallowed.
- Improved effect inference. - Improved effect inference.
- Fixes for the ``math`` module on Windows. - Fixes for the ``math`` module on Windows.
- User defined pragmas will now work for generics that have - User defined pragmas will now work for generics that have
been instantiated in different modules. been instantiated in different modules.
- Fixed queue exhaustion bug. - Fixed queue exhaustion bug.
- Many, many more. - Many, many more.
2014-12-09 New website design! 2014-12-09 New website design!

View file

@ -1,13 +1,13 @@
<a class="news" href="news.html#Z2014-12-29-version-0-10-2-released">
<h4>Dec 29, 2014</h4>
<p>Nim version 0.10.2 has been released!</p>
</a>
<a class="news" href="news.html#Z2014-12-09-new-website-design"> <a class="news" href="news.html#Z2014-12-09-new-website-design">
<h4>Dec 9, 2014</h4> <h4>Dec 9, 2014</h4>
<p>The new website design and forum are now online!</p> <p>The new website design and forum are now online!</p>
</a> </a>
<a class="news" href="news.html#Z2014-10-19-version-0-9-6-released">
<h4>Oct 19, 2014</h4>
<p>Nimrod version 0.9.6 has been released!</p>
</a>
<a class="news" href="news.html#Z2014-02-11-nimrod-featured-in-dr-dobb-s-journal"> <a class="news" href="news.html#Z2014-02-11-nimrod-featured-in-dr-dobb-s-journal">
<h4>Feb 11, 2014</h4> <h4>Feb 11, 2014</h4>
<p>Nimrod featured in Dr. Dobb's Journal</p> <p>Nimrod featured in Dr. Dobb's Journal</p>