ଲୁଆ (ପ୍ରୋଗ୍ରାମିଂ ଭାଷା)
ଲୁଆ (/ˈluːə/ LOO-ə, from Portuguese: lua [ˈlu.(w)ɐ] meaning moon; explicitly not "LUA"[୧]) ଏକ lightweight ପ୍ରୋଗ୍ରାମିଂ ଭାଷା ଅଟେ । ଏହା ANSI Cରେ ଲେଖା ହୋଇଥିବାରୁ ବିଭିନ୍ନ ପ୍ରକାରର କମ୍ପ୍ୟୁଟରରେ ଚାଲିପାରେ ଏଣୁ ଏହାକୁ Cross-platform ସ୍କ୍ରିପ୍ଟ ଭାଷା କୁହାଯାଇପାରେ । [୧] ଲୁଆର ଆପ୍ଲିକେସନ ପ୍ରୋଗ୍ରାମିଂ ଇଣ୍ଟରଫେସ ବା API ସି ଅପେକ୍ଷା ସରଳ ଅଟେ ।[୨]
ପାରାଡ଼ିଜିମ୍ | Multi-paradigm: scripting, imperative (procedural, prototype-based object-oriented), functional |
---|---|
ପ୍ରଥମେ ଦେଖାଯାଇଥିଲା | 1993 |
ଡିଜାଇନ କରିଥିଲେ | Roberto Ierusalimschy Waldemar Celes Luiz Henrique de Figueiredo |
ସ୍ଥାୟୀ ରିଲିଜ | 5.2.3 (ଡିସେମ୍ବର 7, 2013 | )
ଟାଇପିଂ ପଦ୍ଧତି | dynamic, strong, duck |
ପ୍ରମୁଖ ବ୍ୟବହାର | Lua, LuaJIT, LLVM-Lua, Lua Alchemy |
ଉପଭାଷା | Metalua, Idle, GSL Shell |
ଏହାକୁ ପ୍ରଭାବିତ କରିଛନ୍ତି | C++, CLU, Modula, Scheme, SNOBOL |
ଏହା ଦ୍ଵାରା ପ୍ରଭାବିତ ହୋଇଛନ୍ତି | Io, GameMonkey, Squirrel, Falcon, MiniD |
Implementation language | C |
ଅପେରେଟିଂ ସିଷ୍ଟମ | Cross-platform |
ସତ୍ତ୍ଵ | MIT License |
ୱେବସାଇଟ | www |
ଇତିହାସ ସମ୍ପାଦନା
ଫିଚର ସମ୍ପାଦନା
କିଛି କୋଡ ଉଦାହରଣ ସମ୍ପାଦନା
ଏକ ପାରମ୍ପରିକ ହେଲୋ ୱାଲ୍ଡ ପ୍ରୋଗ୍ରାମ ନିମ୍ନୋକ୍ତ ପ୍ରକାରରେ ଲେଖା ଯାଇପାରିବ:
print('Hello World!')
ମନ୍ତବ୍ୟଗୁଡ଼ିକ ନିମ୍ନଲିଖିତ ସିଣ୍ଟାକ୍ସ ବ୍ୟବହାର କରନ୍ତି ଓ ସେସବୁ ଆଡ଼ା, ଇଫେଲ, ହାସକେଲ, SQL ଏବଂ VHDL ଆଦି ସହ ସମାନ:
-- A comment in Lua starts with a double-hyphen and runs to the end of the line.--[[ Multi-line strings & comments are adorned with double square brackets. ]]--[=[ Comments like this can have other --[[comments]] nested. ]=]
ଫାକ୍ଟୋରିଆଲ ଫଳନ ଏହି ଉଦାହରଣରେ ଥିବା ଗୋଟିଏ ଫଳନ ଭାବେ କାର୍ଯ୍ୟକାରୀ ହୋଇଛି:
function factorial(n) local x = 1 for i = 2,n do x = x * i end return xend
ଲୁପ୍ ସମ୍ପାଦନା
ଲୁଆ ଚାରି ପ୍ରକାରର ଲୁପ ବ୍ୟବହାର କରିଥାଏ: ହ୍ୱାଇଲ ଲୁପ, ରିପିଟ ଲୁପ (ଏକ ଡୁ ହ୍ୱାଇଲ ଲୁପ ସହ ସମାନ), ଫର ଲୁପ, ଏବଂ ସାଧାରଣ ଫର ଲୁପ ।
--condition = truewhile condition do --statementsendrepeat --statementsuntil conditionfor i = first,last,delta do --delta may be negative, allowing the for loop to count down or up print(i)end
ସାଧାରଣ ଫର ଲୁପ:
for key, value in pairs(_G) do print(key, value)end
ଏହା _G ସାଧାରଣ ଆଇଟିରେଟର ଫଙ୍କସନ pairs ବ୍ୟବହାର କରି ଟେବୁଲ ଉପରେ ପ୍ରକାଶ କରିବ (nil ମିଳିବା ଯାଏ) ।
ଫଙ୍କସନଗୁଡ଼ିକ ସମ୍ପାଦନା
ଟେବୁଲ ସମ୍ପାଦନା
ରେକର୍ଡ଼ ଭାବେ ସମ୍ପାଦନା
ନେମସ୍ପେସ ଭାବେ ସମ୍ପାଦନା
ଆରେ ଭାବେ ସମ୍ପାଦନା
ମେଟାଟେବୁଲ ସମ୍ପାଦନା
ଅବଜେକ୍ଟ-ଆଧାରିତ ପ୍ରୋଗ୍ରାମିଂ ସମ୍ପାଦନା
ସି ଆପ୍ଲିକେସନ ପ୍ରୋଗ୍ରାମିଂ ଇଣ୍ଟରଫେସ ସମ୍ପାଦନା
ଲୂଆ ଫଙ୍କ୍ସନ୍କୁ ସି ପ୍ରୋଗ୍ରାମିଂ ଭାଷା ବ୍ୟବହାର କରି କିପରି କଲ୍ କରିହେବ ତାହାର ଏକ ଛୋଟ ଉଦାହରଣ:
#include <stdio.h>#include <stdlib.h>#include <lua.h>#include <lauxlib.h>int main(void){ lua_State *L = luaL_newstate(); if (luaL_dostring(L, "function foo (x,y) return x+y end")) { lua_close(L); exit(EXIT_FAILURE); } lua_getglobal(L, "foo"); lua_pushinteger(L, 5); lua_pushinteger(L, 3); lua_call(L, 2, 1); printf("Result: %d\n", lua_tointeger(L, -1)); lua_close(L); return 0;}
Running this example gives:
$ gcc -o example example.c -llua$ ./exampleResult: 8
ବ୍ୟବହାର ସମ୍ପାଦନା
- ଭିଡିଓ ଗେମ ପ୍ରସ୍ତୁତକାରୀମାନଙ୍କ ପାଇଁ ଏହା ବିପୁଳ ମାତ୍ରାରେ ଆଦୃତ ସ୍କ୍ରିପ୍ଟ ଭାଷା ଅଟେ ।
ଆହୁରି ଦେଖନ୍ତୁ ସମ୍ପାଦନା
ଆଧାର ସମ୍ପାଦନା
- ↑ ୧.୦ ୧.୧ "About Lua". Lua.org. Retrieved 2013-06-19.
- ↑ Yuri Takhteyev (April 21, 2013). "From Brazil to Wiki". Foreign Affairs. Retrieved April 25, 2013.
ଆହୁରି ପଢନ୍ତୁ ସମ୍ପାଦନା
ବହି ସମ୍ପାଦନା
| ପ୍ରବନ୍ଧ ସମ୍ପାଦନା
|
ବାହାର ଲିଙ୍କ ସମ୍ପାଦନା
- Official website
- lua-users.org Archived 2010-12-16 at the Wayback Machine. – Community website for and by users (and authors) of Lua
- eLua – Embedded Lua
- Projects in Lua
- SquiLu Squirrel modified with Lua libraries