The Scala IDE for Eclipse is centered around seamless integration with the Eclipse Java tools, providing many of the features Eclipse users have come to expect including,

http://www.assembla.com/wiki/show/scala-ide

 

Hdr-ad-button-2

Scala IDE for Eclipse is an open source project powered by Assembla

Assembla offers secure, commercial-quality Hosted SVN and GIT Repositories, Ticketing & Bug Tracking, and Wikis.

Host your community projects for free or try our subscription plans free for 30 days.

Navigate Pages

Version 19, last updated by Miles Sabin at Feb 22 11:52 UTC

The Scala IDE for Eclipse is centered around seamless integration with the Eclipse Java tools, providing many of the features Eclipse users have come to expect including,

  • Support for mixed Scala/Java projects and any combination of Scala/Java project dependencies. Type driven operations are transparent across Scala and Java files and projects, allowing straightforward references from Scala to Java and vice versa.
  • A Scala editor with syntax highlighting, inferred type and scaladoc hovers, hyperlinking to definitions, code completion, error and warning markers, indentation, brace matching.
  • Project and source navigation including Scala support in the Package explorer view with embedded outline, outline view, quick outline, open type, open type hierarchy.
  • Incremental compilation, application launching with integrated debugger, hyperlinking from stacktraces to Scala source, interactive console.
  • Support for Eclipse plugin and OSGi development including hyperlinking to Scala source from plugin.xml and manifest files.

The Scala IDE is released under a BSD-like license and community involvement in its development is strongly encouraged. See the Developer Documentation on how to take part.

The User Documentation is the starting point for the installation guide and other information regarding the use of the Scala IDE for Eclipse.

 
 

 
 

The Scala IDE for Eclipse is centered around seamless integration with the Eclipse Java tools, providing many of the features Eclipse users have come to expect including,

 
 
 
 
 
Posted in scala | 1 Comment

Scala IDE and Editor plugins

http://www.scala-lang.org/node/91

IDE and Editor plugins

 
Created by admin on 2008-07-04. Updated: 2010-05-07, 14:29

A number of contributors made available to the Scala community plugins and support files for many development tools and editors; this page offers information on the available support files. Please note that we do not manage the IDE plugins efforts; to receive support, please refer to the corresponding project page.

 

IDE Plugins

  • Scala IDE for Eclipse
    Featuring seamless integration with the EclipseJava tools, providing many of the features Eclipse users have come to expect, including: editor with syntax highlighting, inferred type and doc hovers, hyperlinking, code completion, error markers, brace matching, indentation; package explorer outline, outline view, quick outline, open type, open type hierarchy; build/run/debug, hyperlinking from stacktraces to Scala source, interactive console; mixed Scala/Java projects, Scala/Java project dependencies.

  • Scala Plugin for IntelliJ IDEA
    A plugin for the Scala programming language within the Jetbrains IntelliJIDEA development environment. This plugin provides: syntax highlightig, code completion, “Go to class” functionality, code formatting, code folding, XML support, multiple Scala SDK support, Java / Scala cross-language resolve, debugging, variable refactoring, structure view, “Surround with” functionality and auto-import functionality. The plugin is available for IntelliJ IDEA 8. Nightly builds are available for testing, but you probably want the stable versionsfor normal use.

    • Team: Ilya Sergey, Eugene Vigdorchik, Alexander Podkhalyuzin
       
  • Scala Plugin for NetBeans
    Full featured Scala editor providing syntax and semantic coloring, source file navigator, code folding, mark occurrences, go to declaration, instant rename, indentation, formating, pair matching, error annotations, code completion, and in addition: project management (build/run/debug project), debugger, interactive console, JUnit integration, Maven integration.

Tool Support

  • Many other plugins are available, in order to integrate Scala in your preferred development environment. Syntax highlighting plugins and utilities are available for the likes of Emacs, jEdit, Notepad-Plus, TextMate, SubEthaEdit, TextWrangler, and so on. These plugins were made available by a number of independent contributors to the Scala project.

    If you already downloaded the Scala distribution, you can use sbaz to install the relevant package as follows:

    sbaz install scala-tool-support

    Once that is done, you will find the support files under misc/scala-tool-support in your Scala distribution directory. Alternatively, you can obtain the files directly from our SVN repository as follows:

    svn export http://lampsvn.epfl.ch/svn-repos/scala\
    /scala-tool-support/trunk/src scala-tool-support

    This command will create a new directory with the most recent version of the available tool support files. You can also browse the relevant parts of the SVN repository here.

 

 
 

 

Copyright © 2011 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland

 

 

 

Posted in scala | Leave a comment

独家专访Scala IDE三剑客:探秘IDE插件开发(1)

独家专访Scala IDE三剑客:探秘IDE插件开发(1)

2009-11-20 13:25 阿菜 51CTO.com 我要评论(0) 字号:T | T
一键收藏,随时查看,分享好友!

Eclipse、NetBeans和IntelliJ是当前开发领域,尤其是Java开发方面最主流的三大IDE。最近随着Scala编程语言的崛起,对Scala IDE的关注与日俱增。为此51CTO编辑专访了Scala的三个IDE插件作者,一方面总结Scala插件的现状,另一方面也为大家展示IDE语言支持插件的一些开发内幕。

AD:

【51CTO独家特稿】Eclipse、NetBeans和IntelliJ是IDE领域的三大巨头,尤其是在Java开发方面。而Scala编程语言,则是一个基于Java平台的、比Java语言更好的新语言(参考阅读:Scala简介),这个语言在过去的几年间得到了越来越多的认可,并且有越来越多的项目开始接触、尝试并使用它(比如:Twitter,法国电力,西门子等等。详见Scala官方网站)。然而现在一个普遍的问题就是:Scala的IDE支持情况。

大部分Scala项目都是从Java项目开始的,而项目转型的成本和效率与是否有优秀的IDE支持紧密相关。Eclipse、NetBeans和IntelliJ这三大IDE的插件机制各自不同,因此在实现这一共同的功能上,都会有不同的思路,遇到不同的问题,最终带来不同的解决方法。

 

51CTO编辑近日通过网络途径对三个Scala IDE插件的开发者进行了采访,目的有以下两个:

1.总结Scala插件的现状BASE小组在今年8月曾组织过一次吹风会交流Scala插件的情况,此次访谈也是希望延伸那次会议的交流成果,跟踪Scala插件在之后这三个月的发展情况。

2.展示IDE语言支持插件的开发过程。相信很多开发者对于开发Eclipse、NetBeans和IntelliJ的插件很感兴趣,但也许不知道要从何入手,那么最好的方法就是从其他插件开发者的开发经验当中学习。语言支持插件是IDE插件当中最难的一种,因此从中能够获得的经验也是最多的。

概述

目前Scala插件的开发者情况如下(参考Scala官网的介绍):

Eclipse的Scala插件:Scala IDE for Eclipse

Eclipse Scala插件开发者Miles Sabin 这个插件最初由Sean McDirmid(Scala创始人Martin Odersky的学生)开发,现在由Miles Sabin来负责此项目。51CTO编辑联系到了Miles Sabin进行采访。Miles开展了一家专门做Scala相关咨询的公司,为客户提供Scala工具、Scala开发、培训和其他咨询的服务。

Miles Sabin的个人主页(即他公司的主页):http://www.chuusai.com/

NetBeans的Scala插件:Scala Plugin for NetBeans

NetBeans Scala插件开发者邓草原 这个插件由邓草原在其业余时间开发。邓草原,现加盟宏爵财经资讯(北京)有限公司。他是开源软件AIOTrade项目的主创者,同时也是NetBeans的Erlang插件的开发者,以及NetBeans梦之队成员。

邓草原的个人主页:http://blogtrader.net/dcaoyuan/

IntelliJ的Scala插件:Scala Plugin for IntelliJ IDEA

