Go to Post Inventing rocks. I think we've all learned that through FIRST. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Spotlight this post!  
Unread 07-10-2012, 21:30
zombiezen's Avatar
zombiezen zombiezen is offline
Registered User
AKA: Ross Light
FRC #0973 (Greyhound Robotics)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Atascadero
Posts: 12
zombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the rough
Re: Team 973 Code Now Public

Quote:
Originally Posted by Mk.32 View Post
I am a bit confused, how did you guys run Lua on our robots?
Greyhound Lua. It has been discussed before.

The gist is that the Lua interpreter is off-the-shelf code written in clean ANSI C. It compiles with minimal modification under WindRiver, and with some SWIG bindings to grant access to WPILib. It is released under an open source license and is free for other teams to use.

Quote:
Originally Posted by F22Rapture View Post
The choice of Lua is interesting -- what advantages and disadvantages does it afford you over Java/C++/Python?
All of what Adam said plus:

The edit/compile/run cycle is dramatically reduced, as BigJ pointed out, but even more than that, the barrier to experimentation is much lower. Students can try out snippets of code in an interactive interpreter and develop on practically any OS, since the Greyhound Lua interpreter only needs to be compiled once. We don't need to develop in WindRiver, so we have students that are using Ubuntu, Mac, Windows, vim, gedit, and Notepad++.

From a teaching perspective, the language of Lua also lends itself to procedural programming, which is easier to demonstrate and reason about for new students. Gone are the discussions of memory management, inheritance, and NULL pointer crashes. Lua instead builds from combining simple concepts. For instance, we can re-bind controls using closures inside a table.

I've been asked by people inside and outside FRC whether the use of Lua in FRC is a good idea. Their concerns vary from runtime performance to software engineering best practices (usually phrased as "Lua isn't a real language"). If I (as a mentor) were the only one writing the code, you can bet I would be using C++ because the syntax doesn't bother me and the static typing and performance help me during development. But it isn't about me; it's about the students. I've made sure to explain to the new students what the tradeoffs are and why the decision was made. Should all teams be using Lua? No, but it meets our needs, and ultimately, the choice of programming language in a software project does not matter. The real question is: "is your team productive?" And after the last two seasons, I think the results speak for themselves.

On a sidenote, the Python port didn't come until after I finished Greyhound Lua, and IIRC it uses the SWIG bindings I wrote. I initially tried porting Python, but found that the effort required exceeded the amount of time I had before the 2011 season started.

tl;dr: Lua fits our needs.
__________________
Cheers,
Ross Light

http://www.zombiezen.com/
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi