{"id":87047,"date":"2020-07-02T19:42:06","date_gmt":"2020-07-02T17:42:06","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/lua-5-4"},"modified":"2020-07-02T19:42:06","modified_gmt":"2020-07-02T17:42:06","slug":"lua-5-4","status":"publish","type":"post","link":"https:\/\/prohoster.info\/ro\/blog\/news\/lua-5-4","title":{"rendered":"Lua 5.4","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Dup\u0103 doi ani de dezvoltare, pe 29 iunie a fost lansat\u0103 \u00een lini\u0219te noua versiune a limbajului de programare Lua \u2014 5.4.<\/p>\n<p>Lua \u2013 este un limbaj de programare interpretat, simplu, care poate fi integrat u\u0219or \u00een aplica\u021bii. Datorit\u0103 acestor calit\u0103\u021bi, Lua este folosit pe scar\u0103 larg\u0103 ca limbaj de extensie sau descriere a configura\u021biei programelor (\u00een special, a jocurilor de noroc). Lua este distribuit sub licen\u021ba MIT.<\/p>\n<p>Versiunea anterioar\u0103 (5.3.5) a fost lansat\u0103 pe 10 iulie 2018.<\/p>\n<h2>Principalele modific\u0103ri \u00een noua versiune<\/h2>\n<ul>\n<li>\n<p>un nou colector de de\u0219euri bazat pe genera\u021bii (generational). \u00cen func\u021bia collectgarbage, parametrii setpause \u0219i setstepmul sunt declara\u021bi \u00eenvechi\u021bi; \u00een schimb, se recomand\u0103 utilizarea parametrului incremental;<\/p>\n<\/li>\n<li>\n<p>o nou\u0103 func\u021bie pentru emiterea de avertismente warn cu posibilitatea de a dezactiva afi\u0219area acestora;<\/p>\n<\/li>\n<li>\n<p>o nou\u0103 implementare a math.random folose\u0219te algoritmul xoshiro256** \u00een locul celui oferit de libc \u0219i ini\u021biaz\u0103 generatorul cu un num\u0103r aleator;<\/p>\n<\/li>\n<li>\n<p>variabile constante (constant variables);<\/p>\n<\/li>\n<li>\n<p>variabilele \u201e\u00eenchise\u201d (to-be-closed) \u2013 constante locale, pentru care se execut\u0103 metoda __close la ie\u0219irea din domeniul de vizibilitate;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>o nou\u0103 func\u021bie lua_resetthread \u2014 cur\u0103\u021b\u0103 stiva \u0219i \u00eenchide toate variabilele \"de \u00eenchidere\";<\/p>\n<\/li>\n<li>\n<p>o nou\u0103 func\u021bie coroutine.close \u2014 \u00eenchide coroutinea specificat\u0103 \u0219i toate variabilele sale \"de \u00eenchidere\";<\/p>\n<\/li>\n<li>\n<p>datele utilizatorului (userdata) pot con\u021bine un set de valori cu acces pe baza unui index. Pentru a lucra cu acestea, au fost introduse func\u021bii noi: lua_newuserdatauv, lua_setiuservalue \u0219i lua_getiuservalue;<\/p>\n<\/li>\n<li>\n<p>informa\u021bii de depanare despre parametrii \u0219i valorile returnate ale func\u021biilor sunt disponibile;<\/p>\n<\/li>\n<li>\n<p>dac\u0103 se folose\u0219te un index \u00eentreg \u00een bucla for \u0219i se produce o dep\u0103\u0219ire \u2014 bucla se termin\u0103;<\/p>\n<\/li>\n<li>\n<p>func\u021bia string.gmatch a primit un argument op\u021bional care specific\u0103 deslocarea de la \u00eenceputul \u0219irului pentru c\u0103utarea meciurilor;<\/p>\n<\/li>\n<li>\n<p>func\u021biile de conversie implicit\u0103 a \u0219irurilor \u00een numere au fost mutate \u00een biblioteca de \u0219iruri, iar comportamentul lor s-a schimbat. De exemplu, rezultatul opera\u021biei \"1\" + \"2\" este acum un \u00eentreg, \u0219i nu un num\u0103r cu virgul\u0103 mobil\u0103;<\/p>\n<\/li>\n<li>\n<p>\u00een func\u021bia de alocare a memoriei pot ap\u0103rea erori la mic\u0219orarea blocului de memorie;<\/p>\n<\/li>\n<li>\n<p>simbolul nou de formatare \u00een func\u021bia string.format \u2013 %p (pentru pointere);<\/p>\n<\/li>\n<li>\n<p>biblioteca utf8 accept\u0103 coduri de caractere p\u00e2n\u0103 la 2\u00b3\u00b9 (c\u00e2nd este specificat\u0103 o flag special\u0103, f\u0103r\u0103 ea sunt acceptate doar coduri p\u00e2n\u0103 la 0x10FFFF \u0219i nu sunt permise surrogates);<\/p>\n<\/li>\n<li>\n<p>Constan\u021bele \u00eentregi care dep\u0103\u0219esc limitele valorilor sunt convertite \u00een numere cu virgul\u0103 mobil\u0103 (anterior se realiza trunchierea pe bi\u021bi);<\/p>\n<\/li>\n<li>\n<p>Metametoda __lt nu mai este folosit\u0103 pentru a emula metametoda __le; dac\u0103 este necesar, metametoda __le trebuie specificat\u0103 explicit;<\/p>\n<\/li>\n<li>\n<p>O etichet\u0103 pentru operatorul goto nu poate fi creat\u0103 dac\u0103 exist\u0103 deja o etichet\u0103 cu acela\u0219i nume \u00een domeniul de vizibilitate curent (chiar dac\u0103 a fost definit\u0103 \u00eentr-un domeniu extern);<\/p>\n<\/li>\n<li>\n<p>Metametoda __gc poate fi nu doar o func\u021bie. Dac\u0103 apelul metodei e\u0219ueaz\u0103, va fi emis un avertisment;<\/p>\n<\/li>\n<li>\n<p>Func\u021bia print nu apeleaz\u0103 tostring pentru fiecare argument, ci folose\u0219te conversiile sale interne;<\/p>\n<\/li>\n<li>\n<p>Func\u021bia io.lines returneaz\u0103 un set de patru valori \u00een loc de una; pentru a emula comportamentul vechi, \u00eencapsula\u021bi apelul \u00een paranteze c\u00e2nd \u00eel folosi\u021bi ca parametru \u00eentr-o alt\u0103 func\u021bie.<\/p>\n<\/li>\n<\/ul>\n<p>Sursa: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"http:\/\/www.linux.org.ru\/news\/development\/15788994\">linux.org.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u043b\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, 29 \u0438\u044e\u043d\u044f \u0442\u0438\u0445\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u044b\u0448\u043b\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Lua \u2014 5.4. Lua &ndash; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430\u043c, Lua \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u0438\u0433\u0440). \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u0441\u044f Lua \u043f\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 MIT. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (5.3.5) \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u0430 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-87047","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u043b\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, 29 \u0438\u044e\u043d\u044f \u0442\u0438\u0445\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u044b\u0448\u043b\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Lua \u2014 5.4. Lua \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/ro\/blog\/news\/lua-5-4\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"ro_RO\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Lua 5.4 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u043b\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, 29 \u0438\u044e\u043d\u044f \u0442\u0438\u0445\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u044b\u0448\u043b\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Lua \u2014 5.4. Lua \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/ro\/blog\/news\/lua-5-4\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-07-02T17:42:06+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-02T17:42:06+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Lua 5.4 | ProHoster","description":"Dup\u0103 doi ani de dezvoltare, pe 29 iunie a fost lansat\u0103 discret o nou\u0103 versiune a limbajului de programare Lua \u2014 5.4. Lua este un limbaj de programare interpretat simplu, care se integreaz\u0103 u\u0219or \u00een aplica\u021bii.","canonical_url":"https:\/\/prohoster.info\/ro\/blog\/news\/lua-5-4","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"ro_RO","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Lua 5.4 | ProHoster","og:description":"\u041f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u043b\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, 29 \u0438\u044e\u043d\u044f \u0442\u0438\u0445\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u044b\u0448\u043b\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Lua \u2014 5.4. Lua \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.","og:url":"https:\/\/prohoster.info\/ro\/blog\/news\/lua-5-4","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-07-02T17:42:06+00:00","article:modified_time":"2020-07-02T17:42:06+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"87047","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 13:59:56","updated":"2022-10-03 15:54:16","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/87047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/comments?post=87047"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/87047\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/media?parent=87047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/categories?post=87047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/tags?post=87047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}