Ask coding questions

← Back to all posts
I want to learn to use Polygott, but where do I start?
Terra361

I feel like the title explains the whole question.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
programmeruser
Terra361
Comments
hotnewtop
Coder100

Polygott is a Makefile, you can learn Makefile here.

Anyways, why do you need to learn polygott?
Bash is better for beginners like you... but idk, what's your use case?

realTronsi

@Coder100 imagine calling him a beginner

Coder100

well if he hasn't realized its a makefile yet @realTronsi

Coder100

but for me I used bash for a very long time until C++ @realTronsi

realTronsi

@Coder100 but bash != C++, bash is just shell

Coder100

@realTronsi but in repl.it they accomplish the same thing in terms of evaluation

Terra361

@Coder100 I know it's a makefile

Terra361

@Coder100 I already know Bash. I want to learn something new.

Coder100

nice, so what part confuses you? @Terra361

Coder100

so what part of polygott do you want to achieve @Terra361

Terra361

@Coder100 Are they the same thing?

Coder100
Terra361

@Coder100 What I want to do with polygott is something we would call "file linking."

Terra361

@Coder100 I am not sure, but I think I'm just confusing myself a little. Maybe learning makefile is unnecessary?

Coder100

lol maybe
so like polygott is just a makefile, learning it will be useful
@Terra361

fuzzyastrocat

@Coder100 Polygott is not a makefile!

Polygott is a framework for running any language. It's basically like a little sandbox computer where you've got all the langs you could want (well maybe not all) installed.

There is a makefile loaded onto this computer by default, but it's by no means necessary and isn't integral to Polygott itself.

So basically, thinking about Polygott like a little computer where you can run any language makes things pretty easy. Try typing gcc your_file.c or python your_file.py into the console to get a feel for it.

The reason there is a makefile installed by default is because the makefile allows you to automate running programs like this. (It's not the only way to do so, but makefiles are commonly used for this kind of thing.) So, if your makefile is this:

When you click the run button on the repl it will run python my_python_file.py, which will then run the python file. You can have multiple lines/commands too:

That will run your python file and then run your C file.

Makefiles are basically bash scripts (not exactly the same, but close). So, you have a lot of freedom to connect files and have them interact. If you find yourself in a weird situation where the makefile isn't working, but you know how to do it in bash, you can also have the makefile just run a bash script:

And then you put your "startup script" in my_script.sh.

Coder100

is that not just a makefile @fuzzyastrocat

Coder100

polygott itself is just a docker image (i think) but I think they mean the repl itself, which is a makefile @fuzzyastrocat

fuzzyastrocat

@Coder100 Polygott isn't just a makefile. It commonly uses a makefile, but the polygott system has nothing to do with makefiles. It's just that repl, by default, preloads the polygott system with a makefile.

fuzzyastrocat

@Coder100 Yes, polygott is a docker image. And no, the repl itself isn't a makefile, since you can add more to it or even remove the makefile.

Coder100

well this guy is making a misleading question @fuzzyastrocat

Terra361

@fuzzyastrocat I'm asking about the makefile syntax not how to run other files.

Coder100

well learning makefile should be your number one priority @Terra361

Coder100

the polygott index file is a makefile @Terra361

fuzzyastrocat

@Terra361 Ah, well I'd suggest updating your question to "I want to learn to use Makefile but where do I start". (My answer wasn't about how to run other files, it was about how to use Polygott. And Polygott isn't a makefile.)

Terra361

@fuzzyastrocat Okay, but I still think polygott is mostly used for makefile.

fuzzyastrocat

@Terra361 That's because of the misconception that Polygott is only for makefiles.

Coder100

polygott is technically just run-project @fuzzyastrocat

fuzzyastrocat

@Coder100 Only if it's configured that way.

Coder100

repl.it uses it ig @fuzzyastrocat

fuzzyastrocat

@Coder100 By default. But you can change that.

programmeruser

@fuzzyastrocat people have been misusing polygott repls for years. You're supposed to write your code in the entrypoint of any lang on the polygott github repo, then you have the run-project command run your code. If you open up a new polygott repl, you'll see that it says:

You're supposed to choose a lang from the polygott repo, go to the .toml file and find the entrypoint file, write your code inside a new file that has that name, and use run-project to run it. Polygott is NOT a makefile repl.

fuzzyastrocat

@programmeruser Definitely. Totally agreed, it's not just a makefile.

programmeruser

@Terra361 I hate it when people think Polygott is some sort of magical language that runs repl.it. Anyways the things you do in Makefiles are just bash commands, but there there is more than that. Try looking up a Makefile tutorial (and to run different targets you'll have to configure the .replit file).

Terra361

@programmeruser Wait, people actually think polygott runs repl.it?

Terra361

@programmeruser I didn't. It's just a Makefile.

programmeruser

@Terra361 well it kind of does, but not the Makefile type. https://github.com/replit/polygott

Coder100

repl.it is run by toml files @programmeruser

programmeruser

@Coder100 it says hat the polygott repo has instructions on how to add a lang, I don't know why they wanted to call it polygott

Coder100

@programmeruser Poly means many, and gott might be some typo of glot which means language

fuzzyastrocat

@Terra361 I know no one is probably listening, but I'd just like to say again: Polygott isn't a makefile! It's a docker image, like a tiny virtual computer, which can run lots of languages (lots of languages are installed on it). Repl preloads the computer with a makefile, but you can delete it and Polygott will still run fine.

Terra361

@fuzzyastrocat Hmmm. Okay. I think I'll try that eventually.

RYANTADIPARTHI
RayhanADev

Hiya @Terra361

I would consider reading the documentation for some decent information and then looking at this Cornell tutorial for information. Seems to be the best combination! Cheers!
~ Ray <3

Coder100

no that's not polygott lol @RayhanADev

RayhanADev

@Coder100??? wdym explain??

Coder100

polyglot
typo go brr @RayhanADev

RayhanADev

@Coder100 shoot nvm. There’s too many Polygot coding stuff in the world :P.

Coder100
Coder100

jk there's only one: repl.it! @RayhanADev

RayhanADev

@Coder100 rly? My mind no work xD.

Terra361

@RayhanADev Polyglot is cool too though. I considered that once before, I think.

RayhanADev

@Terra361 lul nice! Me still is confusion