Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello.beam
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: erl_compile erl_run clean

erl_compile:
erlc hello.erl

erl_run: erl_compile
erl -noshell -s hello start -s init stop

clean:
rm -f *.beam
14 changes: 14 additions & 0 deletions hello.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Stephan Wehner (2025)
% Erlang
% https://www.erlang.org/
%
% Usage:
% $ erlc hello.erl
% $ erl -noshell -s hello start -s init stop
-module(hello).
-export([start/0]).

start() ->
 Input = io:get_line("What is your name? "),
   Name = string:strip(Input, right, $\n),
io:format("Hello, ~s!~n", [Name]).