Differences between Akka Scala and Java [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am considering using Akka in one of my projects, but I have to use only Java. A majority of the material (books/articles) are on Scala version, so I am wondering if I use Java I would be a second-class citizen.
Are there any significant functional/performance differences between the two?
Thanks

In terms of performance of Akka itself it will be the same since you are going to be running the same Akka byte code. However in terms of integrating you will be using the Java API and be limited to the language features of Java. As such you will be a second-class citizen in terms of using the API. However in functional and performance terms it will be pretty much identical. Just keep in mind that your Java code will be interacting with the library differently from Scala code. With Scala you have access to closure and other constructs that you cant use with Java (yet). Nevertheless Akka is a great library also when used from Java....

I think the main web site page on Akka sums it all: 11 lines of Scala, 17 lines of Java (+50%).
No or negligible performance difference (bytecode, JVM,...). The performance issues will be around what you write on top of Akka.
Significant functional performance (not in terms of possibilities but code clarity... and clarity has a direct relationship to bugs and fixing them)

Between the two implementations, there are no differences in terms of performance and functionality. If your formation is Java then Akka can be a good solution to introduce the actor model in your Java projects. Clearly with Scala would have the advantages that the whole expressiveness of the language offers.

Related

scala vs java for Spark? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Can someone help me understand why people is using scala over Java for spark? I have been researching but haven't been able to find a solid answer, I know both works fine as they both run on JVM and I know scala us functional and OOP language.
Thanks
Spark was written in Scala. Spark also came out before Java 8 was available which made functional programming more cumbersome. Also, Scala is closer to Python while still running in a JVM. Data Scientists were the original target users for Spark. Data Scientists would traditionally have more of a background in Python, so Scala make more sense for them to use then go straight to Java
Here is direct quote from one of the guys who wrote initially wrote spark from a reddit AMA they did. The question was:
Q:
How important was it to create Spark in Scala? Would it have been feasible / realistic to write it in Java or was Scala fundamental to Spark?
A from Matei Zahara:
At the time we started, I really wanted a PL that supports a language-integrated interface (where people write functions inline, etc), because I thought that was the way people would want to program these applications after seeing research systems that had it (specifically Microsoft's DryadLINQ). However, I also wanted to be on the JVM in order to easily interact with the Hadoop filesystem and data formats for that. Scala was the only somewhat popular JVM language then that offered this kind of functional syntax and was also statically typed (letting us have some control over performance), so we chose that. Today there might be an argument to make the first version of the API in Java with Java 8, but we also benefitted from other aspects of Scala in Spark, like type inference, pattern matching, actor libraries, etc.
Edit
Heres the link incase folks were interested in more on what Matei had to say:
https://www.reddit.com/r/IAmA/comments/31bkue/im_matei_zaharia_creator_of_spark_and_cto_at/

Java .vs. C# Memory Usage and Performance [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am tasked with coding up an enterprise level eCommerce setup. I know PHP, C#, VB.NET, C++.
I have reviewed a variety of benchmarks in respect to speed performance online and obviously the results are as expected, C++ hands down, C# and Java close enough its immaterial and PHP a strong last place.
I have been learning Java, not too different from C/C++ after all.
I have viewed some memory usage benchmarks related to both C# (ASP.NET) and Java (operating system stuff aside).
However, everything I have located trends towards the more simple scaler variables and normal "any language" constructs. What I am interested in are memory and even speed performance benchmarks comparing complex objects. Cant seem find a thing that is not biased.
I am not interested in the "I like this better or that better", thats simple preference.
I am interested in more concrete data as throughput and memory usage equate to server load and sessions serviced.
Thanks in advance.
If you want to write fast and memory efficient code, then you should just write your code in this way. Software platform overhead is pretty low in Java and in .NET.
.NET JIT compiles code to native instructions, and most JAVA JIT's do the same thing.
I'm sure that benchmarks you reviewed is very synthetic - they just compare time of application cold-start(which is useless metric). Yes, software platforms that use JIT-compilation will lose there - because they need time to analyse and compile bytecode to native. In most situations, you can write applications with same or even better overall performance and memory usage than when using similar C++ code.
Just use language that you(and also your team!) like more.

What is the purpose of google guava libraries? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
They seem identical to java.util counterparts.
In a project I have to review these apis are used and an external jar is present for that.
But...in what they are different from java.util ones?
The Guava libraries, much like the Apache Commons libraries, are intended to complement the core java libraries, as outlined in the Philosophy Explained document:
Guava is a productivity multiplier for Java projects across the board: we aim to make
working in the Java language more pleasant and more productive. The JDK utilities, e.g.
the Collections API, have been widely adopted and have significantly simplified virtually
all Java code. We hope to continue in that tradition.
That article goes on to explain how they realise that you could implement the procedures they provide to fill the gaps in the core API yourself, but believe there are a number of advantages to using their code:
Guava has been battle-tested in production at Google.
Guava has staggering numbers of unit tests: as of July 2012, the guava-tests package
includes over 286,000 individual test cases. Most of these are automatically generated,
not written by hand, but Guava's test coverage is extremely thorough, especially for
com.google.common.collect.
Guava is under active development and has a strong, vocal, and involved user base.
The best libraries seem obvious in retrospect, but achieving this state is notoriously
challenging.

Are Custom Libraries Unprofessional? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm still in university at the moment, and I'll likely either try to get security or programming job. My first programming course used a custom library that came with the book. It replaced and added many of the basics of Java like Arrays, completely custom math functions, input (scanner), Hashmaps, Queues and Stacks.
If I did land a programming gig, is it considered unprofessional to use a given custom library such as the one above? Either way, I've pretty much weaned myself off of 75% of the custom classes in favor of standard Java classes/objects, but I wanted to know if slipping in a premade class from a textbook is frowned upon. Thanks guys.
"Custom library" is too broad a category to be useful. Libraries that reimplement functionality that's standard in the JRE, such as the Collections API, are almost certainly useless, and probably did more harm than help in an educational setting. However, there are a large number of tools, particularly Google Guava (enhanced collections like multisets and bimaps), the Apache Commons tools (including string parsing, hashCode building, and the like), slf4j/log4j for logging, and runtime environments such as Spring that are basically standard in the industry.
The general principle is "don't reinvent the wheel". If you have an example class out of a textbook that gets a basic job done that isn't in the standard API or one of the de facto standard third-party libraries, by all means use it, but don't prefer some professor's half-baked and untested implementation to ones that have been in use by thousands of developers for years.
Good programmers write good code, excellent programmers find excellent code.
If your library is any good I suspect it's more a case of everyone grabbing a copy.

Is there any reason to prefer functional programming for data mining projects? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am researching the possibility of starting a data mining project which will include intensive calculations and transformation on data, and should be relatively easy to scale.
In your experience, is the choice of programming language critical for said project?
For example, if I am already working on a JVM environment, should I prefer Clojure over plain Java? Does the functional environment guarantee easier scalability? Better performance?
Put aside other factors such as familiarity with the language, toolchain, etc. In your experience, is the choice of language a critical one?
There are a few good reasons for choosing functional programming for data mining projects.
Usually data mining projects
involve algorithmics and mathematics
(than other types of systems) which
can be more easily expressed in
functional programming
Data
mining projects would involve
aggregate functions - which are better in functional
programming, say Clojure
Data
mining programs also would be more
suitable to parallelism - definitely
data parallelism and could even be
task parallelism, again a forte of
functional programming
And
functional languages like Clojure
can interface with java anyway for I/O, file read and write
I
think one can learn the tool chain
easily; it is not that different and so that shouldn't be a factor.
I was asking the same question myself and came with a big Yes for Clojure - am still thinking through how to include R in the mix.
Use the most powerful language you are comfortable with.
In any case, if you want to get scalability you need to have a map-reduce implementation which allow you to parallellize and collect the results.
No particular reason. Pick whatever language you feel most comfortable with.
See my answer to a similar question about natural language processing. I think that some of the features people think obscure languages are suited to AI are really counterproductive.
Often, functional programming solutions are more scalable.

Categories

Resources