The Artima Developer Community
Sponsored Link

Weblogs Forum
Lua and HeronScript

3 replies on 1 page. Most recent reply: Oct 18, 2005 10:08 PM by Michael Feathers

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Lua and HeronScript (View in Weblogs)
Posted: Oct 18, 2005 9:36 AM
Reply to this message Reply
Summary
The Lua programming language is an extension programming language, which holds special interest to me and anyone who is implementing any kind of interpreter.
Advertisement
I have been studying Lua for the last several days, as a possible engine for the HeronScript interpreter.

HeronScript is a strict subset of the Heron language. It is intended as a way for programmers to extend their applications on the fly, for debugging, testing, user-side scripting, etc. (yes, I was inspired by Smalltalk),

Implementing HeronScript is a lot of work, but I recently realized that I could save a lot of work by using Lua as a backend. What I am considering doing is converting HeronScript into Lua and calling the Lua C Api functions to do the work of managing variable and function names for me. The only major difference between HeronScript and Lua is that HeronScript is statically typed, but I can achieve the same effect by inserting type-checking function calls into the generated Lua source.

It seems to me that anyone who wants to implement a scripting language, might want to consider this approach of converting to Lua, and using the Lua interpreter as a back-end. The only thing I need to do now is figure out whether the work needed to convert HeronScript to Lua, is signficantly less than building an interpreter from scratch.


Michael Feathers

Posts: 448
Nickname: mfeathers
Registered: Jul, 2003

Re: Lua and HeronScript Posted: Oct 18, 2005 2:54 PM
Reply to this message Reply
If you like Lua, you need to look at Io.

http://www.iolanguage.com/about/

It was inspired by Lua but it carries things in a far more OO direction. It's the most interesting language I've seen in a couple of years.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Lua and HeronScript Posted: Oct 18, 2005 3:36 PM
Reply to this message Reply
> If you like Lua, you need to look at Io.
>
> http://www.iolanguage.com/about/
>
> It was inspired by Lua but it carries things in a far more
> OO direction. It's the most interesting language I've
> seen in a couple of years.

I appreciate you sharing the link, I hadn't considered IO at all. On a preliminary examination, I can't yet tell what advantages it might have over Lua, in your opinion are there any, and what might they be?

Michael Feathers

Posts: 448
Nickname: mfeathers
Registered: Jul, 2003

Re: Lua and HeronScript Posted: Oct 18, 2005 10:08 PM
Reply to this message Reply
It's simpler. It doesn't have any keywords. Everything is an object including the local context. No statements, just expressions. The code reads well, and it does lazy evaluation of arguments which allows it simulate macro semantics with methods. It handles object inheritance in a very flexible and economical way, using something called differential prototype inheritance.

Take a look at the examples if you get a chance.

Flat View: This topic has 3 replies on 1 page
Topic: Java Threads Previous Topic   Next Topic Topic: Metaprogramming Musings

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use