<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mirko Stocker&#039;s Blog &#187; Scala</title>
	<atom:link href="http://misto.ch/tag/scala/feed/" rel="self" type="application/rss+xml" />
	<link>http://misto.ch</link>
	<description></description>
	<lastBuildDate>Sat, 17 Jul 2010 14:22:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scala Refactoring Thesis Finished</title>
		<link>http://misto.ch/scala-refactoring-thesis-finished/</link>
		<comments>http://misto.ch/scala-refactoring-thesis-finished/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:01:45 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=181</guid>
		<description><![CDATA[I&#8217;m done! A few minutes ago, I handed in my thesis on Scala Refactoring.
The project also has a new home at scala-refactoring.org, where you can find more about the refactorings I implemented, how they can be used, etc. I also recommend reading my report, but if you just want an overview, take a look at [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m done! A few minutes ago, I handed in my thesis on Scala Refactoring.</p>
<p>The project also has a new home at <a href="http://scala-refactoring.org">scala-refactoring.org</a>, where you can find more about the refactorings I implemented, how they can be used, etc. I also recommend reading <a href="http://scala-refactoring.org/wp-content/uploads/scala-refactoring.pdf">my report</a>, but if you just want an overview, take a look at the poster:</p>
<p><a href="http://misto.ch/wp-content/poster.png"><img class="alignnone size-medium wp-image-182" title="poster" src="http://misto.ch/wp-content/poster-300x212.png" alt="" width="300" height="212" /></a></p>
<p>The next steps for me now are to go on holidays, so please excuse if I don&#8217;t respond for a week.</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/scala-refactoring-thesis-finished/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scala Refactoring Talk at Scala Days 2010</title>
		<link>http://misto.ch/scala-refactoring-talk-at-scala-days-2010/</link>
		<comments>http://misto.ch/scala-refactoring-talk-at-scala-days-2010/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:30:04 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=156</guid>
		<description><![CDATA[My talk at Scala Days 2010 is now available online:

And don&#8217;t forget to take a look at the other talks.
]]></description>
			<content:encoded><![CDATA[<p>My talk at Scala Days 2010 is now available online:</p>
<p><a href="http://days2010.scala-lang.org/node/138/141" target="_new"><img src="http://misto.ch/wp-content/scala_refactoring_talk_screenshot.png" alt="" title="scala_refactoring_talk_screenshot" width="580"  class="alignnone size-full wp-image-157" /></a></p>
<p>And don&#8217;t forget to take a look at <a href="http://days2010.scala-lang.org/node/136">the other talks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/scala-refactoring-talk-at-scala-days-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Eclipse Plug-ins Written in Scala with Maven/Tycho</title>
		<link>http://misto.ch/eclipse-plugins-scala-maventycho/</link>
		<comments>http://misto.ch/eclipse-plugins-scala-maventycho/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:40:04 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=140</guid>
		<description><![CDATA[The Scala Refactoring project currently uses a rather crude hand-written ant build file; it compiles and runs tests. What it doesn&#8217;t do is creating a proper OSGi bundle, which I need if I want to do proper releases and integrate it into the Scala Eclipse IDE. Most of my colleagues are using PDE build, but [...]]]></description>
			<content:encoded><![CDATA[<p>The Scala Refactoring project currently uses a rather crude hand-written ant build file; it compiles and runs tests. What it doesn&#8217;t do is creating a proper OSGi bundle, which I need if I want to do proper releases and integrate it into the Scala Eclipse IDE. Most of my colleagues are using PDE build, but from what I&#8217;ve heard, <a href="http://www.eclipse.org/buckminster/">Buckminster</a> or <a href="http://tycho.sonatype.org/">Maven/Tycho</a> are the way to go.</p>
<p>Buchminster looks rather complex to me, so I went with Maven, even though I had no prior experience with it. Now, a few hours later, I have a <em>Hello World</em> plug-in written in Scala and a bunch of poms that build everything I want, even an update site! </p>
<p>Tycho needs Maven 3, which hasn&#8217;t been released yet, so I downloaded the latest <a href="http://maven.apache.org/download.html">alpha build</a> and created an alias that pointed to the mvn binary.</p>
<p>I started with <a href="http://mattiasholmqvist.se/2010/02/building-with-tycho-part-1-osgi-bundles/">Mattias Holmqvist&#8217;s Blog</a> where he explains how to create the initial Maven configuration and an OSGi bundle in Eclipse (I created a Hello World Plug-in Project). Now, we don&#8217;t want to have a Java plug-in but one written in Scala, so I added the Scala Nature to the project and re-wrote the two generated files in Scala.</p>
<p>To add Scala functionality to my pom, I followed the <a href="http://code.google.com/p/esmi/wiki/CreatingScalaMavenProjectsInEclipse">Eclipse Scala Maven Integration wiki</a>. I also had to add the Scala Eclipse Plug-in nightly build update site to my list of repositories so Maven could resolve the <em>scala.library</em> dependency the project has. </p>
<pre class="brush: xml;">    &lt;repository&gt;
       &lt;id&gt;scala eclipse nightly&lt;/id&gt;
       &lt;layout&gt;p2&lt;/layout&gt;
       &lt;url&gt;http://www.scala-lang.org/scala-eclipse-plugin-nightly&lt;/url&gt;
    &lt;/repository&gt;
</pre>
<p>Because I apparently didn&#8217;t follow Maven&#8217;s source layout, I had to explicitly specify the source directory via:
<pre class="brush: xml;">&lt;sourceDirectory&gt;${basedir}/src&lt;/sourceDirectory&gt;</pre>
<p>Adding the update site and feature projects was a peace of cake when following <a href="http://tycho.sonatype.org/how-to-create-a-new-osgi-bundle.html">this tutorial</a> (scroll to <em>Creating an Update Site / P2 repository</em>) from the Tycho project.</p>
<p>I&#8217;ve put the whole project on <a href="http://github.com/misto/Scala-Hello-World-Plug-in">GitHub</a> so you can try it yourself. And remember, this is my first day with Maven, so if I could make the poms even smaller or more idiomatic, please tell me. Or even better, just fork my code!</p>
<p>Next I&#8217;m going to find out how to run unit tests and how the integration in Hudson works, and then I can migrate the Scala Refactoring project and delete a build.xml file.</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/eclipse-plugins-scala-maventycho/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY Refactoring for Scala</title>
		<link>http://misto.ch/diy-refactoring-for-scala/</link>
		<comments>http://misto.ch/diy-refactoring-for-scala/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 15:52:16 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=133</guid>
		<description><![CDATA[Excuse my long absence from blogging, but I have a good excuse: I&#8217;ve been hard at work on my Scala Refactoring project.
Today, I&#8217;m going to show you how you can implement your very own automated refactoring for Scala. &#8220;Implement a refactoring you say? But I don&#8217;t use IDE xy!&#8221;. Don&#8217;t worry, you won&#8217;t have to [...]]]></description>
			<content:encoded><![CDATA[<p>Excuse my long absence from blogging, but I have a good excuse: I&#8217;ve been hard at work on my Scala Refactoring project.</p>
<p>Today, I&#8217;m going to show you how you can implement your very own automated refactoring for Scala. &#8220;Implement a refactoring you say? But I don&#8217;t use IDE xy!&#8221;. Don&#8217;t worry, you won&#8217;t have to use a specific IDE, in fact, you don&#8217;t need to use an IDE at all.</p>
<p>Why should you want to write a refactoring? IDEs usually provide a bunch of general refactorings and code generators, but maybe you need a framework or project specific one that no IDE will implement for you. And don&#8217;t worry, it is not as complicated as it might sound. (And I should add that when I write refactoring, this includes all program transformations that affect the source code, so you could also create a transformation that just creates new code.)</p>
<p>A refactoring is essentially a transformation of the program in its tree form. Unfortunately, our programs are stored in plain text files, so the transformed tree has to be converted back to text, and this without losing all our pretty formatting. One of the design goals of the Scala Refactoring library was to separate these two concerns as good as possible, so that the implementor (you!) of a refactoring can concentrate on transforming trees and let the library do all the ugly code generation for him. To make it easier for those who already know the Scala compiler&#8217;s abstract syntax tree, the refactorings are completely based on this AST instead of introducing a new program representation. I can&#8217;t introduce Scala&#8217;s AST in detail here, but there&#8217;s an <a href="http://scala.ifs.hsr.ch/doc/scalarefactoring-term.pdf">introduction in my term project&#8217;s technical report</a> which I also plan to expand in my master&#8217;s thesis (please give me feedback if you notice any errors).</p>
<p><strong>Please continue reading</strong> the rest <a href="http://scala.ifs.hsr.ch/wiki/DoItYourselfRefactoring#TheExample">of the post on my project wiki</a> (where the layout is much more suited for source code).</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/diy-refactoring-for-scala/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scala Refactoring Term Project Finished</title>
		<link>http://misto.ch/scala-refactoring-term-project-finished/</link>
		<comments>http://misto.ch/scala-refactoring-term-project-finished/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 14:58:49 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=112</guid>
		<description><![CDATA[Today, after 15 weeks of hard work, I was finally able to hand in my Refactoring for Scala term project (its website is scala.ifs.hsr.ch, where you can also find the technical report). After a short break of four weeks, I will continue the project as my master&#8217;s thesis. 
What has been achieved so far? After [...]]]></description>
			<content:encoded><![CDATA[<p>Today, after 15 weeks of hard work, I was finally able to hand in my <a href="/scala-refactoring-term-project/">Refactoring for Scala</a> term project (its website is <a href="http://scala.ifs.hsr.ch/">scala.ifs.hsr.ch</a>, where you can also find the <a href="http://scala.ifs.hsr.ch/doc/scalarefactoring-term.pdf">technical report</a>). After a short break of four weeks, I will continue the project as my master&#8217;s thesis. </p>
<p>What has been achieved so far? After investigating the Scala compiler (nothing is more fun than learning a new language by reading it compiler&#8217;s source code, trust me), I started to create with a foundation to build the refactorings on. Refactorings basically just transform an AST, which has to be converted back to plain text afterwards (which is far more complicated than it sounds, trust me). This occupied me for the larger part of the project, and it still isn&#8217;t finished, but I was able to come up with a scheme that allowed me to leave it in an unfinished state and still being able to perform refactorings, at least good enough for a proof-of-concept. </p>
<p>The implemented refactoring is Extract Method; a perfect candidate because it is not too simple (with regards to the code transformatioms) and it looks much more impressive than e.g. Rename. Is it already usable? I&#8217;m not sure, it has not been tested with a lot of real world code (and usually when I did, it didn&#8217;t take me long to find new bugs, or rather things that were not yet implemented), but that will certainly be done in the near future. Another hurdle to using it is that you would need to install my modified Eclipse Scala plug-in (and I haven&#8217;t yet been able to create a working nightly-build including the Eclipse plug-in and all my stuff that would be needed).</p>
<p>For the near future, i.e. before the thesis, the plan is to implement <em>organize imports</em>, so I can bribe Miles Sabin into including the refactoring library in the Eclipse Scala IDE. After that, I&#8217;ll continue the project with a 20 week full-time thesis (~800 hours of work), where I hope to stabilize the existing Extract Method, advance the library so it can be used by other developers without knowing the inner workings of it, and to provide many new refactorings!</p>
<p>In the mean time, I highly appreciate any feedback. And keep an eye on this blog or <a href="http://twitter.com/m_st">follow me on twitter</a> to hear the latest about the project. </p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/scala-refactoring-term-project-finished/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Extract Method for Scala</title>
		<link>http://misto.ch/extract-method-for-scala/</link>
		<comments>http://misto.ch/extract-method-for-scala/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 12:55:32 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=100</guid>
		<description><![CDATA[I haven&#8217;t blogged in quite a while now. Actually, the last entry was to announce my term project on Scala Refactoring. My excuse is, I was hard at work! So without further ado:
class Demo1 {
  def demo1(i: Int): Int = {
    val a = i
    val b = [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t blogged in quite a while now. Actually, the last entry was to announce my <a href="http://misto.ch/scala-refactoring-term-project/">term project</a> on Scala Refactoring. My excuse is, I was hard at work! So without further ado:</p>
<pre class="brush: scala;">class Demo1 {
  def demo1(i: Int): Int = {
    val a = i
    val b = a + i
    b
  }
}</pre>
<p>Select the line with the assignment to b, <del datetime="2009-12-20T12:55:39+00:00">murmur the incantation</del> press some keys, et voilà:</p>
<pre class="brush: scala;">class Demo1 {
  def newMethod(i: Int, a: Int): Int = {
    val b = a + i
    b
  }
  def demo1(i: Int): Int = {
    val a = i
    val b = newMethod(i, a)
    b
  }
}</pre>
<p>It also works with multiple return values and when passing functions. Now, the code isn&#8217;t ready yet, and I have to concentrate on writing my report right now, so it might take a couple more weeks until I can ship something.</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/extract-method-for-scala/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Scala Refactoring Term Project</title>
		<link>http://misto.ch/scala-refactoring-term-project/</link>
		<comments>http://misto.ch/scala-refactoring-term-project/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:58:09 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=71</guid>
		<description><![CDATA[If you&#8217;re a Java programmer and haven&#8217;t yet heard of Scala, take a look at this nice Scala Tutorial.
What follows is my project proposal for my master term project (12 ECTS, ~360 hours of work, the same as a bachelor thesis actually). The project starts next week and will keep my busy for the next [...]]]></description>
			<content:encoded><![CDATA[<p><em>If you&#8217;re a Java programmer and haven&#8217;t yet heard of Scala, take a look at this nice <a href="http://www.scala-lang.org/docu/files/ScalaTutorial.pdf">Scala Tutorial</a>.</em></p>
<p>What follows is my project proposal for my master term project (12 ECTS, ~360 hours of work, the same as a bachelor thesis actually). The project starts next week and will keep my busy for the next 14 weeks.</p>
<p>If Scala wants to succeed Java, it needs strong IDE support, and this includes  automated refactorings. Although <a href="http://dx.doi.org/10.1109/ICSE.2009.5070529">studies show</a> that refactoring tools are underused, they still serve as a strong selling point to convince programmers to use an IDE (or even a whole language) over a simple text editor. Several Scala IDEs are under development, but all of them lack extensive support for refactoring.</p>
<p>I&#8217;ve worked on various projects implementing (Ruby, C++) and supervising (JavaScript, Groovy) refactoring tools. Taking advantage of these experiences, I believe that a sound refactoring engine can be built for Scala in due time.</p>
<h3>Objectives</h3>
<p>Scala should get an IDE independent facility to perform refactorings. This API can then be used by all IDEs and other tools to refactor Scala code – fostering collaboration to get truly great refactoring capabilities instead of several half-baked implementations from competing IDEs (as the situation with other languages – e.g. Ruby – is today).</p>
<p>The basis to create a successful tool is the code manipulation strategy, i.e. how the source is modified, and most important, how the changed source is obtained (formatting, comments, white-space). In the past, we at the Institute for Software experimented with different strategies but have yet to come up with a silver bullet. Therefore, the first focus of this project will be to analyze existing ways and to come up with a suitable code representation for this project. Additionally, Scala&#8217;s functional aspects (especially pattern matching) should lend itself ideally to the manipulation of tree-like data-structures.</p>
<p>Finally, to make the implementation of refactorings easier, several granularities of abstractions will be needed. Basic building blocks to modify the source trees (e.g. &#8216;move x to y&#8217;, &#8216;rename x to y&#8217;, &#8216;create a new X at y&#8217;) can then be assembled to complete refactorings (&#8220;cursor position is x, rename all references to &#8216;y&#8217;&#8221;) and exposed together with – probably already existing – query-operations (&#8216;what can be renamed&#8217;, &#8216;what is located at the current cursor position&#8217;) and feedback (warnings, errors) through the API. The result of such a refactoring operation will be a set of diffs the IDE can then apply and show to the user.</p>
<h3>Vision</h3>
<p>To my knowledge there exists no language that has IDE independent refactoring support, and the only people creating new refactorings are the developers of the IDE. If this project succeeds, Scala will have a simple API to manipulate its source code on which refactorings and other code manipulation tools (e.g. quick fixes, code generators) can be built by Scala programmers and not only IDE adepts. </p>
<h3>Desired Results</h3>
<p>An API to do refactoring together with an implementation and ideally two  reference users in the form of automated tests and an Eclipse plug-in. Whether these goals are realistic will be determined during the project and adapted if necessary. A more detailed project plan will be developed in the first week of the project, as soon as the effort can be better estimated with regards to the available environment (e.g. the richness and suitability of the AST).</p>
<p>Now, what do <em>you</em> think? How important is automated refactoring support for you in choosing an IDE or a language?</p>
]]></content:encoded>
			<wfw:commentRss>http://misto.ch/scala-refactoring-term-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello again!</title>
		<link>http://misto.ch/hello-world/</link>
		<comments>http://misto.ch/hello-world/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 13:00:26 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://new.misto.ch/?p=1</guid>
		<description><![CDATA[Welcome to my new blog!
After almost 4 years of blogging at blog.misto.ch, I needed a change. The posting frequency constantly dropped and I&#8217;ve picked up twitter to post shorter messages, and most of the serious work I did ended up on InfoQ.
So, why even bother blogging anymore? Well, I&#8217;ll soon start my masters project and [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to my new blog!</p>
<p>After almost 4 years of blogging at <a href="http://blog.misto.ch">blog.misto.ch</a>, I needed a change. The posting frequency constantly dropped and I&#8217;ve picked up twitter to post shorter messages, and most of the serious work I did ended up on InfoQ.</p>
<p>So, why even bother blogging anymore? Well, I&#8217;ll soon start my masters project and I want to have a platform to communicate about it<sup>1</sup>. I also feel (or rather hope) that this might interest a broader audience, thus the switch over to english and &ndash; in the wake of all these changes &ndash; also a fresh design<sup>2</sup><sup>3</sup>.</p>
<p>And now, some rules for this blog:</p>
<ol>
<li>Comments are to be written in English or they&#8217;ll get deleted.</li>
<li>You may criticize my English (I&#8217;m all for improving my skills), but please only if you&#8217;re really sure and can back up your claim.</li>
<li><a href="http://misto.ch/feed/">Subscribe to the feed</a>!</li>
</ol>
<ol class="footnotes" style="margin-left:20px;"><li id="footnote_0_1" class="footnote">If you&#8217;re curious, and as you&#8217;ve probably already guessed, I&#8217;ll bring automated refactoring support to Scala! But more on that in the following days.</li><li id="footnote_1_1" class="footnote">That, as I just realized today, also matches the color scheme of our bathroom.</li><li id="footnote_2_1" class="footnote">Aren&#8217;t these footnotes pretty?</li></ol>]]></content:encoded>
			<wfw:commentRss>http://misto.ch/hello-world/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
