Hacker Newsnew | past | comments | ask | show | jobs | submit | Corsome's commentslogin

> Treesitter is baked in for syntax, eglot is baked in for language servers (intellisense),

Sadly the two of them don't seem to mix well together (eg rust-mode works well with eglot but rust-ts-mode makes eglot ask for LSP server binary and then still does not connect).

Looks like it's early toothing problems but it's not that straightforward (at least yet).


> This is actually not so strange– you can think of many structures as functions. For example, you can think of a number 3 as a function. When you multiply it by things, it makes them three times bigger.

I don't see how 3 can be a function from this example. "3*" (partially applied multiplication by 3) looks more like it.

Matrices and vectors as functions? Yeah, if the argument is within bounds. That makes it just an indexing operation.

(I guess one can view 3 as a one element vector but that sounds like a degenerate case)

Or maybe I'm missing something...?


Check out Peano arithmetic.

Intuitively, natural numbers come from and are defined by counting, and that implies that "3" means inherently that something (could be anything) happened or was repeated three times. For example, if you have three apples, that means that you can identify one particular apple that you have, then do that again, then do that again.

Adding a unit to a number is like adding further information on what it is that is being repeated. Three pairs of apples? You just invented the number six!

The meaning of doing something three times (most abstractly: applying the successor function) is already inherent in the meaning of three, so multiplication isn't something that has to be added on top. It's already in there.



3 is the following function: 3 == lambda x: 3*x

But I think that the technical, mathematical way to think about it is:

The monoid of linear functions L:R->R is isomorphic to the monoid (R, *)

Meaning, the structure of 1x1 matrices under multiplication is exactly the same as the structure of real numbers under multiplication.


Importantly matrix multiplication is the same as function composition of the linear functions, hence the analogy to functions that multiply by a factor.

Seems trivial but among other things it implies associativity, which is not quite trivial for larger matrices.


I think the mathematical concept that you are looking for is that of the dual space. Essentially if you have a vector space V, you can construct a dual space V* where the elements of the dual space are functions taking elements of V to the underlying field F, and under certain conditions these spaces are isomorphic (the same) - so there is a 1:1 correspondence between elements of the vector space and the functions in the dual space.


Hmm you're right, I didn't quite explain it well. The idea is that you can think of `3` as a function that makes thing three times bigger, and think of `*` as a function application operator. So `3*x` is equivalent to `three(x)`. I'll think on this more and change the wording to try and make this more clear.


I take it as analogous to the association of a matrix to a linear transformation. This association is via multiplication.


It looks really great!

Is it just me or the output PDF has quite a bit of broken pages (eg after Working with Types section)?


> Is it just me or the output PDF has quite a bit of broken pages

Nope! The breaks are really there. I guess they converted the HTML to PDF somehow and it didn't work as expected. However, in case you need it offline, the source [1] is written for zola [2] - a single-binary static site generator (of course written in Rust). You can clone the repo and run `zola serve` in it. It renders quite well.

[1] https://github.com/ralfbiedert/cheats.rs/

[2] https://www.getzola.org/


Phew. After being a Windows user for literally almost two decades I've happily migrated to Linux and couldn't be happier. Yep, it took some time to prepare but let's be frank, developers already use quite a lot of Linux/Unix tools already so why not cut the middleman and just work directly with what we need most?


Exactly. I made the switch from MacOS and couldn't be happier. The fun thing is that with Linux these days you have the option of a powerful workstation that you can upgrade be it laptop or desktop, can do gaming, and is private. The next thing for me is to "decloud" - meaning remove any and all online services that are not mission critical.


Yup, same here. And the sad things is that Windows was getting so close. Between WSL2, the new terminal and ssh, all the support for VSCode and better dev tools and open source language support, I was becoming a bit of Windows 'fan' and this close to seriously considering Windows 10 a fully usable developer desktop. Then they released Windows 11 and completely shit the bed.


Personally I think there are multiple forces acting on Windows at the same time. Some of them push it to a good direction (cases you mentioned) some of them less so.

We live in a times that are good for developers: we not only have free access to powerful tools that other professionals need to pay big bucks but it goes even further: with open source we can co-shape these tools and in the extreme cases fork and create our own derivatives.

Why not take advantage of this and just avoid proprietary solutions as much as possible?


Well said.

> The next thing for me is to "decloud" - meaning remove any and all online services that are not mission critical.

For me there are multiple parallel "side quests" and decloud is definitely one of them (I strive to minimize cloud and select solutions that can be self hosted and that are E2EE. Then I pay for hosting anyway but I always have an option of rolling my own. Example: etesync for calendars and contacts).

Other side quests: instead of Gnome use Sway, this requires manually picking wifi/Bluetooth connection managers (iwctl and bluetoothctl work well) and other tooling.

Yet another: convert my entire family to use Linux. Sadly this is harder since schools teach Windows but Gnome looks very similar to what they use.

These are just some examples. The good thing is that all of these are small steps that can be taken in any order to improve the situation in small increments.


> The next thing for me is to "decloud" - meaning remove any and all online services that are not mission critical.

These are often useful, so the better option is to host your own privacy-respecting versions of these tools.


I should have phrased it better, indeed what I meant is self hosting by "declouding" from public clouds. My only concern is realiable self hosted backups. But I already have my own setup for newsfeeds, document storage, even for calling friends and relatives, and at the fraction of the cost (I factor in the value of my privacy as part of overall cost). I think there is good potential for self hosted products out there. A major pain point though is self hosting emails, since that requires a lot of work around spam protection and availability.


I use an iPhone and other than that I hope to not use anything else that’s so cloud reliable. Maybe an AppleTV if I get one, but I only watch sports so a few cable channels are more than enough for me I think.


The nasty issue is that even tvs are turning into covert spies and are starting to show ads. So even if all you do is watch cable channels, the TV itself might still be spying on you. You perhaps need a "filter" such as a raspberry pi or a device that can transfer content via HDMI and have the tv completely cutoff from the internet. Really dubious times we are in.


Just don't use wifi or connect your TV to the internet. That works for me. My TV is online only during firmware updates which almost never happen cause its become old and those stopped long time ago.


how do you deal with absence of working task manager? any random hang-up is a forced restart, no way to kill offending process as EVERYTHING just freezes up. Tried forcing myself to migrate to Linux, even after forcing no updates, a lot of things magically stop working or break, forcing me to spend hours on google to fix some crap by copypasting random nonsense into terminal. I just want to use my PC, not be a debugger non stop.


> how do you deal with absence of working task manager?

I usually end up using something like htop for a quick overview, together with nvidia-smi when I do GPU-related stuff.

> any random hang-up is a forced restart, no way to kill offending process as EVERYTHING just freezes up.

I've not had this happen for as long as I've used Linux, besides GPU driver bugs/crashes that brought down the computer, but I've had this happen more frequently on Windows than Linux. Processes using up all CPU should make the computer a lot slower to use, but shouldn't bring it down. Processes using up all RAM should be killed by the OOM manager that you distribution should include (but anyways you should have swap setup to avoid the situation in the first place). Processes using up all disk space is a bit harder, but again shouldn't bring the computer down.

> a lot of things magically stop working or break, forcing me to spend hours on google to fix some crap by copypasting random nonsense into terminal.

I'm guessing the problem of having things stop working/breaking "magically" is a effect of random copypasting stuff into the terminal, not the other way around.

Linux does want you to learn about the system in order for you to not mangle it, which has it's good and bad sides. Think of it like a chef having sharp knives in order to do their job better, it's true that you could do more damage if you fuck up, but their job requires them to have professional knowledge about the tools they use, and the knowledge about how to use those tools in a good way.


> spend hours on google to fix some crap

That's the Windows way. It's a bad fit for Linux, because there is no one true obsessively-backwards-compatible Linux.

The good news is we don't need it: Linux isn't a black box, so we don't need to guess or study its behavior. We can look it up instead. The goal here is to construct understanding from documentation, as opposed to deconstructing behavior from testing.

Some great starting points to get your bearings are:

- https://wiki.archlinux.org/

- https://wiki.gentoo.org/wiki/Main_Page

- man pages


Every distribution has its variation of a task manager, and there’s always (h)top and kill as baseline standards.

