Coder Social home page Coder Social logo

lunarlang / lunar Goto Github PK

View Code? Open in Web Editor NEW
40.0 5.0 1.0 661 KB

Lunar was a superset programming language of Lua 5.1 with optional static typing, inspired by TypeScript and Ruby.

Home Page: https://discord.gg/CHFC3pS

License: Apache License 2.0

Lua 99.07% PowerShell 0.30% Shell 0.59% Batchfile 0.05%
programming-language lunar-lang lua-superset lunarlang lunar

lunar's People

Contributors

alexmccord avatar ayuka avatar headjoe3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

headjoe3

lunar's Issues

Initial Release Roadmap

TODO: Not a lot of things have been properly tracked before this, so it is difficult to catch everything that has been completed thus far. Additionally, credits have not been properly given as I'm unsure who is responsible for what. If you are responsible for something that is not credited, please let me know immediately. Also, if something is improperly checked (or not), please let me know about that too.

  • Class support @Apakovtac
    • Allow classes to extend from other classes
  • Importing and Exporting between scripts @headjoe3
  • Self-assignment operators @Apakovtac
  • Type system
  • Create issue and pull request templates #37 @ChasingSpace
    • Upon an unexpected error, link user to the New Issue page with the error message written out already.
  • Standalone executable binaries for Windows and Linux @ChasingSpace
    • Update CI build to fetch the latest release instead of using lib which includes an older version of Lunar for compiling.
  • Rewrite the Lunar compiler (lunarc) #39 @ChasingSpace @Apakovtac

Lunar compiler rewrite

This rewrite is geared towards having a proper command line interface using argparse.

  • Options
    • -p --project A path leading to a directory containing a .lunarconfig file.
    • -o --out-dir The name of the output directory. This will be created if it does not exist.
  • Flags
    • --install Installs lunarc to the system, where it can then be used from anywhere.
    • --uninstall Uninstalls lunarc from the system.
    • -w --watch Starts watching the project for any saved changes, and triggers compilation for that file.
    • -v --version Displays the current version of lunarc

Semicolons that separate expression statements are not preserved

(function() print(1) end)();
(function() print(2) end)()

Transpiles to

(function() print(1) end)()
(function() print(2) end)()

In this instance, the semicolon would need to be preserved, or else the transpiled code will attempt to call the the result of print(1) with the argument (function() print(2) end)

Export does not work properly

Exporting functions or classes just appends the name to the return table with no value.

Input

export function name() end

Expected

function name() end
return {name = name}

Actual

function name() end
return {name}

Restrict usage of return statements in a class constructor

We should throw a syntax error for using return [exprlist] unless it's in a function inside of the constructor.

So the following should become illegal, because it would abruptly return out of a constructor.

class C
  constructor()
    return -- illegal return statement
    return 123 -- also illegal return statement
  end
end

But the following should remain legal, because it doesn't interfere with the constructor.

class C
  constructor()
    local function something()
      return 1
    end
    self.something = something()
  end
end

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.