{"id":13832212,"url":"https://github.com/bradfitz/campher","last_synced_at":"2025-03-17T06:31:35.042Z","repository":{"id":1473710,"uuid":"1715755","full_name":"bradfitz/campher","owner":"bradfitz","description":"Embed Perl in Go. This works, but was a joke for a presentation. Don't use.","archived":false,"fork":false,"pushed_at":"2016-12-07T16:51:32.000Z","size":29,"stargazers_count":137,"open_issues_count":0,"forks_count":16,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-02-27T19:03:20.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/bradfitz.png","metadata":{"files":{"readme":"README","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":"2011-05-07T15:43:37.000Z","updated_at":"2024-06-19T09:23:08.000Z","dependencies_parsed_at":"2022-07-29T17:39:53.962Z","dependency_job_id":null,"html_url":"https://github.com/bradfitz/campher","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/bradfitz%2Fcampher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fcampher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fcampher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fcampher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradfitz","download_url":"https://codeload.github.com/bradfitz/campher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847062,"owners_count":20357317,"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-04T10:01:55.540Z","updated_at":"2025-03-17T06:31:34.646Z","avatar_url":"https://github.com/bradfitz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"What do you get when you cross a Camel with a Gopher?\n\nCampher!\n\nPerl in Go.\n\nExample of the awesomeness / horror:\n\n=========\n INSTALL\n=========\n\n$ go get github.com/bradfitz/campher\n\n=========\n EXAMPLE\n=========\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/bradfitz/campher/perl\"\n)\n\nfunc main() {\n\tp := perl.NewInterpreter()\n\tp.Eval(`$foo = \"bar\";`)\n\tfmt.Println(\"foo is:\", p.EvalString(\"$foo\"))\n\n\tcv := p.Eval(`sub { my ($a1, $a2, $func) = @_; $func-\u003e($a1, $a2); }`).CV()\n\tvar ret *SV\n\tp := perl.NewInterpreter()\n\tfoo := p.Eval(`$foo = sub {\n my ($op, $v1, $v2) = @_;\n return \"Perl says: \" . $op-\u003e($v1, $v2);\n};`)\n\tconcat := func(a, b string) string { return a + b }\n\tfmt.Println(\"concat:\", foo.CV().Call(concat, \"foo\", \"bar\"))\n\n\tbase := 0\n\tadd := func(a, b int) int {\n\t\tbase++\n\t\treturn a + b + base\n\t}\n\tfmt.Println(\"add:\", foo.CV().Call(add, 1, \"40\"))\n\tfmt.Println(\"add:\", foo.CV().Call(add, 1, \"40\"))\n}\n\n\n================\n EXAMPLE OUTPUT\n================\n\nconcat: Perl says: foobar\nadd: Perl says: 42\nadd: Perl says: 43\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradfitz%2Fcampher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradfitz%2Fcampher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradfitz%2Fcampher/lists"}