These are chat archives for ractivejs/ractive

18th
Jun 2018
Chris Reeves
@evs-chris
Jun 18 2018 17:47
still stage one... not sure why there's no love for that proposal
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 17:48
neither do I...
Joseph
@fskreuz
Jun 18 2018 19:05
Here's a TS discussion of a similar feature request Microsoft/TypeScript#16
Issue "16" - looks like one of the first few feature requests :grin:
And the TL;DR is: We're waiting for what ES will do. That is... that Stage 1 proposal. :smile:
Chris Reeves
@evs-chris
Jun 18 2018 19:08
yep
I vaguely remember ?: being the proposal from a while back
cause elvis still had both his eyes
Joseph
@fskreuz
Jun 18 2018 19:09
lol :joy:
Chris Reeves
@evs-chris
Jun 18 2018 19:12
holy crap that ts issue is old
dart managed to land it... in 2015
Joseph
@fskreuz
Jun 18 2018 22:29
It also feels like a footgun, accessing something you very well know is going to be missing 50% of the time.
It's perfectly fine given JS's dynamic nature, but if it's going to make debugging even harder, I'd say pass. :grin:
(missed the opportunity to make a Schrodinger joke) :joy:
Chris Reeves
@evs-chris
Jun 18 2018 22:34
most of the time, you follow it up with a default, though
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:35

It also feels like a footgun, accessing something you very well know is going to be missing 50% of the time.

@fskreuz How is that possible?

Chris Reeves
@evs-chris
Jun 18 2018 22:36
box?.cat?.status ?? 'alive'
it looks like it's mostly stalled on bikeshedding because people want index and call to be included in the proposal
boxes?.[idx]?.cat?.getStatus?.() looks a bit weird, but it's easy to parse
no one can agree on how to de-weird it
and some even argue that the member access version should be ?.. to match ?.( and ?.[
Chris Reeves
@evs-chris
Jun 18 2018 22:41
there's even a sinister elvis proposal :?
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:41

LiveScript has done this many years before:

box?.cat?.meow?!

compiles to:

var ref$;
if (typeof box != 'undefined' && box !== null) {
  if ((ref$ = box.cat) != null) {
    if (typeof ref$.meow == 'function') {
      ref$.meow();
    }
  }
}

so I can't imagine what is so hard about it...

Chris Reeves
@evs-chris
Jun 18 2018 22:42
.meow?( could parse as the beginning of a ternary
and there's no bang calling in plain js
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:43
ah... pardon me, livescript cares about spaces
foo + bar is different from foo +bar where first is an addition and second is a function call
Chris Reeves
@evs-chris
Jun 18 2018 22:44
yeah, I'd say make whitespace matter, but millions of minified scripts would suddenly cry out and be silenced
is ls still actively developed?
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:48
nope, it's stalled for a year now
Chris Reeves
@evs-chris
Jun 18 2018 22:48
I looked at it back before es6 landed, but it still has a few corner cases that wouldn't fly for my project at the time
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:48
...but I'm actively using it :)
like what?
Chris Reeves
@evs-chris
Jun 18 2018 22:50
I don't remember the specifics, but I wanna say something to do with a plain block used in a weird way
to be fair it was a weird project
ended up going plain js
I think coffeescript scared a lot of people off of compile-to-js languages, and then js became a compile-to-js language 😁
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 22:54
ahahah :D
Joseph
@fskreuz
Jun 18 2018 23:12

How is that possible?

One good example is TS. The biggest gain you get in TS is type safety. But it also has a lot of escape hatches that undermine types, like optional properties, any etc. If you don't use types, using TS is pointless.

If you left TS code to a team that 1. isn't familiar with TS or 2. hates TS or 3. both, you'll eventually find that code littered with any and optional properties everywhere, defeating the purpose of TS. Same thing with elvis, it becomes a convenient excuse to not actually check existence or re-think how data is structured.
Cerem Cem ASLAN
@ceremcem
Jun 18 2018 23:31
types are on their way to land in LiveScript too: gkz/LiveScript#999
(by the way, it's the most recent heartbeat in LiveScript development, @evs-chris )
@fskreuz I still don't get how "accessing something you very well know is going to be missing 50% of the time." I'm very much anxious that it was a joke and I didn't get it :D