Fork me on GitHub
#off-topic
<
2023-06-01
>
mauricio.szabo00:06:01

TIL: Official YAML documentation considers writing a full compliant parser for YAML almost impossible: https://github.com/yaml/yaml-grammar. Part of their README: > Fully comprehending the YAML grammar is quite an undertaking for most mortals. Creating a fully compliant parser has proven almost impossible.

🤯 4
😅 6
4
dpsutton00:06:46

>> Fully comprehending the YAML grammar is quite an undertaking for most mortals. Creating a fully compliant parser has proven almost impossible. The formatting seems to have dropped the link. But on my phone it seems to be a dead link

seancorfield00:06:30

https://matrix.yaml.info/ is where it should link to...

seancorfield00:06:19

The C and Perl implementations seem to have come the closest to compliance...

Bob B00:06:17

when I see that there are like ten different notations for multi-line strings, and (maybe) breaking changes in minor versions, I find that assertion less difficult to believe

mauricio.szabo01:06:43

Yes, what I meant is that on the official github page of the official YAML spec, this message "it's almost impossible" is written. Doesn't this raise red flags that the specification needs to change? I mean, this is a valid YAML 1.2:

? foo
? bar
? baz

p-himik03:06:43

Not if they want to keep the same scope (and FWIW I myself can't fathom why would anyone want that, so I avoid YAML whenever I can). Same thing with all the web stuff which is now probably the most egregious case of a feature creep, with some API designs and implementations not being thought through.

souenzzo10:06:36

> I avoid YAML whenever I can I write JSON inside YAML files whenever I can 🙂

respatialized12:06:07

EBNF grammars are really not that hard to write (certainly much easier than understanding this specification); I wish more people interested in creating new plain-text data formats would invest the time into thinking about how to specify them with a formal grammar.

💯 2
borkdude12:06:10

Just throw more AI at producing the right parser, yes this will improve things long term 😛

2
respatialized12:06:53

can't wait until we have a YAML parser that has extremely infrequent edge-case rules that mysteriously fail on windows because the model used the presence or absence of a carriage return as a heuristic for obscure formatting rules

Jacob Doran07:06:34

I always seem to have too many windows and too many tabs open. How does everyone else cope with this?

Martynas Maciulevičius07:06:25

i3 window manager and more RAM trollface

Jacob Doran08:06:07

... I did get my laptop with extra ram because I knew what I'm like ^^

p-himik08:06:42

Heh, I have 312 tabs across 14 windows. And yeah, using a tiling WM. :D Session Buddy is a great extension - at the very least, to battle rare-but-critical Chrome failures where it just forgets your tabs. The Great Suspender is another good one, but you'll have to use a fork and build it from source. There's something wrong with the original extension, but I don't recall what (I think it was sold and became full of tracking).

Jacob Doran08:06:53

The resume on The Great Suspender always jarred me. I wouldn't mind being able to name or label my windows. And summon them by a launcher or something.

Martynas Maciulevičius08:06:03

I don't have 312 tabs but I wrote a config for i3wm where I can basically have 22 workspace tags in current context, so 22*26 different workspace tags. 26 is english alphabet and I can have 22 workspaces for each letter when I want to switch context. If anyone's interested I could share part of my i3wm config. This is not for browser, this is OS-level windows. This way I use multiple instances of firefox at the same time. My workflow is fully keyboard-driven and I don't use mouse to switch these contexts.

elken08:06:13

Onetab for tabs, a good tiling window manager for windows

Jacob Doran08:06:46

Martynas that sounds really useful. I already use a containerised FF, multiple instances should be an easy next step

Martynas Maciulevičius08:06:39

My config is not for everyone and you should try what works best for you. It still works the way i3wm works in vanilla way but with this small twist.

Martynas Maciulevičius08:06:32

I also wrote a search tool to search my open windows. This way I can switch to a window when I briefly need to access something in context which is "far away".

Jacob Doran08:06:07

Yeah that sounds like a feature I've been needing for years. Any help in that direction would be great.

Martynas Maciulevičius08:06:02

What OS do you use? i3 doesn't work on windows. I think you can't customize windows up to this extent and with new version you can customize it even less.

Jacob Doran08:06:25

macOS at the moment.

Martynas Maciulevičius08:06:17

> macOS at the moment. Sorry. My suggestion is for GNU/Linux only. And it took a lot of time to develop what I have for myself. So it's not a thing I just downloaded in 5 minutes. (Actually there is a plugin for i3wm where you can name workspaces but I have something more basic which I value more (also that plugin encourages mouse interaction ™️))

Jacob Doran08:06:30

https://github.com/koekeishiya/yabai this looks to be similar. But frankly if the i3 works as well with my brain as i think then i might just switch

Jacob Doran08:06:25

That makes a lot of sense, kind of like a multi year emacs config, it's not something that you can do. ^^

Martynas Maciulevičius08:06:12

Seems to be something quite similar: https://www.steven-braun.com/blog/2022/i3wm-to-yabai/ I can't comment about MacOS as my experience with it was negative (brew is not up to standard; sshfs is not good). i3wm is very basic out of the box.

Jacob Doran08:06:01

Yeah macOS leaves much to be desired, but for the moment it get the job done. Until it doesn't then I swap ^^

Martynas Maciulevičius08:06:21

The good thing with i3wm and the way it all works is that you can choose your display manager upon login. This way I have multiple desktop configurations and I can use one as a fallback one. This is useful when configuring because you're not afraid to break everything. I think you can't do this one MacOS. I think you have to think about some kind of escape hatch if you manage to brick your UI.

Jacob Doran08:06:26

True, though safe-mode would stop yabai from launching, so similar effect.

Martynas Maciulevičius08:06:46

You're allowed to brick way more stuff in Linux than in MacOS. So having multiple "safe modes" is pretty good because if I brick my window manager I can recover the system without a reboot (ok, log-in-log-out but still no full reboot).

tomd08:06:09

It may be worth looking at this as a hoarding problem, not just a technology problem. Lots of articles like this online: https://www.vice.com/en/article/88adya/death-by-1000-tabs-confessions-of-a-tab-hoarder which apply more to the "too many tabs" issue than the "too many windows" issue, but I think the basic idea is the same. Not to say a tiling window manager isn't great - I use i3 myself. But more for the keyboard-centricity and the minimal interface than because it allows me to manage hundreds of windows. That's a tougher problem to solve than downloading and installing a window manager - it involves learning to let go of tabs/windows which you probably won't need again, and knowing if you do need them, you will be able to find them.

2
Jacob Doran08:06:20

True, many a time I've bricked macos and needed a restart. Couple of times a reinstall (don't poke at the default python).

