New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

javacoffee

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javacoffee

Coffeescript-like syntax for writing Java code

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

javacoffee

Coffeescript-like syntax for writing Java code.

npm install javacoffee -g

Please don't install yet. This is still in development!!!

Examples

Fibonacci

class Fibonacci
  # Print out the Fibonacci sequence for values < 50
  main
    lo = hi = 1
    println lo
    while hi < 50
      print hi
      hi = lo + hi
      lo = hi - lo

converts to

class Fibonacci {
  // Print out the Fibonacci sequence for values < 50
  public static void main(String[] args) {
    int lo = 1;
    int hi = 1;
    System.out.println(lo);
    while (hi < 50) {
      System.out.print(hi);
      hi = lo + hi;
      lo = hi - lo;
    }
  }
}

Point

class Point
  +double x, y
  +&origin = Point 0 0
  Point @x @y
  +clear @x = @y = 0
  +distance(Point that):double
    xDiff = x - that.x
    yDiff = y - that.y
    Math.sqrt xDiff^2 + yDiff^2

converts to

class Point {
  public double x, y; 
  public static Point origin = new Point(0,0); 
  Point(double x_value, double y_value) {
    x = x_value; 
    y = y_value; 
  }
  public void clear() {
    this.x = 0; 
    this.y = 0; 
  }
  public double distance(Point that) {
    double xDiff = x - that.x; 
    double yDiff = y - that.y; 
    return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
  }
}

How to compile

javacoffee file.jc -> file.class

How to develop

Install and keep gulp running

npm install
gulp

Test with the following:

node ./bin/javacoffee myFile.jc

Run tests

npm test

Filetype: .jc

Keywords

coffeescript

FAQs

Package last updated on 05 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts