Live data from Hacker News

Show HN: Motif – Scala-like pattern matching with Java 8

github.com

21–30 of 36 posts

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#22

Earlier quoted context omitted.

He said he wanted something that's not painful on the eyes.

I hardly see how Scala is more painful on the eyes than good old Java.

Random example from a popular project:

     def bimap[C, X[_, _], D](g: Bijection[C, D])(implicit F: Bifunctor[X], evF: F[B] =:= Id[B], evG: G[A] =:= Id[A]): Bijection[X[A, C], X[B, D]] =
        bijection(
          F.bimap(_)(to(_), g.to(_)): Id[X[B, D]]
        , F.bimap(_)(from(_), g.from(_)): Id[X[A, C]]
        )

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#23

Hard to read in comparison to Scala. It's impressive that it was accomplished but some things just aren't meant to happen in Java 8.

If you've ever endured the compilation time of a Scala codebase that has more than, say, 2000+ classes, then you might think that some things just aren't meant to happen in Scala either. I used Scala for 4+ years at a company that spent a non-trivial amount of time and resources speeding up its Scala builds (way more than 2000+ classes), sometimes doing sadly controversial things[1] to achieve that speedup. It was a…

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#24

Earlier quoted context omitted.

If you've ever endured the compilation time of a Scala codebase that has more than, say, 2000+ classes, then you might think that some things just aren't meant to happen in Scala either. I used Scala for 4+ years at a company that spent a non-trivial amount of time and resources speeding up its Scala builds (way more than 2000+ classes), sometimes doing sadly controversial things[1] to achieve that speedup. It was a…

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

Question - I don't know much about Scala - how often does one need to do a full build? I am talking regular development cycle, ie make a change, save/compile, check if it works etc. I mean typically a compiled language will have some 'incremental compile' to compile just the file you edited. Does that work with Scala?

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#25

Earlier quoted context omitted.

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

Question - I don't know much about Scala - how often does one need to do a full build? I am talking regular development cycle, ie make a change, save/compile, check if it works etc. I mean typically a compiled language will have some 'incremental compile' to compile just the file you edited. Does that work with Scala?

> Question - I don't know much about Scala - how often does one need to do a full build?

Not often at all.

> I am talking regular development cycle, ie make a change, save/compile, check if it works etc.

sbt[1] supports incremental compilation and projects such as Play[2] leverage this to support "on-the-fly" recompilation while the container remains running.

1 - http://www.scala-sbt.org/0.13/docs/Understanding-Recompilati...

2 - https://www.playframework.com

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#26

Earlier quoted context omitted.

If you've ever endured the compilation time of a Scala codebase that has more than, say, 2000+ classes, then you might think that some things just aren't meant to happen in Scala either. I used Scala for 4+ years at a company that spent a non-trivial amount of time and resources speeding up its Scala builds (way more than 2000+ classes), sometimes doing sadly controversial things[1] to achieve that speedup. It was a…

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

> As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average.

Odd... I just did a full compile of a Scala project I work on which has:

- 259 source files

- Contains dozens of macros[1]

- Results in 2097 classes (includes companion objects and anonymous types)

And it took 75 seconds on my laptop. As I mentioned in another reply, doing a full recompile is rarely needed but was done now to provide quantified metrics.

1 - http://docs.scala-lang.org/overviews/macros/overview.html

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#27

Earlier quoted context omitted.

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

> As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. Odd... I just did a full compile of a Scala project I work on which has: - 259 source files - Contains dozens of macros[1] - Results in 2097 classes (includes companion objects and anonymous types) And it took 75 seconds on my laptop. As I mentioned in another reply, doing a full recompile is rarely needed but was do…

In Java, I compile around 250 classes in about 6 seconds on my laptop. It results in around 250 class files being generated because no filea for anonymous inner classes are created from the lambdas in the code. I don't need a full recompile either. An incremental compile in Java is measured in milliseconds. IntelliJ is usable to its fullest instead of being a fancy editor that just autocompletes and jumps to symbol definitions.

You may not be using all of scala's language features. I'm using java's features to the fullest. I compile in 6 seconds. You compile in 75 seconds. You may still prefer that trade off. After working with thousands of scala files (you have 259 source files? That's cute! I wish I could pinch your cheeks!) where a 75 second compile sounds like a fail-fast error, I think I will live happier with what Java 8 has, limited and warted though it may be.

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#28

Earlier quoted context omitted.

As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. At my last job, compiling >2000 Java classes took about 10-15 seconds with an ant script doing a top-down build. Unfortunately I don't remember LOC, but I don't remember the average Scala file being overly large at my Scala job, or the average Java file being unusually short at my Java job.

> As a point of reference, compiling ~200 Scala classes at a time would take ~2.5 minutes on average. Odd... I just did a full compile of a Scala project I work on which has: - 259 source files - Contains dozens of macros[1] - Results in 2097 classes (includes companion objects and anonymous types) And it took 75 seconds on my laptop. As I mentioned in another reply, doing a full recompile is rarely needed but was do…

In Java, I compile around 250 classes in about 6 seconds on my laptop. It results in around 250 class files being generated because no filea for anonymous inner classes are created from the lambdas in the code. I don't need a full recompile either. An incremental compile in Java is measured in milliseconds. IntelliJ is usable to its fullest instead of being a fancy editor that just autocompletes and jumps to symbol definitions.

You may not be using all of scala's language features. I'm using java's features to the fullest. I compile in 6 seconds. You compile in 75 seconds. You may still prefer that trade off. After working with thousands of scala files (you have 259 source files? That's cute! I wish I could pinch your cheeks!) where a 75 second compile sounds like a fail-fast error, I think I will live happier with what Java 8 has, limited and warted though it may be.

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#29

Earlier quoted context omitted.

I hardly see how Scala is more painful on the eyes than good old Java.

Random example from a popular project: def bimap[C, X[_, _], D](g: Bijection[C, D])(implicit F: Bifunctor[X], evF: F[B] =:= Id[B], evG: G[A] =:= Id[A]): Bijection[X[A, C], X[B, D]] = bijection( F.bimap(_)(to(_), g.to(_)): Id[X[B, D]] , F.bimap(_)(from(_), g.from(_)): Id[X[A, C]] )

Hi! I see that you are new to Hacker News. Welcome.

It's unlikely that anyone cares about your opinion re: Scala's syntax and cherry-picked abuses thereof. I certainly do not. My comment was an attempt to point out the sarcasm in the root comment.

Have a nice day.

Re: Show HN: Motif – Scala-like pattern matching with Java 8

#30

Earlier quoted context omitted.

Random example from a popular project: def bimap[C, X[_, _], D](g: Bijection[C, D])(implicit F: Bifunctor[X], evF: F[B] =:= Id[B], evG: G[A] =:= Id[A]): Bijection[X[A, C], X[B, D]] = bijection( F.bimap(_)(to(_), g.to(_)): Id[X[B, D]] , F.bimap(_)(from(_), g.from(_)): Id[X[A, C]] )

Hi! I see that you are new to Hacker News. Welcome. It's unlikely that anyone cares about your opinion re: Scala's syntax and cherry-picked abuses thereof. I certainly do not. My comment was an attempt to point out the sarcasm in the root comment. Have a nice day.

> I certainly do not.

What a coincidence, I do not care about your opinion either!

Post reply on HN