<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, Adam --<div><br></div><div>Thanks for trying it out!</div><div><br></div><div>I can understand your confusion very well. I think that the problems that occur now are very valuable for us because we can learn from them and know what we have to improve, to communicate, and to document. I encourage you and everybody else to send your experiences and suggestions to the list so we can find solutions for them.</div><div><br></div><div>Jens, Dan, and I are working in the system for some time now and we have our ways of doing things -- but these are necessarily not the best solutions and discussions about improvements are very welcome. The system already is capable of quite a lot but often it might not be obvious of how to approach a certain task (like creating and editing a file). </div><div><br></div><div>Background info:</div><div><br></div><div>Development in Lively was completely file-based in the beginning. This means that the way of writing code was to edit a JavaScript file, start the system, see if the change worked, add another change, restart, and so on.</div><div><br></div><div>We then added support for editing the files from within Lively. This way it was not necessary anymore to restart the system. The tool that we use for that is the 'System code browser'.</div><div><br></div><div>Next thing we did was to attach 'changes' to a world. A change is some JavaScript code snippet like a class definition that can be evaluated on world load. Changes aren't stored in a JavaScript file but are currently added to the XHTML data of a world. To edit them we use the 'Local code browser' and the 'Wiki code browser' (to edit changes of other worlds and not only the current one).</div><div><br></div><div>Sooner or later we might want to abandon files completely but currently the mixture of files and local changes provides a lot of flexibility: If the system is broken for some reason or doesn't have support for something you want to do you can simply use other tools.</div><div><br></div><div>The way I prefer to develop is the following:</div><div>- I start to add tests and code to a world as local changes using the 'Local code browser. For code snippets I want to try out I use a text window (similar to a Smalltalk workspace).</div><div>- When I'm done I merge/push my changes to some module. Currently this is done manually using copy and paste.</div><div>- If I want to add it to an existing module I open the System browser and edit it.</div><div>- If I want to create a new module I can do it with the System browser using 'add module' button. If you want to edit files in another directory as the default then you can choose 'Switch System browser directory' in the tools menu. This part is still to complicated and we will improve it soon.</div><div><br></div><div>To get an impression of how I develop such a world: <a href="http://www.lively-kernel.org/repository/webwerkstatt/!svn/bc/5120/robert/DraftXMLConverter.xhtml">www.lively-kernel.org/repository/webwerkstatt/!svn/bc/5120/robert/DraftXMLConverter.xhtml</a>. You can also view at the different versions to see the development process.</div><div><br></div><div>Ah, and don't worry about changes to the core system. It is always possible to find out what was changed (using SVN or the 'Viewer for latest file changes') and additionally the wiki is separated from the kernel repository. We are able to sync them but currently do this semi-automatically: <a href="http://www.lively-kernel.org/repository/webwerkstatt/update.xhtml">www.lively-kernel.org/repository/webwerkstatt/update.xhtml</a>.</div><meta charset="utf-8"><div><br></div><div>I hope I was able to clear up your confusion at least a bit.</div><div><br></div><div>Best,</div><div>Robert</div><div><br></div><div><br><div><div>On Apr 14, 2010, at 5:19 PM, Adam Spitz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Robert Krahn wrote:<br><br><blockquote type="cite">Part 2: Using modules to add your extensions<br></blockquote><blockquote type="cite">The first thing you need is some place to store your source code and your<br></blockquote><blockquote type="cite">data. You can create your own subdirectory in the wiki<br></blockquote><blockquote type="cite">here: <a href="http://www.lively-kernel.org/repository/lively-wiki/CreateUserDirectory.xhtml">http://www.lively-kernel.org/repository/lively-wiki/CreateUserDirectory.xhtml</a><br></blockquote><blockquote type="cite">Your directory includes a WorldTemplate.xhtml that you can clone to create<br></blockquote><blockquote type="cite">new pages. You can then add new Worlds and add source code in them using the<br></blockquote><blockquote type="cite">local changes (and the Local code Browser, you find it in the Tools menu).<br></blockquote><blockquote type="cite">Or you can create your own JavaScript files using the System browser or<br></blockquote><blockquote type="cite">manually by checking out your directory using SVN and adding/editing files<br></blockquote><blockquote type="cite">with a TextEditor. The JavaScript files should include a module definition.<br></blockquote><br>I'm confused about all these different tools.<br><br>The System Code Browser (which I originally thought would be like a<br>Smalltalk browser, showing me what's in the live image) seems to be<br>showing me what's in the system code *files*. When I first open it up,<br>it says that everything, even the core stuff (Core.js, Text.js, etc.),<br>is "not loaded." Then when I click on the file name, it "loads", which<br>I take to mean that the system is parsing the file and showing me<br>what's in it (rather than showing me the actual code that's in the<br>live image). If I make a change in there and hit Apple-S, it saves the<br>change, and that change is visible if I hit my browser's Reload button<br>or even open the world in another browser. So it obviously saved my<br>change to a file somewhere. Where's the file? The only file in<br><a href="http://www.lively-kernel.org/repository/lively-wiki/users/AdamSpitz/">http://www.lively-kernel.org/repository/lively-wiki/users/AdamSpitz/</a><br>is the WorldTemplate.xhtml file (I don't see any .js files there), so<br>I hope I didn't just overwrite some important official LK file or<br>something.<br><br>And then there's the Javascript Code Browser, which I can open by<br>right-clicking any morph and saying "show class in browser." If I make<br>a change *there*, it seems to be only changing the running image -<br>when I reload the page my change is gone. Good, that makes sense to<br>me.<br><br>Incidentally, I noticed that after I've opened a System Code Browser,<br>the Javascript Code Browser doesn't seem to work anymore - I get an<br>error message in the console saying, "TypeError: Result of expression<br>'this.methodDicts' [undefined] is not an object." (Did I just cause<br>this error by mucking around with system files?)<br><br>Is the System Code Browser just meant to be a way of editing .js<br>files? (That is, it doesn't operate on the live image, it's just a bit<br>nicer than Emacs for editing .js files?) Is the idea that most<br>"normal" programming (programming that isn't likely to crash the whole<br>system if you make a typo) should be done in the Javascript Code<br>Browser?<br><br><br><br><blockquote type="cite">** Using the namespace inside a module is NOT enforced. This means if you<br></blockquote><blockquote type="cite">define a class Object.subclass('SystemBrowser', {...}) it will "extend" the<br></blockquote><blockquote type="cite">Global namespace. This means that you can access the class via<br></blockquote><blockquote type="cite">Global.SystemBrowser (or simply with SystemBrowser). Only if you use the<br></blockquote><blockquote type="cite">namespace explicitly Object.subclass('lively.ide.SystemBrowser', {...}) the<br></blockquote><blockquote type="cite">namespace will be used and you can access the class via<br></blockquote><blockquote type="cite">Global.lively.ide.SystemBrowser (or simply lively.ide.SystemBrowser).<br></blockquote><blockquote type="cite">We might change that in the future to enforce namespace usage.<br></blockquote><br>If you do that, will it still be possible for me to write, say, a<br>"set" class and add an asSet method to the Array class?<br><br>Come to think of it, how does the current system know how to find<br>"extension" methods like that and file them out when you file out the<br>module that they belong to? In Self's module system (and in my port of<br>it to LK), the module object itself keeps track of all the slots<br>belonging to the module. But I don't think I've seen anything like<br>that in LK. (I could easily have missed it, though.)<br><br><br><br>Adam<br>_______________________________________________<br>lively-kernel mailing list<br>lively-kernel@hpi.uni-potsdam.de<br>http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel<br></div></blockquote></div><br></div></body></html>