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

So what google have done for the web with AMP, apple is doing to apps with clips?

I feel like this could be achieved with better HTML5 support from the iPhone and the promotion of light PWA instead.


Every time I read these comments I realize that apple is going to dominate again. A PWA is not vetted! If you complain about a PWA apple cannot take it down!

In your PWA / QR code utopia, after someone sticks a few bogus QR codes on parking meters, scooters and bike rentals etc that point to their phising PWA - trust is going to be toast.

Seriously - chrome getting rid of subdomains used to trick users (wellsfargo.securedomain.com) in the browser bar also generated lots of complaints - and also helps users.

Is this just a HN thing? Screw the 1B users who can't be bothered to become experts on every weird scam / original headers review etc? Because it get's a bit tiring on literally every thing that google / apple do.


> If you complain about a PWA apple cannot take it down!

Browsers already protect people against malicious sites.

You never saw Chrome warn you about it?


I don't think you realize how easy it is to setup a new website. The apple store doesn't have a lot of friction to sign up as a developer and get an app approved, but it has some. Websites are far far easier / quicker etc, and despite browser warnings phishing attacks continue to be very successful. This includes lots of creative options such as windows.net domains using azure cloud compute, cloudfront and CDN domains to host, content coming from places like dropbox, google sites etc.

We actually already know browser warnings are not enough because there continue to be incredible attack volumes in this area with malicious websites as landing pages.


As said elsewhere in this thread, Google already has a direct analog with Google Play Instant Apps.

Although I also wish Apple would put more than the bare minimum of support behind PWAs, from their perspective App Clips still have to go through the App Store vetting process, and therefore are (ostensibly) a safer choice than just granting more OS-level capabilities to PWAs.


You don't need OS-level capabilities to order a pizza.


Pattern matching is implemented as syntaxic sugar on top of if/else in the bytecode.

Behavior doesn't change at all.


Uhhh... yeah but that's true of almost every language feature, right? I love pattern matching but I think the point is that Python risks turning into a "kitchen sink" language with too many syntactical forms to keep in ones head if this continues.


I'm sure I think of a dozen python syntax trick most python devs do not not exist.

Python is good enough without them that they never had to learn them.

In fact, today I'm teaching "advanced python" to someone that has been coding in python for a year.

This person didn't know about list comprehensions.

I would not worry about that.


Sorry, are you trying to argue for or against the proposition that Python is on track to be straight-up more complicated than Perl 5 at this rate? Your tone suggests you think you're arguing against it, but all the evidence you're bringing is for the proposition.


Give me an always-on camera in your toilets.

Blur your face if you wish.

There is no danger for you. No data I can use against you.

Will you do it?

Most people would not.

What you decide to be private is, just because you decide it.

MS doesn't get to decide that.


It's not that easy. Take into consideration spreading of sensors like light/water/gas/sewerage meters, which report measurements to a central SCADA. I touched that around a decade ago, I had to build link with the meters with AT commands through GSM with modbus protocol on top of that.

These days it's a grown-ass market with competition and much more advanced toys involved. You turn on water, they know timings and how much you used. You use more electricity, they call you to suggest a different plan. You used drugs and flushed, they find metabolites in sewerage sensors (I heard that on news, dunno maybe bs).

So I think it's basically about bills; cameras in toilets are different market.


> glad to see this! though it's a shame that the proposed `match/case` is a statement, not an expression:

> no matching in lambdas unless those get overhauled too :(

Hate it or like it, but it's congruent with the rest of Python design.

Guido has been hostile with introducing too much FP in Python.

While I find it frustrating from time to time, espacially when I come back from another language to Python, on the long run, I must say I understand.

I don't like to work with FP languages, because unless your team is really good, the code ends up hard to read and debug. It's possible to make very beautiful code in FP, but it makes it so easy to create huge chains of abstract things.

And devs are not reasonable creatures. Give them a gun with 6 bullets, they'll shoot them all, and throw some stones once it's empty.

To me, the average dev is not responsible enought with code quality, and should not be trusted. I'm all for tooling enforcing as much as you can. Linters and formatters help a lot. But sometimes, language design limiting them is a god send.

I've seen the result with Python: you can put a math teacher, a biologist and frontend dev on their first backend project, and they will make something I can stand reading.


what do you think about if-expressions?

  x if cond else y
IMO match-expressions have basically the same benefits/trade-offs.


Match are usually much more complex than a single ternary condition. Allow to inline them and you will see monsters in the wild.

But I do wish they would have not set aside generalized unpacking.


> Allow to inline them and you will see monsters in the wild.

idk... you can write a huge ugly if-elif-else like this:

  a if foo else b if bar else c if quux else d
but most people just don't.


Ternary expressions are not covered by python code coverage tools by the way.


interesting! why not?


Bytecode tracing is new in 3.7, and nobody's used it in coverage.py yet.


So far I like it.

Unpacking was huge 10 years ago, but nowaday even JS has object destructuring, so python was lagging behind.

It feels like they really spent a lot of time in designing this: Python has clearly not be made for that, and they have to balance legacy design with the new feature.

I think the matching is a success in that regard, and the __match__ method is a great idea. The guards will be handy, while the '_' convention is finally something official. And thanks god for not doing the whole async/await debacle again. Breaking people's code is bad.

On the other hand, I understand the need for @sealed, but this is the kind of thing that shows that Python was not designed with type hints from the begining. Haskell devs must have a laught right now.

We can thank Guido for the PEG parser in 3.9 whichs allows him to co-author this as well.

I expect some ajustments to be made, because we will discover edge cases and performance issues, for sure. Maybe they'll change their mind on generalized unpacking: I do wish to be able to use that for dicts without having to create a whole block.

But all in all, I believe it will be the killer feature of 3.10, and while I didn't see the need to move from 3.7, walrus or not, 3.10 will be my next target for upgrade.


I prefer the PEP syntax: it looks like the instanciation of the object I'm trying to match, so it makes sense to me.


That's their entire point: you're _not_ instantiating the object you're trying to match.


I know.

It doesn't bother me since I see that match/case is a whole different context, I know I'm matching, and have no reason to instanciate anything here.

But since Foo(a=1) looks like instanciation, it's obvious to me what it's supposed to match.

I think that's one of the things that motivated to:

- use new keywords, but existing ones like "as", nor symbols;

- force 2 levels of indentation despite the cost of it.

This makes it very clear, with little effort, that the context is completly different.

It will make scanning the code easy, and avoid confusion.


Pattern matching traditionally resembles instantiation except potentially with wildcards, because the “pattern” in “pattern matching” is a object representation template in the same representation used elsewhere in the language.

Using a different syntax for pattern matching loses the main point of pattern matching.


And the counter-point is: you learn one time that it's not instantiation and remember it forever, and you get to resume reusing/overloading muscle-memory syntax to get the job done.


Crop.


Lisp is not popular.

Remove the browser practical monopoly, and JS popularity would vanish.


Browser monopoly led lots of devs to learn JS, then NodeJS showed that lots of devs want to keep using JS. It's actually possible for people to like it.

Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.


Nodejs showed that a lot of developers are lazy and want 1 language to learn


Not developers; businesses. What do you think a business would prefer: hiring cheap ubiquitous JS devs and using them interchangeably for frontend and backend work, or hiring/training devs separately for backend stacks like Java?


Certainly you didn't go through the entire pro con list of Node over other languages and go "it must be developer laziness!"

Easy to reason about, great performance for most cases, simple to debug and write code for, a plethora of libraries, easy to ship, no need to have different teams for backend/frontend, and minimal tooling needed.


The only really unique thing JS is bringing to the table is that it also has a privileged position in the front end. Your list of benefits it provides boils down to stuff multiple large languages all have, and the one thing that means you can learn just JS.

GP comment was presented somewhat snarkily, but I'm not sure they're all that wrong.


Yikes to see people assume so little about others. Why not ask people why they use Node instead of assuming the worst about them?

You don't think JS is obviously unique for its ubiquitous Promise, async/await, + async-everything abstraction. You tend to only get that in other languages (Rust, Python, Ruby) by limiting yourself to a fraction of the ecosystem.

Btw, what's lazy is making convenient uncharitable assumptions about others than just... asking.

This forum is full of people who could tell you why they still use JS after they analyze pros/cons of other languages.


I'm not entirely sure what you think I was saying. You refer to me assuming and being uncharitable in those assumptions, but I was responding to a specific list of items pointed out, and my own experience. I think you're actually assuming quite a bit about my comment.

> You don't think JS is obviously unique for its ubiquitous Promise, async/await, + async-everything abstraction. You tend to only get that in other languages (Rust, Python, Ruby) by limiting yourself to a fraction of the ecosystem.

A fraction like nodejs or whatever subset of NPM you decide to use?

Core JS is what you get in a browser. That includes async/await, but it's hardly ubiquitous in usage in the core.

The main distinction JS has over Perl, Python, Ruby etc is that it's in the browser, so you can assume almost everyone has it and it's accessible in some manner if they access a web property you are responsible for.


I believe people here don't belong to the situation I mentioned.

You are here because you are interested and want to learn. You probably know more than 1 language.

But that is not the general developer. Most developers are lazy and at the end of the day, want to go back to their wife and kids ( for example).


Yeah, and there's absolutely nothing wrong with that. It's the sign of a healthy work-life balance.

The real problem is that businesses don't want to train devs in the right tools for the jobs at hand, and are instead looking for the shortcut that will let them 'ship it'.


> Yeah, and there's absolutely nothing wrong with that. It's the sign of a healthy work-life balance.

I agree, never claimed otherwise.


Sure other languages have some pieces of the puzzle - python has tons of libraries and is easy to understand, golang has great performance and is easy to write, etc.

But I have yet to find a language that has the same set of features except JS. If you want to offer up an alternative, please do so.


JS has zero unique set of feature.

There is not a single feature in JS you can't find elsewhere, often better implemented.

If anything, the vast majority of scripting languages (Python, Ruby, PHP...) have more features than JS.

JS is so lacking in features that half of its ecosystem is dedicated to compensate for that (typescript, babel, webpack, undersacore...).


Sure and julia has the best matrices, python has the most flexible threading models, erlang has the best distributed runtime..

Yet one feature does not a language make. A language is the whole of it's behavior, and JS is a perfectly fine solution with a wide mix of good features.

Is it the fastest? No. The most performant? Not close. Does it have the best ability to write language parsers? No!

But it's not supposed to. It's a general purpose language that's well suited for a wide swath of cases.

Most languages have transpilers and utility libraries - and those are useful tools but also not meant to be part of a language. Even python has dozens of compilation tools depending on how you intend to distribute your code.

It's the mark of a poor intelligence that buys on pros only without considering cons. We must weigh not only our features but how well the average engineer can use it, how quickly we can produce features and how safe our code is, and how easily we can actually hire and train engineers.

JS is one of the most popular languages in the world. My 10 year old nephew can write it and do a decent job of it.


You're missing the point here, which is not that each of these languages has something JS does, it's that Perl, Python, Ruby etc all support all the same features, have large ecosystems of modules, are easy to use, etc.

JS is a fine language. It doesn't really bring anything new/different to the table (other than prototype inheritance, but that doesn't amount to much IMO), so the real differentiating factor is that it has a privileged position because of browsers.


JS has a great future: first class ubiquitous promise + async-everything. Can't find that in Ruby/Python/PHP, you have to use something like Twisted/asyncio which limits you to a bolted on subset of the ecosystem, unlike in JS.

Very dishonest take btw.

Here's a forum of people who could tell you why they use JS instead of your $favelang, yet instead of trying to figure it out, you just assume everyone is lazy or a junior dev except for you.

You should be a little more suspicious of convenient little truths like that where you're the cool elite engineer protagonist and everyone else is a bumbling idiot.

I use JS on the server. Any questions for me?


Go and Erlang (or Elixir) both have a better async model, and are pretty much better designed on all points.

So for the rare cases where async does matter (and they are a niche, given even big names like facebook code behind async proxy and do long polling), there are still little reason to choose JS.

I can't think of a single mission where, if I were not being forced to use it, I would chose it over something else. And I say that while coding a LOT of JS all year long. Even training people regularly in the language.

I double down on my initial statement, if tomorrow JS is removed from the browser, it would die in a few years.

It's a badly designed language that has been accumulated fixes over the years to make it acceptable while never removing what's bad. It was so initially bad that half the ecosystem of JS exists to not code in JS (typescript, coffeescript, babel, jsx, webpack...).

And it has received that much of attention because we had no choice. Google spent millions to make a technical marvel of a JIT to run it at decent speed.

