Transpilation is here a necessary step to test the application because e.g. his browser won't be able to parse raw TypeScript code.
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.
Yes basically, it's not the same dev yet sway is heavily inspired by i3 and works with i3 config files.
As you wrote i3 is x11-only and sway is wayland.
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.
Presumably this for now has only been seen for a specific tv client API that yt-dlp use and not all youtube videos (well, https://github.com/yuliskov/SmartTube/issues/4444 also saw it for "members-only" videos but again not all videos).
---
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)?
> 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".
It does with the music labels, which is why said labels sued various YouTube downloaders for bypassing a technical protection measure in regards to the existing rolling cypher (but reading between the lines I suspect the labels intention was actually to lose that case, and then take that judgement to YouTube to show that they were in breach of the contract that required them to include some form of technical protection measure and hence adopt Widevine on all music streams).
Not him but because your answer surprised me I chose to reply: at 34 it is also something I always wondered.
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.
A particularly ugly but useful feature of "const enum" (sadly, the "const" flavor of enums are not referred to in this documentation), is that it's the only way to declare a compile-time constant in TypeScript.
e.g. for "development" vs "production" environments, you could write a declaration file for each of those envs as such:
// 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.
I read the README.md of the project but I'm still not sure: What's the expected usage of this? How does the outputed WASM code then interacts with a runtime (and with which, is it intended to be a tool compatible with browsers and other WASM runtimes or is it only compatible with a runtime linked to the project)?
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?
These are very good questions, I'll respond here, but I'll also add more info to the README. This project is mainly targeting WebAssembly usage on the server, cause I think it makes little sense to run JavaScript in WebAssembly in JavaScript (although time will tell, maybe it will be useful for sandboxing frontend plugins?). Regardless if it's running in the browser or a backend runtime like WasmTime or WasmEdge, at the moment running JavaScript inside WebAssembly is not ideal. You either have to compile a JS engine like V8 or SpiderMonkey to WASM and then use it to run your script or you have to settle for an "almost JavaScript" language like AssemblyScript. This is a limiting factor for running server workloads. For example Fastly uses SpiderMonkey for their WASM workers, but it means that each instance uses 5-10MBs of memory even for a hello world. Shopify, on the other hand, uses WASM for customizing server side of their shops, and they decided they only allow WASM binaries up to 250KBs, which is a no-go for embedding any interpreter. Thus their "blessed" language is AssemblyScript. They outline reasons for that here: https://shopify.engineering/shopify-webassembly
This is all due to a fact that historically WASM was a very simple runtime. It was relatively easy to compile C code to WASM, just like you compile C code to machine code, but even though a WebAssembly is a kind of interpreter by itself, it wasn't easy to interpret higher level languages on top of it.
With new proposals being standardized, like garbage collection support or exception handling support, WebAssembly becomes much more powerful interpreter, with stuff like structs, arrays, function references etc.
Jaws leverages that fact translating JS code to WASM code in a way that WASM interprets the resulting code, without the need of a JS engine like SpiderMonkey. In practice it mainly means that a binary generated by Jaws will be probably under 50KBs vs 10MBs when you compile SpiderMonkey to WASM and run your script on top of that. Memory usage will be also significantly lower. For companies like Fastly this would mean orders of magnitude lower memory usage and thus server costs. For companies like Shopify it would mean they could leverage JavaScript code already available (think NPM packkages) and JavaScript ecosystem for people writing plugins for Shopify's backend.
> is it intended to be a tool compatible with browsers and other WASM runtimes or is it only compatible with a runtime linked to the project
The only runtime the project uses is WebAssembly. The generated code is mostly 3k lines of WAT code form this file: https://github.com/drogus/jaws/blob/main/src/wat/template.wa... and whatever your JS code is translated to. For example for a very simple program like "console.log('foo')" the entire "generated" part is this: https://gist.github.com/drogus/1c49c25ed0b14804b2f27e10d2a79..., which more or less prepares an argument (with new_static_string) and then calls console.log. Right now I need a bit of glue code on the host, but eventually it will be possible to execute such a binary with any runtime that supports WASIp2, WASM GC and exception handling proposals.
> 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?
None of this is implemented yet, but I can tell you how it will work. I plan to support Node.js APIs through WASI. WASI is a standard for communicating between WASM programs and the outside world. For example WASI defines a standard set of functions you can use to send an HTTP request, or write to STDOUT, or read/write to a file. So when I get to APIs like `fetch` or `fs`, it should work with any runtime that supports WASI preview2. Browsers could also be supported with polyfills, but in this case I/O support is more custom. Like, if you decide you allow WASM programs to write or read files, you would have to provide a mechanism to do that, for example save files to localStorage or an SQLite database compiled to WASM (or I guess even send them to S3 or something along the lines).
They probably don't want to license them globally, because the expected usage is low. But surely this could be taken into account in the contract / negotiation. Anyway I guess I'm just not in the target audience. But that's what MPV is great for, it allows you to tweak it for that 0.1% use-case.
I think it's also partially an issue with video + audio being paired by region.
AFAIK, the video you are being served is always based by the geolocation and what video was licensed for that. E.g. in a French version of a movie, text in the movie may have been localized into french inside the video. Additionaly there might be additional/missing scenes in the localized version to get the desired age ratings in that market.
The audio is then synced to that version of the video. That means that e.g. the French audio produced for the US video is not 1:1 the same audio as the French audio for the German video.
So that takes it beyond a licensing issue, and would mean additional effort to produce compatible audio tracks for content that they may only have streaming rights for temporarily. For content native to the streaming service they usually put that effort in.
Not him, but I was in the same situation (I'm still in France with roughly the same salary but not in Paris anymore).
> 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.
Yes by most normal countries (North and South America, Europe, Africa, Middle East ) and even broader French (outside of Paris) standards 30 meters square feet (320 sq feet) is called a tiny house, and is even illegal for families in some part of the world.
The whole point is « if you’re alone »… is that a life frankly ? 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 ?
Oh yeah true you don’t need a car because life is so miserable driving and parking here, but public transportation is a total disaster when it comes to safety (ask pretty women how they feel there) , quality of service (summer transportation is a disaster, strikes and regular failures), cleanliness (piss, rats and bedbugs and vagabonds every where). And yeah the SNCF trains are also the preferred homeless shelter and very unreliable during every public vacation time. So you’re totally right, the car is something of the past… unless you live in a crappy suburb you can today totally forget about the less than 1000 rent.it is around 1500 minimum, and in this paradise that means earning 4500 minimum because waiting lines are in average 15 to 20 candidates per rentals . And you better be a white colored person with a European name and face. So with 3700 net salary you simply not qualify. You end up like most people looking for a partner officially and counting on your partner salary plus yours just to get a chance to live in that tiny flat.
Telco is 50 euros min without Netflix and football and Disney or Spotify . If you have a family and need to dream because of the gritty environment you leave in , you can add 30 / 40 bucks and you end up with 70 to 100 bills depending on the number of persons in your household . And you didn’t pay yet the flat tv nor the smartphone.
Believe people earning less than 4k net a month in the Paris region do look at the prices today.
I did not want to annoy anybody, I was just answering the "live very comfortably" part.
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.
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.