The Cobalt programming language
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2be02ea Jul 16, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Updated documentation. May 15, 2018
out Tidied code. Jul 16, 2018
src Tidied code. Jul 16, 2018
.gitignore Removed Haskell project files. Jun 22, 2018
LICENSE resolves 492 May 20, 2018
README.md Update README.md Jun 30, 2018
build.gradle Removed Haskell project files. Jun 22, 2018
settings.gradle Removed Haskell project files. Jun 22, 2018

README.md

Cobalt

Build Status

Cobalt is an object-oriented and functional language that runs on the JVM.

The syntax is similar to languages such as Haskell and Scala.

Main Features

  • Hybrid Language - Functional/Object Oriented
  • Statically typed
  • Focusing on immutability
  • Can be used with other languages on the JVM
  • High readability

Project Contributions

To contribute to the Cobalt project, please send us a pull request from your fork of this repository!
The project is in the alpha stages please get in contact to discuss any large changes and/or features you think would be interesting to include!

Example Code

class ClassName 

    # Define a value (Immutable)
    let value: Int = 10
    
    # Define a variable (Mutable)
    let mutable variable: Int = 20
   
    # Define a method
    let method(): Int = 50 
    
    # Define a method with params (With block of code)
    let methodParams(x: Int, y: Int): Int = do
        if x > 20 then 
            100
        elif x > 10 then 
            200
        else 
            300
        
    # Function assigned to value
    let multiplyBy2 = fun (x: Int) -> x * 2
    
    # Higher order function
    let multiplyListBy2(list: List[Int]): List[Int] = list.map(multiplyBy2) 
    
    # Method with a function type as a parameter
    let functionParam(list: List[Int], x: fun Int -> Int): List[Int] = list.map(x)