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

There is a ton of money to be made if one can create a vcs for office.


Brave being webkit, it's not an alternative.


>Brave being webkit, it's not an alternative.

Brave is Blink not webkit - Blink has been developed by Google, Facebook, Microsoft, Intel and many others. It is the standard for web rendering just as linux is for web hosting. There is nothing wrong with open standards.


The fact you state blink is a standard is everything that is wrong with browser monoculture.

It's like we didn't learn anything from IE6.

Also blink is just a fork of webkit.


>everything that is wrong with browser monoculture

What exactly is wrong with open standards? Would you say linux creates a hosting monoculture? That's just ridiculous. Blink has been contributed to by just about every major tech company, that isn't a monoculture thats how open standards work.


Blink isn't a standard, it's an implementation of multiple standards.

An implementation cannot be a standard since a standard describes what a implementation needs to do while a implementation will need to both decide what parts of standards to implement and how to implement them and will do many things that are not described in standards. There are many behaviors, bugs and implementation details of Blink that should not and cannot be part of a standard.

As soon as a implementation becomes a standard we get ossification and implementation bugs in the standard as the only way to conform to the standard is the exact original implementation.

Besides all that while Blink has contributors from many individuals and companies it is clear that google steers the ship.

The web standards were built on the idea that multiple independent implementations were crucial, and it is a required step for a proposal to become a standard.

Linux isn't a standard either, the standard in that case would be POSIX and linux is "Mostly POSIX-compliant".


> What exactly is wrong with open standards?

Nothing, but Blink isn't one.

> Would you say linux creates a hosting monoculture?

Yes, obviously. The GNU/Linux hegemony is a pet peeve of mine, especially because it breeds this absurd "well the most common implementation does X, so screw everyone else" mindset that needlessly hinders alternatives.


[flagged]


[flagged]


There's no call for ad hominems.


It's not as open as one would think. The corporations have too much control over it that if someone forks it, they will be left behind. Check how syncing was disabled in chromium recently.


>if someone forks it, they will be left behind

Is gecko any different in this regard? That is how forking works.

>The corporations have too much control over it

Blink seems better in this regard, it has received major contributions from just about every major tech company out there diversifying its control. Gecko has been primarily just mozilla (especially these days since it only represents about 3% of the market).


So the worst and most powerful IT corporations in the world spreading their vision as a world standard VS a non profit offering ecosystem diversity ?

I guess I lost my touch, I've been feeding the troll.


>a non profit offering ecosystem diversity

You mean mozilia where over 70% of their revenue is from google?

https://www.ghacks.net/2020/12/10/mozillas-revenue-jumped-to...


Blink is in no way an "open standard"


A trap for your dream world were you suddenly get google size ?

Because I have a 1 million unique users video streaming service still running python 2.7, using a few servers. The thing has a mobile version serving a different media on the fly, encodes user uploaded videos, features comments, tagging, and even has machine learning detection of content now.

It is still maintained by one single person, and he is not a professional dev.

And I'd say it's already very rare to reach that size in any project, in any company. Hell my last 3 paid projects as a freelancer have less than 20 concurrent users. And that's professional. That's people's real life.

2 out of 3 IT projects fail, no code is even shipped. I would worry about the scaling later. Once you do have the problem, pay the price for more hardware or a rewrite, you made it!

And if you do know for sure you will have the problem (you already work for a GAFAM), then not choosing python is ok, it's not a trap, it's a trade off.

But for the vast majority of us out there, having an easy, solid, battle tested and clean language with a huge ecosystem is worth a 10000 times more than some scaling potential in 5 years down the road.

I have seen so many big C++ or Java project fail I don't associate any language with big and failure anyway. I've seen devs arguing about the purity of this in Haskell, or that in Ocaml, and nothing gets to the end user because it's never perfect, or it's a toy, and doesn't handle IRL.

But what powers most companies ? Rail apps that you won't upgrade ever, but are still running. Spaghetti PHP code and wordpress that just won't dies. Horrible SAP scripts, VBA macros and excel sheets that actually deal with your real data.

Because they shipped. They did the job.


I haven't worked at Google's scale, but I've heard a lot of critism about tools and programming languages from people who create architectures that are inherently slow. When a user login requires 8 http calls to distinct microservices or something else silly like that the problem isn't a lack of static types. So far in my career I haven't had a programming language ever be the reason why something can't scale, most often the problem is the initial developers lacking a understanding of relational databases and cache locality.


It's a variation on cargo cult; you WISH you had the scaling problems that could be solved by using something a bit more performant.

But solve the problem first, and solve it fast. It's why so many startups from the 2010's on used Ruby; they were productive in it, solving a real problem, rolling out features fast.

I've worked in a few projects where they dove onto the cargo cult, of wishing they had the kind of requests and load that e.g. a microservices architecture might help with. Massively overpriced projects too, because they hired lots of consultants and self-employed people.

The one time there was a guy who rocked up in a Maserati (used, lol); he took two weeks to build a page that was just a centered bit of text and a button, and it didn't even work.


Also, a lot of developers forget to it, but even if you start with a fast language down the line you will end up rewriting it. The problem is that requirements change a lot and because of that your application will often end up being a mess. For similar reason RDBMS is also better than NoSQL when starting a project.

When rewriting you already know how the project is now, so you can design your app around that, which makes things simpler and faster.


Just write a stateless app tier. Doesn't matter what language you use at that point if you need to scale it out.

It doesn't require any extra work either. Just requires knowing what you're doing.


> Because I have a 1 million unique users video streaming service still running python 2.7, using a few servers.

Congratulations.

•How many servers 2, 5, 10?

•How many pure python libraries did you have to replace with a Cython extension after you realized that it cannot support your scale?

•How many external dependencies? How many of them did you replace after they were abandoned? Surely not all actively developed library are still using Python2.7.

> It is still maintained by one single person, and he is not a professional dev.

So he cannot upgrade the project to Python3.x along with all matching dependencies either, So the project stays with all bugs and vulnerabilities.

Not everyone would be happy with such a setup and aforementioned drawbacks, that's why I think the parent comment says Python is a trap at scale and I concur. I've faced issues at at scale (few hundred thousand) and there's no way a python project can meet that scale without relying upon Cython dependencies.

> A trap for your dream world were you suddenly get google size ?

So only Google size is a benchmark for scale? If I were to start a web project which has just 10 concurrent users I would choose Go because I know I can develop the entire project with little to no dependencies, it can scale to N users without touching the code and with the confidence that the number of servers required will be < than that of python.

I still use Python every day, for where it's good i.e. small scripts for personal use, prototyping algorithms. For professional products I use Python only as an Machine Learning endpoint(With all the bandages) because I have no other choice.


> •How many servers 2, 5, 10?

7

But the question is rather, whats the cost / ratio ? The 7 servers costs 7 less times money that they bring. The solo dev makes $150k/years with it, and doesn't need to work full time, have flexible hours and its own business.

> How many pure python libraries did you have to replace with a Cython extension after you realized that it cannot support your scale?

Many. Being extensible with compiled extension is a feature of Python. Numpy and co are part of the ecosystem. That's an awesome thing about it: I can code in Python and get c speed anyway.

> •How many external dependencies? How many of them did you replace after they were abandoned? Surely not all actively developed library are still using Python2.7.

Many. And the project still runs, with so little resource, bring the money in and serve its purpose, after 10 years of service.

> So he cannot upgrade the project to Python3.x along with all matching dependencies either, So the project stays with all bugs and vulnerabilities.

Sure he can, it's just an expense he won't do. Bugs are workaround, vulnerabilities are shielded by other parts of the system. Essential things like injections are dealt with. Some trade off are made, like always.

> So only Google size is a benchmark for scale? If I were to start a web project which has just 10 concurrent users I would choose Go because I know I can develop the entire project with little to no dependencies,

No you can't. Not if you want the first version to come out in a few months. Because you need a scrapper, and a bdd, and registration, and auth, and permissions, and screenshotting, and upload, and videos encoding, with background tasks, and load balancing all the videos and pics, tagging, i18n, xss protection, and search, etc. So either you pay to use cloud services to do all those things for you, or you leverage a rich ecosystem. Or you take a year to do it. Even if Go were the best language in the world, it can't beat 10 years of django plugins, 25 years of python modules and the iterative speed of a dynamic syntax. Well, it can, with AWS :)

In fact, Go is a very niche language. If you take it out of the I/O and concurrency specialty, it's quite average. Rust is better at raw perfs. At same perf, java has a better ecosystem. For simplicity and easy compilation, you have nim and zig that are more expressive. Resilience ? Erlang. And for speed of dev, python is better.

So for our use case it is not were it would shine, because:

