On Feb 28, 2012, at 3:06 AM, Øyvind Harboe wrote:

> I actually thought  of a killer feature of switching to scripting
> programming language:
> 
> How about if we could replace 80% of the C code with a scripting
> language without sacrificing performance and make 80% of the OpenOCD
> code unit-testable?

This is actually why I made Lua bindings to all the functions in an API for a 
PCI capture card I developed for work; it made unit and regression testing much 
easier, and it also allowed us to use functions without having to write a C 
program which called them (we could call them directly from the Lua command 
line).  It was very useful.

You can even make preprocessor macros to do a lot of the bindings for you, 
though there are some valid arguments for why you should not do so.  It's a lot 
easier in C++ where you can do template metaprogramming, but I don't think 
anyone is interested in going there for OpenOCD (nor should they be).

> The idea is to get exception handling and resources tracking + some
> sane objected oriented design.
> 
> If we can use this to increase the readability, testability and
> ultimately quality of OpenOCD, then I'd be more interested.

I think you could improve OpenOCD a lot with it.  I think Python would be an 
even better choice from a completeness-of-standard-libraries approach, but the 
concerns over its footprint are very real and I think probably a dealbreaker.

- Dave




------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to