Learning another language in addition to Haskell

Haskell is my favorite programming language, but I need another language for competitive programming websites and live interviews. What language should I use? Right now, I'm thinking Scala.

Attached: scala-logo-3594568543.png (635x282, 8.4K)

Well unless you are applying at Scala shops, how about a language that people are actually using? Java (yeah really), C++, Python.

Good morning sir

I know Java, Python and some C++, and would rather not use any of them

>language that people are actually using
>Java, C++, Python
i pity the acerage corpo dev experience

Retard

All of those languages are bad in their own ways
>Java
Dumbed-down shit that is unusable for even moderately complex tasks
>Python
No static type checking. It can’t be added in, either, because then you wouldn’t be able to use namedtuple and the language would go to shit
>C++
Decades of experience to learn the ins and outs of a language moderately more expressive than Java? No, thanks

>namedtuple
It's 2022, use dataclass. It even has support for __slots__ now.

Attached: tetoteto.png (512x512, 168.36K)

>competitive programming
For serious competitive programming, C++ is king. The fact that it has all kinds of shit bolted on, like a dog to which someone glued four additional legs so it can pass as an octopus, is actually an advantage there. So are bad practices like using namespace std, mixing "modern" C++ style with raw C style in the same function, and using an abundance of copy-pasted macros just to avoid typing a few extra characters.
>live interviews
Python works well for those. Typically they just want to see you think and won't benchmark your solution. Python looks almost like pseudocode and makes it easy to explain your code.
>What language should I use? Right now, I'm thinking Scala.
Scala has some nice aspects but it also has a similar problem to C++. C++ got far too complicated because it was introducing modern features under the constraint of C compatibility, which means that they had to introduce even more complexity just for the sake of making them work together. Scala had to do some of this too because it tries to support both Haskell-style and Java-style programming. If you want a comfy programming language on the JVM, I highly recommend Kotlin instead. It's basically a better Java that looks nicer and has much less boilerplate. You'd be swimming upstream by trying to write Haskell-style code on the JVM as eventually you'll need to use Java libraries and then you'll get an ugly impedance mismatch.

Not OP, but is Kotlin usable without JetBrains' slow-torture IDE shit and industrial-grade build systems?
Kotlin/Native performance was many times worse than the JVM last time I checked, what is the state of it currently?

>is Kotlin usable without JetBrains' slow-torture IDE shit and industrial-grade build systems?
No. Try C#

>usable without ... IDE
Significantly more than Java because it's more concise and doesn't enforce spreading your program over many many files. But still less than Python. Not gonna lie, you're probably going to want a JetBrains IDE or at least an editor which supports the LSP.
>industrial-grade build systems
I use Gradle. It's decently usable both from the IDE and from the terminal. It has some industrial overengineering feel at places but the amount of boilerplate is fairly low, usually less than CMake. Much less than the XML build systems which used to be the norm in Java world.
>Kotlin/Native performance
I have no idea, sorry. I always use the JVM because I'm typically using Kotlin for longer-running programs. For quick short scripts I just use Python 3.

I'm not against IDEs, but my experience with IDEA was pretty bad. It'd be nice if VSCode with a few extensions was comfortable.
Basically I'd like to try to use Kotlin instead of Go for some things.

>VSCode
I don't use this editor, but I just looked at its Kotlin extension and looks like of the two most essential (for me) features, completion is supported well but auto-import is fairly rudimentary. You'd have to try it, my guess is it will be OK but not as helpful as IDEA.
>instead of Go
You'll probably like it if you like Go's syntax.
class Main : CliktCommand() {
val files: List by argument("FILE", help = "PDF file to process").multiple()

enum class Verbosity { DEBUG, INFO, WARN, ERROR }
val verbosity: Verbosity by option("--verbosity", help = "level of verbosity")
.enum(key = { it.toString().toLowerCase() }).default(Verbosity.INFO)

override fun run() {
val rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as Logger
rootLogger.level = when (verbosity) {
// Separate enums because we'll likely want to change this later even though it's the same now.
Verbosity.DEBUG -> Level.DEBUG
Verbosity.INFO -> Level.INFO
Verbosity.WARN -> Level.WARN
Verbosity.ERROR -> Level.ERROR
}

for (f in files) {
val path = Paths.get(f)
if (Files.isDirectory(path)) {
for (fileInDir in Files.list(path).sorted(naturalOrder())) {
run(fileInDir.toString())
}
} else {
run(f)
}
}
}
}

fun main(args: Array) {
Main().main(args)
}

>Dumbed-down shit that is unusable for even moderately complex tasks
Elaborate.

He probably just means the verbosity.

I suppose that most language failures (for example, lacking operator overloading and pattern matching) can be described as “verbosity”

Well yeah, you do have a point. But I consider concision second place to a lack of pointless defect attractors such as JavaScript's implicit type conversions or Lua returning nil instead of erroring out when your code does something nonsensical. Java is pretty decent by that metric even though it falls behind Kotlin and Haskell. The library situation is also stellar and the JVM is well engineered if you're writing running processes instead of small utilities which should run quickly. While Java's verbosity annoys me sometimes, I don't mind using it that much because of these advantages.

Really it comes down to a lot of things.
>Data types:
>>Classes are extremely cumbersome
>>Records are limited because they are immutable, record update syntax isn’t a thing, and java uses strict evaluation
>>Algebraic data types require inheritance, which is cumbersome
>Control structures
>>No match statement or match expression
>>No builtin comprehensions / for-yield / do notation
>Misc
>>Streams work very poorly with any code that could throw an error
>>Stdlib lacks a lot of nice things (tuples, variants, etc)
>>No operator overloading or custom operators
I could think of more

I'm not sure where it is that you work but man, I wish I could spend as much time complaining about the most superficial nonsense in my job. We actually chose Java with reactive streams over Scala for multiple reasons

no you don't nigger

Knowing Java is mandatory for introductory college CS classes and AP Computer Science A. Knowing Python is mandatory for applied math classes (e.g. linear algebra)

>Knowing Java
>introductory college CS classes
"Knowing" Java

Ok, to be fair, those classes probably don’t cover newer Java features like records, streams, etc. Honestly, those features don’t work very well, either. For example, I remember trying to use Java streams and failing because of Java’s exception autism