nit-compiler

Now Is Time compiler. Compiles and makes accessible dynamic code from a Java API

License

License

GroupId

GroupId

io.teknek
ArtifactId

ArtifactId

nit-compiler
Last Version

Last Version

0.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

nit-compiler
Now Is Time compiler. Compiles and makes accessible dynamic code from a Java API
Source Code Management

Source Code Management

https://github.com/edwardcapriolo/nit-compiler

Download nit-compiler

How to add to project

<!-- https://jarcasting.com/artifacts/io.teknek/nit-compiler/ -->
<dependency>
    <groupId>io.teknek</groupId>
    <artifactId>nit-compiler</artifactId>
    <version>0.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/io.teknek/nit-compiler/
implementation 'io.teknek:nit-compiler:0.0.4'
// https://jarcasting.com/artifacts/io.teknek/nit-compiler/
implementation ("io.teknek:nit-compiler:0.0.4")
'io.teknek:nit-compiler:jar:0.0.4'
<dependency org="io.teknek" name="nit-compiler" rev="0.0.4">
  <artifact name="nit-compiler" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.teknek', module='nit-compiler', version='0.0.4')
)
libraryDependencies += "io.teknek" % "nit-compiler" % "0.0.4"
[io.teknek/nit-compiler "0.0.4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.codehaus.jackson : jackson-mapper-asl jar 1.9.13
log4j : log4j jar 1.2.15

provided (3)

Group / Artifact Type Version
org.codehaus.groovy : groovy-all jar 2.1.9
org.clojure : clojure jar 1.5.0
org.mozilla : rhino jar 1.7R4

test (1)

Group / Artifact Type Version
junit : junit jar 4.8.2

Project Modules

There are no modules declared in this project.

nit-compiler

Now Is Time Compiler.

An easy way to leverage interpreted JVM languages from java. As well doing URL classloading, reflection, and hot-loading. NitWraps this up into a single project.

Support for JavaScript, Clojure, Groovy, URL Class loading, and Scala. Up next Jython, JRuby.

Usage

Nit lets you eval a string and compile it into code using one of several interpreted languages.

@Test
public void constructAClosure() throws NitException {
  NitDesc n = new NitDesc();
  n.setSpec(NitDesc.NitSpec.GROOVY_CLOSURE);
  n.setScript("{ tuple -> println(tuple); return 1 }");
  Closure c = NitFactory.construct(n);
  Assert.assertEquals(1, c.call("dude"));
}

@Test
public void constructANoArgCllass() throws NitException {
  NitDesc n = new NitDesc();
  n.setSpec(NitDesc.NitSpec.JAVA_LOCAL_CLASSPATH);
  n.setTheClass("java.lang.Object");
  Object o = NitFactory.construct(n);
  Assert.assertNotNull(o);
}

In the long run nit will (probably) do a bunch of "Crazy" stuff like compile java inside java, build jars of java compiled inside java etc.

Versions

Version
0.0.4
0.0.3
0.0.2