Antyos / vscode-mlog

VSCode extension that adds language support for Mindustry Logic (mlog)
GNU General Public License v3.0
11 stars 4 forks source link

mpro compiler #1

Open jankaifer opened 3 years ago

jankaifer commented 3 years ago

Hi,

I'm trhinking about creating compiler for mlog as my school project. (I've seed the TODO in Readme)

Have you created anything? Just asking so I do not create the same thing but rather build on top of your work (if there is any) :)

Thanks for this extension.

Antyos commented 3 years ago

That would be so cool!

I had started designing a compiler for a new language, dubbed mpro shortly after initially creating this extension, but I haven't had the time to work on it in a while. It is currently a private repo because I didn't want people adding issues saying "addition doesn't work" and so on when I know very well that basic math does not work.

The compiler is written in TypeScript in order to more easily integrate into the VSCode extension, but I opted for a separate repo so people could integrate it into other projects too. I'll go ahead and add you as a contributor to that repo so you can take a look at it. There should be some resources in the README to help you get started if you are unfamiliar with compilers (as I was prior to starting the project).

jankaifer commented 3 years ago

Since I have to written 100% of code in my project I cannot directly continue with your work. However I can create parser for mlog in haskell and runtime in ts or rust

Will keep you updated.

Antyos commented 3 years ago

Ok, sounds good!

Of course it'd be great if you were able to contribute to my existing code, but I understand why you can't. Writing a runtime in TypeScript seems like a good in-between for now, but it might be nice to have it entirely written in TypeScript eventually.

As I am not familiar with Haskell, I do not know how much help I can provide for this. You may be better off creating a new Repo for now--I think I should still be able to integrate the code into the extension.

jankaifer commented 3 years ago

Hmm, I wanted to try those 2 languages (just learning them), but TS seems like a better choice for this project (it can run in browser & is well known). So I created this MVP: https://mlogsim.kaifer.cz/

Any thoughts? I hope it will be easy to integrate it with your VSCode extension (after my teacher checks it).

Also someone was faster with a compiler. However, they do it with their own backend with Java :(. https://www.reddit.com/r/Mindustry/comments/m60qli/mindcode_a_higher_level_language_that_compiles/

Antyos commented 3 years ago

Sorry I took a while to get back to you!

That's super cool! I think that could be a really cool thing to include in the extension! Maybe implementing it as a webview would work, or perhaps it's worth digging into the debugger API to step through the code (though I'm not familiar with that). I'd be happy to review a pull request to integrate that into the extension!

Figures someone got around to making a full compiler first, but at least they didn't take the name I came up with!

BalaM314 commented 1 year ago

Hi, I think I've made something similar to what this is looking for? https://github.com/BalaM314/mlogx https://github.com/BalaM314/vscode-mlogx