സുരക്ഷയെ കേന്ദ്രീകരിച്ചുള്ള ഒരു മൾട്ടി-പാരഡിഗം സിസ്റ്റം പ്രോഗ്രാമിംഗ് ഭാഷയാണ്റസ്റ്റ്[6], പ്രത്യേകിച്ച് സുരക്ഷിതമായ കൺകറൻസി[7][8]. റസ്റ്റ് സി++ന് സമാനമാണ്, പക്ഷേ ഉയർന്ന പ്രകടനം നിലനിർത്തിക്കൊണ്ട് മികച്ച മെമ്മറി സുരക്ഷ നൽകുന്നതിനാണ് ഇത് രൂപകൽപ്പന ചെയ്തിരിക്കുന്നത്[9].
മോസില്ലയുടെ റസ്റ്റ് ടീമിൽ നിന്നുള്ള എമിലി ഡൻഹാം എഴുതിയ റസ്റ്റിനെക്കുറിച്ചുള്ള അവതരണം നടത്തുന്നു (linux.conf.au സമ്മേളനം, ഹോബാർട്ട്, 2017).
വളരെ ഒരേസമയത്തും വളരെ സുരക്ഷിതവുമായ സിസ്റ്റങ്ങൾക്കായുള്ള ഒരു ഭാഷയാണ് റസ്റ്റ് ഉദ്ദേശിക്കുന്നത്, [17] വലിയ പ്രോഗ്രാമിംഗ്, അതായത് വലിയ സിസ്റ്റം സമഗ്രത കാത്തുസൂക്ഷിക്കുന്ന അതിരുകൾ സൃഷ്ടിക്കുകയും പരിപാലിക്കുകയും ചെയ്യുക. [18] സുരക്ഷ, മെമ്മറി ലേഔട്ടിന്റെ നിയന്ത്രണം, കൺകറൻസി എന്നിവയ്ക്ക് പ്രാധാന്യം നൽകുന്ന ഒരു സവിശേഷത സെറ്റിലേക്ക് ഇത് നയിച്ചു.
ഇഡ്യൂമാറ്റിക് റസ്റ്റിന്റെ പ്രകടനം
ഇഡ്യൂമാറ്റിക് റസ്റ്റിന്റെ പ്രകടനം ഇഡ്യൂമാറ്റിക് സി++ ന്റെ പ്രകടനവുമായി താരതമ്യപ്പെടുത്താവുന്നതാണ്.[19][20]
വാക്യഘടന
റസ്റ്റിന്റെ കോൺക്രീറ്റ് വാക്യഘടന സി, സി++ എന്നിവയ്ക്ക് സമാനമാണ്, ചുരുള ബ്രാക്കറ്റുകളാൽ വേർതിരിച്ച കോഡ് ബ്ലോക്കുകളും, കൂടാതെ, വേണമെങ്കിൽ, if, else, while,forഎന്നിങ്ങനെയുള്ള നിയന്ത്രണ ഫ്ലോ കീവേഡുകളും നിയന്ത്രിക്കുക. .എല്ലാ സി അല്ലെങ്കിൽ സി++ കീവേഡുകളും നടപ്പിലാക്കുന്നില്ല, എന്നിരുന്നാലും ചില റസ്റ്റ് ഫംഗ്ഷനുകൾ (പാറ്റേൺ പൊരുത്തപ്പെടുത്തലിനായി കീവേഡ് പൊരുത്തത്തിന്റെ ഉപയോഗം പോലുള്ളവ) ഈ ഭാഷകളിൽ വൈദഗ്ദ്ധ്യമുള്ളവർക്ക് പരിചിതമല്ല. സി, സി++ എന്നിവയുമായി ഉപരിപ്ലവമായ സാമ്യം ഉണ്ടെങ്കിലും, ആഴമേറിയ അർത്ഥത്തിൽ റസ്റ്റിന്റെ വാക്യഘടന എംഎൽ കുടുംബ ഭാഷകളുമായും ഹാസ്കൽ ഭാഷയുമായും അടുത്തുനിൽക്കുന്നു. ഒരു ഫംഗ്ഷൻ ബോഡിയുടെ മിക്കവാറും എല്ലാ ഭാഗങ്ങളും ഒരു പദപ്രയോഗമാണ്, [21] ഫ്ലോ ഓപ്പറേറ്റർമാരെ പോലും നിയന്ത്രിക്കുക. ഉദാഹരണത്തിന്, സാധാരണ if പദപ്രയോഗം സിയുടെ ടെറിനറി കണ്ടീഷൻ എടുക്കുന്നു. ഒരു ഫംഗ്ഷൻ ഒരു റിട്ടേൺ എക്സ്പ്രഷനിൽ അവസാനിക്കേണ്ടതില്ല: ഈ സാഹചര്യത്തിൽ അർദ്ധവിരാമം ഒഴിവാക്കിയിട്ടുണ്ടെങ്കിൽ, ഫംഗ്ഷനിലെ അവസാന എക്സ്പ്രഷൻ റിട്ടേൺ മൂല്യം സൃഷ്ടിക്കുന്നു.
മെമ്മറി സുരക്ഷ
റസ്റ്റ് മെമ്മറി സുരക്ഷിതമായി രൂപകൽപ്പന ചെയ്തിരിക്കുന്നു, മാത്രമല്ല ഇത് സുരക്ഷിത കോഡിലെ അസാധുവായ പോയിന്ററുകൾ, ഡാങ്ളിംഗ് പോയിന്ററുകൾ അല്ലെങ്കിൽ ഡാറ്റ റേസുകൾ എന്നിവ അനുവദിക്കുന്നില്ല.[22][23][24]ഒരു നിശ്ചിത ഫോം വഴി മാത്രമേ ഡാറ്റ മൂല്യങ്ങൾ സമാരംഭിക്കാൻ കഴിയൂ, ഇവയ്ക്കെല്ലാം അവയുടെ ഇൻപുട്ടുകൾ ഇതിനകം സമാരംഭിക്കേണ്ടതുണ്ട്.[25]ലിങ്കുചെയ്ത ലിസ്റ്റ് അല്ലെങ്കിൽ ബൈനറി ട്രീ ഡാറ്റാ സ്ട്രക്ചറുകൾ പോലുള്ള സാധുവായതാണോ അല്ലെങ്കിൽ NULL എന്ന് മറ്റ് ഭാഷകളിലെ ഫംഗ്ഷൻ ആവർത്തിക്കുന്നതിന്, റസ്റ്റ് കോർ ലൈബ്രറി ഒരു ഓപ്ഷൻ ടൈപ്പ് നൽകുന്നു, ഒരു പോയിന്ററിന് Someമൂല്യമുണ്ടോ അല്ലെങ്കിൽNone ആണോ എന്ന് പരിശോധിക്കാൻ ഇത് ഉപയോഗിക്കാം. ലൈഫ്ടൈം നിയന്ത്രിക്കുന്നതിനായി റസ്റ്റ് കൂട്ടിച്ചേർത്ത വാക്യഘടനയും അതിന്റെ ബോറോ പരിശോധനയിലൂടെ കംപൈലർ റീസൺസ് അവതരിപ്പിക്കുന്നു. ഈ നിയന്ത്രണങ്ങളിൽ ചിലത് സബ്വെർട്ട് സുരക്ഷിതമല്ലാത്ത കോഡ് ഭാഷയിൽ ഉള്ളunsafe കീവേഡ് ഉപയോഗിച്ച് എഴുതാം
മെമ്മറി മാനേജുമെന്റ്
റസ്റ്റ് ഒരു ഓട്ടോമേറ്റഡ് ഗാർബേജ് ശേഖരണ സംവിധാനം ഉപയോഗിക്കുന്നില്ല. പകരം, മെമ്മറിയും മറ്റ് റിസോഴ്സുകളും മാനേജുചെയ്യുന്നത് റിസോഴ്സ് അക്വിസിഷൻ ഓപ്ഷണൽ റഫറൻസ് കൗണ്ടിംഗ് വഴിയുള്ള ഓർഗനൈസേഷൻ (RAII) കൺവെൻഷനാണ്.
അവലംബം
↑"Command Optimizations?". 2014-06-26. Retrieved 2014-12-10. I just added the outline of a Result library that lets you use richer error messages. It's like Either except the names are more helpful. The names are inspired by Rust's Result library.
↑Avram, Abel (2012-08-03). "Interview on Rust, a Systems Programming Language Developed by Mozilla". InfoQ. Retrieved 2013-08-17. GH: A lot of obvious good ideas, known and loved in other languages, haven't made it into widely used systems languages ... There were a lot of good competitors in the late 1970s and early 1980s in that space, and I wanted to revive some of their ideas and give them another go, on the theory that circumstances have changed: the internet is highly concurrent and highly security-conscious, so the design-tradeoffs that always favor C and C++ (for example) have been shifting.
↑Walton, Patrick (2010-12-05). "C++ Design Goals in the Context of Rust". Retrieved 2011-01-21. It's impossible to be 'as fast as C' in all cases while remaining safe ... C++ allows all sorts of low-level tricks, mostly involving circumventing the type system, that offer practically unlimited avenues for optimization. In practice, though, C++ programmers restrict themselves to a few tools for the vast majority of the code they write, including stack-allocated variables owned by one function and passed by alias, uniquely owned objects (often used with auto_ptr or the C++0x unique_ptr), and reference counting via shared_ptr or COM. One of the goals of Rust's type system is to support these patterns exactly as C++ does, but to enforce their safe usage. In this way, the goal is to be competitive with the vast majority of idiomatic C++ in performance, while remaining memory-safe ...
↑"How Fast Is Rust?". The Rust Programming Language FAQ. Retrieved 11 April 2019.
↑Rosenblatt, Seth (2013-04-03). "Samsung joins Mozilla's quest for Rust". Archived from the original on 2013-04-04. Retrieved 2013-04-05. [Brendan Eich] noted that every year browsers fall victim to hacking in the annual Pwn2Own contest at the CanSecWest conference. "There's no free memory reads" in Rust, he said, but there are in C++. Those problems "lead to a lot of browser vulnerabilities" and would be solved by Rust, which is a self-compiling language.
↑Brown, Neil (2013-04-17). "A taste of Rust". Retrieved 2013-04-25. ... Other more complex data structures could clearly be implemented to allow greater levels of sharing, while making sure the interface is composed only of owned and managed references, and thus is safe from unplanned concurrent access and from dangling pointer errors.