Live data from Hacker News

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

news.ycombinator.com

71–80 of 333 posts

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

#71
post #58

Earlier quoted context omitted.

> I just keep everything in memory in native data structures and flush to disk periodically; Can you expand on what you mean by this? I am interpreting that to mean that you are actually writing to a file and reading from a file rather than using SQL?

They're storing their data in native Rust objects and read or write them in server application RAM. In case data becomes larger than available RAM, they have set up a large swap, which is a file or a disk partition that the OS uses when no more real RAM is available, while acting like nothing is happening (and everything gets 1000x slower). They periodically serialize these in-memory objects to a file on disk, and pr…

Correct. Although I don't read everything on startup. Some of the data (e.g. per user data) is only loaded once it's needed.

Also, the swap doesn't make everything slower as long as my active working set is smaller than the available RAM. That is, I have more data loaded into "memory" than I have RAM, but I'm not using all of it all the time, so things are still fast. It's basically an OS managed database. (If I were using a normal SQL database I'd get a similar behavior where actively used data would sit in RAM and less used data would be read from the disk.)

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

#72

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?

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

#73

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…

This is really neat. What's the site? I'd love to see it. And could you tell us more about the DOM diffing algorithm?

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

#74
Have you heard of tabulator? tabulator.info/ - I honestly don't know how my spreadsheet based project would have been possible without this amazing library (and Flask with Jinja)

On the personal side I always love using Processing (p5js.org) for interactive canvas visualisations. I recently found out that this can be used with react, so that's the basis for my next learning project.

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

#76
I’ve been playing around with code sharing options between web, mobile and desktop platforms.

The idea is that the app core is written once in Rust and bindings are automatically generated to all target platforms.

I have a project that starts with protobuf files and generates Rust for the shared core, and Dart (ffi) and JS (wasm) for the client stubs. The generated client interface is “platform-native-async” so Dart Futures or JS Promises. The bridge passes protobuf messages back and forth between both language contexts and takes care of the threading/async mapping.

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

#77
[Warning: Not Safe For Prod]

Pug and Stylus for html / css preprocessors, especially if you're new to coding.

I used to teach a lot of web dev classes to non web devs (mainly designers looking to upskill). One of the worst parts of html/css (or code in general), particularly when you're experimenting, is the strictness. Pug and Stylus are great preprocessors for experimenting and rapid iteration, particularly because they don't care. Pug doesn't care if you change between its syntax and html. Stylus doesn't care if you missed a ;, or a : in your style declaration. They are forgiving languages, essentially the antithesis of something like Typescript.

Absolutely excellent when you're trying to wrap your brain around something. I highly recommend them.

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

#79
post #56
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.

Adding in a service like a SQL database because "you might want that" in the future is not a good idea. Apps should do what they need to do and no more. "Future proofing" is almost always a waste of time - even if you definitely want the feature in the future it's usually better to add it in when it's needed than adding it early and have to support something that adds no value yet. As for reports and transactions spe…

Unless, of course, switching to SQL turns out to be a major headache because it requires major rewrites, organizational changes, etc.
Post reply on HN