IntelliJ Scala开发者之一Ilya Sergey 这个插件由Jetbrains IntelliJIDEA的一个小团队进行开发,团队成员包括Ilya Sergey,Eugene Vigdorchik以及Alexander Podkhalyuzin。51CTO编辑对Ilya Sergey进行了采访。IntelliJ在几个星期前终于也加入了开源的行列,这将帮助它扩展更多的用户。

Ilya Sergey在信件中表示,希望使用IntelliJ的Scala插件的开发者都能仔细阅读这个wiki页面,这样可以减少很多有关插件安装和使用的问题。

访谈内容

此次访谈主要以电子邮件的形式进行,51CTO编辑向三位开发者发送了一组问卷。问卷包括六个问题:

1.您是如何开始进入Scala插件开发这项工作的?

2.进行IDE插件开发需要具备哪些知识?

3.能否介绍一下您计划让Scala插件提供哪些功能?现在都实现了么?

4.IDE插件开发的主要瓶颈在哪些方面?与其他插件开发者进行交流对您的进程是否有帮助?

5.您认为Scala插件现在已经足够成熟到投入实际的开发中去?开发者在使用中需要注意哪些问题?

6.您对于Scala 2.8的正式推出抱有怎样的期待?

希望三位开发者对这些问题的回答能够对您有所帮助。下面请进入正文部分——

 

 

内容导航

 

Posted in scala | Leave a comment

十二步学会Scala(1):从下载安装到定义方法

十二步学会Scala(1):从下载安装到定义方法

2009-09-28 09:55 alanwu JavaEye博客 我要评论(1) 字号:T | T
一键收藏,随时查看,分享好友!

本篇是一个Scala快速入门,旨在step by step帮助读者快速完成Scala的上手步骤。全文计划分为十二步骤,本文是前四个,介绍了从下载到定义方法的内容。

AD:

Scala教程现在网络上不算特别多,但也不少了。alanwu撰写本篇的目的在于提供一个Scala快速入门,这样大家可以先很快的上手,以后再慢慢熟悉这门语言。

原文地址:AlanWu的博客 | 51CTO编辑推荐:Scala编程语言专题

本Scala快速入门参考了《First Steps to Scala》的内容。下面开始:

我先大致根据这篇文章写一些自己的理解,让想学Scala的同学有个感性认识。

读者对象:有Java经验的工程师

第一步:下载和安装Scala

官网下载并接压缩,像安装ANT或MAVEN之类的那样,把解压后的bin路径加到path里面去就可以了。

在命令行模式下输入Scala

cmd 写道

  1. C:\Documents and Settings\19002850>scala  
  2. Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java 1.6.0_13)  
  3. .  
  4. Type in expressions to have them evaluated.  
  5. Type :help for more information.  
  6.  
  7. scala>  
  8.  

如果你看到scala提示符,那么恭喜你,说明Scala安装成功了。

第二步:学习使用Scala解释器(interpreter)

Scala也算是解释性语言,所以你可以直接与解释器交互。

cmd 写道

  1. scala> 1 + 3 
  2. res0: Int = 4 
  3.  
  4. scala>  
  5.  

直接输入 1 + 3 ,返回res0: Int = 4

res0表示变量名, Int表示类型, 4是值。

Scala的类型定义在冒号后面,和java放在前面不同,和UML类图的属性定义方式一样。

Scala是强类型语言,必须要定义类型,但Scala编译器足够聪明,他能够根据你的值帮你定义变量的类型。

这里res0是个变量名,所以你可以接下来再使用。

cmd 写道

  1. scala> res0 * 3 
  2. res1: Int = 12 
  3.  
  4. scala>  
  5.  

解释器又给了一个变量res1。

Scala的所有变量都是对象,所有操作都是方法。

所以*也是方法,你可以这样调用:

cmd 写道

  1. scala> res0.*(res1)  
  2. res2: Int = 48 
  3.  
  4. scala>  
  5.  

这个和java很不同,java的int不是对象。

是不是有点绕进去了,那么来个hello world宣告第二步结束。

cmd 写道

  1. scala> println(“Hello World!”)  
  2. Hello World!  
  3.  
  4. scala>  
  5.  

这个println是个方法,因为Scala有预定义导入一些类,所以可以直接使用。

因为Scala更新很快,每个版本的Scala的解释器可能都有一些不同,所以如果返回的变量名或有其他有一点不一样,请不要太奇怪。

第三步: 定义变量

写程序最入门就是定义变量和方法,前面的变量由Scala解释器自动定义了,这一步自己定义变量。

Scala有两种类型的变量,val 和var 。 val 变量的值只能初始化一次,再次赋值就发生错误,var就和java的变量相同,可以随时修改。

val 是函数式编程的风格,变量一旦赋值就不要再做修改,从程序上将有很多好处,但有时候做起来会比较绕。

cmd 写道

  1. scala> val msg = “Hello World!” 
  2. msg: java.lang.String = Hello World!  
  3.  
  4. scala> msg = “Hello JavaEye” 
  5. :5: error: reassignment to val  
  6. msg = “Hello JavaEye” 
  7. ^  
  8.  
  9. scala>  
  10.  

Scala是强类型语言,每个变量都需要类型。但如果你赋给变量的有足够明细的类型提示,那么编译器会帮你把类型加上去。

把刚才的msg打印出来

cmd 写道

  1. scala> println(msg)  
  2. Hello World!  
  3.  
  4. scala>  
  5.  

再来看看var ,比较好理解。

cmd 写道

  1. scala> var greeting: String = “Hello World!” 
  2. greeting: String = Hello World!  
  3.  
  4. scala> println(greeting)  
  5. Hello World!  
  6.  
  7. scala> greeting = “Hello World!” 
  8. greeting: String = Hello World!  
  9.  
  10. scala> println(greeting)  
  11. Hello World!  
  12.  
  13. scala>  
  14.  

记住,Scala有两种变量标识,和java不一样。

第四步: 定义一些方法

以前程序就是变量和方法组成吧,所以变量和方法是最基础的东西。

我们定义一个取最大值的方法max

cmd 写道

  1. scala> def max(x: Int, y: Int): Int = if(x < y) y else x  
  2. max: (Int,Int)Int  
  3.  

定义变量用val和var,定义方法用def 。

这个max方法有方法参数,返回值类型,方法体。麻雀虽小,五脏俱全了。

Scala的变量表示是变量名: 类型 ,这一点和java甚至其他语言都很不同,和UML风格比较接近。

调用方法很简单:

cmd 写道

  1. scala> max(3,8)  
  2. res9: Int = 8 
  3.  

Scala中方法也是一个类型,或者说是一个值,成为First Class。

所以可以把max看成是个变量名,(Int,Int)Int是它的类型。他可以作为参数传递,也可以赋值给其他变量。

cmd 写道

  1. scala> val m = max _  
  2. m: (Int, Int) => Int =  

将max赋值给m, 请注意max后面带的下划线,不要忘记写了。

调用m

cmd 写道

  1. scala> m(1,3)  
  2. res11: Int = 3 
  3.  
  4. scala>  
  5.  

在初学的时候就讲这个好像有点急进了,不太容易理解,不过没关系,先了解一下总比看到后莫名其妙好。

OK,本篇到此结束。本Scala快速入门系列计划通过十二步完成,现在进展到了第四步。后续内容敬请期待!

【编辑推荐】

  1. Scala讲座:面向对象和函数式的特点总结
  2. 万物皆对象:介绍Scala对象
  3. Scala的泛型:最强大的特性
  4. Scala的Trait:可以包含代码的接口
  5. Scala的模式匹配和条件类
Posted in scala | Leave a comment

Scala on Google App Engine

Scala on Google App Engine

 
Created by spoon on 2009-05-13. Updated: 2010-03-18, 22:11

By: Toby Reyelts, Alex Rudnick, Lex Spoon (Google)

