#1
Posted 24 June 2013 - 08:53 AM
I tried writing my own but I'm finding the process of looking back at the code then reinserting it into the CC zip and rebooting minecraft rather tedious, particularly when the VM behind CC won't give out what line the error is on.
After procrastinating and programming for so long in C#, I've finally decided to get back to working on my OS for CC and a nice bios selector would be handy, particularly one that will tell me the line number of any errors I make along the way.
#2
Posted 24 June 2013 - 09:07 AM
#3
Posted 24 June 2013 - 09:33 AM
Also, I recommend using an emulator (CCEmu or CCDesk) to test. It makes the development faster, since you don't have to go into minecraft, then into the computer, you just have all the computers there in one screen. And it saves some resources too
#4
Posted 25 June 2013 - 06:59 PM
theoriginalbit, on 24 June 2013 - 09:07 AM, said:
Because functions get changed and added as part of CraftOS's loading up. If the OS is reliant on anything generated by CraftOS, it's not a true OS because it requires another OS to load first.
MysticT, on 24 June 2013 - 09:33 AM, said:
Also, I recommend using an emulator (CCEmu or CCDesk) to test. It makes the development faster, since you don't have to go into minecraft, then into the computer, you just have all the computers there in one screen. And it saves some resources too
I've used CCemu as well, but it has the same problems regardless because the requirement of a rom file and the whole not telling you what line the error is on is an issue with ComputerCraft itself.
That bios there has an issue btw. It replaces the native getmetatable.
I may consider it however, depending on what alternatives are available.
#5
Posted 25 June 2013 - 08:41 PM
Pharap, on 25 June 2013 - 06:59 PM, said:
Pharap, on 25 June 2013 - 06:59 PM, said:
I may consider it however, depending on what alternatives are available.
#6
Posted 25 June 2013 - 10:32 PM
Pharap, on 25 June 2013 - 06:59 PM, said:
#7
Posted 26 June 2013 - 08:18 AM
MysticT, on 25 June 2013 - 08:41 PM, said:
Pharap, on 25 June 2013 - 06:59 PM, said:
If there's no rom file in the lua directory in computercraft, computercraft complains. Also if bios.lua errors, it doesn't give you a line number, it only complains that you have 'installed craftOS wrong'.
MysticT, on 25 June 2013 - 08:41 PM, said:
Pharap, on 25 June 2013 - 06:59 PM, said:
I may consider it however, depending on what alternatives are available.
If it's that crucial they should really make it Java-side, or at least leave a bit more of a note. Makes me wonder why the usual __metatable trick won't work.
theoriginalbit, on 25 June 2013 - 10:32 PM, said:
Pharap, on 25 June 2013 - 06:59 PM, said:
Again, that won't combat the whole 'not giving line errors' problem if the error crops up mid-program. At least not without either explicitly adding extra pcalls or being able to replicate the issues undercraftOS. In which case if it's a relapse of accidentally using craftOS functions, that will lead to more cryptic problems regarding identifying that a craftOS-added function is the problem and where it is.
#8
Posted 26 June 2013 - 12:00 PM
Pharap, on 26 June 2013 - 08:18 AM, said:
Pharap, on 26 June 2013 - 08:18 AM, said:
The __metatable way should work. Maybe they should do that java-side. Doing it on the bios would mean that you just need to do it once, since it's modified on every computer. I think I'll do that.
#9
Posted 26 June 2013 - 12:25 PM
#10
Posted 27 June 2013 - 03:22 AM
Lyqyd, on 26 June 2013 - 12:25 PM, said:
Was that actually directed at anyone?
MysticT, on 26 June 2013 - 12:00 PM, said:
Pharap, on 26 June 2013 - 08:18 AM, said:
Pharap, on 26 June 2013 - 08:18 AM, said:
The __metatable way should work. Maybe they should do that java-side. Doing it on the bios would mean that you just need to do it once, since it's modified on every computer. I think I'll do that.
I may try that. I'm a tad rusty because I've been busy on other non-lua projects, so I keep forgetting what the return values of things like loadstring are.
Personally I think the 'bios' is a stage too late and something that crucial should be Java-side. If it were any normal lua VM I'd say it was fine but given this VM's usage, it's better to be safe than sorry.
Do be sure to notify me if the __metatable trick works, I would think there's some reason it isn't used, but you never know, it might just be that nobody has tried it before and it turns out to be a much better solution.
#11
Posted 27 June 2013 - 11:21 AM
Pharap, on 27 June 2013 - 03:22 AM, said:
The only "problem" I found is that you can't set the metatable for strings (also, it will error if you try). But, who does that anyway?
#12
Posted 27 June 2013 - 12:37 PM
Pharap, on 27 June 2013 - 03:22 AM, said:
Of course.
Pharap, on 25 June 2013 - 06:59 PM, said:
Emphasis mine. The first sentence was fine, the second is not welcome here, as it's completely opinion-based, irrelevant to the discussion, and plays into a recurring debate.
#13
Posted 28 June 2013 - 11:37 AM
MysticT, on 27 June 2013 - 11:21 AM, said:
Pharap, on 27 June 2013 - 03:22 AM, said:
The only "problem" I found is that you can't set the metatable for strings (also, it will error if you try). But, who does that anyway?
I think not erroring is a better idea personally. Errors and exceptions do make things less cryptic, but on the other hand there's a performance cost for handling them. It's one thing I think C/C++ has/had right (returning null pointers if something didn't allocate properly). I wouldn't go as far to say the whole error thing is a bad idea, I just think there are some times where errors are better handled with single if statements than multi-line pcalls.
It's something I've considered experimenting with to see how much I can break, but otherwise, nobody lol
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











