OscarDC
Joined 10 years ago
Joined 10 years ago
Typechecking is not: the browser doesn't care about it, it's mainly to help the developer verify its code.
So to speed-up the build during development (to have faster iterations) the idea is often to make the building process only about the build by removing "unnecessary" steps like type-checking from it, while having a separate linting / typechecking etc. process, which could even run in parallel - but not be necessary to be able to test the application.
This is often done by using tools like a bundler (e.g. esbuild) or a transpiler (babel, swc) to erase the types without checking them in your bundling process.
By the way I tried to look at the code to see where it was defined and, with difficulties I ended up founding:
https://github.com/rschristian/voldephobia/blob/1792b7c39baf...
I always had an issue with that sentence (and I heard it a lot). Why would experienced software developers always come with a solution worse in "every conceivable way" when implementing logic answering a problem they're having, which would have the huge advantage of being tailored for their own needs?
I'm more of a library developer than an application one but I've seen that many JS webdevs have an aversion toward trying things themselves - instead always going for the most huge/"starred" dependency when they can. I'm not sure the impact of this philosophy is always better for a project's health than the total opposite where you would just re-invent your own wheel.
I do have seen multiple attempts at doing a specific homemade architecture that worked out well for some applications with very specific needs even 10 years later (For example I'm thinking about a 500k+ LOC JS webapp - not intended to be accessed on a desktop browser, but that's not the only successful long-lived JS project I know with their own archi). And I guess a lot of webapps do have their own specific needs where the "default framework" solution leads to some inefficiencies or hard-to-maintain / understand mess.
---
Also I suppose you make a reference to software DRM like Widevine L3 vs L1 (same thing for PlayReady SL2000 vs SL3000) which is not exactly Firefox vs Chrome. Firefox has even be known to work on the availability of hardware DRM on windows right now, (through the Media Foundation API I think?).
In the worst scenarios seen right now for example seen on services like Netflix, would be to only have lower qualities (e.g. 480p max) on browsers with only Software DRM available (like firefox) and encrypt better qualities with keys only available when there is hardware DRM available. Though I'm not sure YouTube would go that far for now? Netflix, Amazon and such have contracts with right-holders stating those protections as a requirement, but YouTube does not have (IMO thankfully) the same kind of relation and contract with "Youtubers".
I think that what YouTube wants to do for now is to greatly lower the amount of people not watching contents through its website/app (and thus not seeing ads). I would even think that this is mostly not about yt-dlp users, but more the huge amount of people relying on some Youtube-to-mp3 website or similar accessible tools. Here enforcing software DRM would be enough to at least temporarily break all those tools and force those users to go back on the platform I guess, and maybe you can also sue some tools' developers once there is an "encryption breaking"-mechanism embedded in it (IANAL)?
Becoming obese always seemed a little extreme to me and I fail to imagine how someone could reach that state without the accordingly extreme food-related habits - though maybe I'm just lucky to have the "right" metabolism and thus cannot relate.
Though even if obesity was always linked to eating disorders, I understand that "just stop" is not an appropriate response to that issue.
e.g. for "development" vs "production" environments, you could write a declaration file for each of those envs as such:
// production.d.ts
declare const enum ENVIRONMENT {
PROD = 0,
DEV = 1,
CURRENT_ENV = PROD,
}
And then write in your code something like: // some_file.ts
if (ENVIRONMENT.CURRENT_ENV === ENVIRONMENT.DEV) {
// do something for dev builds
}
It will be replaced by TypeScript at compile-time and most minifiers will then be able to remove the corresponding now-dead code when not in the right env.This is however mainly useful when you're a library developer, as you may not have any "bundler" dependency or any such complex tool able to do that task.
Here, the alternative of bringing a complex dependency just to be able to replace some constants is not worth its cost (in terms of maintenance, security, simplicity etc.), so even if `const enum`s may seem poorly-adapted, they are actually a good enough solution which just works.
Somewhat linked questions: How does it react if it encounters e.g. web APIs inside the JavaScript code or other global identifiers only defined in some environment (e.g. a recent browser, Node.js etc.)? Or if it's not intended for those environments, how are you supposed to do I/O when using this?
This may also be due to legal issues / restrictions in the contract they had with that content's right holders or subtitles providers.
Yes I lived in Paris 15th arrondissement a little more than two years ago (for like 4 years?) with a less than 60k euros salary and felt personally that I lived comfortably.
> Yes by most normal countries
I know that 30 square meters was comfortable to me at the time and had no shame about it. I still find that I live in a "normal country" and don't really care that much what someone from another "normal country" would use as a diminishing adjective to qualify that apartment's superficy.
> is that a life frankly ?
First, it is, and I felt this part was kind of unnecessary. Founding a family is not the end goal of everyone, nor living in a mansion.
> So you take a shitty salary because you’re alone or do you take money to progress in your personal life and build something like a family ?
I did found someone (to also live with) in that time period, which roughly make the same salary than I, we both lived comfortably on our own before and our combined remunerations was thus much bigger when living together which means we could afford something bigger. We decided to move from Paris though, but I also understand people wanting to stay there.
And 60k is far from shitty, even in Paris. We even considered ourselves privileged as we had a usually better salary than our friends and a job we liked.
> but public transportation is a total disaster [...]
I am not that critical of Paris' public transportation, I thought it was good enough for going to work everyday or where I wanted to go most of the time.
> rent.it is around 1500 minimum
I was paying something like between 900 and 1k for 30-ish (don't remember) square meters. It's for the 13, 14, 15, 18, 19 and 20 arrondissements only I would guess, and [close] suburbs.
> waiting lines are in average 15 to 20 candidates per rentals
Yes that was an issue to me also. I had to send a lot of proposal everywhere to have a chance.
> Telco is 50 euros min without Netflix and football and Disney or Spotify
I just checked. I have different operators for phone and internet, and I'm at 20 for internet and 15 for mobile phone subscription. I'm also very bad at managing money so I'm sure I could spend less, if it mattered to me. No idea how much I spend for electricity, gas and so on, because I've never had any issue with money.
> people earning less than 4k net a month in the Paris region do look at the prices today
I did not and my girlfriend didn't two years ago look at prices when doing most day-to-day things, but maybe the situation evolved since then. Though to be honest we never lived an expensive life: we never had any TV for example nor Netflix and such subscriptions, and don't have expensive hobbies nor especially like expensive things.
> let me guess you live in a 30 square meter hole
Living in a 30 square meter apartment was pretty normal, yes. Don't feel obliged to call it "hole", it was pretty OK when you're alone.
My rent was never more than a third of what I earned net. So generally less than 1K.
> any decent car would cost you 300 € a month
In Paris you don't need a car and most people I know don't have one. I still don't have a driver's license and most people I know from my generation don't have one either. So that's not an expense.
> telco bundle 100 €
For the whole Internet + mobile, you shouldn't pay more than 30 euros per month in France (which I guess is still pretty high? I'll have to look).
> that makes already 3000 euros a month of spending
I was (and still am I would guess, though it's a long time since I've calculated this), spending less than 2000 euros per month. And I'm not limiting myself: I often go out in a restaurant, go to the cinema every week, don't look at prices when I'm doing grocerie etc.
Those API could be thought as from the "environment" in which JavaScript run. For example we often call web-only APIs "DOM API": `fetch`, `xmlHttpRequest` and so on.
Node.js also has its own environment. For example both `setTimeout` and `setInterval`, though present in both web and node.js, are implemented differently by browsers and node.js (it's just that node.js decided to go with roughly the same API - see below for code examples for both).
Taking requests as examples there are both declared in blink, the rendering engine and not v8 again because they aren't JS:
- fetch (https://source.chromium.org/chromium/chromium/src/+/main:thi...)
- XMLHttpRequest (https://source.chromium.org/chromium/chromium/src/+/main:thi...)
For the fun of looking even more at some code of reputable projects: for setTimeout / setInterval, I would guess they are declared here in blink: https://source.chromium.org/chromium/chromium/src/+/main:thi...
And maybe here for Node.js: https://github.com/nodejs/node/blob/8a41d9b636be86350cd32847...
To note that "filesystem" API also exist in web world: https://fs.spec.whatwg.org
Again, this API is completely different than in Node.JS
But the discussion here is more about how to package properly an application (for updates, app centralized management etc,) than how to deliver an executable on linux.