This new JVM language Concurnas: <https://concurna...
# language-proposals
v
This new JVM language Concurnas: https://concurnas.com/index.html seems to have a lot of features that we want to have in Kotlin. Any idea?
metal 1
🚫 2
l
This doesn't seem to be a simple language from the snippets I read on their homepage. Also, this is not a language proposal.
c
Multitypes seem neat, without an IntelliJ plugin I can't say I would touch the language though.
v
I know that this is not a language proposal, but I just wanted to express my disappointment about Kotlin’s pace of evolution. This new language has many features that we are longing for Kotlin to happen, but we are still waiting and waiting. The popularity of Kotlin hasn’t reached a level that can be considered secure, but its edge has been diminishing with new versions of Java and other new JVM languages coming out. I am speaking from the perspective of a fan and lover of Kotlin.
🚫 3
🚫 3
e
I cant agree more with you, @vngantk
c
@vngantk can you expand on "seems to have a lot of features that we want to have in Kotlin." I think that would lead to more productive conversations.
e
I can say bitwise operators as first
and there are many other sparse similar requests (less voted)
another minor is
loop{}
c
What would
loop
do? Also bitwise operators are supported however I can see that the syntactical differences could be confusing, I feel like that's a similar thing to tertiary operators though.
e
stays for
while (true) { }
, bitwise operators are not supported
that's more than confusing.. it's the same reason why we prefer using
2+3
instead writing
2.plus(3)
c
Since Kotlin supports top level functions
loop
could be created within a project fairly quickly. I don't know that it's something that needs to be backed into the language.
e
every single function offered by the stdlib can be created within a project fairy quickly, but I still prefer them to be offered by default
g
loop as a function is not the same, it doesn't have continue without restructuring your code, but honestly don't see any win comparing to while(true)
c
Allowing for break and continue within functions seems like a more reasonable language proposal since there are other situations where you may want to do that as well, not just in the context of
loop
g
I agree
Break is kinda exists, it's return. But introducing a new language construct to replace existing language construct which works exactly the same looks not very reasonable for me
c
I also wonder if there is anything that could be done with contracts as well, it's a language feature I have been following but haven't been using. Being able to say a function is intended for control flow could be neat.
e
also pattern matching looks cool https://concurnas.com/docs/patternMatching.html
c
Might be missing something by glancing at the documentation, it looks very similar to when statements in Kotlin.
e
we cant do something like this:
Copy code
def matcher(an Object){
  match(an){
    person Person(yearOfBirth < 1970, favs(number == 12)) => "Person, born: {person.yearOfBirth}. Favourite word: {person.favs.word}"
    x => "unknown input"
  }
}
even something this simple in kotlin requires typing over and over `n`:
Copy code
def matcher(n int){
  match(n){
    >5 and <10 =>    "greater than 5 but less than 10" 
    <10 =>    "less than 10" 
    else => "more than or equal to 10" 
  }
}
c
Copy code
fun matcher(n: Int) {
    when (n) {
        in 6..9 -> "greater than 5 but less than 10"
        in Int.MIN_VALUE..9 -> "less than 10"
        else -> "more than or equal to 10"
    }
}
e
<10
is way more intuitive
honestly, I'll revert to
n < 10
in kotlin
g
when { n < 10 -> “less than 10” } 🤷‍♂️
l
Personally, I'm very alright with the state of Kotlin and its evolution. It's not about the quantity of features, but about the quality, from compiler to IDE, and the possibilities that it allows me and the community, to put into reality. Also, Kotlin is a fairly simple language, and that keeps the entry bar low, and allows us all to understand each other code, which is very nice. It's same as English, which has a fairly simple grammar, making the entry bar low and allowing people worldwide to communicate once they know the vocabulary (which would translate to libraries, APIs, symbols in codebases for Kotlin). Kotlin is getting first class compiler plugins support relatively soon, and some are already doing powerful things with #arrow-meta for example, and also #compose. So I'm not worried about the evolution of Kotlin, and I like that it doesn't break much or at all (at least for non experimental things).
1
g
Thanks Louis, it’s 100% matches with my opinion about this topic. Quality of tooling, performance of IDE and compiler, this is current focus and It makes me happy and I don’t worry about Kotlin future with this approach.
e
it's
Copy code
when {
    n > 5 && n < 10 =>    "greater than 5 but less than 10" 
    n < 10 =>    "less than 10" 
    else => "more than or equal to 10" 
  }
however, the case scenarios more significant are clearly those with some more verbose naming than a simple
n
g
it’s also true for complex check in when, they may be replaced with a function now, with proposed syntax it’s not clear that it even possible