Content deleted Content added
Dreams come true :V Tag: references removed |
m Reverted 9 edits by 190.80.244.132 (talk) to last revision by Trustable (TW) |
||
Line 1:
{{Infobox programming language
| name = Nim
| logo = [[Image:Nim-logo.png|The logo for Nim|
| logo size =
| caption =
| paradigm = [[Multi-paradigm programming language|multi-paradigm]]: [[Compiled language|compiled]], [[Concurrent programming|concurrent]], [[procedural programming|procedural]], [[Imperative programming|imperative]], [[Object-oriented programming|object-oriented]]
Line 10:
| latest release version = <!-- 1.0.0 -->
| latest release date = <!-- {{Start date and age|201?|mm|dd}} -->
| latest preview version = 0.19.4<ref>{{Cite web |url=https://nim-lang.org/blog/2019/02/01/version-0194-released.html|title=Version 0.19.4 released |date=
| latest preview date = {{Start date and age|
| typing = [[static typing|static]],<ref name="nimbyex">{{cite web |url=https://nim-by-example.github.io/ |title=Nim by example |website=[[GitHub]] |access-date=2014-07-20}}</ref> [[strong typing|strong]],<ref name="nimrodbg">{{cite conference |url=https://ibob.github.io/slides/nimrodbg/#/ |language=Bulgarian |title=Метапрограмиране с Nimrod |last1=Караджов |first1=Захари |last2=Станимиров |first2=Борислав |year=2014 |conference=VarnaConf |conference-url=http://varnaconf.com/ |access-date=2014-07-27}}</ref> [[type inference|inferred]], [[structural type system|structural]]
| dialects =
| influenced by = [[Ada (programming language)|Ada
| platform = [[
| operating system = [[Cross-platform]]<ref>{{Cite web |url=https://nim-lang.org/install.html |title=Install Nim |access-date=2018-10-12}}</ref>
| license = [[MIT License|MIT]]<ref name="FAQ">{{cite web |url=https://nim-lang.org/faq.html |title=FAQ |website=Nim-lang.org |access-date=2015-03-27}}</ref><ref name='license1'>{{cite web |url=https://github.com/nim-lang/Nim/blob/master/copying.txt |title=copying.txt |website=GitHub |access-date=2015-03-27}}</ref>
| website = {{URL|https://nim-lang.
| file_ext = .nim
}}
'''Nim''' (formerly named '''Nimrod''')
== Description ==
Nim is statically typed.<ref name="Nim Syntax">{{cite web |url=https://akehrer.github.io/posts/getting-started-with-nim |title=Nim Syntax |last=Kehrer |first=Aaron (akehrer) |website=GitHub |access-date=2015-01-05}}</ref> It supports compile-time [[metaprogramming]] features such as syntactic macros and [[Macro (computer science)#Syntactic macros|term rewriting macros]].<ref name="manual">{{cite web |url=https://nim-lang.org/docs/manual.html#term-rewriting-macros |title=Nim Manual |website=Nim-lang.org |access-date=2014-07-20}}</ref> Term rewriting macros enable library implementations of common data structures such as bignums and matrices to be implemented with an efficiency as if they were builtin language facilities.<ref name="strangeloop">{{cite web |url=https://thestrangeloop.com/sessions/nimrod-a-new-approach-to-meta-programming |archive-url=https://web.archive.org/web/20140713011227/https://thestrangeloop.com/sessions/nimrod-a-new-approach-to-meta-programming |dead-url=yes |archive-date=2014-07-13 |title=Strangeloop Nim presentation |access-date=2015-04-30}}</ref> Iterators are supported and can be used as first class entities<ref name="manual"/> in the language as can functions, these features allow for [[functional programming]] to be used. Object-oriented programming is supported by [[Inheritance (object-oriented programming)|inheritance]] and [[multiple dispatch]]. Functions can be generic and can also be overloaded, [[Generic programming|generics]] are further enhanced by the support for type classes. [[Operator overloading]] is also supported.<ref name="manual"/> Nim includes tunable automatic [[Garbage collection (computer science)|garbage collection]] based on deferred [[reference counting]] with [[Reference counting#Dealing with reference cycles|cycle detection]].<ref name="gc">{{cite web |url=https://nim-lang.org/docs/gc.html |title=Nim's Garbage Collector |website=Nim-lang.org |access-date=2018-01-10}}</ref> In 2014, Andrew Binstock (editor-in-chief of [[Dr. Dobb's Journal]]) said "Nimrod [former name] ... presents a most original design that straddles [[Pascal (programming language)|Pascal]] and [[Python (programming language)|Python]] and compiles to C code or JavaScript."<ref>{{cite web |url=http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192 |title=The Rise And Fall of Languages in 2013 |last=Binstock |first=Andrew |date=2014-01-07 |website=[[Dr. Dobb's Journal]] |access-date=2018-10-08}}</ref> Today, Nim compiles to C++ too.
== History ==
{{Expand section|date=February 2018}}
Nim's initial development began in 2005 by Andreas Rumpf. 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 |archive-url=https://web.archive.org/web/20160626002904/http://nim-lang.org/news.html# |archive-date=2016-06-26 |dead-url=no |df= }}</ref> The compiler is [[free and open-source software]] and is being developed by a group 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>
== Language design ==
{{Expand section|date=February 2018}}
The syntax of Nim is similar to [[Python (programming language)|Python]].<ref name="Yegulalp">{{cite web |url=https://www.infoworld.com/article/3157745/application-development/nim-language-draws-from-best-of-python-rust-go-and-lisp.html |title=Nim language draws from best of Python, Rust, Go, and Lisp |first=Serdar |last=Yegulalp |date=2017-01-16 |website=InfoWorld}}</ref>
In details, it is influenced by:
*[[Modula-3]]: [[Modula-3#Dynamic Programming|traced vs untraced]] pointers
*[[Object Pascal]]: type safe bit sets (set of char), case statement syntax, various type names and filenames in the standard library
*[[Ada (programming language)|Ada]]: subrange types, distinct type, safe variants / case objects
*[[C++]]: Overloading, generic programming
*Python: [[Off-side rule]]
*[[Lisp (programming language)|Lisp]]: Macro system, embrace the AST, [[homoiconicity]]
*[[Oberon (programming language)|Oberon]]: The export marker
*[[C Sharp (programming language)|C#]]: Async / [[await]], lambda macros
*[[Go (programming language)|Go]]: Defer
Also, Nim supports a [[Uniform Function Call Syntax]] (UFCS)<ref>{{Cite web |url=http://nim-lang.org/docs/manual.html#procedures-method-call-syntax |title=Nim Manual: Method call syntax |access-date=2018-10-12}}</ref> and identifier equality.<ref>{{Cite web |url=http://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |title=Nim Manual: Identifier equality |access-date=2018-10-12}}</ref>
== Compiler ==
Line 76 ⟶ 94:
<syntaxhighlight lang="nim">
echo("Hello, world!")
# Procedure can be called with no parentheses
echo "Hello, World!"
</syntaxhighlight>
Line 139 ⟶ 151:
In this code the well known <code>printf</code> function is imported into Nim and then used.
== Community ==
{{Expand section|date=February 2018}}
The project has a bug tracker with wiki hosted by [[GitHub]] and a forum.<ref>{{cite web |url=https://github.com/Araq/Nim |title=Primary source code repository and bug tracker |website=GitHub |access-date=2015-05-04}}</ref><ref>{{cite web |url=http://forum.nim-lang.org |title=Nim Forum |publisher=nim-lang.org |access-date=2015-05-04}}</ref> A presentation at [[O'Reilly Open Source Convention]] (OSCON) in 2015 took place.<ref>{{cite web |url=http://www.oscon.com/open-source-2015/public/schedule/detail/42497 |title=Nim at OSCON 2015 |date=2015-07-20 |website=[[O'Reilly Open Source Convention]] (OSCON) |publisher=O'Reilly Media |access-date=2018-10-17}}</ref> O'Reilly Community: Essential Languages: Nim, [[Scala (programming language)|Scala]], Python.<ref>{{cite web |title=Essential Languages: Nim, Scala, Python |url=http://www.oreilly.com/pub/e/3420 |last1=Rumpf |first1=Andreas |last2=Swartz |first2=Jason |last3=Harrison |first3=Matt |website=O’Reilly |publisher=O'Reilly Media |access-date=2018-10-17}}</ref><ref>{{cite AV media |last=Rumpf |first=Andreas |date=2015-10-26 |title=OSCON 2015 – Andreas Rumpf – Nim: An Overview |medium=Video |language=English |url=https://www.youtube.com/watch?v=4rJEBs_Nnaw |access-date=2018-10-12 |format= |___location= |website=YouTube |id= |ref= }}</ref>
== See also ==
Line 152 ⟶ 168:
== External links ==
* {{
* {{GitHub|nim-lang/Nim}}
* [http://stackoverflow.com/tags/
[[Category:Concurrent programming languages]]
[[Category:Functional languages]]
[[Category:Multi-paradigm programming languages]]
[[Category:Procedural programming languages]]
[[Category:Programming languages created in 2008]]
[[Category:Software using the MIT license]]
[[Category:Statically typed programming languages]]
[[Category:Systems programming languages]]
[[Category:2008 software]]
[[Category:Programming languages]]
[[Category:Cross-platform software]]
[[Category:Free compilers and interpreters]]
|