←  General

ComputerCraft | Programmable Computers for Minecraft

»

Concept: OS using Objective-C

mayanyaa's Photo mayanyaa 09 May 2015

I had an idea: to use HTTP api, PHP, and Objective-C to make an OS. I have the messages working - the computer detecting input, sending it to a web server, and my Objective-C program picking it up.

Here's the output(on the Xcode debugger) I get from doing the following
leftclick
rightclick
"a" key
"b" key
"c" key
scroll up
scroll up
scroll down
scroll down
scroll down
drag(leftclick)
drag(leftclick)
drag(rightclick)
drag(rightclick)
drag(rightclick)
rightclick
rightclick
insert floppy disk on left side
remove floppy disk on left side:

ComputerCraft[16374:8296782] Click With Button: 1 At x: 18 y: 5
ComputerCraft[16374:8296782] label=cs&data=Click With Button: 1 At x: 18 y: 5
ComputerCraft[16374:8296782] Click With Button: 2 At x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Click With Button: 2 At x: 14 y: 10
ComputerCraft[16374:8296782] key pressed with keycode: 30
ComputerCraft[16374:8296782] label=cs&data=key pressed with keycode: 30
ComputerCraft[16374:8296782] key pressed with keycode: 48
ComputerCraft[16374:8296782] label=cs&data=key pressed with keycode: 48
ComputerCraft[16374:8296782] key pressed with keycode: 46
ComputerCraft[16374:8296782] label=cs&data=key pressed with keycode: 46
ComputerCraft[16374:8296782] Scroll in direction: 1 x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Scroll in direction: 1 x: 14 y: 10
ComputerCraft[16374:8296782] Scroll in direction: 1 x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Scroll in direction: 1 x: 14 y: 10
ComputerCraft[16374:8296782] Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] label=cs&data=Scroll in direction: -1 x: 14 y: 10
ComputerCraft[16374:8296782] Drag With Button: 1 At x: 22 y: 12
ComputerCraft[16374:8296782] label=cs&data=Drag With Button: 1 At x: 22 y: 12
ComputerCraft[16374:8296782] Drag With Button: 1 At x: 23 y: 12
ComputerCraft[16374:8296782] label=cs&data=Drag With Button: 1 At x: 23 y: 12
ComputerCraft[16374:8296782] Drag With Button: 2 At x: 23 y: 12
ComputerCraft[16374:8296782] label=cs&data=Drag With Button: 2 At x: 23 y: 12
ComputerCraft[16374:8296782] Click With Button: 2 At x: 17 y: 12
ComputerCraft[16374:8296782] label=cs&data=Click With Button: 2 At x: 17 y: 12
ComputerCraft[16374:8296782] Drag With Button: 2 At x: 20 y: 12
ComputerCraft[16374:8296782] label=cs&data=Drag With Button: 2 At x: 20 y: 12
ComputerCraft[16374:8296782] Disk Inserted On Disk Inserted On left Side Side
ComputerCraft[16374:8296782] label=cs&data=Disk Inserted On left Side
ComputerCraft[16374:8296782] Disk Ejected On Disk Ejected On left Side Side
ComputerCraft[16374:8296782] label=cs&data=Disk Ejected On left Side

I'm still working on the actual handling and returns, but what do you think of the concept? I'm also looking for someone else to work with on the project, so if you're interested then please PM me.

Here's the implementation code, if you want it:
Spoiler

Edited by ValveCantCount, 09 May 2015 - 08:58 AM.
Quote

Lyqyd's Photo Lyqyd 09 May 2015

Moved to General.
Quote

Creator's Photo Creator 09 May 2015

So you are trying to make online OS, and only the client for it will be on the local PC?
Edited by Creator, 09 May 2015 - 08:08 AM.
Quote

mayanyaa's Photo mayanyaa 09 May 2015

View PostCreator, on 09 May 2015 - 08:08 AM, said:

So you are trying to make online OS, and only the client for it will be on the local PC?
That's the basic idea.

In the long run, I'll be using a server-side database to handle, sort, and identify all incoming posts, and do similar IDing with objc. The plan is subject to change, of course, I don't know exactly where this will lead to.

I might have multiple instances running and distribute the data equally to reduce load, if it comes to it(which is completely ridiculous anyways)
Edited by ValveCantCount, 09 May 2015 - 08:54 AM.
Quote

Creator's Photo Creator 09 May 2015

One idea is to use a login system since multiple users may be using it at the same time and you want to be able to differentiate them.
Quote

Engineer's Photo Engineer 09 May 2015

What i internet is down for whatever reason, will the client then handle the events itself? If that is done as "back-up" system, why would you connect to the internet to handle events in the first place? What is the point I am not getting?
Quote

flaghacker's Photo flaghacker 09 May 2015

View PostEngineer, on 09 May 2015 - 01:41 PM, said:

What i internet is down for whatever reason, will the client then handle the events itself? If that is done as "back-up" system, why would you connect to the internet to handle events in the first place? What is the point I am not getting?

No, I think the OS will be programmed in C. No backup in Lua...
Quote

FUNCTION MAN!'s Photo FUNCTION MAN! 09 May 2015

View Postflaghacker, on 09 May 2015 - 03:34 PM, said:

View PostEngineer, on 09 May 2015 - 01:41 PM, said:

What i internet is down for whatever reason, will the client then handle the events itself? If that is done as "back-up" system, why would you connect to the internet to handle events in the first place? What is the point I am not getting?

No, I think the OS will be programmed in C. No backup in Lua...

Objective C.
lern de difference
Quote

Engineer's Photo Engineer 09 May 2015

View PostDr. Poof, on 09 May 2015 - 03:53 PM, said:

