Posts

lab 77 - the unexpected markov

NAME lab 77 - the unexpected markov NOTES This is another unexpected use (again) of the markov program from the `The Practice of Programming', section 3.9 [1]. I wrote an implementation of markov under Limbo, and had fun feeding it with any texts (books, articles, interviews, novels ...). But recently I've been also playing with caerwyn's synth [2] which included in acme-sac, and thought why not feeding markov with music? Find out the answer by yourselves, I'll just provide some small hints in the accompanying guide file. Enjoy! [1] http://cm.bell-labs.com/cm/cs/tpop [2] synth from acme-sac under appl/synth FILES inferno-lab bachm.mp3 (the original bach file bach.mp3 )

lab 76 - using svn with gcode projects

NAME This is not a typical lab, instead are some suggestions to work with svn repos (the ones provided by gcode); like inferno-lab or the rest of Inferno related projects at gcode . NOTES To work with svn the easiest way is to install subversion under the host os and write a wrapper to have the svn command available under Inferno, like: cat > $home/dis/sh/svn The svn script relies in hp, to convert the Inferno paths to host paths, so here is hp: cat > $home/dis/sh/hp # to get host path' } if {~ $emuhost Nt}{ fn slashpath () { sed 's|\\|\\\\|g'; } # put two where there's one emuroot=`{echo $emuroot | slashpath | slashpath} for p in $* { cleanname -d `{pwd} $p | sed -n ' /^\/n\// {s|/n/(.)/|\1:\\\\|p; q;} s|^|'^$emuroot^'|p;' } }{ # host letters subst # hls="{ns | sed -n '/#U.+/ s|^bind -. ''#U(.*)'' (.*)|s\|\2\|\1/\|p|p'} for p in $* { cleanname -d `{pwd} $p | sed -n ' /^\/n\// {s|/n/l...

lab 75 - scope & experiments

Image
NAME lab75 - scope & experiments DESCRIPTION Since i did lab 67 i've been trying to improve/fix the t3 port and experiment with it. So this post has small report of the T3 port status, and some experiments under Inferno; note that they're not dependent of the handheld. T3 PORT Some of the thing i've fixed are: t3 touchscreen : Perform corrections to make it work as it should, this was important since it has direct impact on using Acme, and the rest of the system. blank the lcd : Added code to turn off the lcd while playing music, so battery lasts longer. To do so i added an blank command to the devapm.c written by Alexander Syschev, and wrote a blight script that manages the lcd backlight,to control this from acme. Since this changes apply to the t3 port, they can be found under lab 67 of the inferno-lab While i haven't been able to fix the following segfaults, i've been able to obtain dumps and open them with gdb. So i've been able to find ...

lab 74 - effective inferno

NAME lab 74 - effective inferno NOTES I read the Effective Java book recently. Every language needs a book that describes how to use it effectively. I wish there was a book for Effective Inferno. Although common techniques may work in Inferno I know for sure there are some uncommon ones that may work better. I'll try and describe at least one recipe that could be a chapter in that book. To people who've asked me what distinguishes Inferno, I've answered that it's the concurrent language Limbo, or that it's a portable OS that runs on a VM, or that it uses the Styx protocol to create a distributed system, or that it's about software tools that work together with the Inferno shell. These are the ingredients; on their own they are not unique to inferno. Limbo looks very like C and to a newbie it's not obvious what is special about it. There a lots of little niceties that make Limbo pleasant to use, e.g., array slicing and tuples, but these are det...

lab 73 - MIDI

NAME lab 73 - MIDI NOTES I've written a module to read MIDI format files. I needed this because I wanted more input for my software synthesizer. I was getting bored listening to the same old track, and I haven't yet come up with any computer generated music. This seemed like a quick and easy option to get a large amount of music to listen to. The code reads in the whole MIDI file and stores it in memory, using an ADT for the Header that contains an array of Tracks and each Track has an array of Events. I also wrote a midi2skini command that interleaves the multiple MIDI tracks into a single stream of skini messages for the synthesizer (see earlier labs). It sorts and orders the events converting tick delta to realtime. I've been trying this out on some bach midi files . It's been working quite nicely with the organ like sounds produced by the inferno synth. % echo 1 > /dev/jit % midi2skini bwv988-aria.mid | sequencer ... You need JIT enabled when using the sequence...

lab 72 - wikipedia

NAME lab 72 - wikipedia NOTES I've been working on modifying dict to use the Wikipedia database. I mentioned this in lab 70. So here's what I've got so far. It's not beautiful; the wiki syntax parser needs a lot of work The general idea is I want to use acme-sac as a Wikipedia browser. But there are other reasons too, such as gaining experience of using inferno to work on some large text databases. Acme brings some nice things to a database like Wikipedia. Because of the nature of acme you don't have to rely on people making wiki links to find other articles. You can right-select almost any text to search the index. Right-selecting single words often opens a Wikipedia disambiguation page. If you want to get this working try following the steps below. You need to use the latest acme-sac copy from svn. It has some fixes to support big files, including Acme.exe, otherwise none of this will work. Download the Wikipedia database . This site will explain about ...

lab 71 - pruning

NAME lab 71 - pruning NOTES I've tried to reduce acme-sac source tree to what I consider the core. I'm cutting out dead wood to encourage new growth. Except that what counts as dead wood is highly debatable. I removed files I tended not to use, but my well traveled paths through inferno are not necessarily going to match yours. So while acme-sac still stands alone, it depends on the larger world of inferno-os for diversity and range of applications. The smaller mass of code is intended to have less inertia. Not only can a programmer more easily understand it all, but he can also make changes system wide and so turn it to new directions. For example, if a new system library were to be imagined that could be applied to the whole limbo code set, the size of the code should not present so much resistance that an individual would not attempt it. This reduction effort started in lab 58. The source from that became acme-sac. The recent "right-sizing" removed a lot of...

software temples

NAME software temples NOTES I've been listening to the seminars about long term thinking from the Long Now Foundation. I highly recommend them. The purpose of these seminars is to encourage long term thinking. They succeed at that. For the last few weeks as I've been listening to them I've been contemplating the future of software and the history of civilization. I can't say that I've ever been interested in history. But after attempting to look forward more than 100 years it only now occurs to me what a good idea it is to look backwards far enough to see the patterns and cycles in human history. Some of the seminars are inspiring. Danny Hillis talks about his progress in constructing a clock that will run for 10,000 years. At first it sounds insane, but after listening to him I can't help but admire him and what he's doing. The real purpose of such a scheme is to trick yourself into a different kind of thinking. Similar to the idea of forcing change ...

lab 70 - dict

Image
NAME lab 70 - dict NOTES I ported Plan 9's dict to Inferno. At the moment it works with the Project Gutenberg dictionary and Roget's Thesaurus. Of course, since I'm an acme fan, I also ported adict to browse the dictionaries in acme. I've been looking to collect plain text databases that would fill a small portable 60GB drive. Then use acme as a plain text browser. When I've thought about Inferno as a system I've paid too much attention to the code and not to the data it might work on. Collecting databases is an attempt to broaden my view. Two databases to start with are Wikipedia (8GB uncompressed not including images) and the whole of Project Gutenberg (4GB compressed). I've started working on getting a local copy of wikipedia to display in acme using dict. I got this working for a small subset of wikipedia, the first 1GB, just to try things out. It works well enough that I'm now working on the complete archive.

lab 69 - menuhit

Image
NAME lab 69 - menuhit NOTES After removing Tk I still needed some menu functionality. If you look carefully at the picture in my last post you'll see the little green menu! I ported menuhit from plan9 and made it a module in inferno. I've used it in a few wm commands checked into svn. Because I'm Tk-less I don't have the tk toolbar so menuhit, like rio, is the way of controlling window operations, basic stuff like exiting from clock. Why no Tk? I didn't do this because I hated Tk and the programming interface. But I didn't like the way it looked. I use acme-sac the whole time so I essentially stoped using an Tk based commands. Also, I thought there's no way I'd ever give an end-user an application that used Tk. So I removed it just to see what would happen next. The most immediate consequence is a lurch towards rio like interface. But I don't think that's the end state. I'm also looking at the browser as an end-user interface...

lab 68 - stand alone charon

Image
NAME lab 68 - stand alone charon NOTES I've definitely got behind in blogging my Inferno work. And it's not that I haven't been doing anything. I'm just not putting in the effort to write stuff up. Salva has been carrying the ball and thanks to him for the last few posts. I'm going to try posting more regularly but smaller things. A lot of my recent work has been going into acme-sac. I've checked code into svn at code.google.com. If my posts describe work I've checked in there I won't include the files as part of the blog. Today's post is a pretty picture. The story is I removed Tk from acme-sac and then worked through the consequences. One of them was to get charon working without Tk, which turned out to be not that hard. Whereas Acme is an interface for programmers, I think this is a great interface for end users.

lab 67 - Inferno emu on Palm Tungsten T3

Image
NAME Inferno emu on Palm Tungsten T3 (and under similar palm handhelds, see notes). DESCRIPTION This lab collects some personal/informal notes that I took while setting up setup Inferno emu running hosted on a T3, the main reasons for doing this are: Wanted to experiment with Inferno Get tired of the 'traditional' way of using a computer and by extension a handheld (both POS and Linux), and wanting to employ my time in more useful things. after some time using Inferno i've noticed that it has all I need, and the pieces that Inferno doesn't have (ogg, mp3, etc.) can be borrowed from the host OS (Linux). The first section covers the hardware available on the T3, the second section talks about how to setup Linux on the T3, and finishes talking about the setup of Inferno itself to perform some typical tasks, which includes brief notes on how to compile and run emu on T3. Ha...

lab 66 - useful tools

NAME lab 66 - useful tools NOTES This is a light lab about writting some useful day-to-day tools, mainly language and music playing tools. gask is a simple script for doing searches with google, which is nice when you want to consult something while writting a text, it returns the output in textual form so it can be used/plumbed etc. the next tools are for rapidly looking definitions in english/spanish/... on a dictionary, and they're handy when you aren't a native speaker. trgg (translate google) allows you to translate between any pair of languages that are supported by google, the usage of the command is trgg 'sl|dl' text, or |trgg 'sl|dl' where: sl: is the source language (by default english) dl: is the destination language (by default spanish) while dorg does a search on the dictionaries using the services of www.dict.org site, dra...

lab 65 - Man pages in Acme

NAME lab 65 - Man pages in Acme NOTES This lab's purpose is to have man-pages opened in acme automatically. Easiest way to do this is to allow plumb to get it's data piped from another program. So we can do: man2txt /man/sec/file | plumb -i -d edit -a action showdata -a filename '/man/file(sec)'; given that we want to plumb it to acme we have to set the destination port -d edit, and instruct acme to show the data with the tag set to the value of the filename argument. So now we can add to our plumbing rules something like: # man pages kind is text data matches '([a-zA-Z0-9\-]+)\(([0-9]+)\)' plumb alwaysstart man # nasty plumbing hack plumb start /dis/sh.dis -c '/usr/salva/dis/man -b $2 $1' where /usr/salva/dis/man is an adaptation of /rc/bin/man from Plan9, and in particular when invoked with the -b option does: man2txt $file | plumb -i -d edit -a action showdata -a filename '/man/'^${tl $*}^'('^${hd $*}^')' But if w...

google hosting

NAME google hosting NOTES I've created a project on http://code.google.com to host the code for acme-sac. This the first time I've used svn for a project. But I like it so far. It's nice of google to do this. I like not having to worry about maintaining the source repository. I've uploaded most of the acme-sac distribution. Probably too much; I might be deleting portions of it, such as /appl/wm/*. I'm kinda torn about what to include and what to remove. I'll lean to removing too much to start, and add back it only the things that I find using. I've moved the code for emu to /sys. The mkfiles now assume the build is within Inferno using wrappers 9l, 9c, 9ar to the host system. I've only tried this and got it working on Nt. When I eventually get a Linux machine to do builds on I'll get it working on that too. But if anyone wants to help...

lab 64 - Chat

NAME lab 64 - Chat NOTES Chat is an acme client that connects to the chatsrv filesystem. This is a very basic text chat service. It is considerably simpler than the Irc client. Part of the reason I did this was to have a simpler client I could use to help debug some of the acme interaction, and help me improve Irc. Another reason was a recent urge I had to setup some private communication channels, merely for privacy's sake. Chatsrv is part of the demo code under /appl/demo . I borrowed code from /appl/demo/chat.b and the Irc client I ported from Russ. A chatsrv service is running on tcp!canto.hopto.org!6683. But I've only allowed rc4_256 encryption to use the service, and of course you need a certificate from the canto.hopto.org signer ( Getting Started ). To mount the service within acme and start Chat Local mount -C rc4_256 tcp!canto.hopto.org!6683 /n/chat Chat /n/chat Note that the simplest client can be run inside wm/sh, or win: % {cat & cat >[1=0]...

lab 63 - Calendar

Image
NAME lab 63 - Calendar NOTES I wrote a little calendar client for acme based on Inferno's wm/calendar(1). It uses rawdbfs(1) in the same way to store calendar entries. The calendar window displays a month much like cal(1), and has commands Next and Prev to move between months. Days that have calendar entries have a plus superscript symbol. Right click on the days of the month to open and edit a calendar entry. To use it make sure you have a directory /mnt/schedule, and a file in your home directory called, schedule. mkdir /mnt/schedule touch schedule Calendar schedule Or Local rawdbfs schedule /mnt/schedule Calendar FILES caerwyn.com/lab/63

General update

NAME general update NOTES I've been quiet for a while so I'll give a general update to things I've been working on. I've been doing little bits on lots of different things, but no substantial progress on any one thing. Basically nothing to merit a release of working code. I'll just itemize the stuff. The Slashdot of acme:sac made me want to improve a lot of things. Ems setup a project on sourceforge to host the distribution when I get it completed. There were several things I want to include in the next release, such as acme debug client, an acme web client, and an acme factotum client. I fixed the bug, at least running on my version of XP compile emu, that caused emu to crash. Basically XP didn't like the trap handling code that used inline asm. I removed the inline asm and registered a general trap handler, and that seemed to work fine. I did some more testing on the acme debugger client. In doing so, I think I found another way of crashing acme, so tha...

lab 62 - software synth csp style

Image
NAME lab 62 - software synth CSP style NOTES This is the next iteration of my software synth code for Inferno. Of particular note is the embrace of CSP style as implementation technique. This was true of the code in lab 60. But this time much more of it actually works and the basic framework, the interfaces, are in place for me to extend it further. I think it makes a nice show case of CSP style programming. I thought my lexis database did too (lab 34) but this code is probably easier and more fun to play with. I want to post this now before I move onto the next phase, which may add a lot more complexity but won't illustrate any better the CSP style of programming in this application. You are encouraged to edit this code to create your own synthesizer, and use that as a way into studying CSP style. This synth comes with a basic GUI. Here is a screen shot. The GUI is bare bones, designed just so that it very easy to add new knobs for the control of filters. (One of the thin...

lab 61 - javascript tool

NAME lab 61 javascript tool NOTES In this lab I wanted to get a standalone javascript interpreter for general scripting use within inferno. [Deleted a section on reasons why I'd want to do this based on the mix of languages already available--it's not that interesting and is just me trying to rationalize why I like javascript] There is already a javascript interpreter in inferno as part of the charon web browser. All I'd need to do is add a small set of host objects to interface with the OS. In this lab I haven't included all the host objects I'd want; not even a fraction. This is just the setup, the beginnings of a javascript tool. The only host object I've added is System which contains three functions: getline , print , and readFile . Getline reads a line from stdin and returns it as a string. Print writes a string to stdout. ReadFile reads the in the contents of a file and returns it as a string. Suggestions on what the host objects to add are we...