Nim/todo.txt
2011-10-28 17:57:58 +02:00

191 lines
5.8 KiB
Text
Executable file

Version 0.8.14
==============
- optimize unused constants away (affected by HLO); get rid of nfAllConst
- 'let x = y'
- fix actors.nim
- make threadvar efficient again on linux after testing
- dead code elim for JS backend
incremental compilation
-----------------------
- the loading has to be MUCH lazier! --> next version: We should re-load
symbol.ast.sons[codePos] lazily
- implement lib/pure/memfiles properly
Destructors
-----------
A destructor is bound to a proc instead of a type. The proc is then called
an *init proc*. A destructor is called at
scope exit for the local variables (declared with ``var`` or ``let``)
that are initialized with its corresponding init proc:
.. code-block:: nimrod
proc autoOpen(filename: string): TFile {.destructor: close.} =
result = open(filename)
var f = autoOpen("abc.txt")
A template ``atScopeExit`` can easily be defined with this mechanism. However
unfortunately the regex problem is not solved at all:
.. code-block:: nimrod
if x =~ re"abc":
...
We really need some form of escape analysis; ``var`` or ``let`` is not enough!
Hm, but what if the procs declare that property:
.. code-block:: nimrod
proc `=~` (s: string, pattern: TRegex{.noEscape.}): bool
So it's bound to a type again?
version 0.9.0
=============
- test the sort implementation again
- const ptr/ref
- unsigned ints and bignums; requires abstract integer literal type
- implement the high level optimizer
- warning for implicit openArray -> varargs convention
- implement explicit varargs; **but** ``len(varargs)`` problem remains!
--> solve by implicit conversion from varargs to openarray
- tests: run the GC tests
- change overloading resolution
- implement closures; implement proper coroutines
- make exceptions compatible with C++ exceptions
- ``=`` should be overloadable; requires specialization for ``=``
- 'const' objects including case objects
- os module should use Windows Unicode versions
- 64bit build for Windows
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
- optional indentation for 'case' statement
Bugs
----
- bug: generic assign still buggy
- Optimization: If we use a temporary for the result anyway the code gen
should make use of this fact to generate better code...
- bug: memset() without type field initialization?
- special case the generic assign that needs to care about case objects
- bug: returning a tyVar does not mean it is save to return it:
proc forward[T](x: var T): var T = result = x
proc p(): var int =
var x: int
result = forward(x)
- bug: DLL generation is broken; write at least a basic test
- bug: stress testing basic method example (eval example)
without ``-d:relase`` leaks memory; good way to figure out how a
fixed amount of stack can hold an arbitrary number of GC roots!
version 0.9.XX
==============
- GC: marker procs for native Nimrod GC and Boehm GC; precise stack marking
- implicit ref/ptr->var conversion; the compiler may store an object
implicitly on the heap for write barrier efficiency; better:
proc specialization in the code gen
- EcmaScript needs a new and better code gen: simply adapt the C code gen to it
- tlastmod returns wrong results on BSD (Linux, MacOS X: works)
- nested tuple unpacking; tuple unpacking in non-var-context
- 'nimrod def': does not always work?
- test branch coverage
- checked exceptions
- make pegs support a compile-time option and make c2nim use regexes instead
per default?
- fix implicit generic routines
- think about ``{:}.toTable[int, string]()``
- mocking support with ``tyProxy`` that does:
o.p(x) --> p(o, x) --> myMacro(o, p, x)
- nice idea:
p(a, b):
echo a
echo b
is the same as:
p(a, b, proc() =
echo a
echo b)
Library
-------
- wrappers for poppler; libharu
- radix tree for strings; maybe suffix tree
- locale support
- bignums
- ftp (and other internet protocols)
- pdcurses bindings
- for system:
proc `@` [T](a: openArray[T]): seq[T] =
newSeq(result, a.len)
for i in 0..a.len-1: result[i] = a[i]
--> ensure @[] calls the array version!
Low priority
------------
- ``with proc `+`(x, y: T): T`` for generic code
- new feature: ``distinct T with operations``
- find a way for easy constructors and destructors; (destructors are much more
important than constructors)
- code generated for type information is wasteful
- resizing of strings/sequences could take into account the memory that
is allocated
- timeout for locks
- adapt thread var emulation to care about the new merge operation
Version 2
=========
- language change: inheritance should only work with reference types, so that
the ``type`` field is not needed for objects! --> zero overhead aggregation
BETTER: ``of`` and safe object conversions only work with ref objects. Same
for multi methods.
- explicit nil types?
* nil seq[int]
* nil string
* nil ref int
* nil ptr THallo
* nil proc
- better for backwards compatibility: default nilable, but ``not nil``
notation:
type
PWindow = ref TWindow not nil
The problem with ``nil`` is that the language currently relies on it for
implicit initialization. Initialization is different from assignment. The
issues can "easily" dealt with by ensuring:
var x = myProc() # checks myProc() initializes every pointer explicitely
- the two other parsers
- generalized case statement (requires better transf)
- rethink the syntax: distinction between expr and stmt is unfortunate;
indentation handling is quite complex too; problem with exception handling
is that often the scope of ``try`` is wrong and apart from that ``try`` is
a full blown statement; a ``try`` expression might be a good idea to make
error handling more light-weight
people also want ``inc a; inc b``
--> solved by providing an expr version of most control structures?