Content deleted Content added
m Reverted edits by 190.167.253.131 (talk) (HG) (3.4.6) |
fuck off Shellwood or i will lick your pussy |
||
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]], [[Rust (programming language)|Rust]], [[Modula-3]], [[Lisp (programming language)|Lisp]], [[C++]], [[Object Pascal]], [[Python (programming language)|Python]], [[Oberon (programming language)|Oberon]]
| platform = [[
| operating system = [[AmigaOS]]
| 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.
== Language design ==
{{Expand section|date=February 2018}}
I had a dream and became true...
== Compiler ==
Line 94 ⟶ 76:
<syntaxhighlight lang="nim">
@import (stdio)
fun main:
stdio::writeLn('Hello, world!')
# Procedure can be called with no parentheses
@import (stdio)
fun main:
stdio::writeLn 'Hello, world!'
</syntaxhighlight>
Line 151 ⟶ 139:
In this code the well known <code>printf</code> function is imported into Nim and then used.
== See also ==
Line 168 ⟶ 152:
== External links ==
* {{
▲* [http://stackoverflow.com/tags/nim/info Information about Nim] on [[Stack Overflow]]
|