Skip to content
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

CCSMB 4: Recommendations for Lua Code #16

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

MCJack123
Copy link
Contributor

This RFC adds a proper standard for recommendations for Lua code, including programs and libraries. It's divided into two types of guidelines: interface guidelines, which are required to be compliant with the spec; and style guidelines, which are recommendations by the CCSMB but not required for full compliance. This supersedes #9 by adding much more detail to how Lua files should be written.

This is not complete at the moment, but I figured it would be good to add it for now to get more feedback and suggestions for things to add.

Closes #9

@MCJack123 MCJack123 added the classification: proposal Introduction of a new proposal. label Nov 21, 2022
@MCJack123 MCJack123 self-assigned this Nov 21, 2022
Copy link
Contributor

@Erb3 Erb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! Thanks.

Standards/CCSMB-4.md Show resolved Hide resolved
Copy link
Member

@EmmaKnijn EmmaKnijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about returning multiple values in the same statement, is that allowed?

@tomodachi94 tomodachi94 mentioned this pull request Nov 22, 2022
Standards/CCSMB-4.md Outdated Show resolved Hide resolved
Standards/CCSMB-4.md Show resolved Hide resolved
@CCSMB CCSMB locked and limited conversation to collaborators Jan 8, 2023
@CCSMB CCSMB unlocked this conversation Jan 8, 2023
@MCJack123 MCJack123 added the status: help wanted Extra attention is needed label Jan 10, 2023
@znepb
Copy link

znepb commented Jan 27, 2023

This seems to be a great addition to CCSMB. However, I would like to propose to change the name of the standard to "Recommendations for Executable Lua Source," which would indicate that this RFC exclusively defines information for Lua packages and libraries, NOT Lua tables and/or byte code, which may become their own separate standard entirely.

@MCJack123
Copy link
Contributor Author

  1. Lua/"serialized" tables aren't really Lua code in theory - the fact that they are valid Lua code and loadable by load is an implementation detail (like how JSON is technically valid JavaScript code). As such, it's by default not covered under the "Lua code" title. Even so, serialized tables should still follow the style guidelines.
  2. Bytecode is also not Lua, and is an implementation detail of the Lua VM, so it's also by default not covered as "Lua code".

@tomodachi94 tomodachi94 added the status: stale An unmerged pull request has sat for a month with no comments. label Mar 24, 2024

**1.1.3.** Code intended for distribution MUST have a licence statement located near or at the top of the file. This can be any statement of licence, including "all rights reserved" or "public domain". The CCSMB RECOMMENDS using one of the following licence types:

* CC0 or Unlicense or Public Domain
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe CC0 isn't recommended for code (isn't approved by OSI)


**1.1.2.** Lua files SHOULD have the extension `.lua`, but older programs MAY accept no extension as well.

**1.1.3.** Code intended for distribution MUST have a licence statement located near or at the top of the file. This can be any statement of licence, including "all rights reserved" or "public domain". The CCSMB RECOMMENDS using one of the following licence types:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding links to the licenses (or choosealicense.com) if this document doesn't go into their differences

@@ -0,0 +1,122 @@
# CCSMB 4: Recommendations for Lua Code
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CCSMB 4 should be italicized: CCSMB 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
classification: proposal Introduction of a new proposal. status: help wanted Extra attention is needed status: stale An unmerged pull request has sat for a month with no comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants