Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Commands subset/ORM-like #178

Open
Mte90 opened this issue Jun 12, 2024 · 3 comments
Open

[Feature] Commands subset/ORM-like #178

Mte90 opened this issue Jun 12, 2024 · 3 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@Mte90
Copy link
Member

Mte90 commented Jun 12, 2024

User can create kind of libraries as wrapper to most common commands and many of them can be shipped by Amber natively.

As example ffmpeg, youtube-dl or find to be able to generate commands automatically without using pure Bash.

An example:

find "$1" -type f ( -iname *.mp3 -o -iname *.flac ) -print0

This can generated with find()->file()->ext(['mp3', 'flac'])->print()

In this way Amber can generate a command that works like everywhere (some GNU commands on OSX are different like sed) and the user write more amber then bash, otherwise there is no useful reason to use Amber.

I can call it like a ORM or CliRM.

@Ph0enixKM
Copy link
Collaborator

So you propose to create a query parser inside of Amber? I think we could implement macros to Amber so this would be easily programmable. We could also create the whole query language as well but I'm not sure if that's a good idea since it's better to give the programmer building blocks and let them build a library that can do some ORM-like queries as a separate project.

@Mte90
Copy link
Member Author

Mte90 commented Jun 12, 2024

I think that for some commands can be helpful to have them natively and others instead that are external, like contrib-commands.

As example the GNU commands like mv/cd/ls/find/cat/mkdir etc should be native in the language.

In this way this can be a language and you don't need tons of $command$ in your amber because at that point I can write more fast in bash.

Take this example: https://github.com/Mte90/My-Scripts/blob/master/dev/lsp-installer/install.ab

Probably can simplified with some functions to avoid to repeat them but bash scripts are full of this commands so a way to write more easily is not bad.

@Mte90
Copy link
Member Author

Mte90 commented Jun 12, 2024

Looking at the docs there is no way right now to write a Class but for something like that can be useful in the language itself.

@Mte90 Mte90 added help wanted Extra attention is needed question Further information is requested labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants