-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for GAP (www.gap-system.org) #51
Conversation
If you are curious, GAP can be used as part of Sagemath (and also as a Julia library too!) but is also frequently used as a seperate project. Known issues: GAP has automatic line wrapping. I made lines 9999 characters long so this doesn't interact with codebraid's output commands. |
I've looked over this and have some comments now. I'll go over it again a final time in more detail to double-check everything once you are ready to merge.
Two final remarks that aren't directly related to this code:
|
Hi, I'll go through your comments, thanks! I'll just mention a few (as they might be generally useful). GAP doesn't have any explicit 'flush' function. (If you go searching you might find IO_flush, but that isn't useful in this situation). So far codebraid seems to be working fine without it. If flushing really is required, I could investigate adding it to GAP (I could also use the IO library to do output, so then I could use IO_flush, but that raises other issues). Unfortunately, at the moment we don't get error locations. By default when an error occurs GAP enters a debugger straight away (which hangs codebraid, as you have to type into it). I disable that debugger, but it's the debugger that does most work of printing error locations. The
I will have a look at the python_repl. It might be interesting to use that when people want to interact with the debugger (which I mentioned earlier is built-in, as soon as you enter an error in interactive mode, the prompt changes to |
For flushing output: All the existing templates for languages flush stdout and stderr, but that's because there's an assumption that these typically won't be line buffered. If GAP automatically flushes at the end of each line, then this isn't necessary. Actually, the main impacts of not flushing are (1) For error locations: It might be possible to modify Codebraid so that it detects the debugger starting by looking for |
1bb1708
to
911ba92
Compare
911ba92
to
bc5062c
Compare
Sorry, dropped this PR on the floor (although I have been using this myself for generating some small documents). I had a rebase and cleaned up some minor issues. While I'm sure it could continue to be improved, I think it's OK for now. Random thing I observed while looking over this -- the sage integration seems to have broken, I think it's just not been updated? |
Sorry for the delay...I've been focused on updating the Codebraid VS Code extension recently, and am now back to working on Codebraid itself. This looks good, so I've merged it. It will probably be a few days before a new release incorporating GAP is out. Also, I'll check Sage support and see if something needs to be fixed. |
This adds support for the "GAP" programming language.
I'm going to try using this over the next few days, so may improve it, but thought I would put it here for any initial comments.
One thing I wasn't completely sure on is how many (and how much it matters?) newlines I need before + after the delims.