An experimental language for the jvm

Clone this repo:

Branches

  1. 00e9f91 fix csv write method by BradleyWood · 4 years, 8 months ago master
  2. f896086 fix csv write method by BradleyWood · 4 years, 8 months ago
  3. 40f70ac test csv writer by BradleyWood · 4 years, 8 months ago
  4. a34722a csv writer takes OutputStream as param by BradleyWood · 4 years, 8 months ago
  5. 147e316 raise repl test by BradleyWood · 4 years, 8 months ago

Raven-Lang

Intro

I have been working on a dynamically typed programming language and compiler for the JVM platform. The project is in early stages but I have successfully compiled and tested several programs.

The main goal is create a fast jvm language that lacks the verbosity of java while maintaining full interoperability.

Click here to try

Building and Running

mvn clean install assembly:single

To run a test script

java -jar target/raven-1.0-SNAPSHOT-jar-with-dependencies.jar -r <path to script>.tl

Command line options

Mutually exclusive options

Run in REPL (read-eval-print-loop) mode

-repl

Run a script

-r <path to script>

Check files for correctness

-s <path to script>

Build an executable jar

-b <path to script>

Wrapper types

Types are wrapped to enforce type conversion. Below is a list of wrapper types.

An example program to demonstrate java interop

import javax.swing.JOptionPane;

fun main() {
    JOptionPane.showMessageDialog(null, "Hello World.");
}

View more examples

Builtins

The following builtin functions are accessible globally

  1. print(var) : Prints a variable to the console
  2. println(var) : Prints a variable to the console followed by a new line
  3. println() : Prints a new line
  4. sort(list) : Sorts a list of items (assuming the elemts are comparable)
  5. vars() : A dictionary of accessible variables
  6. readLine() : Reads a line of text from the standard input stream
  7. type(var) : Returns the type of a variable
  8. str(var) : Turns a var into its string representation
  9. len(var) : Returns the size for a string, list, or dictionary
  10. int(var) : Converts a variable to an integer if possible
  11. real(var) : Converts a variable to a real number if possible
  12. sum(list) : Adds the contents of a list
  13. reverse(list) : Reverse the order of a list
  14. hash(var) : Returns the hash of the var
  15. exit(status) : terminate virtual machine

In Progress

  • Classes

    • Automatically generate constructors, getters and setters
    • Inherit from java classes and interfaces
    • Override from super class
  • Annotations and annotation processors

    • Generate adaptor methods through the @JvmMethod annotation
      • Annotation takes name, parameter types, and return type
      • Allows for java code to call our functions

Todo

  • More Unit tests

  • Import * from package

  • Static import

  • Import as