Objective C.
lern de difference
Oh pretty please, you dont get it do you?
If your internet shuts down for any reason, goodluck with this OS, because it is not going to work out....
Frankly, unless there is some backup mechanism, this seems pointless really. Its cool to program in a programming language you prefer over Lua, but the downside is that everything is going to be sent to a server which executes and then a response comes back. The concept is cool, but practically I think bad...

On a side note: learn*
Quote

mayanyaa's Photo mayanyaa 09 May 2015

View PostEngineer, on 09 May 2015 - 05:15 PM, said:

View PostDr. Poof, on 09 May 2015 - 03:53 PM, said:

Objective C.
lern de difference
Oh pretty please, you dont get it do you?
If your internet shuts down for any reason, goodluck with this OS, because it is not going to work out....
Frankly, unless there is some backup mechanism, this seems pointless really. Its cool to program in a programming language you prefer over Lua, but the downside is that everything is going to be sent to a server which executes and then a response comes back. The concept is cool, but practically I think bad...

On a side note: learn*

Yes, if my Internet or the client side Internet is down, then it won't work. Keep in mind that his is a concept, and the main reason I'm making it is for personal satisfaction. Besides, people have Internet most of the time.
Quote

Engineer's Photo Engineer 09 May 2015

View PostValveCantCount, on 09 May 2015 - 06:19 PM, said:

Yes, if my Internet or the client side Internet is down, then it won't work. Keep in mind that his is a concept, and the main reason I'm making it is for personal satisfaction. Besides, people have Internet most of the time.
Like I have said previously it is a cool concept, but practically it is not usefull. Making an assumption like: people have Internet most of the tie is technically a bad thing to do because we, as programmers, should consider every possibility IF we want to support that.

I want to encourage you to continue anyway, because it is for your satisfaction plus then it is proved we can program in other programming languages. If you consider me as someone who is against this project, I am not. Do what you want to do and whenever you like. I am just giving my feedback as a friendly guy, if anything came out wrong, then I will apologise for that.
Quote

mayanyaa's Photo mayanyaa 09 May 2015

View PostEngineer, on 09 May 2015 - 07:03 PM, said:

View PostValveCantCount, on 09 May 2015 - 06:19 PM, said:

Yes, if my Internet or the client side Internet is down, then it won't work. Keep in mind that his is a concept, and the main reason I'm making it is for personal satisfaction. Besides, people have Internet most of the time.
Like I have said previously it is a cool concept, but practically it is not usefull. Making an assumption like: people have Internet most of the tie is technically a bad thing to do because we, as programmers, should consider every possibility IF we want to support that.

I want to encourage you to continue anyway, because it is for your satisfaction plus then it is proved we can program in other programming languages. If you consider me as someone who is against this project, I am not. Do what you want to do and whenever you like. I am just giving my feedback as a friendly guy, if anything came out wrong, then I will apologise for that.

No no, thanks for reminding me about people without Internet. I will probably add some kind d backup or maybe single player support for a local client(with LAN)
Quote

Dahknee's Photo Dahknee 13 May 2015

This I can't see working or even being slightly useful... Imagine the response time for running calls to the computer... anyway:

I do not get why you don't just use C? :s Considering Lua compiles cleanly as C? You could easily fix the bits and bobs and make it work client side?
Quote

Creator's Photo Creator 13 May 2015

View PostDannySMc, on 13 May 2015 - 11:19 AM, said:

This I can't see working or even being slightly useful... Imagine the response time for running calls to the computer... anyway:

I do not get why you don't just use C? :s Considering Lua compiles cleanly as C? You could easily fix the bits and bobs and make it work client side?

He's got a point about response times. That may really be bothering. What I thought about was to use it as an external storage. For example, I have 100Mb of space on your system. I can then upload files and use them directly from computercraft.
Quote

Dahknee's Photo Dahknee 13 May 2015

View PostCreator, on 13 May 2015 - 01:08 PM, said:

View PostDannySMc, on 13 May 2015 - 11:19 AM, said:

This I can't see working or even being slightly useful... Imagine the response time for running calls to the computer... anyway:

I do not get why you don't just use C? :s Considering Lua compiles cleanly as C? You could easily fix the bits and bobs and make it work client side?

He's got a point about response times. That may really be bothering. What I thought about was to use it as an external storage. For example, I have 100Mb of space on your system. I can then upload files and use them directly from computercraft.

I have started a script for this xD, allows you to run virtual commands and use storage, like a http based rednet file browser / nsh kinda thing :P
Quote

Creator's Photo Creator 13 May 2015

Rather ftp.
Quote

Dahknee's Photo Dahknee 13 May 2015

View PostCreator, on 13 May 2015 - 05:31 PM, said:

Rather ftp.

Should I make an FTP type program? Would you actually use it?:D I had a small test one made but never actually released it?:P Should I?::DDD
Quote

mayanyaa's Photo mayanyaa 14 May 2015

View PostCreator, on 13 May 2015 - 01:08 PM, said:

View PostDannySMc, on 13 May 2015 - 11:19 AM, said:

This I can't see working or even being slightly useful... Imagine the response time for running calls to the computer... anyway:

I do not get why you don't just use C? :s Considering Lua compiles cleanly as C? You could easily fix the bits and bobs and make it work client side?

He's got a point about response times. That may really be bothering. What I thought about was to use it as an external storage. For example, I have 100Mb of space on your system. I can then upload files and use them directly from computercraft.

The response time is definitely a potential problem. ATM it isn't too bad, but I'll work out a solution if it comes to that.

One possibility is to send the user input info directly to the program, but with my server setup that would be a pain.
Edited by ValveCantCount, 14 May 2015 - 12:30 AM.
Quote