Giter Site home page Giter Site logo

alonely0 / voila Goto Github PK

View Code? Open in Web Editor NEW
98.0 2.0 8.0 355 KB

Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

License: MIT License

Rust 100.00%
domain-specific-language domain-specific-languages domain-specific file files directory directories folder folders cli cli-tool cli-tools cli-app cli-application

voila's Introduction

Voila forthebadge forthebadge

Contributor Covenant GitHub license Lines of code GitHub release (latest SemVer) GitHub commits since latest release (by date) GitHub Release Date GitHub last commit GitHub contributors OSS Lifecycle Crates.io Crates.io (latest) Linux build macOS build Windows build

Voila is a DSL (domain-specific language) for interacting in a fast, reliable, versatile, safe & multithreaded way with files & directories. It is based on a CLI tool, although you can write your Voila code and do something like this voila DIRECTORY "$(cat operations.vla)". Voila is mainly tested in Linux, so should work better in *nix (Linux, *BSD, macOS, etc) than in Windows-based operating systems, but shouldn't be any problems on them. Voila is completely cross-platform.

Voila scripts are interpreted, but optionally you can compile it like you'd do with other programming languages.

Documentation

You can find the docs in the wiki.

Installation

See #Installation in the docs.

Submitting

voila's People

Contributors

afgalvan avatar alonely0 avatar cg-jl avatar dependabot[bot] avatar github-actions[bot] avatar xiuxiu62 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

voila's Issues

Note on resources, and undefined behavior inside the cycles (long term planning)

Look at the below snippet:

@name == 1 {
   delete(@path)
   shell(my-useful-check @path)
}

This snippet triggers undefined behavior, as it's using a resource potentially destructively (delete will certainly do, my-useful-check might do). You don't know which one will error out, if delete or shell. It could be that shell finds the file while delete is still working on it, and you never know what will happen next.

This issue is meant to open a debate. How shall we mitigate this issue? I've thought of three options, let me know if you have any more:

  • let the undefined behavior happen (as it would in the current state) but document it (i.e say which functions are potentially destructive). This might be a good thing to do while we're developing a more useful idea into the project, to advise against known issues.
  • staticly analyze the code, and trigger an error before it's run if there are calls within the same cycle to functions which will potentially destroy the resource (using the resource would mean passing the path, or the name, to a create/delete/shell function). This seems to me as the best one of the three.
  • silently modify the code before it's run, moving each call to their own separate cycle, and probably issuing a warning that those functions won't execute concurrently because they're trying to own the same resource at one. This is not a great thing to do as you're probably hindering performance through separating the functions and actually don't know which of the functions would be desired to run first.

Final note: I don't think we should start working on this immediately, but instead come up with different ideas or expand one of them as the project matures.

Add more SHAs checksums

While surfing crates.io, I found these crates

Those crates would let us support these SHAs:

  • SHA-1 (cryptographically broken, but if MD5 is in, why not?)
  • SHA-224
  • SHA-254 (already implemented, but would be rewritten using that crate)
  • SHA-384
  • SHA-512

I'll be working in a separate branch for implementing all that.

Add tokio runtime to optimize voila and make it faster

I've been testing Voila execution times using the tokio runtime. These are the results:

  • no tokio runtime
    ➜ time ./target/debug/voila ~ '@name == @name { print(@path) }' -r
     Executed in   80.10 secs    fish           external
       usr time   59.58 secs  600.00 micros   59.58 secs
       sys time   13.80 secs  236.00 micros   13.80 secs
    
  • tokio runtime initialized on interpreter
    ➜ time ./target/debug/voila ~ '@name == @name { print(@path) }' -r
     Executed in   65.67 secs    fish           external
       usr time   58.11 secs  551.00 micros   58.11 secs
       sys time    7.39 secs  263.00 micros    7.39 secs
    
  • tokio runtime initialized on main
    ➜ time ./target/debug/voila ~ '@name == @name { print(@path) }' -r
     Executed in   64.50 secs    fish           external
       usr time   57.34 secs    0.00 micros   57.34 secs
       sys time    7.01 secs  449.00 micros    7.01 secs
    

This issue is for discussing which one should be implemented, if the one that only affects the interpreter, that is where all the async stuff resides, or implement it on all Voila's source by initializing it on main.

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.