I don’t know (but wanna learn) programming, but, for example, can’t you inspect the code of an app if it’s installed?

(yeah this is kind of a stupid question.)

EDIT: Thanks for the clarification, guys!

  • donuts@kbin.social
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    1 year ago

    Your computer’s CPU doesn’t understand human language or code, so programs are compiled from human-readable programming languages (like C++, Rust, etc.) into binary machine code. Machine code is basically just a bunch of CPU instructions and data that are formatted specifically for your CPU’s architecture (depending on if it’s x86, ARM, etc.).

    Most of the time, when you install a program/app/game, you’re only getting the compiled binary in your CPU’s machine code, so you couldn’t view the original “source code” without going through a complex process called “decompilation”. And even then, you wouldn’t have the legal rights to share or modify that code for others to use.

    For something to be considered truly “open source”, it not only makes the original source code available to the user, it also publishes that code under a license like the GPL which gives the user certain rights to use, copy, and/or modify the code.

      • donuts@kbin.social
        link
        fedilink
        arrow-up
        9
        ·
        edit-2
        1 year ago

        Some programs are distributed as “scripts” (in a scripting language like BASIC, BASH, Python, JavaScript, Lua, etc) which are stored on your computer in human-readable form and only converted into CPU machine code when you run the program, through an “interpreter” program.

        Of course, everything boils down to binary machine code in the end, because those CPU instructions are the only language that your CPU actually works with.

      • BlameThePeacock
        link
        fedilink
        arrow-up
        5
        ·
        1 year ago

        There are some programs (especially on Linux) where they don’t distribute compiled binaries and you just download and compile the source code yourself to be able to use the software. This can be because of legal reasons, technological reasons, or even just because a developer wants to be very transparent in what’s being run on your machine.

        This is especially common with software alphas (either for new software, or for testing updates to existing software) where they just don’t bother compiling it for every type of system when it’s really just for use by a handful of developers while they’re actively working on or testing the code.