Open Komodo: an Open Source IDE for Open Languages Own Your IDE Eric Promislow Activestate Software Inc
Total Page:16
File Type:pdf, Size:1020Kb
Open Komodo: An Open Source IDE For Open Languages Own Your IDE Eric Promislow ActiveState Software Inc. OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 1 History • Perl for Windows • Active Python, Komodo Anti -Spam Digression • • • Refocus on Developer Tools OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 2 Contradiction?Origins OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 3 Agenda • Ruby and Rails Support • OpenKomodo • Zooming In OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 4 Komodo Philosophy Balance of Helpfulness • • • Projects Are Optional OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 5 Ruby Support Ruby -Aware Auto-Indentation • • • Soft Characters • • Code Completion – Their Stuff – Your Stuff • OpenKomodo:• AbbreviationsOwn Your IDE (Snippets)Oslo, Norway April 4, 2008 6 • Complete Known Names OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 7 Walk Library Objects OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 8 Call Tips OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 9 Your Own Code OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 10 Troubleshoot OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 11 Rails Support: Goals Avoid the Command-Line for Routine • activities – Generate & Migrate – Test – Debug – Run – SCC OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 12 Useful Tools Firefox JavaScript Debugger • • HTTP Inspector • DOM Inspector • Unit Test Integration • Rx Toolkit OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 13 Visualizing Redirects: Before OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 14 Visualizing Redirects: After OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 15 Rails Support: Deploying • Specify Servers • Edit Remote Files • Remote Folders in Projects • One Size Doesn’t Fit All OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 16 The Komodo Family OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 17 The Komodo Family • Komodo IDE • Komodo Edit • OpenKomodo : MPL GPL LGPL OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 18 Why Open It • Unique in its underlying technology • Built with the same languages we support • Build a foundation, let many build on top • Mozilla: Open, Cross-Platform OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 19 Use It • http://www.openkomodo.com OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 20 Extend It • Macros • Extensions • Hack the Source OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 21 Build Something • Komodo IDE • Snapdragon • Mozpad • ? OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 22 How did we get here? • 1994: Netscape 1.0 Beta • 1995: IE 2.0 Released • Jan 1998: Netscape Open-Sources Client • What does this have to do with developer tools? OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 23 Mozilla: Timing is Everything • Seamonkey and MAS too “90s” • Firefox and Thunderbird Follow Unix Philosophy OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 24 Built on Standards • XUL isn’t too foreign • JavaScript is everyone’s second language OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 25 Other Apps • Flock • Sunbird • Camino • Songbird • Joost • Hackety-Hack OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 26 Even Microsoft Buys In • Windows Application Framework – Based on XAML – XAML based on XUL OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 27 Programmers' Tools Matter • OpenKomodo is the right technology at the right time OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 28 Community Matters • Every platform needs one • Case Study: Visual Basic • "Support statement for Visual Basic 6.0 on … Vista" • Visual Studio .Net (7.0) Q & A OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 29 Openness Matters • Hard to grow a community without empowering people • Extension contest showed people could use it without large amounts of documentation OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 30 And Now For Something More Technical… OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 31 What Exactly Is Mozilla • XUL • JS • CSS OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 32 Mozilla Components • NSPR • Gecko • Necko • XPCOM • XPConnect • XBL OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 33 Komodo Under the Hood • Chrome - front-end -- src/chrome • PyXPCOM back-end -- src/ • Over 20 FOSS components in contrib/ • Scintilla • XML and HTML resources • IDL files - src/* and sdk/ • Over 260 files OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 34 Interfaces & Implementations Search http://grok.openkomodo.com/source/xref/ http://lxr.mozilla.org/mozilla1.8/ OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 35 Write Macros Samples in Toolbox Subset of API in Help Experiment with JavaScript Shell • http://community.activestate.com/ komodo-extension/ komodo-developer-extension OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 36 OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 37 OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 38 Python or JavaScript? • JS code handles controller and view • Python better suited for special cases OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 39 Writing Extensions • Hello-world • Komodo "Komodo Extension Template" • Steeper Leaning Curve that Macros – Graphical UI Adds an Extra Dimension OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 40 Undo Slider OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 41 Getting Started OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 42 OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 43 UI expressed in XML • overlay id=%extension_name%Overlay ... – commandset id=allcommands • command id=Tasks:HelloWorld oncommand="alert('Hello world')" – menupopup id=popup_tools • Menuitem id=menu_%extension_name% label=%extension_nice_name% observes="Tasks:HelloWorld" class="menu-iconic-wide" OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 44 I18n OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 45 chrome.manifeset /content undoslider jar:undoslider.jar!/content • xpcnativewrappers=yes • • overlay chrome://komodo/content/komodo.xul chrome://undoslider/content/overlay.xul • • skin undoslider classic/1.0 jar:undoslider.jar!/skin/ OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 46 Monkeypatching your IDE OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 47 JavaScript • String.prototype.shuffle = function(s) { var a = s.split(''); a.sort(function() { return 0.5 - Math.random(); }); return a.join(''); } OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 48 JavaScript Cautions • Komodo doesn't modify JS classes • Avoids loading third-party libraries • Other extensions might OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 49 Namespaces • ko - global object • Be consistent • Declare everything OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 50 Monkeypatching via Hooks • Function addModifiedHandler(view) { gOrigH = view.onModifiedHandler; view.onModifiedHandler = function(…) { … if (typeof(gOrigH) == "function") { gOrigH(…); } } } OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 51 What about Ruby XPCOM? http://rbxpcom.mozdev.org/index.html • • Version 0.0.4 OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 52 Getting the source • http://www.openkomodo.com • SVN OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 53 Searching the source • http://grok.openkomodo.com/ source/xref OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 54 Resources • http://www.openkomodo.com • http://community.activestate.com • irc://moznet/#komodo • http://blogs.activestate.com/ericp • [email protected] OpenKomodo: Own Your IDE Oslo, Norway April 4, 2008 55.