summary refs log tree commit diff stats
path: root/compiler/commands.nim
Commit message (Expand)AuthorAgeFilesLines
* Add path directive to allow inclusion of config file's path itselftransfuturist2015-05-141-2/+4
* fixes #2569Araq2015-04-231-3/+1
* re-enable git hash compiler infoAraq2015-04-111-3/+3
* preparations for better gcsafety messagesAraq2015-04-041-89/+89
* don't use stdout for nimsuggest server modeAraq2015-02-271-1/+1
* improved --debugger switch; updated release planAraq2015-02-271-5/+15
* fixes #2102Araq2015-02-131-9/+9
* configuration system supports %= to access environment variablesAraq2015-02-071-1/+1
* nimsuggest: sane dirty buffer handlingAraq2015-01-291-4/+5
* nimsuggest: first versionAraq2015-01-271-11/+9
* Happy new year!Guillaume Gelin2015-01-061-1/+1
* implemented 'experimental' switchAraq2014-12-051-0/+4
* Merge branch 'devel' into bigbreakAraq2014-10-201-1/+3
|\
| * default to warnGcUnsafe for threads:onAraq2014-10-191-1/+3
* | nimfix now in its own directory; single file mode now the defaultAraq2014-10-051-1/+3
* | Merge branch 'devel' of https://github.com/Araq/Nimrod into bigbreakAraq2014-10-041-2/+2
|\|
| * Disable git hashing in the version commandVarriount2014-09-281-2/+2
* | nimfix handles helloworldAraq2014-09-061-2/+1
* | fixes #903, fixes #1513Araq2014-09-031-2/+32
* | renamed babelcmd to nimblecmd; config files are now nim.cfg; other renamingsAraq2014-08-291-6/+7
* | Nimrod renamed to NimAraq2014-08-281-2/+2
* | renamefestAraq2014-08-231-1/+1
|/
* distinguish between 'defined' and 'declared'Araq2014-08-111-0/+3
* Update commands.nimVarriount2014-08-021-2/+0
* Clean up moreClay Sweetser2014-07-291-2/+2
* Clean up a bit.Clay Sweetser2014-07-291-5/+5
* Fix #813Clay Sweetser2014-07-291-3/+9
* fixed build configuration detectionAraq2014-07-011-19/+24
* Adds git hash to compiler's version switch. Refs #1119.Grzegorz Adam Hankiewicz2014-04-221-0/+5
* Version switch displays options used during `koch boot`Grzegorz Adam Hankiewicz2014-04-201-0/+22
* merged better html links #850Araq2014-04-081-0/+3
* it's the year 2014Araq2014-01-191-1/+1
* resolved conflicts with masterAraq2014-01-181-3/+6
|\
| * Added --noBabelPath override.Dominik Picheta2013-12-251-1/+4
* | case consistency: cs:partial bootstraps on windowsAraq2013-12-291-9/+9
* | case consistency: next stepsAraq2013-12-291-8/+8
* | case consistency part 4Araq2013-12-271-46/+46
* | case consistency part 1Araq2013-12-271-41/+41
* | next steps for FFI supportAraq2013-11-251-3/+3
|/
* support for --cs:partialAraq2013-09-241-1/+8
* --os and --cpu work in configuration filesAraq2013-05-191-2/+2
* support suggest after compile in caas modeZahary Karadjov2013-05-051-0/+19
* experimental support for answering idetools --def requests fromZahary Karadjov2013-05-041-1/+2
* fixes #394Araq2013-04-231-2/+5
* added manyloc test suite; --path now relative to project dir if not absoluteAraq2013-04-131-5/+7
* implemented --dynlibOverride option for static linking of 'dynlib'Araq2013-04-081-0/+7
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
* Merge pull request #280 from keitahaga/better-error-messageAraq2013-02-211-3/+8
|\
| * Better CLI error message when options are invalidKeita Haga2012-12-161-3/+8
* | preparations for a generational GCAraq2013-02-161-0/+4
='alt'>
73fbcc1f6 ^
0b2a63b7b ^

2f9fd3277 ^












73fbcc1f6 ^
0b2a63b7b ^

5a9ba3469 ^
2f9fd3277 ^






73fbcc1f6 ^
2f9fd3277 ^


f45093893 ^
f9c184a49 ^
556f48808 ^
0b2a63b7b ^




d7a472743 ^
0b2a63b7b ^
556f48808 ^
0b2a63b7b ^
73fbcc1f6 ^
0b2a63b7b ^



556f48808 ^
0b2a63b7b ^
556f48808 ^
73fbcc1f6 ^


556f48808 ^
0b2a63b7b ^


556f48808 ^

0b2a63b7b ^

556f48808 ^

f9c184a49 ^









74fdd5c2e ^
2f9fd3277 ^
0b2a63b7b ^

b420d8b66 ^
5031b638d ^
2f9fd3277 ^


f081ac0e5 ^

74fdd5c2e ^

f081ac0e5 ^
74fdd5c2e ^
f081ac0e5 ^
74fdd5c2e ^
f081ac0e5 ^
73fbcc1f6 ^
2f9fd3277 ^
74fdd5c2e ^
16381364c ^
2f9fd3277 ^
e6dcceae6 ^
2f9fd3277 ^







74fdd5c2e ^
2f9fd3277 ^










acbb7ebc0 ^

2f9fd3277 ^
209a5fc1b ^
2f9fd3277 ^


07562d6b9 ^
4080a9ca4 ^
07562d6b9 ^
2f9fd3277 ^




07562d6b9 ^
2f9fd3277 ^


d7a472743 ^
0b2a63b7b ^
16381364c ^
0b2a63b7b ^
f9c93d23b ^
0b2a63b7b ^
866205cba ^




f9c93d23b ^
866205cba ^
866205cba ^
0b2a63b7b ^
f081ac0e5 ^

cf70fe629 ^

7982fc4f0 ^
cf70fe629 ^

cf70fe629 ^





















7982fc4f0 ^

















cf70fe629 ^


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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
                     
                                                                           
                           
              
               
      

                                                                       
                                             
                                                                                      
                                                                         
                   

                                                                                         

         


                                                                 
                                                                                                    





                                                                                                                                  


                                    
                                                               
                             
                                 
                             
                                                             

                                  
                             





                                                                  
                                                                                 

                
              


              
 



                                    

                                    
                                   
 

                            
                         
                                                     
                 
                                      

                                                      












                                                                                                                                           
                                          

                                                   
                                                                                               






                                                                                                                   
                                                                                                                                      


                                                
                
                                              
                 




                                                                                                                                         
                                                                        
                                                                                     
 
                                          
                                                             



                                                                                                                                 
                 
                                            
     


                                               
 


                                                                                                                                      

            

                                                                                                                   

                  









                                                                                                                                            
              
                                

                                                                                    
                                                                     
                                                                     


                            

                       

                                  
                                    
                                                                                 
                 
                
         
                        
                                                                         
                                                               
                               
                                              
         







                                                    
                                                                   










                                                                      

                                                                                                               
                                                                                            
                                                                                                                   


                                                                  
                                                                                                   
                                                                              
                                                                




                                                                                                                                                                                 
                                                                                                                                                                                                       


                                      
 
                            
                                                   
        
                    
          




                                                                                   
                                              
                           
           
         

       

         
 

                                                        





















                                                                  

















                                                                                            


         
#? stdtmpl | standard
#proc generateHTMLPage(c: var TConfigData, currentTab, title, content, rss,
#   rootDir = ""): string =
#  result = ""
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>${title} - $c.projectTitle</title>
    <link rel="stylesheet" type="text/css" href="${rootDir}assets/style.css?t=2320" />
    <link rel="shortcut icon" href="${rootDir}assets/images/favicon.ico">
  #if len(rss) > 0:
    <link href="$rss" title="Recent changes" type="application/atom+xml" rel="alternate">
  #end if
  </head>
  <body>
    <div id="bountysource">
      <a href="https://salt.bountysource.com/teams/nim">
      <div class="page-layout" style="padding: 2pt 2pt 2pt 30pt">
  	<img src="${rootDir}assets/bountysource/bountysource.png" style="width: 20px; float: left;">
        <span style="margin-left: 10pt; float: left; margin-top: 2pt;">Fund Nim and help us develop it further!</span>
        <img src="https://api.bountysource.com/badge/team?team_id=19072&style=raised" style="margin-top: 2pt; margin-left: 10pt"/>
      </div>
      </a>
    </div>

    <header id="head">
      <div class="page-layout tall">
        <div id="head-logo"></div>
        <a id="head-logo-link" href="${rootDir}index.html"></a>
        <nav id="head-links">
      #for i in 0.. c.tabs.len-1:
      # let t = c.tabs[i].val
      # if t != "index" and t != "community" and t != "news":
      #   let name = c.tabs[i].key
      #   if currentTab == t:
            <a class="active"
      #   else:
            <a
      #   end if
      #   if t.contains('.'):
            href="${t}" title = "$c.projectName - $name">$name</a>
      #   else:
            href="${rootDir}${t}.html" title = "$c.projectName - $name">$name</a>
      #   end if
      # end if
      #end for
        </nav>
      </div>
    </header>

#  if currentTab == "index":
    <section id="neck" class="home">
#  else:
    <section id="neck">
#  end
      <div class="page-layout tall">
        <div id="glow-arrow"></div>

#  if currentTab == "index":
        <div id="slideshow">
          <!-- slides -->
          <div id="slide0" class="active codeslide2">
            <div>
              <h2>Nim is simple..</h2>
<pre>
<span class="cmt"># compute average line length</span>
<span class="kwd">var</span>
<span class="tab">  </span>sum = <span class="val">0</span>
<span class="tab end">  </span>count = <span class="val">0</span>

<span class="kwd">for</span> line <span class="kwd">in</span> stdin.lines:
<span class="tab">  </span>sum += line.len
<span class="tab end">  </span>count += <span class="val">1</span>

echo(<span class="val">"Average line length: "</span>,
  <span class="kwd">if</span> count &gt; <span class="val">0</span>: sum / count <span class="kwd">else</span>: <span class="val">0</span>)
</pre>
            </div>
            <div>
               <h2>..and type safe...</h2>
<pre>
<span class="cmt"># create and greet someone</span>
<span class="kwd">type</span> <span class="def">Person</span> = <span class="kwd">object</span>
<span class="tab">  </span>name: <span class="typ">string</span>
<span class="tab end">  </span>age: <span class="typ">int</span>

<span class="kwd">proc</span> <span class="def">greet</span>(p: <span class="typ">Person</span>) =
<span class="tab">  </span>echo <span class="val">"Hi, I'm "</span>, p.name, <span class="val">"."</span>
<span class="tab end">  </span>echo <span class="val">"I am "</span>, p.age, <span class="val">" years old."</span>

<span class="kwd">let</span> p = <span class="typ">Person</span>(name:<span class="val">"Jon"</span>, age:<span class="val">18</span>)
p.greet() <span class="cmt"># or greet(p)</span>
</pre>
             </div>
          </div>
          <div id="slide1" class="codeslide3">
            <div>
              <h2>C FFI is easy in Nim..</h2>
<pre>
<span class="cmt"># declare a C procedure..</span>
<span class="kwd">proc</span> <span class="def">unsafeScanf</span>(f: <span class="typ">File</span>, s: <span class="typ">cstring</span>)
<span class="tab">  </span>{.varargs,
<span class="tab">    </span>importc: <span class="val">"fscanf"</span>,
<span class="tab end">    </span>header: <span class="val">"&lt;stdio.h&gt;"</span>.}

<span class="cmt"># ..and use it...</span>
<span class="kwd">var</span> x: <span class="typ">cint</span>
stdin.unsafeScanf(<span class="val">"%d"</span>, <span class="kwd">addr</span> x)
</pre>
              <p><span class="desc"><b>Compile and run with:</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&#36; nim c -r example.nim</span></p>
            </div>
            <div>
              <h2>..and DSLs are too...</h2>
<pre>
<span class="cmt"># a simple html server</span>
<span class="kwd">import</span>
  jester, asyncdispatch, htmlgen

<span class="kwd">routes</span>:
<span class="tab">  </span><span class="kwd">get</span> <span class="val">"/"</span>:
<span class="tab end">  <span class="tab end">  </span></span><span class="kwd">resp</span> h1(<span class="val">"Hello world"</span>)

runForever()
</pre>
              <p><span class="desc"><b>View in browser at:</b><br>&nbsp;&nbsp;&nbsp;&nbsp;localhost:5000</span></p>
            </div>
          </div>
          <div id="slide2" class="niaslide">
            <a href="news/e030_nim_in_action_in_production.html">
              <img src="${rootDir}assets/niminaction/banner2.png" alt="A printed copy of Nim in Action should be available in March 2017!"/>
            </a>
          </div>
          <div id="slide3" class="niaslide">
            <a href="sponsors.html">
              <img src="${rootDir}assets/bountysource/meet_sponsors.png" alt="Meet our BountySource sponsors!"/>
            </a>
          </div>
        </div>
        <div id="slideshow-nav">
          <div id="slideControl0" onclick="slideshow_click(0)" class="active"></div>
          <div id="slideControl1" onclick="slideshow_click(1)"></div>
          <div id="slideControl2" onclick="slideshow_click(2)"></div>
          <div id="slideControl3" onclick="slideshow_click(3)"></div>
        </div>
#  end
        <aside id="sidebar">

#  if len(c.links) > 0:
          <h3>More Links</h3>
          <div id="sidebar-links">
#         for i in 0..c.links.len-1:
          <a href="${c.links[i].val}" id="${c.links[i].id}">${c.links[i].key}</a>
#         end for
          </div>
#  end if
#  if len(c.ticker) > 0:
					<h3 class="blue">Latest News</h3>
					<div id="sidebar-news">
          ${c.ticker % rootDir}
					</div>
#  end if
				</aside>
			</div>
		</section>

		<section id="body">
			<div id="body-border"></div>
			<div id="glow-line"></div>
			<div class="page-layout">
				<article id="content" class="page">
				$content
				</article>
			</div>
		</section>

		<!--- #foot --->
		<footer id="foot" class="home">
			<div class="page-layout tall">
				<div id="foot-links">
					<div>
						<h4>Documentation</h4>
						<a href="${rootDir}documentation.html">Stable Documentation</a>
						<a href="${rootDir}learn.html">Learning Resources</a>
					<!--	<a href="">Development Documentation</a> -->
						<a href="https://github.com/nim-lang/nim">Issues &amp; Requests</a>
					</div>
					<div>
						<h4>Community</h4>
						<a href="https://forum.nim-lang.org">User Forum</a>
            <a href="http://webchat.freenode.net/?channels=nim">Online IRC</a>
            <a href="https://irclogs.nim-lang.org/">IRC Logs</a>
					</div>
				</div>
				<div id="foot-legal">
					<h4>Written in Nim - Powered by <a href="https://github.com/dom96/jester">Jester</a></h4>
					Web Design by <a href="http://reign-studios.net/philipwitte/">Philip Witte</a> &amp; <a href="http://picheta.me/">Dominik Picheta</a><br>
					Copyright © 2017 - <a href="https://nim-lang.org/blog/">Andreas Rumpf</a> &amp; <a href="https://github.com/nim-lang/nim/graphs/contributors">Contributors</a>
				</div>
			</div>
		</footer>

#  if currentTab == "index":
  <script src="${rootDir}assets/index.js"></script>
# end if
#  if c.gaId != nil:
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', '${c.gaId}', 'nim-lang.org');
    ga('send', 'pageview');
  </script>
#  end if
</body>
</html>
#end proc
#
#
#proc generateSponsors(sponsors: seq[Sponsor]): string =
#result = ""
#for sponsor in sponsors:
  <dt class="level-${sponsor.level}">
    #if sponsor.url.len > 0:
      <a href="${sponsor.url}" target="_blank">${sponsor.name}</a>
    #else:
      ${sponsor.name}
    #end if
  </dt>
  <dd class="logo">
    #if sponsor.logo.len > 0:
    <a href="${sponsor.url}" target="_blank">
      <img alt="${sponsor.name}'s logo" src="${sponsor.logo}"/>
    </a>
    #end if
  </dd>
  <dd class="this_month">
    Donated <b>$$${sponsor.thisMonth}</b> this month
  </dd>
  <dd class="legend">
    Donated $$${sponsor.allTime} in total since ${sponsor.since}
  </dd>
#end for
#end proc
#proc generateSponsorsPage(activeSponsors, inactiveSponsors: seq[Sponsor]): string =
#result = ""
<h1 id="our-current-sponsors">Our Current Sponsors</h1>
<p>This section lists the companies and individuals that are, very kindly, contributing a
monthly amount to help sustain Nim's development. For more details take a
look at the <a href="https://salt.bountysource.com/teams/nim">Bountysource campaign</a>.</p>
<p class="lastUpdate">Last updated: ${getTime().getGMTime().format("dd/MM/yyyy")}</p>
<dl>
${generateSponsors(activeSponsors)}
</dl>
#
<h1 id="our-past-sponsors">Our Past Sponsors</h1>
<p>This section lists the companies and individuals that have contributed
money in the past to help sustain Nim's development. For more details take a
look at the <a href="https://salt.bountysource.com/teams/nim">Bountysource campaign</a>.</p>
<dl>
${generateSponsors(inactiveSponsors)}
</dl>
#
#end proc