{"id":20839313,"url":"https://github.com/ailln/hey-julia","last_synced_at":"2026-05-26T05:01:47.942Z","repository":{"id":102506836,"uuid":"283765924","full_name":"Ailln/hey-julia","owner":"Ailln","description":"Julia 语言入门","archived":false,"fork":false,"pushed_at":"2020-08-07T18:14:14.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T14:11:04.585Z","etag":null,"topics":["julia","julia-language","julialang"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"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/Ailln.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-07-30T12:20:19.000Z","updated_at":"2020-08-07T18:14:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"464d7b64-17bf-49cf-8361-cde800ed5de5","html_url":"https://github.com/Ailln/hey-julia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ailln/hey-julia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fhey-julia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fhey-julia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fhey-julia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fhey-julia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ailln","download_url":"https://codeload.github.com/Ailln/hey-julia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fhey-julia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33504806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["julia","julia-language","julialang"],"created_at":"2024-11-18T01:13:16.494Z","updated_at":"2026-05-26T05:01:47.937Z","avatar_url":"https://github.com/Ailln.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hey Julia\n\n`Julia` 语言入门。\n\n\u003e 🎵 [The Beatles - Hey Jude](https://www.youtube.com/watch?v=A_MjCqQoLLA)\n\n## 1 安装\n\n### Mac OS\n\n去 [官网](https://julialang.org/downloads/) 下载对应的 `dmg` 文件，然后安装。\n\n需要注意的是 Mac 安装了 Julia 后，无法直接在终端中使用 julia 命令，但是可以通过手动建立链接的形式实现，这里以 1.4 版本为例，需要根据你的版本好做调节。\n\n```bash\nln -s /Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia\n```\n\n### Ubuntu\n\n最简单的方法莫过于直接使用 apt 安装，但是这样的话版本可能会很老。比如当前最新版本是 `v1.4.2`，而使用 apt 安装的版本是 `v0.4.5`。\n\n```bash\nsudo apt install julia\n```\n\n当然你可以选择去 [官网](https://julialang.org/downloads/) 下载需要版本的压缩包，下载后直接解压。\n\n```bash\ntar -zxvf julia-1.4.2-linux-x86_64.tar.gz\n```\n\n我通常会有个专门的目录放软件，因此我们把解压后的软件移动过去。\n\n```bash\nmv julia-1.4.2 ~/software/julia-1.4.2\n```\n\n上面两个步骤你也可以直接在图像界面操作。\n\n接下来要添加环境变量，如果你使用的是 bash 的话，操作如下（其他 shell 类似）:\n\n```bash\n$ vim ~/.bashrc\n# 在底部添加\nexport PATH=$PATH:$HOME/software/julia-1.4.2/bin:$PATH\n\n# 使环境生效\n$ source ~/.bashrc\n```\n\n## 2 Hey\n\n在终端中直接输入 `julia` 命令，进入 REPL 中。\n\n```julia\njulia\u003e println(\"hey julia\")\nhey julia\n\njulia\u003e name = \"julia\";\njulia\u003e println(\"hey $(name)\")\nhey julia\n```\n\n我们也可以在 shell 里操作，直接执行文件。\n\n```bash\n$ julia hey.jl\nhey julia\nhey julia\n```\n\n## 3 REPL\n\n### 4 种交互模式\n\n```julia\n# 在 shell 中输入 julia 进入默认的 julia 模式，按 Ctrl+D 退出\n# 执行 julia 代码\njulia\u003e\n\n# 输入 ] 进入 Pkg 模式，按 Ctrl+C 退出\n# 管理程序包\njulia\u003e ]\npkg\u003e\n\n# 输入 ; 进入 shell 模式，执行一次命令后自动退出\n# 执行普通的 shell 命令\njulia\u003e ;\nshell\u003e\n\n# 输入 ? 进入 help 模式，按 Ctrl+C 退出\n# 查询 julia 语言的帮助文档\njulia\u003e ?\nhelp?\u003e\n```\n\n## 4 Julia 和 Python 的比较\n\n- Julia 的任何结构代码后要加 end，类似于 Ruby；\n- Julia 的 return 可以省略；\n- Julia 可以使用 const 定义常量，但依然可以修改；\n- Julia 区分字符和字符串，分别为 Char 和 String 类型；\n\n## 5 交流\n\n欢迎添加微信号：`Ailln_`，备注「Julia」，我邀请你进入交流群。\n\n## 6 参考\n\n- [什么是REPL？ - Ailln的回答 - 知乎](https://www.zhihu.com/question/53865469/answer/800624678)\n- [Julia 中文文档](https://docs.juliacn.com/latest/)\n- [Julia#设置国内浙大，中科大镜像站](https://blog.csdn.net/qq_38063935/article/details/84971513)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failln%2Fhey-julia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Failln%2Fhey-julia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failln%2Fhey-julia/lists"}