Content deleted Content added
Alexflatter (talk | contribs) No edit summary Tag: Reverted |
|||
(8 intermediate revisions by 6 users not shown) | |||
Line 5:
| name = Nim
| logo = Nim logo.svg
| logo caption = The Nim crown logo
| screenshot = <!-- Filename only -->
Line 23 ⟶ 22:
| operating system = [[Cross-platform software|Cross-platform]]<ref>{{Cite web |url=https://nim-lang.org/install.html |title=Install Nim |access-date=2018-10-12}}</ref>
| license = {{wikidata|property|reference|edit|P275}}
| website = {{
| file ext = .nim, .nims, .nimble
}}
'''Nim''' is a [[General-purpose programming language|general-purpose]], [[multi-paradigm programming language|multi-paradigm]], [[statically typed]], [[Compiled language|compiled]] [[High-level programming language|high-level]] [[System programming language|system]] [[programming language]],<ref name="drdobbs">{{cite web |url=http://www.drdobbs.com/open-source/nimrod-a-new-systems-programming-languag/240165321 |title=Nimrod: A new systems programming language |last=Rumpf |first=Andreas |website=[[Dr. Dobb's Journal]] |date=2014-02-11 |access-date=2014-07-20}}</ref> designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant",<ref name="nim-lang">{{cite web |url=http://nim-lang.org/ |title=The Nim Programming Language |website=Nim-lang.org |access-date=2014-07-20}}</ref> supporting [[metaprogramming]], [[functional programming|functional]], [[message passing]],<ref name="FAQ">{{cite web |url=https://nim-lang.org/faq.html |title=FAQ |website=nim-lang.org |access-date=2015-03-27}}</ref> [[Procedural programming|procedural]], and [[object-oriented programming]] styles by providing several features such as [[compile time]] code generation, [[algebraic data type]]s, a [[foreign function interface]] (FFI) with [[C (programming language)|C]], [[C++]], [[Objective-C]], and [[JavaScript]], and supporting compiling to those same languages as [[intermediate representation]]s.
Line 110 ⟶ 108:
| 2023-08-01
|-
| {{Version | co | 2.0.
|
|-
| rowspan="2" | 2.2
Line 117 ⟶ 115:
| 2024-10-02
|-
| {{Version | c | 2.2.
| 2025-
|-
| colspan="3" | {{Version | l | show=111100}}
Line 127 ⟶ 125:
Andreas Rumpf is the designer and original implementer of Nim. He received a diploma in computer science from the [[University of Kaiserslautern-Landau]], [[Germany]]. His research interests include hard realtime systems, embedded systems, compiler construction and artificial intelligence.<ref>{{Cite book |last=Andreas Rumpf |title=Mastering Nim: A complete guide to the programming language}}</ref>
The first version of the Nim [[compiler]] was written in [[Pascal (programming language)|Pascal]] using the [[Free Pascal]] compiler.<ref name="pas-sources">{{cite web |url=https://github.com/Araq/Nim/tree/ea1f1ec6d4d6c776eb0f81c2bebdd4cb4c817ebe/nim |title=Nim Pascal Sources |website=GitHub |access-date=2013-04-05}}</ref> In 2008, a version of the compiler written in Nim was released.<ref name="news">{{cite web |url=http://nim-lang.org:80/news.html |title=News |website=Nim-lang.org |access-date=2016-06-11 |url-status=live |archive-url=https://web.archive.org/web/20160626002904/http://nim-lang.org/news.html |archive-date=2016-06-26}}</ref> The compiler is [[free and open-source software]], and is being developed by a community of volunteers working with Andreas Rumpf.<ref name="contributors">{{cite web |url=https://github.com/Araq/Nim/contributors |title=Contributors |website=GitHub |access-date=2013-04-05}}</ref> The language was officially renamed from ''Nimrod'' to ''Nim'' with the release of version 0.10.2 in December 2014.<ref>{{cite web |url=https://nim-lang.org/blog/2014/12/29/version-0102-released.html |title=Version 0.10.2 released |date=2014-12-29 |first=Dominik |last=Picheta |website=Nim-lang.org |access-date=2018-10-17}}</ref> On September 23, 2019, version 1.0 of Nim was released, signifying the maturing of the language and its toolchain. On August 1, 2023, version 2.0 of Nim was released, signifying the completion, stabilization of, and switch to the ARC/ORC memory model.<ref name="Nim v2.0 released">{{Cite web |title=Nim v2.0 released |url=https://nim-lang.org/blog/2023/08/01/nim-v20-released.html |access-date=2023-08-17 |website=Nim Programming Language |language=en}}</ref>
Line 185 ⟶ 183:
*[[ParaSail (programming language)|ParaSail]]: pointer-free programming<ref name="parasail"/>
=== Uniform
Nim supports [[
For example, each of these lines print [["Hello, World!" program|"hello world"]], just with different syntax:
Line 484 ⟶ 482:
==== Function composition ====
[[
import std/[sequtils, sugar]
Line 551 ⟶ 549:
==== Method calls and encapsulation ====
Nim's [[
<syntaxhighlight lang="nim"> type Socket* = ref object
host: int # private, lacks export marker
Line 755 ⟶ 754:
== See also ==
{{Portal|Computer programming}}
* [[Crystal (programming language)]]
* [[D (programming language)]]
* [[Fat pointer]]
|