Live data from Hacker News

Ask HN: What novel tools are you using to write web sites/apps?

news.ycombinator.com

81–90 of 333 posts

Re: Ask HN: What novel tools are you using to write web sites/apps?

#81
post #49

Earlier quoted context omitted.

No SQL database is the one thing I disagree with. What if you want to write a SQL query/report? Do you have transactions? As the app gets bigger you might want that.

> No SQL database is the one thing I disagree with. I'm not saying this approach is a good idea in every case. There are many situations where I would use a proper database. It really depends on what kind of app you're building, what kind of queries you want to run, how big is your dataset, your failover and availability requirements, your programming language, etc. In my case it was a great decision. The code is sim…

>The concept of 'transaction' doesn't really make sense in this approach, since I'm directly modifying the data in memory, every change I make is atomic and can't fail, and I flush the data to the disk atomically as well.

So you don't have mutable data shared between threads then?

Re: Ask HN: What novel tools are you using to write web sites/apps?

#82

This partially might be more of a what's old is new again, but here's what I use: - 100% server side rendered - Progressively enhanced (fully works without JS, but having JS enabled makes it nicer) - In select places where I need SPA-like snappiness I use a ~100 line long DOM diffing algorithm (I request full HTML through AJAX and diff it into the current page; if the user has no JS enabled then the page just refresh…

> I use a ~100 line long DOM diffing algorithm Since this is not vDOM diffing (which most JS frameworks nowadays provide) can you help share the algorithm if its already out in the open / non-proprietary?

It's really nothing special. I wrote the whole thing in, like, a single afternoon. If you're interested, here it is:

https://pastebin.com/V7UiWj1e

It's not really a general purpose diffing algorithm. It probably doesn't handle every corner case as it only does what I need it to do in the few places I actually need it.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#83
For my personal projects I find particularly satisfying using my own stack:

- https://h3rald.com/litestore if I need a RESTful searchable data store and some relatively simple middleware logic.

- https://h3.js.org if I need to write a single-page application and I just want to get things done fast.

- https://hastysite.h3rald.com if I need a static site generator.

- https://min-lang.org for more complex things. It took a bit to get used to it, but I managed to get quite productive with it in the end.

I do occasionally try out more traditional things or the latest stuff but... using my own code feels a lot more gratifying. If I needed something different, I found myself building it from scratch exactly like I wanted it.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#84
Svelte and feathersjs.

Feathersjs seems to be just the right amount of magic: choose a backend store with a model, and it creates REST CRUD endpoints for you.

You can drop down to middleware or ideally use "hooks" that activate before (e.g. permissions) or after (post processing) each CRUD call. A new endpoint is a breeze to set up.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#85
I'm migrating a side-project that was served by a Django-based server running on Heroku.

Here's the new version (WIP):

https://www.blockstudio3.net

It's written in Haxe (transpiled to js), runs on a single VPS with all of its data in SQLite, and is cached behind a CDN, making it pretty snappy.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#86

I am working on two alternative tools for building web apps: https://htmx.org - uses HTML attributes and HTML-over-the-wire for AJAX/Web Socket/SSE interactions https://hyperscript.org - an experimental front end programming language derived from HyperTalk that is event-oriented and that removes the distinction between synchronous and asynchronous code. Both tools are HTML-oriented and are designed to be embedded dir…

I'm really looking forward to Hyperscript growing more capabilities. I love that it's very natural-language-oriented. I'm really interested in frameworks like this that could make HTML website creation more accessible for regular people. Watching a friend try to build a website with SquareSpace I was thinking... for the amount of effort she put into learning SS's tools and quirks, she could almost have just learned HTML.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#87

This partially might be more of a what's old is new again, but here's what I use: - 100% server side rendered - Progressively enhanced (fully works without JS, but having JS enabled makes it nicer) - In select places where I need SPA-like snappiness I use a ~100 line long DOM diffing algorithm (I request full HTML through AJAX and diff it into the current page; if the user has no JS enabled then the page just refresh…

I'm doing the same old skool thing (first 4 points) for a large app, except the last 2 points are:

- using MySQL and Redis

- using Perl and the awesome CGI::FormBuilder module

Re: Ask HN: What novel tools are you using to write web sites/apps?

#88
post #81

Earlier quoted context omitted.

> No SQL database is the one thing I disagree with. I'm not saying this approach is a good idea in every case. There are many situations where I would use a proper database. It really depends on what kind of app you're building, what kind of queries you want to run, how big is your dataset, your failover and availability requirements, your programming language, etc. In my case it was a great decision. The code is sim…

>The concept of 'transaction' doesn't really make sense in this approach, since I'm directly modifying the data in memory, every change I make is atomic and can't fail, and I flush the data to the disk atomically as well. So you don't have mutable data shared between threads then?

The basic stuff Rust will solve for you, but it is easy to forget logical dependencies and get an inconsistent state anyways... Just the ordinary close a session, send error message if not alive has bitten us in a 20 person project.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#89
post #81

Earlier quoted context omitted.

> No SQL database is the one thing I disagree with. I'm not saying this approach is a good idea in every case. There are many situations where I would use a proper database. It really depends on what kind of app you're building, what kind of queries you want to run, how big is your dataset, your failover and availability requirements, your programming language, etc. In my case it was a great decision. The code is sim…

>The concept of 'transaction' doesn't really make sense in this approach, since I'm directly modifying the data in memory, every change I make is atomic and can't fail, and I flush the data to the disk atomically as well. So you don't have mutable data shared between threads then?

> So you don't have mutable data shared between threads then?

I might have worded that one sentence a little better, sorry.

I do technically need to share data between threads, since my event loop runs on multiple threads, so if I want to mutably modify something I do need to wrap it either in a `Mutex` or an `RwLock` and lock it.

What I meant was that it is not the same as a "transaction" in the SQL sense. It can't fail, there is no rollback, I decide on my own what level of granularity I need, and I bake the necessary atomicity into the data structures itself. So there are no SQL-style transactions anywhere - I just use a lock where it's appropriate to directly modify the memory, just as you'd do in any other situation. (Either by wrapping the whole structure in a lock, or wrapping only a single field, or by simply making the field atomic by itself.)

Re: Ask HN: What novel tools are you using to write web sites/apps?

#90
I am an amateur dev writing things mostly for myself, just a few were worth sharing as open source.

I use Quasar (based on Vue) for everything. Yes, it makes it look like I have a hammer and everything looks like a Quasar-Vue nail,but it always works.

Everything is enclosed, components, canvas,... SPAs are easy, WPAs are easy, everything is easy.

The community could be better but the docs are excellent.

I've learned quite a few things about Vue using Quasar, so this is a plus too.

As for the back, nothing fancy, usually Python with flask.

Post reply on HN