shx's recent activity

  1. Comment on Denmark to allow 'significantly reduced' mink production – limits on the number of people allowed to visit farms in ~enviro

    shx
    Link
    This makes me sick.

    This makes me sick.

    1 vote
  2. Comment on :-) is 40 years old now in ~comp

    shx
    Link Parent
    I don't see how it works out from, like, a geometric perspective? But the puns make me think that it's some sort of Prince symbol haha

    I don't see how it works out from, like, a geometric perspective? But the puns make me think that it's some sort of Prince symbol haha

    4 votes
  3. Comment on Experience with Crystal programming language? in ~comp

    shx
    Link Parent
    Crystal has a few web development frameworks, but I have not used them myself. There’s a collection of most crystal packages (shards) here, and the web framework section of that page is probably...

    Crystal has a few web development frameworks, but I have not used them myself. There’s a collection of most crystal packages (shards) here, and the web framework section of that page is probably helpful. I’m somewhat friends with the author of the Athena library, so it might be worth checking out :)

    I’m not really aware of any areas where Crystal can’t reasonably be used. Personally, I’ve been drinking a little bit of the Rust kool-aid recently, so I think that things like GUIs and embedded devices should avoid languages that allow direct use of pointers and garbage collection (Crystal is an example of this, but so are almost all modern languages - this is a pro-rust point, not an anti-crystal one).

    It’s worth mentioning that the community is still small, so there are some rough edges to be found. None of them are unfixable, and they will only get better with time. However, if you’re brand new to programming, or you’re looking to learn a language that will land you a tech job, Crystal is not the right choice right now.

    I also want to mention that, although Crystal is a compiled language, there is actually an interpreter being developed by the core team. So, at some point in the next couple of years, you’ll be able to use Crystal just as dynamically as ruby or python, and then compile it for a free 80x speedup :)

    Feel free to ask me any other questions you have.

    2 votes
  4. Comment on Experience with Crystal programming language? in ~comp

    shx
    Link Parent
    Us programmers are really unkind to ourselves and our peers, huh? Haha

    Us programmers are really unkind to ourselves and our peers, huh? Haha

    1 vote
  5. Comment on Experience with Crystal programming language? in ~comp

    shx
    Link
    I've used Crystal a ton over the years! For context, I got my start in java, then moved to web development while doing stuff in C (arduino) at the same time. I also work in python a lot as part of...

    I've used Crystal a ton over the years!

    For context, I got my start in java, then moved to web development while doing stuff in C (arduino) at the same time. I also work in python a lot as part of university.

    Crystal has nailed a LOT of my biggest criteria, and I highly recommend it. I'll enumerate a few:

    Speed: Crystal isn't going to outperform C or Rust unless you're really forcing it to, but it does not disappoint in terms of speed. I do a lot of scientific computing for my degree, and Crystal lets me be lazy and write dumb, unoptimized code that still only takes a couple seconds to run. I do usually write optimized code anyway, but it's nice to have that be a choice and not a requirement.

    Typing: Crystal's type system is really neat - I won't explain it here, but long story short: specifying types is optional, but the compiler will figure out all types your program uses and ensures that the code you've written makes sense. So if you have a function sub(a, b) that returns a-b, you don't have to specify what types a and b are. But, if you call the function with a string and float, the program will not compile. This is what lets crystal look and feel like an interpreted language, while still being so fast and type safe.

    Standard library: This is hugely important, in my opinion. I have never seen a standard library as well curated and generally useful as Crystal's. Regex? Built in, easy. Parsing config files? In there. Crystal also has incredible serialization support, so saving and loading objects to disk is easy. The standard library is also really well factored - for example, if you need a custom container type, you can just include the "Indexable" module in your container, and suddenly it can do everything a normal array can.

    Package management: Crystal's package manager is basically the only one I can tolerate. You tell it where to find the package you want, and then it clones the library into your project's "lib" folder. Packages are only installed locally, you don't need to worry about venvs or global version conflicts. It is the only package manager that feels like it makes things easier, not more convoluted.

    Build System: There isn't one :) Almost all programs are built and run in the exact same way, and you don't have to spend hours digging through cmake documentation before getting someone's code to run.

    Metaprogramming: Crystal has a very powerful macro system. I once wrote breadth first search in it as part of a compile-time safety check I wanted to add to a weird function. The documentation for this is lacking, though.

    Syntax: This is the most subjective, but ruby (and hence crystal) is one of the prettiest languages I've seen. There aren't any useless decorators (semicolons are an example, although I used to prefer them, a better example is brackets around the condition of an if statement), the style is very functional (you can do things like array.each to iterate, array.each_with_index if you need an index as well), and boilerplate is nonexistent. It also uses a more ergonomic set of brackets than most languages - parentheses are used for generic types rather than angle brackets, for example.

    Apologies for the erratic writing - I'm exhausted, but I figure it's the least I can do to share some of my favourite things about the language.

    12 votes
  6. Comment on File not found: A generation that grew up with Google is forcing professors to rethink their lesson plans in ~comp

    shx
    Link Parent
    I don't think this problem is quite as severe as the article says, but as someone who also did first year eng in 2017, I definitely wouldn't call the premise absurd. There are a lot of people our...

    I don't think this problem is quite as severe as the article says, but as someone who also did first year eng in 2017, I definitely wouldn't call the premise absurd. There are a lot of people our age who have never needed to interact with filesystems in any detail - from grade five, every public school computer I used (outside of an elective CS class) was a chromebook. Sure, google drive still has files and folders, but it's generally more abstracted to "these are my recently edited google docs". I've met people who aren't comfortable with filepaths or archives, and I'm sure that most of them just grew up on chromebooks and mobile phones.

    Not to say that this is gen Z's fault or anything - we just grew up during the period when companies were aggressively working to abstract away everything but apps and documents.

    8 votes
  7. Comment on What's something that is, surprisingly, made with animal products? in ~enviro

    shx
    Link Parent
    My apologies for misunderstanding. The third argument I listed is a very common appeal to nature when people discuss veganism. Your third paragraph (which is critical of ethical veganism) is...

    My apologies for misunderstanding. The third argument I listed is a very common appeal to nature when people discuss veganism. Your third paragraph (which is critical of ethical veganism) is immediately followed by: "However much it might clash with modern ethos, animals have to kill to live." I interpreted that sentence as you presenting another perceived flaw in vegan argumentation.

    Thankfully, that was the least important response I wrote. I hope you can see my point of view about the first two.

    3 votes
  8. Comment on What's something that is, surprisingly, made with animal products? in ~enviro

    shx
    Link Parent
    You pose a lot of interesting questions there, and I've spent a fair bit of time thinking about them in the past. I want to start off by saying that I have no hard feelings towards you or your...

    You pose a lot of interesting questions there, and I've spent a fair bit of time thinking about them in the past. I want to start off by saying that I have no hard feelings towards you or your post - I know that this is a sensitive topic, and feels very personal. I trust that you have good intentions, and don't mean to be hostile!

    These are the points I took away from your comment:

    1. Why do vegans treat plant / animal suffering as superior to the damage responses of plants?
    2. Ethical veganism is self contradictory, because the best way to stop suffering is to surrender your life.
    3. Predatory animals must kill to live, therefore veganism is unreasonable / unnatural.

    And here are my replies.

    1 - Why do vegans treat plant / animal suffering as superior to the damage responses of plants?
    I've heard this argument a lot of times before, and used to make it myself. Generally, I think that this question is a bit self defeating - would you rather watch someone cut down a tree, or drive a chainsaw into a puppy? We find it innately obvious that plant life is conscious at a far lower level than animal life, if it is conscious at all. Ultimately, this is a matter of evolutionary biology. Animals evolved pain responses and minds because we are mobile. If something hurts me, I feel pain because my body is convincing me that I need to get away from whatever is damaging me. Plants, however, are almost entirely stuck in place. There is no evolutionary benefit for a plant to be able to make plans, or to feel pain. A mind is energetically costly, and useless if nothing in your genetic line has ever been ambulatory.

    As a result, I personally find it silly to worry about the suffering that plants experience - their pain responses only need be robotic, and a mind isn't needed to ooze poison sap from a cut. However, some people surely disagree with me, there. Perhaps the Venus Flytrap has a mind of some sort. Luckily for veganism, a vegan diet actually kills far fewer plants than an animal based diet. When you feed an animal, almost all of the food energy they receive goes into sustaining their body. As a result, eating a cow is energetically much less efficient - one calorie of beef takes about twenty five calories of plant matter to produce. When we eat plants directly, we absorb their energy and nutrients more efficiently, and ultimately have to kill far fewer of them.

    2 - Ethical veganism is self contradictory, because the best way to stop suffering is to surrender your life.
    In our current world, a person must cause some suffering to stay alive. In your comment, you say that this implies "it's not [consistent with ethical veganism] to keep living if you can't do it without harming something".

    In a vacuum without other human beings, there is some sort of mathematical truth to that claim. One cannot cause suffering to other life forms if they aren't alive. However, in the real world, this doesn't hold true. Their loved ones would suffer from the loss, and an ethical movement built around the surrender of human life would cause a tremendous amount of anguish and depression. Of course, you'll have to weigh that hypothetical mental suffering against the physical suffering of whatever it is that you eat.

    Ultimately, my main disagreement with this point is one of practicality. Death might be the ultimate way to reduce our impact on suffering, but even if it is - do we seriously expect that people will surrender their lives so ants and lettuce can live? No, of course no sensible person would. A world without any life cannot have any suffering, but such a world is both undesirable and unattainable. What is attainable, though, is to eat a beyond burger, or tofu, or beans. We could easily treat animals far better. That middle ground - causing as little suffering as is practical and agreeable - is veganism, to me.

    3 - Predatory animals must kill to live, therefore veganism is unreasonable / unnatural.
    I'm basically going to regurgitate what @top said, for this one. Animals do a lot of things that are bad. They eat their young, they maul and torture prey (I had a cat that would catch mice, then smack them against the ground over and over until they died). Why should this impact us? We do not need meat to live. We voluntarily choose to breed, confine, and slaughter 50 billion chickens, 1.5 billion pigs, and 300 million cows every year for food. Some people consider what lions do to gazelles unethical. I think it's bad (the poor gazelles!), but the lions don't exactly have a choice in the matter.

    My apologies for how long this post got. I wanted to provide a thorough reply for each of your points, but it got a little lengthy! I hope that what I've said is useful, and my apologies if you feel I misrepresented any of your points.

    3 votes
  9. Comment on What's something that is, surprisingly, made with animal products? in ~enviro

  10. Comment on What's something that is, surprisingly, made with animal products? in ~enviro

    shx
    Link Parent
    Yup, good point! A lot of people also go vegan for the environment, too.

    Yup, good point! A lot of people also go vegan for the environment, too.

    2 votes
  11. Comment on What's something that is, surprisingly, made with animal products? in ~enviro

    shx
    Link Parent
    Veganism is just about reducing harm done to living beings where possible. It does not say that a human life is equal to that of a cow, or that plants do not have a rudimentary form of experience....

    Veganism is just about reducing harm done to living beings where possible. It does not say that a human life is equal to that of a cow, or that plants do not have a rudimentary form of experience. Of course, I sympathize with how it must seem personal when your spouse's life is thanks to an animal product. That's totally justified, and please rest assured that nobody reasonable wants to prevent the use of animal tissue if it is the only way to save human lives.

    However, we use animal products very gratuitously in our society, and veganism concerns itself with reducing the harm that does. If we can make insulin with yeast in a lab, we shouldn't take animal pancreases for it. If we can live happy, healthy lives eating only plants, we should not eat meat. Some of these things are inconvenient, but if inconvenience can erase suffering, shouldn't we be inconvenienced?

    Also - I see the argument about plant qualia a fair bit, and understandably so. It would be hypocritical to eat plants if they experience things the same way animals do. If plants do experience pain, though, we should kill as few of them as possible. Considering that 77% of our crops* are fed to animals, and animals only provide 18% of our calories, the best way to reduce overall plant and animal harm is to eat plants directly, without wasting their calories on animal metabolisms.

    I hope I haven't come off as rude - I once had the same objections you do, but was eventually convinced. I feel like I ought to do my part and share my viewpoints on the issue when I can. :)

    *77% of our agricultural land - of course land area and number of crops on that land are not mandatorily related, but I assume that we grow crops with similar land efficiency for human food and animal food.

    10 votes
  12. Comment on Oildrop - A self-auditable userscript manager in ~comp

    shx
    Link Parent
    Yup! The GitHub readme contains a section on how to do exactly that, and it's actually my recommended method of installation. I wanted to put in on the Firefox add on store for the sake of...

    Yup! The GitHub readme contains a section on how to do exactly that, and it's actually my recommended method of installation. I wanted to put in on the Firefox add on store for the sake of convenience.

    I really wish there was a better compromise between automatic updates and security. It would be awesome if the Firefox store would show you diffs on extension code, because I imagine most updates aren't more than a hundred lines of tweaking.

    Thanks for checking the project out - it means a lot. :)

    2 votes
  13. Comment on Oildrop - A self-auditable userscript manager in ~comp

    shx
    Link
    This is a project that I've been working really hard on for a while, and it's the first time I'm properly releasing something into the wild. I'm still figuring out how to publish it, but I wanted...

    This is a project that I've been working really hard on for a while, and it's the first time I'm properly releasing something into the wild. I'm still figuring out how to publish it, but I wanted to start by sharing it on Tildes before offering myself as fodder to less polite forums.

    I'd love to hear feedback, if you have any! I actually made a post where I asked for advice on this project, and if you were involved in that, you might notice that Oildrop isn't drop-in compatible with TamperMonkey/GreaseMonkey scripts. I'm still thinking about adding that feature, perhaps in a separate branch, but have been hesitant to because it'll likely increase the codebase size a lot.

    I hope some of you like it!

    6 votes
  14. Comment on What features do you want to see in a userscript manager? in ~comp

    shx
    Link Parent
    Good to know! I'll probably just stick with wildcards, then, as it'll keep me from having to write more boilerplate.

    Good to know! I'll probably just stick with wildcards, then, as it'll keep me from having to write more boilerplate.

  15. Comment on What features do you want to see in a userscript manager? in ~comp

    shx
    Link Parent
    Good question! Unfortunately, it's not such an easy change. Firefox has this nonstandard (or at least it isn't implemented anywhere else) userscript API that webExtensions can use - By using it,...

    Good question! Unfortunately, it's not such an easy change. Firefox has this nonstandard (or at least it isn't implemented anywhere else) userscript API that webExtensions can use - By using it, I've managed to keep my code from actually touching pattern matching, creating <script> tags, or injecting anything. That has the benefit of keeping things small and simple, but it also means I can't mess around with the guts. That API only supports wildcards, so I'd have to fully abandon it and write my own injector if I wanted regex support.

  16. Comment on What features do you want to see in a userscript manager? in ~comp

    shx
    Link Parent
    Thank you! Bauke also seemed to like the idea of detecting script files, so it seems that's a common preference. I already have toggling each script implemented, as well - I think that's really...

    Thank you!

    Bauke also seemed to like the idea of detecting script files, so it seems that's a common preference. I already have toggling each script implemented, as well - I think that's really important, too. Thanks for your opinions regarding cloud sync and syntax highlighting!

    Regarding regex in URL matching - The way things are currently implemented, url matching works with wildcards, but not regex specifically - so, here are some valid identifiers for scripts:

    https://*.google.com/images/*
    <all_urls>

    However, adding actual regex support would require a lot of extra code, so I was hoping people wouldn't mind losing it. Is the wildcard support enough for your use cases? If not, could you give me an example of what kinds of domains you'd use a regex for?

    1 vote
  17. Comment on Do any of you use productivity software (kanbans, scrum, etc)? How do you stay productive and organized? in ~talk

    shx
    Link Parent
    Not OP, but I've been looking for something like TickTick for a long time - thanks for the reccomendation!

    Not OP, but I've been looking for something like TickTick for a long time - thanks for the reccomendation!

    4 votes
  18. Comment on What features do you want to see in a userscript manager? in ~comp

    shx
    Link Parent
    Oh, interesting - I don't think I want automatic updates enabled (I imagine that's a very easy vector for malware), but I think having a manual update option is smart. The .user.js feature is...

    Oh, interesting - I don't think I want automatic updates enabled (I imagine that's a very easy vector for malware), but I think having a manual update option is smart.

    The .user.js feature is handy, I'll definitely look into it.

    I'm using the Firefox UserScript API to handle most of the grunt work, and luckily that already supports wildcard URL matching. It's really reduced the amount of code I had to write, but it's also a bit limiting.

    Thanks so much for the thoughtful reply! I'll keep all of that in mind.

    5 votes
  19. Comment on What features do you want to see in a userscript manager? in ~comp

    shx
    Link Parent
    So far I'm only supporting modern Firefox - it has a userscript API that helps keep the project tiny. I'm not thrilled about that, because it doesn't even seem like chrome or opera are supporting...

    So far I'm only supporting modern Firefox - it has a userscript API that helps keep the project tiny. I'm not thrilled about that, because it doesn't even seem like chrome or opera are supporting that part of the webextensions API. I suppose one benefit of the small codebase is that porting it probably wouldn't take too long.

    I'm still mulling over how compatible my plugin will be with Greasemonkey et al - Obviously it would be nice to use the existing library of userscripts, but ensuring 100% compatibility would probably triple the project's size. I think I'll probably offer some middle ground - fragmentation is a pain.

    Thanks for sharing your thoughts, though! Those are both important issues I hadn't considered much. I doubt the overlap between people who use chrome and people who want to read browser extension source code is pretty small, so I might want to lean in to the niche privacy aware/FOSS browser community here.

    5 votes