Действительно быстрое

Mar 26, 2023 21:33

Фраза "быстрое прототипирование" заиграла новыми красками. В-общем я решил ебошить генерацию экселя на ноде средствами чатжпт, но не тут-то было. Выяснилось, что есть тучи либ для работы с зип-файлами, но все они какое-то говно. Например, не юзают встроенные в ноду биндинги к злибе, лепят какие-то стримы на стримах и так далее, в результате всё разрастается до мегабайтов. Что не так плохо, но ты понимаешь, какие горы говна там внутри под капотом лежат.

В результате после долгих усилий (перебирая либы) нашёл, что для зипов есть yazl и yauzl, которые какие-то лапшевидные и большие, но не пугающе большие (160 кб в сумме).

Ну и отдельно помучался с хмл. Чатжпт удачно разжевал формат, там выяснилось, что не обязательно использовать sharedStrings, буду пробовать.

Upd: Тут началась мета-игра! Я решил что надо чтобы чатжпт поучаствовало в обсуждении, для чего пропустил текст через гугл-транслейт, поправил откровенно лажовые места руками, сказал чатжпт исправить текст так, чтобы оно звучало натуральнее для тех, у которого английский родной, но сохраняло мудацкий стиль, и отдельными уточнениями сказал поправить места где он не так понял мою первоначальную мысль. Вот что вышло:

"Rapid prototyping" with ChatGPT is fantastic, but finding decent libraries in the Node.js community is like trying to find a needle in a haystack! I decided to generate an Excel file on Node.js using ChatGPT, but lo and behold, I stumbled into a minefield of bloated, inefficient libraries. There are tons of libs for working with zip files, but most of them are utterly disappointing. Instead of using the built-in zlib bindings in Node.js like any competent developer would, they cobble together a Frankenstein's monster of streams layered on top of more streams, making everything balloon to absurd sizes. Just imagine the kind of nonsense lurking beneath all that bloat.

After what felt like an eternity sifting through the quagmire of libraries, I finally stumbled upon yazl and yauzl for handling zip files. Sure, they're still somewhat convoluted and larger than they need to be, but at least they're not completely horrifying (just a relatively minor 160 KB combined).

As for XML, ChatGPT was a lifesaver. It broke down the format for me in great detail, like a true champ. As it turns out, using sharedStrings wasn't even necessary. It's mind-boggling how much effort it takes just to find a library that's not a bloated mess. The Node.js community really needs to step up its game and cut down on all these excessive dependencies!

Буду теперь кормить и постить коммент.

все пидарасы а я, выебудни, programming

Previous post Next post
Up