Fork me on GitHub
#other-languages
<
2017-11-06
>
orestis11:11:10

Just popping in here to say that I’m exploring the integration of ClojureScript with Elixir/Phoenix; it’s fun and productive so far!

val_waeselynck13:11:43

Interesting, do you find good support for things like Transit, EDN, and GraphQL / Om Next in Elixir?

orestis13:11:58

So, Transit and EDN have some Erlang libraries that I haven’t really checked. (Erlang libraries can be natively called from Elixir).

orestis13:11:38

There is an actively maintained and seemingly well-architected GraphQL library called Absinthe: http://absinthe-graphql.org

orestis13:11:58

I’m a beginner in Clojure, and opted to build the server aspect on Elixir/Phoenix to get some productivity boosts.

val_waeselynck09:11:51

@U7PBP4UVAI've been planning on learning Elixir / Phoenix for a while, the platform seems quite good and there's probably a lot of good things to steal for the Clojure world. What I'm afraid of losing though is the ability to share code between server and client

orestis12:11:36

I thought about this, but in the end I can’t imagine many places where code sharing is actually a big deal for my use cases. Perhaps some validation rules?

mpenet11:11:30

on a side note, https://github.com/clojerl/clojerl is getting more impressive every day

mpenet11:11:00

I guess in theory you could call elixir modules from it

orestis13:11:52

Not really; elixir modules are all assuming the basic Erlang/OTP building blocks like processes and message passing. Better to take Clojure code and run on elixir. Which is what clojerl does.

mpenet13:11:19

not sure I follow. https://github.com/clojerl/example-web-app/tree/master/src/web_app does exactly that. It must be like from erlang, if you really want you can just use elixir modules from erlang; you could do the same from cljerl

mpenet13:11:58

beam is quite nice for interop that way, (usually) it can go both ways

mpenet13:11:49

Oh, you meant code sharing between client/server

mpenet13:11:55

well that's another story

orestis14:11:06

Ah, ok, i thought someone said using clojerl to run elixir code in Clojure/JVM.

orestis14:11:50

Unfortunately calling Elixir code from Erlang is a bit tricky since Elixir code is macro-heavy. There was a discussion recently in the Elixir forum.

mpenet14:11:42

didn't try in a while, but it used to be at least possible

orestis14:11:53

For my the use case though of sharing some subset of Clojure between client and server, clojerl would probably work fine. It seems to combine to Erlang modules.

mpenet14:11:07

it might be just as hairy as calling scala from clojure now tho 🙂

mpenet14:11:45

yes, clojerl seems to be similar to lfe/elixir that way, you can do anything erlang can do it seems

orestis14:11:54

It’s possible to call functions. Using macros is not though, so you don’t get the nice expressiveness or DSLs that people create.

mpenet14:11:30

ah, well that's too bad.

mpenet14:11:03

personally I prefer erlang to elixir, at least the language, the ecosystem seems to grow very fast on the elixir side tho