News for hackers. Stuff that matters.
Re:Build your own web framework by skadamat on Friday July 29, 2022 @04:06PM (#32281250)
Do we ever think we'll collapse all of the complexity layers for programming on the web? Coming from other languages, I'm finding that the agreed-upon web standards make development super hard (we have to collectively build these towers of babel on top of them, since we can't fix the underlying stuff)

I guess WASM maybe is one possible solution here

Re:Build your own web framework by lotw_dot_site on Friday July 29, 2022 @04:39PM (#32281501)
This is exactly why I started building "Linux on the Web" about a decade ago. LOTW is meant to completely abstract away all the weird "browser-isms" that seem to overwhelm people like you who just want to sit down and do Plain Old Programming.

I am currently in the midst of supporting a good selection of game console emulators (GB, NES, and SNES are already working), and WASM is indeed a blessing for that!

https://lotw.site

Re:Build your own web framework by mikercampbell on Friday July 29, 2022 @06:01PM (#32282255)
I love this so freaking much!!!! Definitely going to be playing with this over the weekend!
Re:Build your own web framework by blowski on Friday July 29, 2022 @04:16PM (#32281331)
If you want to, you already can. It's what's so great about the web, you don't have to use anything beyond HTTP and HTML. But each of those layers introduces its own costs and benefits, so you can pick and choose to get what you want.
Re:Build your own web framework by Cyberdog on Friday July 29, 2022 @04:17PM (#32281345)
Well, when you start with a "tutorial" (or whatever you call this thing) like this one, you get a false idea of just how complex web development actually is.

I once wrote an e-book on how to use the now mostly defunct Kitura web framework. It started with teaching you how to make a one-file script to output a "hello world" message. After that it talked about using templates and database connectivity and all that, very iteratively. Client-side scripting or "serverless functions" (whatever those are) were not a part of it at all.

Re:Build your own web framework by jeshin on Friday July 29, 2022 @06:01PM (#32282257)
on the note of babel, I don't usually do front end stuff but the other day I wanted to transpile one single javascript file to support older browsers, one time and then never again. I tried for like an hour and I could not figure out how to do it, without setting up like a whole environment/pipeline for it. My expectation going into it was "surely there's some sort of command that just lets you do input file -> output file", but i struggled until I just gave up and used their web demo thing to do it (which tbh I should have just done to begin with, but I had not anticipated it would be so difficult).

I mean I'm sure it's possible somehow, but it sure isn't obvious. And I get that this is not at all the usual use case for it, but still

Re:Build your own web framework by mccorrinall on Friday July 29, 2022 @07:56PM (#32283012)
Babel transpiles js to browsers which are older than me. You should give it a try.
Re:Build your own web framework by cercatrova on Friday July 29, 2022 @10:42PM (#32283842)
If it's only one file, you could just go to the Babel website where they have a playground and paste it in, voilà, converted for older browsers. Now place the output file wherever you want.
Re:Build your own web framework by saghm on Saturday July 30, 2022 @03:32AM (#32285021)
Not sure if they edited their comment (although it seems unlikely given that your comment was four hours later), but that sounds exactly like what they said they did. Maybe I'm old-fashioned, but the idea that I need to upload a plaintext file to have it converted to another plaintext file so I can download it instead of just having a command to run locally seems almost surreal.
Re:Build your own web framework by cercatrova on Saturday July 30, 2022 @03:04PM (#32289384)
There is a command to run locally, `babel`. It works in the command line as well as part of a build tool. It seemed me that the parent however didn't want to spend more time learning all that if they needed to convert just one file.
Re:Build your own web framework by jeshin on Sunday July 31, 2022 @04:28PM (#32298518)
yeah, I did get it to transpile with the babel command, but I couldn't get it to accept the babel-env preset, so it just transpiled from modern javascript to modern javascript, which is not very useful
Re:Build your own web framework by Vinnl on Saturday July 30, 2022 @05:45AM (#32285507)
> Do we ever think we'll collapse all of the complexity layers for programming on the web?

Yes, and this is what Vercel has been doing with Next.js. Used to be that I'd had to manually maintain a bunch of different tools to get them to work together, and then if I wanted to add, say, automatic image compression, I'd have to figure out how to connect that to everything else.

Nowadays, I just let Next.js handle it. I don't even have to think about (and remember, for every new project) what optimisations would be good ideas, as they'll do it for me.

Re:Build your own web framework by edgyquant on Friday July 29, 2022 @04:42PM (#32281530)
I think the problem is there aren’t standards. For backend we have decades of proven architecture but for frontend people are still trying to hammer out the philosophy.