Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

31
LINES

< > BotCompany Repo | #1003839 // Test Temp Program

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1506L/11K/36K).

1  
!759
2  
3  
p {
4  
  S mainJava = [[ static S calc() { ret "Hello " + "World"; } ]];
5  
  print(mainJava);
6  
  
7  
  for (int i = 1; i <= 4; i++) { time {
8  
    print("\nRun " + i);
9  
    
10  
    // transpile
11  
    transpileRaw_silent = true;
12  
    S java;
13  
    time { java = transpileRaw(mainJava); }
14  
    //print(java);
15  
    
16  
    // compile
17  
    File classesDir = javaCompile(java);
18  
    int num = numFiles_noDirs(classesDir);
19  
    long size = directorySize(classesDir);
20  
    print("Compiled to " + classesDir.getAbsolutePath() + " (" + n(num, "file") + ", " + n(size, "byte") + ")");
21  
    
22  
    // hotwire
23  
    Class main = hotwireCore(fileToURL(classesDir));
24  
    
25  
    // call
26  
    print("Hotwired! Now calling.");
27  
    S s = cast call(main, "calc");
28  
    print("Called! Result: " + quote(s));
29  
    assertEquals("Hello World", s);
30  
  }}
31  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003839
Snippet name: Test Temp Program
Eternal ID of this version: #1003839/1
Text MD5: 44c9e36269725b570b926cf4be8b00d2
Transpilation MD5: 10169770cee09ff21e9c3081a31f0328
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-28 16:36:12
Source code size: 828 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 510 / 546
Referenced in: [show references]