DEV Community

Cover image for Dev-Log 1: OH GOD NOT PATHLIB; Gold-Language
Colack
Colack

Posted on

Dev-Log 1: OH GOD NOT PATHLIB; Gold-Language

Check out Gold Here

Converting JavaScript to Python

As you may know from my last post, I talked about how sometime in the near future, I would be making a Python build of Gold.
Well, the tedious task has begun.

Your probably yelling at your screen, Why don't you just use an JS to Python Converter?
Here's the thing though, I don't want to use an Converter.

The reason why, well I just enjoy writing down the code. (And I also don't want to deal with annoying bugs I can't solve.)

The Process of typing JavaScript code into Usable Python code is fun too. Its also kind of difficult.

Now, add on to this the fact that I'm learning C right now, and it seems like I have a lot to do.
I also have a new update coming out next week that I need to keep track of.

On a good note, Colors!

Ah yes. The Shell Colors system.

The Colors system has been a constant battle with me. The first Iteration of the colors system from 1.01 actually worked! I just never implemented it into the code, and left it my developer kit. The files were still in the code though.

I pushed the Colors Update to 1.02, and planned to implement it then. However, even after 2 hours of Bug checking and re-writes, the code still did not work.

After that, I decided to push the Colors Update to 1.1.
Well, 1.1 came, and still no Colors update.

So, the real question is,
How did I get the colors system working?

Well, it takes us to the system I was using.

The colors enabling/disabling system was located inside of a command in the shell, that being colors.

The code for the command was simple.

It would re-write a file called colorsOn.js to allow colors to be added.

A re-write would look something like this:

var colorsOn = true;

export { colorsOn };
Enter fullscreen mode Exit fullscreen mode

The solution, was actually pretty stupid.

I started by turning the colorsOn.js into colors.json, then re-writing the original code to edit a value inside of the json file.

AND IT WORKED!

(Surprisingly.)

Gold-Save; What is it?

Another note of business, Yesterday I was sitting in my room, thinking to myself: What should I add to Gold?

I was thinking about the File-Copying system, and how bad it was.

I then thought about the fact that I was learning C at the moment, and realized that I could Seize the opportunity.

The premise is, I wrote a very basic C program that Copies the Contents of one file to another.

You can check out the code here.

Final Notes

Wanting To Contact Me? Join my Discord Server

  • Colack/

Discussion (0)