Google App Engine

As has been reported already, Scala works on Google App Engine. Gabriele Renzi has even used Scala with the Google Eclipse Plugin, meaning he gets to use tools such as the “deploy to app engine” button. David Pollak has verified that most of the Lift framework works on App Engine, and he has posted a demo site to prove it. Overall, it looks like the scalac compiler produces jars that are so close to Java’s that App Engine just doesn’t notice or care. We can second that: it works for us, too! We would like to describe two sample projects we were involved in and how they went.

Sudoku solver

One of the sample projects we built is a Sudoku solver (code available here, live on App Engine here) by Alex Rudnick. Its front end is made in GWT (so there’s some Java code involved) and GWT RPC connects the client to the server. It grew out of an earlier Python version that Alex had written; part of the motivation was to try out translating from a more dynamic language to Scala. The transition turned out to be pretty straightforward — moving the test cases to Scala early on was a great help for a new Scala programmer, and scalatest was very pleasant and familiar to use.

This version of the solver uses Dancing Links, which is a clever way to do recursive search on a constraint-satisfaction problem without copying state on the stack like a naive recursive search might do — it makes a guess about a constraint and modifies the data structure in place, then undoes the guess when appropriate. The approach comes from a paper by Knuth.

Most of the programming on the solver itself was done in vim, and the test cases launched from a Makefile at first. Pretty primitive, but it got the job done. Mysteriously, though, once the Scala implementation of the solver was working, it was slower than the Python version (!!). This turned out to be a bottleneck where the solver was doing random access on nested linked lists. This was okay in Python, which has array-backed lists as the default. Switching from linked lists to nested arrays took the solver from slow to snappy.

Once there was a working solver, we packaged up the compiled Scala code in a jar and linked it into a GWT project, made in the Google Plugin for Eclipse. At first, the server-side was a servlet implemented in Java, which made calls to the packaged-up Scala code. In the next iteration, instead of having the solver in a separate project, we put the Scala code into the same source tree as the Java, and just extended GWT’s RemoteServiceServlet with a Scala class — no need to make a jar at all, just one bilingual project. In the end, it was a lot of fun to implement, and as soon as it worked at all, it uploaded to App Engine and ran cheerfully.

LotlRepls and the Scala interpreter

LotlRepls, by Toby Reyelts and James Robinson, includes read-eval-print loops — repls — for a number of languages. A language being in LotlRepls gives bragging rights to both the language and App Engine. It means that the language doesn’t just barely work, but that even sophisticated code such as an interpreter works on App Engine. Scala is included in LotlRepls. Getting it to work meant facing a few challenges along the way, however.

  1. Early versions of the Scala interpreter wrote generated class files out to disk, in a temporary directory. This approach has problems on App Engine, because App Engine apps cannot write to anywhere on the local disk. Instead, they must persist data through database APIs. Happily, more recent versions of the interpreter write to an in-memory virtual disk, so this problem is avoided.
  2. The Scala interpreter takes multiple seconds to start. This is an eternity for a web application, where response times should be on the order of 100 ms. To avoid this, LotlRepls creates a Scala interpreter the first time one is requested and then caches it. At each request, LotlRepls calls reset() on the interpreter instance so as to start from a clean slate. Calling reset() takes milliseconds rather than seconds, so this is a big savings.
  3. The Scala interpreter has no way to serialize the interpreter state for use in a future instance. The programming model on the App Engine is that each request comes to a possibly different servlet instance, so any persistent state must be saved to a database. Since interpreter sessions don’t persist, there is no way to maintain a session. Each new request to the servlet goes to a freshly reset interpreter session.

Conclusion

Overall, Scala works so smoothly on App Engine that there is little to add. The main issues you face, such as needing to persist everything to a database, are issues that are exactly the same as in Java or Python. If you like Scala, and you need scalable server-side support, give Google App Engine a try.

 
 

 

Copyright © 2011 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland

 

 

Posted in scala | 1 Comment

Java之外,选择Scala还是Groovy?

Java之外,选择Scala还是Groovy?

责任编辑:覃里作者:InfoQ 宋玮   2009-05-26   
 

文本Tag: Java

  【IT168评论】去年早些时候,一篇名为“Scala,Groovy的杀手? ”的博客对Scala和Groovy进行了对比:

  Scala和Groovy之间的核心区别在于前者是静态类型的。有些人可能争辩说这使得达到脚本化目标变得更加复杂了,而脚本化正是Groovy的动机。然而,Scala有完整的体系特征,这使Groovy看上去更像个玩具。比如,Scala有“sequence comprehensions”。该要素导致对算法的表述非常紧凑和强大。

  Scala还有更多被证明是非常有用的特性,如嵌套类,currying和代数类型模式匹配。它还支持类似于JDK1.5所增加的泛型和注解。这些还都只是冰山一角。

  之后,Derek Young撰文“Scala对比Groovy:静态类型是性能的关键”。在文中他举了一个实际的例子,试图说明针对同样的算法,Scala的性能远高于Groovy。

  然而,Scala并不是尽善尽美的,它也有一些明显的缺陷。Rick Hightower在最近发表的一篇博客中,尖锐地批评了Scala的语法问题:

  Scala并不是更好的选择。在阅读了Scala的文档之后,我的想法是:虽然这种语言的特性听起来挺好,但是语法却让我想放弃。为什么事情非要为了不同而不同?Scala让Groovy看起来比以前更加美味可口。

  憎恨是个很强烈的词。我恨Scala的语法。请不要再推进这种语法了。……Scala有好的思想吗?有。借用过来就行了……

  总而言之,Scala看起来像下一个被过度宣传的语言。只需要把其精华引入到Groovy中,然后扔掉那些糟糕的语法。我最喜欢的Scala特性是推理类型和强类型。C#3.0也有这些。(我不用C#,不见得我不喜欢它的一些特性。)

  Rick Hightower还建议Sun应该在Groovy上进行投资,而不是对JRuby作无谓的投资。

  Groovy更像Java,更容易上手,语法也让开发者不反感。为什么Sun在JRuby上投那么多钱呢?

  投资应该给Groovy。这样了解Java的开发者可以更快地学习Groovy,而且如果有工具支持他们,那么就更可能这样做。

  为了说明Sun投资在Ruby上的不明智,Rick Hightower还引用了一幅统计图表来说明企业采用Ruby的趋势还是比较低的:  

  图1

  另外,无论是Ruby、Scala还是Groovy都有对应的Web框架,且对应的框架都是用各自对应的语言编写的。这些框架分别是Rails、Lift和Grails。尽管Lift和Grails中的许多东西都从Rails借鉴来的,但是Grails对其他已有Java技术框架进行了很好的继承,这无疑会保护用户或厂商在这方面的已有投资。Grails框架参考文档中这样描述:

  Grails构建在这些概念之上,并且显著地减少了在Java平台上构建Web应用的复杂程度。不同的是,这些是建立在已确立的如Spring和Hibernate这样的Java技术之上的。

  目前,Scala和Groovy两种语言都在快速发展的过程中。就目前的情况来看,Groovy的优势在于易用性以及与Java无缝衔接,Scala的优势在于性能和一些高级特性,如果在发展过程中两者能互相借鉴对方的优点来充实自身,对开发者来讲无疑是福音。正如第一篇所引用的博客作者最后提到的那样:

  大家并不想看到一场殊死斗争,而是想看到更注重实效思想的Groovy团队能与更具有学术思想的Scala团队一起合作,制作出一门既强大又易用的语言。

  你会将赌注押在谁身上呢?

Posted in scala | Leave a comment

Java Data Mining Package

http://sourceforge.net/projects/jdmp/files/

 

  Ads by Google
Programming Competitions
Compete in public cloud development contests to win cash. Join now!
join.CloudSpokes.com
Posted in JDMP | Leave a comment