{"id":13610763,"url":"https://github.com/munificent/magpie","last_synced_at":"2025-04-06T12:08:46.550Z","repository":{"id":481975,"uuid":"107630","full_name":"munificent/magpie","owner":"munificent","description":"The Magpie programming language","archived":false,"fork":false,"pushed_at":"2020-12-01T21:51:20.000Z","size":9972,"stargazers_count":366,"open_issues_count":11,"forks_count":35,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-30T10:09:02.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://magpie-lang.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ajacksified/hubot-plusplus","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/munificent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-01-14T23:19:57.000Z","updated_at":"2025-02-26T13:56:13.000Z","dependencies_parsed_at":"2022-07-04T19:01:37.000Z","dependency_job_id":null,"html_url":"https://github.com/munificent/magpie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munificent%2Fmagpie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munificent%2Fmagpie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munificent%2Fmagpie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munificent%2Fmagpie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/munificent","download_url":"https://codeload.github.com/munificent/magpie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478323,"owners_count":20945266,"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":[],"created_at":"2024-08-01T19:01:47.763Z","updated_at":"2025-04-06T12:08:46.532Z","avatar_url":"https://github.com/munificent.png","language":"Python","readme":"\n\n\n                              _/Oo\u003e\n                             /(MM)\n                            A___/       m a g p i e\n                    _______AV_h_h___________________________\n                          AV\n                         AV\n                        AV\n\n\nMagpie is a small dynamically-typed programming language built around patterns,\nclasses, and multimethods. It has a prototype interpreter that runs on the JVM\nand an in-progress bytecode VM written in C++.\n\nIt looks a bit like this:\n\n    // Generates the sequence of turns needed to draw a dragon curve.\n    // See: http://en.wikipedia.org/wiki/Dragon_curve\n    def dragon(0, _)\n        \"\"\n    end\n\n    def dragon(n is Num, turn)\n        dragon(n - 1, \"R\") + turn + dragon(n - 1, \"L\")\n    end\n\n    print(dragon(5, \"\"))\n\nIts goal is to let you write code that's beautiful and easy to read, and to\nallow you to seamlessly extend the language and libraries as you see fit.\n\nYou can learn more about the language at http://magpie-lang.org/.\n\n## Getting Started\n\nMagpie has two implementations right now. There is a prototype interpreter\nwritten in Java. This supports more of the language, but is (of course) tied to\nthe JVM and is *much* slower. It's main job was to let me iterate on the\nlanguage semantics quickly.\n\nNow that the language has (mostly) settled down, I've started writing a\nbytecode VM in C++. This is the \"real\" Magpie implementation, but it's still a\nwork in progress. All current development is going on here. The Java interpreter\nis mainly a reference.\n\n### Building the Bytecode VM\n\n1.  **Pull down the code.** It lives here: https://github.com/munificent/magpie\n\n2.  **Generate a project.** From the root directory of the magpie repo:\n\n        $ cd \u003cpath to magpie repo\u003e\n        $ ./run_gyp\n\n3.  **Set the output directory (XCode 4 only).** Recent versions of XCode build\n    into some shared directory not related to where the project is. This borks\n    Magpie since it's a command-line executable that loads the core library\n    from a path relative to that executable.\n\n    Unfortunately, this setting isn't in the project itself, so gyp can't help.\n    After you generate the project, open it in XCode, then:\n\n    1. Choose \"File \u003e Project Settings...\".\n    2. On the \"Build\" tab, click \"Advanced...\".\n    3. Set \"Build Location\" to \"Custom \u003e Relative to Workspace\".\n    4. Set \"Products\" to `build`.\n    5. Set \"Intermediates\" to `build/Intermediates`.\n    6. Click \"Done\".\n\n    This should ensure that Magpie gets built into `build/\u003cconfig\u003e/magpie`.\n\n4.  **Build the project.** Do what you usually do on your OS to build the thing.\n    On Mac, that means open the XCode project and build from there. In Windows,\n    there is a Visual Studio solution you can build. On Linux, you can just run\n    `make`.\n\n[gyp]: http://code.google.com/p/gyp/\n\n### Building the Java Interpreter\n\n1.  **Pull down the code.** It lives here: https://github.com/munificent/magpie\n\n2.  **Build it.** The repo includes an Eclipse project if that's your thing. If\n    you rock the command-line, you can just do:\n\n        $ cd magpie\n        $ ant jar\n\n### Running Magpie\n\nMagpie is a command line app. After building it, you can run it by doing:\n\n        $ ./magpie\n\nThis will run the Java interpreter or the bytecode VM, whichever is more recent.\n\nIf you run it with no arguments, it drops you into a simple REPL. Enter a\nMagpie expression and it will immediately evaluate it. Since everything is an\nexpression, even things like class definitions, you can build entire programs\nincrementally this way. Here's one to get you started:\n\n    for i in 1..20 do print(\"\u003cyour name\u003e is awesome!\")\n\nIf you pass an argument to the app, it will assume it's a path to a script\nfile and it will load and execute it:\n\n    $ ./magpie example/hello.mag\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunificent%2Fmagpie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmunificent%2Fmagpie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunificent%2Fmagpie/lists"}