thecsw / memeinvestor_bot

This bot can help you invest in memes and make a fortune out of it!
https://meme.market
GNU General Public License v2.0
135 stars 34 forks source link

Porting MIB to Go (Staging, do not merge) #394

Closed thecsw closed 5 years ago

thecsw commented 5 years ago

With the bot complexity rising, we decided to rewrite the bot using Go. There is not much to say at this stage because we only started doing it. I will update this when the time comes.

thecsw commented 5 years ago

How do you envision it?

Keanu73 commented 5 years ago

Something like this: (if you can read javascript) DynamicWorkerImage

Keanu73 commented 5 years ago

Basically, it reads all the known commands in a certain directory and loads them, the same with events.

thecsw commented 5 years ago

But you can also easily divide them into different .go files. For example, balance.go, firm.go, invest.go, etc.

thecsw commented 5 years ago

Also, Go doesn't have a ton of generics like Python, JS, TS to work like that

Keanu73 commented 5 years ago

Well.. if we're re-writing the bot in Go at this rate with only 1 dev, this will take over a year.

Maybe re-write it in a language that actually has new devs coming in?

More people, more work, more finished.

Go is not really a language used by hobby devs anymore, it's more used in corporate environments... any language that is snapped up for corporate use immediately dies.

(i'd like to help but i don't see the beauty in Go like I do in js)

hazzakak commented 5 years ago

Is there a report of the fastest languages?

hazzakak commented 5 years ago

Also; I'd be happy to learn JS to rewrite the bot.

thecsw commented 5 years ago

Alright, @HarryjosephDevelopment, here is the situation

I would love to make the bot in Golang because I believe it is a more mature and strongly-typed language. It is also compiled into binaries. Though, Go has some disadvantages like no generics and the difficulty of making objects (because it is strongly-typed).

JavaScript is a very good web language. It is not strongly typed, everything is stored into hashtables, it is very easy to work with JSON files, etc. However, it's slower, can be spaghettified very quickly, code can grow 100 times in size and not grow 100 times in features.

I believe that JS is a very good language to build web application, however, I do not think it is the best choice for a service backends. It is true that a number of companies use it for back-end purposes, but the vast majority still rely on compiled strongly-typed languages, such as: C++, Java, Go, C, C#, etc.

Finally, I am still thinking. With Go, we can make a very stable and strong codebase. But currently, I am the only developer. With JS, we will have a huge number of developers, but I do not know about the code's complexity that would become after this decision.

Keanu73 commented 5 years ago

@thecsw Well, if we use that module-thing that I linked above ^^ and split major actions into functions, it won't be a problem. I could help maintain if you wanted. Also, ESLint provides the ability to pretty much set coding standards so that the code doesn't look horrible. (e.g. automatic tabbing, etc)

hazzakak commented 5 years ago

What would you estimate the rewrite in Go to take?

Keanu73 commented 5 years ago

The rewrite in Go would take a very long time since we have only one guy who actually knows Go @thecsw and barely anyone in this devving landscape knows Go and is not really attracted to the concept of Golang. And also, Go isn't really actively promoted as a "language to get into", only really by big corporations and whatnot.

thecsw commented 5 years ago

@Keanu73 @HarryjosephDevelopment

The Go development (if it goes at a normal pace with commuted developers) it can take just several weeks. Please look at the code, it is not difficult. Surely, it is a bit different from other languages that we use but it’s super welcoming. You can see gobyexample website, where it shows all standard Go features is a very simple manner.

The files and commands for the bot can be broken down into separate files and that would work just fine. Look at balance.go or template.go. That is how we can multitask. Go is beautiful in a sense because it’s simple, robust, and trusts the user. Like C.

If you want to join the development of Go, I would love to work with you! We will talk about database scheme, so we can start building all the SQL queries. Having generics and all of the agile code is nice but with that you sacrifice the performance. Not only that, moving too close to pure abstractions is not the best strategy in the industry.

Go is a language used to build Amazon, Google, YouTube, Gmail, etc. and we should be happy that this kind of language exists and is open source. We shouldn’t strive away from it because corporations use it, we should learn from them and build our own. Small companies always learn from big ones. Because if they want to become big, they always need someone to look up to.

hazzakak commented 5 years ago

@thecsw do you have a discord or another more organised way of communicating. I'll begin learning, grasping GoLang and I'll begin contributing when I have the necessary skills.

thecsw commented 5 years ago

@HarryjosephDevelopment sure! I am so annoyed by billion Github email notifications.

I am accessible on multiple platform.

Email: ctu@ku.edu Telegram: @thecsw Discord: thecsw #2451

We can use slack if you prefer it

Keanu73 commented 5 years ago

@thecsw I'll definitely help when I can in the future, although my stance may look like I'm a hardcore JS fan, I really have a conflict of interest right now (finishing MemeBot) so I can't focus on MIB right now or engage with Go like I'd want to, since I'm more engaged with JS. I will see you in the future, and also, atleast you have someone working alongside you. ;)

(you should definitely make a discord ^^)

thecsw commented 5 years ago

The branch moved to go1