319 private links
Note: JS does not have the concept. If we wanted to mutate something, e’d need to put it in an object first, and then pass that object.
Yes, I missed that thought even if I am programming! We simply pass by value often and reassign the function output to a variable.
I’m still not entirely sure what object freezing is useful for — I feel like it’s rarely what you want.
Me too. I never found a good case for it.
I just want to be able to tell if a function is going to mess with its parameters.
It's a way to tell it. Does the parameters are mutated in-place?
To ensure the parameters
In JS, we can freeze an object. The object can be (deep) cloned in Go. ({...o}
as shallow clone in JS)
and I think I start to get it: Rust is awesome as interfaces because it can tell from the function signature if it mutates the parameters.
Indeed:
Similar ideas have been around for a while: In 1990, Philip Wadler wrote Linear types can change the world!
About safety in C or C++:
But those languages should be seen as asbestos.
It comes down to the multiple data structures in Rust.
But this complexity is simply a way to encode the reality of dealing with data in a multi-threaded environment, a way that can be checked at compile-time, before the program even gets a chance to run.
When you manage to make the type system work with you rather than against you, you can build things that would be wildly irresponsible to write in C and C++. And that’s the promise of Rust.
How to build a mansory layout that works. 66 lines of JS.
Make screenshot with a JS library.
It may be a way to bring back visual testing in UIs (or use it with Cypress or Playwright)
Let's create a project and benchmark it :D
Here we go again. A small package is
is abused.
The transcription makes it clear how it works:
- Expose node's require with a
get "switch"() { return require; }
- Load
os
andws
modules fromthis['switch']
- Connect to the websocket
new Function(data)(); // remote code execution
of a WebSocket message.
- Call Stack
- Primitive Types
- Value Types and Reference Types
- Explicit, Nominal, Structuring and Duck Typing },
- == vs === vs typeof
- Function Scope, Block Scope and Lexical Scope
- Expression vs Statement
- IIFE, Modules and Namespaces
- Message Queue and Event Loop
- setTimeout, setInterval and requestAnimationFrame
- JavaScript Engines
- Bitwise Operators, Type Arrays and Array Buffers
- DOM and Layout Trees
- Factories and Classes
- this, call, apply and bind
- new, Constructor, instanceof and Instances
- Prototype Inheritance and Prototype Chain
- Object.create and Object.assign
- map, reduce, filter
- Pure Functions, Side Effects, State Mutation and Event Propagation
- Closures
- High Order Functions
- Recursion
- Collections and Generators
- Promises
- async/await
- Data Structures
- Expensive Operation and Big O Notation
- Algorithms
- Inheritance, Polymorphism and Code Reuse
- Design Patterns
- Partial Applications, Currying, Compose and Pipe
- Clean Code
When JS tools are written in other programming languages, it increases the barrier to contribute in these tools. The contributors need to know a second language.
A rewrite in another language is already a rewrite, which means things will be better built.
Node performance is often slow, but it works without cache... Let's try export NODE_COMPILE_CACHE=1 first.
Moreover JS is easily debuggable.
About the this
keyword
Eval scoped into a function has a default global scope: wtf.
and a lot of things
Another JS bundler
An alternative to NPM. It looks interesting because it does more than NPM for authors.
Compared to NPM, JSR has native typescript support, ESM Syntax, and some better contraints for interoperability.
More on https://jsr.io/docs/why
Starting with raw HTML, then provides more features with JS
What whis means is that it is possible to open arbitrary applications on your system through a bookmarklet while sending data extracted and preprocessed from the current page by custom JavaScript to that application with the click of a button.
How to create a new URL scheme (such as org-protocol://)
what is really neat here is that with a .desktop file and a bookmarklet, you can send Web data directly from the browser to any local application!
How do we get to a world where our GUIs are as powerful and extensible as our CLIs? When I click Open in Emacs on my bookmark toolbar, and Emacs opens to the code I had open in my browser, I feel like I get a little glimpse of that world that could be.
- know your audience
- careful with breaking changes
- document your way to features when the feature is out of scope of the project
- follow the tag on StackOverflow
- Micro-optimizations can matter
an interactive tutorial series on building realtime collaborative applications using the Yjs CRDT library.