ecoji icon indicating copy to clipboard operation
ecoji copied to clipboard

Add Gleam version

Open lpil opened this issue 4 years ago • 15 comments

Also usable from other BEAM languages such as Erlang and Elixir.

lpil avatar Jun 26 '20 15:06 lpil

@lpil I will look at this in the next few days

keith-turner avatar Jul 04 '20 22:07 keith-turner

@lpil I tried building this and saw the following. I downloaded gleam-v0.10.0-linux-amd64.tar.gz from the github releases page.

$ gleam build

error: Unknown import
  ┌─ /home/AzureUser/git/ecoji/src/ecoji.gleam:2:8
  │
2 │ import gleam/bit_builder.{BitBuilder}
  │        ^^^^^^^^^^^^^^^^^ did you mean `ecoji/table`?

The module `ecoji` is trying to import the module `gleam/bit_builder`,
but it cannot be found.

keith-turner avatar Jul 12 '20 22:07 keith-turner

Hi Keith! You'll need to use the rebar3 build tool to compile the project rather than using the raw compiler. If you have it installed running rebar3 eunit will run the tests and rebar3 shell will run an Erlang shell for the project.

There's language installation instructions on the website: https://gleam.run/getting-started/index.html

lpil avatar Jul 12 '20 22:07 lpil

@lpil now I see the following error (I know nothing about erlang)

$ rebar3 shell
===> Verifying dependencies...
Compiling gleam/bitwise
Compiling gleam/function
Compiling gleam/string_builder
Compiling gleam/bit_string
Compiling gleam/order
Compiling gleam/bool
Compiling gleam/pair
Compiling gleam/io
Compiling gleam/option
Compiling gleam/regex
Compiling gleam/bit_builder
Compiling gleam/result
Compiling gleam/int
Compiling gleam/list
Compiling gleam/queue
Compiling gleam/map
Compiling gleam/set
Compiling gleam/should
Compiling gleam/float
Compiling gleam/iterator
Compiling gleam/atom
Compiling gleam/dynamic
Compiling gleam/string
Compiling gleam/base
Compiling ecoji/table
Compiling gleam/os
Compiling ecoji
Compiling ecoji_test
Compiling gleam/uri
Done!
===> Compiling gleam_stdlib
===> Compiling _build/default/lib/gleam_stdlib/src/gleam_stdlib.erl failed
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:2: can't find include lib "eunit/include/eunit.hrl"; Make sure eunit is in your app file's 'applications' list
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:16: undefined macro 'assertEqual/2'
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:17: undefined macro 'assertNotEqual/2'
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:18: undefined macro 'assertMatch/2'
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:19: undefined macro 'assertMatch/2'

_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:4: function should_be_error/1 undefined
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:4: function should_be_ok/1 undefined
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:4: function should_equal/2 undefined
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:4: function should_not_equal/2 undefined

keith-turner avatar Jul 12 '20 22:07 keith-turner

It looks like your Erlang installation is missing the eunit libraries. If you've installed Erlang using your operating system package manager there may be additional packages that need to be installed to be ready for development.

lpil avatar Jul 12 '20 22:07 lpil

@lpil I am trying to run this on Ubuntu 18.04. I got a bit further after reading your comment I looked for other things to install and found apt install erlang-dev. Still can not get to the point of running. Seeing the following error.

$ rebar3 shell
===> Verifying dependencies...
Compiling gleam/bitwise
Compiling gleam/function
Compiling gleam/string_builder
Compiling gleam/bit_string
Compiling gleam/order
Compiling gleam/bool
Compiling gleam/pair
Compiling gleam/io
Compiling gleam/option
Compiling gleam/regex
Compiling gleam/bit_builder
Compiling gleam/result
Compiling gleam/int
Compiling gleam/list
Compiling gleam/map
Compiling gleam/queue
Compiling gleam/set
Compiling gleam/should
Compiling gleam/float
Compiling gleam/iterator
Compiling gleam/atom
Compiling gleam/dynamic
Compiling gleam/string
Compiling ecoji/table
Compiling gleam/base
Compiling ecoji
Compiling ecoji_test
Compiling gleam/os
Compiling gleam/uri
Done!
===> Compiling gleam_stdlib
===> Compiling _build/default/lib/gleam_stdlib/src/gleam_stdlib.erl failed
_build/default/lib/gleam_stdlib/src/gleam_stdlib.erl:none: undefined parse transform 'eunit_autoexport'

keith-turner avatar Jul 12 '20 23:07 keith-turner

That's another eunit related library that is missing. I'm afraid I don't know what packages would be required, I typically build Erlang from source

lpil avatar Jul 12 '20 23:07 lpil

Any joy here @keith-turner ?

lpil avatar Nov 12 '20 16:11 lpil

Hi @keith-turner , can we merge this? Perhaps the tests running on CI could be evidence of it working? Or we could test inside a docker container?

lpil avatar Jan 18 '21 11:01 lpil

Hello @keith-turner , any progress here?

lpil avatar Mar 29 '21 10:03 lpil

Hello @keith-turner , any progress here?

@lpil no I have never tried to build and run it again since when I was unable to run it before.

keith-turner avatar Apr 06 '21 01:04 keith-turner

Is running CI sufficient evidence? Alternatively are you able to run docker containers on your machine? I could provide either.

lpil avatar Apr 06 '21 07:04 lpil

A third option is that if you install Erlang using the .deb supplied by Erlang Solutions that will have all the libraries required.

Forth there seems to be an erlang-eunit package on Ubuntu, though I can't vouch for the suitability.

lpil avatar Apr 06 '21 07:04 lpil