[-] hairyballs@programming.dev 1 points 2 years ago

The Elm compiler

[-] hairyballs@programming.dev 0 points 3 years ago* (last edited 3 years ago)

This: comparing something you buy once, with a license does not make a lot of sense. In SaaS, you get update, support, etc. For something critical, I'd rather get that than something that I buy once and may be buggued in the future.

[-] hairyballs@programming.dev 1 points 3 years ago* (last edited 3 years ago)
  • I put the types first in the file, sorted by importance
  • then the public free functions
  • then the impl blocks, sorted by importance, also. Usually, display impls and similar end up being at the end
  • then the private free functions (helpers)

The idea is that I can see all the types in one glance, then I look at the rest.

[-] hairyballs@programming.dev 1 points 3 years ago

What the actual fuck. It's a made up story I'm sure.

[-] hairyballs@programming.dev 1 points 3 years ago

It's a toy example. In that case, the solution is to assign the expression to a variable to compute its result upfront.

[-] hairyballs@programming.dev 1 points 3 years ago* (last edited 3 years ago)

There are still obvious things the BC cannot get. For example:

struct Foo;

impl Foo {
    fn num(&mut self) -> usize { 0 }
    fn index(&mut self, _i: usize) { }
}

let foo = Foo;
foo.index(foo.num()); //error
view more: ‹ prev next ›

hairyballs

0 post score
0 comment score
joined 3 years ago