OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Q 6.2 For Pdaxrom, Functional programming language
agraef
post Oct 22 2005, 01:49 PM
Post #1





Group: Members
Posts: 54
Joined: 28-August 05
Member No.: 7,962



Q is a modern-style functional programming language based on term rewriting. It is an interpreted language with dynamic typing and fairly good library support. If you are looking for a high-level scripting language for your Z, aside from the usual suspects (Perl/Python/Ruby), then you might wish to give it a whirl. It is also useful as an advanced programmable desktop calculator. Please refer to http://q-lang.sourceforge.net/ for more details.

I've set up a little feed with all the needed bits and pieces here. The binaries are for RC11 or later. The feed also includes additional dependencies which are not currently in the official pdaXrom feeds. All packages install into /usr/local. Here is a quick rundown of the packages which are available right now:

- q_6.2_armv5tel.ipk: The core of the interpreter, also includes the standard library, POSIX system interface, as well as the Curl, GDBM, GGI, ImageMagick, Octave, Tcl/Tk and XML/XSLT modules. (At this time, the ODBC and OpenDX modules are not supported in the pdaXrom version.)

- graph_1.4_armv5tel.ipk: Combinatorial graph library and editor. Requires Tcl/Tk.

- q-opengl_1.1_armv5tel.ipk: Q's OpenGL interface. Requires pdaXrom's mesa3d package.

- swig_1.3.22-q_armv5tel.ipk: A SWIG version which has been patched up to add support for Q. Makes it easy to build interfaces between Q and C/C++ libraries.

Please note that, as far as memory sizes on PDAs go, these packages and the dependencies need quite a bit of storage space, so you'll probably want to install them on a memory card.

Quick startup guide: After installing the q_6.2_armv5tel.ipk package, you should be able to run the Q interpreter in an xterm or on the console by just typing "q" (or "q filename.q" to run the given Q script). A bunch of sample scripts can be found in /usr/local/share/q/examples. Onboard help is available in the interpreter with the "help" command (this fires up the language manual in the GNU info reader); the manual is also available as HTML and PDF from q-lang.sf.net. Start out with Section 2 ("Getting Started"), that should get you started quickly. If you have emacs installed, you might also wish to install q-mode.el in /usr/local/share/q/etc into your emacs site-lisp directory, and enable Q mode in your .emacs file as described at the beginning of q-mode.el.

Please let me know how it works for you and feel free to post bug reports and other comments to this thread (or use the bug tracker and mailing lists at the q-lang.sf.net site). I'm currently working on porting other parts of Q's multimedia library (the audio interface, in particular), and I started working on an SQLite module to make up for the missing ODBC interface. I'll announce new modules in this thread as they become available for the pdaXrom version.

Enjoy! smile.gif
Albert Graef
Go to the top of the page
 
+Quote Post
willgan
post Oct 22 2005, 11:58 PM
Post #2





Group: Members
Posts: 84
Joined: 9-December 04
From: KL, Malaysia
Member No.: 5,869



is it possible for the qmidi to work?
Go to the top of the page
 
+Quote Post
agraef
post Oct 23 2005, 09:21 AM
Post #3





Group: Members
Posts: 54
Joined: 28-August 05
Member No.: 7,962



QUOTE(willgan @ Oct 23 2005, 09:58 AM)
is it possible for the qmidi to work?

Q-Midi needs Grame's MidiShare, and I haven't ported that yet. It's on my TODO list. smile.gif

If I get that to work, then there's still the question where to send the MIDI output to. Hmm, I just noticed that the usb-midi kernel module seems to be available in pdaXrom, cool. Has anyone tested that already?
Go to the top of the page
 
+Quote Post
agraef
post Oct 23 2005, 05:37 PM
Post #4





Group: Members
Posts: 54
Joined: 28-August 05
Member No.: 7,962



Ok, I have the Q-Audio module working now. Get it from the feed while it's hot. It requires a few dependencies (portaudio, libsndfile, libsamplerate, fftw) which are also in the feed and should be pulled in automatically when you install the q-audio package.

To try it out, chdir to /usr/local/share/q/examples/audio and run "q audio_examp.q". Then plug in your microphone and enter the following two commands (at the "==>" prompt):

CODE
==> record 3
<<ByteStr>>

==> play _
()


If all is well, this will record 3 seconds of audio and play it back. Of course you only want to do this with short pieces of audio because the entire wave has to fit into main memory. Fortunately, the sample script also has two functions sf_record and sf_play which directly record and play audio files (in any of the formats supported by the libsndfile library):

CODE
==> sf_record "test.wav" 20
()

==> sf_play "test.wav"
()


There are also the functions scope and sf_scope which play back a wave as with play/sf_play but also display the wave in a GGI window (this requires that you're running under X11, of course).

CODE
==> sf_scope "test.wav"


Note that sf_scope doesn't work all that well right now, because the audio_examp.q script is just a simplistic example which isn't really optimized for small/slow devices like the Zaurus. I've quickly hacked together an alternative version (attached file audio_examp2.q, gzipped to make the forum software happy), which puts the audio playback, file reader and scope visualization into different threads, so that interested programmers can get an idea of the kind of changes that are needed to make it work. I owe anyone a beer who also fixes up the sample audio_player script included in the package (which doesn't work properly right now because of the same reasons). smile.gif

Cheers,
Albert
Attached File(s)
Attached File  audio_examp2.q.gz ( 4.47K ) Number of downloads: 7
 
Go to the top of the page
 
+Quote Post
agraef
post Nov 13 2005, 10:17 AM
Post #5





Group: Members
Posts: 54
Joined: 28-August 05
Member No.: 7,962



Release 1.0 of the Q-SQLite module is now available, and I've uploaded a corresponding pdaXrom package to the feed.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th November 2014 - 04:12 PM