Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create boilerplate for popular languages #151

Merged
merged 5 commits into from
Apr 29, 2022
Merged

Create boilerplate for popular languages #151

merged 5 commits into from
Apr 29, 2022

Conversation

Headline
Copy link
Owner

@Headline Headline commented Apr 29, 2022

This is probably long overdue.

Something that sucks to do is to write a bunch of boilerplate every time you want to show someone something in a particular language.

Our strategy now is as follows - if we cannot detect an entry point (which would lead to compilation failure), we will generate the boilerplate ourselves and reorder things as needed. Behavior for each language may be different, but follow the same overall idea. Let's look at how c++'s works

.compile

#include <iostream>
int a = 5;
if (a < 24) {
  std::cout << "test";
}

Will get compiled as, as you can guess

#include <iostream>

int main(void) {
int a = 5;
if (a < 24) {
  std::cout << "test";
}
return 0;
}

We'll be testing out this change on live bot for a little while to see if anything behaves in a way that's unexpected. My biggest concern is our main entry detection, we'll have to add in some tests for this to ensure that we're detecting mains correctly.

@Headline Headline added the enhancement New feature or request label Apr 29, 2022
@Headline Headline merged commit 8afa9aa into master Apr 29, 2022
@Headline Headline deleted the boilerplate branch April 29, 2022 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant