other-languages

here be heresies and things we have to use for work
orestis 2017-11-06T11:49:10.000239Z

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

4👍
val_waeselynck 2017-11-08T09:04:51.000058Z

@orestisI'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

orestis 2017-11-08T12:16:36.000226Z

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?

mpenet 2017-11-09T11:03:30.000013Z

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

mpenet 2017-11-09T11:04:00.000231Z

I guess in theory you could call elixir modules from it

orestis 2017-11-09T13:52:52.000074Z

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.

mpenet 2017-11-09T13:55:19.000075Z

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

mpenet 2017-11-09T13:55:58.000452Z

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

mpenet 2017-11-09T13:56:49.000494Z

Oh, you meant code sharing between client/server

mpenet 2017-11-09T13:56:55.000264Z

well that's another story

orestis 2017-11-09T14:04:06.000250Z

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

orestis 2017-11-09T14:04:50.000160Z

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.

mpenet 2017-11-09T14:05:42.000265Z

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

orestis 2017-11-09T14:05:53.000095Z

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.

mpenet 2017-11-09T14:06:07.000167Z

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

mpenet 2017-11-09T14:06:45.000034Z

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

orestis 2017-11-09T14:06:54.000126Z

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

mpenet 2017-11-09T14:07:30.000185Z

ah, well that's too bad.

mpenet 2017-11-09T14:08:03.000034Z

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

val_waeselynck 2017-11-06T13:38:43.000176Z

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

orestis 2017-11-06T13:51:58.000232Z

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

orestis 2017-11-06T13:52:38.000423Z

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

orestis 2017-11-06T13:53:58.000311Z

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