mrkaspa
I have some questions about this:
- Is everything compiled and ran by mix already using hipe, after running iex I see that hipe shows on the message
iex
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.3.2) - press Ctrl+C to exit (type h() ENTER for help)
-
How can I compile only an specific module in erlang I can add the attribute module -compile()
-
Is there a guide about when we should use HIPE and how to use it on elixir?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
michalmuskala
You use hipe exactly the same way you do it in erlang - with a module attribute. The syntax in elixir is
@compile .... Thehipebit in the VM manifest is merely stating that this VM has support for hipe-compiled programs.Hipe doesn’t work too good if you have a code that switches often between hipe and non-hipe code - the switches are expensive.
NobbZ
I never used HiPE per module attribute in erlang, but using
{erl_opts, [{native, o3}]}in myrebar.config.So could you please provide a full example of how to activate HiPE for a single module, and for the complete project as well?
mrkaspa
Check this chapter Modules | Learn You Some Erlang for Great Good!
sneako
There is an ElixirSips video showing how to use HiPE https://www.dailydrip.com/topics/elixirsips/drips/native-compilation-with-hipe
ellispritchard
For the record, you can set the env-var
ERLC_COMPILER_OPTIONSwith options to be passed toerlcwhen compiling Erlang and Elixir code (because Elixir code gets translated to Erlang).See Allow mix to pass compiler options to erlang · Issue #2665 · elixir-lang/elixir · GitHub
e..g. to compile only your deps native:
You know it’s working if compiling takes much longer!
Exadra37
Not accurate here…
The correct is:
Both Elixir and Erlang are compiled to same byte code.
OvermindDL1
No, actually Elixir does output to Erlang code. Erlang Core it might do later, but for now it is still outputting to Erlang itself for a variety of extra ‘free’ compiler checks it gets.
Exadra37
Thanks for the clarification @OvermindDL1 and sorry @ellispritchard for my wrong correction.
This was caused by reading somewhere, more than once, that Elixir was compiled to the same byte code of Erlang, not translated to Erlang code.
Trying to find that sources led me to this article https://medium.com/@fxn/how-does-elixir-compile-execute-code-c1b36c9ec8cf and for what I can understand Elixir is not translated to true Erlang code as some Erlang developer would write, but instead is translated to an Erlang Abstract Format to take advantage of the mentioned BEAM optimisations.
I was not able to find the sources of my misunderstood but at least I know more about what is the compiler process now
OvermindDL1
From my understanding it does output to Erlang itself, not Erlang Core, I know that translating to a lower level was eventually planned (and the new debug segments added to the BEAM facilitate making that easier), but I don’t think it’s been done yet? Would love to find out though.
Exadra37
Well from the blog post I linked it does look like so…
Maybe I am still misunderstanding something?