Git Product home page Git Product logo

kiama's Introduction

1. Kiama

Kiama is a Scala library for language processing.  In the Kiama project we are
investigating embedding of language processing formalisms such as grammars,
parsers, rewriters and analysers into general-purpose programming languages.

IMPORTANT NOTE: Kiama is a research project, it's early days and the code is
undergoing heavy development, so many details will change.  Consult with us
before you rely on it for serious work.  We make no guarantees about the
features or performance of the Kiama library if you do choose to use it.

Tony Sloane

Programming Languages Research Group
Department of Computing, Macquarie University

[email protected]
[email protected]

http://plrg.science.mq.edu.au/

2. The Kiama project site at Google code

Information about how to build, install and use Kiama can be found on
the Kiama project site:

http://kiama.googlecode.com

3. Documentation and mailing lists

The main documentation for Kiama takes the form of wiki pages
covering library features and examples, available at the Google
Code site.  The User Manual page is a good place to start:

    http://code.google.com/p/kiama/wiki/UserManual

For summary information about Kiama releases, including dependencies
on other software and links to API documentation, see the Releases
wiki page:

    http://code.google.com/p/kiama/wiki/Releases
    
Installation instructions can be found here:

    http://code.google.com/p/kiama/wiki/Installation

There are also two Google Groups for Kiama:

kiama           General announcements and discussions
                http://groups.google.com/group/kiama
                [email protected]
            
kiama-commit    Commit messages and Hudson build problems
                http://groups.google.com/group/kiama-commit
                [email protected]

4. Acknowledgements

The Kiama Project team is:

Tony Sloane
Dominic Verity
Matthew Roberts

Other contributors have been:

Lennart Kats (particularly in attribution)
Ben Mockler (the first version of the Oberon-0 example)

Kiama is currently concentrating on incorporating existing language processing
formalisms, so credit goes to the original developers of those formalisms.  See
the code for details of the sources of ideas that come from elsewhere.

Many of the library rewriting strategies are based on the Stratego library.
See http://releases.strategoxt.org/docs/api/libstratego-lib/stable/docs/.

5. Licensing

Kiama is distributed under the GNU Lesser General Public License.  See the files
COPYING and COPYING.LESSER for details of these licenses.  More information can
be found at http://www.gnu.org/licenses/.

kiama's People

Contributors

inkytonik avatar lennartcl avatar

kiama's Issues

Use copy methods on case classes for cloning

In the rewriting module we use a home-grown technique for creating a clone of a 
term with some 
or all of the children changed.  It should be possible to use the new Scala 
2.8.0 copy methods for 
case classes to achieve this in a more standard fashion.

Original issue reported on code.google.com by inkytonik on 2 Jun 2009 at 12:38

Refactor test support

Move the test utility functions like expect, isFail etc into the util package 
from the test module and 
avoid duplication in multiple places.

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:25

Integrate with Rats! front-ends

For many purposes combinator-based parsers are not ideal since details like 
tree construction need 
to be specified manually.  Hence, we want to also support some methods for 
getting tree data into 
Kiama  code using generated parsers.  Rats! seems like a good choice since it 
has the expressibility 
of parsing expression grammars plus good facilities for modular grammars.

The current Rats! generates Java parsers which we can call from Scala, but 
difficulties are created if 
we want to build Scala trees.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 4:55

Support rewrites on non-Products

Work up an example for this and see what happens.  I think the idea is that you 
need to provide the 
Product interface on your non-Product classes and then everything is OK.


Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:26

Add framework for input/output testing of compiled programs

We already have test that can check that a processor produces the right output 
when given a 
particular input. We also need the next step.  For examples where the input is 
processed to an 
executable form, we also need tests that run the compiled program on inputs and 
make sure that 
the outputs are correct.  This would be used in the Oberon0 and ISWIM examples.

Original issue reported on code.google.com by inkytonik on 4 May 2010 at 12:12

Look into identity hash set for circular attributes

At the moment we use an identity hash map to Unit, but could probably subclass 
the hash sets or 
something with an identity comparison.

This is also now relevant for uncached based attributes which need an identity 
set to detect 
circularity but are currently using a hashmap.

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:55

Add support for congruences

Congruences in Stratego allow you to write things like App (d, e) to pattern 
match on App's, apply d 
to the first component and e to the second component, failing if either d or e 
fail.

Add a generic congruence combinator that gets us as far as we can to having 
this notation for 
Kiama.

Original issue reported on code.google.com by inkytonik on 17 Nov 2009 at 2:20

Switch to sbt for building

Replace dodgy ant-based build process with one using sbt

Original issue reported on code.google.com by inkytonik on 15 Sep 2009 at 3:45

Finish lambda2 example

The current lambda2 implements some of the strategies in 

Dolstra, E., and Visser, E. Building interpreters with rewriting strategies. In 
Proceedings of the 2nd 
Workshop on Language Descriptions, Tools and Applications (2002), vol. 65 of 
Electronic Notes in 
Theoretical Computer Science, pp. 57โ€“76.

but we would like to do them all.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 4:14

Finish TIL chairmarks

http://www.program-transformation.org/Sts/TILChairmarks

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:28

Rename rewriting failure to fail

We originally used failure because Stratego's fail clashed with JUnit's fail.  
But failure clashes with 
the Scala parser library's failure, which is used more in this kind of code. 
So, since we don't really 
use JUint's fail and we are moving away from direct use of  JUnit hopefully, 
switch back to fail.

Original issue reported on code.google.com by inkytonik on 17 Nov 2009 at 4:52

Add example 8 from Uniplate paper to tests

Generate list of all expressions obtained by incrementing or decrementing any 
single literal in an 
original expression.

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:40

Do a basic performance analysis

Just try to see if there are any obvious bottlenecks on the example code. Can 
we use something like 
VisualVM?

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:24

Finish the abstract state machine library

Much of this is working and is ready to go, but we are writing larger specs 
using it to test the library 
in real applications.  Some enhancements are pending the results of that work. 
We also need to 
write some documentation.

Original issue reported on code.google.com by inkytonik on 18 Jan 2010 at 11:38

Replace parsing module with Scala packrat parsing module

There is no need for Kiama to have a packrat parsing library when the standard 
Scala library has 
one, so remove our version and move the tests over to use the new one. Note any 
capabilities that 
are lacking and report to Scala team.

Original issue reported on code.google.com by inkytonik on 2 Jun 2009 at 12:28

Review debugging traces in rewriting module

We have some tracing code that can be enabled in the rewriting module, but it's 
not everywhere it 
probably should be.  Do we really need it?  How much is it slowing us down?


Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:19

Publish release 1.0

Do de do

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 4:57

Add support for collection attributes

For example, see the following for an idea of the kind of feature we want.

Boyland, J. T. Descriptional Composition of Compiler Components. PhD thesis, 
University of Cali- 
fornia, Berkeley, Sept. 1996. Available as technical report UCB//CSD-96-916.

Magnusson, E., Ekman, T., and Hedin, G. Extending attribute grammars with 
collection attributes - 
evaluation and applications. In Proceedings of the Seventh IEEE International 
Working Conference on 
Source Code Analysis and Manipulation (2007), IEEE Press.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 2:55

Make Eclipse classpath refer to lib_managed dir

At the moment the classpath refers to each of the JARs in lib_managed, but this 
is fragile since the 
exact jars in there will vary depending on the transitive dependencies of the 
libraries that we use 
directly.  If possible, make the .classpath file just refer to the directory so 
we don't have to update it 
all the time.


Original issue reported on code.google.com by inkytonik on 24 Nov 2009 at 2:30

Add support for ATerms

For some projects we would like to be able to process trees that come from 
tools such as SDF. This requires us to be able to do rewrites etc on ATerms.  
At present we are looking at a typed implementation that translates a signature 
in Scala case classes and provides typed readers and writers for the ATerm 
representation.

Original issue reported on code.google.com by inkytonik on 21 Oct 2010 at 3:32

Abstract Attributable interface

At the moment if you want to use things like childAttr you need to make your 
tree nodes inherit 
from Attributable, which makes them Products etc.  A more flexible situation 
would be to make the 
interface needed by things like childAttr into an interface that has an 
implementation from 
Attributable if you are using Products, but you could define it yourself if you 
want.

Original issue reported on code.google.com by inkytonik on 10 Nov 2009 at 3:31

Add sbt-based instructions on running examples to wiki

Each example should have command(s) that show how to run the example in a built 
system.  We 
should update these to work in the new sbt world.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:29

More extensive testing of Oberon0 example

The Oberon0 example has only been lightly tested.  We should have a 
comprehensive test suite to 
make sure that more complex things like procedure calls, arrays, records are 
working.


Original issue reported on code.google.com by inkytonik on 12 Nov 2009 at 4:04

Port to Scala 2.8

Once 2.8 is out we need to port the library to it.  Apart from minor changes 
due to language 
updates, we expect work to be needed on collection-related code mostly.  Also, 
we plan at this 
point to remove the Kiama parsing library and switch over to use the Scala 2.8 
library since it will 
now also have packrat parsers.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 4:17

Please don't package examples in the main jar

What steps will reproduce the problem?
1. Build the project
2. Look at what's in the main jar :)

What is the expected output? What do you see instead?

The examples shouldn't be in the distributed jar; they have lots of classes 
that have similar or identical names to users' AST nodes.

What version of the product are you using? On what operating system?
1.0.0.a1 (trunk as of a couple days ago)

Original issue reported on code.google.com by alex%[email protected] on 14 Apr 2010 at 10:33

Reduce dependences on Attributable as much as possible

This seems to be the only thing in Attributable that is not related to 
structural properties.  Or to put 
it another way, if you are not using structural properties you only really want 
this from that module.  
So, we should put it in Attribution somewhere so that Attributable could be 
ignored in some cases.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:34

Add support for dynamic rewrite rules

Stratego's dynamic rewrite rules are ones that can be modified as the rewriting 
proceeds and are conventionally used to implement context-sensitive rewriters 
such as that needed for name analysis. We tend to implement these kinds of 
things using attribution because it is more natural, but we have some work that 
needs to do things in the Stratego way.

Original issue reported on code.google.com by inkytonik on 21 Oct 2010 at 3:44

Explore caching constructors in term duplication during rewriting

The dup method in the Rewriter uses reflection to find the primary constructor 
of a term class so 
that it can create a new term with the constructor but possibly different 
children. We could cache 
these which might usefully limit the amount of reflection that is done. Do some 
measurements to 
see if this helps in typical cases.  Is there some non-performance impacting 
way to make it 
optional?

Original issue reported on code.google.com by inkytonik on 11 Aug 2009 at 3:37

Add more attribute decorators

See 
http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-038.pdf 
for 
information on the kind of thing we plan to add.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 2:52

Make "main" task allow completion of main program object names

At the moment you have to specify the name of the main class exactly, whereas 
it would be nice to 
support completion as in the test-only command which completes over test 
classes.

Original issue reported on code.google.com by inkytonik on 2 May 2010 at 1:12

Complete nowhere present checks in uniplate tests

Add 'nowhere present' check, eg for DoubleNeg example, but others too, intadds 
is ok, do that for 
the others, also uniquevars should check for no duplicates in vars, or collect 
in list and check that 
they are sorted "var" ones.

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:39

Use proper top-level package

At the moment we have packages starting with "kiama", whereas it probably 
should be "org.kiama" 
or "com.googlecode.kiama" or something.

Original issue reported on code.google.com by inkytonik on 22 Nov 2009 at 2:09

Review use of objects vs traits

In some cases we use objects to encapsulate reusable code and import it where 
needed. In others 
we use traits and extend them to get the reuse. Both approaches usually work. 
The trait one results 
in different instances of the reused entities in each context where they trait 
is extended. We need to 
come up with a principled way of deciding which approach is appropriate for a 
given situation and 
apply it across Kiama.

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:34

Review Oberon-0 example

Check for correctness and ease of running on "real" programs

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:21

Add types to strategies

At present, rewriting strategies are untyped much as in Stratego.  We are 
prevented from 
constructing ill-typed terms by Scala's static typing, but there are currently 
no constraints on 
combinations of strategies.  Adding type parameters along the lines of function 
types should be 
possible.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:04

Add execution tests to the ISWIM example

Now that the testing framework can do execution tests, we should have some in 
the ISWIM 
example.  There are some coded up in tests/SECDTests.scala, but there should be 
some file-to-file 
ones as well.  See the Oberon0 ExecutionTests for examples of how to do this.

Original issue reported on code.google.com by inkytonik on 5 May 2010 at 12:51

Add readline-type support to REPLs

It would be nice to have command editing etc. Try JLine?

Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 10:00

Add proper positioning to some of the examples

Examples such as Oberon0 do not attach positions to AST nodes at present so all 
reports refer to 
0,0.  We should use positioned to correctly position all nodes.

Original issue reported on code.google.com by inkytonik on 5 May 2010 at 12:41

Publish release 0.9

The last release on Scala 2.7 with changes since 0.8.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 4:22

Replace junit-style tests with scalatest ones

To further reduce our dependencies, we should try to replace our plain tests 
that are written in 
JUint style with ScalaTest style ones.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:36

Review scaladoc

General tidy up

- make sure everything has something
- check markup on code refs in scaladoc
- use more complex markup, such as @param decls, @see links?

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:13

Explore using weak hashmaps for the attribute storage

Weak maps might help garbage collection performance. Since we must use an 
identity hash map, 
we need to find an implementation of a weak identity hash map.

This also needs to fix the ones in the circular attributes, including the sets 
computed and visited, 
which are maps at the moment.

From Lennart: Only the JCL provides a weak hash map implementation, and it 
doesn't allow 
overriding of the equality/hash key getting mechanism. So to use weak hash maps 
everywhere, 
we'd need an IdentityEquality wrapper object (similar to the ArgAttributeKey 
class). Of course, this 
would make all this even more expensive. Alternatively, a brand new 
IdentityWeakHashMap 
implementation could work.


Original issue reported on code.google.com by inkytonik on 14 Jun 2009 at 9:58

Add Obr example

We have an implementation of a compiler for a cut-down version of Obr that we 
use in teaching.  
We should consider adding it to the examples since it does full (albeit) simple 
semantic analysis and 
code generation for a real language.

Original issue reported on code.google.com by inkytonik on 6 Nov 2009 at 1:30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.