Any tech that would have had half the resources poured into it would today be the incarnation of skynet.

It's a language surviving on artificial life support than can do so because it has the best blackmail game of all time.


>Any tech that would have had half the resources poured into it would today be the incarnation of skynet.

Java?


Good example.

The JVM is one of the most amazing piece of tech ever created. It's so good it supports not only what has been most the popular language in the world for years, but many newly popular languages like Kotlin or Closure. The perf have been optimized so much they are getting about 70% of C/C++, but with high level paradigms. It can pretty much do everything.

In fact, it runs on everything. It used to run on old school nokia phones. It runs on some credit cards! Despite being slowed down by patent trolling, Java found its way to more than half the modern mobile phones in the world throught Dalvik reimplementation.

It's everywhere.

Today, it is still ranking #2 on TIOBE and PYPL, despite having to leave with 2 decades of legacy design decisions and no monopoly.


No, I'm experienced with node and other programming languages. I never said NodeJS is a bad language, that is not related to the statement i made.

I also didn't say everyone is lazy. I said a lot of developers.

Most people here do not belong to that use-case. As they are mostly here by interest and are willing to learn.

But most people, after work, don't do anything with their knowledge.

And are more willing to learn node as it's the same on the backend + frontend.

Or keep using what they already know, with no interest for other languages.


> Easy to reason about,

I'd like to know what language you use as a baseline for this?

I made my first "real" Javascript code back in 2005 (a vector map system that worked in realtime) and I've been working mostly with frontend for the last 3 years so it is not lack of familiarity. In between that however I have programmed a lot of other languages, worked in a number of different teams, written new code, maintained old code and generally gotten some perspective on life.

That perspective has sent Javascript down my list of languages that are easy to reason about.


Event threading pulls out a huge amount of difficulty with semaphores, locks, thread safety, etc.

The lack of OO means no typecasting, inheritance models, interfaces, etc.

Arrays are fully dynamic, not type restricted and operate strictly by reference.

No memory mapping, manual garbage collection or even GC adjustments.

Suddenly the list of things someone has to understand to be a competent JS engineer is way smaller than a language like C or Java.

There are other languages that have a similar level of being easy to understand such as Python and Ruby, and they're good languages too but have a different set of tradeoffs.


Have my upvote for the serious answer. Let's just say we have different opinions.

Here's my attempt to create something similar from my perspective:

- Being able to know to at any point what a variable can contain is very liberating. (Ok, you can define a list of Object that behaves just like a list in JS: "fully dynamic, not type restricted", but thankfully for people like me that is not common in Java anymore.)

- Knowing that the compiler has my back allows me to work faster.

- My preferred languages (Java, C#, TypeScript) together with version control allows me to refactor fearlessly.


It's a tradeoff. Dynamic isn't "better" than typesafety, but it's generally easier to comprehend and reason about. Just yesterday, I was working on a C# script and encountered the following problem:

+ An engineer had written a script with a Dictionary of type <Transform, Material>. If you've touched Unity, you immediately caught the flaw: Transform's aren't unique enough keys and it's really easy to end up trying to add Duplicate keys, even though you really mean different objects.

+ So, since we don't care about uniqueness, shift from a Dictionary to a List. Except we have a problem, because we need to keep that Key->Value relation so we know what transforms get what materials. Well, we have a solution to that, it's yet-another-type called a KeyValuePair.

+ Well we're now nesting a generic KeyValuePair that needs type information inside of a list that is holding <KeyValuePair> objects, which also changes how we iterate through that list and add items to it.

+ In a language like JS, everything I just said doesn't matter at all because instead of using a Dictionary (Map in JS), we would of just said "Use a Set instead". Done.


> It's actually possible for people to like it.

If they started using PHP, without monopoly, they would not have switched to JS.

But plenty of people have switched from PHP to python or ruby.

> Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.

Python, C and Java are not.


I disagree on the current sentiment but agree that browser monopoly pushed js on people. If js didn't evolve over the last few years (since es5), I would have believed removing it from the browser would kill it.

Right now, you have options to avoid writing js at all. There might be some glue code in js but you can write vast majority of your code in other languages and target js. People still choose to write in js.

Purescript, elm, clojurescript, kotlin, bucklescript, and the list goes on. There is a to-js transpiler for every popular language. Why aren't they seeing more usage?


> Purescript, elm, clojurescript, kotlin, bucklescript, and the list goes on. There is a to-js transpiler for every popular language. Why aren't they seeing more usage?

Because a layer of indirection is a heavy price to pay.

If I could code in Python with zero cost in the browser, I would. Hell, I would code in Lua, Lisp or Ruby if that was the alternative.


Because for ecosystem and tooling JavaScript is the first class citizen. TypeScript was accepted as the defacto static typing system because it diverges so little, and valid JS is valid TS meaning example code can still be used close to verbatim.


tbh JS is popular only because of browser monopoly. JS became popular because of internet usage otherwise it would just die. It started with 1997 changed little at 1998 and 4th edition was even abandoned lol. and it took so long to evolve after that. in 2019 there was update and from 2015 we are seeing good progress. no we still cannot avoid because browser needs it. Hopefully wasm can replace but it still has long way to go.

So i don't subscribe to idea that js is not popular because of browser monopoly.


I am not disagreeing with that?


Indeed.

And if the teaching frees the student from that idea, then we can see that as an opportunity to give it a try.

But I can see how it could do harm if the teaching is also twisted to the point that it reinforces that idea.

Going mainstream almost always implies loosing something important in the process. It's hard to condence years of teaching in a few hours.


I think it may be because culturally we mix anger with the causes and consequences of anger.

Meditation can, little by little, albeit very slowly in my experience, decorrelate those 3.

I've seen it to result in meditators subject to a lot of anger:

- producing less anger

- maintaining anger for smaller amounts of time

- acting less dramatically over anger

And so it seems logical that people draw the conclusion that meditation tells you not to be angry. That angers it bad, or that you should control it.

To my knowledge, that's not the teaching.

Note that I think it's as good as a reason as any to start practicing. The practice will shift your point of you over time anyway. It's what it does.

And it will help with the suffering related to anger on the long run.

However, confusion can arise if people with little to no experience with meditation make quick judgement of the technic and build definitive ideas on top of that.

Appart from kindly explaining that it's a different story, there is not much one can do about it, though.


I believe meditation has taken too much oxygen from intellectual action e.g. writing exercises where you try to fully describe what is happening, the feelings, the causes, consequences and possible actions.

If you do this, you gain insight, empowerment and actionable plans. Meditation might claim something similar but I don’t think it delivers to the same degree.


Self-development in general is a very efficent excuse to avoid taking action.

You can certainly use "meditation" to work on yourself forever, in preparation for doing things, and never, ever, actually do anything.

But in itself, it's not the nature of meditation.

In a way, meditation share similarities with physical exercice.

Doing your morning run doesn't make you less fit to take action, make a plan or to apply critical thinking. I would say it's the opposite.

A lot of my most productive periods in my life are right after meditation retreats.

During those times, I use GTD a lot, to support my efforts. Writting, descripting, listing causes and consequences are in no way in competition with meditation.

To be frank, I don't know what could be in competition with meditation. It's pretty much orthogonal to everything by essence.


IME it does deliver. Not necessarily directly (like, you're not going to come up with an action plan white meditating), but, over time, it helps cultivate a state of mind where those things are easier to do.

I think it does take time, though, like between 1 week and 1 month of daily practice, to start noticing the effects.


I agree, but I'll add that in my opinion a writing exercise such as OP describes is half-way meditation anyways.

different activities involve different degrees of mindfulness, and I believe making a sharp distinction, while sometimes useful, is usually harmful.

You can take a shit mindfully, way I see it. it might not be something you call 'meditation' most of the time, but I imagine it's even possible to do a proper meditative shit.


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

Search: