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

help-circle

  • I think that anything in Plan 9 that involves a filesystem makes total sense. It’s just too easy to just make a thin layer that works with files.

    For instance, I was once building a GUI for a project in Plan 9 C, that communicated with the remote server using REST requests. All I had to do is use the webfs filesystem interface. It works somewhat like this:

    • You open /mnt/web/clone for reading and keep it open. Reading that file gives you a handle number for your connections.
    • Open /mnt/web/%d/ctl (%d being the handle number) for writing. Then you write a few textual information for your request, e.g. request get for the method, url https://my-website.com/ for URL, headers blabla for each header parameter, etc.
    • If you’re sending data, set the contenttype through the ctl file as above, then write the request body to /mnt/web/%d/postbody.
    • Open /mnt/web/%d/body for reading. This action performs the actual request, and may take some time. Nevertheless, for your program, it is simply a blocking file operation.

    I think this illustrates how simple Plan 9 can be, so I think it is possible to port most, if not every part of 9fans.net libraries to native Plan 9 by reimplementing a few functions to do file operations instead of using the plan9port binaries.


  • This is awesome!

    Since you’re using 9fans packages, I assume that this works with plan9port though, isn’t that right?

    I was wondering about porting some of these things to native Plan 9 as well, especially the libdraw parts. So far there were successful attempts at using the filesystem interface with Lua (and at some point I managed to run Fennel atop Lua 5.4 to interact with libdraw), so adding Plan 9 support to these libraries shouldn’t be too hard.


  • Not really, to be honest – most of what I learned so far about Golang was from their website’s documentation and examples. It is not hard to learn in my opinion, especially if you also know some C (since you come from a PHP background, I assume you could manage Golang with a few tutorials). You should probably take a look at Go by Example to see for yourself.

    As for “schools”, I won’t recommend any simply because the only online courses I was recommended were paid ones, and they also did not seem to be extremely good. Furthermore, they were in Portuguese, which is my mother language.

    PS. I was also surprised at how Golang does some trivial stuff like connecting to databases. Did you know every database “connection” in fact works as/can work as a connection pool? You end up writing code as if you’re sharing a single connection between threads, but in fact, you’re not.



  • Hello, I’m somewhat in the SDF community already, even though I rarely come up on COM or BBOARD. I’m a developer by day and I am generally very interested in anything relating to programming, AI, cognitive science, and I’ve recently taken some interest on bare metal programming, SoCs and RISC-V stuff.

    You’ll also see me involved in some stuff relating to Plan 9 and, more recently also, Golang programming for Plan 9 on ARM.

    Looking forward to participating in SDF activities on Lemmy as well!