-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua 5.1 / 5.3 alignment and document #3193
Conversation
I'm afraid I have time only for a cursory inspection at the moment, but I've pulled my I am occasionally seeing #3096, I think, as well as the occasional invalid instruction panic that I haven't yet debugged, but neither of these are regressions that should hold up this PR. |
I've got at least one more commit to add:
We are really blocked on this until I get some of this feedback / input. |
I had hoped to get some feedback on the new documentation that I've added, but alas not to be. This PR is still blocked pending other committer input as per my previous comment. I can't update the |
I had planned to make some time for that (late) tonight. |
Thanks Marcel. Much appreciated. Unlike the rest of you guys, I am now a gentleman of leisure / independent means, so I don't have to worry about the day job. 😄 |
@jmattsson, thanks for this. Even if you only have limited time available and can only give general feedback, I still value your perspective and depth of experience. It terms of the overall structure of the code, you will see that all of the eLua botches are gone and we now have a proper layering of node and other libraries over |
Thanks for the complement. Much appreciated.
To understand the reason you need to have a scan through the companion document the Lua 5.3 Reference Manual and start with its contents. This is a very dense but formal specification: the basic concepts and language is covered in §1-3; the standard Lua libraries are in §6; and §4-5 cover the C API that is used to code C library modules. This NLR is really a supplement specifying how our NodeMCU implementation differs from the standard Lua language and implementation as described in the LRM. You will see that I follow the same order, prose style and layout, but only discuss the differences. The reason for the seeming focus on the C API is that there very few differences for §1,2,3,6 as the Lua language and standard libraries are almost unchanged in NodeMCU. The bit that we have added is really the support for ROTables and the ability to move constant data structures from RAM in code space in ROM, and the extra API calls defined in So essentially the LRM + NLR + PiL + its supplement (I haven't got a neat name for this) + the ReadTheDocs library documentation now for the first time form a complete specification of NodeMCU Lua, its libraries and how to implement new ones. I am not wedded to NLR. If any of you guys can come up with a more appropriate name and acronym then we can do the swap. As to Lua Developer FAQ, the Extension Developer FAQ, and the _LFS Whitepaper, these are getting a little dated and it's probably time for new editions removing content that overlaps with these new and more formal references. However, I would rather do this editing cycle as a separate PR. This PR is already big enough IMO. |
To be honest documenting the NodeMCU delta acted as a trigger to tidy up the API a little more, because as I documented some of the calls I realised that they hadn't been done in the "Lua implementation style", and by reworking the API to conform to this style, I actually improved the implementation. A good example of this is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More small bits as PM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, absolutely fabulous. Loving all the documentation!
Only other comment is that Travis looks unhappy about Windows builds, and all I can say about that is that I too would be unhappy if I had to build on Windows 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some very minor nits. This is delightful. 🎉 🥇
Not sure, but maybe someone should note about esp32-s2. It will be ideal replacement for esp8266 (in my opinion), but at the moment it’s not supported and possibly will not be till 4.x LTS will roll out. |
First of all, my thanks to everyone for a super job in doing this review. I suspect that 90% of the comments will result in an "OK will do". In this case instead of explicitly posting this and generating a storm of these email notifications, I will just mark the comment as resolved. In such cases, please take the "thanks, will do" implicitly. I had emailed an ODT version of the docs to some viewers. (Gregor replied with a marked version so his proofing comments aren't inline here.) What I suggest I do is that as well updating the document here I save the before and after versions and do a markup compare in Google Docs. I will send out this link by email to reviewers. So now begins my task of reviewing and aggregating all comments. I suspect that this will need a chunk of work. Where appropriate I will do this inline, but will post separate comments for specific that merit wider discussion To be continued 😄 |
After comments from @marcelstoer, I suggest that we adopt the abbreviations:
I have tweaked the lede sections of these documents to adopt this convention consistently. I was toying with "NodeMCU" vs "NodeMCU Lua" in our documents, but as Marcel raised in one review comment: we have left the Lua language and libraries largely unchanged, so nearly all of the content in our supplemental documents is about the C API for writing C modules; therefore having "Lua" in the titles could be a little confusing. |
I've been away from my main dev setup for a few days, so I have been coding up #3206 in my mind. However, I will resist the scope creep of adding it here. I will update this with the review comments and let's merge this first. #3206 can quickly follow. I have been going though and updating the documentation, but I propose to hold off on |
…demcu-firmware into dev-docs-API-alignment1
Hopefully this latest set of updates has swept up all of the review comments. Note that I've missed hooking the |
When I was testing Lua 5.3 LFS I found that when |
Another little bug was found by updating to GCC 10 - in
is missing
|
BTW @pjsg you mentioned somewhere that the new code returns from reload. This was because the old version did a forever loop to trigger a restart and I replaced this by a system restart call which is is executed in a separate task. What I've done is to follow the restart call by throwing a "system restarting" error which will normally terminate the current task, whilst allowing the SDK to shutdown and restart gracefully. |
@galjonsfigur you mentioned above that |
This is a big PR encompassing #2865, #3152, #3165 (part), #3175, #3176 and #3180.
Make sure all boxes are checked (add x inside the brackets) when you submit your contribution, remove this sentence before doing so.
dev
branch rather than forrelease
.thoroughlytested my contribution.docs/*
.Overview of PR
This aims to sweep up most of the loose ends following the Alpha release of Lua 5.3 and as such is a big PR. Sorry but all of the interdependencies make this a difficult one to untangle. So this encompasses:
docs/
files for the NodeMCU LRM and the LFS Whitepaper. This second is probably far too detailed for mode readers and needs culling, IMO.The NodeMCU Lua Reference Manual documents for the first time how our firmware and C API differs from the standard Lua 5.3 Reference Manual. Can I ask others to print this off and read it? Please give feedback.
node.c:node_lfs_func()
Still TBD
luac.cross
strip debug levelsnodemcu-firmware/msvc/luac-cross/
files need updating to reflect the linux make, plus similar changes forapp/lua53
Caveat
Because of the size of this, I am expecting extra rework so lease don't merge until we've had this review cycle.