On Fri, Sep 29, 2017 at 08:12:53AM +0000, Marc Worrell wrote:
> Thinking of it… we do use a lot of records for all notifications and 
> postbacks.
> Are those supported in Elixir?

Records are supported, here is the Elixir syntax:
Maps are generally easier to deal with than records, though, in both languages.

I have converted larger Erlang codebases to Elixir incrementally. The
first step is generally to switch the project to using using mix, the
Elixir build tool. Second is to switch to using maps for the core data
structures, so it's easier to interoperate. Then we do a "mechanical"
conversion from Erlang to Elixir, as the language semantics are
essentially the same. Depending on the state of tests in the project, we
would either use the Erlang tests to validate that things are still
working properly, or write tests using Elixir's ExUnit and friends.
Finally we start using the syntax improvements in Elixir to make the code nicer.

For interop, doing the first two steps would make things easiest for
Elixir folks. It adds a dependency on Elixir to build the system,

> - Marc


> > On 29 Sep 2017, at 08:54, Kai Janson <kot...@gmail.com> wrote:
> > 
> > Some of the things in the hrl file could be replaced by Elixir macros or 
> > functions?
> > 
> > On Sep 29, 2017, at 02:51, Marc Worrell <mworr...@me.com 
> > <mailto:mworr...@me.com>> wrote:
> > 
> >> Hi Allen,
> >> 
> >> Two weeks ago David de Boer and I had a look at how Elixir and 
> >> Erlang could be mixed.
> >> 
> >> We concluded that it all should be possible to do with the master.
> >> But also that we didn’t know enough of Elixir to make it frictionless.
> >> So we need some help with this.
> >> 
> >> The master is split in applications, and those will all be pushed to Hex.
> >> That is a good start for any Elixir setup, I guess.
> >> 
> >> The main zotonic.hrl is mainly included because we like to poke around in 
> >> #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
> >> 
> >> There are some other macros in there, but they are not essential.
> >> So it is not really needed for building modules etc.
> >> 
> >> We welcome help to make Zotonic work with Elixir!
> >> 
> >> Arjan could probably help as well - though he is very busy right now.
> >> 
> >> Cheers, Marc
> >> 
> >> 
> >>> On 29 Sep 2017, at 03:17, Allen Wyma <allen.w...@gmail.com 
> >>> <mailto:allen.w...@gmail.com>> wrote:
> >>> 
> >>> Hi,
> >>> 
> >>> Does anyone have a guide with how to use elixir with Zotonic?
> >>> We're a ruby house that's looking to switch to elixir, but
> >>> sometimes we get projects that seem to work better for a CMS. When
> >>> I saw this project, I was quite amazed and we'd like to start to
> >>> experiment a bit with it.
> >>> 
> >>> Is it possible to have a guide of how to use elixir with Zotonic?
> >>> I've tried looking a bit at the code for erlang, and it includes
> >>> references to hrl (erlang macro/header files) which are not
> >>> supported in elixir. This is probably my biggest question of how
> >>> to translate over the code.
> >>> 
> >>> Thanks


You received this message because you are subscribed to the Google Groups 
"Zotonic developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to zotonic-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to