www.digitalmars.com         C & C++   DMDScript  

D - TickC and Lua Languages

reply Mark Evans <Mark_member pathlink.com> writes:
Those who like Pliant's extensibility and dynamic code generation might look at
these humbler 'extensible C' projects.  Lua should work with D out of the box,
and VCODE might be interesting to Walter.  I am not advocating anything in
particular though.
-Mark



TickC
http://www.pdos.lcs.mit.edu/
http://pag.lcs.mit.edu/reading-group/pldi-tickc.pdf
"Dynamic code generation should be efficient and portable; specifying
dynamically generated code should be flexible and simple.  We have described 'C,
a superset of ANSI C, that satisfies both of these constraints and also
preserves the semantics and spirit of ANSI C. Examples of 'C programs
demonstrate the expressiveness of the language and illustrate how dynamic code
generation can be used. The 'C prototype compiler demonstrates that 'C programs
can achieve excellent performance (the use of dynamic code generation can
improve performance by up to an order of magnitude), even with little
optimization. The reliance on static type checking reduces the cost of runtime
compilation: code generation operations such as instruction selection can be
performed at compile time. Furthermore, since types are known statically, the
compiler can optimize dynamic code as well as static code."
"By making dynamic code generation a language facility, programs that generate
dynamic code are more portable, easier to write, and easier to debug. In
addition, 'C's dynamic code generation facility is more flexible than in partial
evaluation or other automatic specialization systems. For example, 'C (with some
support for linkage) could be used by fast compilers as a portable means of
emitting efficient machine code. Finally, while the language design has taken
place in the context of ANSI C, we expect the mechanisms used to specify
dynamically generated code can also be mapped onto other statically typed
languages."



VCODE - used by TickC
http://www.sable.mcgill.ca/~dbelan2/courses/763/pres2/presentation.pdf
"An important feature of vcode is that it generates machine code in-place
without the use of intermediate data structures. Eliminating the need to
construct and consume an intermediate representation at runtime makes vcode both
efficient and extensible. vcode dynamically generates code at an approximate
cost of six to ten instructions per generated instruction."



Lua
http://www.lua.org/about.html
http://www.lua.org/ddj.html
http://lua-users.org/wiki/LuaDirectory
"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."
"Lua ... is less than 6000 lines of ANSI C.... Lua has special features that
make it a powerful high-level extensible language."
"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."
"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."



HackC by Bill Cox
http://hackc.sourceforge.net
May 06 2003
parent "Luna Kid" <lunakid neuropolis.org> writes:
This trivial "D-ized" interface for Lua 5.0 may
make it even easier to put it in service for D:

    http://www.neuropolis.org/project/lua_from_d/

Have fun,
Luna Kid


"Mark Evans" <Mark_member pathlink.com> wrote in message
news:b99pub$14dl$1 digitaldaemon.com...
 Those who like Pliant's extensibility and dynamic code generation might
look at
 these humbler 'extensible C' projects.  Lua should work with D out of the
box,
 ...
 Lua
 http://www.lua.org/about.html
 http://www.lua.org/ddj.html
 http://lua-users.org/wiki/LuaDirectory
 "Lua is a language engine that you can embed into your application. This
means
 ...
May 12 2003