Slashdot Mirror


User: thoughtstream

thoughtstream's activity in the archive.

Stories
0
Comments
17
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 17

  1. Re:Can you say "invented"? on HP's Crossbar Latch... Next-Gen Transistor? · · Score: 1

    Sheesh, I thought everybody knew that the aliens' sound system used semi-conductors, whilst the rest of the ship ran on quantum gates. Ask any galactic audiophile: transistors produce a much warmer, fuller, more glowing sound that's totally superior to the harsh tonal coloration and muddy bass you get with cross-bar latches!

  2. Re:A guy walks into his coworker's office.... on Exegesis 7 Released (Perl 6 Text Formatting) · · Score: 2, Informative

    I seriously doubt that the task..Takes text on standard input, outputs word frequency counts sorted first by count, then alphabetically. ..can be handled with 5 lines and with equal clarity.
    while (readline STDIN) {
    for my $word (split) { $freq{lc $word}++ }
    }
    my @sorted = sort { $freq{$b} <=> $freq{$a} || $a cmp $b } keys %freq;
    for my $word (@sorted) {
    print "$word: $freq{$word}\n"
    }
    And in Perl 6 you could write almost exactly same thing:
    while (readline $STDIN) {
    for split -> $word { %freq{lc $word}++ }
    }
    my @sorted = sort { %freq{$^b} <=> %freq{$^a} || $^a cmp $^b } keys %freq;
    for @sorted -> $word {
    print "$word: %freq{$word}\n"
    }
    Or (since we're notionally talking about Perl 6 formatting here) in Perl 6 you could also write it more idiomatically as:
    slurp $STDIN ==> split ==> @words;
    for @words { %freq{lc $^word}++ }
    @sorted = sort %freq: by=>[ {.key} is descending, {.value} ];
    print form "{]]{6}]]}: {[[{60}[[}", @sorted>>.value, @sorted>>.key;
    and have your output prettified as well.
  3. Re:Simple... it's antiwater on Water Flows Uphill · · Score: 1
    The water flows up the ramp and down the side of it into a collection pool, where it procedes up the next ramp. If Hoover-man was using anti-time, wouldn't the waterfall part of this contraption also travel from the collection pool to the top of the glass triangles?
    But that's the genius of the system. Those ramps look to be about 1 metre long and angled at about 20 degrees. Ignoring friction (non-trivial I admit, since later tends to be a drag), that means the water experiences a retrochronic gravitational acceleration of around 3.35 m/s^2. This acceleration is (in our synchronic frame of reference) vectored laterally upwards along the ramp. So by the time the water flows to the top of the ramp, it's travelling at around 2.5 m/s. The resulting linear mutnemom is sufficient to launch it off the lip, out of contact with the later, and back into normal time. At which point it finds itself with no visible means of support (a condition referred to by kinematics boffins as canis latrans ad photomachinam spectat maeste) and simply falls into the next pool.
  4. Re:Simple... it's antiwater on Water Flows Uphill · · Score: 5, Funny
    Close, but no cigar. The clue is in the article, where it's explained that a "thin later of water" is used.

    In other words, he's using anti-time! By covering the ramps with a thin coating of later (rather than the usual layers of earlier that surround most objects) the water actually flows backwards in time. This, of course, causes its normal downhill motion under gravity to occur retrotemporally, giving the fluid the appearance of syntemporal uphill motion.

    Contratemporal epitaxy, eh? I tell you, that Dyson's a genius!

  5. Re:Perl is a Write-Only language on Perl 6: Apocalypse 6 Released · · Score: 3, Insightful

    The proposed solution doesn't deal with maintainability. It only addresses project organization.


    Huh? The only way to deal with maintainability is via project organization.

    Even the most B&D, only-one-way-to-do-it language will permit obfuscated programming. The simplest way is by the (in)judicious use of De Morgan's laws on conditionals. For the more advanced obfuscator, just write a "subtract and branch if negative" function and code the entire algorithm using nothing but that. Every programming language, no matter how strict, provides an unlimited range of choices -- of identifiers, of data structures, of algorithms.

    Coding is fundamentally about making such choices, and syntax is just the very lowest level at which they can be made. Human beings make (and disagree on) these choices, which inevitably means that maintainability is a social issue, not a technical one. So technical fixes alone can never solve the problem.

    What we're proposing instead is a tool that can support in the necessary social processes by allowing you to reward adherence to, and punish transgressions of, your preferred syntactic style. But that's still ultimately a social solution because you have to convince your team to use the tool in the first place and ensure that they don't quietly turn it off when you're not watching.

    And it still won't address the problem of getting them to choose meaningful variable names, or a sane data structure, or an algorithm that mortals can understand. No tool -- except possibly a big stick -- will do that.

    Of course, we are also offering a complete parser for Perl, written in Perl. So if you do want to grab the parse tree of a program and reformat it (applying whatever artificially intelligent refactoring you can muster), the necessary support structures for that will be there too.
  6. Re:Perl is a Write-Only language on Perl 6: Apocalypse 6 Released · · Score: 4, Informative
    That's exactly why we made it possible to modify Perl 6's grammar. As paradoxical as it sounds, adding that flexibility gives us a way of overcoming the downsides of Perl's TMTOWTDI philosophy.

    It will be comparatively simply for a coding team to create a "policy" module (say, Policy/Our/Preferred/Style.pm) that restricts coders to an agreed-upon subset of the language's syntax and features. Thereafter, so long as every module begins with use Policy::Our::Preferred::Style, the rest of the module simply won't compile unless it conforms to the team's coding standards.

    And I suspect that enough groups will want to do this that it will make sense for someone to write a front-end module that simplifies the creation of such policies. So all your team will need to write will be something like:
    module Policy::Our::Preferred::Style;

    use Policy::Specification
    blocks => 'K&R',
    elses => 'cuddled',
    disallow => << unless until statement_modifiers junctions>>,
    # etc.
    ;
  7. Re:20-odd pages... on Perl 6: Apocalypse 6 Released · · Score: 2, Informative
    # Perl 6 code

    for @list.kv -> $index, $elem {
    # do something with $elem
    # do something with $index
    }
  8. Two more worth seeing on Seeking Interesting Sites When Travelling the World? · · Score: 1

    USAF Museum in Dayton Ohio.

    Arecibo observatory in Puerto Rico.

  9. Re:Sticking with Perl5 on Damian Conway Publishes Exegesis 5 · · Score: 1
    Perl6 is nothing close to Perl 5

    That is not an accurate assessment. As this article illustrates, many real-world Perl 5 programs will port to Perl 6 with little (and sometimes no) changes required.

    ...if you look at the code that Damian Conway is generating, it's nothing like perl 5...

    In Exegesis 5? Of course not. Because the Exegeses supposed to explain the Apocalypses, which are specifically about the differences between Perl 5 and Perl 6.

    When I'm writing code to illustrate the similarities between the two, then the Perl 6 code looks very much like Perl 5.

    The problem here is that you have a language being developed by a linguist, not a computer science guy.

    Actually, no. Perl 5 was the language that was developed by a linguist, not a computer science guy. Perl 6 is the language being developed by a linguist and a computer science guy (amongst others).

    The simple fact of the matter is, all of the grammar is changing.

    No it's not. Not even close. Something less than 20% of the grammar is changing.

    All of the keywords are changing.

    Again, simply not true. Not one of the following keywords is changing: for, while, if, unless, until, goto, BEGIN, END, INIT, CHECK, DESTROY, bless, caller, chomp, close, defined, delete, die, exists, exit, fork, getc, goto, grep, index, int, join, keys, kill, last, lc, lcfirst, length, lstat, m//, map, my, next, no, open, ord, pack, package, pipe, pop, pos, print, printf, push, q//, qq//, quotemeta, qw//, qx//, rand, redo, require, reset, return, reverse, rindex, s///, scalar, seek, shift, sleep, sort, splice, split, sprintf, sqrt, sub, system, tell, tr///, uc, ucfirst, undef, unpack, unshift, use, values, vec, wait, warn, y///.

    Those of us on the design team certainly understand that it can sometimes feel like Perl6 is nothing close to Perl 5, and like all the grammar and keywords are changing, and that the linguists are now running the asylum. But the reality is -- as usual -- considerably less fearsome, uncertain, or doubtful than our fears might lead us to believe.

  10. Re:Ask yourself... on The Perl Foundation Grants Are Running Out · · Score: 5, Informative

    For 18 months of Damian and half a year of Dan and Larry... what has been produced?

    I'll let Larry and Dan speak for themselves, but as for myself: in the eighteen months I was supported by the Perl community I produced the following...

    • Released 55 significant updates to 21 CPAN modules...
    • ...including 16 entirely new modules...
    • ...5 of which were subsequently considered important enough to be included in the Perl 5.8 core distribution;
    • Wrote four extended documents (Exegeses 2,3,4 and Synopsis 5) explaining the Perl 6 design;
    • Wrote a Perl Journal article on the practicalities of porting Perl 5 code to Perl 6;
    • Developed a 125 page alternative design for a future Perl (named Perl 5+i), much of which has fed back into the Perl 6 design process;
    • Wrote several articles for various Perl community channels like use.perl;
    • Added 88 discussion nodes to the Perl Monks website;
    • Posted 192 responses to messages posted on the comp.lang.perl.* newsgroups;
    • Replied to over 5000 Perl-related email messages;
    • Gave 167 hours of presentations on 56 Perl topics in 21 different cities in 9 countries on 4 continents.

    What finished products can we take back to our workplace and use?
    These, for a start...
    • Attribute::Handlers
    • Attribute::Handlers::Prospective
    • Attribute::Types
    • Class::Delegation
    • Filter::Simple
    • Getopt::Declare
    • Hook::LexWrap
    • Inline::Files
    • Lingua::EN Inflect
    • NEXT
    • Parse::RecDescent
    • Perl6::Currying
    • Perl6::Placeholders
    • Perl6::Variables
    • Regexp::Common
    • Switch
    • Text::Balanced
    • Text::Reform

    Mailing list traffic?
    Yes. That's where the community converses.

    Apocalypses/Exegeses?
    Yes. Designing Perl 6 was the main job we were asked to do.

    Acme::*?
    Sure. Play is where the community coheres.

    A lot of travel time...
    Yes. Too much. 28 weeks apart from my family. :-(
    ...and expenses?
    Surprisingly, not. Over 100,000 miles of travel and 200 nights of accommodation. All for about $50 a day and $0.20 per mile.

    Lectures given in far away cities...
    Yes, exotic remote places such as New York, London, Dallas/Fort Worth, Toronto, Chicago, Bonn, and Silicon Valley. ;-)
    ...to a few hundred perl hackers?
    Over 10,000 in total.

    Half a design for a language...
    Considerably more than half, I'd estimate. Most of the really hard bits, and quite a lot of the rest.
    ...nobody really begged for?
    Begged? No. Why should they beg?

    But hundreds of extraordinary individuals and organizations did collectively donate over $210,000 in the last 18 months to ensure that the work we were doing would continue. And donations more than doubled in the second 9 months of fund-raising.

    I had always assumed that was because the community approved of what we were doing.

    Damian
  11. Re:Quantum::Superpositions on Quantum Programming with Perl · · Score: 1
    Closer, but still not quite there. You want:

    $max = any(@values) >= all(@values);
  12. Re:Who is Dan Sugalski? on For Sale: 1 Damian Conway, 1 Dan Sugalski · · Score: 0, Offtopic
    terrible color scheme

    Try http://www.yetanother.org/damian/b+w/ instead.

    Same great taste; less moody. ;-)

  13. Re:Neat, but... on The Shakespeare Programming Language · · Score: 1

    How did you get Perl to accept the apostrophe as a letter, instead of treating it as a quote mark?

    Apart from being a string delimiter, apostrophe was also the package name separator in Perl 4 and has been kept on in that role (for backwards compatibility only) in Perl 5.

    That is, the following are synonyms in Perl 5:


    sub Phroggy's_Question { return "???" }

    sub Phroggy::s_Question { return "???" }


    So I could have used an apostrophe in any Perl identifier, so long as I didn't care which package the corresponding referent ended up belonging to.

    However, Klingon has a very different grammatical structure from Perl -- Klingon imperative verbs are RPN, whereas Perl subroutines use a prefix notation.

    So I needed to use a source filter to translate the grammatical structure. Since I was translating anyway, it was quite easy to include specific handling of glottal stop apostrophes as word characters.

    Of course, that also meant I couldn't use apostrophes as string delimiters. But that was okay, since I had already decided that the pach ("talon") and pachmey ("double talons") delimiters:


    <qo' nuqneH> yIghitlh!---> print 'qo\' nuqneH';

    <<qo' nuqneH>> yIghitlh!---> print "qo' nuqneH";


    were more in keeping with the Klingon mindset anyway ;-)

    Damian

  14. Re:Neat, but... on The Shakespeare Programming Language · · Score: 2, Interesting
    ...will there be a version letting one write in the original Klingon?

    Well...kinda. I demo'd the forthcoming Lingua::tlhInganHol::yIghun Perl module at YAPC::NA last June. It will hit the CPAN in a few weeks time.

    With it you'll be able to implement programs like Eratosthenes' well-known "Death Challenge for Primes" in the original Klingon:


    #! /usr/bin/perl

    use Lingua::tlhInganHol::yIghun;

    ###### mI'wa'DIchvaD 'eratoSHeneS HeghqaD #####

    <mI' tIn law': > yIghItlh!
    mI'tInwIj laDDaqvo'Hal yIlaD nob!
    mI'wa'DIchmeywIj cha' mI'tIn chen nob!
    {
    mI'wa'DIchmeyvaD { 'oH gheD chuv! } mI'wa'DIchmey tIwIv yInob!
    gheD <<\n>> ghItlh!
    } gheDvaD mI'wa'DIchmeyvaD yInIH yInob teHtaHvIS!


    Damian
  15. Re:yep, it's a good book on Data Munging with Perl · · Score: 5
    Like Chromatic, though, I really wished that the section on Parse::RecDescent had been longer...
    Be careful what you wish for...

    Next year I'll be writing a book about Parse::RecDescent (or its successor Parse::FastDescent) and grammatical parsing techniques.

    Damian

  16. Re:Great for the Perl community not for his studen on Perl Community To Buy Damian Conway? · · Score: 1
    Yeah, it's certainly my fault that, while teaching one semester of introductory programming in C, I was unable to simultaneously overcome the collective failure of 12 years of English teachers.

    I am ashamed to admit that I also failed to correct their poor dress sense, their ignorance of medieval history, and their inability to juggle.

    ;-)

    Damian

  17. Re:What are "worthwhile pursuits?" on Perl Community To Buy Damian Conway? · · Score: 1
    I hadn't wanted to comment (lest it seem like pan-handling), but this is an important issue...
    • I'm curious, though, how his work will be determined. The information at the link is fairly light, but it seems as if he will have free reign, making this is a beautiful thing. On the other hand, if the "sponsors" are simply paying to have their own agenda pushed, this doesn't feel so pure any more.
    If I were selling out to a "sponsor" you can be sure I'd be selling out for much more than $55K ;-)

    The deal is that I will have total freedom to work on whatever I think is worth doing. Currently that's looking like:

    • Improving those useful modules that people are already using (Parse::RecDescent and Text::Autoformat being the leading contenders);
    • Developing new useful modules (Regex::Common and Parse::Perl being the top priorities);
    • Developing new useless -- but fun -- modules (along the lines of Coy, Quantum::Superpositions, and Lingua::Romana::Perligata);
    • Giving talks at as many conferences and to as many Perl Mongers groups as I can reach;
    • Writing another book;
    • Helping with Perl 6 in whatever way I can;
    • Whatever other weird ideas come to me.

    To their great credit, none of the major companies that have offered to help fund this experiment has even mentioned the issue of "artistic control".

    But let me make it plain: no-one -- no matter how much they offer -- will get any say in what I do. Funding with strings attached will be politely but firmly declined (even if that means this venture doesn't happen at all).

    You have my word on it.

    Damian Conway