4. I meant to say pattern matching. You can catch a match on the structure (int, string, string) without explicitly setting the case class in a case switch statement. https://alvinalexander.com/scala/how-to-use-pattern-matching-scala-match-case-expressions
6. I’ve been using partial classes in c# since it came out 15 years ago. The partial classes / functions are awesome when having a part of the application generated by meta data and the other parts “baked” Into the system. It’s a Deep subject , and primarily stylistic choice. 7. Javacc / antlr both generate a parser. Parboiled2 gives a DSL to define a parser In the native language. Parboiled1 had Java / Scalia. Parboiled2 only Scala. Imagine defining a parser and interactively testing it in REPL. Better yet , imagine being able to dynamically create a parsing syntax from data , dynamically. Javacc, Antlr would Require a generation / validation step before then using it in your application. Not a fair comparison. I agree . Syntactic sugar can be expensive — but when results matter- human time is more important and expensive than computer time. There are two reasons to really optimize code : shitty programming with bad design or actual legitimate reasons to squeeze that 5 millisecond out of the core. Being able to create solutions quickly in 20% of what it normally take that work 80% of the time is better than spending 80% of the time to account for the 20% of edge cases. Best , Rahul On Jul 28, 2018, 9:12 AM -0400, jan <rtm4...@googlemail.com.invalid>, wrote: > I'm not a scala expert and haven't touched it for 18 months, but with > respect to Mr. Singh, I'd like to clarify or question a few of his > points. > > 1. Statelessness is a tool; not an end in itself but a means to an > end. As someone on HackerNews says, "control your state space or die", > but the same guy is *not* saying remove it all. I've seen immutability > overused. Sometimes a bit of state makes things both more > comprehensible and faster. > > 2. I don't know, and 3. true, > > 4. @Rahul, I don't understand, can you clarify? > > 5. Largely true and a huge bonus when used appropriately, but it can > be overused. Sometimes it seems emphasis on "helpful" syntactic > formatting without asking whether it actually helps the programmer. > > 6. Sounds like you've had more experience with them than me! Perhaps I > don't know how to use them appropriately. I may be missing a trick. > > 7. I wouldn't argue but I'd warn that some abstractions can be > expensive and I suspect shapeless may be one. Also, for parsers may I > suggest looking at ANTLR? > > Idiomatic scala code can be expensive *as curremtly implemented*. Just > understand that cost by profiling, and de-idiomise in hot code as > needed. > > It's a fab language. > > jan > > On 23/07/2018, Rahul Singh <rahul.xavier.si...@gmail.com> wrote: > > Not necessarily for Kafka, but you can definitely google “Java vs. Scala” > > and find a variety of reasons . I did a study for a client and ultimately > > here are the major reasons I found : > > > > 1. Functional programming language which leads itself to stateless systems > > 2. Better / easier to use stream processing syntax (then at that time in > > Java 8) > > 3. REPL available to quickly test functionality interactively. > > 4. Case classes which can be inferred with or without strongly typed cases. > > 5. Abilty to quickly create DSLs that seem natural to developers > > 6. Awesome partial function syntax > > 7. My personal favorite — as I was using parboiled2 to build a parser — > > libraries like shapeless > > > > Best > > > > -- > > Rahul Singh > > rahul.si...@anant.us > > > > Anant Corporation > > On Jul 23, 2018, 8:40 AM -0400, M. Manna <manme...@gmail.com>, wrote: > > > Hello, > > > > > > Is anyone aware of any links or website where I can find information/case > > > study etc. to why Scala was the best choice for kafka design? I hope this > > > is not too much of a "Naive" question since I have had a very humble > > > introduction to Scala. > > > > > > I understand that Scala is considered where distributed/scalable systems > > > need to be designed. Also, in some cases it reduces multiple complex > > > statements to be formed using a single complex statements i.e. reduce > > > incremental verbosity. > > > > > > So, as a person who has background in Java, but relatively novice in > > > Scala, > > > I wanted to understand whether a study document exists to document the > > > choice? > > > > > > Regards, > >