Recent submissions

Comment · 1 year ago
Comment · 9 years ago
I looked into Vue + Webpack vs Vue + Brunch on my last project. I ended up with Brunch because the requirements are fairly basic and Brunch are easier to grok. Had the requirements be a little bit more complex, I could have easily gone for Webpack.

IMO, there are a few key things lacking with the Vue + Brunch combo:

- The `vue-brunch` plugin seems to be no longer in active development? (https://github.com/theocodes/vue-brunch)

- The `sass-loader` plugin allows me to use Sass dialect in SFC-style Vue (Single File Component). I'm using plain CSS with Vue + Brunch SFC as I cannot find a Brunch plugin offering similar functionality.

- There are some Brunch idiosyncracies. For one, the processing pipeline is executed as per `package.json` (dev)Dependencies ordering. I spent quite a bit of time before figuring this out.

Comment · 9 years ago
The Scala example, yes... The Elixir one? Is it actually a Monad? I figure it's simply destructuring + pattern matching (against the value of the first tuple value, :ok or :error atom).

To expand a bit more, it's not like Scala's `Either[T, U]` where we're limited to a pair of types, I think you can return other atom values (but use :ok and :error) as a convention.

Also, there is an Elixir library I'm using that's a closer in spirit to Scala's for-comprehension called `monadex`. Example below:

    result = success(comment_params)
             ~>> fn p  -> link_reply_to_id(p)  end
             ~>> fn p  -> create_changeset(p)  end
             ~>> fn cs -> assert_changeset(cs) end
             ~>> fn cs -> insert_changeset(cs) end
Comment · 9 years ago
I believe these are referred to Railway-Oriented Programming. I've seen several other examples for Elixir (incl. ones using macros), but by far this is the 'cleanest' syntax :)

Here's a similar construct in Scala:

    (for {
      user   <- currentUser(...)
      group  <- groups.fetchForUser(...)
      friend <- friendships.fetchFriend(...)
      member <- groups.addMember(...)
    } yield {
      render(...)
    }).recover {
      case e: Exception -> ...
    }
Comment · 9 years ago
IMO the ProcessBuilder class is not a very good example, as the operators are designed to match the existing shell / bash ones (e.g. `#>>` is similar in behaviour to bash's `>>`).
Comment · 9 years ago
> Scala core library is littered with :: +: and other nonsensical operators.

They are very useful. With the two you mentioned (:: and +:) they can be used for pattern matching in addition to concatenation (of a list / sequence), for example:

    scala> val list = 1 :: 2 :: Nil
    list: List[Int] = List(1, 2)


    scala> val x = list match {
         |   case head :: _ => head
         |   case _         => 0
         | }
    x: Int = 1

    scala> val seq = 1 +: Seq(2, 3) :+ 4
    seq: Seq[Int] = List(1, 2, 3, 4)

    scala> val y = seq match {
         |   case a +: _ :+ b => a + b
         |   case _           => 0
         | }
    y: Int = 5
It can be a bit confusing at first, especially for mutable vs immutable collection operators. But you end up remembering some, if not most of it, after using them a number of times.
Comment · 9 years ago
I'm currently working with Scala and recently dabbling with Elixir and Phoenix. It's a good language and great platform, however, I still prefer static typing.

I'm still getting used to dynamic typing in Elixir. Most of the time I feel like just matching against Map data structure or records.

While Dialyzer is great, writing the typespecs is a bit of a maintenance overhead. I suppose it's a tradeoff...

> I came to Elixir from Scala, [..] now I don't have to deal with the half of the Scala community that tries to make Scala into Haskell.

IMO Scala will continue to be a multi-paradigm lang. On pure-FP and libs, it's a choice and really depends on the problem domain. It might not be a good solution to everyone, but I'm glad it exists.

Comment · 9 years ago
> Nothing really changed, you could write Android apps on Kotlin before, as well as on any other JVM language. But now "Kotlin is the hero".

The announcement shows Google making a commitment to make Kotlin successful in Android, rather than leaving the effort all to the community and JetBrains.

> I suspect that Google's adoption of Kotlin is just politics: [...] Google could acknowledge Scala years ago, but didn't [...]

I think this post explains it best: https://medium.com/@ScalaWilliam/why-scala-didnt-miss-the-an... .

In regards with the Scala evolution, there's a lot of things to be excited about. In the near term, 2.13 should see various optimisation to core libraries and faster compilation.

> Also, I don't understand the point of Kotlin. [...] Kotlin is just a subset of Scala. [...]

Kotlin is a better Java, whereas Scala is much, much more.

Scala is still my go-to JVM languages, but one Kotlin use case for me is to write libraries that will be called from Java [1]. Its biggest advantage is that it's succinct, has useful functional features (e.g. Scala-like collections), while producing code signatures that's very close to Java.

Notes:

[1] - https://github.com/builtamont-oss/cassandra-migration

Comment · 9 years ago
Faster CPU does not eliminate GC pauses if your workload consumes a large amount of RAM. This is one of the other benefits which Zing provides.
Comment · 9 years ago
Comment · 9 years ago
Comment · 9 years ago
For me it brings a lot of benefits: easier to find parts, consumer-level parts pricing, and lower TDP.

I'm running a dual Xeon as you mentioned, through buying ex-fleet parts at less than half price of new ones. Several issues I experienced:

- Lack of motherboard options. I had to purchase new motherboard at a high price since the ones that support dual Xeons are either in an incompatible form factor or simply out-of-stock. I settled with Asus Z9PE-D8 WS with an SSI-EEB form factor.

- Outdated BIOS. I had to order a new, pre-flashed, BIOS chip since the BIOS that came with the motherboard refused to boot with the CPU and memory combo.

- Hard to find suitable ECC RAM. The motherboard only supports limited RAM (speed + latency) configs, and finding those is becoming harder. Availability looks seasonal at times.

- Needs capable power supply. One thing that people often look past is the need of a proper PSU. I had to upgrade to one which support two CPU power connectors.

Comment · 9 years ago
> Hence, Buku (after my son's nickname, meaning close to the heart in my language).

Coincidentally, `Buku` translates to `Book` in Indonesian...

Comment · 9 years ago
Comment · 9 years ago
Yes, certainly not a normal nor common view, but as you said, a lot of people seems to share it.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton