diff options
Diffstat (limited to 'docs/README.LuaSL')
-rw-r--r-- | docs/README.LuaSL | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/docs/README.LuaSL b/docs/README.LuaSL deleted file mode 100644 index 7556bf7..0000000 --- a/docs/README.LuaSL +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | Refer to - LuaSL_New_scripting_engine.html | ||
2 | |||
3 | LuaSL is a Lua based LSL scripting engine that will aim for LSL | ||
4 | compatibility first, then adding Lua extensions. It aims to replace the | ||
5 | woeful XEngine from OpenSim, and at a later stage, be the basis for a | ||
6 | client side scripting engine. | ||
7 | |||
8 | To compile this, you will need Enlightenment Foundation Libraries (EFL) | ||
9 | installed in either /opt/e17 or /usr. These are typical places it get's | ||
10 | installed in. You will also need flex. The rest of the dependencies | ||
11 | are in the ../libraries directory. | ||
12 | |||
13 | |||
14 | Design. | ||
15 | ------- | ||
16 | |||
17 | The basic design will be made up as I go along, but so far I have this - | ||
18 | |||
19 | A parser parses an LSL script, validating it and reporting errors. | ||
20 | |||
21 | A translator takes the result of the parse, and converts it into Lua | ||
22 | source. Each LSL script becomes a Lua state. LSL states are handled as | ||
23 | Lua tables, with each LSL state function being a table function in a | ||
24 | common metatable. LL and OS functions are likely to be C or Lua | ||
25 | functions. Careful testing should be done with LuaJIT FFI, sandboxing, | ||
26 | and performance testing. | ||
27 | |||
28 | The Lua source is compiled by the Lua compiler. | ||
29 | |||
30 | LuaJIT is used as the Lua compiler, library, and runtime. | ||
31 | |||
32 | Luaproc is used to start up operating system threads and hand Lua states | ||
33 | between them. Luaproc messaging is also being used, but might need to | ||
34 | change to edje messaging. Note - luaproc has been extensively rewritten | ||
35 | for this project, mostly converting it to use EFL. That rewrite | ||
36 | substantially shrunk the source code. Then it was all rewritten again | ||
37 | to use EFL threads, and cooperative multitasking. | ||
38 | |||
39 | THIS IS WHERE WE ARE RIGHT NOW. | ||
40 | |||
41 | Should implement embedded Lua somehow. Probably the best thing to do is | ||
42 | to have comments like - | ||
43 | |||
44 | //Lua: local t = {1, 3, 42, x='something', 'something else} | ||
45 | /*Lua: print(t.x) */ | ||
46 | |||
47 | The LSL parser picks these up and stores them in the AST as Lua | ||
48 | snippets, then the compiler output functions just inserts them in the | ||
49 | Lua code it is generating. Obviously these Lua snippets can access the | ||
50 | rest of the generated Lua code. They should also be able to access | ||
51 | skang and thus do proper GUI stuff on viewers that support skang. | ||
52 | |||
53 | Nails will be used to pump commands in and out of the LuaSL system. | ||
54 | Incoming commands invoke LSL events via the LuaSL state metatable. LL | ||
55 | and OS functions that impact the world will be converted to nails | ||
56 | commands sent to the command pump. | ||
57 | |||
58 | Initially, since this is the first thing being written, a nails command | ||
59 | pump client needs to be installed into OpenSim's C# stuff. Though it | ||
60 | might be possible to talk directly to ROBUST instead. Think I'll try | ||
61 | the ROBUST route, see how far I can get. That's the general principle | ||
62 | applying in all of this - try to avoid C# and see how for we can get. | ||
63 | lol | ||
64 | |||
65 | On the other hand, might be better to leverage the existing C# | ||
66 | implementations of LSL functions, just to get things up and running | ||
67 | quickly. To that end, a protocol involving exchanging snippets of Lua | ||
68 | over a network socket has been developed, and the next step is to write | ||
69 | the C# side. sigh | ||
70 | |||
71 | A watchdog thread should be used to make sure no LuaSL script spends | ||
72 | forever processing any event. | ||
73 | |||
74 | Some form of serialization will need to be created for saving script | ||
75 | state during shutdowns, passing script state to other threads / | ||
76 | processes / computers. Apparently Lua is good at this. | ||
77 | |||
78 | There will have to be a MySQL (and maybe SQLite) client in the system, | ||
79 | so we can talk directly to the local sim database. Esskyuehl may be | ||
80 | suitable, though it's still in the prototype stage. | ||
81 | |||
82 | Email, HTTP, and XML-RPC might need to be dealt with by us. A ROBUST | ||
83 | client will be needed to. Azy might be suitable, but it's also in | ||
84 | prototype. | ||
85 | |||
86 | An object is a file system directory, full of LSL scripts as text files, | ||
87 | notecards as text files, animations as BVH (or later BVJ) files, etc. | ||
88 | There will be some sort of metadata in place. This could be created by | ||
89 | our own OpenSim compatible cache module. | ||
90 | |||
91 | |||
92 | Test harness. | ||
93 | ------------- | ||
94 | |||
95 | I'll build a test harness. It will be based on EFL Edje Lua, with | ||
96 | buttons for triggering LSL events, SL style dialogs, and other goodies. | ||
97 | |||
98 | The initial goal will be to run standard MLP scripts. They have minimal | ||
99 | interface to the world, and exercise quite a bit of the rest of LSL. | ||
100 | They are also quite common, and sometimes responsible for a lot of the | ||
101 | script running load. | ||
102 | |||
103 | Later I should add stock standard OpenCollar scripts from SL. They are | ||
104 | a bitch to get working under OpenSim, so would be good compatability | ||
105 | tests. | ||
106 | |||
107 | Various eina logging domains might be used to handle whisper, say, shout, | ||
108 | etc. | ||
109 | |||
110 | Performance testing will have to be done on 5000 scripts, to see how | ||
111 | that compares against XEngine. | ||
112 | |||
113 | The test harness became the love world server. | ||
114 | |||
115 | |||
116 | TODO | ||
117 | ---- | ||
118 | |||
119 | Useful for limiting the amount of time scripts use - | ||
120 | https://groups.google.com/forum/#!topic/lua-alchemy-dev/3bDPk2aQ8FE | ||
121 | http://stackoverflow.com/questions/862256/how-can-i-end-a-lua-thread-cleanly | ||