Open
Conversation
added 30 commits
January 10, 2022 04:25
… it's still just one header, but easier to maintain now
…r properties. fingers crossed!
… carry values upon ::execute() calls
…ble road to more extensibilty
…) is second... etc)
…ave fixed the REPL
…h is needed for stuff like Array.map, Array.each, etc. callbacks in general
…magic woo, please.
…rder is extremely uncool
added 5 commits
January 17, 2022 14:00
…ing point, Number can either store a floatingpoint number, or integer, with corresponding ops abstracted to fit it. may seem verbose, but *not* using floatingpoint for everything increases performance considerably
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was really impressed with this implementation, so over a coule days, I expanded my fork quite considerably.
Among things in regard to code style:
switched code directly to C++20. this will compile fine with recent mainline versions of GCC, clang, and VS.
split the code up. Yes, a single header sounds great on paper, but makes management difficult. The main API is still just one header (
msl.h), andpriv.hjust contains code used in the core.So, once built, you'd still only need, say
msl.handlibmsl.a.got rid of PascalCase - you noted a problem with potential clashes with windows headers. switchinging to javaCase fixes this "problem" rather elegantly.
put enums inside classes where they matter, thus reducing namespace clutter
made some hard-coded values mildly more dynamic, such as the methods/properties of global core objects (strings, arrays, etc). these are still declared in
stmt.cpp, but it's easier to expand now.also removed the SystemFunction enum stuff, and instead implemented them properly with
std::functionvalues. Again, this makes expanding way easier.there are many more, but these the most important.
As for the core:
env.cpp, and most of the code used in the stdlib residing in the*mod.cppfiles (things like string formatting, Array.pop(), etc)A few things still need addressing, such as performance:
Numbers are stored as double, regardless of what they're used for. This is very probably a major culprit in regards to performance.
Objects might be copied too much, but this could be tricky to determine
The core is now implemented in a way I find presentable, it does not leak any memory, there are no memory access issues, should compile cleanly with
-Wall -Wextra, and is in effect now platform-independent.Anyway, I'd love to know what you think, and if you think this is a good road to continue on.