All Projects → nerdsupremacist → Llamalang

nerdsupremacist / Llamalang

Licence: mit
Repository for the Llama Programming Language. Work In Progress

Programming Languages

python
139335 projects - #7 most used programming language
language
365 projects

Projects that are alternatives of or similar to Llamalang

Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (+200%)
Mutual labels:  interpreter, runtime
Apple Juice Actionscript
Pure .NET 2.0 code Implementation of the ActionScript3 compiler and runtime. Can be used to run scripts in environments where "just-in-time compilation" is not possible
Stars: ✭ 112 (+1766.67%)
Mutual labels:  interpreter, runtime
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+23716.67%)
Mutual labels:  interpreter, runtime
Openj9
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Stars: ✭ 2,802 (+46600%)
Mutual labels:  interpreter, runtime
WARDuino
A dynamic WebAssembly VM for embedded systems
Stars: ✭ 51 (+750%)
Mutual labels:  interpreter, runtime
quickjs-build
Build for QuickJS JavaScript Engine
Stars: ✭ 25 (+316.67%)
Mutual labels:  interpreter, runtime
Wasm Micro Runtime
WebAssembly Micro Runtime (WAMR)
Stars: ✭ 2,440 (+40566.67%)
Mutual labels:  interpreter, runtime
openj9
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Stars: ✭ 2,973 (+49450%)
Mutual labels:  interpreter, runtime
Ph7
An Embedded Implementation of PHP (C Library)
Stars: ✭ 422 (+6933.33%)
Mutual labels:  interpreter, runtime
Kube Rs
kubernetes rust client and futures controller runtime
Stars: ✭ 613 (+10116.67%)
Mutual labels:  runtime
Messagethrottle
A lightweight Objective-C message throttle and debounce library.
Stars: ✭ 710 (+11733.33%)
Mutual labels:  runtime
Sci
Configurable Clojure interpreter suitable for scripting and Clojure DSLs.
Stars: ✭ 596 (+9833.33%)
Mutual labels:  interpreter
Iosproject
iOS project of collected some demos for iOS App, use Objective-C
Stars: ✭ 5,357 (+89183.33%)
Mutual labels:  runtime
Raftlib
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators
Stars: ✭ 717 (+11850%)
Mutual labels:  runtime
Druntime
Low level runtime library for the D programming language
Stars: ✭ 608 (+10033.33%)
Mutual labels:  runtime
Runtime
A Swift Runtime library for viewing type info, and the dynamic getting and setting of properties.
Stars: ✭ 736 (+12166.67%)
Mutual labels:  runtime
Typescript Is
Stars: ✭ 595 (+9816.67%)
Mutual labels:  runtime
Sysbox
Sysbox repository
Stars: ✭ 596 (+9833.33%)
Mutual labels:  runtime
Pry
A runtime developer console and IRB alternative with powerful introspection capabilities.
Stars: ✭ 6,351 (+105750%)
Mutual labels:  runtime
Springboot Learning
🚕 spring boot学习案例,方便spring boot 初学者快速掌握相关知识
Stars: ✭ 724 (+11966.67%)
Mutual labels:  interpreter

alt text

Llama Programming Language

Repository for the Llama Programming Language. This is a Programming Language I'm defining since I wanted to try out Python and always wanted to make one. ;)

The name is actually an Acronym:

The Llama Language is Awesome, Man. Awesome

It's still a work in progress. For any cool ideas just make an issue and feel free to fork this project and work on it as you like.

As soon as I'm done with the Interpreter I will probably get a few friends to help me write a full compiler.

So far it's really simple:

Run it

This repository provides an Interpreter for the Language. If you want to use it you have to options

Run a file

To run a file just type in your commandline:

./llama <filename>

REPL

You can also run the language in an interactive toplevel just type:

./llama

And the terminal will run it. Now you can enter your code line by line and get instant feedback :D

The Language

Datatypes:

  • Number (float or int)
  • String
  • Bool
  • Function
  • Arrays (Any Type)
  • Dictionaries

Define a variable:

let myString = "My String"
let myNumber = 42
let myArray = [42, 1337]
let myDict = { x: 42, y: 1337 }
let isLlamaAwesome = true
Arrays

Important to note that arrays are not bound to specific datatypes.

Meaning you could create an Array:

let myWeirdArray = [42, "Leet", true, [42, 1337], myOtherVar, myFunction]

To get something from your array use the bracket notation:

let myArray = [42, 1337]
let leet = myArray[1]
Dictionaries

Dictionaries, much like javascript Objects, store Data using String as Keys. To access data you can either use the bracket notation or the "." notation.

let myDict = {
  answer: 42,
  info: 1337,
  sub: {
    hero: "Marty McFly"
  }
}

let answerOfTheUltimateQuestion = myDict.answer
// or
let heroName = myDict["sub"]["hero"]

Write a Comment:

Llama only allows for one line comments


// This is a comment

let myVar = 42 // This is an inline Comment

Define a function

let square = x -> x * x

so that:

square 25 // 625 (Number)

Functions are obviously First Class Citizens:

let redundant = f x -> f (f (f x))
let yell = x -> x + "!"
let hello = "Hello"

redundant yell hello // "Hello!!!"

Control

To take decisions you can use if then else and recursion to create very complex programs

For instance take this small function to calculate the n Factorial:

let fac = n ->
  if n = 0 then
    1
  else
    n * (fac (n-1))

Or for those who like writing things short, there's the ? notation:

let fac = n -> n = 0 ? 1 : n * (fac (n-1))

Note: Our Interpreter can only take one line at the time for now.

More Examples

It works great with tail recursion. For example if you want to calculate the n-th Result of the Fibonacci Sequence:

let helper = n a b ->
  if n = 0 then
    b
  else
    helper (n-1) (a+b) a

let fib = n -> helper n 1 0

Mathematical Operations Supported:

let a = 1
let b = 2

a + b
a - b
a * b
a / b
a ** b // Stands for a^b

Compare Data

let a = 5
let b = 4

a = b // false (That's right a single one)
a != b // true

Boolean Logic

let a = true
let b = false
a & b // false
a | b // true

Standard Library

The interpreter will immediately load our own functions into your code before running. Our standard functions include:

  • print (For Standard Output to the Console)
  • more coming
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].