- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Calling Scala compiler in memory without a file system
Sun, 2009-05-10, 00:29
Is it possible to call the Scala compiler programmatically and get back
bytecodes all in memory without writing to the filesystem?
Thanks
David
Sun, 2009-05-10, 06:07
#2
Re: Calling Scala compiler in memory without a file system
Thanks! Thats what I was looking for. I'll give it a shot, but if anyone has
a working example they can share that would help.
-d
Paul Phillips wrote:
>
> On Sat, May 09, 2009 at 04:29:34PM -0700, dvydra wrote:
>> Is it possible to call the Scala compiler programmatically and get
>> back bytecodes all in memory without writing to the filesystem?
>
> Look at what the interpreter does:
>
> val virtualDirectory = new VirtualDirectory("(memory)", None)
> [...]
> val comp = new nsc.Global(settings, reporter)
> comp.genJVM.outputDir = virtualDirectory
>
Mon, 2009-05-18, 10:47
#3
Re: Calling Scala compiler in memory without a file system
I've made some progress, but for some reason my virtualDirectory is empty. I
checked in code here: http://github.com/vydra/gae-scala/tree/master You can
run the tests with ant test after setting up the appropriate env vars.
When running in verbose mode the compiler seems to write into the right
place, so I am confused.
Thanks
David
On Sat, May 09, 2009 at 04:29:34PM -0700, dvydra wrote:
> Is it possible to call the Scala compiler programmatically and get
> back bytecodes all in memory without writing to the filesystem?
Look at what the interpreter does:
val virtualDirectory = new VirtualDirectory("(memory)", None)
[...]
val comp = new nsc.Global(settings, reporter)
comp.genJVM.outputDir = virtualDirectory