Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 6y ago · link · parent

Keep in mind you should still use a venv with docker, this removes the need for sudo and won't conflict with the image system python if it has one.

comment 6y ago · link · parent

> Also there is the idea that such an infastructure would scare criminals into not doing incriminating things.

Even if the criminals were afraid of the repercussion of their actions, and were aware of the system to catch them and be convinced it will work and would lead to their capture (that's already a LOT of if), this would only work on premeditated crimes, which is a minority of the ones commited in the street.

A lot of crimes are not though in advance, but done on the moment. People fighting because they are angry. Somebody stealing because they saw an opportunity.

We hear a lot about recurring pick pockets, or bank heists. But those are not the majority.

Most bad things in the street happen without being planned, and without consideration for the consequences.

Planned crimes are white colar crimes, and they don't get caught by cameras.

comment 6y ago · link · parent

Can't argue ^^

comment 6y ago · link · parent

Communication around birth control and abortion comes to mind.

You can always pretend we are right about this and those who are offended are biggots, but then you would make your parent's point.

comment 6y ago · link · parent

I interpret it as "I didn't think about it, picked the first thing that worked in the past, and don't wish to make an argument about it, so let it go".

comment 6y ago · link · parent

Sometimes, being a total outsider will see things other people cannot.

comment 6y ago · link · parent

> But we shouldn't do that.

The average human sucks at understanding probabilities.

Until we can prove that most people handling this system are capabable of smart decision making, which the latest police scandals do not lead to believe right now, those systems should not be used.

comment 6y ago · link · parent

> [if you don't change the locale or collation order with environment variables]

Or any other state change.

Because it's not stateless.

Hence not FP.

comment 6y ago · link · parent

> Unix piping is basically functional programming

Except you litterally use side effects to communicate. Not really FP, that part.

comment 6y ago · link · parent

"Companies just cannot be trusted with x" has been repeated and repeated for the last decades.

I think the conclusion is "Companies just cannot be trusted". At all. With anything.

We should assume guilty unless proven overthise for companies. They should go out of their way to show us their good will.

comment 6y ago · link · parent

I love the 'No' is a complete answer". I wished I learned that when I was a teen.

Now that I use "no" though, I still have people that ask "why" after it. Can't really tell them "this is the way" :)

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

Giving my finger and face prints to the browser, the software with the biggest attack surface in the world, connected to internet no less, feels off to me.

comment 6y ago · link · parent

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

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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

Behavior doesn't change at all.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

> 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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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

comment 6y ago · link · parent

Crop.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

> 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.

comment 6y ago · link · parent

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...).

comment 6y ago · link · parent

> 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.

comment 6y ago · link · parent

Lisp is not popular.

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

comment 6y ago · link · parent

Very lazy too, so I get it. I try to take so many shortcuts, and often it leads me taking more time that I would have if I did the hard thing first.

I've been meditating for 13 years, and sometimes I meet people with 3 years of practice that seem decades ahead of me.

One time, I think after my 2nd or 3rd retreat, I practiced in such a way that instead of helping myself, I got into depression. Took me a few months to change course.

I don't thing there is a "standard experience" for meditating. YMMV seems like a good summary for it.

Could be a t-shirt.

"Your Meditation May Vary"

1
155156157
184