Need A Linux Kernel Module? Scratch That

If you have been for (or against) Rust in the Linux kernel, get ready for a Linux kernel module written in… Scratch. That’s right. Scratch, the MIT-developed language with blocks popular for teaching kids to code. We didn’t mean “from scratch.” We meant IN Scratch. The bootstrap code and Makefile is out there on GitHub.

Of course, it is a simple module and the reason it is possible is because of the scratchnative system that lets you compile Scratch into C code. If you want to look at the decidedly simple code, you can open it in your browser.

We don’t t think anyone is seriously suggesting you start doing this kind of development in Scratch, but it is sort of amazing that you can do it at all.

Not really more practical, but we’ve also seen what claims to be an entire operating system written in Scratch. Honestly, we aren’t fluent enough with Scratch to understand what it really does but the code looks like it is just throwing some characters on the screen using memory access.

We wondered what sort of things people would build with Scratch 3.0. Now we know.  Of course, our favorite Scratch application was flying our cheap drone.

15 thoughts on “Need A Linux Kernel Module? Scratch That

    1. Rust in the Linux kernel will be OK if they use the GCC or LLVM code generator backends. Last I checked, the Rust compiler is limited in which architectures it supports which would limit portability. The good news is that they seem to have settled on generating multiple levels of Intermediate Representation which lends itself to the use of other code generator backends.

      That said, the claims of safety in Rust are misleading and when writing drivers, it needs to be mostly disabled.

      1. Most of the CVEs there relate to the implementation, not the safety of the language itself. The difference here is that the implementation is easy enough to identify and fix problems in, while random C code type safety or use-after-frees or whatever can easily just go undetected.

  1. “Honestly, we aren’t fluent enough with Scratch to understand what it really does”
    Did you ask kids? ;)

    Sometimes I think that scratch could be funny home automation system language. Easy to learn, visually oriented and good for simple tasks. In the end not everybody needs/wants “smart” home and automated home would be good enough. And we have long tradition of kids programming home devices because adults could not follow technological advance like VHF recorders in ’80 or TV until now.

  2. I mean technically there is Visuino.
    https://www.visuino.com/what-is-visuino/

    No idea how well it works but it seems to be more about making programming easier or quicker to accomplish at a higher level than just writing code though it seems to let you do that as well?

    There is also Processing, designed for more visual arts type applications.
    https://processing.org/

    ArduBlock seems cloud based and more entry level though visual.
    http://blog.ardublock.com/

    mBlock is somewhat visual and somewhat Python. Also visual.
    https://mblock.makeblock.com/en-us/

  3. I am unable to determine from the article whether I need to scratch up some scratch for Scratch or whether if I scratch around the internet I will be able to scratch Scratch up scratch free.

  4. National Security Agency software directives to Sandia National Laboratories MIssle Secure Unit 1980s NSA-funded project spedified that no binaries other than the app remain on the embedded controller.

    Multitasker use unauthorized under this NSA directive?

    Rules changed after c/c++ software invasion in ~1991?

Leave a Reply to Hacktronics India (@HacktronicsIn)Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.