Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some of these seem good to me:

- "everything is an expression" is a nicer solution for conditional assignments and returns than massive ternary expressions

- the pipe operator feels familiar from Elixir and is somewhat similar to Clojure's threading macros.

- being able to use the spread operator in the middle of an array? Sure, I guess.

I want to like the pattern matching proposal, but the syntax looks slightly too minimal.

The other proposals are either neutral or bad, in my opinion. Custom infix operators? Unbraced object literals? I'm not sure that anyone has a problem that these things solve, other than trying to minimize the number of characters in their source code.

Still, I'm glad that this exists, because allowing people to play with these things and learn from them is a good way to figure out which proposals are worth pursuing. I just won't be using it myself.



I'll pass on the pipe operator, but it's not particularly objectionable.

Agree there's some good ideas. Pattern matching looks like a great idea with the wrong syntax - let's just get a match statement similar to the switch statement - if we can't reuse switch.

String dedent and chained comparisons look nice. Though I think the latter is a breaking change if it were done in js. I'd also be fine with default const for loop variables.

"Export convenience" is going to confuse people. The syntax looks different than named exports and looks closer to the export form of default imports which is begging for trouble.


Using the pipe operator in Elixir is very nice, even more so for building up complex multi operations and such


Exactly. It also massively improves readability by reordering the code to match the order of operations. Also long nested chains of function calls make it so the arguments for each call get spread out, so your eyes have to go back and forth to determine what function receives what.


For “everything is an expression” https://github.com/tc39/proposal-do-expressions may be of interest, though discussion seems to have paused.


The odd thing is that Civet includes both do expressions and everything is an expression. I'd be happy with either, but both seems like a bad idea.


Do blocks in Civet are mainly to provide shielded scopes (with local declarations). They're currently also necessary to handle declarations (const/let) in the middle of expressions, but hopefully they won't be necessary eventually - only when the user wants to shield scopes. They also have useful forms like `async do` that let you build Promises using await-style code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: