nim-wiki/GSoC-2014-Ideas.md

12 KiB

Introduction

Below is a list of project ideas for GSoC 2014. All these projects require familiarity with the Nimrod programming, or at minimum, experience with similar programming languages such as C, C#, Java, Python, etc.

Note - Any ideas to be added to this page must be placed in a relevant category, have a title, a line stating needed/preferred skills for the idea, and a summary of what the idea is.

Projects

Nimrod Compiler

Add support for full coroutines

Description:

  • Many programming languages, in particular Lua, offer coroutines as way to provide light-weight collaborative tasking. Nimrod supports "closure iterators" which are comparable to Python's generators to accomplish the same.
  • However closure iterators are much more limited as they cannot capture the call stack completely.
  • The best example to see the limitations of Nimrod's current way is that iterators cannot be recursive.

Here is a sketch of a possible implementation, but there are lots of other possibilities to implement full coroutines for Nimrod:

  • Implement the necessary stack switching via inline assembler.
  • The GC needs to support conservative marking of multiple stacks.
  • In particular the write barrier in the GC which does the 'isOnStack' check needs to be changed.
  • Using a bloom filter for quick testing whether an address belongs to some stack is likely to pay off.
  • Creating a coroutine needs to register a new stack to the GC.
  • Deleting a coroutine needs to unregister the stack to the GC.
  • Builtin 'yld' must save the current stack pointer so that the GC knows which part of the stack is really in use.

Difficulty: Hard

Mentor: Araq (@Araq)


Add a code generator for OpenCL

Skill Requirements: Good OpenCL knowledge, knowledge of the compiler internals, basics of type theory.

Difficulty: Hard

Mentor: Araq (@Araq)


Make Nimrod a viable research platform for Garbage Collection algorithms

Skill Requirements: Familiarity with the various GC approaches and algorithms, knowledge of the compiler codegen modules.

Most of the popular garbage collected languages of today require a separately distributed run-time environment, providing only a predetermined set of garbage collection algorithms. This leaves little room for experimentation with various approaches and condemns GC researchers to develop and test their algorithms on specialized platforms such as the Jikes RVM that have limited practical significance.

In contrast, in Nimrod, the garbage collection algorithm is chosen at compile-time and embedded in the resulting stand-alone native executable. This enables the users to pick a GC algorithm that's most suitable to their project and allows for a proliferation of GC algorithms, developed by independent groups and individuals, without requiring any modifications to be made to the standard Nimrod distribution.

The Nimrod code generator and type system can provide various GC roots marking strategies, various kinds of write/read barriers and all necessary static type information (e.g. static cycle analysis) and a GC implementation will consist only of a single Nimrod module (supplied as a command-line parameter) that provides configuration for the code generator and implements the logic of the garbage collection algorithm. This module will be compiled as C code with the rest of the program and it could be easily debugged using standard C/C++ debugging and profiling tools.

Tasks:

  • Add support for precise stack marking
  • Add support for read barriers and polish the support for Levanoni/Petrank style of write barriers
  • Implement the infrastructure for picking a user-supplied GC module

Bonus points: Implement simple forms of variety of GC algorithms as a proof-of-concept

Difficulty: Medium to Hard

Mentor: zahary (@zah)


Fix/Expand Nimrod's "Compiler as a Service" features

Skill Requirements: Command line argument parsing, good knowledge of compiler internals and theory.

Description:

  • Fix https://github.com/Araq/Nimrod/issues/804, which makes idetools unusable.
  • Provide commands to execute macros. Allow IDEs to quickly get the code macros generate with different inputs.
  • Allow the compiler to either track more than one project at a time, or not track any project at all.

Bonus points: Implement "Compiler as a Service" support to major IDEs/text editors such as Light Table, Sublime Text, or Visual Studio.

Difficulty: Medium to Hard

Mentor: zahary (@zah)


Allow bootstrap-time integration of the Nimrod executable with the standard library

Skill Requirements: Knowledge of file system api's, knowledge of compiler internals and theory.

Description:

  • Allow the nimrod bootstrap process to integrate the nimrod standard library source code and other associated resources into the nimrod binary, to be used by the nimrod binary when compiling source code. The included library modules should be overridable, either by a switch passed to the nimrod executable, or by placing an actual library file in a pre-determined path.

Difficulty: Medium

Mentor: zahary (@zah)

Standard Library

Implement a YAML parser library

Skill Requirements: Ability to write efficient parsers.

Description:

The Nimrod standard library currently lacks a YAML parsing module. This task requires you to read the YAML specification and to create a module which will be able to parse YAML data into an AST. Subsequently the parser can be used to create a high-level API to access the data.

Difficulty: Medium

Mentor: Araq (@Araq), dom96 (@dom96)


Enhance the filesystem monitoring module "fsmonitor.nim"

Skill Requirements: Knowledge of the Microsoft Windows api.

Description:

  • Allow the fsmonitor module to work on Microsoft Windows by using native api's to gather information about changes in monitored files and directories.
  • Revise the fsmonitor module api to decouple Unix/Linux file handle paradigms (such as using the poll method in in the sockets module) from the api, allowing easier implementations of multiple native backends.
  • Integrate the fsmonitor module's polling mechanism into the new asynchronous io modules.

Difficulty: Easy

Mentor: dom96 (@dom96)


Add a cross-platform stat()-like procedure to the operating system module "os.nim"

Skill Requirements: Knowledge of file system api's for Linux, MacOSX, or Microsoft Windows.

Description:

  • Implement a procedure which uses native stat-like calls on Linux, Mac, Windows, and other operating systems to gather detailed information about specific file system objects. Allow the bypassing of symlinks and hardlinks, where possible.

Difficulty: Easy

Mentor: dom96 (@dom96)


Enhance and expand standard library documentation

Skill Requirements: Basic writing and documentation skills, web design and infrastructure setup.

Description:

  • Ensure that documentation exists for all public methods and modules.
  • Create and design new CSS and HTML layouts for the documentation, to better fit with the main website.
  • Add search capabilities to the online documentation.
  • Add code examples to all modules and to a procedures (where appropriate).

Difficulty: Medium

Mentor: zahary (@zah)


Add documentation to the Nimrod compiler internals

Skill Requirements: Basic writing and documentation skills.

Description:

  • Add comments to the compiler internals, documenting the various mechanisms and mechanics the compiler uses to analyze and transform nimrod code to the code of the specified backend.

Difficulty: Medium

Mentor: Araq (@Araq), zahary (@zah)


Improve times module

Skill Requirements Knowledge of date time representations, native time api's.

Description:

  • Fix limitations to do with time intervals, specifically subtracting a TTimeInterval from a TTimeInfo.
  • Provide a $ for TTimeInterval. Goal is to be able to get timing info like "5 minutes ago".

Difficulty: Easy

Mentor: dom96 (@dom96)


Add an implementation of the ISAAC psuedorandom number generator

Skill Requirements: Pseudo-Random number generation theory, C programming.

Description:

Difficulty: Medium

Mentor: Araq (@Araq)


Wrap and test the Qt framework

Skill Requirements: Knowledge of C++. Experience with the Qt framework is desirable.

Description:

  • Wrap the Qt framework with the help of the c2nim tool, or otherwise.
  • Write tests which use the wrapper.

Bonus points: Write high-level bindings which provide an idiomatic Nimrod API on top of the wrapper.

Difficulty: Medium

Mentor: Araq (@Araq), zahary (@zah)


Wrap and test GTK3

Skill Requirements: Knowledge of C. Experience with the GTK+ is desirable.

Description:

  • Wrap GTK3 with the help of the c2nim tool, or otherwise.
  • Write tests which use the wrapper.

Bonus Points: Write high-level bindings which provide an idiomatic Nimrod API on top of the wrapper.

Difficulty: Medium

Mentor: dom96 (@dom96), Araq (@Araq)

Tools & Infrastructure

Nimbuild

Skill Requirements: JSON parsing, modular program construction, inter-process communication.

Description:

  • Reduce the number of assumptions the Nimrod builder makes about its host system, in order to reduce configuration restrictions. Assumptions include location and usage of external tools, such as git.
  • Implement benchmark tests in the builder and generate graphs showing the time taken to perform those benchmarks on the Nimbuild site. This can include bootstrap times, and test times too.
  • Generate images showing the status of the build to be shown in Nimrod's Github repo and/or Nimrod's website.
  • Improve the download tables on Nimbuild's homepage and generate embeddable download tables for the Nimrod website.

Difficulty: Medium

Mentor: dom96 (@dom96)


Babel

Skill Requirements: Knowledge of Git and other version control systems.

Description:

Babel is the Nimrod package manager. It is currently very basic and some important features are still missing. Babel packages are stored in user-controlled repositories with support for Git and Mercurial currently present.

Possible tasks:

  • Add support for other VCS' alongside Git and Mercurial.
  • Create a website which tracks packages similar to hackage, npm, the DUB registry etc.
  • Add support for the removal of packages.
  • Automate the package submission process.
  • Expand the babel tester to test more dependency scenarios.

Difficulty: Medium

Mentor: dom96 (@dom96)


Implement re2nim, a lexer generator for nimrod

Description:

  • Model it after re2c or the Ragel state machine generator
  • Alternatively model it after Flex.

Skill Requirements: Knowledge of lexer generators. How to translate regexes into DFAs and how to optimize the resulting automatons.

Difficulty: Medium to Hard

Mentor: zahary (@zah)


Implement a Nimrod backend for the Ragel state machine generator

Description:

Skill Requirements: Knowledge of Ragel's internals.

Difficulty: Medium

Mentor: zahary (@zah)