2

Question to the Linux-Users on here.
What scripting languages do you know ?.

I want to build a cli-tool, which will be configurated by code, so I want to chose a language, that is relatively wide spread, or easy to learn.

Comments
  • 5
    Python ๐Ÿ ftw
  • 0
    @Jilano
    Well, my tool will need object-structures.
    And obviously, nodejs also came to my mind since its easy, OOP and not that uncommon.

    I might be able to work around that in bash, using jshon, but that could be pretty messy.
  • 2
    Python, php, bash, the list goes on.
  • 2
    @metamourge Python sounds ideal for you, it's widely used for making CLI tools and supports objects and stuff. It's also extremely widespread and extremely easy to learn.
  • 2
    I write my cli tools in PHP :)
  • 1
    I know exactly as much Haskell as I need in order to make xmonad do what I need it to. If your tool is awesome enough you can script it in whatever you want; people will probably accept the learning curve.

    But you'd probably save untold thousands of hours for us if you went with bash/python!
  • 0
    Python has a module to set arguments to the script call and creates a -h option automatically. Of course you can implement your own solution but the module works great.
  • 0
    I do prefer and recommend Python
  • 0
    OK, so I would write it in Python, but there is one problem.
    Can I do imports relative to a modules location, like in NodeJS, instead of relative to the file, you are executing.
  • 0
    @metamourge u mean imports of libraries ? Once installed in your env or venv I shouldn’t be a problem

    Classic
    Import argparse
    Or
    From this import that
  • 0
    @kLue
    No, not like importing from your Python-Env.
    Just importing a file from somewhere in the filesystem.

    If I want to do that, the import-paths usually have to be relative to the path of the file you executed.

    Like if the executed file is in
    ~/py/start.py
    The import paths of this file and all files it imports have to be relative to ~/py/

    But I want the import-paths to be relative to the file that contains them.
  • 0
    @metamourge
    ๐Ÿค” ๐Ÿค” ๐Ÿค”sorry no idea if that’s possible
Add Comment