-
Notifications
You must be signed in to change notification settings - Fork 34
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
Implement Operator, Bitwise And CPPOPS_CPPTYPES #96
Comments
@shpsi This is your issue for GSoC Pull Request Challenge, Round 1! :-) Please use this comment thread for all discussions related to this Pull Request Challenge. |
Thank you! will soon get back to you |
how can i get it done for macOS |
MacOS is not yet fully supported: "Everywhere that calls the apt-get command, you will have to substitute your equivalent." https://github.com/wbraswell/rperl/blob/master/INSTALL#L18 Please use Linux instead, preferably Xubuntu: |
I am running xubuntu in virtual Box . |
I use Eclipse with Perl Epic plugin for complex jobs like the entire RPerl compiler. For a simple job like just one RPerl operator, you can use normal vim or gvim if you want to keep it simple. If vim is too simple, then go with Eclipse & Perl Epic plugin. |
Hey will , I have some doubts:- In this code, https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Operation/Expression/Operator/Logical/And.pm |
Hello Mr. Singh, Operator_122 and Operator_128 are RPerl AST nodes which map to corresponding RPerl classes, both of which map to RPerl::Operation::Expression::Operator::Logical::And in this case: https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Grammar.eyp#L355 https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Grammar.eyp#L361 Before you can try to run operator tests, you must ensure that RPerl itself is installed correctly:
If you are able to successfully run the |
Hey will, i got this after setting verbose=1 |
Yes your output looks good so RPerl should be installed, although you should always turn on both |
I updated above comment with new image see . how to run simple hello world code using rperl?? is it must to give arguements like modes, code, ops ,types etc? rperl -V fileName.pl was throwing error.is it expected? |
If you delete the "_Inline/" directory, and then rerun the You may run Hello World in PERLOPS_PERLTYPES mode: And in CPPOPS_CPPTYPES mode: |
Thank you so much! I was trying on my own for some hours and it already midnight here. thanks! for rescuing |
If you have used CPAN to install RPerl, then you will need to uninstall it because you need to be working on the latest GitHub code only, not the stable CPAN code. I am making updates to the Logical::And operator on GitHub today, and will tell you when it is ready. Meanwhile, you can work on uninstalling your CPAN version of RPerl and running the same |
how can i check if i installed through cpan?? did you mean command similar to "apt-get cpan install rperl" ? or while executing installer.sh option of choosing cpan?? i dont remember i need to check. |
There is no such command as And if you did not specifically use your own GitHub fork already, then yes you presumably did install from CPAN and thus need to uninstall as described in my previous message. |
(At some time in the future we will release Debian & Ubuntu packages so that |
okay so you are saying me to have "git clone shpsi/rperl" right? i earlier did that :( |
Yes However, if you have executed BOTH the |
so git clone is sufficient? |
i have not run cpan command . i just ran installer |
The RPerl installer can install from either CPAN or GitHub, depending on which option you choose in step 24: https://github.com/wbraswell/rperl/blob/master/script/rperl_installer.sh#L1403-L1447 Which option did you choose? |
I dont remember now but as fas as remember i just clicked 'enter' not sure! I have one folder named rperl5.old |
Please do not EVER just "click enter" without paying attention to what you are doing! There is no "docs/compiler_oracle_FOOBARperl5221_solaris211_sunos511_sunC513.txt" file in the CPAN stable version, only on GitHub: https://fastapi.metacpan.org/source/WBRASWELL/RPerl-4.002000/docs/ https://github.com/wbraswell/rperl/tree/master/docs You can also look inside the rperl directory to see if there is a ".git/" folder, which is only present for git repositories not CPAN installs. If you have a folder named "/home/username/perl5.old" then that means you already had installed some CPAN software via local::lib before your current installation, this could have been because you ran the installer more than once or because you tried it yourself before running the installer, etc. You can simply delete that "perl5.old" folder. https://github.com/wbraswell/rperl/blob/master/script/rperl_installer.sh#L462-L464 |
Sorry for carelessly running enter command. |
Yes I believe you are correctly using the GitHub clone. To be totally sure, please run a system-wide search to ensure no other installations of RPerl are found: |
sorry to disturb you again but i am reading your book. file name contains 'good' or 'bad' , what these mean? how to identify test files? are these kind contains |
BDW, instead by installing 'cpan RPerl' if i install using git clone then rperl -v gives error of "rperl command not found as /user/bin/rperl is not present" hot to fix this? i guess to move the script/rperl folder to /usr/local/bin/. Do you know why this error comes "No typemap for typemap return : skipping return sv_newmortal()"? |
|
Is there support of comparator function while sorting? |
I am very confused by your problems with running |
I do not understand your question about comparator functions, and I do not see how it is related to the Bitwise And operator? |
Yes i tried to reinstall it . leave it . I have done one clean and successful installation. i know comparator func is not related to bitwise AND operator . i was just suggesting new feature. I have completed reading your book one more time and this time with detail. |
Okay so I will not worry about your installation problems, as you have solved that now. As for comparator functions, please do not suggest new features because we already have hundreds of tasks on the to-do list: https://github.com/wbraswell/rperl/blob/master/docs/todo.txt (After GSoC is totally finished, then we can discuss new features.) I am glad you have been reading the Learning RPerl book, I will be updating and completing the content of that book soon, and for now it is a very good resource for you, in addition to the devs_getting_started document. |
Hey mentors, |
@shpsi this is a challenge. We don't need anything at all. You need to complete the challenge and submit it to us. The challenge is well specified in the issue. Do you understand clearly what is required for you to pass the challenge? |
@JJ Thank you Sir ! Yes i understand . From previous discussions, I got to know that multiple rperl compilation is not needed and many other things too. "Learning RPerl" book has these in contents so i got little confused that do i need to have all these installations/compilations before the executing my code. @wbraswell and also what arguements should be provided for compiling my code :: rperl -t -D -V ? |
@shpsi If you can successfully run the When you run a Executing the I will make another post tonight with more information about how to invoke the operator tests. |
Hey @wbraswell , How to get the meaning of each errorcode ECOGEASRP00 , ECOGEASCP00? |
When generated by RPerl, each error code is followed by a plain-English explanation of the error. If you are looking at RPerl code output, just read the error message immediately following the generated error code. If you are looking inside the RPerl source code, again just read the text following the associated error code:
The above source code clearly shows you that error code And the actual meaning of this code is that the RPerl grammar and/or parser have somehow internally generated the incorrect AST nodes, because only Operator_122 and Operator_128 are valid in this case. This is a highly technical internal RPerl error, which should never be experienced by an end-user of stable versions of RPerl. It should only occur when modifying or otherwise working on the RPerl grammar and parser directly, which you are not doing in this Pull Request Challenge. |
Updates to the Logical And operator I have recently made an important upgrade to the Logical And operator (explained below), which will require you to update your forked RPerl repository. Unfortunately, the only good way for you to update your forked repository is actually to DELETE your forked repository, and create a new fork from my current repository. Otherwise, if you try to keep your current fork and somehow update it directly, then we will end up with a confusing mess of git merge loops which I do not want to deal with whatsoever. So, please BACKUP ANY FILES which you may have already started modifying, by copying them somewhere OUTSIDE of the git directory itself on your local machine. Then, go to your forked repo web interface in GitHub, click the gear icon for "Settings", then scroll all the way to the bottom red area "Danger Zone", and click "Delete this repository", and follow the directions. Finally, execute After all this, you should NOT have to re-install anything via CPAN because I did not create any new CPAN dependencies. To ensure your new fork is installed and working correctly, you can simply try to run the More information about the Logical And operator Since you are using the Logical And operator as your example code, this message will pertain to only the Logical And operator. It is important to understand that the RPerl grammar will parse the Logical And operator in 2 different scenarios, called Operator15 and Operator23. Technically, both Operator15 and Operator23 are considered to be RPerl abstract syntax tree (AST) nodes, implemented as Perl hash data structures. The difference between these two RPerl AST nodes is that Operator15 is generated when parsing You can easily see the difference between More info about updates to the Logical And operator As mentioned above, I have made changes to the Logical And operator, specifically adding the The difference between the behavior of Perl and C++ is that Perl returns the value of the right-most operand if the operator is found to have an overall value of "true", instead of always returning a boolean value as in C++. You can see this behavior implemented with a nested ternary-in-ternary operator, in the https://github.com/wbraswell/rperl/blob/master/lib/rperloperations.h#L24-L25 Finally, the https://github.com/wbraswell/rperl/blob/master/lib/RPerl/DataType/String.cpp#L16-L24 How to invoke the Logical And operator tests, automated From inside the RPerl source code directory, execute the following commands to run automated RPerl tests on the Logical And operator, in the Operator15 parse scenario:
The three commands above will test the files in the following directory: https://github.com/wbraswell/rperl/tree/master/lib/RPerl/Test/Operator15LogicalAnd Specifically, the The The Likewise, you may run the following 3 commands to test Logical And in the Operator23 parse scenario.
How to invoke the Logical And operator tests, manual You can run the Operator15 "good" test file using the normal Perl interpreter (PERLOPS_PERLTYPES) by executing the following command from within the RPerl source code directory:
You can run the same test file through the RPerl compiler in
You can compile and run the file (CPPOPS_CPPTYPES):
Finally, you can run the compiled binary executable file again without any Perl involved at all:
The primary task in this Pull Request Challenge is to generate, inspect, and compile the C++ code file(s) which are generated, only 1 file in this case:
Your general work flow is as follows:
|
I was thinking to do this :- |
I am pretty sure your proposed git rebase process will (at the very least) create duplicate entries in the git history, which I do not want. Please delete the repo and fork a new one. |
I have been through this process myself while trying to create clean pull requests across multiple different repositories, and the only 100% correct solution I have found is a full delete and re-fork. |
@shpsi (Specifically, I am wondering if Inline::C or Inline::CPP had any installation errors on CPAN, because we are seeing some issues which may affect installation. These are not issues with RPerl itself, but one or more of RPerl's dependencies on CPAN.) |
I might have but didn't notice as installation was complete but is this the reason of me getting following error:- |
@shpsi
|
Starting Build Parse Stage Starting Build Glue 1 Stage Starting Build Glue 2 Stage Starting Build Glue 3 Stage Starting Build Compile Stage Starting "make" Stage chmod 755 blib/arch/auto/eval_74_7886/eval_74_7886.so Starting "make install" Stage Starting Cleaning Up Stage Finished Build Compile Stage [[[ END 'use Inline' STAGE for 'RPerl/HelperFunctions.cpp' ]]] in rperl, have $RPerl::DEBUG = 0, $ENV{RPERL_DEBUG} = 1 DEPENDENCIES: Follow & find all deps... 0 found. WARNING WEXRP00: Found multiple |
@shpsi |
Also, you have an important warning which indicates that you have incorrectly installed RPerl into multiple locations, which is very bad for new developers:
You should only have 1 |
@shpsi |
How to login on irc? Is this also through freenode? |
NO it is not freenode, it is irc.perl.org |
Get yourself an IRC client or use this link: |
I am running this command in direcotry ~/rperl-latest shiv@rperltesthost:~/rperl-latest$ git pull origin master |
Either you deleted/changed your remote repository, or there is an authentication problem with GitHub. |
Fixed! it was just an authentication issue. |
Implement the ast_to_cpp__generate__CPPOPS_CPPTYPES() C++ code generation subroutine for the "bitwise and" operator:
https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Operation/Expression/Operator/Bitwise/And.pm
Ensure all tests continue to pass in both the existing PERLOPS_PERLTYPES mode as well as the new CPPOPS_CPPTYPES mode:
https://github.com/wbraswell/rperl/tree/master/lib/RPerl/Test/Operator13BitwiseAnd
Upgrade the "good" test to include output, which may be dependent on compiler settings and/or integer bit length:
https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Test/Operator13BitwiseAnd/program_00_good.pl
Use the "bitwise negation" test as reference for EXECUTE_SUCCESS_INTEGER_32 and EXECUTE_SUCCESS_INTEGER_64 test output:
https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Test/Operator05BitwiseNegation/program_01_good.pl
Use the "logical and" operator as reference:
https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Operation/Expression/Operator/Logical/And.pm
Use the "getting started" documentation for step-by-step instructions:
https://github.com/wbraswell/rperl/blob/master/docs/devs_getting_started.txt
The text was updated successfully, but these errors were encountered: