700 karma · joined Nov 27, 2011 (15y ago) · 99 submissions
comment 8mo ago · link · parent
I don't believe inlining can take you to the exact same place though. Thinking about explicit INLINE pragmas, I envision that if you were to implement your partial function application sugar you would have to decide whether the output of your sugar is marked INLINE and either way you choose would be a compromise, right? The compromise with Haskell and curried functions today is that the programmer has to consider the order of arguments, it only works in one direction but on the other hand the optimisation is very dependable.
comment 8mo ago · link · parent
getClosest :: Set Point -> Point -> Point
You could imagine getClosest build a quadtree internally and that tree wouldn't depend on the second argument. I say slightly contrived because I would probably prefer to make the tree explicit if this was important.
Another example would be if you were wrapping a C-library but were exposing a pure interface. Say you had to create some object and lock a mutex for the first argument but the second was safe. If this was a function intended to be passed to higher-order functions then you might avoid a lot of unnecessary lock contention.
You may be able to achieve something like this with optimisations of your explicit syntax, but argument order is relevant for this. I don't immediately see how it would be achieved without compiling a function for every permutation of the arguments.
comment 8mo ago · link · parent
Functions can be done explicitly written to do this or it can be achieved through compiler optimisation.
comment 1y ago · link · parent
Reverse proxy, DB, etc from Debian. The application server is built and deployed with nix. The Python version (and all the dependencies) that runs the application server is the tagged one in my nix flake which is the same used in the development environment.
I make sure that PostgreSQL is never upgraded past what is available in the latest Debian stable on any on the dev machines.
comment 1y ago · link · parent
[0]: https://sioyek.info
comment 1y ago · link · parent
comment 1y ago · link · parent
In code I have control over myself I avoid imports that doesn't enumerate all imported symbols. That is I always use the import Library (symbol) syntax in Haskell and never do wildcard import in Python.
When coding C I sometimes use tags so that I can go to definitions quickly, I should probably use it more than I do to be honest.
I do use hippie-expand for quick auto-completion but it is completely textual, it has no understanding of the programming language it currently works on which makes it much less powerful of course but it also has some benefits.
I always have the documentation very reachable, I use a search keyword in my browser to search on hoogle. I type H <Space> symbol/type-expression <Enter> and I quickly find the documentation.
I do use Visual Studio on a Windows box for working on a C# codebase a couple of times per year and when I do I always turn off that code lens thing and I find that I rely on the code navigation features quite a bit. Part of it is probably due to it being a code base that is larger and that C#(/Java)-flavoured OOP makes the code more spread out. In terser languages like Haskell (which is much terser) it is natural for more functionality or types to live in the same file which means that you get much further with just simple textual search.
comment 2y ago · link · parent
https://en.wikipedia.org/wiki/List_of_minimum_annual_leave_b...
comment 3y ago · link · parent
It's short and sweet game and a good introduction to interactive fiction (IF) in my opinion.
comment 3y ago · link · parent
https://www.dell.com/community/XPS/FAQ-Modern-Standby/td-p/7...
comment 4y ago · link · parent
Before that for a short period I really wanted to get into darcs, the first DVCS I used. I was constantly confused about what commands to use to rectify the off-the-happy-path situations that you find yourself in every now and then. The UI might have been better than git's in a lot of ways but it was distinctly higher-level.
When I learned git and understood the underlying model I had far fewer problems. The commands of early git could have been designed better, but they were more transparent in what they did.
The thought haven't struck me before, but maybe one of the great things about git is that even the low-level/plumbing commands (cat-files/ls-tree/show-ref) have well written man pages.
comment 4y ago · link · parent
BEGIN;
DELETE FROM product WHERE id=123;
ROLLBACK;
--COMMIT;
And then I remove/comment the ROLLBACK and enable the COMMIT when I'm confident it's correct. This way I also get the number of affected rows for the statement.I do this even on the command line but it's handier in an Emacs buffer and for busy databases you then don't need to worry about other transactions and locking while you type.
comment 4y ago · link · parent
I'm one of those weirdos that disable transient-mark-mode because I don't feel like it does the right thing for all situations where you use mark. Sometimes I want to use mark like a cheap bookmark and C-x C-x between mark and point, sometimes I use the rectangle commands and for those transient-mark-mode only makes things worse.
(I know the CUA mode has some fancy rectangle features, but that's not for me)