Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:13
    julienrf commented #2086
  • 13:07
    julienrf synchronize #2088
  • 13:02
    julienrf review_requested #2088
  • 13:02
    julienrf opened #2088
  • 09:26

    lrytz on 2.13.x

    Speed up BSP import of project … Merge pull request #9673 from r… (compare)

  • 09:26
    lrytz closed #9673
  • 07:49
    bjornregnell commented #1250
  • 07:24
    lrytz commented #1250
  • 05:48
    som-snytt closed #12417
  • 05:48
    som-snytt commented #12417
  • 05:48
    som-snytt commented #12417
  • 05:48
    som-snytt commented #12417
  • 04:59

    SethTisue on 2.13.x

    bump scripting dependencies; ju… fix bug in advance script in e… oops, fix script fix and 1 more (compare)

  • 04:58

    SethTisue on 2.12.x

    bump scripting dependencies; ju… fix bug in advance script in e… oops, fix script fix (compare)

  • 03:40
    SethTisue edited #1434
  • 03:40

    SethTisue on 2.13.x

    2.12: advance project SHAs (#14… 2.12: new Scala SHA (#1433) guard against sbt-extras https… and 2 more (compare)

  • 03:39

    SethTisue on 2.12.x

    guard against sbt-extras https… (compare)

  • 03:28
    SethTisue edited #1434
  • 03:28
    SethTisue labeled #1434
  • 03:28
    SethTisue assigned #1434
Guillaume Martres
@smarter
@liewhite tree mods are only present on untyped trees, afterwards you have flags on symbols instead
Philip Schwarz
@philip_schwarz_twitter
@smarter thank you very much!
Philip Schwarz
@philip_schwarz_twitter
@smarter I opened this scala/scala-collection-contrib#146
李霖
@liewhite
@smarter Thank you! You save me a lot of time
zeroexcuses
@zeroexcuses
For the task of forwarding voice packets "mini clubhouse" -- would GoLang be a better match than Scala ?
Seth Tisue
@SethTisue
@zeroexcuses Go and Scala are both popular for back end work in general. what characterizes the domain of "forwarding voice packets", as you see it — what's special about that domain?
nafg
@naftoligug:matrix.org
[m]
Probably a requirement of real-time
It could be some of the newer GCs on newer JVMs are low latency enough
Also there's scala-native and Graal native image
I do think most people would pick Go for such a task over Scala but that doesn't mean it's necessary. Another question is what else does the program do
If there's a good reason to use Scala then the answer is you can but it might not be the default Scala out of the box experience
Alexander Konovalov
@alexknvl
[error] 37 |  def isFConsistency[F[X <: F[X]], A <: F[A], B <: F[B]](ab: (IsF[F, A, B] => Void) => Void): IsF[F, A, B] =
[error]    |                            ^
[error]    |                            Cyclic reference involving type F
Would this be considered a bug? (Scala 3) It compiles in Scala 2.
Rohan Sircar
@rohan-sircar
Go and Scala are both VM/gc based, and neither scala native nor graal native do away with GC. So if real-time is needed, wouldn't you use something like C++/Rust to avoid GC entirely?
sinanspd
@sinanspd
how does Flink etc. deal with that?
While it doesn't achieve Rust level performance, you can get damn good near-real time processing from Flink
it does cripple a little bit when GC kicks in, but not terrible
that makes me curious about what performance optimizations they did under the hood
Rohan Sircar
@rohan-sircar
It depends on the the requirements i think. I've researched this in the context of gamedev, where any stop the world phase would be noticeable and unacceptable.
High-level Rust actually requires a lot of heap allocation for smart pointers which ought to make things slow, but it would still be deterministic which is the point.
*and reference counting, which is also supposed to be slower than GC with a managed heap
Alexander Konovalov
@alexknvl
What's the shortcut for making an anonymous type lambda in Scala3? F[A, *]? F[A, _]? F[A, ?]? None of them seem to work.
Антон Войцишевский
@FunFunFine

How could one implement traverse (or size-unaware mapN) for tuples?
So that such code works:

 val iots = (IO(3), IO(false), IO("a"))
 val sts: IO[(Int, Boolean, String)] = IO.sequence(iots)

I guess it would use recursive match types somehow, but I can't come up with a solution.

Guillaume Martres
@smarter
@alexknvl there isn't one by default yet as we're still in the transition period of _ meaning wildcards: http://dotty.epfl.ch/docs/reference/changed-features/wildcards.html
zygfryd
@zygfryd
@FunFunFine I found a way that works, but since it doesn't infer the result type in IDEA, it'd be a pain to work with: https://scastie.scala-lang.org/EJNbH97BT8OMOJis9ADChg
Luis Miguel Mejía Suárez
@BalmungSan
@FunFunFine isn't that just val sts = iots.tupled?
zygfryd
@zygfryd
@BalmungSan Looks completely unrelated
Erik Erlandson
@erikerlandson
question about generating given expressions:
I recently experimented with replacing the following traditional idiom:
'{ new Coefficient[U1, U2] { val value = $rcoef } }
with a variation that declares an object without using new
'{ { object x extends Coefficient[U1, U2] { val value = $rcoef }; x } }
They both seem to work fine. My intuition is that the object version is "better" in the sense of not needing to allocate memory off the heap, but interested in expert opinions
zygfryd
@zygfryd
Both work the same, if you want to eliminate the allocation use an opaque or value type
Erik Erlandson
@erikerlandson
interesting, so object x extends Class ... is syntactic sugar for val x = new Class ... ?
zygfryd
@zygfryd
Yep
If you put it at the top level, it will be allocated only once, but in a nested context, you'll get a new one every time it's executed
Erik Erlandson
@erikerlandson
may as well stick with the original idiom then, the code is a bit less awkward and it does what it says
Seth Tisue
@SethTisue
@erikerlandson if curious, see https://scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html#object-definitions — "object m is roughly equivalent to the following definition of a lazy value: lazy val m = ..."
Joe Koberg
@jkoberg
Any hints on getting the "blog" feature of scaladoc working? I have a blog/_posts dir under project root (not under src/) with a dated .md file in it, but no blog in the output
seems like scala3doc is running when I type doc in sbt, the generated output has a link at the bottom to https://github.com/lampepfl/dotty/tree/master/scaladoc
Swoorup Joshi
@Swoorup
Does element display well on mobile. Sick of gitter
nafg
@naftoligug:matrix.org
[m]
Much better
Swoorup Joshi
@Swoorup
Gitter source code should be burnt with fire. And banished from the world.
for good of mankind - rant over
Seth Tisue
@SethTisue
perhaps we'll all decamp for https://discord.gg/scala
Антон Войцишевский
@FunFunFine
@BalmungSan it is .tupled for scala 2 tuples, but my question was about scala 3
Sorry for misleading questions
Fabio Epifani
@epifab

hi, any idea why this code wouldn't compile?

trait X:
  type Out
  def value: Out

class XWrapper[XX <: X](val x: XX):
  type Out = x.Out

object XWrapper:
  type Aux[T, U] = XWrapper[T] { type Out = U }

def getValue[XX <: X, U](y: XWrapper.Aux[XX, U]): U =
  y.x.value

it says:

Found:    y.x.Out
Required: U
    y.x.value

shouldn't the compiler know that they're the same type?

zygfryd
@zygfryd
There's no way to generate an invokedynamic instruction in a macro in Scala 3, like there was in Scala 2, is there?
Guillaume Martres
@smarter
no
Arthur McGibbon
@Arthurm1

Back from when I abused Scala more than I do now, I have something like this code...

  val f: Boolean => Any = g => {
    if (g)
      1
  }
  println(f(true))
  println(f(false))

which, in Scala 2, gives...

1
()

but in Scala 3 gives...

()
()

albeit with the warning...

A pure expression does nothing in statement position; you may be omitting necessary parentheses

I can change my code but it has changed the flow of my program with only a warning. Is this correct - I can't find anything about pure expressions in the migration docs.

daenyth
@daenyth:matrix.org
[m]
What line is that error on? The 1?
I'm wondering if this is related to indentation-based syntax somehow
Arthur McGibbon
@Arthurm1
Yes - after the 1. But using brackets around the 1 gives the same result
Luis Miguel Mejía Suárez
@BalmungSan
Maybe you need to do if (g) then 1 else ()?