HNHacker News
TopNewBestAskShowJobs

premium-concern

155 karma · joined June 16, 2016

submissionscomments
premium-concern··on I Love Go; I Hate Go
It provides zero abstraction, which is especially painful when handling errors. In Go you basically _have_ to handle the error right when you receive it, there is no way of usefully combining or composing it. Also error handling itself is very verbose and can't be abstracted over.

In other languages you can compose errors just as regular values, which allows you to handle the errors at the place where you have all the information to deal with it.

Not only that, the types represent the structure of the computation you ran.

For example, your type is Future[Option[List[Person]]] and just by looking at the return types of the things you called, you can tell exactly _where_ an issue occurred and how to handle it:

Your value is a Success(None)? -> The method inside your asynchronous computation that returned Option[List] failed!

Just to note, Future[Option[List[Person]]] is not some made-up example, it could be a real-world query against the database–for instance "do we know the friends of user X"?

  - Future – we run it async
  - Option – we might not know it
  - List   – his friends
This let's us very neatly tell apart things like

  - Failure – "the database response from the database timed out" 
  - Success(None) – "we have no idea about user X' friends"
  - Success(Some(Nil)) – "X has no friends"
  - Success(Some(List(...))) – "here are X' friends"
(And the compiler will make sure that you handle all possibilities)

In Go the closest pattern would likely be to extract the string from the error value and compare it to error strings you recognize. An alternative would be to define a special single-purpose data type specially for each type including all combinators, as Go would not be able to express any commonality between Future[Option[List[Person]]] and Future[Option[List[Pet]]]. You would need to define 4 new data types and all operations anew.

premium-concern··on Lisp as an Alternative to Java (1999)
That's wrong. Feel free to present an example.
premium-concern··on Lisp as an Alternative to Java (1999)
Let's not oversell that.

There are maybe in total 2 compilers out there which are still usable (i. e. not 10 years out of date and unmaintained).

The specification is "open" in the sense that you can't build your own implementation of Java without accepting a proprietary licensing agreement with Oracle (assuming you even get one).

premium-concern··on A founder's perspective on 4 years with Haskell
I think this would help a lot. It would also help to check whether the code mentioned in an issue that triggers a crash is equivalent to the code you have.

Even if you can't publish your code, it might help to say "I'm seeing the same error, but I'm using X unlike the exmaple code that uses Y".

This will make sure that people who fix a bug will cover both causes with a test.

premium-concern··on A founder's perspective on 4 years with Haskell
> I get a few crashes per week related to known bugs

Interesting! Can you link to the issue?

premium-concern··on A founder's perspective on 4 years with Haskell
Do you have some examples for "type inference fails"?

Do you have some examples for "compiler bug"?

premium-concern··on Love for TypeScript
Which version of sbt-android do you use?
premium-concern··on Love for TypeScript
Thanks. I couldn't have said that any better!
premium-concern··on Love for TypeScript
> Not sure why you're bringing up Scala-Native again

Weren't talking about that?

> @tailrec has existed since 2.8

Yes?

> I was thinking (given your mention) that maybe Scala-Native had done away with the problem

It uses fastcc, and yes it does. I don't understand the issue.

premium-concern··on Love for TypeScript
Yes, because Scala-Native only exists for a month at this point in time.
premium-concern··on Love for TypeScript
> It's still sad it can't be relied upon per language spec. :/

There is a @tailrec annotation which ensures that a method was optimized. It probably needs to be updated to understand Scala-Native's new abilities, but the infrastructure is there!

premium-concern··on Love for TypeScript
> but when thinking of Scala I can't help but think "Well, it's not quite Haskell, is it?". (The poor type inference, the whole OOP thing, the lack of TCO means that any Monadic abstraction must be trampolined and that's just cruel.

Some good news:

- Better type inference at the place were it was sorely needed landed in 2.12 (use -Ypartial-unification to enable) or use it on 2.11 with a compiler plugin.

- Even if you are not a fan of OO (I'm not), I still love that I get a great module system for free. Haskell's module system is a completely mess.

- Scala-Native already supports all kinds of TCO, including mutually recursive ones.

premium-concern··on Love for TypeScript
That sounds weird. How did you build it? Can you paste the SBT error?
premium-concern··on Love for TypeScript
I recommend you try the JavaScript backend.

I'm so sick of people spewing JetBrains' marketing points without checking the substance of it.

premium-concern··on Love for TypeScript
Scala compiles to JavaScript, to the JVM, to Android, and (soon) to native. Give it a try!
premium-concern··on Java REST framework Dropwizard 1.0 released
Well, if you think the most important technical improvement to language design discovered since the creation of Java in 1995 is some shorter syntax, go ahead. I guess.

Despite some very loud people on the internet, it seems to have close to zero adoption, and JetBrains making big promises and then failing to deliver anything is not really helping them.

premium-concern··on A Peek into F# 4.1
Wrong parent? (_and_ wrong content, btw)
premium-concern··on A Peek into F# 4.1
>> > Specifically, don't introduce new syntax

> Hearing this in the context of Scala is hilarious[0].

I'm confused, I don't see any syntax in this link. Wrong link?

> You have to ensure that the build system, bytecode enhancer, AOP injectors all are able to cope with the new bytecode format.

If you use Scala you usually need none of them. Problem solved.

premium-concern··on Java REST framework Dropwizard 1.0 released
What's the "middle ground"? Java with a more concise syntax?
premium-concern··on Programming Language Rankings: June 2016
Huh? None of that will be in 2.12 except unification, and that's already planned for backporting to 2.11 (and you can just use the compiler plugin until then).

> I don't want to be stuck on an old version as the language moves forward.

How are you going to be stuck? You might need to stay on 2.11 a bit longer until Google gets their shit together. Most likely this will be during 2.12. Sure, you might miss the first few minor releases of 2.12 ... but stuck?

premium-concern··on Wire open-sourced
Why?
premium-concern··on Rust: The New LLVM
I think that's pretty much untrue.

That program is 0.x seconds on Scala-JVM and 0.0x seconds on Scala-Native.

premium-concern··on I Accidentally Some Machine Learning – My Story of a Month of Learning Elixir
I'm pretty sure that neither Go nor Elixir have anything to compete against Hotspot/Azul in the GC department.
premium-concern··on Programming Language Rankings: June 2016
Which ones?
premium-concern··on Programming Language Rankings: June 2016
> For Kotlin, all I need is to install the plugin on Android Studio and am off to the races.

What is preventing you from doing that with Scala?

I see that you filed a ticket that the setup of IntelliJ != Android Studio, but is there anything that works in one, but not the other? (Except having to skip the "install android support" from the install guide?)

premium-concern··on Programming Language Rankings: June 2016
There is no "dropping" except if you assume that Scala 2.11 will just disappear tomorrow.

I don't get the whole dooms day scenario.

- Google is working on Java 8 support.

- The current version of Scala supports the current Android stack.

- Depending on the timing, the next version of Scala might also support the then-current Android stack.

- You can always use Scala-for-Android (aka 2.11). Just think of it as a flavor like Scala-JVM, Scala.js or Scala-Native.

premium-concern··on Programming Language Rankings: June 2016
> Every time I think about using Scala and go through the list of configurations I need to do, I just give up.

It's pretty easy. You have to setup less things than with Gradle, because SBT deals with all the downloading, installing and managing of the two dozen SDKs Google wants you to use.

> I want a setup that embraces Gradle (even though we love to hate it), Android Studio GUI designers, plugins and annotations.

You can keep all you Gradle configuration. SBT-Android has a Gradle support mode so you can e. g. use the Gradle definitions for your IDE, but enjoy the fast turn-around and compile-times of compilation with SBT.

> Last time I mentioned this, someone pointed me to http://scala-on-android.taig.io/editor/android-studio/ which hasn't been updated in ages.

Yeah. The documentation is at scala-android.org. If you feel something is missing, I think the maintainers are happy to read your ticket.

> Using InteliJ with Android support means always being outdated as it is usually two versions behind from Google's fork.

The current IntelliJ is pretty much up-to-date with current Android Studio.

premium-concern··on The new TrueType interpreter in FreeType 2.7.0
"workstation" ... "OSX"

Yeah, sure! :-)

premium-concern··on Scala 3 (aka Dotty) type-safety not implied by the DOT calculus, after all
Getting a bit desperate, Cedric?
premium-concern··on The Epic Collapse of Deutsche Bank
No.
← PreviousPage 4 of 6Next →