Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 18 00:31

    darkfrog26 on sbt-1.5.4

    (compare)

  • Jul 18 00:31
    darkfrog26 closed #40
  • Jul 18 00:30
    darkfrog26 commented #40
  • Jul 18 00:30
    darkfrog26 opened #43
  • Jul 18 00:30

    darkfrog26 on sbt-1.5.5

    Update sbt to 1.5.5 (compare)

  • Jul 11 00:31
    darkfrog26 opened #42
  • Jul 11 00:31

    darkfrog26 on scala3-library-3.0.1

    Update scala3-library, ... to 3… (compare)

  • Jul 04 00:29
    darkfrog26 opened #41
  • Jul 04 00:28

    darkfrog26 on sbt-scala-native-crossproject-1.1.0

    Update sbt-scala-native-crosspr… (compare)

  • Jun 20 00:31

    darkfrog26 on sbt-1.5.3

    (compare)

  • Jun 20 00:31
    darkfrog26 closed #38
  • Jun 20 00:31
    darkfrog26 commented #38
  • Jun 20 00:31
    darkfrog26 opened #40
  • Jun 20 00:31

    darkfrog26 on sbt-1.5.4

    Update sbt to 1.5.4 (compare)

  • Jun 13 00:31
    darkfrog26 opened #39
  • Jun 13 00:31

    darkfrog26 on sbt-scalajs-1.6.0

    Update sbt-scalajs, scalajs-com… (compare)

  • Jun 06 00:51
    darkfrog26 opened #38
  • Jun 06 00:50

    darkfrog26 on sbt-1.5.3

    Update sbt to 1.5.3 (compare)

  • May 30 01:10

    darkfrog26 on sbt-scoverage-1.8.1

    (compare)

  • May 30 01:10
    darkfrog26 closed #35
slapedra
@slapedra
Hi
Does reactify compute internally a dag calculation in parallel?
Matt Hicks
@darkfrog26
@slapedra no, there is no asynchronous or parallel operations in Reactify by default
while it's entirely thread-safe, all operations, by default, occur on the calling thread
the primary purpose for this is to maintain an agnostic model that can be extended while fully supporting all platforms (JVM, JS, and Native)
@slapedra is there something you're trying to do that you need that for?
slapedra
@slapedra
I was looking at reactify to potentially replace a parallel dag calculation (a really old implementation). I did not achieved the same level of simplicity. However having a dag behind was allowing me to generically do optimisation (mathematics solver) as I could control the edges to be executed between sources and deriveds nodes.
I like the easy integration of reactify with normal scala code.
Matt Hicks
@darkfrog26
It should possible to add asynchronous calculation if it's desired, but unless you're doing heavy operations, I can't imagine it makes much difference
Marek Mosiewicz
@marekmosiewicz
Yes I mean one element depending on another
I try to find solution for Adempiere ERP. It has expression language which it parse and find dependecies, but is very primitive. Just thought that with TASTy maybe it is possible to find dependecies for expression (I need business user friendly expressions)
Matt Hicks
@darkfrog26
Reactify actually works at runtime in version 4 instead of compile-time. Earlier versions used Macros, but this led to complexities for users of the libraries depending how it was used.
Marek Mosiewicz
@marekmosiewicz
@darkfrog26 Macros in Scala3 claims to be standarized
Matt Hicks
@darkfrog26
it's not quite that simple
Marek Mosiewicz
@marekmosiewicz
@darkfrog26 Is it possible to detect dependencies without macro ?
Matt Hicks
@darkfrog26
Macros in Scala 2 or 3 require compile-time injection, but you may leverage pre-compiled functionality
yeah, that's what Reactify does
just call the references method on Val or Var

So, for example:

val a = Var("One")
val b = Var("Two")
val c = Var("Three")

val list = Val(List(a, b, c))

if I call:
list.references it should contain a, b, and c

in a more complex scenario:

val v1 = Var(10)
val v2 = Var("Yes")
val v3 = Var("No")
val complex = Val[String] {
    if (v1 > 10) {
      v2
    } else {
      v3
    }
}

complex.references will contain v1 and v3 initially, but if you change v1 to have a value greater than 10 it will have v1 and v2

Marek Mosiewicz
@marekmosiewicz
But how you can obtain it :) ?
Matt Hicks
@darkfrog26
what do you mean? references method returns a Set[Val[_]]
Marek Mosiewicz
@marekmosiewicz
I'm not good at Scala. how 10, v1 and v2 is put in references
Matt Hicks
@darkfrog26
How does it work you mean?
Reactify could technically be written in Java. There's nothing about Scala that makes it possible.
Marek Mosiewicz
@marekmosiewicz
I understand Observable/Observer but you need to set dependencies for object
What I was thinking of is to detect references from code automatically
Matt Hicks
@darkfrog26
The "magic" of how Reactify works is solving exactly this problem. In Val(List(a, b, c)), the parameter to Val is actually a function.
Internally, before evaluating that function, I set a ThreadLocal reference to the Val being evaluated. As the function is then being evaluated, any Val or Var that is gotten calls to the ThreadLocal to let it know it was referenced during the evaluation. This is how it determines the list of references.
Marek Mosiewicz
@marekmosiewicz
But what about Val/Var that is not evaluated because of condition not match. I mean v3 is not evaluated if v1 < 10
e.g. ( if(v1 >10 and vx< 20) will not evaluate vx
Matt Hicks
@darkfrog26
Right, but during the "evaluation" when any of the dependencies (v1 and v2) change, the function is then re-evaluated and a new dependency list is generated.
this is why I evaluate the list of dependencies, so I can listen for changes to them to know if I should re-evaluate
so, during re-evaluation, it determines that now v1 and v3 are now being referenced instead of v1 and v2, so it stops listening to v2 and starts listening to v3
Marek Mosiewicz
@marekmosiewicz
What about plugable references resolver. I mean it does not seems to be very complicated to list Vals from TASTy
Matt Hicks
@darkfrog26
after all, until v2 is being utilized to determine the result, it's just a waste of performance to listen to it
you can, but imagine this scenario:
Marek Mosiewicz
@marekmosiewicz
ok i understand.
smart
Matt Hicks
@darkfrog26

in Project A I create:

def getValue(): Int = a + b + c  // presuming those are three `Val`s

then, in Project B I do:

val value = Val(getValue() + d) // presuming d is a `Val`
if I were to use Macros I would never get a reference for a, b, and c because TASTy would not know in Project B anything except that I'm calling getValue() because it's already compiled
the way I wrote Reactify, this isn't a problem
There's a reason Reactify is on version 4. I've re-written it several times to get to where I am today. Two of the past major re-writes used Macros.
Marek Mosiewicz
@marekmosiewicz
I think with Scala 3 macro you could do this and even without Val/Var just writing something like expr(a+b+c) where expr is macro
Matt Hicks
@darkfrog26
Sure, but it requires a deeper understanding by the user of the library to do so, which creates pitfalls for someone that attempts the former and begins pulling their hair out when they can't conceive why it's not working as they think it should.
Marek Mosiewicz
@marekmosiewicz
Maybe you are right
Marek Mosiewicz
@marekmosiewicz
It sounds good. Have you heard of ADempiere https://github.com/adempiere/adempiere
Matt Hicks
@darkfrog26
nope, but their site is down
Marek Mosiewicz
@marekmosiewicz
It is war between contributors, but it has interesting ideas there. I would like to rewrite core for general purpose business app framework
Matt Hicks
@darkfrog26
seems like a crazy monolithic library
Marek Mosiewicz
@marekmosiewicz
In fact you can define model and forms in ADempiere in declarative way