On 31/07/2012 18:42,
sa...@quantum-leaps.com wrote:
> Thanks a lot for the tips so far. I should probably clarify that my
> goal is to create an easy to use toolkit for rapid prototyping of
> embedded gizmos on Windows and to release it to the public as *open
> source*.
>
I like your aim here, but I disagree a bit with your details. Of
course, it's a matter of opinion, taste, and experience - there is no
"right" way to do things. I'm just thinking about what I would do if I
were making such a tool (would that I had time!), or what features I
would like in using such a tool. So read my comments with an implied
"IMHO" at the end of each sentence :-)
> Frankly, I'm really surprised that something like this does not seem
> to exist yet. I have quite extensive experience in Qt, for example,
> but Qt, wxWidgets, or Microsoft solutions like MFC, ActiveX, or
> .NET/C# represent quite a steep learning curve and a big complication
> for embedded developers. It's like having to buy a whole pub just to
> drink a pint of beer.
>
If you want to make new development software, don't make it
windows-only. The percentage of non-windows developers is increasing,
and every new version of desktop windows is pushing it further in that
direction, as every new version of windows makes it harder for us
"non-standard" users who dare to use a computer for more than MS Office
and IE. Steadily more tool vendors are moving to cross-platform systems.
This is particularly true when you want to make your tool open source.
The huge potential benefit (to you) of making it open source is that
other people can contribute to it - "open source" is a development
model, as distinct from "free software" (where the "free as in speech"
licensing is the prime motivation) or "freeware" (where zero price is
the motivation). You want to get a community around your tool, so that
you don't have to do all the work - you build the basic frame and a
couple of widgets/components, and hopefully others can contribute new parts.
To encourage such a community, you need to reach as wide a user base as
you can, and you need to make it as easy as possible for people to
participate. You don't do that by arbitrarily cutting out Linux or Mac
users (there are surprisingly many people who do embedded development
work on Macs - at least, /I/ am surprised), especially as your average
Linux developer is much more likely to contribute than your average
windows user.
So don't make it windows-specific - aim cross-platform.
And even for the windows version, don't insist on MS tools (support them
if you want, of course). There are many reasons why people might not
want to have them, even the zero-cost versions - they are big and bulky,
intrusive on the system, won't work on old versions of windows (and
embedded developers are not renowned for updating their systems - XP is
far and away the most common platform), and keep changing. You ruled
out .NET for other reasons, but up until about a year ago MS encouraged
developers that C# and .NET was the language of the future - now with
Win8 .NET is a dead-end.
(For C tools, you might be better off actually making gcc a requirement.
Then you have a known standard platform and your toolkit can
automatically compile the user's code using it.)
> I mean, all that's really needed for good looking, realistic embedded
> front panels is a dialog-box designed with a resource editor (e.g.
> free ResEdit) and a couple of custom controls, such as dot-matrix
> display, segmented display, and owner-drawn button. I also think that
> embedded folks would appreciate direct programming in C, rather than
> having to jump the hoops of different languages (C#, VisualBasic, or
> even C++).
>
> The use of the plain Win32 API would also drastically simplify the
> tools. The free Visual C++ Express (with Platform SDK) and the free
> ResEdit should do it.
>
I fully agree with your aim - and fully disagree with how you want to
get there.
Of all the possible APIs to use, plain Win32 is the second most
masochistic (pipped at the post by plain Xlib). There are good reasons
why virtually nobody ever uses it for gui work, except at the library
implementation level. If your tool requires users to code to Win32 API,
you will not have many users.
First off, your tool should insulate users from the gui as much as
humanly possible. If they are coding in C, then need to be able to
access the simulator and gui in a way that is as close as possible to
the real hardware.
Secondly, when writing simulation-only code, or support code (such as
for a new gui widget), there is /no/ requirement that it is in C. It
might be convenient that it is /possible/ to code it in C. But users
should be able to use something a lot more powerful and flexible here.
They should be able to write code that uses maths, strings, complex data
structures, etc., without doing the error-prone detail work in C. This
tool is for prototyping and simulation - such work is best done in a
higher level language. The C coding is for the real hardware
implementation later. A good choice of language here would be Python -
it is very high level, and fairly easy to learn. An alternative would
be Lua, which is also quite high level, and has the advantage of being
easy to integrate with C systems. Use the right tool for the job -
don't treat everything as a nail just because you (and your users) have
a hammer.
Rather than making people use "resedit" or other such tools, consider
making your own screen / panel designer specifically targeted for the
job. It would not be /that/ hard - after all, you are not trying to
make a general-purpose form designer.
> I don't mean to start here any religious wars, but, frankly, the
> GNU-based tools--and especially the GDB--are horrible for Windows
> development (this includes Eclipse with CDT and GDB under the hood).
No religion here, but plenty of opinions!
The biggest growing IDE for embedded systems is Eclipse. Many, if not
most, major embedded development toolchain vendors either use Eclipse as
their IDE, or are moving towards it. For many processors, gcc is either
the only compiler, or it is at least one of the major compilers. Some
people like these tools, others do not - but those are the facts.
One option that might be worth considering is to base the whole thing on
Eclipse's GEF (Graphical Editing Framework), and make it as an Eclipse
plugin. I don't know how successful that would be, but as it would
integrate with Eclipse you might be able to persuade Freescale, TI,
etc., to sponsor your work to integrate it with their tools.
> I don't think one can actually achieve any true productivity gains
> with the flaky GDB debugger, which of course defeats the whole
> purpose of moving the development to the desktop in the first place.
And you said no religion :-)
No debugger is perfect. I haven't seen any reason to judge gdb as
flakier than other debuggers (and I've used quite a few). A great many
other people seem to manage to use it productively.
> I made this experience with Qt development. I started with the Qt
> Creator IDE, but quickly got frustrated and disappointed. I finally
> switched to Visual Studio and the difference was like night and day.
> I was at least an order of magnitude more productive.
So you don't like Qt (again, it's a tool that a great many people /do/
use and like - and again, it's a matter of taste, experience and
opinion). But it seems like a large step to right off all use of gnu
tools because of one bad experience.
>
> In the end, the devil is always in the detail. I think that to be
> really helpful, an embedded prototyping toolkit for Windows must
> include support for the most productive tools available and
> *complete* code and examples. I don't think that generic statements
> like "you can draw on an external bitmap" are helpful.
>
Well, I hope I've given a few more helpful statements here - even if
they are recommending a different direction for you.