Giter Site home page Giter Site logo

rescala-lang / rescala Goto Github PK

View Code? Open in Web Editor NEW
89.0 89.0 29.0 59.65 MB

REScala - distributed and reactive programming embedded in OO and FP programs.

Home Page: https://www.rescala-lang.com

License: Apache License 2.0

Scala 80.06% Perl 3.79% Java 0.05% CSS 0.20% HTML 0.08% TypeScript 0.02% Jupyter Notebook 8.98% C 3.84% Dockerfile 0.22% Shell 0.18% Scheme 0.20% DenizenScript 0.01% Roff 0.01% JavaScript 0.23% Python 2.09% C++ 0.01% Just 0.04%

rescala's People

Contributors

andrepacak avatar b509 avatar ckuessner avatar drcicero avatar felixgail avatar flom avatar gerizuna avatar guidosalva avatar haaase avatar hansruebb avatar hintz avatar hoshini avatar josef552 avatar kiibou-chan avatar lh70 avatar lichtemo avatar locke avatar manasmahajan avatar markus1189 avatar misterd123 avatar nritschel avatar philippma avatar przchrz avatar pweisenburger avatar rmgk avatar robflop avatar spalberg avatar sprankhub avatar vstollen avatar wallaby1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rescala's Issues

Found mistyping in manual

Hello.
While reading a manual, I found some mistypings.

In_"The handler is a first class function that receives the events value as a parameter."
at 1.2.3. Now, observe, remove,
is events value means event values? or events values?

In "Inside a signal expression others signals should be accessed with the () operator.",
at 1.2.4. Signal Expressions,
is others signals means other signals?

It might leads to misunderstanding of its using.
Thank you.

Released version 0.32.0 silently drops set/fire of Evt/Var due to capturing a completed transaction

Hello, when using the released version 0.32.0 it seems like Vars used inside of outwatch's onClick handler like at https://github.com/reform-org/reform/blob/ad454d788ec4191be1346282d3bd05c3c21eae0d/js/src/main/scala/webapp/pages/ProjectsPage.scala#L186 seem to be not working. They don't update their now value and they also don't call their map functions. When applying the following commit reform-org/reform@ad454d7 (downgrading REScala) everything seems to be working again.

Kind regards
Moritz

rescala for scala 2.11 produces errors when used with scala 2.10

I'm using a .sbt to play with rescala.

resolvers += Resolver.bintrayRepo("rmgk", "maven")                                                                                                                                
resolvers += Resolver.bintrayRepo("pweisenburger", "maven")                                            
                                                                                                       
libraryDependencies += "de.tuda.stg" % "rescala_2.11" % "0.19.0" 

With sbt 0.13.13, which is built only against scala 2.10, but you guys do not have rescala_2.10 in here https://dl.bintray.com/rmgk/maven/de/tuda/stg/

my sbt info

> about
[info] This is sbt 0.13.13
[info] The current project is {file:/Users/prayagupd/possibilities/programming/s2/apple/}apple 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6

So, when I try to define some Vars in sbt console, I get following java.lang.NoSuchMethodError error. Which I believe is a scala version issue, as rescala uses 2.11, while the sbt loads 2.10. Correct me if I'm wrong.

scala> import rescala._
import rescala._

scala> val var1 = Var(1)
java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;
	at rescala.parrp.ParRP.preparationPhase(ParRP.scala:61)
	at rescala.engines.PlanImpl$$anonfun$1.apply(PlanImpl.scala:54)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
	at rescala.engines.PlanImpl$class.plan(PlanImpl.scala:53)
	at rescala.engines.EngineImpl.plan(EngineImpl.scala:13)
	at rescala.engines.PlanImpl$class.subplan(PlanImpl.scala:28)
	at rescala.engines.EngineImpl.subplan(EngineImpl.scala:13)
	at rescala.engines.Ticket$.apply$extension(Ticket.scala:22)
	at rescala.reactives.Var$.apply(sources.scala:75)
	at rescala.engines.Engine$Var$.apply(Engine.scala:37)
	at .<init>(<console>:10)
	at .<clinit>(<console>)
	at .<init>(<console>:7)
	at .<clinit>(<console>)
	at $print(<console>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:734)
	at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:983)
	at scala.tools.nsc.interpreter.IMain.loadAndRunReq$1(IMain.scala:573)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:604)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:568)
	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:760)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:805)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:717)
	at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:581)
	at scala.tools.nsc.interpreter.ILoop.innerLoop$1(ILoop.scala:588)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:591)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:882)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:837)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:837)
	at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:837)
	at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:904)
	at xsbt.ConsoleInterface.run(ConsoleInterface.scala:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:107)
	at sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:82)
	at sbt.Console.sbt$Console$$console0$1(Console.scala:22)
	at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:23)
	at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
	at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
	at sbt.Logger$$anon$4.apply(Logger.scala:84)
	at sbt.TrapExit$App.run(TrapExit.scala:248)
	at java.lang.Thread.run(Thread.java:745)

Initial Evaluation Is Not Logged Any More

@rmgk thanks for your refactoring! I have one issue with it. The initial evaluation of a Signal is not logged any more. Beforehand, the reEvaluate function returned the new value. The currentValue field was initialised by calling this function. The function then logged the evaluation events. Now, this is not longer the case. The currentValue field is initialised with the initialValue function, which does not log any events at all. Is there any good reason for it? Since the initial evaluation is also an evaluation, we definitely need to log that. Hence, we need some refactoring here in order to make it work. But I first wanted to ask for the reasons behind this design decision.

By the way, this has changed in commit 3a4b112.

Fix default signal and event expressions in Scala.js for old REScala version (v0.33.1)

ScalaLoci still depends on REScala v0.33.0 as the last version to support Scala 2.11 because some early ScalaLoci case require Scala 2.11. For now, I would just keep the old 2.x code with a dependency on v0.33.0 around and update to a newer version for 3.x.

The problem is just that v0.33.0 broke Scala.js support for the cases studies (seems to be a problem with the combination of some REScala refactoring, the JS compiler plugin and the reactive macros). I pushed a v0.33.1 tag to fix this (see the test cases for the problem). If we could publish the rescalaJVM/JS artifacts of this version (and with classfiles compatible with JDK8, sorry ...), that would keep some ancient code working ;-)

Calling now after map blows up

Hello! Thank you for this awesome library! :)

When I do this in ScalaJS (JVM is the same..):

object Main {

  def main(args: Array[String]): Unit = {

    val bla$ = Signal { "whatever" }

    val nesto = bla$.map { e =>
      content()
    }
    println("DONE", nesto.now)
  }

  val isEdit$ = Var(false)
  def content() = {
    val e2 = isEdit$.map(x => x)
    println(e2.now) // HERE!
  }
}

I get:

Throwables.scala:18 Uncaught java.lang.IllegalStateException: ba.sake.rxtags.example.Main.main nesto:17(rescala.levelbased.LevelState@4) has an error value
    at $f_Lrescala_reactives_Signal__readValueOnce__Lrescala_core_Scheduler__O (file:///C:/projects/sake/RxTags/examples/target/scala-2.13/examples-fastopt.js:9332:63)
    at $c_Lba_sake_rxtags_example_Main$.main__AT__V (file:///C:/projects/sake/RxTags/examples/target/scala-2.13/examples-fastopt.js:780:29)
    at $s_Lba_sake_rxtags_example_Main__main__AT__V (file:///C:/projects/sake/RxTags/examples/target/scala-2.13/examples-fastopt.js:721:38)
    at file:///C:/projects/sake/RxTags/examples/target/scala-2.13/examples-fastopt.js:24188:1
    at file:///C:/projects/sake/RxTags/examples/target/scala-2.13/examples-fastopt.js:24189:4

Any idea how to fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.