Hacker News new | past | comments | ask | show | jobs | submit | molsson's comments login

process.stdout._handle.setBlocking(true)

...is a bit brutal but works. Draining the stream before exiting also kind of works but there are cases where drain will just permanently block.

async function drain(stream) { return new Promise((resolve) => stream.on('drain', resolve)) }


When you want to await a single instance of a Node EventEmitter, please use `stream.once('drain', (err) => ...)` so you don't leak your listener callback after the promise resolves.


Which cases will it permanently block?


The writable stream will only emit 'drain' if the buffer fills past the limit. In that case, a prior call to `writable.write(...)` would return `false` indicating you should wait for drain before calling write again. Even if your code can't access the return value for the last writable.write call, you can check `if (writable.writableNeedDrain) { ...` to decide to wait for drain.

This program will run forever, since we never write to stdout, stdout never "drains":

    setInterval(() => console.error("stderr: ", new Date().toISOString()), 5_000)
    process.stdout.once("drain", () => {
      console.error("stderr: stdout.once.drain, exit")
      process.exit(0)
    })


Hmm, why did you build it as a desktop app in 2022? Seems like a no brainer to have this in the cloud so that you can seamlessly process huge files and integrate with various third-party APIs. I've used https://www.gigasheet.com/ for this before (which is cloud-based). And there is also the open source visidata project.


Definitely not a no-brainer. Don't want my CSVs integrating with APIs (or in the cloud at all), and I'm confident the desktop version handles large files better than a cloud solution would, as well as being far more responsive, quick, compact than any web-based solution.


I have zero interest in using business data with some online service that nobody else at my company has vetted. I vastly prefer being able to try and use a desktop application where I can be sure sensitive data is where I have 100% control over it.


I'm absolutely positive that you can make a desktop app a lot more snappy and usable than any browser-based solution. Especially if the point is to edit files on your computer – no way I'd want to upload a 100MB CSV to cloud before even having a sneak peek, but a (good) desktop app would allow a quick sneak peek of even a 10GB CSV.


Not everyone wants their solution hosted in the cloud. I would much rather have this as a desktop app that I can own than yet another SaaS product that I have to rent...


It would be nice if the web somehow filtered out links that one had decided to not pay for.


HN Guidelines are links should not be submitted if there is not a freely available version, or at least the wording is "It's ok to post stories from sites with paywalls that have workarounds", which implies that.

It would be nice if OPs took more effort to post the non-paywalled alternative (in addition to the original) to avoid these discussions and complaints. Yes, I am aware complaining about paywalls is OT.

https://news.ycombinator.com/newsfaq.html


No it wouldn't.


Seems like a worthwhile Chrome extension. Or to replace all paywall links with the internet archive link?


We used a similar approach when we pushed to get -Werror enabled in a large C++ code base I worked on years ago.


It's a beauty. Why buy a finished product when you can quickly put something like this together ?


Dead birds? Clearly, the Earth's magnetic field must be reversing!!11

https://www.imdb.com/title/tt0298814/


I hate when you browse through 10-15 websites and for all of them you quickly click the "Accept" button in the bottom banner to get rid of the irritating cookie banners.

And then suddenly, on the 16th website they put a fucking "Buy our thing" button in a bottom bar that you quickly click on without even thinking twice.


There needs to be a way to punish deliberate subversion of expectation. The whole "haha gotcha" mentality is harmful to society in general. The problem is much wider than just dark UI patterns on the web.


It's an impossibility given how our society is structured. A hundred years ago, if Tim's General Store did something shady, there was both social (hey Tim, wtf we're buddies this town only has 50 people) and economic (I'm never going back there and I'm 10% of Tim's regular customers). In this circumstance, our system works very well. But because of increased communication and transportation, pretty much everywhere you can consume from is a multi-national corporation. If Walmart overcharges you for a shovel, you can get your money back, but otherwise don't have any meaningful say about your experience, and probably don't have a meaningful alternative. Same with the internet, there are millions of people hitting up Google the same way you are, even if you blacklist "spamshitblog.net"; most people won't. People like RMS realized this a long time ago, but they basically got shouted down, and I definitely don't think we're gonna stop the train of unchecked free markets anytime soon.

TLDR: The market always wins, just download an adblocker.


I agree completely. It's just a shame.


Oh yeah the other day I saw a website that was showing ads in the fsking GDPR popup (when I tried to "customize" the experience).

Great job guys


The name wren is already used by: https://projectwren.com/


The Wren language has been around a lot longer than the project you linked.


I recently migrated a small side project from MySQL to PostgreSQL. I wrote a short blog post about how I did the migration, issues I ran into etc: http://blog.minimum.se/2019/07/09/upgrading-node-mysql-to-po...

I'm overall very happy with the migration and PostgreSQL also ended up taking less memory (RSS) in prod, which was a nice bonus (this is useful for me because I'm running this on a low-end Digital Ocean droplet).


Very impressive!


This is fast enough, it could be used to write command line utilities in Javascript! What about a Javascript OS in the style of the Lisp machines or early Smalltalks?


Record-query [1] embeds v8 for its query language, which seems to add a significant amount of heft. I know that couchdb uses js for querying as well. It seems like this could be another option for something like that.

[1] https://github.com/dflemstr/rq


Convert the QuickJS code into Rust using c2rust[1], then reuse in rq.

[1] https://github.com/immunant/c2rust


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: