This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lucasm's profile picture

My code has evolved...

Started by lucasm, 10 December 2013 - 11:54 PM
lucasm #1
Posted 11 December 2013 - 12:54 AM
So I have been using ComputerCraft for the better part of a year now, and i still love it. It is one of the most stable and fun mods out there. Over the course of my adventures I have come to a bit of a zen state with the LUA language, and ended up writing my own OS for my computers so that I could abstract away certain things that I found "non-portable" or didn't meet with my design requirements. Below is the top list of the stuff i built in.

- All Async (no blocking calls)

- Explicit event routing
- By having a single point that calls pullEvent() and routing to callbacks, can design code that shares the event queue in a friendly way and allow for multiple "processes" to run at the same time

- Connection Oriented networking
- Built a system for ephemeral ports and the ability for a "chain" of communication to be started
- This enable Client/Server communication models, rather than just peer-to-peer

- HAL/Driver Model
- I wrote a layer that abstracts the "peripheral id" and attach/detach logic from application code (makes code more portable from world to world so i could build generic services)

- Tracing/NetworkLogging
- Event tracing and logging on a Module level with pluggable listeners. I built a file based one and a network based on that spews all trace events out a network port.

- Inspection Console
- Basically a command line that lets you switch between different LUA environment tables and run a line of code or script. Useful for "debugging" state of code when something goes wrong.

- Parallel Persistent state machines
- when used correctly, allows for computers/turtles to survive a world restarts. I have written miners, tree farmers, a sorting system, and some basic construction bots, all that could survive a world restart intact and continue their duties.

- Pluggable Service Model
- Can write "services" that run in background. A couple examples that i have written are GPS Service (so my GPS turtle/computers can do more that just GPS), trace listeners, and a time service (enable me to track the in-game day beyond world restarts).

- Centralized Configuration/Metadata
- I built a well defined system to load Configuration data per computer/turtle and also provide shared/global configuration that can be shared.

My basic question is how best to feedback what i have learned and built to the community/mod authors? It is quite a chog of code and quite complex to use and setup (requires special directory layouts and SymLinks), so i am not sure what the best forum to get it reviewed/commented on.

Much Thanks,
Luke
theoriginalbit #2
Posted 11 December 2013 - 01:05 AM
ended up writing my own OS
http://www.computerc...rating-systems/ there, anywhere else and it will be locked…

of course the other option if you want to release them as separate programs is to release them into the "Programs" forum and any sub-forums of it… Alternatively you can do what a few people are doing (myself included) and make a single thread that you upkeep in "programs" that contains all your programs.
Edited on 11 December 2013 - 12:08 AM
oeed #3
Posted 11 December 2013 - 03:33 AM
As theoriginalbit said, post your programs in their respective forums. In terms of distributing your code, I'd personally make it as easy as possible to install. If it takes me more than a few minutes to install a program I don't bother continuing, especially if it's not something I'm hugely interested in. So, either make installers and put them on Pastebin or use something like my Package Maker. But yea, just get them out there :D/>
distantcam #4
Posted 11 December 2013 - 07:30 AM
If the programs can stand alone then yeah, just distribute them. Otherwise you could make an "OS" distro and put it in the operating system forum.

If you do make a distro then a single installer that takes a fresh computer and puts everything on it is the way to go.

I'm looking forward to seeing this. That list of features is impressive.
AgentE382 #5
Posted 13 December 2013 - 12:09 AM
With that feature list, I want to see what you've got, no matter what state it's in. Write up some instructions and post it in the OS subforum. It would help if you put the files on Pastebin/GitHub or used oeed's packager so people can easily get your OS and test it.
Edited on 12 December 2013 - 11:11 PM