288 private links
Optimizing some endpoints in Rust inside a go app.
The results shows nearly 2x performance.
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.
Let's create a project and benchmark it :D
A binary that generates pages on the fly.
this script runs every minute on a cronjob, and rebuilds my site if the git repo has been updated. in this sense the deployment is automatic - i just test my code locally, upload it, and it's reflected in my public website within a minute. good enough for me. and simple enough that it'll probably just work
forever. again, very few dependencies. you can read it and understand it in ten seconds if you know a little shell. beauty.
No DB, only env variables. KISS
The perfect prisma alternative?
Human feedbacks
Another link checker tool that supports recursion
Everything should be written in #Rust
, but not everything deserves it.And that’s when I reach for #Go
And in the end I get paid to write #JavaScript
and #PHP
First, you need to describe the intent of your code and give an overview of how it works both at a macro level (in the README / wiki) and at the micro level, by commenting functions, structures and packages. Document, document, document.
Second, give examples on how to use your code. Snippets that users can quickly copy/paste and "feel it". Even better, add comments with the expected output to your examples.
Three, write simple code.
A basic reimplementation of Redis. I like to use SQLite for it.
That's great to have such simple deployment. Maybe one for rust with such a script or command could be great too.
Or a bash script :)
Definitely worth. It's great to have high quality articles such as these.
Make an OPML to newsroll 😄
Fetch the website informations and create some cards out of it.
Uses folders to create categories.
There are a bunch of possibilities
Mann kann erst skalieren, dann optimieren, wenn es ein Drittels des Tages dauert. Der erste Prozess, um PDFs zu erzeugen, ist total innefizient. Es zeigt auch, dass Optimierungen der letzte Schritt des Produkts ist. Sie haben damit lange gelebt. Die Architektur ist eine gute Beispiel für horizontale Skalierung.
These are relevant arguments in favor of Go.
- Create construction zone where the result is affected to a variable
- Containing Side-Effects and Error-Handling (go)
- Restrincting variable lifetimes (rust)