HackerTrans
TopNewTrendsCommentsPastAskShowJobs

vq

no profile record

comments

vq
·قبل شهرين·discuss
And Haskell is an ensemble of rainbows. It's very fun and pretty to look at.

Type classes can smooth over some of it but it's not unusual to have to do some plumbing.
vq
·قبل 4 أشهر·discuss
I didn't consider inlining but I believe you're correct, you could regain the optimisation for this example since the function is non-recursive and the application is shallow. The GHC optimisation I had in mind is like the opposite of inlining, it factors out a common part out of a lambda expression that doesn't depend on the variable.

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.
vq
·قبل 4 أشهر·discuss
One slightly contrived example would be if you had a function that returned the point of a set closest to another given point.

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.
vq
·قبل 4 أشهر·discuss
One "feature of currying" in Haskell that isn't mentioned in the fine article is that parts of the function may not be dependent on the last argument(s) and only needs to be evaluated once over many application of the last argument(s) which can be very useful when partially applied functions are passed to higher-order functions.

Functions can be done explicitly written to do this or it can be achieved through compiler optimisation.
vq
·قبل 5 أشهر·discuss
It may or may not change everything.
vq
·السنة الماضية·discuss
Emacs is practically a product of AI research.

Even if it didn't, it's distributed with a psychotherapist mode, hippie-expand (which I use almost every day) and dabbrev.
vq
·السنة الماضية·discuss
I maintain a couple of Debian servers and this is how I do it too.

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.
vq
·السنة الماضية·discuss
Are you aware of Sioyek[0]? It's a PDF viewer with a fairly minimal UI and a focus on keyboard interaction.

[0]: https://sioyek.info
vq
·السنة الماضية·discuss
It reminded me of the Sinclair Zeta[0][1]. I hope their product work out better.

[0]: http://rk.nvg.ntnu.no/sinclair/vehicles/zeta.htm

[1]: https://www.grantsinclair.com/vehiclehistory
vq
·قبل سنتين·discuss
The reason I spelled it out is because I don't use them even though they are available. I realise now that what I wrote is ambiguous, thanks for mentioning it.
vq
·قبل سنتين·discuss
I work almost exclusively in Emacs without the modern LSP-based tools. I believe I do keep more in my head than programmers that use more advanced IDEs.

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.
vq
·قبل سنتين·discuss
My python+numpy+matplotlib version from when I was playing around with it:

  import numpy as np
  import matplotlib.pyplot as plt
  n = 2048
  X, Y = np.mgrid[:n,:n]
  plt.imshow(X^Y, cmap=plt.cm.Spectral)
  plt.show()
vq
·قبل سنتين·discuss
I've had luck with the Prologix Ethernet<->GPIB adapters[0]. At $500 I wouldn't call them cheap but they are a lot easier to integrate than those old NI/Keysight PCI/USB-based interfaces.

[0]: https://prologix.biz/product/gpib-ethernet-controller/
vq
·قبل سنتين·discuss
I live in Sweden where we have minimum 25 paid vacation days (I have 28) and 9 paid holidays.

https://en.wikipedia.org/wiki/List_of_minimum_annual_leave_b...