Where Can I Find Demo/Sample Code For Perl 6? - scripting

I've got myself a copy of Rakudo and I'd love to give it a test drive. After looking around the Internet I found some code snippets of cool Perl 6 stuff, but no complete scripts. Any sites that make practical Perl 6 scripts available would be appreciated.
Thanks guys, Ehtyar.

Please check out the perl6-examples repository from http://github.com/perl6/perl6-examples/tree/master, it contains many nice examples.
Also don't hesitate to join #perl6 or irc.freenode.net if you have any questions (or perl6-users#perl.org if you're more the email user).
Sometimes there are also very nice examples on the Perl 6 blogs out there, most of them are collected on http://pl6anet.org.
See also Perl 6 examples on Rosetta Code.

This page at the Perl foundation covers new features very well. Specifically "The Long Perl 6 Super-Feature List" (Which isn't actually very long, it explains what new features will be coming in bullet points). If you are specifically looking for new features only, that is the place to look as opposed to sifting through mounds of sample code and dissecting new features.
There are some good smaller examples on this page that will demonstrate new features without an elaborate amount of code.

A great place for other perl6 stuff is the Perlgeek blog; there are several articles and examples there, including a functional grammar for JSON parsing...very cool.

As Robert mentioned, the Perlgeek blog has some great articles. I've written a couple articles myself, but they mostly cover specific things of Perl 6 (classes, methods, etc).
You can look at the Using Perl 6 book, which is freely available as a pdf here. It has lots of code examples for the concepts and features it covers. The book is also available in the docs directory of the latest Rakudo * release.
Also, I'd recommend looking through the spec tests. If you have Rakudo * installed they should be in rakudo/t/spec. They are organized by the synopsis, which can be a little confusing. However, the benefit from looking through them is great, you'll get a chance to see multiple examples of how to use concepts in Perl 6 that you know work in your current build because you can run the test.

Resources I think helpful at the time of writing this comment (June 2015), listed from most to least QA'd:
examples.perl6.org.
Short one liners article.
Perl 6 advent calendars.
jnthn's talks eg "Perl 6: what can you do today?". Good resource for examples of concurrency.
Perl 6 entries at Rosetta Code. Many of these are written by Larry Wall.
Modules on modules.perl6.org.
Perl6Maven. Contains snippets and a long, incomplete, partly bitrotted P6 tutorial, but the site's owner (Gabor Szabgab) has said he intends to build out his P6 content this year (2015) so it's worth at least a quick visit.

Related

Resources for beginners to develop with Zope 2

I'm planning to write an application using Zope2; it's not going to be a CMS-ish application but let's say it's a rudimentary "accounting and finance" application. From what I could understand so far (mostly by reading Zope 2 Book), this is not an “instance-space” application and should be written in “Python packages” form.
I've been searching the net for many hours to find a tutorial or a guide on how to start such a project with no luck. What I need, basically, is:
How to create the initial structure of the project? I'm looking for some tool equivalent to grokproject for Zope2.
A very simple example application so I can understand how things are put together. I have absolutely no idea about this and I couldn't find any reference to this topic in Zope 2 Book.
I've already checked Zope 2 Wiki, which hardly looks like a wiki BTW :-), but couldn't find anything useful for my case.
So I'd really appreciate if you could share anything useful in this regard with me.
TIA,
The following, though bumpy, got me started:
Zope 2 Developer's Guide
Zope 2 Book
ZopeSkel for project creationg and doing the initial boilerplate
Zope-ers' priceless help on StackOverflow :-)
Not sure if I should recommend it but reading other products' code (specially SilvaForum and OFS.Folder) really helped me clear thing up in my mind.

Are there tools for branch-level test coverage tracking for Pharo/Squeak?

I am looking for something that could visualize code coverage on the branch/statement level.
My understanding is that the test coverage tool provide by the test runner in Pharo and Squeak only tell me which methods haven't been called.
I also had a look at Hapao. First I found that the linked image was rather old, but even after loading the latest version into a fresh image, I still had the feeling that it provides me with a lot information that is not immediately helpful to answer my questions.
From the C world, I am used to things like gcov and lcov, where I can see immediately which branches haven't been covered.
Is there something similar available in the Pharo or Squeak universe?
Reading a recent thread on the Pharo mailing list gives me the impression: 'not yet'?
I know there is branch level code coverage in VisualWorks extensions (found in Cincom public store)
SUnitToo(verage)
http://www.cincomsmalltalk.com/publicRepository/SUnitToo(verage).html
SUnitToo(lsoverage)
similar address (I'm SO noob, and can't post more than 2 links)
See this blog too http://www.cincomsmalltalk.com/userblogs/mls/blogView?entry=3346628542
I don't know the license, nor if it would be easily portable though...
Stefan Reichhart implements and describes various cool tools to improve test quality in his master thesis. The tool Christo (described in Appendix B) provided sub-method level test-coverage and visualized coverage in the browsers. Unfortunately the code is unlikely to work in more recent Squeak/Pharo images, as it builds on top of libraries that got lost over the years (NewCompiler and ByteSurgeon).

What Doxygen alternative would Dave DeLong use?

Yesterday, Dave DeLong answered a question of mine. It wasn't the answer I was looking for, but in the question he mentioned an alternative way of generating doxygen-style documentation for Objective-C.
Before I could really look into it, someone (maybe Dave himself) noticed the answer didn't match the question that well and removed it. *poof* gone was the link to that documentation tool.
I can't remember the name, but I'm fairly certain it's neither HeaderDoc nor Doxygen itself.
Dave, you out there? What was that link again?
I'm clearly not Dave DeLong, but I'd use appledoc, it's pretty darn awesome!
Developer Page quote:
appledoc is command line tool that helps Objective-C developers generate
Apple-like source code documentation
from specially formatted source code
comments. It's designed to take as
readable source code comments as
possible for the input and use
comments as well as surrounding source
code to generate visually appealing
documentation in the form of HTML as
well as fully indexed and browsable
Xcode documentation set. Although
there are several tools that can
create HTML documentation for
Objective-C, all of those know to me
fall short in meeting the minimum of
goals described below.
Human readable source code appledoc is designed to keep source
code comments as readable as possible
even within your source code editor.
Cross references to objects and members Creating cross references to
classes, categories or protocols is
straightforward and automated as much
as possible.
Apple-like source code HTML documentation Generate appealing
HTML documentation with the same style
as Apple's.
Xcode documentation set creation Generate and install fully indexed and
browsable Xcode documentation sets.
Documentation set can also be
automatically installed to Xcode.
Single tool from sorce code to doc set Single tool to drive generation
from source code parsing to
documentation set installation
Easily customizable output appledoc gives you a lot of command
line switches so you can parameterize
output. If this is not enough, you can
change any or all of the template
files to suit your needs.
100% Objective-C implementation The whole appledoc is written in
Objective-C, so you can easily change
it using familiar language and tools.
This also make debugging much simpler
and effective.

Any tools to check for duplicate VB.NET code?

I wish to get a quick feeling for how much “copy and paste” coding we have, there are many tools for C# / Java to check for this type of thing. Are there any such tools that work well with VB.NET?
(I have seen what looks like lots of repeated code, but wish to get some number to help me make a case for sorting it out)
Update on progress.
I have just tried Simian.
It does not seem to be able to produce a nicely formatted report I can sent by email
It does not cope when the names of local variables, or parameters etc may have been changed, e.g it just matches on lines of text being the same.
Clone Doctor does not support VB.NET (only C# and VB 6 and lot of other)
October 2010: VB.net added to langauges supported by CloneDR
Clone Detective for Visual Studio only supports C#
SolidSDD - Source Code Duplication Detector only supports C, C++, C# and Java
DuplicateFinder is open source, but otherwise looks very match like Simian, e.g it just works on lines of text
ConQAT - Continuous Quality Assessment Toolkit seems to have a clone detector that works for VB.NET (not tried it yet)
Gendarme is a bit like FXCop and has a AvoidCodeDuplicatedInSameClassRule rule, this looks very promising, as it avoids the problem of working at the text level. Just tried it, it is the best solution so far, pity it does not search with a greater scope.
Before claiming that this question is a duplicate, please check that the other question addresses VB.NET, as a lot of tools that work well for C# don't work so well for VB.NET. (However it would not surprise me if this question is a real duplicate)
CodeRush 11.2 introduced a new feature called Duplicate Detection and Consolidation (DDC)
http://community.devexpress.com/blogs/markmiller/archive/2011/11/29/duplicate-detection-and-consolidation-in-coderush-for-visual-studio.aspx
Make sure to check out the options for it as well, as you can have it run when so many lines are changed, certainly time has passed, etc.
They've posted some decent videos on the DevExpress site too.
Simian: http://www.redhillconsulting.com.au/products/simian/
[I'm the author of CloneDR ("Clone Doctor").]
CloneDR is parameterized by a full grammar for the programming language in question. So it doesn't just match lines. Rather, it can find clones which are syntactically well-formed, with variations that are more than just identifier changes, regardless of where they stop or start in a line.
The engine on which CloneDR rests, The DMS Software Reengineering Toolkit" is a tool for analyzing large scale systems in any programming language, and uses language descriptions to drive the analysis. DMS has a wide variety of language front ends already available.
Presently it has VBScript and VB6 (as dialects of "Visual Basic"). It doesn't have VB.net, but that would be pretty straightforward to do given the DMS infrastructure and our experience with lots of other languages.
So, CloneDR could do this just fine, with a small bit of effort on our part.
EDIT October 2010: VB.net added as a language CloneDR can process.
Atomiq supports vb.net amongst other languages, and the results are nicely presented.
JetBrains published console tool set Resharper Console Tools to run duplication analysis. Once installed it allows you to do the same analysis as TeamCity does and generate duplicates report locally and even include duplicates search into custom build process with MSBuild. This tool does exactly what you need. More details you can find here at JetBrains blog post
Try Simian:
Simian (Similarity Analyser) identifies duplication in Java, C#, C, C++, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files.
I once saw an impressive demo of Pattern Insight; its CP Miner may be what you’re looking for: http://patterninsight.com/products/cp-miner.php. It seems to be language-independent, though I couldn’t find anything explicit about languages other than C/C++.
Roll up your sleeves and write your own parser to use it with CPD?
See the question for the tools I found.

Is there any Subtext IDE or equivalent Example-driven Visual Programming Language/Interface published on the Internet?

I'm really excited about this new and experimental language named Subtext. But it's author haven't released nothing about it besides some papers and videos. Should I clone it? There are similar alternatives?
UPDATE I'm looking for an example-driven VPL, not just a VPL.
As Edwards' says in his related work section, the Self programming language is very similar. It shares subtext's emphsis on directness, uniformity, and liveness, but doesn't emphasize a tabular format (Schematic tables).
A lot of of work went into the Solaris version:
http://research.sun.com/self/papers/papers.html
seems there's a Mac & linux version, not sure how mature it is:
http://selflanguage.org/
Here's a video demo'ing Self, where they emphasize directness, uniformity, and liveness:
http://www.smalltalk.org.br/movies/
When you say "any VPL", do you mean none at all, or not a run-of-the-mill one? From the wording of the title question, I'll assume the latter. Here're a couple with some serious programming theory behind them:
Morphic is/was a/the UI piece of Self, and is now ported to Squeak:
http://wiki.squeak.org/squeak/2139
Prograph was a way-cool system, but I don't know of an available version.
A bit further out there is Kahn's Toontalk, based on Pictorial Janus:
http://www.toontalk.com/
I am sure you are aware of VPL On Wikipedia that lists many different VPL languages. You have not supplied information on what you are trying to achieve but another site is Synopsis. This is a commercial product.
From their website:
Synopsis is a completely visual RAD tool for Windows that frees you from having to write textual code and learning unnecesary programming details. With Synopsis you can concentrate on creating software instead of wrestling with mundane and complex low-level development tasks.
The image below shows how this application looks:
(source: codemorphis.com)
Granted my knowledge on this subject is limited and I do follow this to see if something really powerful can be created. I did see a project on CodeProject or CodePlex that was written in C# that allowed VPL but I cant find that URL.
If I ever do find that application I will edit this post!
You haven't provided more information about features you expect from such a VPL environment, but I think that "Tersus" could be interesting thing to look at. There're many VPLs, but mainly they're targeted as educational tools or addition to particular technologies (i.e VPL for Microsoft Robotics Studio) to simplify common tasks programming. The "Tersus" is full blown application development platform. It's open source and free to download for many OSes.
http://www.tersus.com
Coherence — The Director’s Cut
The Coherence home page is up at http://coherence-lang.org. The submitted version of the paper is there, with a new intro and a surprise ending.
Coherence claims to be an experimental programming language, a continuation of Subtext using other means.
Intentional shipped, but they are still kind of alpha, with limited distribution and testing. You can make example driven DSLs, but I don't know if the environment itself works that way.
http://lambda-the-ultimate.org/node/3287
You could look at the work on eve that is happening too:
http://incidentalcomplexity.com/