HNHacker News
TopNewBestAskShowJobs

happy_dino

145 karma · joined February 10, 2013

submissionscomments
happy_dino··on Horses for courses: choosing Scala or Clojure
Judging from ...

> Actors also introduce some overhead in case you just want to read a single variable from a datastructure safely.

... I think the large part which you are missing is that in Scala, everything is a library, there are no “privileged” operations or data structures:

In Scala, you have a huge set of options available which can be used where appropriate. There was a talk by the creators of Akka recently, and the most important message of their talk was “pick your poison”.

It's not like in Go where people claim that channels and “goroutines” are the solution to every problem or how the Clojure community treats STM/Agents.

In a sense, this also shows the maturity of Scala's developers and ecosystem, because they don't claim that X or Y is the ultimate solution to everything.

- Scala has a full range of immutable & persistent as well as mutable & concurrent data structures available. In general, they are faster and more efficient than the ones in Clojure, due to the heavy tuning they received and the fact that you can pick the implementation which has the best performance characteristics for your use-case.

- The collection library supports data-parallel operations since 2.9, but I think it's great that Clojure tries to catch up!

- Additionally, Scala offers a standardized Future&Promises implementation, as well as support for async blocks (also a libraray feature) in the upcoming version.

- On top of that, you can use java.util.concurrent or any other Java-based concurrency package without any impedance mismatch, like Netty.

- If necessary, you can also drop down to things like Threads, Locks, Queues, synchronization, @volatile variables or sun.mis.Unsafe.

- Actors offer solutions for higher-level concerns of concurrency, like distributed computation, failure tolerance and communication over unreliable networks. (I think the best question whether you need Actors is: “Is there a chance that message X never reaches the receiver?” If the answer is no, there is pretty much no point in using actors.) (There are currently some improvements under-way to make sure that no state can be accidentally captured in Actors, Futures, etc.)

- In addition to that you also have things like the Akka Dataflow libraries, Rx-style approaches or functional reactive programming.

- You can also use the STM library (or agents, ...) if it is the best tool for the job (most concurrency people in Scala say that STM is conceptually a dead-end though).

I hope the explanation helps a bit!

happy_dino··on Horses for courses: choosing Scala or Clojure
> Static languages ensure type safety (which are uncovered in unit tests anyway)

Wrong.

> ... and to ensure this type safety, they need more information from you, the developer.

Wrong.

Anyway, correlation != causation. If I would claim that there are some projects which are successful, despite being untyped, I could pretty much use the same data points to make my claim.

happy_dino··on Horses for courses: choosing Scala or Clojure
I'm no Clojure expert, but listening to the Scala parts was like “Ok, I might disagree, but one can claim that ... WOW, that's factually wrong ... nod ... this is pretty misleading the way it is described ... ok, this sounds reasonable ... no, that's just wrong”.

Can a Clojure expert comment on whether the Clojure part is as wrong/inaccurate as the Scala part?

happy_dino··on An Introduction to the Go Language
At least I'm acting better than people who think they need to stalk my comment history before replying.

And, no, not all communities are behaving like Go fans do.

happy_dino··on iOS 7 As Defense
Wow, Apple fans ... they always have some ideas how to act even more embarrassing.
happy_dino··on An Introduction to the Go Language
I agree. These absurd claims are increasingly disturbing.

Seems like a lot of Go fans have lost touch with reality.

happy_dino··on Fair trial impossible in U.S., Snowden tells Ecuador
People like you make me really feel ashamed of the human race.
happy_dino··on Rated at position #34 (after Scratch) is Scala really important?
I want to offer a better metric: Scala is number 15 on GitHub.

Answering the question: Yes, it is.

- Scala is bringing the best combination of functional and OO programming to the masses.

- New languages out there are asked "how do you improve on Scala?", which is a huge change, considering that a few years ago Java was the main comparison target.

- Languages like Java or C# are adopting improvements from Scala, which shows that Scala seems to have done a lot things right.

The explanation of the bad rating on Tiobe is the search string being used by Tiobe:

Tiobe searches for phrases like "$LANG programming", but in Scala (and Haskell) the phrase "programming in $LANG" is much more common. Therefore, both languages suffer from a bad rating. People at Tiobe are aware of it, but it seems as if they don't plan to fix it.

Some other language communities started to modify their websites to cheat the index. For example, the Delphi community went through all their documentation and blog and modified existing texts to read "Delphi programming" and gained a few positions afterwards.

Further info: http://blog.timbunce.org/2009/05/17/tiobe-index-is-being-gam...

happy_dino··on On Scala
> Scala's main advantage over Haskell is being able to call into Java.

+ a superior module system + better type classes (no global namespace)

But yes, if running on the JVM is no option, Haskell is a serious contender

happy_dino··on On Scala
Syntax:

The author in the article is complaining about 18 different ways to define a function. Of those 18, the ones which use postfix operators create a feature warning already and will stop being accepted without the appropriate flag in the future.

If you eliminate the ones which use additional but pointless curly braces (Really, what's the point? Why not add 5 curly braces instead of 1?), you are pretty much left with either a named variation (n =>) and an anonymous variation (_). That seems pretty reasonable.

Features:

Compared to Java, Scala also removes a lot of stuff. Having read both language specs, I say Scala comes out as a winner, because the actual features it has are actually working and don't consist of tons of pointless cruft like in Java or C#.

Implicits:

Really, implicits seem to be a big deal for those people not using Scala. For actual users of Scala, they are not. I have never touched a codebase where implicit conversions posed such an issue as it is claimed in blogs. In practice, implicit conversions are pretty rare and mostly used for Java compatibility. The good thing is that you can get rid of the ones you don't like in Scala, which you cannot do in pretty much all other languages (where they are built into the language itself).

happy_dino··on On Scala
- [1] comes down to the idea of not having to build two separate concepts (namely, operators AND methods) with different syntax, different declaration styles, different parsing rules, ... into the language. Scala has only methods (which can have a “symbolic” name). The usual precedence rules are based on that name.

- case classes: I love them.

- _: The underscore has one meaning, “there is something, but I don't care about the name”. Super simple.

- forgetting = in a function def can make it mean something else: I agree, it is very error-prone. As far as I know, there are some proposals to get completely rid of procedure syntax.

- currying syntax: PinS has a pretty good explanation why it works that way. It is certainly not perfect, but less error-prone than alternatives.

- the imports (especially renaming): Many languages have this feature and I have not seen any issues with it.

- arbitrary rules on whether construction needs "new" or not: No. The rule is that you always need new to construct an instance.

-[3]: You can do crazy stuff in every language. Have a look at functional code written in Java.

- And it even has macros, but all of its very many language features aren't implemented as macros: No. In a sense, ALL features are implemented via macros, because the compiler API and the reflection API (macros) are pretty much the same underneath.

happy_dino··on On Scala
Could you expand on what exactly you feel is syntactically inconsistent?

Considering features: Well, it certainly depends where you come from. If you come from Scheme, Scala is huge. But if you come from Java or C# or F# or ..., Scala is refreshingly small, consistent and self-contained.

Regarding implicits: Most languages have implicits, they are just hard-coded into the language and will be there forever. In Scala, you can just de-import the ones you dislike and if enough people dislike those, they might even get deprecated and removed.

Implicits seem to be really the feature all people except actual Scala users love hating, especially exactly those kinds of implicits which aren't even widely used anyway. Implicit conversions make up maybe 10% of all usages of “implicit ” and require a feature import.

happy_dino··on On Scala
> Scala's crazy amount of syntax

Could you expand on that a bit?

happy_dino··on The JVM situation
I don't think C# is even remotely able to compete in this battle. :-)
happy_dino··on The JVM situation
What happens is that every single bit of functionality is split up and abstracted away, so that code duplication is kept at a minimum.

Considering that Scala ships with BOTH tons of collection types AND tons of useful operations, this seems to be a sane thing to do.

Scala manages ...

- to make both adding a new operation AND adding a new type not suck too much

- to retain the “best” collection type through operations, without duplicating code left and right

Most other languages fail already at point number one. No other language has managed to achieve point number two, let alone both.

happy_dino··on Scala.js - Write in Scala for the browser
You mean like http://scalagwt.github.io/samples/Showcase.html?
happy_dino··on Learn C
> a significant portion of Clojure core is built using macros

Well, pretty much all the Scala compiler is written using macros, because compiler API ~= macro API.

Homoiconicity is nice, but the lack of it doesn't make anything impossible. If there is anything which makes stuff impossible, it's the static type system, which can catch most of your macro errors at compile time. That's a pretty good thing in my book.

happy_dino··on Google’s Go has some coders raving
The search term you chose looks really favourable to Go, but closer inspection reveals that it doesn't contain a single Go job.

I think this is more accurate: http://www.indeed.com/jobtrends?q=scala%2C++golang

Golang: 8 Jobs

Scala: 1,434 Jobs

happy_dino··on Perl Cannot Be Parsed: A Formal Proof (2008)
> How do we define a language that's not parseable?

You can read up on that.

> Does it only mean that you can't know what the program will do until you run it?

No.

happy_dino··on Ask HN: What language do you recommend I learn?
Scala.
happy_dino··on Stop Using Linked Lists
http://docs.scala-lang.org/overviews/collections/performance...
happy_dino··on Extreme syntax
This is so stupid that I won't bother answering it.

You just can't imagine how incredibly ridiculous it appears to the non-US world to use “academic” as a slur.

happy_dino··on Dart Is Not the Language You Think It Is
Yes, but I think it's a more wide-spread issue. Comparing languages of the European school with languages of the Anglo-Saxon school, it seems like the wide-spread anti-intellectualism in the US has a large impact on language design quality.

I remember that Dijkstra had some pretty good article about it.

happy_dino··on Dart Is Not the Language You Think It Is
Your issue is not knowing JavaScript. No point to blame a JavaScript linter.
happy_dino··on Extreme syntax
The idea of saying “Here is some file and I can't tell you whether it is valid Perl without executing it.” is magnitudes worse than all the C++ macro preprocessor and template hell combined.

Something like that is pretty much the worst imaginable thing to happen in language design, especially because we know at least since Chomsky, Rice and Turing how to do better.

happy_dino··on Extreme syntax
Yes, absolutely.
happy_dino··on Why I chose to write Nuuton in Go
That's not an IDE. What's the value of static typing if you have you don't have any tools which make use of it to provide code analysis, completion and refactoring options?
happy_dino··on Why I chose to write Nuuton in Go
> The tooling is fantastic and there are a lot of other great ideas in it.

Which IDE would you recommend for it?

happy_dino··on Indie game Haunts unable to compile its Go code
That's just non-sense. The issues were caused by exactly that. Multiple people cloned the head at different times and things broke.
happy_dino··on Indie game Haunts unable to compile its Go code
> I might as well blame my text editor for allowing me to do stupid things.

The difference is whether the editor turns around and deletes /home as a punishment (Go community) or tries to educate the user about a better approach without acting like an asshole (pretty much all other language communities).

← PreviousPage 3 of 5Next →