-
Notifications
You must be signed in to change notification settings - Fork 3
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
Major overhaul #2
Open
apfeltee
wants to merge
35
commits into
sawickiap:master
Choose a base branch
from
apfeltee:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
… 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
…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
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.h
just contains code used in the core.So, once built, you'd still only need, say
msl.h
andlibmsl.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::function
values. 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.cpp
files (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.