Nimrod -> Nim
This commit is contained in:
parent
d37a83e181
commit
a989172605
|
@ -46,7 +46,7 @@ Exceptions | No (Yes w/C++) | Yes
|
||||||
|
|
||||||
### Philosophy
|
### Philosophy
|
||||||
|
|
||||||
The key to understanding Nim is that Nim was designed to be as fast as C, but to be much safer. Many of the design-decisions are based on making it harder to shoot yourself in the foot. For example, in C you are required to use a pointer for most of your everyday programming needs. While Nim does give you pointers, Nim gives you other, safer tools for your everyday needs, while pointers are mostly reserved for interfacing with C and doing low-level system programming. In other words, C gives you a combined hammer and gun, while Nimrod gives you a separate gun and hammer.
|
The key to understanding Nim is that Nim was designed to be as fast as C, but to be much safer. Many of the design-decisions are based on making it harder to shoot yourself in the foot. For example, in C you are required to use a pointer for most of your everyday programming needs. While Nim does give you pointers, Nim gives you other, safer tools for your everyday needs, while pointers are mostly reserved for interfacing with C and doing low-level system programming. In other words, C gives you a combined hammer and gun, while Nim gives you a separate gun and hammer.
|
||||||
|
|
||||||
The other important thing to know is that while C uses a separate language to do meta-programming (the preprocessor), Nim meta-programming is done with the Nim language itself. That means that most Nim code can be executed at compile time, and Nim's ability to generate Nim-code at compile time is much more sophisticated.
|
The other important thing to know is that while C uses a separate language to do meta-programming (the preprocessor), Nim meta-programming is done with the Nim language itself. That means that most Nim code can be executed at compile time, and Nim's ability to generate Nim-code at compile time is much more sophisticated.
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ var y2 = 2
|
||||||
let z = 2
|
let z = 2
|
||||||
</pre>
|
</pre>
|
||||||
</td>
|
</td>
|
||||||
<td><b>Define variable</b>. y2 uses type inference. z is single-assignment. In nimrod, uninitialized variables is initialized to 0/nil or similar defaults.</i>
|
<td><b>Define variable</b>. y2 uses type inference. z is single-assignment. In Nim, uninitialized variables is initialized to 0/nil or similar defaults.</i>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue