Skip to content
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

Consistently represent dbg #2

Merged
merged 5 commits into from
Dec 2, 2024
Merged

Consistently represent dbg #2

merged 5 commits into from
Dec 2, 2024

Conversation

thaliaarchi
Copy link
Contributor

@thaliaarchi thaliaarchi commented Dec 2, 2024

This makes the dbg instruction more consistent. The assembler recognized it as both debugger, but it was dbg elsewhere, and the Whitespace parser recognized it as both "\n\n " and "\n\n\t", but the assembler always emitted "\n\n ". Standardize on dbg and "\n\n ".

Also rename the --debugger option to --extensions to reflect its broader purpose and fix a broken test.

See the commit messages for more details.

I'm revisiting my universal assembler, so these fixes came to mind. You may be interested in seeing my list of extension instructions from various Whitespace implementations, including yours.

The breakpoint extension instruction is written as `debugger` for the
assembler, but printed as `dbg` by the debugger and internally named
`dbg`. This difference makes the output of the disassembler not able to
be fed into the assembler. Settle on `dbg` to match the other short
names.
It enables not only the `dbg` instruction, but also bitwise operations,
so broaden the name.
The parser accepts both "\n\n " and "\n\n\t" for dbg, but the assembler
always emits "\n\n ". Accept only the former.

Also, similarly refactor the stack opcode parsing to simplify.
The `test` shorthand from Burghard wsa is not supported by the
assembler.
`String.prototype.split` and `String.prototype.charCodeAt` separate
Unicode codepoints into UTF-16 code units.
Copy link
Owner

@voliva voliva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, I truly appreciate this @thaliaarchi! This is something I wanted to address too.

Thank you so much!

Offtopic, but I think you might find interesting that I have successfully implemented keccak-256 hashing function, published here

@voliva voliva merged commit dd86212 into voliva:main Dec 2, 2024
@thaliaarchi
Copy link
Contributor Author

I saw when you added keccac.wsa. Quite impressive! I like the decorator feature you added too. (By the way, when there's more decorators than compiled lines, the trailing decorators are dropped. I'm not sure how that should be handled.)

You may be interested to know that I'm working on a language server for Whitespace assembly (including your dialect). I can't promise when it'll be ready, but I'm excited since I've been intending to do this for a long time.

@thaliaarchi thaliaarchi deleted the consistent-ops branch December 3, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants