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

Python can actually do this using "# coding:", albeit less elegantly than lisp.

I would say it's a good thing, I don't want to see a hundred of half baked, badly tested and vaguely document DSL with no decent tooling support.


That's probably an argument for a language with good DSL support.

When this comes up I usually link to the work of Alan Kay and others (the very mystical sounding STEPS project at VPRI)

""" The big breakthrough is making it easy to create new DSLs for any situation. Every area of the OS has its own language (and you can just add more if you feel the need) so that the whole OS including networking and GUI is very compact, understandable, and hackable. This particular project focused on compactness, just to prove that it is quantitatively more expressive. """

comment by sp332 https://news.ycombinator.com/item?id=11687952

final report from 2016 https://news.ycombinator.com/item?id=11686325


Can you provide some more info / links regarding the “# coding:” feature? I wasn’t able to find anything.


Codecs (https://docs.python.org/3/library/codecs.html) can change the content of the file on the fly. You can abuse that to create new syntax, although it is evidently not the original intent.

Let's say you hate significative spaces, here is a (very fragile) PoC for your pain:

https://0bin.net/paste/42AQCTIC#dLEscW0rWQbE70cdnVCCiY72VuJw...

Import that into a *.pth file in your venv, and you can then do:

    # coding: braces_indent
 
    def main() {
        print("Hello, World!")
        if True {
            print("This is indented using braces.")
        }
    }
You also can use import hooks (python ideas does that), bytecode manipulations (pytest does that) or use the ctypes module (forbiddenfruit does that).

Still, I'm very happy it stays limited to super specific niches. Big power, big responsibilities, and all that.


The idea is you can register a custom file encoding, analogous to built-in file encodings like utf-8, and use it to transform the source file before python loads it. An example is pyxl, kind of like jsx, where you put `# coding: pyxl` at the top and then it will transform bare `<html>` in the python file into calls to a template builder: https://github.com/gvanrossum/pyxl3

Incidentally this turns out to be super hard to search for without asking an LLM, since "python coding" is so overloaded, and using the feature this way is intentionally undocumented because it's not really what it's for, and not something I think most python users really want to encourage. So, forbidden python knowledge!


It's specified in PEP 263 [0] which pulls up easier on search if you quote it and include the typical "special comment symbol" -*- around it.

[0]: https://peps.python.org/pep-0263/


If you place `# coding: utf-8` on the first line of a Python script, it'll try to interpret the raw bytes contained later in the file by passing them through a relevant codec[1]. Since the codec receives the raw source and transforms it before any interpretation happens, you can (here's the point I'm starting to guess) supply a codec that parses the code, transforms the AST, and dumps it back to the source for execution. It would be similar to how "parse transforms" work in Erlang, though there you're handed AST and not bytes.

[1] https://docs.python.org/3/library/codecs.html


>how "parse transforms" work in Erlang, though there you're handed AST and not bytes.

Oh, I didn't know about this. Was thinking about doing something similar in my own language, so I'll have to check that out.


Continuous inflation without raised salaries means exactly the opposite of this.

I ran a python script the other day using the French state data on pricing. Minimal wage was about 1000 euros after tax in 2003, and is 1300 in 2023. But 1000 in 2003 is about 2300 euros in 2023 according to the same official data.

I don't know a single vital thing in my life that is not more expensive now than when I was a kid: food, water, energy, shelter, clothes, health... They are all more expensive.

Now sure, internet access is less expensive and better, but you can't eat wifi.


Why would one expect those things to not be more expensive? Governments explicitly and intentionally manipulate currency so that prices (overall) are on an upward march.

Also, comparing changes in income deciles over time would be more useful than minimum wage changes, as legislatures are not necessarily reacting in real time.

> food, water, energy, shelter, clothes, health

Many of these are things where technological advances resulting in greater and greater economies of scale plateaued, or where technological advances mean that your expectation of the quality of goods or service greatly increased.

The former would be water/energy/shelter/food/clothes. The world has a lot more people competing for these resources, but there was no commensurate increase in supply.

The latter would be health, where the healthcare from your childhood is a greatly different product (at the advanced levels, not necessarily the routine checkup or flu visit).


Given that prices for health in the US are exorbitant because they are based on the free market and the prices in France much cheaper (even when you pay 100% of of pocket) because the market is state controled, I have a hard time to take your comment seriously.

But I'm sure you will find a reason while health is an exception.


We'll never know if prices would be exorbitant under a free market in the US because we've got a nasty mix of corrupt insurance companies, healthcare administrators, and political lobbying (bribery) keeping it from being a free market. Generally we can't even ask the price of a procedure with which to compare providers, and for most insurance, you can't even choose your provider anyways. Does that sound like a free market to you?!?

As the other poster pointed out: Your logic is flawed because your premise is wrong. If the US had state controlled medical, I have no doubt our politicians would figure out some way to ruin that too.


> But I'm sure you will find a reason while health is an exception.

Pretty easy to find an exception when you start with a false premise.

> Given that prices for health in the US are exorbitant because they are based on the free market


Unchecked capitalism trys hard to turn into feudalism.


France, a state with famously unchecked capitalism bordering on libertarian anarcho-capitalism.


Why something so strong and not melatonin?

Real question, never tried any.


Melatonin isn't a sleep drug. It's something your brain makes naturally at the end of the day when it gets dark etc. As I understand it, it's part of your bio clock and is not much more than your brain telling your body it's time to go to sleep. But if you're on a plane and you're nervous about flying, you won't fall asleep any more than in any other situation where you're nervous and not lying in your bed. You don't necessarily need something stronger, you need something different.


I am sorry, melatonin doesn't really do anything. It might give some the extra "kick" to fall asleep in a relaxed situation at home, but it definitely is not useful for "I need to go asleep while being pretty wound up" which is what people are talking here.


One not-oft-mentioned thing melatonin seems to do (at least in my own experience) is that it cancels out the effects of earlier-consumed caffeine in preventing sleep. So if you're overtired and awake only because of caffeine, melatonin will put you out pretty quickly.


Specifically, whitelisting the URL for the bot protection, but not the cache, so that you are still somewhat protected against adversarial use.


An adversary can easily send no-cache headers to bust the cache.


The CDN can choose whether to honor those. That hasn’t been an effective adversarial technique since the turn of the century.


does cloudflare give such an option? Even for non-paid accounts?


They ignore request cache control headers, I believe unconditionally so you’d have to disable caching for the endpoints which clients are allowed to request uncached.


Cloudflare is a fantastic service with an unmatched value proposition, but it's unfortunately slowly killing web privacy, with 1000s paper cuts.

Another problem is "resist fingerprinting" prevents some canvas processing, and many websites like bluesky, linked in or substack uses canvas to handle image upload, so your images appear to be stripes of pixel.

Then you have mobile apps that just don't run if you don't have a google account, like chatgpt's native app.

I understand why people give up, trying to fight for your privacy is an uphill battle with no end in sight.


> Then you have mobile apps that just don't run if you don't have a google account, like chatgpt's native app.

Is that true? At least on iOS you can log into the ChatGPT with same email/password as the website.

I never use Google login for stuff and ChatGPT works fine for me.


See other comment.


The privacy battle has to be at the legal layer. GDPR is far from perfect (bureaucratic and unclear with weak enforcement), but it's a step in the right direction.

In an adversarial environment, especially with both AI scrapers and AI posters, websites have to be able to identify and ban persistent abusers. Which unfortunately implies having some kind of identification of everybody.


No, it's more than that. Cloudflare's bot protection has blocked me from sites where I have a paid account, paid for by my real checking account with my real name attached. Even when I am perfectly willing to give out my identity and be tracked, I still can't because I can't even get to the login page.


They block such visits because their pragma suspects that your visit is the account of a real human that was hacked by a bot.


You notice that Analogue Devices puts their (incredibly useful) information up for free. That's because they make money other ways. Ad supported content farm Internet had a nice run but we will get on without it.


That's another problem, we want cheap easy solutions like tracking people, instead of more targetteed or systemic ones.


> The privacy battle has to be at the legal layer.

I couldn't disagree more. The way to protect privacy is to make privacy the standard at the implementation layer, and to make it costly and difficult to breach it.

Trying to rely on political institutions without the practical and technical incentives favoring privacy will inevitably result in the political institutions themselves becoming the main instrument that erodes privacy.


Yet without regulation nothing stops large companies from simply changing the implementation layer for one that pads their bottom line better, or just rebuild it from scratch.

If people who valued privacy really controlled the implementation layer we wouldn't have gotten to this point in the first place.


The point we're at is one in which privacy is still attainable via implementation-layer measures, even if it requires investing some effort and making some trade-offs to sustain. The alternative -- placing trust in regulation, which never works in the long run -- will inevitably result in regulatory capture that eliminates those remaining practical measures and replaces them with, at best, a performative illusion.


> Then you have mobile apps that just don't run if you don't have a google account, like chatgpt's native app.

That's not true, I use ChatGPT's app on my phone without logging into a Google account.

You don't even need any kind of account at all to use it.


On Android at least, even if you don't need to log in to your google account when connecting to chatgpt, the app won't work if your phone isn't signed in into google play, which doesn't work if your phone isn't linked to a google account.

An android phone asks you to link a google account when you use it for the first time. It takes a very dedicated user to refuse that, then to avoid logging in into the gmail, youtube or app store apps which will all also link your phone to your google account when you sign in.

But I do actively avoid this, I use Aurora, F-droid, K9 and NewPipeX, so no link to google.

But then no ChatGPT app. When I start it, I get hit with a logging page to the app store and it's game over.


I have a similar experience with the pager duty app. It loads up and then exits with "security problem detected by app" because I've made it more secure by isolating it from Google (a competitor). Workaround is to just control it via slack instead.


Well you can use the web base chagpt so there is a workaround. Except it's worse a worse experience.



That won't make chatgpt's app work thought.


It might well do, depending on what ChatGPT's app is asking the OS for. /e/OS is an Android fork that removes Google services and replaces them with open source stubs/re-implementations from https://microg.org/

I haven't tried the ChatGPT app, but I know that, for example my bank and other financial services apps work with on-device fingerprint authentication and no Google account on /e/OS.


I already have microg installed.


So the requirement is to pass the phone’s system validation process rather than having a Google account. I don’t love that but I can understand why they don’t want to pay the bill for the otherwise ubiquitous bots, and it’s why it’s an Android-specific issue.


You can make a very rational case for each privacy invasive technical decision ever made.

In the end, the fact remain: no chatgpt app without giving up your privacy, to google none the less.


“Giving up your privacy” is a pretty sweeping claim – it sounds like you’re saying that Android inherently leaks private data to Google, which is broader than even Apple fans tend to say.


A person who was maximally distrustful of Google would assume they link your phone and your IP through the connection used to receive push notifications, and the wifi-network-visibility-to-location API, and the software update checker, and the DNS over HTTPS, and suchlike. As a US company, they could even be forced to do this in secret against their will, and lie about it.

Of course as Google doesn't claim they do this, many people would consider it unreasonably fearful/cynical.


Sure, but that says you shouldn’t have a phone, not that ChatGPT is forcing you to give up your privacy.


> it sounds like you’re saying that Android inherently leaks private data to Google, which is broader than even Apple fans tend to say.

Yes? I mean, not "leaks" - it's designed to upload your private data to Google and others.

https://www.tcd.ie/news_events/articles/study-reveals-scale-...

> Even when minimally configured and the handset is idle, with the notable exception of e/OS, these vendor-customised Android variants transmit substantial amounts of information to the OS developer and to third parties such as Google, Microsoft, LinkedIn, and Facebook that have pre-installed system apps. There is no opt-out from this data collection.


Google and Apple were both part of the PRISM program, of course I'm making this claim.

That's the opposite stance that would be bonkers.


PRISM covered communications through U.S. company’s servers. It was not a magic back door giving them access to your device’s local data, and even if you did believe that it was the answer would be not using a phone. A major intelligence agency does not need you to have a Google account so they can spy on you.


Forest for the tree.

Google and Apple are both heavily invested in ads (apple made 4.7 billion from ads in 2022), they have a track record of exfiltrating your data (remember contractors listening to your siri recordings?), of lying to the customers (remember the home button scandal on iPhone?), have control over a device that have your whole life yet runs partially on code you can't evaluate.

Trusting those people makes no sense at all. You have a business relationship with them, that's it.


It’s interesting how each time you say something which isn’t accurate you try to distract by changing the topic.


Sometimes in the middle of the sentence, I write True or None, out of habit.


This is illegal in Europe, since you can't add somebody to a list without their consent.

As usual, I know it's trendy to say on HN the EU is killing innovation with all the regulations, and there is truth to that, but there is also great customer protection, which seems constantly violated in the US.

So yes, in the US, companies can flourish, but it seems the consumers are second-class citizens compared to companies.

That's why it's nice to have both: eventually, EU regulations leak out to the rest of the world, and the US innovations reach us.

We pay the price by having a weaker economy, they pay the price by having less dignity in their life, but there is eventually balance.


If your "innovation" is at risk from consumer protection regulations I question whether it's a good innovation.


No. Regulations are required so companies produce value rather than exploits. There's no stopping the exploits, especially in an environment where $$$ === speech, but regulation is required for companies to produce value for customers.


There are many examples of successful companies that fall into that category.

Sometimes an innovation needs critical mass to work - social networks for example. LinkedIn famously got big by being extremely aggressive on how they mined your contacts. You'd get sued to the moon and back in the EU for this behaviour.

LinkedIn is big now, it has established itself and no longer needs to be that aggressive. Any European player that tried to enter the market with a less aggressive stance had no chance - they never reached that critical mass.


And we are all so grateful that LinkedIn's aggressive innovation was allowed to flourish.


Bayer would have never invented heroin, if there had not been a market for that and there is a market for that because its a great product. The greatest actually, surpassing all other products, including human society and its the purest form of capitalism. All other products and businesses are just pre-cursors for this one.

https://en.wikipedia.org/wiki/Heroin#History


A good example is the US "health care" system. It's a meat grinder that exploits everyone and sort of pretends to do what it's supposed to through regulation.


Since the people making the innovations and regulations are different, I fear there’s no way to implement regulation that doesn’t lead to suboptimal results.

And to be clear, when I say suboptimal results I mean misery and death in large quantities.


Yes, but the innovators' incentives don't always align with the needs of the people the regulations should protect.

Regulation are a necessary balance, otherwise the innovators become so powerful they eventually concentrate all the power and privilege and make weaker people pay for it.

Chlorofluorocarbons were an innovation for some times, then we needed regulation to save our ozone layer. Industrial wouldn't have stopped using it.

It's a fine line, constantly moving, an nobody will never be perfectly happy about it.


> We pay the price by having a weaker economy, they pay the price by having less dignity in their life, but there is eventually balance.

It doesn't need to be black or white.

A country can have decent consumer protections without e.g. a tax policy that is hostile to startups. But many EU countries are seemingly uninterested in the latter — presumably because there are no votes in it.


From reading all these messages, I'm curious if an American couldn't try sending a GDPR deletion request by email to some of these organisations. Sure, it only technically applies to European citizens, but it applies to them anywhere in the world — do they really have it on record that you're not one? And of course, if they do a Home Depot style block-all-EU-ip-addresses thing they probably wouldn't care. But in those cases they still break the law, they're just reasonably sure that it will never be enforced against them.

I would imagine the potential legal risk for some orgs would be enough to make them comply, especially those with a European presence (and surely a university like Brown must have both at least one legal entity and enough alumni in the EU for them to count). The worst they could do is say no.

it technically applies to anyone resident in the EEA and UK, as well as citizens of the EEA and the UK abroad


IPython is huge: 15,5 Mo without any extras.

Python is 150mo. Hard to justify that 10% of the lines of code, source of bugs and maintenance only go to the shell.


I am curious about your suffixes.

I mean, I understand the post fine, but I have never seen the units (Mo, mo) before and am wondering where they came from.

I would guess mo is megabytes(megaoctets?) and Mo is gigabytes(is ipython really 15GB? yikes)


I think I remember seeing something about MB=Mo in french, the casing is probably safe to ignore in the gp as ipython is definitely not 15gb



yeah sorry mb, french comming out


OT, but I love your newsletter!

Didn’t notice your username until you wrote “French”


That's lovely to hear.

It's great hearing it in general, but given the HN community is picky, it feels even better.


Sure, the statistical method matters, but I think it's missing the forest for the tree.

Any metric will differ: bpm, sleep phases, body temp, etc.

Because those devices are not super accurate, and the context you wear them in doesn't allow them to be anyway.

If you were to do a respiratory polygraph with proper medical equipment you'll find different values from your Apple Watch or Oura ring for the times you wake up. But you'll also notice a gap between getting the values at home and in a hospital, because in the hospital the nurses will check your equipment setup.

Those devices are great to give you a big picture, follow general trends and understand your own body. That's it.


Note that French does have a tense for gossip.

You can say: julie aurait couché avec pierre hier, meaning julie allegedly selpt with pierre yesterday.

But it's not a cultural thing to use it outside of tv or books.


Now that you say this, the exact same thing is used in Dutch to indicate something is a rumour.

Ze zouden met elkaar naar bed zijn geweest.


French learner here: I read that as "Julie would have slept with Pierre yesterday." I take it there's some mood subtlety I'm missing?


Context. Or even the lack thereof. In this case the use of the conditional implies an unstated condition, the "if I'm right about it" condition.

This is more idiomatic than grammatical. It's the same in Spanish. In English we don't have this sort of idiom, so that phrase doesn't translate very well.


How would that be phrased in Spanish? Are you talking about the future tense in constructions like "Será que...?" or "Estará volviendo" to say "he must be returning"?


Julia habría dormido con Pedro anoche.

As explained, mood is implied. This is a common pattern in news reports, etc., not quite colloquial


Yeah, it's very common in news because it's a very concise way to indicate the possibility of doubt because it's just "gossip" (as the title here would have it).


Yes we do, “…will have slept…”


Merci.


What you say is grammatically correct. But if you want to find out whether it implies gossip or past conditional, you need to look at the context.


Il paraît que quelqu'un voudrait faire croire que ce genre de phrase n'est employé que dans des œuvres littéraires et télévisuelles. :)


Ce quoi on dirait n'est pas vrai du tout.


"On diraît" est utilisé par les enfants de 6 ans pour parler de jouer un rôle, mais pas vraiment par les adultes pour reporter un commérage.


BS (Baliverne Saugrenue)!

La tournure correcte, "voudrait" n'est en pratique que très peu utilisée pour le témoignage indirect au quotidien.

"Il paraît qu'on a voulu te faire croire que ce genre de phrase n'est employée que dans des œuvres littéraires et télévisuelles" est beaucoup plus réaliste.

Indicatif + participe passé, ou imparfait. Le conditionnel est surtout utilisé pour l'hypothétique non lié aux ragots et encore, par des gens comme dans ce thread qui se soucient de leur language.

Par contre, au journal de 20h: "on dit dans les milieux autorisés qu'un accord secret aurait été signé" est tout à fait courant.


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

Search: