{"id":13561975,"url":"https://github.com/boardwalk/erltest","last_synced_at":"2026-01-24T13:49:43.090Z","repository":{"id":141498684,"uuid":"80078657","full_name":"boardwalk/erltest","owner":"boardwalk","description":"Erlang example application","archived":false,"fork":false,"pushed_at":"2017-01-26T04:56:30.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T13:38:17.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/boardwalk.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}},"created_at":"2017-01-26T02:15:22.000Z","updated_at":"2024-07-25T11:03:21.000Z","dependencies_parsed_at":"2024-01-14T03:44:55.953Z","dependency_job_id":"c2f4bee3-f1fa-40e8-9ad6-6e9a978265cb","html_url":"https://github.com/boardwalk/erltest","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/boardwalk%2Ferltest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boardwalk%2Ferltest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boardwalk%2Ferltest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boardwalk%2Ferltest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boardwalk","download_url":"https://codeload.github.com/boardwalk/erltest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247047155,"owners_count":20874785,"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-01T13:01:03.227Z","updated_at":"2026-01-24T13:49:43.030Z","avatar_url":"https://github.com/boardwalk.png","language":"Erlang","funding_links":[],"categories":["Erlang"],"sub_categories":[],"readme":"# erltest\n\nErlang example application. I created this for myself to understand how an Erlang application goes together without Elixir's Mix doing everything for me.\n\n## Directory structure\n\n```\nerltest/\n  Our application's directory. This could also be called Name-VSN if we\n  cared about versioning.\n\nerltest/src/\n  All of our Erlang source code.\n\nerltest/src/myapp.erl\n  Implements the application behavior. Starts a supervisor named 'mysuper'.\n\nerltest/src/mysuper.erl\n  Implements the supervisor behavior. Starts a child named 'myserver'.\n\nerltest/src/myserver.erl\n  Implements the gen_server behavior. Doesn't do anything except print on startup.\n\nerltest/ebin/\n  Compiled source code as .beam files and our .app file.\n\nerltest/ebin/erltest.app\n  Describes our application. The 'applications' key specifies what applications\n  must be started before this one. The optional 'mod' key specifies what module\n  implements the 'application' behavior to start and stop it.\n\nerltest.rel\n  Describes our release, including all of the applications it contains.\n```\n\n## Usage\n\nTo compile our source code, we run build-erl:\n\n```\n$ ./build-erl\n```\n\nThis compiles `erltest/src/*.erl` to `erltest/ebin/*.beam`.\n\nTo create our boot file, we run build-boot:\n\n```\n$ ERL_LIBS=. ./build-boot\n```\n\nThe creates erltest.script, a script that describes how to start our release as well as erltest.boot, a binary version of the script. We need `ERL_LIBS=.` because Erlang needs to be able to find the erltest.app file of the erltest application we referenced in erltest.rel, and the current directory is not in its load path by default.\n\nTo finally bring up our system, we run erl:\n\n```\n$ ERL_LIBS=. erl -boot erltest\nErlang/OTP 19 [erts-8.6] [source] [128-bit] [smp:32:32] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\n\nmyserver init\nEshell V8.6  (abort with ^G)\n```\n\nThis time we need `ERL_LIBS=.` so Erlang can find our .beam files. `-boot erltest` tells Erlang to execute erltest.boot, which essentially starts the kernel, stdlib, and erltest applications.\n\nNow we stop our application:\n\n```\n\u003e application:stop(erltest).\nmyserver terminate\nok\n=INFO REPORT==== 25-Jan-2027::20:47:00 ===\n    application: erltest\n    exited: stopped\n    type: permanent\n```\n\nAnd restart it if we want:\n\n```\n\u003e application:start(erltest).\nmyserver init\nok\n```\n\nWe can see our supervisor and server running with i:\n\n```\n\u003e i().\nPid                   Initial Call                          Heap     Reds Msgs\nRegistered            Current Function                     Stack              \n...\n\u003c0.67.0\u003e              supervisor:mysuper/1                   233       96    0\nmysuper               gen_server:loop/6                        9              \n\u003c0.68.0\u003e              myserver:init/1                        233       34    0\nmyserver              gen_server:loop/6                        9              \n...\n```\n\nYou can talk to the server too:\n\n```\n\u003e gen_server:call(myserver, \"jabba\").\n\"hello jabba from myserver\"\n```\n\nThat's it! Not too bad.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboardwalk%2Ferltest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboardwalk%2Ferltest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboardwalk%2Ferltest/lists"}