mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 13:33:22 +00:00
todo.txt changes
This commit is contained in:
@@ -72,11 +72,6 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym): PNode =
|
||||
else:
|
||||
result = n
|
||||
else: result = newSymNode(s, n.info)
|
||||
|
||||
proc semMixinStmt(c: PContext, n: PNode, toMixin: var TIntSet): PNode =
|
||||
for i in 0 .. < n.len:
|
||||
toMixin.incl(considerAcc(n.sons[i]).id)
|
||||
result = newNodeI(nkNilLit, n.info)
|
||||
|
||||
proc Lookup(c: PContext, n: PNode, flags: TSemGenericFlags,
|
||||
ctx: var TIntSet): PNode =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
#
|
||||
# The Nimrod Compiler
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
# (c) Copyright 2013 Andreas Rumpf
|
||||
#
|
||||
# See the file "copying.txt", included in this
|
||||
# distribution, for details about the copyright.
|
||||
@@ -89,7 +89,12 @@ proc semBindStmt(c: PContext, n: PNode, toBind: var TIntSet): PNode =
|
||||
for x in items(sc): toBind.incl(x.sym.id)
|
||||
else:
|
||||
illFormedAst(a)
|
||||
result = newNodeI(nkNilLit, n.info)
|
||||
result = newNodeI(nkEmpty, n.info)
|
||||
|
||||
proc semMixinStmt(c: PContext, n: PNode, toMixin: var TIntSet): PNode =
|
||||
for i in 0 .. < n.len:
|
||||
toMixin.incl(considerAcc(n.sons[i]).id)
|
||||
result = newNodeI(nkEmpty, n.info)
|
||||
|
||||
proc replaceIdentBySym(n: var PNode, s: PNode) =
|
||||
case n.kind
|
||||
@@ -101,7 +106,7 @@ proc replaceIdentBySym(n: var PNode, s: PNode) =
|
||||
type
|
||||
TemplCtx {.pure, final.} = object
|
||||
c: PContext
|
||||
toBind: TIntSet
|
||||
toBind, toMixin: TIntSet
|
||||
owner: PSym
|
||||
|
||||
proc getIdentNode(c: var TemplCtx, n: PNode): PNode =
|
||||
@@ -192,6 +197,8 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
|
||||
result = semTemplBody(c, n.sons[0])
|
||||
of nkBindStmt:
|
||||
result = semBindStmt(c.c, n, c.toBind)
|
||||
of nkMixinStmt:
|
||||
result = semMixinStmt(c.c, n, c.toMixin)
|
||||
of nkEmpty, nkSym..nkNilLit:
|
||||
nil
|
||||
of nkIfStmt:
|
||||
@@ -395,6 +402,7 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
|
||||
n.sons[patternPos] = semPattern(c, n.sons[patternPos])
|
||||
var ctx: TemplCtx
|
||||
ctx.toBind = initIntSet()
|
||||
ctx.toMixin = initIntSet()
|
||||
ctx.c = c
|
||||
ctx.owner = s
|
||||
if sfDirty in s.flags:
|
||||
@@ -416,6 +424,8 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
|
||||
addInterfaceOverloadableSymAt(c, s, curScope)
|
||||
else:
|
||||
SymTabReplace(c.tab.stack[curScope], proto, s)
|
||||
# XXX this seems wrong: We need to check for proto before and overwrite
|
||||
# proto.ast ...
|
||||
if n.sons[patternPos].kind != nkEmpty:
|
||||
c.patterns.add(s)
|
||||
|
||||
@@ -536,6 +546,7 @@ proc semPattern(c: PContext, n: PNode): PNode =
|
||||
openScope(c.tab)
|
||||
var ctx: TemplCtx
|
||||
ctx.toBind = initIntSet()
|
||||
ctx.toMixin = initIntSet()
|
||||
ctx.c = c
|
||||
ctx.owner = getCurrOwner()
|
||||
result = flattenStmts(semPatternBody(ctx, n))
|
||||
|
||||
92
todo.txt
92
todo.txt
@@ -1,12 +1,14 @@
|
||||
version 0.9.2
|
||||
=============
|
||||
|
||||
- FFI:
|
||||
* test libffi on windows
|
||||
* test: times.format with the FFI
|
||||
- acyclic vs prunable; introduce GC hints
|
||||
- CGEN: ``restrict`` pragma + backend support; computed goto support
|
||||
- document NimMain and check whether it works for threading
|
||||
- make 'bind' default for templates and introduce 'mixin';
|
||||
special rule for ``[]=``
|
||||
- ``=`` should be overloadable; requires specialization for ``=``; general
|
||||
lift mechanism in the compiler is already implemented for 'fields'
|
||||
- mocking support with ``tyProxy`` that does: fallback for ``.`` operator
|
||||
- overloading of ``.``? Special case ``.=``?
|
||||
- built-in 'getImpl'
|
||||
|
||||
|
||||
Bugs
|
||||
====
|
||||
@@ -28,18 +30,15 @@ version 0.9.4
|
||||
=============
|
||||
|
||||
- macros as type pragmas
|
||||
- provide tool/API to track leaks/object counts
|
||||
- hybrid GC
|
||||
- use big blocks in the allocator
|
||||
- implement full 'not nil' checking
|
||||
- make 'bind' default for templates and introduce 'mixin';
|
||||
special rule for ``[]=``
|
||||
- implement full 'not nil' checking; range[1..3] needs the same mechanism
|
||||
- implicit deref for parameter matching
|
||||
- ``=`` should be overloadable; requires specialization for ``=``; general
|
||||
lift mechanism in the compiler is already implemented for 'fields'
|
||||
- lazy overloading resolution:
|
||||
* get rid of ``expr[typ]``, use perhaps ``static[typ]`` instead
|
||||
* special case ``tyStmt``
|
||||
- FFI:
|
||||
* test libffi on windows
|
||||
* test: times.format with the FFI
|
||||
- document NimMain and check whether it works for threading
|
||||
|
||||
|
||||
version 0.9.X
|
||||
@@ -48,8 +47,6 @@ version 0.9.X
|
||||
- test&finish first class iterators:
|
||||
* nested iterators
|
||||
- implement the missing features wrt inheritance
|
||||
- object pooling support for *hard* realtime systems
|
||||
- improve the compiler as a service
|
||||
- better support for macros that rewrite procs
|
||||
- macros need access to types and symbols (partially implemented)
|
||||
- perhaps: change comment handling in the AST
|
||||
@@ -62,8 +59,8 @@ version 0.9.X
|
||||
templates that would work too: T([.ref int])
|
||||
|
||||
|
||||
Concurrency
|
||||
-----------
|
||||
Concurrency/Effect system
|
||||
=========================
|
||||
|
||||
- shared memory heap: ``shared ref`` etc. The only hard part in the GC is to
|
||||
"stop the world". However, it may be worthwhile to generate explicit
|
||||
@@ -83,21 +80,51 @@ Concurrency
|
||||
version 0.9.XX
|
||||
==============
|
||||
|
||||
- object branch transitions can't work with the current 'reset'; add a 'reset'
|
||||
with an additional parameter --> simple:
|
||||
provide a 'reset(x, TObj(k: nkValue))' instead? why bother? '=' does the
|
||||
same.
|
||||
- document nimdoc properly finally
|
||||
- make 'clamp' a magic for the range stuff
|
||||
- better type syntax for functions and tuples: tuple(int, int); (int,int)->int
|
||||
|
||||
|
||||
Memory safety
|
||||
=============
|
||||
|
||||
- object branch transitions from low(selector) are unsafe! ---> Needs a
|
||||
deprecation path
|
||||
- object branch transitions can't work with the current 'reset'; add a 'reset'
|
||||
with an additional parameter --> simple:
|
||||
provide a 'reset(x, TObj(k: nkValue))' instead? why bother? '=' does the
|
||||
same.
|
||||
- returning 'var T' is unsafe and needs some static analysis
|
||||
|
||||
|
||||
GC
|
||||
==
|
||||
|
||||
- precise stack marking; embrace C++ code generation for that
|
||||
- marker procs for Boehm GC
|
||||
- hybrid GC
|
||||
- GC: implement simple generational GC
|
||||
* first version: mark black in write barrier
|
||||
* second version: introduce fake roots instead of marking black
|
||||
* third version: find some clever heuristic which is preferable
|
||||
- acyclic vs prunable; introduce GC hints
|
||||
- use big blocks in the allocator
|
||||
- object pooling support for *hard* realtime systems
|
||||
- provide tool/API to track leaks/object counts
|
||||
- resizing of strings/sequences could take into account the memory that
|
||||
is allocated
|
||||
|
||||
|
||||
CGEN
|
||||
====
|
||||
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
|
||||
- ``restrict`` pragma + backend support; computed goto support
|
||||
- 'const' objects including case objects
|
||||
|
||||
|
||||
Not essential for 1.0.0
|
||||
=======================
|
||||
|
||||
- 'const' objects including case objects
|
||||
- mocking support with ``tyProxy`` that does: fallback for ``.`` operator
|
||||
- overloading of ``.``? Special case ``.=``?
|
||||
- allow implicit forward declarations of procs via a pragma (so that the
|
||||
wrappers can deactivate it): better solution: introduce the notion of a
|
||||
'proc section' that is similar to a type section.
|
||||
@@ -108,28 +135,13 @@ Not essential for 1.0.0
|
||||
- ``with proc `+`(x, y: T): T`` for generic code
|
||||
- new feature: ``distinct T with operations``
|
||||
- arglist as a type (iterator chaining); variable length type lists for generics
|
||||
- resizing of strings/sequences could take into account the memory that
|
||||
is allocated
|
||||
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
|
||||
- implement marker procs for message passing
|
||||
- activate more thread tests
|
||||
- implement closures that support nesting of *procs* > 1
|
||||
- GC: implement simple generational GC
|
||||
* first version: mark black in write barrier
|
||||
* second version: introduce fake roots instead of marking black
|
||||
* third version: find some clever heuristic which is preferable
|
||||
- object constructors: static check for fields if discriminator is known at
|
||||
compile time
|
||||
|
||||
|
||||
GC
|
||||
==
|
||||
|
||||
- precise stack marking; embrace C++ code generation for that
|
||||
- marker procs for Boehm GC
|
||||
- implement 'mixed' GC mode
|
||||
|
||||
|
||||
Optimizations
|
||||
=============
|
||||
|
||||
|
||||
Reference in New Issue
Block a user