Skip to content
/ jasmine Public

The Jasmine programming language. Working on branch next

License

Notifications You must be signed in to change notification settings

onlycs/jasmine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Jasmine Programming Language

My computer science class forces me to use the absolutely horrid Java programming language. Because of this, I decided to make my own programming language that compiles to Java source code. I called it Jasmine

Features

  • Functions
  • Loops
  • Variables
  • Expressions
  • Statements
  • Structures
  • Functions on structures (impls)
  • [] Traits (interfaces)
  • Enums
  • Auto-Expansion of fn main() to public static void main(String[] args)
  • Math
  • If-let statements (for enums only)
  • Match statements (for enums only)
  • Nice builtins
  • [] Type casting (not planned)
  • Idk what else should be here, but probably, yes!

Usage

A Rust-like programming langauge that transpiles to Java

Usage: jasmine [OPTIONS]

Options:
  -n, --program-name <name>  Java class name [default: JasmineProgram]
  -r, --skip-rewrite         Just print (or save) the AST
  -i, --input <INPUT>        Input file [default: program.jasmine]
  -s, --save                 Save the file
  -h, --help                 Print help (see more with '--help')
  -V, --version              Print version

Examples

Note: Untested

Hello World

fn main() {
	println("Hello, World!");
}

Fibonacci

fn fib(n: int) -> int {
	if n == 0 {
		return 0;
	} else if n == 1 {
		return 1;
	} else {
		return fib(n - 1) + fib(n - 2);
	}
}

fn main() {
	println("{}", fib(10));
}

About

The Jasmine programming language. Working on branch next

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published