These are chat archives for scala-android/sbt-android

4th
Mar 2017
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 17:21
Hi guys, thanks to the project's maintainers. It works like a charm, I could create small applications and make them run in my tablet in a Sunday evening without any previous knowledge on Android thanks to how easy is to use android-sbt
However, I found what I think it is a huge constraint: It seems that it is not possible to use Scala's reflection package since it makes use of java.rmi. Am I mistaken?
Perry
@pfn
Mar 04 2017 17:31
scala reflection package is terrible
there's no reason to ever use it
there are hacks to possibly make it work
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 17:33
@pfn I agree on the fact that reflection should be avoided like the plague. But I need it for a very specific reason: Make use of TookBox to interpret text code at runtime
Rafal Wachol
@charafau
Mar 04 2017 17:57
@pfcoperez what's tookbox ?
Xavier Fernández Salas
@xavier-fernandez
Mar 04 2017 17:59
@pfcoperez have you ever heard of ScalaMeta?
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 18:01
@charafau It is part of the scala-compiler package and is a class allowing, among other things, to parse and evaluate Scala code http://www.scala-lang.org/api/2.11.8/scala-compiler/#scala.tools.reflect.ToolBox
@xavier-fernandez No, I haven't heard of that. But I've just opened its site and it looks promising
is it able to evaluate the code once parsed?
(in run time I mean)
Rafal Wachol
@charafau
Mar 04 2017 18:07
oh it's scala reflect thing. never touched it
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 18:17
@xavier-fernandez It seems it currently support parsing, analysis and re-writing
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 18:25
@pfn Concerning those hacks you mentioned, what would you suggest? Kind of trying to replicate the source code?
Perry
@pfn
Mar 04 2017 19:23
basically you would add stubs of the missing objects
@pfcoperez,
and yeah, don't parse and run code at runtime....
Perry
@pfn
Mar 04 2017 19:36
why are you trying to evaluate arbitrary code anyway
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 19:43
@pfn I'd like to build an off-line (no need of sending code to an execution server) Scala REPL application for Android. I'd like to have an environment for my tablet and phone on which I could try some snippets and algorithms
Xavier Fernández Salas
@xavier-fernandez
Mar 04 2017 19:43
Scalameta is your library then
Pablo Francisco Pérez Hidalgo
@pfcoperez
Mar 04 2017 19:45
@xavier-fernandez does it allow running the parsed code? I've been walking through its introduction tutorial as well as playing with it in a REPL but could't find a way of running the parsed code
@pfn A desperate measure could be trying to extract java.rmi classes from the openjdk source code and build a jar with them to include as unmanaged library. But I fear that those classes will bring more dependencies ... I might take a look
Perry
@pfn
Mar 04 2017 21:56
not the solution, @pfcoperez - - just stub them out