Page 1 of 1
Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 07:28
by shoshk
Hi,
Since starting to use FH about five years ago, I have written a number of plugins used by both myself and my husband (he's the WATFOR programmer

).
Several of these plugins are truly "mission critical" and my husband would be pretty lost if I was not able to maintain them.
I've come to the conclusion that the best solution to the problem is to teach him how to write plugins.
I would love to be able to give him a book or direct him to a website, but there really doesn't seem to be anything out there that's directed at a true beginner. So, my plan is to design a series of lessons, which will consist of private tutoring supplemented by relevant resources. Obviously, he will need to learn LUA as well as the FH API. My goal is to get him to a point where he can write and maintain plugins of moderate complexity. This could take from 6 months to a year; there's no rush.
I welcome any input and ideas people have about how to go about designing a course of study.
I'm also wondering if a course outline with references to relevant resources would be of interest to other people and worth adding to the knowledge base (I'm volunteering to take it on).
Regards,
Shosh
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 08:18
by ColeValleyGirl
I guess you've seen the Programming in Lua book? I'm not enamored of it for giving to beginners -- it begins with the assumption that they understand the very dry language/vocabulary. Many will find it adequate but you need to come at it with a particular mindset.
Plus of course it doesn't address the FH aspects of the matter.
Absolutely a course outline with resource references would be great to have in the KB.
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 09:19
by shoshk
Helen,
Yes, I've seen the programming in Lua book. The first edition is available online. Do you think it's worthwhile to invest in the 4th edition (available only as hardcopy)? I imagine that I will reference sections in the book in the
References section for a lesson.
Other references could include:
- lua-users.org wiki
- FH Plugin Help
- FHUG KB
As for building a basic outline, my daughter (works for Intel, very talented technically, and happens to live across the hall from me

) suggested that I take a look at Python tutorials (of which there are many) and use that as a base.
Of course, I will need to incorporate FH aspects are we go along. I've started thinking about how to approach this material.
As I see it, each lesson should handle a small chunk of information and could include both Lua and FH aspects.
I've requested an Editor's Account for the KB, so I can start working on the outline.
Shosh
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 09:31
by ColeValleyGirl
Shosh, your KB editor's account is set up.
I have a softcover of the 4th edition of programming Lua, and it's not that different to the first... except of course where they had to change it to cater for Lua 5.3. Not sure it's worth it...
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 09:40
by shoshk
Correction, the Programming in Lua book (4th edition) is available for purchase as an ebook (pdf and epub version) with an online version. At £22 it seems like a no-brainer. My husband likes referring to books, so it probably makes sense to have the most recent version.
Programming in Lua Fourth Edition
Shosh
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 11:28
by mjashby
This might be of some use if you don't already know about it:
https://www.tutorialspoint.com/lua/index.htm
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 13:07
by shoshk
Getting started in the KB ...
It seems to me that I'm going to have one article which will contain the outline for the course/tutorial and then an article for each lesson. There could potentially be quite a few "lesson" articles. Is that a problem?
The naming convention for articles would be:
Writing Plugins for Beginners (the course outline)
Writing Plugins for Beginners - Lesson n - <lesson title>
I don't plan on creating the entire outline at one go, it will be expanded and fleshed out as I go, mostly depending on how lessons with my husband progress. As I create the lessons, the outline will be updated to link each lesson. The process is expected to take a number of months.
Shosh
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 13:18
by ColeValleyGirl
Shosh, multiple articles are not a problem.
Best to indicate in the 'lead' article that it's a work in progress that will expand with time.
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 14:39
by Mark1834
I think this is an excellent initiative. There's useful stuff in the FH help files, in the KB, in the Lua reference guides, and in the usual online help sites, but it's disjointed, and I end up with far too many resources open at once when I'm trying to figure something out. Having it brought together in a systematic way, with links to more detailed material, would be excellent.
I've always found the
w3school.com material well set out and easy to follow. They cover Python, but not Lua.
I'm still very much at the Lua newbie hobbyist level, so don't have the expertise to contribute directly, but have dabbled in other languages over the years and written a fair amount of technical training material in my old day job, so if you need another pair of eyes to test drive or proofread material, I'm happy to help.
Re: Writing Plugins for WATFOR (and other FORTRAN) Programmers
Posted: 13 Dec 2020 16:33
by shoshk
Mark,
Thank you for your offer. I don't have a lot of experience writing training material (although I've used a lot of it over the years) and would really appreciate any help I can get.
I intend to start at an absolutely basic level, not assuming any previous programming experience. But, as the lessons progress, I'll be addressing more interesting topics.
I learned lua for the most part by reading other people's code and a lot of trial and error. As you say, the available information is scattered all about.
Hopefully, the result of this effort will be a husband who can write and maintain plugins as well as a resource that can benefit other people writing plugins.
Shosh