GithubHelp home page GithubHelp logo

linecode / clue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cluelang/clue

0.0 1.0 0.0 279 KB

C/Rust like programming language that compiles into Lua code

License: MIT License

Lua 0.70% Rust 99.30%

clue's Introduction

image

Clue is a programming language that compiles into Lua code with a syntax similar to languages like C or Rust.

Clue tries to be almost as simple as Lua (with only a slightly more advanced syntax) but adds many optional features that can make code look better or make some things (like metatables) easier to code.

Clue does not compile to a specfic version of Lua: flags can be toggled to alter the output to allow most if not all versions or modifications of Lua to be compiled to with Clue.

General syntax differences

  • Code blocks are now inside {} instead of then/do/repeat and end/until
  • Comments are made with // ... or /* ... */

If you want a complete documentation of every change and addition in Clue check the wiki.

Example code

print("Hello world!")

local fn add(x, y) {
    return x + y
}

global n = 1

while n < 10 {
    n += add(n, n)
    if n == 3 {continue}
    print(n)
}

More examples can be found in the wiki or you can check an example program made with LOVE using Clue. More examples will be added soon.

How to install

Using PowerShell (admin perms required)

  1. Paste and run the below line in your PowerShell
md $Env:ProgramFiles\Clue -f >$null&&iwr((iwr https://api.github.com/repos/ClueLang/Clue/releases?per_page=1).Content|ConvertFrom-Json).assets[0].browser_download_url -o "$Env:ProgramFiles\Clue\clue.exe"&&[Environment]::SetEnvironmentVariable('Path',$Env:PATH+";$Env:ProgramFiles\Clue",'Machine')
  1. Type clue in your PowerShell to run the compiler, it will explain the rest

Manual insallation

  1. Download the latest release and save it somewhere
  2. Open your system environment variables
  3. Add the path to the directory that contains clue.exe in the PATH variable
  4. Type clue in your cmd/PowerShell to run the compiler, it will explain the rest

More coming soon!

There are still some features that I'm considering adding and others that will be added soon. The most likely ones to be added in the future are:

  • macro
  • struct

For any suggestion or bug you can make a github issue.

I hope Clue will be useful to you :)

Why is Clue named Clue?

I have no clue.

clue's People

Contributors

crim-dev avatar maiori44 avatar

Watchers

 avatar

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.