-
Notifications
You must be signed in to change notification settings - Fork 19
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
Brain tape viewer #44
Conversation
I found a bug on Travis with your PR hahahha! The tests should have not passed! |
Thank you so much for you PR @haskellcamargo. However I believe that we should fix the Our current problems are:
I will open an issue for that as well. Other than that, could you review the |
This PR has an amazing idea! Lets address some issues that we (@luizperes and @rafaelcn) have been discussing @haskellcamargo. The makefile point is exactly what we are having problems. Aliasing clang/llvm has shown to not work as @luizperes previously mentioned and we have to maintain a certain compatibility with older versions of clang/llvm. Secondly, this debug tape has a bug. When you move more than twelve cells forward or even one cell backwards you won't display the cell correctly. It would be nice to have a way to walk towards the value being shown on the debug on the tape. I'm not sure if this is the intended behavior, but it does have room for improvement! Another thing that I realized is: we never spoke about the maximum size of a tape in Brain, theoretically it is unlimited but, the limit is actually in the hardware, and as far as the current code is being developed we've been only using |
@@ -19,7 +19,7 @@ for lib in $files | |||
do | |||
filename=$(basename "$lib") | |||
filename="${filename%.*}" | |||
clang -S -emit-llvm $lib -o $inc_path/$filename.ll | |||
clang-3.8 -S -emit-llvm $lib -o $inc_path/$filename.ll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to discuss this change with care.
@@ -11,7 +11,7 @@ MKBIN=mkdir -p bin | |||
ROOT=src | |||
|
|||
SRCS=$(ROOT)/utils/ArgsOptions.cpp $(ROOT)/utils/ArgsHandler.cpp $(ROOT)/utils/Bootstrap.cpp $(ROOT)/parser/Parser.cpp $(ROOT)/ast/general/ASTInfo.cpp $(ROOT)/ast/expr/Expr.cpp $(ROOT)/ast/expr/ShiftExpr.cpp $(ROOT)/ast/expr/IncrementExpr.cpp $(ROOT)/ast/expr/InputExpr.cpp $(ROOT)/ast/expr/OutputExpr.cpp $(ROOT)/ast/expr/LoopExpr.cpp $(ROOT)/ast/expr/ArithmeticExpr.cpp $(ROOT)/ast/expr/DebugExpr.cpp $(ROOT)/ast/expr/BreakExpr.cpp $(ROOT)/ast/expr/IfExpr.cpp $(ROOT)/ast/expr/FloatExpr.cpp $(ROOT)/main.cpp | |||
CONFIG=`llvm-config --cxxflags --ldflags --system-libs --libs core mcjit native nativecodegen irreader linker` | |||
CONFIG=`llvm-config-3.8 --cxxflags --ldflags --system-libs --libs core mcjit native nativecodegen irreader linker` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to discuss this change with care.
|
||
// you can overwrite those functions! :) | ||
|
||
int number_size(int number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should return unsigned int.
} | ||
|
||
void b_show_tape(int idx, int *cells, int size) { | ||
// TODO: ellipsize values based on index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed a good idea! 😄
@haskellcamargo could you make the updates from After your PR gets approved, the build will broke because of the test files. What should we do? What do you think @rafaelcn |
We have just to add new .cmp files as suggested in the Hangouts call. |
Yes, I've done it already @rafaelcn haskellcamargo#1, just waiting for him to approve it |
Merging new version, fixing tests and improving code
This pull-request implements a natural tape vision for the Brain compiler using ASCII only and fixes the version of LLVM and Clang to
3.8
because it was not explicit and the system, by default, uses the version as suffix for operations.About the tape, we are currently overriding the debug
#
to show the information, but this can be discussed.Screenshot
Observation
Current work
^
indicator according to cell value_
, except when the index is over it (showing0
)Future work
To Discuss
-emit-tape