-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
195 lines (162 loc) · 12.8 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>The Neat Language — Neat documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=039e1c02" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Getting Started" href="getstarted.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="the-neat-language">
<h1>The Neat Language<a class="headerlink" href="#the-neat-language" title="Link to this heading">¶</a></h1>
<p>Neat is a C-like statically-typed native compiled language with automated reference counting, OOP and macros.
Its syntax is heavily “inspired by” D.</p>
<p>Have some example code! Here’s a program that prints the longest line in a file:</p>
<div class="highlight-d notranslate"><div class="highlight"><pre><span></span><span class="k">module</span><span class="w"> </span><span class="n">longestline</span><span class="p">;</span>
<span class="kr">macro</span><span class="w"> </span><span class="k">import</span><span class="w"> </span><span class="n">std</span><span class="p">.</span><span class="kr">macro</span><span class="p">.</span><span class="n">listcomprehension</span><span class="p">;</span>
<span class="k">import</span><span class="w"> </span><span class="n">std</span><span class="p">.</span><span class="n">file</span><span class="p">;</span>
<span class="k">import</span><span class="w"> </span><span class="n">std</span><span class="p">.</span><span class="n">stdio</span><span class="p">;</span>
<span class="k">import</span><span class="w"> </span><span class="n">std</span><span class="p">.</span><span class="nb">string</span><span class="p">;</span>
<span class="kt">void</span><span class="w"> </span><span class="n">main</span><span class="p">(</span><span class="nb">string</span><span class="p">[]</span><span class="w"> </span><span class="n">args</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">auto</span><span class="w"> </span><span class="n">text</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">readText</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
<span class="w"> </span><span class="nb">string</span><span class="w"> </span><span class="n">longestLine</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">[</span>
<span class="w"> </span><span class="n">argmax</span><span class="p">(</span><span class="n">line</span><span class="p">.</span><span class="n">strip</span><span class="p">.</span><span class="n">length</span><span class="p">)</span><span class="w"> </span><span class="n">line</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">line</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">text</span><span class="p">.</span><span class="n">split</span><span class="p">(</span><span class="s">"\n"</span><span class="p">)];</span>
<span class="w"> </span><span class="n">print</span><span class="p">(</span><span class="n">longestLine</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">...</span>
<span class="p">$</span><span class="w"> </span><span class="n">neat</span><span class="w"> </span><span class="n">longestline</span><span class="p">.</span><span class="n">nt</span>
<span class="p">...</span>
<span class="p">$</span><span class="w"> </span><span class="p">./</span><span class="n">longestline</span><span class="w"> </span><span class="n">longestline</span><span class="p">.</span><span class="n">nt</span>
<span class="kr">macro</span><span class="w"> </span><span class="k">import</span><span class="w"> </span><span class="n">std</span><span class="p">.</span><span class="kr">macro</span><span class="p">.</span><span class="n">listcomprehension</span><span class="p">;</span>
</pre></div>
</div>
<p><strong>Important notice</strong>: Before you jump in, please read the section <a class="reference internal" href="getstarted.html#good-and-bad-neat"><span class="std std-ref">Good and Bad Neat</span></a>!</p>
<p>For <strong>more examples,</strong> see the <a class="reference external" href="https://github.com/Neat-Lang/neat/tree/master/demos">Demos</a> page.</p>
</section>
<section id="community">
<h1>Community<a class="headerlink" href="#community" title="Link to this heading">¶</a></h1>
<ul class="simple">
<li><p><a class="reference external" href="https://discord.gg/QkUecKgUvS">Neat Language on Discord</a></p></li>
<li><p><a class="reference external" href="https://web.libera.chat/#neat">#neat on libera.chat</a> (formerly Freenode).</p></li>
<li><p>If you’re trying out the language, drop by and say hi!</p></li>
<li><p><a class="reference external" href="https://github.com/Neat-Lang/neat/discussions">Github Discussions</a></p></li>
</ul>
</section>
<section id="contents">
<h1>Contents<a class="headerlink" href="#contents" title="Link to this heading">¶</a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="getstarted.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="getstarted.html#install-on-windows">Install on Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="getstarted.html#install-with-llvm">Install with LLVM</a></li>
<li class="toctree-l2"><a class="reference internal" href="getstarted.html#install-with-gcc">Install with GCC</a></li>
<li class="toctree-l2"><a class="reference internal" href="getstarted.html#start-a-project">Start a Project</a></li>
<li class="toctree-l2"><a class="reference internal" href="getstarted.html#good-and-bad-neat">Good and Bad Neat</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro.html#what-is-neat">What is Neat?</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#why-make-another-new-language">Why make another new language?</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#okay-so-what-is-neat-like">Okay, so what is Neat like?</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#a-digression-why-reference-counting">A digression: why reference counting?</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#is-neat-production-ready">Is Neat production ready?</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#a-note-on-security">A note on security</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#final-notes">Final notes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="manual.html">Manual</a><ul>
<li class="toctree-l2"><a class="reference internal" href="manual.html#lexical">Lexical</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#modules">Modules</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#packages">Packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#module-level-statements">Module-Level Statements</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#expressions">Expressions</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#functions">Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#statements">Statements</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#types">Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#unittest">Unittest</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#templates">Templates</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#ranges">Ranges</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#lambdas">Lambdas</a></li>
<li class="toctree-l2"><a class="reference internal" href="manual.html#macros">Macros</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="std.html">Standard Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="std/algorithm.html">std.algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/argparse.html">std.argparse</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/container/binheap.html">std.container.binheap</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/error.html">std.error</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/file.html">std.file</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/json.html">std.json</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/json/stream.html">std.json.stream</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/math.html">std.math</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/math/matrix.html">std.math.matrix</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/math/vector.html">std.math.vector</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/process.html">std.process</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/range/iota.html">std.range.iota</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/sha256.html">std.sha256</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/socket.html">std.socket</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/stdio.html">std.stdio</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/stream.html">std.stream</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/string.html">std.string</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/thread.html">std.thread</a></li>
<li class="toctree-l2"><a class="reference internal" href="std/time.html">std.time</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neat-lang/neat/">Neat on Github 🔗</a></li>
</ul>
</div>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="#">Neat</a></h1>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="getstarted.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="manual.html">Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="std.html">Standard Library</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neat-lang/neat/">Neat on Github 🔗</a></li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©@FeepingCreature.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
<a href="_sources/index.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>