nickwitha_k (he/him)

  • 2 Posts
  • 223 Comments
Joined 1 year ago
cake
Cake day: July 16th, 2023

help-circle
  • “Interpreted” isn’t especially well defined but it would take a pretty wildly out-there definition to call Java interpreted! Java is JIT compiled or even AoT compiled recently.

    Java is absolutely interpreted, supposing that the AoT isn’t being used. The code must be interpreted by JVM (an interpreter and JIT compiler) in order to output binary data that can run on any system, the same as any interpreted language. It is a pretty major stretch, in my mind to claim that it’s not. The simplest test would be: “Does the program require any additional programs to provide the system with native binaries at runtime?”

    It definitely can’t.

    Well, yes. So not blazingly fast then.

    I mean it can be blazingly fast compared to computers from the 90s, or like humans… But “blazingly fast” generally means in the context of what is possible.

    I find that context marginally useful in practice. In my experience it is prone to letting perfect be the enemy of good and premature optimization.

    My focus is more in tooling, however, so, might be coming from very different places. In my contexts, things are usually measured against existing processes and tooling and frequently on human scale. Do my something in 5 seconds that usually takes a human 15 minutes and that’s an improvement of nearly 3 orders of magnitude.

    My extensive experience is that this step rarely happens because by the time it makes sense to do this you have 100k lines of Python and performance is juuuust about tolerable and we can’t wait 3 months for you to rewrite it we need those new features now now now!

    You’re not wrong. I’m actually in the process of making such a push where I’m at, for the first time in my career. It helps a lot if you can architect it so that you can have runner and coordinator components as those, at their basics, are simple to implement in most languages. Then, things can be iteratively ported over time.

    My experience has also shown that writing Python is rarely a faster way to develop even prototypes, especially when you consider all the time you’ll waste on pip and setuptools and venv…

    That’s… an odd perspective to me. Pip and venv have been tools that I’ve found to greatly accelerate dev setup and application deployment. Installing any third-party dependencies in a venv with pip means that one can pip freeze later and dump directly to a requirements.txt for others (including deployment) to use.


  • You’re both at least partly right. The only interpreted language that can compete with compiled for execution speed is Java and it has the downside of being Java.

    That being said, you might be surprised at how fast you can make Python code execute, even pre-GIL changes. I certainly was. Using multiprocessing and code architected to be run massively parallel, it can be blazingly fast. It would still be blown out of the water by similarly optimized compiled code but, is worth serious consideration if you want to optimize for iterative development.

    My view on such workflows would be:

    1. Write iteration of code component in Python.
    2. Release.
    3. Evaluate if any functional changes are required. If so, goto 1.
    4. Port component to compiled language, changing function calls/imports to make use of the compiled binary alongside the other interpreted components.
    5. Release.
    6. Refactor code to optimize for compiled language, features that compiled language enables, and/or security/bug fixes.
    7. Release.
    8. Evaluate if further refactor is required at this time, if so, goto 6.





  • AFAIK FreeRTOS always ran drivers in kernel.

    At least in the docs, I see it described as a microkernel but, with a kernel that small, the differences are probably academic (and I’ll leave that to people with more formal background in CS than myself).

    You can’t even emulate MPU without MPU. The only way is running bytecode, which is still not context switching.

    You are correct here. Should have said MPU instead.

    Oh yes! That makes a lot more sense. I’ve been on-and-off looking at implementing multithreading and multiprocessing in CircuitPython. Memory protection is a big problem with making it work reliably.


  • I was not meaning to say that all microcontrollers (or microcontroller firmwares) run a microkernel but, rather, that microcontrollers are an environment where they can work well because the limited scope of what the device is expected to do and its necessarily supported peripherals can be much smaller, making the potential impact of context changes smaller.

    For some good examples of microkernels for such purposes, take a look at FreeRTOS, ChibiOS, or Zephyr pre-1.6 (at which point architecture changed to a monolith because it is creeping towards general computing functionality).

    Some microcontrollers don’t even have context switching at all.

    As long as there’s some processing RAM and sufficient ROM, I’m sure that it can be crammed in there via firmware (in a sub-optimal way that makes people who have to maintain the code, including your future self, hate you and wish a more appropriate part were used).

    And I’m not even starting to talk about MMU.

    Some madlads forked Linux to get it to work without an MMU, even getting it merged into the mainline kernel: https://en.m.wikipedia.org/wiki/ΜClinux

    So, doable. Adviseable? Probably not in most cases but that’s subjective.





  • That’s the beautiful thing about gifting software with permissive licenses (when one wants to): it’s a gift and anyone can do whatever they want with it for free.

    ETA: I DO think that it is important for one who chooses to license software permissively to be informed about their decision and its implications. But, just like consent in other areas, as long as one enters into it intentionally and with the understanding of what the license means, it’s noone’s place to judge (and, like consent in other interpersonal areas, the license can be revoked/modified at any time - with a new version). Honestly, really weird of those that take issue with individuals choosing to gift their software to humanity - there’s way more interesting and useful things to engage in in the FLOSS landscape.




  • what would you do if someone used it to hurt people instead? I’d personally feel like shit if my software were used for that, and as others said in this post, they’d prefer to have entities request an exemption rather than have their code used in ways they don’t approve of. So what say you?

    I’ve a few thoughts on this:

    • Anyone who wants to use anything that I release for harm, will probably do so regardless of license. Bad actors are going to act badly. Plus, chances are that they’d see no legal repercussions as underdogs winning in court is the exception, not the rule. The legal system is heavily stacked against the little guy.
    • I tend to specifically avoid working on things that are weaponizable to reduce the chance of ethical conflict.
    • The projects that I’ve released or plan to release tend to be pretty esoteric. The one that saw the most interest was years ago and it was an adapter between abandoned gallery plugin and an abandoned social media CMS thing. It would take some great creativity to hurt people with that, other than making them read my horrible code from that era. My current projects are more about FPGA and mixed reality stuff.
    • Once I’ve created something and shared it freely, it is no longer wholely mine. I cannot dictate how one uses it, anymore than a musician can dictate how someone listens to the radio. As long as one abstains from creating tools intended to harm (or that can be predictably turned to harm), I don’t see legitimate ethical culpability. We only have control over ourselves.


  • Really?..

    Just about every FOSS and Source-Available license that I’ve seen is perfectly valid. As a software developer, one has the option to choose how they wish to license their software. This can be based upon one’s personal philosophical view or what seems most appropriate for the piece of software.

    Not everyone is motivated by profit. Most software that I develop personally is permissively licensed because IDGAF as long as I have enough to get by. If I write some code that makes someone else’s life better or easier, that’s more than enough for me.

    Wait. What am I saying? This is the Internet and, according to the rules of corpo social media, we’re all supposed to be dicks to each other to further “engagement”. WHICH ONE OF YOU SAVAGES IS USING TAB INDENTATION INSTEAD OF BLOCKS IN YOUR LICENSE FILES?!?;!!!111one