What's Kotlin's compatibility policy? - kotlin

Once Kotlin 1.0 is out, what will be the compatibility policy? As a user, I hope Kotlin would keep its compatibility, either in source or binary. Just as serious as Java.
On contrast, Scala is a bad example. Failing to keep its binary compatibility between minor versions drove me away. And I believe a lot of users have left Scala partly because of its compatibility issue. This caused many libraries (including SBT at my time) cannot provide a complete suite of distributions for the whole series of Scala versions. This is just binary compatibility issue. Imagine if source compatibility was broken.
I have decided to use Kotlin in my company's commercial project. So I really need to be sure Kotlin is serious about keeping compatibility, instead of pursuing beauty.

Kotlin isn't out yet (UPD: now it is). Changes to the language are to be expected (even changes that break code and binary compatibility).
With the Beta release the binary format was finalized, so we shouldn't expect changes there anymore (but they might still happen if bugs have to be fixed).
After 1.0 gets released the language and the binary format is supposed to be backwards compatible forever.
Source: http://blog.jetbrains.com/kotlin/2015/11/the-kotlin-language-1-0-beta-is-here/

Related

Can anyone motivate why Arrow (Kotlin) choose to deprecate higher-kinded types?

Digging into the codebase of Arrow I found this deprecation warning above higher-kinded types.
Higher Kinded types and their related type classes will no longer be
supported after Arrow 0.13.0. Most relevant APIs are now concrete over
the data types available as members or top level extension functions
Can anyone motivate this choice and the proposed alternatives? Or point me to some relevant documentation on this topic?
Raul Raja wrote this about it on the Arrow-channel in the Kotlin-slack:
For those wondering about the future of Higher Kinds in Arrow:
Kinds are going away because their encoding forces the user to call .fix() and there is no workaround for it without compiler plugins.
Once compiler plugins are properly supported perhaps after 1.5 then we will revisit kinds but instead of providing all this boilerplate we will provide a deeper and better integration than what we have now. Arrow Meta already has this support but it can’t be distributed to users until the Kotlin IDEA plugin supports compiler plugins. Kinds will be revisited then.
Since Arrow is currently marching close to the final encoding of 1.0, we can’t release a 1.0 where the entire lib and most of user code depends on Kinds in the current form and commit to maintain that for the long run.

Maven release bug fix versioning

I'm getting ready to deploy the first release of our software, version 1.0. Once it's out to our customer, inevitably, some bugs will be found. When I fix those bugs though, I'm not sure what "best practice" is for versioning it. When I release the fixes, would that be an entirely new version (in maven), such as 1.01 (or whatever the increment is, 1.1 for example)? Or would it still be 1.0 with some sort of classifier (maybe a date tag)?
Thanks,
Jeff
Wikipedia has a surprisingly thorough discussion of software versioning. It covers all the major points and discusses most of the approaches I've seen.
(In your specific case I'd go with 1.0.1 which would generally be regarded as "an update to 1.0 with no significant feature additions")
You have to change the number in order for maven clients to recognize a newer version in the repository. The change is up to you. I'm sure there's a best practice document somewhere but my company dictates the numbers we use so I've never looked for one.

Which IDE for Scala 2.8? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
This is the same question for older version of Scala, but they say that Eclipse plugin has been improved vastly. Is it the best IDE now? How do different Scala IDE compare today?
I've been pretty successful with IDEA 9. I've briefly tried both Netbeans and Eclipse and wasn't able to get what I wanted. Eclipse's code-complete didn't behave as well as I'd have liked, and I couldn't find a way to make Netbeans handle Scala scripts; It'd just complain that the file wasn't a class.
To be clear, I've been using IDEA for a few years for Java, so keep that in mind:)
For the moment, Scala Plugin in IntelliJ IDEA is the best. It handles Scala 2.8 well. IntelliJ IDEA Community Edition is now free and open source (and works with Scala), so I can't see any reason for not using it.
The plugin is still somewhat buggy (many "false negatives", i.e. the code without red underscores may not compile successfully; but almost no "false positives"), but perfectly usable. The best thing is that you can use IDEA's excellent debugger with Scala (not without some issues, but it actually works!).
FSC (Fast Scala Compiler) is also supported in latest builds. A huge time-saver.
The plugin development team is quite responsive. Some of the guys work directly in JetBrains and possess intimate knowledge about IDEA platform, so the development progresses fast.
JetBrains IDEA's Scala plug-in handles 2.7 and 2.8 equally well.
I cannot make any comparisons because I have used only IDEA.
Using Eclipse Helios with the dev-version of the new Scala(2.8) plugin, as there isn't an official release yet. That is beta, definitively -- but I can't confirm the frequently expressed opinion that this plugin is outright horrible ;-)
I'd say, the experience is already OK-ish, and indeed better than the current state of affairs with the Groovy plugin. OTOH, the experience with plain Java is way more smooth (feels like flying at times), and the current CDT I'd rate somewhat in between.
Incremental compile and error highlighting work quite well for me; tweaking a DSL implementation into form just by continuously rewriting your code until the error markers are gone -- without ever having to test-run your program -- is outright fun and just again shows that FP / static typing rocks!
Problems encountered from time to time:
- implicits and nested types in other compilation units (esp. nested / super packages) aren't picked up at times when there are still other errors around; they will be picked up after an full build
- there seems to be a memory leak in the version I'm using right now (from end august 2010), necessitating to restart the workbench after some hours of work
- beware when you're using AspectJ, to make sure you get a version of the Scala plugin which relies on a JDT weaving bundle version which also works with AJDT
PS: I'm using maven builds in all my projects and generated the eclipse projects with the eclipse-maven-plugin, and then imported them as plain-flat eclipse projects. I can just strongly recommend everyone to keep away from the M2-eclipse plugin (for maven) in its current (2010) state, it makes your workbench painfully slow, is buggy and has lots of almost unpredictable behaviour, because it constantly tries to do magic things behind the scenes (and besides that, the aspectj support is broken since this spring)
i use both eclipse and IDEA
eclipse supports type detection is
better than IDEA (it is very
neccessery thing if you want program
in functional style that you can be
aware from type of expressions and
variables.)
Edit1: IDEA supports type detection like eclipse but you have
to define a value in your functions
for example: def
testTs[A](a:List[String],b:List[A])
= for{
ai <- a
bi <- b
} yield (ai,bi) } should be converted to def
testTs[A](a:List[String],b:List[A]):List[(String,A)]={
val result = for{
ai <- a
bi <- b
} yield (ai,bi) } also instead of hover your mouse over variables you must press ctrl+q when your mouse is hover on that variable
eclipse have some problems in code
completion (when you use a variable
in next line and you want get a
property of this variable eclipse
show wrong code suggestions)
in IDEA ruining a scala application
is 5 sec slower than eclipse (there is some solution for bust IDEA run time but these have side effect have some problems)
in idea there is a well known problem with double click speed that show itself in many cases like opening a file or selecting an string in source... you can increase double click time out by creating (or editing) /home/.Xresources and add this line: *.multiClickTime: 400
Edit1: in summery i prefer to use IDEA rather than eclipse
My experiences clearly point to IntelliJ IDEA:
About six months ago, when I started a serious Scala (multi module) project, I had to abandon Eclipse as my favorite Java IDE and switched to IntelliJ (9.0.x). Eclipse Scala IDE was way to buggy and often stopped responding at some point, even for the most simple projects. For CI (Hudson) and command line build, I depend on Maven (with Scala plugin). The Maven dependencies (incl. Scala libs) are picked up nicely by IntelliJ.
A few days back I updated to IDEA X (CE) with the current plugin (nightly build) and work became even smoother. Although fsc still terminates after a while when inactive.
From what I see, I'd like to add, that there seems to be way more activity on the IntelliJ side to respond to bugs and improve the plugin continuously. Correct me when I'm wrong, but Eclipse Scala IDE development seems almost stalled. Still no 'official' Helios release!
NB: Just to provide some context (not bragging, really): The aforementioned project consists of about 25 Scala modules (POMs), 5 Java modules, 325 Scala files with a total of about 360 Scala classes, case classes and traits (> 19 kLOC, including comments). My platform is OS X 10.6, Scala 2.8.1, Java 1.6.
UPDATE: After having the need for pretty extensive refactorings (mainly move class, rename package), I discovered that the recent IDEA 10.0.1 plugin 0.4.413 (and probably older versions, too) has quite some problems getting stuff right. I don't want to explain the specifics, but I (almost ever) ended up manually fixing unresolved references or otherwise messed-up code. You can have a look at http://youtrack.jetbrains.net to get an idea.
For everyone who is really considering doing some serious development with Scala, I strongly recommend to evaluate the IDEs in question beyond the basics. When you are into an agile approach, which in my option requires a painless refactoring support without surprises (especially in multi-module projects), things are pretty tight at the moment.
It would be pretty neat, if someone came up with a IDE independent specification-like list of refactorings (and desired outcomes), which could be used to verify an IDE's refactoring support.
A non-answer: None.
Based on what a perceived majority says, IDEA is probably the best Scala IDE today. And it (read: the Scala plugin) sucks. It does not handle fsc well, type inference is a mess, many errors are not shown, a number of non-errors are marked as errors, it is slow (when inspections are turned on), the test runner silently swallows aborting (!= failing) tests, ...
So I switched to a simple text editor with syntax highlighting on one and a maximized shell with SBT (simple build tool) on the other screen. Awesome! SBT is responsive (you can let file changes trigger recompilation of affected code and even reruns of tests), manages dependencies very smoothly and has helpful output (esp for tests; using ScalaTest). SBT increased my productivity compared to IDEA a lot.
You lose code completion, of course, altough geany offers me identified symbols. But as long as IDEs don't get type inference to work properly code completion does not help, anyway.
Some people care a lot about code refactoring. Well, the IDEs apparently don't make a good job there either. Even if they would, I'd rather only open them for this particular task than use them all the time.
I think that the best option so far is the ScalaIDE for Eclipse. You can go to the ScalaIDE Web Site and look around to see by yourself.
http://scala-ide.org/
Strong points I see about it are:
documentation,
tutorials,
constant releases,
support from Typesafe.
Here below a summary of the main features:
Scala IDE provides support for development of Scala applications in the Eclipse platform. Its main target is the support for the Scala language and the integration with the Eclipse Java tools. It provides 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, 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 stack traces to Scala source, interactive console.
Support for Eclipse plug-in and OSGi development including hyperlinking to Scala source from plugin.xml and manifest files.
UPDATE: the features and advantages are mentioned on this answer are for version 2.9 and 2.10 of Scala, because it has been already discontinued. see here:
"The 2.0.1 release is only available for Scala 2.9, if you would like to use the Scala IDE with Scala 2.8, please install the 2.0.0 release (support for Scala 2.8 has been discontinued after the 2.0.0 version)"
The officially endorsed and supported (by Typesafe) for Scala 2.9 is Eclipse. The current version is far superior to prior versions and includes a context-aware REPL, full-featured debugger, and even the ability to debug REPL statements. I think this question needs to be updated and the answers revisited.
I don't recommend the Scala IDE/Eclipse. It doesn't have a lot of the features that are even available for Eclipse with Java. And there are bugs.
I am using the latest NetBeans and haven't tried anything else. I've met at least 2 notable bugs in NetBeans while coding in Scala:
One: NB occasionally come unable to run a program, hanging on classpath scanning.
Solution: Create a new project, copy your code there and go on.
Comment: This bug is more than 10 years old.
Two: Sometimes NB can't see members of particular namespaces or classes and complains when you use them.
Solution: Just ignore and go on - compiler founds no errors and the program works.
I'd recommend IDEA's plugin for now.
The Scala plugin for NetBeans is quite nice too. It doesn't yet support NetBeans 6.9, the newest release, though, and you still need to download it manually instead of installing it directly from the plugin manager inside NetBeans.
However, it integrates better with Maven projects than IDEA's plugin does (this is true for NB and IDEA in general, in my opinion).
It partly depends on your style of working, as all the options have strengths and weaknesses.
If you need refactoring across mixed java/scala projects, then IntelliJ is your only option.
If you want to do any work on the compiler or a compiler plugin, then Eclipse has the advantage of being able to launch a runtime workspace with a custom compiler build, including breakpoints. It also improved massively for the 2.8 Scala release.
Netbeans is a fine choice to go with if you're already very familiar with that platform, the costs of learning a new environment may well outweigh any benefits, and all three solutions are improving rapidly.
I haven't tried netbeans scala plugin yet, but I find that Intellij IDEA plugin is at any way much better a scala ide than the Scala eclipse plugin, which is sooooo slow that drives me crazy.
Though swing applications don't work well with my tiling window manager.
try IDEAX the latest community edition of Intellij IDEA (version 10), it has improved scala plugin which has faster code compilation and exceution in addition to that it has
Maven3 and SBT support with which we can develop Lift applications.
IntelliJ IDEA community edition + Scala Plugin + SBT plugin
For recent versions (2021) the question which ide takes a big portion of the home page https://scala-lang.org/

