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

So I tried the example in the doc: there is a huge latency between the moment I click on "+" and the moment the counter increment.

Is that what we can expect performance wise? What causes this?


Looking into it we just have a lot of people on the site rn. Will need to scale it up to handle this traffic


Do you mean every time I click on the button, it goes to the backend for incrementing?


Maybe the pressure the knots hold is enough to maintain rows of sections of the material in close enough range for the casimir effect to apply, making making some part of it flexible (the material) and some part of it super resistant (the quantum fluctuation zone) which ends up giving this property.


Way too big for quantum stuff, it is just plain friction.


Most probably, but throwing geckos at knots is more fun.


The adhesion of the gecko’s foot is caused by van der waals forces, not the Casimir effect, just fyi


Thank you for correcting me.


It won't pass the IRB if you describe it like that.


But when is it going to make regex obsolete? :)


Guns have only one purpose: physical combat. Either commit it, or, hopefully, prevent it.

Blades and encryption main purposes are not physical combat. Blades are mostly use for cutting material we use in our daily life, encryption is mainly use to hide communications.

I don't agree with Brazil move, mind you. Flippers are not dangerous to the point I would consider seizing them a priority.


>Guns have only one purpose: physical combat.

This premise is not true. But I agree, it's generally ignorance about a tool, weather it's firearms or radio, that leads to people and so governments, making false claims and so taking stupid regulatory actions.


It is really. You can use a gun as a doorstop or a paperweight, but it wasn't designed to that end. It's designed to deliver massive force to a small target at range and though that could be an object (eg in a target shooting competition), the intended target is usually an animal or person. Please don't insult people's intelligence with semantic games.


It's understandable that most people don't have the lived experience to realize that firearms are mostly for recreation. Most people live in high population density areas where firearms discharge is not allowed or feasible. But for most firearms uses the vast majority of use, and indeed the marketing by the companies that manufacture them, is about the recreational aspect, not shooting people or animals. There's certainly marketing and intent towards hunting but those are .308 rifles and larger calibres explicitly designed for it and they are not the majority of the market.

It's not the 1800s anymore.


Many people use firearms for recreation, and I agree that they are great fun. They are designed to put force on a target at range. If you only care about the recreation aspects, you'll be equally happy with a paintball or BB gun.


I have paintball and pellet guns and I can assure you while they are fun it is not the same. Although high calibre (.30) precompressed pneumatic air rifles are approaching the capabilities and fun of combustion propellant firearms pretty rapidly these days. And as a plus you can fire them full auto and with noise mitigation attachments without the legal worries of combustion firearms.


None of this obviates my point about what guns are designed to do. I don't have time for more of this semantic quibbling.


> Guns have only one purpose: physical combat.

I'm pretty sure the vast majority of gun owners have never actually shot anyone. More common uses are: training, hunting, collecting, and plain old having fun shooting things.

I used to be pretty anti-gun, but the 2020 home protests and Ukrainians initially training with wood guns changed that.


>I'm pretty sure the vast majority of gun owners have never actually shot anyone. More common uses are: training, hunting, collecting, and plain old having fun shooting things.

You're confusing use with purpose as if to imply the utility of firearms as tools to commit violence is merely arbitrary, rather than specific to their design. Which is weird because your second sentence makes it clear you know otherwise.

Setting aside that hunting is physical combat, the purpose of guns is not to be collected, or to shoot inanimate targets. The founding fathers didn't create the Second Amendment to protect the right of the people to keep and bear arms against watermelons on stumps. Guns may have multiple uses, but their purpose is combat.


It's a form of insurance. You don't get a car insurance to crash your car, just like the US doesn't have nuclear weapons to use them.


> Guns have only one purpose

Not a fan of biathlon? Although I guess competitive shooting could be seen as a form of combat the same way competitive chess could be.


I use my keys to open my amazon packages.

But keys are still made to open doors.


But you wouldn't say keys have only one purpose.


Yes I would.

Purpose has a very specific definition.


I'm not exactly on this trend, but I noticed something going into that direction:

15 years ago, I wanted the latest everything. Now I usually want the latest minus one. Python 3.11 is out? It's finally time to use 3.10. The new phone model is ready? Let me buy the one from last year.

Because it's almost as good, but a lot more reliable.

You get all the patches, all the user report, all the ecosystem support that has accumulated since then. And this has a LOT of value.


I saw this happen in myself too. I think it has to do with experiencing things as a consumer first(the "ooh shinys") and then only later being able to work through how I'm actually using the tool towards a goal.

A lot of tasks that look like they need a computer in the loop, are actually a tiny layer of tech on top of a more traditional skillset. That is, you would actually be more capable of using the tech well by studying and planning it on paper and walking in the proverbial "recording studio" practiced and prepared, than by getting a device and expecting to be hands-on with it for hours and hours every day. This analogy works for music, for visual art, for writing, for programming, and many other tasks.

The cases where you can get a lot out of being hands-on tend to be artifacts of incidental incentive structures, because so much of computing is just an abstract UI to process and edit data you already have and publish the results, vs being an more intrinsic experience - it's supposed to speed you up, not make you dwell on every decision. Staying hands-on with the machine creates incentives to polish things mindlessly, because it will never say "no" to one more layer of processing, and it will always say "yes" to your requests to keep previous versions around.

Going traditional cuts out all the fluff - you have to put in ongoing effort to support a traditional workflow, so you automatically drop your level of polish to what the task calls for. It makes you think about handling information as a performance art, instead of an idealized production process. And when you bring the computer in on top of that, it focuses you around making basic adjustments and enhancements, instead of mitigating the need for a performative approach altogether.


One's own values may shift over time. Personally, I'm still as much a fan of bleeding edge[0] as when I was a young'un.

It's just personal preference and it's fine. The weird thing is making a big deal of it, IMO.

[0] As is tradition, I must mention that I do run Arch Linux, but I'm not on the 'testing' repositories... but I'm not sure I'd ever want to be that bleeding edge, even in my youth :)


A couple weeks ago I realized I was still running the previous version of MacOS and I honestly don't want to put any effort into upgrading. It works fine right now. What a weird departure when I used to want to upgrade on day 1 and had to consciously wait two weeks for the big bugs to be worked out.


> It works fine right now

> don't want to put any effort into upgrading

There is so much effort from Apple to reverse this.

They want to make it harder to stay on older versions. So much so that upgrading feels like the less painful option.

Be it hardware or software they really put in so many roadblocks, its almost like an evil masterplan.

No more Apple for me.


> No more Apple for me.

It would be great if there were a competitor with equal hardware and software, but there isn’t that I’ve seen.


Apple has advantages. And everything comes with tradeoffs.

I don't use Apple's hardware and software anymore. Thats my position. I won't take those tradeoffs. Works for me TM.

Others use Apple's hardware and software. It works for them.

I own enough personal and professional hardware and boatloads of software, on owned hardware and in the cloud, that has nothing to do with Apple. Clearly there's competition.


Also I can generally pick up the previous generation used at a discount as the new stock is about to come in. This is especially good on big ticket items that people seem to crave having the newest version of. i.e phones, TVs, computers.


If you code in Python, your probably should use the language as much as possible and avoid calling shell commands.

E.G:

- manipulate the file system with pathlib

- do hashes with hashlib

- zip with zipfile

- set error code with sys.exit

- use os.environ for env vars

- print to stderr with print(..., file=...)

- sometimes you'll need to install lib. Like, if you want to manipulate a git repo, instead of calling the git command, use gitpython (https://gitpython.readthedocs.io/en/stable/)

But if you don't feel like installing a too many libs, or just really want to call commands because you know them well, then the "sh" lib is going to make things smoother:

https://pypi.org/project/sh/

Also, enjoy the fact Python comes with argparse to parse script arguments (or if you feel like installing stuff, use typer). It sucks to do it in bash .

If what you need is more build oriented, like something to replace "make", then I would instead recommend "doit":

https://pydoit.org/

It's the only task runner that I haven't run away from yet.

Remember to always to everything in a venv. But you can have a giant venv for all the scripts, and just she-bang the venv python executable so that it's transparent. Things don't have to be difficult.

Finally, sometimes it's just easier to do things in ipython directly. Indeed, with a good PYTHONSTARTUP script, you don't have to import everything, you get superb completion+help, and you can call any bash command by just doing "!cmd". In fact, the result can be store in a python variable. Also you can set autocall so that you don't have to write parenthesis in simple function calls.


Is this satire?


Pdb comes to mind.


I don't understand, why is "&" not the default and passing ownership something you must explicitly request ?

It seems the latter is more common than the former, and that would avoid to have to add "&" everywhere.


One reason is that "&" is nestable, but ownership is just ownership.

Currently the types are:

    owned T            T
    ref of T          &T
    ref of ref of T  &&T
You're suggesting that instead you skip the "&" and write some sigil for owned types, say "@":

    owned T           @T
    ref of T           T
    ref of ref of T   ???
How do you write the type "ref of ref of T"?

On its own this isn't a super compelling argument, because "&&T" is an unusual type that one doesn't normally use. But it hints at the fact that "&" is a modifier. The stronger but less pithy version of this argument is that if you have a type parameter "T" it's essential that it can be instantiated as "T=&U" for some "U".

EDIT: come to think of it, you don't often write "&&T", but it is commonly used. If you `println!("{}", x)` where "x" is a reference, the "println!" macro also takes a reference and you get a "&&" type.


> come to think of it, you don't often write "&&T", but it is commonly used. If you `println!("{}", x)` where "x" is a reference, the "println!" macro also takes a reference and you get a "&&" type.

