rescala-lang / rescala Goto Github PK
View Code? Open in Web Editor NEWREScala - distributed and reactive programming embedded in OO and FP programs.
Home Page: https://www.rescala-lang.com
License: Apache License 2.0
REScala - distributed and reactive programming embedded in OO and FP programs.
Home Page: https://www.rescala-lang.com
License: Apache License 2.0
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.
We need:
Hello, when using the released version 0.32.0 it seems like Var
s 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 manual: http://guidosalva.github.io/REScala/manual/
Add a search tool to search stuff in the manual
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 Var
s 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)
@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.
After #8 has been merged, all deprecation warnings should be solved. It currently works because the compat
stuff is imported: https://github.com/sprankhub/REScala/commit/36170fac34d559f79e5e72734b1dee9c6f112143#diff-33b10e506950f2f139a2e583745ff36fR19
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 ;-)
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?
After #8 has been merged, someone should have a look at this test: https://github.com/sprankhub/REScala/commit/2262eb0dcef3f768389f9bfea27594f0ffab3cf9#diff-7695f102e24dc721990174a9c8f5c2e5R243
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.