Tag Info

Hot answers tagged

69

I assume you read the same Slashdot article I did (with linked slides). The short answer is that Scala already does everything that Ceylon is supposed to do except Focus on ease of learning Syntactic sugar for sequences Syntactic sugar for strings It also does things that Ceylon does not (yet): Implicit conversions Trivially easy closure declarations ...


48

Major Differences: Both Scala and F# combine OO-imperative programming and functional programming into one language. Their approach towards unification of paradigms is vastly different though. Scala tries to fuse the two paradigms into one (we call it object-functional paradigm), whereas F# provides the two paradigms side by side. For example, algebraic ...


33

This has nothing to do with functional programming - you can find this kind of situation in context of any other programming language - developers who love the advanced constructs of "their" language so much that they ignore any common sense about readability and keeping things simple. I have encountered such a situation in C, C++, Perl, Java, C#, Basic, and ...


31

As I read through the Ceylon presentations yesterday, I was astounded by how much Scala is already providing a solution for those issues which Ceylon claims to be addressing (with respect to shortcomings of Java). In fact, I'd say that pretty much 95% of what Ceylon appears to be trying to accomplish, can already be done with Scala. (The obvious exception ...


29

The question is confusing, as C and C++ are languages, while JVM is a virtual machine and .Net is a platform. Scala could be implemented in C or C++, and it could generate machine code instead of bytecode for a virtual machine. Answering the question that was asked: Scala was not implemented in C or C++ because Scala, the language in which it is actually ...


28

Memory management is utterly relevant since it governs how fast something appears even if that something has a great deal of memory. The best and most canonical example are AAA-title games like Call of Duty or Bioshock. These are effectively real-time applications that require massive amounts of control in terms of optimization and usage. It's not the usage ...


27

There's one thing that you can do concisely and efficiently in Java that you can't in Scala: enumerations. For everything else, even for constructs that are slow in Scala's library, you can get efficient versions working in Scala. So, for the most part, you don't need to add Java to your code. Even for code that uses enumeration in Java, there's often a ...


25

IMHO from somebody programming in Java for the last 7 years and being my strongest language, I find Scala quite alien and am having a hard time getting used to it. Xtend feels more like Java and was able to write a simple application with it much quicker. Granted I didn't give myself enough time with Scala, but I certainly understand why some may be turned ...


24

The real brick was the memory allocation - at worst, Java allocated a whopping 52x more memory than C, and 25x more than C++. Do you understand the numbers you base your question upon? How much memory was allocated? What were the programs doing? When there's a big disparity between those Java and C programs, it's mostly the default JVM memory ...


23

All programming is related to mathematics. Indeed many universities still place their computer science programs under the purview of the mathematics department. As for learning functional programming, you do not need to have a strong base in mathematics to learn it. I've learnt three different functional languages now to reasonable proficiency (Haskell, ...


21

I can advise Programming in Scala because it's from the creator of the Scala language: Martin Odersky. He describes most of the features of Scala very detailedly and explains, why he chose this feature instead of an other one. Therefore, the reader gets a deep insight into Scala. The book is fantastic. It is one of the best programming books I've ever ...


21

What Odersky says is (Slide 11, http://www.slideshare.net/rawwell/scalaliftoff2009pdf): "Scala is deep where other languages are broad." This means, scalable is meant in terms of flexibility and expressiveness. You can create your own control structures. E.g. the actors frameworks is a library, but it looks like it uses language features. This means ...


21

There is an easy, but boilerplate heavy way to seal classes in Java. You put a private constructor in the base class then make subclasses inner classes of it. public abstract class List<A> { // private constructor is uncallable by any sublclasses except inner classes private List() { } public static final class Nil<A> extends ...


21

In Scala, the * is a valid identifier. One could write: val * = "trollin'" println(*) With the result being: trollin' One could write a class named * as such: class * { def test():String = { "trollin'" } } So with that being the case, when I have a class * in the package us.hexcoder and I write: import us.hexcoder.* You would be saying ...


20

I haven't read anything about Ceylon yet, so let me comment on your check points. Scala does better: Type inference via the "local" keyword Scala's very syntax was designed to make type annotations optional everywhere; it does require type annotations on method parameters and return value of recursive methods or methods that use return to break ...


20

According to the Benchmarks Game for a single core, 32 bit system, Scala is at a median 80% as fast as Java. The performance is approximately the same for a Quad Core x64 computer. Even memory usage and code density are very similar in most cases. I would say based on these (rather unscientific) analyses that you are correct in asserting that Scala adds some ...


20

Now, I don't know much about Clojure and little about Scala, but I'll give it a shot. First off, we need to differentiate between tail-CALLs and tail-RECURSION. Tail recursion is indeed rather easy to transform into a loop. With tail calls, it's much harder to impossible in the general case. You need to know what is being called, but with polymorphism ...


19

REPL - I was using scala at work for a long time before I really started to use the REPL regularly. It can be useful for checking little things (like: how will a very large BigDecimal format itself using toString?) But I've started using it much, much more since I started using scalaz and functional-programming, because it allows for quick playing around ...


19

While it is true that Scala has been used in the wild at the Guardian and at Twitter, there is one fundamental concern. Much of Java's popularity comes from the fact that it is relatively easy to read and maintain. Scala has an problem here as it can be written in many different styles. OO style vs functional style is the obvious split here, but it gets ...


19

Disclaimer: I'm not a Scala guru. Scala does two things extremely well which Java (currently) does not. Solve functional problems At the most basic level, Scala has fully fledged closures with collections support. This means you no longer have to write boiler plate code such as (shamelessly ripped off a DZone post) public List<Item> bought(User ...


19

There is a number of problems rooted deep in JVM which makes it literally impossible to implement high level languages efficiently. The mostly cited issue is the lack of explicit tail call annotations. Another notorious problem is a lack of explicitly stack allocated structures (value types in .NET). JVM method size limit is also an unfortunate factor for ...


18

Well, I think Scala is too complex. It feels like C++ in that it has a myriad of different ways of doing things. Some would call this "richness", "expressiveness" or "power", but your mileage may vary. In many real world projects you would have to artificially limit what language features you're going to use and what not, so that all developers involved ...


18

Short Answer: There is a simple solution to your problem. Just install the virtual-machine with Linux (Ubuntu) - it is free. I am also a mainly .NET developer who loves to experiment different things, or try variety of frameworks and/or development tools. The main thing here is not to mess your main development environment. Thus, installing everything in a ...


18

Here are a few reasons, which might be more or less compelling for you, depending on your own preferences: Do not simply discount it for being "syntactic sugar". While you may say that something is just syntactic sugar, it is after all the sugar that sweetens your life - as a programmer just as well as a coffee or tea drinker. Singletons - every Scala ...


17

One of the big hurdles languages face when being introduced to the world at large is library availability. The traditional response to this has been to provide a C-based FFI (foreign function interface) to permit you access to C-based libraries. This is not ideal for a variety of reasons, chief among them: There's a lot of different ways that libraries ...


17

According the Great Benchmarks Game, ATS is faster than the rest with Haskell, Scala, and one of the variants of Common Lisp in a rough tie for speed close behind that. After that Ocaml and F# are in roughly the same speed category with Racket and Clojure lagging behind... However, almost none of this means anything at all really. It's all a question of ...


17

So from a neutral point of view, which syntax is simpler and readable? Those are two very different questions. Simpler means "composed of fewer parts". Clojure's syntax has fewer rules, ergo it is objectively simpler than Scala's. Readability, however, is subjective. It mainly comes down to familiarity. For example, I find ECMAScript, C#, Java, D, Go, ...


16

I've been programming Scala for more than one year now, so I'll try to set myself back a year to answer this question. Scala code is more concise than Java code (no setter or getter, a lot of the type information can be inferred) The built-in support for XML literal is very appealing. Java library compatibility and interoperability is great The support ...


16

I don't think Groovy is going to disappear, it is a self sustained entity now. Grails framework is built around Groovy language, which it is a good reason to stay alive. Groovy got its killer application. I'm not saying Grails is the only vital Groovy project, Gradle is also pretty good. GORM is really handy. Gant is a nice improvement over Ant. Not ...


16

What you are really asking about here is how to do Polymorphism in functional languages, i.e. how to create functions that behave differently based on their arguments. Note the first argument to a function is typically equivalent to the "object" in OOP, but in functional languages you usually want to separate functions from data, so the "object" is likely ...



Only top voted, non community-wiki answers of a minimum length are eligible