js-proposal-algebraic-effects
proposal-explicit-resource-management
js-proposal-algebraic-effects | proposal-explicit-resource-management | |
---|---|---|
3 | 22 | |
174 | 721 | |
- | 2.5% | |
0.0 | 6.1 | |
about 3 years ago | about 15 hours ago | |
JavaScript | JavaScript | |
- | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
js-proposal-algebraic-effects
-
Proposal: Signals as a Built-In Primitive of JavaScript
I have to admit: you're perfectly right here. React of course always relied on mutable state in it's implementation – just so we don't have to. I derailed a lot here to keep this funny thread going ;) I'm still not with you on your definition of "functional", since you treated it synonymously with "purely functional". Functional means just made by applying and composing functions, and react UI is created exactly like that. There is an awesome algebraic effects proposal[1], which will hopefully will be added to JavaScript one day, then react will make use of it to become purely functional.
1: https://github.com/macabeus/js-proposal-algebraic-effects
-
Letlang, a programming language targetting Rust - Road to v0.1
Super interesting, there is a proposal to add this to JavaScript and several languages that use this, unison, koka & eff. I had no idea this was even a thing!
-
Go Replaces Interface{} with 'Any'
Ok I was wrongly assuming that panic was expecting an error type, in fact it's an interface{}.
> Your use of exceptions for flow control (i.e. goto) is considered harmful
Exceptions are a way to delegate error handling to the caller by giving them informations about the unexpected behavior. It implies that the expected behavior is the "happy path" (everything went well) and any deviations (errors) is unexpected.
This is far from a goto because you can have `try/finally` blocks without catch (or defer in golang).
Also, exceptions are just a kind of algebraic effects that do not resume. There was a proposal to JS for this: https://github.com/macabeus/js-proposal-algebraic-effects
This is also easier to test. assertRaises(ErrorType, func() { code... })
Almost every Go library I've seen just return an error (which is just a string), you'd need to parse it to assert that the correct error is returned in special conditions.
proposal-explicit-resource-management
- Cooperation between Cloudflare Workers has become amazing thanks to RPC support
-
Proposal: Signals as a Built-In Primitive of JavaScript
The standard doesn't have anything to do with TypeScript, not sure where you got that from? https://github.com/tc39/proposal-explicit-resource-managemen...
-
How does TypeScript's explicit resource management work?
The explicit resource management proposal tries to make it a bit easier for us, by allowing the resource to declare how it should be managed, rather than expecting us to clean everything up when we use the resource. We get a new keyword using to define a variable (rather than const or let), which tells the runtime to clean up the resource at the end of the function.
-
Using using in TypeScript for resource management
Enter the explicit resource management proposal, which describes — among many other things — a new using operator that was introduced in TypeScript 5.2 and is making its way into JavaScript. From the top of the README file, here’s what this proposal aims to do:
-
OpenTelemetry in 2023
In addition to this, is the new (stage 3 even!)explicit resource management proposal[0], supported by TypeScript version >= 5.2[1]
Though I agree that async context is better fit for this generally, the RMP should be good for telemetry around objects that have defined lifetime semantics, which is a step in the right direction you can use today
[0]: https://github.com/tc39/proposal-explicit-resource-managemen...
[1]: https://www.totaltypescript.com/typescript-5-2-new-keyword-u...
- ECMAScript Explicit Resource Management Proposal
-
Why is JavaScript so hated?
It's too early for that, https://github.com/tc39/proposal-explicit-resource-management
-
TypeScript 5.2's New Keyword: 'using'
[3]: https://github.com/tc39/proposal-explicit-resource-managemen...
-
Douglas Crockford: “We should stop using JavaScript”
I'm not _entirely_ sure which RAII you mean, but if you mean something like C#'s `using` or Java's `try-with-resources` or Python's `with`, then https://github.com/tc39/proposal-explicit-resource-managemen... and https://github.com/tc39/proposal-async-explicit-resource-man... are in stage 3 (of 4 stages) in ECMAScript's language proposal lifecycle and will be coming to a JS engine near you behind a flag soon-ish.
What are some alternatives?
mux - A powerful HTTP router and URL matcher for building Go web servers with 🦍
caniuse - Raw browser/feature support data from caniuse.com
exhaustive - Check exhaustiveness of switch statements of enum-like constants in Go source code.
librope - UTF-8 rope library for C
errors - Simple error handling primitives
pidove
rustic_result - Result monad for Elixir inspired by Rust Result type
proposal-class-method-parameter-decorators - Decorators for ECMAScript class method and constructor parameters
search-benchmark-game - Search engine benchmark (Tantivy, Lucene, PISA, ...)
proposal-iterator-helpers - Methods for working with iterators in ECMAScript
proposal-record-tuple - ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
SharpLab - .NET language playground