{"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\/pt\/blog\/news\/lua-5-4","title":{"rendered":"Lua 5.4","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Ap\u00f3s dois anos de desenvolvimento, em 29 de junho foi lan\u00e7ada discretamente uma nova vers\u00e3o da linguagem de programa\u00e7\u00e3o Lua \u2013 5.4.<\/p>\n<p>Lua \u00e9 uma linguagem de programa\u00e7\u00e3o simples e interpretada que se integra facilmente a aplicativos. Devido a essas caracter\u00edsticas, Lua \u00e9 amplamente utilizada como linguagem de extens\u00e3o ou descri\u00e7\u00e3o de configura\u00e7\u00e3o de programas (em particular, jogos de computador). A distribui\u00e7\u00e3o do Lua ocorre sob a licen\u00e7a MIT.<\/p>\n<p>A vers\u00e3o anterior (5.3.5) foi lan\u00e7ada em 10 de julho de 2018.<\/p>\n<h2>Principais mudan\u00e7as na nova vers\u00e3o<\/h2>\n<ul>\n<li>\n<p>novo coletor de lixo baseado em gera\u00e7\u00f5es (generational). Nos par\u00e2metros setpause e setstepmul da fun\u00e7\u00e3o collectgarbage, ambos est\u00e3o obsoletos, recomenda-se usar o par\u00e2metro incremental;<\/p>\n<\/li>\n<li>\n<p>nova fun\u00e7\u00e3o para emiss\u00e3o de avisos warn com possibilidade de desativar a exibi\u00e7\u00e3o deles;<\/p>\n<\/li>\n<li>\n<p>nova implementa\u00e7\u00e3o de math.random que utiliza o algoritmo xoshiro256** em vez do fornecido pelo libc e inicializa o gerador com um n\u00famero aleat\u00f3rio;<\/p>\n<\/li>\n<li>\n<p>constantes (constant variables);<\/p>\n<\/li>\n<li>\n<p>Vari\u00e1veis \"fech\u00e1veis\" (to-be-closed) s\u00e3o constantes locais, para as quais o m\u00e9todo __close \u00e9 executado ao sair do escopo;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>nova fun\u00e7\u00e3o lua_resetthread \u2014 limpa a pilha e executa o fechamento de todas as vari\u00e1veis \"fech\u00e1veis\";<\/p>\n<\/li>\n<li>\n<p>nova fun\u00e7\u00e3o coroutine.close \u2014 fecha a corrotina especificada e todas suas vari\u00e1veis \"fech\u00e1veis\";<\/p>\n<\/li>\n<li>\n<p>dados do usu\u00e1rio (userdata) agora podem conter um conjunto de valores acess\u00edveis por \u00edndice. Novas fun\u00e7\u00f5es foram introduzidas para trabalhar com eles: lua_newuserdatauv, lua_setiuservalue e lua_getiuservalue;<\/p>\n<\/li>\n<li>\n<p>informa\u00e7\u00f5es de depura\u00e7\u00e3o sobre par\u00e2metros e valores de retorno de fun\u00e7\u00f5es est\u00e3o dispon\u00edveis;<\/p>\n<\/li>\n<li>\n<p>se um \u00edndice inteiro \u00e9 usado em um loop for e ocorre um estouro \u2014 o loop \u00e9 encerrado;<\/p>\n<\/li>\n<li>\n<p>um argumento opcional foi adicionado \u00e0 fun\u00e7\u00e3o string.gmatch, que especifica um deslocamento a partir do in\u00edcio da string para a busca de correspond\u00eancias;<\/p>\n<\/li>\n<li>\n<p>As fun\u00e7\u00f5es de convers\u00e3o impl\u00edcita de strings em n\u00fameros foram transferidas para a biblioteca de strings, e seu comportamento foi alterado. Por exemplo, o resultado da opera\u00e7\u00e3o \"1\" + \"2\" agora \u00e9 um n\u00famero inteiro, em vez de um n\u00famero de ponto flutuante;<\/p>\n<\/li>\n<li>\n<p>na fun\u00e7\u00e3o de aloca\u00e7\u00e3o de mem\u00f3ria, agora \u00e9 permitido ocorrer um erro ao reduzir um bloco de mem\u00f3ria;<\/p>\n<\/li>\n<li>\n<p>Novo s\u00edmbolo de formata\u00e7\u00e3o na fun\u00e7\u00e3o string.format \u2014 %p (para ponteiros);<\/p>\n<\/li>\n<li>\n<p>a biblioteca utf8 aceita c\u00f3digos de caracteres at\u00e9 2\u00b3\u00b9 (ao especificar uma flag especial, sem isso aceita-se apenas c\u00f3digos at\u00e9 0x10FFFF e n\u00e3o s\u00e3o permitidos os c\u00f3digos de substitui\u00e7\u00e3o);<\/p>\n<\/li>\n<li>\n<p>Constantes inteiras que excedem o intervalo de valores s\u00e3o convertidas em n\u00fameros de ponto flutuante (antes ocorriam cortes de bits);<\/p>\n<\/li>\n<li>\n<p>O metam\u00e9todo __lt n\u00e3o \u00e9 mais usado para emular o metam\u00e9todo __le; se necess\u00e1rio, o metam\u00e9todo __le deve ser definido explicitamente;<\/p>\n<\/li>\n<li>\n<p>Uma etiqueta para o operador goto n\u00e3o pode ser criada se j\u00e1 existir uma etiqueta com o mesmo nome no escopo atual (mesmo que tenha sido definida em um escopo externo);<\/p>\n<\/li>\n<li>\n<p>O metam\u00e9todo __gc pode n\u00e3o ser apenas uma fun\u00e7\u00e3o. Se a tentativa de chamar o m\u00e9todo falhar, um aviso ser\u00e1 emitido;<\/p>\n<\/li>\n<li>\n<p>A fun\u00e7\u00e3o print n\u00e3o chama tostring para cada argumento, mas utiliza suas convers\u00f5es internas;<\/p>\n<\/li>\n<li>\n<p>A fun\u00e7\u00e3o io.lines retorna um conjunto de quatro valores em vez de um, para emular o comportamento antigo, coloque a chamada entre par\u00eanteses se voc\u00ea a passar como par\u00e2metro ao chamar outra fun\u00e7\u00e3o.<\/p>\n<\/li>\n<\/ul>\n<p>Fonte: <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.3 - 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\/pt\/blog\/news\/lua-5-4\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_PT\" \/>\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\/pt\/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":"Ap\u00f3s dois anos de desenvolvimento, em 29 de junho, foi lan\u00e7ada silenciosamente uma nova vers\u00e3o da linguagem de programa\u00e7\u00e3o Lua \u2014 5.4. Lua \u00e9 uma linguagem de programa\u00e7\u00e3o simples e interpretada, que se integra facilmente em aplica\u00e7\u00f5es.","canonical_url":"https:\/\/prohoster.info\/pt\/blog\/news\/lua-5-4","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pt_PT","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\/pt\/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\/pt\/wp-json\/wp\/v2\/posts\/87047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/comments?post=87047"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/87047\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media?parent=87047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/categories?post=87047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/tags?post=87047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}