> it can scale to N users without touching the code and with the confidence that the number of servers required will be < than that of python.

1 server only run the python code, the others are for the video hosting and the db. Python is not the bottleneck in this site. It almost never is in web dev. nginx serves the content, postgres and redis deals with the data.


Even faster for 0->1, use Javascript, big ecosystem as Python but same language in front-end and back-end. Faster runtime also.


There are still no "rails" or "django" for JS. There are frameworks emerging with the same features, but they don't have close to the ecosystem. Meaning every time you want auth, social integration, etc. you have to reinvent the wheel.

There is also the stdlib. JS doesn't have simple things built in like left trim a string, csv loading, uuid generation, etc.

Then there is the API. Sorting in JS requires this weird -1/1 function. Getting the last element or truthiness to manipulate length.

Suddenly not only you have to install tons of things, but libs and frameworks can't rely on a common ground, nothing seems to integrate well. You glue a lot of things manually.

The popularity of JS is because it has a monopoly on the browser, and so a lot of people must use it, and a lot of users know it by default, and look for it elsewhere.

But when you have Ruby, Python, or even modern PHP frameworks in front of it, it's not a great deal.

Of course, not all programming tasks are about the Web. And this is where JS collapses completely. Sysadmin, data analysis, pen testing or automation using JS is a pain compared to the fluent versatility of alternatives. You know, things like connect to this ftp, download the excel files every hour, put the average of every column in the mysql db then export the thing as a PDF and send that to the boss.


>There is also the stdlib. JS doesn't have simple things built in like left trim a string,

Or left pad.

https://www.google.com/search?q=left+pad+js

left-pad as a service

https://news.ycombinator.com/item?id=11352315

https://news.ycombinator.com/item?id=11350651

https://news.ycombinator.com/item?id=11354770


Depends. Mainly on what libraries you can make use of. For anything numerical or also ETL processes that deal with various document formats python is way more mature.


Since you don't know if your product will workout and you want to go fast you use a third-party service first. Of course, for some type of stuff, you might have to go with python but if both can equally do the job well in the backend and you need a web[mobile] frontend the...


Many (most?) web projects allow hiding performance issues by scaling horizontally, caching and offloading work to native implementations where necessary (like video encoding). Python can work great in such circumstances.

The best testament to this is the reality that popular web services were able to limp along on a slow language for a long time before they had to rewrite their code.

But if one is doing something that requires raw power or precise control over resources, or precise timing then not choosing Python is not merely a tradeoff to be considered, but an obvious architecture decision.


link to the site ?


That's because:

- speeds matters of that level matters only for a limited number of use cases. Most programming use cases are fine with python speed. They were fine, in fact, with it 20 years ago, before we got that hardware speed.

- people are starting to complain about speed in python only because of all the data science going up. Suddenly here speed matters. Before, you had to get to google level of infra to find use cases where python was too slow.

- dev are expensive. Hardware is cheap. If you have a slow website, paying $200 dollar more on your server is not a big deal. But taking 3 more month dev that features with your $300k pro is another thing entirely.


It does a lot of basic things right:

- iterators everywhere

- context managers

- generators

- namespaces

- powerful function arguments

- a good stdlib

- unicode handling

- string formatting

It's easy to get started, and then to get going.

Turns out a lot of people value that.


Use shiv: http://shiv.readthedocs.io

Installs are now an scp.

Now of course, you gotta remember that installing something is usually more than copying the code, and there is nothing to help you with that, in any language.

Welcome to the world of deployment, which is why things like ansible and docker exist.


It's not that easy actually.

Python already does so much for you, and provides so much tooling to do even more, it's hard to write bad code if your daily job is to be a coder.

The iterator protocol means you rarely get off by one errors, context managers and GC deals with resource handling, the GIL, for all its faults, helps a lot of concurrency errors...

Now, add a good IDE, and syntax errors, names errors and attribute errors go away. Play a little in the REPL, and use cases become more obvious, behaviors more clear.

Want more security? You can add type hints and unit tests (which are incredibly easy to write, thanks to pytest).

Even without all that, the size of the ecosystem means you won't write most of the code anyway, and less code, means less potential for mistakes. Adds to that the language bare bone syntax, and you really has something that actively helps with writing good code.

Not to say you can't write bad code in Python, but unless you are not a professional dev (in that case, you can write bad code in any lang), you have a lot to help you there.


Not to mention facebook leaders don't care, they already made billions by misbehaving without any consequence. Even if the story did end there, it's 100% win for them.

This is the lesson of our generation: makes money by delegating the consequences to society. Nothing will happen to you. In fact, in 20 years, you could buy the service of some PR firm, and they will even make you a hero in the eyes of the public eventually.


I mean, they abuse the system like dictators "abuse" guns to kill people.

If you have a company selling a weapon, it's pretty obvious it's going to be used to harm. That's by design.

And just like we were never able to prevent the guns to arrive in the hand of the wrong people, or make sure people using guns respect any kind of rules, why would we expect NSO clients to be well filtered and behaved?


God invented man, Sam Colt made them equal.

If you are a 40 year old, inactive person, try defending yourself against a knife or a club, especially against a younger person who has had experience using it.

"Harm" is a loaded word.


The for loop in python is a try/except catching StopIteration in a trench coat.

Also, EAFP, and the context manager protocol.


But that is what I meant, this StopIteration would not be affected by the zero cost optimization. The zero cost optimization is about compiled Python bytecode and the VM interpreter. The StopIteration is handled internally by CPython (not via Python bytecode).

For example, consider this function:

    def foo():
        for i in range(3):
            print(i)
There is no try-except in this code, and neither in its bytecode. So this is not affected by the zero cost optimization from the linked issue.

The bytecode is this:

  2           0 LOAD_GLOBAL              0 (range)
              2 LOAD_CONST               1 (3)
              4 CALL_FUNCTION            1
              6 GET_ITER
        >>    8 FOR_ITER                12 (to 22)
             10 STORE_FAST               0 (i)

  3          12 LOAD_GLOBAL              1 (print)
             14 LOAD_FAST                0 (i)
             16 CALL_FUNCTION            1
             18 POP_TOP
             20 JUMP_ABSOLUTE            8
        >>   22 LOAD_CONST               0 (None)
             24 RETURN_VALUE
The iteration logic is inside the `FOR_ITER` op. And that is purely handled inside CPython.

Also, this is again what I meant: In user code, you rarely would use custom exceptions for control flow. Please show me any example where you have seen otherwise.

So, again, what I wrote: I'm very confident that for most user code, the code path under `except ...:` is only rarely executed. Please show me any big Python project where this would not be the case. I doubt that there is any.

Also, btw, on EAFP, Guido van Rossum disagrees: https://mail.python.org/pipermail/python-dev/2014-March/1331...


> The for loop in python is a try/except catching StopIteration in a trench coat.

That's...horrifying, both from a computational efficiency perspective (due to the overhead of exceptions) and from a "beauty" perspective (exceptions are supposed to be exceptional, darn it!). Why is it implemented this way? Why not just use a normal loop and check a return value from the iterator?


exceptions are supposed to be exceptional, darn it

This feeling is at odds with what is generally considered idiomatic Python, for better or worse.

Upthread BiteCode mentioned EAFP. See, for example: https://devblogs.microsoft.com/python/idiomatic-python-eafp-...

(It's certainly not unanimous. Guido himself is on the record as saying EAFP isn't better than LBYL, but in most of the Python I've cruised through these last umpteen years [that wasn't some other language written in Python], I've certainly seen an overall preference for EAFP. Naturally YMMV.)


I think that implies that either "exceptions" are misnamed in Python (as in every other language with that name, they're meant to be exactly that - exceptional - so whatever Python calls "exceptions" isn't the same as in other languages), or that that particular idiom is wrong, and needs to be rethought.


> Why not just use a normal loop and check a return value from the iterator?

Because an iterator needs to be able to return any python value, and if you did that, there would be at least one python value that an iterator could not actually return.

Unless you required the iterator to wrap real return values in a container (basically, an optional/maybe monad) but then you have unwrapping overhead on every real return value, which is worse.


Couldn't the runtime just allocate a specific Python object representing the case where the iterator is complete? Make that object implementation-specific, hide it as best as you can, write documentation stating that users should not use this value directly, and if they do - they voided the warranty, and should expect evil to befall them. (ultimately, you can't prevent the user from doing really dumb things e.g. editing the Python binary directly)


You do that with one thing, okay, maybe it works.

You do that with two or more of the protocols that Python has that use return values for return values ans exceptions for flow control signals and...you make it a lot harder to work with them, especially in conjunction.


Can you give an example of this? I can't think of any myself - generators also raise a StopIteration exception, for instance, so they could use the same value.


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

Search: