Help with compiling TypeScript using nashorn

Marcus Lagergren marcus.lagergren at
Mon Mar 2 13:45:20 UTC 2015


I’ve looked briefly at trying to run the Typescript compiler as you described. Can you indicate in more detail the process you go through to reproducible problem? Not sure how to install and use the current Microsoft distribution with Jake as you describe below. If you have some example setup that we can download and use, with step-by-step instructions that’d be ideal. I can run the typescript compler 


> On 01 Mar 2015, at 23:18, Marcus Lagergren <marcus.lagergren at> wrote:
> Hi Dan!
> Interesting to hear about your project. It sounds very cool. 
> I, personally, haven’t tried to play around with the Microsoft type script compiler on Nashorn much lately. I did play around with it a few months back. We should proably get it into the test suite in some form other than the Octane Typescript benchmark. I know Attila was doing some debugging in this benchmark last week, he might have some more recent experience.
> My limited TS experience with Nashorn consists mostly of working with our thesis student Andreas Gabrielsson (thesis available to the public very soon) on a frontend that parses typescript and emits it as bytecode using Nashorn as the runtime, not with the industry standard TS compiler as such. Andreas might have more info for you about the current status, as he did a lot of typescript/javascript compilation using the typescript compiler during the thesis. 
> I’ll try to find time this week (or someone on the team) to play with the latest typescript to javascript compiler and see if we have a bug here. I’ll file an issue if this is the case.
> A quick look at twitter seems to indicate that people are successfully doing things with the TypeScript compiler on Nashorn right now. For example: 
> <>
> We’ll investigate and get back to you as soon as we can.
> /M
>> On 10 Feb 2015, at 14:25, Dan Bar-Yaakov <danbaryak at> wrote:
>> Hi
>> Marcus, thanks for the reply in LinkedIn. following that, here is a brief
>> description of what I'm trying to do:
>> I work for Luminis Technologies. We build open source components for
>> building modular web applications using OSGi (The Amdatu
>> <> Project). We would like to add some components that
>> automatically compile frontend resources written in multiple languages
>> (typescript, coffeescript, lescss, sass etc.). As the first stage we would
>> like to get typescript working, as it's common in many projects that use
>> our stack. Since we want to do it automatically on each change, speed is
>> critical. That's why I was very glad to learn about your latest nashorn
>> performance enhancements.
>> To get started I've tried compiling the microsoft TypeScript distribution
>> (using Jake) and running it using jjs as I've seen in some examples online
>> (j*js tsc.js --optimistic-types=true -- hello.ts* for example) and got the
>> following error:
>> tsc.js:20361 TypeError: Cannot read property "args" from undefined
>> got the same thing when trying in Java code.
>> If it is indeed already possible to compile TS using nashorn, I'd really
>> appreciate any help you can provide on how to do so.
>> Many thanks,
>> Dan

More information about the nashorn-dev mailing list