Yup, i see them all the time in iterators too. Eg `foos.iter().filter(|t| ..` `t` is `&&Foo` in that example, iirc. Not that you usually see it though, due to closures obscuring types.


You would use an explict "&", just that &T is implicit by default.

I have to assume rust creators knew what they were doing since they are obviously way more experienced at this than me, but I still don't get it.


I suspect you're not imagining all the places this would touch the language. For example:

- Does "i32" mean an integer or a reference to an integer? You almost always want it to be an integer, so maybe we carve out an exception for small primitive types, that they don't get an implicit "&".

- Likewise some library-defined types like "Rc<T>". "Rc<T>" is the way you store a ref-counted T. So you usually want "Rc<T>" instead of "&Rc<T>". Is there an exception for this type, too, or do you always have to write "@Rc<T>"? It's defined in the standard library, so if it gets an exception than there has to be a language mechanism for "types that should not have an implicit &".

- The ".next()" method on iterators has the type signature "next(&mut self) -> Option<T>", where "T" is the type of the iterator's elements. Under your proposal, you'd write "next(&mut self) -> Option<@T>". If "T=&str", then you're returning an "Option<@&str>". Which has to be equal to "Option<&str>" or else everything breaks, but that might not be super intuitive to programmers.

That last one's the most important, though I don't know how to explain it clearly. If you have a type parameter "T", then "T" does not mean owned T. It means "T", whatever "T" is. If "T" is a reference, then it's a reference. And if you have a type parameter "T" then "&T" means a reference to "T" whatever "T" is. If "T" is itself a reference, then "&T" is a reference to a reference.


Gosh, thanks for this explanation. This will help as my eyes protest the assault of '&'s.


Ooh that's a fun question. I think it comes from reusing the C/C++ notation for references (https://stackoverflow.com/a/2094715/2242866). But I have no idea where the original idea for using those characters came from.

There's one other thing in Rust that would be kind of difficult if passing a reference were the default, rather than the owned value. Rust has implicit returns so the last thing at the end of a block or function is returned. If you needed to explicitly ask for ownership, you'd need to do that at the end of every function. Also, Rust will yell at you if you try to have a function return a reference to a value that's going to be dropped.


> I think it comes from reusing the C/C++ notation for references (https://stackoverflow.com/a/2094715/2242866). But I have no idea where the original idea for using those characters came from.

In C++, I think that the use of '&' came from the use of '&' in C as meaning "the address of". A reference and an address to a value are similar concepts.


Rust 0.x used to have this the other way around with an explicit `move` keyword.

It was tedious and eventually dropped. For example, it's more natural to move in assignment. `= move` is weirdly boilerplatey, `=` borrowing is unhelpful, and `=` moving without the move keyword is inconsistent.

Also the moment something is borrowed starts a lifetime scope, which is useful to know. It'd be harder to notice loan scopes of loans were implicit.


Fascinating! Didn't know that


I think it's, um, borrowed from C++'s pass by value / reference syntax. To be honest I'm still a bit muddled about how &x in Rust relates to &x in C++.


& is about the same as const & in C++, just swapping the default for immutability.


Because Rust is pass by value.

  f(&s);
is practically equal to

  let r = s.borrow();
  f(r);


If I ask why is the sky blue, telling me because blue is the color or the sky doesn't help.


It's simpler to buy any true value option than pick from all the rental properties in the rust belt.


Oh, so it's for performance reason: the default choice is not the easiest, the the cheapest, and they force you to be explicit about paying the price of a reference?


As a geek, I'd love syntactic macros. As a professional, I'm instinctively lead to believe it will kill Python with a 1000 paper cuts.


So no dropbox, no firefox/chrome, no thunderbird, no whatsapp client, no telegram client, not git ?


You listed examples of free software and non-free software.

The former is much more likely to find a home on my devices.

I've found it limiting to not use WhatsApp, but not that much. It's kind of like if I knew someone who is known to stalk people, but we also have many friends in common. Maybe some friends won't come to my party, but I'm still not letting them into my house.


Those programs are all doing work on your computer. Therefore you install them on your computer.

The only reason to deny access to a website for other browsers is to get your own native software on the machine of the user.

If Google would deny access to a Google website with browsers other than Chrome, everybody would be mad at them.

There are a lot of angry posts about Googles websites being less optimized for Firefox than for Chrome.

Outright banning alternative browsers is what is happening here.


Mostly correct. Browsers can block ads, trackers, Javascript libraries, and elements at will using extensions. "Native" apps for web services, such as these Electron-wrapped clients, have full access to the trackers / analytics endpoints, and more. That's a big nono.


It's not watertight, but controlling your own DNS, as through pi-hole, helps protect against this.


Rather difficult to do that when on a phone.


Maybe you meant to illustrate how absurd such a stance would be, but in reality 5 of the 7 things you mention are an absolute non-starter for me.


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

Search: