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

Move from miniswig to Simple Squirrel (SuperTux fork) #66

Closed
tulpenkiste opened this issue Apr 15, 2024 · 5 comments
Closed

Move from miniswig to Simple Squirrel (SuperTux fork) #66

tulpenkiste opened this issue Apr 15, 2024 · 5 comments

Comments

@tulpenkiste
Copy link
Contributor

I personally believe miniswig makes working with the brux codebase quite daunting and not at all a fun experience to work with.
Not too long ago, the SuperTux project hard forked SimpleSquirrel (along with also preparing to ditch miniswig in favour of simplesquirrel) and, imo, using SimpleSquirrel makes dealing with Squirrel a lot more understandable and easier while not having particularly many trade offs.

@KelvinShadewing
Copy link
Owner

What we have currently feels pretty simple to me, just add functions to an API file. What kind of changes would we need to do to use this, and how would the new workflow go?

@tulpenkiste
Copy link
Contributor Author

tulpenkiste commented Apr 16, 2024

What we have currently feels pretty simple to me, just add functions to an API file. What kind of changes would we need to do to use this, and how would the new workflow go?

The changes we could make is to remove a lot of the functions within rte/src/api as they would no longer be required (due to them being basic wrapper functions for squirrel) and instead use ssq::VM::addFunc (or ssq::VM::setConst for constants).

Additionally, we would also be able to remove a fair amount of compilation steps as it doesn't require generating build/bin/miniswig to parse the API (as its handled entirely via a shared/static library).
We could probably cut down on a lot of C++ files in the long run.

Alongside this, simplesquirrel also lets programmers extend C++ classes from inside of squirrel. We aren't using this at the moment but it is something to keep in mind.

@hexaheximal
Copy link
Contributor

hexaheximal commented Apr 16, 2024 via email

@Vankata453
Copy link
Contributor

I can try to implement this sometime, since I've gotten a good understanding of SimpleSquirrel from having implemented it into SuperTux. However, I'm not sure when I'll be able to do that.

Vankata453 added a commit to Vankata453/brux-gdk that referenced this issue May 13, 2024
…tion

The `simplesquirrel` library is a simple binding to Squirrel in C++11.

It allows Brux to easily bind its API functions, each with a single line of code, removing the need for wrapper generation and the various inconveniences around it - everything is done from the code in "src/brux". Since there is no longer any wrapper generation, the "src/api" and "src/squirrel" directories have been deleted.

Additionally, `simplesquirrel` also provides handy wrappers across all types of Squirrel objects and a lot of general functions, which have been utilized in some places here.

Closes KelvinShadewing#66.
Vankata453 added a commit to Vankata453/brux-gdk that referenced this issue May 14, 2024
…tion

The `simplesquirrel` library is a simple binding to Squirrel in C++11.

It allows Brux to easily bind its API functions, each with a single line of code, removing the need for wrapper generation and the various inconveniences around it - everything is done from the code in "src/brux". Since there is no longer any wrapper generation, the "src/api" and "src/squirrel" directories have been deleted.

Additionally, `simplesquirrel` also provides handy wrappers across all types of Squirrel objects and a lot of general functions, which have been utilized in some places here.

Closes KelvinShadewing#66.
Vankata453 added a commit to Vankata453/brux-gdk that referenced this issue May 14, 2024
…tion

The `simplesquirrel` library is a simple binding to Squirrel in C++11.

It allows Brux to easily bind its API functions, each with a single line of code, removing the need for wrapper generation and the various inconveniences around it - everything is done from the code in "src/brux". Since there is no longer any wrapper generation, the "src/api" and "src/squirrel" directories have been deleted.

Additionally, `simplesquirrel` also provides handy wrappers across all types of Squirrel objects and a lot of general functions, which have been utilized in some places here.

Closes KelvinShadewing#66.
KelvinShadewing pushed a commit that referenced this issue May 16, 2024
…tion (#71)

Implement `simplesquirrel` library to replace Miniswig wrapper generation

The `simplesquirrel` library is a simple binding to Squirrel in C++11.

It allows Brux to easily bind its API functions, each with a single line of code, removing the need for wrapper generation and the various inconveniences around it - everything is done from the code in "src/brux". Since there is no longer any wrapper generation, the "src/api" and "src/squirrel" directories have been deleted.

Additionally, `simplesquirrel` also provides handy wrappers across all types of Squirrel objects and a lot of general functions, which have been utilized in some places here.

Closes #66.

* Update simplesquirrel

* GitHub workflows: Recursively fetch submodules

Allows for fetching the required Squirrel submodule, contained in the simplesquirrel submodule.

* Add simplesquirrel Squirrel include dir patch

* Fix illegal token error with `std::min` and `std::max`

* Fix Squirrel linking issue in `simplesquirrel`

* Update `simplesquirrel`

* Revert copyright header change

Don't know why I did this.
@Vankata453
Copy link
Contributor

@KelvinShadewing Now that #71 is merged, this can be closed. Not sure why GitHub didn't do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants