Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Dynamically Updated Languages #52

Open
Shivansh-007 opened this issue May 17, 2021 · 0 comments
Open

Dynamically Updated Languages #52

Shivansh-007 opened this issue May 17, 2021 · 0 comments
Labels
area: languages level: 1 - intermediate This PR is suitable for intermediate users. priority: 2 - medium Medium Priority status: planning Discussing the implementation type: enhancement Changes or improvements to existing features type: feature Relating to the functionality of the application.
Milestone

Comments

@Shivansh-007
Copy link
Owner

Description

Currently, we need to update languages manually, and can sometimes get tiring. A better alternative to this is to dynamically run this every 48 hours(say), for example:

if it runs today (Monday) at 5am, it would store this time in a cached file called last_language_fetch, on every run it would check whether there has been a 48 hour gap, now the user again runs it on Wednesday 7am, which is a 50hour gap, more than the default run gap. Then it would run again and follow the same process.

Now we have talked about running the function of getting the languages, here the question comes, how will we store these languages, well of-course we cannot store them as objects, since on every run they would change so we would again be using some help of file caches, a file called languages.yml, which would store all this data, I am writing this issue talking piston v3 into picture.

The file would look something like this:

language:
  - aliases:
    - 1
    - 2
  - versions:
    - 10.1
    - 11.3

On every run, we would load this yml file and do the normal checks of version, language present or not, etc. For lexers it would look up and see if there are any lexers available for that language, if not it would find any available lexers for that language, then it would take up the text lexer and warn the user, they could either create a issue on this repository or the pygments, and get that lexer added.

Additional Details

I know this will increase the time of running, and the speed would decrease, but we could give this a try and see how does it go, if the speed is really less, we could try squash some of the features down and add flags to skip some fetches. Anyone can implement this for now, I am a bit busy, if no one takes this eventually me or @SuperMaZingCoder would do the honors. If there are any questions, you can join the Piston CLI server or dm me.

@Shivansh-007 Shivansh-007 added type: enhancement Changes or improvements to existing features help wanted Extra attention is needed level: 1 - intermediate This PR is suitable for intermediate users. status: planning Discussing the implementation area: languages area: CI Related to continuous intergration and deployment priority: 2 - medium Medium Priority type: feature Relating to the functionality of the application. labels May 17, 2021
@Shivansh-007 Shivansh-007 added this to the Dreamland milestone May 17, 2021
@Shivansh-007 Shivansh-007 added status: approved and removed status: planning Discussing the implementation labels May 17, 2021
@Shivansh-007 Shivansh-007 added status: planning Discussing the implementation and removed area: CI Related to continuous intergration and deployment help wanted Extra attention is needed status: approved labels May 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: languages level: 1 - intermediate This PR is suitable for intermediate users. priority: 2 - medium Medium Priority status: planning Discussing the implementation type: enhancement Changes or improvements to existing features type: feature Relating to the functionality of the application.
Projects
None yet
Development

No branches or pull requests

1 participant