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

Well, if you have a 100 billions of dollar that sits doing nothing like Apple does, spending it to get a new competitive advantage may make sense. They can do what no other computer manufacturers can no in that position.


Those billions are made from iPhone sales. Lenovo, Dell and HP don't make billions from selling phones.

And the move to ARM isn't guaranteed to bring them more sales. Customers might dislike it and software makers might dislike it.


But the stack in JS is a terrible burden in itself, and people only accept it because we have no realistic alternative to JS on the most popular plateform in the world: the web browser.

PHP doesn't have this accidental monopoly: you can use a language that doesn't require discipline and tooling to make something decent.

Bottom line, PHP is better than it used to be. But the technical debt remains, and it's easy to avoid if you can, so we do.

I started with PHP, but I have no reason to go back to it. It has no benefit and is worth it only if you have already a massive PHP code base, or a pool of PHP devs you need to employ.


If you know a magical language that can result in excellent code without discipline, I'm all ears.


I don't know of a magical language that can result in excellent code without discipline. But languages do vary significantly in how hard it is to take non-excellent code written without discipline and safely make it better code. The dynamic scripting languages are on the bottom of that list; all the freedom they enable also simultaneously make that harder.

This is probably the best way to understand the increasing push towards static types lately. It isn't so much necessarily the experience of writing the code the first time, where static types may at least sometimes indeed be a bit harder to work with. It's that it's a relatively easy to work with code that takes a list of OrderIDs and CustomerIDs and returns a map of CustomerID -> Order, and calls a function that takes an OrderID and yields an Order, a method that takes an Order and yields a Customer structure, and a method that takes a Customer and yields a CustomerID, and finally constructs exactly the promised structure. You can change it and feel pretty good about what's going on and what's going to happen both to the code it calls and the code that call it.

On the other hand, working with code that takes a something and a something and returns a something, calling a function that takes as something and yields a something, another function that yields a something and a something, and a method on one of those somethings that takes a something and yields and something, and then returns something, is harder to work with, before we even talk about the fact that these somethings may have no literal source code existence because there were dynamically assembled, and after the somethings were dynamically assembled, other somethings may have come along and turned those somethings into something else.

Obviously, the first case still isn't heavenly and the second case isn't as bad as I make it sound in this brief summary, but there's still a real difference.


I think the spirit of their argument is that there are plenty of languages with more benefits from an engineering standpoint and fewer downsides. Static typing, cleanser language construction, etc.


Genuine question: why would you want that? Isn't that the role of the file system or the data transport?


I understand the hate for snap (and flatpak) and I personally use deb as much as I can, but they are the right move.

Yes, right now it's a subpar experience.

But you need to deploy it now to be able to improve on it and have it as the default in the future.

And I believe it's a better future, because:

- packaging a deb is difficult. I've done it, and it's a lot of complicated hard work you get to repeat for every release for anything that is not a simple program. Snap and flatpak are very easy to build and support accross releases. This will increase the number of software that will be provided to Linux. In fact, it already has.

- the permissions model we have on our phones is very hard to replicate on Linux, yet something like this proves more and more necessary. SELinux and Apparmor are too low level. Snap and flatpak make it easy to make sandboxed app and request permissions by abstracting those. What's more, they make it ovious for the user to know that the apps it uses are sandboxed and the permissions they use.

It will take a few years before we get a streamlined experience with snap and flatpak, and it will be at the cost of a bit of performance and disk space. For now they feel bloated, are not necessarily more secure, and are less well integrated.

But in the end, it will make the Linux ecosystem more user friendly.


I think Snap is a great way forward. I get the argument that shared libraries let you update one package to get a fix for the entire system without relying on any number of maintainers to independently stay on top of security issues, but in practice it doesn't work all that well and makes things more complicated. Maybe Nix improves this; I've been meaning to play with it for years.

From a distributor perspective, I love that it was simple and publishing at https://snapcraft.io/cyph gets us on every distro with no hassle. The alternative was likely not supporting Linux at all right away, or at best supporting a couple distros and requiring more work on the user end.


> packaging a deb is difficult. I've done it, and it's a lot of complicated hard work you get to repeat for every release for anything that is not a simple program

Right, but the point of a high-quality distribution is that this complicated hard work only needs to be done once (per package, updated for upstream changes obviously) by your distribution's package maintainer. Then it scales for free. That's the beauty.


> Right, but the point of a high-quality distribution is that this complicated hard work only needs to be done once (per package, updated for upstream changes obviously) by your distribution's package maintainer.

Sure it works for a sysadmin, but it's not matching at all how regular people are using their computer.

It means you can only use packages that are part of the official repo and:

- it's hard to get in those official repo

- it takes a lot of time

- it assumes free software

- if your app embeds its own dependancies, it's usually rejected by default

- it's a bottleneck for publication (the repo team is limited in resources)

- you have no control over updates

- you can't make people pay for software that are in those repos

- you may want/need to package the software yourself or for yourself

On my computer I have a huge number of softwares that I have not installed from the repos:

puslsms, vscode, telegram, dynalist, veracrypt, signal, discord, antidote, bitwarden firefox developper, guitar, stremio, pop corn time, dukto, photoflare, sublime text, table plus and sublime merge

I think using the simple act of spreading this argument is a demonstration of how remote one can get from the vast diversity of the user base.


Snaps solve the problems caused by users installing from third party apt repositories. Users do that today. Comparing against the virtues of distribution-provided packages is a strawman.

The exception is distribution packages like Chromium and Firefox. These don't work well in deb format, because users expect the latest upstream updates after the distribution releases, but upstreams add dependencies creating dependency hell for packagers. Snaps work better for this case.


