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

TI Program - Add Extensions and Improve Statistics for TI Assembly Programs #6295

Closed
darkmastermindz opened this issue Feb 18, 2023 · 7 comments

Comments

@darkmastermindz
Copy link

darkmastermindz commented Feb 18, 2023

Describe the enhancement

There's missing extensions in linguist for TI Assembly which are part of TI Program.

It was brought to my attention by @TIny-Hacker that statistics for TI Programmers are widely skewed towards the most basic programs (with #5446 missing which exemplifies some basic programs in newer formats) such as while majority of the community uses TI Assembly but not all the extensions are included as there's no z80 assembly syntax highlighting for ".8xk" / ".8xk.txt" while ".83p" and ".83p.txt" are among the extensions for TI Assembly that are written in assembly are missing.

References:

https://en.wikibooks.org/wiki/TI_83_Plus_Assembly

https://github.com/github/linguist/blob/1345d0122a82119ae01abc366346fc9b022cc444/lib/linguist/languages.yml#L6675-L6685

Please see conversation reference at https://twitter.com/darkmastermindz/status/1626954142756356096

Requirements

I can help with contributing some initial PRs and testing as well if needed.

- [ ] Identify all TI Assembly extensions
- [ ] Discuss syntax highlighting and statistics for TI Programs (TI Assembly vs TI Basic)
- [ ] Contribute to enhancements for each in PRs
@TIny-Hacker
Copy link
Contributor

TIny-Hacker commented Feb 18, 2023

After some thought I feel like TI Program is mostly just assuming TI-BASIC, or at least TI z80 BASIC (There isn't extension support for other TI calc models currently), since (e)Z80 ASM/C aren't necessarily platform-specific. Technically, .8xp is a binary file anyway, so most source code (even for basic programs) isn't uploaded with a .8xp extension, but just a text file like here. Binary files aren't recognized as source, so unless you specifically create a text file with your code and then change the extension, it won't detect it.

Given that assembly programs for TI calculators are often made with the extension .asm or .z80, they are counted as simply "Assembly" and not specifically TI, which is fine given that other devices (for example, gameboy) use z80 assembly as well.

Extensions for other TI calculator platforms which use some form of TI programming language could be nice to have, like .82p, .85p, .86p, .89p, .v2p, .9xp, and .tns. I'm not exactly sure why .8xk is supported, since it's specifically a compiled app binary and the source for that would be .asm or .z80 (not .8xk).

@TIny-Hacker
Copy link
Contributor

I've created a grammar for z80 TI-BASIC here which could possibly help with syntax highlighting.

What makes the most sense to me is to remove .8xk and .8xk.txt, add .83p and .83p.txt, and possibly rename from "TI Program" to "TI-BASIC" so there's less ambiguity.

@darkmastermindz
Copy link
Author

darkmastermindz commented Mar 1, 2023

Hi @Alhadis & @scottmangiapane - previously you discussed about TI Programs and ASM in #3330 - I would like to hear some input on this as well on this before starting a PR. I definitely would like TI Programs to be accurately represented. :D

@scottmangiapane
Copy link
Contributor

Oh man, this is a blast from the past, both this repo and calculator programming in general. It's nice to see there's still an interest and community around it :)

Technically, .8xp is a binary file anyway, so most source code (even for basic programs) isn't uploaded with a .8xp extension, but just a text file like here. Binary files aren't recognized as source, so unless you specifically create a text file with your code and then change the extension, it won't detect it.

I agree with this... .8xp is the extension for the source files on the calculator itself, but it's stored as binary and not normal plaintext source code. Linguist can't recognize binary files (or at least that was the case 6 years ago) so people need to translate them with a tool like this then upload the resulting text under the .8xp.txt extension.

IIRC I didn't realize Linguist couldn't recognize binary files when I first added the .8xk extension, and I thought it would help GitHub recognize compiled apps. I have no problem with removing .8xk now if that is still the case. (and .8xk.txt probably shouldn't have existed to begin with).

I know very little about assembly, so I can't speak to that, except that I agree marking all .asm as calculator programs would be bad lol.

possibly rename from "TI Program" to "TI-BASIC" so there's less ambiguity

I hesitate to rename "TI Program" to "TI-BASIC". Before the color TI-84s came out a lot of programs were made with axe parser, which is more powerful than TI-BASIC, compiles into assembly, and has its own syntax that's similar to but distinct from TI-BASIC. But it's been a long time since then, and from my googling it seems that Axe hasn't been updated in years, so perhaps it's no longer relevant.

@scottmangiapane
Copy link
Contributor

Searching here I see some repos using .8xp.txt like I intended, and some that just uploaded the plaintext as .8xp. I don't see any instances of .8xk or .8xk.txt so I doubt they'll be missed if we do remove them.

@TIny-Hacker
Copy link
Contributor

I hesitate to rename "TI Program" to "TI-BASIC". Before the color TI-84s came out a lot of programs were made with axe parser, which is more powerful than TI-BASIC, compiles into assembly, and has its own syntax that's similar to but distinct from TI-BASIC.

I agree with this as well. Initially when I suggested renaming it I wasn't thinking of third-party languages like AXE on monochromes and ICE on the colored calculators. While it isn't used much anymore (given that most students use color calculators now), it (along with ICE) still is widespread enough that I don't think renaming makes sense anymore.

@darkmastermindz
Copy link
Author

@scottmangiapane @TIny-Hacker I think a good approach to solution to also have is to maybe make TI Program a parent group and then split these into separate categories based on highlighting requirements much like how Typescript is implemented in languages.yml so we can solve the problem of statistics first without changing the current implementation.

https://github.com/github/linguist/blob/1345d0122a82119ae01abc366346fc9b022cc444/lib/linguist/languages.yml#L30-L31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants