oeed / CraftOS-Standards

Community standard file formats, communication systems, etc. for ComputerCraft and CraftOS 2.0
Other
20 stars 16 forks source link

Add Lua Source Code Format #26

Closed oeed closed 8 years ago

oeed commented 8 years ago

Closes #16

lyqyd commented 8 years ago

There's lots of things in CC that a valid lua file could be:

lua/data lua/program lua/library

So why are we collapsing all of them to one mime type? We are missing an opportunity here.

oeed commented 8 years ago

That's a fair point @lyqyd, but how do you specify which one it is? If the system determines the MIME based on the file extension they'll all default to lua/program. I guess one solution to this would to be API/libraries a separate extension like .lib or something like that.

lyqyd commented 8 years ago

Yes, separate file extensions are one way to go. You have a good point though, that there needs to be a way to tell the metadata system what variety/usage of Lua a file contains. Is there already a suggestion/draft for a generalized metadata attribute setting standard?

oeed commented 8 years ago

@lyqyd I've been working on a proposal here, it's not quite complete, but the basics are there.

I'd originally proposed a system more alike your RFC, although everyone in Gitter was quite against having a metadata file for each file. Another issue I found with your system was as Silica has a few hundred files metadata started taking up a significant amount of storage space, this format is designed to be as tight as possible.

I don't think it's mentioned yet, but in Silica I currently have it 'guessing' the MIME based on a file's extension; I'm not really sure of another reliable method.