summary refs log tree commit diff stats
path: root/tests/parser/tprocexprasstmt.nim
Commit message (Expand)AuthorAgeFilesLines
* second test case haul for templates and generics (#22728)metagn2023-09-191-1/+12
* allow proc expressions in place of statements (#20935)metagn2022-11-291-0/+3
rumpf_a@web.de> 2012-07-08 21:03:47 +0200 changed integer promotion rules; breaks bootstrapping and lots of code' href='/ahoang/Nim/commit/todo.txt?h=devel&id=4fbba0a65ad310ba9498f1cf9f79eb0826b19f81'>4fbba0a65 ^
a6e0679ae ^
0b509127d ^
a6e0679ae ^
8ce1c99d0 ^
ee1bcb641 ^
0b509127d ^
09499b382 ^
b5d34242c ^
32b4192b3 ^
5a838d3e0 ^
32b4192b3 ^
f191059e5 ^
2c4a1dbc0 ^
0b509127d ^
8d99753d6 ^

bd1cb9e77 ^
afd8ca2f1 ^
e88123fb1 ^




2bd14f4ba ^
b5d8e8bfa ^
d10973adb ^

fd62116f6 ^
0857efe51 ^

94013a4cf ^

fd62116f6 ^
d10973adb ^
4fa80956b ^

d10973adb ^
fe285b354 ^

f2af2fb47 ^
fe285b354 ^
4fbba0a65 ^

869a5aa90 ^
4fbba0a65 ^
a6e0679ae ^

a6e0679ae ^

a6ee0eb29 ^
d10973adb ^
2d54b8508 ^
8b6f9ef5e ^
4741e8f9a ^
2b323c638 ^

c25ffbf26 ^
869a5aa90 ^
5b96eaa95 ^
4839800c2 ^
7fd8f285d ^
f7f0c90ff ^




4839800c2 ^
a1cdd6e7f ^







2183bf77a ^

d10973adb ^



cd83cc81a ^
8e7917c3f ^
d10973adb ^
d10973adb ^
d10973adb ^
d10973adb ^
d10973adb ^
990dc2d71 ^


869a5aa90 ^
dd99fe61c ^
e956abbad ^
ee1bcb641 ^
990dc2d71 ^
3e806a374 ^

d560e84fc ^
72651de71 ^

7e2bb7250 ^
fedc69f61 ^

299390a58 ^
03ba0f3e2 ^




bcbfa3aaa ^


c53ad1b39 ^
cb79bf9f1 ^
752cddb91 ^

f191059e5 ^
632aece19 ^
990dc2d71 ^
ec0f982ed ^






c53ad1b39 ^


c53ad1b39 ^








d10973adb ^

6a8a409f1 ^
d10973adb ^








d10973adb ^
61a442bb0 ^
d10973adb ^


3005955d2 ^





e194037ea ^







3005955d2 ^
e194037ea ^
d10973adb ^
959e370ae ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

             
 
                                       
                                                                    
 
            
                                    
                                  
                      
 
                                                    
                                                              
                                                                 
                                              
                             
                                                                         
                               
                                                                     

                                                          
 
                        




                                                                            
 
 

    
 

                                                                             

                                                                          
 
 

              
 

               
                          
 

                                                                               
                                  
                                          

                                                            

                                                                         
                                                                      
                                                               
                                                            
                                     
                      

                                                                            
                                        
                  
                                            
                                             
                                          




                                                  
            







                  

           



       
              
                             
         
 
                   
 
 


            
                                         
                                                
                                             
                                        
                                                 

                                                                       
                   

                                                                    
                                                                       

                                                                              
                                                                        




                                                            


                                                                        
                             
                            

                                                                        
                                                        
 
 






                                                                             


                    








                                                                            

                                                                             
                                                                             








                     
                                                                      
           


                                 





                                                                            







                                                              
    
                    
 
                                                     
version 0.9.0
=============

- implicit deref for parameter matching
- deprecate ``var x, y = 0`` as it's confusing for tuple consistency

New pragmas:
- ``hoist`` pragma for loop hoisting
- fix & document ``byCopy`` pragma
- document destructors

- ``borrow`` needs to take type classes into account
- make use of ``tyIter`` to fix the implicit items/pairs issue
- ``=`` should be overloadable; requires specialization for ``=``
- optimize genericAssign in the code generator
- fix remaining closure bugs:
  - make toplevel but in a scope vars local; make procs there inner procs
  - fix evals.nim with closures
  - implement "closure tuple consists of a single 'ref'" optimization
  - make closure default calling convention for proc types
  - fix '==' for closures

- document 'do' notation
- 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


Bugs
----

- bug: pragma statements in combination with symbol files are evaluated twice
  but this can lead to compilation errors
- bug: the parser is not strict enough with newlines: 'echo "a" echo "b"' 
  compiles


version 0.9.XX
==============

- JS gen:
  - document it
  - fix exception handling

- make templates hygienic by default: try to gensym() everything in the 'block'
  of a template; find a better solution for gensym instead of `*ident`
- document nimdoc properly finally
- make 'clamp' a magic for the range stuff
- implement a warning message for shadowed 'result' variable
- implement the high level optimizer
- we need to support iteration of 2 different data structures in parallel
- implement proper coroutines
- proc specialization in the code gen for write barrier specialization
- 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
- make pegs support a compile-time option and make c2nim use regexes instead
  per default?
- 'const' objects including case objects
- 'export' feature
- think about ``{:}.toTable[int, string]()``
- mocking support with ``tyProxy`` that does:
  o.p(x) --> p(o, x) -->  myMacro(p, o, x)
  
  This is really the opposite of ``tyExpr``:
  * For parameter ``tyExpr`` any argument matches.
  * Argument ``tyProxy`` matches any parameter.
  
- nice idea:

  p(a, b): 
    echo a
    echo b
  
  is the same as:
  
  p(a, b, proc() =
    echo a
    echo b)

Library
-------

- suffix trees
- locale support; i18n module
- bignums

- pdcurses bindings


Low priority
------------

- change how comments are part of the AST
- ``with proc `+`(x, y: T): T`` for generic code
- new feature: ``distinct T with operations``
- implement the "easy" constructors idea
- code generated for type information is wasteful
- resizing of strings/sequences could take into account the memory that
  is allocated
- timeout for locks
- compilation cache:
  - adapt thread var emulation to care about the new merge operation
  - check for interface changes; if only the implementation changes, no
    need to recompile clients; er ... what about templates, macros or anything
    that has inlining semantics?
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
- GC: precise stack marking;
  escape analysis for string/seq seems to be easy to do too;
  even further write barrier specialization
- GC: marker procs Boehm GC
- implement marker procs for assignment and message passing
- warning for implicit openArray -> varargs conversion
- implement explicit varargs; **but** ``len(varargs)`` problem remains! 
  --> solve by implicit conversion from varargs to openarray
- optimize method dispatchers
- activate more thread tests
- implement ``--script:sh|bat`` command line option; think about script 
  generation
- implement closures that support nesting of *procs* > 1


Further optimization ideas
==========================

- To optimize further copies away, you want to gather the additional
  information inlining would provide, but don't inline for code size reasons.


Version 2 and beyond
====================

- 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 
  (or implicit) syncGC() calls in loops. Automatic loop injection seems
  troublesome, but maybe we can come up with a simple heuristic. (All procs
  that `new` shared memory are syncGC() candidates...)

- implement/generalize the effect system; checked exceptions
- const ptr/ref

- 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

- guards for the 'case' statement; generalized case statement;
  a guard looks like: 
  
    case x
    of nkStmtList if x.value == 0: 
  
  a generalized case statement looks like:
    
    case x with `=~`

- implement ``partial`` pragma for partial evaluation