psylone
Elixir Getting Started: Scripted mode
Hi! Going through the elixir-lang.org getting started guides and have a question about Scripted mode section.
You can see this point in the guide:
When executed, both extensions compile and load their modules into memory, although only .ex files write their bytecode to disk in the format of .beam files.
And further:
And execute it as:
$ elixir math.exs
The file will be compiled in memory and executed, printing “3” as the result. No bytecode file will be created.
So, the question is here: one can do the same thing with *.ex extension and run it with:
elixir math.ex
And in this case I also see no compiled *.beam file.
Guess *.exs compilation will not write *.beam file to the disk if you do it with mix. Is it correct?
Thanks!
Marked As Solved
fuelen
Also Liked
fuelen
Command elixir is used to run scripts.
Command elixirc is used to compile modules to *.beam files.
File extension is irrelevant for both commands. You may use math.my_custom_extension or even avoid it at all and name file as math.
Last Post!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









