• 4 Posts
  • 42 Comments
Joined 1 year ago
cake
Cake day: September 7th, 2023

help-circle



  • I haven’t done too much work with WASM myself, but when I did, the only languages I saw recommended were Rust, C++, or TinyGo. From what I’ve heard, Rust and C++ are smoother than TinyGo. Garbage collected languages usually aren’t great choices for compiling to wasm because wasm doesn’t have any native garbage collection support. That limits your selection down a lot.

    But another option you may want to consider is Nim. As I understand, it compiles to C, so any C->Wasm compiler should theoretically work for you as well. I did a quick search and wasn’t able to find any great resources on how to do this, but you might get a bit more lucky. Good luck!


  • You’re probably right. I think COBOL development is one of the cases where the crazier stories are the ones that bubble to the top. The regular scene is probably more mundane.

    I do think there are a few advantages to learning COBOL over C++. COBOL seems to be much stickier - companies that use it seem much more hesitant to replace it than a lot of the companies that use C++, and as a result, they will probably get more desperate. And while there’s definitely a lot more C++ out there than COBOL, I have to imagine that the number of people under 50 that use COBOL is probably tiny, while C++ still has a very large userbase. On the other hand, consulting depends a lot on your portfolio, references, and past accomplishments, and nobody’s going to pay 1k EUR/USD/etc. per hour (exaggerating, obviously) if you don’t have any credentials. It takes time to build that up.

    Ultimately, I do think you’re pretty spot on, but we’ll have to see. This is more just a fantasy I tell myself to make it seem like retirement is closer than it probably is…



  • This is very interesting! Things like this make me wish programmers would give functional^W declarative programming more of a chance. I’ve long fantasized about being able to write programs as declarative code that the computer can optimize automatically without human intervention. When you implement your program in more restrictive (ie. stateless) paradigms, you can more easily reason about the code, and thereby make it easier to optimize or run in different environments.

    SQL is a great example of this - when you look at some of the optimizations that servers like PostgreSQL can do under the hood, this is because the language inherently limits what you can do so the actual system executing your instructions can do different things with it for better performance and reliability. Things like this are what make query optimizers possible, and it’s really fascinating if you actually read carefully what query analyzers report (beyond just checking whether your indices are being used or not).

    Beautiful chart. Thanks for sharing!


  • Do you know how vim has distributions like lunarvim, lazvim, nvchad, etc.? Simply installing something like lazyvim can quickly and easily convert vim from a text editor to a full blown IDE.

    I think Gnome needs something like this. A curated set of plugins that are easy to install and maintain compatibility with different versions of Gnome - something that would deal with the API churn in Gnome while maintaining a stable, usable desktop environment.

    I don’t know if this is feasible, because I haven’t used Gnome since 2.x, but I think it would really help make it an actual full blown DE.


  • If I want to make a piece of software to improve people’s lives and I don’t care to do it for free, I’ll choose MIT. If it gets “stolen” by a for-profit corporation it only makes it better, because now my software has reached more people, thus (theoretically) improving their lives.

    I’m not completely sure about this.

    Suppose you write a library that a company like Facebook finds useful. Suppose that they incorporate it into their website. I’m sure I can skip the portion of this post where I extol the harms that Facebook has wrought on society. Do you think your software has improved people’s lives by enabling Facebook to do those sorts of things? They would not have been able to do them if you had used AGPL instead.

    And I don’t want to make it seem like we should never do anything because someone might use the product of our work in a sinister way (because that would quickly devolve into nihilism). If 99 people use it for good and 1 for evil, that’s still a heavy net positive. But at the same time, I would be lying if I didn’t acknowledge that the 1 person using it for evil still would make me feel bad.


  • I was surprised that comment this got so many upvotes, so I’ll respond by saying that, with all due respect, I think your argument is much more fallacious than the one you are trying to debunk.

    The comic author takes one specific case of an MIT licensed product being used in a commercial product, and pits it against another GPL product.

    Yes, this is called an example. In this case, the author is using a particularly egregious case to make a broader conclusion: namely that if you release software under a “do whatever you want” license, it may come back to bite you in the future when it’s used in a product that you don’t like.

    This comic is a warning to developers that choosing MIT/BSD without understanding this fact is a bad choice.

    This ignores situations where MIT is the right answer, where GPL is the wrong one

    It does not ignore those situations. All situations are multifaceted and need to take multiple considerations into account. The author is trying to argue that people should take care not to overlook the particular one to which he is trying to draw attention.

    situations where legal action on GPL violations has failed

    Just because legal efforts have failed does not mean that they are not worthwhile. There may be many cases where people avoided misappropriating GPL software because they did not want to deal with the license - there may be cases where people were less hesitant about doing so with MIT/BSD because they knew this risk was not there.

    From that I conclude that this falls under The Cherry Picking Fallacy. While humorous, it’s a really bad argument.

    Just because the author used a single example does not preclude the existence of others. That is a much more fallacious assumption that invalidates much of your argument.

    and all cases where the author’s intent is considered (Tanenbaum doesn’t mind).

    Just because Tanenbaum didn’t mind does not mean that other developers who mistakenly use MIT/BSD will not either. Also, it honestly shouldn’t matter what Tanenbaum thinks because we don’t know what his rationale is. Maybe he thinks malware is a good thing or that IME is not a serious issue - if that’s the case, do we still consider his sentiments relevant?

    commonly referred to as “cuck licenses”

    This sentiment makes the enclosing sentence an Ad-hominem fallacy

    It does not, in fact. Just because the author used a slang/slanderous term to describe the licenses he doesn’t like does not mean that his logical arguments are invalid. Ad-hominem fallacies are when you say “the person who argued that is $X, therefore his logic is invalid”, not when he uses a term that may be considered in poor taste.

    by attacking the would-be MIT license party as having poor morals and/or low social standing.

    Misrepresentation. The author is not arguing that they have poor morals, he is arguing that they are short-sighted and possibly naive with regards to the implications of choosing MIT/BSD.

    My conclusion: I appreciate the author for making this post. People should be more aware of the fact that your software could be used for nefarious purposes.

    So unless you really don’t care about enabling evil people, you should be defaulting to using GPL. If people really want to use your copyleft software in a proprietary way, then it is easily within their means (and resources) to get an exemption from you. The fact that there is so much non-GPL software out there makes the GPL itself weaker and makes it easier for nefarious interests to operate freely.

    (Not that I would ever release software under GPL myself. I think software licenses are stupid. But no license basically has the same non-derivative limitation as GPL so it doesn’t matter as far as I’m aware.)



  • I only briefly dabbled with Arch >10 years ago. But it has always been evident that it is an incredibly powerful distro. The fact that its wiki is so extensive is a testament to how much people are using it. The problem it has always had is that most companies tend to support other ones (Debian, Ubuntu, Red Hat/Fedora, Alpine), so it never really had any corporate love. With Valve’s backing, we can see just how widespread Arch could be if it had more money behind it.

    Not that this is necessarily a good thing of course. Look at how money has corrupted Ubuntu and Red Hat. All I want to point out is that it can do anything that the most well-supported distros try to do. And the fact that it has done so without any corporate support is a true testament to how powerful it is.


  • This is quite cool. I always find it interesting to see how optimization algorithms play games and to see how their habits can change how we would approach the game.

    I notice that the AI does some unnatural moves. Humans would usually try to find the safest area on the screen and leave generous amounts of space in their dodges, whereas the AI here seems happy to make minimal motions and cut dodges as closely as possible.

    I also wonder if the AI has any concept of time or ability to predict the future. If not, I imagine it could get cornered easily if it dodges into an area where all of its escape routes are about to get closed off.


  • What can we do?

    It’s so funny that people are even asking this question. Go back a few decades (pre-Thatcher/Regan/Mulroney) and the answer would be obvious.

    Every time we see people acting as moronically helpless as this, it’s a true testament to how utterly slaughtered our psychologies have become that we don’t even think of using the tools at our disposal (namely government regulation and anti-trust law) to take action against it. It is so unfathomably out of reach for people to think this way, and this is how utterly destroyed our image of economics and society have become thanks to the devastating policies that they pushed and adopted.

    As overwhelming as it may seem, the most important thing that we can do these days is to make these kinds of conversation normal again. Sure, there are things we can do today, and we should do them, but it’s even more important to win back the public mindset. Once we do that, it will become much, much easier to fix the problem.


  • Agreed on all points. I think some of the issues that you’re facing are things that would be resolved if Ocaml were more popular. But some others would be harder to fix without making breaking changes to the language as I mentioned earlier. If I had to put it as succinctly as possible, I’d say that the language just needs a lot more polish which would probably happen if it were more mainstream. But not all languages have to be mainstream, and maybe Ocaml’s purpose in the world is, as you put it, to inspire other languages. It is definitely extremely good at that!


  • namingthingsiseasy@programming.devtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    30
    arrow-down
    1
    ·
    7 months ago

    No one has said Ocaml yet, so I will. It’s not a perfect language, but it has a lot of cool ideas and concepts. It’s a functional language, but allows you to write imperative code when you want to. Algebraic data types and type matching are built natively into the language and work very nicely. It’s type inference capabilities are very powerful (though that can backfire at times), and the |> operator is really, really fun to use. It also has very powerful module/functor capabilities, though they go a bit over my head since I haven’t had a chance to play with them. Also, Opam is a very powerful package manager and it’s pretty easy to wrap/bind external libraries with it.

    I’d love to see some improvements to the language - the syntax is a bit confusing and ugly at times (but this unfortunately can’t be fixed without breaking the language of course) - but overall I think I’d have a lot more fun programming in Ocaml than what I do in my day job.


  • Agreed. Objects are nice and a great way to program. Composition is great. Traits/interfaces are great. Namespaces are great. Objects are a really nice way to reap the benefits of principles like these.

    But then there are aspects of OOP that absolutely suck, like inheritance. I hate inheritance. The rules get very confusing very quickly. For example, try understanding overriding of methods. Do I need to call the superclass method or not? If not, does it get called automatically? If so, in what order? How do these rules change for the constructor? Now repeat this exercise for every OOP language you use and try not to mix them up… Java, C++, Python, etc.

    Fortunately, it feels like we rely on inheritance less and less these days. As an example, I really like how Java allows you to implement Runnable these days. Before, if you wanted to run a thread, you needed a separate object that inherited Thread. And what if that object needs to inherit from another one too? Things would get out of hand quickly. (This is a very old example, but with lambdas and other new features, things are getting even better now.)

    Anyway, long story short, I think OOP is a complicated way to achieve good principles, and there are simpler ways to achieve those principles than a full OOP implementation.


  • Agreed, Linux is quite popular in academia, particularly in any technical field. A lot of scientific software has to run on Linux because of supercomputers, and especially a lot of open source software is Linux only. So a lot of students run Linux for convenience, and a lot of computer labs run Linux as well. Of course, there’s also the fact that lots of people just think Linux is better than the alternatives, and they’re more likely to try new things when they’re at a university student’s age.

    So I feel like that would probably be a significant contribution to the 2% that’s being reported




  • My advice would be to learn C first (or at least develop a good understanding of it). It’s extremely important to understand how memory works in C so that you can understand pointers in C++; and also important to understand how functions work so you can understand classes and methods in C++. I would go through The C Programming Language. It’s fairly concise and while you don’t have to go through it cover to cover, you should at least understand the chapters on structs, pointers and functions (up to chapter 6, I believe).

    (Note that the wikipedia link that I posted above has a link to the full text of the book in pdf format.)

    The reason why I think it’s important to understand C is because when you learn C++, then you’ll understand how the language abstracts over a lot of the lower-level functionality in C. new in C++ supplants malloc in C for example, and your understanding of functions in C will map to more complicated concepts like constructors, destructors, copies, methods, and operators in C++. At this point, I would probably start learning how classes in C++ work. They’re basically structs with private member variables and methods defined in the scope of the class. learncpp.com, is the best reference that I’m aware of (it’s very thorough, which makes for a pretty slow read, but you’ll understand it very well). I would probably start with chapter 14 (introduction to classes), and then go back to the earlier chapters to fill in the gaps, but this is more dependent on how you think you learn best.

    Be aware though, that if you don’t have existing experience with OO development, then C++ is (in my opinion) not a great language to start learning it, because a lot of it is hacked on top of C and implemented in arcane ways in order to maintain compatibility with C. The first language I learned was Java, and it was really helpful to have that as a background for when I learned C/C++. I’m only familiar with Javascript on a procedural programming level, so I’m not aware of its OO functionality or how well that will translate to C++, but hopefully it works out.

    Good luck!


  • Agreed overall, you will still be competent switching from one language to another, but intricacies and nuance matter a lot here. You may have enough knowledge to solve problems, but will you have enough knowledge to avoid creating new ones too? Like performance issues, or memory leaks, or other unwanted behavior? C++ is a great example here: someone that’s smart but inexperienced might just be dangerous enough to start writing classes with dumb pointers without overriding the copy constructors, and this is just a recipe for disaster.

    I think it would take more than a few months to develop the kinds of experience that you need to be aware of these issues and avoid them. And while C++ is a very easy example to point out here, pretty much all languages have their share of footguns to be aware of, and it just takes time to learn them. A “deep knowledge” of a language is not just about being faster and more productive; it’s also about not creating more issues than the ones your solving.


  • This one might be a bit controversial, but has rung true in my general experience. Probably a lot of exceptions to these rules, but here goes:

    You don’t really know a programming language until you understand a fair amount of the standard library and how packages/modules/dependencies work. Syntax is pretty easy, and any mainstream language will work just fine for solving basic leet-code style problems. But when you really spend a lot of time working with a language, you’re going to spend more time learning about common libraries and how to manage dependencies. If you’re working with a language like C++ or Java, this could also include build systems and how to use them.

    Another precursor to being able to say that you know a language is that you should also be familiar with best practices (ie. how to name modules, how to write documentation, etc.) and common pitfalls (undefined behavior, etc.). This is one of the hardest parts about learning a new language in my opinion, because the language may not necessarily enforce these things, but doing them the wrong way can make your life very difficult.