-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.html
More file actions
184 lines (157 loc) Β· 7.4 KB
/
install.html
File metadata and controls
184 lines (157 loc) Β· 7.4 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Install NaC - Getting Started</title>
<link
href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700;900&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="assets/style.css" />
<link rel="shortcut icon" href="assets/logo.png" />
</head>
<body>
<div class="grid-bg"></div>
<header>
<a href="/" class="logo">NaC</a>
<nav>
<a href="/#why">Why NaC</a>
<a href="/#learn">Learn</a>
<a href="docs.html">Docs</a>
<a href="https://github.com/naclang/nac">GitHub</a>
</nav>
</header>
<div class="container">
<h1>Getting Started</h1>
<p class="subtitle">Install and compile NaC in minutes. Start building amazing things.</p>
<h2><span class="step-number">1</span> Prerequisites</h2>
<p>Before installing NaC, make sure you have the following:</p>
<ul>
<li>GCC compiler (version 4.9 or higher)</li>
<li>Git (to clone the repository)</li>
<li>Curl (Linux and MacOS only, for HTTP requests)</li>
</ul>
<div class="info-box">
<strong>π‘ Quick Check:</strong> Run <code>gcc --version</code> to verify your GCC installation.
</div>
<h2><span class="step-number">2</span> Download NaC</h2>
<p>Clone the repository from GitHub:</p>
<br />
<div class="code-block" data-lang="bash">
<code
><span class="command">git clone</span> https://github.com/naclang/nac.git<br /><span
class="command"
>cd</span
>
nac</code
>
</div>
<h2><span class="step-number">3</span> Compile the Interpreter</h2>
<p>Compile the NaC interpreter using GCC:</p>
<h3>Platform-Specific Instructions</h3>
<h4>Windows (MinGW / MSYS2)</h4>
<div class="code-block" data-lang="bash">
<code
><span class="command"># Using MinGW</span><br />
./build.bat<br />
<br />
<span class="command"># Add to PATH (optional)</span><br />
set PATH=%PATH%;C:\path\to\nac</code
><br />
</div>
<br />
<h4>Linux / macOS</h4>
<div class="code-block" data-lang="bash">
<code
><span class="command"># Make executable</span><br />
chmod +x build.sh<br />
<br />
<span class="command"># Optional: Install system-wide</span><br />
./build.sh<br>
<br>
<span class="command"># Optional: Install system-wide</span><br />
sudo cp nac /usr/local/bin/</code
><br />
</div>
<h2><span class="step-number">4</span> Verify Installation</h2>
<p>Run your first NaC program:</p><br>
<div class="code-block" data-lang="bash">
<code><span class="command">./nac</span> examples/test.nac</code>
</div>
<div class="success-box"><strong>β
Success!</strong> If you see the output, NaC is working correctly.</div>
<h2><span class="step-number">5</span> Try More Examples</h2>
<p>Explore the examples directory for more sample programs:</p><br>
<div class="code-block" data-lang="bash">
<code>
<span class="command"># Factorial calculation</span><br>
./nac examples/factorial.nac<br>
<br />
<span class="command"># Number guessing game</span><br>
./nac examples/guess.nac<br>
<br />
<span class="command"># Prime number check</span><br>
./nac examples/prime.nac<br>
<br />
<span class="command"># Fibonacci sequence</span><br>
./nac examples/fibonacci.nac<br>
<br />
<span class="command"># HTTP example</span><br>
./nac examples/http.nac<br>
<br />
<span class="command"># Array operations</span><br>
./nac examples/arrays.nac<br>
<br />
<span class="command"># Sorting algorithm</span><br>
./nac examples/bubble_sort.nac
</code>
</div>
<h2>Compilation Options</h2>
<p>Advanced compilation options for optimization:</p>
<h3>Debug Build</h3>
<div class="code-block" data-lang="bash">
<code><span class="command">gcc</span> -g -o...</code>
</div>
<h3>Optimized Build</h3>
<div class="code-block" data-lang="bash">
<code><span class="command">gcc</span> -O3...</code>
</div>
<h3>Static Build (Portable)</h3>
<div class="code-block" data-lang="bash">
<code><span class="command">gcc</span> -static...</code>
</div>
<h2>Troubleshooting</h2>
<h3>Common Issues</h3>
<div class="info-box">
<strong>Error: "undefined reference to 'sqrt'"</strong><br />
Solution: Make sure to include the <code>-lm</code> flag when compiling.
</div>
<div class="info-box">
<strong>Error: "gcc: command not found"</strong><br />
Solution: Install GCC using your package manager:<br />
β’ Ubuntu/Debian: <code>sudo apt install build-essential</code><br />
β’ Fedora: <code>sudo dnf install gcc</code><br />
β’ macOS: <code>xcode-select --install</code>
</div>
<div class="info-box">
<strong>Error: "Permission denied"</strong><br />
Solution: Run <code>chmod +x nac</code> to make the binary executable.
</div>
<h2>Next Steps</h2>
<p>Now that you have NaC installed, here's what to do next:</p>
<ul>
<li>π <a href="docs.html">Read the documentation</a> to learn the language syntax</li>
<li>π» Check out <a href="/#learn">code examples</a> on the main page</li>
<li>π Join the <a href="https://github.com/naclang/nac/discussions">community discussions</a></li>
<li>
π Report bugs or request features on <a href="https://github.com/naclang/nac/issues">GitHub</a>
</li>
</ul>
<a href="docs.html" class="btn-primary">Read Full Documentation β</a>
</div>
<footer>
<p>NaC Language | <a href="https://github.com/naclang/nac" target="_blank">GitHub</a></p>
<p style="margin-top: 1rem">Built with β€οΈ for developers</p>
</footer>
</body>
</html>