24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions
https://www.bitecode.dev/
Email: contact at bitecode.dev
comment 6y ago · link · parent
Is there any way to attach the deployement scenario in a Python object ?
All the examples I see are global functions called at a root of a module.
How do I make a scenario pluggable? Reusable? Introspectable?
comment 6y ago · link · parent
Ansible is a great system, with a terrible DSL.
YAML is not a programming language, and deployment is not a toy task. You need power.
The result is that ansible has pushed a markup language to its limit, then pushed the templating engine used in it to its limit too. Then used a bunch of duck tape + conventions to glue everything and ended up with 10% of an unclean verbose unexpressive real programming language with ridiculous limited tooling, testability and had to document + support it.
As with most DSL.
For what? For the quest of having something "declarative", and that any language could read.
Well you can have declarative API written in any language, and nobody except ansible ever read playbooks.
In the end, it's just a big weight at the ankle. I never ever used it and though, "damn, what a pleasant tech choice, I'm happy they didn't directly expose the API through Python".
It's the same reason I use "nox" and not "tox", or "doit" and not "make". DSL really seem like a great idea, but they fail most of the time. There is a reason only few of them - like SQL, CSS or regex patterns - became a success. 99% of the time, what you need is a good lib, with a well designed API. For the 0.9% of the time you do need multi-language communication, you may implement RPC. Then, only for the 0.01% case should you really consider a DSL.
But we geek love to create DSL. They are fun to write! They are so elegant in tutorials!
Is Pyinfra doing better? I don't know, but I'm sure to give it a try. I really, really want to leave ansible behind, but fabric 2 is not high level or declarative enough.
comment 6y ago · link · parent
I assume it's a joke, but I often have people in my classroom that have been doing python for some times and that keep typing the whitespaces themselves instead of using an editor that does it for them.
But again, I've seen some coding without any syntax highlighting.
Now I never assume people know even the most obvious things.
comment 6y ago · link · parent
Every single tool in your toolbox could introduce a new one, and it leads to fatigue.
Task runner? New DSL (make)
Test runner? New DSL (robot)
Deployement? New DSL (Ansible)
Batch spawning? New DSL (tox)
Etc
Of course, dev in half of those DSL is a total pain, because, like with most DSL, the tooling sucks: terrible completion, linting, debugging or composing experience.
So people write/leverage tools they can use with their favorite language. And why not? You have to install it anyway (make isn't default on windows, it's not even installed on vanilla Ubuntu!).
When I need a make-like tool, I use doit (https://pydoit.org/).
Why?
It's in Python, the language of my projects. So I can use the same tooling, the same libs, the same install and testing procedures. And so can people contributing: no need to train them. Most devs don't know how to use make (most of them are on Windows after all).
Using make adds zero benefit for me: doit just does what make does (ok, that sentence is hard to parse :)). But make adds an extra step of asking to install it while I can just slip doit among my other python project dependancies. I have to google the syntax. I can't use tab to complete names, of right click to get documentation. And if (actually when) I need to debug my make file, God have mercy.
It's not against make. It just doesn't provide enough value to justify the cost of it.
comment 6y ago · link · parent
When you approach life intellectually, because it has been your best weapon until now, you tend to think that if you understand something clearly, then you can express it as clearly.
But just like it's impossible to explain blue to a blind man, it's impossible to explain realizations about what happens inside yourself, to people outside. Or maybe you'll find a way (E.G: frequency for colors), but it will have no impact on the other party because the experience it what matters.
It's weird, but there are actually a lot that happens to us that we have no vocabulary for. Or no language tools, or even shared concepts, for. It's very frustrating, espacially if you are particularly good at putting things in words.
I like step by step explanations to get a grap on things. It infuriated me when I had to learn practices that weren't taught that way. It felt such BS. But I now know that it's not. It's just our way of communicating is limited, like everything in the human condition. And the more you practice, the more you see things you didn't notice before in yourself. It's no surprise we got no word for something we seldom pay attention to.
Knowing that now, I understand why so many self-help practices seems so full of shenanigans: testimonies look irrational, full of terrible analogies and symbolism, or flat "duh, bro".
Plus, people create complicated believe systems around their experience and mix up everything. We are so desperate for the extraordinary that we will make it up at any occasion. E.G: meditation is a very mondain activity, but the term is loaded with a lot of stereotypes, expectations and mythology.
It's confusing, and doesn't scream credibility.
Also, we reuse the same labels for totally different things. I've seen hundred of people taking about psychedelics or meditating, and they do it in vastly different ways.
If you take LSD at a party, it's not the same than in a guided ceremony. If you medidate 10 minutes singing a mantra, it's not the same than a 10 days silent retreat, etc.
Then, add variety in people, the fact experience can't be measured, that there is no way to be objective about it, the placebo effect, history, culture, politics, moral, religion, other believes, etc.
And you got yourself a puddle of mud.
But it's worth exploring, I swear.
comment 6y ago · link · parent
But one day, I experienced what it was to use Google without ublock origin, by mistake. It was a horrible mess.
Then it hit me: the main benefit of DDG is that it's clean, even if you don't know anything about ad blockers.
comment 6y ago · link · parent
I regularly use the Python port of the original chardet (https://pypi.org/project/chardet/). In fact, most python devs do since it comes with requests.
This post is full of gems. E.G: I learned that it's important for your meta charset to be in the first 1024 bytes of your HTML :)
comment 6y ago · link · parent
- you may not be able to find the talent where you are (good designers are not uniformly distributed, and remote may not be possible for you. Source: lived in Africa)
- you may want/need to know the basics to evaluate the work of a designer, hire one or just communicate efficiently with one
- you may just be curious, and want to learn that for you. Or transition to be, you know, a designer :)
comment 6y ago · link · parent
As a Linux user, the iPad pro writting feedback is probably the only thing I envy from Apple's users. What they did is black magic.
comment 6y ago · link · parent
Libs are for the dev: you want the source code, you want to manage versions, you want it to integrate with your dev env, you want a well delimited scope, a way to install it using your usual setup (pip/poetry/etc) and to isolate it from project to project.
comment 6y ago · link · parent
E.G:
- shiv leave files hanging around, but you can address those files directly. With PyOxidize, you will need to use https://pyoxidizer.readthedocs.io/en/stable/config_api.html#... a way to read a non Python files. Because most projects don't know this and just use open(), they won't work out of the box and you may need to monkey patch open().
- pyoxidizer requires a compiler, which is easy on linux, but a higher requirement on windows. Compared to shiv, which is just a pip install away.
There is no perfect solution yet, because you have really often many things to balance: bringing in the python vm or not, allow compiled extensions or not, provide support for open() or not, etc.
comment 6y ago · link · parent
For a lot of people, than means learning programming before learning english.
Which is incredibly counter productive. It's like learning maths without pen and paper. Sure you can do it, but I wouldn't want to.
Besides, there are only a limited number of hours in the day. Energy and motivation are also in short supply. You can't do everything at once, and even if you manage a bit of parallelism, you'll end up doing a lot supperficially.
Better be sequencial. And prioritize.
> How would someone know whether to consider it, if not exposed to it at all?
Like I said, just like with music, you put it everywhere, and you associate it with joy.
Play with robots, make beautiful programmable lights shows in the kid room, use games like turing tumble, program openly and talk proudly about the result, create bots to annoy the kid in social media, make your own "alexa" system that the whole family can abuse, lay around bare raspi you can fiddle with, etc.
The idea is that you feel like the house in "honey I shrunk the kids". It calls for experimenting.
> Most people in the English-speaking western world won't make a vast amount of use of that second language.
First, that's not most of the world. Second, of course they would. It opens an entire different culture that make you think differently, grow differently. Sure, you can put a number on it, but it's huge, and it must happen soon, or it will unlikely happen at all.
It's hard to learn a language by yourself unless you travel abroad, while learning programming alone is easy.
In fact, if you have the money, sending your kid abroad in hight school or college is fantastic.
> Most won't use their Chemistry or Physics education in day to day life, but it will help them understand the world better.
And because you had to learn all that at the same time, most people don't understand basic physics, chemistry or maths. They don't speak a second language either. They lost everything, trying to do all the things.
> As our world becomes dominated by software, training in it becomes similar - even those who aren't going to go all in and follow a career in it, can conceivably benefit from some training.
Software is just regular life, automated and faster.
Learn real life first.
comment 6y ago · link · parent
My answer was "when she asks for it".
There are many things a kid should learn, and among them, a huge number are more important than programming (plus sometimes a pre-requisite for it):
- reading
- writing
- basic maths
- critical analysis
- building your own idea
- defending yourself verbally, mentally and physically
- expressing yourself
- chosing ingredients and preparing food
- proper life hygiene
- understanding the current society, the medias, the political system, etc
- learning a second language
I recall that when I was a freshman, some kids were still not be able to read out loud correctly.
Programming can come later. Way, way later.
In fact, she may even not enjoy programming at all, or even consider it.
I think the best bet is like with music. If it's something you want to share: demo a lot of it in regular life, associate it with joy, and the kid may just show an interest in it.
Then foster than.
Then setup lessons, discipline, etc.
But don't make it a requirement.
4794.
Pycopy – a minimalist and memory-efficient Python implementation(github.com ↗)
135 points · by BiteCode_dev · 6y ago · 52 comments
comment 6y ago · link · parent
javascript:(function(){function%20init(){var%20newline=unescape(%22%%22+%220A%22);dead=false;oldCSS=null;x=opener;ta=document.f.ta;ta.select();ta.value=%22/*%20Type%20CSS%20rules%20here%20and%20they%20will%20be%20applied%20to%22+newline+%22whatever%20page%20is%20loaded%20in%20that%20tab,%20as%20long%20as%20the%20pages%22+newline+%22are%20from%20'%22+location.host+%22'%22+newline+%22and%20you%20keep%20this%20window%20open.%20*/%22+newline+newline;update();}function%20update(){try{if(!x||x.closed){ta.style.backgroundColor=%22#ddd%22;return;}x.bookmarkletStyleSheet;}catch(er){ta.style.backgroundColor=%22#fdc%22;setTimeout(update,150);dead=true;return;}if(dead){dead=false;ta.style.backgroundColor=%22%22;oldCSS=null;}if(!x.testStyles){var%20newSS;newSS=x.document.createElement(%22link%22);newSS.rel=%22stylesheet%22;newSS.type=%22text/css%22;x.document.getElementsByTagName(%22head%22)[0].appendChild(newSS);x.testStyles=newSS;oldCSS=null;}if(oldCSS!=ta.value){oldCSS=ta.value;if(window.opera)x.testStyles.href=%22javascript:unescape('%22+escape(ta.value)+%22')%22;else%20if(navigator.userAgent.indexOf(%22MSIE%22)!=-1)x.testStyles.href=%22javascript:unescape('%22+escape(escape(ta.value))+%22')%22;else%20x.testStyles.href=%22data:text/css,%22+escape(ta.value);}setTimeout(update,150);}y=window.open('','','resizable,width=500,height=300');y.document.write('<title>New%20CSS%20Style%20Sheet</title><style>.ec%20{%20width:%20100%;%20height:%20100%;%20border:%20none;%20margin:%200px;%20padding:%200px;%20}</style><body%20class=%22ec%22><form%20name=%22f%22%20style=%22margin:%200px;%22%20class=%22ec%22><textarea%20name=%22ta%22%20wrap=%22soft%22%20style=%22margin:%200px;%20border:%200px;%20width:100%;%20height:100%;%22%20class=%22ec%22></textarea><script>'+update+init+'init();<'+'/script>');y.document.close();})()
To quickly edit the css style of anything.And:
javascript:(function()%7Blet%20style%20%3D%20document.getElementById('__colorallblocks__')%3Bif%20(style)%7Bstyle.remove()%3B%7D%20else%20%7Bstyle%20%3D%20document.createElement('style')%3Bstyle.id%20%3D%20'__colorallblocks__'%3Bstyle.innerHTML%20%3D%20%60*%20%7B%20background-color%3A%20rgba(255%2C0%2C0%2C.2)%3B%20%7D*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C0%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C0%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C0%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C0%2C255%2C.2)%3B%20%7D%60%3Bdocument.body.appendChild(style)%3B%7D%7D)()
To color all blocks in a page.But if the equivalent exist as a Firefox add on, I use that instead, because it bypasses many restrictions.
In this article, the video BM can be replaced with the excellent "Enhancer for Youtube", at least on Youtube: https://addons.mozilla.org/fr/firefox/addon/enhancer-for-you.... Just being able to change the speed of the video using the mouse wheel is a god send.
Same for archive.li or the way back machine.
But I'll steal the space scroll one, this red bar is nifty.