psylone

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

fuelen

Ah, yes. There is a button on the page to edit it on GitHub :wink:

Also Liked

fuelen

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!

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement