Git Product home page Git Product logo

st-js's Introduction

Strongly-Typed Javascript (STJS)

Build Status

STJS is an open source (Apache 2.0 licensed) Javascript code generator from a Java source. It is built as a Maven plugin that can be executed after the compilation of your Java code.

Our full website can be found at http://st-js.org

Compiling the Project

ST-JS compiles with the traditional mvn install command, but it currently needs both Java 6 - that is the default JDK on the command line when you call the Maven command, but also Java 8 to compile the generator-plugin-java8 artifact. To achieve this, you need to to configure the environment variable JAVA8_HOME that points to the home of your JDK 8 home folder.

Notes on Primitives+Arrays Support

Arrays

AnyNonPrimitiveType[] is Array

String[] a = {"a", "b"};
var a = ["a", "b"];

Multidimensional arrays

float[][][] arr = new float[1][2][3];
Object[][][] objarr = new Object[][][]{ new String[][]{ { "hello" }, { "world" }, new String[]{} }, new Integer[][]{ { 1, 2 }, { 3, 4 } }, new Double[4][5] };
var arr = Array.apply(null, Array(1)).map(function(){return Array.apply(null, Array(2)).map(function(){return new Float32Array(3);});});"
var objarr = [[["hello"], ["world"], []], [[1, 2], [3, 4]], Array.apply(null, Array(4)).map(function() { return Array(5);})];

Primitive Arrays

Java JavaScript
boolean[] Int8Array
byte[] Int8Array
short[] Int16Array
char[] Uint16Array
int[] Int32Array
float[] Float32Array
double[] Float64Array
long[] Array

Foreach

Enhanced for loop over Java arrays will iterate over values instead of keys

String[] msg = {"hello", "world"};
for(String s : msg) {
	console.log(s);
}
var msg = ["hello", "world"];
for(var index$s = 0, arr$s = msg; index$s < arr$s.length; index$s++) {
	var s = arr$s[index$s];
	console.log(s);
}

long

There is no support for 64bit integer type in JavaScript. Max value for an integer is 2^53-1

> Number.MAX_SAFE_INTEGER
9007199254740991

char

char is stored in Java as unsigned short so it is in st-js primitive support.

char[] in st-js is Uint16Array.

The following side effects appear:

String a = "hello worl";
char c = 'd';
String result = a + c;
var a = "hello worl";
var c = 'd'.charCodeAt(0); //looks ugly but compatible
var result = a + String.fromCharCode(c);
char c = 'a';
byte b = (byte) c;
var c = 'a'.charCodeAt(0);
var b = c << 24 >> 24;

float and double

Are considered equivalent no attempt for Java compatibility is made.

primitive type casting

Java JavaScript
int to short ((i)<<16>>16)
int to byte ((i)<<24>>24)
int to char ((i)&0xfff)
int to long var l = i
int to float var f = i
int to double var d = i
short to byte ((s)<<24>>24)
short to char ((s)&0xfff)
short to int var i = s
short to long var l = s
short to float var f = s
short to double var d = s
byte to short var s = b
byte to char var c = b
byte to int var i = b
byte to long var l = b
byte to float var f = b
byte to double var d = b
char to byte ((c)<<24>>24)
char to short var s = c
char to int var i = c
char to long var l = c
char to float var f = c
char to double var d = c
long to byte ((l)<<24>>24)
long to short ((l)<<16>>16)
long to char ((l)&0xfff)
long to int var i = l|0
long to float var f = l
long to double var d = l
float to byte ((f)<<24>>24)
float to short ((f)<<16>>16)
float to char ((f)&0xfff)
float to int var i = f|0
float to long var l = stjs.trunc(f)
float to double var d = f
double to byte ((d)<<24>>24)
double to short ((d)<<16>>16)
double to char ((d)&0xfff)
double to int var i = d|0
double to long var l = stjs.trunc(d)
double to float var f = d

st-js's People

Contributors

acraciun avatar asendari avatar bondarenko avatar charlesdemers avatar denysbabii avatar ekaspi avatar eyalkaspi avatar ghostler avatar janscheible avatar jonathanmelly avatar lumixen avatar mbaron avatar npiguet avatar onigoetz avatar prmx avatar rusakovam avatar slayer-b avatar zhuker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

st-js's Issues

Command line tool now gives an exception after compiling the code

Version 3 of the command line tool now gives the following message after running the Java compiler:

java.lang.NoClassDefFoundError: com/sun/source/tree/Tree

This indicates that the tool somehow couldn't find part of the source code tools that are part of the JDK. This error persists even after adding the JAR file [JDKDIRECTORY]/lib/tools.jar in the CLASSPATH (where the class com.sun.source.tree.Tree is defined).

This didn't happen with version 2 of the command line tool.

tutorial doesn't Maven-build

