Details
-
AboutI write code and a science-friction story about code, where magic is programmable and upholds the rules of thermodynamics in a fantasy universe.
-
SkillsC++, JavaScript, TypeScript, and I refuse to add PHP to this list.
-
LocationAlexandria, Egypt
-
Website
-
Github
Joined devRant on 9/14/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
PHP developers will be amongst the first souls to get into heaven because of all their suffering.
But let’s face it, most of them will go to hell for the atrocities they’ve committed against humanity.7 -
I'm never making fun of people who go to Stack Overflow for answers ever again.
I mean, have you guys seen this? A leap-second causing 100% CPU use in MySQL, and a dude figures it out like it was nothing, and provides a quick solution!
https://stackoverflow.com/a/...12 -
So let's say you spent over a day trying to clone WebKit using git but it failed every single time. Because the WebKit repo is HUGE (at least 7GB of worthless bloated refs), your connection is unstable, and git doesn't resume.
Then you discover you can solve the issue by simply cloning it via SVN in your cmake script.
Then you hit build, and forget that you had `-j 8` set in your IDE settings.
Then your computer freezes when it tries to compile 8 of WebKit's "UnifiedSourceXXX.cpp" files at a time, and all your 16GB of RAM get obliterated.
What the fuck, universe?1 -
Source Code Activism is a thing that should not exist.
Keep your filthy CoC away from the Linux kernel you freaking bastards.2 -
Not an angry rant, and not strictly related to code, but I think it's important, nonetheless.
If you've ever considered or been approached by Amazon, please read this short real-life story first and judge for yourself: https://dev.to/voodooattack/...
P.S: I didn't post this here because I needed markdown for formatting. Sorry. :(6 -
I'll preface this by saying that TypeScript is a beautiful language.
But also UTTERLY INCOMPLETE.
Here's what I'm trying to do: give the compiler well-defined contextual type information for a decorator's argument (a lambda signature) and for the decorated class method, so the user would not have to toil and type every single argument.
But does that happen? No.
I'm honestly disappointed.2 -
This snippet was found in Thanos’ bash history:
```
ps Sh | sort -R | awk 'NR % 2 {print $1}' | xargs sudo kill -9
```joke/meme shell script thanosdidnothingwrong avengers joke marvel scripting snaps that hurt in prod thanos bash -
Why is GitHub's certificate showing up on semver.org? I can no longer access the site normally because of the browser warning. Who's responsible for this atrocity?
I checked with a VPN and without, same result. Can someone confirm?
https://www.semver.org/5 -
Ever heard of event-based programming? Nope? Well, here we are.
This is a software design pattern that revolves around controlling and defining state and behaviour. It has a temporal component (the code can rewind to a previous point in time), and is perfectly suited for writing state machines.
I think I could use some peer-review on this idea.
Here's the original spec for a full language: https://gist.github.com/voodooattac...
(which I found to be completely unnecessary, since I just implemented this pattern in plain TypeScript with no extra dependencies. See attached image for how TS code looks like).
The fact that it transcends language barriers if implemented as a library instead of a full language means less complexity in the face of adaptation.
Moving on, I was reviewing the idea again today when I discovered an amazing fact: because this is based on gene expression, and since DNA is recombinant, any state machine code built using this pattern is also recombinant[1]. Meaning you can mix and match condition bodies (as you would mix complete genes) in any program and it would exhibit the functionality you picked or added.
You can literally add behaviour from a program (for example, an NPC) to another by copying and pasting new code from a file to another. Assuming there aren't any conflicts in variable names between the two, and that the variables (for example `state.health` and `state.mood`) mean the same thing to both programs.
If you combine two unrelated programs (a server and a desktop application, for example) then assuming there are no variables clashing, your new program will work as a desktop application and as a server at the same time.
I plan to publish the TypeScript reference implementation/library to npm and GitHub once it has all basic functionality, along with an article describing this and how it all works.
I wish I had a good academic background now, because I think this is worthy of a spec/research paper. Unfortunately, I don't have any connections in academia. (If you're interested in writing a paper about this, please let me know)
Edit: here's the current preliminary code: https://gist.github.com/voodooattac...
***
[1] https://en.wikipedia.org/wiki/...29 -
Why aren't there more programming languages out there that aren't derived from English?
We're in the age of universal UTF-8 support, if it was meant to be then it should be happening now.
+ sarcasm
I mean, we should be more inclusive and allow other flavours of JavaScript that aren't based on English across browser, right? Otherwise that would mean that English is the master language of the web.
- sarcasm5 -
“Someone is eventually going to build a JavaScript compiler that output machine code, which will lead to an apocalypse and the death of everything you know and love when all JS code mysteriously stops working in the year 2048.
You need to stop that person from being born. I'm forwarding the details now.
Good luck,
-- Future you”3 -
When you live in a 3rd world country, get a relatively expensive 16mbps connection (that's still very unreliable), and try to clone WebKit… why the hell is it so large even with `--depth 1` and `--single-branch`? Why doesn't `git clone` support resuming/incremental cloning? Is this even 2018?
I want to code but life is actively fighting me right now. I hate this.
/rant26 -
I honestly treat JavaScript as a binary executable format nowadays. It's an output format for me.
I choose you, TypeScript.4 -
So here's a random idea: DDoS defence swarm.
Install the daemon on your server, and every time your server gets DDoS'd, all members of the swarm will mobilise to defend you, but the catch is that your server will have to help other members of the swarm too.
The defensive technique in question can be one of many:
1. Automated IP blocking/reporting with a blacklist in distributed form.
2. Other swarm members counterattack and cooperatively DDoS the offending addresses.
3. Flood the ISP with automated emails to force them to pay attention to the problem.
...or a combination of all of the above.
The only issue I can see with this is abuse potential. A clever person can trick the swarm into DDoSing innocents.15 -
Okay, story time.
Back during 2016, I decided to do a little experiment to test the viability of multithreading in a JavaScript server stack, and I'm not talking about the Node.js way of queuing I/O on background threads, or about WebWorkers that box and convert your arguments to JSON and back during a simple call across two JS contexts.
I'm talking about JavaScript code running concurrently on all cores. I'm talking about replacing the god-awful single-threaded event loop of ECMAScript – the biggest bottleneck in software history – with an honest-to-god, lock-free thread-pool scheduler that executes JS code in parallel, on all cores.
I'm talking about concurrent access to shared mutable state – a big, rightfully-hated mess when done badly – in JavaScript.
This rant is about the many mistakes I made at the time, specifically the biggest – but not the first – of which: publishing some preliminary results very early on.
Every time I showed my work to a JavaScript developer, I'd get negative feedback. Like, unjustified hatred and immediate denial, or outright rejection of the entire concept. Some were even adamantly trying to discourage me from this project.
So I posted a sarcastic question to the Software Engineering Stack Exchange, which was originally worded differently to reflect my frustration, but was later edited by mods to be more serious.
You can see the responses for yourself here: https://goo.gl/poHKpK
Most of the serious answers were along the lines of "multithreading is hard". The top voted response started with this statement: "1) Multithreading is extremely hard, and unfortunately the way you've presented this idea so far implies you're severely underestimating how hard it is."
While I'll admit that my presentation was initially lacking, I later made an entire page to explain the synchronisation mechanism in place, and you can read more about it here, if you're interested:
http://nexusjs.com/architecture/
But what really shocked me was that I had never understood the mindset that all the naysayers adopted until I read that response.
Because the bottom-line of that entire response is an argument: an argument against change.
The average JavaScript developer doesn't want a multithreaded server platform for JavaScript because it means a change of the status quo.
And this is exactly why I started this project. I wanted a highly performant JavaScript platform for servers that's more suitable for real-time applications like transcoding, video streaming, and machine learning.
Nexus does not and will not hold your hand. It will not repeat Node's mistakes and give you nice ways to shoot yourself in the foot later, like `process.on('uncaughtException', ...)` for a catch-all global error handling solution.
No, an uncaught exception will be dealt with like any other self-respecting language: by not ignoring the problem and pretending it doesn't exist. If you write bad code, your program will crash, and you can't rectify a bug in your code by ignoring its presence entirely and using duct tape to scrape something together.
Back on the topic of multithreading, though. Multithreading is known to be hard, that's true. But how do you deal with a difficult solution? You simplify it and break it down, not just disregard it completely; because multithreading has its great advantages, too.
Like, how about we talk performance?
How about distributed algorithms that don't waste 40% of their computing power on agent communication and pointless overhead (like the serialisation/deserialisation of messages across the execution boundary for every single call)?
How about vertical scaling without forking the entire address space (and thus multiplying your application's memory consumption by the number of cores you wish to use)?
How about utilising logical CPUs to the fullest extent, and allowing them to execute JavaScript? Something that isn't even possible with the current model implemented by Node?
Some will say that the performance gains aren't worth the risk. That the possibility of race conditions and deadlocks aren't worth it.
That's the point of cooperative multithreading. It is a way to smartly work around these issues.
If you use promises, they will execute in parallel, to the best of the scheduler's abilities, and if you chain them then they will run consecutively as planned according to their dependency graph.
If your code doesn't access global variables or shared closure variables, or your promises only deal with their provided inputs without side-effects, then no contention will *ever* occur.
If you only read and never modify globals, no contention will ever occur.
Are you seeing the same trend I'm seeing?
Good JavaScript programming practices miraculously coincide with the best practices of thread-safety.
When someone says we shouldn't use multithreading because it's hard, do you know what I like to say to that?
"To multithread, you need a pair."18