News for hackers. Stuff that matters.
Re:Scala projects are difficult to maintain by tootie on Monday March 22, 2021 @10:34AM (#26541383)
I only witnessed from the outside, but saw a similar story play out. A client had bet on Scala for a new platform and made it about 6 months in before throwing in the towel and rewriting the whole thing in in Java. It's too hard to recruit and the tooling isn't mature enough.
Re:Scala projects are difficult to maintain by mumblemumble on Monday March 22, 2021 @11:25AM (#26542152)
I didn't run into problems with recruiting in general being too difficult. Plenty of people are interested in FP and are eager to do it professionally. But recruiting the right mix of people can be a challenge. Scala tends to attract people with an experimental temperament, and scare away more conservative developers. A team needs a healthy mix of both, though. It's the creative tension among different attitudes about how to write code that yields the best work in the long run.
Re:Scala projects are difficult to maintain by rednum on Monday March 22, 2021 @11:37AM (#26542325)
Yeah, good luck when someone with experimental temperament decides to implement some of your crucial functionality with semialgebras. (that's what happened in my previous job where we run Scala). I'm happy I didn't have to debug any customer issues around that module. Also, I didn't enjoy constant bickering with my reviewers what makes a beautiful code or not. Apparently there are five ways to do everything in Scala and I always ended up picking not the one my teammates would like the most.
Re:Scala projects are difficult to maintain by mumblemumble on Monday March 22, 2021 @12:05PM (#26542717)
Yes. That's pretty much how the Scala project I was working on ran itself aground. Everyone got so caught up in flexing at each other that solving actual business problems became a secondary priority.
Re:Scala projects are difficult to maintain by randmeerkat on Monday March 22, 2021 @12:28PM (#26543035)
This is why I think the community is way more important than the language. In Python people are like, hmm, this is a hack, but it works for now, in Scala it’s, what have you done you savage?!?
Re:Scala projects are difficult to maintain by mumblemumble on Monday March 22, 2021 @12:36PM (#26543162)
It's also just really weird, when you step back and take a good long look at it, to see people getting worked up about hacky ways of doing things within the context of a language that implemented sum types the way Scala implemented sum types, and that implemented typeclasses the way that Scala implemented typeclasses.

Which, I don't want to be too down on Scala. Overall, I like the language. Scala's real weak point is its culture. There's a decent risk of cognitive dissonance when you try to wrap an ethos of design purity around a language that's always been a bit of a communal experimentation project.

Re:Scala projects are difficult to maintain by nowherebeen on Monday March 22, 2021 @12:21PM (#26542944)
This points to a culture problem more than the language itself though.
Re:Scala projects are difficult to maintain by mumblemumble on Monday March 22, 2021 @12:25PM (#26543005)
Interestingly, when we were working on the Java code, we didn't have this problem. Same people, same time, same git repository, different modules.
Re:Scala projects are difficult to maintain by milesvp on Monday March 22, 2021 @03:07PM (#26545293)
This doesn’t terribly surprise me. Community isn’t just the people but also the customs and idioms within the community. It’s probably similar to ‘code switching’ in verbal languages. People talk (and act) differently depending on who thay’re talking to.
Re:Scala projects are difficult to maintain by nine_k on Monday March 22, 2021 @12:25PM (#26543006)
Were semialgebras a right abstraction, or over-engineering?

What is helpful in situations like this is the motto "as simple as possible, but not simpler". During a code review, if you see something you think is too complex, ask the author: "How could it be made even simpler? If not, how exactly a simpler approach did not work?" It sometimes helps find an overlooked simplification.

Re:Scala projects are difficult to maintain by hota_mazi on Monday March 22, 2021 @12:44PM (#26543260)
> Were semialgebras a right abstraction, or over-engineering?

I think that's missing the point.

The criterion should be: is the code clear enough to be easily testable, easy to debug, and easy to evolve?

I will take a wrong abstraction with the qualities listed above any day of the week.

Re:Scala projects are difficult to maintain by nine_k on Monday March 22, 2021 @09:55PM (#26550074)
This is a good call.

The problem with wrong abstractions, though, is that they do not work, especially when you make the next step on the roadmap.

I would say that clear, testable, evolvable code with little abstraction may be fine. OTOH boilerplate and copy-paste prevents easy or well-controlled evolution. The abstractions end up inlined and fused in the code, instead of being made visible, and become easy to miss a case when a concerted change is needed.

Re:Scala projects are difficult to maintain by worldsayshi on Monday March 22, 2021 @11:28AM (#26542197)
In contrast I think that going all in on Java scares away people who like to experiment.
Re:Scala projects are difficult to maintain by eternalban on Monday March 22, 2021 @12:08PM (#26542760)
Be honest and give a short list of experimental approaches that you wanted to do and couldn't be done on Java. What did you want to do and couldn't?

And, let's ask Rich Hickey. What language was it he used to experiment with a new s-expression language? Why wasn't RH scared away? You want the brutal honest answer? Because he is smart and can grok the complexity of the Java in toto.

What sort of experiments can you not do on a virtual machine based language, with open byte code/vm spec, open class loaders, and compile and runtime instrumentation and meta- capabilities?

I used to do the switch the superclass at loadtime to experiment with adaptable programs. This was circa late 90s. Loads of fun (npi).

What scares many away from Java is that it is now a very huge mental object. But not wanting to admit this, they simply pass along FUD.

Re:Scala projects are difficult to maintain by fctorial on Monday March 22, 2021 @01:29PM (#26543839)
> I used to do the switch the superclass at loadtime to experiment with adaptable programs.

This probably falls in undefined behavior territory. What kind of errors did you get when something went wrong?

Re:Scala projects are difficult to maintain by eternalban on Monday March 22, 2021 @02:42PM (#26544955)
It is not undefined behavior. Bytecodes are modified via custom CL and superclass was swapped from e.g. Object to something else. As for errors, honestly its been 23+ years so don’t really remember. Naturally you can’t just swap any random class - it has to be correct e.g. can’t have an override method in the child that has no corresponding method in the super. And if memory serves, you can also play this trick using classpaths. Assume a stub package com.foo.Context which is simply an extension of Object, and derive components from com.foo.Context.SuperClass. You simply need to provide a different eponymous package for the adapted instance of the code.

https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.ht...

Re:Scala projects are difficult to maintain by hderms on Friday March 26, 2021 @07:47AM (#26590913)
I've definitely experienced some scary bugs caused by runtime bytecode injection (from a tracing library). I didn't bother tracking it down further than identifying it was at the intersection of some slightly strange type and the tracing. Caused VM errors when this method was called but only when the tracing was configured.

Not saying it's not interesting to experiment with things like that, but there are non-trivial associated, if you ask me, to depending on it in production.

Re:Scala projects are difficult to maintain by eternalban on Saturday March 27, 2021 @08:54AM (#26601948)
I'm pretty sure (but am hedging here :) that you would get any errors in the verification phase of loading a class. What you saw may have been due to bugs in that library you were using.

Anyway, this was before ASM and other bytecode engineering libraries. Today I would not directly hack the class def myself.

Re:Scala projects are difficult to maintain by closeparen on Monday March 22, 2021 @01:32PM (#26543885)
I thought it was understood that choosing a less popular language meant hiring people for fundamentals and then letting them ramp on on your language. Did the client choose Scala thinking they would just hire "Scala people"?
Re:Scala projects are difficult to maintain by hderms on Friday March 26, 2021 @07:49AM (#26590929)
If you stick to a reasonable middle-ground of scala it really shouldn't be hard to teach. I do like the FP community but that style has gone a long way towards mythologizing scala as an impossible language to teach.

In my experience it's clearly considerably simpler than Rust or C++ to become productive in.