Review of 7 Ways to Run Code in ChatGPT.... 6 Failed :-(
Dall-E Image created with prompt: “Robot that is coding a computer program to create a robot that can code computer programs.”

Review of 7 Ways to Run Code in ChatGPT.... 6 Failed :-(

I really love using ChatGPT for code development. It is able to take ideas and other things and at least get started in the right direction... But, I've wanted to be able to run the code inside of my web browser easily. I figured if I did Javascript, this shouldn't be too hard.... Well, I guess I was wrong....

I had asked ChatGPT to make a simple set of concentric circles based on the Bands of Belonging model used in Education SystemONE. This is the code that was produced:

<!DOCTYPE htm
<html lang="en">
<head>
??? <meta charset="UTF-8">
??? <meta name="viewport" content="width=device-width, initial-scale=1.0">
??? <title>Bands of Belonging</title>
</head>
<body>
??? <canvas id="belongingCanvas" width="500" height="500"></canvas>
??? <script>
??????? const canvas = document.getElementById('belongingCanvas');
??????? const ctx = canvas.getContext('2d');

??????? const bandsOfBelonging = [
????????? 'Core', 'Consciousness', 'Clan', 'Companions', 'Culture',
????????? 'Country', 'Career', 'Collective', 'Creatures', 'Cosmos'
??????? ];

??????? const centerX = canvas.width / 2;
??????? const centerY = canvas.height / 2;

??????? for (let i = 0; i < bandsOfBelonging.length; i++) {
????????? const radius = (i + 1) * 25; // Adjust the spacing between the circles here
????????? ctx.beginPath();
????????? ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
????????? ctx.stroke();
????????? ctx.fillText(bandsOfBelonging[i], centerX + radius + 5, centerY); // Positioning the text labels
??????? }
??? </script>
</body>
</html>
        

Here are all the ways I tried to run the code directly with ChatGPT:

Using a ChatGPT Plugin or Native Feature

First I wondered what ChatGPT can do on its own, or with its own plugins, and so there were three ways I found. (If you know of others, let me know!)

CoderPad ChatGPT Plugin

No alt text provided for this image

My friend Corbin Crutchley used to work for CoderPad, and so I wanted to give their plugin for ChatGPT a go first. Here is my review:

Pros:

  1. It should allow running nearly any type of code and producing
  2. It has an easy to use interface (if it worked)

Cons:

  1. It didn't work. I clicked the run button over and over, and nothing happened
  2. The signup process was a bit weird, because it was originally designed for doing software interviews, and so if you just want to run code, you have to answer some questions that might not exactly apply to you.

Code Runner

No alt text provided for this image

The Code Runner plugin by Haseeb M. looked like it might work. So I tried it... Here is my quick review:

Pros:

  1. It runs a wide range of languages
  2. The signup process was fairly easy

Cons:

  1. It can't produce anything but text (that is what it said). So it didn't work!
  2. It might cost money if you need to do too much... I couldn't quite tell.

Use ChatGPT's Native Code Interpreter

No alt text provided for this image

I went ahead and also tried ChatGPT's Code Interpreter, but since it only does Python, it couldn't help me.

Pros:

  1. Comes automatically with the paid account for ChatGPT
  2. It can do graphics for Python

Cons:

  1. I think it only supports Python right now, so it didn't work for me!
  2. It has a very limited set of packages/libraries that it can use

Use a Chrome Extension

Since none of the native ways worked, I thought there probably was a Chrome Extension that would work.... So this is what I tried:

RunGPT

No alt text provided for this image

The RunGPT browser extension also by Haseeb M. seemed the most popular, and so I thought I'd try it first.. And this is what I found:

Pros:

  1. Easy to install
  2. Nice interface, if it worked
  3. No cost, at the moment

Cons:

  1. It didn't run my code... It tried, but I just got the two black screens that you see in the image above, one with crazy scroll bars... (and, yes I tried to find the image through scrolling, and no such luck)
  2. When I tried to run Javascript on its own, it didn't seem to have an easy way of adding libraries, and the error messages it gave were hard to read (I think they were orange on a reddish background)

ChatGPT Code Previewer

No alt text provided for this image

This extension by Yangguang Li looked like it might work, but it didn't either...

Pros:

  1. Easy to install
  2. No Cost

Cons:

  1. Again, this didn't work!
  2. It only works on fresh code blocks. So if you are testing multiple Chrome extensions, and you click reload, most of the other ones will become active automatically on the previous code blocks, this one doesn't.
  3. It only supports languages that the browser should be able to render already.

ChatGPT Code Runner (Extension)

No alt text provided for this image

This should not be confused with the ChatGPT Plugin, although it was also written by Haseeb M. But one is a plugin right in ChatGPT and the other is a browser extension. Although, they share a similar goal, and both require "credits" from an API.

Pros:

  1. Says it supports a lot of languages
  2. The extension is open source on Github

Cons:

  1. It did not work! (Ok, I sound like a broken record now... For those who remember what records were)
  2. It can cost money because you only get a few executions for free
  3. The signup was not as straightforward as other ones

The Old Fashioned Way

Ok, so NONE of these worked... So I'm now reviewing the 7th way... The way that ChatGPT tells you to do... Save the code block, then run it in a browser.. This WORKED. But I would really prefer a method that was quicker and easier... Yet all the methods that seemed like they would be... Well, you know now, none of them worked...

BTW, I know the words are on top of each other... That was going to be my next iteration to fix... But I never got to it, because I got tired by trying all the ways that were supposed to help me see this quicker!

No alt text provided for this image





Haseeb M.

Software Engineer | Fullstack | Game Dev | Ex Rockstar Games

1 年

Thanks for the article here are some corrections. The Code Runner Plugin and Extensions are free. * It offers vast variety of languages. *It offers Graph generations and Sharing code Snippet screenshots. It offers file management for your code . It supports documents analysis. These things are good for basic data analysis. And the RunGpt extension is not created by me its from different developers.

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了