turboscript
Advanced tools
Comparing version 1.0.0 to 1.0.1-beta
114
lib/tc.ts
@@ -1,31 +0,4 @@ | ||
#! /usr/bin/env node | ||
#! /usr/bin/env ts-node | ||
var debug = true; | ||
var stdlib = {}; | ||
global["stdlib"] = stdlib; | ||
stdlib["assert"] = function (truth) { | ||
if (!truth) { | ||
if(debug){ | ||
debugger; | ||
} | ||
console.error(new Error('Assertion failed')); | ||
process.exit(1); | ||
} | ||
}; | ||
global["assert"] = stdlib["assert"]; | ||
stdlib["Profiler_begin"] = function (name: string) { | ||
console.time(name) | ||
}; | ||
stdlib["Profiler_end"] = function (name: string) { | ||
console.timeEnd(name) | ||
}; | ||
stdlib["StringBuilder_append"] = function (a, b) { | ||
return a + b; | ||
}; | ||
stdlib["StringBuilder_appendChar"] = function (a, b) { | ||
return a + String.fromCharCode(b); | ||
}; | ||
stdlib["Uint8Array_new"] = function (x) { | ||
return new Uint8Array(x); | ||
}; | ||
const debug = true; | ||
@@ -46,80 +19,15 @@ Math["imul"] = Math["imul"] || function (a, b) { | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var SystemJS = require('systemjs'); | ||
SystemJS.defaultJSExtensions = true; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
if(!process.env.TURBO_PATH){ | ||
process.env.TURBO_PATH = path.resolve(__dirname, "../"); | ||
} | ||
global["TURBO_PATH"] = process.env.TURBO_PATH; | ||
console.log("TURBO_PATH:"+global["TURBO_PATH"]) | ||
//Import compiler | ||
require(path.resolve(process.env.TURBO_PATH, "bin/turbo.js")); | ||
const turbo = require("./turboscript.js"); | ||
SystemJS.import("main").then(function (mod) { | ||
var Color = mod.Color; | ||
var turboMain = mod.main; | ||
const Color = turbo.Color; | ||
const turboMain = turbo.main; | ||
stdlib["Terminal_setColor"] = Terminal_setColor; | ||
stdlib["Terminal_write"] = Terminal_write; | ||
stdlib["IO_readTextFile"] = IO_readTextFile; | ||
stdlib["IO_writeTextFile"] = IO_writeTextFile; | ||
stdlib["IO_writeBinaryFile"] = IO_writeBinaryFile; | ||
for (let i = 2; i < process.argv.length; i++) { | ||
turboMain.addArgument(process.argv[i]); | ||
} | ||
function Terminal_setColor(color) { | ||
if (process.stdout.isTTY) { | ||
var code = | ||
color === Color.BOLD ? 1 : | ||
color === Color.RED ? 91 : | ||
color === Color.GREEN ? 92 : | ||
color === Color.MAGENTA ? 95 : | ||
0; | ||
process.stdout.write('\x1B[0;' + code + 'm'); | ||
} | ||
} | ||
function Terminal_write(text) { | ||
process.stdout.write(text); | ||
} | ||
function IO_readTextFile(path) { | ||
try { | ||
return fs.readFileSync(path, 'utf8').replace(/\r\n/g, '\n'); | ||
} catch (e) { | ||
return null; | ||
} | ||
} | ||
function IO_writeTextFile(path, contents) { | ||
try { | ||
fs.writeFileSync(path, contents); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function IO_writeBinaryFile(path, contents) { | ||
try { | ||
fs.writeFileSync(path, new Buffer(contents.array.subarray(0, contents.length))); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function main() { | ||
for (var i = 2; i < process.argv.length; i++) { | ||
turboMain.addArgument(process.argv[i]); | ||
} | ||
process.exit(turboMain.entry()); | ||
} | ||
main(); | ||
}); | ||
process.exit(turboMain.entry()); |
{ | ||
"name": "turboscript", | ||
"version": "1.0.0", | ||
"version": "1.0.1-beta", | ||
"description": "Super charged JavaScript for parallel programming and WebAssembly", | ||
@@ -9,20 +9,46 @@ "main": "index.js", | ||
}, | ||
"dependencies": { | ||
"systemjs": "^0.19.41" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/node": "^6.0.52", | ||
"lite-server": "^2.2.2", | ||
"ts-node": "^1.7.2", | ||
"typescript": "^2.1.4" | ||
"@types/debug": "^0.0.29", | ||
"@types/fs-extra": "^2.1.0", | ||
"@types/jest": "^19.2.2", | ||
"@types/node": "^7.0.12", | ||
"@types/webassembly-js-api": "^0.0.0", | ||
"babel-jest": "^19.0.0", | ||
"debug": "^2.6.3", | ||
"fs": "^0.0.1-security", | ||
"fs-extra": "^2.1.2", | ||
"jest": "^19.0.2", | ||
"raw-loader": "^0.5.1", | ||
"request": "^2.81.0", | ||
"ts-jest": "^19.0.9", | ||
"ts-loader": "^2.1.0", | ||
"ts-node": "^3.0.2", | ||
"typescript": "^2.3.4", | ||
"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22", | ||
"uglifyjs-webpack-plugin": "^0.4.3", | ||
"webpack": "^2.6.1" | ||
}, | ||
"bin": { | ||
"tc": "lib/tc.js" | ||
"tc": "./bin/tc" | ||
}, | ||
"scripts": { | ||
"post-install": "npm run build", | ||
"build": "tsc -p ./src && tsc lib/tc.ts", | ||
"watch": "tsc -w -p ./src", | ||
"watch-lib": "tsc -w lib/tc.ts" | ||
"build": "webpack --config webpack.config.js && tsc -p ./lib", | ||
"watch-build": "webpack --progress --colors --watch", | ||
"test": "node ./node_modules/jest/bin/jest.js", | ||
"watch-test": "node ./node_modules/jest/bin/jest.js --watch" | ||
}, | ||
"jest": { | ||
"globals": { | ||
"__TS_CONFIG__": "tsconfig.base.json" | ||
}, | ||
"transform": { | ||
".(ts|tsx)": "./node_modules/ts-jest/preprocessor.js" | ||
}, | ||
"testRegex": "(\\.(test|spec))\\.(ts)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
] | ||
}, | ||
"repository": { | ||
@@ -32,3 +58,7 @@ "type": "git", | ||
}, | ||
"author": "Nidin Vinayakan", | ||
"author": "Nidin Vinayakan <01@01alchemist.com> (https://01alchemist.com)", | ||
"contributors": [ | ||
"Max Graey <maxgraey@gmail.com> (https://github.com/MaxGraey)", | ||
"Wink Saville <wink@saville.com> (https://github.com/winksaville)" | ||
], | ||
"license": "MIT", | ||
@@ -35,0 +65,0 @@ "bugs": { |
@@ -151,3 +151,3 @@ "use strict"; | ||
{path: TURBO_PATH + '/src/library/wasm/malloc.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/wasm/array.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/wasm/f32-array.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/wasm/math.tbs', code: ""}, | ||
@@ -158,3 +158,3 @@ | ||
{path: TURBO_PATH + '/src/library/asmjs/malloc.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/asmjs/array.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/asmjs/f32-array.tbs', code: ""}, | ||
{path: TURBO_PATH + '/src/library/asmjs/math.tbs', code: ""}, | ||
@@ -161,0 +161,0 @@ {path: TURBO_PATH + '/src/library/asmjs/runtime.js', code: ""}, |
@@ -0,0 +0,0 @@ /** |
@@ -93,7 +93,6 @@ /** | ||
' ', | ||
' constructor(x: float32, y: float32, z: float32): Vec3 {', | ||
' constructor(x: float32, y: float32, z: float32) {', | ||
' this.x = x;', | ||
' this.y = y;', | ||
' this.z = z;', | ||
' return this;', | ||
' }', | ||
@@ -379,23 +378,22 @@ ' ', | ||
SystemJS.import("main").then(function (exports) { | ||
backendWebAssembly.onchange = compile; | ||
backendJavaScript.onchange = compile; | ||
targetWebAssembly.onchange = compile; | ||
targetJavaScript.onchange = compile; | ||
terminal.oninput = updateTerminalContent; | ||
targetAsmJs.onchange = compile; | ||
input.oninput = compile; | ||
outputButton.onclick = function () { | ||
triggerDownload(outputName, outputContents); | ||
}; | ||
secondaryOutputButton.onclick = function () { | ||
triggerDownload(secondaryOutputName, secondaryOutputContents); | ||
}; | ||
terminalButton.onclick = runOrDownloadShim; | ||
clear.onclick = clearLog; | ||
backendWebAssembly.onchange = compile; | ||
backendJavaScript.onchange = compile; | ||
targetWebAssembly.onchange = compile; | ||
targetJavaScript.onchange = compile; | ||
terminal.oninput = updateTerminalContent; | ||
targetAsmJs.onchange = compile; | ||
input.oninput = compile; | ||
outputButton.onclick = function () { | ||
triggerDownload(outputName, outputContents); | ||
}; | ||
secondaryOutputButton.onclick = function () { | ||
triggerDownload(secondaryOutputName, secondaryOutputContents); | ||
}; | ||
terminalButton.onclick = runOrDownloadShim; | ||
clear.onclick = clearLog; | ||
compiledJavaScript = compileJavaScript(exports, libs); | ||
input.value = samples[selectedSample].content; | ||
input.selectionStart = input.selectionEnd = 0; | ||
compile(); | ||
compiledJavaScript = compileJavaScript(exports, libs); | ||
input.value = samples[selectedSample].content; | ||
input.selectionStart = input.selectionEnd = 0; | ||
compile(); | ||
@@ -413,3 +411,2 @@ // if (supportsWebAssembly()) { | ||
}); | ||
}); | ||
@@ -416,0 +413,0 @@ } |
186
README.md
# TurboScript | ||
Super charged JavaScript for parallel programming and WebAssembly | ||
[](https://travis-ci.org/01alchemist/TurboScript) []() [](https://waffle.io/01alchemist/TurboScript) [](https://greenkeeper.io/) | ||
Super charged JavaScript for parallel programming and WebAssembly | ||
[](https://waffle.io/01alchemist/TurboScript/metrics/throughput) | ||
<pre> | ||
@@ -13,11 +18,161 @@ @ _________ | ||
</pre> | ||
TurboScript is an experimental programming language for parallel programming for web which compiles to JavaScript (asm.js) and WebAssembly (targeting post-MVP). The syntax is similar to TypeScript (Hardly trying to fill the gaps) and the compiler is open source and written in TypeScript. | ||
This is still an experiment and isn't intended for real use yet. ~~The biggest issue is that the generated code currently doesn't delete anything~~ (basic manual memory management is added). Also the WebAssembly specification is still being developed and the current binary format may stop working when WebAssembly is officially released. WebAssembly binary format is up-to-date, please feel free to open issues if it stop working or need a new feature. | ||
TurboScript is an experimental programming language for parallel programming for web which compiles to JavaScript ~~(asm.js)~~ and WebAssembly (targeting post-MVP). The syntax is similar to TypeScript ~~(Hardly trying to fill the gaps)~~ and the compiler is open source and written in TypeScript. TurboScript has zero dependencies. | ||
TurboScript is forked from ThinScript and changed a lot, so there will be no going back. | ||
This is still an experiment and isn't intended for real use yet but we are working towards an MVP release. Please feel free to open issues if it stop working or need a new feature. | ||
#Roadmap | ||
## Install | ||
`npm install -g turboscript` | ||
## Syntax | ||
### variables | ||
```typescript | ||
var myGlobal:int32 = 1; | ||
let evaluatedVar:int32 = myGlobal + 1; | ||
// let is same as var. | ||
``` | ||
### Number Literals | ||
```typescript | ||
let integer:int32 = 1234; | ||
let integer64bit:int64 = 1234; | ||
let floatingPoint:float32 = 1.234f; | ||
let floatingPoint64bit:float64 = 1.234; // default floating point number is 64 bit | ||
// You can also omit type since compiler infer type from the literal | ||
let integer = 1234; // default integer is 32 bit, use type :int64 for 64 bit integer | ||
let floatingPoint = 1.234f; | ||
let floatingPoint64bit = 1.234; | ||
``` | ||
### function | ||
```typescript | ||
// add.tbs | ||
export function add(a:int32, b:int32):int32 { | ||
return a + b; | ||
} | ||
``` | ||
### class | ||
```typescript | ||
// vector3D.tbs | ||
export class Vector3D { | ||
x:float32; | ||
y:float32; | ||
z:float32; | ||
constructor(x:float32, y:float32, z:float32){ | ||
this.x = x; | ||
this.y = y; | ||
this.z = z; | ||
} | ||
} | ||
``` | ||
### Generic | ||
```typescript | ||
class Foo<T> { | ||
value:T; | ||
constructor(value:T){ | ||
this.value = value; | ||
} | ||
getValue():T { | ||
return this.value; | ||
} | ||
} | ||
export function testI32(value:int32):int32 { | ||
let instance = new Foo<int32>(value); | ||
return instance.getValue(); | ||
} | ||
export function testI64(value:int32):int32 { | ||
let value2 = value as int64; | ||
let instance = new Foo<int64>(value2); | ||
return instance.getValue() as int32; | ||
} | ||
export function testF32(value:float32):float32 { | ||
let instance = new Foo<float32>(value); | ||
return instance.getValue(); | ||
} | ||
export function testF64(value:float64):float64 { | ||
let instance = new Foo<float64>(value); | ||
return instance.getValue(); | ||
} | ||
``` | ||
### Operator overload | ||
```typescript | ||
class Vector3D { | ||
x:float32; | ||
y:float32; | ||
z:float32; | ||
constructor(x:float32, y:float32, z:float32){ | ||
this.x = x; | ||
this.y = y; | ||
this.z = z; | ||
} | ||
operator + (other:Vector3D):Vector3D { | ||
return new Vector3D(this.x + other.x, this.y + other.y, this.z + other.z); | ||
} | ||
operator - (other:Vector3D):Vector3D { | ||
return new Vector3D(this.x - other.x, this.y - other.y, this.z - other.z); | ||
} | ||
} | ||
export function test():boolean { | ||
let a = new Vector3D(1.0f,1.0f,1.0f); | ||
let b = new Vector3D(1.0f,1.0f,1.0f); | ||
let c = a + b; | ||
return c.x == 2.0f && c.y == 2.0f && c.z == 2.0f; | ||
} | ||
``` | ||
### Array | ||
```typescript | ||
// f64-array.tbs | ||
var a: Array<float64> = null; | ||
export function test(num:int32): Array<float64> { | ||
a = new Array<float64>(num); | ||
let i:int32 = 0; | ||
while (i < num) { | ||
a[i] = 0.0; | ||
i = i + 1; | ||
} | ||
return a; | ||
} | ||
export function getArrayByteLength(value:Array<float64>):int32 { | ||
return value.bytesLength; | ||
} | ||
export function getArrayElementSize(value:Array<float64>):int32 { | ||
return value.elementSize; | ||
} | ||
export function getArray(): Array<float64> { | ||
return a; | ||
} | ||
export function getData(index:int32):float64 { | ||
return a[index]; | ||
} | ||
export function setData(index:int32, value:float64):void { | ||
a[index] = value; | ||
} | ||
``` | ||
#### Compile to wasm | ||
`tc add.tbs --wasm --out add.wasm` | ||
## Join  | ||
You need an invitation to join slack. open a ticket with your email address. I will make it happen. | ||
# Roadmap | ||
* ~~Parallel JavaScript~~ | ||
@@ -28,11 +183,20 @@ * ~~WebAssembly Emitter~~ | ||
* ~~Import external functions with namespace~~ | ||
* Array Data Type | ||
* ~~Array Data Type~~ | ||
* Parallel WebAssembly (post-MVP) | ||
#Useful links | ||
* [Future WebHPC & Parallel Programming with JavaScript] (https://dump.01alchemist.com/2016/12/31/future-webhpc-parallel-programming-with-javascript-the-new-era-about-to-begin/) | ||
* [TurboScript playground] (https://01alchemist.com/projects/turboscript/playground/) | ||
# Wiki | ||
Documentations can be found at [wiki](../../wiki) (under construction :construction:) | ||
# Useful links | ||
* [Future WebHPC & Parallel Programming with JavaScript](https://dump.01alchemist.com/2016/12/31/future-webhpc-parallel-programming-with-javascript-the-new-era-about-to-begin/) | ||
* [TurboScript playground](https://01alchemist.com/projects/turboscript/playground/) | ||
* [Assembleash playground](https://github.com/MaxGraey/Assembleash/#TurboScript) | ||
#Credit | ||
# Credit | ||
Lexical analysis, Parsing, Checking codes are borrowed from Evan Wallace's thinscript | ||
# Now enjoy - Wow! this snail is fast | ||
<a href="http://www.youtube.com/watch?feature=player_embedded&v=w-SDeBoDLTg | ||
" target="_blank"><img src="https://01alchemist.com/images/Turbo-630x354.jpg" | ||
alt="Wow! this snail is fast" width="630" height="354" border="10" /></a> |
@@ -111,6 +111,6 @@ // combine kernel modules and compile | ||
console.log("TURBO_PATH:" + global["TURBO_PATH"]) | ||
console.log("TURBO_PATH:" + global["TURBO_PATH"]); | ||
//Import compiler | ||
require(path.resolve(process.env.TURBO_PATH, "bin/turbo.js")); | ||
require(path.resolve(process.env.TURBO_PATH, "lib/turbo.js")); | ||
@@ -117,0 +117,0 @@ System.import("main").then(function (mod) { |
@@ -87,3 +87,3 @@ /** | ||
if (this.flags[this.id] === 2) {//thread locked | ||
console.log("exit:1"); | ||
Terminal.write("exit:1"); | ||
this.lock(); | ||
@@ -106,3 +106,3 @@ return; | ||
if (this.locked) { | ||
console.log("restarted:" + this.iterations, "samples:" + this.checkSamples()); | ||
Terminal.write("restarted:" + this.iterations, "samples:" + this.checkSamples()); | ||
this.locked = false; | ||
@@ -160,3 +160,3 @@ } | ||
if (this.flags[this.id] === 2) {//thread locked | ||
console.log("exit:3"); | ||
Terminal.write("exit:3"); | ||
this.lock(); | ||
@@ -229,3 +229,3 @@ return; | ||
//console.time("render"); | ||
//Terminal.time("render"); | ||
/*for (var y:number = this.yoffset; y < this.yoffset + this.height; y++) { | ||
@@ -236,3 +236,3 @@ | ||
if (this.flags[this.id] === 2) {//thread locked | ||
console.log("exit:3"); | ||
Terminal.write("exit:3"); | ||
this.lock(); | ||
@@ -272,3 +272,3 @@ return; | ||
if (this.flags[this.id] === 2) {//thread locked | ||
console.log("exit:7"); | ||
Terminal.write("exit:7"); | ||
this.lock(); | ||
@@ -283,3 +283,3 @@ return; | ||
}*/ | ||
//console.timeEnd("render"); | ||
//Terminal.timeEnd("render"); | ||
} | ||
@@ -290,3 +290,3 @@ | ||
if (this.flags[this.id] === 2) {//thread locked | ||
console.log("exit:8"); | ||
Terminal.write("exit:8"); | ||
this.lock(); | ||
@@ -293,0 +293,0 @@ return; |
@@ -26,29 +26,2 @@ type byte = number; | ||
declare class ByteArray { | ||
} | ||
declare var assert:Function; | ||
declare var TURBO_PATH:string; | ||
declare namespace stdlib { | ||
var assert; | ||
function Profiler_begin(name: string); | ||
function Profiler_end(name: string); | ||
function StringBuilder_append(a, b); | ||
function StringBuilder_appendChar(a, b); | ||
function Uint8Array_new(x); | ||
function Terminal_setColor(color: any): void; | ||
function Terminal_write(text: string): void; | ||
function IO_readTextFile(path: string): string; | ||
function IO_writeTextFile(path: string, contents: string): boolean; | ||
function IO_writeBinaryFile(path: string, contents: ByteArray): boolean; | ||
} |
@@ -1,35 +0,34 @@ | ||
import {CompileTarget} from "../compiler"; | ||
import {CompileTarget} from "../compiler/compile-target"; | ||
// library files | ||
const math = require('./common/math.tbs'); | ||
const types = require('./common/types.tbs'); | ||
const array = require('./common/array.tbs'); | ||
const jstypes = require('./turbo/types.tbs'); | ||
const runtime = require('raw-loader!./turbo/runtime.js'); | ||
const wrapper = require('raw-loader!./turbo/wrapper.js'); | ||
const malloc = require('./common/malloc.tbs'); | ||
const builtins = require('./webassembly/builtins.tbs'); | ||
const initializer = require('./webassembly/initializer.tbs'); | ||
export class Library { | ||
static get(target: CompileTarget) { | ||
let lib; | ||
switch (target) { | ||
/*case CompileTarget.WEBASSEMBLY: | ||
lib = stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/types.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/foreign.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/malloc.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/math.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/array.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/wasm/typedarray/float64array.tbs") + "\n"; | ||
return lib;*/ | ||
case CompileTarget.TURBO_JAVASCRIPT: | ||
lib = stdlib.IO_readTextFile(TURBO_PATH + "/src/library/turbo/types.tbs") + "\n"; | ||
return lib; | ||
case CompileTarget.JAVASCRIPT: | ||
lib = jstypes + "\n"; | ||
break; | ||
case CompileTarget.WEBASSEMBLY: | ||
lib = stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/types.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/foreign.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/math.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/malloc.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/array.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/typedarray/float64array.tbs") + "\n"; | ||
return lib; | ||
case CompileTarget.ASMJS: | ||
lib = stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/types.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/foreign.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/math.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/malloc.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/array.tbs") + "\n"; | ||
lib += stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/typedarray/float64array.tbs") + "\n"; | ||
return lib; | ||
lib = [ | ||
types, | ||
initializer, | ||
builtins, | ||
math, | ||
malloc, | ||
array | ||
].join('\n'); | ||
break; | ||
} | ||
return lib; | ||
} | ||
@@ -39,6 +38,4 @@ | ||
switch (target) { | ||
case CompileTarget.TURBO_JAVASCRIPT: | ||
return stdlib.IO_readTextFile(TURBO_PATH + "/src/library/turbo/runtime.js") + "\n"; | ||
case CompileTarget.ASMJS: | ||
return stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/runtime.js") + "\n"; | ||
case CompileTarget.JAVASCRIPT: | ||
return runtime + "\n"; | ||
default: | ||
@@ -51,6 +48,4 @@ return ""; | ||
switch (target) { | ||
case CompileTarget.TURBO_JAVASCRIPT: | ||
return stdlib.IO_readTextFile(TURBO_PATH + "/src/library/turbo/wrapper.js") + "\n"; | ||
case CompileTarget.ASMJS: | ||
return stdlib.IO_readTextFile(TURBO_PATH + "/src/library/asmjs/wrapper.js") + "\n"; | ||
case CompileTarget.JAVASCRIPT: | ||
return wrapper + "\n"; | ||
default: | ||
@@ -60,3 +55,2 @@ return ""; | ||
} | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"module": "system", | ||
"target": "es6", | ||
"module": "commonjs", | ||
"target": "es5", | ||
"sourceMap": true, | ||
@@ -11,6 +11,6 @@ "emitDecoratorMetadata": true, | ||
], | ||
"outFile": "../bin/turbo.js" | ||
"outDir": "../.turbo" | ||
}, | ||
"files": [ | ||
"main.ts" | ||
"index.ts" | ||
], | ||
@@ -22,2 +22,2 @@ "exclude": [ | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
34458703
0
367
201
19
1
35555
3
34
25
- Removedsystemjs@^0.19.41
- Removedsystemjs@0.19.47(transitive)
- Removedwhen@3.7.8(transitive)