Live data from Hacker News

Is Scala Really the Next C++?

codecommit.com

21–27 of 27 posts

Re: Is Scala Really the Next C++?

#21
post #6

Earlier quoted context omitted.

I think you missed the point of the comparison. One of the reasons C++ took off was that it was deliberately compatible with C (the dominant language at the time), so you didn't have to discard your existing C code and could ramp up from your existing skills. Likewise, today the dominant language is Java, and Scala compiles down to Java bytecode and allows you to continue to use your existing Java libraries. To my kn…

Following the same argument, Clojure and Jython qualify just as well as Scala does.

javascript using rhino as well

Re: Is Scala Really the Next C++?

#22
post #10

Earlier quoted context omitted.

Erlang's fast? Compared to what? Scala is usually about as fast as Java. Not trolling. Genuinely curious.

Erlang is fast if you are using multicore processors because it scales [almost] linerly by performance by core number.

Do you have data, or are you arguing that it should scale?

An important lesson I've learned is that just because you've written a parallel program, doesn't mean you've written a good one.

Re: Is Scala Really the Next C++?

#23
post #6

Why wouldn't Erlang be the next C++? Erlang's fast, compiled, but still flexible and dynamically, strongly typed. It has a type inference engine so you can look over your code, and it's fairly easy to do IDE integration with Erlang. Erlang's distribution and multi-threading primitives are unbelievably well tested, and everyone could learn a thing or two from the OTP model. I can't imagine why we'd ever consider Scala…

I think you missed the point of the comparison. One of the reasons C++ took off was that it was deliberately compatible with C (the dominant language at the time), so you didn't have to discard your existing C code and could ramp up from your existing skills. Likewise, today the dominant language is Java, and Scala compiles down to Java bytecode and allows you to continue to use your existing Java libraries. To my kn…

Erlang can integrate with anything out there, because it deliberately discourages binary inclusion. Instead you make remote "ports" that act like servers or vendors of results.

It's a very weird approach, but it's surprisingly effective.

Re: Is Scala Really the Next C++?

#24
post #6

Earlier quoted context omitted.

I think you missed the point of the comparison. One of the reasons C++ took off was that it was deliberately compatible with C (the dominant language at the time), so you didn't have to discard your existing C code and could ramp up from your existing skills. Likewise, today the dominant language is Java, and Scala compiles down to Java bytecode and allows you to continue to use your existing Java libraries. To my kn…

Erlang can integrate with anything out there, because it deliberately discourages binary inclusion. Instead you make remote "ports" that act like servers or vendors of results. It's a very weird approach, but it's surprisingly effective.

Well can you give more info about these ports? Sounds like you want to do interprocess communication of some kind with the JVM?

1. How exactly would you setup the JVM? Will you need to wrap every Java class you want to use with some kind of communication mechanism? What about callbacks?

2. Can you subclass a Java class?

3. What is the overhead of calling Java methods from Erlang?

4. Has anyone demonstrated a bridge to a non-trivial Java library using a language not running on the JVM?

I feel interprocess communication might be ok for some apps but not all apps.

Re: Is Scala Really the Next C++?

#25

Earlier quoted context omitted.

Erlang can integrate with anything out there, because it deliberately discourages binary inclusion. Instead you make remote "ports" that act like servers or vendors of results. It's a very weird approach, but it's surprisingly effective.

Well can you give more info about these ports? Sounds like you want to do interprocess communication of some kind with the JVM? 1. How exactly would you setup the JVM? Will you need to wrap every Java class you want to use with some kind of communication mechanism? What about callbacks? 2. Can you subclass a Java class? 3. What is the overhead of calling Java methods from Erlang? 4. Has anyone demonstrated a bridge t…

1. Yes, you write a communication mechanism. You can either use an existing one (like Thrift) or use the Erlang binary protocol. Erlang expects you to be acting like an erlang message-based process, like an actor.

2. No. Erlang is not an OO langauge, although its concurrency model is the actor concurrency model, which sometimes feels like Smalltalk's object model.

3. The cost of communication. Having implemented a few systems that do this, I've found it to be fairly small, even using a slow glue layer like ruby. See https://github.com/KirinDave/fuzed/tree ... Powerset uses almost exactly this codebase to manage query analysis on its frontend before dispatching to our results retrieval layer. Thus far, it's been one of the most flexible and robust parts of our architecture.

I felt this way too, and it is the case in some very specific scenarios. But the truth of the matter is that Java itself is often the wrong tool in these cases, so it's somewhat of a red herring to say that.

4. http://erlang.org/documentation/doc-5.6.1/lib/jinterface-1.4...

Re: Is Scala Really the Next C++?

#26
I took a look at Scala about six months ago. It's quite a nice, full-featured language, and is a real contender for anyone forced to deploy to the JVM. However, it has a lot, and I do mean a whole hell of a lot of growing up to do before I'd actually use it for anything.

Its support for editors and tools was pretty horrible. The Eclipse plugin outright sucked (bundled compiler lagging behind the language release, syntax highlighting which came and went unpredictably, weird compilation errors which didn't matter --- and when I submitted a bug report ticket, the Scala team took four months to respond). I tried the Emacs mode, but it had such flaky indentation that I didn't know what it was doing half the time. If I absolutely had to use Scala, I'm sure I'd fix the Emacs mode, but it just wasn't worthwhile back then.

In addition, the language changes rapidly in ways which break existing code (I ran into an incompatible change in the Actors library, but don't remember the details any more). Granted, that's actually a good thing, because it means that the developers do not want to be stuck with bad design decisions from the past, but I'd like to be able to write production code, too. Since it seems that Scala's authors use it as a testbed for their research in languages, I have my doubts that it'll stabilize quite enough. (Counterarguments welcome!)

Re: Is Scala Really the Next C++?

#27
post #20

If C++ had just abandoned it’s C legacy, it would have been a much nicer language. A much nicer language no one would have used. It is Stroustrup's opinion that if C++ had not been backwards-compatiable with C, it never would have become popular. I agree. I also have difficulty with calling C++ a "failure."

Yep... c++ is a great language. Doesn't force one paradigm onto the programmer. Fast, portable and very efficient too. I heard the new F-35 jet fighter is using c++ over ada.
Post reply on HN