alüla

The Programming Language

alüla Repository

About

This is alüla, the language that does away with the semicolon, but embraces the colon. alüla is a static, strongly typed programming languages that focuses on parallelism and simplicity through the standardized use of the colon. alüla takes inspiration from Python and Elm.

In many programming language, the equal sign has many contextual uses. For example, in JavaScript, a single equal sign (=) is used to declare, while a double or triple equal sign (==/===) is for different types of comparisons. The overuse of such a character can cause unnecessary confusion for beginner coders. In alüla, the equal sign is utilized, but only for the comparison of values. All declarations, statements, and function calls begin with a colon, allowing for an easier understanding for those unfamiliar with the language. In Layman's terms, anything that does something or is usable begins with a colon.

Features


General
  • All variable declarations and statements require a colon to designate the beginning
  • Parameters for functions occur after the colon, but before the curly brackets. Multiple parameters are separated with commas
  • Chained functions are separated by ->, to designate another "step"
  • Double parentheses are exclusively used for logic and arithmetic precedence
  • Functions are called with any arguments directed into the function <-
Types
  • num graduationYear: 2019
  • bool operatingSystemsIsFun: true
  • string favoriteInstructor: "Forns"
  • list[string] hobbies: ["Skiing", "Surfing", "Basketball"]
  • dict{string, num} nicknames: {"John": 51, "J": 4, "Olive": 6}
  • struct{num: age, string: breed} fluffy: {age: 5, breed: "Pitbull"}
  • undefined

Examples


Hello World

print: "Hello World"
          	

Average

Finds the average of a list of numbers

          		
function average: num list {
  num multiplied: 1
  for: i:0, i < (list -> length), i++ {
    multiplied 
  • : list[i] } return multiplied / (list -> length) }

  • Fibonacci Sequence

    Iteratively finds fibonacci number at the nth index value

              		
    function fibonacci: num position {
      num result: 1
      for: i: 1, i < (position -> length), i++ {
        result +: result
      }
      return: result
    }
    	          	
    	          

    Check Odd / Even

    Returns odd or even based on the input

              		
    function oddOrEven: num number {
      if: number % 2 == 0 {
        return: 'even'
      } else:
        return: 'odd'
    }
    	          	
    	          

    Closure

    A basic closure that finds the previous x value and multiplies it by y

              		
    function closure: num x, num y {
      currentX: x
      return: function next: {
        currentX: currentX 
  • y return: currentX } } closureVariable: closure: 3, 2 closureVariable -> next