Today's News

13th Jun 2007
12th Jun 2007
11th Jun 2007

Get Linux in South Africa Pretoria on DVD or CD, SUSE, OpenSuse, Fedora, Mandriva, Knoppix, Mandrake, Debian, DamnSmall, DSL, Gentoo, Slackware, SimplyMepis, Monoppix, FreeBSD, Trustix, Comodo, Smoothwall, Gibraltar, IPCop, OpenCD, Ubuntu, Kubuntu, Redhat, CentOS, Whitebox, PCLinuxOS, Xandros, Vector, Scientific, OpenOffice, Vector, Foresight, Asterisk
 
News Alert


Linux and Open Source News for 12th June 2007

Linux

previous    Distro Watch    next


  popularity

Source: LinuxTracker.org

Category: Open Source Software Size: 108.72 MB Status: no seeders and no leecher Added: 2007-06-12 23:18:41


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: LinuxTracker.org

Category: Open Source Software Size: 97.03 MB Status: no seeders and no leecher Added: 2007-06-12 23:17:02


  popularitypopularity

Source: LinuxTracker.org

Category: Open Source Software Size: 143.05 MB Status: no seeders and no leecher Added: 2007-06-12 22:53:08


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: LinuxTracker.org

Category: Open Source Software Size: 125.53 MB Status: 14 seeders and 5 leechers Added: 2007-06-12 22:49:09


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: berry

Yuichiro Nakada has announced the availability of an updated version of Berry Linux, a Fedora-based English/Japanese live CD featuring many of the latest desktop Linux technologies: "Berry Linux 0.81 released." The new version is based on Fedora 6 with a number of updated applications. It boots into Linux .


  popularitypopularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: pardus

G rkem etin has announced the availability of a beta release of Pardus Linux 2007.2, an independently developed desktop Linux distribution with custom package management and system administration utilities: "Pardus project announces Pardus 2007.2 beta (codename Bar ), which is dedicated to our longtime developer Bar Metin. This beta version .



previous    Linux Today News Service    next


  popularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Linux.com: "By itself, Vim is one of the best editors for shell scripting. With a little tweaking, however, you can turn Vim into a full-fledged IDE for writing scripts "


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

developerWorks: "Using the publicly available and easily accessible reflectivity data from one of the WSR-88D class radar systems, this article will show you how to choose a location and set up weather-change alerts for a precise geographical area "


  popularitypopularity

Source: Linux Today

Linux.com: "The OpenWengo project recently released version 2.1 of its WengoPhone VoIP softphone. It's a big step forward for Linux users "


  popularitypopularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Tuxmachines: "Granular Linux is a Linux distribution based on PCLinuxOS and features the XFCE4 and KDE desktops "


  popularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Intranet Journal: "In articles past, we have examined both the up-and-coming open source projects to watch, and which open source applications you simply cannot live without. But where does this leave the enterprise user ?"


  popularity

Source: Linux Today

NetworkWorld: "Q&A; with Jim Klein, director of information services and technology for the Saugus Union School District in California "


  popularitypopularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

iTWire: "Why would the world's second-ranked PC seller make an effort to sell an operating system that it's never sold before on custom hardware--and do it in a half-hearted manner ?"


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Just Another Tech Blog: "Although I don't intend to keep daily journals of my trials of various Linux distributions this summer, I will chronicle the first day I spend with each distro "


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Eric Lee: "I no longer use Microsoft Windows XP and instead now use Ubuntu Linux. That's nice, you may be thinking, but what does that have to do with the trade union movement ?"


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

whurley: "Safari is a pretty cool browser, and I do use it on my MacBook Pro. But where's my Safari for Linux? Why wasn't today's announcement about open sourcing Safari ?"


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Linux-Watch: "If you're like most Linux users, you've heard of OpenSolaris, but I'm willing to bet you've never tried it "


  popularity

Source: Linux Today

ZDNet: "Microsoft's hire of Tom Hanrahan, formerly director of engineering for the Linux Foundation (and before that of the OSDL, one of its predecessors) says a lot about the company's true open source situation "


  popularity

Source: Linux Today

Enderle: "Two Slashdot posts and a long meeting with Microsoft really got me to thinking about whether Microsoft really likes, or doesn't like, the new GPL version and how its strategy "


  popularity

Source: Linux Today

eWeek: "Dell's customer feedback-driven initiative for preloading Linux on some of the machines it sells is moving forward with a full head of steam "


  popularitypopularity

Source: Linux Today

Datamation: "Over the past few weeks much has been written about Dell's decision to offer desktop and notebook PCs that have the Ubuntu Linux distro installed on them as opposed to Windows "


  popularitypopularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

Groklaw: "Similarly, when Microsoft joined the SCO 'you must pay me forever for my precious IP' club, made up of companies that don't know enough not to club baby Linux penguins, the world said, Ewww "


  popularitypopularity

Source: Linux Today

