ABS Compiler for Java

Compile ABS source to Java source

Лицензия

Лицензия

Группа

Группа

com.github.crisposs
Идентификатор

Идентификатор

jabsc
Последняя версия

Последняя версия

0.1.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

ABS Compiler for Java
Compile ABS source to Java source
Система контроля версий

Система контроля версий

https://github.com/CrispOSS/jabsc.git

Скачать jabsc

Как подключить последнюю версию

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

Зависимости

compile (8)

Идентификатор библиотеки Тип Версия
com.github.crisposs : abs-api jar 0.8.8
de.jflex : jflex jar 1.6.1
nz.ac.waikato.cms.weka.thirdparty : java-cup-11b-runtime jar 2015.03.26
nz.ac.waikato.cms.weka.thirdparty : java-cup-11b jar 2015.03.26
com.squareup : javawriter jar 2.5.1
io.airlift : airline jar 0.7
org.slf4j : slf4j-simple jar 1.7.12
org.slf4j : jul-to-slf4j jar 1.7.12

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Build Status Coverage Maven Central Tag License

jabsc

jabsc is ABS compiler to Java source.

Usage

Maven Plugin

We have an example module to use Maven plugin for jabsc.

Java

To the use the compiler API:

Compiler compiler = new Compiler(sourceDirectory, outputDirectory);
compiler.compile();

and make sure you have the proper Maven dependency:

<dependency>
   <groupId>com.github.crisposs</groupId>
   <artifactId>jabsc</artifactId>
   <version>${version.jabsc}</version>
</dependency>

Tests

Please refer to jabsc-tests for a set of examples. In addition, the feature coverage of the compiler is testing using reference examples by Haskell compiler for ABS.

The legend for the following tables:

  • ABS source is compiled to Java and its test passes.
  • ABS source is compiled to Java but its test fails.
  • ABS source is compiled to Java but its test hangs.
  • ‼️ ABS source fails to compile to correct Java.

Tests: compiler/must/

Test State Comment
Arith
AsyncToSameCOG
AwaitOnThis
AwaitOnThis2
BenchLists
BenchMaps
CatchClauseBugInOtherBackends ‼️ Unreachable code is generated.
ClassDisjointInterfs
Cosimo1
Cosimo2 Object's field reference to a "future" is changed; thus the future is lost.
Cosimo3 Same as Cosimo2
Cosimo4
CosimoAsyncRun
Equality
ExceptionCase
ExceptionMod ‼️ Local variable is not final. Structural pattern matching on exceptions not supported.
ExceptionPos ‼️ Unreachable code is generated.
Fail1
Fail2
FieldToFunc
FixBugMonadicStyle
ForeignImport
Futures
HiddenMethod
Inference ‼️
InferenceNum ‼️
Interfaces
LeaderElection
Module Multi-module in the same file not supported.
MultipleTasksPerObject
MultiScope
NonMethods
Null ‼️ Usage of Java keywords such as null.
Parens
PingPong
PromiseSimple No definitive semantics.
PureCode
RunAndNonMethods
StatefulOO
Subtyping
Subtyping2
TestAwait
TestMaps
TestRefs
TestThis
ThisSwitching
TypeSym Parametric/Algebraic types not supported.
UpcastingInt Type information not available during compilation.
While

Benchmarks

We use [abs-bench][4] repository to perform benchmarks on generated Java code from jabsc. To run the benchmarks:

  • Checkout abs-bench and switch to "jabsc" branch
$ git clone https://github.com/abstools/abs-bench.git
$ cd abs-bench
abs-bench$ git checkout jabsc
  • Run the benchmarks from jabsc root source directory
$ cd /path/to/jabsc
jabsc$ ./jabsc benchmark /path/to/abs-bench/synthetic_par/
  • The results in CSV format and a GNU Plot result will be generated in /tmp.

The latest run of the benchmarks:

jabsc Benchmarks

Build Parser/Lexer

You need the following only if you modify src/main/resources/ABS.cf to generate the Lexer and Parser:

  1. Ensure you have bnfc tool on your PATH
  2. Run clean.sh
  3. Run build.sh
  4. The build should pass

Версии библиотеки

Версия
0.1.5
0.1.4