# Rewrite in Elm?

**URL:** https://meta.discourse.org/t/rewrite-in-elm/48677
**Category:** Development
**Created:** [August 15, 2016, 8:20pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677 "2016-08-15T20:20:53Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![DevinRhode2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devinrhode2/32/108394_2.png) [@DevinRhode2](https://meta.discourse.org/u/DevinRhode2)
#### Post date: [August 15, 2016, 8:20pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/1 "2016-08-15T20:20:53Z")

</div>

Curious to hear the community’s thoughts on Elm: [http://elm-lang.org](http://elm-lang.org)

I’m already well versed in Ember and am looking for a useful Ember app to try and rewrite in Elm as a way to learn Elm. Discourse is a very advanced Ember app, and I’m sure there’s plenty of things that we could all learn from attempting to rewrite the project in elm. But who out there would seriously consider using it instead of the main Ember Discourse?

I’m sure as things were learned during this rewrite, there’s lower level components that would need to be rebuilt in Elm. I’m sure this could take quite a while. I think it’d be worth it, but discourse might simply be too big of an app. It might be better to do it with something smaller and simpler, like [hospitalrun.io](http://hospitalrun.io).

---

<div class="post-metadata">

### Author: ![Dan\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_g/32/114732_2.png) [@Dan\_G](https://meta.discourse.org/u/Dan_G)
#### Post date: [August 15, 2016, 9:37pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/2 "2016-08-15T21:37:17Z")

</div>

Elm is an amazing language, it would be my first choice for doing a frontend project. It leads to very fast (especially compared to Ember), very maintainable code. It’s beginner friendly and a all around a terrific choice.

However, a tremendous number of hours have been poured into writing the current code base and a tremendous number of hours would have to be poured into a rewrite from scratch which makes the project nor feasible or desirable.

However it is possible to introduce Elm gradually into a code base, starting with converting pain points (for instance, slow parts) but I doubt it would align with the project’s priority.

Did you read the article on how to gradually introduce Elm in a project on the official blog? Here it is: [news/how-to-use-elm-at-work](http://elm-lang.org/blog/how-to-use-elm-at-work)

---

<div class="post-metadata">

### Author: ![DevinRhode2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devinrhode2/32/108394_2.png) [@DevinRhode2](https://meta.discourse.org/u/DevinRhode2)
#### Post date: [August 15, 2016, 9:42pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/3 "2016-08-15T21:42:16Z")

</div>

Thanks for your insights Daniel, haven’t seen that post but going to read it now 🙂

---

<div class="post-metadata">

### Author: ![DevinRhode2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devinrhode2/32/108394_2.png) [@DevinRhode2](https://meta.discourse.org/u/DevinRhode2)
#### Post date: [August 15, 2016, 10:45pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/4 "2016-08-15T22:45:05Z")

</div>

So, I’m at the stage of trying to become an advocate, trying to pick a small but good sort of hobby project. I need something more substantial than a widget but certainly not larger than discourse.

Working on discourse would essentially be working on an ember-\>elm upgrade path, which I think would be pretty cool, and get a lot of attention and involvement. I am very interested in collaborating/engaging with others, as opposed to making something alone.

I posted here because I had a good feeling someone would respond! 🙂

---

<div class="post-metadata">

### Author: ![Dan\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_g/32/114732_2.png) [@Dan\_G](https://meta.discourse.org/u/Dan_G)
#### Post date: [August 16, 2016, 12:06am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/5 "2016-08-16T00:06:01Z")

</div>

I think you are underestimating just how large a project Discourse is. Why not try to scratch your own itch and build your own project in Elm?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 16, 2016, 12:07am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/6 "2016-08-16T00:07:54Z")

</div>

I’m just going to leave this here:

> **[Things You Should Never Do, Part I](https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/)**
>
> Netscape 6.0 is finally going into its first public beta. There never was a version 5.0. The last major release, version 4.0, was released almost three years ago. Three years is an awfully long tim…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 16, 2016, 1:05am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/7 "2016-08-16T01:05:02Z")

</div>

but… but.. wasabi!!!

[https://blog.fogcreek.com/the-origin-of-wasabi/](https://blog.fogcreek.com/the-origin-of-wasabi/)

[https://blog.fogcreek.com/killing-off-wasabi-part-1/](https://blog.fogcreek.com/killing-off-wasabi-part-1/)

---

<div class="post-metadata">

### Author: ![DevinRhode2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devinrhode2/32/108394_2.png) [@DevinRhode2](https://meta.discourse.org/u/DevinRhode2)
#### Post date: [August 16, 2016, 1:15am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/8 "2016-08-16T01:15:43Z")

</div>

Yeah I thought of that article when I read the first reply! History tends  
to repeat itself.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 16, 2016, 1:18am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/9 "2016-08-16T01:18:12Z")

</div>

I know you’re at least somewhat 👅-in-cheek, but it’s important for anyone spectating to note that the migration away from Wasabi wasn’t a rewrite – as the second of your links makes clear, migrating from Wasabi to C# involved writing a Wasabi-to-C# translator, which is an entirely different thing to a ground-up rewrite.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 16, 2016, 1:26am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/10 "2016-08-16T01:26:16Z")

</div>

“Never {X}” is rarely good advice regardless of the source.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 16, 2016, 1:33am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/11 "2016-08-16T01:33:53Z")

</div>

> [@mpalmer](#):
>
> I know you’re at least somewhat 👅-in-cheek,

Absolutely, more seriously

### Every time I participated in a full rewrite it was a fail of medium to large proportions.

At my first job (ChaosMusic) we had a CDNOW like clone, we decided that at one point Microsoft Commerce Server was a mess and started doing this gigantic rewrite. The company eventually ran out of money before we managed to launch it. It was so cool, the UI was so much better, etc… But … launching it was impossible and eventually the company ran out of money, I left, and the rewrite was “lost” somehow which was fitting.

At my second job (Altiris, later on acquired by Symantec) they decided to rewrite the flagship product “Notification Server” between version 6 and 7. It was an insane engineering effort. I ran the “sustained engineering” team. Which was in charge of fixing bugs and supporting the **actual** product we were selling. More than half of the engineering team was sequestered away writing wonderful new bugs and a magical new platform that was going to solve all our pains we had with 6.

Needless to say this was a phenomenal failure of gigantic proportions, NS7 is now mostly dead, partly cause symantec killed it and partly cause it sucked.

So yeah…

#There is not going to be any rewriting of Discourse in X

Not going to happen, not on my watch.

Instead, we solve the problems our customers have, and build new components that make our life better introducing new tech as we need it.

We already have 3 JS rendering methods for various use cases, I do not see us adding a 4th any time soon.

> **[Neurath's boat](https://en.wikipedia.org/wiki/Neurathian_bootstrap)**
>
> Neurath's boat (or Neurath's ship) is a simile used in anti-foundational accounts of knowledge, especially in the philosophy of science. It was first formulated by Otto Neurath. It is based in part on the Ship of Theseus which, however, is standardly used to illustrate other philosophical questions, to do with problems of identity. It was popularised by Willard Van Orman Quine in Word and Object (1960).
> Neurath used the simile in several occasions, first in "Problems in War Economics" (1913). In...

> We are like sailors who on the open sea must reconstruct their ship but are never able to start afresh from the bottom. Where a beam is taken away a new one must at once be put there, and for this the rest of the ship is used as support. In this way, by using the old beams and driftwood the ship can be shaped entirely anew, but only by gradual reconstruction.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [August 16, 2016, 8:34am UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/12 "2016-08-16T08:34:38Z")

</div>

> [@sam](#):
>
> ### Every time I participated in a full rewrite it was a fail of medium to large proportions.

I also worked on two rewrites in my previous jobs and both failed **miserably** … The only way I see a rewrite _could_ work is when you are extracting **one** feature from your product and creating a new one based on that. There’s no way it’ll work if you want to keep (_a large portion of_) the same features/bugs.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [August 16, 2016, 4:32pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/13 "2016-08-16T16:32:58Z")

</div>

I’ve had people tell me “You should rewrite the backend of Discourse in X” and really I just hear it as “I have no idea how complicated Discourse actually is”

Which I think is a compliment really! Sure it just looks like you’re _just_ typing text in a box and hitting submit, but behind the scenes we’re doing a _lot_ of work based on that input 🙂

I’m not so against rewrites if you define them as “building the same software over again after learning their mistakes” In a way Discourse is a rewrite of VBulletin for example!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [August 16, 2016, 4:38pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/14 "2016-08-16T16:38:04Z")

</div>

> [@eviltrout](#):
>
> I’m not so against rewrites if you define them as “building the same software over again after learning their mistakes” In a way Discourse is a rewrite of VBulletin for example!

Or if you want to learn a new programming language/paradigm or, even more interesting, learn a new domain space.

 ![](https://global.discourse-cdn.com/meta/original/3X/b/d/bdaa9f3ec77ffc1633ba79bc0497eeaa6657e25e.jpg)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [August 16, 2016, 5:30pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/15 "2016-08-16T17:30:25Z")

</div>

> [@zogstrip](#):
>
> Or if you want to learn a new programming language/paradigm or, even more interesting, learn a new domain space

Offtopic:  
… or if you have software written in a technology where the runtime will cease to exist sooner or later. I’m currently facing that problem with a web application where the frontend was developed with Adobe/Apache Flex.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [August 16, 2016, 5:38pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/16 "2016-08-16T17:38:56Z")

</div>

I can understand the excitement when discovering a new language. It’s only natural for a developer to want to start writing code using it.

But I see two major hurdles when it comes to rewriting Discourse.

The first is the undertaking would require a thorough understanding of Discourse code.

I may be a statistical outlier, but I have been looking and tinkering with Discourse code for about two and a half years and I still only consider myself to be approaching literate level, not advanced.

The second is the undertaking would require expert knowledge of the other language so that existing code could be successfully swapped out to it.

Then one needs to weigh the costs.  
Are the advantages the other language has to offer really worth the time and effort?

I am familiar with several languages and I have found that each has both stronger and weaker aspects. That is, the choice of language often depends on what you primarily want to do more efficiently and what inefficiencies you are willing to accept.

All that said, I’ve been thinking of where I might try to rewrite Discourse if I was interested in doing so.

AFAIK most code “touches” a lot of other code and the task would not be simple.

I’m guessing maybe the Admin → Backup might be the most “isolated” code.but would still be a chore.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 16, 2016, 10:47pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/17 "2016-08-16T22:47:23Z")

</div>

> [@Mittineague](#):
>
> I’m guessing maybe the Admin -\> Backup might be the most “isolated” code.but would still be a chore.

And that’s partly because it’s mostly shelling out to `tar` and `psql`.

---

<div class="post-metadata">

### Author: ![Dan\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_g/32/114732_2.png) [@Dan\_G](https://meta.discourse.org/u/Dan_G)
#### Post date: [August 16, 2016, 11:58pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/18 "2016-08-16T23:58:58Z")

</div>

> [@eviltrout](#):
>
> I’ve had people tell me “You should rewrite the backend of Discourse in X”

How often does that happen and what are the most common As?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [August 17, 2016, 6:00pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/19 "2016-08-17T18:00:36Z")

</div>

To be fair it’s not that often, but people have definitely suggested a rewrite in PHP, Node.js, Elixir and now Elm.

---

<div class="post-metadata">

### Author: ![Dan\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_g/32/114732_2.png) [@Dan\_G](https://meta.discourse.org/u/Dan_G)
#### Post date: [August 17, 2016, 6:33pm UTC](https://meta.discourse.org/t/rewrite-in-elm/48677/20 "2016-08-17T18:33:44Z")

</div>

Ah. Then it looks like it’s the first time someone suggests rewriting the _frontend_. 🙂

[Next page](https://meta.discourse.org/t/rewrite-in-elm/48677.md?page=2)
