HNHacker News
TopNewBestAskShowJobs

bloblaw

705 karma · joined March 24, 2012

submissionscomments
bloblaw··on Use `Python -m Pip`
Docker simultaneously solves and creates problems here.

Step 1: Docker must be installed on all targets. This is not a given and is a new piece of overhead.

Step 2: The Dockerfile hopefully doesn't source from just "ubuntu:latest" and bring in the whole kitchen sink for this SINGLE APPLICATION.

Effectively if you are using Docker and deploying your script to Windows or macOS, you are saying "Hey, this script requires you to install linux in a VM to run this. Docker makes it easy. Go download 500mb of Docker and a couple hundred more mb of images to run this 800k script.

bloblaw··on Use `Python -m Pip`
The fact that the suggested solution in Python is to give every Python script a full copy of an entire specific Python runtime (via venv) is a mild annoyance as a design pattern...to me.

Python scripting today requires shipping your development environment. Python is wonderful until you want to run that code on another machine. At that point, the target system has to venv their way into reproducing your environment...often including the specific Python interpreter you picked, and to download (and possibly compile) all modules and their dependencies.

It can work beautifully and many of the large companies I've worked for have put oodles of engineering effort into making it "easy", as long as you follow their happy path and don't deviate.

But, to your point, on my own machine with venv + pip it "just works". The pain comes when trying to venv + pip on another machine.

How confident are you that you could venv + pip your moderately complex Python application on 200k machines without issue? What if it's a mix of Windows, Linux, and macOS? (this is a real scenario I've experienced). From my own experience I can share that it is painful. Your mileage may vary.

And after a while your system is riddled with Python venvs. Leading to some mildly annoying problems with popular IDE's: https://www.jetbrains.com/help/pycharm/package-installation-...

bloblaw··on Use `Python -m Pip`
I remember when Perl was more popular generally than Python (late 90's and early 00's), and Perl espoused the mantra of (There is more than one way to do it: TIMTOWTDI).

As a tongue-in-cheek reaction, Python espoused "TOOWTDI", or There's Only One Way To Do It :)

reference: https://wiki.python.org/moin/TOOWTDI

The problem is, when it comes to the Python package management ecosystem, there are SO MANY ways to do it. And they aren't equal and require a deep understanding of each tool to select the correct choice.

It is a problem for Python, although I often regrettably see it dismissed as not a true issue because $latest_package_management_system fixes it.

Python has allowed me to be profoundly productive in many ways, but this is a huge sore spot for the Python ecosystem.

bloblaw··on Why We Switched from Python to Go (2021)
So did I :) One of those places replaced an interpreted language used for a process intensive core function with Go and saw a massive performance increase...resulting in clear cost savings.

But Go isn't a silver bullet. It's another tool in the toolbox and sometimes it makes sense to reach for Python, or Kotlin, or Swift, etc. But choosing Python when you should've chosen Rust / Go / D is a tough design decision to quickly come back from.

bloblaw··on Why We Switched from Python to Go (2021)
Not natively, but there is a community developed one called gore: https://github.com/x-motemen/gore
bloblaw··on Why We Switched from Python to Go (2021)
That's a great point, and one I hadn't considered. One language feature that Go brings is first-class multi-threading and communication amongst and with child threads.

The only languages I know that can compete with Go with similar properties are Nim, Zig, and Rust. I'd like to include Delphi / Free-Pascal, but cross-compilation can be a bit of headache at times.

bloblaw··on Why We Switched from Python to Go (2021)
Depends on your requirements. If you want statically compiled (AOT compiled), then I think Nim, Zig, or even Rust are good alternatives.

If you like the high-performance backend, then Java, Kotlin, Scala, or C# are great choices.

bloblaw··on Why We Switched from Python to Go (2021)
Go debugging is nearly the exact same experience as Python. GoLand (from JetBrains ... same folks that make Pycharm) or VSCode with delve debugger work flawlessly.

I don't think there is any difference between Go and Python when it comes to debugging. Support for both is widespread and high-quality.

bloblaw··on Why We Switched from Python to Go (2021)
Oh, that's a great way to put it. I'm stealing that :)
bloblaw··on Why We Switched from Python to Go (2021)
Go was released in 2009, which is 13 years ago. Many companies have built significant portions of their stacks on top of Go....Twitch, Google, Uber, Lyft, Amazon, etc.

It's widely used in industry and isn't going anywhere.

bloblaw··on Why We Switched from Python to Go (2021)
Go is successful because it has many appealing features:

  1. trivial cross-compilation
  2. native multi-threading (eg no GIL or multi-process hacks) that is easy to take advantage of
  3. fast. An order of magnitude faster than Python in many cases.
  4. easy to deploy. Most often just a single binary
I like Go because once I compile it, I can ship that binary anywhere and it will run. I like Python for a great number of tasks and for prototyping, but I prefer Go when I need to run my code on another machine (or it needs to be fast).

To put it simply, with Go I ship a binary. With Python I have to ship my entire development environment.

bloblaw··on Generate Python extensions using Nim language
For me, Nim provides much of the developer productiveness of Python, but with higher performance.

I'm a big fan of Nim, and while I love Python, I keep finding more ways to use Nim instead of Python because it means if my proof-of-concept in Nim gets popular, I can avoid making trade-offs in scaling (due to performance).

bloblaw··on Awesome Pascal – A curated list of Delphi, FreePascal, and Pascal shiny things
Ultimate++ is nice, but one of the benefits of Delphi / Lazarus is the use of the Pascal language instead of C++. This can be a point of contention, but I know once I moved from C++ to Object-Pascal, I didn't want to go back.
bloblaw··on Awesome Pascal – A curated list of Delphi, FreePascal, and Pascal shiny things
If you want a really strong Object-Pascal -> JavaScript transpiler, you want TMS WebCore: https://www.tmssoftware.com/site/tmswebcorevsc.asp
bloblaw··on Awesome Pascal – A curated list of Delphi, FreePascal, and Pascal shiny things
https://jonlennartaasenden.wordpress.com/2014/11/06/famous-s...

A couple more well known titles are:

  - BeyondCompare  
  - InnoSetup  
  - Nero Burning ROM  
  - Macromedia Dreamweaver!
bloblaw··on RegExr: Learn, Build and Test Regex
If you paste a regex into RegexBuddy, it will explain each portion of the regex. Clicking on parts of the regex will highlight its meaning.

https://www.regexbuddy.com/analyze.html

Or it has the best regex debugger I've ever seen in my 20 year career: https://www.regexbuddy.com/debug.html

bloblaw··on RegExr: Learn, Build and Test Regex
Oh, you should checkout RegexMagic. That's exactly what it does: https://www.regexmagic.com/

Written by author of RegexBuddy and Oreilly's Regex Cookbook: https://learning.oreilly.com/library/view/regular-expression...

bloblaw··on RegExr: Learn, Build and Test Regex
RegexBuddy works perfectly on wine: https://www.regexbuddy.com/wine.html

Why does it matter if it's closed source?

I am a paying customer of RegexBuddy. Best $39 I've ever spent on software.

RegexBuddy's `debug` feature has no equal in open-source or commercial software: https://www.regexbuddy.com/debug.html

It has many more features than regex101 AND it keeps all data local. Maybe regex101 keeps things locally too, but I have to run it in a browser and I'm not about to put sensitive test data there.

That being said, regex101 is very well done, but I paid $39 for RegexBuddy 14 years ago (and price is still the same) and last year paid $19 for the optional upgrade from v3 to v4...but I really only did that to support the developer. v3 still met all my needs.

bloblaw··on Problems once solved by a metaclass can be solved by __init_subclass__
I agree that Python is a great glue language (so are Perl and Python).

However, Python really doesn't shine when compared with other memory safe languages like Go, Rust, and Java.

Ultimately, Python is single-threaded by design. There are some hacks to get around this design contraint (multi-processing), but then you are adding an entire additional Python runtime to your system's memory for every "thread" you want to run. Even with asyncio, Python performs the worst when it comes to I/O.

I love Python, but it's important to understand that due to specific design considerations it is not and will likely never be a performant language.

reference: https://medium.com/star-gazers/benchmarking-low-level-i-o-c-...

bloblaw··on Windows 2000 Modernization Guide
When I was an active Windows user, I always used the server editions as my desktop OS.

Eg, I ran Server 2003 (instead of XP), Server 2012 R2 (instead of 8.1), and finally, Server 2016 (instead of Win 10).

Much less bloat. Not sustainable for an enterprise deployment, but for my home use it worked quite well.

bloblaw··on Named Pipes in .NET 6 with Tray Icon and Service
You're welcome. An alternative I've used to named pipes among processes of different privilege levels is to build the service to listen for custom commands sent to it. These are just integers, and the service maps those to pre-defined commands.

Then the only thing the user-mode application can send are just flags (integers) that the service has already pre-determined what it will do in response.

Here's an article: https://www.codeproject.com/Articles/24434/How-to-Write-Wind...

And here's a succinct example: https://stackoverflow.com/a/5805700

bloblaw··on Named Pipes in .NET 6 with Tray Icon and Service
This is generally how I've approached this problem as well. I like using the `ServiceController.ExecuteCommand` method and just send some integer value from the client -> server...and the server maps the integer value to a pre-determined command.

https://docs.microsoft.com/en-us/dotnet/api/system.servicepr...

You've definitely outlined the risk clearly of allowing a client to specify anything arbitrarily.

I once wrote a sudo implementation for Windows Vista / Windows 7 and first attempt used named pipes communicating to a windows service that did some token manipulation to execute things as the user (but with elevated token attached as well). There be (security) dragons.

I like using named pipes and they are a great IPC mechanism for communicating amongst processes of the same privilege level. I would not use them for message passing between processes of different privilege levels.

bloblaw··on Named Pipes in .NET 6 with Tray Icon and Service
Good article, but I wish the author would've addressed securing these named pipes.

Consider that if a user-mode application can send messages to a privileged process (like a Windows service).

What prevents any user-mode application from doing that? And if your Windows service is running as "NT_AUTHORITY/SYSTEM" and even executes privileged commands, well you might find you've got a simple privilege escalation vuln.

Remember, secure your named pipes...especially when the named pipe server runs as SYSTEM.

- https://stackoverflow.com/a/59983266

- https://versprite.com/blog/security-research/vulnerable-name...

bloblaw··on An oral history of Bank Python
The problem is "less than 100mb" is unacceptable (for my use cases).

There are use cases where 100-300mb is no big deal and customer can handle this.

But single binary deployments with a statically compiled language where a fully-featured binary can weigh in from 5-30mb are what I'm after.

And honestly, with upx I can take even those fat Go binaries down from ~35mb to 7-8mb. That's an order of magnitude less than 100mb of Python and all it's dependencies. Not to mention with all those languages I mentioned (Go, Rust, Nim, Zig), I get multi-threading and high-performance as well.

bloblaw··on An oral history of Bank Python
If you compare Python's deployment and dependency management to those of statically compiled languages like Go, Rust, Zig, or Nim, you quickly see the experience with Python is quite poor.

In all the above languages, you simply ship a statically compiled binary (often just 1 file), and the user needs nothing else.

With any sufficiently complex Python project, the user will need:

1. virtualenv 2. possibly a C compiler 3. recent versions of Python (and that keeps changing. 3.0->3.4 are "ancient", and 3.6 seems to be the absolute minimum version these days --- due primarily to f-strings) 4. Or you ship a dockerfile and then the users need 600mb of Docker installed

I sometimes joke that in the future every Python script will require a K8s deployment and people will call it "easy".

Python is a great language, but deployment is a massive pain point for the language.

When I know I am writing something that has to "just work" on a wide range of systems that I don't necessarily control, well I don't write the solution in Python. I pick Go, Nim, or Rust (Zig would be a good choice too).

bloblaw··on Microsoft Edge GA on Linux
Excel is incredibly powerful. Watch an accountant or financial expert in a mid to large company use it. They'll use functions you've never heard of...and don't require writing Python.

Or watch this video and level-up your Excel! https://www.youtube.com/watch?v=YNuC6ayrNKQ

Note: Joel Spolsky (co-founder of Stack Overflow, Trello, FogBugz, more) was a program manager for Excel in 90's.

bloblaw··on Microsoft Edge GA on Linux
Sadly, they aren't even close to what Edge offers.

My main browser is Firefox with Sidebery. That's what Chrome should copy. Edge's vertical tabs are the next best thing...especially when you need a chromium based browser.

https://addons.mozilla.org/en-US/firefox/addon/sidebery/

bloblaw··on Microsoft Edge GA on Linux
For me it's a trade-off between Google and Microsoft.

Nobody would ever confuse me for a Microsoft fan-boy, but I personally feel more comfortable with sharing telemetry data (which both Google and Microsoft collect) with a software and services company than an advertising company.

More than 80% of Google's revenue comes from advertising (source cited below).

The majority of Microsoft's revenue comes from cloud services, Office, and Windows.

But I understand Microsoft has a trust gap with many folks, based on their anti-OSS activity of the late 90's and early 00's, and I'm glad we are all free to choose.

The only major browser (by market share) that is truly open-source is still Mozilla Firefox.

source: https://www.cnbc.com/2021/05/18/how-does-google-make-money-a...

source: https://www.geekwire.com/2020/filing-shows-microsoft-really-...

bloblaw··on Microsoft Edge GA on Linux
You do realize Google Chrome is closed source, right?

> Unlike Chromium, Chrome is not open-source, so its binaries are licensed as freeware under the Google Chrome Terms of Service.

source: https://en.wikipedia.org/wiki/Chromium_(web_browser)#Brandin...

I greatly prefer Firefox to Edge or Chrome, but unfortunately the world we live in is where some websites only work in Chrome, or corporate functionality requires plugins that only work in Chrome.

bloblaw··on Microsoft Edge GA on Linux
Edge has built in support for vertical tabs, tab groups, and chrome extensions.

IMHO, Edge is the best chromium based browser out there, and for me is miles better than Chrome itself.

← PreviousPage 2 of 5Next →