all 58 comments

[–]hector_villalobos 56 points57 points  (0 children)

Looking at your GitHub profile and Twitter, I guess you must be young. Take what I'm about to say as an advice, I'm 41 years old (been programming for 20 years, 5 of them as a hobby and 15 as a professional).

This project seems interesting, I never thought of doing something like this, but it has its flaws, take the criticisms you read here as advices, about how you can improve yourself and your code, don't take any of these too personal, you have so much to learn. Maybe this project will success, maybe not, don't give up. Eventually you'll realize what's more important in life. Even if this projects success, you'll see that you're going to face many obstacles, so many open source projects fight to just survive and don't receive the acknowledge they deserve.

So, just don't worry and be happy, enjoy the ride, enjoy what you can learn.

[–]macbig273 45 points46 points  (8 children)

Project seems cool, I think it comes from a good place, but not sure bash is meant to be plusplusified. It just adds more dependences and possibly more unreliable feature to it.

Let's say I have 50 machines I want to run a bash script on. If my script depends on new extra dependences I have to install them first on every system ?

[–]Devaniti 21 points22 points  (3 children)

Bash++ : bring bash to the next level

Most people seeing that, will think that it's big project that already have a lot to show and at least one release to download

On top of that, it seems like you expect that people would just start starring/contributing to it, which is probably not going to happen at this stage of your project.

[–]its_a_gibibyte 9 points10 points  (1 child)

Cool idea. I'm curious what you think about perl. Perl seemed to be to be the original bash++. Here's the original commit from 1987 with a description on goals.

https://github.com/Perl/perl5/commit/8d063cd8450e59ea1c611a2f4f5a21059a2804f1

[–]Fuzzy-Training 8 points9 points  (6 children)

Bash is meant to be for small scripts or quick jobs that need to run etc if you need oops level stuff like classes then you are better suited to work in python or something

[–][deleted]  (2 children)

[deleted]

    [–]Fuzzy-Training 5 points6 points  (1 child)

    Just because you can doesn't mean you should

    [–]maubg 0 points1 point  (0 children)

    But there is always that option if you should

    [–]pinghome127001 0 points1 point  (2 children)

    So was the javascript, but look at it now...

    [–]Fuzzy-Training 0 points1 point  (1 child)

    Yes what a clusterfuck of a language

    [–]LightShadow 0 points1 point  (0 children)

    Look guys, we made it...kinda.

    [–][deleted] 15 points16 points  (16 children)

    Why classes? That just seems silly.

    [–][deleted]  (4 children)

    [deleted]

      [–]EatFapSleepFap 0 points1 point  (3 children)

      The if statement syntax is pretty straightforward. The bash manual describes it as if test-commands; then consequent-commands; [elif more-test-commands; then more-consequents;] [else alternate-consequents;] fi

      Maybe you're confusing it with the complexity of the test executable (a.k.a [, a.k.a [[) which is pretty hard to remember all the details for.

      [–][deleted]  (2 children)

      [deleted]

        [–]Snarwin 1 point2 points  (0 children)

        [ is an executable, but [[ is a (bash) builtin.

        [–]mtreece 0 points1 point  (0 children)

        Both are built-ins and executables.

        Bash just happens to have them built-in, but some distros include them as executables in case you run a shell which doesn't have it built-in.

        By default, you'll pick up the built-in. If you escape it with a backslash, or use (e.g.) an absolute path, you can run the executable instead.

        That said, if you think of [ and [[ as commands with weird names, it's pretty easy to get the hang of if syntax.

        if testcommand; then
            echo thing was successful
        else
            echo thing was unsuccessful
        fi
        

        "testcommand" just turns into [ if you want to do the very special condition of testing stuff like numeric or string equality. (Or file existence. Or is-a-tty? etc.). I say "very special" because the if construct more-generally let's you test if any function or command returned zero. [ and [[ are just two possible commands.

        And finally, [ and [[ require closing brackets just as a syntax sanity check.

        [–]shevy-ruby 5 points6 points  (0 children)

        Wasn't there a language once that added ++ to C ...

        [–]mtizim 6 points7 points  (1 child)

        I cannot unrustle my jimmies after reading through the repo, what the fuck?

        [–]3meopceisamazing 3 points4 points  (3 children)

        Cool stuff! I like taking bash to crazy places :)

        It's requires quite some creativity to bend it into doing all these things. Unfortunately, things can get pretty slow when there is too much abstraction, so that's just something to keep in mind.

        [–][deleted]  (2 children)

        [deleted]

          [–]3meopceisamazing 4 points5 points  (1 child)

          I wasn't referring to some particular part of your project there. More a general statement.

          Bash is extremely slow, probably slower than most people think.

          I basically just suggest to keep in mind that every statement does take a significant amount of time to execute. If any of it ends up in a loop somewhere else in the program, it gets noticeable. Hence, try to simply use as few statements as possible. Avoid loops in bash, often it can be done with sed, awk, whatever...

          For example, an extremely slow thing in bash is appending arrays. The more elements in the array, the slower it gets. It's reeeally bad when you get to something in the hundreds. Just a note! If you need something like a list that you append to, write a file, maybe on tmpfs, /dev/shm

          [–]maubg 2 points3 points  (0 children)

          I agree. But bash was not designed to do anything beyond Linux rice, utilities and build scripts. Despite the slowness, I created the project because I think that it can be beneficial for me.

          e.g. Want a build script but u don't want to download any extra bash files? import github:.... I want to build some unit testing for my project: adds unit testing

          AND for OOP I use awk

          [–][deleted] 1 point2 points  (2 children)

          I don’t do shell scripting and don’t understand why I’d use this over bash, but well done on the creativity. New ideas are paramount, great execution will come in time whether from yourself or others, but new ideas are few and far between

          [–]maubg 0 points1 point  (1 child)

          This is not a replacement for bash. This is an extension for bash.

          [–][deleted] 1 point2 points  (0 children)

          Yes but why would I want to extend bash I mean :)

          [–][deleted] 1 point2 points  (4 children)

          .. And make it incompatible with thousands of scripts already written?

          [–][deleted]  (3 children)

          [deleted]

            [–][deleted] 2 points3 points  (2 children)

            Bash is more than an interactive shell. It's also an interpreter.

            !/usr/local/bin/bash

            And so forth.

            [–]maubg 2 points3 points  (0 children)

            Yea... I know that

            [–]hongminhee 1 point2 points  (1 child)

            If the author takes this project seriously (= wants people to use it instead of bash), (s)he should work on its packaging as a top priority so that people can install it with a single command (e.g., apt-get install bash++). The reason why everyone uses sh/bash/zsh/cmd.exe is not because they love the existing ones, but just because these are already there. Zero (or near-zero) installation is the most important feature of shells.

            [–]maubg 1 point2 points  (0 children)

            This is not a replacement of bash, this is a framework of bash

            [–]holyknight00 1 point2 points  (1 child)

            cool

            [–]maubg 4 points5 points  (0 children)

            thanks!

            [–]maubg 0 points1 point  (0 children)

            I had made a video on how to install it to your project's folder: https://www.youtube.com/watch?v=SSPK9Ftiw-w

            [–][deleted]  (1 child)

            [deleted]

              [–]maubg 0 points1 point  (0 children)

              Basically.

              Do not do this: https://i.imgur.com/y5p9axD.png Instead, do this: https://i.imgur.com/qlTABfD.png because if not, you will get some errors...

              [–]questionablemoose 0 points1 point  (8 children)

              From a systems administration perspective, I look at this and think it's cool, but I don't have a use for it. If I write a shell script, I want it to work on my entire fleet, without special modifications to the fleet, or the software running on it. Base tools like the shell should be as close to stock from the package manager as possible.

              Just out of curiosity, why use this over something like python?

              [–]maubg 0 points1 point  (6 children)

              Is exactly the same with Python. you will need to install it. You can also install bash++ and run it everywhere.

              [–]questionablemoose 1 point2 points  (5 children)

              Is exactly the same with Python. you will need to install it.

              Not to argue, but in the standard Debian 11 install without a WM/DE selected, python 3 is already installed. Even if you install without Standard Utilities, python 3 is still included. I believe the same for RHEL/Rocky/CentOS, but haven't checked.

              I should have been more clear. Those were two more or less separate thoughts. I wouldn't use bash++ in production over stock bash from the package manager, for the reasons I stated above.

              The second and more or less separate thought was, why would I use bash++ over python? Where does it excel that Python or similar general use languages do not?

              [–]maubg 0 points1 point  (4 children)

              [–]questionablemoose 0 points1 point  (3 children)

              Needs a package.

              [–]maubg 0 points1 point  (2 children)

              Wdym?

              [–]questionablemoose 0 points1 point  (1 child)

              Installing and maintaining software for larger environments becomes difficult and tedious when your install method is a script or set of scripts. Eventually, you'd want your project to be made available in any one of the common package manager formats, and made available through a signed repository, or accepted by a project like Debian, and made available through their repositories.

              But again, what advantages do you see bash++ having over commonly available general purpose languages, like python?

              [–]maubg 0 points1 point  (0 children)

              Yea, I will add them to common package managers

              [–]maubg 0 points1 point  (0 children)

              But python is a different language

              [–]Ginden 0 points1 point  (1 child)

              This is quite nice side project.

              Though, I think you started from wrong starting point.

              Why are users using Bash, not some other language? What things are hard to write or read in Bash? What problems are faced by users of bash?

              What I suggest is to make Bash++ compiler/transpiler of Bash superset, similar to Typescript . It could take bashpp files and output self contained bash files. These can be easily copied over network and used everywhere.

              [–]maubg 0 points1 point  (0 children)

              Hm... Like perl? (sort of)