What are the good Scala IDEs at the start of 2010?

I know this is an exact duplicate, but a year has gone by and Scala seems to be a fast moving thing, so I figure it might be acceptable to ask again:
What is the best IDE for Scala development right now?
I know the Eclipse plugin is a work in progress and undergoing a complete re-write for Scala 2.8 but I saw a colleague use a nightly-build recently and it was extremely poor.
I use IntelliJ IDEA (the Community Edition 9 is free) and the scala plugin for it is really good. Excellent syntax highlighting, code navigation etc. It's not as good as the Java support but then I wouldn't necessarily expect that. It's good enough that I feel I'm more productive than I would have been in Java!
It has Specs integration and console integration as well.
I tried both Eclipse, NetBeans and IntelliJ IDEA,
Eclipse is the worst in my opinion. It is slow, sometimes messes up the syntax highlighting, almost always messes up the autocompletion and the whole IDE gets unresponsive from time to time. I would not recommend it for any kind of use except for self torturing.
NetBeans works better than the Eclipse plugin. Better highlighting, much better autocompletion but it has been reporting errors on a fairly complex syntax all over the source. But when i hit run, the code compiles just well. Could not understand why. Another issue is that autocomplete can not suggest private members of classes when you are writing inside the body of that class. Poor!
IntelliJ IDEA works just fine. I recommend that if you are seriously leaning against Scala development.
I hope that the Eclipse plugin will be more mature in time but given that it had plenty of time to become mature, I'm not a big fan of the idea. Scala has a great potential, being a well thought, programmer friendly language and running on JVM (which means great performance and high availability) but the poor IDE support is the worst thing for such language. Writing PHP on a simple text editor is acceptable but Scala, with such complex syntax and requirement to use the bloated Java libraries, there is a need of assistance. Maybe the current Scala community with functinal and Java background can not understand this but you can not expect newcomers to easily adopt to such a language instantly.
Anyway, go for IntelliJ IDEA...
Your main options are a fully fledged IDE like IntelliJ IDEA, NetBeans or Eclipse, or a text editor with some Scala awareness like TextMate or Emacs.
Personally, I like IntelliJ the best. I've been using it for Java development for many years, especially due to its refactoring and code navigation power. The Scala plugin was quite rough to start with, but is improving constantly. It's open source, I've been contributing bug reports and a few bug fixes.
The IDE plugins have all been working hard to be ready for Scala 2.8. It's been a moving target during the last 6 months, especially given that binary compatibility was broken as new features were added. So you might update to a new build of the compiler and then wait for supporting libraries (e.g. specs, scalatest) to be updated and recompiled.
Now that the Scala 2.8 Beta is imminent these problems are less frequent.
IntelliJ implements its own parser and type inference, as it does for Java. This lets it be more tolerant of errors and to immediately understand your code as you are editing. The type inference is not complete yet. Eclipse delegates most of this work to scalac, which means it they should always agree, but the information is only regenerated when you save files and the compiler is re-run. I don't know how NetBeans works in this regard.
Right now, IntelliJ's IDEA. And one big difference from now to a year ago is that a free, open source version of IDEA is available.
Personally, I use IDEA CE 9.0.1, but leave compilation&testing to SBT, which I keep running on another window, with cc or ~test.
In the context of 2.8, I have used Eclipse 3.5.x with the nightly plug-in and IDEA Community Edition 9.0. IDEA has been clearly better for me, except for compilation times. But I use sbt in parallel and it takes care of that.
My main issues with the Eclipse plug-in are:
Inability to change my tab settings in Eclipse (though that seems to work for others)
Code compiles but some errors are still highlighted and I need to close and reopen the file
Auto-completion just returns a lot of choices
I did not have those issues in IDEA 9.0 build #IC-93.13 with the recent plug-in 0.3.385. Additionally IDEA shows me unused import statements.
All plug-ins seem to be evolving quite quickly and are actively developed and I suspect that what is true today may not be in one month. I hope that in a few months from now, we will just be able to use our favorite IDE and have good Scala support.
(note this is a repost of my recent answer to the original question)

Benchmarks of code generated by different g++ versions

I work on a runtime system for an application domain that is very performance sensitive. We go to a lot of effort to maintain backward compatibility with older compiler versions, including avoiding more recently-implemented language constructs, and synthesizing them for the older versions.
However, I'm concerned that this effort does a disservice to our users, by enabling them to continue to use compiler releases that are costing them huge amounts of performance. Unfortunately, I haven't been able to find any real comparison of execution performance across releases. If anyone has links to reports on this issue, please post them.
I'd really like to see benchmarks that cover a wide span of releases (if you can get back to 3.2, that's amazing) and applications/tests
A bit old, but still shows how much GCC have progressed: This benchmark shows that GCC 4.4 with it's new register allocator (IRA) and the focus on optimization made it become almost as powerful as ICC (Which is considered to be he most aggressive optimizer available).
I highly recommend using GCC 4.4[.1].
If you are on Windows, and using MinGW 3.4.x, you should upgrade NOW, since that specific port is rather buggy and generates horrible code.