Martynas Maciulevičius08:06:04

> Couple of times a reinstall I think it's rougher with Linux. But when it works then it really works.

😄 2
Jacob Doran08:06:29

The hoarding is an issue. I've started using obsidian, hoping I can pull down the tabs, but I still seem to get nerd sniped and open a bunch of things.

😄 2
p-himik08:06:33

Hoarding is not an issue if you enjoy it! :)

😂 4
Martynas Maciulevičius08:06:58

> hoarding problem There are the people that are addicted to eating plastic and now this? 😄

😆 2
Jacob Doran08:06:45

Ooh dinner is here. Thanks for the ideas everyone. I'll report back in a couple of days to let everyone know what I learned.

Martynas Maciulevičius08:06:41

> Yeah that sounds like a feature I've been needing for years. Any help in that direction would be great. Also you could use Vimium extension. It has a key shift+t...... "Search through your open tabs". But it won't help if you have 1000 tabs as you'll forget what they are 😄

respatialized12:06:38

I close my web browser at the end of the day. It is a small gesture of finality that helps me "log off", with the added benefit of keeping the number of tabs I use down to a manageable level. if I need to find something I looked at previously, searching my browser history is easier than cycling through dozens of tabs.

👍 4
💯 2
skylize14:06:23

Using the new Groups feature in Chromium-based browsers helps a little with organization, but also excerbates the buildup. Honestly, I find most of it is stuff I'm more likely to Google for again when I need it than to even remember I already have open in some tab. So I have been slowly dismantling the groups, moving a few links here and there into my organization app for reference (I use DynaList), while mostly just closing references I can easily find again and making a choice on backlogged articles to either read it now or abandon it.

p-himik14:06:04

Oh, apart from the tab groups, you can also name windows. I often use emojis in them to be able to find the right window at a glance.

skylize14:06:15

I have no title bars, so window naming would be close to useless.

p-himik14:06:39

I also don't have them - it's to find them in the window list.

👍 2
Heather16:06:59

I started using the Arc browser and it's pretty nice for managing tabs and spaces. There is a steep learning curve, though. It's built for the power-user, not the beginner. I've had to stumble upon features or get coworkers to share what they've found.

isak16:06:43

I use Tab Wranger for Firefox. Basically if you have excess tabs, it just starts killing tabs you haven't used for a while. (Number of tabs and the time is configurable). It has a list to restore tabs if it killed something you actually needed.

😂 2
isak17:06:43

I use 3 monitors so I don't feel the need to use a tiling window manager (I can get by with the Windows + Arrow shortcuts), but I want to try fewer monitors and a tiling manager for my next setup.

Alan Carroll22:06:37

I use vivaldi browser with named workspaces and easy tab search to switch

Jacob Doran01:06:58

Good ideas. I've added Tridactyl to Firefox, which is like vimium but a codebase that works with Firefox Quantum extensions. It's doing okay at wrangling my tabs, I do still need to delete a bunch I know I can find again quickly. I've collapsed all my different FF windows into a single one that I can pop between tabs quickly, and that's making it easier to flick between the much fewer windows. I haven't gotten yabai up and running yet, I'd need to modify SIP and I can't be bothered rebooting yet (my uptime is barely 13 days, I'm not due for another week at least).

Mark Wardle10:06:47

How do people manage uint64 types in their web APIs? I naively use unit64 types via edn to and from a ClojureScript front-end and have no difficulty on the JVM, but it turns out JavaScript can't deal with some very big numbers, silently truncating these fields when requesting the same data as JSON. JSON itself doesn't appear to specify a limit, but some implementations fail so that interoperability can only be guaranteed to a certain level (53-bits I think). Do I offer a per-request configuration option for broken clients/platforms, do I always stringify these enormous 64-bit identifiers but break clients that are working perfectly and have no such limits, ignore broken clients/platforms and just add a big warning in the documentation, or do I give up and go and live on a farm?

delaguardo10:06:49

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json JSON.parse and JSON.stringify accept extra parameter where you can apply a BigInt coercion

👍 2
souenzzo11:06:39

it is easy to make bigints work with transit in cljs I can provide an example

Mark Wardle11:06:00

Thanks @U2J4FRT2T - actually I have things working fine in cljs/clj and transit... it is a user of my library using the HTTP API and JSON from R that is the issue... it is truncating very big numbers silently and I gather this applies also to JavaScript.

Mark Wardle11:06:55

Thanks @U04V4KLKC - that is helpful and makes me inclined to say this is a client issue and they take responsibility for dealing with these very large 64 bit identifiers.

skylize14:06:08

Go with the farm! 🐄 🥳

🐑 2
Mark Wardle14:06:16

Sheep and their problems may actually be worse than JSON JavaScript I gather.