Following the tutorial to the letter yields Java compile errors because the classes of the shared-3.0.0.jar cannot be found. Adding that dependency by hand doesn't help. Would it be an idea to have a working Maven module in a repository?

Array#forEach and Iterable#forEach

Using stjs 3.0.0 and java 8, this sample :

$array("a", "b", "c").forEach((element) -> {
    console.log(element)
});

throws the following compile time error :

both method forEach(java.util.function.Consumer<? super T>) in java.lang.Iterable
and method forEach(org.stjs.javascript.functions.Callback1<V>) in org.stjs.javascript.Array match

This is definitely not something which can't be worked around, but it's still sad to not be able to use lambda with such an important method.

An alias Array#$forEach could be a good solution ?

Constructor functions are missing

Some of the constructor functions are missing from the bridges. The most useful ones that are missing are:

Array (15.1.4.3)
String (15.1.4.4)
Boolean (15.1.4.5)
Number (15.1.4.6)
Date (15.1.4.7)
RegExp (15.1.4.8)

These are useful because they provide quick conversion between types in javascript. Given that they can be called both with and without the "new" operator, and that practically speaking adding the new Operator doesn't seem to change the behavior, we could simply add these as static methods to a Global bridge Object.

There are many other such constructors (Object, Function, Error, TypeError, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError), but How they should be declared in Java seems a bit more difficult to determine, so it will take a lot more effort to include in the bridge.

st-js produces pack js with an invalid dependency order

Test Case 1:

package test;
public class A_Gretting {
    public String message = "hello, world!";
}
package test;
import org.stjs.javascript.Global;
public class Z_Test {
    public static void main(String[] args) {
        Global.alert(new A_Gretting().message);
    }
}

st-js produces pack js with correct dependency order:

var A_Gretting = function(){};
stjs.extend(A_Gretting, null, [], function(constructor, prototype){
    prototype.message = "hello, world!";
    prototype.equals=JavalikeEquals;}, {});


var Z_Test = function(){};
stjs.extend(Z_Test, null, [], function(constructor, prototype){
    constructor.main = function(args) {
        alert(new A_Gretting().message);
    };
    prototype.equals=JavalikeEquals;}, {});

if (!stjs.mainCallDisabled) Z_Test.main();

Test Case 2:

If i rename Z_Test.java to X_Test.java st-js produces pack js with an invalid dependency order:

var X_Test = function(){};
stjs.extend(X_Test, null, [], function(constructor, prototype){
    constructor.main = function(args) {
        alert(new A_Gretting().message);
    };
    prototype.equals=JavalikeEquals;}, {});

if (!stjs.mainCallDisabled) X_Test.main();

var A_Gretting = function(){};
stjs.extend(A_Gretting, null, [], function(constructor, prototype){
    prototype.message = "hello, world!";
    prototype.equals=JavalikeEquals;}, {});

@Template and ordinary classes

Can we have generated javascript object field assignment from bean style java properties declaration with @template (value="toProperty")?
For example:

public class ClassWithBeanStyleProperties {
    private String sp;

    @Template(value = "toProperty")
    public String getStringProperty(){
        return sp;
    }

    @Template(value = "toProperty")
    public void setStringProperty(String val){
        sp=val;
    }

    public String testMethod(){
        ClassWithBeanStyleProperties c = new ClassWithBeanStyleProperties();
        c.setStringProperty("Hellow");
        return c.getStringProperty();
    }
}

generated js code is not correct now :

var ClassWithBeanStyleProperties = function(){};
stjs.extend(ClassWithBeanStyleProperties, null, [], function(constructor, prototype){
    prototype.sp = null;
    prototype.getStringProperty = function() {
        return this.sp;
    };
    prototype.setStringProperty = function(val) {
        this.sp = val;
    };
    prototype.testMethod = function() {
        var c = new ClassWithBeanStyleProperties();
        c.setStringProperty = "Hellow";
        return c.getStringProperty;
    };
}, {});

must be :

var ClassWithBeanStyleProperties = function(){};
stjs.extend(ClassWithBeanStyleProperties, null, [], function(constructor, prototype){
    prototype.sp = null;
    prototype.testMethod = function() {
        var c = new ClassWithBeanStyleProperties();
        c.sp = "Hellow";
        return c.sp;
    };
}, {});

Bridging to a "continue" javascript method.

Hi and thanks for this project.

I am discovering st-js and I'm bridging the IndexedDB api.
There is a method that is called "continue" and it is a keyword in java so I could not map it.

I don't know if there is an easier way to do it but I ended up creating a $continue method and, adding and using a new Template type as in this commit: twitwi@540dec0

It is probably not perfect as I'm discovering st-js and maybe useless (if there was already another way).
Any feedback is welcome.

Allow @Native Annotation on methods

@Native is currently (2.1.0) only allowed on constructors.

It would be great if it would work the same way for methods as it does for constructors, it allows the usage of the same methods on the vm (server) and on the client (js). The concrete implementation of the more specific method is only used for the java vm, and not generated in js.

Issue with automatic script includes in st-js tests

it may happen that script imports in st-js tests appear in incorrect order.
For example, we have class SQW with some static fields and Switch annotated with @namespace("SQW.forms"). That way after the build it will look like as if we had package SQW and package SQW.forms with some classes inside these packages. Object SQW should be created prior to object Switch (here I mean objects representing classes). Otherwise there will be a problem: object SQW will overwrite object SQW created by statement stjs.ns("SQW.forms") used to contain Switch object.
Still, there might be a situation where SQW is actually created after stjs.ns("SQW.forms").

See the example:

package com.swissquote.bank.web.js.dialogs;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.stjs.testing.annotation.ScriptsAfter;
import org.stjs.testing.driver.STJSTestDriverRunner;

import com.swissquote.bank.web.js.FoxDummyInclude;
import com.swissquote.bank.web.js.DummySQW;
import com.swissquote.bank.web.js.DummySwitch;

@RunWith(STJSTestDriverRunner.class)
@ScriptsAfter({
"/js/jquery-1.7.2.min.js","/jquery.mockjax.js", "/json2.js", "/js/stjs-adapter.js", 
"/js/date.format.js", "/sqw-components/js/jquery/ui/jquery.ui.datepicker.js"
})
public class TestStjsInculdesIssue {

    @Test
    public void test() {        
        DummySwitch dummySwitch = new DummySwitch();
    }

}
package com.swissquote.bank.web.js;

import com.swissquote.bank.web.js.DummySwitch;

public class FoxDummyInclude {

}
package com.swissquote.bank.web.js;

public class DummySQW {

    @SuppressWarnings("unused")
    private static String $;

    public static void main(String[] args) {
        DummySQW.$ = "DummySQW";
    }

}
package com.swissquote.bank.web.js;

import org.stjs.javascript.annotation.Namespace;

@Namespace("DummySQW.forms")
public class DummySwitch  {

}

Iterable and Iterator are not supported

The java enhanced for loop only works for Array and Map in stjs. It is impossible for any of our javascript class to Implement Iterable or Iterator because stjs doesn't recognize those classes as being compilable to js.

Given that the enhanced for loop is a java language feature that requires those two interfaces, I stjs should provide a JS translation of these two interfaces.

Array methods beginning with "$" won't compile via the command line

I found that the command line tool refuses to compile methods of org.stjs.javascript.Array that begin with "$", such as "$put" and "$get". However, other methods compile just fine, such as "join" and "indexOf".

Compounding this issue is the lack of documentation for the command line tool (see issue #27).

instanceof doesn't work with interfaces or subclasses

the java instanceof keywork doesn't work when applied to an interface argument.

If I type

myObject instanceof SomeInteface

then STJS generates

myObject.constructor == SomeInterface

This works fine when the right hand side argument of instanceof is a Class, but fails when it is an interface.

access to outer scope from lambdas

example

public MyClass {
private int field;

public void method(){
Callback0 c = () -> console.info(field);
}
}

in this case the generator should complain as "field" belongs to the outer scope

Js file generation error in project with annotation processor

When I tried to use annotation processor (it is just a stub, sample projects here https://dl.dropboxusercontent.com/u/51283446/err-sample.zip ) in my project, I have got error:
[maven-plugin:generate]
The POM for org.st-js:stjs-generator-plugin-java8:jar:3.0.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Generating JavaScript files to /home/Joy/NetBeansProjects/ST-JS/err-sample/app/target/classes
warning: No SupportedAnnotationTypes annotation found on test.AProcessor, returning an empty set.
/home/Joy/NetBeansProjects/ST-JS/err-sample/app/src/main/java/test/app/App.java [1:1]: java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.tools.javac.main.JavaCompiler.resolveIdent(JavaCompiler.java:571)
at com.sun.tools.javac.model.JavacElements.nameToSymbol(JavacElements.java:157)
at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:139)
at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:47)
at org.stjs.generator.javac.AnnotationHelper.getAnnotationInHelperClass(AnnotationHelper.java:69)
at org.stjs.generator.javac.AnnotationHelper.getAnnotationInHelpers(AnnotationHelper.java:64)
at org.stjs.generator.javac.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
at org.stjs.generator.GenerationContext.getAnnotation(GenerationContext.java:257)
at org.stjs.generator.javac.TreeWrapper.getMethodTemplate(TreeWrapper.java:184)
at org.stjs.generator.check.declaration.MethodDeclarationTemplateCheck.visit(MethodDeclarationTemplateCheck.java:18)
at org.stjs.generator.check.declaration.MethodDeclarationTemplateCheck.visit(MethodDeclarationTemplateCheck.java:14)
at org.stjs.generator.visitor.TreePathScannerContributors$ContributorHolder.visitContributors(TreePathScannerContributors.java:258)
at org.stjs.generator.visitor.TreePathScannerContributors$ContributorHolder.visit(TreePathScannerContributors.java:251)
at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:187)
at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:75)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:83)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:117)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:592)
at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:75)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:83)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:104)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:478)
at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
at org.stjs.generator.Generator.generateJavascript(Generator.java:176)
at org.stjs.maven.AbstractSTJSMojo.execute(AbstractSTJSMojo.java:229)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