Deveroper/packager productivity matters a lot, as people will then bother to package more nice things and keep those packages up to date. It's bad for everyone if packaging is needlessly hard.

Also the sw engineering world is clearly moving away from packaging as "integate application into distro X version set of library versions by continuously expending a lot of integration engineering effort" and more towards things like docker images, snap/flatpak/appimage that sidestep the problem of host platform component dependencies as much as possible.


But your distribution's package maintainer has limited bandwidth, there's only so much software they can support. At some point you need a way for developers to do it themselves.


I agree with almost everything you say, and, yes, people used IIS, windows, as webservers, only not-long ago, so, let's hope for progress. Totally agreed.


I don't see what that has to do with the post you replied to.


I'll enlighten you. About twenty years ago people used IIS for web-servers, encumbered in costly licenses, for everything, and progress goes on. That's the point man. Time goes on, and things gets better. Hope you see now. That was the point, anyways. I really hope it helps.

Progress goes on is just the general point. Nothing else intended. Should be clear enough.


Lots of people still use IIS for web servers


parent is joking around but I got curious and wanted some data on this and found rather surprisingly that IIS isn’t doing so well these days and seemed to have dropped even more in the last year:

https://news.netcraft.com/archives/2020/04/08/april-2020-web...

https://news.netcraft.com/archives/2019/04/22/april-2019-web...


Yeah I was just being an asshole. Didn't really mean to thrash on ISS or anything. Just being dumb.


For even more fun, use async def + await, and you save yourself the while loop since that what the asyncio.run() does for you.


asyncio will get confused as to why youre yielding random things and it won't work


No, you just wrap it in a Future.


So now you have even more confusing code. Good work!


Besides, serious projects in Go do use additional tools for creating task queues because they need to handle various stages of persistence, error handling, serialization, workflow, etc. Which are not stuff you want to write by hand yourself.

If you don't need all that, then it's not a problem in Python either. You don't even need asyncio, you can just use a ThreadPool or a ProcessPool, dump stuff with pickle/shelve/sqlite3 and be on your way.


> In most other languages you can get away with just running tasks in the background for a really long time before you need spin up a distributed task queue

In Python too:

    # or ThreadPoolExecutor depending of the type of work
    from concurrent.futures import ProcessPoolExecutor, as_completed

    with ProcessPoolExecutor(max_workers=2) as executor:

        a = executor.submit(any_function)
        b = executor.submit(any_function)

        for future in as_completed((a, b)):
            print(future.result())
Any task you would put in celery would be a good candidate for being first passed to a process pool executor.

No, the real reason we use celery is that it solves many problems at once:

  - it features configurable task queues with priorities
 
  - it comes as an independent service accessible from multiple processes

  - its activity can be inspected and monitored with stuff like flower

  - it has the ability to create persistent queues that survive restart

  - error handling is backed in, they are logged and won't break your process
 
  - it offers an optional result backend for persisting results and errors
 
  - many distribution and error handling strategies can be configured

  - tasks are composable, can depend on each others or be grouped

  - celery also does recurring tasks, and better than cron

  - you can start tasks from other languages than Python
Now some People use celery when they should use a ProcessPool, because they don't know it exists. But that's hardly because of the language: you didn't seem to know about it either.

It is true that Python concurrency story is not comparable to something like Go, Erlang or Rust, but very common use cases are solved.

In the same way, we can perfectly use shelves instead of redis.

We use redis beacuse it solves many problems at once:

    - it's very performant on a single machine, and can be load balanced if needed

    - it has expiration baked in

    - it offers many powerful data structures 

    - it embeds numerous strategies to deal with persistence and resilience

    - it's accessible from multiple processes, and multiple languages

    - its ecosystem is great, and it's hugely versatile
It's almost never a bad choice to add redis for your website. It's easy to setup, cheap to run, and and it shines to manage sessions and caching for any service with up to a few million users a day.

Once you are at it, why not later use it for other stuff, like storing the result of background tasks, log stream, geographical pin pointing, hyperlolog stats, etc. ? There are so many things it does better than your DBMS, faster, easier or for less resources.

It's such fantastic software really.

But no, nothing prevents you in Python to create a queue manually and serialize it manually. It's just more work for less features.


Thanks, I am well aware of every kind of multiprocessing and quasi-threading in the standard library, having built several large Python systems over the years.

I also understand the benefits of task queues. However, there are many cases in which you do not need any of those. Specifically, everything you wrote applies to the web backend/distributed systems usecase. Doing things in the background in a simple application, not so much. My problem is exactly with introducing distributed systems machinery for a local process on a single machine that doesn't need any of that.


With all those websites preventing you to use tor, you can use tor to connect to this, and this to connect to whatever you need.


You can also set up a SOCKS proxy on a much cheaper basic VPS as well, giving you the advantage of using a web browser on your local computer instead of dealing with the overhead of a completely virtualized desktop.


> I guess to flip the question, what's the benefit of using a static HTML file over React, other than a 10kb footprint?

KISS


100% agree - bringing in a framework for a landing page is insane to me in regards to pushing dependencies where they don't belong.

In this conversation I have yet to see one solid argument for inclusion of React on a landing page outside of "it can help the developers pivot to landing page + something else". Sure I can sorta see this, but if you're an engineer who decides on major dependency inclusions based on what may happen you're over-engineering (ESPECIALLY in regards to a landing page).


This is one of the reason I don't like to put application logic directly in the database.

It makes everything harder: caching, testing, abstracting, balancing, etc.


Where do you draw the line between a query and application logic? Does a join or aggregate function count as application logic?

On another note, a few hours/days spent implementing application code can save you 5 minutes of writing SQL.


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

Search: