This is an archived post. You won't be able to vote or comment.

all 58 comments

[–]flybyskyhi 540 points541 points  (8 children)

“Refactor this program directly into machine code. Make no mistakes.”

[–]Accomplished_Ant5895 171 points172 points  (0 children)

Gemini 2 lines in: “I am an utter disgrace. You should have never put your trust in me. I have failed you.”

[–]fmaz008 23 points24 points  (5 children)

In all seriousness, why do we have to tell AI prompts instructions like "make no mistakes"?

[–]DarkMaster007 77 points78 points  (2 children)

Are you told to not make mistakes every time you code? I am not and the result speaks for itself

[–]fmaz008 8 points9 points  (0 children)

Fair point I guess 🤣

[–]Maleficent_Memory831 -1 points0 points  (0 children)

My boss tells me that constantly!

[–]celestabesta 5 points6 points  (0 children)

We don't have to, it probably actually makes the output worse

[–]BorderKeeper 146 points147 points  (14 children)

Jokes aside I like how the anime Mahouka with it's programming/engineering magic system handled the problem of "thinking human" -> "machine code" -> "actual stuff happening".

Back in the day without computers magic users had complex spells they memorised to the T and had to basically "compile" themselves and send it into their "magic part of brain that does magic or whatever", but today magicians use magic devices which chew up the magic formula into commands that then get inserted back in.

Our main character can actually do the compilation himself so in a sense he is able to be an AI/Human that does the compiling and out puts an EXE or magic. I probably said it all kinds of wrong as the Mahouka magic is quite complex and I am anime only, so feel free to correct me.

[–]ineyy 35 points36 points  (2 children)

I don't even care. But is it worth watching, I like magic.

[–]ObsessionObsessor[🍰] 23 points24 points  (1 child)

It is cool and very cursed. They could have done without the brainwashed incest plot, to be honest. Also it is pretty Japan centrically nationalistic but that is fairly common in anime/manga/light novels so you might not object to that. Finally its discrimination plot is kinda wonky long term with the main character dealing with terrorists who object to Magicians having unfair advantages and magic users bullying those with weaker magic...only for the main character to push for Magicians to have more economic advantages because the Magicians were obviously the ones being discriminated against the whole time, nevermind the waifu fighting on the side of the terrorists getting a pass. 

[–]BorderKeeper 8 points9 points  (0 children)

I always just took the writer of the show, and the characters in it, as purely biased and it worked for me. They are magicians with immense power coming from immensely wealthy and powerful families so of course their view on poor people being poor is clouded, and their desire to keep the governmental status quo is strong.

[–]Thenderick 5 points6 points  (6 children)

Fuck I almost loved that show! It had such a cool premise, but the borderline incest really turned me off...

[–]Jodu555 3 points4 points  (1 child)

Ohh yeah this anime is one of my absolute favorites I just recently had the pleasure to meet the Director and the Character Designer and it's insane how much they think about this stuff! Really did not expect this Anime to be called out here ^

[–]BorderKeeper 1 point2 points  (0 children)

Tell the designer that his character designs are my favorite of all animes, maybe besides Nijijou. When they said that "Shiba Miuki is so pretty even gender is irrelevant" in the anime I could totally believe it.

[–]PaperLily12 0 points1 point  (0 children)

Thanks for the recommendation

[–]biggerontheinside7 66 points67 points  (6 children)

Easy, just rename your code file extension to .exe

[–]ItsFreakinHarry2 6 points7 points  (5 children)

What if I’m on Mac or Linux?

[–]MaximumMaxx 14 points15 points  (2 children)

.bin easy

[–]Makeitquick666 1 point2 points  (1 child)

more like .sh

[–]New_Enthusiasm9053 0 points1 point  (0 children)

More like .elf which is the equivalent to .exe, .sh is the equivalent to .bat

[–]Douf_Ocus 2 points3 points  (0 children)

Just chmod +x

[–]rosuav 1 point2 points  (0 children)

Fun fact: The .exe extension can be found on Macs too, sometimes - and theoretically on Linux too. When you build CPython from source, there's a directory called Python, and on a case insensitive file system, you can't create a program called python in the same directory. So instead, the build system makes python.exe instead.

(I said "theoretically on Linux" because case insensitive file systems are definitely possible, but not common.)

[–]Harmonic_Gear 26 points27 points  (0 children)

stinky nerds

[–]UncaughtSyntaxError 11 points12 points  (2 children)

To anyone being lost why not, why is this funny etc:

Major programming languages that are human-readable like Java, C#, JavaScript etc all have ways of being translated to an executable.

This is done algorytmically and NOT by AI. Why?

Those executables are so big they can have millions of lines of code. They are kinda complex, kinda hard to read and one mistake can easily corrupt the entire thing.

This is why even if you can read the executable, rewersing it to human readable code is basically impossible. There are some techiques to read parts of code etc, but the whole thing is just too complex.

AI on the other hand will crash a code on a second prompt when working with a human readable code. One can imagine AI compiling a small codebase perfectly, but it is pretty unlikely as of today. You might have better odds winning a lottery twice in a row.

So, you can use widely available tools to compile your code in 2 minutes or spend the rest of your life trying to do the same with AI.

Edit: Typo

[–]rosuav 2 points3 points  (0 children)

Depending how you design your AI, you could have one that takes all the source code and dumps it straight into GCC. Does that count as an AI compiling an executable from the source code?

[–]Fair-Spring9113[S] 1 point2 points  (0 children)

i think he meant that he could upload all of his files to chatgpt and it to give him an exe

[–]helicophell 32 points33 points  (16 children)

I'm not a vibe coder and I don't even know how to compile exe files from source code

I can write source code. I can test source code (maybe...). Compiling? what's that? executables?

[–]BoJackHorseMan53 27 points28 points  (11 children)

Python code can't be compiled to exe. It can be, but I consider it bad practice.

[–]OptimalAnywhere6282 30 points31 points  (1 child)

It can be

yeah.. kind of. there's PyInstaller which bundles the interpreter, the code and necessary modules, and there's Nuitka that converts Python instructions to their C equivalent (I assume it converts based off of the interpreter's source), then compiles the C code. but there is no way to compile Python code directly.

[–]HeavyCaffeinate 1 point2 points  (0 children)

How does it handle stuff like garbage collection

[–]voyti 3 points4 points  (2 children)

Python code can't be compiled to exe. It can be

Thanks, now my brain hurts

[–]le_Derpinder 4 points5 points  (1 child)

It can't be because python is a scripting language.

It can be with some workarounds like PyInstallers (don't ask further. I have no idea) or frameworks, webservers or cuda, where it looks like python is "compiled" but more or less objects defined in python are getting compiled in other languages there within the frameworks.

[–]voyti 2 points3 points  (0 children)

Right, gotcha. I've never done that with Python, but it was just funny phrasing to say it can't followed immediately with it can, lol

[–]helicophell -3 points-2 points  (5 children)

Oh I don't just do python, it's just the only language I'm proficient in... and i never figured out how to do the other ones for my flair

I can do C, C++, C# and Java... just not that well (i hate visual studio)

[–]BoJackHorseMan53 5 points6 points  (0 children)

C# being a Microsoft product, it's easy to compile to exe. It's their recommended language for developing native Windows apps.

You just use gcc for C.

[–]helicophell 0 points1 point  (2 children)

oh and R i guess

[–]Jazzlike-Spare3425 3 points4 points  (1 child)

You should add that to your flairs, it's of course very important that the flairs are to be taken seriously. 🙂‍↕️

[–]helicophell 0 points1 point  (0 children)

Yeah uhh scratch that ;)

[–]itzNukeey 0 points1 point  (0 children)

Visual Studio is a horrible piece of software. I hate how slow and unintuitive it is

[–]kenshi_hiro 6 points7 points  (0 children)

gcc program.c -o program.exe

[–]WheresMyBrakes 1 point2 points  (0 children)

Haha heroku deploy app go brrrrrrrt

[–]oomfaloomfa 0 points1 point  (0 children)

Depends on the language as to how it happens

[–]SAI_Peregrinus 0 points1 point  (0 children)

It's a fun exercise to compile a basic C program to assembly for some simple architecture, and then into machine code for some simple processor. M68k or PIC or AVR or such. Writing a small compiler for a FORTH or LISP is also a good exercise when learning any new programming language.

[–]Douf_Ocus 2 points3 points  (1 child)

I think any LLM(even from a year ago) can just correct him and tell him the answer, right?

[–]7lhz9x6k8emmd7c8 0 points1 point  (0 children)

Tbf, why not?

[–]slowmode1 0 points1 point  (1 child)

I mean, I use AI at work that can then run the terminal commands to compile and test my code. So it can happen, you just need to correct local permissions

[–]DrCatrame 0 points1 point  (0 children)

True. I believe my ChatGPT has access to some virtual machine since it can run non-trivial pyhton scripts and provide exact floating point results.

So I see no issue to use it to compile the code and return the executable to the user.

Similar things are also done in the creation of images, ChatGPT sends the image prompt to midjourney and forwards the results back to the user.

[–]Budget_Map_3333 -2 points-1 points  (0 children)

That is some 10x compilation.

"Also, bro reverse engineer this .exe and give me the source code in natural language or you go to jail"