{"id":20425261,"url":"https://github.com/catseye/sixtypical","last_synced_at":"2025-04-12T18:54:44.905Z","repository":{"id":15779891,"uuid":"18518981","full_name":"catseye/SixtyPical","owner":"catseye","description":"MIRROR of https://codeberg.org/catseye/SixtyPical : A 6502-oriented low-level programming language supporting advanced static analysis","archived":false,"fork":false,"pushed_at":"2024-03-17T08:24:02.000Z","size":1033,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-26T13:11:31.364Z","etag":null,"topics":["6502-assembly","abstract-interpretation","effect-system","experimental-language","flow-typing","low-level-programming","static-analysis","symbolic-execution"],"latest_commit_sha":null,"homepage":"https://catseye.tc/node/SixtyPical","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catseye.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-04-07T13:58:07.000Z","updated_at":"2024-12-17T17:29:59.000Z","dependencies_parsed_at":"2022-08-25T14:30:34.576Z","dependency_job_id":"bba9886a-9315-4926-bac8-2b019c1641b2","html_url":"https://github.com/catseye/SixtyPical","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FSixtyPical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FSixtyPical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FSixtyPical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FSixtyPical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catseye","download_url":"https://codeload.github.com/catseye/SixtyPical/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618262,"owners_count":21134200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6502-assembly","abstract-interpretation","effect-system","experimental-language","flow-typing","low-level-programming","static-analysis","symbolic-execution"],"created_at":"2024-11-15T07:12:43.612Z","updated_at":"2025-04-12T18:54:44.863Z","avatar_url":"https://github.com/catseye.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SixtyPical\n==========\n\n\u003c!--\nCopyright (c) 2014-2024, Chris Pressey, Cat's Eye Technologies.\nThis file is distributed under a 2-clause BSD license.  See LICENSES/ dir.\nSPDX-License-Identifier: LicenseRef-BSD-2-Clause-X-SixtyPical\n--\u003e\n\n_Version 0.21_\n| _See also:_ [Bubble Escape 2K](https://codeberg.org/catseye/Bubble-Escape#bubble-escape)\n∘ [SITU-SOL](https://git.catseye.tc/SITU-SOL/)\n\n- - - -\n\n_NOTE: Having met the majority of its goals, the SixtyPical project_\n_might not undergo much more development going forward.  See_\n[Future directions for SixtyPical][] _for more information._\n\n- - - -\n\n**SixtyPical** brings advanced static analysis to the [6502][].\n\nSixtyPical is a [low-level](#low-level) programming language\nsupporting some advanced [static analysis](#static-analysis) methods.\nIts reference compiler can generate [efficient code](#efficient-code) for\nseveral 6502-based [target platforms](#target-platforms) while catching many\ncommon mistakes at compile-time, reducing the time spent in debugging.\n\nQuick Start\n-----------\n\nMake sure you have Python (2.7 or 3.5+) installed.  Then\nclone this repository and put its `bin` directory on your\nexecutable search path.  Then you can run:\n\n    sixtypical\n\nIf you have the [VICE][] emulator suite installed, you can run\n\n    sixtypical --run-on=x64 eg/c64/hearts.60p\n\nand it will compile the [hearts.60p source code](eg/c64/hearts.60p) and\nautomatically start it in the `x64` emulator, and you should see:\n\n![Screenshot of result of running hearts.60p](images/hearts.png?raw=true)\n\nYou can try `sixtypical --run-on` on other sources in the `eg` directory\ntree, which contains more extensive examples, including an entire\ngame(-like program); see [eg/README.md](eg/README.md) for a listing.\n\nFeatures\n--------\n\nSixtyPical aims to fill this niche:\n\n*   You'd use assembly, but you don't want to spend hours\n    debugging (say) a memory overrun that happened because of a\n    ridiculous silly error.\n*   You'd use C or some other \"high-level\" language, but you don't\n    want the extra overhead added by the compiler to manage the\n    stack and registers.\n\nSixtyPical gives the programmer a coding regimen on par with assembly\nlanguage in terms of size and hands-on-ness, but also able to catch\nmany ridiculous silly errors at compile time.\n\n### Low level\n\nMany of SixtyPical's primitive instructions resemble those of the\n[MOS Technology 6502][] — it is in fact intended to be compiled to 6502\nmachine code.  However, it also provides some \"higher-level\" operations\nbased on common 8-bit machine-language programming idioms, including\n\n*   copying values from one register to another (via a third register when\n    there are no underlying instructions that directly support it)\n*   copying, adding, and comparing 16-bit values (done in two steps)\n*   explicit tail calls\n*   indirect subroutine calls\n\nWhile a programmer will find these constructs convenient, their\ninclusion in the language is primarily to make programs easier to analyze.\n\n### Static analysis\n\nThe SixtyPical language defines an [effect system][], and the reference\ncompiler [abstractly interprets][] the input program in the manner of\n[flow typing][] to confirm that it does not violate it.  This can detect\ncommon mistakes such as\n\n*   you forgot to clear carry before adding something to the accumulator\n*   a subroutine that you called trashes a register you thought it preserved\n*   you tried to read or write a byte beyond the end of a byte array\n*   you tried to write the address of something that was not a routine, to\n    a jump vector\n\n### Efficient code\n\nUnlike most conventional languages, in SixtyPical the programmer must manage\nmemory very explicitly, selecting the registers and memory locations to store\neach piece of data in.  So, unlike a C compiler such as [cc65][], a SixtyPical\ncompiler doesn't need to generate code to handle [calling conventions][] or\n[register allocation][].  This results in smaller (and thus faster) programs.\n\nThe flagship demo, a minigame for the Commodore 64, compiles to\na **930**-byte `.PRG` file.\n\n### Target platforms\n\nThe reference implementation can analyze and compile SixtyPical programs to\n6502 machine code formats which can run on several 6502-based 8-bit architectures:\n\n*   [Commodore 64][]\n*   [Commodore VIC-20][]\n*   [Atari 2600][]\n*   [Apple II series][]\n\nFor example programs for each of these, see [eg/README.md](eg/README.md).\n\nSpecification\n-------------\n\nSixtyPical is defined by a specification document, a set of test cases,\nand a reference implementation written in Python.\n\nThere are over 400 test cases, written in [Falderal][] format for readability.\nIn order to run the tests for compilation, [dcc6502][] needs to be installed.\n\n*   [SixtyPical specification](doc/SixtyPical.md)\n*   [Literate test suite for SixtyPical syntax](tests/SixtyPical%20Syntax.md)\n*   [Literate test suite for SixtyPical analysis (operations)](tests/SixtyPical%20Analysis.md)\n*   [Literate test suite for SixtyPical analysis (storage)](tests/SixtyPical%20Storage.md)\n*   [Literate test suite for SixtyPical analysis (control flow)](tests/SixtyPical%20Control%20Flow.md)\n*   [Literate test suite for SixtyPical compilation](tests/SixtyPical%20Compilation.md)\n*   [Literate test suite for SixtyPical fallthru optimization](tests/SixtyPical%20Fallthru.md)\n*   [Literate test suite for SixtyPical callgraph construction](tests/SixtyPical%20Callgraph.md)\n\nDocumentation\n-------------\n\n*   [Design Goals](doc/Design%20Goals.md)\n*   [SixtyPical revision history](HISTORY.md)\n*   [6502 Opcodes used/not used in SixtyPical](doc/6502%20Opcodes.md)\n*   [Output formats supported by `sixtypical`](doc/Output%20Formats.md)\n*   [TODO](TODO.md)\n\n[Future directions for SixtyPical]: doc/Future%20directions%20for%20SixtyPical.md\n[6502]: https://en.wikipedia.org/wiki/MOS_Technology_6502\n[MOS Technology 6502]: https://en.wikipedia.org/wiki/MOS_Technology_6502\n[effect system]: https://en.wikipedia.org/wiki/Effect_system\n[abstractly interprets]: https://en.wikipedia.org/wiki/Abstract_interpretation\n[flow typing]: https://en.wikipedia.org/wiki/Flow-sensitive_typing\n[calling conventions]: https://en.wikipedia.org/wiki/Calling_convention\n[register allocation]: https://en.wikipedia.org/wiki/Register_allocation\n[VICE]: http://vice-emu.sourceforge.net/\n[cc65]: https://cc65.github.io/\n[Commodore 64]: https://en.wikipedia.org/wiki/Commodore_64\n[Commodore VIC-20]: https://en.wikipedia.org/wiki/Commodore_VIC-20\n[Atari 2600]: https://en.wikipedia.org/wiki/Atari_2600\n[Apple II series]: https://en.wikipedia.org/wiki/Apple_II_series\n[Falderal]: https://catseye.tc/node/Falderal\n[dcc6502]: https://github.com/tcarmelveilleux/dcc6502\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fsixtypical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatseye%2Fsixtypical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fsixtypical/lists"}