Using GitHub Copilot with Elm

I tried using GitHub CoPilot for writing a simple Elm application.

I used Vite and deployed it on Vercel.

The experience was quite pleasant. It managed well the task of writing Elm code and connect to JavaScript ports. My focus shifted more to telling it want I want rather than using energy on how things are done.

It is a simple Markdown editor that shows the result as you type. It stores the thing in local storage and you can download it.

The inital prompt was:


Create a basic markdown editor in Elm with the following features:

  • Create model for markdown with default text ā€œtype markdown hereā€
  • A text area where users can write markdown
  • Show a live preview of the markdown text as I type
  • Support for basic markdown syntax like headers, bold, italics
  • The markdown text and resulting HTML should be saved in the model.

If youā€™d like to know more, here is the repository: https://github.com/perty/elm-vite-test

4 Likes

I use Codeium, which is free for individual users and itā€™s been a nice experience so far for autocompletion at least (never tried full prompt-coding).

1 Like

Iā€™ve not used Codeium, might give it a try.

The comparison chart with Copilot is wrong though, there is ā€˜in IDE chat and searchā€™ for Copilot, the chart says otherwise. Itā€™s one of the things I really like about Copilot, if Iā€™m not sure about something, I can ask - made StackOverflow redundant for me.

I also find it really useful for boilerplate stuff, like if youā€™re creating a ToString function for an Enum type, Copilot will understand and complete the code block once youā€™ve started it.

Iā€™m not a fan of AI in general, but bit the bullet with Copilot. Sometime in the not too distant future Copilot and friends may make a lot of devs redundant.

If Copilot can create

from

who needs to learn Elm? :man_shrugging: :man_shrugging:

Iā€™m getting ā€œunknown languageā€ in VS Code while trying Codeium Command option. Do you only use chat for Elm, or?

In case of Copilot, I use for completion, fix errors and chat.

He, he, you still need to know Elm. There is still the risk that AI writes the wrong code, although it nailed it this time, at every iteration.

I have also tried AI for Java and JavaScript and it works well but I am more confident when using it for Elm as the compiler catches a lot.

1 Like

I know, I always double check what it provides :+1:

Exactly my point, and itā€™s still a whipper snapper that weā€™re training. Iā€™m 53, and Iā€™m willing to bet that in my lifetime the overall demand for devs will reduce as a result of AIā€¦

And those devs still in demand, will be those that know how to work with AI.

If I remember correctly, after I installed the Codeium plugin for VS Code, on the right of the bottom status bar ā€œCodeiumā€ was written in orange to signal something. When clicking on it a popup appeared and asked something like ā€œdo you want to enable Codium for Elm (experimental)?ā€. I chose ā€œyesā€ and it works not too bad since. For JS/TS and CSS or even markdown it works really well.

1 Like

I missed that. Thank you!
Codeium Command was still throwing the same error, but autocompletion/suggestions worked.

1 Like

@perty Really impressive markdown editor result by the way :astonished:

Thank you very much, youā€™re too kind.

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