codethesaurus / codethesaur.us

A polyglot developer reference tool to compare programming language concepts side-by-side! Great for learning new languages or using for reference.
https://codethesaur.us
GNU Affero General Public License v3.0
284 stars 163 forks source link

[COBOL] Language request to add COBOL #374

Open INeedAUniqueUsername opened 2 years ago

INeedAUniqueUsername commented 2 years ago

Language you would like added

COBOL a.k.a. Common Business Oriented Language

Information on the language

COBOL is a 60 year old domain-specific language designed for business computing and data processing (e.g. huge databases and financial transactions). It may be useful to learn.

Disclaimer

I'd like to maybe get started on the COBOL thesaurus for Hacktoberfest. I don't have direct experience with COBOL at this time (I'm more of an expert at C# and Lisp) but I've been reading through Michael Coughlan's book, Beginning COBOL for Programmers.

Requirements:

Need Help?

Leave a comment on here with your question, or feel free to ask @geekygirlsarah on Twitter. You can also email coreteam@codethesaur.us too.

Thanks!

We really value and appreciate the additions people make to Code Thesaurus, no matter how large or small. So thank you for taking the time to work on this!

geekygirlsarah commented 2 years ago

I updated this a bit to change and add a few things.

I'll assign it to you! For Hacktoberfest, I tend to make one issue (or request one PR) per concept per language. You can make as many as you want, but I'll be happy if you do one PR per concept if you're participating.

INeedAUniqueUsername commented 2 years ago

So I got the project running on my local machine but none of my changes are showing up. I'm looking at localhost:8000 on incognito. I'm not sure what's happening here.

geekygirlsarah commented 2 years ago

Hey @INeedAUniqueUsername, What is it saying or showing when you try to go there? Is it like "server can't be found", or "error with the server", or something else? If you're running the Docker image, is there an error? If you're running the Python app directly, is there an error reported there?

INeedAUniqueUsername commented 2 years ago

@geekygirlsarah The app starts up with no problems. But nothing happens if I modify the json files.

image

image

geekygirlsarah commented 2 years ago

Hmm... to the best of my knowledge that should work. Have you tried restarting the Docker container? It should automatically pull in changes to the code and Python/Django should just rerender new stuff on new page visits, but just in case it's not going in for some reason you could try that.

Also are you running it directly (like a docker run -it code-thesaurus) or are you using docker-compose up? The docker-compose will automatically patch in the latest code changes without having to restart the container.

Or if you're running the container directly, you could try to add in like -v .:/code/ to make it automatically pull in changes.

INeedAUniqueUsername commented 2 years ago

@geekygirlsarah I'm running the container with this command docker run --name ct-container -ti -p 8000:8000 -v `pwd`:/code ct-image

INeedAUniqueUsername commented 2 years ago

oh wait, maybe I replace pwd with something else. I did not notice that earlier.

INeedAUniqueUsername commented 2 years ago

I'm not experienced with Docker so I took the most obvious action and copypasted that command into VS Code

geekygirlsarah commented 2 years ago

Oh! If you leave the backticks in (so leave in -v `pwd`:/code ct-image), it should put the current directory in for you and Docker should pick it up. It should work on Mac, Windows, and Linux.

geekygirlsarah commented 2 years ago

though also running docker-compose up should do more of that wrangling on its own.

I should probably update the docs with that, since I think docker-compose was added and the instructions didn't get updated yet.

INeedAUniqueUsername commented 2 years ago

The Installation page is NOT HELPFUL

Sorry, let me retrace my steps

  1. I run docker build -t ct-image .
  2. I run the command docker run --name ct-container -ti -p 8000:8000 -v `pwd`:/code ct-image
  3. I copy the json files for COBOL
  4. I modify meta-info.json to include COBOL
  5. I don't see any change in the app.

I haven't had my patience tested this intensely since the first time I learned C++

geekygirlsarah commented 2 years ago

From the screenshots, it looks like it should be working, but I get that it is not. And from the command you're running, it seems like it should be.

You could replace `pwd ` with your local directory (so it looks like from your screenshots you could do `-v /Users/alexm/source/repos/codethesaur.us:/code) and see if that works.

Or kill the container, then run docker-compose up.

I made issue 15 on the docs to update these instructions. If no one jumps on it in a few days, I should have time to update them myself.

INeedAUniqueUsername commented 2 years ago

docker-compose up leads to the following error message:

[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                         0.0s 
 => => transferring dockerfile: 32B                                                          0.0s 
 => [internal] load .dockerignore                                                            0.0s 
 => => transferring context: 2B                                                              0.0s 
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: target stage cthesaurus-img could not be found
geekygirlsarah commented 2 years ago

I'll test more on this tomorrow. I'm not sure what's going on but I can try to debug it and see what's going on.

INeedAUniqueUsername commented 2 years ago

Okay, I got docker-compose to work. I modified docker-compose.yml to look like this:

version: "3"

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: codethesaurus-container
    ports:
      - "8000:8000"
    volumes:
      - ".:/code"

Source: https://stackoverflow.com/a/63479416

geekygirlsarah commented 2 years ago

Yeah, that looks about right. I did get it working on my computer, I just didn't push up changes yet. I'll try to get that done tonight or tomorrow. Thanks!

geekygirlsarah commented 2 years ago

I pushed up a new Dockerfile/docker-compose.yml if that helps! They should be smaller and spin up faster too.

geekygirlsarah commented 2 years ago

Hey @INeedAUniqueUsername, I figured I'd check in to see how this issue is coming along for you. No rush, but if you're doing Hacktoberfest, it ends in a little over a day, so I figured I'd just remind you.

INeedAUniqueUsername commented 2 years ago

Oops, I forgot I was going to work on this

geekygirlsarah commented 2 years ago

lol, that's fine! Do you still want it, or want to unassign? Or just want to keep it just will have to work on it a bit later?

geekygirlsarah commented 2 years ago

Hey @INeedAUniqueUsername, figured I'd double-check again to see if you're interested in this. If yes, let me know, otherwise I'll probably unassign in the next day or two. And if you have any more questions, let me know!

geekygirlsarah commented 2 years ago

Haven't heard back so I'm removing them. (If you still want it, let me know and I'll add you back.)