BetaNews: "Last week, it announced its official support of a Web site whose purpose will be to encourage citizens to assess the validity of patent applications for themselves, and issue challenges where necessary "


  popularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

KernelTrap: "'I was impressed in the sense that it was a hell of a lot better than the disaster that were the earlier drafts,' Linus Torvalds explained in reply to a comment suggesting that he was impressed with the final draft of the GPLv3 "


  popularitypopularity

Source: Linux Today

HowtoForge: "As you might have noticed on Centos 5.0, there is no PHP-MSSQL module/extension available in the default yum repositories "


  popularitypopularitypopularitypopularitypopularitypopularity

Source: Linux Today

KernelTrap: The translation of a some kernel documentation into Japanese led to a discussion as to whether or not it was appropriate to include translated documentation with the kernel source code "


  popularity

Source: Linux Today

HowToForge: "This tutorial provides step-by-step instructions on how to install VMware Server on a Fedora 7 desktop system. With VMware Server you can create and run guest operating systems ('virtual machines') such as Linux, Windows, FreeBSD, etc. under a host operating system "



previous    News, reviews and commentary on all aspects of Linux and open-source software, including application servers, communications and database servers.    next


Source: eWEEK Linux


  popularity

Source: eWEEK Linux

Some in Linux hate the deal with a passion, while others don't consider it really worth noticing.



previous    The O'Reilly Network ONLamp Articles and Weblogs    next


  popularity

Source: ONLamp.com

One of the sub-projects of Pugs
is a series of Perl 6 sanity
tests which define a minimal set of useful Perl 6 features. The idea
behind those tests is that a Perl 6 implementation which can pass the
sanity tests supports enough features so that it’s possible to bootstrap
the rest of Perl 6 in that minimal implementation.

The Parrot project recently
borrowed those sanity tests for the Perl 6 on Parrot implementation. (I
work on Parrot in part because I believe that Parrot’s compiler tools are much more suitable for
building compilers and languages than anything else I’ve ever used.)

Though I spend more of my Parrot time these days applying submitted
patches, fixing bugs, and refactoring code, I try to make time for new
development. I heard that we almost had all of the first suite of sanity
tests passing and decided to see if I could improve the situation.

Most of the 19 tests passed. The most app failure was in
t/01-sanity/08-test.t, which loads Test.pm and calls two
functions exported from that module:



#!/usr/bin/pugs

# Checking that testing is sane: Test.pm

use v6;
use Test;

plan 1;

my $x = '0';
ok $x == $x;



Within languages/perl6, run make and then
../../parrot perl6.pbc t/01-sanity/08-test.t. As of Parrot
r18892, you’d see errors about invoking null subroutines–because Perl 6
didn’t actually load Test.pm.

Inside the Perl 6 Compiler

Though perl6.pbc looks like is a single monolithic chunk of
Parrot code, it’s actually a combination of several different stages of
compilation. The first is a PGE-based grammar (built on Perl 6 Synopsis
05). The rest are successive refinements of the Perl 6 program in
different tree forms, from the parse tree generated from PGE to actual code
in Parrot’s native language. A Parrot class named HLLCompiler
performs most of the work to read in source code and shuttle the trees
through the transformations; the Perl 6 compiler subclasses this class to
add some very basic additional behavior.

Though multiple stages add conceptual complexity to understanding the
compiler when you start, they often add clarity and simplicity in practice
when adding features. For example, I only had to modify the first two
stages of compilation (out of four) to support use and
require.

Parsing Support

I was fortunate, though, that other files in the sanity test all had the
line use v6;. The grammar (in
src/parser/grammar_rules.pg) already had a token defined to handle
use statements:



token use_statement {
use ?
}

token version { }



In brief, a use statement starts with optional whitespace, contains the
literal term use, has optional whitespace, contains something
matching the version rule, has optional whitespace, and
optionally contains an expression followed by a semicolon. A
version is just a valid identifier.

This token isn’t quite perfectly correct yet, particularly
because version is semantically the wrong name at this point
in the grammar, but it’s close enough to add the feature, and it will be
the target of refactoring when improving use support.

All I needed to know was that the parser actually matched use
v6; and use Test; appropriately here:



$ parrot perl6.pir --target=PARSE t/01-sanity/08-test.t

= ResizablePMCArray (size:5) [
PMC 'Perl6::Grammar' = "#!/usr/bin/pugs " @ 0 {
= PMC 'Perl6::Grammar' = "#!/usr/bin/pugs " @ 0 {
= PMC 'Perl6::Grammar' = "v6" @ 63 {
= PMC 'Perl6::Grammar' = "v6" @ 63
}
}
}

]



The --target option to the Perl 6 compiler allows you to
emit the result of any stage in the compilation process. PARSE
dumps the PGE tree in a visible (if lengthy) form. (README gives the
other flags and options.)

Transforming the Parse Tree

So far, I didn’t have to change any code (except that the PGE dumping
didn’t work, due to a missing line of code, but that was a bugfix and not a
new feature). The next step was to transform this
use_statement branch appropriately into PAST. (The first
transformation step is from program source code into a PGE–or parse–tree.
The second transformation is from the parse tree into a Parrot Abstract
Syntax Tree.)

The Perl 6 compiler’s PAST transformations are individual rules in a TGE
grammar found in src/PAST/Grammar.tg. There’s usually at least one
rule for each named node in the PGE output. I searched the file for
use_statement and found it mentioned in the transformation
rule for Perl6::Grammar::statement nodes:



transform past (Perl6::Grammar::statement) :language('PIR') {
$P0 = node['use_statement']
unless null $P0 goto use_statement



use_statement:
null $P0
.return ($P0)



node represents the particular node of the parse tree.
Child nodes are available through keyed access–thus this code looks in a
Perl6::Grammar::statement node for a
use_statement node. If that’s found, it jumps to the
use_statement label, which does nothing. Returning a null
value here effectively splices this node out of the resulting PAST.

When I saw this, I knew I needed to add some code.

TGE transformations create PAST objects. Each TGE transform is basically
a map from particular elements in one tree structure to another. They take
whatever information they need from the input tree and create nodes in the
output tree with that data.

From personal experience and poking around in the file (and liberal use
of the --target=PAST option to the Perl 6 compiler, I decided
that a use statement needed a PAST::Op node to
represent the use operator with a child PAST::Val
node to represent the name of the module to load.

Here’s a fun piece of magic: whatever other rule invoked this
transformation will splice the PAST::Op node returned from
this rule into the final PAST automatically. If you’ve ever had to rethread
a syntax or operator tree on your own, you may appreciate this.

The code was remarkably easy, though again my experience made this
easier than if this were my first attempt:



use_statement:
.local pmc name
name = $P0['version';'ident']

.local string name_string
name_string = name

if name_string == 'v6' goto use_pragma
if name_string == 'lib' goto use_pragma

.local pmc use_op
use_op = new 'PAST::Op'
use_op.'init'('node' = $P0, 'name' = 'use')

.local pmc module_name
module_name = new 'PAST::Val'
module_name.'init'('node' = $P0, 'vtype' = '.Perl6Str', 'name' = name, 'ctype' = 's~')
use_op.'push'(module_name)

.return (use_op)



This code grabs the value of the version (from its
contained ident; this is a fixable wart in the grammar),
converts that from a PMC to a native Parrot string, and then compares the
result against two hard-coded cases. (Only the v6 case should
survive past the near future.)

Everything else represents a genuine Perl module to load.

The rest of the code creates a PAST::Op object, where the
important attribute is name–to represent a use
operation, and a PAST::Val object which represents a Perl6Str
PMC representing a string. (This is the only spot that gave me trouble; I
had to guess at what 'ctype' = 's~' signified, but I have
confidence that it’s accurate.)

After attaching the PAST::Val as a child of the
PAST::Op with push(), the code returns the
PAST::Op. That’s all it takes to add support in the compiler.
Subsequent transformations (from PAST to POST and from POST to PIR) are all
free; the third transformer knows how to handle PAST::Op nodes
already.

Adding a Built-In

Of course, that didn’t actually define the use
operator, merely made it callable from Perl 6 programs. Builtins are PIR
subroutines in the src/builtins/*.pir files. I chose
src/builtins/io.pir as a likely candidate for two new operators:



.sub 'use'
.param pmc module

.local string module_string
module_string = module

.local pmc path
path = split '::', module_string

.local string file_string
file_string = join '/', path

.local pmc filename
filename = new .Perl6Str
filename = file_string
filename .= '.pm'

require(filename)
.end



use takes the name of a module and converts it into
filename, represented as a a Perl 6-style string. Then it calls the
require operator.



.sub 'require'
.param pmc filename

.local pmc p6compiler
p6compiler = compreg 'Perl6'
p6compiler.'evalfiles'(filename)
.end



require is a lot shorter, mostly because it cheats. I wrote
earlier that the Perl 6 compiler extends HLLCompiler to add a
few features. One of those features is registering itself as the
Perl6 compiler with Parrot. This allows require
to grab the Perl 6 compiler object from the compiler registry, then call
its evalfiles() method on the passed filename.

That merely starts the compilation process over on the named file.

Conclusion

This isn’t the final implementation of either use or
require. In particular, use doesn’t call any
import() method on the required module, nor does
require respect any include paths or perform any caching to
avoid re-loading unchanged files.

However, it took more time to write this description than to write this
code and make it work. Though as of the current Parrot revision (r18935),
the test still isn’t passing (because the compiler needs a few more grammar
rules to parse all of Test.pm properly), a small amount of work
added a new feature to Perl 6 on Parrot that brought bootstrapping one step
closer.

Perhaps even better, a fuller Perl 6 implementation on Parrot will make
writing compilers even easier, as you can use Perl 6 to write your
transformation rules instead of PIR.



Updated: Wed Jun 13 23:55:04 2007


OrderWeb Software CC
Contact Us