lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Um, just FYI, Android is Linux, the apps are java.

On Wed, Aug 3, 2011 at 2:33 PM, HyperHacker <hyperhacker@gmail.com> wrote:
On Wed, Aug 3, 2011 at 12:20, Justin Cormack
<justin@specialbusservice.com> wrote:
> On 3 Aug 2011, at 16:31, Sean Conner <sean@conman.org> wrote:
>
>> It was thus said that the Great HyperHacker once stated:
>>>
>>> A much easier method though might be to hack a Linux kernel. And no
>>> matter which method you choose, proprietary graphic drivers present a
>>> problem...
>>
>>  Even easier would be a Linux system with a custom init program (process
>> 1) written in Lua.
>>
>>  -spc
>
> I am working on that, just for fun, using luajit.
>>
>
> Justin
>
>
>

I actually think an OS written mostly in Lua could be a very practical
and useful idea - just not on the PC. Think of smartphones, tablets,
and so forth. Android is mostly Java, with all applications being pure
Java - why can't similar be done with Lua? I suspect a phone OS
written in Lua would be much like Android, but simpler (Android's API
is horrendously complicated) and leaner (for having Lua instead of
Java).

I don't want to say "entirely", because of course modern CPUs
unfortunately can't boot into Lua code :) but all you'd need to do in
C/assembly is enough to create a Lua state and give it some functions
it can use to interface with the hardware directly, allocate blocks of
memory, and create other Lua states, and load a "kernel" script
(likely precompiled bytecode) into it. From there it can take care of
loading applications and modules, each in their own Lua state having
whatever functions are appropriate. (e.g. "userland" applications
wouldn't have the raw hardware I/O functions provided.)

Of course even here, using a Linux kernel is still an option as well.

--
Sent from my toaster.