Giter Club home page Giter Club logo

elys's Introduction

elys

scripting language

GitHub Actions Workflow Status GitHub Actions Workflow Status

Why Elys? ๐Ÿค”

Elys is a lightweight scripting language written in Nim, designed to seamlessly integrate into various applications.

Thanks to its compact implementation, Elys can be embedded into Minecraft mods, web applications, native apps, mobile applications, and even devices like smart refrigerators.

With its simple syntax, Elys is an excellent choice for rapid prototyping and building extensible systems.

It provides easy interaction with the host application and straightforward handling of tasks such as data management, interface control, and process automation.

API

If you want to use elys in your project, then you just need to install it using nimble and use it as follows:

nimble install https://github.com/HapticX/elys
import elys

discard elys.exec("print(1)")

Hello, world! ๐Ÿ‘‹

Here's hello world program written in Elys:

print('Hello, world!')

Variables ๐Ÿงฉ

Elys supports two types of variables - var and const.

var is mutable variable. const is immutable variable

Example

var x = 10
const y = 20

x = 20  # success
y = 10  # error

If Statements โ“

if (2 + 2 * 2 == 8) {  # Order of operations as in math
  print('nope, 2 + 2 * 2 is 6 :(')
} elif (2 + 2 * 2 == 6) {
  print('yeap, 2 + 2 * 2 is 6!')
} else {
  print('???')
}

You can also use if statements as an expression to obtain a result for a variable:

var x = if (false) {
  0
} elif (false) {
  1
} else {
  2
}
print x  # will be 2

Cycles ๐Ÿ”„

Elys provides for and while cycles:

for i in 0..<10 {
  print i  # will shows numbers from 0 to 9
}

var x = 0
while x < 10 {
  x++
}
print x  # will be 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.