Elm and smart contracts (blockchains)

Hi,

As total Elm beginner I would really appreciate some feedback … was wondering has anybody used Elm as frontend client for Ethereum based smart contract - specificly Quorum network with private contracts?

I found there are two packages, but not really sure about them.

I would really like to avoid React and other JS based frameworks… but as a Elm beginner I must admit I am a bit scared about all this ecosystem around Elm and the fact that community doesnt grow as one would expect. Why is that? What would happen if Evan decides that he has enough? I know there are others, but to my understandings he still has some Would I be able to do all inside Elm? What if not?

Thanks in advance

1 Like

What does that mean? I think there are billions of line of Elm code at the moment.

The Elm community continues to grow, new packages and tooling is constantly being created. But Elm is a small language with a small community and thus a small ecosystem. If you choose to use Elm you’ll have to be comfortable with the choice of a smaller ecosystem.

It’s likely someone else would take over as there are lot of companies that depend on Elm. But this is a potential problem you’ll always encounter with any smaller ecosystem and even some rather large ones.

There are some Ethereum related packages around.
eg. https://package.elm-lang.org/packages/cmditch/elm-ethereum/latest/

But it’s likely you’d be doing that part of your app in JS using the JS library for it and communicating with it from Elm via a port.

@drathier works (or worked) with something in this direction I think.

In terms of the ecosystem, returning to Elm after a year coding in Elixir, I feel that we’re in a Golden Age in terms of the quality and ambition of packages being released: from elm-review to elm-pages, from elm-program-test to elm-animation, and much more.

Having recently (and successfully) introduced previous “killer packages” elm-graphql and elm-css to a project, I’m looking forward to exploring some of these newer packages. Several of which are being developed openly on Twitch streams, Github and GitLab.

There really aren’t enough hours in the day to explore everything exciting happening in the ecosystem. Just think how much the art of the SPA has improved this year with elm-spa and the effects-pattern real world example announced on this forum (and which @avh4 recently combined on a Twitch stream).

So, yes, Elm the language is stable. But the real excitement right now is in the blossoming ecosystem.

6 Likes

I don’t agree with this. I have been doing blockchain development in Elm for more than two years and my trajectory was:

  1. Use ports with web3js.
  2. Since web3js implementation of websockets wasn’t reliable, we stopped using ports and I wrote a custom implementation of websockets for elm 0.18 because the official one was too naive to be used in production. We started using cmditch/elm-ethereum.
  3. We stopped using websockets at all because blockchain events could get lost in parity client, so we created a custom server that analyzes all blocks indexing relevant events for us. We moved back to using ports and ethersjs for blockchain interaction.
  4. We have gone back to using cmditch/elm-ethereum only for parsing and writing blockchain calls. Ports have become a proxy that connects Elm to the wallet manager. We did this because we have a complex system that does many blockchain interations that depend on each other, and we needed to have it stable once and for all.
  5. In order to make our lives easier, I created elm-effects-proxy, witch allows to use function calls, promises or generators (websockets planned, not yet implemented) making elm believe that it is making plain HTTP calls or multipart HTTP calls in the case of generators.

Right now our system is very robust from the use interaction to the blockchain interaction. Also, elm 0.19 is supposed to last a couple or three years. Also, if the core team drops it, as it has been said, many companies depend on it because, IMHO, there is nothing that can rival Elm in terms of technology. The compiler is open source, you can always fork but as the core team says, there is no strong fork out there. I think that it is because it is not needed. If for some reason I couldn’t use elm-effects-proxy anymore, I would create a fork myself, which is what I was planning to do when I found the workaround.

So, go for it. The worst that can happen is that you can learn much more than you would expect.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.