HNHacker News
TopNewBestAskShowJobs

rpep

291 karma · joined September 28, 2022

https://rpep.dev/about https://github.com/rpep
submissionscomments
rpep··on The skills gap for Fortran looms large in HPC
There have been automatic translators from Fortran to C for many years, but they don’t product idiomatic C code.
rpep··on The skills gap for Fortran looms large in HPC
None of this is particularly surprising. I think there are a multitude of factors:

* Universities are teaching Python more than ever. When I started my undergrad in Physics everyone took C++, by the time I graduated it was all Python.

* Academia as a career track is not stable so people want to write code in something that they might have a hope of getting a job in afterwards. C/C++ are much more applicable in the wider world so anyone with one eye on the exit is likely to prefer one of those…

* Fortran itself is fine and even improving with fpm and the ecosystem changes happening, but the big Fortran scientific code bases are not much fun to work on.

* There’s no performance benefit to sticking with Fortran. You can make code fast in any language. The main argument that Fortran is faster than C/C++ is to do with aliasing which anyone writing performance critical code will know how to deal with anyway. Performance portability codes like Kokkos that let you run on OpenMP/MPI/CUDA but write code once are pretty much all C++ too.

* A few years ago, CUDA could only be used in Fortran with the PGI compiler which was commercial. This made it less attractive vs C/C++. This has improved now but it was a major factor for a few years. Even now I think they’re not at feature parity although it’s been a long time since I looked.

rpep··on British government mocked for advertising head of cyber role with £57K salary
It’s worth considerably more than that as an individual since you lose any investment risk, and contributing the same as employer + employee contribution to a pension is unlikely to get you benefits on retirement with the same annual payment.
rpep··on Making Python faster with Rust
> Most FFI boundaries incur their own performance cost. I’m not sure about Python, but I wouldn’t be surprised if FFI to rust in a hot loop is often slower than just writing the same code in Python directly. And it’s not always easy to refactor to avoid this.

They definitely do, but I’d usually suggest that if you find this an issue then perhaps the function you’re exposing from the compiled language should be higher level, with more work done in the compiled code to avoid the overhead of returning control back to the interpreted language.

rpep··on Making Python faster with Rust
You need to add “-march=native” to turn on SIMD at the highest level your processor will support, otherwise it will just use SSE4.1 by default on most compilers (the lowest common denominator, as all x86-64 processors have it).
rpep··on Pytest Tips and Tricks
With a Django project, what it is actually doing is spinning up a new test database at this point which will be the cause of your slowness. If you haven’t made database schema changes you can run it with the flag “—reuse-db”.

If you’ve got a large project that’s been going for a while, squashing migrations helps too. It can be a bit tricky to do this though.

rpep··on Regenerating Jordan’s native forests
Completely different landscape but “Rewilding” by Isabella Tree goes into quite a bit of detail about similar challenges in the U.K., for e.g. neighbouring farms being unhappy about them letting grow plants they consider weeds, having to remove carcasses of large animals due to agricultural regulations etc.
rpep··on Ask HN: What has your personal website/blog done for you?
I only started last year. So far not a lot! I find it helps me clarify my own thoughts however.
rpep··on Python-based compiler achieves orders-of-magnitude speedups
You can certainly use it, but whether you see any benefit is going to strongly depend on your workload. If you're doing significant calculations in the API then it might be considerably more performant, but if your API is primarily retrieving things from the database and transforming it to JSON then you're going to be limited mostly by the database latency and so I wouldn't expect major improvements.
rpep··on Show HN: Faster FastAPI with simdjson and io_uring on Linux 5.19
This isn't a silly question at all, and it's quite complicated.

When compiling C/C++, with some compilers you are able to specify multiple architectures and provide a fat binary. It's been a few years now since I've worked on this sort of thing, but the Intel compiler for e.g. used to allow you to do something like this at the compilation stage

-march=avx,avx2,avx512

And at runtime, your processor would use the most recent instruction set. In practice, you don't always want to do this, since you produce fat binaries - i.e. every function call that's got vector instructions will have multiple versions, and the file size goes up, library is slower to load, etc... I can't remember if there was an overhead too to each function call. So instead of doing this, what is also common is to compile N versions of the library (one per instruction set), and then load the appropriate version at runtime. This you can do with any compiler, and is indeed what Intel do themselves with the MKL library - if you look into the package for it, you can see that you end up with multiple shared libraries, each with a suffix saying which instruction set it supports (e.g. libmkl_avx.so, libmkl_avx2.so, libmkl_avx512.so). I'm not familiar with simdjson so not sure which approach it takes.

Interestingly, if you use ARM processors, the SVE instruction set is designed so that you don't need to re-compile if a new processor family comes along with longer vector processing units.

rpep··on Tell HN: Gitlab Premium pricing increases incoming $19 to $29
Premium is already expensive considering that GitHub enterprise is $40/user/month and has many more features.

I’ve been following a number of open tickets and certain things I consider pretty basic features aren’t possible at the moment. You can’t block merges that aren’t up to date with the target branch, and merge trains are “too clever” a way of doing that. You can’t block people from being able to reveal secrets in the CI system.

rpep··on Why CMake sucks (2021)
This misses the forest for the trees IMO. You have to look at “what problem does CMake try and solve”, and the answer is basically “generating build files for toolchains across a varied set of operating systems and environments”.

Now do I think CMake is perfect? No, certainly not. But syntax is the least of the issues with it. And it’s an enormous improvement on autotools in allowing you to improve portability of your build to Windows for e.g. - and worth saying that this was true before VS added CMake support.

rpep··on World’s largest four-day work week trial finds few are going back
The child benefit threshold makes it pretty bad for most mid to high household incomes too, effectively a 60% marginal tax rate between £50k and £60k if you have a student loan
rpep··on Was the $5B that VCs plugged into escooters worth it?
Here in the U.K. scooters are only legal in specific trial areas and when hired from a company (normally one per city), which vets that the hirer has a driving license, and this ensures the person is riding them with insurance. But there are lots of people using privately owned e-scooters illegally - I live not far outside a trial area and regularly see people on them. This is despite a risk of large fines or even losing your driving license (most people need 12 penalty points to be banned from driving and being caught on one of these is 6 points).

I would be interested to see how profitable these startups are in the face of competition in this direction, because it looks like here there’ll be a liberalisation of the rules at some point. For e.g. I know a couple of people who commute on them, but it would seem to me to make sense for them to just buy one and charge it at home/work if it was legal.

rpep··on The C++ Killers (Not You, Rust)
Never heard of Spiral but it looks really interesting, particularly compared to MKL and FFTW. It’s been possible for a long time for C and C++ compilers to use “profile guided optimisation”, but it’s not widely used in practice because it’s pretty awkward to leverage.
rpep··on The inscrutable nature of UK rail ticketing
The massive database that the author references is actually published here:

http://data.atoc.org/routeing-guide

The “pink book” is the one to look at to identify which “group” your station is part of. Then with the “yellow book”, you can use it to work out valid routes for a particular ticket, because it lists valid maps you need to join together. For e.g. if I want to travel from Nottingham to Southampton the yellow book says I can use maps:

London

BG + BW

BG + RB

DG + BW

DG + RB

Then, looking across those maps, there is a set of arcane rules determining whether a particular route is valid for a ticket which includes some calculations about ticket prices and not being able to double back on yourself through the same station. On top of that, your ticket might have specific rules on it for e.g. it’s not uncommon to get tickets that say “via London” and when that is the case you have to travel by that route.

These rules are detailed in the intro document which is actually a pretty good read (if you’re interested in trains!) and is available here: http://iblocks-rg-publication.s3-website-eu-west-1.amazonaws...

In theory the ticket selling platforms should just implement this routing guide. In practice it’s not straightforward to implement! I also have a feeling of you tried to do some of the more obscure routings that train guards or station staff might not be too happy even though in theory it is permitted.

rpep··on Improving Rust compile times to enable adoption of memory safety
I found most precompiled C++ libraries target a specific minimum microarchitecture because it swells the binary size if you do fat binaries, and for most users they wouldn’t know anyway. Companies always get complaints when they bump up the minimum though - I remember reading some articles about some games requiring SSE4.1 or AVX and gamers complaining they couldn’t play it on their ten year old machine.
rpep··on Is AM radio dead?
In the U.K. it’s still used to broadcast some national BBC stations (BBC R5 Live, BBC Asian Network) that aren’t available on FM and in some more areas it’s used to broadcast stations that are also on FM (BBC R4). They still also operate some LW! https://www.bbc.co.uk/reception/help-guides/fmmwlw-radio/fm-...

Until two weeks ago I used to listen to Absolute Radio in my car over MW but they shut it down.

rpep··on PEP 704 – Require virtual environments by default for package installers
I can't see this being accepted even though I think standardisation is the way to go, because there's a signficant amount of diversity for 'virtual environments' in Python with:

* virtualenv (external library)

* venv (fork of virtualenv included in standard library from 3.3 onwards)

* conda

* poetry

* pipenv

rpep··on Spotify reducing employee base by about 6%
It makes the library a bit useless though. If I'm offline and want to look for a specific artist's music I have downloaded, if I can't remember the name of the album it's not easily findable.
rpep··on Spotify reducing employee base by about 6%
The most frustrating one for me is that saving an album doesn’t add the Artist to your artists list in your Library.
rpep··on Which GPU(s) to get for deep learning
The ROCm libraries and their documentation are nowhere near as good though.

For e.g. compare rocFFT to cuFFT. They're worlds apart still.

rpep··on Ask HN: Will Apple sell any of new MacBook Pro's outside the US?
Most of the additional cost is VAT, and the norm in the US is to show prices without sales tax. It's $1999 for the base model 14" MBP in the US which is roughly €1,850 or £1620

Country, Sales tax, Adjusted Price, Actual Price

France, 20%, €2220, €2399

Germany, 19%, €2201, €2399

Spain, 21% , €2238, €2449

UK, 20%, £1944, £2,149

Ireland, 23%, €2275, €2499

rpep··on How to improve Python packaging
My view is that it is not that hard (with any tool) to build a wheel. You can basically follow a guide, you have to supply the same information, it’s mostly just the format you do it in.

The problem is that compiled extensions are not a minor use case for Python, they’re hugely widely used for packages even if users don’t use them that much. Building a package with no dependencies is still not that hard. But there is no good way to distribute the compiled packages you depend on as their own thing - Intel release MKL as a “Python” package for e.g. but it is just the C library [1]. But of course, if you’re a package maintainer, the chance that the package maintainer of your dependency has both uploaded it to a package manager in a language they don’t use and that also being the version you need is pretty slim. So the issue becomes “how do I bundle every single possible dependency I might need inside a Wheel”, because source installs are not something most Python users understand. Conda and Spack try and fix this issue by being general package managers that can distribute packages in any language, allowing you to depend on FFTW or Eigen or SUNDIALS or whatever you need in your C extensions, and in all of the discussion I don’t think any proposal really tackles this gap.

[1] https://pypi.org/project/mkl/

rpep··on China now publishes more high-quality science than any other nation
“Most cited” is a very poor way of measuring quality and is massively subject to gaming. When it comes to review it’s not uncommon to get comments like “you didn’t cite this paper” where said paper is only marginally related so it’s clear that the reviewer has some interest in you citing it.
rpep··on Strava hikes monthly subscription price
People are annoyed because the competitors have got a lot better and because Strava hasn’t improved over that period, in many ways it’s got more annoying to use.
rpep··on Ask HN: Share your personal site
https://rpep.dev

Just started it really, trying to start writing as I miss it a bit from working in academia.

I used Hugo to generate it and host it on GitHub Pages with a custom domain. I need to make some tweaks to the template I used but not really had time!

rpep··on Python 2 removed from Debian
I worked on a code base which had a large dependency not port to Python 3 until 2018, and at the same time they made a huge ton of changes to the APIs, most of which were not documented well. So there was both a big refactoring to handle binary data transfer between it and the application, and also a ton of other unrelated things just to make it work. It's things like that that made it difficult to port for most people.
rpep··on Why is CI Development so bad?
I think the DSL approach really comes from people liking the simplicity of setting things up. Jenkins allows you to write a job script in Groovy and bring in arbitrary functions, and it feels much more arduous to get something working than say, Gitlab CI. I wrote a pipeline in my current role that span up a database with Docker in the background to run certain tests for a web application. When we ported that from Jenkins to Gitlab, the pipeline was significantly less complex because it was easier to express what was needed in a declarative way.

Where the DSLs fall down is when you need to do something that’s difficult to express, but for the most part if that’s necessary you can always write a script in whatever language you like and call it, which is a worthwhile approach anyway since it’s good to be able to debug your pipelines locally.

rpep··on Map, Filter, Reduce in Fortran (2019)
That’s common to all typed languages and is the motivation behind generics/templates which allow you to write once and provide specialisation where necessary. In older C and Fortran libraries it wasn’t unusual to have to compile a library multiple times to support different input types - FFTW does this for example. Often there’s some macro magic with a variable injected at build time to determine the type.
← PreviousPage 2 of 4Next →