Updated Nimrod for C programmers (markdown)
This commit is contained in:
parent
df51787100
commit
1b7896de82
|
@ -23,6 +23,10 @@ http://nimrod-lang.org/manual.html
|
|||
<tr><td>Custom Operators</td><td>No</td><td>Yes</td></tr>
|
||||
</table>
|
||||
|
||||
### Philosophy
|
||||
|
||||
The key to understanding Nimrod is that Nimrod 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. The other important thing to know is that while C uses a separate language to do meta-programming (the preprocessor), Nimrod meta-programming is done with the Nimrod language itself. That means that most Nimrod code can be executed at compile time, and Nimrod's ability to generate Nimrod-code at compile time is much more sophisticated.
|
||||
|
||||
### Arrays
|
||||
|
||||
In C an array is more or less syntactic sugar for pointers. In Nimrod, arrays are much more strict and safe to use. They are pass-by-value (meaning they're copied at assignment). When passing an array to a proc in Nimrod, the argument is a read-only reference, meaning it can't be assigned to. Take the following example:
|
||||
|
|
Loading…
Reference in New Issue