JQuery Event classes doesn't have the originalEvent property

It seems that org.stjs.javascript.jquery.Event doesn't have the originalEvent property.

we have used the following class (and the corresponding ugly casts) as a workaround:

public abstract class OriginalEventAwareEvent extends Event {
public Event originalEvent;
}

Where Event is org.stjs.javascript.jquery.Event

Make ST-JS play well with webjars

There is already a great way of packaging JavaScript source code with maven: The webjars repository: http://www.webjars.org/

ST-JS is currently ignoring this existing infrastructure in different ways:

  • by default stjs-maven-plugin doesn't build Servlet 3 compatible jars (it doesn't make use of the special properties of META-INF/resources). This means that users need to do all sorts of strange manipulations in their webapp jars to server ST-JS javascript files.
  • ST-JS bridges package their own version of the javascript libraries they bridge. They could instead declare the correct webjars dependency, making it easier for webapplications that already use webjars to figure out the correct version of Javascript dependencies
  • ST-JS TestDriverRunner doesn't specifically support webjars or META-INF/resources, forcing users to explicitly manually define scripts that they depend on.

ST-JS should try to improve on this situation.

HEAD doesn't Maven-build

Running a Maven clean install-build on HEAD causes an error because of an annotation applied to the package in package-info. Are you using CI (@pre-push)?

Also, following the tutorial with the pre-build plugins @ Maven central does not lead to a working build of that code - hence the attempt to use HEAD.

st-js does not work on Java 5

Maven, when running on JRE 5, complains about an unknown "-s" flag when running stjs. When Maven runs on JRE 6 but the build itself is 1.5, various class file version problems occur.

Suggested solution: require Java 6 for ST-JS projects, and put that in the documentation ;)

Maven plugin "pack" error

I have got an error when build project with latest st-js maven plugin snapshot.
Sample project here https://dl.dropboxusercontent.com/u/51283446/err-sample.zip


Building app 1.0-SNAPSHOT


[resources:resources]
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /home/Joy/NetBeansProjects/ST-JS/err-sample/app/src/main/resources

[compiler:compile]
Compiling 1 source file to /home/Joy/NetBeansProjects/ST-JS/err-sample/app/target/classes

[maven-plugin:generate]
Generating JavaScript files to /home/Joy/NetBeansProjects/ST-JS/err-sample/app/target/classes
Generated 1 JavaScript files in 1259 ms
Feb 2, 2014 7:20:30 PM org.stjs.generator.STJSClass loadProperties
SEVERE: CANNOT find:org/stjs/javascript/Global.stjs clazz:null


BUILD FAILURE


Total time: 3.244s
Finished at: Sun Feb 02 19:20:30 GMT 2014
Final Memory: 10M/101M


Failed to execute goal org.st-js:maven-plugin:3.0.1-SNAPSHOT:generate (main) on project app: Error when packing files:This resolver assumed that the javascript for the class [org.stjs.javascript.Global] was already generated -> [Help 1]

typeof operator

We found interesting behaviour of a piece of code containing Global.typeof() invocation.
In class BaseTypeFormatters.java, line 87 (revisions prior to 4541), we have the following code:

if (Global.typeof(dateAndTime).equals("string"))

which is translated into JS in the following way:

if (typeof(dateAndTime).equals("string"))

For java programmers it looks like invoke method typeof of the Global class, than invoke method equals on the result of previous invocation, and it seems to be what we actually want.
But in JS typeof is an operator which has lower priority than property access and function invocation. JS code listed above could be written in more comprehensible but equal form:

if (typeof dateAndTime.equals("string"))

This expression has another semantics and caused an error in the Java code listed above. But in other cases (if class Date has equals() method) it may not fail but cause bugs that are very difficult to understand...
I am not very familiar with the way STJS generates code for such a case, but simple () brackets around typeof operator can solve the problem.

I hope, this report will help for further improvement of STJS framework.

Problems with command line generation with nested packages

Hello,

I've some trouble generating the JS for nested Java Classes via the command line artifact.

A IllegalArgumentException is always thrown for various classes when generating the source, stacktrace below. When all Java classes are annotated with @STJSBridge it works fine, but as I understood the purpose of @STJSBride is bridge a native JavaScript function?

Also when I move all classes to the root package (no nested packages anymore) it works fine.

The Java classes are all there, have constructors and compile fine, the following call is used to generate the classes (artifacts compiled from SVN).

/home/florian/bin/st-js-command-line-2.1.0-SNAPSHOT/bin/st-js /home/florian/workspace/st-js-test/src /home/florian/workspace/st-js-test/libs ./compiled-js

Stacktrace:

java-to-javascript:
     [exec] Note: /home/florian/workspace/st-js-test/src/nefos/core/event/EventEmitter.java uses unchecked or unsafe operations.
     [exec] Note: Recompile with -Xlint:unchecked for details.
     [exec] Exception in thread "main" org.stjs.generator.JavascriptFileGenerationException: The usage of the class nefos.core.event.EventEmitter is not allowed. If it's one of your own bridge types, please add the annotation @STJSBridge to the class or to its package.(BaseApp.java:7)
     [exec]     at org.stjs.generator.scope.ScopeBuilder.identifyQualifiedNameExprClass(ScopeBuilder.java:594)
     [exec]     at org.stjs.generator.scope.ScopeBuilder.
processNonAsteriskImportDeclarations(ScopeBuilder.java:181)
     [exec]     at org.stjs.generator.scope.ScopeBuilder.visit(ScopeBuilder.java:194)
     [exec]     at org.stjs.generator.Generator.parseAndResolve(Generator.java:219)
     [exec]     at org.stjs.generator.Generator.generateJavascript(Generator.java:99)
     [exec]     at org.stjs.command.line.CommandLine.generate(CommandLine.java:57)
     [exec]     at org.stjs.command.line.ProjectCommandLine.generate(ProjectCommandLine.java:34)
     [exec]     at org.stjs.command.line.ProjectCommandLine.main(ProjectCommandLine.java:26)
     [exec] Caused by: java.lang.IllegalArgumentException: The usage of the class nefos.core.event.EventEmitter is not allowed. If it's one of your own bridge types, please add the annotation @STJSBridge to the class or to its package.
     [exec]     at org.stjs.generator.type.ClassLoaderWrapper.typeNotAllowedException(ClassLoaderWrapper.java:72)
     [exec]     at org.stjs.generator.type.ClassLoaderWrapper.checkPackageAllowed(ClassLoaderWrapper.java:88)
     [exec]     at org.stjs.generator.type.ClassLoaderWrapper.checkAndAddResolvedClass(ClassLoaderWrapper.java:108)
     [exec]     at org.stjs.generator.type.ClassLoaderWrapper.loadClass(ClassLoaderWrapper.java:63)
     [exec]     at org.stjs.generator.type.ClassLoaderWrapper.loadClassOrInnerClass(ClassLoaderWrapper.java:120)
     [exec]     at org.stjs.generator.scope.ScopeBuilder.identifyQualifiedNameExprClass(ScopeBuilder.java:591)
     [exec]     ... 7 more
     [exec] Result: 1

Thx!

Anonymous class instantiation losing it's type

When instantiating and overriding members or fields of a class it's type detail get lost.

Example:

public class DateWrapper {
   public Date internalDate;
   public long getMillis() {
      return internalDate.getTime();
   }
   public static long staticGetMillis(DateWrapper inst) {
      return inst.getMillis();
   }
   public static void main(String[] args) {
      staticGetMillis(new DateWrapper(){{
         internalDate = new Date();
      }});
   }
}

Throws error: getMillis is not defined.

The generator outputs:

DateWrapper.staticGetMillis({internalDate: new Date()});

Thus passing a untyped object to the static method.
A more desired result might be:

DateWrapper.staticGetMillis(stjs.copyProps({internalDate:new Date()}, new DateWrapper()));

OR via stjs.typefy

DateWrapper.staticGetMillis(stjs.typefy({internalDate:new Date()}, new DateWrapper()));

ST-JS initializes integers to null, not 0

ST-JS compiles the following class:

public class Test {
  int variable;
  public Test(){}
  @Override public String toString(){
    return "Variable is "+variable;
  }
}

into this:

var Test = function() {

};
stjs.extend(Test, null, [], function(constructor, prototype){
    prototype.variable = null;
    prototype.toString = function() {
        return "Variable is " + this.variable;
    };
}, {});

Note that "variable" is declared as int, yet the code generator initializes it to null rather than 0 ("prototype.variable = null"). This may cause unexpected errors at runtime, which wouldn't be the case in the original Java.

JUnit @Test.expected field is not supported

In unit tests, the JUnit @Test.expected annotation field is not supported. This makes it difficult to test exceptional cases.

Currently the only workaround is to design your tests this way:

@Test
public void test(){
    boolean exceptionThrown = false;
    try{
        // test code that is supposed to throw something
    } catch(Exception e){
        exceptionThrown = true;
    }
    if(!exceptionThrown){
        throw new RuntimeException("Excepted exception, but none was thrown");
    }
}

This is of course a bit ugly and should be handled by st-js, either by directly supporting @Test.expected in stjs, or introduce another @ExceptionExcepted annotation defined by st-js that takes no parameter (since st-js's current support for exceptions is pretty barebones).

Bridge and pack in Maven

I have a one bridge class. The class is annotated with @globalscope. I also have a package-info.java file annotated with @STJSBridge. It is a bridge, therefore I don't want to have a generated JavaScript file for it. The file is not generated as expected but "pack" option in Maven plugin set to "true" requires the generated file and throw an error when executing:

[ERROR] Failed to execute goal org.st-js:maven-plugin:1.3.1:generate (main) on project xyz: Error when packing files:/xyz/target/xyz-1.0-SNAPSHOT/generated-js/client/bridges/package-info.js (No file or directory)

Java keywords in Enums

Can we have annotation on Enums like @Lovercase and @uppercase or maybe better @RemoveSimbol(value="$") to generate js from Enums with java keywords.

@RemoveSimbol(value="$")
enum WithKeywords {
   $boolean,$float;
}

generated

var WithKeywords = stjs.enumeration(
    "boolean",
    "float"
);

Suggested additions for command-line tool documentation

Any documentation for the command-line tool should state that a Java SDK (JDK) is needed to run it. Currently it gives an unhelpful error message about a NullPointerException.

In addition, the command-line tool should check if ToolProvider.getSystemJavaCompiler() returns null. If it does, the tool should provide a message that the user should install a JDK, include the JDK's bin directory in the PATH environment variable, and run the tool from that JDK, not a JRE, since it won't include a Java compiler.

floating point division mistakenly transformed into an integer division

The following java method

private void testDivision() {
    double a = 1.0 / 2;
    double b = 1 / 2.0;
    double c = 1.0 / 2.0;
    double d = 1 / 2;
}

is translated by STJS to the following javascript function:

prototype.testDivision = function() {
        var a = 1.0 / 2;
        var b = stjs.trunc(1 / 2.0);
        var c = 1.0 / 2.0;
        var d = stjs.trunc(1 / 2);
    };

the second division (var b...) is treated by STJS as an integer division when it shouldn't be.

Cannot find symbols from the same package

Tried everything. Changing settings, resets, different maven setups. No luck.. my code wont compile anymore. :(

Any ideas?

Main

package com.company;

import org.stjs.javascript.functions.Callback0;

public class Main {

    public static void main(String[] args) {
        Integer i = 10;

        com.company.Unit unit = new com.company.Unit(10, 10);
        unit.x += 1;

        Callback0 test = new Callback0() {
            @Override public void $invoke() {

            }
        };

        unit.lamda();
    }
}

Unit

package com.company;

import org.stjs.javascript.Array;
import org.stjs.javascript.JSCollections;
import org.stjs.javascript.JSGlobal;
import org.stjs.javascript.JSObjectAdapter;
import org.stjs.javascript.functions.Callback0;
import org.stjs.javascript.functions.Function;

public class Unit {

    public static enum TEST_ENUM {
        A,B,C
    }

    public int x;
    public int y;
    private int myPrivateVar;
    protected int myProtectedVar;

    public Unit (int x, int y) {
        this.x = x;
        this.y = y;
        myPrivateVar = 10;
        myProtectedVar = 20;
    }

    public void outer () {
        int i = 1;
    }

    public void lamda () {
        final Array<String> list = JSCollections.$array();

            int n = 20;
            JSObjectAdapter.$js("x = 10;");
            JSObjectAdapter.$js("x = n;");
    }

    public void checkEnum (TEST_ENUM e) {
        switch (e) {
            case A:
            case B:
            case C:
                break;
        }
    }
}

Trace

[DEBUG] Configuring mojo 'org.st-js:maven-plugin:3.0.3:generate' with basic configurator -->
[DEBUG]   (f) buildOutputDirectory = C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes
[DEBUG]   (f) compileSourceRoots = [C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\src\main\java]
[DEBUG]   (f) generateArrayHasOwnProperty = true
[DEBUG]   (f) generateSourceMap = false
[DEBUG]   (f) includes = [**/*.java]
[DEBUG]   (f) pack = true
[DEBUG]   (f) project = MavenProject: groupId:STJS-Test:1.0-SNAPSHOT @ C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\pom.xml
[DEBUG]   (f) staleMillis = 0
[DEBUG] -- end configuration --
[INFO] Generating JavaScript files to C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes
[DEBUG] Classpath:C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\bridge\html\5.0.bv2\html-5.0.bv2.jar
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\shared\3.0.0\shared-3.0.0.jar
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\server\3.0.3\server-3.0.3.jar
[DEBUG] Generating C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes\com\company\Unit.js
[DEBUG] Generating C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes\com\company\Main.js
C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\src\main\java\com\company\Main.java:10: error: cannot find symbol
        com.company.Unit unit = new com.company.Unit(10, 10);
                   ^
  symbol:   class Unit
  location: package com.company
C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\src\main\java\com\company\Main.java:10: error: cannot find symbol
        com.company.Unit unit = new com.company.Unit(10, 10);
                                               ^
  symbol:   class Unit
  location: package com.company
[ERROR] C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\src\main\java\com\company\Main.java [1:1]: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to javax.lang.model.element.ExecutableElement
java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to javax.lang.model.element.ExecutableElement
    at org.stjs.generator.javac.TreeUtils.elementFromUse(TreeUtils.java:432)
    at org.stjs.generator.check.expression.MethodInvocationOuterScopeCheck.visit(MethodInvocationOuterScopeCheck.java:36)
    at org.stjs.generator.check.expression.MethodInvocationOuterScopeCheck.visit(MethodInvocationOuterScopeCheck.java:22)
    at org.stjs.generator.visitor.TreePathScannerContributors$ContributorHolder.visitContributors(TreePathScannerContributors.java:258)
    at org.stjs.generator.visitor.TreePathScannerContributors$ContributorHolder.visit(TreePathScannerContributors.java:251)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:187)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
    at com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:243)
    at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1302)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
    at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:81)
    at com.sun.source.util.TreeScanner.scan(TreeScanner.java:91)
    at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:162)
    at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:918)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
    at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:81)
    at com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:144)
    at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:800)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
    at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:81)
    at com.sun.source.util.TreeScanner.scan(TreeScanner.java:91)
    at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:99)
    at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:133)
    at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:720)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:18)
    at com.sun.source.util.TreeScanner.scan(TreeScanner.java:91)
    at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:99)
    at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:120)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:550)
    at org.stjs.generator.visitor.TreePathScannerContributors.visit(TreePathScannerContributors.java:189)
    at org.stjs.generator.visitor.TreePathScannerContributors.scan(TreePathScannerContributors.java:202)
    at org.stjs.generator.Generator.generateJavascript(Generator.java:177)
    at org.stjs.maven.AbstractSTJSMojo.execute(AbstractSTJSMojo.java:240)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Generated 1 JavaScript files in 733 ms
[DEBUG] Classpath:C:\Users\Alex\Documents\CustomWars Tactics\STJS-Test\target\classes
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\bridge\html\5.0.bv2\html-5.0.bv2.jar
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\shared\3.0.0\shared-3.0.0.jar
[DEBUG] Classpath:C:\Users\Alex\.m2\repository\org\st-js\server\3.0.3\server-3.0.3.jar
[DEBUG] com.company.Main is a bridge. Don't add it to the pack file
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.816 s
[INFO] Finished at: 2015-01-11T22:25:51+01:00
[INFO] Final Memory: 19M/143M

ST-JS code generator misinterprets "0xFFFF" as "0xFFF"

The ST-JS command line tool translates the following code:

class STJSIssue {
  public static int func(int x){
    return (((int)x) & 0xFFFF);
  }
}

to this:

 var STJSIssue = function(){};
    stjs.extend(STJSIssue, null, [], function(constructor, prototype){
      constructor.func = function(x) {
         return ((stjs.trunc(x)) & 0xFFF);
      };
 }, {});

Note that "0xFFFF" was changed to "0xFFF". The workaround is to change "0xFFFF" to 65535.

stjs.trunc

wrong truncate of big numbers. ex 1413492112445

Method calls with arguments containing the XOR operator (^) won't compile

The following code won't compile:

class STJSIssue {
  public int test(int x){
    return 0;
  }
  public int test2(int x){
    int y=1;
    return test(x^y);
  }
}

This is because the call to test contains the argument x^y, with the XOR operator. Calling test(x|y) or calling test(x&y) or writing the workaround int z=x^y; return test(z); won't trigger this issue.

Array.slice(start, end) Appears Broken in 3.0.1

I ran into problems where my Java code uses the implementation of Array in share-3.0.1.jar, so I wrote this test in one of my test classes. This does not pass for me, b is empty :/

@Test
public void slice_simple() {
    Array<String> a = JSCollections.$array("1", "2", "3", "4");
    Array<String> b = a.slice(1, 2);

    assertEquals("1,2,3,4", a.toString());  // make sure I have sliced and not spliced
    assertEquals("2,3", b.toString());
}

The implementation of this method may have an incorrect test in an if statement:

    if (s <= e) {

I couldn't find any JUnit tests for this class in the repo (https://github.com/st-js/st-js/tree/master/shared/src/test/java/org/stjs/javascript), I'm happy to submit a pull request that starts a test class if you would find that helpful.

Integer division: "a/=b" not treated like "a=a/b"

The following code:

int a=500;
int b=200;
a/=b;
a=a/b;
return a;

is converted to:

var a = 500;
var b = 200;
a /= b;
a = stjs.trunc(a / b);
return a;

Note that "a/=b" isn't converted to use truncating integer division, as it should, even though it's the same as "a=a/b".

maven-plugin: @STJSBridge classes are counted as generated javascript files

Here is an extract from my build:

[DEBUG] Generating /jslib/JstreeEventHandler.js
[DEBUG] Generating /jslib/JQueryUIDrag.js
[DEBUG] Generating /jslib/twitter/Widget.js
[DEBUG] Generating /jslib/AnimateOptions.js
[DEBUG] Generating /jslib/twitter/TwitterWidgetConfig.js
[DEBUG] Generating /jslib/Jstree.js
[DEBUG] Generating /jslib/RSVP.js
[DEBUG] Generating /jslib/ToffException.js
[DEBUG] Generating /jslib/ToffWindow.js
[DEBUG] Generating /jslib/FormattersBridge.js
[DEBUG] Generating /jslib/JQueryUIDragData.js
[DEBUG] Generating /jslib/Console.js
[DEBUG] Generating /jslib/ToffGlobalJQuery.js
[DEBUG] Generating /jslib/FoxGlobal.js
[DEBUG] Generating /jslib/Point.js
[DEBUG] Generating /jslib/ToffJQuery.js
[DEBUG] Generating /jslib/twitter/TwitterWidgetFeaturesConfig.js
[DEBUG] Generating /jslib/DatePickerPlugin.js
[DEBUG] Generating /jslib/CometD.js
[DEBUG] Generating /jslib/STJSUtils.js
[DEBUG] Generating /jslib/ExtendedAjaxParams.js
[DEBUG] Generating /jslib/CometDMessage.js
[DEBUG] Generating /jslib/JstreeConfigurationOptions.js
[DEBUG] Generating /jslib/JQueryUITabEvent.js
[DEBUG] Generating /jslib/Math.js
[DEBUG] Generating /jslib/JQueryXHR.js
[DEBUG] Generating /js/drilldown/ElementEx.js
[DEBUG] Generating /js/drilldown/DocumentEx.js
[DEBUG] Generating /js/data/Storage.js
[INFO] Generated 29 JavaScript files in 249 ms

Most of the files that are listed in this output are classes annotated with @STJSBridge which do not need to be translated (and actually correctly aren't translated).

However, the ST-JS maven plugin counts them when doing it's short incremental build status report. On top of this, it counts them even when they have not been modified for ages. Bridges should be excluded from the "Generated X JavaScript files" report.

Support for Java Marker Interfaces

Hi,
currently it seems to be impossible to implement Java marker interfaces in a STJS class, f.ex. java.io.Serializable.
We use st-js to share code between client (js-vm) and server (jre) so it would be great if there was a possibility to tell the compiler to ignore java marker interfaces like the java.lang.* classes.

JSException cannot be used as value of @Test.expected

When I write the following code in one of my JUnit tests, I get a javascript generation error

@Test(expected = org.stjs.testing.JSException.class)
    public void testConstructByArrayHighBoundIsNull() {

the maven error I get is the following

The usage of the class org.stjs.testing.JSException is not allowed. If it's one of your own bridge types, please add the annotation @STJSBridge to the class or to its package. (org.st-js:maven-plugin:1.3.0:generate- test:test:process-test-classes)

I get the same problem if I import org.stjs.testing.JSException and use JSException.class instead of using the fully qualified class name.

Log the way generator found java sources to process

Hi, please add some more logging for end user for diagnosing the way generator is searching java sources to process, e.g. "using compile source root c:\work\projects\myproject\src"
"using include filter */.java"
"using exclude filter *_/_Test.java"
"processing HelloWorld.java"
This feature can help override maven plugin configuration parameters.

Java Parser Encoding

The Generator class instantiates a Java parser using the default platform encoding.
Do we have (I guess no) a mean to set the encoding to read java files ?

Generator line 180:
// parse the file
cu = JavaParser.parse(in);

It could be nice to have a mean to specifiy this platform encoding through GeneratorConfiguration ou Generator ?

Could be :

cu = JavaParser.parse(in, encodingFromConfiguration);

Upgrade maven pack possibility to create a file per "main class"

For now it is only possible to generate js files per java class or all classes in one js. In our application we have a couple of pages which have a dependency to 3 or 4 st-js js files. So this is no problem to define the dependencies by hand.

But there are three pages will have 20 or 30 dependencies. And there will be heavy development. So classes will come and go ;-). So i don't want to manage these dependencies by hand. Pack is for these dependencies by far the better solution.

When we will use the maven pack we end up with a huge js files with 60-90 classes inside which are not needed for the actual page.

A proper solution would be to generate a js file per java class with a public main defined. I haven't looked inside how st-js starts these "main classes" on the js side. SO i don't know for now if it would be possible to have multiple mains on one html page. But i think even if only one main per page is supported the generation per main would be a great feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.