Having everything lock up I don’t think I’ve ever seen, only way I could see that happen is a runaway process eats all the memory of the machine, and somehow dodges the OOM killer. Especially if the machine is configured with no swap (don’t do that).

And I’m saying that as someone who doesn’t really like linux.

> forcing me to spend hours on google to fix some crap by copypasting random nonsense into terminal

Have you considered that “copy pasting random nonsense into terminal” could be the source of your issues?


Ubuntu ships with woefully inadequate swap these days. We have to advise our employees to customize the installation process, or they get hangs while building C or Rust packages that sound like what GP is describing


That is frustrating to read. Swap you're not using doesn't hurt anyone, but having no swap can really screw you up.


Both KDE and Gnome have task manager apps as far as I'm aware. And even then, in my experience it's very rare to observe any kind of hang-up that requires restarting the entire PC. Might be because I use a different set of applications. What applications do you observe these hang-ups with?


If things are so frozen that you can't open System Monitor (task manager), try this: Hold down SysRq and Alt, let go of SysRq, keep holding down Alt, then press these buttons in order (don't need to hold them): REISUB - to remember it: "Raising Elephants Is So Utterly Boring", also known as "raising the elephant".

On some systems you need to enable this feature first, so try it out once to see if it works and look up how to enable it, if it doesn't.

https://en.m.wikipedia.org/wiki/Magic_SysRq_key

On most distros, you can also get into a command line, with the combination CTRL + ALT + F1 - F8 (try out which function keys do it for you and how to get back to the GUI). There you can use `ps`, `kill <pid>`, `reboot now` or restart the GUI. I'd keep a note of the exact commands on my phone just in case.

As a sidenote, I've had an issue on a good windows desktop PC where it freezes when watching YouTube or ither streaming services. I can still move the mouse for a bit, but clicking does nothing and I'm unable to even save it from a hard reset with Ctrl + Alt + Delete. Sometimes it won't happen for weeks, but if I'm unlucky multiple times in an hour. Look up "PC freezes while watching YouTube" and you will see I'm far from alone with this issue, Asus motherboards with new AMD processors seem to be the common factor. Haven't had this happen on Linux yet (dual boot) and I've tried everything to avoid these unusual freezes in windows, but nothing seems to help.


Are you on Windows 11? There is an ongoing fTPM issue with AMD firmware that can cause behavior like that. I had this issue and ultimately just disabled TPM in the BIOS. Its supposed to be required for Win 11, but I haven't seen any issues since disabling.


I will try this, thanks.


Well this is the perfect example of the infuriatingly arcane crap that I have to deal with on Linux. Every time I need to do something on Linux, I have to look it up and then when I do - it is some crazy long explanation of hoops I need to jump through to make it happen. I try to keep track of these notes, but it all takes so much time.

I am hoping someone comes up with a fully dis-arcaned distro. Especially ditch (or remap) goofy command line relics into the obvious and easily remembered. Why do we still use CP instead of Copy? Legacy stuff that greybeards would freak if it were changed. Let them use a greybeard distro and make one that is for joe user.

Yes, I use Mint and it is still full of arcane crap.


yes, i much prefer the mac experience where it crashes and says sorry in 13 different languages.


You sound like my mom when she swears she did nothing and it just stopped working. We both know she did something but we also know I will just reinstall windows for her because she really doesn't want to learn something new.


It definitely sounds like you just need to learn a few more basic skills to use Linux.

Also good to note: there's tons of problems uniquely with windows that I'm sure are just "computer problems" and "computer slowness" to you, and you never blame windows.


Not the OP - but I think it's the use of the word "basic" that turns a lot of people off.

"Basic" in Windows is all stuff you can easily do with a mouse. Getting anywhere with Linux requires comfort with the command line, OK, but even after spending a decent amount of time, there are lots of system-specific and application-specific commands that you need to master to actually get the system humming. And a total rabbit hole when errors start to pop up. Getting a handle on all of this, being able to understand and fix errors, this is well beyond "basic" and the condescending attitude "just need to learn a few more basic skills" is a huge turn-off. Saying nothing is more helpful than telling someone they just need to learn "basic skills."


Yup, the nice thing about windows was everything was accessible by both mouse and keyboard so for people who needed the gui to figure things out it’s there for you and for people who are comfortable on the keyboard you used to be able to never think about the mouse. (This is no longer the case on windows 10 even, they’ve totally neutered keyboard navigation and you often need to reach for the mouse or use the arrow keys excessively for many things now).

Linux requires being super comfortable on the keyboard, using cli nearly exclusively and recalling with perfect accuracy arcane letter incantations which if you know the guy who wrote the program and the full name of his dog makes sense but to everyone else is just random letters strung together.


ctrl+alt+f2 to switch to tty2. Log in and reap whatever is hanging. Logout. ctrl + alt + f7 (usually) to get back to the GUI.


I'd suggest Bottom as a TUI alternative to the in-built task managers - https://github.com/ClementTsang/bottom

It works on Windows also and in my opinion is better than the default on there too.


I've never experienced that EVERYTHING freezes up.

If something hangs I just kill or pkill it via the terminal.


> how do you deal with absence of working task manager?

I see people offering nice advice here but I mostly do ps aux | grep thing and then kill (-9) it... or killall :)

> any random hang-up is a forced restart, no way to kill offending process as EVERYTHING just freezes up.

I had the everything freeze up experience initially on a Dell laptop and frankly don't know what was the cause. Maybe missing microcode updates or old firmware? Nowadays it almost never happens (I don't remember it happening over the months). I have an app crash (like Firefox) ~once a month but it's so rare I barely notice.


I know how to use ps or top. what to do when you cannot launch terminal even?


Ctrl+alt+f2 (Or any other F) will give you additional login terminal.


Counter-intuitively my usual go-to is to SSH in from another device (phone, tablet, another computer). 95% of the time when the UI is locked up the ssh daemon is still responsive.

Note: I also do this on macOS but it’s much less useful since there are very few commands to actually restore a session that’s locked up.


I never have the problem of everything hanging except on an old laptop with only 4gb memory, in OOM conditions. If a program hangs I can just use the KDE task manager or kill -9 to make it compliant


htop is a good task manager. At least for me.


On the terminal, all the various "modern" replacements for `top` (btop, htop, bottom [mentioned in an earlier comment], etc.) are all really great. Many are almost on-par with their graphical counterparts these days.


what do you do if you cannot launch it? because everything is frozen


switch to another tty(ctrl+alt+(f1..f12)), log in and launch htop from there.

Unless you are dealing with a kernel panic, this will work.


What no_time said is the answer. Me personally, I always have it running so that I can see what is running.


Your books are indeed excellent!

I was wondering... what's your opinion on Geometric Algebra? (If you have one)


I've watched a few talks and seen cool computational demos about it (see for example https://news.ycombinator.com/item?id=22282452 ), but I still don't really understand it... or should I say I can't "wedge" it into my head ;)

The uniformity of operations and the fact it works in all dimensions is very appealing, but I remember there were some very counter-intuitive aspects too, so I'm not fully on board. Still very cool though!

I guess old school vectors, dot-, and cross- products have the benefit of history behind them, so they feel more intuitive, whereas geometric algebra operations feel somehow foreign to us (to me at least). It would be interesting to see what happens if a student learns geometric algebra first, maybe it will feel more natural then.


Thanks for your take on it!

> It would be interesting to see what happens if a student learns geometric algebra first, maybe it will feel more natural then.

Yeah, I've noticed some people [0] advocating for using it for all physics as soon as possible too.

[0]: https://www.cambridge.org/core/books/geometric-algebra-for-p...


I think you're using a copycat app from Play Store. It's not a real app which is only available through F-Droid.


Ah, that was probably it. Gotta admit, I deserved it then, for not reading carefully enough :)


It's a sad state of affairs, NewPipe being forbidden from distribution because the ad company that owns YouTube also owns the platorm's app store, and the app store being full of scammy apps including clones and malicious forks of F/OSS. No one deserves to be presented with traps like that. :-\


No clearer evidence of monopoly harming the consumer than this!


> My software will not be open-source for a number of reasons,

Just to clarify which exact software is not open source? PartsBox looks to be AGPL.

> In-browser camera scanning is available in commercial plans only (due to licensing costs).

I wonder if you checked out https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Det...


I think you are confusing the original Link (Parts-DB) which is AGPL, with the grand parent, PartsBox a different project in the same space, and is not AGPL


Ah, right. Indeed, the naming is super similar. Thanks for mentioning that PartsBox is not open source.


Will the compiler be open sourced?


The source code will be publicly available when we reach beta status(things are moving too fast right now).


This sounds like you're planning to use Business Source License (https://www.hashicorp.com/blog/hashicorp-adopts-business-sou...). Did I get that right?


What if the firmware program has a bug that needs to be fixed? Fixing it would change the hash and thus lock it out from key access but leaving it unchanged will mean the keys can be compromised.

How does Tillitis handle this case?


Could you not have a tiny certified kernel program with an embedded public key that reads the main program, hashes it, checks the signature, and executes it (providing the keys to the main program). Obviously, if you change the kernel program, you would change the keys, but you could change the main program. Anyone with the private key then has the power... they could migrate by running a new kernel (while the TKey is under their physical control) and generate a keypair (deterministically from the new secret key) and export the public key. Then the controller of the private key could sign a program to run under the old kernel that will encrypt that old key with the new public key.


It's tedious, but simple: revoke the old key, rotate to the new one. If you need the old key to revoke it (say you encrypted a disk, or you have wrapped credentials you need to unwrap first), then use the old buggy firmware to do the necessary decryption, then encrypt again with the new one.

Writing the migration program that loads the two pieces of firmware (the old, then the new) to the dongle however is a pain in the butt. Especially if you can't restart the device without physically plugging it out and back in again.


What are the advantages of using Debian testing/sid rolling release instead of a regular rolling release distro (say, Arch)?


Debian Sid is the original rolling release. Its advantage is is that you are on a rolling-release distro but it's still Debian, so all the system knowledge you accrue will apply seamlessly to production Debian servers. Most rolling-release distros, on the other hand, are typically not used on production servers.


Sid is not a rolling release. This is a common misconception.

In preparation for a new stable release, it goes through what is effectively a package freeze. Maintainers are discouraged from updating packages in Sid in order to focus on the new release. So almost no new updates are uploaded to the repositories until Stable is finally out.


That's not exactly a hard rule, just stuff maintainers do because it is far easier to still have normal flow of unstable -> testing for the freeze period, and keeping 2 ("actual unstable" + "unstable on the way to the new release") would be a big burden for maintainers.


Correct. This is why I said “effectively”. At the end of the day, Unstable does run behind during the freeze period. Same for Testing, obviously


Also, packages are tested in sid/unstable and migrates to testing which then becomes the new stable when it's ready.

And packages are tested across releases, enabling one to dist-upgrade to a new version of the system easily. I think it's piuparts that does this job of testing packages among themselves too.


Like toyg says, I really enjoyed having a familiar working environment both on servers and on my workstation. When big changes would come around (like the transition from SysV init to systemd), I'd start getting hands-on experience early, and upgrade production with more confidence.

Between testing/sid/experimental you also got the choice of running "somewhat stable" vs "bleeding edge"; I'd usually stick to testing (except around the freeze leading up to a release).


Most Debian users are advised against using testing and should use Sid instead if new packages are neeed https://www.debian.org/doc/manuals/debian-faq/choosing.en.ht...


What's irregular about Debian, and why would I use Arch instead of it?


I rather meant irregular with regards to Debian Sid not Debian in general.

Arch only has rolling release mode so everyone is using the latest (thus any potential issue in Arch will affect bigger % of Arch users) while Debian has stable and testing and I was wondering if that'd make Sid less stable for practical use (since "it's not stable").

I don't want to start a distro war here, just wondering about some anecdata of actual distro users.


I'd think that both distros work with upstream as much as possible when bugs are found. I'm too lazy to do it, but you could check both distro's bugtrackers for activity to know if one really generates more checking than the other, but I'd be surprised if in practice there's a big difference. Maybe pick a few packages, see how fast fixes are merged?


Anecdata, if you aren't advanced user with new hw, Sid might be more robust, otherwise Arch is superior in almost any way. I wish it wasn't, I like Debian community more, it is less elitist.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: