Hacker GitHub

← All repos

tc39/proposal-pattern-matching

View on GitHub ↗ ★ 5,806 HTML

Pattern matching syntax for ECMAScript

41 mentions on Hacker News by 37 people: 7 stories, 34 comments · first 2017-07-05 · latest 2026-02-01

Mentions per year 41 mentions · busiest year 2021 (8)
20082026
  1. ▲ 1
    ECMAScript Pattern Matching
    story by modinfo · 2026-02-01 · 0 comments
  2. It will get pattern matching when JS does. Not certain yet but in progress. https://github.com/tc39/proposal-pattern-matching
  3. …is largely wrong and misleading. Pattern matching is still Stage 1, meaning it’s not a standard: https://github.com/tc39/proposal-pattern-matching Pipeline operator is Stage 2 and won’t use the “|>” syntax:…
  4. ▲ 3
    ECMAScript TC39 proposal-pattern-matching
    story by denysonique · 2025-09-15 · 0 comments
  5. …someone needs to champion it, and then there is the "at least two implementations" factor. https://github.com/tc39/proposal-pattern-matching
    comment by pjmlp · 2025-04-29 · in Migrating away from Rust
  6. …redundant code to get the bindings; perhaps the `passes` test could return optional bindings.) [1]: https://github.com/tc39/proposal-pattern-matching
  7. …a necessary evil in JSX. We'll all be rejoicing when pattern matching finally lands in JS [1]. [1] https://github.com/tc39/proposal-pattern-matching
    comment by jakelazaroff · 2023-09-22 · in Second-Guessing the Modern Web (2020)
  8. …very well, it’s just the underlying JS runtimes that can’t, there is a proposal for it though; https://github.com/tc39/proposal-pattern-matching .
  9. The proposal for pattern matching syntax seems more akin to what they're looking for. https://github.com/tc39/proposal-pattern-matching
  10. Both are active tc39 proposals :) https://github.com/tc39/proposal-pipeline-operator - Stage 2 https://github.com/tc39/proposal-pattern-matching - Stage 1 Hopefully we get both in the next couple of years.
  11. https://github.com/tc39/proposal-pattern-matching I'm not sure if it's stalled or not. But it's being discussed.
    comment by Waterluvian · 2023-03-21 · in Java 20 / JDK 20: General Availability
  12. …without waiting. We've added https://github.com/tc39/proposal-pipeline-operator , a variant of https://github.com/tc39/proposal-pattern-matching , a variant of https://github.com/tc39/proposal-string-dedent and others. Since our goal is to…
    comment by Yahivin · 2023-02-28 · in CoffeeScript for TypeScript
  13. …and pattern matching have been proposed to JS. https://github.com/tc39/proposal-pipeline-operator https://github.com/tc39/proposal-pattern-matching
    comment by tacotacotaco · 2023-01-02 · in Functional Programming – How and Why
  14. For reference. Pattern matching: https://github.com/tc39/proposal-pattern-matching Do expression: https://github.com/tc39/proposal-do-expressions Pipe operator: https://github.com/tc39/proposal-pipeline-operator
    comment by gherkinnn · 2022-10-04 · in The TC39 Process
  15. …actually being discussed in tc39 for JS as a whole (where TS reps are some of the champions, ofc): https://github.com/tc39/proposal-pattern-matching The specifics of the proposal will likely shift a bit since it's still stage 1 (2?).
    comment by wwwigham · 2022-10-01 · in Ten Years of TypeScript
  16. …There are two Stage 1 TC39 proposals with different approaches to it: More hands-on/direct: https://github.com/tc39/proposal-pattern-matching More indirect: https://github.com/tc39/proposal-do-expressions > list comprehensions There are…
  17. …Typescript do not has proper pattern matching support, The proposal is far from being adopted https://github.com/tc39/proposal-pattern-matching > Related, Typescript is the only language I know of that through flow analysis does not…
    comment by SemanticStrengh · 2022-05-14 · in Java record pattern matching in JDK 19
  18. I think they are great! Especially in combination with pattern matching ( https://github.com/tc39/proposal-pattern-matching ), or when using JSX.
    comment by lucacasonato · 2021-12-13 · in Deno Joins TC39
  19. ▲ 1
    ECMAScript Pattern Matching
    story by cribbles · 2021-09-17 · 0 comments
  20. That is a stage 1 proposal[1]. [1] https://github.com/tc39/proposal-pattern-matching
    comment by graftak · 2021-09-07 · in V8 Release v9.4
  21. …1 proposals that I hope get in there some day. https://github.com/tc39/proposal-slice-notation https://github.com/tc39/proposal-pattern-matching
    comment by Joeri · 2021-06-28 · in JavaScript Is Weird
  22. …some renewed energy with new champions (including from the typescript team) and syntax proposals: https://github.com/tc39/proposal-pattern-matching Also there has been movement in the user land space with libraries like ts-pattern that…
    comment by a_humean · 2021-05-14 · in Scala 3.0
  23. ▲ 4
    ECMAScript pattern matching TC39 proposal overhauled
    story by ojosilva · 2021-04-21 · 0 comments
  24. Hopefully we will get real pattern-matching at some point ( https://github.com/tc39/proposal-pattern-matching ), but I kinda sorta like this!
    comment by scotttrinh · 2021-04-12 · in Using the switch(true) pattern in JavaScript
  25. …presented to TC-39. If it reaches Stage 3 then it is presumed likely Typescript will implement it. https://github.com/tc39/proposal-pattern-matching
    comment by WorldMaker · 2021-03-10 · in Why Become a TypeScript Fan?
  26. https://github.com/tc39/proposal-pattern-matching
  27. …for adding it to Javascript (using the keyword `case`, like the non-popular language Haskell)? https://github.com/tc39/proposal-pattern-matching At what point does a feature go from "horrible code" to "stealing each others' best ideas"?…
    comment by chriswarbo · 2020-07-27 · in Named arguments are coming in PHP 8
  28. For reference, the proposal: https://github.com/tc39/proposal-pattern-matching Rust’s pattern matching is deliberately fairly limited in what it can do; it’s all about destructuring types, not running arbitrary code like Perl’s smart-match…
    comment by chrismorgan · 2020-03-13 · in Rust 1.42
  29. …fac(N) when N > 0 -> N*fac(N-1). This makes a lot of code much more readable and more concise. [1] https://github.com/tc39/proposal-pattern-matching [2] http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.h...
    comment by dmitriid · 2020-02-19 · in Intro To Pattern Matching – Covers C# 9
  30. Pattern matching seems to be a current proposal, also driven by Microsoft: https://github.com/tc39/proposal-pattern-matching
  31. …could just get pattern matching[1] and optional chaining[2], that would really elevate things. [1] https://github.com/tc39/proposal-pattern-matching [2] https://github.com/tc39/proposal-optional-chaining
    comment by halfmatthalfcat · 2019-07-30 · in What’s New in ES2019
  32. …but once they settle on the actual syntax, i'd feel comfortable to start using it with compilers. https://github.com/tc39/proposal-pattern-matching
  33. …pattern matching! It's currently a stage 1 proposal with backing from Microsoft, npm, and Facebook. https://github.com/tc39/proposal-pattern-matching
    comment by bastawhiz · 2019-02-22 · in Why I prefer objects over switch statements
  34. This might be our best hope right now: https://github.com/tc39/proposal-pattern-matching
    comment by alexsasharegan · 2019-02-02 · in Pattern Matching Custom Data Types in TypeScript
  35. …(some people use if statements, some switch, and others store it all in an object and use keys). 1. https://github.com/tc39/proposal-pattern-matching#motivating...
    comment by dvdhnt · 2018-04-25 · in JavaScript Pattern Matching Proposal
  36. ▲ 371
    JavaScript Pattern Matching Proposal
    story by JONBRWN · 2018-04-25 · 251 comments
  37. …to javascript to support this has been proposed, I'm hopeful that it gets considered seriously: https://github.com/tc39/proposal-pattern-matching
  38. ▲ 2
    ECMAScript Pattern Matching Syntax Proposal
    story by networked · 2018-01-05 · 0 comments
  39. It's just become a Stage 0 proposal: https://github.com/tc39/proposal-pattern-matching
    comment by herrschnapps · 2017-07-13 · in Toward Go 2
  40. ▲ 3
    ECMAScript Pattern Matching Syntax
    story by cribbles · 2017-07-06 · 0 comments
  41. TC39 published its stage 0 proposal for pattern matching in ECMAScript a couple of days ago: https://github.com/tc39/proposal-pattern-matching
    comment by stupidcar · 2017-07-05 · in Pattern Matching with TypeScript