9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Sergey Kish <sergey.kish@gmail.com>
To: 9fans@9fans.net
Subject: [9fans]  /dev/draw and c, rc, ruby, python, go
Date: Sun, 10 Apr 2011 20:53:18 +0300	[thread overview]
Message-ID: <BANLkTikQF2=qizJiMPv_u7ViviLA2j66Lw@mail.gmail.com> (raw)

Ruby is my language of choice. It was natural to use it for Plan 9
application development which involves working with dictiories, stacks
and some metaprogramming.

I took fgb/ruby, localized changes, wrote mkfile
https://gist.github.com/912507 And it was ok until I've started
GUI part. It appears that Ruby C extensions are dynamic libraries.
So I can't access libdraw, but why not access /dev/draw directly?

libdraw is a simple wrapper around /dev/draw. It can be implemented
in any language. Unexpected problem appeard rapidly.
I can't reread /dev/draw/ctl

    named-image.rb:26:in `read': Invalid argument - /dev/draw/new
    (Errno::EINVAL) from named-image.rb:26

To check algorithm named imaged retrieval on several
languages was written . All attempts storred on github
https://gist.github.com/912377

C looks clear and works fine. Python and Ruby falls with exception.
Their message construction checked in rc, which works fine. Also
works when opened from rc and accessed in application through /fd/4

	<[4] /dev/draw/new { ruby application.rb }

Today I've implemented same on go. It also falls but it may be my
fault

    error: read /dev/draw/new: unknown id for draw image

What's special about Plan 9 files? Which languages handle them?
How to fix Python and Ruby?
Any help appreciated



             reply	other threads:[~2011-04-10 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 17:53 Sergey Kish [this message]
2011-04-10 20:49 ` ron minnich
2011-04-12  4:41   ` Akshat Kumar
2011-04-13 22:16     ` erik quanstrom
2011-04-11  0:49 ` Anthony Martin
2011-04-11  1:09   ` Anthony Martin
2011-04-11 15:17     ` Sergey Kish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTikQF2=qizJiMPv_u7ViviLA2j66Lw@mail.gmail.com' \
    --to=sergey.kish@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).