Penguin

Differences between current version and revision by previous author of Lua.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 7 Last edited on Sunday, November 21, 2004 2:54:26 pm by AristotlePagaltzis
Older page: version 4 Last edited on Wednesday, January 7, 2004 9:27:26 pm by WillBird Revert
@@ -1,69 +1,66 @@
-Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose, stand-alone language. Lua is free software
+[ Lua | http://www.lua.org] is a lightweight ProgrammingLanguage designed for extending applications, but also frequently used as a stand-alone language. It is implemented as a small library of [ANSI] [C] functions that compiles unmodified on all known platforms. The [API] that allows an application to exchange data with [ Lua] programs and also to extend Lua with [C] functions. In this sense, [Lua] can be regarded as a language framework for building domain-specific languages. [Lua] programs are compiled to ByteCode. [Lua]'s implementation goals are simplicity, efficiency, portability, and low embedding cost. The result is a fast language engine with small footprint, making it ideal in embedded systems too. It is FreeSoftware, designed and implemented by a team at Tecgraf, the Computer Graphics Technology Group of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro in Brazil). Tecgraf is a laboratory of theDepartment of ComputerScience
  
-Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, interpreted from [ByteCode]s , and has automatic memory management with GarbageCollection, making it ideal for configuration, scripting, and rapid prototyping. 
+The language combines simple procedural syntax with powerful data description constructs based on associative arrays, is dynamically typed, and has automatic memory management with GarbageCollection, making it ideal for configuration, scripting, and rapid prototyping. A fundamental concept in the design of [Lua] is to provide meta-mechanisms for implementing features, instead of providing a host of features directly in the language. For example, although [Lua] does not contain ObjectOrientation, it does provide mechanisms for implementing classes and inheritance. This philosophy brings an economy of concepts and keeps the language small, while allowing unconventional extensions to its semantics
  
-A fundamental concept in the design of Lua is to provide meta-mechanisms for implementing features, instead of providing a host of features directly in the language. For example , although Lua is not a pure object-oriented language , it does provide meta-mechanisms for implementing classes and inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the language small, while allowing the semantics to be extended in unconventional ways . Extensible semantics is a distinguishing feature of Lua
+It is used as a scripting language for game engines by Lucas Soft , MicrosoftCorporation , etc (watch the conference at http://ll3 .ai.mit.edu/)
  
-Lua is a language engine that you can embed into your application . This means that, besides syntax and semantics, Lua has an [API ] that allows the application to exchange data with Lua programs and also to extend Lua with [C ] functions. In this sense, Lua can be regarded as a language framework for building domain-specific languages.  
+See also:  
+* [The Lua-Users wiki | http://lua-users .org/wiki ]  
+* <tt>#lua</tt> on the [FreeNode ] [IRC] network  
  
-Lua is implemented as a small library of [C] functions, written in [ANSI -C], and compiles unmodified in all known platforms. The implementation goals are simplicity, efficiency, portability, and low embedding cost. The result is a fast language engine with small footprint, making it ideal in embedded systems too.  
+----  
  
-Lua is designed and implemented by a team at Tecgraf, the Computer Graphics Technology Group of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro in Brazil). Tecgraf is a laboratory of theDepartment of Computer Science.  
-(taken from http://www.lua.org)  
+!! Sample [ Lua] program  
  
-also used as a scripting language for game engines by [lucassoft], [Microsoft], etc (watch the conference at http://ll3.ai.mit.edu/)  
+SourceCode::  
+ <verbatim>  
+ -- simple program that reads a config file in the format "a = b" and  
+ -- prints them to the output as "a is b"  
  
-like most programming languages, they have an [IRC] channel. lua's is #Lua on the [FreeNode] [IRC] network  
-  
-see http://www.lua.org and http://lua-users.org/wiki  
-  
-__example of lua:__  
- -- simple program that reads a config file in the format "a = b" and  
- -- prints them to the output as "a is b"  
-  
- function fileexists( file )  
- local f = io.open( file, "r" )  
- if f then  
- io.close( f )  
- return true  
- else  
- return false  
- end  
+ function fileexists( file )  
+ local f = io.open( file, "r" )  
+ if f then  
+ io.close( f )  
+ return true  
+ else  
+ return false 
  end 
+ end  
  
- function loadconfig( file )  
- print( "+ reading config file " .. file )  
- if fileexists( file ) then  
- local cline = 1  
- for line in io.lines( file ) do  
- if string.sub( line, , 2 ) ~= "--" and line ~= "" then  
- local _,_,var, val = string.find( line, "(%S+)%s?=%s?(.*)" ) ;  
- if var == nil or val == nil then  
- print( "! malformed line on line " .. cline .. ", ignoring" )  
- else  
- print( var .. " is ".. val )  
- end  
- end  
- cline = cline + 1  
- end  
- else  
- print( "! " .. file .. " does not exist !" )  
- print( "! exiting.." )  
- os.exit()  
+ function loadconfig( file )  
+ print( "+ reading config file " .. file )  
+ if fileexists( file ) then  
+ local cline = 1  
+ for line in io.lines( file ) do  
+ if string.sub( line, , 2 ) ~= "--" and line ~= "" then  
+ local _,_,var, val = string.find( line, "(%S+)%s?=%s?(.*)" ) ;  
+ if var == nil or val == nil then  
+ print( "! malformed line on line " .. cline .. ", ignoring" )  
+ else  
+ print( var .. " is ".. val )  
+ end 
  end 
+ cline = cline + 1  
+ end  
+ else  
+ print( "! " .. file .. " does not exist !" )  
+ print( "! exiting.." )  
+ os.exit()  
  end 
+ end  
  
- loadconfig( "blah.conf" ) 
+ loadconfig( "blah.conf" )  
+ </verbatim>  
+  
+Output::  
+ <verbatim>  
+ $ lua blah.lua  
+ + reading config file blah.conf  
+ a is b  
+ var is val  
+ ! malformed line on line 3, ignoring  
+ nick is scope  
+ </verbatim>  
  
-__output:__  
- junk@lizzy lua $ lua blah.lua  
- + reading config file blah.conf  
- a is b  
- var is val  
- ! malformed line on line 3, ignoring  
- nick is scope  
- junk@lizzy lua $  
-----  
-i'm also trying to make an [IRC] bot in lua ! it's __fun__ ;D  
 ---- 
 CategoryProgrammingLanguages