kuroda
When we try to evaluate an Elixir code m = %{}; m.foo = 1 on IEx, it emits the following error message :
** (CompileError) iex:1: cannot invoke remote function m.foo/0 inside a match
I know that we cannot call m.foo/0 inside a pattern match, but I have some questions:
- What is a remote function exactly?
- What is called a function that is not a remote function?
I cannot find a definition of this word within the documentation.
Perhaps, it refers to a remote call, which is used in the left . right?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
A remote function is a function in a module that isn’t this one.
A local function is one defined in the current module.
There is a slight cost in the BEAM to execute a remote function over a local one, but not material to a design decision.
NobbZ
A remote call is every function call which is qualified by its module.
The recursive call here is a remote call, with all of its costs.
patrickdm
Could you suggest some resource to learn about the costs of remote calls please? At this point I’m intrigued and curious! Thank you.
hauleth
That is not fully true as
__MODULE__.foo()is also remote call. In short the difference between remote and local call is that you put the module name before remote call.hauleth
The advantage and disadvantage of the remote calls is exactly the same:
The remote call allows for the hot code reload, which mean that it need to check if there is no newer code each time it is called.
However if you are trying to use local call as a lambda in form of
&foo/0then it will be slower than&__MODULE__.foo/0as the second can be as a constant so will be faster to call.NobbZ
Though here we have to remember, that for
&__MODULE__.foo/0to work, the function needs to be exposed/public, by usingdef, while when doing&foo/0the function is allowed to be private (defp).hauleth
Any remote call need to point to public function.
patrickdm
Thank you very much @hauleth and @NobbZ for the explanation! Is this kind of things (I mean ignorance here) that triggers the impostor syndrome in me.. than I remember It’s all in my mind. Nothing serious indeed.
kuroda
Thank you everyone for answering the question.
Does anyone know where to find a description of a remote function call in the erlang documentation or its source code?
Qqwy
I think this is a good starting point: