DEV Community

HytteFolk
HytteFolk

Posted on • Updated on

Erlang for Web (setup env + hello world)

Why Erlang?
https://serokell.io/blog/introduction-to-erlang

Which web framework?
https://www.linuxlinks.com/free-open-source-erlang-web-frameworks/

Let's try N2O.
https://sample.n2o.dev/
https://github.com/synrc/sample

It seems it works better with Linux/OSX. I do not have experience neither with Linux nor OSX, so setup and configuration process might be ugly.

Let's install Erlang to WSL (Ubuntu-22.04).

We need build tool
https://rebar3.org/docs/getting-started/
it requires Erlang https://adoptingerlang.org/docs/development/setup/
https://www.erlang.org/downloads
https://docs.riak.com/riak/ts/1.5.2/setup/installing/source/erlang/index.html

> configure: error: no acceptable C compiler found in $PATH

// might be not strictly required
> sudo apt install libncurses5-dev

> sudo apt install build-essential
> configure: error: No dtrace utility found.

// might be useless
> sudo apt install systemtap

> sudo apt install systemtap-sdt-dev

WARNING: It appears that a required development package 'libssl-dev' is not installed.
WARNING: It appears that a required development package 'automake' is not installed.
WARNING: It appears that a required development package 'autoconf' is not installed.
APPLICATIONS DISABLED (See: /home/foo/.kerl/builds/26.0.1/otp_build_26.0.1.log)
 * crypto         : No usable OpenSSL found
 * jinterface     : Java compiler disabled by user
 * odbc           : ODBC library - link check failed
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

APPLICATIONS INFORMATION (See: /home/foo/.kerl/builds/26.0.1/otp_build_26.0.1.log)
 * wx             : No OpenGL headers found, wx will NOT be usable
 * No GLU headers found, wx will NOT be usable
 * wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
 *         wxWidgets must be installed on your system.
 *         Please check that wx-config is in path, the directory
 *         where wxWidgets libraries are installed (returned by
 *         'wx-config --libs' or 'wx-config --static --libs' command)
 *         is in LD_LIBRARY_PATH or equivalent variable and
 *         wxWidgets version is 3.0.2 or above.

DOCUMENTATION INFORMATION (See: /home/foo/.kerl/builds/26.0.1/otp_build_26.0.1.log)
 * documentation  :
 *                  xsltproc is missing.
 *                  fop is missing.
 *                  xmllint is missing.
 *                  The documentation cannot be built.
Enter fullscreen mode Exit fullscreen mode

We need proxy browser requests to wsl and back https://jwstanly.com/blog/article/Port+Forwarding+WSL+2+to+Your+LAN/

Other:
https://phoenixnap.com/kb/linux-export-command

Top comments (0)