Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

That's what t-strings are about. They are lazy, so you can mark them for translation "as-is".


Does perl have lazy string processing? And I'm not talking about a coderefs hack.


t-string are lazy, which is the point (escaping HTML, translating strings when you get preferred language headers, preparing SQL statements...).

Does Ruby strings already allow lazy processing ?

I'm not talking about wrapping them in a block and passing the block (all languages can do that with a lambdas) but a having literally that eventually resolves to something when you use it.


That's seems like the wrong pattern, maybe I'm missing something.

Ruby has lazy evaluation with a generic lazy enumeration facility, whether to produce string or any kind of object.

That is, I don't know what is the actual behavior of the default string interpolation in Ruby, but if profiling a codebase some string generation would gain lazy evaluation, there is a path to do so. But in the general case, does it really matter? Chances are good that a string construction is not a big bottleneck.

Does Python miss such a feature of generic lazy enumeration, or is it so painful to use that some syntactic sugar felt like a must have? Genuine question here, I don't have any strong opinion on this t-string feature.


It has lazy enumeration with generators, but:

    - string construction is a hot path, you don't want them to always be lazy, especially since any access is slow in python.

    - having it using a string syntax is just very clean and easy to read. It's explicit and can be supported by good editor highlighting.

    - it's easy to grep, analyse for, substitute, etc.

    - you get one single unified API instead of thousands of variations. Translations API, log API and escaping API can all look the same, arguments are in the same shapes.


Thanks for the detailed answer.

I understand that string generation can be a hotpath, though I wouldn't take it as a general certain fact.

From what I understand here the benefit in term of performance is mainly due to partial application automatically handled by the interpreter. It's hard to me to jauge actual pro/con compared to Ruby which can also leverage on freezed string, lambda, miscellaneous lazy evaluation facilities for example. I'm not aware of anything close in PHP, to stay in the realm of popular interpreted languages. I didn't make any Lua for a long time, so no idea how it evolved on that matter.


You don't need interactivity for this, you just need "<img src="" />"


Which still isn’t perfect as images get cached at different stages depending on the email client.


Or can be blocked or are opaque to visually impaired.


It's "accelerated mobile pages" but I love the abuse version.


Well yes, obviously Google didn't actually name it for Abuse of Monopoly Power.


Not publicly, at least.

They've put some seriously dumb admissions in writing before.

https://www.techemails.com/p/sergey-brin-irate-call-from-ste...


They learned from this and now just have periodic arbitrary layoffs to depress salaries and keep the workers scared and in line in a deniable way instead of in an explicit way.


I'm in France, maybe I should open a proxy. You order through me, I reexpedite to the US, with a French stamp lol.


Somebody absolutely should and will open this business. Versions of it already exist in Northern Ireland after Brexit.

A slightly greyer version: you open the box, add a ribbon to every item, repackage it, mark it "final assembly in France".

Unfortunately for you, your business probably gets outcompeted by the guy who has the same idea in Canada.


It does not work. You have to declare the real source of the merchandise. Or it has to go through "substantial transformation" so that is called "Made in France".

Country of origin is taxed and not country of shippment.


And nobody ever lied on those Chinese envelopes with the value declaration. ;)

Also, I can tell you that the country of origin field has one of the lowest entry qualities of all fields. People just don't bother, and customs don't have the capacity. Also, depending on your warehousing, there is a good chance you simply don't know. If something in your item bucket came from either China, Vietnam, Malaysia or the Philippines, what are you gonna write?


I bought an instrument cluster for my car for 700$ a year or two ago and they totally put something like "broken car parts - 20$" on the declaration.


How does what you say not make it work though? Are you aware that people lie for financial gains?


Sure, but then it's less of a fun side business and just becomes straight up smuggling.


A reputable business might not be interested in smuggling, but if you have incentivized smuggling, it will definitely occur


145% tariffs are practically designed to encourage smuggling.


I've seen a few headlines in our local news here in Australia about how nobody knows what amount of Chinese ingredients will result in the final product being hit with Chinese tariffs, even though the products are assembled here.


Russia has 0% tariffs, so they're probably going to ship through there.


China is 'best friends' with Russia, Russia is best friends with Trump. Huge piles of cash for everyone on the inside there.


That’s already happening.


I had bad reviews been supressed by amazon several as well, so at this point I'm assuming any review system is theater.


Amazon definitely don't do anything like this.


Seller-side here. Amazon combine my author page, with that of A.A. Milne. Some of my products show up under the deceased author, some of his under mine. Reviews for one particular product are combined.

My seller ID is separate, my last name is also Milne, but my first is James.

He wrote a book called "The Red House Mystery", I wrote an homage to it because I am related to the man, called "Red House". Different products, with different ISBNs.

Combined reviews. [0]

That's not exactly a fair process for customers - and no, I can't get them uncombined. I've been trying for years. But if the seller can't get rid of something completely misleading, that seems to have been caused by a very badly automated process, then there are processes at Amazon that cause problems.

[0] https://www.amazon.com.au/Red-House-James-Milne-ebook/dp/B0C...


I've only ever left one bad review on Amazon. Chopsticks, they came bound together with some sticky tape. Sticky tape left a very sticky area just where your hands go that I was unable to get off despite a lot of effort scrubbing, washing, and so on. I left a polite constructive review saying they were good chopsticks but watch out for this stickiness issue. My review was declined by Amazon on the grounds it didn't meet their "community guidelines" (without elaborating further on which rule I'd supposedly broken).


Ok, well I've left nine 1-star and many other 2 or more star reviews and none of them have been removed for any reason, so I would say you got unlucky and that I stand by my comment that Amazon don't do anything like automatically redirecting all 1-star reviews to customer service.


You don't have a glue removal spray? :)

I bought one to get sticker residue off my windshield, but it's proven useful many times since.

Mind, considering how well it removes glue, I wouldn't stick anything that was touched by it in my mouth... but may be okay for the hand end of your chopsticks.


Can you recommend your glue removal spray which is food safe? Because the entirety of cutlery needs to remain food safe, not just the pointy end.


Just wash the cutlery afterwards? Dish soap isn't food safe either for that matter.


Orange oil works wonders. It's explicitly not food safe, but you get that stuff on your hand every time you peel an orange and it's also present in juice. Just rinse them afterwards and wear gloves.


My mother swears by "Goo Gone": https://googone.com/

Of course, after you use it, I would recommend to wash the cutlery.


Here are the ingredients:

   Product Name: Goo and Adhesive Remover Spray Gel
   Product Code: 2096, 2137C
   Ingredients CAS No. Function
   Petroleum distillates 64742-47-8 Solvent
   Aliphatic ether alcohol Withheld Solvent
   d-Limonene 5989-27-5 Solvent
   Polymer Withheld Thickener
   Orange sweet extract 8028-48-6 Solvent
   Solvent orange 60 6925-69-5 Colorant
   Solvent red 18 6483-64-3 Colorant
I would probably use some lens cleaning ether without perfume.


Paste made from sodium bicarbonate and vegetable oil is good at getting sticky label residue off glass jars.


I recommend isopropyl alcohol. It’s cheap, versatile and works like a charm for most of your cleaning jobs. Way safer and cheaper than sprays and "super-do-that-thing-4000". No offense to the sprayers.


Not for Austrian road tax stickers. That's specifically what made me get the spray.


The community guidelines rejection is such BS. I've done thousands of Amazon reviews and get about 1% rejection rate, and it's always baffling as to the cause. You develop superstition over time over what is the cause. I avoid certain words (sexual, violence, mention of other brands), blur our barcodes, etc. "Sticky" would trigger my "uh oh, sounds sexual" alarm and I'd word it something like "tape around chopsticks left adhesive residue". Like I said, superstition.


They must have thought it was a bad dad joke.


Amazon is known for suppressing negative reviews, there are many reports about it. Not sure why the grandparent comment is claiming the contrary - not doing the automatic redirect maybe, but they do remove or just not accept negative reviews.


They absolutely do, it's personally happened to me. My review was rejected because I simply listed what items were included in the box, one of them being a card that offered a bribe for a positive review.


Every review I left for Amazon products (Amazon EU) got rejected until it was diluted into nothing. The explanation was always vague, listing a dozen possible reasons, none of which fit what I wrote.

On non-Amazon products it's a coin toss for negative reviews. Many are published, some are not. Can't explain why.

Google is not better, negative reviews I leave on Maps are published very selectively. Maybe big-tech found a way to monetize this too. I know sites like Yelp are more or less an extortion business where you pay to get negative reviews wiped.


Neither does Temu. They're misrepresenting what Temu does, at least in my experience.

If you choose a star rating below five, Temu asks if you'd like to request a refund or seek other assistance. The one time I said yes -- it was a keyboard where a shift key wouldn't trigger consistently at the peculiar angle that my typing style hit it at -- it immediately gave me a 100% refund and said just keep it.

But I've left other low-star rating without trouble. The refund/assistance suggestion is an entirely optional sidetrack.


I've never (to my knowledge) had a review on Amazon rejected, and I've left very some negative reviews, including when I received counterfeit items.

I always thought the review scams on Amazon were more driven by the third-party sellers doing stuff like listing takeover, astroturfing reviews, bribing customers for good reviews, etc., but maybe I'm wrong. I have personally received multiple offers from third-party sellers of incentives to leave good reviews.


I bought a pcie wifi card on amazon.

It came with a "get $20 if you leave a 5 star review" card in it.

I took a picture and included it in my review.

Amazon declined to publish it.

So, they do shady shit like this for sure.


Either you've never used amazon or you are lying in bad faith.


I have written more than 200 reviews on Amazon in the past year and only one got rejected, and quickly approved I corrected one thing that was out of the rules.

More than 50% of those are below 3 stars. They don't suppress any legitimate reviews.


Amazon took down one of my reviews because I included a picture of the item's manual which had a page offering to pay for Amazon reviews (the item had unanimous 5 star reviews). To me that seemed like valuable info and legitimate context to include in a review but even after I appealed they disagreed because my picture was "irrelevant".


You're supposed to report review manipulation offers to Amazon. Reviews are for the product itself, not the seller (in theory multiple sellers can offer the same product, but for alphabet soup brands that's never the case).


The review manipulation offer was boxed up in the shrinkwrapped package so from my POV that made it part of the product. If the seller is altering the product then IMO its fair game to review. If a seller removed the batteries or put a sticker on the product I'd consider that an alteration to be part of the product itself... as opposed to when reviews complain about stuff like the seller's shipping speed which is orthogonal to what's in the box being shipped.


How convenient that the information only goes to Amazon, who can choose to do nothing, and isn't allowed to go out to other customers to help them make a purchasing decision.


>More than 50% of those are below 3 stars.

Do you make bad purchasing decisions? How could "over 50%" of 200+ purchases be two star or fewer? Why would you still patronize Amazon if this is your experience?

>They don't suppress any legitimate reviews.

While I don't think they do -- Amazon, like Temu, is a marketplace of sellers, and they let the bad sellers die -- you aren't really in a position to say if they do or not. Amazon's algorithm for surfacing and/or aggregating reviews is not something we can audit in any real manner.


> Do you make bad purchasing decisions? How could "over 50%" of 200+ purchases be two star or fewer? Why would you still patronize Amazon if this is your experience?

I get them for free, see https://news.ycombinator.com/item?id=43690563

> While I don't think they do -- Amazon, like Temu, is a marketplace of sellers, and they let the bad sellers die -- you aren't really in a position to say if they do or not. Amazon's algorithm for surfacing and/or aggregating reviews is not something we can audit in any real manner.

Most of my reviews are for items with very little reviews due to the nature of Vine, so I can directly see the impact of my score on the average score.


Some people treat it like an adventure or a gamble or are just too curious, they know it's hit or miss but it's cheap and usually you can return it easily. See Atomic Shrimp channel for example. I don't get those people but I don't judge


> I have written more than 200 reviews on Amazon

Why did you do that? Did they pay you? Or did you get the stuff for free?


You forgot to ask 'Do you live in a high-trust society?' - or maybe you didn't?


Building common goods is one thing. Free labor for a corporation (that can at any time decide to throw it away if it's not profitable enough) is another thing.


Yeah I get the items for free in exchange of honest reviews, look up Amazon Vine, it's an official Amazon program.

Note that if anything they are more stringent with the quality of the reviews we need to write, not less.


stremio works fine and is quite popular.

It's similar to popcorn time that was killed by legal ways so I'd say they did take off.

Stremio smartly avoids being killed by making pirating an optional plugin you have to install from another site so they get deniability.

It works well and save my ass from needing 1000s' of subscriptions.


I was going to cite stremio too, it's far from perfect but it works fine most of the time.


Ah, so you are not using pyQT, numpy, any database driver, pillow or anything using cryptography, then?


For the libraries you listed, the benefits of using a native library are much larger, since they’re wrapping a well-known library that is known to be secure and fully-featured, or since the performance benefits are actually visible in any significant code snippet. But here, there is no Rust library to wrap, and I doubt the performance of a date-time library would have any effect on the performance of virtually all applications (maybe except for calendar apps).


datetime handling can absolutely be a hot spot, especially if you're parsing or formatting them. Even for relatively simple things like "parse a huge csv file with dates into dataclasses".

In particular, default implementation of datetime in cpython is a C module (with a fallback to pure python one) https://github.com/python/cpython/blob/main/Modules/_datetim...

Not saying it's necessarily justified in case of this library, but if they want to compete with stdlib datetime in terms of performance, some parts will need to be compiled.


Functions that you have to document, test and maintain of course. You do that, right? And all the people in your team, they do that and will keep doing that once you leave, right? And they all understand the business domain and all the pitfalls that come with it and have the skill, time, and resources to take care of it, right?

And this for every single problem: time, text, maths, network, parsing, formatting, validating, authenticating...


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

Search: